altoslib: Add receiver serial to telem file names
[fw/altos] / altoslib / AltosState.java
index dba9bff8084d5db712ea733e537cac6d9005bbe8..5a805fc6bf6864b75a146b64a411746583084c48 100644 (file)
@@ -269,6 +269,7 @@ public class AltosState implements Cloneable {
        public int      state;
        public int      flight;
        public int      serial;
+       public int      receiver_serial;
        public boolean  landed;
        public boolean  ascent; /* going up? */
        public boolean  boost;  /* under power */
@@ -604,6 +605,7 @@ public class AltosState implements Cloneable {
 
                log_format = AltosLib.MISSING;
                serial = AltosLib.MISSING;
+               receiver_serial = AltosLib.MISSING;
 
                baro = null;
                companion = null;
@@ -632,7 +634,9 @@ public class AltosState implements Cloneable {
 
                received_time = old.received_time;
                time = old.time;
-               time_change = 0;
+               time_change = old.time_change;
+               prev_time = old.time;
+               
                tick = old.tick;
                prev_tick = old.tick;
                boost_tick = old.boost_tick;
@@ -723,6 +727,7 @@ public class AltosState implements Cloneable {
 
                log_format = old.log_format;
                serial = old.serial;
+               receiver_serial = old.receiver_serial;
 
                baro = old.baro;
                companion = old.companion;
@@ -779,6 +784,7 @@ public class AltosState implements Cloneable {
                        }
                        tick = new_tick;
                        time = tick / 100.0;
+                       time_change = time - prev_time;
                }
        }
 
@@ -844,6 +850,11 @@ public class AltosState implements Cloneable {
                }
        }
 
+       public void set_receiver_serial(int serial) {
+               if (serial != AltosLib.MISSING)
+                       receiver_serial = serial;
+       }
+
        public int rssi() {
                if (rssi == AltosLib.MISSING)
                        return 0;