X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosLog.java;h=740f0be600ecd1301a2b20be9c1a31ff4265395d;hb=93305717ac4c993c88d9144d797ca64d26db97c5;hp=855ee2b4a724fd22963a02a54db3fd60b2a6b346;hpb=4132ac5896114e5f3d8fb3f219422e8933078cf4;p=fw%2Faltos diff --git a/altosui/AltosLog.java b/altosui/AltosLog.java index 855ee2b4..740f0be6 100644 --- a/altosui/AltosLog.java +++ b/altosui/AltosLog.java @@ -22,6 +22,7 @@ import java.lang.*; import java.util.*; import java.text.ParseException; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; /* * This creates a thread to capture telemetry data and write it to @@ -35,6 +36,7 @@ class AltosLog implements Runnable { int flight; FileWriter log_file; Thread log_thread; + AltosFile file; private void close_log_file() { if (log_file != null) { @@ -54,6 +56,10 @@ class AltosLog implements Runnable { } } + File file() { + return file; + } + boolean open (AltosRecord telem) throws IOException { AltosFile a = new AltosFile(telem); @@ -69,6 +75,7 @@ class AltosLog implements Runnable { } } log_file.flush(); + file = a; } return log_file != null; } @@ -88,7 +95,6 @@ class AltosLog implements Runnable { close_log_file(); serial = telem.serial; flight = telem.flight; - System.out.printf("Opening telem %d %d\n", serial, flight); open(telem); } previous = telem;