fix end of csv

This commit is contained in:
interfisch 2021-03-29 16:17:12 +02:00
parent c6b8ad6648
commit 115ae21ee5
1 changed files with 6 additions and 6 deletions

View File

@ -78,8 +78,8 @@ int brake;
color bg=color(0);
void setup() {
//size(1920, 1080);
size(1000, 800);
size(1920, 1080);
//size(1000, 800);
frameRate(100);
if (useSerial) {
@ -179,7 +179,7 @@ void setup() {
//Current
color c_currentall=color(240,255,50);
vis_currentAll = new Tacho(width/2+150,height-150,100,-1,10);
vis_currentAll.setTitle("minCurrent");
vis_currentAll.setTitle("currentAll");
vis_currentAll.setValueUnit("A");
vis_currentAll.setcmain(c_currentall); //currentAll color
vis_currentAll.setShowMinMax(true);
@ -215,7 +215,7 @@ void setup() {
}
void draw() {
long loopmillis=millis()+25000;
long loopmillis=millis();
if (useSerial) {
if (serial.available() > 0) {
@ -257,10 +257,10 @@ void draw() {
}
}
}else{
if (loopmillis>=nextTimeData){ //New Data
if (loopmillis>=nextTimeData && nextID+1<logdata.getRowCount()){ //New Data
TableRow row = logdata.getRow(nextID);
lastTimeData=nextTimeData;
nextTimeData=(long)(row.getFloat("time")*1000); //get time and convert from seconds to ms
nextTimeData=(long)(logdata.getRow(nextID+1).getFloat("time")*1000); //get time and convert from seconds to ms
lastTimeMillis=nextTimeMillis;
nextTimeMillis=loopmillis;