altos: Add delays to bt startup sequence
[fw/altos] / altosui / AltosUI.java
index 73ddf979c254a8f2343c57bc8cebdf31687fc688..7955c1c20660a5348537a9a5450cdacf5b7434b0 100644 (file)
@@ -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","<undefined>")),
@@ -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();
@@ -198,12 +198,8 @@ public class AltosUI extends JFrame {
        }
 
        private void ConnectToDevice() {
-               AltosBTManage   bt_manage;
-
-               bt_manage = new AltosBTManage(AltosBTDevice.bt_product_any, this);
-               bt_manage.list();
                AltosDevice     device = AltosDeviceDialog.show(AltosUI.this,
-                                                               AltosDevice.product_basestation);
+                                                               Altos.product_basestation);
 
                if (device != null)
                        telemetry_window(device);
@@ -401,9 +397,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<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
+                       for (AltosDevice device : devices)
+                               altosui.telemetry_window(device);
                }
        }
 }