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
 Trying to make a Real-Time LineGapPlot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tcormode

2 Posts

Posted - 23 Jan 2006 :  15:48:58  Show Profile  Reply with Quote
I'm trying out QC before I buy it. I am trying to make a scrolling real-time graph that has two lineplots and one linegapplot. However, I am getting a Null Pointer Exception. If I eliminate the linegapplot, things run fine. I'm a little stumped. If someone can help out, it would be appreciated. A snippet of the code that creates the plots is as follows:

scrollFrame = new RTScrollFrame(this, rtSeries[0], pTransform1, ChartConstants.RT_FIXEDEXTENT_MOVINGSTART_AUTOSCROLL);

scrollFrame.setScrollScaleModeY(ChartConstants.RT_NO_AUTOSCALE_Y);
scrollFrame.addProcessVar(rtSeries[1]);

scrollFrame.setScrollRescaleMargin(0.25);
scrollFrame.setMinSamplesForAutoScale(50);

simpleplot[0] = (SimplePlot) new SimpleLinePlot(pTransform1, null, attrib1);
simpleplot[1] = (SimplePlot) new SimpleLinePlot(pTransform1, null, attrib2);

scrollFrame.addProcessVar(rtLineGap[0]);
scrollFrame.addProcessVar(rtLineGap[1]);
LineGapPlot alTargetPlot = new LineGapPlot(pTransform1, null, attribLG);
alTargetPlot.setFastClipMode(ChartConstants.FASTCLIP_X);
mpvLineGap = new RTMultiProcessVar("Al Target Range", rtLineGap);
lgPlot = new RTGroupMultiValuePlot(pTransform1, alTargetPlot, rtLineGap);

chartVu.addChartObject(scrollFrame);
chartVu.addChartObject(lgPlot);

for (int i = 0; i< 2; i++) {
simpleplot[i].setFastClipMode( ChartConstants.FASTCLIP_X);
rtlineplot[i] = new RTSimpleSingleValuePlot(pTransform1,simpleplot[i],rtSeries[i]);
chartVu.addChartObject(rtlineplot[i]);
}

quinncurtis

1586 Posts

Posted - 23 Jan 2006 :  18:59:48  Show Profile  Reply with Quote
We cannot tell by inspection what is wrong with your program. It may be in the parts of the code you do not show. To rule out a simple problem with the LineGapPlot routine used in a real-time graph, we modified the example program ScrollGraphDemo.GroupScrollGraph1 to plot a LineGapPlot.


// The following line was changed to create the LineGapPlot
// MultiLinePlot groupplot = (MultiLinePlot) new MultiLinePlot(pTransform1, null, attribArray);
LineGapPlot groupplot = (LineGapPlot) new LineGapPlot(pTransform1, null, attribArray[0]);
groupplot.setFastClipMode(ChartConstants.FASTCLIP_X);
rtlineplot = new RTGroupMultiValuePlot(pTransform1,groupplot, bigProcessVarArray);
chartVu.addChartObject(rtlineplot);


It worked as expected.

If you cannot solve the problem, first see if you can reproduce the problem using the ScrollGraphDemo.GroupScrollGraph1 example program. If not, then zip your complete project that reproduces the problem and send it with an explanation to support@quinn-curtis.com.
Go to Top of Page

tcormode

2 Posts

Posted - 24 Jan 2006 :  11:31:38  Show Profile  Reply with Quote
It turns out that I did not call the statement:
rtLineGap[0].setDatasetEnableUpdate(true); before I set the current value. This caused things to crash...

Thanks for the help.
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