Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29375 Discussions

QuickWin - Visualisation of a progress

onkelhotte
New Contributor II
930 Views
Hi there,

I want to visualise a progress in a QuickWin Window, something like the CPU progress when you view the Windows Task-Manager.

Right now I have a fixed X-Axis, for example from 0s to 100s. When the calculation reaches 100s, I delete the whole diagram, draw a new one where the X-Axis shows the timeframe 100sto 200s and so on. The disadvantage is, that you dont see the former values (in this case the last 100s).

A simple but inefficient way would be to store all Y Datas, delete the diagram and redraw them all.

Does anyone knows a trick how to do it better?

Thanks in advance,
Markus
0 Kudos
7 Replies
Jugoslav_Dujic
Valued Contributor II
930 Views
Quoting - onkelhotte
Hi there,

I want to visualise a progress in a QuickWin Window, something like the CPU progress when you view the Windows Task-Manager.

Right now I have a fixed X-Axis, for example from 0s to 100s. When the calculation reaches 100s, I delete the whole diagram, draw a new one where the X-Axis shows the timeframe 100sto 200s and so on. The disadvantage is, that you dont see the former values (in this case the last 100s).

A simple but inefficient way would be to store all Y Datas, delete the diagram and redraw them all.

Does anyone knows a trick how to do it better?

If your step is e.g. 5%, you can do a "cut and paste" (GETIMAGE/PUTIMAGE) of the image of the last (5-100%) of the diagram onto the (0-95%) position of the screen. Then, redraw only the last 5% of the diagram. In this way, user continuously sees the last window of the data. Task Manager CPU load diagram looks suspiciously like using that technique.
0 Kudos
bmchenry
New Contributor II
930 Views
it sounds likw what you want is to incrementally scale the diagram.
Meaning the initial scale is to 100, then once it > 100, simply rescale to 200, etc.
if you use background bitmap/swapping, then the transition is smooth (no 'clear' visible).

0 Kudos
Paul_Curtis
Valued Contributor I
930 Views
Quoting - Jugoslav Dujic

If your step is e.g. 5%, you can do a "cut and paste" (GETIMAGE/PUTIMAGE) of the image of the last (5-100%) of the diagram onto the (0-95%) position of the screen. Then, redraw only the last 5% of the diagram. In this way, user continuously sees the last window of the data. Task Manager CPU load diagram looks suspiciously like using that technique.

Even easier, take a look at the WinAPI function ScrollWindow, which can move screen content as a graphics-block in any direction by any number of pixels, so you only redraw whatever fraction you want.
0 Kudos
anthonyrichards
New Contributor III
930 Views
Quoting - bmchenry
it sounds likw what you want is to incrementally scale the diagram.
Meaning the initial scale is to 100, then once it > 100, simply rescale to 200, etc.
if you use background bitmap/swapping, then the transition is smooth (no 'clear' visible).


It sounds like you want to apply asliding100 second wide X-axis window on your data that is then plotted into a screen window of fixed dimensions. So save all your (X,Y) data then, when you want to replot, just change your scaling to select the new starting X-value for your data. Your upper X-value will be Xstartnew +100. Your plot window has fixed dimensions in pixels, so then determine the pixel co-ordinates for all your data points using the new scaling. e.g. Xpixelnumber = 0+ (Xvalue-Xstartnew)*windowXpixelwidth/100.

Any -ve pixel co-ordinates or Xpixelnumber values falling outside this windowXpixelwidth windowwill not matter, windows will automatically drop them if you try and draw to them. The main problem is plotting and replotting without getting flicker. You may find using windows API plotting better as then you can use a memory buffer to plot new data and then swap it onto the bitmap in the window device context.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
930 Views
Quoting - Paul Curtis

Even easier, take a look at the WinAPI function ScrollWindow, which can move screen content as a graphics-block in any direction by any number of pixels, so you only redraw whatever fraction you want.

I don't think that ScrollWindow will do the job in QuickWin context, because QuickWin has internal double-buffering. It will erase the effects of ScrollWindow as soon as the window gets a WM_PAINT.
0 Kudos
anthonyrichards
New Contributor III
930 Views
How about just subtracting a gradually increasing X-value from your X data values before you re-plot them?

0 Kudos
Paul_Curtis
Valued Contributor I
930 Views
Quoting - Jugoslav Dujic

I don't think that ScrollWindow will do the job in QuickWin context, because QuickWin has internal double-buffering. It will erase the effects of ScrollWindow as soon as the window gets a WM_PAINT.

Hmmm, interesting. Reason #762 to drop QuickWin and process your own message loops directly from Fortran.

Just think how much traffic in this forum is devoted to howto limitiations of QuickWin vs. full Win32. If only there were some way to harness that energy...
0 Kudos
Reply