+ class LastPacket extends FlightValue {
+
+ long last_secs = -1;
+
+ void show(AltosState state, AltosListenerState listener_state) {
+ if (listener_state.running) {
+ long secs = (System.currentTimeMillis() - state.received_time + 500) / 1000;
+ if (secs != last_secs) {
+ value.setText(String.format("%d", secs));
+ last_secs = secs;
+ }
+ } else {
+ value.setText("done");
+ }
+ }
+
+ public void reset() {
+ super.reset();
+ last_secs = -1;
+ }
+
+ public LastPacket(GridBagLayout layout, int x) {
+ super (layout, x, "Age");
+ }
+ }
+
+ LastPacket last_packet;
+