diff options
| author | Keith Packard <keithp@keithp.com> | 2013-08-31 23:11:39 -0500 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-08-31 23:11:39 -0500 | 
| commit | 77dc89ed5b7bf8f5b3fa3b6131660f1a98f583ea (patch) | |
| tree | f2b92c6d3e92d4b807ec945285bf15d91585367a /altosui/AltosInfoTable.java | |
| parent | c781469ff907a32bd43a5d781391b6859b14cd32 (diff) | |
altoslib/altosui: Further AltosState transition work
Parses most eeprom and telem records now; altosui updated to show from
AltosState info.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosInfoTable.java')
| -rw-r--r-- | altosui/AltosInfoTable.java | 30 | 
1 files changed, 18 insertions, 12 deletions
diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 8601d76f..8906920b 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -155,10 +155,14 @@ public class AltosInfoTable extends JTable {  				else  					info_add_row(1, "GPS", "  missing");  				info_add_row(1, "Satellites", "%6d", state.gps.nsat); -				info_add_deg(1, "Latitude", state.gps.lat, 'N', 'S'); -				info_add_deg(1, "Longitude", state.gps.lon, 'E', 'W'); -				info_add_row(1, "GPS altitude", "%6d", state.gps.alt); -				info_add_row(1, "GPS height", "%6.0f", state.gps_height); +				if (state.gps.lat != AltosRecord.MISSING) +					info_add_deg(1, "Latitude", state.gps.lat, 'N', 'S'); +				if (state.gps.lon != AltosRecord.MISSING) +					info_add_deg(1, "Longitude", state.gps.lon, 'E', 'W'); +				if (state.gps.alt != AltosRecord.MISSING) +					info_add_row(1, "GPS altitude", "%8.1f", state.gps.alt); +				if (state.gps_height != AltosRecord.MISSING) +					info_add_row(1, "GPS height", "%8.1f", state.gps_height);  				/* The SkyTraq GPS doesn't report these values */  				/* @@ -195,14 +199,16 @@ public class AltosInfoTable extends JTable {  					info_add_deg(1, "Pad longitude", state.pad_lon, 'E', 'W');  					info_add_row(1, "Pad GPS alt", "%6.0f m", state.pad_alt);  				} -				info_add_row(1, "GPS date", "%04d-%02d-%02d", -					     state.gps.year, -					     state.gps.month, -					     state.gps.day); -				info_add_row(1, "GPS time", "  %02d:%02d:%02d", -					     state.gps.hour, -					     state.gps.minute, -					     state.gps.second); +				if (state.gps.year != AltosRecord.MISSING)  +					info_add_row(1, "GPS date", "%04d-%02d-%02d", +						     state.gps.year, +						     state.gps.month, +						     state.gps.day); +				if (state.gps.hour != AltosRecord.MISSING) +					info_add_row(1, "GPS time", "  %02d:%02d:%02d", +						     state.gps.hour, +						     state.gps.minute, +						     state.gps.second);  				//int	nsat_vis = 0;  				int	c;  | 
