-public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFontListener, ActionListener {
+public class TeleGPS
+ extends AltosUIFrame
+ implements AltosFlightDisplay, AltosFontListener, AltosUnitsListener, ActionListener
+{
AltosInfoTable info_table;
LinkedList<AltosFlightDisplay> displays;
/* File menu */
final static String new_command = "new";
AltosInfoTable info_table;
LinkedList<AltosFlightDisplay> displays;
/* File menu */
final static String new_command = "new";
final static String close_command = "close";
final static String exit_command = "exit";
static final String[][] file_menu_entries = new String[][] {
{ "New Window", new_command },
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 },
{ "Close", close_command },
{ "Exit", exit_command },
};
/* Monitor menu */
{ "Close", close_command },
{ "Exit", exit_command },
};
/* Monitor menu */
final static String disconnect_command = "disconnect";
final static String scan_command = "scan";
static final String[][] monitor_menu_entries = new String[][] {
final static String disconnect_command = "disconnect";
final static String scan_command = "scan";
static final String[][] monitor_menu_entries = new String[][] {
{ "Disconnect", disconnect_command },
{ "Scan Channels", scan_command },
};
/* Device menu */
final static String download_command = "download";
{ "Disconnect", disconnect_command },
{ "Scan Channels", scan_command },
};
/* Device menu */
final static String download_command = "download";
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 },
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 },
AltosDevice device = AltosDeviceUIDialog.show(this,
AltosLib.product_basestation);
if (device == null)
AltosDevice device = AltosDeviceUIDialog.show(this,
AltosLib.product_basestation);
if (device == null)
+ AltosDataChooser chooser;
+ chooser = new AltosDataChooser(this);
+ AltosStateIterable states = chooser.runDialog();
+ if (states == null)
+ return;
+ try {
+ new TeleGPSGraphUI(states, chooser.file());
+ } catch (InterruptedException ie) {
+ } catch (IOException ie) {
+ }
frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial));
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial));
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
void remove_frequency_menu() {
if (frequencies != null) {
menu_bar.remove(frequencies);
void remove_frequency_menu() {
if (frequencies != null) {
menu_bar.remove(frequencies);
frequencies = null;
}
}
public void set_reader(AltosFlightReader reader) {
setTitle(String.format("TeleGPS %s", reader.name));
frequencies = null;
}
}
public void set_reader(AltosFlightReader reader) {
setTitle(String.format("TeleGPS %s", reader.name));
- thread = new AltosDisplayThread(this, voice(), this, reader);
+ thread = new TeleGPSDisplayThread(this, voice(), this, reader);
- sitemap = new AltosSiteMap();
- pane.add("Site Map", sitemap);
- displays.add(sitemap);
+ map = new AltosUIMap();
+ pane.add(map.getName(), map);
+ displays.add(map);
info_table = new AltosInfoTable();
pane.add("Table", info_table);
displays.add(info_table);
info_table = new AltosInfoTable();
pane.add("Table", info_table);
displays.add(info_table);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
AltosUIPreferences.register_font_listener(this);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
AltosUIPreferences.register_font_listener(this);
+ static boolean process_graph(File file) {
+ AltosStateIterable states = record_iterable(file);
+ if (states == null)
+ return false;
+ try {
+ new TeleGPSGraphUI(states, file);
+ } catch (Exception e) {
+ return false;
+ }
+ return true;
+ }
+
java.util.List<AltosDevice> devices = AltosUSBDevice.list(AltosLib.product_basestation);
if (devices != null)
for (AltosDevice device : devices) {
new TeleGPS(device);
any_created = true;
}
java.util.List<AltosDevice> devices = AltosUSBDevice.list(AltosLib.product_basestation);
if (devices != null)
for (AltosDevice device : devices) {
new TeleGPS(device);
any_created = true;
}