Reverted package name to 'altosui' from 'AltosUI'
[fw/altos] / altosui / AltosUI.java
index 75a12ecef1b6d0f174e37281098ae49d76e7ebd6..926d66f083a076c8634cbe4dc6e5a8db05542b46 100644 (file)
@@ -27,6 +27,7 @@ import java.util.*;
 import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.*;
+import org.altusmetrum.AltosLib.*;
 
 import libaltosJNI.*;
 
@@ -47,7 +48,7 @@ public class AltosUI extends AltosFrame {
 
        void telemetry_window(AltosDevice device) {
                try {
-                       AltosFlightReader reader = new AltosTelemetryReader(device);
+                       AltosFlightReader reader = new AltosTelemetryReader(new AltosSerial(device));
                        if (reader != null)
                                new AltosFlightUI(voice, reader, device.getSerial());
                } catch (FileNotFoundException ee) {
@@ -108,7 +109,7 @@ public class AltosUI extends AltosFrame {
                if (imgURL != null)
                        setIconImage(new ImageIcon(imgURL).getImage());
 
-               AltosPreferences.set_component(this);
+               AltosUIPreferences.set_component(this);
 
                pane = getContentPane();
                gridbag = new GridBagLayout();
@@ -210,12 +211,12 @@ public class AltosUI extends AltosFrame {
                        });
                b.setToolTipText("Check flight readiness of altimeter in idle mode");
 
-               b = addButton(3, 2, "Launch Controller");
-               b.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                       LaunchController();
-                               }
-                       });
+//             b = addButton(3, 2, "Launch Controller");
+//             b.addActionListener(new ActionListener() {
+//                             public void actionPerformed(ActionEvent e) {
+//                                     LaunchController();
+//                             }
+//                     });
 
                b = addButton(4, 2, "Quit");
                b.addActionListener(new ActionListener() {
@@ -262,9 +263,9 @@ public class AltosUI extends AltosFrame {
                String  result;
                result = JOptionPane.showInputDialog(AltosUI.this,
                                                     "Configure Callsign",
-                                                    AltosPreferences.callsign());
+                                                    AltosUIPreferences.callsign());
                if (result != null)
-                       AltosPreferences.set_callsign(result);
+                       AltosUIPreferences.set_callsign(result);
        }
 
        void ConfigureTeleMetrum() {
@@ -365,6 +366,8 @@ public class AltosUI extends AltosFrame {
                        in = new FileInputStream(file);
                        if (filename.endsWith("eeprom"))
                                return new AltosEepromIterable(in);
+                       else if (filename.endsWith("mega"))
+                               return new AltosEepromMegaIterable(in);
                        else
                                return new AltosTelemetryIterable(in);
                } catch (FileNotFoundException fe) {
@@ -535,8 +538,9 @@ public class AltosUI extends AltosFrame {
        }
        
        public static void main(final String[] args) {
+               load_library(null);
                try {
-                       UIManager.setLookAndFeel(AltosPreferences.look_and_feel());
+                       UIManager.setLookAndFeel(AltosUIPreferences.look_and_feel());
                } catch (Exception e) {
                }
                /* Handle batch-mode */