From c607bd1442e60fec1421955c996f6aad1d98647a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Oct 2012 13:32:56 -0700 Subject: altosui: Parse .mega files from command line Signed-off-by: Keith Packard --- altosui/AltosUI.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'altosui') diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index b5cbefe7..dcc0de60 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -444,6 +444,8 @@ public class AltosUI extends AltosFrame { //AltosReplayReader reader; if (file.getName().endsWith("eeprom")) { recs = new AltosEepromIterable(in); + } else if (file.getName().endsWith("mega")) { + recs = new AltosEepromMegaIterable(in); } else { recs = new AltosTelemetryIterable(in); } -- cgit v1.2.3 From ef9cb19d8b210e02eaa1c657833c1bd5fc619ad8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 16 Oct 2012 17:13:04 -0700 Subject: altosui: Handle missing pad distance in descent tab When the GPS isn't locked, the distance from the pad cannot be computed and is left missing. Not crashing in this case is more useful. Signed-off-by: Keith Packard --- altosui/AltosDescent.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'altosui') diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index e9ff590b..a71cdc10 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -309,7 +309,10 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class Distance extends DescentValue { void show(AltosState state, int crc_errors) { - show(AltosConvert.distance, state.from_pad.distance); + if (state.from_pad != null) + show(AltosConvert.distance, state.from_pad.distance); + else + show("???"); } public Distance (GridBagLayout layout, int x, int y) { -- cgit v1.2.3 From b8d8b23ca5e6c2d3a19f8aeda2764b43d25eb9d6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 16 Oct 2012 17:14:05 -0700 Subject: altosui: Print exception stack trace when tracking flights More useful in fixing the problem Signed-off-by: Keith Packard --- altosui/AltosFlightUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'altosui') diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 533b1951..43df705e 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -138,7 +138,8 @@ public class AltosFlightUI extends AltosFrame implements AltosFlightDisplay, Alt } } } catch (Exception e) { - System.out.print("Show exception" + e); + System.out.print("Show exception " + e + "\n"); + e.printStackTrace(); } } -- cgit v1.2.3 From 440365bd17d804c2f574c35164612cf1682397d7 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 16 Oct 2012 21:54:23 -0700 Subject: altosui: Accept serial number of zero for eeprom download AVR-based products don't have a valid serial number, and so usually report 0. Accept this by making the 'no serial number' case check for negative values. Signed-off-by: Keith Packard --- altoslib/AltosConfigData.java | 1 + altosui/AltosEepromDownload.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'altosui') diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index 6f343639..a962b105 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -134,6 +134,7 @@ public class AltosConfigData implements Iterable { radio_setting = 0; radio_frequency = 0; stored_flight = 0; + serial = -1; for (;;) { String line = link.get_reply(); if (line == null) diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index a8cb24ff..a5e99749 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -314,7 +314,7 @@ public class AltosEepromDownload implements Runnable { done = false; start = true; - if (flights.config_data.serial == 0) + if (flights.config_data.serial < 0) throw new IOException("no serial number found"); /* Reset per-capture variables */ -- cgit v1.2.3