summaryrefslogtreecommitdiff
path: root/altoslib
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-02-06 20:36:44 -0800
committerKeith Packard <keithp@keithp.com>2015-02-06 20:36:44 -0800
commit35ad1833b10595564de84c88f44a214b1c134ccf (patch)
tree7a98c4e39f624ed589a66d493deda09dfe29190a /altoslib
parent66e7a8081c07d0d96a31ae34963d430f06dccdfb (diff)
altosuilib: EEProm download from TeleGPS doesn't have states
As TeleGPS doesn't have flight states, the EEProm download progress bar shouldn't show 'state invalid', and it should use a different scale for each block. Fix this by having AltosConfigData know which devices have state based on their log format, then mark the progress bar state limits as 'invalid/invalid' instead of 'boost/landed'. Then have the progress bar use that to set a more reasonable scale for each block. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib')
-rw-r--r--altoslib/AltosConfigData.java8
-rw-r--r--altoslib/AltosEepromDownload.java5
2 files changed, 12 insertions, 1 deletions
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java
index 65f6346a..0820bf56 100644
--- a/altoslib/AltosConfigData.java
+++ b/altoslib/AltosConfigData.java
@@ -577,6 +577,14 @@ public class AltosConfigData implements Iterable<String> {
dest.set_tracker_interval(tracker_interval);
}
+ public boolean log_has_state() {
+ switch (log_format) {
+ case AltosLib.AO_LOG_FORMAT_TELEGPS:
+ return false;
+ }
+ return true;
+ }
+
public void save(AltosLink link, boolean remote) throws InterruptedException, TimeoutException {
/* HAS_FLIGHT */
diff --git a/altoslib/AltosEepromDownload.java b/altoslib/AltosEepromDownload.java
index a448ee64..78a1f4be 100644
--- a/altoslib/AltosEepromDownload.java
+++ b/altoslib/AltosEepromDownload.java
@@ -254,7 +254,10 @@ public class AltosEepromDownload implements Runnable {
flights = given_flights;
success = false;
- monitor.set_states(AltosLib.ao_flight_boost, AltosLib.ao_flight_landed);
+ if (flights.config_data.log_has_state())
+ monitor.set_states(AltosLib.ao_flight_boost, AltosLib.ao_flight_landed);
+ else
+ monitor.set_states(AltosLib.ao_flight_invalid, AltosLib.ao_flight_invalid);
monitor.start();
}