altosui: Catch errors in state value when saving flight logs
[fw/altos] / altosui / AltosEepromDownload.java
index d1e5fdf0484cd2d51c3a70ef10f9e56761e81a46..b04890cdb35a5ebd28285cc80b565beb8511df1e 100644 (file)
@@ -319,11 +319,9 @@ public class AltosEepromDownload implements Runnable {
                done = false;
                start = true;
 
-//             if (flights.config_data.serial == 0)
-//                     throw new IOException("no serial number found");
+               if (flights.config_data.serial == 0)
+                       throw new IOException("no serial number found");
 
-               log_format = 5;
-               System.out.printf ("log format: %d\n", log_format);
                /* Reset per-capture variables */
                flight = 0;
                year = 0;
@@ -338,7 +336,7 @@ public class AltosEepromDownload implements Runnable {
 
                state = 0; state_block = log.start_block;
                for (block = log.start_block; !done && block < log.end_block; block++) {
-                       monitor.set_value(Altos.state_to_string[state], state, block - state_block);
+                       monitor.set_value(AltosLib.state_name(state), state, block - state_block);
 
                        AltosEepromChunk        eechunk = new AltosEepromChunk(serial_line, block, block == log.start_block);