diff options
author | Keith Packard <keithp@keithp.com> | 2011-08-14 21:11:41 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-08-14 21:11:41 -0700 |
commit | 048b3eb45169e572f33c68ff152b89db9ef97d31 (patch) | |
tree | b5cc2b33a57f865157c459838e1d4457a58622c3 /altosui/AltosPad.java | |
parent | adb7d345963ab9981c49c7cc68c6b4d7156dce46 (diff) |
altosui: Add 'On-board Data Logging' indicator to pad tab
This shows whether the on-board data memory is full, or is ready to
record the flight. This is indicated in the telemetry stream by a
flight number of '0'.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosPad.java')
-rw-r--r-- | altosui/AltosPad.java | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index d08925be..2ed1ab2c 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -173,6 +173,29 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { Main main; + class LoggingReady extends LaunchStatus { + void show (AltosState state, int crc_errors) { + show(); + System.out.printf("flight %d state %d\n", state.data.flight, state.data.state); + if (state.data.flight != 0) { + if (state.data.state <= Altos.ao_flight_pad) + value.setText("Ready to record"); + else if (state.data.state < Altos.ao_flight_landed) + value.setText("Recording data"); + else + value.setText("Recorded data"); + } + else + value.setText("Storage full"); + lights.set(state.data.flight != 0); + } + public LoggingReady (GridBagLayout layout, int y) { + super(layout, y, "On-board Data Logging"); + } + } + + LoggingReady logging_ready; + class GPSLocked extends LaunchStatus { void show (AltosState state, int crc_errors) { show(); @@ -252,6 +275,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { battery.reset(); apogee.reset(); main.reset(); + logging_ready.reset(); gps_locked.reset(); gps_ready.reset(); pad_lat.reset(); @@ -269,6 +293,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { main.hide(); else main.show(state, crc_errors); + logging_ready.show(state, crc_errors); pad_alt.show(state, crc_errors); if (state.gps != null && state.gps.connected) { gps_locked.show(state, crc_errors); @@ -301,10 +326,11 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { battery = new Battery(layout, 0); apogee = new Apogee(layout, 1); main = new Main(layout, 2); - gps_locked = new GPSLocked(layout, 3); - gps_ready = new GPSReady(layout, 4); - pad_lat = new PadLat(layout, 5); - pad_lon = new PadLon(layout, 6); - pad_alt = new PadAlt(layout, 7); + logging_ready = new LoggingReady(layout, 3); + gps_locked = new GPSLocked(layout, 4); + gps_ready = new GPSReady(layout, 5); + pad_lat = new PadLat(layout, 6); + pad_lon = new PadLon(layout, 7); + pad_alt = new PadAlt(layout, 8); } } |