Page 1 of 1
Macro Redraw Question
Posted: Thu Aug 09, 2007 11:37 pm
by jsc
David,
I thought I learned my lesson about redrawing, but is there one of these commands that forces a redraw even though I issued the postpone redraw command as the first step of the macro?
PostponeRedraw()
SelectCurve(1)
EditOperateY("(y-32)*5/9")
legend(1,"CJC00, °C")
SelectCurve(2)
EditOperateY("y-273.15")
legend(2,"AiCoInT, °C")
SelectCurve(3)
EditOperateY("(y-32)*5/9")
legend(3,"AiCoOuT, °C")
legend(4,"AiCoPIn, In H2O")
legend(5,"AiCoPou, Psi")
legend(6,"InMan, In H2O")
legend(7,"EngSpd, RPM")
SelectCurve(7)
MultipleYAxes(2,2,0)
ViewRedraw()
Seems like I'm getting redraws for all three of the EditOperateY commands.
Thanks.
Jon
Posted: Fri Aug 10, 2007 3:17 pm
by DPlotAdmin
Seems like I'm getting redraws for all three of the EditOperateY commands.
Yes. Will fix this one, too. Thanks again.
Posted: Mon Aug 20, 2007 8:29 pm
by jsc
David,
Not sure if 2.1.3.2 fixed the redraw. Was real noticable on my home machine as I was working on some somewhat large files (up to 7x200k). (Can't figure out these "new" chips. A 1.73 gHz Centrino Pentium M is faster than a 2.6 gHz Celeron? I guess. (1 gig vs. 750 mb memory))
Seems like after the EditOperate commands above still cause a redraw to flash by the screen. Is this correct behavior?
Jon
Posted: Mon Aug 20, 2007 9:20 pm
by DPlotAdmin
Seems like after the EditOperate commands above still cause a redraw to flash by the screen.
That's not what I'm getting, and I'm sure of it. Quick test: Generate>Y=f(X) with y=sin(pi*x), y=sin(2*pi*x) and y=sin(3*pi*x) with 0
<x
<4, dX=0.00001 (400,001 points in each curve).
This:
PostponeRedraw()
SelectCurve(1)
EditOperateY("y*2")
SelectCurve(2)
EditOperateY("y*3")
SelectCurve(3)
EditOperateY("y*4")
ViewRedraw()
results in the plot being redrawn only once. If I comment the PostponeRedraw line, I can clearly see it being redrawn 4 times (once for every EditOperateY and again with ViewRedraw).
It must be something else in your macro that's misbehaving. In the macro posted originally it also isn't the Legend or MultipleYAxes commands.
Posted: Mon Aug 20, 2007 9:51 pm
by jsc
I tried your test, and I can see that you're right. In my data and macro, I just saw the curve flash by the screen and thought it was actually redrawing - I see three flashes (3 EditOperate commands) go past the screen while it's working, and I see the "Drawing Graph" on the status line, so I thought it might have been ignoring the PostponeRedraw(). But if I turn Postpone redraw off, the macro crawls. So it was doing something!
Sorry to bother you! I'll go back to work now...
Jon
Posted: Mon Aug 20, 2007 10:49 pm
by DPlotAdmin
Sorry to bother you! I'll go back to work now...
I know you know this, but for anybody else that reads this thread: please don't worry about "bothering" me. You don't and won't.
And besides, I'm a little curious about "I see three flashes...". I don't, with the test I described. The screen goes blank, I see "Drawing Graph" in the status bar, followed by the final result being drawn. No flashing at all. With PostponeRedraw removed it's much different: I clearly see the plot being redrawn after every EditOperateY. This is on XP. I'd be surprised if there are differences in different Windows versions, but stranger things have happened. What version of Windows are you running?
Posted: Mon Aug 20, 2007 11:11 pm
by jsc
WinXP Pro on the laptop, Thinkpad T43 with Intel Graphic Extreme something for video. Home is WinXP Home on a no-nameish Micro Center brand with onboard S3 video.
My guess is that it has something to do with the video drivers, but it does act the same way on both machines - I get a brief flash of the graph after each EditOperate command. Not sure it is of a changed graph, but something flashes by.
Jon
Posted: Mon Aug 20, 2007 11:46 pm
by DPlotAdmin
Thanks. I'll try this out on several different systems with bigger and smaller data sets. It's possible there's some weird timing issue that forces a repaint. My guess, but it's only a guess, is that if this happens then all that's being done is the previously-existing bitmap of the graph is being redrawn, rather than the plot being redrawn from scratch. But I've been wrong before...