55 lines
1.0 KiB
Plaintext
55 lines
1.0 KiB
Plaintext
|
|
Visualization visThrottle;
|
|
|
|
|
|
long lastTimeData=0; //last time data received
|
|
|
|
|
|
Table logdata;
|
|
int nextID=0; //next row number to be displayed
|
|
long nextTime=0; //time of nextID row
|
|
|
|
//Data from log
|
|
int throttle=0;
|
|
|
|
void setup() {
|
|
size(1920, 1080);
|
|
frameRate(100);
|
|
|
|
logdata = loadTable("LOG00008_rumfahren_neu.TXT", "header, csv");
|
|
|
|
|
|
|
|
visThrottle = new BarV(20+80,120,10,100,-1000,1000);
|
|
visThrottle.setTitle("Throttle");
|
|
|
|
}
|
|
|
|
void draw() {
|
|
if (millis()>=nextTime){
|
|
TableRow row = logdata.getRow(nextID);
|
|
lastTimeData=nextTime;
|
|
nextTime=(long)(row.getFloat("time")*1000); //get time and convert from seconds to ms
|
|
|
|
throttle=row.getInt("throttle");
|
|
println(nextTime + " throttle:"+throttle);
|
|
|
|
nextID++;
|
|
nextID=nextID%logdata.getRowCount();
|
|
}
|
|
|
|
|
|
|
|
|
|
background(255);
|
|
visThrottle.setValue(throttle);
|
|
|
|
visThrottle.drawVis();
|
|
|
|
fill(color(0,0,0));
|
|
textSize(12);
|
|
text("d="+(nextTime-lastTimeData)+"ms", 5,12*2);
|
|
|
|
text("t="+(millis()/1000.0)+"s", 5,12);
|
|
}
|