X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=telegps%2FTeleGPS.java;h=eddb47d8f2975fc496bd1817aa14c63025a210f5;hb=92895c87bc3d97bf4990f1feda0bd8b07da4c405;hp=9aaa80c3fc12e4fcf9e16cf462773e864fc9c8b9;hpb=7d77d83685cbfce5323767bbfae3bd18be175ffc;p=fw%2Faltos diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index 9aaa80c3..eddb47d8 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -69,48 +69,49 @@ public class TeleGPS AltosUIMap map; TeleGPSInfo gps_info; + TeleGPSState gps_state; AltosInfoTable info_table; LinkedList displays; /* File menu */ final static String new_command = "new"; - final static String preferences_command = "preferences"; + final static String graph_command = "graph"; + final static String export_command = "export"; final static String load_maps_command = "loadmaps"; + final static String preferences_command = "preferences"; final static String close_command = "close"; final static String exit_command = "exit"; static final String[][] file_menu_entries = new String[][] { { "New Window", new_command }, - { "Preferences", preferences_command }, + { "Graph Data", graph_command }, + { "Export Data", export_command }, { "Load Maps", load_maps_command }, + { "Preferences", preferences_command }, { "Close", close_command }, { "Exit", exit_command }, }; /* Monitor menu */ - final static String monitor_command = "monitor"; + final static String connect_command = "connect"; final static String disconnect_command = "disconnect"; final static String scan_command = "scan"; static final String[][] monitor_menu_entries = new String[][] { - { "Monitor Device", monitor_command }, + { "Connect Device", connect_command }, { "Disconnect", disconnect_command }, { "Scan Channels", scan_command }, }; /* Device menu */ final static String download_command = "download"; - final static String export_command = "export"; - final static String graph_command = "graph"; final static String configure_command = "configure"; final static String flash_command = "flash"; static final String[][] device_menu_entries = new String[][] { { "Download Data", download_command }, { "Configure Device", configure_command }, - { "Export Data", export_command }, - { "Graph Data", graph_command }, { "Flash Device", flash_command }, }; @@ -212,7 +213,7 @@ public class TeleGPS } } - void monitor() { + void connect() { AltosDevice device = AltosDeviceUIDialog.show(this, AltosLib.product_basestation); if (device == null) @@ -285,8 +286,8 @@ public class TeleGPS System.exit(0); /* Monitor menu */ - if (monitor_command.equals(ev.getActionCommand())) { - monitor(); + if (connect_command.equals(ev.getActionCommand())) { + connect(); return; } if (disconnect_command.equals(ev.getActionCommand())) { @@ -370,6 +371,7 @@ public class TeleGPS } private void close() { + disconnect(); AltosUIPreferences.unregister_font_listener(this); AltosPreferences.unregister_units_listener(this); setVisible(false); @@ -443,13 +445,17 @@ public class TeleGPS bag.add(pane, c); map = new AltosUIMap(); - pane.add("Map", map); + pane.add(map.getName(), map); displays.add(map); gps_info = new TeleGPSInfo(); - pane.add("Info", gps_info); + pane.add(gps_info.getName(), gps_info); displays.add(gps_info); + gps_state = new TeleGPSState(); + pane.add(gps_state.getName(), gps_state); + displays.add(gps_state); + info_table = new AltosInfoTable(); pane.add("Table", info_table); displays.add(info_table);