summaryrefslogtreecommitdiff
path: root/altosui/AltosAscent.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-24 05:27:57 +0900
committerKeith Packard <keithp@keithp.com>2011-03-24 05:27:57 +0900
commitf3e68341f6f5daaf26dd162e4f9a06c29988986a (patch)
tree2590305c2cc5677f190ae89f4d7ce61005d96544 /altosui/AltosAscent.java
parent1e976a105423f2da1842f70da531c9051ba88a7f (diff)
altosui: Add support for telemetry version 4
New telemetry format needed to support TeleNano and TeleMini Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosAscent.java')
-rw-r--r--altosui/AltosAscent.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java
index 64bdcf30..0fbc5de2 100644
--- a/altosui/AltosAscent.java
+++ b/altosui/AltosAscent.java
@@ -87,6 +87,16 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
void reset() {
value.setText("");
}
+
+ void show() {
+ label.show();
+ value.show();
+ }
+
+ void hide() {
+ label.hide();
+ value.hide();
+ }
public AscentValue (GridBagLayout layout, int y, String text) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1;
@@ -247,6 +257,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
class Lat extends AscentValue {
void show (AltosState state, int crc_errors) {
+ show();
if (state.gps != null)
value.setText(pos(state.gps.lat,"N", "S"));
else
@@ -261,6 +272,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
class Lon extends AscentValue {
void show (AltosState state, int crc_errors) {
+ show();
if (state.gps != null)
value.setText(pos(state.gps.lon,"E", "W"));
else
@@ -284,8 +296,13 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
}
public void show(AltosState state, int crc_errors) {
- lat.show(state, crc_errors);
- lon.show(state, crc_errors);
+ if (state.gps != null) {
+ lat.show(state, crc_errors);
+ lon.show(state, crc_errors);
+ } else {
+ lat.hide();
+ lon.hide();
+ }
height.show(state, crc_errors);
main.show(state, crc_errors);
apogee.show(state, crc_errors);