diff options
| author | Keith Packard <keithp@keithp.com> | 2010-11-09 10:21:34 -0800 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-11-09 10:21:34 -0800 |
| commit | eb77e806ded99532dc7eaa39c1893f075b028af6 (patch) | |
| tree | 87473598b7baaf2432eb230508b41fba11fea51b /ao-tools/altosui/AltosFlightUI.java | |
| parent | a0a92c605e238277c9881545a7226e53b5dbc295 (diff) | |
altosui: Create abstract interface for flight data display
This allows the implementation of the flight data display to occur in
the flight UI instead of the display thread.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosFlightUI.java')
| -rw-r--r-- | ao-tools/altosui/AltosFlightUI.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ao-tools/altosui/AltosFlightUI.java b/ao-tools/altosui/AltosFlightUI.java index 84ba9dca..11fc2442 100644 --- a/ao-tools/altosui/AltosFlightUI.java +++ b/ao-tools/altosui/AltosFlightUI.java @@ -28,7 +28,7 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; -public class AltosFlightUI extends JFrame { +public class AltosFlightUI extends JFrame implements AltosFlightDisplay { String[] statusNames = { "Height (m)", "State", "RSSI (dBm)", "Speed (m/s)" }; Object[][] statusData = { { "0", "pad", "-50", "0" } }; @@ -62,6 +62,15 @@ public class AltosFlightUI extends JFrame { stop_display(); } + public void reset() { + flightInfo.clear(); + } + + public void show(AltosState state, int crc_errors) { + flightStatus.set(state); + flightInfo.show(state, crc_errors); + } + public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) { voice = in_voice; reader = in_reader; @@ -117,7 +126,7 @@ public class AltosFlightUI extends JFrame { this.setVisible(true); - thread = new AltosDisplayThread(this, voice, flightStatus, flightInfo, reader); + thread = new AltosDisplayThread(this, voice, this, reader); thread.start(); } |
