X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosFlightUI.java;h=dcf852776a0904f4dd78850bb9300c3056440b6c;hb=8610fdae8f47e1e8b6e8525227cc912664ecfafd;hp=b44b9d43b84c4a7f3f511120a4c2e183c68f028d;hpb=cbfbaabb39f9f7709d00cf3dc63cc1bc7563062e;p=fw%2Faltos diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index b44b9d43..dcf85277 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -28,7 +28,22 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; -public class AltosFlightUI extends JFrame implements AltosFlightDisplay, AltosFontListener { +class AltosFlightStatusUpdate implements ActionListener { + + public AltosState saved_state; + AltosFlightStatus flightStatus; + + public void actionPerformed (ActionEvent e) { + if (saved_state != null) + flightStatus.show(saved_state, 0); + } + + public AltosFlightStatusUpdate (AltosFlightStatus in_flightStatus) { + flightStatus = in_flightStatus; + } +} + +public class AltosFlightUI extends AltosFrame implements AltosFlightDisplay, AltosFontListener { AltosVoice voice; AltosFlightReader reader; AltosDisplayThread thread; @@ -98,7 +113,11 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay, AltosFo set_font(); } + + AltosFlightStatusUpdate status_update; + public void show(AltosState state, int crc_errors) { + status_update.saved_state = state; JComponent tab = which_tab(state); try { pad.show(state, crc_errors); @@ -151,6 +170,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay, AltosFo AltosFreqList frequencies; JComboBox telemetries; + ActionListener show_timer; + public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) { AltosPreferences.set_component(this); @@ -289,6 +310,10 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay, AltosFo thread = new AltosDisplayThread(this, voice, this, reader); + status_update = new AltosFlightStatusUpdate(flightStatus); + + new javax.swing.Timer(100, status_update).start(); + thread.start(); }