projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Fix broken EXTI edge mode selections. Clear pending exti on enable
[fw/altos]
/
altosui
/
AltosLog.java
diff --git
a/altosui/AltosLog.java
b/altosui/AltosLog.java
index 64275f32e4a9868e4a336d6808babb3c11d94fe2..a5f1830d89d0986149cf1bc88781dcc82296cb77 100644
(file)
--- a/
altosui/AltosLog.java
+++ b/
altosui/AltosLog.java
@@
-35,6
+35,7
@@
class AltosLog implements Runnable {
int flight;
FileWriter log_file;
Thread log_thread;
int flight;
FileWriter log_file;
Thread log_thread;
+ AltosFile file;
private void close_log_file() {
if (log_file != null) {
private void close_log_file() {
if (log_file != null) {
@@
-54,6
+55,10
@@
class AltosLog implements Runnable {
}
}
}
}
+ File file() {
+ return file;
+ }
+
boolean open (AltosRecord telem) throws IOException {
AltosFile a = new AltosFile(telem);
boolean open (AltosRecord telem) throws IOException {
AltosFile a = new AltosFile(telem);
@@
-69,6
+74,7
@@
class AltosLog implements Runnable {
}
}
log_file.flush();
}
}
log_file.flush();
+ file = a;
}
return log_file != null;
}
}
return log_file != null;
}
@@
-82,11
+88,12
@@
class AltosLog implements Runnable {
continue;
try {
AltosRecord telem = AltosTelemetry.parse(line.line, previous);
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;
close_log_file();
serial = telem.serial;
flight = telem.flight;
- System.out.printf("Opening telem %d %d\n", serial, flight);
open(telem);
}
previous = telem;
open(telem);
}
previous = telem;