diff options
Diffstat (limited to 'telegps')
| -rw-r--r-- | telegps/TeleGPS.java | 19 | ||||
| -rw-r--r-- | telegps/TeleGPSGraphUI.java | 26 | 
2 files changed, 39 insertions, 6 deletions
diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index 3646f000..1433c9e1 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -30,7 +30,7 @@ import org.altusmetrum.altosuilib_12.*;  public class TeleGPS  	extends AltosUIFrame -	implements AltosFlightDisplay, AltosFontListener, AltosUnitsListener, ActionListener +	implements AltosFlightDisplay, AltosFontListener, AltosUnitsListener, ActionListener, AltosEepromGrapher  {  	static String[] telegps_icon_names = { @@ -280,7 +280,7 @@ public class TeleGPS  	}  	void download(){ -		new AltosEepromManage(this, AltosLib.product_telegps); +		new AltosEepromManage(this, this, AltosLib.product_telegps);  	}  	void configure() { @@ -316,6 +316,21 @@ public class TeleGPS  		}  	} +	public void graph_flights(AltosEepromList list) { +		for (AltosEepromLog log : list) { +			if (log.file != null) { +				AltosRecordSet set = record_set(log.file); +				if (set != null) { +					try { +						new TeleGPSGraphUI(set, log.file); +					} catch (InterruptedException ie) { +					} catch (IOException ie) { +					} +				} +			} +		} +	} +  	void flash() {  		AltosFlashUI.show(this);  	} diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java index 9d8c6bf5..c68f2bad 100644 --- a/telegps/TeleGPSGraphUI.java +++ b/telegps/TeleGPSGraphUI.java @@ -34,7 +34,7 @@ import org.jfree.chart.ChartPanel;  import org.jfree.chart.JFreeChart;  import org.jfree.ui.RefineryUtilities; -public class TeleGPSGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener +public class TeleGPSGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener, AltosFilterListener  {  	JTabbedPane		pane;  	AltosGraph		graph; @@ -92,20 +92,38 @@ public class TeleGPSGraphUI extends AltosUIFrame implements AltosFontListener, A  			enable.units_changed(imperial_units);  	} +	AltosUIFlightSeries flight_series; + +	public void filter_changed(double speed_filter, double accel_filter) { +		flight_series.set_filter(speed_filter, accel_filter); +		graph.filter_changed(); +		stats = new AltosFlightStats(flight_series); +		statsTable.filter_changed(stats); +	} + +	public double speed_filter() { +		return flight_series.speed_filter_width; +	} + +	public double accel_filter() { +		return flight_series.accel_filter_width; +	} +  	TeleGPSGraphUI(AltosRecordSet set, File file) throws InterruptedException, IOException {  		super(file.getName());  		AltosCalData cal_data = set.cal_data(); -		AltosUIFlightSeries flight_series = new AltosUIFlightSeries(cal_data); +		flight_series = new AltosUIFlightSeries(cal_data);  		set.capture_series(flight_series);  		flight_series.finish();  		pane = new JTabbedPane(); -		enable = new AltosUIEnable(); +		graph = new AltosGraph(enable, stats, flight_series); +  		stats = new AltosFlightStats(flight_series); -		graph = new AltosGraph(enable, stats, flight_series); +		enable = new AltosUIEnable(this);  		statsTable = new AltosFlightStatsTable(stats);  | 
