projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Make sure .eeprom download file is flushed on exception
[fw/altos]
/
altoslib
/
AltosEepromDownload.java
diff --git
a/altoslib/AltosEepromDownload.java
b/altoslib/AltosEepromDownload.java
index 9598bd93e88456cc5f946ad6a3496f2a0103f424..c4ddb0e7472c851d8d9e54673c383a98f33dcc4e 100644
(file)
--- a/
altoslib/AltosEepromDownload.java
+++ b/
altoslib/AltosEepromDownload.java
@@
-15,7
+15,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
6
;
+package org.altusmetrum.altoslib_
8
;
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
@@
-111,12
+111,12
@@
public class AltosEepromDownload implements Runnable {
monitor.set_flight(state.flight);
/* Monitor state transitions to update display */
monitor.set_flight(state.flight);
/* Monitor state transitions to update display */
- if (state.state != AltosLib.ao_flight_invalid &&
- state.state <= AltosLib.ao_flight_landed)
+ if (state.state
()
!= AltosLib.ao_flight_invalid &&
+ state.state
()
<= AltosLib.ao_flight_landed)
{
{
- if (state.state > AltosLib.ao_flight_pad)
+ if (state.state
()
> AltosLib.ao_flight_pad)
want_file = true;
want_file = true;
- if (state.state == AltosLib.ao_flight_landed)
+ if (state.state
()
== AltosLib.ao_flight_landed)
done = true;
}
done = true;
}
@@
-147,7
+147,6
@@
public class AltosEepromDownload implements Runnable {
/* Reset per-capture variables */
want_file = false;
/* Reset per-capture variables */
want_file = false;
- eeprom_file = null;
eeprom_pending = new LinkedList<String>();
/* Set serial number in the monitor dialog window */
eeprom_pending = new LinkedList<String>();
/* Set serial number in the monitor dialog window */
@@
-174,21
+173,17
@@
public class AltosEepromDownload implements Runnable {
CaptureEeprom (eechunk, log_format);
CaptureEeprom (eechunk, log_format);
- if (state.state
!= prev_state && state.state
!= AltosLib.ao_flight_invalid) {
+ if (state.state
() != prev_state && state.state()
!= AltosLib.ao_flight_invalid) {
state_block = block;
state_block = block;
- prev_state = state.state;
+ prev_state = state.state
()
;
}
monitor.set_value(state.state_name(),
}
monitor.set_value(state.state_name(),
- state.state,
+ state.state
()
,
block - state_block,
block - log.start_block);
}
CheckFile(true);
block - state_block,
block - log.start_block);
}
CheckFile(true);
- if (eeprom_file != null) {
- eeprom_file.flush();
- eeprom_file.close();
- }
}
public void run () {
}
public void run () {
@@
-201,11
+196,16
@@
public class AltosEepromDownload implements Runnable {
parse_exception = null;
if (log.selected) {
monitor.reset();
parse_exception = null;
if (log.selected) {
monitor.reset();
+ eeprom_file = null;
try {
CaptureLog(log);
} catch (ParseException e) {
parse_exception = e;
}
try {
CaptureLog(log);
} catch (ParseException e) {
parse_exception = e;
}
+ if (eeprom_file != null) {
+ eeprom_file.flush();
+ eeprom_file.close();
+ }
}
if (parse_exception != null) {
failed = true;
}
if (parse_exception != null) {
failed = true;