Author |
Topic  |
|
epp
Germany
4 Posts |
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(),""); } } |
|
Mike Buess
USA
3037 Posts |
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 |
 |
|
epp
Germany
4 Posts |
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); } |
 |
|
|
Topic  |
|
|
|