summaryrefslogtreecommitdiff
path: root/telegps/TeleGPSGraphUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-10-02 19:33:37 -0700
committerKeith Packard <keithp@keithp.com>2017-10-02 19:33:37 -0700
commit98dc29a7a964f8d653b73989c6751695d168844c (patch)
tree415e274078746fe853aad554aae1a2e5d1a57ca5 /telegps/TeleGPSGraphUI.java
parentd75e8b9046295051c91696461e8d5f59c8260ccc (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 'telegps/TeleGPSGraphUI.java')
-rw-r--r--telegps/TeleGPSGraphUI.java26
1 files changed, 22 insertions, 4 deletions
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);