Author |
Topic |
|
soundar
51 Posts |
Posted - 20 Aug 2015 : 14:14:00
|
In one of my projects I am using the rtgraph in "cumulative" mode, that is, ScrollScaleModeX = ChartObj.RT_MAXEXTENT_FIXEDSTART_AUTOSCROLL. And I have AutoTruncateMaxCount = 100000 and AutoTruncateMinCount=1000. Unfortunately, the customer wants the graph to "go on forever". Of course this is not possible to due to memory constraints and performance and I have a few questions.
1. if I dont set AutoTruncateMaxCount, does it default to something? (MAX_INT perhaps?) 2. if I dont set AutoTruncateMinCount, does it default to something? 3. Is there a way to trap that an auto-truncation has occured ? (short of keeping count of the points myself)? 4. I am using an elapsed time scale for my x-axis. If a truncation has occured, I would like to shift the StartX to the new minimum. For example, say the graph is displaying from 0 to X seconds, where X is increasing, and now a truncation occurs at, say 10 seconds. I now want the graph to start displaying from 10 to 11, 10 to 12 etc as new data comes in. Is there a way to do this? Would appreciate any help.
Thanks.
|
|
quinncurtis
1586 Posts |
Posted - 20 Aug 2015 : 15:13:56
|
1. Default AutoTruncateMaxCount is 1000 2. Default AutoTruncateMinCount is 500 Default AutoTruncateDataset is false
3. Use the RTDatasetTruncateEventHandler or RTGroupDatasetTruncateEventHandler to trap the auto-truncate event . See the manual and the the FetalMonitor and Dynamometer example programs.
4. Then you do NOT want RT_MAXEXTENT_FIXEDSTART_AUTOSCROLL. Use RT_FIXEDEXTENT_MOVINGSTART_AUTOSCROLL with a ScrollRescaleMargin of something like 0.9. In this case, when the current data reaches the right hand edge of the graph scale, it then shift the graph scale back 90% towards the left edge of the chart.
scrollFrame = new RTScrollFrame(this, currentTemperature1, pTransform1, ChartObj.RT_FIXEDEXTENT_MOVINGSTART_AUTOSCROLL); scrollFrame.ScrollRescaleMargin = 0.9;
Make sure you keep enough in the data buffer so that when the RTScrollFrame resets the starting and ending points of the chart, that the chart can fill from the beginning of the chart to where new data is added (10% away from the start of the graph). |
|
|
|
Topic |
|
|
|