stop doing automatic tag push during builds
[fw/altos] / altosui / AltosTelemetryReader.java
index 6c5a93978c69a4156e0e44fe3b94b3ea7a9c92c0..23524b2cb349c4a99a2d11878a5a2f879842f5a3 100644 (file)
@@ -26,6 +26,7 @@ class AltosTelemetryReader extends AltosFlightReader {
        AltosDevice     device;
        AltosSerial     serial;
        AltosLog        log;
+       AltosRecord     previous;
 
        LinkedBlockingQueue<AltosLine> telem;
 
@@ -33,7 +34,13 @@ class AltosTelemetryReader extends AltosFlightReader {
                AltosLine l = telem.take();
                if (l.line == null)
                        throw new IOException("IO error");
-               return new AltosTelemetry(l.line);
+               AltosRecord     next = AltosTelemetry.parse(l.line, previous);
+               previous = next;
+               return next;
+       }
+
+       void flush() {
+               telem.clear();
        }
 
        void close(boolean interrupted) {
@@ -47,12 +54,18 @@ class AltosTelemetryReader extends AltosFlightReader {
                AltosPreferences.set_channel(device.getSerial(), channel);
        }
 
+       void set_telemetry(int telemetry) {
+               serial.set_telemetry(telemetry);
+               AltosPreferences.set_telemetry(device.getSerial(), telemetry);
+       }
+
        public AltosTelemetryReader (AltosDevice in_device)
                throws FileNotFoundException, AltosSerialInUseException, IOException {
                device = in_device;
                serial = new AltosSerial(device);
                log = new AltosLog(serial);
                name = device.toShortString();
+               previous = null;
 
                telem = new LinkedBlockingQueue<AltosLine>();
                serial.set_radio();