From 0b0b359cbce6b818257b44b2a6aee0edcbaee40d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 2 May 2016 16:13:53 -0700 Subject: altoslib: Deal with TeleMetrum v2.0 MMA6555 being inverted Dumping the MMA655X data with the 'A' command provides the raw sensor value. On TM v2.0 boards, the sensor is inverted, and all of the firmware uses the inverted value except for the 'dump the raw data' command. As a result, MonitorIdle was using the un-inverted value and displaying mystic values. I've fixed this in the ground station code by checking the product name and conditionally inverting the value (4095 - value) for TeleMetrum v2.0 products. Unknown products will generate a warning dialog on AltosUI so we'll catch places where we've failed to add a new product name. Signed-off-by: Keith Packard --- altosui/AltosIdleMonitorUI.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'altosui') diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 2f14e2df..d789de77 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -128,6 +128,19 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl SwingUtilities.invokeLater(r); } + public void error(final String reason) { + Runnable r = new Runnable() { + public void run() { + disconnect(); + JOptionPane.showMessageDialog(AltosIdleMonitorUI.this, + reason, + "Error fetching data", + JOptionPane.ERROR_MESSAGE); + } + }; + SwingUtilities.invokeLater(r); + } + Container bag; AltosUIFreqList frequencies; JTextField callsign_value; -- cgit v1.2.3