ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How does pausing a realtime chart work?
Posted by Shawn on Jan-27-2020 23:53
I've been reviewing the real-time demos, but I can't see how the freezing functionality is being implemented. There doesn't appear to be any assigned functions to the "Freeze" radio button. I'm sure it's stupid, but what am I missing?

Any help is greatly appreciated.

Thanks!

  Re: How does pausing a realtime chart work?
Posted by Peter Kwan on Jan-28-2020 00:44
Hi Shawn,

We have many programming language editions of ChartDirector, and each programming langauge may support multiple GUI frameworks. For example C++/MFC, C++/Qt, C#/WPF, C#/Windows Forms, Java/SWING etc.. Would you mind to clarify which programming language and GUI framework you are using?

For our real-time chart sample code, there are usually two timers - a data collection timer, and a chart update timer. The data collection timer collects real-time data. The chart update time updates the chart display. The Freeze button stops the chart update timer. In this way, data are still being collected, but the chart does not move.

In some GUI frameworks, the Run button and Freeze button works as "radio buttons". That means selecting "Freeze" will automatically deselect "Run" and vice versa. So we only need to implement "Run" and use it to enable/disable the chart update timer. For example, in C#/Windows Forms, our code is:

   private void runPB_CheckedChanged(object sender, EventArgs e)
   {
        chartUpdateTimer.Enabled = runPB.Checked;
   }

The above code means if the Freeze button is pressed (and therefore the Run button is  deselected), the chartUpdateTimer will be disabled. If the Run button is pressed, the chartUpdateTimer will be enabled.

Hope this can help.

Regards
Peter Kwan

  Re: How does pausing a realtime chart work?
Posted by Shawn on Jan-28-2020 01:39
Thanks Peter. I was testing the Windows forms functionality. I didn't have the CheckedChanged function set for the Run radio button. When trying to figure out why it wasn't working, I was looking for freezePB related text. I have it working now.