this is not per se a problem with the BBox GUI but it contains some elements of it.
I am trying to add a semi real-time monitor to visualise data coming from a dual channel ADC (STM42F407 SoC, https://www.olimex.com/Products/ARM/ST/ ... e-hardware).
In order to accomplish my goal, I am using the LibPlotters library. The simplified code is presented below.
Filling data vector with values of j simulates the reading process from an external device. So, first an empty plot is created. For j =1 I am updating the data vector and then
I am sending the update message to a plot. The same is for j=2. The problem is that I cannot see the updated plot for j=1, and only for j=2 a line is shown on the plot (at the end of my program).
Why sending the update message (for j=1) does not refresh the plot? Did I miss something?
I am using BBox v1.6-RC6.
Your suggestions are welcome.
Cheers,
Darek
Code: Select all
MODULE TestPlotLib;
IMPORT Plotters := LibPlotters, Ports, Log := StdLog, Fnt:= Fonts,
Vec := LibVectors;
VAR PLp: Plotters.Plotter;
PROCEDURE InitPlotter (VAR P: Plotters.Plotter);
BEGIN
P := Plotters.dir.NewPlotter(" Data display");
P.SetMargin(5,5,5,5);
P.Scale(0, 513.0, -1.0 , 11.0);
P.Xaxis(0, 512.0, 0, 0, 0.0, 0, {});
P.Yaxis(-1.0, 10.0, 0, 0, 0.0, 0, TRUE, {});
P.SetFont2 ('New Courier', 8 * Fnt.point, {Fnt.italic}, Fnt.bold);
P.XyLabel (256.0, 10., Plotters.jC, 'Test data');
P.AddToolBar();
END InitPlotter;
PROCEDURE Run*();
VAR data : Vec.Vector;
i, j, k: INTEGER;
BEGIN
InitPlotter(PLp);
Plotters.OpenAux(PLp, 0,0, TRUE, 'Test plot update');
data := Vec.New(512);
PLp.DrawVector(data, 0.0 , 1, 0.0, 1.0, 0, Ports.blue);
FOR j := 1 TO 2 DO
Log.String("Iteration : "); Log.Int(j); Log.Ln();
FOR i := 0 TO LEN(data) -1 DO
data[i] := j ;
END;
PLp.Update();
Log.String("Pause start");Log.Ln();
(*just delay *)
FOR k := 0 TO 500000000 DO END;
Log.String("Pause end"); Log.Ln();
END;
END Run;
BEGIN
END TestPlotLib.
TestPlotLib.Run
DevDebug.UnloadThis TestPlotLib