X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosUI.java;h=a1bc0dbbec2fc035c8af7c60700f8aa505f7a043;hp=0aa5d03ce142ef1a420b2c45d4d581b9654ac829;hb=79f3434013650fe4e3d76e5eb56a10000ee34249;hpb=7767a045d446ea2bc5fe1ec98d89274155f956c4 diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 0aa5d03c..a1bc0dbb 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -463,7 +463,7 @@ public class AltosUI extends AltosUIFrame { AltosStateIterable states = record_iterable(file); if (states == null) return null; - return new AltosReplayReader(states.iterator(), file); + return new AltosReplayReader(states.iterator(), file, true); } static boolean process_replay(File file) { @@ -471,7 +471,6 @@ public class AltosUI extends AltosUIFrame { if (reader == null) return false; AltosFlightUI flight_ui = new AltosFlightUI(new AltosVoice(), reader); - flight_ui.set_exit_on_close(); return true; } @@ -559,9 +558,9 @@ public class AltosUI extends AltosUIFrame { public static void help(int code) { System.out.printf("Usage: altosui [OPTION]... [FILE]...\n"); System.out.printf(" Options:\n"); - System.out.printf(" --fetchmaps \tpre-fetch maps for site map view\n"); System.out.printf(" --replay \t\trelive the glory of past flights \n"); System.out.printf(" --graph \t\tgraph a flight\n"); + System.out.printf(" --summary \t\tText summary of a flight\n"); System.out.printf(" --csv\tgenerate comma separated output for spreadsheets, etc\n"); System.out.printf(" --kml\tgenerate KML output for use with Google Earth\n"); System.exit(code); @@ -574,10 +573,11 @@ public class AltosUI extends AltosUIFrame { UIManager.setLookAndFeel(AltosUIPreferences.look_and_feel()); } catch (Exception e) { } + AltosUI altosui = null; + /* Handle batch-mode */ if (args.length == 0) { - AltosUI altosui = new AltosUI(); - + altosui = new AltosUI(); java.util.List devices = AltosUSBDevice.list(Altos.product_basestation); if (devices != null) for (AltosDevice device : devices) @@ -615,10 +615,14 @@ public class AltosUI extends AltosUIFrame { switch (process) { case process_none: case process_graph: + if (altosui == null) + altosui = new AltosUI(); if (!process_graph(file)) ++errors; break; case process_replay: + if (altosui == null) + altosui = new AltosUI(); if (!process_replay(file)) ++errors; break;