for (int i = 0; i < parts.length; i++) {
try {
- r[i] = Altos.fromdec(parts[i]);
+ r[i] = AltosLib.fromdec(parts[i]);
} catch (NumberFormatException n) {
r[i] = 0;
}
case AltosLib.AO_LOG_SOFTWARE_VERSION:
out.printf ("# Software version: %s\n", record.data);
break;
- case Altos.AO_LOG_BARO_RESERVED:
+ case AltosLib.AO_LOG_BARO_RESERVED:
out.printf ("# Baro reserved: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_SENS:
+ case AltosLib.AO_LOG_BARO_SENS:
out.printf ("# Baro sens: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_OFF:
+ case AltosLib.AO_LOG_BARO_OFF:
out.printf ("# Baro off: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_TCS:
+ case AltosLib.AO_LOG_BARO_TCS:
out.printf ("# Baro tcs: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_TCO:
+ case AltosLib.AO_LOG_BARO_TCO:
out.printf ("# Baro tco: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_TREF:
+ case AltosLib.AO_LOG_BARO_TREF:
out.printf ("# Baro tref: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_TEMPSENS:
+ case AltosLib.AO_LOG_BARO_TEMPSENS:
out.printf ("# Baro tempsens: %d\n", record.a);
break;
- case Altos.AO_LOG_BARO_CRC:
+ case AltosLib.AO_LOG_BARO_CRC:
out.printf ("# Baro crc: %d\n", record.a);
break;
}
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package altoslib;
+package org.altusmetrum.AltosLib;
public class AltosIMU {
public int accel_x;
public static final int AO_LOG_PRODUCT = 2001;
public static final int AO_LOG_SERIAL_NUMBER = 2002;
public static final int AO_LOG_LOG_FORMAT = 2003;
+
+ /* Added for header fields in megametrum files */
+ public static final int AO_LOG_BARO_RESERVED = 3000;
+ public static final int AO_LOG_BARO_SENS = 3001;
+ public static final int AO_LOG_BARO_OFF = 3002;
+ public static final int AO_LOG_BARO_TCS = 3004;
+ public static final int AO_LOG_BARO_TCO = 3005;
+ public static final int AO_LOG_BARO_TREF = 3006;
+ public static final int AO_LOG_BARO_TEMPSENS = 3007;
+ public static final int AO_LOG_BARO_CRC = 3008;
+
public static final int AO_LOG_SOFTWARE_VERSION = 9999;
/* Added to flag invalid records */
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package altoslib;
+package org.altusmetrum.AltosLib;
public class AltosMag {
public int x;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package altoslib;
+package org.altusmetrum.AltosLib;
public class AltosMs5607 {
public int reserved;
public AltosRecordCompanion companion;
->>>>>>> 5a249bc... altosui: Complete split out of separate java library
/*
* Values for our MP3H6115A pressure sensor
*
public double gps_height;
+ public double pad_lat, pad_lon, pad_alt;
+
public int speak_tick;
public double speak_altitude;
try {
/* Version 1.0 or later firmware supports all telemetry formats */
- if (serial.config_data().compare_version("1.0") >= 0)
+ if (link.config_data().compare_version("1.0") >= 0)
return true;
/* Version 0.9 firmware only supports 0.9 telemetry */
- if (serial.config_data().compare_version("0.9") >= 0) {
- if (telemetry == Altos.ao_telemetry_0_9)
+ if (link.config_data().compare_version("0.9") >= 0) {
+ if (telemetry == AltosLib.ao_telemetry_0_9)
return true;
else
return false;
}
/* Version 0.8 firmware only supports 0.8 telemetry */
- if (telemetry == Altos.ao_telemetry_0_8)
+ if (telemetry == AltosLib.ao_telemetry_0_8)
return true;
else
return false;
*/
package org.altusmetrum.AltosLib;
+import java.text.*;
public abstract class AltosTelemetryRecord {
int[] bytes;
try {
- bytes = Altos.hexbytes(hex);
+ bytes = AltosLib.hexbytes(hex);
} catch (NumberFormatException ne) {
throw new ParseException(ne.getMessage(), 0);
}
if (!cksum(bytes))
throw new ParseException(String.format("invalid line \"%s\"", hex), 0);
- int rssi = Altos.int8(bytes, bytes.length - 3) / 2 - 74;
- int status = Altos.uint8(bytes, bytes.length - 2);
+ int rssi = AltosLib.int8(bytes, bytes.length - 3) / 2 - 74;
+ int status = AltosLib.uint8(bytes, bytes.length - 2);
if ((status & PKT_APPEND_STATUS_1_CRC_OK) == 0)
throw new AltosCRCException(rssi);
/* length, data ..., rssi, status, checksum -- 4 bytes extra */
switch (bytes.length) {
- case Altos.ao_telemetry_standard_len + 4:
- int type = Altos.uint8(bytes, 4 + 1);
+ case AltosLib.ao_telemetry_standard_len + 4:
+ int type = AltosLib.uint8(bytes, 4 + 1);
switch (type) {
case packet_type_TM_sensor:
case packet_type_Tm_sensor:
break;
}
break;
- case Altos.ao_telemetry_0_9_len + 4:
+ case AltosLib.ao_telemetry_0_9_len + 4:
r = new AltosTelemetryRecordLegacy(bytes, rssi, status);
break;
- case Altos.ao_telemetry_0_8_len + 4:
+ case AltosLib.ao_telemetry_0_8_len + 4:
r = new AltosTelemetryRecordLegacy(bytes, rssi, status);
break;
default:
record.serial = map.get_int(AO_TELEM_SERIAL, AltosRecord.MISSING);
record.flight = map.get_int(AO_TELEM_FLIGHT, AltosRecord.MISSING);
record.rssi = map.get_int(AO_TELEM_RSSI, AltosRecord.MISSING);
- record.state = Altos.state(map.get_string(AO_TELEM_STATE, "invalid"));
+ record.state = AltosLib.state(map.get_string(AO_TELEM_STATE, "invalid"));
record.tick = map.get_int(AO_TELEM_TICK, 0);
/* raw sensor values */
record.status = AltosParse.parse_hex(words[i++]);
AltosParse.word(words[i++], "STATE");
- record.state = Altos.state(words[i++]);
+ record.state = AltosLib.state(words[i++]);
record.tick = AltosParse.parse_int(words[i++]);
public class Altos extends AltosLib {
- /* Added for header fields in eeprom files */
- static final int AO_LOG_CONFIG_VERSION = 1000;
- static final int AO_LOG_MAIN_DEPLOY = 1001;
- static final int AO_LOG_APOGEE_DELAY = 1002;
- static final int AO_LOG_RADIO_CHANNEL = 1003;
- static final int AO_LOG_CALLSIGN = 1004;
- static final int AO_LOG_ACCEL_CAL = 1005;
- static final int AO_LOG_RADIO_CAL = 1006;
- static final int AO_LOG_MAX_FLIGHT_LOG = 1007;
- static final int AO_LOG_MANUFACTURER = 2000;
- static final int AO_LOG_PRODUCT = 2001;
- static final int AO_LOG_SERIAL_NUMBER = 2002;
- static final int AO_LOG_LOG_FORMAT = 2003;
-
- /* Added for header fields in megametrum files */
- static final int AO_LOG_BARO_RESERVED = 3000;
- static final int AO_LOG_BARO_SENS = 3001;
- static final int AO_LOG_BARO_OFF = 3002;
- static final int AO_LOG_BARO_TCS = 3004;
- static final int AO_LOG_BARO_TCO = 3005;
- static final int AO_LOG_BARO_TREF = 3006;
- static final int AO_LOG_BARO_TEMPSENS = 3007;
- static final int AO_LOG_BARO_CRC = 3008;
-
- static final int AO_LOG_SOFTWARE_VERSION = 9999;
-
- /* Added to flag invalid records */
- static final int AO_LOG_INVALID = -1;
-
- /* Flight state numbers and names */
- static final int ao_flight_startup = 0;
- static final int ao_flight_idle = 1;
- static final int ao_flight_pad = 2;
- static final int ao_flight_boost = 3;
- static final int ao_flight_fast = 4;
- static final int ao_flight_coast = 5;
- static final int ao_flight_drogue = 6;
- static final int ao_flight_main = 7;
- static final int ao_flight_landed = 8;
- static final int ao_flight_invalid = 9;
-
- /* Telemetry modes */
- static final int ao_telemetry_off = 0;
- static final int ao_telemetry_min = 1;
- static final int ao_telemetry_standard = 1;
- static final int ao_telemetry_0_9 = 2;
- static final int ao_telemetry_0_8 = 3;
- static final int ao_telemetry_max = 3;
-
- static final String[] ao_telemetry_name = {
- "Off", "Standard Telemetry", "TeleMetrum v0.9", "TeleMetrum v0.8"
- };
-
- static final String launch_sites_url = "http://www.altusmetrum.org/AltOS/launch-sites.txt";
-
- static final int ao_telemetry_standard_len = 32;
- static final int ao_telemetry_0_9_len = 95;
- static final int ao_telemetry_0_8_len = 94;
-
- static final int[] ao_telemetry_len = {
- 0, 32, 95, 94
- };
-
- static HashMap<String,Integer> string_to_state = new HashMap<String,Integer>();
-
- static boolean map_initialized = false;
-
static final int tab_elt_pad = 5;
static Font label_font;
flush_output();
}
-<<<<<<< HEAD
private int telemetry_len() {
return Altos.telemetry_len(telemetry);
}
remote = false;
}
-=======
->>>>>>> bc5e669... altosui: Pull most of AltosSerial into AltosLink
public void set_frame(Frame in_frame) {
frame = in_frame;
}
AltosConfigureUI.java \
AltosConfigTD.java \
AltosConfigTDUI.java \
- AltosConvert.java \
- AltosCRCException.java \
AltosCSV.java \
AltosCSVUI.java \
AltosDebug.java \
AltosEepromList.java \
AltosEepromManage.java \
AltosEepromMonitor.java \
- AltosEepromTeleScience.java \
AltosEepromMega.java \
AltosEepromMegaIterable.java \
AltosEepromSelect.java \