From e311cefae19d7dc71fb10e9a943daa8e2313c8f8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 9 May 2017 00:22:35 -0700 Subject: altosui: Use new eeprom reading code This just means using different file opening functions, which then get matched by AltosEepromFile and sent off to the new eeprom code. Signed-off-by: Keith Packard --- altosui/AltosUI.java | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 019bbb9e..b0c6d33b 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -448,16 +448,23 @@ public class AltosUI extends AltosUIFrame { static AltosStateIterable record_iterable(File file) { FileInputStream in; - try { - in = new FileInputStream(file); - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", file); - return null; + if (file.getName().endsWith("telem")) { + try { + in = new FileInputStream(file); + return new AltosTelemetryFile(in); + } catch (Exception e) { + System.out.printf("Failed to open file '%s'\n", file); + } + } else { + + try { + AltosEepromFile f = new AltosEepromFile(new FileReader(file)); + return f; + } catch (Exception e) { + System.out.printf("Failed to open file '%s'\n", file); + } } - if (file.getName().endsWith("telem")) - return new AltosTelemetryFile(in); - else - return new AltosEepromFile(in); + return null; } static AltosReplayReader replay_file(File file) { -- cgit v1.2.3 From 0641326842bffbf4b3ae69459ca540131cb64e59 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 9 May 2017 02:31:04 -0700 Subject: altoslib: Remove older eeprom handling code The new code appears to work in minor testing; time to try it all the time. Signed-off-by: Keith Packard --- altoslib/AltosEepromFile.java | 116 +------------ altoslib/AltosEepromFireTwo.java | 125 -------------- altoslib/AltosEepromGPS.java | 173 ------------------- altoslib/AltosEepromHeader.java | 335 ------------------------------------- altoslib/AltosEepromLog.java | 41 ----- altoslib/AltosEepromMega.java | 287 ------------------------------- altoslib/AltosEepromMetrum2.java | 184 -------------------- altoslib/AltosEepromMini.java | 116 ------------- altoslib/AltosEepromRecordSet.java | 3 + altoslib/AltosEepromTM.java | 206 ----------------------- altoslib/AltosEepromTMini.java | 160 ------------------ altoslib/AltosStateIterable.java | 10 +- altoslib/Makefile.am | 10 +- altosui/AltosLanded.java | 7 +- altosui/AltosUI.java | 10 +- altosuilib/AltosDataChooser.java | 7 +- altosuilib/AltosEepromSelect.java | 6 +- 17 files changed, 32 insertions(+), 1764 deletions(-) delete mode 100644 altoslib/AltosEepromFireTwo.java delete mode 100644 altoslib/AltosEepromGPS.java delete mode 100644 altoslib/AltosEepromHeader.java delete mode 100644 altoslib/AltosEepromMega.java delete mode 100644 altoslib/AltosEepromMetrum2.java delete mode 100644 altoslib/AltosEepromMini.java delete mode 100644 altoslib/AltosEepromTM.java delete mode 100644 altoslib/AltosEepromTMini.java (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java index bb8abf87..4606e780 100644 --- a/altoslib/AltosEepromFile.java +++ b/altoslib/AltosEepromFile.java @@ -22,130 +22,26 @@ import java.io.*; import java.util.*; import java.text.*; -class AltosEepromIterator implements Iterator { - AltosState state; - Iterator body; - AltosEeprom next; - boolean seen; - - public boolean hasNext() { - return !seen || body.hasNext(); - } - - public AltosState next() { - if (seen) { - AltosState n = state.clone(); - AltosEeprom e = body.next(); - - e.update_state(n); - state = n; - } - seen = true; - return state; - } - - public void remove () { - } - - public AltosEepromIterator(AltosState start, Iterator body) { - this.state = start; - this.body = body; - this.seen = false; - } -} - public class AltosEepromFile extends AltosStateIterable { - AltosEepromIterable headers; - AltosEepromIterable body; AltosEepromRecordSet set; - AltosState start; + + public AltosConfigData config_data() { + return set.eeprom.config_data(); + } public void write_comments(PrintStream out) { - headers.write(out); } public void write(PrintStream out) { - headers.write(out); - body.write(out); + out.printf("%s\n", set.eeprom.toString()); } public AltosEepromFile(Reader input) throws IOException { set = new AltosEepromRecordSet(input); - - } - - public AltosEepromFile(FileInputStream input) { - headers = new AltosEepromIterable(AltosEepromHeader.read(input)); - - start = headers.state(); - if (start.state() != AltosLib.ao_flight_stateless) - start.set_state(AltosLib.ao_flight_pad); - - if (start.log_format == AltosLib.MISSING) { - if (start.product != null) { - if (start.product.startsWith("TeleMetrum")) - start.log_format = AltosLib.AO_LOG_FORMAT_FULL; - else if (start.product.startsWith("TeleMini")) - start.log_format = AltosLib.AO_LOG_FORMAT_TINY; - } - } - - switch (start.log_format) { - case AltosLib.AO_LOG_FORMAT_FULL: - body = new AltosEepromIterable(AltosEepromTM.read(input)); - break; - case AltosLib.AO_LOG_FORMAT_TINY: - body = new AltosEepromIterable(AltosEepromTMini.read(input)); - break; - case AltosLib.AO_LOG_FORMAT_TELEMETRY: - case AltosLib.AO_LOG_FORMAT_TELESCIENCE: - case AltosLib.AO_LOG_FORMAT_TELEMEGA: - case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD: - body = new AltosEepromIterable(AltosEepromMega.read(input, start.log_format)); - break; - case AltosLib.AO_LOG_FORMAT_TELEMETRUM: - body = new AltosEepromIterable(AltosEepromMetrum2.read(input)); - break; - case AltosLib.AO_LOG_FORMAT_TELEMINI2: - case AltosLib.AO_LOG_FORMAT_TELEMINI3: - case AltosLib.AO_LOG_FORMAT_EASYMINI: - body = new AltosEepromIterable(AltosEepromMini.read(input)); - break; - case AltosLib.AO_LOG_FORMAT_TELEGPS: - body = new AltosEepromIterable(AltosEepromGPS.read(input)); - break; - case AltosLib.AO_LOG_FORMAT_TELEFIRETWO: - body = new AltosEepromIterable(AltosEepromFireTwo.read(input)); - break; - default: - body = new AltosEepromIterable(new LinkedList()); - break; - } - - /* Find boost tick */ - AltosState state = start.clone(); - for (AltosEeprom eeprom : body) { - eeprom.update_state(state); - state.finish_update(); - if (state.state() >= AltosLib.ao_flight_boost) { - start.set_boost_tick(state.tick); - break; - } - } } public Iterator iterator() { - if (set != null) - return set.iterator(); - - AltosState state = start.clone(); - Iterator i = body.iterator(); - - while (i.hasNext() && !state.valid()) { - i.next().update_state(state); - state.finish_update(); - } - return new AltosEepromIterator(state, i); + return set.iterator(); } } diff --git a/altoslib/AltosEepromFireTwo.java b/altoslib/AltosEepromFireTwo.java deleted file mode 100644 index 16019c8c..00000000 --- a/altoslib/AltosEepromFireTwo.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright © 2017 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromFireTwo extends AltosEeprom { - public static final int record_length = 32; - - public int record_length() { return record_length; } - - /* AO_LOG_FLIGHT elements */ - public int flight() { return data16(0); } - public int idle_pres() { return data16(2); } - public int idle_thrust() { return data16(4); } - - /* AO_LOG_STATE elements */ - public int state() { return data16(0); } - public int reason() { return data16(2); } - - /* AO_LOG_SENSOR elements */ - public int pres() { return data16(0); } - public int thrust() { return data16(2); } - public int temp(int i) { return data16(4+i*2); } - - public AltosEepromFireTwo (AltosEepromChunk chunk, int start) throws ParseException { - parse_chunk(chunk, start); - } - - private static final double r_above = 5600.0; - private static final double r_below = 10000.0; - private static final double v_adc = 3.3; - - private static double firetwo_adc(int raw) { - return raw / 4095.0; - } - - public static double adc_to_pa(int adc) { - - /* raw adc to processor voltage, then back through the - * voltage divider to the sensor voltage - */ - - double v = firetwo_adc(adc) * v_adc * (r_above + r_below) / r_below; - - /* Bound to ranges provided in sensor */ - if (v < 0.5) v = 0.5; - if (v > 4.5) v = 4.5; - - double psi = (v - 0.5) / 4.0 * 1600.0; - return AltosConvert.psi_to_pa(psi); - } - - public static double adc_to_n(int adc) { - double v = firetwo_adc(adc); - - /* this is a total guess */ - return AltosConvert.lb_to_n(v * 298 * 9.807); - } - - public void update_state(AltosState state) { - super.update_state(state); - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - state.set_flight(flight()); - state.set_ground_pressure(adc_to_pa(idle_pres())); - state.set_accel_g(0, -1); - break; - case AltosLib.AO_LOG_STATE: - state.set_state(state()); - break; - case AltosLib.AO_LOG_SENSOR: - state.set_pressure(adc_to_pa(pres())); - state.set_accel(firetwo_adc(thrust()) * 100); - break; - } - } - - public AltosEepromFireTwo (String line) { - parse_string(line); - } - - static public LinkedList read(FileInputStream input) { - LinkedList firetwos = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - try { - AltosEepromFireTwo firetwo = new AltosEepromFireTwo(line); - - if (firetwo.cmd != AltosLib.AO_LOG_INVALID) - firetwos.add(firetwo); - } catch (Exception e) { - System.out.printf ("exception\n"); - } - } catch (IOException ie) { - break; - } - } - - return firetwos; - } -} diff --git a/altoslib/AltosEepromGPS.java b/altoslib/AltosEepromGPS.java deleted file mode 100644 index e76b36dd..00000000 --- a/altoslib/AltosEepromGPS.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright © 2014 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromGPS extends AltosEeprom { - public static final int record_length = 32; - - public static final int max_sat = 12; - - public int record_length() { return record_length; } - - /* AO_LOG_FLIGHT elements */ - public int flight() { return data16(0); } - public int start_altitude() { return data16(2); } - public int start_latitude() { return data32(4); } - public int start_longitude() { return data32(8); } - - /* AO_LOG_GPS_TIME elements */ - public int latitude() { return data32(0); } - public int longitude() { return data32(4); } - public int altitude_low() { return data16(8); } - public int hour() { return data8(10); } - public int minute() { return data8(11); } - public int second() { return data8(12); } - public int flags() { return data8(13); } - public int year() { return data8(14); } - public int month() { return data8(15); } - public int day() { return data8(16); } - public int course() { return data8(17); } - public int ground_speed() { return data16(18); } - public int climb_rate() { return data16(20); } - public int pdop() { return data8(22); } - public int hdop() { return data8(23); } - public int vdop() { return data8(24); } - public int mode() { return data8(25); } - public int altitude_high() { return data16(26); } - - public boolean has_seconds() { return cmd == AltosLib.AO_LOG_GPS_TIME; } - - public int seconds() { - switch (cmd) { - case AltosLib.AO_LOG_GPS_TIME: - return second() + 60 * (minute() + 60 * (hour() + 24 * (day() + 31 * month()))); - default: - return 0; - } - } - - public AltosEepromGPS (AltosEepromChunk chunk, int start) throws ParseException { - parse_chunk(chunk, start); - } - - public void update_state(AltosState state) { - super.update_state(state); - - AltosGPS gps; - - /* Flush any pending GPS changes */ - if (state.gps_pending) { - switch (cmd) { - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - state.set_temp_gps(); - break; - } - } - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - if (state.flight == AltosLib.MISSING) { - state.set_boost_tick(tick); - state.set_flight(flight()); - } - /* no place to log start lat/lon yet */ - break; - case AltosLib.AO_LOG_GPS_TIME: - state.set_tick(tick); - gps = state.make_temp_gps(false); - gps.lat = latitude() / 1e7; - gps.lon = longitude() / 1e7; - if (state.altitude_32()) - gps.alt = (altitude_low() & 0xffff) | (altitude_high() << 16); - else - gps.alt = altitude_low(); - - gps.hour = hour(); - gps.minute = minute(); - gps.second = second(); - - int flags = flags(); - - gps.connected = (flags & AltosLib.AO_GPS_RUNNING) != 0; - gps.locked = (flags & AltosLib.AO_GPS_VALID) != 0; - gps.nsat = (flags & AltosLib.AO_GPS_NUM_SAT_MASK) >> - AltosLib.AO_GPS_NUM_SAT_SHIFT; - - gps.year = 2000 + year(); - gps.month = month(); - gps.day = day(); - gps.ground_speed = ground_speed() * 1.0e-2; - gps.course = course() * 2; - gps.climb_rate = climb_rate() * 1.0e-2; - if (state.compare_version("1.4.9") >= 0) { - gps.pdop = pdop() / 10.0; - gps.hdop = hdop() / 10.0; - gps.vdop = vdop() / 10.0; - } else { - gps.pdop = pdop() / 100.0; - if (gps.pdop < 0.8) - gps.pdop += 2.56; - gps.hdop = hdop() / 100.0; - if (gps.hdop < 0.8) - gps.hdop += 2.56; - gps.vdop = vdop() / 100.0; - if (gps.vdop < 0.8) - gps.vdop += 2.56; - } - break; - } - } - - public AltosEepromGPS (String line) { - parse_string(line); - } - - static public LinkedList read(FileInputStream input) { - LinkedList tgpss = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - try { - AltosEepromGPS tgps = new AltosEepromGPS(line); - if (tgps.cmd != AltosLib.AO_LOG_INVALID) - tgpss.add(tgps); - } catch (Exception e) { - System.out.printf ("exception\n"); - } - } catch (IOException ie) { - break; - } - } - - return tgpss; - } -} diff --git a/altoslib/AltosEepromHeader.java b/altoslib/AltosEepromHeader.java deleted file mode 100644 index 37b666b4..00000000 --- a/altoslib/AltosEepromHeader.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright © 2013 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromHeader extends AltosEeprom { - - public int cmd; - public String data; - public int config_a, config_b, config_c; - public boolean last; - public boolean valid; - - public int record_length () { return 0; } - - /* XXX pull rest of config data to state */ - public void update_state(AltosState state) { - switch (cmd) { - case AltosLib.AO_LOG_CONFIG_VERSION: - break; - case AltosLib.AO_LOG_MAIN_DEPLOY: - break; - case AltosLib.AO_LOG_APOGEE_DELAY: - break; - case AltosLib.AO_LOG_RADIO_CHANNEL: - break; - case AltosLib.AO_LOG_CALLSIGN: - state.set_callsign(data); - break; - case AltosLib.AO_LOG_ACCEL_CAL: - state.set_accel_g(config_a, config_b); - break; - case AltosLib.AO_LOG_RADIO_CAL: - break; - case AltosLib.AO_LOG_MANUFACTURER: - break; - case AltosLib.AO_LOG_PRODUCT: - state.product = data; - break; - case AltosLib.AO_LOG_LOG_FORMAT: - state.set_log_format(config_a); - break; - case AltosLib.AO_LOG_SERIAL_NUMBER: - state.set_serial(config_a); - break; - case AltosLib.AO_LOG_BARO_RESERVED: - state.make_baro(); - state.baro.reserved = config_a; - break; - case AltosLib.AO_LOG_BARO_SENS: - state.make_baro(); - state.baro.sens = config_a; - break; - case AltosLib.AO_LOG_BARO_OFF: - state.make_baro(); - state.baro.off = config_a; - break; - case AltosLib.AO_LOG_BARO_TCS: - state.make_baro(); - state.baro.tcs = config_a; - break; - case AltosLib.AO_LOG_BARO_TCO: - state.make_baro(); - state.baro.tco = config_a; - break; - case AltosLib.AO_LOG_BARO_TREF: - state.make_baro(); - state.baro.tref = config_a; - break; - case AltosLib.AO_LOG_BARO_TEMPSENS: - state.make_baro(); - state.baro.tempsens = config_a; - break; - case AltosLib.AO_LOG_BARO_CRC: - state.make_baro(); - state.baro.crc = config_a; - break; - case AltosLib.AO_LOG_IMU_CAL: - state.set_accel_zero(config_a, config_b, config_c); - break; - case AltosLib.AO_LOG_SOFTWARE_VERSION: - state.set_firmware_version(data); - break; - case AltosLib.AO_LOG_FREQUENCY: - case AltosLib.AO_LOG_APOGEE_LOCKOUT: - case AltosLib.AO_LOG_RADIO_RATE: - case AltosLib.AO_LOG_IGNITE_MODE: - break; - case AltosLib.AO_LOG_PAD_ORIENTATION: - state.set_pad_orientation(config_a); - break; - case AltosLib.AO_LOG_RADIO_ENABLE: - case AltosLib.AO_LOG_AES_KEY: - case AltosLib.AO_LOG_APRS: - case AltosLib.AO_LOG_BEEP_SETTING: - case AltosLib.AO_LOG_TRACKER_SETTING: - case AltosLib.AO_LOG_PYRO_TIME: - case AltosLib.AO_LOG_APRS_ID: - break; - case AltosLib.AO_LOG_ALTITUDE_32: - state.set_altitude_32(config_a); - break; - } - } - - public void write(PrintStream out) { - switch (cmd) { - case AltosLib.AO_LOG_CONFIG_VERSION: - out.printf("# Config version: %s\n", data); - break; - case AltosLib.AO_LOG_MAIN_DEPLOY: - out.printf("# Main deploy: %s\n", config_a); - break; - case AltosLib.AO_LOG_APOGEE_DELAY: - out.printf("# Apogee delay: %s\n", config_a); - break; - case AltosLib.AO_LOG_RADIO_CHANNEL: - out.printf("# Radio channel: %s\n", config_a); - break; - case AltosLib.AO_LOG_CALLSIGN: - out.printf("# Callsign: %s\n", data); - break; - case AltosLib.AO_LOG_ACCEL_CAL: - out.printf ("# Accel cal: %d %d\n", config_a, config_b); - break; - case AltosLib.AO_LOG_RADIO_CAL: - out.printf ("# Radio cal: %d\n", config_a); - break; - case AltosLib.AO_LOG_MAX_FLIGHT_LOG: - out.printf ("# Max flight log: %d\n", config_a); - break; - case AltosLib.AO_LOG_MANUFACTURER: - out.printf ("# Manufacturer: %s\n", data); - break; - case AltosLib.AO_LOG_PRODUCT: - out.printf ("# Product: %s\n", data); - break; - case AltosLib.AO_LOG_SERIAL_NUMBER: - out.printf ("# Serial number: %d\n", config_a); - break; - case AltosLib.AO_LOG_SOFTWARE_VERSION: - out.printf ("# Software version: %s\n", data); - break; - case AltosLib.AO_LOG_BARO_RESERVED: - out.printf ("# Baro reserved: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_SENS: - out.printf ("# Baro sens: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_OFF: - out.printf ("# Baro off: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_TCS: - out.printf ("# Baro tcs: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_TCO: - out.printf ("# Baro tco: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_TREF: - out.printf ("# Baro tref: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_TEMPSENS: - out.printf ("# Baro tempsens: %d\n", config_a); - break; - case AltosLib.AO_LOG_BARO_CRC: - out.printf ("# Baro crc: %d\n", config_a); - break; - case AltosLib.AO_LOG_IMU_CAL: - out.printf ("# IMU cal: %d %d %d\n", config_a, config_b, config_c); - break; - case AltosLib.AO_LOG_FREQUENCY: - case AltosLib.AO_LOG_APOGEE_LOCKOUT: - case AltosLib.AO_LOG_RADIO_RATE: - case AltosLib.AO_LOG_IGNITE_MODE: - break; - case AltosLib.AO_LOG_PAD_ORIENTATION: - out.printf("# Pad orientation: %d\n", config_a); - break; - case AltosLib.AO_LOG_RADIO_ENABLE: - case AltosLib.AO_LOG_AES_KEY: - case AltosLib.AO_LOG_APRS: - case AltosLib.AO_LOG_BEEP_SETTING: - case AltosLib.AO_LOG_TRACKER_SETTING: - case AltosLib.AO_LOG_PYRO_TIME: - case AltosLib.AO_LOG_APRS_ID: - break; - case AltosLib.AO_LOG_ALTITUDE_32: - out.printf("# Altitude-32: %d\n", config_a); - break; - } - } - - public AltosEepromHeader (String[] tokens) { - last = false; - valid = true; - try { - if (tokens[0].equals("Config") && tokens[1].equals("version:")) { - cmd = AltosLib.AO_LOG_CONFIG_VERSION; - data = tokens[2]; - } else if (tokens[0].equals("Main") && tokens[1].equals("deploy:")) { - cmd = AltosLib.AO_LOG_MAIN_DEPLOY; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[0].equals("Apogee") && tokens[1].equals("delay:")) { - cmd = AltosLib.AO_LOG_APOGEE_DELAY; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[0].equals("Radio") && tokens[1].equals("channel:")) { - cmd = AltosLib.AO_LOG_RADIO_CHANNEL; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[0].equals("Callsign:")) { - cmd = AltosLib.AO_LOG_CALLSIGN; - data = tokens[1].replaceAll("\"",""); - } else if (tokens[0].equals("Accel") && tokens[1].equals("cal")) { - cmd = AltosLib.AO_LOG_ACCEL_CAL; - config_a = Integer.parseInt(tokens[3]); - config_b = Integer.parseInt(tokens[5]); - } else if (tokens[0].equals("Radio") && tokens[1].equals("cal:")) { - cmd = AltosLib.AO_LOG_RADIO_CAL; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[0].equals("Max") && tokens[1].equals("flight") && tokens[2].equals("log:")) { - cmd = AltosLib.AO_LOG_MAX_FLIGHT_LOG; - config_a = Integer.parseInt(tokens[3]); - } else if (tokens[0].equals("manufacturer")) { - cmd = AltosLib.AO_LOG_MANUFACTURER; - data = tokens[1]; - } else if (tokens[0].equals("product")) { - cmd = AltosLib.AO_LOG_PRODUCT; - data = tokens[1]; - } else if (tokens[0].equals("serial-number")) { - cmd = AltosLib.AO_LOG_SERIAL_NUMBER; - config_a = Integer.parseInt(tokens[1]); - } else if (tokens[0].equals("log-format")) { - cmd = AltosLib.AO_LOG_LOG_FORMAT; - config_a = Integer.parseInt(tokens[1]); - } else if (tokens[0].equals("altitude-32")) { - cmd = AltosLib.AO_LOG_ALTITUDE_32; - config_a = Integer.parseInt(tokens[1]); - } else if (tokens[0].equals("software-version")) { - cmd = AltosLib.AO_LOG_SOFTWARE_VERSION; - data = tokens[1]; - last = true; - } else if (tokens[0].equals("ms5607")) { - if (tokens[1].equals("reserved:")) { - cmd = AltosLib.AO_LOG_BARO_RESERVED; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("sens:")) { - cmd = AltosLib.AO_LOG_BARO_SENS; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("off:")) { - cmd = AltosLib.AO_LOG_BARO_OFF; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("tcs:")) { - cmd = AltosLib.AO_LOG_BARO_TCS; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("tco:")) { - cmd = AltosLib.AO_LOG_BARO_TCO; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("tref:")) { - cmd = AltosLib.AO_LOG_BARO_TREF; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("tempsens:")) { - cmd = AltosLib.AO_LOG_BARO_TEMPSENS; - config_a = Integer.parseInt(tokens[2]); - } else if (tokens[1].equals("crc:")) { - cmd = AltosLib.AO_LOG_BARO_CRC; - config_a = Integer.parseInt(tokens[2]); - } else { - cmd = AltosLib.AO_LOG_INVALID; - data = tokens[2]; - } - } else if (tokens[0].equals("IMU") && tokens[1].equals("cal")) { - cmd = AltosLib.AO_LOG_IMU_CAL; - config_a = Integer.parseInt(tokens[3]); - config_b = Integer.parseInt(tokens[5]); - config_c = Integer.parseInt(tokens[7]); - } else if (tokens[0].equals("Pad") && tokens[1].equals("orientation:")) { - cmd = AltosLib.AO_LOG_PAD_ORIENTATION; - config_a = Integer.parseInt(tokens[2]); - } else - valid = false; - } catch (Exception e) { - valid = false; - } - } - - static public LinkedList read(FileInputStream input) { - LinkedList headers = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - AltosEepromHeader header = new AltosEepromHeader(line); - headers.add(header); - if (header.last) - break; - } catch (IOException ie) { - break; - } - } - - return headers; - } - - static public void write (PrintStream out, LinkedList headers) { - out.printf("# Comments\n"); - for (AltosEepromHeader header : headers) { - header.write(out); - } - - } - - public AltosEepromHeader (String line) { - this(line.split("\\s+")); - } -} diff --git a/altoslib/AltosEepromLog.java b/altoslib/AltosEepromLog.java index 1bca6563..63e4a1f8 100644 --- a/altoslib/AltosEepromLog.java +++ b/altoslib/AltosEepromLog.java @@ -32,8 +32,6 @@ public class AltosEepromLog { public int start_block; public int end_block; - public int year, month, day; - public boolean selected; public AltosEepromLog(AltosConfigData config_data, @@ -43,7 +41,6 @@ public class AltosEepromLog { throws InterruptedException, TimeoutException { int block; - boolean has_date = false; flight = in_flight; if (flight != 0) @@ -56,43 +53,5 @@ public class AltosEepromLog { * Select all flights for download */ selected = true; - - /* - * Look in TeleMetrum log data for date - */ - if (config_data.log_format == AltosLib.AO_LOG_FORMAT_UNKNOWN || - config_data.log_format == AltosLib.AO_LOG_FORMAT_FULL) - { - /* - * Only look in the first two blocks so that this - * process doesn't take a long time - */ - if (in_end_block > in_start_block + 2) - in_end_block = in_start_block + 2; - - for (block = in_start_block; block < in_end_block; block++) { - AltosEepromChunk eechunk = new AltosEepromChunk(link, block, block == in_start_block); - - for (int i = 0; i < AltosEepromChunk.chunk_size; i += AltosEepromTM.record_length) { - try { - AltosEepromTM r = new AltosEepromTM(eechunk, i); - - if (r.cmd == AltosLib.AO_LOG_FLIGHT) { - flight = r.b; - has_flight = true; - } - if (r.cmd == AltosLib.AO_LOG_GPS_DATE) { - year = 2000 + (r.a & 0xff); - month = (r.a >> 8) & 0xff; - day = (r.b & 0xff); - has_date = true; - } - } catch (ParseException pe) { - } - } - if (has_date && has_flight) - break; - } - } } } diff --git a/altoslib/AltosEepromMega.java b/altoslib/AltosEepromMega.java deleted file mode 100644 index 082d6054..00000000 --- a/altoslib/AltosEepromMega.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright © 2011 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromMega extends AltosEeprom { - public static final int record_length = 32; - - public static final int max_sat = 12; - - private int log_format; - - public int record_length() { return record_length; } - - /* AO_LOG_FLIGHT elements */ - public int flight() { return data16(0); } - public int ground_accel() { return data16(2); } - public int ground_pres() { return data32(4); } - public int ground_accel_along() { return data16(8); } - public int ground_accel_across() { return data16(10); } - public int ground_accel_through() { return data16(12); } - public int ground_roll() { - switch (log_format) { - case AltosLib.AO_LOG_FORMAT_TELEMEGA: - return data32(16); - case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD: - return data16(14); - default: - return AltosLib.MISSING; - } - } - public int ground_pitch() { - switch (log_format) { - case AltosLib.AO_LOG_FORMAT_TELEMEGA: - return data32(20); - case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD: - return data16(16); - default: - return AltosLib.MISSING; - } - } - public int ground_yaw() { - switch (log_format) { - case AltosLib.AO_LOG_FORMAT_TELEMEGA: - return data32(24); - case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD: - return data16(18); - default: - return AltosLib.MISSING; - } - } - - /* AO_LOG_STATE elements */ - public int state() { return data16(0); } - public int reason() { return data16(2); } - - /* AO_LOG_SENSOR elements */ - public int pres() { return data32(0); } - public int temp() { return data32(4); } - public int accel_x() { return data16(8); } - public int accel_y() { return data16(10); } - public int accel_z() { return data16(12); } - public int gyro_x() { return data16(14); } - public int gyro_y() { return data16(16); } - public int gyro_z() { return data16(18); } - public int mag_x() { return data16(20); } - public int mag_y() { return data16(22); } - public int mag_z() { return data16(24); } - public int accel() { return data16(26); } - - /* AO_LOG_TEMP_VOLT elements */ - public int v_batt() { return data16(0); } - public int v_pbatt() { return data16(2); } - public int nsense() { return data16(4); } - public int sense(int i) { return data16(6 + i * 2); } - public int pyro() { return data16(26); } - - /* AO_LOG_GPS_TIME elements */ - public int latitude() { return data32(0); } - public int longitude() { return data32(4); } - public int altitude_low() { return data16(8); } - public int hour() { return data8(10); } - public int minute() { return data8(11); } - public int second() { return data8(12); } - public int flags() { return data8(13); } - public int year() { return data8(14); } - public int month() { return data8(15); } - public int day() { return data8(16); } - public int course() { return data8(17); } - public int ground_speed() { return data16(18); } - public int climb_rate() { return data16(20); } - public int pdop() { return data8(22); } - public int hdop() { return data8(23); } - public int vdop() { return data8(24); } - public int mode() { return data8(25); } - public int altitude_high() { return data16(26); } - - /* AO_LOG_GPS_SAT elements */ - public int nsat() { return data16(0); } - public int svid(int n) { return data8(2 + n * 2); } - public int c_n(int n) { return data8(2 + n * 2 + 1); } - - public AltosEepromMega (AltosEepromChunk chunk, int start, int log_format) throws ParseException { - this.log_format = log_format; - parse_chunk(chunk, start); - } - - public void update_state(AltosState state) { - super.update_state(state); - - AltosGPS gps; - - /* Flush any pending GPS changes */ - if (state.gps_pending) { - switch (cmd) { - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - state.set_temp_gps(); - break; - } - } - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - state.set_boost_tick(tick); - state.set_flight(flight()); - state.set_ground_accel(ground_accel()); - state.set_ground_pressure(ground_pres()); - state.set_accel_ground(ground_accel_along(), - ground_accel_across(), - ground_accel_through()); - state.set_gyro_zero(ground_roll() / 512.0, - ground_pitch() / 512.0, - ground_yaw() / 512.0); - break; - case AltosLib.AO_LOG_STATE: - state.set_tick(tick); - state.set_state(state()); - break; - case AltosLib.AO_LOG_SENSOR: - state.set_tick(tick); - state.set_ms5607(pres(), temp()); - - AltosIMU imu = new AltosIMU(accel_y(), /* along */ - accel_x(), /* across */ - accel_z(), /* through */ - gyro_y(), /* roll */ - gyro_x(), /* pitch */ - gyro_z()); /* yaw */ - - if (log_format == AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD) - state.check_imu_wrap(imu); - - state.set_imu(imu); - - state.set_mag(new AltosMag(mag_x(), - mag_y(), - mag_z())); - - state.set_accel(accel()); - - break; - case AltosLib.AO_LOG_TEMP_VOLT: - state.set_battery_voltage(AltosConvert.mega_battery_voltage(v_batt())); - state.set_pyro_voltage(AltosConvert.mega_pyro_voltage(v_pbatt())); - - int nsense = nsense(); - - state.set_apogee_voltage(AltosConvert.mega_pyro_voltage(sense(nsense-2))); - state.set_main_voltage(AltosConvert.mega_pyro_voltage(sense(nsense-1))); - - double voltages[] = new double[nsense-2]; - for (int i = 0; i < nsense-2; i++) - voltages[i] = AltosConvert.mega_pyro_voltage(sense(i)); - - state.set_ignitor_voltage(voltages); - state.set_pyro_fired(pyro()); - break; - case AltosLib.AO_LOG_GPS_TIME: - state.set_tick(tick); - gps = state.make_temp_gps(false); - gps.lat = latitude() / 1e7; - gps.lon = longitude() / 1e7; - - if (state.altitude_32()) - gps.alt = (altitude_low() & 0xffff) | (altitude_high() << 16); - else - gps.alt = altitude_low(); - - gps.hour = hour(); - gps.minute = minute(); - gps.second = second(); - - int flags = flags(); - - gps.connected = (flags & AltosLib.AO_GPS_RUNNING) != 0; - gps.locked = (flags & AltosLib.AO_GPS_VALID) != 0; - gps.nsat = (flags & AltosLib.AO_GPS_NUM_SAT_MASK) >> - AltosLib.AO_GPS_NUM_SAT_SHIFT; - - gps.year = 2000 + year(); - gps.month = month(); - gps.day = day(); - gps.ground_speed = ground_speed() * 1.0e-2; - gps.course = course() * 2; - gps.climb_rate = climb_rate() * 1.0e-2; - if (state.compare_version("1.4.9") >= 0) { - gps.pdop = pdop() / 10.0; - gps.hdop = hdop() / 10.0; - gps.vdop = vdop() / 10.0; - } else { - gps.pdop = pdop() / 100.0; - if (gps.pdop < 0.8) - gps.pdop += 2.56; - gps.hdop = hdop() / 100.0; - if (gps.hdop < 0.8) - gps.hdop += 2.56; - gps.vdop = vdop() / 100.0; - if (gps.vdop < 0.8) - gps.vdop += 2.56; - } - break; - case AltosLib.AO_LOG_GPS_SAT: - state.set_tick(tick); - gps = state.make_temp_gps(true); - - int n = nsat(); - if (n > max_sat) - n = max_sat; - for (int i = 0; i < n; i++) - gps.add_sat(svid(i), c_n(i)); - break; - } - } - - public AltosEepromMega (String line, int log_format) { - this.log_format = log_format; - parse_string(line); - } - - static public LinkedList read(FileInputStream input, int log_format) { - LinkedList megas = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - try { - AltosEepromMega mega = new AltosEepromMega(line, log_format); - if (mega.cmd != AltosLib.AO_LOG_INVALID) - megas.add(mega); - } catch (Exception e) { - System.out.printf ("exception\n"); - } - } catch (IOException ie) { - break; - } - } - - return megas; - } -} diff --git a/altoslib/AltosEepromMetrum2.java b/altoslib/AltosEepromMetrum2.java deleted file mode 100644 index f685b3ce..00000000 --- a/altoslib/AltosEepromMetrum2.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright © 2011 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromMetrum2 extends AltosEeprom { - public static final int record_length = 16; - - public int record_length() { return record_length; } - - /* AO_LOG_FLIGHT elements */ - public int flight() { return data16(0); } - public int ground_accel() { return data16(2); } - public int ground_pres() { return data32(4); } - public int ground_temp() { return data32(8); } - - /* AO_LOG_STATE elements */ - public int state() { return data16(0); } - public int reason() { return data16(2); } - - /* AO_LOG_SENSOR elements */ - public int pres() { return data32(0); } - public int temp() { return data32(4); } - public int accel() { return data16(8); } - - /* AO_LOG_TEMP_VOLT elements */ - public int v_batt() { return data16(0); } - public int sense_a() { return data16(2); } - public int sense_m() { return data16(4); } - - /* AO_LOG_GPS_POS elements */ - public int latitude() { return data32(0); } - public int longitude() { return data32(4); } - public int altitude_low() { return data16(8); } - public int altitude_high() { return data16(10); } - - /* AO_LOG_GPS_TIME elements */ - public int hour() { return data8(0); } - public int minute() { return data8(1); } - public int second() { return data8(2); } - public int flags() { return data8(3); } - public int year() { return data8(4); } - public int month() { return data8(5); } - public int day() { return data8(6); } - public int pdop() { return data8(7); } - - /* AO_LOG_GPS_SAT elements */ - public int nsat() { return data8(0); } - public int more() { return data8(1); } - public int svid(int n) { return data8(2 + n * 2); } - public int c_n(int n) { return data8(2 + n * 2 + 1); } - - public AltosEepromMetrum2 (AltosEepromChunk chunk, int start) throws ParseException { - parse_chunk(chunk, start); - } - - public void update_state(AltosState state) { - super.update_state(state); - - AltosGPS gps; - - /* Flush any pending GPS changes */ - if (state.gps_pending) { - switch (cmd) { - case AltosLib.AO_LOG_GPS_POS: - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - state.set_temp_gps(); - break; - } - } - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - state.set_flight(flight()); - state.set_ground_accel(ground_accel()); - state.set_ground_pressure(ground_pres()); -// state.set_temperature(ground_temp() / 100.0); - break; - case AltosLib.AO_LOG_STATE: - state.set_state(state()); - break; - case AltosLib.AO_LOG_SENSOR: - state.set_ms5607(pres(), temp()); - state.set_accel(accel()); - - break; - case AltosLib.AO_LOG_TEMP_VOLT: - state.set_battery_voltage(AltosConvert.mega_battery_voltage(v_batt())); - - state.set_apogee_voltage(AltosConvert.mega_pyro_voltage(sense_a())); - state.set_main_voltage(AltosConvert.mega_pyro_voltage(sense_m())); - - break; - case AltosLib.AO_LOG_GPS_POS: - gps = state.make_temp_gps(false); - gps.lat = latitude() / 1e7; - gps.lon = longitude() / 1e7; - if (state.altitude_32()) - gps.alt = (altitude_low() & 0xffff) | (altitude_high() << 16); - else - gps.alt = altitude_low(); - break; - case AltosLib.AO_LOG_GPS_TIME: - gps = state.make_temp_gps(false); - - gps.hour = hour(); - gps.minute = minute(); - gps.second = second(); - - int flags = flags(); - - gps.connected = (flags & AltosLib.AO_GPS_RUNNING) != 0; - gps.locked = (flags & AltosLib.AO_GPS_VALID) != 0; - gps.nsat = (flags & AltosLib.AO_GPS_NUM_SAT_MASK) >> - AltosLib.AO_GPS_NUM_SAT_SHIFT; - - gps.year = 2000 + year(); - gps.month = month(); - gps.day = day(); - gps.pdop = pdop() / 10.0; - break; - case AltosLib.AO_LOG_GPS_SAT: - gps = state.make_temp_gps(true); - - int n = nsat(); - for (int i = 0; i < n; i++) - gps.add_sat(svid(i), c_n(i)); - break; - } - } - - public AltosEepromMetrum2 (String line) { - parse_string(line); - } - - static public LinkedList read(FileInputStream input) { - LinkedList metrums = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - try { - AltosEepromMetrum2 metrum = new AltosEepromMetrum2(line); - - if (metrum.cmd != AltosLib.AO_LOG_INVALID) - metrums.add(metrum); - } catch (Exception e) { - System.out.printf ("exception\n"); - } - } catch (IOException ie) { - break; - } - } - - return metrums; - } -} diff --git a/altoslib/AltosEepromMini.java b/altoslib/AltosEepromMini.java deleted file mode 100644 index 04155071..00000000 --- a/altoslib/AltosEepromMini.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright © 2011 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromMini extends AltosEeprom { - public static final int record_length = 16; - - public int record_length() { return record_length; } - - /* AO_LOG_FLIGHT elements */ - public int flight() { return data16(0); } - public int ground_pres() { return data32(4); } - - /* AO_LOG_STATE elements */ - public int state() { return data16(0); } - public int reason() { return data16(2); } - - /* AO_LOG_SENSOR elements */ - public int pres() { return data24(0); } - public int temp() { return data24(3); } - public int sense_a() { return data16(6); } - public int sense_m() { return data16(8); } - public int v_batt() { return data16(10); } - - private double battery_voltage(AltosState state, int sensor) { - if (state.log_format == AltosLib.AO_LOG_FORMAT_EASYMINI) - return AltosConvert.easy_mini_voltage(sensor, state.serial); - if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI2) - return AltosConvert.tele_mini_2_voltage(sensor); - if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI3) - return AltosConvert.tele_mini_3_battery_voltage(sensor); - return -1; - } - - private double pyro_voltage(AltosState state, int sensor) { - if (state.log_format == AltosLib.AO_LOG_FORMAT_EASYMINI) - return AltosConvert.easy_mini_voltage(sensor, state.serial); - if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI2) - return AltosConvert.tele_mini_2_voltage(sensor); - if (state.log_format == AltosLib.AO_LOG_FORMAT_TELEMINI3) - return AltosConvert.tele_mini_3_pyro_voltage(sensor); - return -1; - } - - public void update_state(AltosState state) { - super.update_state(state); - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - state.set_flight(flight()); - state.set_ground_pressure(ground_pres()); - break; - case AltosLib.AO_LOG_STATE: - state.set_state(state()); - break; - case AltosLib.AO_LOG_SENSOR: - state.set_ms5607(pres(), temp()); - state.set_apogee_voltage(pyro_voltage(state, sense_a())); - state.set_main_voltage(pyro_voltage(state, sense_m())); - state.set_battery_voltage(battery_voltage(state, v_batt())); - break; - } - } - - public AltosEepromMini (AltosEepromChunk chunk, int start) throws ParseException { - parse_chunk(chunk, start); - } - - public AltosEepromMini (String line) { - parse_string(line); - } - - public AltosEepromMini(int in_cmd, int in_tick) { - cmd = in_cmd; - tick = in_tick; - valid = true; - } - - static public LinkedList read(FileInputStream input) { - LinkedList minis = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - AltosEepromMini mini = new AltosEepromMini(line); - minis.add(mini); - } catch (IOException ie) { - break; - } - } - - return minis; - } -} diff --git a/altoslib/AltosEepromRecordSet.java b/altoslib/AltosEepromRecordSet.java index 000d9c02..911b90b9 100644 --- a/altoslib/AltosEepromRecordSet.java +++ b/altoslib/AltosEepromRecordSet.java @@ -18,6 +18,7 @@ import java.io.*; import java.util.*; public class AltosEepromRecordSet implements Iterable { + AltosEepromNew eeprom; TreeSet ordered; AltosState start_state; @@ -52,6 +53,8 @@ public class AltosEepromRecordSet implements Iterable { } public AltosEepromRecordSet(AltosEepromNew eeprom) { + this.eeprom = eeprom; + AltosConfigData config_data = eeprom.config_data(); AltosEepromRecord record = null; diff --git a/altoslib/AltosEepromTM.java b/altoslib/AltosEepromTM.java deleted file mode 100644 index 9a09f926..00000000 --- a/altoslib/AltosEepromTM.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright © 2010 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromTM extends AltosEeprom { - public int a; - public int b; - - public static final int record_length = 8; - - public void write(PrintStream out) { - out.printf("%c %4x %4x %4x\n", cmd, tick, a, b); - } - - public int record_length() { return record_length; } - - public String string() { - return String.format("%c %4x %4x %4x\n", cmd, tick, a, b); - } - - public void update_state(AltosState state) { - super.update_state(state); - - AltosGPS gps; - - /* Flush any pending GPS changes */ - if (state.gps_pending) { - switch (cmd) { - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - state.set_temp_gps(); - break; - } - } - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - state.set_state(AltosLib.ao_flight_pad); - state.set_ground_accel(a); - state.set_flight(b); - state.set_boost_tick(tick); - break; - case AltosLib.AO_LOG_SENSOR: - state.set_accel(a); - state.set_pressure(AltosConvert.barometer_to_pressure(b)); - break; - case AltosLib.AO_LOG_PRESSURE: - state.set_pressure(AltosConvert.barometer_to_pressure(b)); - break; - case AltosLib.AO_LOG_TEMP_VOLT: - state.set_temperature(AltosConvert.thermometer_to_temperature(a)); - state.set_battery_voltage(AltosConvert.cc_battery_to_voltage(b)); - break; - case AltosLib.AO_LOG_DEPLOY: - state.set_apogee_voltage(AltosConvert.cc_ignitor_to_voltage(a)); - state.set_main_voltage(AltosConvert.cc_ignitor_to_voltage(b)); - break; - case AltosLib.AO_LOG_STATE: - state.set_state(a); - break; - case AltosLib.AO_LOG_GPS_TIME: - gps = state.make_temp_gps(false); - - gps.hour = (a & 0xff); - gps.minute = (a >> 8); - gps.second = (b & 0xff); - - int flags = (b >> 8); - - gps.connected = (flags & AltosLib.AO_GPS_RUNNING) != 0; - gps.locked = (flags & AltosLib.AO_GPS_VALID) != 0; - gps.nsat = (flags & AltosLib.AO_GPS_NUM_SAT_MASK) >> - AltosLib.AO_GPS_NUM_SAT_SHIFT; - break; - case AltosLib.AO_LOG_GPS_LAT: - gps = state.make_temp_gps(false); - - int lat32 = a | (b << 16); - gps.lat = (double) lat32 / 1e7; - break; - case AltosLib.AO_LOG_GPS_LON: - gps = state.make_temp_gps(false); - - int lon32 = a | (b << 16); - gps.lon = (double) lon32 / 1e7; - break; - case AltosLib.AO_LOG_GPS_ALT: - gps = state.make_temp_gps(false); - gps.alt = a; - break; - case AltosLib.AO_LOG_GPS_SAT: - gps = state.make_temp_gps(true); - int svid = a; - int c_n0 = b >> 8; - gps.add_sat(svid, c_n0); - break; - case AltosLib.AO_LOG_GPS_DATE: - gps = state.make_temp_gps(false); - gps.year = (a & 0xff) + 2000; - gps.month = a >> 8; - gps.day = b & 0xff; - break; - } - } - - public AltosEepromTM (AltosEepromChunk chunk, int start) throws ParseException { - - cmd = chunk.data(start); - valid = true; - - valid = !chunk.erased(start, record_length); - if (valid) { - if (AltosConvert.checksum(chunk.data, start, record_length) != 0) - throw new ParseException(String.format("invalid checksum at 0x%x", - chunk.address + start), 0); - } else { - cmd = AltosLib.AO_LOG_INVALID; - } - - tick = chunk.data16(start + 2); - a = chunk.data16(start + 4); - b = chunk.data16(start + 6); - } - - public AltosEepromTM (String line) { - valid = false; - tick = 0; - a = 0; - b = 0; - if (line == null) { - cmd = AltosLib.AO_LOG_INVALID; - } else { - try { - String[] tokens = line.split("\\s+"); - - if (tokens[0].length() == 1) { - if (tokens.length != 4) { - cmd = AltosLib.AO_LOG_INVALID; - } else { - cmd = tokens[0].codePointAt(0); - tick = Integer.parseInt(tokens[1],16); - valid = true; - a = Integer.parseInt(tokens[2],16); - b = Integer.parseInt(tokens[3],16); - } - } else { - cmd = AltosLib.AO_LOG_INVALID; - } - } catch (NumberFormatException ne) { - cmd = AltosLib.AO_LOG_INVALID; - } - } - } - - public AltosEepromTM(int in_cmd, int in_tick, int in_a, int in_b) { - valid = true; - cmd = in_cmd; - tick = in_tick; - a = in_a; - b = in_b; - } - - static public LinkedList read(FileInputStream input) { - LinkedList tms = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - AltosEepromTM tm = new AltosEepromTM(line); - tms.add(tm); - } catch (IOException ie) { - break; - } - } - - return tms; - } - -} diff --git a/altoslib/AltosEepromTMini.java b/altoslib/AltosEepromTMini.java deleted file mode 100644 index 2557f431..00000000 --- a/altoslib/AltosEepromTMini.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright © 2010 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.altusmetrum.altoslib_11; - -import java.io.*; -import java.util.*; -import java.text.*; - -public class AltosEepromTMini extends AltosEeprom { - public int i; - public int a; - public int b; - - public static final int record_length = 2; - - public void write(PrintStream out) { - out.printf("%c %4x %4x %4x\n", cmd, tick, a, b); - } - - public int record_length() { return record_length; } - - public String string() { - return String.format("%c %4x %4x %4x\n", cmd, tick, a, b); - } - - public void update_state(AltosState state) { - super.update_state(state); - - switch (cmd) { - case AltosLib.AO_LOG_FLIGHT: - state.set_state(AltosLib.ao_flight_boost); - state.set_flight(b); - break; - case AltosLib.AO_LOG_PRESSURE: - if (tick == 0) - state.set_ground_pressure(AltosConvert.barometer_to_pressure(b)); - else - state.set_pressure(AltosConvert.barometer_to_pressure(b)); - break; - case AltosLib.AO_LOG_STATE: - state.set_state(a); - break; - } - } - - public AltosEepromTMini (AltosEepromChunk chunk, int start, AltosState state) throws ParseException { - int value = chunk.data16(start); - - int i = (chunk.address + start) / record_length; - - cmd = chunk.data(start); - valid = true; - - valid = !chunk.erased(start, record_length); - - switch (i) { - case 0: - cmd = AltosLib.AO_LOG_FLIGHT; - tick = 0; - a = 0; - b = value; - break; - case 1: - cmd = AltosLib.AO_LOG_PRESSURE; - tick = 0; - a = 0; - b = value; - break; - default: - if ((value & 0x8000) != 0) { - cmd = AltosLib.AO_LOG_STATE; - tick = state.tick; - a = value & 0x7fff; - b = 0; - } else { - if (state.ascent) - tick = state.tick + 10; - else - tick = state.tick + 100; - cmd = AltosLib.AO_LOG_PRESSURE; - a = 0; - b = value; - } - break; - } - } - - public AltosEepromTMini (String line) { - valid = false; - tick = 0; - a = 0; - b = 0; - if (line == null) { - cmd = AltosLib.AO_LOG_INVALID; - } else { - try { - String[] tokens = line.split("\\s+"); - - if (tokens[0].length() == 1) { - if (tokens.length != 4) { - cmd = AltosLib.AO_LOG_INVALID; - } else { - cmd = tokens[0].codePointAt(0); - tick = Integer.parseInt(tokens[1],16); - valid = true; - a = Integer.parseInt(tokens[2],16); - b = Integer.parseInt(tokens[3],16); - } - } else { - cmd = AltosLib.AO_LOG_INVALID; - } - } catch (NumberFormatException ne) { - cmd = AltosLib.AO_LOG_INVALID; - } - } - } - - public AltosEepromTMini(int in_cmd, int in_tick, int in_a, int in_b) { - valid = true; - cmd = in_cmd; - tick = in_tick; - a = in_a; - b = in_b; - } - - static public LinkedList read(FileInputStream input) { - LinkedList tms = new LinkedList(); - - for (;;) { - try { - String line = AltosLib.gets(input); - if (line == null) - break; - AltosEepromTMini tm = new AltosEepromTMini(line); - tms.add(tm); - } catch (IOException ie) { - break; - } - } - - return tms; - } - -} diff --git a/altoslib/AltosStateIterable.java b/altoslib/AltosStateIterable.java index 5332aecd..ec3d944d 100644 --- a/altoslib/AltosStateIterable.java +++ b/altoslib/AltosStateIterable.java @@ -29,15 +29,13 @@ public abstract class AltosStateIterable implements Iterable { public abstract void write(PrintStream out); public static AltosStateIterable iterable(File file) { - FileInputStream in; try { - in = new FileInputStream(file); + if (file.getName().endsWith("telem")) + return new AltosTelemetryFile(new FileInputStream(file)); + else + return new AltosEepromFile(new FileReader(file)); } catch (Exception e) { return null; } - if (file.getName().endsWith("telem")) - return new AltosTelemetryFile(in); - else - return new AltosEepromFile(in); } } diff --git a/altoslib/Makefile.am b/altoslib/Makefile.am index 2bcd934f..ad3fc682 100644 --- a/altoslib/Makefile.am +++ b/altoslib/Makefile.am @@ -47,19 +47,11 @@ altoslib_JAVA = \ AltosEeprom.java \ AltosEepromChunk.java \ AltosEepromDownload.java \ + AltosEepromMonitor.java \ AltosEepromFile.java \ - AltosEepromTM.java \ - AltosEepromTMini.java \ - AltosEepromHeader.java \ AltosEepromIterable.java \ AltosEepromList.java \ AltosEepromLog.java \ - AltosEepromMega.java \ - AltosEepromMetrum2.java \ - AltosEepromMini.java \ - AltosEepromGPS.java \ - AltosEepromMonitor.java \ - AltosEepromFireTwo.java \ AltosFile.java \ AltosFlash.java \ AltosFlashListener.java \ diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index ded08537..25d4fcc8 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -125,7 +125,7 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener { try { AltosStateIterable states = null; if (filename.endsWith("eeprom")) { - FileInputStream in = new FileInputStream(file); + FileReader in = new FileReader(file); states = new AltosEepromFile(in); } else if (filename.endsWith("telem")) { FileInputStream in = new FileInputStream(file); @@ -143,6 +143,11 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener { fe.getMessage(), "Cannot open file", JOptionPane.ERROR_MESSAGE); + } catch (IOException ie) { + JOptionPane.showMessageDialog(null, + ie.getMessage(), + "Error reading file file", + JOptionPane.ERROR_MESSAGE); } } } diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index b0c6d33b..72c3c161 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -367,16 +367,16 @@ public class AltosUI extends AltosUIFrame { static AltosStateIterable open_logfile(File file) { try { - FileInputStream in; - - in = new FileInputStream(file); if (file.getName().endsWith("telem")) - return new AltosTelemetryFile(in); + return new AltosTelemetryFile(new FileInputStream(file)); else - return new AltosEepromFile(in); + return new AltosEepromFile(new FileReader(file)); } catch (FileNotFoundException fe) { System.out.printf("%s\n", fe.getMessage()); return null; + } catch (IOException ie) { + System.out.printf("%s\n", ie.getMessage()); + return null; } } diff --git a/altosuilib/AltosDataChooser.java b/altosuilib/AltosDataChooser.java index 8758fc34..a8c74926 100644 --- a/altosuilib/AltosDataChooser.java +++ b/altosuilib/AltosDataChooser.java @@ -47,7 +47,7 @@ public class AltosDataChooser extends JFileChooser { filename = file.getName(); try { if (filename.endsWith("eeprom")) { - FileInputStream in = new FileInputStream(file); + FileReader in = new FileReader(file); return new AltosEepromFile(in); } else if (filename.endsWith("telem")) { FileInputStream in = new FileInputStream(file); @@ -60,6 +60,11 @@ public class AltosDataChooser extends JFileChooser { fe.getMessage(), "Cannot open file", JOptionPane.ERROR_MESSAGE); + } catch (IOException ie) { + JOptionPane.showMessageDialog(frame, + ie.getMessage(), + "Error reading file", + JOptionPane.ERROR_MESSAGE); } } return null; diff --git a/altosuilib/AltosEepromSelect.java b/altosuilib/AltosEepromSelect.java index 0b4b7a85..2c6ee6d7 100644 --- a/altosuilib/AltosEepromSelect.java +++ b/altosuilib/AltosEepromSelect.java @@ -38,11 +38,7 @@ class AltosEepromItem implements ActionListener { log = in_log; String text; - if (log.year != 0) - text = String.format("Flight #%02d - %04d-%02d-%02d", - log.flight, log.year, log.month, log.day); - else - text = String.format("Flight #%02d", log.flight); + text = String.format("Flight #%02d", log.flight); label = new JLabel(text); -- cgit v1.2.3 From bbe0c2e0a3216f40f49af34b756330ba28d7c7e1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 12 May 2017 00:01:14 -0700 Subject: altosui: Hacks to plug into the new graph stuff Signed-off-by: Keith Packard --- altosui/AltosGraphUI.java | 8 ++++---- altosui/AltosLanded.java | 4 +++- altosui/AltosUI.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 4ca2b77c..50a1948e 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -34,7 +34,7 @@ import org.jfree.ui.RefineryUtilities; public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener { JTabbedPane pane; - AltosGraph graph; + AltosGraphNew graph; AltosUIEnable enable; AltosUIMap map; AltosState state; @@ -69,7 +69,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt enable.units_changed(imperial_units); } - AltosGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException { + AltosGraphUI(AltosStateIterable states, AltosRecordSet record_set, File file) throws InterruptedException, IOException { super(file.getName()); state = null; @@ -78,9 +78,9 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt enable = new AltosUIEnable(); stats = new AltosFlightStats(states); - graphDataSet = new AltosGraphDataSet(states); +// graphDataSet = new AltosGraphDataSet(states); - graph = new AltosGraph(enable, stats, graphDataSet); + graph = new AltosGraphNew(enable, stats, record_set); statsTable = new AltosFlightStatsTable(stats); diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 25d4fcc8..95cab605 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -124,9 +124,11 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener { String filename = file.getName(); try { AltosStateIterable states = null; + AltosRecordSet record_set = null; if (filename.endsWith("eeprom")) { FileReader in = new FileReader(file); states = new AltosEepromFile(in); + record_set = new AltosEepromRecordSet(new FileReader(file)); } else if (filename.endsWith("telem")) { FileInputStream in = new FileInputStream(file); states = new AltosTelemetryFile(in); @@ -134,7 +136,7 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener { throw new FileNotFoundException(filename); } try { - new AltosGraphUI(states, file); + new AltosGraphUI(states, record_set, file); } catch (InterruptedException ie) { } catch (IOException ie) { } diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 72c3c161..7caaa3e9 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -348,7 +348,7 @@ public class AltosUI extends AltosUIFrame { if (states == null) return; try { - new AltosGraphUI(states, chooser.file()); + new AltosGraphUI(states, new AltosEepromRecordSet(new FileReader(chooser.file())), chooser.file()); } catch (InterruptedException ie) { } catch (IOException ie) { } @@ -487,7 +487,7 @@ public class AltosUI extends AltosUIFrame { if (states == null) return false; try { - new AltosGraphUI(states, file); + new AltosGraphUI(states, new AltosEepromRecordSet(new FileReader(file)), file); return true; } catch (InterruptedException ie) { } catch (IOException ie) { -- cgit v1.2.3 From 4d497c1be534e2b206edec3c096198c8ea64cebe Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 May 2017 17:29:31 -0700 Subject: altosui: Adapt to AltosFlightSeries for data analysis Signed-off-by: Keith Packard --- altosui/AltosFlightStatus.java | 18 ++++--- altosui/AltosFlightUI.java | 2 +- altosui/AltosGraphUI.java | 40 +++++++++------ altosui/AltosLanded.java | 7 +-- altosui/AltosPad.java | 6 +-- altosui/AltosUI.java | 110 +++++++++++++++++++++++------------------ 6 files changed, 102 insertions(+), 81 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index 4288fc9f..26f0379a 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -120,13 +120,14 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay int last_serial = -1; void show(AltosState state, AltosListenerState listener_state) { - if (state.serial != last_serial) { + AltosCalData cal_data = state.cal_data; + if (cal_data.serial != last_serial) { show(); - if (state.serial == AltosLib.MISSING) + if (cal_data.serial == AltosLib.MISSING) value.setText("none"); else - value.setText(String.format("%d", state.serial)); - last_serial = state.serial; + value.setText(String.format("%d", cal_data.serial)); + last_serial = cal_data.serial; } } @@ -147,13 +148,14 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay int last_flight = -1; void show(AltosState state, AltosListenerState listener_state) { - if (state.flight != last_flight) { + AltosCalData cal_data = state.cal_data; + if (cal_data.flight != last_flight) { show(); - if (state.flight == AltosLib.MISSING) + if (cal_data.flight == AltosLib.MISSING) value.setText("none"); else - value.setText(String.format("%d", state.flight)); - last_flight = state.flight; + value.setText(String.format("%d", cal_data.flight)); + last_flight = cal_data.flight; } } diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index cf03d2dc..3d33b6e5 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -101,7 +101,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { status_update.saved_listener_state = listener_state; if (state == null) - state = new AltosState(); + state = new AltosState(new AltosCalData()); if (state.state() != Altos.ao_flight_startup) { if (!has_state) { diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 50a1948e..5314a3b6 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -37,19 +37,23 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt AltosGraphNew graph; AltosUIEnable enable; AltosUIMap map; - AltosState state; - AltosGraphDataSet graphDataSet; AltosFlightStats stats; AltosFlightStatsTable statsTable; + AltosGPS gps; boolean has_gps; - void fill_map(AltosStateIterable states) { - boolean any_gps = false; - for (AltosState state : states) { - if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) { + void fill_map(AltosFlightSeries flight_series) { + boolean any_gps = false; + + for (AltosGPSTimeValue gtv : flight_series.gps_series) { + AltosGPS gps = gtv.gps; + if (gps != null && + gps.locked && + gps.nsat >= 4) { if (map == null) map = new AltosUIMap(); - map.show(state, null); + map.show(gps, AltosLib.ao_flight_pad); + this.gps = gps; has_gps = true; } } @@ -69,18 +73,24 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt enable.units_changed(imperial_units); } - AltosGraphUI(AltosStateIterable states, AltosRecordSet record_set, File file) throws InterruptedException, IOException { + AltosGraphUI(AltosRecordSet set, File file) throws InterruptedException, IOException { super(file.getName()); - state = null; + AltosCalData cal_data = set.cal_data(); + pane = new JTabbedPane(); enable = new AltosUIEnable(); - stats = new AltosFlightStats(states); -// graphDataSet = new AltosGraphDataSet(states); + AltosUIFlightSeries flight_series = new AltosUIFlightSeries(cal_data); + + set.capture_series(flight_series); + + flight_series.fill_in(); + + stats = new AltosFlightStats(flight_series); - graph = new AltosGraphNew(enable, stats, record_set); + graph = new AltosGraphNew(enable, stats, flight_series, cal_data); statsTable = new AltosFlightStatsTable(stats); @@ -89,7 +99,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt pane.add("Flight Statistics", statsTable); has_gps = false; - fill_map(states); + fill_map(flight_series); if (has_gps) pane.add("Map", map); @@ -108,7 +118,7 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt pack(); setVisible(true); - if (state != null && has_gps) - map.centre(state); + if (gps != null) + map.centre(gps); } } diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 95cab605..a75d5a9f 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -123,20 +123,17 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener { if (file != null) { String filename = file.getName(); try { - AltosStateIterable states = null; AltosRecordSet record_set = null; if (filename.endsWith("eeprom")) { - FileReader in = new FileReader(file); - states = new AltosEepromFile(in); record_set = new AltosEepromRecordSet(new FileReader(file)); } else if (filename.endsWith("telem")) { FileInputStream in = new FileInputStream(file); - states = new AltosTelemetryFile(in); + record_set = new AltosTelemetryFile(in); } else { throw new FileNotFoundException(filename); } try { - new AltosGraphUI(states, record_set, file); + new AltosGraphUI(record_set, file); } catch (InterruptedException ie) { } catch (IOException ie) { } diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index d411c969..73da9933 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -46,10 +46,10 @@ public class AltosPad extends AltosUIFlightTab { class LoggingReady extends AltosUIIndicator { public void show (AltosState state, AltosListenerState listener_state) { - if (state == null || state.flight == AltosLib.MISSING) { + if (state == null || state.cal_data.flight == AltosLib.MISSING) { hide(); } else { - if (state.flight != 0) { + if (state.cal_data.flight != 0) { if (state.state() <= Altos.ao_flight_pad) show("Ready to record"); else if (state.state() < Altos.ao_flight_landed || @@ -59,7 +59,7 @@ public class AltosPad extends AltosUIFlightTab { show("Recorded data"); } else show("Storage full"); - set_lights(state.flight != 0); + set_lights(state.cal_data.flight != 0); } } public LoggingReady (AltosUIFlightTab container, int y) { diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 7caaa3e9..a6e422e6 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -310,12 +310,13 @@ public class AltosUI extends AltosUIFrame { AltosDataChooser chooser = new AltosDataChooser( AltosUI.this); - Iterable states = chooser.runDialog(); - if (states != null) { - AltosFlightReader reader = new AltosReplayReader(states.iterator(), - chooser.file()); - new AltosFlightUI(voice, reader); - } + AltosRecordSet set = chooser.runDialog(); +/* XXX fixme */ +// if (states != null) { +// AltosFlightReader reader = new AltosReplayReader(states.iterator(), +// chooser.file()); +// new AltosFlightUI(voice, reader); +// } } /* Connect to TeleMetrum, either directly or through @@ -325,6 +326,12 @@ public class AltosUI extends AltosUIFrame { new AltosEepromManage(AltosUI.this, AltosLib.product_any); } + private static AltosFlightSeries make_series(AltosRecordSet set) { + AltosFlightSeries series = new AltosFlightSeries(new AltosCalData()); + set.capture_series(series); + return series; + } + /* Load a flight log file and write out a CSV file containing * all of the data in standard units */ @@ -332,10 +339,11 @@ public class AltosUI extends AltosUIFrame { private void ExportData() { AltosDataChooser chooser; chooser = new AltosDataChooser(this); - AltosStateIterable states = chooser.runDialog(); - if (states == null) + AltosRecordSet set = chooser.runDialog(); + if (set == null) return; - new AltosCSVUI(AltosUI.this, states, chooser.file()); + AltosFlightSeries series = make_series(set); + new AltosCSVUI(AltosUI.this, series, series.cal_data, chooser.file()); } /* Load a flight log CSV file and display a pretty graph. @@ -344,11 +352,11 @@ public class AltosUI extends AltosUIFrame { private void GraphData() { AltosDataChooser chooser; chooser = new AltosDataChooser(this); - AltosStateIterable states = chooser.runDialog(); - if (states == null) + AltosRecordSet set = chooser.runDialog(); + if (set == null) return; try { - new AltosGraphUI(states, new AltosEepromRecordSet(new FileReader(chooser.file())), chooser.file()); + new AltosGraphUI(set, chooser.file()); } catch (InterruptedException ie) { } catch (IOException ie) { } @@ -365,7 +373,7 @@ public class AltosUI extends AltosUIFrame { } } - static AltosStateIterable open_logfile(File file) { + static AltosRecordSet open_logfile(File file) { try { if (file.getName().endsWith("telem")) return new AltosTelemetryFile(new FileInputStream(file)); @@ -407,8 +415,8 @@ public class AltosUI extends AltosUIFrame { static final int process_cat = 6; static boolean process_csv(File input) { - AltosStateIterable states = open_logfile(input); - if (states == null) + AltosRecordSet set = open_logfile(input); + if (set == null) return false; File output = Altos.replace_extension(input,".csv"); @@ -420,15 +428,16 @@ public class AltosUI extends AltosUIFrame { AltosWriter writer = open_csv(output); if (writer == null) return false; - writer.write(states); + AltosFlightSeries series = make_series(set); + writer.write(series); writer.close(); } return true; } static boolean process_kml(File input) { - AltosStateIterable states = open_logfile(input); - if (states == null) + AltosRecordSet set = open_logfile(input); + if (set == null) return false; File output = Altos.replace_extension(input,".kml"); @@ -440,13 +449,14 @@ public class AltosUI extends AltosUIFrame { AltosWriter writer = open_kml(output); if (writer == null) return false; - writer.write(states); + AltosFlightSeries series = make_series(set); + writer.write(series); writer.close(); return true; } } - static AltosStateIterable record_iterable(File file) { + static AltosRecordSet record_set(File file) { FileInputStream in; if (file.getName().endsWith("telem")) { try { @@ -468,10 +478,11 @@ public class AltosUI extends AltosUIFrame { } static AltosReplayReader replay_file(File file) { - AltosStateIterable states = record_iterable(file); - if (states == null) + AltosRecordSet set = record_set(file); + if (set == null) return null; - return new AltosReplayReader(states.iterator(), file); +// return new AltosReplayReader(states.iterator(), file); + return null; } static boolean process_replay(File file) { @@ -483,11 +494,11 @@ public class AltosUI extends AltosUIFrame { } static boolean process_graph(File file) { - AltosStateIterable states = record_iterable(file); - if (states == null) + AltosRecordSet set = record_set(file); + if (set == null) return false; try { - new AltosGraphUI(states, new AltosEepromRecordSet(new FileReader(file)), file); + new AltosGraphUI(set, file); return true; } catch (InterruptedException ie) { } catch (IOException ie) { @@ -496,12 +507,13 @@ public class AltosUI extends AltosUIFrame { } static boolean process_summary(File file) { - AltosStateIterable states = record_iterable(file); - if (states == null) + AltosRecordSet set = record_set(file); + if (set == null) return false; try { System.out.printf("%s:\n", file.toString()); - AltosFlightStats stats = new AltosFlightStats(states); + AltosFlightSeries series = make_series(set); + AltosFlightStats stats = new AltosFlightStats(series); if (stats.serial != AltosLib.MISSING) System.out.printf("Serial: %5d\n", stats.serial); if (stats.flight != AltosLib.MISSING) @@ -550,26 +562,26 @@ public class AltosUI extends AltosUIFrame { static boolean process_cat(File file) { try { - AltosStateIterable eef = record_iterable(file); - - for (AltosState state : eef) { - if ((state.set & AltosState.set_gps) != 0) { - System.out.printf ("time %d %d-%d-%d %d:%d:%d lat %g lon %g alt %g\n", - state.gps.seconds(), - state.gps.year, - state.gps.month, - state.gps.day, - state.gps.hour, - state.gps.minute, - state.gps.second, - state.gps.lat, - state.gps.lon, - state.gps.alt); - } else { - System.out.printf ("tick %d state %d height %g\n", - state.tick, state.state(), state.height()); - } - } + AltosRecordSet set = record_set(file); + +// for (AltosState state : eef) { +// if ((state.set & AltosState.set_gps) != 0) { +// System.out.printf ("time %d %d-%d-%d %d:%d:%d lat %g lon %g alt %g\n", +// state.gps.seconds(), +// state.gps.year, +// state.gps.month, +// state.gps.day, +// state.gps.hour, +// state.gps.minute, +// state.gps.second, +// state.gps.lat, +// state.gps.lon, +// state.gps.alt); +// } else { +// System.out.printf ("tick %d state %d height %g\n", +// state.tick, state.state(), state.height()); +// } +// } } catch (Exception e) { System.out.printf("Failed to open file '%s'\n", file); -- cgit v1.2.3 From 222158581887b5f9e8b9843d14321c313fa023fa Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 May 2017 22:36:05 -0700 Subject: altoslib/altosuilib/altosui: More work towards using AltosFlightSeries for analysis Graphing and CSV seem complete now; stats still missing lots of stuff. Signed-off-by: Keith Packard --- altoslib/AltosCSV.java | 68 ++++--- altoslib/AltosCalData.java | 11 +- altoslib/AltosConvert.java | 6 +- altoslib/AltosDataListener.java | 2 +- altoslib/AltosDistance.java | 2 +- altoslib/AltosEepromDownload.java | 2 +- altoslib/AltosEepromNew.java | 3 +- altoslib/AltosEepromRecord.java | 2 +- altoslib/AltosEepromRecordFull.java | 4 +- altoslib/AltosEepromRecordMega.java | 3 +- altoslib/AltosFlightListener.java | 2 +- altoslib/AltosFlightSeries.java | 211 +++++++++++++++++--- altoslib/AltosFlightStats.java | 6 +- altoslib/AltosLib.java | 2 +- altoslib/AltosMapLine.java | 32 +-- altoslib/AltosPyroName.java | 32 +++ altoslib/AltosSensorMega.java | 6 +- altoslib/AltosSensorTM.java | 4 +- altoslib/AltosState.java | 8 +- altoslib/AltosTelemetryFile.java | 4 +- altoslib/AltosTelemetryLegacy.java | 4 +- altoslib/AltosTelemetryLocation.java | 8 +- altoslib/AltosTelemetryMegaData.java | 2 +- altoslib/AltosTelemetrySensor.java | 4 +- altoslib/AltosTimeSeries.java | 65 +++++- altoslib/Makefile.am | 1 + altosui/AltosFlightUI.java | 22 +- altosui/AltosGraphUI.java | 9 +- altosui/AltosIdleMonitorUI.java | 24 +-- altosui/AltosIgnitor.java | 42 ++-- altosui/AltosUI.java | 2 +- altosuilib/AltosGraphNew.java | 377 +++++++++++------------------------ altosuilib/AltosUIFlightSeries.java | 15 +- altosuilib/AltosUITimeSeries.java | 15 +- 34 files changed, 555 insertions(+), 445 deletions(-) create mode 100644 altoslib/AltosPyroName.java (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosCSV.java b/altoslib/AltosCSV.java index 0cfe4c94..38afdc64 100644 --- a/altoslib/AltosCSV.java +++ b/altoslib/AltosCSV.java @@ -192,31 +192,42 @@ public class AltosCSV implements AltosWriter { out.printf("accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z,mag_x,mag_y,mag_z"); } + double accel_along() { return series.value(AltosFlightSeries.accel_along_name, indices); } + double accel_across() { return series.value(AltosFlightSeries.accel_across_name, indices); } + double accel_through() { return series.value(AltosFlightSeries.accel_through_name, indices); } + + double gyro_roll() { return series.value(AltosFlightSeries.gyro_roll_name, indices); } + double gyro_pitch() { return series.value(AltosFlightSeries.gyro_pitch_name, indices); } + double gyro_yaw() { return series.value(AltosFlightSeries.gyro_yaw_name, indices); } + + double mag_along() { return series.value(AltosFlightSeries.mag_along_name, indices); } + double mag_across() { return series.value(AltosFlightSeries.mag_across_name, indices); } + double mag_through() { return series.value(AltosFlightSeries.mag_through_name, indices); } + void write_advanced() { -/* out.printf("%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f,%7.2f", - state.accel_along(), state.accel_across(), state.accel_through(), - state.gyro_roll(), state.gyro_pitch(), state.gyro_yaw(), - state.mag_along(), state.mag_across(), state.mag_through()); -*/ + accel_along(), accel_across(), accel_through(), + gyro_roll(), gyro_pitch(), gyro_yaw(), + mag_along(), mag_across(), mag_through()); } void write_gps_header() { -/* out.printf("connected,locked,nsat,latitude,longitude,altitude,year,month,day,hour,minute,second,pad_dist,pad_range,pad_az,pad_el,pdop,hdop,vdop"); -*/ } void write_gps() { -/* - AltosGPS gps = state.gps; - if (gps == null) - gps = new AltosGPS(); + AltosGPS gps = series.gps_before(series.time(indices)); - AltosGreatCircle from_pad = state.from_pad; - if (from_pad == null) + AltosGreatCircle from_pad; + + if (series.cal_data.gps_pad != null && gps != null) + from_pad = new AltosGreatCircle(series.cal_data.gps_pad, gps); + else from_pad = new AltosGreatCircle(); + if (gps == null) + gps = new AltosGPS(); + out.printf("%2d,%2d,%3d,%12.7f,%12.7f,%8.1f,%5d,%3d,%3d,%3d,%3d,%3d,%9.0f,%9.0f,%4.0f,%4.0f,%6.1f,%6.1f,%6.1f", gps.connected?1:0, gps.locked?1:0, @@ -231,13 +242,12 @@ public class AltosCSV implements AltosWriter { gps.minute, gps.second, from_pad.distance, - state.range, + from_pad.range, from_pad.bearing, - state.elevation, + from_pad.elevation, gps.pdop, gps.hdop, gps.vdop); -*/ } void write_gps_sat_header() { @@ -249,8 +259,7 @@ public class AltosCSV implements AltosWriter { } void write_gps_sat() { -/* - AltosGPS gps = state.gps; + AltosGPS gps = series.gps_before(series.time(indices)); for(int i = 1; i <= 32; i++) { int c_n0 = 0; if (gps != null && gps.cc_gps_sat != null) { @@ -264,13 +273,14 @@ public class AltosCSV implements AltosWriter { if (i != 32) out.printf(","); } -*/ } void write_companion_header() { +/* out.printf("companion_id,companion_time,companion_update,companion_channels"); for (int i = 0; i < 12; i++) out.printf(",companion_%02d", i); +*/ } void write_companion() { @@ -401,16 +411,16 @@ public class AltosCSV implements AltosWriter { has_battery = true; if (series.has_series(AltosFlightSeries.accel_across_name)) has_advanced = true; -/* - if (state.gps != null) { - has_gps = true; - if (state.gps.cc_gps_sat != null) - has_gps_sat = true; - } - if (state.companion != null) - has_companion = true; - } -*/ + + if (series.gps_series != null) + has_gps = true; + if (series.sats_in_view != null) + has_gps_sat = true; + /* + if (state.companion != null) + has_companion = true; + */ + indices = series.indices(); for (;;) { diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java index 58d34abe..3da0e400 100644 --- a/altoslib/AltosCalData.java +++ b/altoslib/AltosCalData.java @@ -204,12 +204,11 @@ public class AltosCalData { this.state = state; } - public double gps_ground_altitude = AltosLib.MISSING; + public AltosGPS gps_pad = null; - public void set_gps_altitude(double altitude) { - if ((state != AltosLib.MISSING && state < AltosLib.ao_flight_boost) || - gps_ground_altitude == AltosLib.MISSING) - gps_ground_altitude = altitude; + public void set_gps(AltosGPS gps) { + if ((state != AltosLib.MISSING && state < AltosLib.ao_flight_boost) || gps_pad == null) + gps_pad = gps; } /* @@ -226,7 +225,7 @@ public class AltosCalData { public void reset_temp_gps() { if (temp_gps != null) { if (temp_gps.locked && temp_gps.nsat >= 4) - set_gps_altitude(temp_gps.alt); + set_gps(temp_gps); } temp_gps = null; } diff --git a/altoslib/AltosConvert.java b/altoslib/AltosConvert.java index 95c1a99f..5b3ff391 100644 --- a/altoslib/AltosConvert.java +++ b/altoslib/AltosConvert.java @@ -191,7 +191,7 @@ public class AltosConvert { } public static double - cc_ignitor_to_voltage(double ignite) + cc_igniter_to_voltage(double ignite) { return ignite / 32767 * 15.0; } @@ -434,6 +434,10 @@ public class AltosConvert { public static AltosStateName state_name = new AltosStateName(); + public static AltosPyroName pyro_name = new AltosPyroName(); + + public static AltosUnits magnetic_field = null; + public static String show_gs(String format, double a) { a = meters_to_g(a); format = format.concat(" g"); diff --git a/altoslib/AltosDataListener.java b/altoslib/AltosDataListener.java index b644e817..4a6fe04d 100644 --- a/altoslib/AltosDataListener.java +++ b/altoslib/AltosDataListener.java @@ -59,7 +59,7 @@ public abstract class AltosDataListener { public abstract void set_accel(double along, double across, double through); public abstract void set_mag(double along, double across, double through); public abstract void set_pyro_voltage(double volts); - public abstract void set_ignitor_voltage(double[] voltage); + public abstract void set_igniter_voltage(double[] voltage); public abstract void set_pyro_fired(int pyro_mask); public abstract void set_companion(AltosCompanion companion); diff --git a/altoslib/AltosDistance.java b/altoslib/AltosDistance.java index 0239c5ce..5e1b3545 100644 --- a/altoslib/AltosDistance.java +++ b/altoslib/AltosDistance.java @@ -96,7 +96,7 @@ public class AltosDistance extends AltosUnits { } }; - range_imperial[1] = new AltosUnitsRange(AltosConvert.feet_to_meters(1000), + range_imperial[1] = new AltosUnitsRange(AltosConvert.feet_to_meters(5280), "mi", "miles") { double value(double v) { return AltosConvert.meters_to_miles(v); diff --git a/altoslib/AltosEepromDownload.java b/altoslib/AltosEepromDownload.java index 4e641b85..8a2053ec 100644 --- a/altoslib/AltosEepromDownload.java +++ b/altoslib/AltosEepromDownload.java @@ -59,7 +59,7 @@ class AltosEepromNameData extends AltosDataListener { public void set_accel(double along, double across, double through) { } public void set_mag(double along, double across, double through) { } public void set_pyro_voltage(double volts) { } - public void set_ignitor_voltage(double[] voltage) { } + public void set_igniter_voltage(double[] voltage) { } public void set_pyro_fired(int pyro_mask) { } public void set_companion(AltosCompanion companion) { } public void set_kalman(double height, double speed, double acceleration) { } diff --git a/altoslib/AltosEepromNew.java b/altoslib/AltosEepromNew.java index 5220f3a0..0da3df71 100644 --- a/altoslib/AltosEepromNew.java +++ b/altoslib/AltosEepromNew.java @@ -165,7 +165,8 @@ public class AltosEepromNew { int start = data.size(); if (config_data().log_format != AltosLib.AO_LOG_FORMAT_TINY) { - data.add((byte) tokens[0].codePointAt(0)); + byte cmd = (byte) tokens[0].codePointAt(0); + data.add(cmd); int time = AltosLib.fromhex(tokens[1]); diff --git a/altoslib/AltosEepromRecord.java b/altoslib/AltosEepromRecord.java index 08f7ebca..7dd37592 100644 --- a/altoslib/AltosEepromRecord.java +++ b/altoslib/AltosEepromRecord.java @@ -92,7 +92,7 @@ public abstract class AltosEepromRecord implements Comparable public int next_start() { int s = start + length; - while (s + length < eeprom.data.size()) { + while (s + length <= eeprom.data.size()) { if (valid(s)) return s; s += length; diff --git a/altoslib/AltosEepromRecordFull.java b/altoslib/AltosEepromRecordFull.java index ea81eb3d..b4968220 100644 --- a/altoslib/AltosEepromRecordFull.java +++ b/altoslib/AltosEepromRecordFull.java @@ -62,8 +62,8 @@ public class AltosEepromRecordFull extends AltosEepromRecord { listener.set_battery_voltage(AltosConvert.cc_battery_to_voltage(data16(2))); break; case AltosLib.AO_LOG_DEPLOY: - listener.set_apogee_voltage(AltosConvert.cc_ignitor_to_voltage(data16(0))); - listener.set_main_voltage(AltosConvert.cc_ignitor_to_voltage(data16(2))); + listener.set_apogee_voltage(AltosConvert.cc_igniter_to_voltage(data16(0))); + listener.set_main_voltage(AltosConvert.cc_igniter_to_voltage(data16(2))); break; case AltosLib.AO_LOG_STATE: listener.set_state(data16(0)); diff --git a/altoslib/AltosEepromRecordMega.java b/altoslib/AltosEepromRecordMega.java index 371810ab..d4a5a0b2 100644 --- a/altoslib/AltosEepromRecordMega.java +++ b/altoslib/AltosEepromRecordMega.java @@ -143,6 +143,7 @@ public class AltosEepromRecordMega extends AltosEepromRecord { ground_yaw() / 512.0); break; case AltosLib.AO_LOG_STATE: + System.out.printf("log state %s\n", AltosLib.state_name(state())); listener.set_state(state()); break; case AltosLib.AO_LOG_SENSOR: @@ -198,7 +199,7 @@ public class AltosEepromRecordMega extends AltosEepromRecord { for (int i = 0; i < nsense-2; i++) voltages[i] = AltosConvert.mega_pyro_voltage(sense(i)); - listener.set_ignitor_voltage(voltages); + listener.set_igniter_voltage(voltages); listener.set_pyro_fired(pyro()); break; case AltosLib.AO_LOG_GPS_TIME: diff --git a/altoslib/AltosFlightListener.java b/altoslib/AltosFlightListener.java index 5b478ed0..395d8f3f 100644 --- a/altoslib/AltosFlightListener.java +++ b/altoslib/AltosFlightListener.java @@ -130,7 +130,7 @@ public abstract class AltosFlightListener { public abstract void set_imu(AltosIMU imu); public abstract void set_mag(AltosMag mag); public abstract void set_pyro_voltage(double volts); - public abstract void set_ignitor_voltage(double[] voltage); + public abstract void set_igniter_voltage(double[] voltage); public abstract void set_pyro_fired(int pyro_mask); public void copy(AltosFlightListener old) { diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java index b7434a5c..0eea34b7 100644 --- a/altoslib/AltosFlightSeries.java +++ b/altoslib/AltosFlightSeries.java @@ -23,12 +23,17 @@ public class AltosFlightSeries extends AltosDataListener { public int[] indices() { int[] indices = new int[series.size()]; for (int i = 0; i < indices.length; i++) - indices[i] = 0; + indices[i] = -1; + step_indices(indices); return indices; } private double time(int id, int index) { AltosTimeSeries s = series.get(id); + + if (index < 0) + return Double.NEGATIVE_INFINITY; + if (index < s.values.size()) return s.values.get(index).time; return Double.POSITIVE_INFINITY; @@ -69,8 +74,30 @@ public class AltosFlightSeries extends AltosDataListener { public double value(String name, int[] indices) { for (int i = 0; i < indices.length; i++) { AltosTimeSeries s = series.get(i); + if (s.label.equals(name)) { + int index = indices[i]; + if (index < 0) + index = 0; + if (index >= s.values.size()) + index = s.values.size() - 1; + return s.values.get(index).value; + } + } + return AltosLib.MISSING; + } + + public double value_before(String name, double time) { + for (AltosTimeSeries s : series) { if (s.label.equals(name)) - return s.values.get(indices[i]).value; + return s.value_before(time); + } + return AltosLib.MISSING; + } + + public double value_after(String name, double time) { + for (AltosTimeSeries s : series) { + if (s.label.equals(name)) + return s.value_after(time); } return AltosLib.MISSING; } @@ -105,11 +132,12 @@ public class AltosFlightSeries extends AltosDataListener { public static final String state_name = "State"; public void set_state(int state) { - this.state = state; if (state_series == null) state_series = add_series(state_name, AltosConvert.state_name); - else if ((int) state_series.get(state_series.size()-1).value == state) + else if (this.state == state) return; + System.out.printf("state %s\n", AltosLib.state_name(state)); + this.state = state; state_series.add(time(), state); } @@ -146,14 +174,14 @@ public class AltosFlightSeries extends AltosDataListener { AltosTimeSeries status_series; - public static final String status_name = "Status"; + public static final String status_name = "Radio Status"; public void set_rssi(int rssi, int status) { - if (rssi_series == null) + if (rssi_series == null) { rssi_series = add_series(rssi_name, null); - rssi_series.add(time(), rssi); - if (status_series == null) status_series = add_series(status_name, null); + } + rssi_series.add(time(), rssi); status_series.add(time(), status); } @@ -329,6 +357,18 @@ public class AltosFlightSeries extends AltosDataListener { main_voltage_series.add(time(), volts); } + public ArrayList gps_series; + + public AltosGPS gps_before(double time) { + AltosGPS gps = null; + for (AltosGPSTimeValue gtv : gps_series) + if (gtv.time <= time) + gps = gtv.gps; + else + break; + return gps; + } + AltosTimeSeries sats_in_view; AltosTimeSeries sats_in_soln; AltosTimeSeries gps_altitude; @@ -337,8 +377,7 @@ public class AltosFlightSeries extends AltosDataListener { AltosTimeSeries gps_ascent_rate; AltosTimeSeries gps_course; AltosTimeSeries gps_speed; - - public ArrayList gps_series; + AltosTimeSeries gps_pdop, gps_vdop, gps_hdop; public static final String sats_in_view_name = "Satellites in view"; public static final String sats_in_soln_name = "Satellites in solution"; @@ -348,30 +387,42 @@ public class AltosFlightSeries extends AltosDataListener { public static final String gps_ascent_rate_name = "GPS Ascent Rate"; public static final String gps_course_name = "GPS Course"; public static final String gps_speed_name = "GPS Speed"; + public static final String gps_pdop_name = "GPS Dilution of Precision"; + public static final String gps_vdop_name = "GPS Vertical Dilution of Precision"; + public static final String gps_hdop_name = "GPS Horizontal Dilution of Precision"; public void set_gps(AltosGPS gps) { if (gps_series == null) gps_series = new ArrayList(); gps_series.add(new AltosGPSTimeValue(time(), gps)); - if (sats_in_view == null) { - sats_in_view = add_series(sats_in_view_name, null); + if (sats_in_soln == null) { sats_in_soln = add_series(sats_in_soln_name, null); - gps_altitude = add_series(gps_altitude_name, AltosConvert.height); - gps_height = add_series(gps_height_name, AltosConvert.height); - gps_ground_speed = add_series(gps_ground_speed_name, AltosConvert.speed); - gps_ascent_rate = add_series(gps_ascent_rate_name, AltosConvert.speed); - gps_course = add_series(gps_course_name, null); - gps_speed = add_series(gps_speed_name, null); } - if (gps.cc_gps_sat != null) - sats_in_view.add(time(), gps.cc_gps_sat.length); + sats_in_soln.add(time(), gps.nsat); + if (gps.pdop != AltosLib.MISSING) { + if (gps_pdop == null) { + gps_pdop = add_series(gps_pdop_name, null); + gps_hdop = add_series(gps_hdop_name, null); + gps_vdop = add_series(gps_vdop_name, null); + } + gps_pdop.add(time(), gps.pdop); + gps_hdop.add(time(), gps.hdop); + gps_vdop.add(time(), gps.vdop); + } if (gps.locked) { - sats_in_soln.add(time(), gps.nsat); + if (gps_altitude == null) { + gps_altitude = add_series(gps_altitude_name, AltosConvert.height); + gps_height = add_series(gps_height_name, AltosConvert.height); + gps_ground_speed = add_series(gps_ground_speed_name, AltosConvert.speed); + gps_ascent_rate = add_series(gps_ascent_rate_name, AltosConvert.speed); + gps_course = add_series(gps_course_name, null); + gps_speed = add_series(gps_speed_name, null); + } if (gps.alt != AltosLib.MISSING) { gps_altitude.add(time(), gps.alt); - if (cal_data.gps_ground_altitude != AltosLib.MISSING) - gps_height.add(time(), gps.alt - cal_data.gps_ground_altitude); + if (cal_data.gps_pad != null) + gps_height.add(time(), gps.alt - cal_data.gps_pad.alt); } if (gps.ground_speed != AltosLib.MISSING) gps_ground_speed.add(time(), gps.ground_speed); @@ -383,33 +434,141 @@ public class AltosFlightSeries extends AltosDataListener { gps_speed.add(time(), Math.sqrt(gps.ground_speed * gps.ground_speed + gps.climb_rate * gps.climb_rate)); } + if (gps.cc_gps_sat != null) { + if (sats_in_view == null) + sats_in_view = add_series(sats_in_view_name, null); + sats_in_view.add(time(), gps.cc_gps_sat.length); + } } - public static final String accel_across_name = "Accel Across"; public static final String accel_along_name = "Accel Along"; + public static final String accel_across_name = "Accel Across"; public static final String accel_through_name = "Accel Through"; + AltosTimeSeries accel_along, accel_across, accel_through; + + public static final String gyro_roll_name = "Roll Rate"; + public static final String gyro_pitch_name = "Pitch Rate"; + public static final String gyro_yaw_name = "Yaw Rate"; + + AltosTimeSeries gyro_roll, gyro_pitch, gyro_yaw; + + public static final String mag_along_name = "Magnetic Field Along"; + public static final String mag_across_name = "Magnetic Field Across"; + public static final String mag_through_name = "Magnetic Field Through"; + + AltosTimeSeries mag_along, mag_across, mag_through; + public void set_accel(double along, double across, double through) { + if (accel_along == null) { + accel_along = add_series(accel_along_name, AltosConvert.accel); + accel_across = add_series(accel_across_name, AltosConvert.accel); + accel_through = add_series(accel_through_name, AltosConvert.accel); + } + accel_along.add(time(), along); + accel_across.add(time(), across); + accel_through.add(time(), through); } public void set_accel_ground(double along, double across, double through) { } public void set_gyro(double roll, double pitch, double yaw) { + if (gyro_roll == null) { + gyro_roll = add_series(gyro_roll_name, AltosConvert.rotation_rate); + gyro_pitch = add_series(gyro_pitch_name, AltosConvert.rotation_rate); + gyro_yaw = add_series(gyro_yaw_name, AltosConvert.rotation_rate); + } + gyro_roll.add(time(), roll); + gyro_pitch.add(time(), pitch); + gyro_yaw.add(time(), yaw); } public void set_mag(double along, double across, double through) { + if (mag_along == null) { + mag_along = add_series(mag_along_name, AltosConvert.magnetic_field); + mag_across = add_series(mag_across_name, AltosConvert.magnetic_field); + mag_through = add_series(mag_through_name, AltosConvert.magnetic_field); + } + mag_along.add(time(), along); + mag_across.add(time(), across); + mag_through.add(time(), through); } - public void set_orient(double new_orient) { } + public static final String orient_name = "Tilt Angle"; + + AltosTimeSeries orient_series; + + public void set_orient(double orient) { + if (orient_series == null) + orient_series = add_series(orient_name, AltosConvert.orient); + orient_series.add(time(), orient); + } + + public static final String pyro_voltage_name = "Pyro Voltage"; + + AltosTimeSeries pyro_voltage; public void set_pyro_voltage(double volts) { + if (pyro_voltage == null) + pyro_voltage = add_series(pyro_voltage_name, AltosConvert.voltage); + pyro_voltage.add(time(), volts); } - public void set_ignitor_voltage(double[] voltage) { + private static String[] igniter_voltage_names; + + public String igniter_voltage_name(int channel) { + if (igniter_voltage_names == null || igniter_voltage_names.length <= channel) { + String[] new_igniter_voltage_names = new String[channel + 1]; + int i = 0; + + if (igniter_voltage_names != null) { + for (; i < igniter_voltage_names.length; i++) + new_igniter_voltage_names[i] = igniter_voltage_names[i]; + } + for (; i < channel+1; i++) + new_igniter_voltage_names[i] = AltosLib.igniter_name(i); + igniter_voltage_names = new_igniter_voltage_names; + } + return igniter_voltage_names[channel]; + } + + AltosTimeSeries[] igniter_voltage; + + public void set_igniter_voltage(double[] voltage) { + int channels = voltage.length; + if (igniter_voltage == null || igniter_voltage.length <= channels) { + AltosTimeSeries[] new_igniter_voltage = new AltosTimeSeries[channels + 1]; + int i = 0; + + if (igniter_voltage != null) { + for (; i < igniter_voltage.length; i++) + new_igniter_voltage[i] = igniter_voltage[i]; + } + for (; i < channels; i++) + new_igniter_voltage[i] = add_series(igniter_voltage_name(i), AltosConvert.voltage); + igniter_voltage = new_igniter_voltage; + } + for (int channel = 0; channel < voltage.length; channel++) + igniter_voltage[channel].add(time(), voltage[channel]); } + public static final String pyro_fired_name = "Pyro Channel State"; + + AltosTimeSeries pyro_fired_series; + + int last_pyro_mask; + public void set_pyro_fired(int pyro_mask) { + if (pyro_fired_series == null) + pyro_fired_series = add_series(pyro_fired_name, AltosConvert.pyro_name); + for (int channel = 0; channel < 32; channel++) { + if ((last_pyro_mask & (1 << channel)) == 0 && + (pyro_mask & (1 << channel)) != 0) { + pyro_fired_series.add(time(), channel); + } + } + last_pyro_mask = pyro_mask; } public void set_companion(AltosCompanion companion) { diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java index 7179351e..54d0dd63 100644 --- a/altoslib/AltosFlightStats.java +++ b/altoslib/AltosFlightStats.java @@ -46,7 +46,7 @@ public class AltosFlightStats { public boolean has_imu; public boolean has_mag; public boolean has_orient; - public int num_ignitor; + public int num_igniter; double landed_time(AltosFlightSeries series) { double landed_state_time = AltosLib.MISSING; @@ -215,8 +215,8 @@ public class AltosFlightStats { has_mag = true; if (state.orient() != AltosLib.MISSING) has_orient = true; - if (state.ignitor_voltage != null && state.ignitor_voltage.length > num_ignitor) - num_ignitor = state.ignitor_voltage.length; + if (state.igniter_voltage != null && state.igniter_voltage.length > num_igniter) + num_igniter = state.igniter_voltage.length; } */ for (int s = AltosLib.ao_flight_startup; s <= AltosLib.ao_flight_landed; s++) { diff --git a/altoslib/AltosLib.java b/altoslib/AltosLib.java index 2137d1d7..fb43ea20 100644 --- a/altoslib/AltosLib.java +++ b/altoslib/AltosLib.java @@ -571,7 +571,7 @@ public class AltosLib { } } - public static String ignitor_name(int i) { + public static String igniter_name(int i) { return String.format("Ignitor %c", 'A' + i); } } diff --git a/altoslib/AltosMapLine.java b/altoslib/AltosMapLine.java index c475f52d..cf09307e 100644 --- a/altoslib/AltosMapLine.java +++ b/altoslib/AltosMapLine.java @@ -44,39 +44,9 @@ public abstract class AltosMapLine { } public String line_dist() { - String format; AltosGreatCircle g = new AltosGreatCircle(start.lat, start.lon, end.lat, end.lon); - double distance = g.distance; - if (AltosConvert.imperial_units) { - distance = AltosConvert.meters_to_feet(distance); - if (distance < 1000) { - format = "%4.0fft"; - } else { - distance /= 5280; - if (distance < 10) - format = "%5.3fmi"; - else if (distance < 100) - format = "%5.2fmi"; - else if (distance < 1000) - format = "%5.1fmi"; - else - format = "%5.0fmi"; - } - } else { - if (distance < 1000) { - format = "%4.0fm"; - } else { - distance /= 1000; - if (distance < 100) - format = "%5.2fkm"; - else if (distance < 1000) - format = "%5.1fkm"; - else - format = "%5.0fkm"; - } - } - return String.format(format, distance); + return AltosConvert.distance.show(7, g.distance); } } diff --git a/altoslib/AltosPyroName.java b/altoslib/AltosPyroName.java new file mode 100644 index 00000000..18a31dd2 --- /dev/null +++ b/altoslib/AltosPyroName.java @@ -0,0 +1,32 @@ +/* + * Copyright © 2017 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +package org.altusmetrum.altoslib_11; + +public class AltosPyroName extends AltosUnits { + + public double value(double v, boolean imperial_units) { return v; } + + public double inverse(double v, boolean imperial_units) { return v; } + + public String string_value(double v, boolean imperial_units) { + return AltosLib.igniter_name((int) v); + } + + public String show_units(boolean imperial_units) { return "state"; } + + public String say_units(boolean imperial_units) { return "state"; } + + public int show_fraction(int width, boolean imperial_units) { return 0; } +} diff --git a/altoslib/AltosSensorMega.java b/altoslib/AltosSensorMega.java index 63c7a0ce..82696038 100644 --- a/altoslib/AltosSensorMega.java +++ b/altoslib/AltosSensorMega.java @@ -97,10 +97,10 @@ class AltosSensorMega { state.set_apogee_voltage(AltosConvert.mega_pyro_voltage(sensor_mega.sense[4])); state.set_main_voltage(AltosConvert.mega_pyro_voltage(sensor_mega.sense[5])); - double[] ignitor_voltage = new double[4]; + double[] igniter_voltage = new double[4]; for (int i = 0; i < 4; i++) - ignitor_voltage[i] = AltosConvert.mega_pyro_voltage(sensor_mega.sense[i]); - state.set_ignitor_voltage(ignitor_voltage); + igniter_voltage[i] = AltosConvert.mega_pyro_voltage(sensor_mega.sense[i]); + state.set_igniter_voltage(igniter_voltage); } catch (TimeoutException te) { } diff --git a/altoslib/AltosSensorTM.java b/altoslib/AltosSensorTM.java index 7d7becfb..49f3986b 100644 --- a/altoslib/AltosSensorTM.java +++ b/altoslib/AltosSensorTM.java @@ -39,8 +39,8 @@ public class AltosSensorTM { listener.set_pressure(AltosConvert.barometer_to_pressure(sensor_tm.pres)); listener.set_temperature(AltosConvert.thermometer_to_temperature(sensor_tm.temp)); listener.set_battery_voltage(AltosConvert.cc_battery_to_voltage(sensor_tm.batt)); - listener.set_apogee_voltage(AltosConvert.cc_ignitor_to_voltage(sensor_tm.drogue)); - listener.set_main_voltage(AltosConvert.cc_ignitor_to_voltage(sensor_tm.main)); + listener.set_apogee_voltage(AltosConvert.cc_igniter_to_voltage(sensor_tm.drogue)); + listener.set_main_voltage(AltosConvert.cc_igniter_to_voltage(sensor_tm.main)); } catch (TimeoutException te) { } diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index f46b12ea..889aa9a3 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -702,7 +702,7 @@ public class AltosState extends AltosDataListener { public double apogee_voltage; public double main_voltage; - public double ignitor_voltage[]; + public double igniter_voltage[]; public AltosGPS gps; public AltosGPS temp_gps; @@ -786,7 +786,7 @@ public class AltosState extends AltosDataListener { pyro_voltage = AltosLib.MISSING; apogee_voltage = AltosLib.MISSING; main_voltage = AltosLib.MISSING; - ignitor_voltage = null; + igniter_voltage = null; kalman_height = new AltosValue(); kalman_speed = new AltosValue(); @@ -1221,8 +1221,8 @@ public class AltosState extends AltosDataListener { } } - public void set_ignitor_voltage(double[] voltage) { - this.ignitor_voltage = voltage; + public void set_igniter_voltage(double[] voltage) { + this.igniter_voltage = voltage; } public void set_pyro_fired(int fired) { diff --git a/altoslib/AltosTelemetryFile.java b/altoslib/AltosTelemetryFile.java index 0b0e6a48..c6462872 100644 --- a/altoslib/AltosTelemetryFile.java +++ b/altoslib/AltosTelemetryFile.java @@ -46,7 +46,7 @@ class AltosTelemetryNullListener extends AltosDataListener { public void set_accel(double along, double across, double through) { } public void set_mag(double along, double across, double through) { } public void set_pyro_voltage(double volts) { } - public void set_ignitor_voltage(double[] voltage) { } + public void set_igniter_voltage(double[] voltage) { } public void set_pyro_fired(int pyro_mask) { } public void set_companion(AltosCompanion companion) { } @@ -78,7 +78,7 @@ class AltosTelemetryNullListener extends AltosDataListener { /* * TelemetryLocation */ - if (AltosLib.has_gps(cal_data.device_type) && cal_data.gps_ground_altitude == AltosLib.MISSING) + if (AltosLib.has_gps(cal_data.device_type) && cal_data.gps_pad == null) return false; return true; diff --git a/altoslib/AltosTelemetryLegacy.java b/altoslib/AltosTelemetryLegacy.java index 394d023c..8a86417c 100644 --- a/altoslib/AltosTelemetryLegacy.java +++ b/altoslib/AltosTelemetryLegacy.java @@ -564,8 +564,8 @@ public class AltosTelemetryLegacy extends AltosTelemetry { listener.set_kalman(kalman_height, kalman_speed, kalman_acceleration); listener.set_temperature(AltosConvert.thermometer_to_temperature(temp)); listener.set_battery_voltage(AltosConvert.cc_battery_to_voltage(batt)); - listener.set_apogee_voltage(AltosConvert.cc_ignitor_to_voltage(apogee)); - listener.set_main_voltage(AltosConvert.cc_ignitor_to_voltage(main)); + listener.set_apogee_voltage(AltosConvert.cc_igniter_to_voltage(apogee)); + listener.set_main_voltage(AltosConvert.cc_igniter_to_voltage(main)); if (gps != null) listener.set_gps(gps); } diff --git a/altoslib/AltosTelemetryLocation.java b/altoslib/AltosTelemetryLocation.java index 5eb727d6..c7b7fa22 100644 --- a/altoslib/AltosTelemetryLocation.java +++ b/altoslib/AltosTelemetryLocation.java @@ -58,6 +58,9 @@ public class AltosTelemetryLocation extends AltosTelemetryStandard { gps.nsat = flags & 0xf; gps.locked = (flags & (1 << 4)) != 0; gps.connected = (flags & (1 << 5)) != 0; + gps.pdop = pdop() / 10.0; + gps.hdop = hdop() / 10.0; + gps.vdop = vdop() / 10.0; if (gps.locked) { gps.lat = latitude() * 1.0e-7; @@ -72,12 +75,9 @@ public class AltosTelemetryLocation extends AltosTelemetryStandard { gps.ground_speed = ground_speed() * 1.0e-2; gps.course = course() * 2; gps.climb_rate = climb_rate() * 1.0e-2; - gps.pdop = pdop() / 10.0; - gps.hdop = hdop() / 10.0; - gps.vdop = vdop() / 10.0; if (gps.nsat >= 4) - cal_data.set_gps_altitude(gps.alt); + cal_data.set_gps(gps); } listener.set_gps(gps); } diff --git a/altoslib/AltosTelemetryMegaData.java b/altoslib/AltosTelemetryMegaData.java index c0749e87..b648f300 100644 --- a/altoslib/AltosTelemetryMegaData.java +++ b/altoslib/AltosTelemetryMegaData.java @@ -55,7 +55,7 @@ public class AltosTelemetryMegaData extends AltosTelemetryStandard { for (int i = 0; i < 4; i++) voltages[i] = AltosConvert.mega_pyro_voltage(sense(i)); - listener.set_ignitor_voltage(voltages); + listener.set_igniter_voltage(voltages); cal_data.set_ground_accel(ground_accel()); cal_data.set_ground_pressure(ground_pres()); diff --git a/altoslib/AltosTelemetrySensor.java b/altoslib/AltosTelemetrySensor.java index 37589397..da253eea 100644 --- a/altoslib/AltosTelemetrySensor.java +++ b/altoslib/AltosTelemetrySensor.java @@ -57,8 +57,8 @@ public class AltosTelemetrySensor extends AltosTelemetryStandard { listener.set_temperature(AltosConvert.thermometer_to_temperature(temp())); listener.set_battery_voltage(AltosConvert.cc_battery_to_voltage(v_batt())); if (type() == packet_type_TM_sensor || type() == packet_type_Tm_sensor) { - listener.set_apogee_voltage(AltosConvert.cc_ignitor_to_voltage(sense_d())); - listener.set_main_voltage(AltosConvert.cc_ignitor_to_voltage(sense_m())); + listener.set_apogee_voltage(AltosConvert.cc_igniter_to_voltage(sense_d())); + listener.set_main_voltage(AltosConvert.cc_igniter_to_voltage(sense_m())); } listener.set_kalman(height_16(), speed()/16.0, acceleration()/16.0); diff --git a/altoslib/AltosTimeSeries.java b/altoslib/AltosTimeSeries.java index 1d3d9a6c..30b24d82 100644 --- a/altoslib/AltosTimeSeries.java +++ b/altoslib/AltosTimeSeries.java @@ -17,9 +17,9 @@ package org.altusmetrum.altoslib_11; import java.util.*; public class AltosTimeSeries implements Iterable { - public String label; - public AltosUnits units; - List values; + public String label; + public AltosUnits units; + ArrayList values; public void add(AltosTimeValue tv) { values.add(tv); @@ -33,6 +33,58 @@ public class AltosTimeSeries implements Iterable { return values.get(i); } + private double lerp(AltosTimeValue v0, AltosTimeValue v1, double t) { + /* degenerate case */ + if (v0.time == v1.time) + return (v0.value + v1.value) / 2; + + return (v0.value * (v1.time - t) + v1.value * (t - v0.time)) / v1.time - v0.time; + } + + private int after_index(double time) { + int lo = 0; + int hi = values.size() - 1; + + while (lo <= hi) { + int mid = (lo + hi) / 2; + + if (values.get(mid).time < time) + lo = mid + 1; + else + hi = mid - 1; + } + return lo; + } + + /* Compute a value for an arbitrary time */ + public double value(double time) { + int after = after_index(time); + if (after == 0) + return values.get(0).value; + if (after == values.size()) + return values.get(after - 1).value; + + return lerp(values.get(after-1), values.get(after), time); + } + + /* Find the value just before an arbitrary time */ + public double value_before(double time) { + int after = after_index(time); + + if (after == 0) + return values.get(0).value; + return values.get(after-1).value; + } + + /* Find the value just after an arbitrary time */ + public double value_after(double time) { + int after = after_index(time); + + if (after == values.size()) + return values.get(after-1).value; + return values.get(after).value; + } + public int size() { return values.size(); } @@ -144,11 +196,16 @@ public class AltosTimeSeries implements Iterable { int left = find_left(i, half_width); int right = find_right(i, half_width); + for (int j = left; j <= right; j++) { double j_time = values.get(j).time; if (left_time <= j_time && j_time <= right_time) { - double coeff = filter_coeff(j_time - center_time, width); + double j_left = j == left ? left_time : values.get(j-1).time; + double j_right = j == right ? right_time : values.get(j+1).time; + double interval = (j_right - j_left) / 2.0; + double coeff = filter_coeff(j_time - center_time, width) * interval; + total_coeff += coeff; total_value += coeff * values.get(j).value; } diff --git a/altoslib/Makefile.am b/altoslib/Makefile.am index fa0e8c1b..ffa92783 100644 --- a/altoslib/Makefile.am +++ b/altoslib/Makefile.am @@ -92,6 +92,7 @@ altoslib_JAVA = \ AltosPreferences.java \ AltosPreferencesBackend.java \ AltosProgrammer.java \ + AltosPyroName.java \ AltosReplayReader.java \ AltosRomconfig.java \ AltosSavedState.java \ diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 3d33b6e5..eaf19256 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -36,7 +36,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { JTabbedPane pane; AltosPad pad; - AltosIgnitor ignitor; + AltosIgnitor igniter; AltosAscent ascent; AltosDescent descent; AltosLanded landed; @@ -45,7 +45,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { boolean has_map; boolean has_companion; boolean has_state; - boolean has_ignitor; + boolean has_igniter; private AltosFlightStatus flightStatus; private AltosInfoTable flightInfo; @@ -121,15 +121,15 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { cur_tab = tab; } - if (ignitor.should_show(state)) { - if (!has_ignitor) { - pane.add("Ignitor", ignitor); - has_ignitor = true; + if (igniter.should_show(state)) { + if (!has_igniter) { + pane.add("Ignitor", igniter); + has_igniter = true; } } else { - if (has_ignitor) { - pane.remove(ignitor); - has_ignitor = false; + if (has_igniter) { + pane.remove(igniter); + has_igniter = false; } } @@ -272,8 +272,8 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { displays.add(pad); pane.add("Status", pad); - ignitor = new AltosIgnitor(); - displays.add(ignitor); + igniter = new AltosIgnitor(); + displays.add(igniter); ascent = new AltosAscent(); displays.add(ascent); descent = new AltosDescent(); diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 5314a3b6..a3107f2b 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -44,19 +44,26 @@ public class AltosGraphUI extends AltosUIFrame implements AltosFontListener, Alt void fill_map(AltosFlightSeries flight_series) { boolean any_gps = false; + AltosGPSTimeValue gtv_last = null; for (AltosGPSTimeValue gtv : flight_series.gps_series) { + gtv_last = gtv; AltosGPS gps = gtv.gps; if (gps != null && gps.locked && gps.nsat >= 4) { if (map == null) map = new AltosUIMap(); - map.show(gps, AltosLib.ao_flight_pad); + map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time)); this.gps = gps; has_gps = true; } } + if (gtv_last != null) { + int state = (int) flight_series.value_after(AltosFlightSeries.state_name, gtv_last.time); + if (state == AltosLib.ao_flight_landed) + map.show(gtv_last.gps, state); + } } public void font_size_changed(int font_size) { diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 4d5c3b2d..afa9b944 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -34,12 +34,12 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl AltosPad pad; AltosInfoTable flightInfo; AltosFlightStatus flightStatus; - AltosIgnitor ignitor; + AltosIgnitor igniter; AltosIdleMonitor thread; AltosUIMap sitemap; int serial; boolean remote; - boolean has_ignitor; + boolean has_igniter; boolean has_map; void stop_display() { @@ -75,15 +75,15 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl public void show(AltosState state, AltosListenerState listener_state) { status_update.saved_state = state; - if (ignitor.should_show(state)) { - if (!has_ignitor) { - pane.add("Ignitor", ignitor); - has_ignitor = true; + if (igniter.should_show(state)) { + if (!has_igniter) { + pane.add("Ignitor", igniter); + has_igniter = true; } } else { - if (has_ignitor) { - pane.remove(ignitor); - has_ignitor = false; + if (has_igniter) { + pane.remove(igniter); + has_igniter = false; } } if (state.gps != null && state.gps.connected) { @@ -102,8 +102,8 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl pad.show(state, listener_state); flightStatus.show(state, listener_state); flightInfo.show(state, listener_state); - if (has_ignitor) - ignitor.show(state, listener_state); + if (has_igniter) + igniter.show(state, listener_state); if (has_map) sitemap.show(state, listener_state); // } catch (Exception e) { @@ -274,7 +274,7 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl flightInfo = new AltosInfoTable(); pane.add("Table", new JScrollPane(flightInfo)); - ignitor = new AltosIgnitor(); + igniter = new AltosIgnitor(); sitemap = new AltosUIMap(); diff --git a/altosui/AltosIgnitor.java b/altosui/AltosIgnitor.java index fabf4320..09dcdf93 100644 --- a/altosui/AltosIgnitor.java +++ b/altosui/AltosIgnitor.java @@ -27,59 +27,59 @@ import org.altusmetrum.altosuilib_11.*; public class AltosIgnitor extends AltosUIFlightTab { public class Ignitor extends AltosUIUnitsIndicator { - int ignitor; + int igniter; public double value(AltosState state, int i) { - if (state.ignitor_voltage == null || - state.ignitor_voltage.length < ignitor) + if (state.igniter_voltage == null || + state.igniter_voltage.length < igniter) return AltosLib.MISSING; - return state.ignitor_voltage[ignitor]; + return state.igniter_voltage[igniter]; } public double good() { return AltosLib.ao_igniter_good; } public Ignitor (AltosUIFlightTab container, int y) { - super(container, y, AltosConvert.voltage, String.format ("%s Voltage", AltosLib.ignitor_name(y)), 1, true, 1); - ignitor = y; + super(container, y, AltosConvert.voltage, String.format ("%s Voltage", AltosLib.igniter_name(y)), 1, true, 1); + igniter = y; } } - Ignitor[] ignitors; + Ignitor[] igniters; public void show(AltosState state, AltosListenerState listener_state) { if (isShowing()) - make_ignitors(state); + make_igniters(state); super.show(state, listener_state); } public boolean should_show(AltosState state) { if (state == null) return false; - if (state.ignitor_voltage == null) + if (state.igniter_voltage == null) return false; - return state.ignitor_voltage.length > 0; + return state.igniter_voltage.length > 0; } - void make_ignitors(AltosState state) { - int n = (state == null || state.ignitor_voltage == null) ? 0 : state.ignitor_voltage.length; - int old_n = ignitors == null ? 0 : ignitors.length; + void make_igniters(AltosState state) { + int n = (state == null || state.igniter_voltage == null) ? 0 : state.igniter_voltage.length; + int old_n = igniters == null ? 0 : igniters.length; if (n != old_n) { - if (ignitors != null) { - for (int i = 0; i < ignitors.length; i++) { - remove(ignitors[i]); - ignitors[i].remove(this); - ignitors = null; + if (igniters != null) { + for (int i = 0; i < igniters.length; i++) { + remove(igniters[i]); + igniters[i].remove(this); + igniters = null; } } if (n > 0) { setVisible(true); - ignitors = new Ignitor[n]; + igniters = new Ignitor[n]; for (int i = 0; i < n; i++) { - ignitors[i] = new Ignitor(this, i); - add(ignitors[i]); + igniters[i] = new Ignitor(this, i); + add(igniters[i]); } } else setVisible(false); diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index a6e422e6..b0cff381 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -327,7 +327,7 @@ public class AltosUI extends AltosUIFrame { } private static AltosFlightSeries make_series(AltosRecordSet set) { - AltosFlightSeries series = new AltosFlightSeries(new AltosCalData()); + AltosFlightSeries series = new AltosFlightSeries(set.cal_data()); set.capture_series(series); return series; } diff --git a/altosuilib/AltosGraphNew.java b/altosuilib/AltosGraphNew.java index dc5b7e47..a9393f94 100644 --- a/altosuilib/AltosGraphNew.java +++ b/altosuilib/AltosGraphNew.java @@ -52,6 +52,8 @@ public class AltosGraphNew extends AltosUIGraphNew { static final private Color battery_voltage_color = new Color(194, 194, 31); static final private Color drogue_voltage_color = new Color(150, 150, 31); static final private Color main_voltage_color = new Color(100, 100, 31); + static final private Color igniter_voltage_color = new Color(80, 80, 31); + static final private Color igniter_marker_color = new Color(255, 0, 0); static final private Color gps_nsat_color = new Color (194, 31, 194); static final private Color gps_nsat_solution_color = new Color (194, 31, 194); static final private Color gps_nsat_view_color = new Color (150, 31, 150); @@ -65,25 +67,17 @@ public class AltosGraphNew extends AltosUIGraphNew { static final private Color temperature_color = new Color (31, 194, 194); static final private Color dbm_color = new Color(31, 100, 100); static final private Color state_color = new Color(0,0,0); - static final private Color accel_x_color = new Color(255, 0, 0); - static final private Color accel_y_color = new Color(0, 255, 0); - static final private Color accel_z_color = new Color(0, 0, 255); - static final private Color gyro_x_color = new Color(192, 0, 0); - static final private Color gyro_y_color = new Color(0, 192, 0); - static final private Color gyro_z_color = new Color(0, 0, 192); - static final private Color mag_x_color = new Color(128, 0, 0); - static final private Color mag_y_color = new Color(0, 128, 0); - static final private Color mag_z_color = new Color(0, 0, 128); + static final private Color accel_along_color = new Color(255, 0, 0); + static final private Color accel_across_color = new Color(0, 255, 0); + static final private Color accel_through_color = new Color(0, 0, 255); + static final private Color gyro_roll_color = new Color(192, 0, 0); + static final private Color gyro_pitch_color = new Color(0, 192, 0); + static final private Color gyro_yaw_color = new Color(0, 0, 192); + static final private Color mag_along_color = new Color(128, 0, 0); + static final private Color mag_across_color = new Color(0, 128, 0); + static final private Color mag_through_color = new Color(0, 0, 128); static final private Color orient_color = new Color(31, 31, 31); -// static AltosNsat nsat_units = new AltosNsat(); - static AltosUnits nsat_units = null; -// static AltosDbm dbm_units = new AltosDbm(); - static AltosUnits dbm_units = null; - static AltosOrient orient_units = new AltosOrient(); -// static AltosMagUnits mag_units = new AltosMagUnits(); - static AltosUnits mag_units = null; -// static AltosDopUnits dop_units = new AltosDopUnits(); static AltosUnits dop_units = null; AltosUIFlightSeries flight_series; @@ -102,15 +96,15 @@ public class AltosGraphNew extends AltosUIGraphNew { accel_axis = newAxis("Acceleration", AltosConvert.accel, accel_color); voltage_axis = newAxis("Voltage", AltosConvert.voltage, voltage_color); temperature_axis = newAxis("Temperature", AltosConvert.temperature, temperature_color, 0); - nsat_axis = newAxis("Satellites", nsat_units, gps_nsat_color, + nsat_axis = newAxis("Satellites", null, gps_nsat_color, AltosUIAxis.axis_include_zero | AltosUIAxis.axis_integer); - dbm_axis = newAxis("Signal Strength", dbm_units, dbm_color, 0); + dbm_axis = newAxis("Signal Strength", null, dbm_color, 0); distance_axis = newAxis("Distance", AltosConvert.distance, range_color); - gyro_axis = newAxis("Rotation Rate", AltosConvert.rotation_rate, gyro_z_color, 0); - orient_axis = newAxis("Tilt Angle", orient_units, orient_color, 0); - mag_axis = newAxis("Magnetic Field", mag_units, mag_x_color, 0); - course_axis = newAxis("Course", orient_units, gps_course_color, 0); + gyro_axis = newAxis("Rotation Rate", AltosConvert.rotation_rate, gyro_roll_color, 0); + orient_axis = newAxis("Tilt Angle", AltosConvert.orient, orient_color, 0); + mag_axis = newAxis("Magnetic Field", AltosConvert.magnetic_field, mag_along_color, 0); + course_axis = newAxis("Course", AltosConvert.orient, gps_course_color, 0); dop_axis = newAxis("Dilution of Precision", dop_units, gps_pdop_color, 0); flight_series.register_axis("default", @@ -121,7 +115,14 @@ public class AltosGraphNew extends AltosUIGraphNew { flight_series.register_marker(AltosUIFlightSeries.state_name, state_color, true, - plot); + plot, + true); + + flight_series.register_marker(AltosUIFlightSeries.pyro_fired_name, + igniter_marker_color, + true, + plot, + false); flight_series.register_axis(AltosUIFlightSeries.accel_name, accel_color, @@ -164,17 +165,50 @@ public class AltosGraphNew extends AltosUIGraphNew { height_axis); + flight_series.register_axis(AltosUIFlightSeries.temperature_name, + temperature_color, + false, + temperature_axis); + + flight_series.register_axis(AltosUIFlightSeries.battery_voltage_name, + battery_voltage_color, + false, + voltage_axis); + + flight_series.register_axis(AltosUIFlightSeries.apogee_voltage_name, + drogue_voltage_color, + false, + voltage_axis); + + flight_series.register_axis(AltosUIFlightSeries.main_voltage_name, + main_voltage_color, + false, + voltage_axis); + flight_series.register_axis(AltosUIFlightSeries.sats_in_view_name, gps_nsat_view_color, false, nsat_axis); - flight_series.register_axis(AltosUIFlightSeries.sats_in_soln_name, gps_nsat_solution_color, false, nsat_axis); + flight_series.register_axis(AltosUIFlightSeries.gps_pdop_name, + gps_pdop_color, + false, + dop_axis); + + flight_series.register_axis(AltosUIFlightSeries.gps_hdop_name, + gps_hdop_color, + false, + dop_axis); + + flight_series.register_axis(AltosUIFlightSeries.gps_vdop_name, + gps_vdop_color, + false, + dop_axis); flight_series.register_axis(AltosUIFlightSeries.gps_altitude_name, gps_height_color, @@ -191,13 +225,11 @@ public class AltosGraphNew extends AltosUIGraphNew { false, speed_axis); - flight_series.register_axis(AltosUIFlightSeries.gps_ascent_rate_name, gps_climb_rate_color, false, speed_axis); - flight_series.register_axis(AltosUIFlightSeries.gps_course_name, gps_course_color, false, @@ -208,246 +240,69 @@ public class AltosGraphNew extends AltosUIGraphNew { false, speed_axis); + flight_series.register_axis(AltosUIFlightSeries.accel_along_name, + accel_along_color, + false, + accel_axis); + + flight_series.register_axis(AltosUIFlightSeries.accel_across_name, + accel_across_color, + false, + accel_axis); + + flight_series.register_axis(AltosUIFlightSeries.accel_through_name, + accel_through_color, + false, + accel_axis); + + flight_series.register_axis(AltosUIFlightSeries.gyro_roll_name, + gyro_roll_color, + false, + gyro_axis); + + flight_series.register_axis(AltosUIFlightSeries.gyro_pitch_name, + gyro_pitch_color, + false, + gyro_axis); + + flight_series.register_axis(AltosUIFlightSeries.gyro_yaw_name, + gyro_yaw_color, + false, + gyro_axis); + + flight_series.register_axis(AltosUIFlightSeries.mag_along_name, + mag_along_color, + false, + mag_axis); + + flight_series.register_axis(AltosUIFlightSeries.mag_across_name, + mag_across_color, + false, + mag_axis); + + flight_series.register_axis(AltosUIFlightSeries.mag_through_name, + mag_through_color, + false, + mag_axis); + + flight_series.register_axis(AltosUIFlightSeries.orient_name, + orient_color, + false, + orient_axis); + + for (int channel = 0; channel < 26; channel++) { + flight_series.register_axis(flight_series.igniter_voltage_name(channel), + igniter_voltage_color, + false, + voltage_axis); + } + flight_series.register_axis(AltosUIFlightSeries.thrust_name, thrust_color, true, thrust_axis); -// addMarker("State", AltosGraphDataPoint.data_state, state_color); - return flight_series.series(cal_data); -/* - if (stats.has_flight_data) { - addSeries("Height", - AltosGraphDataPoint.data_height, - AltosConvert.height, - height_color, - true, - height_axis); - addSeries("Pressure", - AltosGraphDataPoint.data_pressure, - pressure_units, - pressure_color, - false, - pressure_axis); - addSeries("Thrust", - AltosGraphDataPoint.data_thrust, - thrust_units, - thrust_color, - false, - thrust_axis); - addSeries("Speed", - AltosGraphDataPoint.data_speed, - AltosConvert.speed, - speed_color, - true, - speed_axis); - addSeries("Acceleration", - AltosGraphDataPoint.data_accel, - AltosConvert.accel, - accel_color, - true, - accel_axis); - } - if (stats.has_gps) { - boolean enable_gps = false; - - if (!stats.has_flight_data) - enable_gps = true; - - addSeries("Range", - AltosGraphDataPoint.data_range, - AltosConvert.distance, - range_color, - false, - distance_axis); - addSeries("Distance", - AltosGraphDataPoint.data_distance, - AltosConvert.distance, - distance_color, - enable_gps, - distance_axis); - addSeries("GPS Height", - AltosGraphDataPoint.data_gps_height, - AltosConvert.height, - gps_height_color, - enable_gps, - height_axis); - addSeries("GPS Altitude", - AltosGraphDataPoint.data_gps_altitude, - AltosConvert.height, - gps_height_color, - false, - height_axis); - addSeries("GPS Satellites in Solution", - AltosGraphDataPoint.data_gps_nsat_solution, - nsat_units, - gps_nsat_solution_color, - false, - nsat_axis); - if (stats.has_gps_sats) { - addSeries("GPS Satellites in View", - AltosGraphDataPoint.data_gps_nsat_view, - nsat_units, - gps_nsat_view_color, - false, - nsat_axis); - } - if (stats.has_gps_detail) { - addSeries("GPS Course", - AltosGraphDataPoint.data_gps_course, - orient_units, - gps_course_color, - false, - course_axis); - addSeries("GPS Ground Speed", - AltosGraphDataPoint.data_gps_ground_speed, - AltosConvert.speed, - gps_ground_speed_color, - enable_gps, - speed_axis); - addSeries("GPS Climb Rate", - AltosGraphDataPoint.data_gps_climb_rate, - AltosConvert.speed, - gps_climb_rate_color, - enable_gps, - speed_axis); - } - addSeries("GPS Position DOP", - AltosGraphDataPoint.data_gps_pdop, - dop_units, - gps_pdop_color, - false, - dop_axis); - if (stats.has_gps_detail) { - addSeries("GPS Horizontal DOP", - AltosGraphDataPoint.data_gps_hdop, - dop_units, - gps_hdop_color, - false, - dop_axis); - addSeries("GPS Vertical DOP", - AltosGraphDataPoint.data_gps_vdop, - dop_units, - gps_vdop_color, - false, - dop_axis); - } - } - if (stats.has_rssi) - addSeries("Received Signal Strength", - AltosGraphDataPoint.data_rssi, - dbm_units, - dbm_color, - false, - dbm_axis); - - if (stats.has_battery) - addSeries("Battery Voltage", - AltosGraphDataPoint.data_battery_voltage, - voltage_units, - battery_voltage_color, - false, - voltage_axis); - - if (stats.has_flight_adc) { - addSeries("Temperature", - AltosGraphDataPoint.data_temperature, - AltosConvert.temperature, - temperature_color, - false, - temperature_axis); - addSeries("Drogue Voltage", - AltosGraphDataPoint.data_drogue_voltage, - voltage_units, - drogue_voltage_color, - false, - voltage_axis); - addSeries("Main Voltage", - AltosGraphDataPoint.data_main_voltage, - voltage_units, - main_voltage_color, - false, - voltage_axis); - } - - if (stats.has_imu) { - addSeries("Acceleration Along", - AltosGraphDataPoint.data_accel_along, - AltosConvert.accel, - accel_x_color, - false, - accel_axis); - addSeries("Acceleration Across", - AltosGraphDataPoint.data_accel_across, - AltosConvert.accel, - accel_y_color, - false, - accel_axis); - addSeries("Acceleration Through", - AltosGraphDataPoint.data_accel_through, - AltosConvert.accel, - accel_z_color, - false, - accel_axis); - addSeries("Roll Rate", - AltosGraphDataPoint.data_gyro_roll, - gyro_units, - gyro_x_color, - false, - gyro_axis); - addSeries("Pitch Rate", - AltosGraphDataPoint.data_gyro_pitch, - gyro_units, - gyro_y_color, - false, - gyro_axis); - addSeries("Yaw Rate", - AltosGraphDataPoint.data_gyro_yaw, - gyro_units, - gyro_z_color, - false, - gyro_axis); - } - if (stats.has_mag) { - addSeries("Magnetometer Along", - AltosGraphDataPoint.data_mag_along, - mag_units, - mag_x_color, - false, - mag_axis); - addSeries("Magnetometer Across", - AltosGraphDataPoint.data_mag_across, - mag_units, - mag_y_color, - false, - mag_axis); - addSeries("Magnetometer Through", - AltosGraphDataPoint.data_mag_through, - mag_units, - mag_z_color, - false, - mag_axis); - } - if (stats.has_orient) - addSeries("Tilt Angle", - AltosGraphDataPoint.data_orient, - orient_units, - orient_color, - false, - orient_axis); - if (stats.num_ignitor > 0) { - for (int i = 0; i < stats.num_ignitor; i++) - addSeries(AltosLib.ignitor_name(i), - AltosGraphDataPoint.data_ignitor_0 + i, - voltage_units, - main_voltage_color, - false, - voltage_axis); - for (int i = 0; i < stats.num_ignitor; i++) - addMarker(AltosLib.ignitor_name(i), AltosGraphDataPoint.data_ignitor_fired_0 + i, state_color); - } -*/ } public AltosGraphNew(AltosUIEnable enable, AltosFlightStats stats, AltosUIFlightSeries flight_series, AltosCalData cal_data) { diff --git a/altosuilib/AltosUIFlightSeries.java b/altosuilib/AltosUIFlightSeries.java index 1840761e..0bcc8a6e 100644 --- a/altosuilib/AltosUIFlightSeries.java +++ b/altosuilib/AltosUIFlightSeries.java @@ -33,15 +33,17 @@ class AltosUITimeSeriesAxis { Color color; boolean enabled; boolean marker; + boolean marker_top; AltosUIAxis axis; XYPlot plot; - public AltosUITimeSeriesAxis(Color color, boolean enabled, AltosUIAxis axis, XYPlot plot, boolean marker) { + public AltosUITimeSeriesAxis(Color color, boolean enabled, AltosUIAxis axis, XYPlot plot, boolean marker, boolean marker_top) { this.color = color; this.enabled = enabled; this.axis = axis; this.plot = plot; this.marker = marker; + this.marker_top = marker_top; } } @@ -57,7 +59,7 @@ public class AltosUIFlightSeries extends AltosFlightSeries { if (label.equals(ts.label) || (label.equals("default") && uts.color == null)) { if (axis.marker) - uts.set_marker(axis.color, axis.enabled, axis.plot); + uts.set_marker(axis.color, axis.enabled, axis.plot, axis.marker_top); else uts.set_axis(axis.color, axis.enabled, axis.axis); } @@ -72,6 +74,7 @@ public class AltosUIFlightSeries extends AltosFlightSeries { enabled, axis, null, + false, false); axes.put(label, tsa); fill_axes(label, tsa); @@ -80,12 +83,14 @@ public class AltosUIFlightSeries extends AltosFlightSeries { public void register_marker(String label, Color color, boolean enabled, - XYPlot plot) { + XYPlot plot, + boolean marker_top) { AltosUITimeSeriesAxis tsa = new AltosUITimeSeriesAxis(color, enabled, null, plot, - true); + true, + marker_top); axes.put(label, tsa); fill_axes(label, tsa); } @@ -100,7 +105,7 @@ public class AltosUIFlightSeries extends AltosFlightSeries { tsa = axes.get("default"); if (tsa != null) { if (tsa.marker) - time_series.set_marker(tsa.color, tsa.enabled, tsa.plot); + time_series.set_marker(tsa.color, tsa.enabled, tsa.plot, tsa.marker_top); else time_series.set_axis(tsa.color, tsa.enabled, tsa.axis); } diff --git a/altosuilib/AltosUITimeSeries.java b/altosuilib/AltosUITimeSeries.java index 0f5e35eb..7c48264e 100644 --- a/altosuilib/AltosUITimeSeries.java +++ b/altosuilib/AltosUITimeSeries.java @@ -47,6 +47,7 @@ public class AltosUITimeSeries extends AltosTimeSeries implements AltosUIGrapher boolean enable; AltosUIAxis axis; boolean marker; + boolean marker_top; XYItemRenderer renderer; XYPlot plot; AltosXYSeries xy_series; @@ -81,8 +82,13 @@ public class AltosUITimeSeries extends AltosTimeSeries implements AltosUIGrapher String s = units.string_value(v.value); ValueMarker marker = new ValueMarker(v.time); marker.setLabel(s); - marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); - marker.setLabelTextAnchor(TextAnchor.TOP_LEFT); + if (marker_top) { + marker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); + marker.setLabelTextAnchor(TextAnchor.TOP_LEFT); + } else { + marker.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT); + marker.setLabelTextAnchor(TextAnchor.BOTTOM_LEFT); + } marker.setPaint(color); if (enable) plot.addDomainMarker(marker); @@ -91,12 +97,14 @@ public class AltosUITimeSeries extends AltosTimeSeries implements AltosUIGrapher } else { xy_series.clear(); + xy_series.setNotify(false); for (AltosTimeValue v : this) { double value = v.value; if (units != null) value = units.graph_value(value); xy_series.add(v.time, value); } + xy_series.setNotify(true); } } @@ -153,11 +161,12 @@ public class AltosUITimeSeries extends AltosTimeSeries implements AltosUIGrapher xy_series = new AltosXYSeries(label); } - public void set_marker(Color color, boolean enable, XYPlot plot) { + public void set_marker(Color color, boolean enable, XYPlot plot, boolean marker_top) { this.color = color; this.enable = enable; this.marker = true; this.plot = plot; + this.marker_top = marker_top; } public AltosUITimeSeries(String label, AltosUnits units) { -- cgit v1.2.3 From 2e82051a6aaaccf1e8a242f9c8141e4167e652d2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 26 May 2017 00:20:17 -0700 Subject: altoslib,altosuilib,altosui: Get stats and replay working again. Stats are really easy with all of the data in memory. Replay takes a special thread to run the data and dump it into a single state. Signed-off-by: Keith Packard --- altoslib/AltosEepromRecordMega.java | 1 - altoslib/AltosFlightReader.java | 2 - altoslib/AltosFlightSeries.java | 17 +----- altoslib/AltosFlightStats.java | 111 ++++++++++++---------------------- altoslib/AltosReplayReader.java | 117 ++++++++++++++++++++++++++++++++---- altoslib/AltosTelemetryFile.java | 1 - altoslib/AltosTimeSeries.java | 56 +++++++++++++++++ altosui/AltosFlightUI.java | 2 + altosui/AltosUI.java | 3 +- altosuilib/AltosDisplayThread.java | 26 ++++---- 10 files changed, 218 insertions(+), 118 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosEepromRecordMega.java b/altoslib/AltosEepromRecordMega.java index d4a5a0b2..cd6916b4 100644 --- a/altoslib/AltosEepromRecordMega.java +++ b/altoslib/AltosEepromRecordMega.java @@ -143,7 +143,6 @@ public class AltosEepromRecordMega extends AltosEepromRecord { ground_yaw() / 512.0); break; case AltosLib.AO_LOG_STATE: - System.out.printf("log state %s\n", AltosLib.state_name(state())); listener.set_state(state()); break; case AltosLib.AO_LOG_SENSOR: diff --git a/altoslib/AltosFlightReader.java b/altoslib/AltosFlightReader.java index 250e2236..790710e0 100644 --- a/altoslib/AltosFlightReader.java +++ b/altoslib/AltosFlightReader.java @@ -45,8 +45,6 @@ public abstract class AltosFlightReader { public void save_telemetry_rate() { } - public void update(AltosState state) throws InterruptedException { } - public boolean supports_telemetry(int telemetry) { return false; } public boolean supports_telemetry_rate(int telemetry_rate) { return false; } diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java index 0eea34b7..7bedf389 100644 --- a/altoslib/AltosFlightSeries.java +++ b/altoslib/AltosFlightSeries.java @@ -136,7 +136,6 @@ public class AltosFlightSeries extends AltosDataListener { state_series = add_series(state_name, AltosConvert.state_name); else if (this.state == state) return; - System.out.printf("state %s\n", AltosLib.state_name(state)); this.state = state; state_series.add(time(), state); } @@ -147,7 +146,6 @@ public class AltosFlightSeries extends AltosDataListener { public void set_acceleration(double acceleration) { if (accel_series == null) { - System.out.printf("set acceleration %g\n", acceleration); accel_series = add_series(accel_name, AltosConvert.accel); } accel_series.add(time(), acceleration); @@ -221,10 +219,8 @@ public class AltosFlightSeries extends AltosDataListener { public static final String speed_name = "Speed"; private void compute_speed() { - if (speed_series != null) { - System.out.printf("speed series already made\n"); + if (speed_series != null) return; - } AltosTimeSeries alt_speed_series = null; AltosTimeSeries accel_speed_series = null; @@ -235,8 +231,6 @@ public class AltosFlightSeries extends AltosDataListener { alt_speed_series = make_series(speed_name, AltosConvert.speed); temp_series.filter(alt_speed_series, 10.0); - } else { - System.out.printf("no altitude series\n"); } if (accel_series != null) { AltosTimeSeries temp_series = make_series(speed_name, AltosConvert.speed); @@ -244,8 +238,6 @@ public class AltosFlightSeries extends AltosDataListener { accel_speed_series = make_series(speed_name, AltosConvert.speed); temp_series.filter(accel_speed_series, 0.1); - } else { - System.out.printf("no accel series\n"); } if (alt_speed_series != null && accel_speed_series != null) { @@ -277,11 +269,8 @@ public class AltosFlightSeries extends AltosDataListener { } else if (accel_speed_series != null) { speed_series = accel_speed_series; } - if (speed_series != null) { + if (speed_series != null) add_series(speed_series); - System.out.printf("speed series for %s set to %s\n", this.toString(), speed_series.toString()); - } else - System.out.printf("didn't manage to make speed series\n"); } AltosTimeSeries kalman_height_series, kalman_speed_series, kalman_accel_series; @@ -575,7 +564,6 @@ public class AltosFlightSeries extends AltosDataListener { } public void fill_in() { - System.out.printf("fill in %s\n", this.toString()); compute_speed(); compute_accel(); if (cal_data.ground_altitude != AltosLib.MISSING) @@ -594,7 +582,6 @@ public class AltosFlightSeries extends AltosDataListener { public AltosFlightSeries(AltosCalData cal_data) { super(cal_data); - System.out.printf("new flight series %s\n", this.toString()); init(); } } diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java index 54d0dd63..2948ad38 100644 --- a/altoslib/AltosFlightStats.java +++ b/altoslib/AltosFlightStats.java @@ -115,8 +115,6 @@ public class AltosFlightStats { double end_time = 0; double landed_time = landed_time(series); - System.out.printf("flight stats %s\n", series.toString()); - year = month = day = AltosLib.MISSING; hour = minute = second = AltosLib.MISSING; serial = flight = AltosLib.MISSING; @@ -133,8 +131,21 @@ public class AltosFlightStats { for (int s = AltosLib.ao_flight_startup; s <= AltosLib.ao_flight_landed; s++) { state_count[s] = 0; - state_speed[s] = 0.0; - state_accel[s] = 0.0; + + if (s == AltosLib.ao_flight_boost) + state_start[s] = boost_time; + else + state_start[s] = series.state_series.time_of(s); + if (s == AltosLib.ao_flight_landed) + state_end[s] = landed_time; + else + state_end[s] = series.state_series.time_of(s+1); + + if (series.speed_series != null) + state_speed[s] = series.speed_series.average(state_start[s], state_end[s]); + + if (series.accel_series != null) + state_accel[s] = series.accel_series.average(state_start[s], state_end[s]); } serial = cal_data.serial; @@ -145,92 +156,46 @@ public class AltosFlightStats { has_rssi = series.rssi_series != null; has_flight_data = series.pressure_series != null; - if (series.gps_series != null) { - AltosGPS gps = series.gps_series.get(0).gps; + AltosGPS gps = series.cal_data.gps_pad; + if (gps != null) { year = gps.year; month = gps.month; day = gps.day; hour = gps.hour; minute = gps.minute; second = gps.second; + has_gps = true; + lat = pad_lat = gps.lat; + lon = pad_lon = gps.lon; + for (AltosGPSTimeValue gtv : series.gps_series) { + gps = gtv.gps; + if (gps.locked && gps.nsat >= 4) { + lat = gps.lat; + lon = gps.lon; + } + } + } max_height = AltosLib.MISSING; if (series.height_series != null) max_height = series.height_series.max(); max_speed = AltosLib.MISSING; - if (series.speed_series != null) - max_speed = series.speed_series.max(); - else - System.out.printf("missing speed series\n"); + if (series.speed_series != null) { + max_speed = series.speed_series.max(state_start[AltosLib.ao_flight_boost], state_start[AltosLib.ao_flight_drogue]); + if (max_speed == AltosLib.MISSING) + max_speed = series.speed_series.max(); + } max_acceleration = AltosLib.MISSING; - if (series.accel_series != null) - max_acceleration = series.accel_series.max(); + if (series.accel_series != null) { + max_acceleration = series.accel_series.max(state_start[AltosLib.ao_flight_boost], state_start[AltosLib.ao_flight_drogue]); + if (max_acceleration == AltosLib.MISSING) + max_acceleration = series.accel_series.max(); + } max_gps_height = AltosLib.MISSING; if (series.gps_height != null) max_gps_height = series.gps_height.max(); -/* - for (AltosState state : states) { - end_time = state.time; - - int state_id = state.state(); - if (boost_time != AltosLib.MISSING && state.time >= boost_time && state_id < AltosLib.ao_flight_boost) { - state_id = AltosLib.ao_flight_boost; - } - if (landed_time != AltosLib.MISSING && state.time >= landed_time && state_id < AltosLib.ao_flight_landed) { - state_id = AltosLib.ao_flight_landed; - } - - if (0 <= state_id && state_id < AltosLib.ao_flight_invalid) { - double acceleration = state.acceleration(); - double speed = state.speed(); - if (acceleration != AltosLib.MISSING && speed != AltosLib.MISSING) { - state_accel[state_id] += acceleration; - state_speed[state_id] += speed; - state_count[state_id]++; - } - if (state_start[state_id] == 0.0) - state_start[state_id] = state.time; - if (state_end[state_id] < state.time) - state_end[state_id] = state.time; - } - if (state.pad_lat != AltosLib.MISSING) { - pad_lat = state.pad_lat; - pad_lon = state.pad_lon; - } - if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) { - lat = state.gps.lat; - lon = state.gps.lon; - has_gps = true; - if (state.gps.cc_gps_sat != null) - has_gps_sats = true; - if (state.gps.course != AltosLib.MISSING) - has_gps_detail = true; - } - if (state.imu != null) - has_imu = true; - if (state.mag != null) - has_mag = true; - if (state.orient() != AltosLib.MISSING) - has_orient = true; - if (state.igniter_voltage != null && state.igniter_voltage.length > num_igniter) - num_igniter = state.igniter_voltage.length; - } -*/ - for (int s = AltosLib.ao_flight_startup; s <= AltosLib.ao_flight_landed; s++) { - if (state_count[s] > 0) { - state_speed[s] /= state_count[s]; - state_accel[s] /= state_count[s]; - } else { - state_speed[s] = AltosLib.MISSING; - state_accel[s] = AltosLib.MISSING; - } - if (state_start[s] == 0) - state_start[s] = end_time; - if (state_end[s] == 0) - state_end[s] = end_time; - } } } diff --git a/altoslib/AltosReplayReader.java b/altoslib/AltosReplayReader.java index 59ade871..fb8432e7 100644 --- a/altoslib/AltosReplayReader.java +++ b/altoslib/AltosReplayReader.java @@ -20,36 +20,131 @@ package org.altusmetrum.altoslib_11; import java.io.*; import java.util.*; +import java.util.concurrent.*; /* * Open an existing telemetry file and replay it in realtime */ +class AltosReplay extends AltosDataListener implements Runnable { + + AltosState state; + AltosRecordSet record_set; + double last_time = AltosLib.MISSING; + Semaphore semaphore = new Semaphore(1);; + boolean done = false; + + public void set_time(double time) { + if (last_time != AltosLib.MISSING) { + semaphore.release(); + double delay = Math.min(time - last_time,10); + if (delay > 0) { + try { + Thread.sleep((int) (delay * 1000)); + } catch (InterruptedException ie) { + } + } + } + last_time = time; + super.set_time(time); + state.set_time(time); + } + + public void set_state(int state) { + super.set_state(state); + this.state.set_state(state); + } + + public void set_rssi(int rssi, int status) { state.set_rssi(rssi, status); } + public void set_received_time(long received_time) { } + + public void set_acceleration(double accel) { state.set_acceleration(accel); } + public void set_pressure(double pa) { state.set_pressure(pa); } + public void set_thrust(double N) { state.set_thrust(N); } + + public void set_kalman(double height, double speed, double accel) { state.set_kalman(height, speed, accel); } + + public void set_temperature(double deg_c) { state.set_temperature(deg_c); } + public void set_battery_voltage(double volts) { state.set_battery_voltage(volts); } + + public void set_apogee_voltage(double volts) { state.set_apogee_voltage(volts); } + public void set_main_voltage(double volts) { state.set_main_voltage(volts); } + + public void set_gps(AltosGPS gps) { state.set_gps(gps); } + + public void set_orient(double orient) { state.set_orient(orient); } + public void set_gyro(double roll, double pitch, double yaw) { state.set_gyro(roll, pitch, yaw); } + public void set_accel_ground(double along, double across, double through) { state.set_accel_ground(along, across, through); } + public void set_accel(double along, double across, double through) { state.set_accel(along, across, through); } + public void set_mag(double along, double across, double through) { state.set_mag(along, across, through); } + public void set_pyro_voltage(double volts) { state.set_pyro_voltage(volts); } + public void set_igniter_voltage(double[] voltage) { state.set_igniter_voltage(voltage); } + public void set_pyro_fired(int pyro_mask) { state.set_pyro_fired(pyro_mask); } + public void set_companion(AltosCompanion companion) { state.set_companion(companion); } + + public void run () { + System.out.printf("ReplayReader running\n"); + state = new AltosState(record_set.cal_data()); + + /* Tell the display that we're in pad mode */ + state.set_state(AltosLib.ao_flight_pad); + semaphore.release(); + try { + Thread.sleep(100); + } catch (InterruptedException ie) { + } + + /* Run the flight */ + record_set.capture_series(this); + + /* All done, signal that it's over */ + done = true; + semaphore.release(); + } + + public AltosReplay(AltosRecordSet record_set) { + super(record_set.cal_data()); + try { + semaphore.acquire(); + } catch (InterruptedException ie) { } + this.record_set = record_set; + Thread t = new Thread(this); + t.start(); + } +} + public class AltosReplayReader extends AltosFlightReader { - Iterator iterator; - File file; + File file; + AltosReplay replay; public AltosState read() { - if (iterator.hasNext()) - return iterator.next(); - return null; + + /* When done, let the display know */ + if (replay.done) + return null; + + /* Wait for something to change */ + try { + replay.semaphore.acquire(); + } catch (InterruptedException ie) { + } + + /* Fake out the received time */ + replay.state.set_received_time(System.currentTimeMillis()); + return replay.state; } public void close (boolean interrupted) { } public void update(AltosState state) throws InterruptedException { - /* Make it run in realtime after the rocket leaves the pad */ - if (state.state() > AltosLib.ao_flight_pad && state.time_change > 0) - Thread.sleep((int) (Math.min(state.time_change,10) * 1000)); - state.set_received_time(System.currentTimeMillis()); } public File backing_file() { return file; } - public AltosReplayReader(Iterator in_iterator, File in_file) { - iterator = in_iterator; + public AltosReplayReader(AltosRecordSet record_set, File in_file) { file = in_file; name = file.getName(); + replay = new AltosReplay(record_set); } } diff --git a/altoslib/AltosTelemetryFile.java b/altoslib/AltosTelemetryFile.java index c6462872..8adf7e69 100644 --- a/altoslib/AltosTelemetryFile.java +++ b/altoslib/AltosTelemetryFile.java @@ -111,7 +111,6 @@ public class AltosTelemetryFile implements AltosRecordSet { if (l.cal_data_complete()) break; } - System.out.printf("Telemetry boost tick %d\n", cal_data.boost_tick); } return cal_data; } diff --git a/altoslib/AltosTimeSeries.java b/altoslib/AltosTimeSeries.java index 30b24d82..142c30ef 100644 --- a/altoslib/AltosTimeSeries.java +++ b/altoslib/AltosTimeSeries.java @@ -85,6 +85,16 @@ public class AltosTimeSeries implements Iterable { return values.get(after).value; } + public double time_of(double value) { + double last = AltosLib.MISSING; + for (AltosTimeValue v : values) { + if (v.value >= value) + return v.time; + last = v.time; + } + return last; + } + public int size() { return values.size(); } @@ -102,6 +112,16 @@ public class AltosTimeSeries implements Iterable { return max; } + public double max(double start_time, double end_time) { + double max = AltosLib.MISSING; + for (AltosTimeValue tv : values) { + if (start_time <= tv.time && tv.time <= end_time) + if (max == AltosLib.MISSING || tv.value > max) + max = tv.value; + } + return max; + } + public double min() { double min = AltosLib.MISSING; for (AltosTimeValue tv : values) { @@ -111,6 +131,42 @@ public class AltosTimeSeries implements Iterable { return min; } + public double min(double start_time, double end_time) { + double min = AltosLib.MISSING; + for (AltosTimeValue tv : values) { + if (start_time <= tv.time && tv.time <= end_time) + if (min == AltosLib.MISSING || tv.value < min) + min = tv.value; + } + return min; + } + + public double average() { + double total = 0; + int count = 0; + for (AltosTimeValue tv : values) { + total += tv.value; + count++; + } + if (count == 0) + return AltosLib.MISSING; + return total / count; + } + + public double average(double start_time, double end_time) { + double total = 0; + int count = 0; + for (AltosTimeValue tv : values) { + if (start_time <= tv.time && tv.time <= end_time) { + total += tv.value; + count++; + } + } + if (count == 0) + return AltosLib.MISSING; + return total / count; + } + public AltosTimeSeries integrate(AltosTimeSeries integral) { double value = 0.0; double pvalue = 0.0; diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index eaf19256..23a62e95 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -115,7 +115,9 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { JComponent tab = which_tab(state); if (tab != cur_tab) { + System.out.printf("checking tab for state %s\n", AltosLib.state_name(state.state())); if (cur_tab == pane.getSelectedComponent()) { + System.out.printf("switch tabs\n"); pane.setSelectedComponent(tab); } cur_tab = tab; diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index b0cff381..a6b967f8 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -481,8 +481,7 @@ public class AltosUI extends AltosUIFrame { AltosRecordSet set = record_set(file); if (set == null) return null; -// return new AltosReplayReader(states.iterator(), file); - return null; + return new AltosReplayReader(set, file); } static boolean process_replay(File file) { diff --git a/altosuilib/AltosDisplayThread.java b/altosuilib/AltosDisplayThread.java index 52414c62..1edac8a9 100644 --- a/altosuilib/AltosDisplayThread.java +++ b/altosuilib/AltosDisplayThread.java @@ -30,7 +30,9 @@ public class AltosDisplayThread extends Thread { IdleThread idle_thread; AltosVoice voice; AltosFlightReader reader; - AltosState old_state, state; + AltosState state; + int old_state = AltosLib.ao_flight_invalid; + boolean old_gps_ready = false; AltosListenerState listener_state; AltosFlightDisplay display; @@ -164,7 +166,7 @@ public class AltosDisplayThread extends Thread { } public synchronized void notice(boolean spoken) { - if (old_state != null && old_state.state() != state.state()) { + if (old_state != state.state()) { report_time = now(); this.notify(); } else if (spoken) @@ -179,16 +181,16 @@ public class AltosDisplayThread extends Thread { synchronized boolean tell() { boolean ret = false; - if (old_state == null || old_state.state() != state.state()) { + if (old_state != state.state()) { if (state.state() != AltosLib.ao_flight_stateless) voice.speak(state.state_name()); - if ((old_state == null || old_state.state() <= AltosLib.ao_flight_boost) && + if ((old_state == AltosLib.ao_flight_invalid || old_state <= AltosLib.ao_flight_boost) && state.state() > AltosLib.ao_flight_boost) { if (state.max_speed() != AltosLib.MISSING) voice.speak("max speed: %s.", AltosConvert.speed.say_units(state.max_speed() + 0.5)); ret = true; - } else if ((old_state == null || old_state.state() < AltosLib.ao_flight_drogue) && + } else if ((old_state == AltosLib.ao_flight_invalid || old_state < AltosLib.ao_flight_drogue) && state.state() >= AltosLib.ao_flight_drogue) { if (state.max_height() != AltosLib.MISSING) voice.speak("max height: %s.", @@ -196,17 +198,18 @@ public class AltosDisplayThread extends Thread { ret = true; } } - if (old_state == null || old_state.gps_ready != state.gps_ready) { + if (old_gps_ready != state.gps_ready) { if (state.gps_ready) { voice.speak("GPS ready"); ret = true; } - else if (old_state != null) { + else if (old_gps_ready) { voice.speak("GPS lost"); ret = true; } } - old_state = state; + old_state = state.state(); + old_gps_ready = state.gps_ready; return ret; } @@ -220,14 +223,11 @@ public class AltosDisplayThread extends Thread { try { for (;;) { try { - AltosState new_state = reader.read(); - if (new_state == null) { - state = null; + state = reader.read(); + if (state == null) { listener_state.running = false; break; } - reader.update(new_state); - state = new_state; show_safely(); told = tell(); idle_thread.notice(told); -- cgit v1.2.3 From af3c7938f24dcf5ffbce024ed596655b26282cf1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 26 May 2017 17:13:43 -0700 Subject: altosui: Remove --cat mode Wasn't documented, didn't do much useful. Signed-off-by: Keith Packard --- altosui/AltosUI.java | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index a6b967f8..ac46ae5c 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -412,7 +412,6 @@ public class AltosUI extends AltosUIFrame { static final int process_graph = 3; static final int process_replay = 4; static final int process_summary = 5; - static final int process_cat = 6; static boolean process_csv(File input) { AltosRecordSet set = open_logfile(input); @@ -559,36 +558,6 @@ public class AltosUI extends AltosUIFrame { return false; } - static boolean process_cat(File file) { - try { - AltosRecordSet set = record_set(file); - -// for (AltosState state : eef) { -// if ((state.set & AltosState.set_gps) != 0) { -// System.out.printf ("time %d %d-%d-%d %d:%d:%d lat %g lon %g alt %g\n", -// state.gps.seconds(), -// state.gps.year, -// state.gps.month, -// state.gps.day, -// state.gps.hour, -// state.gps.minute, -// state.gps.second, -// state.gps.lat, -// state.gps.lon, -// state.gps.alt); -// } else { -// System.out.printf ("tick %d state %d height %g\n", -// state.tick, state.state(), state.height()); -// } -// } - - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", file); - return false; - } - return true; - } - public static void help(int code) { System.out.printf("Usage: altosui [OPTION]... [FILE]...\n"); System.out.printf(" Options:\n"); @@ -631,8 +600,6 @@ public class AltosUI extends AltosUIFrame { process = process_graph; else if (args[i].equals("--summary")) process = process_summary; - else if (args[i].equals("--cat")) - process = process_cat; else if (args[i].startsWith("--")) help(1); else { @@ -661,9 +628,6 @@ public class AltosUI extends AltosUIFrame { if (!process_summary(file)) ++errors; break; - case process_cat: - if (!process_cat(file)) - ++errors; } } } -- cgit v1.2.3 From 3d29882f5c70e627b0bbfe42c0a31d6cb5f6b6bf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 26 May 2017 18:22:02 -0700 Subject: altoslib: Get KML export working again Even annotate the states with avg speed/accel for fun. Signed-off-by: Keith Packard --- altoslib/AltosCalData.java | 9 ++-- altoslib/AltosEepromRecord.java | 9 ++++ altoslib/AltosEepromRecordFull.java | 16 ------- altoslib/AltosEepromRecordMega.java | 16 ------- altoslib/AltosEepromRecordMetrum.java | 17 ------- altoslib/AltosFlightSeries.java | 8 ++++ altoslib/AltosFlightStats.java | 2 +- altoslib/AltosKML.java | 56 +++++++++------------- altoslib/AltosLib.java | 14 ++++++ altoslib/AltosTimeSeries.java | 19 +++++--- altosui/AltosUI.java | 90 +++++++++++++++++------------------ 11 files changed, 116 insertions(+), 140 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java index 3da0e400..fff6ba67 100644 --- a/altoslib/AltosCalData.java +++ b/altoslib/AltosCalData.java @@ -206,9 +206,13 @@ public class AltosCalData { public AltosGPS gps_pad = null; + public double gps_pad_altitude = AltosLib.MISSING; + public void set_gps(AltosGPS gps) { if ((state != AltosLib.MISSING && state < AltosLib.ao_flight_boost) || gps_pad == null) gps_pad = gps; + if (gps_pad_altitude == AltosLib.MISSING && gps.alt != AltosLib.MISSING) + gps_pad_altitude = gps.alt; } /* @@ -226,8 +230,8 @@ public class AltosCalData { if (temp_gps != null) { if (temp_gps.locked && temp_gps.nsat >= 4) set_gps(temp_gps); + temp_gps = null; } - temp_gps = null; } public boolean gps_pending() { @@ -235,9 +239,8 @@ public class AltosCalData { } public AltosGPS make_temp_gps(int tick, boolean sats) { - if (temp_gps == null) { + if (temp_gps == null) temp_gps = new AltosGPS(); - } if (sats) { if (tick != temp_gps_sat_tick) temp_gps.cc_gps_sat = null; diff --git a/altoslib/AltosEepromRecord.java b/altoslib/AltosEepromRecord.java index 7dd37592..7a0cc8f9 100644 --- a/altoslib/AltosEepromRecord.java +++ b/altoslib/AltosEepromRecord.java @@ -87,6 +87,15 @@ public abstract class AltosEepromRecord implements Comparable if (cmd() == AltosLib.AO_LOG_FLIGHT) cal_data.set_boost_tick(); listener.set_time(cal_data.time()); + + /* Flush any pending GPS changes */ + if (!AltosLib.is_gps_cmd(cmd())) { + AltosGPS gps = cal_data.temp_gps(); + if (gps != null) { + listener.set_gps(gps); + cal_data.reset_temp_gps(); + } + } } public int next_start() { diff --git a/altoslib/AltosEepromRecordFull.java b/altoslib/AltosEepromRecordFull.java index b4968220..c29da025 100644 --- a/altoslib/AltosEepromRecordFull.java +++ b/altoslib/AltosEepromRecordFull.java @@ -26,22 +26,6 @@ public class AltosEepromRecordFull extends AltosEepromRecord { super.provide_data(listener, cal_data); AltosGPS gps; - /* Flush any pending GPS changes */ - if (cal_data.gps_pending()) { - switch (cmd()) { - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - listener.set_gps(cal_data.temp_gps()); - cal_data.reset_temp_gps(); - break; - } - } - switch (cmd()) { case AltosLib.AO_LOG_FLIGHT: listener.set_state(AltosLib.ao_flight_pad); diff --git a/altoslib/AltosEepromRecordMega.java b/altoslib/AltosEepromRecordMega.java index cd6916b4..0abc3fe7 100644 --- a/altoslib/AltosEepromRecordMega.java +++ b/altoslib/AltosEepromRecordMega.java @@ -114,22 +114,6 @@ public class AltosEepromRecordMega extends AltosEepromRecord { AltosGPS gps; - /* Flush any pending GPS changes */ - if (cal_data.gps_pending()) { - switch (cmd()) { - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - listener.set_gps(cal_data.temp_gps()); - cal_data.reset_temp_gps(); - break; - } - } - switch (cmd()) { case AltosLib.AO_LOG_FLIGHT: cal_data.set_flight(flight()); diff --git a/altoslib/AltosEepromRecordMetrum.java b/altoslib/AltosEepromRecordMetrum.java index 97a1103d..248709b3 100644 --- a/altoslib/AltosEepromRecordMetrum.java +++ b/altoslib/AltosEepromRecordMetrum.java @@ -70,23 +70,6 @@ public class AltosEepromRecordMetrum extends AltosEepromRecord { AltosGPS gps; - /* Flush any pending GPS changes */ - if (cal_data.gps_pending()) { - switch (cmd()) { - case AltosLib.AO_LOG_GPS_POS: - case AltosLib.AO_LOG_GPS_LAT: - case AltosLib.AO_LOG_GPS_LON: - case AltosLib.AO_LOG_GPS_ALT: - case AltosLib.AO_LOG_GPS_SAT: - case AltosLib.AO_LOG_GPS_DATE: - break; - default: - listener.set_gps(cal_data.temp_gps()); - cal_data.reset_temp_gps(); - break; - } - } - switch (cmd()) { case AltosLib.AO_LOG_FLIGHT: cal_data.set_flight(flight()); diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java index 6f4f7bb1..944cff31 100644 --- a/altoslib/AltosFlightSeries.java +++ b/altoslib/AltosFlightSeries.java @@ -86,6 +86,14 @@ public class AltosFlightSeries extends AltosDataListener { return AltosLib.MISSING; } + public double value(String name, double time) { + for (AltosTimeSeries s : series) { + if (s.label.equals(name)) + return s.value(time); + } + return AltosLib.MISSING; + } + public double value_before(String name, double time) { for (AltosTimeSeries s : series) { if (s.label.equals(name)) diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java index 32beb8b5..9ebdb9e6 100644 --- a/altoslib/AltosFlightStats.java +++ b/altoslib/AltosFlightStats.java @@ -109,7 +109,7 @@ public class AltosFlightStats { } - public AltosFlightStats(AltosFlightSeries series) throws InterruptedException, IOException { + public AltosFlightStats(AltosFlightSeries series) { AltosCalData cal_data = series.cal_data; double boost_time = boost_time(series); double end_time = 0; diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java index 61e83daa..2ab91d3e 100644 --- a/altoslib/AltosKML.java +++ b/altoslib/AltosKML.java @@ -37,7 +37,8 @@ public class AltosKML implements AltosWriter { PrintWriter out; int flight_state = -1; AltosGPS prev = null; - double gps_start_altitude; + double gps_start_altitude = AltosLib.MISSING; + AltosFlightStats stats; static final String[] kml_state_colors = { "FF000000", // startup @@ -101,15 +102,16 @@ public class AltosKML implements AltosWriter { "\n" + "\n"; - void start (int state) { -/* - out.printf(kml_header_start, record.flight, record.serial); + void start (AltosCalData cal_data) { + AltosGPS gps = cal_data.gps_pad; + + gps_start_altitude = cal_data.gps_pad_altitude; + out.printf(kml_header_start, cal_data.flight, cal_data.serial); out.printf("Date: %04d-%02d-%02d\n", - record.gps.year, record.gps.month, record.gps.day); + gps.year, gps.month, gps.day); out.printf("Time: %2d:%02d:%02d\n", - record.gps.hour, record.gps.minute, record.gps.second); + gps.hour, gps.minute, gps.second); out.printf("%s", kml_header_end); -*/ } boolean started = false; @@ -118,7 +120,10 @@ public class AltosKML implements AltosWriter { String state_name = AltosLib.state_name(state); String state_color = state_color(state); out.printf(kml_style_start, state_name, state_color); - out.printf("\tState: %s\n", state_name); + out.printf("State: %s\n", state_name); + out.printf("Time: %6.2f s\n", stats.state_end[state] - stats.state_start[state]); + out.printf("Average speed: %s\n", AltosConvert.speed.show(6, stats.state_speed[state])); + out.printf("Average accel: %s\n", AltosConvert.accel.show(6, stats.state_accel[state])); out.printf("%s", kml_style_end); out.printf(kml_placemark_start, state_name, state_name); } @@ -156,52 +161,37 @@ public class AltosKML implements AltosWriter { } } - public void write(AltosGPS gps, int state, double height) { + public void write(AltosGPSTimeValue gtv, AltosCalData cal_data, int state, double height) { + AltosGPS gps = gtv.gps; if (gps.lat == AltosLib.MISSING) return; if (gps.lon == AltosLib.MISSING) return; - if (!started) { - start(state); - started = true; - gps_start_altitude = gps.alt; - } if (state != flight_state) { flight_state = state; if (prev != null) { -// coord(gps, state, height); + coord(gtv.time, gps, state, height); state_end(); } state_start(state); } -// coord(0, gps, state, height); + coord(0, gps, state, height); prev = gps; } private int state(AltosFlightSeries series, double time) { - int s = AltosLib.MISSING; - for (AltosTimeValue state : series.state_series) { - if (state.time > time) - break; - s = (int) state.value; - } - return s; + return (int) series.value_before(AltosFlightSeries.state_name, time); } private double height(AltosFlightSeries series, double time) { - double h = AltosLib.MISSING; - for (AltosTimeValue height : series.height_series) { - if (height.time > time) - break; - h = height.value; - } - return h; + return series.value(AltosFlightSeries.height_name, time); } public void write(AltosFlightSeries series) { - for (AltosGPSTimeValue gps : series.gps_series) { - write(gps.gps, state(series, gps.time), height(series, gps.time)); - } + stats = new AltosFlightStats(series); + start(series.cal_data); + for (AltosGPSTimeValue gtv : series.gps_series) + write(gtv, series.cal_data, state(series, gtv.time), height(series, gtv.time)); } public AltosKML(File in_name) throws FileNotFoundException { diff --git a/altoslib/AltosLib.java b/altoslib/AltosLib.java index fb43ea20..355c7a27 100644 --- a/altoslib/AltosLib.java +++ b/altoslib/AltosLib.java @@ -38,6 +38,20 @@ public class AltosLib { public static final int AO_LOG_GPS_DATE = 'Y'; public static final int AO_LOG_PRESSURE = 'P'; + public static boolean is_gps_cmd(int cmd) { + switch (cmd) { + case AltosLib.AO_LOG_GPS_POS: + case AltosLib.AO_LOG_GPS_TIME: + case AltosLib.AO_LOG_GPS_LAT: + case AltosLib.AO_LOG_GPS_LON: + case AltosLib.AO_LOG_GPS_ALT: + case AltosLib.AO_LOG_GPS_SAT: + case AltosLib.AO_LOG_GPS_DATE: + return true; + } + return false; + } + /* Added for header fields in eeprom files */ public static final int AO_LOG_CONFIG_VERSION = 1000; public static final int AO_LOG_MAIN_DEPLOY = 1001; diff --git a/altoslib/AltosTimeSeries.java b/altoslib/AltosTimeSeries.java index 142c30ef..64fb399e 100644 --- a/altoslib/AltosTimeSeries.java +++ b/altoslib/AltosTimeSeries.java @@ -38,7 +38,7 @@ public class AltosTimeSeries implements Iterable { if (v0.time == v1.time) return (v0.value + v1.value) / 2; - return (v0.value * (v1.time - t) + v1.value * (t - v0.time)) / v1.time - v0.time; + return (v0.value * (v1.time - t) + v1.value * (t - v0.time)) / (v1.time - v0.time); } private int after_index(double time) { @@ -59,12 +59,18 @@ public class AltosTimeSeries implements Iterable { /* Compute a value for an arbitrary time */ public double value(double time) { int after = after_index(time); - if (after == 0) - return values.get(0).value; - if (after == values.size()) - return values.get(after - 1).value; + double ret; - return lerp(values.get(after-1), values.get(after), time); + if (after == 0) + ret = values.get(0).value; + else if (after == values.size()) + ret = values.get(after - 1).value; + else { + AltosTimeValue b = values.get(after-1); + AltosTimeValue a = values.get(after); + ret = lerp(b, a, time); + } + return ret; } /* Find the value just before an arbitrary time */ @@ -182,7 +188,6 @@ public class AltosTimeSeries implements Iterable { } pvalue = v.value; time = v.time; -// System.out.printf("%g %g %g\n", time, v.value, value); integral.add(time, value); } diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index ac46ae5c..e7dedffd 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -449,6 +449,7 @@ public class AltosUI extends AltosUIFrame { if (writer == null) return false; AltosFlightSeries series = make_series(set); + series.finish(); writer.write(series); writer.close(); return true; @@ -508,54 +509,49 @@ public class AltosUI extends AltosUIFrame { AltosRecordSet set = record_set(file); if (set == null) return false; - try { - System.out.printf("%s:\n", file.toString()); - AltosFlightSeries series = make_series(set); - AltosFlightStats stats = new AltosFlightStats(series); - if (stats.serial != AltosLib.MISSING) - System.out.printf("Serial: %5d\n", stats.serial); - if (stats.flight != AltosLib.MISSING) - System.out.printf("Flight: %5d\n", stats.flight); - if (stats.year != AltosLib.MISSING) - System.out.printf("Date: %04d-%02d-%02d\n", - stats.year, stats.month, stats.day); - if (stats.hour != AltosLib.MISSING) - System.out.printf("Time: %02d:%02d:%02d UTC\n", - stats.hour, stats.minute, stats.second); - if (stats.max_height != AltosLib.MISSING) - System.out.printf("Max height: %6.0f m %6.0f ft\n", - stats.max_height, - AltosConvert.meters_to_feet(stats.max_height)); - if (stats.max_speed != AltosLib.MISSING) - System.out.printf("Max speed: %6.0f m/s %6.0f ft/s %6.4f Mach\n", - stats.max_speed, - AltosConvert.meters_to_feet(stats.max_speed), - AltosConvert.meters_to_mach(stats.max_speed)); - if (stats.max_acceleration != AltosLib.MISSING) { - System.out.printf("Max accel: %6.0f m/s² %6.0f ft/s² %6.2f g\n", - stats.max_acceleration, - AltosConvert.meters_to_feet(stats.max_acceleration), - AltosConvert.meters_to_g(stats.max_acceleration)); - } - if (stats.state_speed[Altos.ao_flight_drogue] != AltosLib.MISSING) - System.out.printf("Drogue rate: %6.0f m/s %6.0f ft/s\n", - stats.state_speed[Altos.ao_flight_drogue], - AltosConvert.meters_to_feet(stats.state_speed[Altos.ao_flight_drogue])); - if (stats.state_speed[Altos.ao_flight_main] != AltosLib.MISSING) - System.out.printf("Main rate: %6.0f m/s %6.0f ft/s\n", - stats.state_speed[Altos.ao_flight_main], - AltosConvert.meters_to_feet(stats.state_speed[Altos.ao_flight_main])); - if (stats.state_end[Altos.ao_flight_main] != AltosLib.MISSING && - stats.state_start[Altos.ao_flight_boost] != AltosLib.MISSING) - System.out.printf("Flight time: %6.0f s\n", - stats.state_end[Altos.ao_flight_main] - - stats.state_start[Altos.ao_flight_boost]); - System.out.printf("\n"); - return true; - } catch (InterruptedException ie) { - } catch (IOException ie) { + System.out.printf("%s:\n", file.toString()); + AltosFlightSeries series = make_series(set); + AltosFlightStats stats = new AltosFlightStats(series); + if (stats.serial != AltosLib.MISSING) + System.out.printf("Serial: %5d\n", stats.serial); + if (stats.flight != AltosLib.MISSING) + System.out.printf("Flight: %5d\n", stats.flight); + if (stats.year != AltosLib.MISSING) + System.out.printf("Date: %04d-%02d-%02d\n", + stats.year, stats.month, stats.day); + if (stats.hour != AltosLib.MISSING) + System.out.printf("Time: %02d:%02d:%02d UTC\n", + stats.hour, stats.minute, stats.second); + if (stats.max_height != AltosLib.MISSING) + System.out.printf("Max height: %6.0f m %6.0f ft\n", + stats.max_height, + AltosConvert.meters_to_feet(stats.max_height)); + if (stats.max_speed != AltosLib.MISSING) + System.out.printf("Max speed: %6.0f m/s %6.0f ft/s %6.4f Mach\n", + stats.max_speed, + AltosConvert.meters_to_feet(stats.max_speed), + AltosConvert.meters_to_mach(stats.max_speed)); + if (stats.max_acceleration != AltosLib.MISSING) { + System.out.printf("Max accel: %6.0f m/s² %6.0f ft/s² %6.2f g\n", + stats.max_acceleration, + AltosConvert.meters_to_feet(stats.max_acceleration), + AltosConvert.meters_to_g(stats.max_acceleration)); } - return false; + if (stats.state_speed[Altos.ao_flight_drogue] != AltosLib.MISSING) + System.out.printf("Drogue rate: %6.0f m/s %6.0f ft/s\n", + stats.state_speed[Altos.ao_flight_drogue], + AltosConvert.meters_to_feet(stats.state_speed[Altos.ao_flight_drogue])); + if (stats.state_speed[Altos.ao_flight_main] != AltosLib.MISSING) + System.out.printf("Main rate: %6.0f m/s %6.0f ft/s\n", + stats.state_speed[Altos.ao_flight_main], + AltosConvert.meters_to_feet(stats.state_speed[Altos.ao_flight_main])); + if (stats.state_end[Altos.ao_flight_main] != AltosLib.MISSING && + stats.state_start[Altos.ao_flight_boost] != AltosLib.MISSING) + System.out.printf("Flight time: %6.0f s\n", + stats.state_end[Altos.ao_flight_main] - + stats.state_start[Altos.ao_flight_boost]); + System.out.printf("\n"); + return true; } public static void help(int code) { -- cgit v1.2.3 From 855a7d243a5a85728a7b23fdfe9485d4ecaf71cf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 27 May 2017 16:12:31 -0700 Subject: telegps: Get telegps application working again Many minor API tweaks Signed-off-by: Keith Packard --- altoslib/AltosFlightReader.java | 2 ++ altoslib/AltosState.java | 3 ++ altoslib/AltosTelemetryReader.java | 32 ++++++++++------- altosui/AltosUI.java | 11 +++--- altosuilib/AltosScanUI.java | 9 ++--- telegps/TeleGPS.java | 46 ++++++++++++++----------- telegps/TeleGPSDisplayThread.java | 14 ++++---- telegps/TeleGPSGraphUI.java | 70 ++++++++++++++++++++++++++++++-------- telegps/TeleGPSState.java | 8 ++--- telegps/TeleGPSStatus.java | 26 +++++++------- 10 files changed, 142 insertions(+), 79 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosFlightReader.java b/altoslib/AltosFlightReader.java index 790710e0..f252d60b 100644 --- a/altoslib/AltosFlightReader.java +++ b/altoslib/AltosFlightReader.java @@ -31,6 +31,8 @@ public abstract class AltosFlightReader { public abstract AltosState read() throws InterruptedException, ParseException, AltosCRCException, IOException; + public abstract AltosCalData cal_data(); + public abstract void close(boolean interrupted); public void set_frequency(double frequency) throws InterruptedException, TimeoutException { } diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index e5a0541e..5abc0c2d 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -1075,11 +1075,14 @@ public class AltosState extends AltosDataListener { } public AltosState() { + Thread.dumpStack(); init(); } public AltosState (AltosCalData cal_data) { super(cal_data); + if (cal_data == null) + Thread.dumpStack(); init(); } } diff --git a/altoslib/AltosTelemetryReader.java b/altoslib/AltosTelemetryReader.java index 96113613..1020efb0 100644 --- a/altoslib/AltosTelemetryReader.java +++ b/altoslib/AltosTelemetryReader.java @@ -23,13 +23,13 @@ import java.io.*; import java.util.concurrent.*; public class AltosTelemetryReader extends AltosFlightReader { - AltosLink link; - AltosLog log; - double frequency; - int telemetry; - int telemetry_rate; - public AltosState state = null; - public AltosCalData cal_data = null; + AltosLink link; + AltosLog log; + double frequency; + int telemetry; + int telemetry_rate; + private AltosState state = null; + private AltosCalData cal_data = null; LinkedBlockingQueue telem; @@ -41,14 +41,22 @@ public class AltosTelemetryReader extends AltosFlightReader { throw new IOException("IO error"); } while (!link.get_monitor()); AltosTelemetry telem = AltosTelemetry.parse(l.line); - if (cal_data == null) - cal_data = new AltosCalData(); - if (state == null) - state = new AltosState(cal_data); - telem.provide_data(state, cal_data); + if (state == null) { + System.out.printf("Make state\n"); + state = new AltosState(cal_data()); + } + telem.provide_data(state, state.cal_data); return state; } + public AltosCalData cal_data() { + if (cal_data == null) { + System.out.printf("Make cal data\n"); + cal_data = new AltosCalData(); + } + return cal_data; + } + public void flush() { telem.clear(); } diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index e7dedffd..b302b670 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -311,12 +311,10 @@ public class AltosUI extends AltosUIFrame { AltosUI.this); AltosRecordSet set = chooser.runDialog(); -/* XXX fixme */ -// if (states != null) { -// AltosFlightReader reader = new AltosReplayReader(states.iterator(), -// chooser.file()); -// new AltosFlightUI(voice, reader); -// } + if (set != null) { + AltosReplayReader reader = new AltosReplayReader(set, chooser.file()); + new AltosFlightUI(voice, reader); + } } /* Connect to TeleMetrum, either directly or through @@ -329,6 +327,7 @@ public class AltosUI extends AltosUIFrame { private static AltosFlightSeries make_series(AltosRecordSet set) { AltosFlightSeries series = new AltosFlightSeries(set.cal_data()); set.capture_series(series); + series.finish(); return series; } diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index ad53f66b..2dc093dc 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.java @@ -213,10 +213,11 @@ public class AltosScanUI if (state == null) continue; packet_count++; - if (reader.cal_data.flight != AltosLib.MISSING) { - final AltosScanResult result = new AltosScanResult(reader.cal_data.callsign, - reader.cal_data.serial, - reader.cal_data.flight, + AltosCalData cal_data = state.cal_data; + if (cal_data.flight != AltosLib.MISSING) { + final AltosScanResult result = new AltosScanResult(cal_data.callsign, + cal_data.serial, + cal_data.flight, frequencies[frequency_index], telemetry, rate); diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index cf2cbd4f..5e500e02 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -152,7 +152,7 @@ public class TeleGPS status_update.saved_listener_state = listener_state; if (state == null) - state = new AltosState(); + state = new AltosState(new AltosCalData()); int i = 0; for (AltosFlightDisplay display : displays) { @@ -287,23 +287,30 @@ public class TeleGPS new TeleGPSConfig(this); } + private static AltosFlightSeries make_series(AltosRecordSet set) { + AltosFlightSeries series = new AltosFlightSeries(set.cal_data()); + set.capture_series(series); + series.finish(); + return series; + } + void export() { - AltosDataChooser chooser; - chooser = new AltosDataChooser(this); - AltosStateIterable states = chooser.runDialog(); - if (states == null) + AltosDataChooser chooser = new AltosDataChooser(this); + + AltosRecordSet set = chooser.runDialog(); + if (set == null) return; - new AltosCSVUI(this, states, chooser.file()); + AltosFlightSeries series = make_series(set); + new AltosCSVUI(this, series, series.cal_data, chooser.file()); } void graph() { - AltosDataChooser chooser; - chooser = new AltosDataChooser(this); - AltosStateIterable states = chooser.runDialog(); - if (states == null) + AltosDataChooser chooser = new AltosDataChooser(this); + AltosRecordSet set = chooser.runDialog(); + if (set == null) return; try { - new TeleGPSGraphUI(states, chooser.file()); + new TeleGPSGraphUI(set, chooser.file()); } catch (InterruptedException ie) { } catch (IOException ie) { } @@ -612,7 +619,7 @@ public class TeleGPS connect(device); } - static AltosStateIterable record_iterable(File file) { + static AltosRecordSet record_set(File file) { FileInputStream in; if (file.getName().endsWith("telem")) { try { @@ -624,8 +631,7 @@ public class TeleGPS } else { try { - AltosEepromFile f = new AltosEepromFile(new FileReader(file)); - return f; + return new AltosEepromFile(new FileReader(file)); } catch (Exception e) { System.out.printf("Failed to open file '%s'\n", file); } @@ -634,18 +640,18 @@ public class TeleGPS } static AltosReplayReader replay_file(File file) { - AltosStateIterable states = record_iterable(file); - if (states == null) + AltosRecordSet set = record_set(file); + if (set == null) return null; - return new AltosReplayReader(states.iterator(), file); + return new AltosReplayReader(set, file); } static boolean process_graph(File file) { - AltosStateIterable states = record_iterable(file); - if (states == null) + AltosRecordSet set = record_set(file); + if (set == null) return false; try { - new TeleGPSGraphUI(states, file); + new TeleGPSGraphUI(set, file); } catch (Exception e) { return false; } diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java index a9c80dc0..c311dd7e 100644 --- a/telegps/TeleGPSDisplayThread.java +++ b/telegps/TeleGPSDisplayThread.java @@ -31,7 +31,9 @@ public class TeleGPSDisplayThread extends Thread { IdleThread idle_thread; AltosVoice voice; AltosFlightReader reader; - AltosState old_state, state; + AltosState state; + int old_state = AltosLib.ao_flight_invalid; + boolean old_gps_ready = false; AltosListenerState listener_state; AltosFlightDisplay display; @@ -130,11 +132,12 @@ public class TeleGPSDisplayThread extends Thread { } public synchronized void notice(boolean spoken) { - if (old_state != null && old_state.state() != state.state()) { + if (old_state != state.state()) { report_time = now(); this.notify(); } else if (spoken) set_report_time(); + old_state = state.state(); } public IdleThread() { @@ -144,17 +147,17 @@ public class TeleGPSDisplayThread extends Thread { synchronized boolean tell() { boolean ret = false; - if (old_state == null || old_state.gps_ready != state.gps_ready) { + if (old_gps_ready != state.gps_ready) { if (state.gps_ready) { voice.speak("GPS ready"); ret = true; } - else if (old_state != null) { + else if (old_gps_ready) { voice.speak("GPS lost"); ret = true; } + old_gps_ready = state.gps_ready; } - old_state = state; return ret; } @@ -173,7 +176,6 @@ public class TeleGPSDisplayThread extends Thread { listener_state.running = false; break; } - reader.update(state); show_safely(); told = tell(); idle_thread.notice(told); diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java index 55ee370e..3e765640 100644 --- a/telegps/TeleGPSGraphUI.java +++ b/telegps/TeleGPSGraphUI.java @@ -34,21 +34,41 @@ import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.ui.RefineryUtilities; -public class TeleGPSGraphUI extends AltosUIFrame +public class TeleGPSGraphUI extends AltosUIFrame implements AltosFontListener, AltosUnitsListener { JTabbedPane pane; - AltosGraph graph; + AltosGraphNew graph; AltosUIEnable enable; AltosUIMap map; AltosState state; AltosFlightStats stats; - AltosGraphDataSet graphDataSet; AltosFlightStatsTable statsTable; - - void fill_map(AltosStateIterable states) { - for (AltosState state : states) { - if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) - map.show(state, null); + AltosGPS gps; + boolean has_gps; + + void fill_map(AltosFlightSeries flight_series) { + boolean any_gps = false; + AltosGPSTimeValue gtv_last = null; + + if (flight_series.gps_series != null) { + for (AltosGPSTimeValue gtv : flight_series.gps_series) { + gtv_last = gtv; + AltosGPS gps = gtv.gps; + if (gps != null && + gps.locked && + gps.nsat >= 4) { + if (map == null) + map = new AltosUIMap(); + map.show(gps, (int) flight_series.value_before(AltosFlightSeries.state_name, gtv.time)); + this.gps = gps; + has_gps = true; + } + } + } + if (gtv_last != null) { + int state = (int) flight_series.value_after(AltosFlightSeries.state_name, gtv_last.time); + if (state == AltosLib.ao_flight_landed) + map.show(gtv_last.gps, state); } } @@ -58,16 +78,35 @@ public class TeleGPSGraphUI extends AltosUIFrame TeleGPS.subtract_window(); } - TeleGPSGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException { + public void font_size_changed(int font_size) { + if (map != null) + map.font_size_changed(font_size); + if (statsTable != null) + statsTable.font_size_changed(font_size); + } + + public void units_changed(boolean imperial_units) { + if (map != null) + map.units_changed(imperial_units); + if (enable != null) + enable.units_changed(imperial_units); + } + + TeleGPSGraphUI(AltosRecordSet set, File file) throws InterruptedException, IOException { super(file.getName()); - state = null; + AltosCalData cal_data = set.cal_data(); + + AltosUIFlightSeries flight_series = new AltosUIFlightSeries(cal_data); + set.capture_series(flight_series); + flight_series.finish(); pane = new JTabbedPane(); enable = new AltosUIEnable(); - stats = new AltosFlightStats(states); - graphDataSet = new AltosGraphDataSet(states); - graph = new AltosGraph(enable, stats, graphDataSet); + stats = new AltosFlightStats(flight_series); + + graph = new AltosGraphNew(enable, stats, flight_series, cal_data); + statsTable = new AltosFlightStatsTable(stats); map = new AltosUIMap(); @@ -75,11 +114,14 @@ public class TeleGPSGraphUI extends AltosUIFrame pane.add("Graph", graph.panel); pane.add("Configure Graph", enable); pane.add("Statistics", statsTable); - fill_map(states); + fill_map(flight_series); pane.add("Map", map); setContentPane (pane); + AltosUIPreferences.register_font_listener(this); + AltosPreferences.register_units_listener(this); + addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java index 9ba0b7a5..2e39037c 100644 --- a/telegps/TeleGPSState.java +++ b/telegps/TeleGPSState.java @@ -124,10 +124,10 @@ public class TeleGPSState extends AltosUIFlightTab { class FirmwareVersion extends AltosUIIndicator { public void show(AltosState state, AltosListenerState listener_state) { - if (state.firmware_version == null) + if (state.cal_data.firmware_version == null) show("Missing"); else - show(state.firmware_version); + show(state.cal_data.firmware_version); } public FirmwareVersion(Container container, int y) { @@ -137,9 +137,7 @@ public class TeleGPSState extends AltosUIFlightTab { class FlightLogMax extends AltosUIIndicator { public void show(AltosState state, AltosListenerState listener_state) { - int storage = state.flight_log_max; - if (storage == AltosLib.MISSING) - storage = state.log_space >> 10; + int storage = state.cal_data.flight_log_max; if (storage == AltosLib.MISSING) show("Missing"); else diff --git a/telegps/TeleGPSStatus.java b/telegps/TeleGPSStatus.java index 5479f43a..a6ddd1b0 100644 --- a/telegps/TeleGPSStatus.java +++ b/telegps/TeleGPSStatus.java @@ -75,11 +75,13 @@ public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { String call; void show(AltosState state, AltosListenerState listener_state) { - if (state.callsign != call) { - value.setText(state.callsign); - call = state.callsign; + if (state.cal_data == null) + System.out.printf("null cal data?\n"); + if (state.cal_data.callsign != call) { + value.setText(state.cal_data.callsign); + call = state.cal_data.callsign; } - if (state.callsign == null) + if (state.cal_data.callsign == null) setVisible(false); else setVisible(true); @@ -100,12 +102,12 @@ public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { class Serial extends Value { int serial = -1; void show(AltosState state, AltosListenerState listener_state) { - if (state.serial != serial) { - if (state.serial == AltosLib.MISSING) + if (state.cal_data.serial != serial) { + if (state.cal_data.serial == AltosLib.MISSING) value.setText("none"); else - value.setText(String.format("%d", state.serial)); - serial = state.serial; + value.setText(String.format("%d", state.cal_data.serial)); + serial = state.cal_data.serial; } } @@ -126,12 +128,12 @@ public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { int last_flight = -1; void show(AltosState state, AltosListenerState listener_state) { - if (state.flight != last_flight) { - if (state.flight == AltosLib.MISSING) + if (state.cal_data.flight != last_flight) { + if (state.cal_data.flight == AltosLib.MISSING) value.setText("none"); else - value.setText(String.format("%d", state.flight)); - last_flight = state.flight; + value.setText(String.format("%d", state.cal_data.flight)); + last_flight = state.cal_data.flight; } } -- cgit v1.2.3 From da914cd72411af8c36af05b13c11b9093c8a378c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 28 May 2017 14:00:15 -0700 Subject: altoslib: Create data file open helper in AltosLib Use InputStream everywhere, instead of Reader. Create private string input stream as java one is deprecated. Signed-off-by: Keith Packard --- altoslib/AltosEepromFile.java | 2 +- altoslib/AltosEepromNew.java | 67 ++++++++++++++++++++++-------------- altoslib/AltosEepromRecordSet.java | 2 +- altoslib/AltosJson.java | 10 +++--- altoslib/AltosLib.java | 24 +++++++++++++ altoslib/AltosStringInputStream.java | 61 ++++++++++++++++++++++++++++++++ altoslib/AltosTelemetryFile.java | 2 +- altoslib/AltosTelemetryIterable.java | 30 +++++++--------- altoslib/Makefile.am | 1 + altosui/AltosLanded.java | 4 +-- altosui/AltosUI.java | 52 ++++++++-------------------- altosuilib/AltosDataChooser.java | 16 +-------- telegps/TeleGPS.java | 19 +++------- 13 files changed, 169 insertions(+), 121 deletions(-) create mode 100644 altoslib/AltosStringInputStream.java (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java index df19877b..463948b1 100644 --- a/altoslib/AltosEepromFile.java +++ b/altoslib/AltosEepromFile.java @@ -33,7 +33,7 @@ public class AltosEepromFile implements AltosRecordSet { out.printf("%s\n", set.eeprom.toString()); } - public AltosEepromFile(Reader input) throws IOException { + public AltosEepromFile(InputStream input) throws IOException { set = new AltosEepromRecordSet(input); } diff --git a/altoslib/AltosEepromNew.java b/altoslib/AltosEepromNew.java index 0da3df71..c373bff3 100644 --- a/altoslib/AltosEepromNew.java +++ b/altoslib/AltosEepromNew.java @@ -93,19 +93,34 @@ public class AltosEepromNew { w.append('\n'); } - private boolean read_config(Reader r) throws IOException { - config = AltosJson.fromReader(r); + private boolean read_config(InputStream stream) throws IOException { + config = AltosJson.fromInputStream(stream); if (config == null) return false; return true; } - private boolean read_data(Reader r) throws IOException { - BufferedReader br = new BufferedReader(r); - String s; + private String read_line(InputStream stream) throws IOException { + StringBuffer buffer = null; + int c; + + for (;;) { + c = stream.read(); + if (c == -1 && buffer == null) + return null; + if (buffer == null) + buffer = new StringBuffer(); + if (c == -1 || c == '\n') + return buffer.toString(); + buffer.append((char) c); + } + } + + private boolean read_data(InputStream stream) throws IOException { + String s; data = new ArrayList(); - while ((s = br.readLine()) != null) { + while ((s = read_line(stream)) != null) { String[] tokens = s.split("\\s+"); @@ -122,24 +137,24 @@ public class AltosEepromNew { return true; } - private boolean read_old_config(BufferedReader r) throws IOException { + private boolean read_old_config(InputStream stream) throws IOException { AltosConfigData cfg = new AltosConfigData(); for (;;) { boolean done = false; /* The data starts with an upper case F character followed by a space */ - r.mark(2); - int first = r.read(); + stream.mark(2); + int first = stream.read(); if (first == 'F') { - int second = r.read(); + int second = stream.read(); if (second == ' ') done = true; } - r.reset(); + stream.reset(); if (done) break; - String line = r.readLine(); + String line = read_line(stream); if (line == null) return false; cfg.parse_line(line); @@ -148,11 +163,11 @@ public class AltosEepromNew { return true; } - private boolean read_old_data(BufferedReader r) throws IOException { + private boolean read_old_data(InputStream stream) throws IOException { String line; data = new ArrayList(); - while ((line = r.readLine()) != null) { + while ((line = read_line(stream)) != null) { String[] tokens = line.split("\\s+"); /* Make sure there's at least a type and time */ @@ -207,22 +222,22 @@ public class AltosEepromNew { return true; } - private void read(Reader r) throws IOException { - BufferedReader br = new BufferedReader(r); + private void read(InputStream stream) throws IOException { + BufferedInputStream bis = new BufferedInputStream(stream); - br.mark(1); - int c = br.read(); - br.reset(); + bis.mark(1); + int c = bis.read(); + bis.reset(); if (c == '{') { - if (!read_config(br)) + if (!read_config(bis)) throw new IOException("failed to read config"); - if (!read_data(br)) + if (!read_data(bis)) throw new IOException("failed to read data"); } else { - if (!read_old_config(br)) + if (!read_old_config(bis)) throw new IOException("failed to read old config"); - if (!read_old_data(br)) + if (!read_old_data(bis)) throw new IOException("failed to read old data"); } } @@ -253,12 +268,12 @@ public class AltosEepromNew { /* * Constructors */ - public AltosEepromNew(Reader r) throws IOException { - read(r); + public AltosEepromNew(InputStream stream) throws IOException { + read(stream); } public AltosEepromNew(String s) throws IOException { - read(new StringReader(s)); + read(new AltosStringInputStream(s)); } public AltosEepromNew(AltosJson config, ArrayList data) { diff --git a/altoslib/AltosEepromRecordSet.java b/altoslib/AltosEepromRecordSet.java index 183cb9ae..0c60c1a5 100644 --- a/altoslib/AltosEepromRecordSet.java +++ b/altoslib/AltosEepromRecordSet.java @@ -110,7 +110,7 @@ public class AltosEepromRecordSet implements AltosRecordSet { } } - public AltosEepromRecordSet(Reader input) throws IOException { + public AltosEepromRecordSet(InputStream input) throws IOException { this(new AltosEepromNew(input)); } } diff --git a/altoslib/AltosJson.java b/altoslib/AltosJson.java index 9191be68..ce50b872 100644 --- a/altoslib/AltosJson.java +++ b/altoslib/AltosJson.java @@ -255,7 +255,7 @@ class JsonToken { * Lexer for json */ class JsonLexer extends JsonUtil { - Reader f; + InputStream f; int line; int ungot = -2; StringBuffer pending_token; @@ -445,12 +445,12 @@ class JsonLexer extends JsonUtil { } JsonLexer(String s) { - f = new StringReader(s); + f = new AltosStringInputStream(s); line = 1; token = null; } - JsonLexer(Reader f) { + JsonLexer(InputStream f) { this.f = f; line = 1; token = null; @@ -570,7 +570,7 @@ class JsonParse { lexer = new JsonLexer(s); } - JsonParse(Reader f) { + JsonParse(InputStream f) { lexer = new JsonLexer(f); } } @@ -670,7 +670,7 @@ public class AltosJson extends JsonUtil { } } - public static AltosJson fromReader(Reader f) { + public static AltosJson fromInputStream(InputStream f) { JsonParse parse = new JsonParse(f); try { return parse.parse(); diff --git a/altoslib/AltosLib.java b/altoslib/AltosLib.java index 355c7a27..6c1729df 100644 --- a/altoslib/AltosLib.java +++ b/altoslib/AltosLib.java @@ -588,4 +588,28 @@ public class AltosLib { public static String igniter_name(int i) { return String.format("Ignitor %c", 'A' + i); } + + public static AltosRecordSet record_set(File file) throws FileNotFoundException, IOException { + FileInputStream in; + in = new FileInputStream(file); + if (file.getName().endsWith("telem")) { + return new AltosTelemetryFile(in); + } else if (file.getName().endsWith("eeprom")) { + return new AltosEepromFile(in); + } else { + String name = file.getName(); + int dot = name.lastIndexOf('.'); + String extension; + + if (dot == -1) + throw new IOException(String.format("%s (Missing extension)", file.toString())); + else { + extension = name.substring(dot); + throw new IOException(String.format("%s (Invalid extension '%s')", + file.toString(), + extension)); + } + } + } + } diff --git a/altoslib/AltosStringInputStream.java b/altoslib/AltosStringInputStream.java new file mode 100644 index 00000000..d574db24 --- /dev/null +++ b/altoslib/AltosStringInputStream.java @@ -0,0 +1,61 @@ +/* + * Copyright © 2017 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +package org.altusmetrum.altoslib_11; + +import java.util.*; +import java.io.*; + +public class AltosStringInputStream extends InputStream { + + String s; + int at; + int mark; + + public int available() { + return s.length() - at; + } + + public void mark(int read_limit) { + mark = at; + } + + public boolean markSupported() { + return true; + } + + public int read() { + if (at == s.length()) + return -1; + return (int) s.charAt(at++); + } + + public void reset() { + at = mark; + } + + public long skip(long n) throws IOException { + if (n < 0) n = 0; + + if (at + n > s.length()) + n = s.length() - at; + at += n; + return n; + } + + public AltosStringInputStream(String s) { + this.s = s; + this.at = 0; + } +} diff --git a/altoslib/AltosTelemetryFile.java b/altoslib/AltosTelemetryFile.java index 40b9c9bf..077ef9c6 100644 --- a/altoslib/AltosTelemetryFile.java +++ b/altoslib/AltosTelemetryFile.java @@ -129,7 +129,7 @@ public class AltosTelemetryFile implements AltosRecordSet { listener.finish(); } - public AltosTelemetryFile(FileInputStream input) { + public AltosTelemetryFile(FileInputStream input) throws IOException { telems = new AltosTelemetryIterable(input); } } diff --git a/altoslib/AltosTelemetryIterable.java b/altoslib/AltosTelemetryIterable.java index 402bbf4f..a752e24e 100644 --- a/altoslib/AltosTelemetryIterable.java +++ b/altoslib/AltosTelemetryIterable.java @@ -80,29 +80,25 @@ public class AltosTelemetryIterable implements Iterable { return new AltosTelemetryOrderedIterator(telems); } - public AltosTelemetryIterable (FileInputStream input) { + public AltosTelemetryIterable (FileInputStream input) throws IOException { telems = new TreeSet (); tick = 0; index = 0; - try { - for (;;) { - String line = AltosLib.gets(input); - if (line == null) { + for (;;) { + String line = AltosLib.gets(input); + if (line == null) { + break; + } + try { + AltosTelemetry telem = AltosTelemetry.parse(line); + if (telem == null) break; - } - try { - AltosTelemetry telem = AltosTelemetry.parse(line); - if (telem == null) - break; - add(telem); - } catch (ParseException pe) { - System.out.printf("parse exception %s\n", pe.getMessage()); - } catch (AltosCRCException ce) { - } + add(telem); + } catch (ParseException pe) { + System.out.printf("parse exception %s\n", pe.getMessage()); + } catch (AltosCRCException ce) { } - } catch (IOException io) { - System.out.printf("io exception\n"); } } } diff --git a/altoslib/Makefile.am b/altoslib/Makefile.am index ffa92783..1e26b724 100644 --- a/altoslib/Makefile.am +++ b/altoslib/Makefile.am @@ -107,6 +107,7 @@ altoslib_JAVA = \ AltosSensorTGPS.java \ AltosState.java \ AltosStateName.java \ + AltosStringInputStream.java \ AltosTelemetry.java \ AltosTelemetryConfiguration.java \ AltosTelemetryCompanion.java \ diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index a75d5a9f..de0d7425 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -124,10 +124,10 @@ public class AltosLanded extends AltosUIFlightTab implements ActionListener { String filename = file.getName(); try { AltosRecordSet record_set = null; + FileInputStream in = new FileInputStream(file); if (filename.endsWith("eeprom")) { - record_set = new AltosEepromRecordSet(new FileReader(file)); + record_set = new AltosEepromRecordSet(in); } else if (filename.endsWith("telem")) { - FileInputStream in = new FileInputStream(file); record_set = new AltosTelemetryFile(in); } else { throw new FileNotFoundException(filename); diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index b302b670..ac121512 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -372,21 +372,6 @@ public class AltosUI extends AltosUIFrame { } } - static AltosRecordSet open_logfile(File file) { - try { - if (file.getName().endsWith("telem")) - return new AltosTelemetryFile(new FileInputStream(file)); - else - return new AltosEepromFile(new FileReader(file)); - } catch (FileNotFoundException fe) { - System.out.printf("%s\n", fe.getMessage()); - return null; - } catch (IOException ie) { - System.out.printf("%s\n", ie.getMessage()); - return null; - } - } - static AltosWriter open_csv(File file) { try { return new AltosCSV(file); @@ -405,6 +390,18 @@ public class AltosUI extends AltosUIFrame { } } + static AltosRecordSet record_set(File input) { + try { + return AltosLib.record_set(input); + } catch (IOException ie) { + String message = ie.getMessage(); + if (message == null) + message = String.format("%s (I/O error)", input.toString()); + System.err.printf("%s\n", message); + } + return null; + } + static final int process_none = 0; static final int process_csv = 1; static final int process_kml = 2; @@ -413,7 +410,7 @@ public class AltosUI extends AltosUIFrame { static final int process_summary = 5; static boolean process_csv(File input) { - AltosRecordSet set = open_logfile(input); + AltosRecordSet set = record_set(input); if (set == null) return false; @@ -434,7 +431,7 @@ public class AltosUI extends AltosUIFrame { } static boolean process_kml(File input) { - AltosRecordSet set = open_logfile(input); + AltosRecordSet set = record_set(input); if (set == null) return false; @@ -455,27 +452,6 @@ public class AltosUI extends AltosUIFrame { } } - static AltosRecordSet record_set(File file) { - FileInputStream in; - if (file.getName().endsWith("telem")) { - try { - in = new FileInputStream(file); - return new AltosTelemetryFile(in); - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", file); - } - } else { - - try { - AltosEepromFile f = new AltosEepromFile(new FileReader(file)); - return f; - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", file); - } - } - return null; - } - static AltosReplayReader replay_file(File file) { AltosRecordSet set = record_set(file); if (set == null) diff --git a/altosuilib/AltosDataChooser.java b/altosuilib/AltosDataChooser.java index c6d53a31..c26d3673 100644 --- a/altosuilib/AltosDataChooser.java +++ b/altosuilib/AltosDataChooser.java @@ -44,22 +44,8 @@ public class AltosDataChooser extends JFileChooser { file = getSelectedFile(); if (file == null) return null; - filename = file.getName(); try { - if (filename.endsWith("eeprom")) { - FileReader in = new FileReader(file); - return new AltosEepromFile(in); - } else if (filename.endsWith("telem")) { - FileInputStream in = new FileInputStream(file); - return new AltosTelemetryFile(in); - } else { - throw new FileNotFoundException(); - } - } catch (FileNotFoundException fe) { - JOptionPane.showMessageDialog(frame, - fe.getMessage(), - "Cannot open file", - JOptionPane.ERROR_MESSAGE); + return AltosLib.record_set(file); } catch (IOException ie) { JOptionPane.showMessageDialog(frame, ie.getMessage(), diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index 5e500e02..e032726a 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -620,21 +620,10 @@ public class TeleGPS } static AltosRecordSet record_set(File file) { - FileInputStream in; - if (file.getName().endsWith("telem")) { - try { - in = new FileInputStream(file); - return new AltosTelemetryFile(in); - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", file); - } - } else { - - try { - return new AltosEepromFile(new FileReader(file)); - } catch (Exception e) { - System.out.printf("Failed to open file '%s'\n", file); - } + try { + return AltosLib.record_set(file); + } catch (IOException ie) { + System.out.printf("%s\n", ie.getMessage()); } return null; } -- cgit v1.2.3 From a61217f0a6d0ef48b6471f632c4600255867e831 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 13 Jun 2017 10:58:57 -0700 Subject: altoslib,altosuilib: Bump library version numbers The API and ABI have changed a bit since 1.7 Signed-off-by: Keith Packard --- altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java | 2 +- .../src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java | 2 +- .../src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java | 2 +- altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java | 2 +- altoslib/AltosAccel.java | 2 +- altoslib/AltosCRCException.java | 2 +- altoslib/AltosCSV.java | 2 +- altoslib/AltosCalData.java | 2 +- altoslib/AltosCompanion.java | 2 +- altoslib/AltosConfigData.java | 2 +- altoslib/AltosConfigDataException.java | 2 +- altoslib/AltosConfigValues.java | 2 +- altoslib/AltosConvert.java | 2 +- altoslib/AltosDataListener.java | 2 +- altoslib/AltosDataProvider.java | 2 +- altoslib/AltosDebug.java | 2 +- altoslib/AltosDistance.java | 2 +- altoslib/AltosEeprom.java | 2 +- altoslib/AltosEepromChunk.java | 2 +- altoslib/AltosEepromDownload.java | 2 +- altoslib/AltosEepromFile.java | 2 +- altoslib/AltosEepromList.java | 2 +- altoslib/AltosEepromLog.java | 2 +- altoslib/AltosEepromMonitor.java | 2 +- altoslib/AltosEepromRecord.java | 2 +- altoslib/AltosEepromRecordFireTwo.java | 2 +- altoslib/AltosEepromRecordFull.java | 2 +- altoslib/AltosEepromRecordGps.java | 2 +- altoslib/AltosEepromRecordMega.java | 2 +- altoslib/AltosEepromRecordMetrum.java | 2 +- altoslib/AltosEepromRecordMini.java | 2 +- altoslib/AltosEepromRecordSet.java | 2 +- altoslib/AltosEepromRecordTiny.java | 2 +- altoslib/AltosFile.java | 2 +- altoslib/AltosFlash.java | 2 +- altoslib/AltosFlashListener.java | 2 +- altoslib/AltosFlightDisplay.java | 2 +- altoslib/AltosFlightListener.java | 2 +- altoslib/AltosFlightReader.java | 2 +- altoslib/AltosFlightSeries.java | 2 +- altoslib/AltosFlightStats.java | 2 +- altoslib/AltosFontListener.java | 2 +- altoslib/AltosForce.java | 2 +- altoslib/AltosFrequency.java | 2 +- altoslib/AltosGPS.java | 2 +- altoslib/AltosGPSSat.java | 2 +- altoslib/AltosGPSTimeValue.java | 2 +- altoslib/AltosGreatCircle.java | 2 +- altoslib/AltosHeight.java | 2 +- altoslib/AltosHexfile.java | 2 +- altoslib/AltosHexsym.java | 2 +- altoslib/AltosIMU.java | 2 +- altoslib/AltosIdle.java | 2 +- altoslib/AltosIdleFetch.java | 2 +- altoslib/AltosIdleMonitor.java | 2 +- altoslib/AltosIdleMonitorListener.java | 2 +- altoslib/AltosIdleReader.java | 2 +- altoslib/AltosIgnite.java | 2 +- altoslib/AltosImage.java | 2 +- altoslib/AltosJson.java | 2 +- altoslib/AltosKML.java | 2 +- altoslib/AltosLatLon.java | 2 +- altoslib/AltosLatitude.java | 2 +- altoslib/AltosLaunchSite.java | 2 +- altoslib/AltosLaunchSiteListener.java | 2 +- altoslib/AltosLaunchSites.java | 2 +- altoslib/AltosLib.java | 2 +- altoslib/AltosLine.java | 2 +- altoslib/AltosLink.java | 2 +- altoslib/AltosListenerState.java | 2 +- altoslib/AltosLocation.java | 2 +- altoslib/AltosLog.java | 2 +- altoslib/AltosLongitude.java | 2 +- altoslib/AltosMag.java | 2 +- altoslib/AltosMap.java | 2 +- altoslib/AltosMapCache.java | 2 +- altoslib/AltosMapCacheListener.java | 2 +- altoslib/AltosMapInterface.java | 2 +- altoslib/AltosMapLine.java | 2 +- altoslib/AltosMapLoader.java | 2 +- altoslib/AltosMapLoaderListener.java | 2 +- altoslib/AltosMapMark.java | 2 +- altoslib/AltosMapPath.java | 2 +- altoslib/AltosMapPathPoint.java | 2 +- altoslib/AltosMapRectangle.java | 2 +- altoslib/AltosMapStore.java | 2 +- altoslib/AltosMapStoreListener.java | 2 +- altoslib/AltosMapTile.java | 2 +- altoslib/AltosMapTileListener.java | 2 +- altoslib/AltosMapTransform.java | 2 +- altoslib/AltosMapTypeListener.java | 2 +- altoslib/AltosMapZoomListener.java | 2 +- altoslib/AltosMma655x.java | 2 +- altoslib/AltosMs5607.java | 2 +- altoslib/AltosNoSymbol.java | 2 +- altoslib/AltosOrient.java | 2 +- altoslib/AltosParse.java | 2 +- altoslib/AltosPointDouble.java | 2 +- altoslib/AltosPointInt.java | 2 +- altoslib/AltosPreferences.java | 2 +- altoslib/AltosPreferencesBackend.java | 2 +- altoslib/AltosPresTemp.java | 2 +- altoslib/AltosPressure.java | 2 +- altoslib/AltosProgrammer.java | 2 +- altoslib/AltosPyro.java | 2 +- altoslib/AltosPyroName.java | 2 +- altoslib/AltosQuaternion.java | 2 +- altoslib/AltosRecordSet.java | 2 +- altoslib/AltosRectangle.java | 2 +- altoslib/AltosReplayReader.java | 2 +- altoslib/AltosRomconfig.java | 2 +- altoslib/AltosRotation.java | 2 +- altoslib/AltosRotationRate.java | 2 +- altoslib/AltosSavedState.java | 2 +- altoslib/AltosSelfFlash.java | 2 +- altoslib/AltosSensorEMini.java | 2 +- altoslib/AltosSensorMM.java | 2 +- altoslib/AltosSensorMega.java | 2 +- altoslib/AltosSensorMetrum.java | 2 +- altoslib/AltosSensorTGPS.java | 2 +- altoslib/AltosSensorTM.java | 2 +- altoslib/AltosSensorTMini2.java | 2 +- altoslib/AltosSensorTMini3.java | 2 +- altoslib/AltosSpeed.java | 2 +- altoslib/AltosState.java | 2 +- altoslib/AltosStateName.java | 2 +- altoslib/AltosStringInputStream.java | 2 +- altoslib/AltosTelemetry.java | 2 +- altoslib/AltosTelemetryCompanion.java | 2 +- altoslib/AltosTelemetryConfiguration.java | 2 +- altoslib/AltosTelemetryFile.java | 2 +- altoslib/AltosTelemetryIterable.java | 2 +- altoslib/AltosTelemetryLegacy.java | 2 +- altoslib/AltosTelemetryLocation.java | 2 +- altoslib/AltosTelemetryMap.java | 2 +- altoslib/AltosTelemetryMegaData.java | 2 +- altoslib/AltosTelemetryMegaSensor.java | 2 +- altoslib/AltosTelemetryMetrumData.java | 2 +- altoslib/AltosTelemetryMetrumSensor.java | 2 +- altoslib/AltosTelemetryMini2.java | 2 +- altoslib/AltosTelemetryMini3.java | 2 +- altoslib/AltosTelemetryRaw.java | 2 +- altoslib/AltosTelemetryReader.java | 2 +- altoslib/AltosTelemetrySatellite.java | 2 +- altoslib/AltosTelemetrySensor.java | 2 +- altoslib/AltosTelemetryStandard.java | 2 +- altoslib/AltosTemperature.java | 2 +- altoslib/AltosTime.java | 2 +- altoslib/AltosTimeSeries.java | 2 +- altoslib/AltosTimeValue.java | 2 +- altoslib/AltosUnits.java | 2 +- altoslib/AltosUnitsListener.java | 2 +- altoslib/AltosUnitsRange.java | 2 +- altoslib/AltosUnknownProduct.java | 2 +- altoslib/AltosVersion.java.in | 2 +- altoslib/AltosVoltage.java | 2 +- altoslib/AltosWriter.java | 2 +- altosui/Altos.java | 4 ++-- altosui/AltosAscent.java | 4 ++-- altosui/AltosCompanionInfo.java | 4 ++-- altosui/AltosConfig.java | 4 ++-- altosui/AltosConfigPyroUI.java | 4 ++-- altosui/AltosConfigTD.java | 4 ++-- altosui/AltosConfigTDUI.java | 4 ++-- altosui/AltosConfigUI.java | 4 ++-- altosui/AltosConfigureUI.java | 2 +- altosui/AltosDescent.java | 4 ++-- altosui/AltosFlightStatus.java | 4 ++-- altosui/AltosFlightStatusTableModel.java | 2 +- altosui/AltosFlightStatusUpdate.java | 2 +- altosui/AltosFlightUI.java | 4 ++-- altosui/AltosGraphUI.java | 4 ++-- altosui/AltosIdleMonitorUI.java | 4 ++-- altosui/AltosIgniteUI.java | 4 ++-- altosui/AltosIgnitor.java | 4 ++-- altosui/AltosLanded.java | 4 ++-- altosui/AltosLaunch.java | 2 +- altosui/AltosLaunchUI.java | 2 +- altosui/AltosPad.java | 4 ++-- altosui/AltosUI.java | 4 ++-- altosuilib/AltosBTDevice.java | 4 ++-- altosuilib/AltosBTDeviceIterator.java | 4 ++-- altosuilib/AltosBTKnown.java | 4 ++-- altosuilib/AltosBTManage.java | 4 ++-- altosuilib/AltosCSVUI.java | 4 ++-- altosuilib/AltosConfigFreqUI.java | 4 ++-- altosuilib/AltosDataChooser.java | 4 ++-- altosuilib/AltosDevice.java | 2 +- altosuilib/AltosDeviceDialog.java | 2 +- altosuilib/AltosDeviceUIDialog.java | 2 +- altosuilib/AltosDisplayThread.java | 4 ++-- altosuilib/AltosEepromDelete.java | 4 ++-- altosuilib/AltosEepromManage.java | 4 ++-- altosuilib/AltosEepromMonitorUI.java | 4 ++-- altosuilib/AltosEepromSelect.java | 4 ++-- altosuilib/AltosFlashUI.java | 4 ++-- altosuilib/AltosFlightInfoTableModel.java | 2 +- altosuilib/AltosFlightStatsTable.java | 4 ++-- altosuilib/AltosGraph.java | 4 ++-- altosuilib/AltosInfoTable.java | 4 ++-- altosuilib/AltosLed.java | 2 +- altosuilib/AltosLights.java | 2 +- altosuilib/AltosPositionListener.java | 2 +- altosuilib/AltosRomconfigUI.java | 4 ++-- altosuilib/AltosScanUI.java | 4 ++-- altosuilib/AltosSerial.java | 4 ++-- altosuilib/AltosSerialInUseException.java | 2 +- altosuilib/AltosUIAxis.java | 4 ++-- altosuilib/AltosUIConfigure.java | 4 ++-- altosuilib/AltosUIDataMissing.java | 2 +- altosuilib/AltosUIDataPoint.java | 2 +- altosuilib/AltosUIDataSet.java | 2 +- altosuilib/AltosUIDialog.java | 2 +- altosuilib/AltosUIEnable.java | 4 ++-- altosuilib/AltosUIFlightSeries.java | 4 ++-- altosuilib/AltosUIFlightTab.java | 4 ++-- altosuilib/AltosUIFrame.java | 2 +- altosuilib/AltosUIFreqList.java | 4 ++-- altosuilib/AltosUIGraph.java | 4 ++-- altosuilib/AltosUIGrapher.java | 4 ++-- altosuilib/AltosUIImage.java | 2 +- altosuilib/AltosUIIndicator.java | 4 ++-- altosuilib/AltosUILib.java | 4 ++-- altosuilib/AltosUIListener.java | 2 +- altosuilib/AltosUIMap.java | 4 ++-- altosuilib/AltosUIMapPreload.java | 4 ++-- altosuilib/AltosUIMarker.java | 4 ++-- altosuilib/AltosUIPreferences.java | 4 ++-- altosuilib/AltosUIPreferencesBackend.java | 4 ++-- altosuilib/AltosUIRateList.java | 4 ++-- altosuilib/AltosUITelemetryList.java | 4 ++-- altosuilib/AltosUITimeSeries.java | 4 ++-- altosuilib/AltosUIUnitsIndicator.java | 4 ++-- altosuilib/AltosUIVoltageIndicator.java | 4 ++-- altosuilib/AltosUSBDevice.java | 2 +- altosuilib/AltosVoice.java | 2 +- altosuilib/GrabNDrag.java | 2 +- altosuilib/OSXAdapter.java | 2 +- configure.ac | 4 ++-- micropeak/MicroData.java | 4 ++-- micropeak/MicroDeviceDialog.java | 2 +- micropeak/MicroDownload.java | 4 ++-- micropeak/MicroExport.java | 4 ++-- micropeak/MicroFile.java | 4 ++-- micropeak/MicroFileChooser.java | 4 ++-- micropeak/MicroFrame.java | 2 +- micropeak/MicroPeak.java | 4 ++-- micropeak/MicroRaw.java | 4 ++-- micropeak/MicroSave.java | 4 ++-- micropeak/MicroSerial.java | 2 +- micropeak/MicroSerialLog.java | 2 +- micropeak/MicroUSB.java | 4 ++-- telegps/TeleGPS.java | 4 ++-- telegps/TeleGPSConfig.java | 4 ++-- telegps/TeleGPSConfigUI.java | 4 ++-- telegps/TeleGPSDisplayThread.java | 4 ++-- telegps/TeleGPSGraphUI.java | 4 ++-- telegps/TeleGPSInfo.java | 4 ++-- telegps/TeleGPSPreferences.java | 2 +- telegps/TeleGPSState.java | 4 ++-- telegps/TeleGPSStatus.java | 4 ++-- telegps/TeleGPSStatusUpdate.java | 2 +- 284 files changed, 359 insertions(+), 359 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java index 8e65e1d0..359b5832 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java @@ -31,7 +31,7 @@ import android.bluetooth.BluetoothSocket; import android.os.Handler; //import android.os.Message; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosBluetooth extends AltosDroidLink { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java index b8c90773..5906ff98 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.io.*; import java.lang.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.graphics.*; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java index 36ba0308..f648142f 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java @@ -52,7 +52,7 @@ import android.hardware.usb.*; import android.graphics.*; import android.graphics.drawable.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class SavedState { long received_time; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java index 23105635..05cb0f6b 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java @@ -25,7 +25,7 @@ import java.util.UUID; import android.os.Handler; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public abstract class AltosDroidLink extends AltosLink { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java index 2b78104d..8730e8ad 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java @@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid; import java.util.*; import java.io.*; import android.location.Location; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public interface AltosDroidMapInterface { public void onCreateView(AltosDroid altos_droid); diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java index c7cdc961..0670005a 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java @@ -22,7 +22,7 @@ import java.util.*; import java.text.*; import android.content.Context; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosDroidPreferences extends AltosPreferences { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java index 2fceb535..01ec0af9 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java @@ -25,7 +25,7 @@ import android.content.SharedPreferences; import android.os.Environment; import android.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosDroidPreferencesBackend extends AltosPreferencesBackend { public final static String NAME = "org.altusmetrum.AltosDroid"; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java index 11d8f624..71309897 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java @@ -18,7 +18,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.location.Location; import android.app.Activity; import android.graphics.Color; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java index 3f74bbba..9909ba7f 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java @@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid; import java.util.*; import java.io.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.graphics.*; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java index 9e5d6dee..b71cdd62 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java @@ -20,7 +20,7 @@ package org.altusmetrum.AltosDroid; import java.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import com.google.android.gms.maps.*; import com.google.android.gms.maps.model.*; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java index 8d0a725a..77947b4b 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java @@ -29,7 +29,7 @@ import android.hardware.usb.*; import android.app.*; import android.os.Handler; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUsb extends AltosDroidLink { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java index e041a00a..b85f0274 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java @@ -23,7 +23,7 @@ import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener; import android.location.Location; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosVoice { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java index 7b3bbb4e..ace0a7d6 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java @@ -35,7 +35,7 @@ import android.view.View.OnClickListener; import android.widget.*; import android.widget.AdapterView.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class IdleModeActivity extends Activity { private EditText callsign; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java index 4b8dc3e8..eccf5c59 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java @@ -33,7 +33,7 @@ import android.view.View.*; import android.widget.*; import android.widget.AdapterView.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class IgniterItem { public String name; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java index 0eef129e..ff599fda 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java @@ -33,7 +33,7 @@ import android.view.inputmethod.*; import android.widget.*; import android.widget.AdapterView.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class FrequencyItem { public AltosFrequency frequency; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java index a0c7233f..b93eaa19 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java @@ -35,7 +35,7 @@ import android.view.View.OnClickListener; import android.widget.*; import android.widget.AdapterView.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class MapTypeActivity extends Activity { private Button hybrid; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java index a8e87bf2..9c43870f 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java @@ -42,7 +42,7 @@ import android.location.LocationManager; import android.location.LocationListener; import android.location.Criteria; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; /** * This Activity appears as a dialog. It lists any paired devices and diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java index 41c3eb88..d970fc4f 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java @@ -31,7 +31,7 @@ import android.view.View.*; import android.widget.*; import android.widget.AdapterView.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class SetupActivity extends Activity { private Spinner select_rate; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java index 3143679a..5349612c 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java @@ -18,7 +18,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.os.Bundle; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java index 5db5b85f..d239d988 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java @@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid; import java.util.*; import java.io.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.graphics.*; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java index 37e2df18..6fdd39dc 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java @@ -18,7 +18,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.os.Bundle; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java index 97a35c9e..ac211230 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java @@ -18,7 +18,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.os.Bundle; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java index c379d3d8..56f235c1 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java @@ -1,6 +1,6 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java index bc0b3615..d097a550 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java @@ -26,7 +26,7 @@ import java.util.*; import java.util.concurrent.*; import android.os.Handler; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class TelemetryReader extends Thread { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java index 45bb4732..f976e05c 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java @@ -41,7 +41,7 @@ import android.os.Looper; import android.widget.Toast; import android.location.Criteria; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class TelemetryService extends Service implements AltosIdleMonitorListener { diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java index 46b4027a..77cee787 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java @@ -19,7 +19,7 @@ package org.altusmetrum.AltosDroid; import java.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import android.location.Location; public class TelemetryState { diff --git a/altoslib/AltosAccel.java b/altoslib/AltosAccel.java index 31aa7c1b..8fefefc5 100644 --- a/altoslib/AltosAccel.java +++ b/altoslib/AltosAccel.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosCRCException.java b/altoslib/AltosCRCException.java index 80dca140..5c398d3c 100644 --- a/altoslib/AltosCRCException.java +++ b/altoslib/AltosCRCException.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosCRCException extends Exception { public int rssi; diff --git a/altoslib/AltosCSV.java b/altoslib/AltosCSV.java index 5117a702..aed18728 100644 --- a/altoslib/AltosCSV.java +++ b/altoslib/AltosCSV.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java index 49b90ce7..b49e3792 100644 --- a/altoslib/AltosCalData.java +++ b/altoslib/AltosCalData.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; /* * Calibration and other data needed to construct 'real' values from various data diff --git a/altoslib/AltosCompanion.java b/altoslib/AltosCompanion.java index 2c03c922..5ce333f8 100644 --- a/altoslib/AltosCompanion.java +++ b/altoslib/AltosCompanion.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java index a0e9a292..97a80bcb 100644 --- a/altoslib/AltosConfigData.java +++ b/altoslib/AltosConfigData.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.text.*; diff --git a/altoslib/AltosConfigDataException.java b/altoslib/AltosConfigDataException.java index 59a8e9c1..fe6336b6 100644 --- a/altoslib/AltosConfigDataException.java +++ b/altoslib/AltosConfigDataException.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosConfigDataException extends Exception { diff --git a/altoslib/AltosConfigValues.java b/altoslib/AltosConfigValues.java index bc20d21d..170b1112 100644 --- a/altoslib/AltosConfigValues.java +++ b/altoslib/AltosConfigValues.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosConfigValues { /* set and get all of the dialog values */ diff --git a/altoslib/AltosConvert.java b/altoslib/AltosConvert.java index 9eb8d16a..ed16541a 100644 --- a/altoslib/AltosConvert.java +++ b/altoslib/AltosConvert.java @@ -19,7 +19,7 @@ /* * Sensor data conversion functions */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; diff --git a/altoslib/AltosDataListener.java b/altoslib/AltosDataListener.java index f8d38731..7f5dfda9 100644 --- a/altoslib/AltosDataListener.java +++ b/altoslib/AltosDataListener.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public abstract class AltosDataListener { diff --git a/altoslib/AltosDataProvider.java b/altoslib/AltosDataProvider.java index e55071cf..f977aee3 100644 --- a/altoslib/AltosDataProvider.java +++ b/altoslib/AltosDataProvider.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosDataProvider { public void provide_data(AltosDataListener listener, AltosCalData cal_data) throws InterruptedException, AltosUnknownProduct; diff --git a/altoslib/AltosDebug.java b/altoslib/AltosDebug.java index aa1b298f..24a25933 100644 --- a/altoslib/AltosDebug.java +++ b/altoslib/AltosDebug.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosDistance.java b/altoslib/AltosDistance.java index 5e1b3545..38efbf1a 100644 --- a/altoslib/AltosDistance.java +++ b/altoslib/AltosDistance.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosDistance extends AltosUnits { diff --git a/altoslib/AltosEeprom.java b/altoslib/AltosEeprom.java index 2600e802..ad7bf881 100644 --- a/altoslib/AltosEeprom.java +++ b/altoslib/AltosEeprom.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.io.*; diff --git a/altoslib/AltosEepromChunk.java b/altoslib/AltosEepromChunk.java index 1deb0ded..4f12c190 100644 --- a/altoslib/AltosEepromChunk.java +++ b/altoslib/AltosEepromChunk.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.util.concurrent.*; diff --git a/altoslib/AltosEepromDownload.java b/altoslib/AltosEepromDownload.java index 961b32cd..33f0dd17 100644 --- a/altoslib/AltosEepromDownload.java +++ b/altoslib/AltosEepromDownload.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java index 463948b1..067f0302 100644 --- a/altoslib/AltosEepromFile.java +++ b/altoslib/AltosEepromFile.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosEepromList.java b/altoslib/AltosEepromList.java index fc72fd95..55d47e20 100644 --- a/altoslib/AltosEepromList.java +++ b/altoslib/AltosEepromList.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosEepromLog.java b/altoslib/AltosEepromLog.java index 63e4a1f8..8d1f3fc4 100644 --- a/altoslib/AltosEepromLog.java +++ b/altoslib/AltosEepromLog.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.util.concurrent.*; diff --git a/altoslib/AltosEepromMonitor.java b/altoslib/AltosEepromMonitor.java index 250568ac..a99ec687 100644 --- a/altoslib/AltosEepromMonitor.java +++ b/altoslib/AltosEepromMonitor.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosEepromMonitor { diff --git a/altoslib/AltosEepromRecord.java b/altoslib/AltosEepromRecord.java index c479a621..094584fe 100644 --- a/altoslib/AltosEepromRecord.java +++ b/altoslib/AltosEepromRecord.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public abstract class AltosEepromRecord implements Comparable { diff --git a/altoslib/AltosEepromRecordFireTwo.java b/altoslib/AltosEepromRecordFireTwo.java index 48d480c5..d6b74d1b 100644 --- a/altoslib/AltosEepromRecordFireTwo.java +++ b/altoslib/AltosEepromRecordFireTwo.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosEepromRecordFull.java b/altoslib/AltosEepromRecordFull.java index 10ae0bef..85709f73 100644 --- a/altoslib/AltosEepromRecordFull.java +++ b/altoslib/AltosEepromRecordFull.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosEepromRecordFull extends AltosEepromRecord { public static final int record_length = 8; diff --git a/altoslib/AltosEepromRecordGps.java b/altoslib/AltosEepromRecordGps.java index ee76d073..5cf5db39 100644 --- a/altoslib/AltosEepromRecordGps.java +++ b/altoslib/AltosEepromRecordGps.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosEepromRecordMega.java b/altoslib/AltosEepromRecordMega.java index fdbbd6f7..ad3e23fd 100644 --- a/altoslib/AltosEepromRecordMega.java +++ b/altoslib/AltosEepromRecordMega.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosEepromRecordMega extends AltosEepromRecord { public static final int record_length = 32; diff --git a/altoslib/AltosEepromRecordMetrum.java b/altoslib/AltosEepromRecordMetrum.java index 65d8f086..3da50544 100644 --- a/altoslib/AltosEepromRecordMetrum.java +++ b/altoslib/AltosEepromRecordMetrum.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosEepromRecordMetrum extends AltosEepromRecord { public static final int record_length = 16; diff --git a/altoslib/AltosEepromRecordMini.java b/altoslib/AltosEepromRecordMini.java index 787f4e0d..55696693 100644 --- a/altoslib/AltosEepromRecordMini.java +++ b/altoslib/AltosEepromRecordMini.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosEepromRecordMini extends AltosEepromRecord { public static final int record_length = 16; diff --git a/altoslib/AltosEepromRecordSet.java b/altoslib/AltosEepromRecordSet.java index df1aad9f..48e90c05 100644 --- a/altoslib/AltosEepromRecordSet.java +++ b/altoslib/AltosEepromRecordSet.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosEepromRecordTiny.java b/altoslib/AltosEepromRecordTiny.java index 628e18c3..4d44ddd7 100644 --- a/altoslib/AltosEepromRecordTiny.java +++ b/altoslib/AltosEepromRecordTiny.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosEepromRecordTiny extends AltosEepromRecord implements AltosDataProvider { public static final int record_length = 2; diff --git a/altoslib/AltosFile.java b/altoslib/AltosFile.java index 691e70b4..69f779c1 100644 --- a/altoslib/AltosFile.java +++ b/altoslib/AltosFile.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.File; import java.util.*; diff --git a/altoslib/AltosFlash.java b/altoslib/AltosFlash.java index ad573305..c8db1f77 100644 --- a/altoslib/AltosFlash.java +++ b/altoslib/AltosFlash.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosFlashListener.java b/altoslib/AltosFlashListener.java index e15d7ac3..60052133 100644 --- a/altoslib/AltosFlashListener.java +++ b/altoslib/AltosFlashListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosFlashListener { public void position(String label, int percent); diff --git a/altoslib/AltosFlightDisplay.java b/altoslib/AltosFlightDisplay.java index c395dc45..8fe33c5e 100644 --- a/altoslib/AltosFlightDisplay.java +++ b/altoslib/AltosFlightDisplay.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosFlightDisplay extends AltosUnitsListener, AltosFontListener { void reset(); diff --git a/altoslib/AltosFlightListener.java b/altoslib/AltosFlightListener.java index 395d8f3f..d61831a9 100644 --- a/altoslib/AltosFlightListener.java +++ b/altoslib/AltosFlightListener.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public abstract class AltosFlightListener { diff --git a/altoslib/AltosFlightReader.java b/altoslib/AltosFlightReader.java index f252d60b..671bf638 100644 --- a/altoslib/AltosFlightReader.java +++ b/altoslib/AltosFlightReader.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.io.*; diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java index 5223a5b4..fc7a9f14 100644 --- a/altoslib/AltosFlightSeries.java +++ b/altoslib/AltosFlightSeries.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java index ddb57d23..a2c5d468 100644 --- a/altoslib/AltosFlightStats.java +++ b/altoslib/AltosFlightStats.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosFontListener.java b/altoslib/AltosFontListener.java index c7f339a0..97947d0b 100644 --- a/altoslib/AltosFontListener.java +++ b/altoslib/AltosFontListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosFontListener { void font_size_changed(int font_size); diff --git a/altoslib/AltosForce.java b/altoslib/AltosForce.java index 229d04f3..47fb900c 100644 --- a/altoslib/AltosForce.java +++ b/altoslib/AltosForce.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosForce extends AltosUnits { diff --git a/altoslib/AltosFrequency.java b/altoslib/AltosFrequency.java index 3b2a445a..6838be8a 100644 --- a/altoslib/AltosFrequency.java +++ b/altoslib/AltosFrequency.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosGPS.java b/altoslib/AltosGPS.java index a730957b..7898fb9f 100644 --- a/altoslib/AltosGPS.java +++ b/altoslib/AltosGPS.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.util.concurrent.*; diff --git a/altoslib/AltosGPSSat.java b/altoslib/AltosGPSSat.java index e2f0f380..8d3b316a 100644 --- a/altoslib/AltosGPSSat.java +++ b/altoslib/AltosGPSSat.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.text.*; diff --git a/altoslib/AltosGPSTimeValue.java b/altoslib/AltosGPSTimeValue.java index 0a534373..e15c60e3 100644 --- a/altoslib/AltosGPSTimeValue.java +++ b/altoslib/AltosGPSTimeValue.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosGPSTimeValue { public double time; diff --git a/altoslib/AltosGreatCircle.java b/altoslib/AltosGreatCircle.java index 6e5bd362..f1cb1940 100644 --- a/altoslib/AltosGreatCircle.java +++ b/altoslib/AltosGreatCircle.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.lang.Math; import java.io.*; diff --git a/altoslib/AltosHeight.java b/altoslib/AltosHeight.java index 0cd495fb..668080f1 100644 --- a/altoslib/AltosHeight.java +++ b/altoslib/AltosHeight.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosHeight extends AltosUnits { diff --git a/altoslib/AltosHexfile.java b/altoslib/AltosHexfile.java index e746b649..7ab121ad 100644 --- a/altoslib/AltosHexfile.java +++ b/altoslib/AltosHexfile.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.LinkedList; diff --git a/altoslib/AltosHexsym.java b/altoslib/AltosHexsym.java index 2eb08f75..4f56af9a 100644 --- a/altoslib/AltosHexsym.java +++ b/altoslib/AltosHexsym.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosHexsym { String name; diff --git a/altoslib/AltosIMU.java b/altoslib/AltosIMU.java index 407ed4bb..87d3ec94 100644 --- a/altoslib/AltosIMU.java +++ b/altoslib/AltosIMU.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.*; import java.io.*; diff --git a/altoslib/AltosIdle.java b/altoslib/AltosIdle.java index d37af966..b5ee20d0 100644 --- a/altoslib/AltosIdle.java +++ b/altoslib/AltosIdle.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosIdleFetch.java b/altoslib/AltosIdleFetch.java index cfd6866a..7980ae6b 100644 --- a/altoslib/AltosIdleFetch.java +++ b/altoslib/AltosIdleFetch.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosIdleMonitor.java b/altoslib/AltosIdleMonitor.java index 3d73dce6..cc6b8545 100644 --- a/altoslib/AltosIdleMonitor.java +++ b/altoslib/AltosIdleMonitor.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.concurrent.*; diff --git a/altoslib/AltosIdleMonitorListener.java b/altoslib/AltosIdleMonitorListener.java index 3349e9c4..1ddec09a 100644 --- a/altoslib/AltosIdleMonitorListener.java +++ b/altoslib/AltosIdleMonitorListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosIdleMonitorListener { public void update(AltosState state, AltosListenerState listener_state); diff --git a/altoslib/AltosIdleReader.java b/altoslib/AltosIdleReader.java index 3307cf26..5f9ceca3 100644 --- a/altoslib/AltosIdleReader.java +++ b/altoslib/AltosIdleReader.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.io.*; diff --git a/altoslib/AltosIgnite.java b/altoslib/AltosIgnite.java index 5df64ab2..767c00fb 100644 --- a/altoslib/AltosIgnite.java +++ b/altoslib/AltosIgnite.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.io.*; diff --git a/altoslib/AltosImage.java b/altoslib/AltosImage.java index 2e32b720..abe9d56f 100644 --- a/altoslib/AltosImage.java +++ b/altoslib/AltosImage.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosJson.java b/altoslib/AltosJson.java index ce50b872..52c9b41e 100644 --- a/altoslib/AltosJson.java +++ b/altoslib/AltosJson.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java index 2ab91d3e..ccdd0818 100644 --- a/altoslib/AltosKML.java +++ b/altoslib/AltosKML.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosLatLon.java b/altoslib/AltosLatLon.java index 5865d3cc..6fcc43fe 100644 --- a/altoslib/AltosLatLon.java +++ b/altoslib/AltosLatLon.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosLatLon { public double lat; diff --git a/altoslib/AltosLatitude.java b/altoslib/AltosLatitude.java index 4663cd09..f43397d0 100644 --- a/altoslib/AltosLatitude.java +++ b/altoslib/AltosLatitude.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosLatitude extends AltosLocation { public String pos() { return "N"; } diff --git a/altoslib/AltosLaunchSite.java b/altoslib/AltosLaunchSite.java index 8a06cdb2..19fb4858 100644 --- a/altoslib/AltosLaunchSite.java +++ b/altoslib/AltosLaunchSite.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.*; diff --git a/altoslib/AltosLaunchSiteListener.java b/altoslib/AltosLaunchSiteListener.java index d2ee601e..0d926353 100644 --- a/altoslib/AltosLaunchSiteListener.java +++ b/altoslib/AltosLaunchSiteListener.java @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.*; diff --git a/altoslib/AltosLaunchSites.java b/altoslib/AltosLaunchSites.java index d5c41c82..365f19e3 100644 --- a/altoslib/AltosLaunchSites.java +++ b/altoslib/AltosLaunchSites.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.*; diff --git a/altoslib/AltosLib.java b/altoslib/AltosLib.java index 6cf875a9..d1063509 100644 --- a/altoslib/AltosLib.java +++ b/altoslib/AltosLib.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.io.*; diff --git a/altoslib/AltosLine.java b/altoslib/AltosLine.java index 952a21e3..b3833f64 100644 --- a/altoslib/AltosLine.java +++ b/altoslib/AltosLine.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosLine { public String line; diff --git a/altoslib/AltosLink.java b/altoslib/AltosLink.java index d75c9aa0..5a802ef1 100644 --- a/altoslib/AltosLink.java +++ b/altoslib/AltosLink.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.concurrent.*; diff --git a/altoslib/AltosListenerState.java b/altoslib/AltosListenerState.java index 80bc0df2..949d2271 100644 --- a/altoslib/AltosListenerState.java +++ b/altoslib/AltosListenerState.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosLocation.java b/altoslib/AltosLocation.java index c612caaa..45831004 100644 --- a/altoslib/AltosLocation.java +++ b/altoslib/AltosLocation.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public abstract class AltosLocation extends AltosUnits { diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java index d57749a1..ab0d3987 100644 --- a/altoslib/AltosLog.java +++ b/altoslib/AltosLog.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.text.*; diff --git a/altoslib/AltosLongitude.java b/altoslib/AltosLongitude.java index 4c6d1857..b2134cbb 100644 --- a/altoslib/AltosLongitude.java +++ b/altoslib/AltosLongitude.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosLongitude extends AltosLocation { public String pos() { return "E"; } diff --git a/altoslib/AltosMag.java b/altoslib/AltosMag.java index e24fa11d..3cf83138 100644 --- a/altoslib/AltosMag.java +++ b/altoslib/AltosMag.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.*; import java.io.*; diff --git a/altoslib/AltosMap.java b/altoslib/AltosMap.java index 203a23b5..286cf1bb 100644 --- a/altoslib/AltosMap.java +++ b/altoslib/AltosMap.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.*; diff --git a/altoslib/AltosMapCache.java b/altoslib/AltosMapCache.java index 4e529177..54d2dbdd 100644 --- a/altoslib/AltosMapCache.java +++ b/altoslib/AltosMapCache.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.net.*; diff --git a/altoslib/AltosMapCacheListener.java b/altoslib/AltosMapCacheListener.java index 057d1c43..8c07e3c1 100644 --- a/altoslib/AltosMapCacheListener.java +++ b/altoslib/AltosMapCacheListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosMapCacheListener { public void map_cache_changed(int map_cache); diff --git a/altoslib/AltosMapInterface.java b/altoslib/AltosMapInterface.java index a2ea81db..5089db64 100644 --- a/altoslib/AltosMapInterface.java +++ b/altoslib/AltosMapInterface.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.net.*; diff --git a/altoslib/AltosMapLine.java b/altoslib/AltosMapLine.java index cf09307e..f2174935 100644 --- a/altoslib/AltosMapLine.java +++ b/altoslib/AltosMapLine.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.Math; diff --git a/altoslib/AltosMapLoader.java b/altoslib/AltosMapLoader.java index 17e88bf4..b57591df 100644 --- a/altoslib/AltosMapLoader.java +++ b/altoslib/AltosMapLoader.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosMapLoaderListener.java b/altoslib/AltosMapLoaderListener.java index 07624f80..7f36c002 100644 --- a/altoslib/AltosMapLoaderListener.java +++ b/altoslib/AltosMapLoaderListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosMapLoaderListener { public abstract void loader_start(int max); diff --git a/altoslib/AltosMapMark.java b/altoslib/AltosMapMark.java index cbe7bebe..4ef179ef 100644 --- a/altoslib/AltosMapMark.java +++ b/altoslib/AltosMapMark.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.Math; diff --git a/altoslib/AltosMapPath.java b/altoslib/AltosMapPath.java index c2335169..1542a4e9 100644 --- a/altoslib/AltosMapPath.java +++ b/altoslib/AltosMapPath.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.Math; diff --git a/altoslib/AltosMapPathPoint.java b/altoslib/AltosMapPathPoint.java index 5182ecfd..409a6a5c 100644 --- a/altoslib/AltosMapPathPoint.java +++ b/altoslib/AltosMapPathPoint.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.Math; diff --git a/altoslib/AltosMapRectangle.java b/altoslib/AltosMapRectangle.java index a2321e19..0751aa33 100644 --- a/altoslib/AltosMapRectangle.java +++ b/altoslib/AltosMapRectangle.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosMapRectangle { AltosLatLon ul, lr; diff --git a/altoslib/AltosMapStore.java b/altoslib/AltosMapStore.java index 460c52b6..4eba3a04 100644 --- a/altoslib/AltosMapStore.java +++ b/altoslib/AltosMapStore.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.net.*; diff --git a/altoslib/AltosMapStoreListener.java b/altoslib/AltosMapStoreListener.java index e3935201..1fb7194a 100644 --- a/altoslib/AltosMapStoreListener.java +++ b/altoslib/AltosMapStoreListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosMapStoreListener { abstract void notify_store(AltosMapStore store, int status); diff --git a/altoslib/AltosMapTile.java b/altoslib/AltosMapTile.java index 4d6dc8d1..4b01e437 100644 --- a/altoslib/AltosMapTile.java +++ b/altoslib/AltosMapTile.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosMapTileListener.java b/altoslib/AltosMapTileListener.java index 219dcd07..3c6275a0 100644 --- a/altoslib/AltosMapTileListener.java +++ b/altoslib/AltosMapTileListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosMapTileListener { abstract public void notify_tile(AltosMapTile tile, int status); diff --git a/altoslib/AltosMapTransform.java b/altoslib/AltosMapTransform.java index 266557b6..b6d4f435 100644 --- a/altoslib/AltosMapTransform.java +++ b/altoslib/AltosMapTransform.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.lang.Math; diff --git a/altoslib/AltosMapTypeListener.java b/altoslib/AltosMapTypeListener.java index 1d5e2b47..94401a00 100644 --- a/altoslib/AltosMapTypeListener.java +++ b/altoslib/AltosMapTypeListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosMapTypeListener { public void map_type_changed(int map_type); diff --git a/altoslib/AltosMapZoomListener.java b/altoslib/AltosMapZoomListener.java index 93c26cbb..c4a0acd6 100644 --- a/altoslib/AltosMapZoomListener.java +++ b/altoslib/AltosMapZoomListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosMapZoomListener { abstract public void zoom_changed(int zoom); diff --git a/altoslib/AltosMma655x.java b/altoslib/AltosMma655x.java index 2aadfc2e..f69b571b 100644 --- a/altoslib/AltosMma655x.java +++ b/altoslib/AltosMma655x.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.*; diff --git a/altoslib/AltosMs5607.java b/altoslib/AltosMs5607.java index 399de834..6888bda1 100644 --- a/altoslib/AltosMs5607.java +++ b/altoslib/AltosMs5607.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.*; import java.io.*; diff --git a/altoslib/AltosNoSymbol.java b/altoslib/AltosNoSymbol.java index 37542cf0..8372d396 100644 --- a/altoslib/AltosNoSymbol.java +++ b/altoslib/AltosNoSymbol.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosNoSymbol extends Exception { public AltosNoSymbol(String name) { diff --git a/altoslib/AltosOrient.java b/altoslib/AltosOrient.java index 8b3a3541..4546a798 100644 --- a/altoslib/AltosOrient.java +++ b/altoslib/AltosOrient.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosOrient extends AltosUnits { diff --git a/altoslib/AltosParse.java b/altoslib/AltosParse.java index b4b6f875..77cf969d 100644 --- a/altoslib/AltosParse.java +++ b/altoslib/AltosParse.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.text.*; diff --git a/altoslib/AltosPointDouble.java b/altoslib/AltosPointDouble.java index 31b03b1f..301d07b0 100644 --- a/altoslib/AltosPointDouble.java +++ b/altoslib/AltosPointDouble.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosPointDouble { public double x, y; diff --git a/altoslib/AltosPointInt.java b/altoslib/AltosPointInt.java index 233a8d31..25f5dd2a 100644 --- a/altoslib/AltosPointInt.java +++ b/altoslib/AltosPointInt.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosPointInt { public int x, y; diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index f446d4dd..0c388f1b 100644 --- a/altoslib/AltosPreferences.java +++ b/altoslib/AltosPreferences.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosPreferencesBackend.java b/altoslib/AltosPreferencesBackend.java index 327b534c..00fd2c6d 100644 --- a/altoslib/AltosPreferencesBackend.java +++ b/altoslib/AltosPreferencesBackend.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosPresTemp.java b/altoslib/AltosPresTemp.java index d0787033..4cd382c8 100644 --- a/altoslib/AltosPresTemp.java +++ b/altoslib/AltosPresTemp.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosPresTemp { double pres = AltosLib.MISSING; diff --git a/altoslib/AltosPressure.java b/altoslib/AltosPressure.java index 2de26820..507a4cee 100644 --- a/altoslib/AltosPressure.java +++ b/altoslib/AltosPressure.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosPressure extends AltosUnits { diff --git a/altoslib/AltosProgrammer.java b/altoslib/AltosProgrammer.java index ba04107b..0a828a32 100644 --- a/altoslib/AltosProgrammer.java +++ b/altoslib/AltosProgrammer.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosPyro.java b/altoslib/AltosPyro.java index 80884b9f..0ea3bfc1 100644 --- a/altoslib/AltosPyro.java +++ b/altoslib/AltosPyro.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.text.*; diff --git a/altoslib/AltosPyroName.java b/altoslib/AltosPyroName.java index 18a31dd2..0152e479 100644 --- a/altoslib/AltosPyroName.java +++ b/altoslib/AltosPyroName.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosPyroName extends AltosUnits { diff --git a/altoslib/AltosQuaternion.java b/altoslib/AltosQuaternion.java index 40786e32..66b5f4f5 100644 --- a/altoslib/AltosQuaternion.java +++ b/altoslib/AltosQuaternion.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosQuaternion { double r; /* real bit */ diff --git a/altoslib/AltosRecordSet.java b/altoslib/AltosRecordSet.java index 3c6ae575..91cce624 100644 --- a/altoslib/AltosRecordSet.java +++ b/altoslib/AltosRecordSet.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; diff --git a/altoslib/AltosRectangle.java b/altoslib/AltosRectangle.java index 50b3caa6..810388ed 100644 --- a/altoslib/AltosRectangle.java +++ b/altoslib/AltosRectangle.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosRectangle { public int x, y, width, height; diff --git a/altoslib/AltosReplayReader.java b/altoslib/AltosReplayReader.java index a26d1e84..3847cab7 100644 --- a/altoslib/AltosReplayReader.java +++ b/altoslib/AltosReplayReader.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosRomconfig.java b/altoslib/AltosRomconfig.java index dcfbda32..46ee2b6e 100644 --- a/altoslib/AltosRomconfig.java +++ b/altoslib/AltosRomconfig.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosRotation.java b/altoslib/AltosRotation.java index 1235d86b..0de24515 100644 --- a/altoslib/AltosRotation.java +++ b/altoslib/AltosRotation.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosRotation extends AltosQuaternion { private AltosQuaternion rotation; diff --git a/altoslib/AltosRotationRate.java b/altoslib/AltosRotationRate.java index c3f26f46..492f1217 100644 --- a/altoslib/AltosRotationRate.java +++ b/altoslib/AltosRotationRate.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosRotationRate extends AltosUnits { diff --git a/altoslib/AltosSavedState.java b/altoslib/AltosSavedState.java index 76d12faf..66876864 100644 --- a/altoslib/AltosSavedState.java +++ b/altoslib/AltosSavedState.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosSelfFlash.java b/altoslib/AltosSelfFlash.java index ae7cd69a..53782172 100644 --- a/altoslib/AltosSelfFlash.java +++ b/altoslib/AltosSelfFlash.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; diff --git a/altoslib/AltosSensorEMini.java b/altoslib/AltosSensorEMini.java index 2d7bab83..a144ec7a 100644 --- a/altoslib/AltosSensorEMini.java +++ b/altoslib/AltosSensorEMini.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorMM.java b/altoslib/AltosSensorMM.java index d79c0805..00873afe 100644 --- a/altoslib/AltosSensorMM.java +++ b/altoslib/AltosSensorMM.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorMega.java b/altoslib/AltosSensorMega.java index 1ef40a2a..c47ee4b1 100644 --- a/altoslib/AltosSensorMega.java +++ b/altoslib/AltosSensorMega.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorMetrum.java b/altoslib/AltosSensorMetrum.java index 1b025d1c..6d64b6ba 100644 --- a/altoslib/AltosSensorMetrum.java +++ b/altoslib/AltosSensorMetrum.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorTGPS.java b/altoslib/AltosSensorTGPS.java index 7534cf46..5f39e596 100644 --- a/altoslib/AltosSensorTGPS.java +++ b/altoslib/AltosSensorTGPS.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorTM.java b/altoslib/AltosSensorTM.java index 49f3986b..76bf8a77 100644 --- a/altoslib/AltosSensorTM.java +++ b/altoslib/AltosSensorTM.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorTMini2.java b/altoslib/AltosSensorTMini2.java index c347a3a6..8d95c7f7 100644 --- a/altoslib/AltosSensorTMini2.java +++ b/altoslib/AltosSensorTMini2.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSensorTMini3.java b/altoslib/AltosSensorTMini3.java index e88566cc..bb7fcd77 100644 --- a/altoslib/AltosSensorTMini3.java +++ b/altoslib/AltosSensorTMini3.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; diff --git a/altoslib/AltosSpeed.java b/altoslib/AltosSpeed.java index 465c190c..2a8ccedc 100644 --- a/altoslib/AltosSpeed.java +++ b/altoslib/AltosSpeed.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosSpeed extends AltosUnits { diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index a75c240c..6f293652 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -20,7 +20,7 @@ * Track flight state from telemetry or eeprom data stream */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosState extends AltosDataListener { diff --git a/altoslib/AltosStateName.java b/altoslib/AltosStateName.java index a3ac9261..5ba21f27 100644 --- a/altoslib/AltosStateName.java +++ b/altoslib/AltosStateName.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosStateName extends AltosUnits { diff --git a/altoslib/AltosStringInputStream.java b/altoslib/AltosStringInputStream.java index d574db24..48fff3ea 100644 --- a/altoslib/AltosStringInputStream.java +++ b/altoslib/AltosStringInputStream.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; import java.io.*; diff --git a/altoslib/AltosTelemetry.java b/altoslib/AltosTelemetry.java index b810ac83..e93e6601 100644 --- a/altoslib/AltosTelemetry.java +++ b/altoslib/AltosTelemetry.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; diff --git a/altoslib/AltosTelemetryCompanion.java b/altoslib/AltosTelemetryCompanion.java index f3283c32..6f91d7c2 100644 --- a/altoslib/AltosTelemetryCompanion.java +++ b/altoslib/AltosTelemetryCompanion.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryCompanion extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryConfiguration.java b/altoslib/AltosTelemetryConfiguration.java index 920c3187..b5f0eb4b 100644 --- a/altoslib/AltosTelemetryConfiguration.java +++ b/altoslib/AltosTelemetryConfiguration.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryConfiguration extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryFile.java b/altoslib/AltosTelemetryFile.java index a4792f11..037a6c87 100644 --- a/altoslib/AltosTelemetryFile.java +++ b/altoslib/AltosTelemetryFile.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosTelemetryIterable.java b/altoslib/AltosTelemetryIterable.java index a752e24e..d3e4ce67 100644 --- a/altoslib/AltosTelemetryIterable.java +++ b/altoslib/AltosTelemetryIterable.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.io.*; import java.util.*; diff --git a/altoslib/AltosTelemetryLegacy.java b/altoslib/AltosTelemetryLegacy.java index 8a86417c..7f3f2ecb 100644 --- a/altoslib/AltosTelemetryLegacy.java +++ b/altoslib/AltosTelemetryLegacy.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; diff --git a/altoslib/AltosTelemetryLocation.java b/altoslib/AltosTelemetryLocation.java index cf849f33..6819fec8 100644 --- a/altoslib/AltosTelemetryLocation.java +++ b/altoslib/AltosTelemetryLocation.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryLocation extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryMap.java b/altoslib/AltosTelemetryMap.java index c8185434..a7ddc684 100644 --- a/altoslib/AltosTelemetryMap.java +++ b/altoslib/AltosTelemetryMap.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.util.HashMap; diff --git a/altoslib/AltosTelemetryMegaData.java b/altoslib/AltosTelemetryMegaData.java index b648f300..29baee8c 100644 --- a/altoslib/AltosTelemetryMegaData.java +++ b/altoslib/AltosTelemetryMegaData.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryMegaData extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryMegaSensor.java b/altoslib/AltosTelemetryMegaSensor.java index b5e9d13c..efcc3ccb 100644 --- a/altoslib/AltosTelemetryMegaSensor.java +++ b/altoslib/AltosTelemetryMegaSensor.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryMegaSensor extends AltosTelemetryStandard { int orient() { return int8(5); } diff --git a/altoslib/AltosTelemetryMetrumData.java b/altoslib/AltosTelemetryMetrumData.java index 21c60c75..8cd09b41 100644 --- a/altoslib/AltosTelemetryMetrumData.java +++ b/altoslib/AltosTelemetryMetrumData.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryMetrumData extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryMetrumSensor.java b/altoslib/AltosTelemetryMetrumSensor.java index e003c831..211f9c68 100644 --- a/altoslib/AltosTelemetryMetrumSensor.java +++ b/altoslib/AltosTelemetryMetrumSensor.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryMetrumSensor extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryMini2.java b/altoslib/AltosTelemetryMini2.java index 02d1c757..59a4d506 100644 --- a/altoslib/AltosTelemetryMini2.java +++ b/altoslib/AltosTelemetryMini2.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryMini2 extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryMini3.java b/altoslib/AltosTelemetryMini3.java index 1d627668..13c2ea4d 100644 --- a/altoslib/AltosTelemetryMini3.java +++ b/altoslib/AltosTelemetryMini3.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryMini3 extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryRaw.java b/altoslib/AltosTelemetryRaw.java index a7d3a2ca..f2d73ae8 100644 --- a/altoslib/AltosTelemetryRaw.java +++ b/altoslib/AltosTelemetryRaw.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetryRaw extends AltosTelemetryStandard { public AltosTelemetryRaw(int[] bytes) throws AltosCRCException { diff --git a/altoslib/AltosTelemetryReader.java b/altoslib/AltosTelemetryReader.java index 1020efb0..7b51853d 100644 --- a/altoslib/AltosTelemetryReader.java +++ b/altoslib/AltosTelemetryReader.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; import java.io.*; diff --git a/altoslib/AltosTelemetrySatellite.java b/altoslib/AltosTelemetrySatellite.java index b3afda00..012d0c46 100644 --- a/altoslib/AltosTelemetrySatellite.java +++ b/altoslib/AltosTelemetrySatellite.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetrySatellite extends AltosTelemetryStandard { int channels() { return uint8(5); } diff --git a/altoslib/AltosTelemetrySensor.java b/altoslib/AltosTelemetrySensor.java index da253eea..6bbe4ece 100644 --- a/altoslib/AltosTelemetrySensor.java +++ b/altoslib/AltosTelemetrySensor.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTelemetrySensor extends AltosTelemetryStandard { diff --git a/altoslib/AltosTelemetryStandard.java b/altoslib/AltosTelemetryStandard.java index 4429c49a..56381561 100644 --- a/altoslib/AltosTelemetryStandard.java +++ b/altoslib/AltosTelemetryStandard.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public abstract class AltosTelemetryStandard extends AltosTelemetry { public int int8(int off) { diff --git a/altoslib/AltosTemperature.java b/altoslib/AltosTemperature.java index d63e81d1..efc6d5e1 100644 --- a/altoslib/AltosTemperature.java +++ b/altoslib/AltosTemperature.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTemperature extends AltosUnits { diff --git a/altoslib/AltosTime.java b/altoslib/AltosTime.java index de094e83..5c6ab037 100644 --- a/altoslib/AltosTime.java +++ b/altoslib/AltosTime.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTime extends AltosUnits { public double value(double v, boolean imperial_units) { return v; } diff --git a/altoslib/AltosTimeSeries.java b/altoslib/AltosTimeSeries.java index 5cf46c9a..b5d831be 100644 --- a/altoslib/AltosTimeSeries.java +++ b/altoslib/AltosTimeSeries.java @@ -12,7 +12,7 @@ * General Public License for more details. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.*; diff --git a/altoslib/AltosTimeValue.java b/altoslib/AltosTimeValue.java index 489050f2..298ac7f0 100644 --- a/altoslib/AltosTimeValue.java +++ b/altoslib/AltosTimeValue.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosTimeValue { public double time; diff --git a/altoslib/AltosUnits.java b/altoslib/AltosUnits.java index 7744cdb4..e1194487 100644 --- a/altoslib/AltosUnits.java +++ b/altoslib/AltosUnits.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; diff --git a/altoslib/AltosUnitsListener.java b/altoslib/AltosUnitsListener.java index e094810c..1f06afbf 100644 --- a/altoslib/AltosUnitsListener.java +++ b/altoslib/AltosUnitsListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosUnitsListener { public void units_changed(boolean imperial_units); diff --git a/altoslib/AltosUnitsRange.java b/altoslib/AltosUnitsRange.java index 9f56001d..6bf0d91f 100644 --- a/altoslib/AltosUnitsRange.java +++ b/altoslib/AltosUnitsRange.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.text.*; diff --git a/altoslib/AltosUnknownProduct.java b/altoslib/AltosUnknownProduct.java index 114abc76..e4bebcd4 100644 --- a/altoslib/AltosUnknownProduct.java +++ b/altoslib/AltosUnknownProduct.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosUnknownProduct extends Exception { public String product; diff --git a/altoslib/AltosVersion.java.in b/altoslib/AltosVersion.java.in index a48c532b..c8399f2e 100644 --- a/altoslib/AltosVersion.java.in +++ b/altoslib/AltosVersion.java.in @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosVersion { public final static String version = "@VERSION@"; diff --git a/altoslib/AltosVoltage.java b/altoslib/AltosVoltage.java index 8031c805..ef53ac11 100644 --- a/altoslib/AltosVoltage.java +++ b/altoslib/AltosVoltage.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public class AltosVoltage extends AltosUnits { diff --git a/altoslib/AltosWriter.java b/altoslib/AltosWriter.java index 717f1a8f..c77e48b0 100644 --- a/altoslib/AltosWriter.java +++ b/altoslib/AltosWriter.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; public interface AltosWriter { diff --git a/altosui/Altos.java b/altosui/Altos.java index c2cf4090..9f176c4b 100644 --- a/altosui/Altos.java +++ b/altosui/Altos.java @@ -21,8 +21,8 @@ package altosui; import java.awt.*; import libaltosJNI.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class Altos extends AltosUILib { diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index a4f475cb..ab052e5f 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -22,8 +22,8 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosAscent extends AltosUIFlightTab { JLabel cur, max; diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index 52815d6f..95e1d2d9 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -20,8 +20,8 @@ package altosui; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosCompanionInfo extends JTable implements AltosFlightDisplay { private AltosFlightInfoTableModel model; diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 07802247..bf2b8166 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -23,8 +23,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.text.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosConfig implements ActionListener { diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java index 2d4b216c..5016ea63 100644 --- a/altosui/AltosConfigPyroUI.java +++ b/altosui/AltosConfigPyroUI.java @@ -23,8 +23,8 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosConfigPyroUI extends AltosUIDialog diff --git a/altosui/AltosConfigTD.java b/altosui/AltosConfigTD.java index 621db3c0..9fedc56d 100644 --- a/altosui/AltosConfigTD.java +++ b/altosui/AltosConfigTD.java @@ -22,8 +22,8 @@ import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosConfigTD implements ActionListener { diff --git a/altosui/AltosConfigTDUI.java b/altosui/AltosConfigTDUI.java index 529c2fa2..3ff56218 100644 --- a/altosui/AltosConfigTDUI.java +++ b/altosui/AltosConfigTDUI.java @@ -22,8 +22,8 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosConfigTDUI extends AltosUIDialog diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index c639dd63..270131b8 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -23,8 +23,8 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.text.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosConfigUI extends AltosUIDialog diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index 6aefb3a6..acafc659 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -23,7 +23,7 @@ import java.awt.event.*; import java.beans.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public class AltosConfigureUI extends AltosUIConfigure diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 0c3a8e9e..2cc65b08 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -22,8 +22,8 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosDescent extends AltosUIFlightTab { diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index 2ff76870..b46cbc84 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -20,8 +20,8 @@ package altosui; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosFlightStatus extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/altosui/AltosFlightStatusTableModel.java b/altosui/AltosFlightStatusTableModel.java index 7b872df9..9c4e1bee 100644 --- a/altosui/AltosFlightStatusTableModel.java +++ b/altosui/AltosFlightStatusTableModel.java @@ -28,7 +28,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosFlightStatusTableModel extends AbstractTableModel { private String[] columnNames = { diff --git a/altosui/AltosFlightStatusUpdate.java b/altosui/AltosFlightStatusUpdate.java index 82ef43c2..b8b0d38a 100644 --- a/altosui/AltosFlightStatusUpdate.java +++ b/altosui/AltosFlightStatusUpdate.java @@ -19,7 +19,7 @@ package altosui; import java.awt.event.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosFlightStatusUpdate implements ActionListener { diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index b4445992..44e995be 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -23,8 +23,8 @@ import java.awt.event.*; import javax.swing.*; import java.util.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { AltosVoice voice; diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index f8408112..f6c906c6 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -24,8 +24,8 @@ import java.util.ArrayList; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index afa9b944..a2696f15 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -25,8 +25,8 @@ import javax.swing.event.*; import java.io.*; import java.util.concurrent.*; import java.util.Arrays; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener { AltosDevice device; diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index fe6194ef..debbf763 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -25,8 +25,8 @@ import java.io.*; import java.text.*; import java.util.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosIgniteUI extends AltosUIDialog diff --git a/altosui/AltosIgnitor.java b/altosui/AltosIgnitor.java index 09dcdf93..7c7d1fba 100644 --- a/altosui/AltosIgnitor.java +++ b/altosui/AltosIgnitor.java @@ -21,8 +21,8 @@ package altosui; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosIgnitor extends AltosUIFlightTab { diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index de0d7425..c2e14923 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -22,8 +22,8 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosLanded extends AltosUIFlightTab implements ActionListener { diff --git a/altosui/AltosLaunch.java b/altosui/AltosLaunch.java index d4e73b3e..f1893cf5 100644 --- a/altosui/AltosLaunch.java +++ b/altosui/AltosLaunch.java @@ -21,7 +21,7 @@ package altosui; import java.io.*; import java.util.concurrent.*; import java.awt.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public class AltosLaunch { AltosDevice device; diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java index 835858e2..8a24ed3e 100644 --- a/altosui/AltosLaunchUI.java +++ b/altosui/AltosLaunchUI.java @@ -24,7 +24,7 @@ import javax.swing.*; import java.io.*; import java.text.*; import java.util.concurrent.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; class FireButton extends JButton { protected void processMouseEvent(MouseEvent e) { diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index a29cdd6f..331b58e3 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -19,8 +19,8 @@ package altosui; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosPad extends AltosUIFlightTab { diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index ac121512..3ec25cfa 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -23,8 +23,8 @@ import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosUI extends AltosUIFrame { public AltosVoice voice = new AltosVoice(); diff --git a/altosuilib/AltosBTDevice.java b/altosuilib/AltosBTDevice.java index 313cf0a0..5b9ab06a 100644 --- a/altosuilib/AltosBTDevice.java +++ b/altosuilib/AltosBTDevice.java @@ -16,10 +16,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import libaltosJNI.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosBTDevice extends altos_bt_device implements AltosDevice { diff --git a/altosuilib/AltosBTDeviceIterator.java b/altosuilib/AltosBTDeviceIterator.java index 1ea31950..ac9068d0 100644 --- a/altosuilib/AltosBTDeviceIterator.java +++ b/altosuilib/AltosBTDeviceIterator.java @@ -16,11 +16,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.util.*; import libaltosJNI.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosBTDeviceIterator implements Iterator { AltosBTDevice current; diff --git a/altosuilib/AltosBTKnown.java b/altosuilib/AltosBTKnown.java index 32cc05d7..56f1991f 100644 --- a/altosuilib/AltosBTKnown.java +++ b/altosuilib/AltosBTKnown.java @@ -16,10 +16,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosBTKnown implements Iterable { LinkedList devices = new LinkedList(); diff --git a/altosuilib/AltosBTManage.java b/altosuilib/AltosBTManage.java index 14e0a056..aec4c34d 100644 --- a/altosuilib/AltosBTManage.java +++ b/altosuilib/AltosBTManage.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; @@ -24,7 +24,7 @@ import javax.swing.*; import javax.swing.plaf.basic.*; import java.util.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosBTManage extends AltosUIDialog implements ActionListener, Iterable { LinkedBlockingQueue found_devices; diff --git a/altosuilib/AltosCSVUI.java b/altosuilib/AltosCSVUI.java index 49d6ea68..821b842b 100644 --- a/altosuilib/AltosCSVUI.java +++ b/altosuilib/AltosCSVUI.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosCSVUI extends AltosUIDialog diff --git a/altosuilib/AltosConfigFreqUI.java b/altosuilib/AltosConfigFreqUI.java index c4d2abba..055d34f9 100644 --- a/altosuilib/AltosConfigFreqUI.java +++ b/altosuilib/AltosConfigFreqUI.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.text.*; import java.awt.event.*; import javax.swing.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class AltosEditFreqUI extends AltosUIDialog implements ActionListener { Frame frame; diff --git a/altosuilib/AltosDataChooser.java b/altosuilib/AltosDataChooser.java index c26d3673..b417c732 100644 --- a/altosuilib/AltosDataChooser.java +++ b/altosuilib/AltosDataChooser.java @@ -16,12 +16,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosDataChooser extends JFileChooser { JFrame frame; diff --git a/altosuilib/AltosDevice.java b/altosuilib/AltosDevice.java index f9878fe9..44f71f7a 100644 --- a/altosuilib/AltosDevice.java +++ b/altosuilib/AltosDevice.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import libaltosJNI.*; diff --git a/altosuilib/AltosDeviceDialog.java b/altosuilib/AltosDeviceDialog.java index 5d8ff570..77249bfc 100644 --- a/altosuilib/AltosDeviceDialog.java +++ b/altosuilib/AltosDeviceDialog.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; import java.awt.*; diff --git a/altosuilib/AltosDeviceUIDialog.java b/altosuilib/AltosDeviceUIDialog.java index c2d6f4f3..f3409cce 100644 --- a/altosuilib/AltosDeviceUIDialog.java +++ b/altosuilib/AltosDeviceUIDialog.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; import java.awt.*; diff --git a/altosuilib/AltosDisplayThread.java b/altosuilib/AltosDisplayThread.java index a5a1f1b3..3fcc02da 100644 --- a/altosuilib/AltosDisplayThread.java +++ b/altosuilib/AltosDisplayThread.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import javax.swing.*; import java.io.*; import java.text.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosDisplayThread extends Thread { diff --git a/altosuilib/AltosEepromDelete.java b/altosuilib/AltosEepromDelete.java index 24337be4..87e80a51 100644 --- a/altosuilib/AltosEepromDelete.java +++ b/altosuilib/AltosEepromDelete.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosEepromDelete implements Runnable { AltosEepromList flights; diff --git a/altosuilib/AltosEepromManage.java b/altosuilib/AltosEepromManage.java index a6636c4f..93827139 100644 --- a/altosuilib/AltosEepromManage.java +++ b/altosuilib/AltosEepromManage.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosEepromManage implements ActionListener { diff --git a/altosuilib/AltosEepromMonitorUI.java b/altosuilib/AltosEepromMonitorUI.java index 03661662..3427fe0f 100644 --- a/altosuilib/AltosEepromMonitorUI.java +++ b/altosuilib/AltosEepromMonitorUI.java @@ -16,12 +16,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosEepromMonitorUI extends AltosUIDialog implements AltosEepromMonitor { JFrame owner; diff --git a/altosuilib/AltosEepromSelect.java b/altosuilib/AltosEepromSelect.java index 2c6ee6d7..0c890c8b 100644 --- a/altosuilib/AltosEepromSelect.java +++ b/altosuilib/AltosEepromSelect.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class AltosEepromItem implements ActionListener { AltosEepromLog log; diff --git a/altosuilib/AltosFlashUI.java b/altosuilib/AltosFlashUI.java index da36397a..ca089ca8 100644 --- a/altosuilib/AltosFlashUI.java +++ b/altosuilib/AltosFlashUI.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; @@ -24,7 +24,7 @@ import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosFlashUI extends AltosUIDialog diff --git a/altosuilib/AltosFlightInfoTableModel.java b/altosuilib/AltosFlightInfoTableModel.java index 2d371101..943c9207 100644 --- a/altosuilib/AltosFlightInfoTableModel.java +++ b/altosuilib/AltosFlightInfoTableModel.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.table.*; diff --git a/altosuilib/AltosFlightStatsTable.java b/altosuilib/AltosFlightStatsTable.java index d88383b8..7e3be1ea 100644 --- a/altosuilib/AltosFlightStatsTable.java +++ b/altosuilib/AltosFlightStatsTable.java @@ -16,12 +16,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import javax.swing.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosFlightStatsTable extends JComponent implements AltosFontListener { GridBagLayout layout; diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index 6f38c417..8125e5e0 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosInfoTable.java b/altosuilib/AltosInfoTable.java index c1ac774e..41614cfa 100644 --- a/altosuilib/AltosInfoTable.java +++ b/altosuilib/AltosInfoTable.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.table.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosInfoTable extends JTable implements AltosFlightDisplay, HierarchyListener { private AltosFlightInfoTableModel model; diff --git a/altosuilib/AltosLed.java b/altosuilib/AltosLed.java index c06e45e5..b53e7604 100644 --- a/altosuilib/AltosLed.java +++ b/altosuilib/AltosLed.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; diff --git a/altosuilib/AltosLights.java b/altosuilib/AltosLights.java index 394cfc67..7b02d770 100644 --- a/altosuilib/AltosLights.java +++ b/altosuilib/AltosLights.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import javax.swing.*; diff --git a/altosuilib/AltosPositionListener.java b/altosuilib/AltosPositionListener.java index 8c4d2516..f44735e2 100644 --- a/altosuilib/AltosPositionListener.java +++ b/altosuilib/AltosPositionListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; public interface AltosPositionListener { public void position_changed(int position); diff --git a/altosuilib/AltosRomconfigUI.java b/altosuilib/AltosRomconfigUI.java index c1b8ac26..74323218 100644 --- a/altosuilib/AltosRomconfigUI.java +++ b/altosuilib/AltosRomconfigUI.java @@ -16,12 +16,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosRomconfigUI extends AltosUIDialog diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index 2dc093dc..1280ba6a 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; @@ -26,7 +26,7 @@ import java.io.*; import java.util.*; import java.text.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class AltosScanResult { String callsign; diff --git a/altosuilib/AltosSerial.java b/altosuilib/AltosSerial.java index 5c32a7d8..d7c6129c 100644 --- a/altosuilib/AltosSerial.java +++ b/altosuilib/AltosSerial.java @@ -20,13 +20,13 @@ * Deal with TeleDongle on a serial port */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.*; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import libaltosJNI.*; /* diff --git a/altosuilib/AltosSerialInUseException.java b/altosuilib/AltosSerialInUseException.java index e0de8ad7..c8ca4d56 100644 --- a/altosuilib/AltosSerialInUseException.java +++ b/altosuilib/AltosSerialInUseException.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; public class AltosSerialInUseException extends Exception { public AltosDevice device; diff --git a/altosuilib/AltosUIAxis.java b/altosuilib/AltosUIAxis.java index e8c31518..fe94f161 100644 --- a/altosuilib/AltosUIAxis.java +++ b/altosuilib/AltosUIAxis.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIConfigure.java b/altosuilib/AltosUIConfigure.java index 19512f49..e3d86724 100644 --- a/altosuilib/AltosUIConfigure.java +++ b/altosuilib/AltosUIConfigure.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; import java.beans.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class DelegatingRenderer implements ListCellRenderer { diff --git a/altosuilib/AltosUIDataMissing.java b/altosuilib/AltosUIDataMissing.java index a59cc0a0..05227e1d 100644 --- a/altosuilib/AltosUIDataMissing.java +++ b/altosuilib/AltosUIDataMissing.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; public class AltosUIDataMissing extends Exception { public int id; diff --git a/altosuilib/AltosUIDataPoint.java b/altosuilib/AltosUIDataPoint.java index 4107feae..36fadeaf 100644 --- a/altosuilib/AltosUIDataPoint.java +++ b/altosuilib/AltosUIDataPoint.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; public interface AltosUIDataPoint { public abstract double x() throws AltosUIDataMissing; diff --git a/altosuilib/AltosUIDataSet.java b/altosuilib/AltosUIDataSet.java index ffab46c1..ddda3d3d 100644 --- a/altosuilib/AltosUIDataSet.java +++ b/altosuilib/AltosUIDataSet.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; public interface AltosUIDataSet { public abstract String name(); diff --git a/altosuilib/AltosUIDialog.java b/altosuilib/AltosUIDialog.java index 85b40229..5eafa457 100644 --- a/altosuilib/AltosUIDialog.java +++ b/altosuilib/AltosUIDialog.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; diff --git a/altosuilib/AltosUIEnable.java b/altosuilib/AltosUIEnable.java index 4c733b96..0c23fa8d 100644 --- a/altosuilib/AltosUIEnable.java +++ b/altosuilib/AltosUIEnable.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; @@ -24,7 +24,7 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIFlightSeries.java b/altosuilib/AltosUIFlightSeries.java index eade12af..19bed609 100644 --- a/altosuilib/AltosUIFlightSeries.java +++ b/altosuilib/AltosUIFlightSeries.java @@ -12,12 +12,12 @@ * General Public License for more details. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.util.*; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIFlightTab.java b/altosuilib/AltosUIFlightTab.java index 3adbdb33..cf6a0c74 100644 --- a/altosuilib/AltosUIFlightTab.java +++ b/altosuilib/AltosUIFlightTab.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public abstract class AltosUIFlightTab extends JComponent implements AltosFlightDisplay, HierarchyListener { public GridBagLayout layout; diff --git a/altosuilib/AltosUIFrame.java b/altosuilib/AltosUIFrame.java index e5007fff..b7eee664 100644 --- a/altosuilib/AltosUIFrame.java +++ b/altosuilib/AltosUIFrame.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; diff --git a/altosuilib/AltosUIFreqList.java b/altosuilib/AltosUIFreqList.java index 4dd9fece..7a5c3543 100644 --- a/altosuilib/AltosUIFreqList.java +++ b/altosuilib/AltosUIFreqList.java @@ -16,10 +16,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUIFreqList extends JComboBox { diff --git a/altosuilib/AltosUIGraph.java b/altosuilib/AltosUIGraph.java index 775201ed..0caabcfa 100644 --- a/altosuilib/AltosUIGraph.java +++ b/altosuilib/AltosUIGraph.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.*; @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIGrapher.java b/altosuilib/AltosUIGrapher.java index 9bb91340..916d0b3f 100644 --- a/altosuilib/AltosUIGrapher.java +++ b/altosuilib/AltosUIGrapher.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIImage.java b/altosuilib/AltosUIImage.java index b157a2ce..f23b50bc 100644 --- a/altosuilib/AltosUIImage.java +++ b/altosuilib/AltosUIImage.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import javax.swing.*; import javax.imageio.ImageIO; diff --git a/altosuilib/AltosUIIndicator.java b/altosuilib/AltosUIIndicator.java index f47a2f29..ac2e6f06 100644 --- a/altosuilib/AltosUIIndicator.java +++ b/altosuilib/AltosUIIndicator.java @@ -16,11 +16,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public abstract class AltosUIIndicator implements AltosFontListener, AltosUnitsListener { JLabel label; diff --git a/altosuilib/AltosUILib.java b/altosuilib/AltosUILib.java index 0c5fa1c7..ef706e36 100644 --- a/altosuilib/AltosUILib.java +++ b/altosuilib/AltosUILib.java @@ -16,12 +16,12 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import libaltosJNI.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUILib extends AltosLib { diff --git a/altosuilib/AltosUIListener.java b/altosuilib/AltosUIListener.java index 55ce584a..54a00661 100644 --- a/altosuilib/AltosUIListener.java +++ b/altosuilib/AltosUIListener.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; public interface AltosUIListener { public void ui_changed(String look_and_feel); diff --git a/altosuilib/AltosUIMap.java b/altosuilib/AltosUIMap.java index 05c99a12..2e1e8f16 100644 --- a/altosuilib/AltosUIMap.java +++ b/altosuilib/AltosUIMap.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; @@ -28,7 +28,7 @@ import java.awt.geom.*; import java.util.*; import java.util.concurrent.*; import javax.imageio.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosMapInterface { diff --git a/altosuilib/AltosUIMapPreload.java b/altosuilib/AltosUIMapPreload.java index 06c4c59b..81cda0d2 100644 --- a/altosuilib/AltosUIMapPreload.java +++ b/altosuilib/AltosUIMapPreload.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; @@ -27,7 +27,7 @@ import java.text.*; import java.lang.Math; import java.net.URL; import java.net.URLConnection; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; class AltosUIMapPos extends Box implements ActionListener { AltosUIMapPreload preload; diff --git a/altosuilib/AltosUIMarker.java b/altosuilib/AltosUIMarker.java index d50dfe9a..90cdb291 100644 --- a/altosuilib/AltosUIMarker.java +++ b/altosuilib/AltosUIMarker.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIPreferences.java b/altosuilib/AltosUIPreferences.java index c8ae9a7d..a2014065 100644 --- a/altosuilib/AltosUIPreferences.java +++ b/altosuilib/AltosUIPreferences.java @@ -16,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.*; import java.awt.Component; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUIPreferences extends AltosPreferences { diff --git a/altosuilib/AltosUIPreferencesBackend.java b/altosuilib/AltosUIPreferencesBackend.java index 6dd2baaf..163ba173 100644 --- a/altosuilib/AltosUIPreferencesBackend.java +++ b/altosuilib/AltosUIPreferencesBackend.java @@ -16,11 +16,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.File; import java.util.prefs.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import javax.swing.filechooser.FileSystemView; public class AltosUIPreferencesBackend extends AltosPreferencesBackend { diff --git a/altosuilib/AltosUIRateList.java b/altosuilib/AltosUIRateList.java index 7bdd3f77..d1c15ce0 100644 --- a/altosuilib/AltosUIRateList.java +++ b/altosuilib/AltosUIRateList.java @@ -16,10 +16,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUIRateList extends JComboBox { diff --git a/altosuilib/AltosUITelemetryList.java b/altosuilib/AltosUITelemetryList.java index f02d2f7f..f884cd41 100644 --- a/altosuilib/AltosUITelemetryList.java +++ b/altosuilib/AltosUITelemetryList.java @@ -16,11 +16,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.util.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class AltosUITelemetryList extends JComboBox { diff --git a/altosuilib/AltosUITimeSeries.java b/altosuilib/AltosUITimeSeries.java index 26c5efca..08f95ca7 100644 --- a/altosuilib/AltosUITimeSeries.java +++ b/altosuilib/AltosUITimeSeries.java @@ -16,14 +16,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/altosuilib/AltosUIUnitsIndicator.java b/altosuilib/AltosUIUnitsIndicator.java index d4dd18db..bbfebef6 100644 --- a/altosuilib/AltosUIUnitsIndicator.java +++ b/altosuilib/AltosUIUnitsIndicator.java @@ -16,11 +16,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public abstract class AltosUIUnitsIndicator extends AltosUIIndicator { diff --git a/altosuilib/AltosUIVoltageIndicator.java b/altosuilib/AltosUIVoltageIndicator.java index 299c6114..297a6531 100644 --- a/altosuilib/AltosUIVoltageIndicator.java +++ b/altosuilib/AltosUIVoltageIndicator.java @@ -16,11 +16,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public abstract class AltosUIVoltageIndicator extends AltosUIUnitsIndicator { diff --git a/altosuilib/AltosUSBDevice.java b/altosuilib/AltosUSBDevice.java index 221ac829..49f966f3 100644 --- a/altosuilib/AltosUSBDevice.java +++ b/altosuilib/AltosUSBDevice.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.util.*; import libaltosJNI.*; diff --git a/altosuilib/AltosVoice.java b/altosuilib/AltosVoice.java index c651aa35..1d579a16 100644 --- a/altosuilib/AltosVoice.java +++ b/altosuilib/AltosVoice.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; diff --git a/altosuilib/GrabNDrag.java b/altosuilib/GrabNDrag.java index 0e57fe4d..665ef89e 100644 --- a/altosuilib/GrabNDrag.java +++ b/altosuilib/GrabNDrag.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.awt.*; import java.awt.event.*; diff --git a/altosuilib/OSXAdapter.java b/altosuilib/OSXAdapter.java index de5d5836..c338396f 100755 --- a/altosuilib/OSXAdapter.java +++ b/altosuilib/OSXAdapter.java @@ -55,7 +55,7 @@ Copyright © 2003-2007 Apple, Inc., All Rights Reserved */ -package org.altusmetrum.altosuilib_11; +package org.altusmetrum.altosuilib_12; import java.lang.reflect.*; import java.util.HashMap; diff --git a/configure.ac b/configure.ac index 3e6658e9..020ee031 100644 --- a/configure.ac +++ b/configure.ac @@ -34,8 +34,8 @@ AC_SUBST(ANDROID_VERSION) dnl ========================================================================== dnl Java library versions -ALTOSUILIB_VERSION=11 -ALTOSLIB_VERSION=11 +ALTOSUILIB_VERSION=12 +ALTOSLIB_VERSION=12 AC_SUBST(ALTOSLIB_VERSION) AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package]) diff --git a/micropeak/MicroData.java b/micropeak/MicroData.java index 09555b8b..70492a07 100644 --- a/micropeak/MicroData.java +++ b/micropeak/MicroData.java @@ -21,8 +21,8 @@ package org.altusmetrum.micropeak; import java.lang.*; import java.io.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroData { public int ground_pressure; diff --git a/micropeak/MicroDeviceDialog.java b/micropeak/MicroDeviceDialog.java index 010612a0..db2662a0 100644 --- a/micropeak/MicroDeviceDialog.java +++ b/micropeak/MicroDeviceDialog.java @@ -22,7 +22,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public class MicroDeviceDialog extends AltosDeviceDialog { diff --git a/micropeak/MicroDownload.java b/micropeak/MicroDownload.java index 2326ea08..e5f54821 100644 --- a/micropeak/MicroDownload.java +++ b/micropeak/MicroDownload.java @@ -24,8 +24,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroDownload extends AltosUIDialog implements Runnable, ActionListener, MicroSerialLog, WindowListener { MicroPeak owner; diff --git a/micropeak/MicroExport.java b/micropeak/MicroExport.java index f1062681..36700e75 100644 --- a/micropeak/MicroExport.java +++ b/micropeak/MicroExport.java @@ -24,8 +24,8 @@ import java.util.ArrayList; import java.awt.*; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroExport extends JFileChooser { diff --git a/micropeak/MicroFile.java b/micropeak/MicroFile.java index b341f350..20f6db55 100644 --- a/micropeak/MicroFile.java +++ b/micropeak/MicroFile.java @@ -20,8 +20,8 @@ package org.altusmetrum.micropeak; import java.io.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroFile { diff --git a/micropeak/MicroFileChooser.java b/micropeak/MicroFileChooser.java index c068244b..85f7aed4 100644 --- a/micropeak/MicroFileChooser.java +++ b/micropeak/MicroFileChooser.java @@ -21,8 +21,8 @@ package org.altusmetrum.micropeak; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroFileChooser extends JFileChooser { JFrame frame; diff --git a/micropeak/MicroFrame.java b/micropeak/MicroFrame.java index b6f1f76d..d9ad8404 100644 --- a/micropeak/MicroFrame.java +++ b/micropeak/MicroFrame.java @@ -22,7 +22,7 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public class MicroFrame extends AltosUIFrame { static String[] micro_icon_names = { diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java index 2543f398..607bf20c 100644 --- a/micropeak/MicroPeak.java +++ b/micropeak/MicroPeak.java @@ -24,8 +24,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroPeak extends MicroFrame implements ActionListener, ItemListener { diff --git a/micropeak/MicroRaw.java b/micropeak/MicroRaw.java index 5ff4f6b5..d1d5d076 100644 --- a/micropeak/MicroRaw.java +++ b/micropeak/MicroRaw.java @@ -21,8 +21,8 @@ package org.altusmetrum.micropeak; import java.awt.*; import java.io.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroRaw extends JTextArea { diff --git a/micropeak/MicroSave.java b/micropeak/MicroSave.java index 5dda5b8c..9da76914 100644 --- a/micropeak/MicroSave.java +++ b/micropeak/MicroSave.java @@ -25,8 +25,8 @@ import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroSave extends JFileChooser { diff --git a/micropeak/MicroSerial.java b/micropeak/MicroSerial.java index 43dfd18b..c1b2a7ad 100644 --- a/micropeak/MicroSerial.java +++ b/micropeak/MicroSerial.java @@ -21,7 +21,7 @@ package org.altusmetrum.micropeak; import java.util.*; import java.io.*; import libaltosJNI.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public class MicroSerial extends InputStream { SWIGTYPE_p_altos_file file; diff --git a/micropeak/MicroSerialLog.java b/micropeak/MicroSerialLog.java index 2e6dd236..d33a36b3 100644 --- a/micropeak/MicroSerialLog.java +++ b/micropeak/MicroSerialLog.java @@ -21,7 +21,7 @@ package org.altusmetrum.micropeak; import java.util.*; import java.io.*; import libaltosJNI.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public interface MicroSerialLog { diff --git a/micropeak/MicroUSB.java b/micropeak/MicroUSB.java index 4ab5fcc9..a2db3835 100644 --- a/micropeak/MicroUSB.java +++ b/micropeak/MicroUSB.java @@ -20,8 +20,8 @@ package org.altusmetrum.micropeak; import java.util.*; import libaltosJNI.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class MicroUSB extends altos_device implements AltosDevice { diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index e032726a..c6cd2bd1 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -25,8 +25,8 @@ import java.io.*; import java.util.concurrent.*; import java.util.*; import java.text.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPS extends AltosUIFrame diff --git a/telegps/TeleGPSConfig.java b/telegps/TeleGPSConfig.java index d24e7471..7fc15ba9 100644 --- a/telegps/TeleGPSConfig.java +++ b/telegps/TeleGPSConfig.java @@ -23,8 +23,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.text.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSConfig implements ActionListener { diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java index a68c82cb..88ced192 100644 --- a/telegps/TeleGPSConfigUI.java +++ b/telegps/TeleGPSConfigUI.java @@ -23,8 +23,8 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSConfigUI extends AltosUIDialog diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java index c311dd7e..fdf0e201 100644 --- a/telegps/TeleGPSDisplayThread.java +++ b/telegps/TeleGPSDisplayThread.java @@ -22,8 +22,8 @@ import java.awt.*; import javax.swing.*; import java.io.*; import java.text.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSDisplayThread extends Thread { diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java index 89c6cea5..9d8c6bf5 100644 --- a/telegps/TeleGPSGraphUI.java +++ b/telegps/TeleGPSGraphUI.java @@ -27,8 +27,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; diff --git a/telegps/TeleGPSInfo.java b/telegps/TeleGPSInfo.java index f4fa7216..383a0a44 100644 --- a/telegps/TeleGPSInfo.java +++ b/telegps/TeleGPSInfo.java @@ -22,8 +22,8 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSInfo extends AltosUIFlightTab { diff --git a/telegps/TeleGPSPreferences.java b/telegps/TeleGPSPreferences.java index 61952326..58b3ae35 100644 --- a/telegps/TeleGPSPreferences.java +++ b/telegps/TeleGPSPreferences.java @@ -23,7 +23,7 @@ import java.awt.event.*; import java.beans.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSPreferences extends AltosUIConfigure diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java index 2e39037c..19fd3694 100644 --- a/telegps/TeleGPSState.java +++ b/telegps/TeleGPSState.java @@ -22,8 +22,8 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSState extends AltosUIFlightTab { diff --git a/telegps/TeleGPSStatus.java b/telegps/TeleGPSStatus.java index a6ddd1b0..15292fe5 100644 --- a/telegps/TeleGPSStatus.java +++ b/telegps/TeleGPSStatus.java @@ -20,8 +20,8 @@ package org.altusmetrum.telegps; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_11.*; -import org.altusmetrum.altosuilib_11.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/telegps/TeleGPSStatusUpdate.java b/telegps/TeleGPSStatusUpdate.java index ac37af31..1b66d142 100644 --- a/telegps/TeleGPSStatusUpdate.java +++ b/telegps/TeleGPSStatusUpdate.java @@ -19,7 +19,7 @@ package org.altusmetrum.telegps; import java.awt.event.*; -import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altoslib_12.*; public class TeleGPSStatusUpdate implements ActionListener { -- cgit v1.2.3 From 0da4e201041a4420f273c2e0cda77eea78099518 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 20 Jun 2017 11:18:41 -0700 Subject: altoslib: Make cal_data private in AltosDataListener This way we can create it as needed. Signed-off-by: Keith Packard --- altoslib/AltosCSV.java | 8 ++++---- altoslib/AltosDataListener.java | 23 +++++++++++++++++++++- altoslib/AltosDataProvider.java | 2 +- altoslib/AltosEepromRecordTiny.java | 9 ++++----- altoslib/AltosFlightSeries.java | 22 ++++++++++----------- altoslib/AltosFlightStats.java | 4 ++-- altoslib/AltosGPS.java | 2 +- altoslib/AltosIMU.java | 3 ++- altoslib/AltosIdleFetch.java | 32 +++++++++++++++---------------- altoslib/AltosIdleMonitor.java | 3 +-- altoslib/AltosIdleReader.java | 2 +- altoslib/AltosKML.java | 4 ++-- altoslib/AltosLog.java | 2 +- altoslib/AltosMag.java | 3 ++- altoslib/AltosMma655x.java | 3 ++- altoslib/AltosMs5607.java | 3 ++- altoslib/AltosReplayReader.java | 2 +- altoslib/AltosSensorEMini.java | 3 ++- altoslib/AltosSensorMega.java | 2 +- altoslib/AltosSensorMetrum.java | 2 +- altoslib/AltosSensorTGPS.java | 2 +- altoslib/AltosSensorTM.java | 3 ++- altoslib/AltosSensorTMini2.java | 2 +- altoslib/AltosSensorTMini3.java | 2 +- altoslib/AltosState.java | 12 +++++------- altoslib/AltosTelemetry.java | 7 +++---- altoslib/AltosTelemetryCompanion.java | 4 ++-- altoslib/AltosTelemetryConfiguration.java | 7 +++++-- altoslib/AltosTelemetryFile.java | 6 ++++-- altoslib/AltosTelemetryLegacy.java | 13 +++++++------ altoslib/AltosTelemetryLocation.java | 6 ++++-- altoslib/AltosTelemetryMegaData.java | 7 ++++--- altoslib/AltosTelemetryMegaSensor.java | 6 ++++-- altoslib/AltosTelemetryMetrumSensor.java | 7 +++---- altoslib/AltosTelemetryMini2.java | 7 ++++--- altoslib/AltosTelemetryMini3.java | 9 ++++----- altoslib/AltosTelemetryRaw.java | 4 ++-- altoslib/AltosTelemetryReader.java | 2 +- altoslib/AltosTelemetrySatellite.java | 6 ++++-- altoslib/AltosTelemetrySensor.java | 7 ++++--- altoslib/AltosTelemetryStandard.java | 4 ++-- altosui/AltosFlightStatus.java | 12 ++++++------ altosui/AltosPad.java | 7 ++++--- altosui/AltosUI.java | 2 +- altosuilib/AltosCSVUI.java | 4 ++-- altosuilib/AltosGraph.java | 2 +- altosuilib/AltosInfoTable.java | 2 +- altosuilib/AltosScanUI.java | 2 +- telegps/TeleGPS.java | 2 +- telegps/TeleGPSState.java | 8 +++++--- telegps/TeleGPSStatus.java | 29 +++++++++++++++------------- 51 files changed, 184 insertions(+), 143 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altoslib/AltosCSV.java b/altoslib/AltosCSV.java index aed18728..f55b4785 100644 --- a/altoslib/AltosCSV.java +++ b/altoslib/AltosCSV.java @@ -133,8 +133,8 @@ public class AltosCSV implements AltosWriter { void write_general() { double time = time(); out.printf("%s, %d, %d, %s, %8.2f, %8.2f, %4d, %3d", - ALTOS_CSV_VERSION, series.cal_data.serial, - series.cal_data.flight, series.cal_data.callsign, + ALTOS_CSV_VERSION, series.cal_data().serial, + series.cal_data().flight, series.cal_data().callsign, time, time, rssi(), status() & 0x7f); } @@ -220,8 +220,8 @@ public class AltosCSV implements AltosWriter { AltosGreatCircle from_pad; - if (series.cal_data.gps_pad != null && gps != null) - from_pad = new AltosGreatCircle(series.cal_data.gps_pad, gps); + if (series.cal_data().gps_pad != null && gps != null) + from_pad = new AltosGreatCircle(series.cal_data().gps_pad, gps); else from_pad = new AltosGreatCircle(); diff --git a/altoslib/AltosDataListener.java b/altoslib/AltosDataListener.java index 7f5dfda9..5f89b3e4 100644 --- a/altoslib/AltosDataListener.java +++ b/altoslib/AltosDataListener.java @@ -16,24 +16,45 @@ package org.altusmetrum.altoslib_12; public abstract class AltosDataListener { - public AltosCalData cal_data = null; + private AltosCalData cal_data = null; + public double time = AltosLib.MISSING; public int state = AltosLib.MISSING; + public void set_tick(int tick) { + cal_data.set_tick(tick); + set_time(cal_data.time()); + } + + public AltosCalData cal_data() { + if (cal_data == null) + cal_data = new AltosCalData(); + return cal_data; + } + public void set_time(double time) { if (time != AltosLib.MISSING) this.time = time; } + public void set_serial(int serial) { + cal_data().set_serial(serial); + } + public double time() { return time; } public void set_state(int state) { + cal_data().set_state(state); if (state != AltosLib.MISSING) this.state = state; } + public void set_flight(int flight) { + cal_data().set_flight(flight); + } + /* Called after all records are captured */ public void finish() { } diff --git a/altoslib/AltosDataProvider.java b/altoslib/AltosDataProvider.java index f977aee3..9589a8e6 100644 --- a/altoslib/AltosDataProvider.java +++ b/altoslib/AltosDataProvider.java @@ -19,5 +19,5 @@ package org.altusmetrum.altoslib_12; public interface AltosDataProvider { - public void provide_data(AltosDataListener listener, AltosCalData cal_data) throws InterruptedException, AltosUnknownProduct; + public void provide_data(AltosDataListener listener) throws InterruptedException, AltosUnknownProduct; } diff --git a/altoslib/AltosEepromRecordTiny.java b/altoslib/AltosEepromRecordTiny.java index 4d44ddd7..06ee9d54 100644 --- a/altoslib/AltosEepromRecordTiny.java +++ b/altoslib/AltosEepromRecordTiny.java @@ -50,16 +50,15 @@ public class AltosEepromRecordTiny extends AltosEepromRecord implements AltosDat return tick; } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { + public void provide_data(AltosDataListener listener) { int value = data16(-header_length); - cal_data.set_tick(tick()); - listener.set_time(cal_data.time()); + listener.set_tick(tick()); switch (cmd()) { case AltosLib.AO_LOG_FLIGHT: listener.set_state(AltosLib.ao_flight_pad); - cal_data.set_flight(value); - cal_data.set_boost_tick(); + listener.cal_data().set_flight(value); + listener.cal_data().set_boost_tick(); break; case AltosLib.AO_LOG_STATE: listener.set_state(value & 0x7fff); diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java index fc7a9f14..45d3b456 100644 --- a/altoslib/AltosFlightSeries.java +++ b/altoslib/AltosFlightSeries.java @@ -232,23 +232,23 @@ public class AltosFlightSeries extends AltosDataListener { if (altitude_series == null) altitude_series = add_series(altitude_name, AltosConvert.height); - if (cal_data.ground_pressure == AltosLib.MISSING) - cal_data.set_ground_pressure(pa); + if (cal_data().ground_pressure == AltosLib.MISSING) + cal_data().set_ground_pressure(pa); double altitude = AltosConvert.pressure_to_altitude(pa); altitude_series.add(time(), altitude); } private void compute_height() { - double ground_altitude = cal_data.ground_altitude; + double ground_altitude = cal_data().ground_altitude; if (height_series == null && ground_altitude != AltosLib.MISSING && altitude_series != null) { height_series = add_series(height_name, AltosConvert.height); for (AltosTimeValue alt : altitude_series) height_series.add(alt.time, alt.value - ground_altitude); } - if (gps_height == null && cal_data.gps_pad != null && cal_data.gps_pad.alt != AltosLib.MISSING && gps_altitude != null) { - double gps_ground_altitude = cal_data.gps_pad.alt; + if (gps_height == null && cal_data().gps_pad != null && cal_data().gps_pad.alt != AltosLib.MISSING && gps_altitude != null) { + double gps_ground_altitude = cal_data().gps_pad.alt; gps_height = add_series(gps_height_name, AltosConvert.height); for (AltosTimeValue gps_alt : gps_altitude) gps_height.add(gps_alt.time, gps_alt.value - gps_ground_altitude); @@ -343,16 +343,16 @@ public class AltosFlightSeries extends AltosDataListener { if (accel_ground_across == AltosLib.MISSING) return; - if (cal_data.pad_orientation == AltosLib.MISSING) + if (cal_data().pad_orientation == AltosLib.MISSING) return; - if (cal_data.accel_zero_across == AltosLib.MISSING) + if (cal_data().accel_zero_across == AltosLib.MISSING) return; - AltosRotation rotation = new AltosRotation(AltosIMU.convert_accel(accel_ground_across - cal_data.accel_zero_across), - AltosIMU.convert_accel(accel_ground_through - cal_data.accel_zero_through), - AltosIMU.convert_accel(accel_ground_along - cal_data.accel_zero_along), - cal_data.pad_orientation); + AltosRotation rotation = new AltosRotation(AltosIMU.convert_accel(accel_ground_across - cal_data().accel_zero_across), + AltosIMU.convert_accel(accel_ground_through - cal_data().accel_zero_through), + AltosIMU.convert_accel(accel_ground_along - cal_data().accel_zero_along), + cal_data().pad_orientation); double prev_time = ground_time; orient_series = add_series(orient_name, AltosConvert.orient); diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java index a2c5d468..2b6530c8 100644 --- a/altoslib/AltosFlightStats.java +++ b/altoslib/AltosFlightStats.java @@ -128,7 +128,7 @@ public class AltosFlightStats { public AltosFlightStats(AltosFlightSeries series) { - AltosCalData cal_data = series.cal_data; + AltosCalData cal_data = series.cal_data(); series.finish(); @@ -204,7 +204,7 @@ public class AltosFlightStats { has_rssi = series.rssi_series != null; has_flight_data = series.pressure_series != null; - AltosGPS gps = series.cal_data.gps_pad; + AltosGPS gps = series.cal_data().gps_pad; if (gps != null) { year = gps.year; diff --git a/altoslib/AltosGPS.java b/altoslib/AltosGPS.java index 7898fb9f..b6ca3576 100644 --- a/altoslib/AltosGPS.java +++ b/altoslib/AltosGPS.java @@ -383,7 +383,7 @@ public class AltosGPS implements Cloneable { } } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosGPS gps = new AltosGPS(link, link.config_data()); if (gps != null) diff --git a/altoslib/AltosIMU.java b/altoslib/AltosIMU.java index 87d3ec94..dee28a92 100644 --- a/altoslib/AltosIMU.java +++ b/altoslib/AltosIMU.java @@ -74,9 +74,10 @@ public class AltosIMU implements Cloneable { return n; } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosIMU imu = new AltosIMU(link); + AltosCalData cal_data = listener.cal_data(); if (imu != null) { listener.set_gyro(cal_data.gyro_roll(imu.gyro_y), diff --git a/altoslib/AltosIdleFetch.java b/altoslib/AltosIdleFetch.java index 7980ae6b..058df0a1 100644 --- a/altoslib/AltosIdleFetch.java +++ b/altoslib/AltosIdleFetch.java @@ -43,47 +43,47 @@ class AltosIdler { static final int idle_sensor_tgps = 16; static final int idle_sensor_tmini3 = 17; - public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException, TimeoutException, AltosUnknownProduct { + public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException, TimeoutException, AltosUnknownProduct { for (int idler : idlers) { switch (idler) { case idle_gps: - AltosGPS.provide_data(listener, link, cal_data); + AltosGPS.provide_data(listener, link); break; case idle_imu: - AltosIMU.provide_data(listener, link, cal_data); + AltosIMU.provide_data(listener, link); break; case idle_mag: - AltosMag.provide_data(listener, link, cal_data); + AltosMag.provide_data(listener, link); break; case idle_mma655x: - AltosMma655x.provide_data(listener, link, cal_data); + AltosMma655x.provide_data(listener, link); break; case idle_ms5607: - AltosMs5607.provide_data(listener, link, cal_data); + AltosMs5607.provide_data(listener, link); break; case idle_sensor_tm: - AltosSensorTM.provide_data(listener, link, cal_data); + AltosSensorTM.provide_data(listener, link); break; case idle_sensor_metrum: - AltosSensorMetrum.provide_data(listener, link, cal_data); + AltosSensorMetrum.provide_data(listener, link); break; case idle_sensor_mega: - AltosSensorMega.provide_data(listener, link, cal_data); + AltosSensorMega.provide_data(listener, link); break; case idle_sensor_emini1: - AltosSensorEMini.provide_data(listener, link, cal_data, 1); + AltosSensorEMini.provide_data(listener, link, 1); break; case idle_sensor_emini2: - AltosSensorEMini.provide_data(listener, link, cal_data, 2); + AltosSensorEMini.provide_data(listener, link, 2); break; case idle_sensor_tmini2: - AltosSensorTMini2.provide_data(listener, link, cal_data); + AltosSensorTMini2.provide_data(listener, link); break; case idle_sensor_tgps: - AltosSensorTGPS.provide_data(listener, link, cal_data); + AltosSensorTGPS.provide_data(listener, link); break; case idle_sensor_tmini3: - AltosSensorTMini3.provide_data(listener, link, cal_data); + AltosSensorTMini3.provide_data(listener, link); break; } } @@ -151,7 +151,7 @@ public class AltosIdleFetch implements AltosDataProvider { AltosLink link; - public void provide_data(AltosDataListener listener, AltosCalData cal_data) throws InterruptedException, AltosUnknownProduct { + public void provide_data(AltosDataListener listener) throws InterruptedException, AltosUnknownProduct { try { boolean matched = false; /* Fetch config data from remote */ @@ -159,7 +159,7 @@ public class AltosIdleFetch implements AltosDataProvider { listener.set_state(AltosLib.ao_flight_stateless); for (AltosIdler idler : idlers) { if (idler.matches(config_data)) { - idler.provide_data(listener, link, cal_data); + idler.provide_data(listener, link); matched = true; break; } diff --git a/altoslib/AltosIdleMonitor.java b/altoslib/AltosIdleMonitor.java index cc6b8545..fc5d4cc8 100644 --- a/altoslib/AltosIdleMonitor.java +++ b/altoslib/AltosIdleMonitor.java @@ -55,11 +55,10 @@ public class AltosIdleMonitor extends Thread { boolean provide_data(AltosDataListener listener) throws InterruptedException, TimeoutException, AltosUnknownProduct { boolean worked = false; boolean aborted = false; - AltosCalData cal_data = new AltosCalData(link.config_data()); try { start_link(); - fetch.provide_data(listener, cal_data); + fetch.provide_data(listener); if (!link.has_error && !link.reply_abort) worked = true; } finally { diff --git a/altoslib/AltosIdleReader.java b/altoslib/AltosIdleReader.java index 5f9ceca3..d15e2174 100644 --- a/altoslib/AltosIdleReader.java +++ b/altoslib/AltosIdleReader.java @@ -72,7 +72,7 @@ public class AltosIdleReader extends AltosFlightReader { start_link(); if (state == null) state = new AltosState(cal_data()); - fetch.provide_data(state, state.cal_data); + fetch.provide_data(state); if (!link.has_error && !link.reply_abort) worked = true; } catch (TimeoutException te) { diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java index ccdd0818..1c025ef4 100644 --- a/altoslib/AltosKML.java +++ b/altoslib/AltosKML.java @@ -189,9 +189,9 @@ public class AltosKML implements AltosWriter { public void write(AltosFlightSeries series) { stats = new AltosFlightStats(series); - start(series.cal_data); + start(series.cal_data()); for (AltosGPSTimeValue gtv : series.gps_series) - write(gtv, series.cal_data, state(series, gtv.time), height(series, gtv.time)); + write(gtv, series.cal_data(), state(series, gtv.time), height(series, gtv.time)); } public AltosKML(File in_name) throws FileNotFoundException { diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java index ab0d3987..44bea646 100644 --- a/altoslib/AltosLog.java +++ b/altoslib/AltosLog.java @@ -92,7 +92,7 @@ public class AltosLog implements Runnable { AltosTelemetry telem = AltosTelemetry.parse(line.line); if (state == null) state = new AltosState(cal_data); - telem.provide_data(state, cal_data); + telem.provide_data(state); if (cal_data.serial != serial || cal_data.flight != flight || diff --git a/altoslib/AltosMag.java b/altoslib/AltosMag.java index 3cf83138..0d8ec69f 100644 --- a/altoslib/AltosMag.java +++ b/altoslib/AltosMag.java @@ -62,9 +62,10 @@ public class AltosMag implements Cloneable { y = AltosLib.MISSING; } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosMag mag = new AltosMag(link); + AltosCalData cal_data = listener.cal_data(); if (mag != null) listener.set_mag(cal_data.mag_along(mag.y), diff --git a/altoslib/AltosMma655x.java b/altoslib/AltosMma655x.java index f69b571b..0f6022ac 100644 --- a/altoslib/AltosMma655x.java +++ b/altoslib/AltosMma655x.java @@ -46,9 +46,10 @@ public class AltosMma655x implements Cloneable { return n; } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException, AltosUnknownProduct { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException, AltosUnknownProduct { try { AltosMma655x mma655x = new AltosMma655x(link); + AltosCalData cal_data = listener.cal_data(); if (mma655x != null) { int accel = mma655x.accel; diff --git a/altoslib/AltosMs5607.java b/altoslib/AltosMs5607.java index 6888bda1..5b3ba65d 100644 --- a/altoslib/AltosMs5607.java +++ b/altoslib/AltosMs5607.java @@ -133,8 +133,9 @@ public class AltosMs5607 { crc = old.crc; } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { + AltosCalData cal_data = listener.cal_data(); AltosMs5607 ms5607 = cal_data.ms5607; if (ms5607 != null) { diff --git a/altoslib/AltosReplayReader.java b/altoslib/AltosReplayReader.java index 3847cab7..24b425b7 100644 --- a/altoslib/AltosReplayReader.java +++ b/altoslib/AltosReplayReader.java @@ -108,7 +108,7 @@ public class AltosReplayReader extends AltosFlightReader { int reads; public AltosCalData cal_data() { - return replay.state.cal_data; + return replay.state.cal_data(); } public AltosState read() { diff --git a/altoslib/AltosSensorEMini.java b/altoslib/AltosSensorEMini.java index a144ec7a..1bdbb60c 100644 --- a/altoslib/AltosSensorEMini.java +++ b/altoslib/AltosSensorEMini.java @@ -26,9 +26,10 @@ public class AltosSensorEMini { public int main; public int batt; - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data, int version) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link, int version) throws InterruptedException { try { AltosSensorEMini sensor_emini = new AltosSensorEMini(link); + AltosCalData cal_data = listener.cal_data(); if (sensor_emini == null) return; diff --git a/altoslib/AltosSensorMega.java b/altoslib/AltosSensorMega.java index c47ee4b1..e58b03a1 100644 --- a/altoslib/AltosSensorMega.java +++ b/altoslib/AltosSensorMega.java @@ -89,7 +89,7 @@ class AltosSensorMega { } } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorMega sensor_mega = new AltosSensorMega(link); diff --git a/altoslib/AltosSensorMetrum.java b/altoslib/AltosSensorMetrum.java index 6d64b6ba..e01d57cc 100644 --- a/altoslib/AltosSensorMetrum.java +++ b/altoslib/AltosSensorMetrum.java @@ -53,7 +53,7 @@ class AltosSensorMetrum { } } - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorMetrum sensor_metrum = new AltosSensorMetrum(link); listener.set_battery_voltage(AltosConvert.mega_battery_voltage(sensor_metrum.v_batt)); diff --git a/altoslib/AltosSensorTGPS.java b/altoslib/AltosSensorTGPS.java index 5f39e596..14514413 100644 --- a/altoslib/AltosSensorTGPS.java +++ b/altoslib/AltosSensorTGPS.java @@ -24,7 +24,7 @@ public class AltosSensorTGPS { public int tick; public int batt; - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorTGPS sensor_tgps = new AltosSensorTGPS(link); diff --git a/altoslib/AltosSensorTM.java b/altoslib/AltosSensorTM.java index 76bf8a77..bdedaa9c 100644 --- a/altoslib/AltosSensorTM.java +++ b/altoslib/AltosSensorTM.java @@ -29,9 +29,10 @@ public class AltosSensorTM { public int drogue; public int main; - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorTM sensor_tm = new AltosSensorTM(link); + AltosCalData cal_data = listener.cal_data(); if (sensor_tm == null) return; diff --git a/altoslib/AltosSensorTMini2.java b/altoslib/AltosSensorTMini2.java index 8d95c7f7..9b5a1854 100644 --- a/altoslib/AltosSensorTMini2.java +++ b/altoslib/AltosSensorTMini2.java @@ -26,7 +26,7 @@ public class AltosSensorTMini2 { public int main; public int batt; - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorTMini2 sensor_tmini = new AltosSensorTMini2(link); diff --git a/altoslib/AltosSensorTMini3.java b/altoslib/AltosSensorTMini3.java index bb7fcd77..b92def03 100644 --- a/altoslib/AltosSensorTMini3.java +++ b/altoslib/AltosSensorTMini3.java @@ -26,7 +26,7 @@ public class AltosSensorTMini3 { public int main; public int batt; - static public void provide_data(AltosDataListener listener, AltosLink link, AltosCalData cal_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorTMini3 sensor_tmini = new AltosSensorTMini3(link); diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 6f293652..cfee819b 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -909,11 +909,11 @@ public class AltosState extends AltosDataListener { public double accel_ground_along, accel_ground_across, accel_ground_through; void update_pad_rotation() { - if (cal_data.pad_orientation != AltosLib.MISSING && accel_ground_along != AltosLib.MISSING) { - rotation = new AltosRotation(AltosIMU.convert_accel(accel_ground_across - cal_data.accel_zero_across), - AltosIMU.convert_accel(accel_ground_through - cal_data.accel_zero_through), - AltosIMU.convert_accel(accel_ground_along - cal_data.accel_zero_along), - cal_data.pad_orientation); + if (cal_data().pad_orientation != AltosLib.MISSING && accel_ground_along != AltosLib.MISSING) { + rotation = new AltosRotation(AltosIMU.convert_accel(accel_ground_across - cal_data().accel_zero_across), + AltosIMU.convert_accel(accel_ground_through - cal_data().accel_zero_through), + AltosIMU.convert_accel(accel_ground_along - cal_data().accel_zero_along), + cal_data().pad_orientation); orient.set_computed(rotation.tilt(), time); } } @@ -1066,8 +1066,6 @@ public class AltosState extends AltosDataListener { public AltosState (AltosCalData cal_data) { super(cal_data); - if (cal_data == null) - Thread.dumpStack(); init(); } } diff --git a/altoslib/AltosTelemetry.java b/altoslib/AltosTelemetry.java index e93e6601..7d576942 100644 --- a/altoslib/AltosTelemetry.java +++ b/altoslib/AltosTelemetry.java @@ -46,12 +46,11 @@ public abstract class AltosTelemetry implements AltosDataProvider { return sum == bytes[bytes.length - 1]; } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - cal_data.set_serial(serial()); + public void provide_data(AltosDataListener listener) { + listener.set_serial(serial()); if (listener.state == AltosLib.ao_flight_invalid) listener.set_state(AltosLib.ao_flight_startup); - cal_data.set_tick(tick()); - listener.set_time(cal_data.time()); + listener.set_tick(tick()); listener.set_rssi(rssi(), status()); listener.set_received_time(received_time); } diff --git a/altoslib/AltosTelemetryCompanion.java b/altoslib/AltosTelemetryCompanion.java index 6f91d7c2..c6dfe3eb 100644 --- a/altoslib/AltosTelemetryCompanion.java +++ b/altoslib/AltosTelemetryCompanion.java @@ -49,8 +49,8 @@ public class AltosTelemetryCompanion extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); listener.set_companion(companion()); } } diff --git a/altoslib/AltosTelemetryConfiguration.java b/altoslib/AltosTelemetryConfiguration.java index b5f0eb4b..ea307442 100644 --- a/altoslib/AltosTelemetryConfiguration.java +++ b/altoslib/AltosTelemetryConfiguration.java @@ -35,8 +35,11 @@ public class AltosTelemetryConfiguration extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); + + AltosCalData cal_data = listener.cal_data(); + cal_data.set_device_type(device_type()); cal_data.set_flight(flight()); cal_data.set_config(config_major(), config_minor(), flight_log_max()); diff --git a/altoslib/AltosTelemetryFile.java b/altoslib/AltosTelemetryFile.java index 037a6c87..135b0284 100644 --- a/altoslib/AltosTelemetryFile.java +++ b/altoslib/AltosTelemetryFile.java @@ -52,6 +52,8 @@ class AltosTelemetryNullListener extends AltosDataListener { public boolean cal_data_complete() { /* All telemetry packets */ + AltosCalData cal_data = cal_data(); + if (cal_data.serial == AltosLib.MISSING) return false; @@ -107,7 +109,7 @@ public class AltosTelemetryFile implements AltosRecordSet { AltosTelemetryNullListener l = new AltosTelemetryNullListener(cal_data); for (AltosTelemetry telem : telems) { - telem.provide_data(l, cal_data); + telem.provide_data(l); if (l.cal_data_complete()) break; } @@ -125,7 +127,7 @@ public class AltosTelemetryFile implements AltosRecordSet { /* Try to pick up at least one pre-boost value */ if (cal_data.time() >= -2) - telem.provide_data(listener, cal_data); + telem.provide_data(listener); if (listener.state == AltosLib.ao_flight_landed) break; } diff --git a/altoslib/AltosTelemetryLegacy.java b/altoslib/AltosTelemetryLegacy.java index 7f3f2ecb..027f601e 100644 --- a/altoslib/AltosTelemetryLegacy.java +++ b/altoslib/AltosTelemetryLegacy.java @@ -548,16 +548,17 @@ public class AltosTelemetryLegacy extends AltosTelemetry { } } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - cal_data.set_tick(tick); - listener.set_time(cal_data.time()); + public void provide_data(AltosDataListener listener) { + listener.set_serial(serial); + listener.set_tick(tick); listener.set_state(this.state); - cal_data.set_state(this.state); - cal_data.set_flight(flight); - cal_data.set_serial(serial); + listener.set_flight(flight); listener.set_rssi(rssi, status); listener.set_pressure(AltosConvert.barometer_to_pressure(pres)); + + AltosCalData cal_data = listener.cal_data(); + cal_data.set_accel_plus_minus(accel_plus_g, accel_minus_g); listener.set_acceleration(cal_data.acceleration(accel)); if (kalman_height != AltosLib.MISSING) diff --git a/altoslib/AltosTelemetryLocation.java b/altoslib/AltosTelemetryLocation.java index 6819fec8..f4366e33 100644 --- a/altoslib/AltosTelemetryLocation.java +++ b/altoslib/AltosTelemetryLocation.java @@ -49,8 +49,10 @@ public class AltosTelemetryLocation extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); + + AltosCalData cal_data = listener.cal_data(); AltosGPS gps = cal_data.make_temp_gps(tick(), false); diff --git a/altoslib/AltosTelemetryMegaData.java b/altoslib/AltosTelemetryMegaData.java index 29baee8c..7ef9c637 100644 --- a/altoslib/AltosTelemetryMegaData.java +++ b/altoslib/AltosTelemetryMegaData.java @@ -39,11 +39,10 @@ public class AltosTelemetryMegaData extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); listener.set_state(state()); - cal_data.set_state(state()); listener.set_battery_voltage(AltosConvert.mega_battery_voltage(v_batt())); listener.set_pyro_voltage(AltosConvert.mega_pyro_voltage(v_pyro())); @@ -57,6 +56,8 @@ public class AltosTelemetryMegaData extends AltosTelemetryStandard { listener.set_igniter_voltage(voltages); + AltosCalData cal_data = listener.cal_data(); + cal_data.set_ground_accel(ground_accel()); cal_data.set_ground_pressure(ground_pres()); cal_data.set_accel_plus_minus(accel_plus_g(), accel_minus_g()); diff --git a/altoslib/AltosTelemetryMegaSensor.java b/altoslib/AltosTelemetryMegaSensor.java index efcc3ccb..4c64b554 100644 --- a/altoslib/AltosTelemetryMegaSensor.java +++ b/altoslib/AltosTelemetryMegaSensor.java @@ -41,8 +41,10 @@ public class AltosTelemetryMegaSensor extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); + + AltosCalData cal_data = listener.cal_data(); listener.set_acceleration(cal_data.acceleration(accel())); listener.set_pressure(pres()); diff --git a/altoslib/AltosTelemetryMetrumSensor.java b/altoslib/AltosTelemetryMetrumSensor.java index 211f9c68..79d3a499 100644 --- a/altoslib/AltosTelemetryMetrumSensor.java +++ b/altoslib/AltosTelemetryMetrumSensor.java @@ -38,13 +38,12 @@ public class AltosTelemetryMetrumSensor extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); listener.set_state(state()); - cal_data.set_state(state()); - listener.set_acceleration(cal_data.acceleration(accel())); + listener.set_acceleration(listener.cal_data().acceleration(accel())); listener.set_pressure(pres()); listener.set_temperature(temp()/100.0); diff --git a/altoslib/AltosTelemetryMini2.java b/altoslib/AltosTelemetryMini2.java index 59a4d506..3ea287ac 100644 --- a/altoslib/AltosTelemetryMini2.java +++ b/altoslib/AltosTelemetryMini2.java @@ -40,16 +40,17 @@ public class AltosTelemetryMini2 extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); listener.set_state(state()); - cal_data.set_state(state()); listener.set_battery_voltage(AltosConvert.tele_mini_2_voltage(v_batt())); listener.set_apogee_voltage(AltosConvert.tele_mini_2_voltage(sense_a())); listener.set_main_voltage(AltosConvert.tele_mini_2_voltage(sense_m())); + AltosCalData cal_data = listener.cal_data(); + cal_data.set_ground_pressure(ground_pres()); listener.set_pressure(pres()); diff --git a/altoslib/AltosTelemetryMini3.java b/altoslib/AltosTelemetryMini3.java index 13c2ea4d..c66f8e61 100644 --- a/altoslib/AltosTelemetryMini3.java +++ b/altoslib/AltosTelemetryMini3.java @@ -40,19 +40,18 @@ public class AltosTelemetryMini3 extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); - - cal_data.set_ground_pressure(ground_pres()); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); listener.set_state(state()); - cal_data.set_state(state()); listener.set_battery_voltage(AltosConvert.tele_mini_3_battery_voltage(v_batt())); listener.set_apogee_voltage(AltosConvert.tele_mini_3_pyro_voltage(sense_a())); listener.set_main_voltage(AltosConvert.tele_mini_3_pyro_voltage(sense_m())); + listener.cal_data().set_ground_pressure(ground_pres()); + listener.set_pressure(pres()); listener.set_temperature(temp()/100.0); diff --git a/altoslib/AltosTelemetryRaw.java b/altoslib/AltosTelemetryRaw.java index f2d73ae8..f2108d68 100644 --- a/altoslib/AltosTelemetryRaw.java +++ b/altoslib/AltosTelemetryRaw.java @@ -23,7 +23,7 @@ public class AltosTelemetryRaw extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); } } diff --git a/altoslib/AltosTelemetryReader.java b/altoslib/AltosTelemetryReader.java index 7b51853d..26fe4f26 100644 --- a/altoslib/AltosTelemetryReader.java +++ b/altoslib/AltosTelemetryReader.java @@ -45,7 +45,7 @@ public class AltosTelemetryReader extends AltosFlightReader { System.out.printf("Make state\n"); state = new AltosState(cal_data()); } - telem.provide_data(state, state.cal_data); + telem.provide_data(state); return state; } diff --git a/altoslib/AltosTelemetrySatellite.java b/altoslib/AltosTelemetrySatellite.java index 012d0c46..60bc4a51 100644 --- a/altoslib/AltosTelemetrySatellite.java +++ b/altoslib/AltosTelemetrySatellite.java @@ -44,8 +44,10 @@ public class AltosTelemetrySatellite extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); + + AltosCalData cal_data = listener.cal_data(); AltosGPS gps = cal_data.make_temp_gps(tick(), true); diff --git a/altoslib/AltosTelemetrySensor.java b/altoslib/AltosTelemetrySensor.java index 6bbe4ece..dc8efa9b 100644 --- a/altoslib/AltosTelemetrySensor.java +++ b/altoslib/AltosTelemetrySensor.java @@ -41,11 +41,12 @@ public class AltosTelemetrySensor extends AltosTelemetryStandard { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); listener.set_state(state()); - cal_data.set_state(state()); + + AltosCalData cal_data = listener.cal_data(); if (type() == packet_type_TM_sensor) { cal_data.set_ground_accel(ground_accel()); diff --git a/altoslib/AltosTelemetryStandard.java b/altoslib/AltosTelemetryStandard.java index 56381561..2a1c9365 100644 --- a/altoslib/AltosTelemetryStandard.java +++ b/altoslib/AltosTelemetryStandard.java @@ -104,7 +104,7 @@ public abstract class AltosTelemetryStandard extends AltosTelemetry { super(bytes); } - public void provide_data(AltosDataListener listener, AltosCalData cal_data) { - super.provide_data(listener, cal_data); + public void provide_data(AltosDataListener listener) { + super.provide_data(listener); } } diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index b46cbc84..a5e5a4ef 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -93,14 +93,14 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay } void show(AltosState state, AltosListenerState listener_state) { - if (!same_call(state.cal_data.callsign)) { + if (!same_call(state.cal_data().callsign)) { show(); - value.setText(state.cal_data.callsign); - if (state.cal_data.callsign == null) + value.setText(state.cal_data().callsign); + if (state.cal_data().callsign == null) setVisible(false); else setVisible(true); - last_call = state.cal_data.callsign; + last_call = state.cal_data().callsign; } } @@ -120,7 +120,7 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay int last_serial = -1; void show(AltosState state, AltosListenerState listener_state) { - AltosCalData cal_data = state.cal_data; + AltosCalData cal_data = state.cal_data(); if (cal_data.serial != last_serial) { show(); if (cal_data.serial == AltosLib.MISSING) @@ -148,7 +148,7 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay int last_flight = -1; void show(AltosState state, AltosListenerState listener_state) { - AltosCalData cal_data = state.cal_data; + AltosCalData cal_data = state.cal_data(); if (cal_data.flight != last_flight) { show(); if (cal_data.flight == AltosLib.MISSING) diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 331b58e3..0aeef8e1 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -46,10 +46,11 @@ public class AltosPad extends AltosUIFlightTab { class LoggingReady extends AltosUIIndicator { public void show (AltosState state, AltosListenerState listener_state) { - if (state == null || state.cal_data.flight == AltosLib.MISSING) { + AltosCalData cal_data = state.cal_data(); + if (state == null || cal_data.flight == AltosLib.MISSING) { hide(); } else { - if (state.cal_data.flight != 0) { + if (cal_data.flight != 0) { if (state.state() <= Altos.ao_flight_pad) show("Ready to record"); else if (state.state() < Altos.ao_flight_landed || @@ -59,7 +60,7 @@ public class AltosPad extends AltosUIFlightTab { show("Recorded data"); } else show("Storage full"); - set_lights(state.cal_data.flight != 0); + set_lights(cal_data.flight != 0); } } public LoggingReady (AltosUIFlightTab container, int y) { diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 3ec25cfa..26591738 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -342,7 +342,7 @@ public class AltosUI extends AltosUIFrame { if (set == null) return; AltosFlightSeries series = make_series(set); - new AltosCSVUI(AltosUI.this, series, series.cal_data, chooser.file()); + new AltosCSVUI(AltosUI.this, series, chooser.file()); } /* Load a flight log CSV file and display a pretty graph. diff --git a/altosuilib/AltosCSVUI.java b/altosuilib/AltosCSVUI.java index 821b842b..442e3de3 100644 --- a/altosuilib/AltosCSVUI.java +++ b/altosuilib/AltosCSVUI.java @@ -56,9 +56,9 @@ public class AltosCSVUI set_default_file(); } - public AltosCSVUI(JFrame frame, AltosFlightSeries series, AltosCalData cal_data, File source_file) { + public AltosCSVUI(JFrame frame, AltosFlightSeries series, File source_file) { this.series = series; - this.cal_data = cal_data; + this.cal_data = series.cal_data(); csv_chooser = new JFileChooser(source_file); accessory = new JPanel(); diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index 8125e5e0..31042abb 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -84,7 +84,7 @@ public class AltosGraph extends AltosUIGraph { AltosUIFlightSeries flight_series; AltosUITimeSeries[] setup(AltosFlightStats stats, AltosUIFlightSeries flight_series) { - AltosCalData cal_data = flight_series.cal_data; + AltosCalData cal_data = flight_series.cal_data(); AltosUIAxis height_axis, speed_axis, accel_axis, voltage_axis, temperature_axis, nsat_axis, dbm_axis; AltosUIAxis distance_axis, pressure_axis, thrust_axis; diff --git a/altosuilib/AltosInfoTable.java b/altosuilib/AltosInfoTable.java index 41614cfa..9e528b1f 100644 --- a/altosuilib/AltosInfoTable.java +++ b/altosuilib/AltosInfoTable.java @@ -128,7 +128,7 @@ public class AltosInfoTable extends JTable implements AltosFlightDisplay, Hierar public void show(AltosState state, AltosListenerState listener_state) { - AltosCalData cal_data = state.cal_data; + AltosCalData cal_data = state.cal_data(); if (!isShowing()) { last_state = state; diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java index 1280ba6a..c63f027c 100644 --- a/altosuilib/AltosScanUI.java +++ b/altosuilib/AltosScanUI.java @@ -213,7 +213,7 @@ public class AltosScanUI if (state == null) continue; packet_count++; - AltosCalData cal_data = state.cal_data; + AltosCalData cal_data = state.cal_data(); if (cal_data.flight != AltosLib.MISSING) { final AltosScanResult result = new AltosScanResult(cal_data.callsign, cal_data.serial, diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index c6cd2bd1..3646f000 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -301,7 +301,7 @@ public class TeleGPS if (set == null) return; AltosFlightSeries series = make_series(set); - new AltosCSVUI(this, series, series.cal_data, chooser.file()); + new AltosCSVUI(this, series, chooser.file()); } void graph() { diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java index 19fd3694..21173394 100644 --- a/telegps/TeleGPSState.java +++ b/telegps/TeleGPSState.java @@ -124,10 +124,11 @@ public class TeleGPSState extends AltosUIFlightTab { class FirmwareVersion extends AltosUIIndicator { public void show(AltosState state, AltosListenerState listener_state) { - if (state.cal_data.firmware_version == null) + AltosCalData cal_data = state.cal_data(); + if (cal_data.firmware_version == null) show("Missing"); else - show(state.cal_data.firmware_version); + show(cal_data.firmware_version); } public FirmwareVersion(Container container, int y) { @@ -137,7 +138,8 @@ public class TeleGPSState extends AltosUIFlightTab { class FlightLogMax extends AltosUIIndicator { public void show(AltosState state, AltosListenerState listener_state) { - int storage = state.cal_data.flight_log_max; + AltosCalData cal_data = state.cal_data(); + int storage = cal_data.flight_log_max; if (storage == AltosLib.MISSING) show("Missing"); else diff --git a/telegps/TeleGPSStatus.java b/telegps/TeleGPSStatus.java index 15292fe5..e1be69a4 100644 --- a/telegps/TeleGPSStatus.java +++ b/telegps/TeleGPSStatus.java @@ -75,13 +75,14 @@ public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { String call; void show(AltosState state, AltosListenerState listener_state) { - if (state.cal_data == null) + AltosCalData cal_data = state.cal_data(); + if (cal_data == null) System.out.printf("null cal data?\n"); - if (state.cal_data.callsign != call) { - value.setText(state.cal_data.callsign); - call = state.cal_data.callsign; + if (cal_data.callsign != call) { + value.setText(cal_data.callsign); + call = cal_data.callsign; } - if (state.cal_data.callsign == null) + if (cal_data.callsign == null) setVisible(false); else setVisible(true); @@ -102,12 +103,13 @@ public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { class Serial extends Value { int serial = -1; void show(AltosState state, AltosListenerState listener_state) { - if (state.cal_data.serial != serial) { - if (state.cal_data.serial == AltosLib.MISSING) + AltosCalData cal_data = state.cal_data(); + if (cal_data.serial != serial) { + if (cal_data.serial == AltosLib.MISSING) value.setText("none"); else - value.setText(String.format("%d", state.cal_data.serial)); - serial = state.cal_data.serial; + value.setText(String.format("%d", cal_data.serial)); + serial = cal_data.serial; } } @@ -128,12 +130,13 @@ public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { int last_flight = -1; void show(AltosState state, AltosListenerState listener_state) { - if (state.cal_data.flight != last_flight) { - if (state.cal_data.flight == AltosLib.MISSING) + AltosCalData cal_data = state.cal_data(); + if (cal_data.flight != last_flight) { + if (cal_data.flight == AltosLib.MISSING) value.setText("none"); else - value.setText(String.format("%d", state.cal_data.flight)); - last_flight = state.cal_data.flight; + value.setText(String.format("%d", cal_data.flight)); + last_flight = cal_data.flight; } } -- cgit v1.2.3 From c7c2fc2d85414fefda0a7948a6c4e38f65140861 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 23 Jul 2017 16:38:09 -0700 Subject: altosui: Adapt to flight stats time value changes There aren't state time values anymore as those don't work when you have multiple motors. Instead, 'boost_time' is when the rocket left the pad and 'landed_time' is when it touched down. Use these new values in the --summary output. Signed-off-by: Keith Packard --- altosui/AltosUI.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 26591738..a5a2078d 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -520,11 +520,12 @@ public class AltosUI extends AltosUIFrame { System.out.printf("Main rate: %6.0f m/s %6.0f ft/s\n", stats.state_speed[Altos.ao_flight_main], AltosConvert.meters_to_feet(stats.state_speed[Altos.ao_flight_main])); - if (stats.state_end[Altos.ao_flight_main] != AltosLib.MISSING && - stats.state_start[Altos.ao_flight_boost] != AltosLib.MISSING) + if (stats.landed_time != AltosLib.MISSING && + stats.boost_time != AltosLib.MISSING && + stats.landed_time > stats.boost_time) System.out.printf("Flight time: %6.0f s\n", - stats.state_end[Altos.ao_flight_main] - - stats.state_start[Altos.ao_flight_boost]); + stats.landed_time - + stats.boost_time); System.out.printf("\n"); return true; } -- cgit v1.2.3 From 198a3d4d5f51de5c0f0413299582479cde4e177f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 23 Jul 2017 16:37:27 -0700 Subject: altosui: Rename AltosConfig -> AltosConfigFC Now the class name says that this configures the flight computer. Signed-off-by: Keith Packard --- altosui/AltosConfig.java | 308 --------- altosui/AltosConfigFC.java | 308 +++++++++ altosui/AltosConfigFCUI.java | 1368 ++++++++++++++++++++++++++++++++++++++++ altosui/AltosConfigPyroUI.java | 8 +- altosui/AltosConfigUI.java | 1368 ---------------------------------------- altosui/AltosUI.java | 2 +- altosui/Makefile-standalone | 4 +- altosui/Makefile.am | 4 +- 8 files changed, 1685 insertions(+), 1685 deletions(-) delete mode 100644 altosui/AltosConfig.java create mode 100644 altosui/AltosConfigFC.java create mode 100644 altosui/AltosConfigFCUI.java delete mode 100644 altosui/AltosConfigUI.java (limited to 'altosui/AltosUI.java') diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java deleted file mode 100644 index bf2b8166..00000000 --- a/altosui/AltosConfig.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright © 2010 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package altosui; - -import java.awt.event.*; -import javax.swing.*; -import java.io.*; -import java.util.concurrent.*; -import java.text.*; -import org.altusmetrum.altoslib_12.*; -import org.altusmetrum.altosuilib_12.*; - -public class AltosConfig implements ActionListener { - - class int_ref { - int value; - - public int get() { - return value; - } - public void set(int i) { - value = i; - } - public int_ref(int i) { - value = i; - } - } - - class string_ref { - String value; - - public String get() { - return value; - } - public void set(String i) { - value = i; - } - public string_ref(String i) { - value = i; - } - } - - JFrame owner; - AltosDevice device; - AltosSerial serial_line; - boolean remote; - - AltosConfigData data; - AltosConfigUI config_ui; - boolean serial_started; - boolean made_visible; - - void start_serial() throws InterruptedException, TimeoutException { - serial_started = true; - if (remote) - serial_line.start_remote(); - } - - void stop_serial() throws InterruptedException { - if (!serial_started) - return; - serial_started = false; - if (remote) - serial_line.stop_remote(); - } - - void update_ui() { - data.set_values(config_ui); - config_ui.set_clean(); - if (!made_visible) { - made_visible = true; - config_ui.make_visible(); - } - } - - int pyro; - - final static int serial_mode_read = 0; - final static int serial_mode_save = 1; - final static int serial_mode_reboot = 2; - - class SerialData implements Runnable { - AltosConfig config; - int serial_mode; - - void callback(String in_cmd) { - final String cmd = in_cmd; - Runnable r = new Runnable() { - public void run() { - if (cmd.equals("abort")) { - abort(); - } else if (cmd.equals("all finished")) { - if (serial_line != null) - update_ui(); - } - } - }; - SwingUtilities.invokeLater(r); - } - - void get_data() { - data = null; - try { - start_serial(); - data = new AltosConfigData(config.serial_line); - } catch (InterruptedException ie) { - } catch (TimeoutException te) { - try { - stop_serial(); - callback("abort"); - } catch (InterruptedException ie) { - } - } finally { - try { - stop_serial(); - } catch (InterruptedException ie) { - } - } - callback("all finished"); - } - - void save_data() { - try { - start_serial(); - data.save(serial_line, remote); - if (remote) - AltosUIPreferences.set_frequency(device.getSerial(), - data.frequency()); - } catch (InterruptedException ie) { - } catch (TimeoutException te) { - } finally { - try { - stop_serial(); - } catch (InterruptedException ie) { - } - } - } - - void reboot() { - try { - start_serial(); - serial_line.printf("r eboot\n"); - serial_line.flush_output(); - } catch (InterruptedException ie) { - } catch (TimeoutException te) { - } finally { - try { - stop_serial(); - serial_line.close(); - } catch (InterruptedException ie) { - } - } - } - - public void run () { - switch (serial_mode) { - case serial_mode_save: - save_data(); - /* fall through ... */ - case serial_mode_read: - get_data(); - break; - case serial_mode_reboot: - reboot(); - break; - } - } - - public SerialData(AltosConfig in_config, int in_serial_mode) { - config = in_config; - serial_mode = in_serial_mode; - } - } - - void run_serial_thread(int serial_mode) { - SerialData sd = new SerialData(this, serial_mode); - Thread st = new Thread(sd); - st.start(); - } - - void init_ui () throws InterruptedException, TimeoutException { - config_ui = new AltosConfigUI(owner, remote); - config_ui.addActionListener(this); - serial_line.set_frame(owner); - set_ui(); - } - - void abort() { - if (serial_line != null) { - serial_line.close(); - serial_line = null; - } - JOptionPane.showMessageDialog(owner, - String.format("Connection to \"%s\" failed", - device.toShortString()), - "Connection Failed", - JOptionPane.ERROR_MESSAGE); - config_ui.setVisible(false); - } - - void set_ui() throws InterruptedException, TimeoutException { - if (serial_line != null) - run_serial_thread(serial_mode_read); - else - update_ui(); - } - - double frequency() { - return AltosConvert.radio_to_frequency(data.radio_frequency, - data.radio_setting, - data.radio_calibration, - data.radio_channel); - } - - void save_data() { - - try { - /* bounds check stuff */ - if (config_ui.flight_log_max() > data.log_space() / 1024) { - JOptionPane.showMessageDialog(owner, - String.format("Requested flight log, %dk, is larger than the available space, %dk.\n", - config_ui.flight_log_max(), - data.log_space() / 1024), - "Maximum Flight Log Too Large", - JOptionPane.ERROR_MESSAGE); - return; - } - - /* Pull data out of the UI and stuff back into our local data record */ - - data.get_values(config_ui); - run_serial_thread(serial_mode_save); - } catch (AltosConfigDataException ae) { - JOptionPane.showMessageDialog(owner, - ae.getMessage(), - "Configuration Data Error", - JOptionPane.ERROR_MESSAGE); - } - } - - public void actionPerformed(ActionEvent e) { - String cmd = e.getActionCommand(); - try { - if (cmd.equals("Save")) { - save_data(); - } else if (cmd.equals("Reset")) { - set_ui(); - } else if (cmd.equals("Reboot")) { - if (serial_line != null) - run_serial_thread(serial_mode_reboot); - } else if (cmd.equals("Close")) { - if (serial_line != null) - serial_line.close(); - } - } catch (InterruptedException ie) { - abort(); - } catch (TimeoutException te) { - abort(); - } - } - - public AltosConfig(JFrame given_owner) { - owner = given_owner; - - device = AltosDeviceUIDialog.show(owner, Altos.product_any); - if (device != null) { - try { - serial_line = new AltosSerial(device); - try { - if (device.matchProduct(Altos.product_basestation)) - remote = true; - init_ui(); - } catch (InterruptedException ie) { - abort(); - } catch (TimeoutException te) { - abort(); - } - } catch (FileNotFoundException ee) { - JOptionPane.showMessageDialog(owner, - ee.getMessage(), - "Cannot open target device", - JOptionPane.ERROR_MESSAGE); - } catch (AltosSerialInUseException si) { - JOptionPane.showMessageDialog(owner, - String.format("Device \"%s\" already in use", - device.toShortString()), - "Device in use", - JOptionPane.ERROR_MESSAGE); - } - } - } -} diff --git a/altosui/AltosConfigFC.java b/altosui/AltosConfigFC.java new file mode 100644 index 00000000..beff71b7 --- /dev/null +++ b/altosui/AltosConfigFC.java @@ -0,0 +1,308 @@ +/* + * Copyright © 2010 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +package altosui; + +import java.awt.event.*; +import javax.swing.*; +import java.io.*; +import java.util.concurrent.*; +import java.text.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; + +public class AltosConfigFC implements ActionListener { + + class int_ref { + int value; + + public int get() { + return value; + } + public void set(int i) { + value = i; + } + public int_ref(int i) { + value = i; + } + } + + class string_ref { + String value; + + public String get() { + return value; + } + public void set(String i) { + value = i; + } + public string_ref(String i) { + value = i; + } + } + + JFrame owner; + AltosDevice device; + AltosSerial serial_line; + boolean remote; + + AltosConfigData data; + AltosConfigFCUI config_ui; + boolean serial_started; + boolean made_visible; + + void start_serial() throws InterruptedException, TimeoutException { + serial_started = true; + if (remote) + serial_line.start_remote(); + } + + void stop_serial() throws InterruptedException { + if (!serial_started) + return; + serial_started = false; + if (remote) + serial_line.stop_remote(); + } + + void update_ui() { + data.set_values(config_ui); + config_ui.set_clean(); + if (!made_visible) { + made_visible = true; + config_ui.make_visible(); + } + } + + int pyro; + + final static int serial_mode_read = 0; + final static int serial_mode_save = 1; + final static int serial_mode_reboot = 2; + + class SerialData implements Runnable { + AltosConfigFC config; + int serial_mode; + + void callback(String in_cmd) { + final String cmd = in_cmd; + Runnable r = new Runnable() { + public void run() { + if (cmd.equals("abort")) { + abort(); + } else if (cmd.equals("all finished")) { + if (serial_line != null) + update_ui(); + } + } + }; + SwingUtilities.invokeLater(r); + } + + void get_data() { + data = null; + try { + start_serial(); + data = new AltosConfigData(config.serial_line); + } catch (InterruptedException ie) { + } catch (TimeoutException te) { + try { + stop_serial(); + callback("abort"); + } catch (InterruptedException ie) { + } + } finally { + try { + stop_serial(); + } catch (InterruptedException ie) { + } + } + callback("all finished"); + } + + void save_data() { + try { + start_serial(); + data.save(serial_line, remote); + if (remote) + AltosUIPreferences.set_frequency(device.getSerial(), + data.frequency()); + } catch (InterruptedException ie) { + } catch (TimeoutException te) { + } finally { + try { + stop_serial(); + } catch (InterruptedException ie) { + } + } + } + + void reboot() { + try { + start_serial(); + serial_line.printf("r eboot\n"); + serial_line.flush_output(); + } catch (InterruptedException ie) { + } catch (TimeoutException te) { + } finally { + try { + stop_serial(); + serial_line.close(); + } catch (InterruptedException ie) { + } + } + } + + public void run () { + switch (serial_mode) { + case serial_mode_save: + save_data(); + /* fall through ... */ + case serial_mode_read: + get_data(); + break; + case serial_mode_reboot: + reboot(); + break; + } + } + + public SerialData(AltosConfigFC in_config, int in_serial_mode) { + config = in_config; + serial_mode = in_serial_mode; + } + } + + void run_serial_thread(int serial_mode) { + SerialData sd = new SerialData(this, serial_mode); + Thread st = new Thread(sd); + st.start(); + } + + void init_ui () throws InterruptedException, TimeoutException { + config_ui = new AltosConfigFCUI(owner, remote); + config_ui.addActionListener(this); + serial_line.set_frame(owner); + set_ui(); + } + + void abort() { + if (serial_line != null) { + serial_line.close(); + serial_line = null; + } + JOptionPane.showMessageDialog(owner, + String.format("Connection to \"%s\" failed", + device.toShortString()), + "Connection Failed", + JOptionPane.ERROR_MESSAGE); + config_ui.setVisible(false); + } + + void set_ui() throws InterruptedException, TimeoutException { + if (serial_line != null) + run_serial_thread(serial_mode_read); + else + update_ui(); + } + + double frequency() { + return AltosConvert.radio_to_frequency(data.radio_frequency, + data.radio_setting, + data.radio_calibration, + data.radio_channel); + } + + void save_data() { + + try { + /* bounds check stuff */ + if (config_ui.flight_log_max() > data.log_space() / 1024) { + JOptionPane.showMessageDialog(owner, + String.format("Requested flight log, %dk, is larger than the available space, %dk.\n", + config_ui.flight_log_max(), + data.log_space() / 1024), + "Maximum Flight Log Too Large", + JOptionPane.ERROR_MESSAGE); + return; + } + + /* Pull data out of the UI and stuff back into our local data record */ + + data.get_values(config_ui); + run_serial_thread(serial_mode_save); + } catch (AltosConfigDataException ae) { + JOptionPane.showMessageDialog(owner, + ae.getMessage(), + "Configuration Data Error", + JOptionPane.ERROR_MESSAGE); + } + } + + public void actionPerformed(ActionEvent e) { + String cmd = e.getActionCommand(); + try { + if (cmd.equals("Save")) { + save_data(); + } else if (cmd.equals("Reset")) { + set_ui(); + } else if (cmd.equals("Reboot")) { + if (serial_line != null) + run_serial_thread(serial_mode_reboot); + } else if (cmd.equals("Close")) { + if (serial_line != null) + serial_line.close(); + } + } catch (InterruptedException ie) { + abort(); + } catch (TimeoutException te) { + abort(); + } + } + + public AltosConfigFC(JFrame given_owner) { + owner = given_owner; + + device = AltosDeviceUIDialog.show(owner, Altos.product_any); + if (device != null) { + try { + serial_line = new AltosSerial(device); + try { + if (device.matchProduct(Altos.product_basestation)) + remote = true; + init_ui(); + } catch (InterruptedException ie) { + abort(); + } catch (TimeoutException te) { + abort(); + } + } catch (FileNotFoundException ee) { + JOptionPane.showMessageDialog(owner, + ee.getMessage(), + "Cannot open target device", + JOptionPane.ERROR_MESSAGE); + } catch (AltosSerialInUseException si) { + JOptionPane.showMessageDialog(owner, + String.format("Device \"%s\" already in use", + device.toShortString()), + "Device in use", + JOptionPane.ERROR_MESSAGE); + } + } + } +} diff --git a/altosui/AltosConfigFCUI.java b/altosui/AltosConfigFCUI.java new file mode 100644 index 00000000..c0c37254 --- /dev/null +++ b/altosui/AltosConfigFCUI.java @@ -0,0 +1,1368 @@ +/* + * Copyright © 2010 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +package altosui; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.event.*; +import java.text.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; + +public class AltosConfigFCUI + extends AltosUIDialog + implements ActionListener, ItemListener, DocumentListener, AltosConfigValues, AltosUnitsListener +{ + + Container pane; + JLabel product_label; + JLabel version_label; + JLabel serial_label; + JLabel main_deploy_label; + JLabel apogee_delay_label; + JLabel apogee_lockout_label; + JLabel frequency_label; + JLabel radio_calibration_label; + JLabel radio_frequency_label; + JLabel radio_enable_label; + JLabel rate_label; + JLabel aprs_interval_label; + JLabel aprs_ssid_label; + JLabel aprs_format_label; + JLabel flight_log_max_label; + JLabel ignite_mode_label; + JLabel pad_orientation_label; + JLabel callsign_label; + JLabel beep_label; + JLabel tracker_motion_label; + JLabel tracker_interval_label; + + public boolean dirty; + + JFrame owner; + JLabel product_value; + JLabel version_value; + JLabel serial_value; + JComboBox main_deploy_value; + JComboBox apogee_delay_value; + JComboBox apogee_lockout_value; + AltosUIFreqList radio_frequency_value; + JLabel radio_calibration_value; + JRadioButton radio_enable_value; + AltosUIRateList rate_value; + JComboBox aprs_interval_value; + JComboBox aprs_ssid_value; + JComboBox aprs_format_value; + JComboBox flight_log_max_value; + JComboBox ignite_mode_value; + JComboBox pad_orientation_value; + JTextField callsign_value; + JComboBox beep_value; + JComboBox tracker_motion_value; + JComboBox tracker_interval_value; + + JButton pyro; + + JButton save; + JButton reset; + JButton reboot; + JButton close; + + AltosPyro[] pyros; + double pyro_firing_time; + + ActionListener listener; + + static String[] main_deploy_values_m = { + "100", "150", "200", "250", "300", "350", + "400", "450", "500" + }; + + static String[] main_deploy_values_ft = { + "250", "500", "750", "1000", "1250", "1500", + "1750", "2000" + }; + + static String[] apogee_delay_values = { + "0", "1", "2", "3", "4", "5" + }; + + static String[] apogee_lockout_values = { + "0", "5", "10", "15", "20" + }; + + static String[] ignite_mode_values = { + "Dual Deploy", + "Redundant Apogee", + "Redundant Main", + }; + + static String[] aprs_interval_values = { + "Disabled", + "2", + "5", + "10" + }; + + static Integer[] aprs_ssid_values = { + 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + }; + + static String[] beep_values = { + "3750", + "4000", + "4250", + }; + + static String[] pad_orientation_values = { + "Antenna Up", + "Antenna Down", + }; + + static String[] tracker_motion_values_m = { + "2", + "5", + "10", + "25", + }; + + static String[] tracker_motion_values_ft = { + "5", + "20", + "50", + "100" + }; + + static String[] tracker_interval_values = { + "1", + "2", + "5", + "10" + }; + + /* A window listener to catch closing events and tell the config code */ + class ConfigListener extends WindowAdapter { + AltosConfigFCUI ui; + + public ConfigListener(AltosConfigFCUI this_ui) { + ui = this_ui; + } + + public void windowClosing(WindowEvent e) { + ui.actionPerformed(new ActionEvent(e.getSource(), + ActionEvent.ACTION_PERFORMED, + "Close")); + } + } + + boolean is_telemini_v1() { + String product = product_value.getText(); + return product != null && product.startsWith("TeleMini-v1"); + } + + boolean is_telemini() { + String product = product_value.getText(); + return product != null && product.startsWith("TeleMini"); + } + + boolean is_easymini() { + String product = product_value.getText(); + return product != null && product.startsWith("EasyMini"); + } + + boolean is_telemetrum() { + String product = product_value.getText(); + return product != null && product.startsWith("TeleMetrum"); + } + + void set_radio_enable_tool_tip() { + if (radio_enable_value.isVisible()) + radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions"); + else + radio_enable_value.setToolTipText("Firmware version does not support disabling radio"); + } + + void set_rate_tool_tip() { + if (rate_value.isVisible()) + rate_value.setToolTipText("Select telemetry baud rate"); + else + rate_value.setToolTipText("Firmware version does not support variable telemetry rates"); + } + + void set_aprs_interval_tool_tip() { + if (aprs_interval_value.isVisible()) + aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports"); + else + aprs_interval_value.setToolTipText("Hardware doesn't support APRS"); + } + + void set_aprs_ssid_tool_tip() { + if (aprs_ssid_value.isVisible()) + aprs_ssid_value.setToolTipText("Set the APRS SSID (secondary station identifier)"); + else if (aprs_ssid_value.isVisible()) + aprs_ssid_value.setToolTipText("Software version doesn't support setting the APRS SSID"); + else + aprs_ssid_value.setToolTipText("Hardware doesn't support APRS"); + } + + void set_aprs_format_tool_tip() { + if (aprs_format_value.isVisible()) + aprs_format_value.setToolTipText("Set the APRS format (compressed/uncompressed)"); + else if (aprs_format_value.isVisible()) + aprs_format_value.setToolTipText("Software version doesn't support setting the APRS format"); + else + aprs_format_value.setToolTipText("Hardware doesn't support APRS"); + } + + void set_flight_log_max_tool_tip() { + if (flight_log_max_value.isVisible()) + flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)"); + else { + if (is_telemini_v1()) + flight_log_max_value.setToolTipText("TeleMini-v1 stores only one flight"); + else + flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory"); + } + } + + void set_ignite_mode_tool_tip() { + if (ignite_mode_value.isVisible()) + ignite_mode_value.setToolTipText("Select when igniters will be fired"); + else + ignite_mode_value.setToolTipText("Older firmware could not select ignite mode"); + } + + void set_pad_orientation_tool_tip() { + if (pad_orientation_value.isVisible()) + pad_orientation_value.setToolTipText("How will the computer be mounted in the airframe"); + else { + if (is_telemetrum()) + pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward"); + else if (is_telemini() || is_easymini()) + pad_orientation_value.setToolTipText("TeleMini and EasyMini don't care how they are mounted"); + else + pad_orientation_value.setToolTipText("Can't select orientation"); + } + } + + void set_beep_tool_tip() { + if (beep_value.isVisible()) + beep_value.setToolTipText("What frequency the beeper will sound at"); + else + beep_value.setToolTipText("Older firmware could not select beeper frequency"); + } + + /* Build the UI using a grid bag */ + public AltosConfigFCUI(JFrame in_owner, boolean remote) { + super (in_owner, "Configure Flight Computer", false); + + owner = in_owner; + GridBagConstraints c; + int row = 0; + + Insets il = new Insets(4,4,4,4); + Insets ir = new Insets(4,4,4,4); + + pane = getContentPane(); + pane.setLayout(new GridBagLayout()); + + /* Product */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + product_label = new JLabel("Product:"); + pane.add(product_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + product_value = new JLabel(""); + pane.add(product_value, c); + row++; + + /* Version */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + version_label = new JLabel("Software version:"); + pane.add(version_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + version_value = new JLabel(""); + pane.add(version_value, c); + row++; + + /* Serial */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + serial_label = new JLabel("Serial:"); + pane.add(serial_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + serial_value = new JLabel(""); + pane.add(serial_value, c); + row++; + + /* Main deploy */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + main_deploy_label = new JLabel(get_main_deploy_label()); + pane.add(main_deploy_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + main_deploy_value = new JComboBox(main_deploy_values()); + main_deploy_value.setEditable(true); + main_deploy_value.addItemListener(this); + pane.add(main_deploy_value, c); + main_deploy_value.setToolTipText("Height above pad altitude to fire main charge"); + row++; + + /* Apogee delay */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + apogee_delay_label = new JLabel("Apogee Delay(s):"); + pane.add(apogee_delay_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + apogee_delay_value = new JComboBox(apogee_delay_values); + apogee_delay_value.setEditable(true); + apogee_delay_value.addItemListener(this); + pane.add(apogee_delay_value, c); + apogee_delay_value.setToolTipText("Delay after apogee before charge fires"); + row++; + + /* Apogee lockout */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + apogee_lockout_label = new JLabel("Apogee Lockout(s):"); + pane.add(apogee_lockout_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + apogee_lockout_value = new JComboBox(apogee_lockout_values); + apogee_lockout_value.setEditable(true); + apogee_lockout_value.addItemListener(this); + pane.add(apogee_lockout_value, c); + apogee_lockout_value.setToolTipText("Time after boost while apogee detection is locked out"); + row++; + + /* Frequency */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + radio_frequency_label = new JLabel("Frequency:"); + pane.add(radio_frequency_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + radio_frequency_value = new AltosUIFreqList(); + radio_frequency_value.addItemListener(this); + pane.add(radio_frequency_value, c); + radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency"); + row++; + + /* Radio Calibration */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + radio_calibration_label = new JLabel("RF Calibration:"); + pane.add(radio_calibration_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + radio_calibration_value = new JLabel(String.format("%d", 1186611)); + pane.add(radio_calibration_value, c); + row++; + + /* Radio Enable */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + radio_enable_label = new JLabel("Telemetry/RDF/APRS Enable:"); + pane.add(radio_enable_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + radio_enable_value = new JRadioButton("Enabled"); + radio_enable_value.addItemListener(this); + pane.add(radio_enable_value, c); + set_radio_enable_tool_tip(); + row++; + + /* Telemetry Rate */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + rate_label = new JLabel("Telemetry baud rate:"); + pane.add(rate_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + rate_value = new AltosUIRateList(); + rate_value.addItemListener(this); + pane.add(rate_value, c); + set_rate_tool_tip(); + row++; + + /* APRS interval */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + aprs_interval_label = new JLabel("APRS Interval(s):"); + pane.add(aprs_interval_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + aprs_interval_value = new JComboBox(aprs_interval_values); + aprs_interval_value.setEditable(true); + aprs_interval_value.addItemListener(this); + pane.add(aprs_interval_value, c); + set_aprs_interval_tool_tip(); + row++; + + /* APRS SSID */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + aprs_ssid_label = new JLabel("APRS SSID:"); + pane.add(aprs_ssid_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + aprs_ssid_value = new JComboBox(aprs_ssid_values); + aprs_ssid_value.setEditable(false); + aprs_ssid_value.addItemListener(this); + aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length); + pane.add(aprs_ssid_value, c); + set_aprs_ssid_tool_tip(); + row++; + + /* APRS format */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + aprs_format_label = new JLabel("APRS format:"); + pane.add(aprs_format_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + aprs_format_value = new JComboBox(AltosLib.ao_aprs_format_name); + aprs_format_value.setEditable(false); + aprs_format_value.addItemListener(this); + aprs_format_value.setMaximumRowCount(AltosLib.ao_aprs_format_name.length); + pane.add(aprs_format_value, c); + set_aprs_format_tool_tip(); + row++; + + /* Callsign */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + callsign_label = new JLabel("Callsign:"); + pane.add(callsign_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + callsign_value = new JTextField(AltosUIPreferences.callsign()); + callsign_value.getDocument().addDocumentListener(this); + pane.add(callsign_value, c); + callsign_value.setToolTipText("Callsign reported in telemetry data"); + row++; + + /* Flight log max */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + flight_log_max_label = new JLabel("Maximum Flight Log Size (kB):"); + pane.add(flight_log_max_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + flight_log_max_value = new JComboBox(); + flight_log_max_value.setEditable(true); + flight_log_max_value.addItemListener(this); + pane.add(flight_log_max_value, c); + set_flight_log_max_tool_tip(); + row++; + + /* Ignite mode */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + ignite_mode_label = new JLabel("Igniter Firing Mode:"); + pane.add(ignite_mode_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + ignite_mode_value = new JComboBox(ignite_mode_values); + ignite_mode_value.setEditable(false); + ignite_mode_value.addItemListener(this); + pane.add(ignite_mode_value, c); + set_ignite_mode_tool_tip(); + row++; + + /* Pad orientation */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + pad_orientation_label = new JLabel("Pad Orientation:"); + pane.add(pad_orientation_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + pad_orientation_value = new JComboBox(pad_orientation_values); + pad_orientation_value.setEditable(false); + pad_orientation_value.addItemListener(this); + pane.add(pad_orientation_value, c); + set_pad_orientation_tool_tip(); + row++; + + /* Beeper */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + beep_label = new JLabel("Beeper Frequency:"); + pane.add(beep_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + beep_value = new JComboBox(beep_values); + beep_value.setEditable(true); + beep_value.addItemListener(this); + pane.add(beep_value, c); + set_beep_tool_tip(); + row++; + + /* Tracker triger horiz distances */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + tracker_motion_label = new JLabel(get_tracker_motion_label()); + pane.add(tracker_motion_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + tracker_motion_value = new JComboBox(tracker_motion_values()); + tracker_motion_value.setEditable(true); + tracker_motion_value.addItemListener(this); + pane.add(tracker_motion_value, c); + row++; + + /* Tracker triger vert distances */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + tracker_interval_label = new JLabel("Position Reporting Interval(s):"); + pane.add(tracker_interval_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + tracker_interval_value = new JComboBox(tracker_interval_values); + tracker_interval_value.setEditable(true); + tracker_interval_value.addItemListener(this); + pane.add(tracker_interval_value, c); + set_tracker_tool_tip(); + row++; + + /* Pyro channels */ + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + pyro = new JButton("Configure Pyro Channels"); + pane.add(pyro, c); + pyro.addActionListener(this); + pyro.setActionCommand("Pyro"); + row++; + + /* Buttons */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 2; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + save = new JButton("Save"); + pane.add(save, c); + save.addActionListener(this); + save.setActionCommand("Save"); + + c = new GridBagConstraints(); + c.gridx = 2; c.gridy = row; + c.gridwidth = 2; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.CENTER; + c.insets = il; + reset = new JButton("Reset"); + pane.add(reset, c); + reset.addActionListener(this); + reset.setActionCommand("Reset"); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 2; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.CENTER; + c.insets = il; + reboot = new JButton("Reboot"); + pane.add(reboot, c); + reboot.addActionListener(this); + reboot.setActionCommand("Reboot"); + + c = new GridBagConstraints(); + c.gridx = 6; c.gridy = row; + c.gridwidth = 2; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_END; + c.insets = il; + close = new JButton("Close"); + pane.add(close, c); + close.addActionListener(this); + close.setActionCommand("Close"); + + addWindowListener(new ConfigListener(this)); + AltosPreferences.register_units_listener(this); + } + + /* Once the initial values are set, the config code will show the dialog */ + public void make_visible() { + pack(); + setLocationRelativeTo(owner); + setVisible(true); + } + + /* If any values have been changed, confirm before closing */ + public boolean check_dirty(String operation) { + if (dirty) { + Object[] options = { String.format("%s anyway", operation), "Keep editing" }; + int i; + i = JOptionPane.showOptionDialog(this, + String.format("Configuration modified. %s anyway?", operation), + "Configuration Modified", + JOptionPane.DEFAULT_OPTION, + JOptionPane.WARNING_MESSAGE, + null, options, options[1]); + if (i != 0) + return false; + } + return true; + } + + void set_dirty() { + dirty = true; + save.setEnabled(true); + } + + public void set_clean() { + dirty = false; + save.setEnabled(false); + } + + AltosConfigPyroUI pyro_ui; + + public void dispose() { + if (pyro_ui != null) + pyro_ui.dispose(); + AltosPreferences.unregister_units_listener(this); + super.dispose(); + } + + /* Listen for events from our buttons */ + public void actionPerformed(ActionEvent e) { + String cmd = e.getActionCommand(); + + if (cmd.equals("Pyro")) { + if (pyro_ui == null && pyros != null) + pyro_ui = new AltosConfigPyroUI(this, pyros, pyro_firing_time); + if (pyro_ui != null) + pyro_ui.make_visible(); + return; + } + + if (cmd.equals("Close") || cmd.equals("Reboot")) + if (!check_dirty(cmd)) + return; + listener.actionPerformed(e); + if (cmd.equals("Close") || cmd.equals("Reboot")) { + setVisible(false); + dispose(); + } + set_clean(); + } + + /* ItemListener interface method */ + public void itemStateChanged(ItemEvent e) { + set_dirty(); + } + + /* DocumentListener interface methods */ + public void changedUpdate(DocumentEvent e) { + set_dirty(); + } + + public void insertUpdate(DocumentEvent e) { + set_dirty(); + } + + public void removeUpdate(DocumentEvent e) { + set_dirty(); + } + + /* Let the config code hook on a listener */ + public void addActionListener(ActionListener l) { + listener = l; + } + + /* set and get all of the dialog values */ + public void set_product(String product) { + radio_frequency_value.set_product(product); + product_value.setText(product); + set_pad_orientation_tool_tip(); + set_flight_log_max_tool_tip(); + } + + public void set_version(String version) { + version_value.setText(version); + } + + public void set_serial(int serial) { + radio_frequency_value.set_serial(serial); + serial_value.setText(String.format("%d", serial)); + } + + public void set_altitude_32(int altitude_32) { + } + + public void set_main_deploy(int new_main_deploy) { + if (new_main_deploy != AltosLib.MISSING) + main_deploy_value.setSelectedItem(AltosConvert.height.say(new_main_deploy)); + main_deploy_value.setVisible(new_main_deploy != AltosLib.MISSING); + main_deploy_label.setVisible(new_main_deploy != AltosLib.MISSING); + } + + public int main_deploy() throws AltosConfigDataException { + String str = main_deploy_value.getSelectedItem().toString(); + try { + return (int) (AltosConvert.height.parse_locale(str) + 0.5); + } catch (ParseException pe) { + throw new AltosConfigDataException("invalid main deploy height %s", str); + } + } + + String get_main_deploy_label() { + return String.format("Main Deploy Altitude(%s):", AltosConvert.height.parse_units()); + } + + String[] main_deploy_values() { + if (AltosConvert.imperial_units) + return main_deploy_values_ft; + else + return main_deploy_values_m; + } + + void set_main_deploy_values() { + String[] v = main_deploy_values(); + while (main_deploy_value.getItemCount() > 0) + main_deploy_value.removeItemAt(0); + for (int i = 0; i < v.length; i++) + main_deploy_value.addItem(v[i]); + main_deploy_value.setMaximumRowCount(v.length); + } + + public void units_changed(boolean imperial_units) { + boolean was_dirty = dirty; + + String v = main_deploy_value.getSelectedItem().toString(); + main_deploy_label.setText(get_main_deploy_label()); + set_main_deploy_values(); + try { + int m = (int) (AltosConvert.height.parse_locale(v, !imperial_units) + 0.5); + set_main_deploy(m); + } catch (ParseException pe) { + } + + if (tracker_motion_value.isVisible()) { + String motion = tracker_motion_value.getSelectedItem().toString(); + tracker_motion_label.setText(get_tracker_motion_label()); + set_tracker_motion_values(); + try { + int m = (int) (AltosConvert.height.parse_locale(motion, !imperial_units) + 0.5); + set_tracker_motion(m); + } catch (ParseException pe) { + } + } + + if (!was_dirty) + set_clean(); + } + + public void set_apogee_delay(int new_apogee_delay) { + if (new_apogee_delay != AltosLib.MISSING) + apogee_delay_value.setSelectedItem(Integer.toString(new_apogee_delay)); + apogee_delay_value.setVisible(new_apogee_delay != AltosLib.MISSING); + apogee_delay_label.setVisible(new_apogee_delay != AltosLib.MISSING); + } + + private int parse_int(String name, String s, boolean split) throws AltosConfigDataException { + String v = s; + if (split) + v = s.split("\\s+")[0]; + try { + return Integer.parseInt(v); + } catch (NumberFormatException ne) { + throw new AltosConfigDataException("Invalid %s \"%s\"", name, s); + } + } + + public int apogee_delay() throws AltosConfigDataException { + return parse_int("apogee delay", apogee_delay_value.getSelectedItem().toString(), false); + } + + public void set_apogee_lockout(int new_apogee_lockout) { + if (new_apogee_lockout != AltosLib.MISSING) + apogee_lockout_value.setSelectedItem(Integer.toString(new_apogee_lockout)); + + apogee_lockout_value.setVisible(new_apogee_lockout != AltosLib.MISSING); + apogee_lockout_label.setVisible(new_apogee_lockout != AltosLib.MISSING); + } + + public int apogee_lockout() throws AltosConfigDataException { + return parse_int("apogee lockout", apogee_lockout_value.getSelectedItem().toString(), false); + } + + public void set_radio_frequency(double new_radio_frequency) { + if (new_radio_frequency != AltosLib.MISSING) + radio_frequency_value.set_frequency(new_radio_frequency); + radio_frequency_label.setVisible(new_radio_frequency != AltosLib.MISSING); + radio_frequency_value.setVisible(new_radio_frequency != AltosLib.MISSING); + } + + public double radio_frequency() { + return radio_frequency_value.frequency(); + } + + public void set_radio_calibration(int new_radio_calibration) { + if (new_radio_calibration != AltosLib.MISSING) + radio_calibration_value.setText(String.format("%d", new_radio_calibration)); + radio_calibration_value.setVisible(new_radio_calibration != AltosLib.MISSING); + radio_calibration_label.setVisible(new_radio_calibration != AltosLib.MISSING); + } + + public void set_radio_enable(int new_radio_enable) { + if (new_radio_enable != AltosLib.MISSING) + radio_enable_value.setSelected(new_radio_enable != 0); + radio_enable_label.setVisible(new_radio_enable != AltosLib.MISSING); + radio_enable_value.setVisible(new_radio_enable != AltosLib.MISSING); + set_radio_enable_tool_tip(); + } + + public int radio_enable() { + if (radio_enable_value.isVisible()) + return radio_enable_value.isSelected() ? 1 : 0; + else + return AltosLib.MISSING; + } + + public void set_telemetry_rate(int new_rate) { + if (new_rate != AltosLib.MISSING) + rate_value.set_rate(new_rate); + rate_label.setVisible(new_rate != AltosLib.MISSING); + rate_value.setVisible(new_rate != AltosLib.MISSING); + set_rate_tool_tip(); + } + + public int telemetry_rate() { + return rate_value.rate(); + } + + public void set_callsign(String new_callsign) { + if (new_callsign != null) + callsign_value.setText(new_callsign); + callsign_value.setVisible(new_callsign != null); + callsign_label.setVisible(new_callsign != null); + } + + public String callsign() { + if (callsign_value.isVisible()) + return callsign_value.getText(); + return null; + } + + int flight_log_max_limit; + int flight_log_max; + + public String flight_log_max_label(int flight_log_max) { + if (flight_log_max_limit != 0) { + int nflight = flight_log_max_limit / flight_log_max; + String plural = nflight > 1 ? "s" : ""; + + return String.format("%d (%d flight%s)", flight_log_max, nflight, plural); + } + return String.format("%d", flight_log_max); + } + + public void set_flight_log_max(int new_flight_log_max) { + if (new_flight_log_max != AltosLib.MISSING) { + flight_log_max_value.setSelectedItem(flight_log_max_label(new_flight_log_max)); + flight_log_max = new_flight_log_max; + } + flight_log_max_value.setVisible(new_flight_log_max != AltosLib.MISSING); + flight_log_max_label.setVisible(new_flight_log_max != AltosLib.MISSING); + set_flight_log_max_tool_tip(); + } + + public void set_flight_log_max_enabled(boolean enable) { + flight_log_max_value.setEnabled(enable); + set_flight_log_max_tool_tip(); + } + + public int flight_log_max() throws AltosConfigDataException { + if (flight_log_max_value.isVisible()) + return parse_int("flight log max", flight_log_max_value.getSelectedItem().toString(), true); + return AltosLib.MISSING; + } + + public void set_flight_log_max_limit(int new_flight_log_max_limit) { + flight_log_max_limit = new_flight_log_max_limit; + if (new_flight_log_max_limit != AltosLib.MISSING) { + flight_log_max_value.removeAllItems(); + for (int i = 8; i >= 1; i--) { + int size = flight_log_max_limit / i; + flight_log_max_value.addItem(String.format("%d (%d flights)", size, i)); + } + } + if (flight_log_max != 0) + set_flight_log_max(flight_log_max); + } + + public void set_ignite_mode(int new_ignite_mode) { + if (new_ignite_mode != AltosLib.MISSING) { + if (new_ignite_mode >= ignite_mode_values.length) + new_ignite_mode = 0; + if (new_ignite_mode < 0) { + ignite_mode_value.setEnabled(false); + new_ignite_mode = 0; + } else { + ignite_mode_value.setEnabled(true); + } + ignite_mode_value.setSelectedIndex(new_ignite_mode); + } + ignite_mode_value.setVisible(new_ignite_mode != AltosLib.MISSING); + ignite_mode_label.setVisible(new_ignite_mode != AltosLib.MISSING); + + set_ignite_mode_tool_tip(); + } + + public int ignite_mode() { + if (ignite_mode_value.isVisible()) + return ignite_mode_value.getSelectedIndex(); + else + return AltosLib.MISSING; + } + + + public void set_pad_orientation(int new_pad_orientation) { + if (new_pad_orientation != AltosLib.MISSING) { + if (new_pad_orientation >= pad_orientation_values.length) + new_pad_orientation = 0; + if (new_pad_orientation < 0) + new_pad_orientation = 0; + pad_orientation_value.setSelectedIndex(new_pad_orientation); + } + pad_orientation_value.setVisible(new_pad_orientation != AltosLib.MISSING); + pad_orientation_label.setVisible(new_pad_orientation != AltosLib.MISSING); + + set_pad_orientation_tool_tip(); + } + + public int pad_orientation() { + if (pad_orientation_value.isVisible()) + return pad_orientation_value.getSelectedIndex(); + else + return AltosLib.MISSING; + } + + public void set_beep(int new_beep) { + if (new_beep != AltosLib.MISSING) { + int new_freq = (int) Math.floor (AltosConvert.beep_value_to_freq(new_beep) + 0.5); + for (int i = 0; i < beep_values.length; i++) + if (new_beep == AltosConvert.beep_freq_to_value(Integer.parseInt(beep_values[i]))) { + beep_value.setSelectedIndex(i); + set_beep_tool_tip(); + return; + } + beep_value.setSelectedItem(String.format("%d", new_freq)); + } + beep_value.setVisible(new_beep != AltosLib.MISSING); + beep_label.setVisible(new_beep != AltosLib.MISSING); + set_beep_tool_tip(); + } + + public int beep() { + if (beep_value.isVisible()) + return AltosConvert.beep_freq_to_value(Integer.parseInt(beep_value.getSelectedItem().toString())); + else + return AltosLib.MISSING; + } + + String[] tracker_motion_values() { + if (AltosConvert.imperial_units) + return tracker_motion_values_ft; + else + return tracker_motion_values_m; + } + + void set_tracker_motion_values() { + String[] v = tracker_motion_values(); + while (tracker_motion_value.getItemCount() > 0) + tracker_motion_value.removeItemAt(0); + for (int i = 0; i < v.length; i++) + tracker_motion_value.addItem(v[i]); + tracker_motion_value.setMaximumRowCount(v.length); + } + + String get_tracker_motion_label() { + return String.format("Logging Trigger Motion (%s):", AltosConvert.height.parse_units()); + } + + void set_tracker_tool_tip() { + if (tracker_motion_value.isVisible()) + tracker_motion_value.setToolTipText("How far the device must move before logging"); + else + tracker_motion_value.setToolTipText("This device doesn't disable logging when stationary"); + if (tracker_interval_value.isVisible()) + tracker_interval_value.setToolTipText("How often to report GPS position"); + else + tracker_interval_value.setToolTipText("This device can't configure interval"); + } + + public void set_tracker_motion(int tracker_motion) { + if (tracker_motion != AltosLib.MISSING) + tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion)); + tracker_motion_label.setVisible(tracker_motion != AltosLib.MISSING); + tracker_motion_value.setVisible(tracker_motion != AltosLib.MISSING); + } + + public int tracker_motion() throws AltosConfigDataException { + if (tracker_motion_value.isVisible()) { + String str = tracker_motion_value.getSelectedItem().toString(); + try { + return (int) (AltosConvert.height.parse_locale(str) + 0.5); + } catch (ParseException pe) { + throw new AltosConfigDataException("invalid tracker motion %s", str); + } + } + return AltosLib.MISSING; + } + + public void set_tracker_interval(int tracker_interval) { + if (tracker_interval != AltosLib.MISSING) + tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval)); + tracker_interval_label.setVisible(tracker_interval != AltosLib.MISSING); + tracker_interval_value.setVisible(tracker_interval != AltosLib.MISSING); + } + + public int tracker_interval() throws AltosConfigDataException { + if (tracker_interval_value.isVisible()) + return parse_int ("tracker interval", tracker_interval_value.getSelectedItem().toString(), false); + return AltosLib.MISSING; + } + + public void set_pyros(AltosPyro[] new_pyros) { + pyros = new_pyros; + if (pyros != null && pyro_ui != null) + pyro_ui.set_pyros(pyros); + pyro.setVisible(pyros != null); + } + + public AltosPyro[] pyros() throws AltosConfigDataException { + if (pyro_ui != null) + pyros = pyro_ui.get_pyros(); + return pyros; + } + + public void set_pyro_firing_time(double new_pyro_firing_time) { + pyro_firing_time = new_pyro_firing_time; + if (pyro_firing_time != AltosLib.MISSING && pyro_ui != null) + pyro_ui.set_pyro_firing_time(pyro_firing_time); + pyro.setVisible(pyro_firing_time != AltosLib.MISSING); + } + + public double pyro_firing_time() throws AltosConfigDataException { + if (pyro_ui != null) + pyro_firing_time = pyro_ui.get_pyro_firing_time(); + return pyro_firing_time; + } + + public void set_aprs_interval(int new_aprs_interval) { + if (new_aprs_interval != AltosLib.MISSING) + aprs_interval_value.setSelectedItem(Integer.toString(new_aprs_interval)); + aprs_interval_value.setVisible(new_aprs_interval != AltosLib.MISSING); + aprs_interval_label.setVisible(new_aprs_interval != AltosLib.MISSING); + set_aprs_interval_tool_tip(); + } + + public int aprs_interval() throws AltosConfigDataException { + if (aprs_interval_value.isVisible()) { + String s = aprs_interval_value.getSelectedItem().toString(); + + return parse_int("aprs interval", s, false); + } + return AltosLib.MISSING; + } + + public void set_aprs_ssid(int new_aprs_ssid) { + if (new_aprs_ssid != AltosLib.MISSING) + aprs_ssid_value.setSelectedItem(new_aprs_ssid); + aprs_ssid_value.setVisible(new_aprs_ssid != AltosLib.MISSING); + aprs_ssid_label.setVisible(new_aprs_ssid != AltosLib.MISSING); + set_aprs_ssid_tool_tip(); + } + + public int aprs_ssid() throws AltosConfigDataException { + if (aprs_ssid_value.isVisible()) { + Integer i = (Integer) aprs_ssid_value.getSelectedItem(); + return i; + } + return AltosLib.MISSING; + } + + public void set_aprs_format(int new_aprs_format) { + if (new_aprs_format != AltosLib.MISSING) + aprs_format_value.setSelectedIndex(new_aprs_format); + aprs_format_value.setVisible(new_aprs_format != AltosLib.MISSING); + aprs_format_label.setVisible(new_aprs_format != AltosLib.MISSING); + set_aprs_format_tool_tip(); + } + + public int aprs_format() throws AltosConfigDataException { + if (aprs_format_value.isVisible()) + return aprs_format_value.getSelectedIndex(); + return AltosLib.MISSING; + } +} diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java index 5016ea63..cd887c00 100644 --- a/altosui/AltosConfigPyroUI.java +++ b/altosui/AltosConfigPyroUI.java @@ -30,7 +30,7 @@ public class AltosConfigPyroUI extends AltosUIDialog implements ItemListener, DocumentListener, AltosUnitsListener, ActionListener { - AltosConfigUI owner; + AltosConfigFCUI owner; Container pane; static Insets il = new Insets(4,4,4,4); @@ -347,9 +347,9 @@ public class AltosConfigPyroUI /* A window listener to catch closing events and tell the config code */ class ConfigListener extends WindowAdapter { AltosConfigPyroUI ui; - AltosConfigUI owner; + AltosConfigFCUI owner; - public ConfigListener(AltosConfigPyroUI this_ui, AltosConfigUI this_owner) { + public ConfigListener(AltosConfigPyroUI this_ui, AltosConfigFCUI this_owner) { ui = this_ui; owner = this_owner; } @@ -367,7 +367,7 @@ public class AltosConfigPyroUI setVisible(false); } - public AltosConfigPyroUI(AltosConfigUI in_owner, AltosPyro[] pyros, double pyro_firing_time) { + public AltosConfigPyroUI(AltosConfigFCUI in_owner, AltosPyro[] pyros, double pyro_firing_time) { super(in_owner, "Configure Pyro Channels", false); diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java deleted file mode 100644 index 270131b8..00000000 --- a/altosui/AltosConfigUI.java +++ /dev/null @@ -1,1368 +0,0 @@ -/* - * Copyright © 2010 Keith Packard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package altosui; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.event.*; -import java.text.*; -import org.altusmetrum.altoslib_12.*; -import org.altusmetrum.altosuilib_12.*; - -public class AltosConfigUI - extends AltosUIDialog - implements ActionListener, ItemListener, DocumentListener, AltosConfigValues, AltosUnitsListener -{ - - Container pane; - JLabel product_label; - JLabel version_label; - JLabel serial_label; - JLabel main_deploy_label; - JLabel apogee_delay_label; - JLabel apogee_lockout_label; - JLabel frequency_label; - JLabel radio_calibration_label; - JLabel radio_frequency_label; - JLabel radio_enable_label; - JLabel rate_label; - JLabel aprs_interval_label; - JLabel aprs_ssid_label; - JLabel aprs_format_label; - JLabel flight_log_max_label; - JLabel ignite_mode_label; - JLabel pad_orientation_label; - JLabel callsign_label; - JLabel beep_label; - JLabel tracker_motion_label; - JLabel tracker_interval_label; - - public boolean dirty; - - JFrame owner; - JLabel product_value; - JLabel version_value; - JLabel serial_value; - JComboBox main_deploy_value; - JComboBox apogee_delay_value; - JComboBox apogee_lockout_value; - AltosUIFreqList radio_frequency_value; - JLabel radio_calibration_value; - JRadioButton radio_enable_value; - AltosUIRateList rate_value; - JComboBox aprs_interval_value; - JComboBox aprs_ssid_value; - JComboBox aprs_format_value; - JComboBox flight_log_max_value; - JComboBox ignite_mode_value; - JComboBox pad_orientation_value; - JTextField callsign_value; - JComboBox beep_value; - JComboBox tracker_motion_value; - JComboBox tracker_interval_value; - - JButton pyro; - - JButton save; - JButton reset; - JButton reboot; - JButton close; - - AltosPyro[] pyros; - double pyro_firing_time; - - ActionListener listener; - - static String[] main_deploy_values_m = { - "100", "150", "200", "250", "300", "350", - "400", "450", "500" - }; - - static String[] main_deploy_values_ft = { - "250", "500", "750", "1000", "1250", "1500", - "1750", "2000" - }; - - static String[] apogee_delay_values = { - "0", "1", "2", "3", "4", "5" - }; - - static String[] apogee_lockout_values = { - "0", "5", "10", "15", "20" - }; - - static String[] ignite_mode_values = { - "Dual Deploy", - "Redundant Apogee", - "Redundant Main", - }; - - static String[] aprs_interval_values = { - "Disabled", - "2", - "5", - "10" - }; - - static Integer[] aprs_ssid_values = { - 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 - }; - - static String[] beep_values = { - "3750", - "4000", - "4250", - }; - - static String[] pad_orientation_values = { - "Antenna Up", - "Antenna Down", - }; - - static String[] tracker_motion_values_m = { - "2", - "5", - "10", - "25", - }; - - static String[] tracker_motion_values_ft = { - "5", - "20", - "50", - "100" - }; - - static String[] tracker_interval_values = { - "1", - "2", - "5", - "10" - }; - - /* A window listener to catch closing events and tell the config code */ - class ConfigListener extends WindowAdapter { - AltosConfigUI ui; - - public ConfigListener(AltosConfigUI this_ui) { - ui = this_ui; - } - - public void windowClosing(WindowEvent e) { - ui.actionPerformed(new ActionEvent(e.getSource(), - ActionEvent.ACTION_PERFORMED, - "Close")); - } - } - - boolean is_telemini_v1() { - String product = product_value.getText(); - return product != null && product.startsWith("TeleMini-v1"); - } - - boolean is_telemini() { - String product = product_value.getText(); - return product != null && product.startsWith("TeleMini"); - } - - boolean is_easymini() { - String product = product_value.getText(); - return product != null && product.startsWith("EasyMini"); - } - - boolean is_telemetrum() { - String product = product_value.getText(); - return product != null && product.startsWith("TeleMetrum"); - } - - void set_radio_enable_tool_tip() { - if (radio_enable_value.isVisible()) - radio_enable_value.setToolTipText("Enable/Disable telemetry and RDF transmissions"); - else - radio_enable_value.setToolTipText("Firmware version does not support disabling radio"); - } - - void set_rate_tool_tip() { - if (rate_value.isVisible()) - rate_value.setToolTipText("Select telemetry baud rate"); - else - rate_value.setToolTipText("Firmware version does not support variable telemetry rates"); - } - - void set_aprs_interval_tool_tip() { - if (aprs_interval_value.isVisible()) - aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports"); - else - aprs_interval_value.setToolTipText("Hardware doesn't support APRS"); - } - - void set_aprs_ssid_tool_tip() { - if (aprs_ssid_value.isVisible()) - aprs_ssid_value.setToolTipText("Set the APRS SSID (secondary station identifier)"); - else if (aprs_ssid_value.isVisible()) - aprs_ssid_value.setToolTipText("Software version doesn't support setting the APRS SSID"); - else - aprs_ssid_value.setToolTipText("Hardware doesn't support APRS"); - } - - void set_aprs_format_tool_tip() { - if (aprs_format_value.isVisible()) - aprs_format_value.setToolTipText("Set the APRS format (compressed/uncompressed)"); - else if (aprs_format_value.isVisible()) - aprs_format_value.setToolTipText("Software version doesn't support setting the APRS format"); - else - aprs_format_value.setToolTipText("Hardware doesn't support APRS"); - } - - void set_flight_log_max_tool_tip() { - if (flight_log_max_value.isVisible()) - flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)"); - else { - if (is_telemini_v1()) - flight_log_max_value.setToolTipText("TeleMini-v1 stores only one flight"); - else - flight_log_max_value.setToolTipText("Cannot set max value with flight logs in memory"); - } - } - - void set_ignite_mode_tool_tip() { - if (ignite_mode_value.isVisible()) - ignite_mode_value.setToolTipText("Select when igniters will be fired"); - else - ignite_mode_value.setToolTipText("Older firmware could not select ignite mode"); - } - - void set_pad_orientation_tool_tip() { - if (pad_orientation_value.isVisible()) - pad_orientation_value.setToolTipText("How will the computer be mounted in the airframe"); - else { - if (is_telemetrum()) - pad_orientation_value.setToolTipText("Older TeleMetrum firmware must fly antenna forward"); - else if (is_telemini() || is_easymini()) - pad_orientation_value.setToolTipText("TeleMini and EasyMini don't care how they are mounted"); - else - pad_orientation_value.setToolTipText("Can't select orientation"); - } - } - - void set_beep_tool_tip() { - if (beep_value.isVisible()) - beep_value.setToolTipText("What frequency the beeper will sound at"); - else - beep_value.setToolTipText("Older firmware could not select beeper frequency"); - } - - /* Build the UI using a grid bag */ - public AltosConfigUI(JFrame in_owner, boolean remote) { - super (in_owner, "Configure Flight Computer", false); - - owner = in_owner; - GridBagConstraints c; - int row = 0; - - Insets il = new Insets(4,4,4,4); - Insets ir = new Insets(4,4,4,4); - - pane = getContentPane(); - pane.setLayout(new GridBagLayout()); - - /* Product */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - product_label = new JLabel("Product:"); - pane.add(product_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - product_value = new JLabel(""); - pane.add(product_value, c); - row++; - - /* Version */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - version_label = new JLabel("Software version:"); - pane.add(version_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - version_value = new JLabel(""); - pane.add(version_value, c); - row++; - - /* Serial */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - serial_label = new JLabel("Serial:"); - pane.add(serial_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - serial_value = new JLabel(""); - pane.add(serial_value, c); - row++; - - /* Main deploy */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - main_deploy_label = new JLabel(get_main_deploy_label()); - pane.add(main_deploy_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - main_deploy_value = new JComboBox(main_deploy_values()); - main_deploy_value.setEditable(true); - main_deploy_value.addItemListener(this); - pane.add(main_deploy_value, c); - main_deploy_value.setToolTipText("Height above pad altitude to fire main charge"); - row++; - - /* Apogee delay */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - apogee_delay_label = new JLabel("Apogee Delay(s):"); - pane.add(apogee_delay_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - apogee_delay_value = new JComboBox(apogee_delay_values); - apogee_delay_value.setEditable(true); - apogee_delay_value.addItemListener(this); - pane.add(apogee_delay_value, c); - apogee_delay_value.setToolTipText("Delay after apogee before charge fires"); - row++; - - /* Apogee lockout */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - apogee_lockout_label = new JLabel("Apogee Lockout(s):"); - pane.add(apogee_lockout_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - apogee_lockout_value = new JComboBox(apogee_lockout_values); - apogee_lockout_value.setEditable(true); - apogee_lockout_value.addItemListener(this); - pane.add(apogee_lockout_value, c); - apogee_lockout_value.setToolTipText("Time after boost while apogee detection is locked out"); - row++; - - /* Frequency */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - radio_frequency_label = new JLabel("Frequency:"); - pane.add(radio_frequency_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - radio_frequency_value = new AltosUIFreqList(); - radio_frequency_value.addItemListener(this); - pane.add(radio_frequency_value, c); - radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency"); - row++; - - /* Radio Calibration */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - radio_calibration_label = new JLabel("RF Calibration:"); - pane.add(radio_calibration_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - radio_calibration_value = new JLabel(String.format("%d", 1186611)); - pane.add(radio_calibration_value, c); - row++; - - /* Radio Enable */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - radio_enable_label = new JLabel("Telemetry/RDF/APRS Enable:"); - pane.add(radio_enable_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - radio_enable_value = new JRadioButton("Enabled"); - radio_enable_value.addItemListener(this); - pane.add(radio_enable_value, c); - set_radio_enable_tool_tip(); - row++; - - /* Telemetry Rate */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - rate_label = new JLabel("Telemetry baud rate:"); - pane.add(rate_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - rate_value = new AltosUIRateList(); - rate_value.addItemListener(this); - pane.add(rate_value, c); - set_rate_tool_tip(); - row++; - - /* APRS interval */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - aprs_interval_label = new JLabel("APRS Interval(s):"); - pane.add(aprs_interval_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - aprs_interval_value = new JComboBox(aprs_interval_values); - aprs_interval_value.setEditable(true); - aprs_interval_value.addItemListener(this); - pane.add(aprs_interval_value, c); - set_aprs_interval_tool_tip(); - row++; - - /* APRS SSID */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - aprs_ssid_label = new JLabel("APRS SSID:"); - pane.add(aprs_ssid_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - aprs_ssid_value = new JComboBox(aprs_ssid_values); - aprs_ssid_value.setEditable(false); - aprs_ssid_value.addItemListener(this); - aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length); - pane.add(aprs_ssid_value, c); - set_aprs_ssid_tool_tip(); - row++; - - /* APRS format */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - aprs_format_label = new JLabel("APRS format:"); - pane.add(aprs_format_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - aprs_format_value = new JComboBox(AltosLib.ao_aprs_format_name); - aprs_format_value.setEditable(false); - aprs_format_value.addItemListener(this); - aprs_format_value.setMaximumRowCount(AltosLib.ao_aprs_format_name.length); - pane.add(aprs_format_value, c); - set_aprs_format_tool_tip(); - row++; - - /* Callsign */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - callsign_label = new JLabel("Callsign:"); - pane.add(callsign_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - callsign_value = new JTextField(AltosUIPreferences.callsign()); - callsign_value.getDocument().addDocumentListener(this); - pane.add(callsign_value, c); - callsign_value.setToolTipText("Callsign reported in telemetry data"); - row++; - - /* Flight log max */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - flight_log_max_label = new JLabel("Maximum Flight Log Size (kB):"); - pane.add(flight_log_max_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - flight_log_max_value = new JComboBox(); - flight_log_max_value.setEditable(true); - flight_log_max_value.addItemListener(this); - pane.add(flight_log_max_value, c); - set_flight_log_max_tool_tip(); - row++; - - /* Ignite mode */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - ignite_mode_label = new JLabel("Igniter Firing Mode:"); - pane.add(ignite_mode_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - ignite_mode_value = new JComboBox(ignite_mode_values); - ignite_mode_value.setEditable(false); - ignite_mode_value.addItemListener(this); - pane.add(ignite_mode_value, c); - set_ignite_mode_tool_tip(); - row++; - - /* Pad orientation */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - pad_orientation_label = new JLabel("Pad Orientation:"); - pane.add(pad_orientation_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - pad_orientation_value = new JComboBox(pad_orientation_values); - pad_orientation_value.setEditable(false); - pad_orientation_value.addItemListener(this); - pane.add(pad_orientation_value, c); - set_pad_orientation_tool_tip(); - row++; - - /* Beeper */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - beep_label = new JLabel("Beeper Frequency:"); - pane.add(beep_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - beep_value = new JComboBox(beep_values); - beep_value.setEditable(true); - beep_value.addItemListener(this); - pane.add(beep_value, c); - set_beep_tool_tip(); - row++; - - /* Tracker triger horiz distances */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - tracker_motion_label = new JLabel(get_tracker_motion_label()); - pane.add(tracker_motion_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - tracker_motion_value = new JComboBox(tracker_motion_values()); - tracker_motion_value.setEditable(true); - tracker_motion_value.addItemListener(this); - pane.add(tracker_motion_value, c); - row++; - - /* Tracker triger vert distances */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - tracker_interval_label = new JLabel("Position Reporting Interval(s):"); - pane.add(tracker_interval_label, c); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.weightx = 1; - c.anchor = GridBagConstraints.LINE_START; - c.insets = ir; - c.ipady = 5; - tracker_interval_value = new JComboBox(tracker_interval_values); - tracker_interval_value.setEditable(true); - tracker_interval_value.addItemListener(this); - pane.add(tracker_interval_value, c); - set_tracker_tool_tip(); - row++; - - /* Pyro channels */ - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 4; - c.fill = GridBagConstraints.HORIZONTAL; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - c.ipady = 5; - pyro = new JButton("Configure Pyro Channels"); - pane.add(pyro, c); - pyro.addActionListener(this); - pyro.setActionCommand("Pyro"); - row++; - - /* Buttons */ - c = new GridBagConstraints(); - c.gridx = 0; c.gridy = row; - c.gridwidth = 2; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_START; - c.insets = il; - save = new JButton("Save"); - pane.add(save, c); - save.addActionListener(this); - save.setActionCommand("Save"); - - c = new GridBagConstraints(); - c.gridx = 2; c.gridy = row; - c.gridwidth = 2; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.CENTER; - c.insets = il; - reset = new JButton("Reset"); - pane.add(reset, c); - reset.addActionListener(this); - reset.setActionCommand("Reset"); - - c = new GridBagConstraints(); - c.gridx = 4; c.gridy = row; - c.gridwidth = 2; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.CENTER; - c.insets = il; - reboot = new JButton("Reboot"); - pane.add(reboot, c); - reboot.addActionListener(this); - reboot.setActionCommand("Reboot"); - - c = new GridBagConstraints(); - c.gridx = 6; c.gridy = row; - c.gridwidth = 2; - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.LINE_END; - c.insets = il; - close = new JButton("Close"); - pane.add(close, c); - close.addActionListener(this); - close.setActionCommand("Close"); - - addWindowListener(new ConfigListener(this)); - AltosPreferences.register_units_listener(this); - } - - /* Once the initial values are set, the config code will show the dialog */ - public void make_visible() { - pack(); - setLocationRelativeTo(owner); - setVisible(true); - } - - /* If any values have been changed, confirm before closing */ - public boolean check_dirty(String operation) { - if (dirty) { - Object[] options = { String.format("%s anyway", operation), "Keep editing" }; - int i; - i = JOptionPane.showOptionDialog(this, - String.format("Configuration modified. %s anyway?", operation), - "Configuration Modified", - JOptionPane.DEFAULT_OPTION, - JOptionPane.WARNING_MESSAGE, - null, options, options[1]); - if (i != 0) - return false; - } - return true; - } - - void set_dirty() { - dirty = true; - save.setEnabled(true); - } - - public void set_clean() { - dirty = false; - save.setEnabled(false); - } - - AltosConfigPyroUI pyro_ui; - - public void dispose() { - if (pyro_ui != null) - pyro_ui.dispose(); - AltosPreferences.unregister_units_listener(this); - super.dispose(); - } - - /* Listen for events from our buttons */ - public void actionPerformed(ActionEvent e) { - String cmd = e.getActionCommand(); - - if (cmd.equals("Pyro")) { - if (pyro_ui == null && pyros != null) - pyro_ui = new AltosConfigPyroUI(this, pyros, pyro_firing_time); - if (pyro_ui != null) - pyro_ui.make_visible(); - return; - } - - if (cmd.equals("Close") || cmd.equals("Reboot")) - if (!check_dirty(cmd)) - return; - listener.actionPerformed(e); - if (cmd.equals("Close") || cmd.equals("Reboot")) { - setVisible(false); - dispose(); - } - set_clean(); - } - - /* ItemListener interface method */ - public void itemStateChanged(ItemEvent e) { - set_dirty(); - } - - /* DocumentListener interface methods */ - public void changedUpdate(DocumentEvent e) { - set_dirty(); - } - - public void insertUpdate(DocumentEvent e) { - set_dirty(); - } - - public void removeUpdate(DocumentEvent e) { - set_dirty(); - } - - /* Let the config code hook on a listener */ - public void addActionListener(ActionListener l) { - listener = l; - } - - /* set and get all of the dialog values */ - public void set_product(String product) { - radio_frequency_value.set_product(product); - product_value.setText(product); - set_pad_orientation_tool_tip(); - set_flight_log_max_tool_tip(); - } - - public void set_version(String version) { - version_value.setText(version); - } - - public void set_serial(int serial) { - radio_frequency_value.set_serial(serial); - serial_value.setText(String.format("%d", serial)); - } - - public void set_altitude_32(int altitude_32) { - } - - public void set_main_deploy(int new_main_deploy) { - if (new_main_deploy != AltosLib.MISSING) - main_deploy_value.setSelectedItem(AltosConvert.height.say(new_main_deploy)); - main_deploy_value.setVisible(new_main_deploy != AltosLib.MISSING); - main_deploy_label.setVisible(new_main_deploy != AltosLib.MISSING); - } - - public int main_deploy() throws AltosConfigDataException { - String str = main_deploy_value.getSelectedItem().toString(); - try { - return (int) (AltosConvert.height.parse_locale(str) + 0.5); - } catch (ParseException pe) { - throw new AltosConfigDataException("invalid main deploy height %s", str); - } - } - - String get_main_deploy_label() { - return String.format("Main Deploy Altitude(%s):", AltosConvert.height.parse_units()); - } - - String[] main_deploy_values() { - if (AltosConvert.imperial_units) - return main_deploy_values_ft; - else - return main_deploy_values_m; - } - - void set_main_deploy_values() { - String[] v = main_deploy_values(); - while (main_deploy_value.getItemCount() > 0) - main_deploy_value.removeItemAt(0); - for (int i = 0; i < v.length; i++) - main_deploy_value.addItem(v[i]); - main_deploy_value.setMaximumRowCount(v.length); - } - - public void units_changed(boolean imperial_units) { - boolean was_dirty = dirty; - - String v = main_deploy_value.getSelectedItem().toString(); - main_deploy_label.setText(get_main_deploy_label()); - set_main_deploy_values(); - try { - int m = (int) (AltosConvert.height.parse_locale(v, !imperial_units) + 0.5); - set_main_deploy(m); - } catch (ParseException pe) { - } - - if (tracker_motion_value.isVisible()) { - String motion = tracker_motion_value.getSelectedItem().toString(); - tracker_motion_label.setText(get_tracker_motion_label()); - set_tracker_motion_values(); - try { - int m = (int) (AltosConvert.height.parse_locale(motion, !imperial_units) + 0.5); - set_tracker_motion(m); - } catch (ParseException pe) { - } - } - - if (!was_dirty) - set_clean(); - } - - public void set_apogee_delay(int new_apogee_delay) { - if (new_apogee_delay != AltosLib.MISSING) - apogee_delay_value.setSelectedItem(Integer.toString(new_apogee_delay)); - apogee_delay_value.setVisible(new_apogee_delay != AltosLib.MISSING); - apogee_delay_label.setVisible(new_apogee_delay != AltosLib.MISSING); - } - - private int parse_int(String name, String s, boolean split) throws AltosConfigDataException { - String v = s; - if (split) - v = s.split("\\s+")[0]; - try { - return Integer.parseInt(v); - } catch (NumberFormatException ne) { - throw new AltosConfigDataException("Invalid %s \"%s\"", name, s); - } - } - - public int apogee_delay() throws AltosConfigDataException { - return parse_int("apogee delay", apogee_delay_value.getSelectedItem().toString(), false); - } - - public void set_apogee_lockout(int new_apogee_lockout) { - if (new_apogee_lockout != AltosLib.MISSING) - apogee_lockout_value.setSelectedItem(Integer.toString(new_apogee_lockout)); - - apogee_lockout_value.setVisible(new_apogee_lockout != AltosLib.MISSING); - apogee_lockout_label.setVisible(new_apogee_lockout != AltosLib.MISSING); - } - - public int apogee_lockout() throws AltosConfigDataException { - return parse_int("apogee lockout", apogee_lockout_value.getSelectedItem().toString(), false); - } - - public void set_radio_frequency(double new_radio_frequency) { - if (new_radio_frequency != AltosLib.MISSING) - radio_frequency_value.set_frequency(new_radio_frequency); - radio_frequency_label.setVisible(new_radio_frequency != AltosLib.MISSING); - radio_frequency_value.setVisible(new_radio_frequency != AltosLib.MISSING); - } - - public double radio_frequency() { - return radio_frequency_value.frequency(); - } - - public void set_radio_calibration(int new_radio_calibration) { - if (new_radio_calibration != AltosLib.MISSING) - radio_calibration_value.setText(String.format("%d", new_radio_calibration)); - radio_calibration_value.setVisible(new_radio_calibration != AltosLib.MISSING); - radio_calibration_label.setVisible(new_radio_calibration != AltosLib.MISSING); - } - - public void set_radio_enable(int new_radio_enable) { - if (new_radio_enable != AltosLib.MISSING) - radio_enable_value.setSelected(new_radio_enable != 0); - radio_enable_label.setVisible(new_radio_enable != AltosLib.MISSING); - radio_enable_value.setVisible(new_radio_enable != AltosLib.MISSING); - set_radio_enable_tool_tip(); - } - - public int radio_enable() { - if (radio_enable_value.isVisible()) - return radio_enable_value.isSelected() ? 1 : 0; - else - return AltosLib.MISSING; - } - - public void set_telemetry_rate(int new_rate) { - if (new_rate != AltosLib.MISSING) - rate_value.set_rate(new_rate); - rate_label.setVisible(new_rate != AltosLib.MISSING); - rate_value.setVisible(new_rate != AltosLib.MISSING); - set_rate_tool_tip(); - } - - public int telemetry_rate() { - return rate_value.rate(); - } - - public void set_callsign(String new_callsign) { - if (new_callsign != null) - callsign_value.setText(new_callsign); - callsign_value.setVisible(new_callsign != null); - callsign_label.setVisible(new_callsign != null); - } - - public String callsign() { - if (callsign_value.isVisible()) - return callsign_value.getText(); - return null; - } - - int flight_log_max_limit; - int flight_log_max; - - public String flight_log_max_label(int flight_log_max) { - if (flight_log_max_limit != 0) { - int nflight = flight_log_max_limit / flight_log_max; - String plural = nflight > 1 ? "s" : ""; - - return String.format("%d (%d flight%s)", flight_log_max, nflight, plural); - } - return String.format("%d", flight_log_max); - } - - public void set_flight_log_max(int new_flight_log_max) { - if (new_flight_log_max != AltosLib.MISSING) { - flight_log_max_value.setSelectedItem(flight_log_max_label(new_flight_log_max)); - flight_log_max = new_flight_log_max; - } - flight_log_max_value.setVisible(new_flight_log_max != AltosLib.MISSING); - flight_log_max_label.setVisible(new_flight_log_max != AltosLib.MISSING); - set_flight_log_max_tool_tip(); - } - - public void set_flight_log_max_enabled(boolean enable) { - flight_log_max_value.setEnabled(enable); - set_flight_log_max_tool_tip(); - } - - public int flight_log_max() throws AltosConfigDataException { - if (flight_log_max_value.isVisible()) - return parse_int("flight log max", flight_log_max_value.getSelectedItem().toString(), true); - return AltosLib.MISSING; - } - - public void set_flight_log_max_limit(int new_flight_log_max_limit) { - flight_log_max_limit = new_flight_log_max_limit; - if (new_flight_log_max_limit != AltosLib.MISSING) { - flight_log_max_value.removeAllItems(); - for (int i = 8; i >= 1; i--) { - int size = flight_log_max_limit / i; - flight_log_max_value.addItem(String.format("%d (%d flights)", size, i)); - } - } - if (flight_log_max != 0) - set_flight_log_max(flight_log_max); - } - - public void set_ignite_mode(int new_ignite_mode) { - if (new_ignite_mode != AltosLib.MISSING) { - if (new_ignite_mode >= ignite_mode_values.length) - new_ignite_mode = 0; - if (new_ignite_mode < 0) { - ignite_mode_value.setEnabled(false); - new_ignite_mode = 0; - } else { - ignite_mode_value.setEnabled(true); - } - ignite_mode_value.setSelectedIndex(new_ignite_mode); - } - ignite_mode_value.setVisible(new_ignite_mode != AltosLib.MISSING); - ignite_mode_label.setVisible(new_ignite_mode != AltosLib.MISSING); - - set_ignite_mode_tool_tip(); - } - - public int ignite_mode() { - if (ignite_mode_value.isVisible()) - return ignite_mode_value.getSelectedIndex(); - else - return AltosLib.MISSING; - } - - - public void set_pad_orientation(int new_pad_orientation) { - if (new_pad_orientation != AltosLib.MISSING) { - if (new_pad_orientation >= pad_orientation_values.length) - new_pad_orientation = 0; - if (new_pad_orientation < 0) - new_pad_orientation = 0; - pad_orientation_value.setSelectedIndex(new_pad_orientation); - } - pad_orientation_value.setVisible(new_pad_orientation != AltosLib.MISSING); - pad_orientation_label.setVisible(new_pad_orientation != AltosLib.MISSING); - - set_pad_orientation_tool_tip(); - } - - public int pad_orientation() { - if (pad_orientation_value.isVisible()) - return pad_orientation_value.getSelectedIndex(); - else - return AltosLib.MISSING; - } - - public void set_beep(int new_beep) { - if (new_beep != AltosLib.MISSING) { - int new_freq = (int) Math.floor (AltosConvert.beep_value_to_freq(new_beep) + 0.5); - for (int i = 0; i < beep_values.length; i++) - if (new_beep == AltosConvert.beep_freq_to_value(Integer.parseInt(beep_values[i]))) { - beep_value.setSelectedIndex(i); - set_beep_tool_tip(); - return; - } - beep_value.setSelectedItem(String.format("%d", new_freq)); - } - beep_value.setVisible(new_beep != AltosLib.MISSING); - beep_label.setVisible(new_beep != AltosLib.MISSING); - set_beep_tool_tip(); - } - - public int beep() { - if (beep_value.isVisible()) - return AltosConvert.beep_freq_to_value(Integer.parseInt(beep_value.getSelectedItem().toString())); - else - return AltosLib.MISSING; - } - - String[] tracker_motion_values() { - if (AltosConvert.imperial_units) - return tracker_motion_values_ft; - else - return tracker_motion_values_m; - } - - void set_tracker_motion_values() { - String[] v = tracker_motion_values(); - while (tracker_motion_value.getItemCount() > 0) - tracker_motion_value.removeItemAt(0); - for (int i = 0; i < v.length; i++) - tracker_motion_value.addItem(v[i]); - tracker_motion_value.setMaximumRowCount(v.length); - } - - String get_tracker_motion_label() { - return String.format("Logging Trigger Motion (%s):", AltosConvert.height.parse_units()); - } - - void set_tracker_tool_tip() { - if (tracker_motion_value.isVisible()) - tracker_motion_value.setToolTipText("How far the device must move before logging"); - else - tracker_motion_value.setToolTipText("This device doesn't disable logging when stationary"); - if (tracker_interval_value.isVisible()) - tracker_interval_value.setToolTipText("How often to report GPS position"); - else - tracker_interval_value.setToolTipText("This device can't configure interval"); - } - - public void set_tracker_motion(int tracker_motion) { - if (tracker_motion != AltosLib.MISSING) - tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion)); - tracker_motion_label.setVisible(tracker_motion != AltosLib.MISSING); - tracker_motion_value.setVisible(tracker_motion != AltosLib.MISSING); - } - - public int tracker_motion() throws AltosConfigDataException { - if (tracker_motion_value.isVisible()) { - String str = tracker_motion_value.getSelectedItem().toString(); - try { - return (int) (AltosConvert.height.parse_locale(str) + 0.5); - } catch (ParseException pe) { - throw new AltosConfigDataException("invalid tracker motion %s", str); - } - } - return AltosLib.MISSING; - } - - public void set_tracker_interval(int tracker_interval) { - if (tracker_interval != AltosLib.MISSING) - tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval)); - tracker_interval_label.setVisible(tracker_interval != AltosLib.MISSING); - tracker_interval_value.setVisible(tracker_interval != AltosLib.MISSING); - } - - public int tracker_interval() throws AltosConfigDataException { - if (tracker_interval_value.isVisible()) - return parse_int ("tracker interval", tracker_interval_value.getSelectedItem().toString(), false); - return AltosLib.MISSING; - } - - public void set_pyros(AltosPyro[] new_pyros) { - pyros = new_pyros; - if (pyros != null && pyro_ui != null) - pyro_ui.set_pyros(pyros); - pyro.setVisible(pyros != null); - } - - public AltosPyro[] pyros() throws AltosConfigDataException { - if (pyro_ui != null) - pyros = pyro_ui.get_pyros(); - return pyros; - } - - public void set_pyro_firing_time(double new_pyro_firing_time) { - pyro_firing_time = new_pyro_firing_time; - if (pyro_firing_time != AltosLib.MISSING && pyro_ui != null) - pyro_ui.set_pyro_firing_time(pyro_firing_time); - pyro.setVisible(pyro_firing_time != AltosLib.MISSING); - } - - public double pyro_firing_time() throws AltosConfigDataException { - if (pyro_ui != null) - pyro_firing_time = pyro_ui.get_pyro_firing_time(); - return pyro_firing_time; - } - - public void set_aprs_interval(int new_aprs_interval) { - if (new_aprs_interval != AltosLib.MISSING) - aprs_interval_value.setSelectedItem(Integer.toString(new_aprs_interval)); - aprs_interval_value.setVisible(new_aprs_interval != AltosLib.MISSING); - aprs_interval_label.setVisible(new_aprs_interval != AltosLib.MISSING); - set_aprs_interval_tool_tip(); - } - - public int aprs_interval() throws AltosConfigDataException { - if (aprs_interval_value.isVisible()) { - String s = aprs_interval_value.getSelectedItem().toString(); - - return parse_int("aprs interval", s, false); - } - return AltosLib.MISSING; - } - - public void set_aprs_ssid(int new_aprs_ssid) { - if (new_aprs_ssid != AltosLib.MISSING) - aprs_ssid_value.setSelectedItem(new_aprs_ssid); - aprs_ssid_value.setVisible(new_aprs_ssid != AltosLib.MISSING); - aprs_ssid_label.setVisible(new_aprs_ssid != AltosLib.MISSING); - set_aprs_ssid_tool_tip(); - } - - public int aprs_ssid() throws AltosConfigDataException { - if (aprs_ssid_value.isVisible()) { - Integer i = (Integer) aprs_ssid_value.getSelectedItem(); - return i; - } - return AltosLib.MISSING; - } - - public void set_aprs_format(int new_aprs_format) { - if (new_aprs_format != AltosLib.MISSING) - aprs_format_value.setSelectedIndex(new_aprs_format); - aprs_format_value.setVisible(new_aprs_format != AltosLib.MISSING); - aprs_format_label.setVisible(new_aprs_format != AltosLib.MISSING); - set_aprs_format_tool_tip(); - } - - public int aprs_format() throws AltosConfigDataException { - if (aprs_format_value.isVisible()) - return aprs_format_value.getSelectedIndex(); - return AltosLib.MISSING; - } -} diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index a5a2078d..4bc2a5f8 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -276,7 +276,7 @@ public class AltosUI extends AltosUIFrame { } void ConfigureTeleMetrum() { - new AltosConfig(AltosUI.this); + new AltosConfigFC(AltosUI.this); } void ConfigureTeleDongle() { diff --git a/altosui/Makefile-standalone b/altosui/Makefile-standalone index cbaf9743..e5f41639 100644 --- a/altosui/Makefile-standalone +++ b/altosui/Makefile-standalone @@ -4,8 +4,8 @@ CLASSPATH=classes:./*:/usr/share/java/* CLASSFILES=\ Altos.class \ AltosChannelMenu.class \ - AltosConfig.class \ - AltosConfigUI.class \ + AltosConfigFC.class \ + AltosConfigFCUI.class \ AltosConvert.class \ AltosCRCException.class \ AltosCSV.class \ diff --git a/altosui/Makefile.am b/altosui/Makefile.am index df022c40..720cae7f 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -14,8 +14,8 @@ altosui_JAVA = \ AltosAscent.java \ AltosChannelMenu.java \ AltosCompanionInfo.java \ - AltosConfig.java \ - AltosConfigUI.java \ + AltosConfigFC.java \ + AltosConfigFCUI.java \ AltosConfigPyroUI.java \ AltosConfigureUI.java \ AltosConfigTD.java \ -- cgit v1.2.3