summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-09-06 16:52:51 -0700
committerKeith Packard <keithp@keithp.com>2013-09-06 16:52:51 -0700
commit0ad95614685a73856bb26a94866909e5fc025434 (patch)
treeab6586923bc94ab5e5ed398a1372be6728480266
parentb66e0d4c107a0727279d03d1d0e1e40a9eaaa3bc (diff)
altosui: Set 'flight' value in AltosEepromMonitor window during download
This feature was lost in the AltosState updates Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altosui/AltosEepromDownload.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java
index f034d73c..6e2fd061 100644
--- a/altosui/AltosEepromDownload.java
+++ b/altosui/AltosEepromDownload.java
@@ -94,10 +94,12 @@ public class AltosEepromDownload implements Runnable {
void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException {
boolean any_valid = false;
+ boolean got_flight = false;
int record_length = 8;
state.set_serial(flights.config_data.serial);
+ monitor.set_serial(flights.config_data.serial);
for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += record_length) {
AltosEeprom r = eechunk.eeprom(i, log_format, state);
@@ -109,6 +111,9 @@ public class AltosEepromDownload implements Runnable {
r.update_state(state);
+ if (!got_flight && state.flight != AltosLib.MISSING)
+ monitor.set_flight(state.flight);
+
/* Monitor state transitions to update display */
if (state.state != AltosLib.ao_flight_invalid &&
state.state <= AltosLib.ao_flight_landed)
@@ -234,7 +239,10 @@ public class AltosEepromDownload implements Runnable {
serial_line.device.toShortString(),
JOptionPane.ERROR_MESSAGE);
} catch (InterruptedException ie) {
- System.out.printf("download interrupted\n");
+ show_message(String.format("Connection to \"%s\" interrupted",
+ serial_line.device.toShortString()),
+ "Connection Interrupted",
+ JOptionPane.ERROR_MESSAGE);
} catch (TimeoutException te) {
show_message(String.format("Connection to \"%s\" failed",
serial_line.device.toShortString()),