From: Keith Packard Date: Sun, 16 Jan 2011 06:43:37 +0000 (-0800) Subject: altosui: Reset eeprom download instance variables before reading flight X-Git-Tag: debian/0.8.1+71+gda42f40~18 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=deb3c7b9206be0c9c46f75d35c8f766c26d9838f;hp=eec9eb2e81535e62c52fbb2e57a2d33f88f92c1a altosui: Reset eeprom download instance variables before reading flight To deal with downloading multiple flights in a single invocation, make sure all relevant instance variables are set back to start of flight download values each time a log is read. Signed-off-by: Keith Packard --- diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index 5d19acec..af70b15c 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -37,11 +37,13 @@ public class AltosEepromDownload implements Runnable { boolean remote; Thread eeprom_thread; AltosEepromMonitor monitor; - int flight = 0; - int year = 0, month = 0, day = 0; - boolean want_file = false; - FileWriter eeprom_file = null; - LinkedList eeprom_pending = new LinkedList(); + + int flight; + int year, month, day; + boolean want_file; + FileWriter eeprom_file; + LinkedList eeprom_pending; + AltosEepromList flights; ActionListener listener; boolean success; @@ -84,6 +86,16 @@ public class AltosEepromDownload implements Runnable { if (flights.config_data.serial == 0) throw new IOException("no serial number found"); + /* Reset per-capture variables */ + flight = 0; + year = 0; + month = 0; + day = 0; + want_file = false; + eeprom_file = null; + eeprom_pending = new LinkedList(); + + /* Set serial number in the monitor dialog window */ monitor.set_serial(flights.config_data.serial); /* Now scan the eeprom, reading blocks of data and converting to .eeprom file form */