projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "altos: Debugging TBT issues -- check pin configuration after boot"
[fw/altos]
/
altosui
/
AltosAscent.java
diff --git
a/altosui/AltosAscent.java
b/altosui/AltosAscent.java
index 64bdcf3097cc5eae63ad395e96eded6ef6ad4a9f..8a4aa58b02de03234e4d070886ceaf208f84dcb6 100644
(file)
--- a/
altosui/AltosAscent.java
+++ b/
altosui/AltosAscent.java
@@
-87,6
+87,16
@@
public class AltosAscent extends JComponent implements AltosFlightDisplay {
void reset() {
value.setText("");
}
void reset() {
value.setText("");
}
+
+ void show() {
+ label.setVisible(true);
+ value.setVisible(true);
+ }
+
+ void hide() {
+ label.setVisible(false);
+ value.setVisible(false);
+ }
public AscentValue (GridBagLayout layout, int y, String text) {
GridBagConstraints c = new GridBagConstraints();
c.weighty = 1;
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) {
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
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) {
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
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) {
}
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);
height.show(state, crc_errors);
main.show(state, crc_errors);
apogee.show(state, crc_errors);