rolling graph gwoptics update problem
in
Contributed Library Questions
•
3 months ago
Hi all,
I am developing an application to monitor UPS parameters and status. I developed the application using Processing 1.2.1, which reads and records parameters through serial ports in every approx 3 seconds. I need to enhance the functionality by plotting the graph of critical parameters. I am using "gwoptics" library for plotting and the class is RolloingLine2DTrace. First i tried with the example program "rolling graph". I customized the "eq" functions according to my application and it worked fine. But when i incorporated the same codes to my application the "x values" started to over write each values after some time x axis becomes a black pacth with values. I think the issue with the timing of the updates. i tried different values. but no use. I tried to change the the 'tickincrease', 'refreshrate" in example code. it worked fine with change in speed according to the parameters. but in my application it is a different story. Could you please help me to come out of this problem? How to calculate the exact 'tikincreaserate' , refreshrate, and Xaxis value?
each x value is getting overwritten by the value in right as the time goes and finally it becomes illegible
r = new RollingLine2DTrace(new eq() ,4000,.50f);
r.setTraceColour(0, 255, 0);
g = new Graph2D(this, 200, 200, false);
g.setYAxisMax(300);
g.addTrace(r);
g.position.y = 80;
g.position.x =1150;
g.setYAxisTickSpacing(100);
// g.setXAxisTickSpacing(.1f);
//g.setXAxisMax(35f);
// g.setXAxisMin(0);
// g.setYAxisMin(0);
//g.setYAxisTickSpacing(0.4);
g.setXAxisMax(1f);
1