The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Update values of matrix

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
epp Posted - 06/08/2005 : 11:34:47 AM
Origin Version: 7.5Pro SR5 (v 7.5870)
Operating System: Windows XP Pro

I want to make an animated contour plot. For achieving this
I want to copy every 500 milliseconds a column of a matrix
onto a column of another matrix. The second matrix is plotted.

As a first step I wanted to check if the data is copied
correctly from the first matrix ("RawData") to the second
one ("AnimData"). But "AnimData" is refreshed only at the time,
when the code is finishing. Using REDRAW_REFRESH has no effect,
REDRAW_REALTIME_SCOPE causes Origin to crash (???).

Funnily enough displaying a MessageBox (commented out in
the source) does refresh the matrix "AnimData".

Does anybody have an idea?

void test()
{
int iMaxRow, iMaxCol;
int iActRow, iActCol;

Matrix mRawData("RawData");
Matrix mAnimData("AnimData");

MatrixObject moRawData("RawData", 0);
MatrixObject moAnimData("AnimData", 0);

if(!mRawData || !mAnimData || !moRawData || !moAnimData)
{
printf("Error! \n");
}

iMaxRow = moRawData.GetNumRows();
iMaxCol = moRawData.GetNumCols();

for (iActRow=0; iActRow<iMaxRow; iActRow++)
{
Sleep(500);

for (iActCol=0; iActCol<iMaxCol; iActCol++) mAnimData[1][iActCol] = mRawData[iActRow][iActCol];

printf ("still there!\n");

mAnimData.Update(FALSE, REDRAW_REFRESH);
// MessageBox(GetWindow(),"");
}
}
2   L A T E S T    R E P L I E S    (Newest First)
epp Posted - 06/09/2005 : 02:18:27 AM
Hi Mike,

thanks for the fast reply.

Using LT_execute("sec -p 0.5") does solve the problem.

Even if I don't understand as the following code for
waiting one second does not stop the whole program
but anyway has not the wished effect:

time(&StartWait);
time(&StopWait);
DiffTime = difftime(StopWait, StartWait);

while(DiffTime<1.0)
{
time(&StopWait);
DiffTime = difftime(StopWait, StartWait);
}
Mike Buess Posted - 06/08/2005 : 2:23:32 PM
I'm not sure that this will fix your problem but I suggest you use LT_execute("sec -p 0.5") instead of Sleep(500). Sleep() stops the entire program and might be preventing the update.

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000