X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosEepromDownload.java;h=21b467401dce8dd6ddf7463488fc34f8a265d414;hb=59f355f5288b42b2e47743d06e41e55819a55f64;hp=a4d6b26ee917866e6710812de83f85dbd06c9f5e;hpb=1fc97dd9875a7639533a34438c4c7c999412eb3a;p=fw%2Faltos diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index a4d6b26e..21b46740 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -15,22 +15,16 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; -import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; import java.io.*; import java.util.*; import java.text.*; -import java.util.prefs.*; import java.util.concurrent.*; import org.altusmetrum.AltosLib.*; -import libaltosJNI.*; - public class AltosEepromDownload implements Runnable { JFrame frame; @@ -113,7 +107,7 @@ public class AltosEepromDownload implements Runnable { extension = "eeprom"; set_serial(flights.config_data.serial); - for (int i = 0; i < eechunk.chunk_size && !done; i += AltosEepromRecord.record_length) { + for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += AltosEepromRecord.record_length) { try { AltosEepromRecord r = new AltosEepromRecord(eechunk, i); if (r.cmd == Altos.AO_LOG_FLIGHT) @@ -134,7 +128,8 @@ public class AltosEepromDownload implements Runnable { } if (r.cmd == Altos.AO_LOG_STATE && r.a == Altos.ao_flight_landed) done = true; - any_valid = true; + if (r.cmd != AltosLib.AO_LOG_INVALID) + any_valid = true; Log(r); } catch (ParseException pe) { if (parse_exception == null) @@ -219,7 +214,7 @@ public class AltosEepromDownload implements Runnable { boolean any_valid = false; extension = "science"; - for (int i = 0; i < eechunk.chunk_size && !done; i += AltosEepromTeleScience.record_length) { + for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += AltosEepromTeleScience.record_length) { try { AltosEepromTeleScience r = new AltosEepromTeleScience(eechunk, i); if (r.type == AltosEepromTeleScience.AO_LOG_TELESCIENCE_START) { @@ -272,7 +267,7 @@ public class AltosEepromDownload implements Runnable { extension = "mega"; set_serial(flights.config_data.serial); - for (int i = 0; i < eechunk.chunk_size && !done; i += AltosEepromMega.record_length) { + for (int i = 0; i < AltosEepromChunk.chunk_size && !done; i += AltosEepromMega.record_length) { try { AltosEepromMega r = new AltosEepromMega(eechunk, i); if (r.cmd == Altos.AO_LOG_FLIGHT) @@ -288,7 +283,7 @@ public class AltosEepromDownload implements Runnable { if (r.cmd == Altos.AO_LOG_GPS_TIME) { year = 2000 + r.data8(14); month = r.data8(15); - day = r.data8(14); + day = r.data8(16); want_file = true; } @@ -319,7 +314,7 @@ public class AltosEepromDownload implements Runnable { done = false; start = true; - if (flights.config_data.serial == 0) + if (flights.config_data.serial < 0) throw new IOException("no serial number found"); /* Reset per-capture variables */