altos/altosui: Add ability to disable telemetry/rdf completely
[fw/altos] / altosui / AltosFlightStats.java
index e38142f04de27d8c515ef0e437d5ee8f816920ef..19471e9fa650847b8af2d5406e3036f8db19f4be 100644 (file)
@@ -67,7 +67,10 @@ public class AltosFlightStats {
                                        if (state_end[state.state] < state.time)
                                                state_end[state.state] = state.time;
                                        max_height = state.max_height;
-                                       max_speed = state.max_speed;
+                                       if (state.max_speed != 0)
+                                               max_speed = state.max_speed;
+                                       else
+                                               max_speed = state.max_baro_speed;
                                        max_acceleration = state.max_acceleration;
                                }
                        } catch (ParseException pp) {
@@ -85,11 +88,11 @@ public class AltosFlightStats {
                }
        }
 
-       public AltosFlightStats(AltosRecordIterable iterable, String filename) throws InterruptedException, IOException {
-               this(new AltosReplayReader(iterable.iterator(), filename));
+       public AltosFlightStats(AltosRecordIterable iterable, File file) throws InterruptedException, IOException {
+               this(new AltosReplayReader(iterable.iterator(), file));
        }
 
        public AltosFlightStats(AltosRecordIterable iterable) throws InterruptedException, IOException {
-               this(iterable, "");
+               this(iterable, new File(""));
        }
 }