Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCRTGraph for Java
 Changing the time axis on an RTScrollFrame
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

zreynolds

5 Posts

Posted - 18 Jan 2008 :  07:48:47  Show Profile  Reply with Quote
I am working on an RTScrollFrame that displays data in real-time. It's put together such that each time a packet of data arrives, it adds the data to the RTScrollFrame. Occasionally, there are interruptions in the data, so the display will just wait for more data to arrive. When it does, the labels on the TimeAxis resume from where they were, no longer reflecting the timestamp on the data itself.

So, more technically, adjusting the start and end times on the axes causes the RTScrollFrame to stop responding. Demolishing the whole chart and recreating it also causes the frame to stop responding.

I guess the fundamental question is, what's the best way to change the values on the TimeAxis?

Zane Reynolds
reynolds@eng.usf.edu

quinncurtis

1586 Posts

Posted - 18 Jan 2008 :  09:37:34  Show Profile  Reply with Quote
We cannot reproduce what you describe.

It sounds like there is something wrong with the way you are using the scroll frame, or are updating the data.

We made a simple modification to the timer1_Tick method in our simple scroll example, ScrollApplication1, to update at a random time interval.

// Update data using 200 msec timer
private void timer1_Tick(ActionEvent e)
{
       // Random data
	currentTemperatureValue1 += 5 * (0.5 - ChartSupport.getRandomDouble());
	currentTemperatureValue2 += 8 * (0.5 - ChartSupport.getRandomDouble());
        counter++;
	double randreal = ChartSupport.getRandomDouble();
	if (randreal < 0.05)
	{
	  currentTemperature1.setCurrentValue(currentTemperatureValue1);
	  currentTemperature2.setCurrentValue(currentTemperatureValue2);
        }
}


The graph updates correctly, the graph scrolls properly, and the axes labels always maintain the proper relationship to the data, even though the updates are completely random and sporatic in time.

See if you can reproduce your problem using that example program.
Go to Top of Page

zreynolds

5 Posts

Posted - 18 Jan 2008 :  13:52:38  Show Profile  Reply with Quote
I think the essential problem was that I was trying to add data to the chart that was older than the current extent of the chart. I set up the RTScrollFrames with a TimeAxis that has an initial value of the current time. Then I try to adjust the TimeAxis to show the older start time, and that's where the problem occurs.

I ended up using a work-around to solve this problem. Everything works properly when I take the current time initially, and just increment that time every time new data arrives. So, the work around is that I removed the TimeAxisLabels from the RTScrollFrame and used a separate date/time stamp that corresponds to the date stamp that comes with the data.

Thanks for your usual quick response!

Zane Reynolds
reynolds@eng.usf.edu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07