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" } };
AltosDisplayThread thread;
private Box vbox;
+
+ JTabbedPane pane;
+
+ AltosPad pad;
+
private AltosStatusTable flightStatus;
private AltosInfoTable flightInfo;
stop_display();
}
+ public void reset() {
+ pad.reset();
+ flightInfo.clear();
+ }
+
+ public void show(AltosState state, int crc_errors) {
+ pad.show(state, 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;
vbox = new Box (BoxLayout.Y_AXIS);
vbox.add(flightStatus);
+ pane = new JTabbedPane();
+
+ pad = new AltosPad();
+ pane.add("Launch Pad", pad);
+
flightInfo = new AltosInfoTable();
- vbox.add(flightInfo.box());
+ pane.add("Table", flightInfo.box());
+
+ vbox.add(pane);
this.add(vbox);
this.setVisible(true);
- thread = new AltosDisplayThread(this, voice, flightStatus, flightInfo, reader);
+ thread = new AltosDisplayThread(this, voice, this, reader);
thread.start();
}