diff options
| author | Keith Packard <keithp@keithp.com> | 2011-08-12 14:58:34 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-08-13 18:46:12 -0700 | 
| commit | c7f540330c040c521f9d7626009a406e704a5e41 (patch) | |
| tree | ac56003938abefc4b0bedcd035f804da2682fae7 /altosui/AltosFlightUI.java | |
| parent | 18369c58e62bc64b969a7cf8be3103aa33c6d4aa (diff) | |
altosui: Add companion support to the flight UI and CSV conversion
Shows the companion data in a new tab. Also put companion data into
CSV file.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosFlightUI.java')
| -rw-r--r-- | altosui/AltosFlightUI.java | 20 | 
1 files changed, 19 insertions, 1 deletions
diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index f0626e7c..51768046 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -39,8 +39,10 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {  	AltosAscent	ascent;  	AltosDescent	descent;  	AltosLanded	landed; +	AltosCompanionInfo	companion;  	AltosSiteMap    sitemap;  	boolean		has_map; +	boolean		has_companion;  	private AltosFlightStatus flightStatus;  	private AltosInfoTable flightInfo; @@ -96,7 +98,20 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {  		}  		flightStatus.show(state, crc_errors);  		flightInfo.show(state, crc_errors); -		if (state.gps != null) { + +		if (state.data.companion != null) { +			if (!has_companion) { +				pane.add("Companion", companion); +				has_companion= true; +			} +			companion.show(state, crc_errors); +		} else { +			if (has_companion) { +				pane.remove(companion); +				has_companion = false; +			} +		} +		if (state.gps != null && state.gps.connected) {  			if (!has_map) {  				pane.add("Site Map", sitemap);  				has_map = true; @@ -216,6 +231,9 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {  		flightInfo = new AltosInfoTable();  		pane.add("Table", new JScrollPane(flightInfo)); +		companion = new AltosCompanionInfo(); +		has_companion = false; +  		sitemap = new AltosSiteMap();  		has_map = false;  | 
