X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosEepromDelete.java;h=73f3a00f06420dd571c61c826081304c34f3c840;hb=75d6aa6f798606f1a6c5a46542065dda81e63b2a;hp=94951ced3758c66be524b980643d394accb98fe8;hpb=0e3e4f9c1e6a6bf972514f12c9d622258aa2aec2;p=fw%2Faltos diff --git a/altosui/AltosEepromDelete.java b/altosui/AltosEepromDelete.java index 94951ced..73f3a00f 100644 --- a/altosui/AltosEepromDelete.java +++ b/altosui/AltosEepromDelete.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; @@ -42,7 +43,7 @@ public class AltosEepromDelete implements Runnable { private void DeleteLog (AltosEepromLog log) throws IOException, InterruptedException, TimeoutException { - if (flights.config_data.flight_log_max != 0) { + if (flights.config_data.flight_log_max != 0 || flights.config_data.log_format != 0) { /* Devices with newer firmware can erase the * flash blocks containing each flight @@ -90,7 +91,7 @@ public class AltosEepromDelete implements Runnable { serial_line.start_remote(); for (AltosEepromLog log : flights) { - if (log.delete) { + if (log.selected) { DeleteLog(log); } } @@ -104,10 +105,14 @@ public class AltosEepromDelete implements Runnable { serial_line.device.toShortString()), "Connection Failed"); } finally { - if (remote) - serial_line.stop_remote(); - serial_line.flush_output(); - serial_line.close(); + try { + if (remote) + serial_line.stop_remote(); + } catch (InterruptedException ie) { + } finally { + serial_line.flush_output(); + serial_line.close(); + } } if (listener != null) { Runnable r = new Runnable() {