first cut at turnon scripts for EasyTimer v2
[fw/altos] / altosui / AltosConfigFC.java
index beff71b7279db119e094f10f8cae37688dfcae14..20ca311e30d1ce7b9e4e67d6f8f38c27606b0ea3 100644 (file)
@@ -23,8 +23,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_14.*;
+import org.altusmetrum.altosuilib_14.*;
 
 public class AltosConfigFC implements ActionListener {
 
@@ -232,7 +232,9 @@ public class AltosConfigFC implements ActionListener {
 
                try {
                        /* bounds check stuff */
-                       if (config_ui.flight_log_max() > data.log_space() / 1024) {
+                       if (config_ui.flight_log_max() != AltosLib.MISSING &&
+                           config_ui.flight_log_max() > data.log_space() / 1024)
+                       {
                                JOptionPane.showMessageDialog(owner,
                                                              String.format("Requested flight log, %dk, is larger than the available space, %dk.\n",
                                                                            config_ui.flight_log_max(),
@@ -268,6 +270,13 @@ public class AltosConfigFC implements ActionListener {
                                if (serial_line != null)
                                        serial_line.close();
                        }
+                       else if (cmd.equals("Accel")) {
+                               if (data.pad_orientation != AltosLib.MISSING) {
+                                       AltosUIAccelCal accel_ui = new AltosUIAccelCal(owner, serial_line, config_ui);
+                                       if (accel_ui != null)
+                                               accel_ui.doit();
+                               }
+                       }
                } catch (InterruptedException ie) {
                        abort();
                } catch (TimeoutException te) {