projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added PKGBUILDs for deps into contribs
[fw/altos]
/
ao-tools
/
altosui
/
AltosLog.java
diff --git
a/ao-tools/altosui/AltosLog.java
b/ao-tools/altosui/AltosLog.java
index fed96c28b0c238b20b7c7db72ef5e586383bd8e1..dd147d21adb960818ff3d26423f7c5e48816ba36 100644
(file)
--- a/
ao-tools/altosui/AltosLog.java
+++ b/
ao-tools/altosui/AltosLog.java
@@
-22,9
+22,6
@@
import java.lang.*;
import java.util.*;
import java.text.ParseException;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.*;
import java.text.ParseException;
import java.util.concurrent.LinkedBlockingQueue;
-import altosui.AltosSerial;
-import altosui.AltosFile;
-import altosui.AltosLine;
/*
* This creates a thread to capture telemetry data and write it to
/*
* This creates a thread to capture telemetry data and write it to
@@
-39,15
+36,22
@@
class AltosLog implements Runnable {
FileWriter log_file;
Thread log_thread;
FileWriter log_file;
Thread log_thread;
-
void clos
e() {
+
private void close_log_fil
e() {
if (log_file != null) {
try {
log_file.close();
} catch (IOException io) {
}
if (log_file != null) {
try {
log_file.close();
} catch (IOException io) {
}
+ log_file = null;
}
}
- if (log_thread != null)
+ }
+
+ void close() {
+ close_log_file();
+ if (log_thread != null) {
log_thread.interrupt();
log_thread.interrupt();
+ log_thread = null;
+ }
}
boolean open (AltosTelemetry telem) throws IOException {
}
boolean open (AltosTelemetry telem) throws IOException {
@@
-77,7
+81,7
@@
class AltosLog implements Runnable {
try {
AltosTelemetry telem = new AltosTelemetry(line.line);
if (telem.serial != serial || telem.flight != flight || log_file == null) {
try {
AltosTelemetry telem = new AltosTelemetry(line.line);
if (telem.serial != serial || telem.flight != flight || log_file == null) {
- close();
+ close
_log_file
();
serial = telem.serial;
flight = telem.flight;
open(telem);
serial = telem.serial;
flight = telem.flight;
open(telem);