X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosFlightUI.java;h=517680463c4f794ffb89ccdc7555c0e22e7c44f0;hb=adb7d345963ab9981c49c7cc68c6b4d7156dce46;hp=8c3f821e6c96db559153196a5bcb1e5bcb8bf813;hpb=0e3e4f9c1e6a6bf972514f12c9d622258aa2aec2;p=fw%2Faltos diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 8c3f821e..51768046 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -39,8 +39,10 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { AltosAscent ascent; AltosDescent descent; AltosLanded landed; + AltosCompanionInfo companion; AltosSiteMap sitemap; boolean has_map; + boolean has_companion; private AltosFlightStatus flightStatus; private AltosInfoTable flightInfo; @@ -96,7 +98,20 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { } flightStatus.show(state, crc_errors); flightInfo.show(state, crc_errors); - if (state.gps != null) { + + if (state.data.companion != null) { + if (!has_companion) { + pane.add("Companion", companion); + has_companion= true; + } + companion.show(state, crc_errors); + } else { + if (has_companion) { + pane.remove(companion); + has_companion = false; + } + } + if (state.gps != null && state.gps.connected) { if (!has_map) { pane.add("Site Map", sitemap); has_map = true; @@ -147,12 +162,12 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { frequencies.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double frequency = frequencies.frequency(); - reader.save_frequency(); try { reader.set_frequency(frequency); } catch (TimeoutException te) { } catch (InterruptedException ie) { } + reader.save_frequency(); } }); c.gridx = 0; @@ -210,12 +225,15 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { descent = new AltosDescent(); pane.add("Descent", descent); - landed = new AltosLanded(); + landed = new AltosLanded(reader); pane.add("Landed", landed); flightInfo = new AltosInfoTable(); pane.add("Table", new JScrollPane(flightInfo)); + companion = new AltosCompanionInfo(); + has_companion = false; + sitemap = new AltosSiteMap(); has_map = false;