altosui: Print filename before attempting to parse in --summary mode
[fw/altos] / altosui / AltosUI.java
index 74e074632b81a263f27b939fee753067e92d28c4..fa259906769a9da7101c9bf1c064ce43a21bab93 100644 (file)
@@ -492,8 +492,8 @@ public class AltosUI extends AltosUIFrame {
                if (states == null)
                        return false;
                try {
-                       AltosFlightStats stats = new AltosFlightStats(states);
                        System.out.printf("%s:\n", file.toString());
+                       AltosFlightStats stats = new AltosFlightStats(states);
                        if (stats.serial != AltosLib.MISSING)
                                System.out.printf("Serial:       %5d\n", stats.serial);
                        if (stats.flight != AltosLib.MISSING)
@@ -612,15 +612,13 @@ public class AltosUI extends AltosUIFrame {
                                        File file = new File(args[i]);
                                        switch (process) {
                                        case process_none:
-                                       case process_graph:
                                                if (altosui == null)
                                                        altosui = new AltosUI();
+                                       case process_graph:
                                                if (!process_graph(file))
                                                        ++errors;
                                                break;
                                        case process_replay:
-                                               if (altosui == null)
-                                                       altosui = new AltosUI();
                                                if (!process_replay(file))
                                                        ++errors;
                                                break;