Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 Freeze a lineplot ?

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

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert 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 [?]

 
   

T O P I C    R E V I E W
Procentaren Posted - 25 Feb 2014 : 14:01:40
I have an application with a number of curves that are updated with processvalues.
Sometimes I wan't to freeze the update so the user can inspect the curves.
But the datacollection should still run.
The obvious way to achieve this is to stop calling updatedraw. And this works fine.
But the problem is that I also use the mouselistener to move an object (axis) in the graph.
And when the object is moved there seem to be an automatic update of the graph, and the curves are also updated then.
I can of course make som kind of buffer to store the processvalues during the time when the graph is frozen, and restore them later. But can someone think of a simpler way ?

Here is the setup for the curves
For I = 1 To NumberOfCurves
inputChannel(I) = New RTProcessVar("Ch #2", New ChartAttribute(Color.Green, 1.0, DashStyle.Solid, Color.Green))
scrollFrame1.AddProcessVar(inputChannel(I))

attrib(I) = New ChartAttribute(Trend(ATP).Kurvfarg(I), Trend(ATP).Tjocklek(I), DStyle(Trend(ATP).DashStyle(I)))

lineplot(I) = New SimpleLinePlot(pTransform1, Nothing, attrib(I))
lineplot(I).SetFastClipMode(ChartObj.FASTCLIP_X)

inputChannel(I).DatasetEnableUpdate = True
rtPlot(I) = New RTSimpleSingleValuePlot(pTransform1, lineplot(I), inputChannel(I))
chartVu.AddChartObject(rtPlot(I))
Next I


Here is the update of the curves
For I = 1 To NumberOfCurves
inputChannelValue(I) = GetCurrentValue(Trend(TrendNr).Sigtyp(I), Trend(TrendNr).Signummer(I), Trend(TrendNr).RegSigSpec(I))
inputChannel(I).SetCurrentValue(x, inputChannelValue(I))
Next I

3   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 26 Feb 2014 : 12:20:22
Yes, your disabling of the AutoTruncateDataset function is the correct thing to do, because the data is still coming in, and if you exceed the auto-truncate value, older data will be discarded from the display dataset. And if you freeze the graph for a long enough period, where you are looking at old data, that is the data which starts to get thrown away.
Procentaren Posted - 26 Feb 2014 : 12:01:40
Yes, disabling and enabling worked just as you described.
Now I can move the object in the graph without "destroying" the curves.
Thankyou for your help.

At first I had random phenomenas where parts of the curve disappeared every time I moved the object.
The reason for this was the AutoTruncateDataset function.
Setting this function to False while the graph is frozen, fixed that problem.

UserChartControl11.inputChannel(I).AutoTruncateDataset = False
quinncurtis Posted - 25 Feb 2014 : 15:06:40
If you move something, then the only way to update its position is to redraw the entire graph. In order to maintain the proper depth positioning (z-value) of every object in the graph in relation to each other, the entire graph needs to be redrawn, which by default includes every object in the graph. So that's the logic behind what's going on.

The RTScrollFrame is what rescales the coordinate system to the most recent data, so that is what would be changing the view of the data. If you disable it while when you want to freeze, that will freeze the change of the scale until RTScrollFrame is re-enabled. It won't prevent display updates, which will always take place when you move something, just the change of the scale and therefore your current view of the data. You may continue to see the waveform update until the waveform reaches the right edge of the current scale, but since the scale will not change until the RTScrollFrame is re-enabled, the waveform will not change after that.

scrollFrame.ChartObjEnable = ChartObj.OBJECT_DISABLE
.
.
scrollFrame.ChartObjEnable = ChartObj.OBJECT_ENABLE




Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07