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;
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)
}
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)
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) {
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)
done = false;
start = true;
-// if (flights.config_data.serial == 0)
-// throw new IOException("no serial number found");
+ if (flights.config_data.serial == 0)
+ throw new IOException("no serial number found");
- log_format = 5;
- System.out.printf ("log format: %d\n", log_format);
/* Reset per-capture variables */
flight = 0;
year = 0;
state = 0; state_block = log.start_block;
for (block = log.start_block; !done && block < log.end_block; block++) {
- monitor.set_value(Altos.state_to_string[state], state, block - state_block);
+ monitor.set_value(AltosLib.state_name(state), state, block - state_block);
AltosEepromChunk eechunk = new AltosEepromChunk(serial_line, block, block == log.start_block);