int flight;
FileWriter log_file;
Thread log_thread;
+ AltosFile file;
private void close_log_file() {
if (log_file != null) {
}
}
+ File file() {
+ return file;
+ }
+
boolean open (AltosRecord telem) throws IOException {
AltosFile a = new AltosFile(telem);
}
}
log_file.flush();
+ file = a;
}
return log_file != null;
}
continue;
try {
AltosRecord telem = AltosTelemetry.parse(line.line, previous);
- if (telem.serial != serial || telem.flight != flight || log_file == null) {
+ if (telem.serial != 0 && telem.flight != 0 &&
+ (telem.serial != serial || telem.flight != flight || log_file == null))
+ {
close_log_file();
serial = telem.serial;
flight = telem.flight;
- System.out.printf("Opening telem %d %d\n", serial, flight);
open(telem);
}
previous = telem;