X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosUI.java;h=9ab451defca7847e24354195809dad779f2b8231;hp=ded9e733441015274797cdf4834812622151f292;hb=8463ffcaca6bcd31e645aba71c171f548dce96d8;hpb=6b17d276271faa8a420a1c8f6be17faaa0c7043c diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index ded9e733..9ab451de 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -28,25 +28,6 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; -import altosui.Altos; -import altosui.AltosSerial; -import altosui.AltosSerialMonitor; -import altosui.AltosRecord; -import altosui.AltosTelemetry; -import altosui.AltosState; -import altosui.AltosDeviceDialog; -import altosui.AltosPreferences; -import altosui.AltosLog; -import altosui.AltosVoice; -import altosui.AltosFlightInfoTableModel; -import altosui.AltosFlashUI; -import altosui.AltosLogfileChooser; -import altosui.AltosCSVUI; -import altosui.AltosLine; -import altosui.AltosStatusTable; -import altosui.AltosInfoTable; -import altosui.AltosDisplayThread; - import libaltosJNI.*; public class AltosUI extends JFrame { @@ -456,7 +437,26 @@ public class AltosUI extends JFrame { public static void main(final String[] args) { int process = 0; /* Handle batch-mode */ - if (args.length > 0) { + if (args.length == 2 && args[0].equals("--replay")) { + String filename = args[1]; + FileInputStream in; + try { + in = new FileInputStream(filename); + } catch (Exception e) { + System.out.printf("Failed to open file '%s'\n", filename); + return; + } + AltosRecordIterable recs; + AltosReplayReader reader; + if (filename.endsWith("eeprom")) { + recs = new AltosEepromIterable(in); + } else { + recs = new AltosTelemetryIterable(in); + } + reader = new AltosReplayReader(recs.iterator(), filename); + new AltosFlightUI(new AltosVoice(), reader); + return; + } else if (args.length > 0) { for (int i = 0; i < args.length; i++) { if (args[i].equals("--kml")) process |= process_kml;