X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosConfigUI.java;h=37128573c966ea39cd57fba2c7f5fab6dc8da63a;hb=9c32b93ef5fb43558fb0179ea1b047e35b7ed6e8;hp=1d8c579a8c66ccefbb030db35f6e5576d6fd628b;hpb=afea6c264c5ebf12f1d629bd4bc724da86d11b7a;p=fw%2Faltos diff --git a/ao-tools/altosui/AltosConfigUI.java b/ao-tools/altosui/AltosConfigUI.java index 1d8c579a..37128573 100644 --- a/ao-tools/altosui/AltosConfigUI.java +++ b/ao-tools/altosui/AltosConfigUI.java @@ -44,7 +44,10 @@ import altosui.AltosFlightInfoTableModel; import libaltosJNI.*; -public class AltosConfigUI extends JDialog implements ActionListener, ItemListener, DocumentListener { +public class AltosConfigUI + extends JDialog + implements ActionListener, ItemListener, DocumentListener +{ Container pane; Box box; @@ -54,6 +57,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen JLabel main_deploy_label; JLabel apogee_delay_label; JLabel radio_channel_label; + JLabel radio_calibration_label; JLabel callsign_label; public boolean dirty; @@ -65,6 +69,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen JComboBox main_deploy_value; JComboBox apogee_delay_value; JComboBox radio_channel_value; + JTextField radio_calibration_value; JTextField callsign_value; JButton save; @@ -144,6 +149,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_START; c.insets = il; + c.ipady = 5; version_label = new JLabel("Software version:"); pane.add(version_label, c); @@ -154,6 +160,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen c.weightx = 1; c.anchor = GridBagConstraints.LINE_START; c.insets = ir; + c.ipady = 5; version_value = new JLabel(""); pane.add(version_value, c); @@ -164,6 +171,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_START; c.insets = il; + c.ipady = 5; serial_label = new JLabel("Serial:"); pane.add(serial_label, c); @@ -174,6 +182,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen c.weightx = 1; c.anchor = GridBagConstraints.LINE_START; c.insets = ir; + c.ipady = 5; serial_value = new JLabel(""); pane.add(serial_value, c); @@ -184,7 +193,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_START; c.insets = il; - c.ipady = 3; + c.ipady = 5; main_deploy_label = new JLabel("Main Deploy Altitude(m):"); pane.add(main_deploy_label, c); @@ -249,7 +258,7 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen radio_channel_value.addItemListener(this); pane.add(radio_channel_value, c); - /* Callsign */ + /* Radio Calibration */ c = new GridBagConstraints(); c.gridx = 0; c.gridy = 6; c.gridwidth = 3; @@ -257,11 +266,34 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen c.anchor = GridBagConstraints.LINE_START; c.insets = il; c.ipady = 5; + radio_calibration_label = new JLabel("RF Calibration:"); + pane.add(radio_calibration_label, c); + + c = new GridBagConstraints(); + c.gridx = 3; c.gridy = 6; + c.gridwidth = 3; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + radio_calibration_value = new JTextField(String.format("%d", 1186611)); + radio_calibration_value.getDocument().addDocumentListener(this); + pane.add(radio_calibration_value, c); + + /* Callsign */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = 7; + c.gridwidth = 3; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; callsign_label = new JLabel("Callsign:"); pane.add(callsign_label, c); c = new GridBagConstraints(); - c.gridx = 3; c.gridy = 6; + c.gridx = 3; c.gridy = 7; c.gridwidth = 3; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; @@ -274,8 +306,8 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen /* Buttons */ c = new GridBagConstraints(); - c.gridx = 0; c.gridy = 7; - c.gridwidth = 2; + c.gridx = 0; c.gridy = 8; + c.gridwidth = 6; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_START; c.insets = il; @@ -285,8 +317,8 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen save.setActionCommand("save"); c = new GridBagConstraints(); - c.gridx = 2; c.gridy = 7; - c.gridwidth = 2; + c.gridx = 0; c.gridy = 8; + c.gridwidth = 6; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; c.insets = il; @@ -296,8 +328,8 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen reset.setActionCommand("reset"); c = new GridBagConstraints(); - c.gridx = 4; c.gridy = 7; - c.gridwidth = 2; + c.gridx = 0; c.gridy = 8; + c.gridwidth = 6; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.LINE_END; c.insets = il; @@ -408,6 +440,14 @@ public class AltosConfigUI extends JDialog implements ActionListener, ItemListen return radio_channel_value.getSelectedIndex(); } + public void set_radio_calibration(int new_radio_calibration) { + radio_calibration_value.setText(String.format("%d", new_radio_calibration)); + } + + public int radio_calibration() { + return Integer.parseInt(radio_calibration_value.getText()); + } + public void set_callsign(String new_callsign) { callsign_value.setText(new_callsign); }