X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosGraphUI.java;h=59b06c18da42a68a03934df79a0713f528121281;hp=71aa0e6f9c719669ae54a56e182f85d510dc25a2;hb=297eb795b24ec31f6599f48bc8c3769557a7ec6f;hpb=b6b5c64f93fa56bcb22ea1c4279e4f754e6e6f1c diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 71aa0e6f..59b06c18 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -24,17 +24,17 @@ import java.util.ArrayList; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_13.*; +import org.altusmetrum.altosuilib_13.*; 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; - AltosGraphNew graph; + AltosGraph graph; AltosUIEnable enable; AltosUIMap map; AltosFlightStats stats; @@ -48,7 +48,6 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt if (flight_series.gps_series != null) { for (AltosGPSTimeValue gtv : flight_series.gps_series) { - gtv_last = gtv; AltosGPS gps = gtv.gps; if (gps != null && gps.locked && @@ -57,6 +56,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt map = new AltosUIMap(); map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time)); this.gps = gps; + gtv_last = gtv; has_gps = true; } } @@ -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); @@ -99,7 +116,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt stats = new AltosFlightStats(flight_series); - graph = new AltosGraphNew(enable, stats, flight_series, cal_data); + graph = new AltosGraph(enable, stats, flight_series); statsTable = new AltosFlightStatsTable(stats);