X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosUI.java;h=d8c8d61ce6794f8b6b4d8717c839bd2bc77dd916;hb=1f3f3d575572eff33a2bc7a53d4691e59a428450;hp=94c4dd2aa4b10bb2ae6424268344f0c9ace981f6;hpb=3fbefb3eea981d34a09496cf8abf0119de2e35bf;p=fw%2Faltos diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 94c4dd2a..d8c8d61c 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -34,7 +34,7 @@ public class AltosUI extends JFrame { public AltosVoice voice = new AltosVoice(); public static boolean load_library(Frame frame) { - if (!AltosDevice.load_library()) { + if (!Altos.load_library()) { JOptionPane.showMessageDialog(frame, String.format("No AltOS library in \"%s\"", System.getProperty("java.library.path","")), @@ -99,7 +99,7 @@ public class AltosUI extends JFrame { if (imgURL != null) setIconImage(new ImageIcon(imgURL).getImage()); - AltosPreferences.init(this); + AltosPreferences.set_component(this); pane = getContentPane(); gridbag = new GridBagLayout(); @@ -172,6 +172,21 @@ public class AltosUI extends JFrame { } }); + + b = addButton(0, 2, "Scan Channels"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + ScanChannels(); + } + }); + + b = addButton(1, 2, "Load Maps"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + LoadMaps(); + } + }); + setTitle("AltOS"); pane.doLayout(); @@ -199,7 +214,7 @@ public class AltosUI extends JFrame { private void ConnectToDevice() { AltosDevice device = AltosDeviceDialog.show(AltosUI.this, - AltosDevice.product_basestation); + Altos.product_basestation); if (device != null) telemetry_window(device); @@ -219,13 +234,21 @@ public class AltosUI extends JFrame { } void FlashImage() { - new AltosFlashUI(AltosUI.this); + AltosFlashUI.show(AltosUI.this); } void FireIgniter() { new AltosIgniteUI(AltosUI.this); } + void ScanChannels() { + new AltosScanUI(AltosUI.this); + } + + void LoadMaps() { + new AltosSiteMapPreload(AltosUI.this); + } + /* * Replay a flight from telemetry data */ @@ -245,7 +268,7 @@ public class AltosUI extends JFrame { * a TeleDongle over the packet link */ private void SaveFlightData() { - new AltosEepromDownload(AltosUI.this); + new AltosEepromManage(AltosUI.this); } /* Load a flight log file and write out a CSV file containing @@ -328,7 +351,7 @@ public class AltosUI extends JFrame { if (input.equals(output)) { System.out.printf("Not processing '%s'\n", input); } else { - AltosWriter writer = open_csv(output); + AltosWriter writer = open_csv("/dev/stdout"); if (writer != null) { writer.write(iterable); writer.close(); @@ -397,9 +420,9 @@ public class AltosUI extends JFrame { AltosUI altosui = new AltosUI(); altosui.setVisible(true); - AltosDevice[] devices = AltosDevice.list(AltosDevice.product_basestation); - for (int i = 0; i < devices.length; i++) - altosui.telemetry_window(devices[i]); + java.util.List devices = AltosUSBDevice.list(Altos.product_basestation); + for (AltosDevice device : devices) + altosui.telemetry_window(device); } } }