diff options
| author | Keith Packard <keithp@keithp.com> | 2017-10-02 19:33:37 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2017-10-02 19:33:37 -0700 | 
| commit | 98dc29a7a964f8d653b73989c6751695d168844c (patch) | |
| tree | 415e274078746fe853aad554aae1a2e5d1a57ca5 /altosui/AltosGraphUI.java | |
| parent | d75e8b9046295051c91696461e8d5f59c8260ccc (diff) | |
altoslib: Add user-selectable filter width for data smoothing
Also switch smoothing window to Kaiser and change default accel filter
width to 1 second instead of 4 seconds.
Now users can play with the filter and see what it does.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosGraphUI.java')
| -rw-r--r-- | altosui/AltosGraphUI.java | 23 | 
1 files changed, 20 insertions, 3 deletions
| diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 042f9277..f387ed9b 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -31,7 +31,7 @@ import org.jfree.chart.ChartPanel;  import org.jfree.chart.JFreeChart;  import org.jfree.ui.RefineryUtilities; -public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener +public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener, AltosFilterListener  {  	JTabbedPane		pane;  	AltosGraph		graph; @@ -82,6 +82,23 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt  			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; +	} +  	AltosGraphUI(AltosRecordSet set, File file) throws InterruptedException, IOException {  		super(file.getName());  		AltosCalData	cal_data = set.cal_data(); @@ -89,9 +106,9 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt  		pane = new JTabbedPane(); -		enable = new AltosUIEnable(); +		flight_series = new AltosUIFlightSeries(cal_data); -		AltosUIFlightSeries flight_series = new AltosUIFlightSeries(cal_data); +		enable = new AltosUIEnable(this);  		set.capture_series(flight_series); | 
