From 3fbefb3eea981d34a09496cf8abf0119de2e35bf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 24 Nov 2010 14:57:57 -0800 Subject: Move altosui to the top level, placing libaltos inside it. Signed-off-by: Keith Packard --- altosui/AltosLanded.java | 212 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 altosui/AltosLanded.java (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java new file mode 100644 index 00000000..d34efe6d --- /dev/null +++ b/altosui/AltosLanded.java @@ -0,0 +1,212 @@ +/* + * 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; version 2 of the License. + * + * 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.filechooser.FileNameExtensionFilter; +import javax.swing.table.*; +import java.io.*; +import java.util.*; +import java.text.*; +import java.util.prefs.*; +import java.util.concurrent.LinkedBlockingQueue; + +public class AltosLanded extends JComponent implements AltosFlightDisplay { + GridBagLayout layout; + Font label_font; + Font value_font; + + public class LandedValue { + JLabel label; + JTextField value; + void show(AltosState state, int crc_errors) {} + + void reset() { + value.setText(""); + } + + void show(String format, double v) { + value.setText(String.format(format, v)); + } + + public LandedValue (GridBagLayout layout, int y, String text) { + GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; + + label = new JLabel(text); + label.setFont(label_font); + label.setHorizontalAlignment(SwingConstants.LEFT); + c.gridx = 0; c.gridy = y; + c.insets = new Insets(10, 10, 10, 10); + c.anchor = GridBagConstraints.WEST; + c.weightx = 0; + c.fill = GridBagConstraints.VERTICAL; + layout.setConstraints(label, c); + add(label); + + value = new JTextField(Altos.text_width); + value.setFont(value_font); + value.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = 1; c.gridy = y; + c.anchor = GridBagConstraints.WEST; + c.weightx = 1; + c.fill = GridBagConstraints.BOTH; + layout.setConstraints(value, c); + add(value); + } + } + + String pos(double p, String pos, String neg) { + String h = pos; + if (p < 0) { + h = neg; + p = -p; + } + int deg = (int) Math.floor(p); + double min = (p - Math.floor(p)) * 60.0; + return String.format("%s %4d° %9.6f", h, deg, min); + } + + class Lat extends LandedValue { + void show (AltosState state, int crc_errors) { + if (state.gps != null) + value.setText(pos(state.gps.lat,"N", "S")); + else + value.setText("???"); + } + public Lat (GridBagLayout layout, int y) { + super (layout, y, "Latitude"); + } + } + + Lat lat; + + class Lon extends LandedValue { + void show (AltosState state, int crc_errors) { + if (state.gps != null) + value.setText(pos(state.gps.lon,"E", "W")); + else + value.setText("???"); + } + public Lon (GridBagLayout layout, int y) { + super (layout, y, "Longitude"); + } + } + + Lon lon; + + class Bearing extends LandedValue { + void show (AltosState state, int crc_errors) { + if (state.from_pad != null) + show("%3.0f°", state.from_pad.bearing); + else + value.setText("???"); + } + public Bearing (GridBagLayout layout, int y) { + super (layout, y, "Bearing"); + } + } + + Bearing bearing; + + class Distance extends LandedValue { + void show (AltosState state, int crc_errors) { + if (state.from_pad != null) + show("%6.0f m", state.from_pad.distance); + else + value.setText("???"); + } + public Distance (GridBagLayout layout, int y) { + super (layout, y, "Distance"); + } + } + + Distance distance; + + class Height extends LandedValue { + void show (AltosState state, int crc_errors) { + show("%6.0f m", state.max_height); + } + public Height (GridBagLayout layout, int y) { + super (layout, y, "Maximum Height"); + } + } + + Height height; + + class Speed extends LandedValue { + void show (AltosState state, int crc_errors) { + show("%6.0f m/s", state.max_speed); + } + public Speed (GridBagLayout layout, int y) { + super (layout, y, "Maximum Speed"); + } + } + + Speed speed; + + class Accel extends LandedValue { + void show (AltosState state, int crc_errors) { + show("%6.0f m/s²", state.max_acceleration); + } + public Accel (GridBagLayout layout, int y) { + super (layout, y, "Maximum Acceleration"); + } + } + + Accel accel; + + public void reset() { + lat.reset(); + lon.reset(); + bearing.reset(); + distance.reset(); + height.reset(); + speed.reset(); + accel.reset(); + } + + public void show(AltosState state, int crc_errors) { + bearing.show(state, crc_errors); + distance.show(state, crc_errors); + lat.show(state, crc_errors); + lon.show(state, crc_errors); + height.show(state, crc_errors); + speed.show(state, crc_errors); + accel.show(state, crc_errors); + } + + public AltosLanded() { + layout = new GridBagLayout(); + + label_font = new Font("Dialog", Font.PLAIN, 22); + value_font = new Font("Monospaced", Font.PLAIN, 22); + setLayout(layout); + + /* Elements in descent display */ + bearing = new Bearing(layout, 0); + distance = new Distance(layout, 1); + lat = new Lat(layout, 2); + lon = new Lon(layout, 3); + height = new Height(layout, 4); + speed = new Speed(layout, 5); + accel = new Accel(layout, 6); + } +} -- cgit v1.2.3 From f3e68341f6f5daaf26dd162e4f9a06c29988986a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 24 Mar 2011 05:27:57 +0900 Subject: altosui: Add support for telemetry version 4 New telemetry format needed to support TeleNano and TeleMini Signed-off-by: Keith Packard --- altosui/AltosAscent.java | 21 ++- altosui/AltosCSV.java | 29 ++-- altosui/AltosDataPointReader.java | 2 + altosui/AltosDescent.java | 57 +++++++- altosui/AltosFlightUI.java | 23 +++- altosui/AltosGPS.java | 47 ++++++- altosui/AltosLanded.java | 31 ++++- altosui/AltosPad.java | 41 +++++- altosui/AltosRecord.java | 83 +++++++++-- altosui/AltosSiteMap.java | 2 - altosui/AltosState.java | 15 +- altosui/AltosTelemetry.java | 267 +++++++++++++++++++++++++++++++++--- altosui/AltosTelemetryIterable.java | 1 - altosui/AltosUI.java | 2 +- altosui/Makefile.am | 1 + src/ao_telem.h | 8 +- 16 files changed, 550 insertions(+), 80 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index 64bdcf30..0fbc5de2 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -87,6 +87,16 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { void reset() { value.setText(""); } + + void show() { + label.show(); + value.show(); + } + + void hide() { + label.hide(); + value.hide(); + } public AscentValue (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -247,6 +257,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Lat extends AscentValue { void show (AltosState state, int crc_errors) { + show(); if (state.gps != null) value.setText(pos(state.gps.lat,"N", "S")); else @@ -261,6 +272,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Lon extends AscentValue { void show (AltosState state, int crc_errors) { + show(); if (state.gps != null) value.setText(pos(state.gps.lon,"E", "W")); else @@ -284,8 +296,13 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { } public void show(AltosState state, int crc_errors) { - lat.show(state, crc_errors); - lon.show(state, crc_errors); + if (state.gps != null) { + lat.show(state, crc_errors); + lon.show(state, crc_errors); + } else { + lat.hide(); + lon.hide(); + } height.show(state, crc_errors); main.show(state, crc_errors); apogee.show(state, crc_errors); diff --git a/altosui/AltosCSV.java b/altosui/AltosCSV.java index df98b2b4..5277c160 100644 --- a/altosui/AltosCSV.java +++ b/altosui/AltosCSV.java @@ -60,7 +60,7 @@ public class AltosCSV implements AltosWriter { * drogue (V) * main (V) * - * GPS data + * GPS data (if available) * connected (1/0) * locked (1/0) * nsat (used for solution) @@ -179,12 +179,14 @@ public class AltosCSV implements AltosWriter { } } - void write_header() { + void write_header(boolean gps) { out.printf("#"); write_general_header(); out.printf(","); write_flight_header(); out.printf(","); write_basic_header(); - out.printf(","); write_gps_header(); - out.printf(","); write_gps_sat_header(); + if (gps) { + out.printf(","); write_gps_header(); + out.printf(","); write_gps_sat_header(); + } out.printf ("\n"); } @@ -192,9 +194,12 @@ public class AltosCSV implements AltosWriter { state = new AltosState(record, state); write_general(record); out.printf(","); write_flight(record); out.printf(","); - write_basic(record); out.printf(","); - write_gps(record); out.printf(","); - write_gps_sat(record); + write_basic(record); + if (record.gps != null) { + out.printf(","); + write_gps(record); out.printf(","); + write_gps_sat(record); + } out.printf ("\n"); } @@ -206,7 +211,7 @@ public class AltosCSV implements AltosWriter { public void write(AltosRecord record) { if (!header_written) { - write_header(); + write_header(record.gps != null); header_written = true; } if (!seen_boost) { @@ -240,12 +245,16 @@ public class AltosCSV implements AltosWriter { write(r); } - public AltosCSV(File in_name) throws FileNotFoundException { + public AltosCSV(PrintStream in_out, File in_name) { name = in_name; - out = new PrintStream(name); + out = in_out; pad_records = new LinkedList(); } + public AltosCSV(File in_name) throws FileNotFoundException { + this(new PrintStream(in_name), in_name); + } + public AltosCSV(String in_string) throws FileNotFoundException { this(new File(in_string)); } diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java index 7704310b..ee57d2ce 100644 --- a/altosui/AltosDataPointReader.java +++ b/altosui/AltosDataPointReader.java @@ -15,6 +15,8 @@ class AltosDataPointReader implements Iterable { AltosState state; AltosRecord record; + final static int MISSING = AltosRecord.MISSING; + public AltosDataPointReader(Iterable reader) { this.iter = reader.iterator(); this.state = null; diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 16ccd458..594a7a09 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -37,6 +37,19 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { AltosLights lights; abstract void show(AltosState state, int crc_errors); + + void show() { + label.show(); + value.show(); + lights.show(); + } + + void hide() { + label.hide(); + value.hide(); + lights.hide(); + } + void reset() { value.setText(""); lights.set(false); @@ -90,6 +103,16 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { abstract void show(AltosState state, int crc_errors); + void show() { + label.show(); + value.show(); + } + + void hide() { + label.hide(); + value.hide(); + } + void show(String format, double v) { value.setText(String.format(format, v)); } @@ -134,12 +157,27 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { value2.setText(""); } + void show() { + label.show(); + value1.show(); + value2.show(); + } + + void hide() { + label.hide(); + value1.hide(); + value2.hide(); + } + abstract void show(AltosState state, int crc_errors); + void show(String v1, String v2) { + show(); value1.setText(v1); value2.setText(v2); } void show(String f1, double v1, String f2, double v2) { + show(); value1.setText(String.format(f1, v1)); value2.setText(String.format(f2, v2)); } @@ -260,6 +298,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class Main extends DescentStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.main_sense)); lights.set(state.main_sense > 3.2); } @@ -324,11 +363,19 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { public void show(AltosState state, int crc_errors) { height.show(state, crc_errors); speed.show(state, crc_errors); - bearing.show(state, crc_errors); - range.show(state, crc_errors); - elevation.show(state, crc_errors); - lat.show(state, crc_errors); - lon.show(state, crc_errors); + if (state.gps != null) { + bearing.show(state, crc_errors); + range.show(state, crc_errors); + elevation.show(state, crc_errors); + lat.show(state, crc_errors); + lon.show(state, crc_errors); + } else { + bearing.hide(); + range.hide(); + elevation.hide(); + lat.hide(); + lon.hide(); + } main.show(state, crc_errors); apogee.show(state, crc_errors); } diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 7fcfb8be..68e0ef87 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -29,9 +29,6 @@ import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; public class AltosFlightUI extends JFrame implements AltosFlightDisplay { - String[] statusNames = { "Height (m)", "State", "RSSI (dBm)", "Speed (m/s)" }; - Object[][] statusData = { { "0", "pad", "-50", "0" } }; - AltosVoice voice; AltosFlightReader reader; AltosDisplayThread thread; @@ -43,6 +40,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { AltosDescent descent; AltosLanded landed; AltosSiteMap sitemap; + boolean has_map; private AltosFlightStatus flightStatus; private AltosInfoTable flightInfo; @@ -85,6 +83,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { public void show(AltosState state, int crc_errors) { JComponent tab = which_tab(state); + try { pad.show(state, crc_errors); ascent.show(state, crc_errors); descent.show(state, crc_errors); @@ -97,7 +96,21 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { } flightStatus.show(state, crc_errors); flightInfo.show(state, crc_errors); - sitemap.show(state, crc_errors); + if (state.gps != null) { + if (!has_map) { + pane.add("Site Map", sitemap); + has_map = true; + } + sitemap.show(state, crc_errors); + } else { + if (has_map) { + pane.remove(sitemap); + has_map = false; + } + } + } catch (Exception e) { + System.out.print("Show exception" + e); + } } public void set_exit_on_close() { @@ -169,7 +182,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { pane.add("Table", new JScrollPane(flightInfo)); sitemap = new AltosSiteMap(); - pane.add("Site Map", sitemap); + has_map = false; /* Make the tabbed pane use the rest of the window space */ c.gridx = 0; diff --git a/altosui/AltosGPS.java b/altosui/AltosGPS.java index 83821842..0dbc8364 100644 --- a/altosui/AltosGPS.java +++ b/altosui/AltosGPS.java @@ -26,10 +26,11 @@ public class AltosGPS { int c_n0; } + final static int MISSING = AltosRecord.MISSING; + int nsat; boolean locked; boolean connected; - boolean date_valid; double lat; /* degrees (+N -S) */ double lon; /* degrees (+E -W) */ int alt; /* m */ @@ -40,11 +41,11 @@ public class AltosGPS { int minute; int second; - int gps_extended; /* has extra data */ double ground_speed; /* m/s */ int course; /* degrees */ double climb_rate; /* m/s */ - double hdop; /* unitless? */ + double hdop; /* unitless */ + double vdop; /* unitless */ int h_error; /* m */ int v_error; /* m */ @@ -73,6 +74,44 @@ public class AltosGPS { hour = minute = second = 0; } + public AltosGPS(AltosTelemetryMap map) throws ParseException { + String state = map.get_string(AltosTelemetry.AO_TELEM_GPS_STATE, + AltosTelemetry.AO_TELEM_GPS_STATE_ERROR); + + nsat = map.get_int(AltosTelemetry.AO_TELEM_GPS_NUM_SAT, 0); + if (state.equals(AltosTelemetry.AO_TELEM_GPS_STATE_LOCKED)) { + connected = true; + locked = true; + lat = map.get_double(AltosTelemetry.AO_TELEM_GPS_LATITUDE, MISSING, 1.0e-7); + lon = map.get_double(AltosTelemetry.AO_TELEM_GPS_LONGITUDE, MISSING, 1.0e-7); + alt = map.get_int(AltosTelemetry.AO_TELEM_GPS_ALTITUDE, MISSING); + year = map.get_int(AltosTelemetry.AO_TELEM_GPS_YEAR, MISSING); + if (year != MISSING) + year += 2000; + month = map.get_int(AltosTelemetry.AO_TELEM_GPS_MONTH, MISSING); + day = map.get_int(AltosTelemetry.AO_TELEM_GPS_DAY, MISSING); + + hour = map.get_int(AltosTelemetry.AO_TELEM_GPS_HOUR, 0); + minute = map.get_int(AltosTelemetry.AO_TELEM_GPS_MINUTE, 0); + second = map.get_int(AltosTelemetry.AO_TELEM_GPS_SECOND, 0); + + ground_speed = map.get_double(AltosTelemetry.AO_TELEM_GPS_HORIZONTAL_SPEED, + AltosRecord.MISSING, 1/100.0); + course = map.get_int(AltosTelemetry.AO_TELEM_GPS_COURSE, + AltosRecord.MISSING); + hdop = map.get_double(AltosTelemetry.AO_TELEM_GPS_HDOP, MISSING, 1.0); + vdop = map.get_double(AltosTelemetry.AO_TELEM_GPS_VDOP, MISSING, 1.0); + h_error = map.get_int(AltosTelemetry.AO_TELEM_GPS_HERROR, MISSING); + v_error = map.get_int(AltosTelemetry.AO_TELEM_GPS_VERROR, MISSING); + } else if (state.equals(AltosTelemetry.AO_TELEM_GPS_STATE_UNLOCKED)) { + connected = true; + locked = false; + } else { + connected = false; + locked = false; + } + } + public AltosGPS(String[] words, int i, int version) throws ParseException { AltosParse.word(words[i++], "GPS"); nsat = AltosParse.parse_int(words[i++]); @@ -184,7 +223,6 @@ public class AltosGPS { nsat = old.nsat; locked = old.locked; connected = old.connected; - date_valid = old.date_valid; lat = old.lat; /* degrees (+N -S) */ lon = old.lon; /* degrees (+E -W) */ alt = old.alt; /* m */ @@ -195,7 +233,6 @@ public class AltosGPS { minute = old.minute; second = old.second; - gps_extended = old.gps_extended; /* has extra data */ ground_speed = old.ground_speed; /* m/s */ course = old.course; /* degrees */ climb_rate = old.climb_rate; /* m/s */ diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index d34efe6d..0717ffe2 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -42,10 +42,22 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { value.setText(""); } + void show() { + label.show(); + value.show(); + } + + void hide() { + label.hide(); + value.hide(); + } + void show(String format, double v) { + show(); value.setText(String.format(format, v)); } + public LandedValue (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -86,6 +98,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { class Lat extends LandedValue { void show (AltosState state, int crc_errors) { + show(); if (state.gps != null) value.setText(pos(state.gps.lat,"N", "S")); else @@ -100,6 +113,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { class Lon extends LandedValue { void show (AltosState state, int crc_errors) { + show(); if (state.gps != null) value.setText(pos(state.gps.lon,"E", "W")); else @@ -114,6 +128,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { class Bearing extends LandedValue { void show (AltosState state, int crc_errors) { + show(); if (state.from_pad != null) show("%3.0f°", state.from_pad.bearing); else @@ -128,6 +143,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { class Distance extends LandedValue { void show (AltosState state, int crc_errors) { + show(); if (state.from_pad != null) show("%6.0f m", state.from_pad.distance); else @@ -184,10 +200,17 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { } public void show(AltosState state, int crc_errors) { - bearing.show(state, crc_errors); - distance.show(state, crc_errors); - lat.show(state, crc_errors); - lon.show(state, crc_errors); + if (state.gps != null) { + bearing.show(state, crc_errors); + distance.show(state, crc_errors); + lat.show(state, crc_errors); + lon.show(state, crc_errors); + } else { + bearing.hide(); + distance.hide(); + lat.hide(); + lon.hide(); + } height.show(state, crc_errors); speed.show(state, crc_errors); accel.show(state, crc_errors); diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index e345e5da..2f59e879 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -42,6 +42,18 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { lights.set(false); } + public void show() { + label.show(); + value.show(); + lights.show(); + } + + public void hide() { + label.hide(); + value.hide(); + lights.hide(); + } + public LaunchStatus (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -83,6 +95,16 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { JTextField value; void show(AltosState state, int crc_errors) {} + void show() { + label.show(); + value.show(); + } + + void hide() { + label.hide(); + value.hide(); + } + void reset() { value.setText(""); } @@ -151,6 +173,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class GPSLocked extends LaunchStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4d sats", state.gps.nsat)); lights.set(state.gps.locked && state.gps.nsat >= 4); } @@ -163,6 +186,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class GPSReady extends LaunchStatus { void show (AltosState state, int crc_errors) { + show(); if (state.gps_ready) value.setText("Ready"); else @@ -189,6 +213,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class PadLat extends LaunchValue { void show (AltosState state, int crc_errors) { + show(); value.setText(pos(state.pad_lat,"N", "S")); } public PadLat (GridBagLayout layout, int y) { @@ -200,6 +225,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class PadLon extends LaunchValue { void show (AltosState state, int crc_errors) { + show(); value.setText(pos(state.pad_lon,"E", "W")); } public PadLon (GridBagLayout layout, int y) { @@ -235,11 +261,18 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { battery.show(state, crc_errors); apogee.show(state, crc_errors); main.show(state, crc_errors); - gps_locked.show(state, crc_errors); - gps_ready.show(state, crc_errors); - pad_lat.show(state, crc_errors); - pad_lon.show(state, crc_errors); pad_alt.show(state, crc_errors); + if (state.gps != null) { + gps_locked.show(state, crc_errors); + gps_ready.show(state, crc_errors); + pad_lat.show(state, crc_errors); + pad_lon.show(state, crc_errors); + } else { + gps_locked.hide(); + gps_ready.hide(); + pad_lat.hide(); + pad_lon.hide(); + } } public AltosPad() { diff --git a/altosui/AltosRecord.java b/altosui/AltosRecord.java index 1160a273..46e96b95 100644 --- a/altosui/AltosRecord.java +++ b/altosui/AltosRecord.java @@ -23,6 +23,8 @@ import java.util.HashMap; import java.io.*; public class AltosRecord { + final static int MISSING = 0x7fffffff; + int version; String callsign; int serial; @@ -31,19 +33,27 @@ public class AltosRecord { int status; int state; int tick; + int accel; int pres; int temp; int batt; int drogue; int main; - int flight_accel; + int ground_accel; - int flight_vel; - int flight_pres; int ground_pres; int accel_plus_g; int accel_minus_g; + + double acceleration; + double speed; + double height; + + int flight_accel; + int flight_vel; + int flight_pres; + AltosGPS gps; double time; /* seconds since boost */ @@ -72,46 +82,82 @@ public class AltosRecord { } public double raw_pressure() { + if (pres == MISSING) + return MISSING; return barometer_to_pressure(pres); } public double filtered_pressure() { + if (flight_pres == MISSING) + return MISSING; return barometer_to_pressure(flight_pres); } public double ground_pressure() { + if (ground_pres == MISSING) + return MISSING; return barometer_to_pressure(ground_pres); } - public double filtered_altitude() { - return AltosConvert.pressure_to_altitude(filtered_pressure()); - } - public double raw_altitude() { - return AltosConvert.pressure_to_altitude(raw_pressure()); + double p = raw_pressure(); + if (p == MISSING) + return MISSING; + return AltosConvert.pressure_to_altitude(p); } public double ground_altitude() { - return AltosConvert.pressure_to_altitude(ground_pressure()); + double p = ground_pressure(); + if (p == MISSING) + return MISSING; + return AltosConvert.pressure_to_altitude(p); + } + + public double filtered_altitude() { + if (height != MISSING && ground_pres != MISSING) + return height + ground_altitude(); + + double p = filtered_pressure(); + if (p == MISSING) + return MISSING; + return AltosConvert.pressure_to_altitude(p); } public double filtered_height() { - return filtered_altitude() - ground_altitude(); + if (height != MISSING) + return height; + + double f = filtered_altitude(); + double g = ground_altitude(); + if (f == MISSING || g == MISSING) + return MISSING; + return f - g; } public double raw_height() { - return raw_altitude() - ground_altitude(); + double r = raw_altitude(); + double g = ground_altitude(); + + if (r == MISSING || g == MISSING) + return MISSING; + return r - g; } public double battery_voltage() { + if (batt == MISSING) + return MISSING; return AltosConvert.cc_battery_to_voltage(batt); } public double main_voltage() { + if (main == MISSING) + return MISSING; return AltosConvert.cc_ignitor_to_voltage(main); } public double drogue_voltage() { + if (drogue == MISSING) + return MISSING; return AltosConvert.cc_ignitor_to_voltage(drogue); } @@ -131,6 +177,8 @@ public class AltosRecord { } public double temperature() { + if (temp == MISSING) + return MISSING; return thermometer_to_temperature(temp); } @@ -139,13 +187,22 @@ public class AltosRecord { return counts_per_g / 9.80665; } + public double acceleration() { + if (acceleration != MISSING) + return acceleration; + + if (ground_accel == MISSING || accel == MISSING) + return MISSING; return (ground_accel - accel) / accel_counts_per_mss(); } public double accel_speed() { - double speed = flight_vel / (accel_counts_per_mss() * 100.0); - return speed; + if (speed != MISSING) + return speed; + if (flight_vel == MISSING) + return MISSING; + return flight_vel / (accel_counts_per_mss() * 100.0); } public String state() { diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index d6bd6d1f..f4b6b7e0 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -228,8 +228,6 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { int last_state = -1; public void show(final AltosState state, final int crc_errors) { // if insufficient gps data, nothing to update - if (state.gps == null) - return; if (!state.gps.locked && state.gps.nsat < 4) return; diff --git a/altosui/AltosState.java b/altosui/AltosState.java index ec499d5a..4e165f80 100644 --- a/altosui/AltosState.java +++ b/altosui/AltosState.java @@ -79,7 +79,8 @@ public class AltosState { data = cur; ground_altitude = data.ground_altitude(); - height = data.filtered_altitude() - ground_altitude; + height = data.filtered_height(); + System.out.printf("height %g\n", height); report_time = System.currentTimeMillis(); @@ -114,10 +115,14 @@ public class AltosState { /* compute barometric speed */ double height_change = height - prev_state.height; - if (time_change > 0) - baro_speed = (prev_state.baro_speed * 3 + (height_change / time_change)) / 4.0; - else - baro_speed = prev_state.baro_speed; + if (data.speed != AltosRecord.MISSING) + baro_speed = data.speed; + else { + if (time_change > 0) + baro_speed = (prev_state.baro_speed * 3 + (height_change / time_change)) / 4.0; + else + baro_speed = prev_state.baro_speed; + } } else { npad = 0; ngps = 0; diff --git a/altosui/AltosTelemetry.java b/altosui/AltosTelemetry.java index bdb6466a..3eb0efa8 100644 --- a/altosui/AltosTelemetry.java +++ b/altosui/AltosTelemetry.java @@ -27,10 +27,40 @@ import java.util.HashMap; /* - * The telemetry data stream is a bit of a mess at present, with no consistent - * formatting. In particular, the GPS data is formatted for viewing instead of parsing. - * However, the key feature is that every telemetry line contains all of the information - * necessary to describe the current rocket state, including the calibration values + * Version 4 is a replacement with consistent syntax. Each telemetry line + * contains a sequence of space-separated names and values, the values are + * either integers or strings. The names are all unique. All values are + * optional + * + * VERSION 4 c KD7SQG n 236 f 18 r -25 s pad t 513 r_a 15756 r_b 26444 r_t 20944 + * r_v 26640 r_d 512 r_m 208 c_a 15775 c_b 26439 c_p 15749 c_m 16281 a_a 15764 + * a_s 0 a_b 26439 g_s u g_n 0 s_n 0 + * + * VERSION 4 c KD7SQG n 19 f 0 r -23 s pad t 513 r_b 26372 r_t 21292 r_v 26788 + * r_d 136 r_m 140 c_b 26370 k_h 0 k_s 0 k_a 0 + * + * General header fields + * + * Name Value + * + * VERSION Telemetry version number (4 or more). Must be first. + * c Callsign (string, no spaces allowed) + * n Flight unit serial number (integer) + * f Flight number (integer) + * r Packet RSSI value (integer) + * s Flight computer state (string, no spaces allowed) + * t Flight computer clock (integer in centiseconds) + * + * Version 3 is Version 2 with fixed RSSI numbers -- the radio reports + * in 1/2dB increments while this protocol provides only integers. So, + * the syntax didn't change just the interpretation of the RSSI + * values. + * + * Version 2 of the telemetry data stream is a bit of a mess, with no + * consistent formatting. In particular, the GPS data is formatted for + * viewing instead of parsing. However, the key feature is that every + * telemetry line contains all of the information necessary to + * describe the current rocket state, including the calibration values * for accelerometer and barometer. * * GPS unlocked: @@ -47,25 +77,201 @@ import java.util.HashMap; * GPS 9 sat 2010-02-13 17:16:51 35°20.0803'N 106°45.2235'W 1790m \ * 0.00m/s(H) 0° 0.00m/s(V) 1.0(hdop) 0(herr) 0(verr) \ * SAT 10 29 30 24 28 5 25 21 20 15 33 1 23 30 24 18 26 10 29 2 26 + * */ public class AltosTelemetry extends AltosRecord { - public AltosTelemetry(String line) throws ParseException, AltosCRCException { - String[] words = line.split("\\s+"); - int i = 0; + /* + * General header fields + * + * Name Value + * + * VERSION Telemetry version number (4 or more). Must be first. + * c Callsign (string, no spaces allowed) + * n Flight unit serial number (integer) + * f Flight number (integer) + * r Packet RSSI value (integer) + * s Flight computer state (string, no spaces allowed) + * t Flight computer clock (integer in centiseconds) + */ - if (words[i].equals("CRC") && words[i+1].equals("INVALID")) { - i += 2; - AltosParse.word(words[i++], "RSSI"); - rssi = AltosParse.parse_int(words[i++]); - throw new AltosCRCException(rssi); - } - if (words[i].equals("CALL")) { - version = 0; - } else { - AltosParse.word (words[i++], "VERSION"); - version = AltosParse.parse_int(words[i++]); - } + final static String AO_TELEM_VERSION = "VERSION"; + final static String AO_TELEM_CALL = "c"; + final static String AO_TELEM_SERIAL = "n"; + final static String AO_TELEM_FLIGHT = "f"; + final static String AO_TELEM_RSSI = "r"; + final static String AO_TELEM_STATE = "s"; + final static String AO_TELEM_TICK = "t"; + + /* + * Raw sensor values + * + * Name Value + * r_a Accelerometer reading (integer) + * r_b Barometer reading (integer) + * r_t Thermometer reading (integer) + * r_v Battery reading (integer) + * r_d Drogue continuity (integer) + * r_m Main continuity (integer) + */ + + final static String AO_TELEM_RAW_ACCEL = "r_a"; + final static String AO_TELEM_RAW_BARO = "r_b"; + final static String AO_TELEM_RAW_THERMO = "r_t"; + final static String AO_TELEM_RAW_BATT = "r_v"; + final static String AO_TELEM_RAW_DROGUE = "r_d"; + final static String AO_TELEM_RAW_MAIN = "r_m"; + + /* + * Sensor calibration values + * + * Name Value + * c_a Ground accelerometer reading (integer) + * c_b Ground barometer reading (integer) + * c_p Accelerometer reading for +1g + * c_m Accelerometer reading for -1g + */ + + final static String AO_TELEM_CAL_ACCEL_GROUND = "c_a"; + final static String AO_TELEM_CAL_BARO_GROUND = "c_b"; + final static String AO_TELEM_CAL_ACCEL_PLUS = "c_p"; + final static String AO_TELEM_CAL_ACCEL_MINUS = "c_m"; + + /* + * Kalman state values + * + * Name Value + * k_h Height above pad (integer, meters) + * k_s Vertical speeed (integer, m/s * 16) + * k_a Vertical acceleration (integer, m/s² * 16) + */ + + final static String AO_TELEM_KALMAN_HEIGHT = "k_h"; + final static String AO_TELEM_KALMAN_SPEED = "k_s"; + final static String AO_TELEM_KALMAN_ACCEL = "k_a"; + + /* + * Ad-hoc flight values + * + * Name Value + * a_a Acceleration (integer, sensor units) + * a_s Speed (integer, integrated acceleration value) + * a_b Barometer reading (integer, sensor units) + */ + + final static String AO_TELEM_ADHOC_ACCEL = "a_a"; + final static String AO_TELEM_ADHOC_SPEED = "a_s"; + final static String AO_TELEM_ADHOC_BARO = "a_b"; + + /* + * GPS values + * + * Name Value + * g_s GPS state (string): + * l locked + * u unlocked + * e error (missing or broken) + * g_n Number of sats used in solution + * g_ns Latitude (degrees * 10e7) + * g_ew Longitude (degrees * 10e7) + * g_a Altitude (integer meters) + * g_Y GPS year (integer) + * g_M GPS month (integer - 1-12) + * g_D GPS day (integer - 1-31) + * g_h GPS hour (integer - 0-23) + * g_m GPS minute (integer - 0-59) + * g_s GPS second (integer - 0-59) + * g_v GPS vertical speed (integer, cm/sec) + * g_s GPS horizontal speed (integer, cm/sec) + * g_c GPS course (integer, 0-359) + * g_hd GPS hdop (integer * 10) + * g_vd GPS vdop (integer * 10) + * g_he GPS h error (integer) + * g_ve GPS v error (integer) + */ + + final static String AO_TELEM_GPS_STATE = "g"; + final static String AO_TELEM_GPS_STATE_LOCKED = "l"; + final static String AO_TELEM_GPS_STATE_UNLOCKED = "u"; + final static String AO_TELEM_GPS_STATE_ERROR = "e"; + final static String AO_TELEM_GPS_NUM_SAT = "g_n"; + final static String AO_TELEM_GPS_LATITUDE = "g_ns"; + final static String AO_TELEM_GPS_LONGITUDE = "g_ew"; + final static String AO_TELEM_GPS_ALTITUDE = "g_a"; + final static String AO_TELEM_GPS_YEAR = "g_Y"; + final static String AO_TELEM_GPS_MONTH = "g_M"; + final static String AO_TELEM_GPS_DAY = "g_D"; + final static String AO_TELEM_GPS_HOUR = "g_h"; + final static String AO_TELEM_GPS_MINUTE = "g_m"; + final static String AO_TELEM_GPS_SECOND = "g_s"; + final static String AO_TELEM_GPS_VERTICAL_SPEED = "g_v"; + final static String AO_TELEM_GPS_HORIZONTAL_SPEED = "g_g"; + final static String AO_TELEM_GPS_COURSE = "g_c"; + final static String AO_TELEM_GPS_HDOP = "g_hd"; + final static String AO_TELEM_GPS_VDOP = "g_vd"; + final static String AO_TELEM_GPS_HERROR = "g_he"; + final static String AO_TELEM_GPS_VERROR = "g_ve"; + + /* + * GPS satellite values + * + * Name Value + * s_n Number of satellites reported (integer) + * s_v0 Space vehicle ID (integer) for report 0 + * s_c0 C/N0 number (integer) for report 0 + * s_v1 Space vehicle ID (integer) for report 1 + * s_c1 C/N0 number (integer) for report 1 + * ... + */ + + final static String AO_TELEM_SAT_NUM = "s_n"; + final static String AO_TELEM_SAT_SVID = "s_v"; + final static String AO_TELEM_SAT_C_N_0 = "s_c"; + + private void parse_v4(String[] words, int i) throws ParseException { + AltosTelemetryMap map = new AltosTelemetryMap(words, i); + + callsign = map.get_string(AO_TELEM_CALL, "N0CALL"); + serial = map.get_int(AO_TELEM_SERIAL, MISSING); + flight = map.get_int(AO_TELEM_FLIGHT, MISSING); + rssi = map.get_int(AO_TELEM_RSSI, MISSING); + state = Altos.state(map.get_string(AO_TELEM_STATE, "invalid")); + tick = map.get_int(AO_TELEM_TICK, 0); + + /* raw sensor values */ + accel = map.get_int(AO_TELEM_RAW_ACCEL, MISSING); + pres = map.get_int(AO_TELEM_RAW_BARO, MISSING); + temp = map.get_int(AO_TELEM_RAW_THERMO, MISSING); + batt = map.get_int(AO_TELEM_RAW_BATT, MISSING); + drogue = map.get_int(AO_TELEM_RAW_DROGUE, MISSING); + main = map.get_int(AO_TELEM_RAW_MAIN, MISSING); + + /* sensor calibration information */ + ground_accel = map.get_int(AO_TELEM_CAL_ACCEL_GROUND, MISSING); + ground_pres = map.get_int(AO_TELEM_CAL_BARO_GROUND, MISSING); + accel_plus_g = map.get_int(AO_TELEM_CAL_ACCEL_PLUS, MISSING); + accel_minus_g = map.get_int(AO_TELEM_CAL_ACCEL_MINUS, MISSING); + + /* flight computer values */ + acceleration = map.get_int(AO_TELEM_KALMAN_ACCEL, MISSING); + if (acceleration != MISSING) + acceleration /= 16.0; + speed = map.get_int(AO_TELEM_KALMAN_SPEED, MISSING); + if (speed != MISSING) + speed /= 16.0; + height = map.get_int(AO_TELEM_KALMAN_HEIGHT, MISSING); + + flight_accel = map.get_int(AO_TELEM_ADHOC_ACCEL, MISSING); + flight_vel = map.get_int(AO_TELEM_ADHOC_SPEED, MISSING); + flight_pres = map.get_int(AO_TELEM_ADHOC_BARO, MISSING); + + if (map.has(AO_TELEM_GPS_STATE)) + gps = new AltosGPS(map); + else + gps = null; + } + + private void parse_legacy(String[] words, int i) throws ParseException { AltosParse.word (words[i++], "CALL"); callsign = words[i++]; @@ -140,4 +346,27 @@ public class AltosTelemetry extends AltosRecord { gps = new AltosGPS(words, i, version); } + + public AltosTelemetry(String line) throws ParseException, AltosCRCException { + String[] words = line.split("\\s+"); + int i = 0; + + if (words[i].equals("CRC") && words[i+1].equals("INVALID")) { + i += 2; + AltosParse.word(words[i++], "RSSI"); + rssi = AltosParse.parse_int(words[i++]); + throw new AltosCRCException(rssi); + } + if (words[i].equals("CALL")) { + version = 0; + } else { + AltosParse.word (words[i++], "VERSION"); + version = AltosParse.parse_int(words[i++]); + } + + if (version < 4) + parse_legacy(words, i); + else + parse_v4(words, i); + } } diff --git a/altosui/AltosTelemetryIterable.java b/altosui/AltosTelemetryIterable.java index a71ab872..14b5f27f 100644 --- a/altosui/AltosTelemetryIterable.java +++ b/altosui/AltosTelemetryIterable.java @@ -63,7 +63,6 @@ public class AltosTelemetryIterable extends AltosRecordIterable { } catch (ParseException pe) { System.out.printf("parse exception %s\n", pe.getMessage()); } catch (AltosCRCException ce) { - System.out.printf("crc error\n"); } } } catch (IOException io) { diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 90e3d7f0..4d17b0d2 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -328,7 +328,7 @@ public class AltosUI extends JFrame { if (input.equals(output)) { System.out.printf("Not processing '%s'\n", input); } else { - AltosWriter writer = open_csv(output); + AltosWriter writer = open_csv("/dev/stdout"); if (writer != null) { writer.write(iterable); writer.close(); diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 288fca0e..49f34ce3 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -65,6 +65,7 @@ altosui_JAVA = \ AltosRecord.java \ AltosRecordIterable.java \ AltosTelemetryReader.java \ + AltosTelemetryMap.java \ AltosReplayReader.java \ AltosRomconfig.java \ AltosRomconfigUI.java \ diff --git a/src/ao_telem.h b/src/ao_telem.h index b1624fe0..1a8da291 100644 --- a/src/ao_telem.h +++ b/src/ao_telem.h @@ -108,7 +108,7 @@ * GPS values * * Name Value - * g_s GPS state (string): + * g GPS state (string): * l locked * u unlocked * e error (missing or broken) @@ -123,7 +123,7 @@ * g_m GPS minute (integer - 0-59) * g_s GPS second (integer - 0-59) * g_v GPS vertical speed (integer, cm/sec) - * g_s GPS horizontal speed (integer, cm/sec) + * g_g GPS horizontal speed (integer, cm/sec) * g_c GPS course (integer, 0-359) * g_hd GPS hdop (integer * 10) * g_vd GPS vdop (integer * 10) @@ -131,7 +131,7 @@ * g_ve GPS v error (integer) */ -#define AO_TELEM_GPS_STATE "g_s" +#define AO_TELEM_GPS_STATE "g" #define AO_TELEM_GPS_STATE_LOCKED 'l' #define AO_TELEM_GPS_STATE_UNLOCKED 'u' #define AO_TELEM_GPS_STATE_ERROR 'e' @@ -146,7 +146,7 @@ #define AO_TELEM_GPS_MINUTE "g_m" #define AO_TELEM_GPS_SECOND "g_s" #define AO_TELEM_GPS_VERTICAL_SPEED "g_v" -#define AO_TELEM_GPS_HORIZONTAL_SPEED "g_s" +#define AO_TELEM_GPS_HORIZONTAL_SPEED "g_g" #define AO_TELEM_GPS_COURSE "g_c" #define AO_TELEM_GPS_HDOP "g_hd" #define AO_TELEM_GPS_VDOP "g_vd" -- cgit v1.2.3 From 2c121f1ef495e8af3eb39210baa40e212b691894 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 25 Mar 2011 22:04:09 -0700 Subject: altosui: swing hide/show methods are deprecated I don't know why, but they are, so just replace them with setVisible calls. Signed-off-by: Keith Packard --- altosui/AltosAscent.java | 8 ++++---- altosui/AltosDescent.java | 32 ++++++++++++++++---------------- altosui/AltosLanded.java | 8 ++++---- altosui/AltosPad.java | 20 ++++++++++---------- 4 files changed, 34 insertions(+), 34 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index 0fbc5de2..8a4aa58b 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -89,13 +89,13 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { } void show() { - label.show(); - value.show(); + label.setVisible(true); + value.setVisible(true); } void hide() { - label.hide(); - value.hide(); + label.setVisible(false); + value.setVisible(false); } public AscentValue (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 594a7a09..addd6878 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -39,15 +39,15 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { abstract void show(AltosState state, int crc_errors); void show() { - label.show(); - value.show(); - lights.show(); + label.setVisible(true); + value.setVisible(true); + lights.setVisible(true); } void hide() { - label.hide(); - value.hide(); - lights.hide(); + label.setVisible(false); + value.setVisible(false); + lights.setVisible(false); } void reset() { @@ -104,13 +104,13 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { abstract void show(AltosState state, int crc_errors); void show() { - label.show(); - value.show(); + label.setVisible(true); + value.setVisible(true); } void hide() { - label.hide(); - value.hide(); + label.setVisible(false); + value.setVisible(false); } void show(String format, double v) { @@ -158,15 +158,15 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { } void show() { - label.show(); - value1.show(); - value2.show(); + label.setVisible(true); + value1.setVisible(true); + value2.setVisible(true); } void hide() { - label.hide(); - value1.hide(); - value2.hide(); + label.setVisible(false); + value1.setVisible(false); + value2.setVisible(false); } abstract void show(AltosState state, int crc_errors); diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 0717ffe2..63a2daf6 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -43,13 +43,13 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { } void show() { - label.show(); - value.show(); + label.setVisible(true); + value.setVisible(true); } void hide() { - label.hide(); - value.hide(); + label.setVisible(false); + value.setVisible(false); } void show(String format, double v) { diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 2f59e879..2d800e8a 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -43,15 +43,15 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { } public void show() { - label.show(); - value.show(); - lights.show(); + label.setVisible(true); + value.setVisible(true); + lights.setVisible(true); } public void hide() { - label.hide(); - value.hide(); - lights.hide(); + label.setVisible(false); + value.setVisible(false); + lights.setVisible(false); } public LaunchStatus (GridBagLayout layout, int y, String text) { @@ -96,13 +96,13 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { void show(AltosState state, int crc_errors) {} void show() { - label.show(); - value.show(); + label.setVisible(true); + value.setVisible(true); } void hide() { - label.hide(); - value.hide(); + label.setVisible(false); + value.setVisible(false); } void reset() { -- cgit v1.2.3 From 8f80f5705d64469bcfb00ff11aee68364edb271b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 6 Jul 2011 21:38:57 -0700 Subject: altosui: Don't show missing igniter and gps values The new telemetry stuff leaves state.gps always set (but empty), which seems fine, we just need to look at state.gps.connected to see if there's a GPS receiver on board. For TeleNano, we also want to hide the igniter status fields as they won't have any data present. Signed-off-by: Keith Packard --- altosui/AltosAscent.java | 41 +++++++++++++++++++++++++++++++++-------- altosui/AltosDescent.java | 17 ++++++++++++----- altosui/AltosFlightUI.java | 4 ++-- altosui/AltosInfoTable.java | 8 +++++--- altosui/AltosLanded.java | 6 +++--- altosui/AltosPad.java | 14 +++++++++++--- 6 files changed, 66 insertions(+), 24 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index 8a4aa58b..d607b0c5 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -36,6 +36,18 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { JTextField value; AltosLights lights; + void show() { + value.setVisible(true); + lights.setVisible(true); + label.setVisible(true); + } + + void hide() { + value.setVisible(false); + lights.setVisible(false); + label.setVisible(false); + } + void show(AltosState state, int crc_errors) {} void reset() { value.setText(""); @@ -136,14 +148,19 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { void reset() { value.setText(""); max_value.setText(""); - max = 0; + max = AltosRecord.MISSING; } void show(String format, double v) { - value.setText(String.format(format, v)); - if (v > max) { - max_value.setText(String.format(format, v)); - max = v; + if (v == AltosRecord.MISSING) { + value.setText("Missing"); + max_value.setText("Missing"); + } else { + value.setText(String.format(format, v)); + if (v > max || max == AltosRecord.MISSING) { + max_value.setText(String.format(format, v)); + max = v; + } } } public AscentValueHold (GridBagLayout layout, int y, String text) { @@ -233,6 +250,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Apogee extends AscentStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.drogue_sense)); lights.set(state.drogue_sense > 3.2); } @@ -245,6 +263,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Main extends AscentStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.main_sense)); lights.set(state.main_sense > 3.2); } @@ -296,7 +315,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { } public void show(AltosState state, int crc_errors) { - if (state.gps != null) { + if (state.gps != null && state.gps.connected) { lat.show(state, crc_errors); lon.show(state, crc_errors); } else { @@ -304,8 +323,14 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { lon.hide(); } height.show(state, crc_errors); - main.show(state, crc_errors); - apogee.show(state, crc_errors); + if (state.main_sense != AltosRecord.MISSING) + main.show(state, crc_errors); + else + main.hide(); + if (state.drogue_sense != AltosRecord.MISSING) + apogee.show(state, crc_errors); + else + apogee.hide(); speed.show(state, crc_errors); accel.show(state, crc_errors); } diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index addd6878..2a9e7eef 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -258,7 +258,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class Lat extends DescentValue { void show (AltosState state, int crc_errors) { - if (state.gps != null) + if (state.gps != null && state.gps.connected) show(pos(state.gps.lat,"N", "S")); else show("???"); @@ -272,7 +272,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class Lon extends DescentValue { void show (AltosState state, int crc_errors) { - if (state.gps != null) + if (state.gps != null && state.gps.connected) show(pos(state.gps.lon,"W", "E")); else show("???"); @@ -286,6 +286,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class Apogee extends DescentStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.drogue_sense)); lights.set(state.drogue_sense > 3.2); } @@ -363,7 +364,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { public void show(AltosState state, int crc_errors) { height.show(state, crc_errors); speed.show(state, crc_errors); - if (state.gps != null) { + if (state.gps != null && state.gps.connected) { bearing.show(state, crc_errors); range.show(state, crc_errors); elevation.show(state, crc_errors); @@ -376,8 +377,14 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { lat.hide(); lon.hide(); } - main.show(state, crc_errors); - apogee.show(state, crc_errors); + if (state.main_sense != AltosRecord.MISSING) + main.show(state, crc_errors); + else + main.hide(); + if (state.drogue_sense != AltosRecord.MISSING) + apogee.show(state, crc_errors); + else + apogee.hide(); } public AltosDescent() { diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 5f1fc678..9536c4bb 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -156,8 +156,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { // Telemetry format menu telemetries = new JComboBox(); - telemetries.addItem("Legacy TeleMetrum"); - telemetries.addItem("Split Telemetry"); + telemetries.addItem("Original TeleMetrum Telemetry"); + telemetries.addItem("Standard AltOS Telemetry"); int telemetry = 1; telemetry = AltosPreferences.telemetry(serial); if (telemetry > Altos.ao_telemetry_split) diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 723f8301..8ebeaba1 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -107,10 +107,12 @@ public class AltosInfoTable extends JTable { info_add_row(0, "Max Speed", "%8.1f m/s", state.max_speed); info_add_row(0, "Temperature", "%9.2f °C", state.temperature); info_add_row(0, "Battery", "%9.2f V", state.battery); - info_add_row(0, "Drogue", "%9.2f V", state.drogue_sense); - info_add_row(0, "Main", "%9.2f V", state.main_sense); + if (state.drogue_sense != AltosRecord.MISSING) + info_add_row(0, "Drogue", "%9.2f V", state.drogue_sense); + if (state.main_sense != AltosRecord.MISSING) + info_add_row(0, "Main", "%9.2f V", state.main_sense); info_add_row(0, "Pad altitude", "%6.0f m", state.ground_altitude); - if (state.gps == null) { + if (state.gps == null || !state.gps.connected) { info_add_row(1, "GPS", "not available"); } else { if (state.gps_ready) diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 63a2daf6..d5c8e434 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -99,7 +99,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { class Lat extends LandedValue { void show (AltosState state, int crc_errors) { show(); - if (state.gps != null) + if (state.gps != null && state.gps.connected) value.setText(pos(state.gps.lat,"N", "S")); else value.setText("???"); @@ -114,7 +114,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { class Lon extends LandedValue { void show (AltosState state, int crc_errors) { show(); - if (state.gps != null) + if (state.gps != null && state.gps.connected) value.setText(pos(state.gps.lon,"E", "W")); else value.setText("???"); @@ -200,7 +200,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { } public void show(AltosState state, int crc_errors) { - if (state.gps != null) { + if (state.gps != null && state.gps.connected) { bearing.show(state, crc_errors); distance.show(state, crc_errors); lat.show(state, crc_errors); diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 2d800e8a..d08925be 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -149,6 +149,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class Apogee extends LaunchStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.drogue_sense)); lights.set(state.drogue_sense > 3.2); } @@ -161,6 +162,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { class Main extends LaunchStatus { void show (AltosState state, int crc_errors) { + show(); value.setText(String.format("%4.2f V", state.main_sense)); lights.set(state.main_sense > 3.2); } @@ -259,10 +261,16 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { public void show(AltosState state, int crc_errors) { battery.show(state, crc_errors); - apogee.show(state, crc_errors); - main.show(state, crc_errors); + if (state.drogue_sense == AltosRecord.MISSING) + apogee.hide(); + else + apogee.show(state, crc_errors); + if (state.main_sense == AltosRecord.MISSING) + main.hide(); + else + main.show(state, crc_errors); pad_alt.show(state, crc_errors); - if (state.gps != null) { + if (state.gps != null && state.gps.connected) { gps_locked.show(state, crc_errors); gps_ready.show(state, crc_errors); pad_lat.show(state, crc_errors); -- cgit v1.2.3 From 9e1487b1a5db0afd1d23c86d82c60b1c1a62aab0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 10 Aug 2011 14:08:21 -0700 Subject: altosui: Add a 'Graph Flight' button to the 'landed' tab This lets you see the results of a flight as soon as the rocket lands using the telemetry data. Signed-off-by: Keith Packard --- altosui/AltosFlightReader.java | 2 ++ altosui/AltosFlightStats.java | 6 ++-- altosui/AltosFlightUI.java | 2 +- altosui/AltosLanded.java | 59 +++++++++++++++++++++++++++++++++++++-- altosui/AltosLog.java | 6 ++++ altosui/AltosReplayReader.java | 8 ++++-- altosui/AltosTelemetryReader.java | 4 +++ altosui/AltosUI.java | 10 +++++-- 8 files changed, 86 insertions(+), 11 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosFlightReader.java b/altosui/AltosFlightReader.java index 3a171444..47df375d 100644 --- a/altosui/AltosFlightReader.java +++ b/altosui/AltosFlightReader.java @@ -42,4 +42,6 @@ public class AltosFlightReader { void save_telemetry() { } void update(AltosState state) throws InterruptedException { } + + File backing_file() { return null; } } diff --git a/altosui/AltosFlightStats.java b/altosui/AltosFlightStats.java index e38142f0..e644b0ba 100644 --- a/altosui/AltosFlightStats.java +++ b/altosui/AltosFlightStats.java @@ -85,11 +85,11 @@ public class AltosFlightStats { } } - public AltosFlightStats(AltosRecordIterable iterable, String filename) throws InterruptedException, IOException { - this(new AltosReplayReader(iterable.iterator(), filename)); + public AltosFlightStats(AltosRecordIterable iterable, File file) throws InterruptedException, IOException { + this(new AltosReplayReader(iterable.iterator(), file)); } public AltosFlightStats(AltosRecordIterable iterable) throws InterruptedException, IOException { - this(iterable, ""); + this(iterable, new File("")); } } diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index c31e02bf..f0626e7c 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -210,7 +210,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { descent = new AltosDescent(); pane.add("Descent", descent); - landed = new AltosLanded(); + landed = new AltosLanded(reader); pane.add("Landed", landed); flightInfo = new AltosInfoTable(); diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index d5c8e434..47aca29d 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -28,7 +28,7 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; -public class AltosLanded extends JComponent implements AltosFlightDisplay { +public class AltosLanded extends JComponent implements AltosFlightDisplay, ActionListener { GridBagLayout layout; Font label_font; Font value_font; @@ -214,11 +214,51 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { height.show(state, crc_errors); speed.show(state, crc_errors); accel.show(state, crc_errors); + if (reader.backing_file() != null) + graph.setEnabled(true); } - public AltosLanded() { + JButton graph; + AltosFlightReader reader; + + public void actionPerformed(ActionEvent e) { + String cmd = e.getActionCommand(); + + if (cmd.equals("graph")) { + File file = reader.backing_file(); + if (file != null) { + String filename = file.getName(); + try { + AltosRecordIterable records = null; + if (filename.endsWith("eeprom")) { + FileInputStream in = new FileInputStream(file); + records = new AltosEepromIterable(in); + } else if (filename.endsWith("telem")) { + FileInputStream in = new FileInputStream(file); + records = new AltosTelemetryIterable(in); + } else { + throw new FileNotFoundException(); + } + try { + new AltosGraphUI(records); + } catch (InterruptedException ie) { + } catch (IOException ie) { + } + } catch (FileNotFoundException fe) { + JOptionPane.showMessageDialog(null, + filename, + "Cannot open file", + JOptionPane.ERROR_MESSAGE); + } + } + } + } + + public AltosLanded(AltosFlightReader in_reader) { layout = new GridBagLayout(); + reader = in_reader; + label_font = new Font("Dialog", Font.PLAIN, 22); value_font = new Font("Monospaced", Font.PLAIN, 22); setLayout(layout); @@ -231,5 +271,20 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay { height = new Height(layout, 4); speed = new Speed(layout, 5); accel = new Accel(layout, 6); + + graph = new JButton ("Graph Flight"); + graph.setActionCommand("graph"); + graph.addActionListener(this); + graph.setEnabled(false); + + GridBagConstraints c = new GridBagConstraints(); + + c.gridx = 0; c.gridy = 7; + c.insets = new Insets(10, 10, 10, 10); + c.anchor = GridBagConstraints.WEST; + c.weightx = 0; + c.weighty = 0; + c.fill = GridBagConstraints.VERTICAL; + add(graph, c); } } diff --git a/altosui/AltosLog.java b/altosui/AltosLog.java index 6157a656..a5f1830d 100644 --- a/altosui/AltosLog.java +++ b/altosui/AltosLog.java @@ -35,6 +35,7 @@ class AltosLog implements Runnable { int flight; FileWriter log_file; Thread log_thread; + AltosFile file; private void close_log_file() { if (log_file != null) { @@ -54,6 +55,10 @@ class AltosLog implements Runnable { } } + File file() { + return file; + } + boolean open (AltosRecord telem) throws IOException { AltosFile a = new AltosFile(telem); @@ -69,6 +74,7 @@ class AltosLog implements Runnable { } } log_file.flush(); + file = a; } return log_file != null; } diff --git a/altosui/AltosReplayReader.java b/altosui/AltosReplayReader.java index 4e5e1d93..eed56cff 100644 --- a/altosui/AltosReplayReader.java +++ b/altosui/AltosReplayReader.java @@ -34,6 +34,7 @@ import java.util.concurrent.LinkedBlockingQueue; public class AltosReplayReader extends AltosFlightReader { Iterator iterator; + File file; public AltosRecord read() { if (iterator.hasNext()) @@ -50,8 +51,11 @@ public class AltosReplayReader extends AltosFlightReader { Thread.sleep((int) (Math.min(state.time_change,10) * 1000)); } - public AltosReplayReader(Iterator in_iterator, String in_name) { + public File backing_file() { return file; } + + public AltosReplayReader(Iterator in_iterator, File in_file) { iterator = in_iterator; - name = in_name; + file = in_file; + name = file.getName(); } } diff --git a/altosui/AltosTelemetryReader.java b/altosui/AltosTelemetryReader.java index 6abe95d8..1f327a67 100644 --- a/altosui/AltosTelemetryReader.java +++ b/altosui/AltosTelemetryReader.java @@ -69,6 +69,10 @@ class AltosTelemetryReader extends AltosFlightReader { AltosPreferences.set_telemetry(device.getSerial(), telemetry); } + File backing_file() { + return log.file(); + } + public AltosTelemetryReader (AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException, IOException, InterruptedException, TimeoutException { device = in_device; diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index fefe74e8..62e612ed 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -276,7 +276,7 @@ public class AltosUI extends JFrame { AltosRecordIterable iterable = chooser.runDialog(); if (iterable != null) { AltosFlightReader reader = new AltosReplayReader(iterable.iterator(), - chooser.filename()); + chooser.file()); new AltosFlightUI(voice, reader); } } @@ -310,7 +310,11 @@ public class AltosUI extends JFrame { AltosRecordIterable record_reader = chooser.runDialog(); if (record_reader == null) return; - new AltosGraphUI(record_reader); + try { + new AltosGraphUI(record_reader); + } catch (InterruptedException ie) { + } catch (IOException ie) { + } } private void ConfigureAltosUI() { @@ -427,7 +431,7 @@ public class AltosUI extends JFrame { } else { recs = new AltosTelemetryIterable(in); } - reader = new AltosReplayReader(recs.iterator(), filename); + reader = new AltosReplayReader(recs.iterator(), new File(filename)); AltosFlightUI flight_ui = new AltosFlightUI(new AltosVoice(), reader); flight_ui.set_exit_on_close(); return; -- cgit v1.2.3 From 4e2fd7ae76c23aa8da1390ebcbd8f45276cd7a32 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 22 Aug 2011 18:24:54 -0700 Subject: altosui: Show filename in AltosGraph window Makes it easier to tell multiple windows apart Signed-off-by: Keith Packard --- altosui/AltosGraphUI.java | 4 ++-- altosui/AltosLanded.java | 2 +- altosui/AltosUI.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 16b0fd48..be52bd4e 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -178,8 +178,8 @@ public class AltosGraphUI extends JFrame } } - public AltosGraphUI(AltosRecordIterable records) throws InterruptedException, IOException { - super("Altos Graph"); + public AltosGraphUI(AltosRecordIterable records, String name) throws InterruptedException, IOException { + super(String.format("Altos Graph %s", name)); AltosDataPointReader reader = new AltosDataPointReader (records); if (reader == null) diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 47aca29d..71c10663 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -240,7 +240,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio throw new FileNotFoundException(); } try { - new AltosGraphUI(records); + new AltosGraphUI(records, filename); } catch (InterruptedException ie) { } catch (IOException ie) { } diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index b2c5107e..0317f569 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -311,7 +311,7 @@ public class AltosUI extends JFrame { if (record_reader == null) return; try { - new AltosGraphUI(record_reader); + new AltosGraphUI(record_reader, chooser.filename()); } catch (InterruptedException ie) { } catch (IOException ie) { } -- cgit v1.2.3 From cbfbaabb39f9f7709d00cf3dc63cc1bc7563062e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 24 Aug 2011 19:13:03 -0700 Subject: altosui: Make flight monitor font size configurable Tiny netbooks aren't tall enough for the 'usual' font size, so provide a smaller option. Then provide a bigger option, just because. Signed-off-by: Keith Packard --- altosui/Altos.java | 42 ++++++++++++++++++++++++++-- altosui/AltosAscent.java | 30 +++++++++++++++++++- altosui/AltosCompanionInfo.java | 15 +++++----- altosui/AltosConfigureUI.java | 61 +++++++++++++++++++++++++++++++---------- altosui/AltosDescent.java | 28 +++++++++++++++++++ altosui/AltosFlightDisplay.java | 2 ++ altosui/AltosFlightStatus.java | 14 ++++++++++ altosui/AltosFlightUI.java | 21 +++++++++++++- altosui/AltosFontListener.java | 22 +++++++++++++++ altosui/AltosIdleMonitorUI.java | 5 ++++ altosui/AltosInfoTable.java | 12 ++++---- altosui/AltosLanded.java | 23 ++++++++++++---- altosui/AltosPad.java | 22 +++++++++++++++ altosui/AltosPreferences.java | 42 ++++++++++++++++++++++++++++ altosui/AltosSiteMap.java | 4 +++ altosui/Makefile.am | 1 + doc/altusmetrum.xsl | 7 +++++ 17 files changed, 314 insertions(+), 37 deletions(-) create mode 100644 altosui/AltosFontListener.java (limited to 'altosui/AltosLanded.java') diff --git a/altosui/Altos.java b/altosui/Altos.java index ddf1005a..e4f974f9 100644 --- a/altosui/Altos.java +++ b/altosui/Altos.java @@ -97,9 +97,45 @@ public class Altos { static final int tab_elt_pad = 5; - static final Font label_font = new Font("Dialog", Font.PLAIN, 22); - static final Font value_font = new Font("Monospaced", Font.PLAIN, 22); - static final Font status_font = new Font("SansSerif", Font.BOLD, 24); + static Font label_font; + static Font value_font; + static Font status_font; + static Font table_label_font; + static Font table_value_font; + + final static int font_size_small = 1; + final static int font_size_medium = 2; + final static int font_size_large = 3; + + static void set_fonts(int size) { + int brief_size; + int table_size; + int status_size; + + switch (size) { + case font_size_small: + brief_size = 16; + status_size = 18; + table_size = 11; + break; + default: + case font_size_medium: + brief_size = 22; + status_size = 24; + table_size = 14; + break; + case font_size_large: + brief_size = 26; + status_size = 30; + table_size = 17; + break; + } + label_font = new Font("Dialog", Font.PLAIN, brief_size); + value_font = new Font("Monospaced", Font.PLAIN, brief_size); + status_font = new Font("SansSerif", Font.BOLD, status_size); + table_label_font = new Font("SansSerif", Font.PLAIN, table_size); + table_value_font = new Font("Monospaced", Font.PLAIN, table_size); + } static final int text_width = 20; diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index d607b0c5..c8e5f3af 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -30,6 +30,7 @@ import java.util.concurrent.LinkedBlockingQueue; public class AltosAscent extends JComponent implements AltosFlightDisplay { GridBagLayout layout; + JLabel cur, max; public class AscentStatus { JLabel label; @@ -54,6 +55,11 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { lights.set(false); } + void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + public AscentStatus (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -109,6 +115,11 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { label.setVisible(false); value.setVisible(false); } + void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + public AscentValue (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -151,6 +162,12 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { max = AltosRecord.MISSING; } + void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + max_value.setFont(Altos.value_font); + } + void show(String format, double v) { if (v == AltosRecord.MISSING) { value.setText("Missing"); @@ -314,6 +331,18 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { accel.reset(); } + public void set_font() { + cur.setFont(Altos.label_font); + max.setFont(Altos.label_font); + lat.set_font(); + lon.set_font(); + main.set_font(); + apogee.set_font(); + height.set_font(); + speed.set_font(); + accel.set_font(); + } + public void show(AltosState state, int crc_errors) { if (state.gps != null && state.gps.connected) { lat.show(state, crc_errors); @@ -337,7 +366,6 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { public void labels(GridBagLayout layout, int y) { GridBagConstraints c; - JLabel cur, max; cur = new JLabel("Current"); cur.setFont(Altos.label_font); diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index f287a8ea..82bde623 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -31,25 +31,26 @@ import java.util.concurrent.LinkedBlockingQueue; public class AltosCompanionInfo extends JTable { private AltosFlightInfoTableModel model; - private Font infoLabelFont = new Font("SansSerif", Font.PLAIN, 14); - private Font infoValueFont = new Font("Monospaced", Font.PLAIN, 14); - static final int info_columns = 2; static final int info_rows = 17; int desired_row_height() { - FontMetrics infoValueMetrics = getFontMetrics(infoValueFont); + FontMetrics infoValueMetrics = getFontMetrics(Altos.table_value_font); return (infoValueMetrics.getHeight() + infoValueMetrics.getLeading()) * 18 / 10; } + public void set_font() { + setFont(Altos.table_value_font); + setRowHeight(desired_row_height()); + doLayout(); + } + public AltosCompanionInfo() { super(new AltosFlightInfoTableModel(info_rows, info_columns)); model = (AltosFlightInfoTableModel) getModel(); - setFont(infoValueFont); setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS); setShowGrid(true); - setRowHeight(desired_row_height()); - doLayout(); + set_font(); } public Dimension getPreferredScrollableViewportSize() { diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index 0c865d0e..bcb9636b 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -47,12 +47,17 @@ public class AltosConfigureUI JLabel callsign_label; JTextField callsign_value; + JLabel font_size_label; + JComboBox font_size_value; + JRadioButton serial_debug; // BLUETOOTH // JButton manage_bluetooth; JButton manage_frequencies; + final static String[] font_size_names = { "Small", "Medium", "Large" }; + /* DocumentListener interface methods */ public void changedUpdate(DocumentEvent e) { AltosPreferences.set_callsign(callsign_value.getText()); @@ -73,6 +78,8 @@ public class AltosConfigureUI Insets insets = new Insets(4, 4, 4, 4); + int row = 0; + owner = in_owner; voice = in_voice; pane = getContentPane(); @@ -85,14 +92,14 @@ public class AltosConfigureUI /* Nice label at the top */ c.gridx = 0; - c.gridy = 0; + c.gridy = row++; c.gridwidth = 3; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; pane.add(new JLabel ("Configure AltOS UI"), c); c.gridx = 0; - c.gridy = 1; + c.gridy = row++; c.gridwidth = 3; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; @@ -100,7 +107,7 @@ public class AltosConfigureUI /* Voice settings */ c.gridx = 0; - c.gridy = 2; + c.gridy = row; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.WEST; @@ -119,7 +126,7 @@ public class AltosConfigureUI } }); c.gridx = 1; - c.gridy = 2; + c.gridy = row; c.gridwidth = 1; c.weightx = 1; c.fill = GridBagConstraints.NONE; @@ -128,7 +135,7 @@ public class AltosConfigureUI enable_voice.setToolTipText("Enable/Disable all audio in-flight announcements"); c.gridx = 2; - c.gridy = 2; + c.gridy = row++; c.gridwidth = 1; c.weightx = 1; c.fill = GridBagConstraints.NONE; @@ -144,7 +151,7 @@ public class AltosConfigureUI /* Log directory settings */ c.gridx = 0; - c.gridy = 3; + c.gridy = row; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.WEST; @@ -158,7 +165,7 @@ public class AltosConfigureUI } }); c.gridx = 1; - c.gridy = 3; + c.gridy = row++; c.gridwidth = 2; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.WEST; @@ -167,7 +174,7 @@ public class AltosConfigureUI /* Callsign setting */ c.gridx = 0; - c.gridy = 4; + c.gridy = row; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.WEST; @@ -176,16 +183,42 @@ public class AltosConfigureUI callsign_value = new JTextField(AltosPreferences.callsign()); callsign_value.getDocument().addDocumentListener(this); c.gridx = 1; - c.gridy = 4; + c.gridy = row++; c.gridwidth = 2; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.WEST; pane.add(callsign_value, c); callsign_value.setToolTipText("Callsign sent in packet mode"); + /* Font size setting */ + c.gridx = 0; + c.gridy = row; + c.gridwidth = 1; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.WEST; + pane.add(new JLabel("Font size"), c); + + font_size_value = new JComboBox(font_size_names); + int font_size = AltosPreferences.font_size(); + font_size_value.setSelectedIndex(font_size - Altos.font_size_small); + font_size_value.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + int size = font_size_value.getSelectedIndex() + Altos.font_size_small; + + AltosPreferences.set_font_size(size); + } + }); + c.gridx = 1; + c.gridy = row++; + c.gridwidth = 2; + c.fill = GridBagConstraints.BOTH; + c.anchor = GridBagConstraints.WEST; + pane.add(font_size_value, c); + font_size_value.setToolTipText("Font size used in telemetry window"); + /* Serial debug setting */ c.gridx = 0; - c.gridy = 5; + c.gridy = row; c.gridwidth = 1; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.WEST; @@ -202,7 +235,7 @@ public class AltosConfigureUI serial_debug.setToolTipText("Enable/Disable USB I/O getting sent to the console"); c.gridx = 1; - c.gridy = 5; + c.gridy = row++; c.gridwidth = 3; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.WEST; @@ -216,7 +249,7 @@ public class AltosConfigureUI // } // }); // c.gridx = 0; -// c.gridy = 6; +// c.gridy = row++; // c.gridwidth = 2; // c.fill = GridBagConstraints.NONE; // c.anchor = GridBagConstraints.WEST; @@ -232,7 +265,7 @@ public class AltosConfigureUI // BLUETOOTH // c.gridx = 2; c.gridx = 1; - c.gridy = 6; + c.gridy = row++; c.gridwidth = 2; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.WEST; @@ -246,7 +279,7 @@ public class AltosConfigureUI } }); c.gridx = 0; - c.gridy = 7; + c.gridy = row++; c.gridwidth = 3; c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.CENTER; diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 2a9e7eef..0fcd690b 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -55,6 +55,11 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { lights.set(false); } + void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + public DescentStatus (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -121,6 +126,11 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { value.setText(v); } + void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + public DescentValue (GridBagLayout layout, int x, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -169,6 +179,12 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { value2.setVisible(false); } + void set_font() { + label.setFont(Altos.label_font); + value1.setFont(Altos.value_font); + value2.setFont(Altos.value_font); + } + abstract void show(AltosState state, int crc_errors); void show(String v1, String v2) { @@ -361,6 +377,18 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { apogee.reset(); } + public void set_font() { + lat.set_font(); + lon.set_font(); + height.set_font(); + speed.set_font(); + bearing.set_font(); + range.set_font(); + elevation.set_font(); + main.set_font(); + apogee.set_font(); + } + public void show(AltosState state, int crc_errors) { height.show(state, crc_errors); speed.show(state, crc_errors); diff --git a/altosui/AltosFlightDisplay.java b/altosui/AltosFlightDisplay.java index d18d1d1f..f633c8e6 100644 --- a/altosui/AltosFlightDisplay.java +++ b/altosui/AltosFlightDisplay.java @@ -21,4 +21,6 @@ public interface AltosFlightDisplay { void reset(); void show(AltosState state, int crc_errors); + + void set_font(); } diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index 59c9e9db..ed273384 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -40,6 +40,12 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay void reset() { value.setText(""); } + + void set_font() { + label.setFont(Altos.status_font); + value.setFont(Altos.status_font); + } + public FlightValue (GridBagLayout layout, int x, String text) { GridBagConstraints c = new GridBagConstraints(); c.insets = new Insets(5, 5, 5, 5); @@ -127,6 +133,14 @@ public class AltosFlightStatus extends JComponent implements AltosFlightDisplay rssi.reset(); } + public void set_font () { + call.set_font(); + serial.set_font(); + flight.set_font(); + flight_state.set_font(); + rssi.set_font(); + } + public void show (AltosState state, int crc_errors) { call.show(state, crc_errors); serial.show(state, crc_errors); diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index abe08a18..b44b9d43 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -28,7 +28,7 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; -public class AltosFlightUI extends JFrame implements AltosFlightDisplay { +public class AltosFlightUI extends JFrame implements AltosFlightDisplay, AltosFontListener { AltosVoice voice; AltosFlightReader reader; AltosDisplayThread thread; @@ -83,6 +83,21 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { sitemap.reset(); } + public void set_font() { + pad.set_font(); + ascent.set_font(); + descent.set_font(); + landed.set_font(); + flightStatus.set_font(); + flightInfo.set_font(); + sitemap.set_font(); + companion.set_font(); + } + + public void font_size_changed(int font_size) { + set_font(); + } + public void show(AltosState state, int crc_errors) { JComponent tab = which_tab(state); try { @@ -254,12 +269,16 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { bag.add(pane, c); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + AltosPreferences.register_font_listener(this); + addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { disconnect(); setVisible(false); dispose(); + AltosPreferences.unregister_font_listener(AltosFlightUI.this); if (exit_on_close) System.exit(0); } diff --git a/altosui/AltosFontListener.java b/altosui/AltosFontListener.java new file mode 100644 index 00000000..0dda0f29 --- /dev/null +++ b/altosui/AltosFontListener.java @@ -0,0 +1,22 @@ +/* + * 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; version 2 of the License. + * + * 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; + +public interface AltosFontListener { + void font_size_changed(int font_size); +} diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 142f0278..988a797c 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -284,6 +284,11 @@ public class AltosIdleMonitorUI extends JFrame implements AltosFlightDisplay { flightInfo.clear(); } + public void set_font() { + pad.set_font(); + flightInfo.set_font(); + } + public void show(AltosState state, int crc_errors) { try { pad.show(state, crc_errors); diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 8ebeaba1..c023369e 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -31,27 +31,29 @@ import java.util.concurrent.LinkedBlockingQueue; public class AltosInfoTable extends JTable { private AltosFlightInfoTableModel model; - private Font infoLabelFont = new Font("SansSerif", Font.PLAIN, 14); - private Font infoValueFont = new Font("Monospaced", Font.PLAIN, 14); - static final int info_columns = 3; static final int info_rows = 17; int desired_row_height() { - FontMetrics infoValueMetrics = getFontMetrics(infoValueFont); + FontMetrics infoValueMetrics = getFontMetrics(Altos.table_value_font); return (infoValueMetrics.getHeight() + infoValueMetrics.getLeading()) * 18 / 10; } public AltosInfoTable() { super(new AltosFlightInfoTableModel(info_rows, info_columns)); model = (AltosFlightInfoTableModel) getModel(); - setFont(infoValueFont); + setFont(Altos.table_value_font); setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS); setShowGrid(true); setRowHeight(desired_row_height()); doLayout(); } + public void set_font() { + setFont(Altos.table_value_font); + doLayout(); + } + public Dimension getPreferredScrollableViewportSize() { return getPreferredSize(); } diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 71c10663..50e6b542 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -30,8 +30,6 @@ import java.util.concurrent.LinkedBlockingQueue; public class AltosLanded extends JComponent implements AltosFlightDisplay, ActionListener { GridBagLayout layout; - Font label_font; - Font value_font; public class LandedValue { JLabel label; @@ -47,6 +45,11 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio value.setVisible(true); } + public void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + void hide() { label.setVisible(false); value.setVisible(false); @@ -63,7 +66,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio c.weighty = 1; label = new JLabel(text); - label.setFont(label_font); + label.setFont(Altos.label_font); label.setHorizontalAlignment(SwingConstants.LEFT); c.gridx = 0; c.gridy = y; c.insets = new Insets(10, 10, 10, 10); @@ -74,7 +77,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio add(label); value = new JTextField(Altos.text_width); - value.setFont(value_font); + value.setFont(Altos.value_font); value.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = 1; c.gridy = y; c.anchor = GridBagConstraints.WEST; @@ -199,6 +202,16 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio accel.reset(); } + public void set_font() { + lat.set_font(); + lon.set_font(); + bearing.set_font(); + distance.set_font(); + height.set_font(); + speed.set_font(); + accel.set_font(); + } + public void show(AltosState state, int crc_errors) { if (state.gps != null && state.gps.connected) { bearing.show(state, crc_errors); @@ -259,8 +272,6 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio reader = in_reader; - label_font = new Font("Dialog", Font.PLAIN, 22); - value_font = new Font("Monospaced", Font.PLAIN, 22); setLayout(layout); /* Elements in descent display */ diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 3a8d04fe..6ef66f7a 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -54,6 +54,11 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { lights.setVisible(false); } + public void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + public LaunchStatus (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -105,6 +110,11 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { value.setVisible(false); } + public void set_font() { + label.setFont(Altos.label_font); + value.setFont(Altos.value_font); + } + void reset() { value.setText(""); } @@ -282,6 +292,18 @@ public class AltosPad extends JComponent implements AltosFlightDisplay { pad_alt.reset(); } + public void set_font() { + battery.set_font(); + apogee.set_font(); + main.set_font(); + logging_ready.set_font(); + gps_locked.set_font(); + gps_ready.set_font(); + pad_lat.set_font(); + pad_lon.set_font(); + pad_alt.set_font(); + } + public void show(AltosState state, int crc_errors) { battery.show(state, crc_errors); if (state.drogue_sense == AltosRecord.MISSING) diff --git a/altosui/AltosPreferences.java b/altosui/AltosPreferences.java index de926b38..716559ab 100644 --- a/altosui/AltosPreferences.java +++ b/altosui/AltosPreferences.java @@ -55,6 +55,9 @@ class AltosPreferences { /* scanning telemetry preferences name */ final static String scanningTelemetryPreference = "SCANNING-TELEMETRY"; + /* font size preferences name */ + final static String fontSizePreference = "FONT-SIZE"; + /* Default logdir is ~/TeleMetrum */ final static String logdirName = "TeleMetrum"; @@ -88,6 +91,10 @@ class AltosPreferences { /* Scanning telemetry */ static int scanning_telemetry; + static LinkedList font_listeners; + + static int font_size = Altos.font_size_medium; + /* List of frequencies */ final static String common_frequencies_node_name = "COMMON-FREQUENCIES"; static AltosFrequency[] common_frequencies; @@ -164,6 +171,11 @@ class AltosPreferences { scanning_telemetry = preferences.getInt(scanningTelemetryPreference,(1 << Altos.ao_telemetry_standard)); + font_listeners = new LinkedList(); + + font_size = preferences.getInt(fontSizePreference, Altos.font_size_medium); + Altos.set_fonts(font_size); + String firmwaredir_string = preferences.get(firmwaredirPreference, null); if (firmwaredir_string != null) firmwaredir = new File(firmwaredir_string); @@ -335,6 +347,36 @@ class AltosPreferences { return firmwaredir; } + public static int font_size() { + return font_size; + } + + static void set_fonts() { + } + + public static void set_font_size(int new_font_size) { + font_size = new_font_size; + synchronized (preferences) { + preferences.putInt(fontSizePreference, font_size); + flush_preferences(); + Altos.set_fonts(font_size); + for (AltosFontListener l : font_listeners) + l.font_size_changed(font_size); + } + } + + public static void register_font_listener(AltosFontListener l) { + synchronized (preferences) { + font_listeners.add(l); + } + } + + public static void unregister_font_listener(AltosFontListener l) { + synchronized (preferences) { + font_listeners.remove(l); + } + } + public static void set_serial_debug(boolean new_serial_debug) { serial_debug = new_serial_debug; AltosSerial.set_debug(serial_debug); diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index b3fb3c54..c258b3e5 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -146,6 +146,10 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { // nothing } + public void set_font() { + // nothing + } + private void loadMap(final AltosSiteMapTile tile, File pngfile, String pngurl) { diff --git a/altosui/Makefile.am b/altosui/Makefile.am index f626d3fa..ba1c830c 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -57,6 +57,7 @@ altosui_JAVA = \ AltosFlightStatsTable.java \ AltosFlightStatus.java \ AltosFlightUI.java \ + AltosFontListener.java \ AltosFrequency.java \ AltosFreqList.java \ AltosGPS.java \ diff --git a/doc/altusmetrum.xsl b/doc/altusmetrum.xsl index 601b62eb..df1e6635 100644 --- a/doc/altusmetrum.xsl +++ b/doc/altusmetrum.xsl @@ -1537,6 +1537,13 @@ NAR #88757, TRA #12200 your local radio regulations. +
+ Font Size + + Selects the set of fonts used in the flight monitor + window. Choose between the small, medium and large sets. + +
Serial Debug -- cgit v1.2.3 From 31e3255b6cbfaf95c0e97e2d1ec8de72f845994c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 28 Aug 2011 15:50:30 -0700 Subject: altosui: Report error message back from libaltos This includes changing all of the error dialogs to show the error message rather than just the file name. Signed-off-by: Keith Packard --- altosui/AltosBTDevice.java | 7 +++ altosui/AltosCSVUI.java | 2 +- altosui/AltosConfig.java | 3 +- altosui/AltosDataChooser.java | 2 +- altosui/AltosDevice.java | 1 + altosui/AltosEepromDownload.java | 12 +++-- altosui/AltosEepromManage.java | 3 +- altosui/AltosFlashUI.java | 4 +- altosui/AltosIgniteUI.java | 3 +- altosui/AltosLanded.java | 4 +- altosui/AltosLaunchUI.java | 3 +- altosui/AltosScanUI.java | 6 +-- altosui/AltosSerial.java | 4 +- altosui/AltosUI.java | 9 ++-- altosui/AltosUSBDevice.java | 7 +++ altosui/libaltos/libaltos.c | 97 +++++++++++++++++++++++++++++++++------- altosui/libaltos/libaltos.h | 8 ++++ 17 files changed, 131 insertions(+), 44 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/AltosBTDevice.java b/altosui/AltosBTDevice.java index 7a876c25..55b8f8fc 100644 --- a/altosui/AltosBTDevice.java +++ b/altosui/AltosBTDevice.java @@ -42,6 +42,13 @@ public class AltosBTDevice extends altos_bt_device implements AltosDevice { return getAddr(); } + public String getErrorString() { + altos_error error = new altos_error(); + + libaltos.altos_get_last_error(error); + return String.format("%s (%d)", error.getString(), error.getCode()); + } + public int getSerial() { String name = getName(); if (name == null) diff --git a/altosui/AltosCSVUI.java b/altosui/AltosCSVUI.java index e1b6002d..a212409e 100644 --- a/altosui/AltosCSVUI.java +++ b/altosui/AltosCSVUI.java @@ -99,7 +99,7 @@ public class AltosCSVUI writer.close(); } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(frame, - file.getName(), + ee.getMessage(), "Cannot open file", JOptionPane.ERROR_MESSAGE); } diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 122ebecc..93def70d 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -480,8 +480,7 @@ public class AltosConfig implements ActionListener { } } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(owner, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ee.getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } catch (AltosSerialInUseException si) { diff --git a/altosui/AltosDataChooser.java b/altosui/AltosDataChooser.java index 15de05c2..d81ca6d1 100644 --- a/altosui/AltosDataChooser.java +++ b/altosui/AltosDataChooser.java @@ -61,7 +61,7 @@ public class AltosDataChooser extends JFileChooser { } } catch (FileNotFoundException fe) { JOptionPane.showMessageDialog(frame, - filename, + fe.getMessage(), "Cannot open file", JOptionPane.ERROR_MESSAGE); } diff --git a/altosui/AltosDevice.java b/altosui/AltosDevice.java index 3357c550..1b5c1a91 100644 --- a/altosui/AltosDevice.java +++ b/altosui/AltosDevice.java @@ -26,5 +26,6 @@ public interface AltosDevice { public abstract int getSerial(); public abstract String getPath(); public abstract boolean matchProduct(int product); + public abstract String getErrorString(); public SWIGTYPE_p_altos_file open(); } diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index 358ad337..e7e52466 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -248,6 +248,10 @@ public class AltosEepromDownload implements Runnable { done = true; } + void CaptureTelemetry(AltosEepromChunk eechunk) throws IOException { + + } + void CaptureLog(AltosEepromLog log) throws IOException, InterruptedException, TimeoutException { int block, state_block = 0; int log_format = flights.config_data.log_format; @@ -300,10 +304,10 @@ public class AltosEepromDownload implements Runnable { extension = "eeprom"; CaptureTiny(eechunk); break; -// case Altos.AO_LOG_FORMAT_TELEMETRY: -// extension = "telem"; -// CaptureTelemetry(eechunk); -// break; + case Altos.AO_LOG_FORMAT_TELEMETRY: + extension = "telem"; + CaptureTelemetry(eechunk); + break; case Altos.AO_LOG_FORMAT_TELESCIENCE: extension = "science"; CaptureTeleScience(eechunk); diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index 2e520628..083c7372 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -219,8 +219,7 @@ public class AltosEepromManage implements ActionListener { t.start(); } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(frame, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ee.getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } catch (AltosSerialInUseException si) { diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java index 3874b500..3956ff20 100644 --- a/altosui/AltosFlashUI.java +++ b/altosui/AltosFlashUI.java @@ -200,8 +200,8 @@ public class AltosFlashUI void exception (Exception e) { if (e instanceof FileNotFoundException) { JOptionPane.showMessageDialog(frame, - "Cannot open image", - file.toString(), + ((FileNotFoundException) e).getMessage(), + "Cannot open file", JOptionPane.ERROR_MESSAGE); } else if (e instanceof AltosSerialInUseException) { JOptionPane.showMessageDialog(frame, diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index c11a8614..b215c228 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -122,8 +122,7 @@ public class AltosIgniteUI void ignite_exception(Exception e) { if (e instanceof FileNotFoundException) { JOptionPane.showMessageDialog(owner, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ((FileNotFoundException) e).getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } else if (e instanceof AltosSerialInUseException) { diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 50e6b542..4dd9a2dd 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -250,7 +250,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio FileInputStream in = new FileInputStream(file); records = new AltosTelemetryIterable(in); } else { - throw new FileNotFoundException(); + throw new FileNotFoundException(filename); } try { new AltosGraphUI(records, filename); @@ -259,7 +259,7 @@ public class AltosLanded extends JComponent implements AltosFlightDisplay, Actio } } catch (FileNotFoundException fe) { JOptionPane.showMessageDialog(null, - filename, + fe.getMessage(), "Cannot open file", JOptionPane.ERROR_MESSAGE); } diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java index 4e630afb..47365e03 100644 --- a/altosui/AltosLaunchUI.java +++ b/altosui/AltosLaunchUI.java @@ -164,8 +164,7 @@ public class AltosLaunchUI void launch_exception(Exception e) { if (e instanceof FileNotFoundException) { JOptionPane.showMessageDialog(owner, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ((FileNotFoundException) e).getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } else if (e instanceof AltosSerialInUseException) { diff --git a/altosui/AltosScanUI.java b/altosui/AltosScanUI.java index bce4b32c..df5c51d4 100644 --- a/altosui/AltosScanUI.java +++ b/altosui/AltosScanUI.java @@ -130,8 +130,7 @@ public class AltosScanUI void scan_exception(Exception e) { if (e instanceof FileNotFoundException) { JOptionPane.showMessageDialog(owner, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ((FileNotFoundException) e).getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } else if (e instanceof AltosSerialInUseException) { @@ -326,8 +325,7 @@ public class AltosScanUI return true; } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(owner, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ee.getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } catch (AltosSerialInUseException si) { diff --git a/altosui/AltosSerial.java b/altosui/AltosSerial.java index 0a531aa9..4cf306d0 100644 --- a/altosui/AltosSerial.java +++ b/altosui/AltosSerial.java @@ -323,8 +323,10 @@ public class AltosSerial implements Runnable { } altos = device.open(); if (altos == null) { + final String message = device.getErrorString(); close(); - throw new FileNotFoundException(device.toShortString()); + throw new FileNotFoundException(String.format("%s (%s)", + device.toShortString(), message)); } if (debug) System.out.printf("Open %s\n", device.getPath()); diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 60adfc7c..3e5bcf43 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -52,8 +52,7 @@ public class AltosUI extends JFrame { new AltosFlightUI(voice, reader, device.getSerial()); } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(AltosUI.this, - String.format("Cannot open device \"%s\"", - device.toShortString()), + ee.getMessage(), "Cannot open target device", JOptionPane.ERROR_MESSAGE); } catch (AltosSerialInUseException si) { @@ -356,7 +355,7 @@ public class AltosUI extends JFrame { else return new AltosTelemetryIterable(in); } catch (FileNotFoundException fe) { - System.out.printf("Cannot open '%s'\n", filename); + System.out.printf("%s\n", fe.getMessage()); return null; } } @@ -366,7 +365,7 @@ public class AltosUI extends JFrame { try { return new AltosCSV(file); } catch (FileNotFoundException fe) { - System.out.printf("Cannot open '%s'\n", filename); + System.out.printf("%s\n", fe.getMessage()); return null; } } @@ -376,7 +375,7 @@ public class AltosUI extends JFrame { try { return new AltosKML(file); } catch (FileNotFoundException fe) { - System.out.printf("Cannot open '%s'\n", filename); + System.out.printf("%s\n", fe.getMessage()); return null; } } diff --git a/altosui/AltosUSBDevice.java b/altosui/AltosUSBDevice.java index dc746a64..b11a3934 100644 --- a/altosui/AltosUSBDevice.java +++ b/altosui/AltosUSBDevice.java @@ -39,6 +39,13 @@ public class AltosUSBDevice extends altos_device implements AltosDevice { } + public String getErrorString() { + altos_error error = new altos_error(); + + libaltos.altos_get_last_error(error); + return String.format("%s (%d)", error.getString(), error.getCode()); + } + public SWIGTYPE_p_altos_file open() { return libaltos.altos_open(this); } diff --git a/altosui/libaltos/libaltos.c b/altosui/libaltos/libaltos.c index a3796ee3..48e00a44 100644 --- a/altosui/libaltos/libaltos.c +++ b/altosui/libaltos/libaltos.c @@ -49,6 +49,22 @@ altos_fini(void) { } +static struct altos_error last_error; + +static void +altos_set_last_error(int code, char *string) +{ + last_error.code = code; + strncpy(last_error.string, string, sizeof (last_error.string) -1); + last_error.string[sizeof(last_error.string)-1] = '\0'; +} + +PUBLIC void +altos_get_last_error(struct altos_error *error) +{ + *error = last_error; +} + #ifdef DARWIN #undef USE_POLL @@ -96,6 +112,12 @@ struct altos_file { int in_read; }; +static void +altos_set_last_posix_error(void) +{ + altos_set_last_error(errno, strerror(errno)); +} + PUBLIC struct altos_file * altos_open(struct altos_device *device) { @@ -103,12 +125,18 @@ altos_open(struct altos_device *device) int ret; struct termios term; - if (!file) + if (!file) { + altos_set_last_posix_error(); return NULL; + } + +// altos_set_last_error(12, "yeah yeah, failed again"); +// free(file); +// return NULL; file->fd = open(device->path, O_RDWR | O_NOCTTY); if (file->fd < 0) { - perror(device->path); + altos_set_last_posix_error(); free(file); return NULL; } @@ -117,7 +145,7 @@ altos_open(struct altos_device *device) #else file->out_fd = open(device->path, O_RDWR | O_NOCTTY); if (file->out_fd < 0) { - perror(device->path); + altos_set_last_posix_error(); close(file->fd); free(file); return NULL; @@ -125,7 +153,7 @@ altos_open(struct altos_device *device) #endif ret = tcgetattr(file->fd, &term); if (ret < 0) { - perror("tcgetattr"); + altos_set_last_posix_error(); close(file->fd); #ifndef USE_POLL close(file->out_fd); @@ -143,7 +171,7 @@ altos_open(struct altos_device *device) #endif ret = tcsetattr(file->fd, TCSAFLUSH, &term); if (ret < 0) { - perror("tcsetattr"); + altos_set_last_posix_error(); close(file->fd); #ifndef USE_POLL close(file->out_fd); @@ -195,8 +223,10 @@ altos_flush(struct altos_file *file) #else ret = write (file->out_fd, file->out_data, file->out_used); #endif - if (ret < 0) + if (ret < 0) { + altos_set_last_posix_error(); return -errno; + } if (ret) { memmove(file->out_data, file->out_data + ret, file->out_used - ret); @@ -248,7 +278,7 @@ altos_fill(struct altos_file *file, int timeout) fd[1].events = POLLIN; ret = poll(fd, 2, timeout); if (ret < 0) { - perror("altos_getchar"); + altos_set_last_posix_error(); return LIBALTOS_ERROR; } if (ret == 0) @@ -261,7 +291,7 @@ altos_fill(struct altos_file *file, int timeout) { ret = read(file->fd, file->in_data, USB_BUF_SIZE); if (ret < 0) { - perror("altos_getchar"); + altos_set_last_posix_error(); return LIBALTOS_ERROR; } file->in_read = 0; @@ -700,8 +730,10 @@ altos_bt_open(struct altos_bt_device *device) if (!file) goto no_file; file->fd = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); - if (file->fd < 0) + if (file->fd < 0) { + altos_set_last_posix_error(); goto no_sock; + } addr.rc_family = AF_BLUETOOTH; addr.rc_channel = 1; @@ -711,7 +743,7 @@ altos_bt_open(struct altos_bt_device *device) (struct sockaddr *)&addr, sizeof(addr)); if (status < 0) { - perror("connect"); + altos_set_last_posix_error(); goto no_link; } sleep(1); @@ -912,6 +944,21 @@ struct altos_file { OVERLAPPED ov_write; }; +static void +altos_set_last_windows_error(void) +{ + DWORD error = GetLastError(); + TCHAR message[1024]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + 0, + error, + 0, + message, + sizeof (message) / sizeof (TCHAR), + NULL); + altos_set_last_error(error, message); +} + PUBLIC struct altos_list * altos_list_start(void) { @@ -922,7 +969,7 @@ altos_list_start(void) list->dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, DIGCF_ALLCLASSES|DIGCF_PRESENT); if (list->dev_info == INVALID_HANDLE_VALUE) { - printf("SetupDiGetClassDevs failed %ld\n", GetLastError()); + altos_set_last_windows_error(); free(list); return NULL; } @@ -956,6 +1003,7 @@ altos_list_next(struct altos_list *list, struct altos_device *device) DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); if (dev_key == INVALID_HANDLE_VALUE) { + altos_set_last_windows_error(); printf("cannot open device registry key\n"); continue; } @@ -966,6 +1014,7 @@ altos_list_next(struct altos_list *list, struct altos_device *device) result = RegQueryValueEx(dev_key, "SymbolicName", NULL, NULL, symbolic, &symbolic_len); if (result != 0) { + altos_set_last_windows_error(); printf("cannot find SymbolicName value\n"); RegCloseKey(dev_key); continue; @@ -988,6 +1037,7 @@ altos_list_next(struct altos_list *list, struct altos_device *device) port, &port_len); RegCloseKey(dev_key); if (result != 0) { + altos_set_last_windows_error(); printf("failed to get PortName\n"); continue; } @@ -1003,6 +1053,7 @@ altos_list_next(struct altos_list *list, struct altos_device *device) sizeof(friendlyname), &friendlyname_len)) { + altos_set_last_windows_error(); printf("Failed to get friendlyname\n"); continue; } @@ -1015,8 +1066,10 @@ altos_list_next(struct altos_list *list, struct altos_device *device) return 1; } result = GetLastError(); - if (result != ERROR_NO_MORE_ITEMS) + if (result != ERROR_NO_MORE_ITEMS) { + altos_set_last_windows_error(); printf ("SetupDiEnumDeviceInfo failed error %d\n", (int) result); + } return 0; } @@ -1035,8 +1088,10 @@ altos_queue_read(struct altos_file *file) return LIBALTOS_SUCCESS; if (!ReadFile(file->handle, file->in_data, USB_BUF_SIZE, &got, &file->ov_read)) { - if (GetLastError() != ERROR_IO_PENDING) + if (GetLastError() != ERROR_IO_PENDING) { + altos_set_last_windows_error(); return LIBALTOS_ERROR; + } file->pend_read = TRUE; } else { file->pend_read = FALSE; @@ -1061,8 +1116,10 @@ altos_wait_read(struct altos_file *file, int timeout) ret = WaitForSingleObject(file->ov_read.hEvent, timeout); switch (ret) { case WAIT_OBJECT_0: - if (!GetOverlappedResult(file->handle, &file->ov_read, &got, FALSE)) + if (!GetOverlappedResult(file->handle, &file->ov_read, &got, FALSE)) { + altos_set_last_windows_error(); return LIBALTOS_ERROR; + } file->pend_read = FALSE; file->in_read = 0; file->in_used = got; @@ -1106,15 +1163,20 @@ altos_flush(struct altos_file *file) while (used) { if (!WriteFile(file->handle, data, used, &put, &file->ov_write)) { - if (GetLastError() != ERROR_IO_PENDING) + if (GetLastError() != ERROR_IO_PENDING) { + altos_set_last_windows_error(); return LIBALTOS_ERROR; + } ret = WaitForSingleObject(file->ov_write.hEvent, INFINITE); switch (ret) { case WAIT_OBJECT_0: - if (!GetOverlappedResult(file->handle, &file->ov_write, &put, FALSE)) + if (!GetOverlappedResult(file->handle, &file->ov_write, &put, FALSE)) { + altos_set_last_windows_error(); return LIBALTOS_ERROR; + } break; default: + altos_set_last_windows_error(); return LIBALTOS_ERROR; } } @@ -1142,6 +1204,7 @@ altos_open(struct altos_device *device) 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); if (file->handle == INVALID_HANDLE_VALUE) { + altos_set_last_windows_error(); free(file); return NULL; } @@ -1157,6 +1220,7 @@ altos_open(struct altos_device *device) dcbSerialParams.DCBlength = sizeof(dcbSerialParams); if (!GetCommState(file->handle, &dcbSerialParams)) { + altos_set_last_windows_error(); CloseHandle(file->handle); free(file); return NULL; @@ -1166,6 +1230,7 @@ altos_open(struct altos_device *device) dcbSerialParams.StopBits = ONESTOPBIT; dcbSerialParams.Parity = NOPARITY; if (!SetCommState(file->handle, &dcbSerialParams)) { + altos_set_last_windows_error(); CloseHandle(file->handle); free(file); return NULL; diff --git a/altosui/libaltos/libaltos.h b/altosui/libaltos/libaltos.h index a05bed4c..f90fbb87 100644 --- a/altosui/libaltos/libaltos.h +++ b/altosui/libaltos/libaltos.h @@ -51,6 +51,11 @@ struct altos_bt_device { //%mutable; }; +struct altos_error { + int code; + char string[1024]; +}; + #define LIBALTOS_SUCCESS 0 #define LIBALTOS_ERROR -1 #define LIBALTOS_TIMEOUT -2 @@ -62,6 +67,9 @@ altos_init(void); PUBLIC void altos_fini(void); +PUBLIC void +altos_get_last_error(struct altos_error *error); + PUBLIC struct altos_list * altos_list_start(void); -- cgit v1.2.3 From 3c2f601139d36761de6a8a2210545d082ef16133 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 2 Jan 2012 17:26:59 -0800 Subject: altosui: Complete split out of separate java library Signed-off-by: Keith Packard --- altosui/Altos.java | 1 + altosui/AltosAscent.java | 1 + altosui/AltosBTManage.java | 1 + altosui/AltosCSV.java | 1 + altosui/AltosCSVUI.java | 1 + altosui/AltosChannelMenu.java | 1 + altosui/AltosCompanionInfo.java | 1 + altosui/AltosConfig.java | 1 + altosui/AltosConfigData.java | 1 + altosui/AltosConfigFreqUI.java | 1 + altosui/AltosConfigUI.java | 1 + altosui/AltosConfigureUI.java | 1 + altosui/AltosDataChooser.java | 1 + altosui/AltosDataPointReader.java | 1 + altosui/AltosDebug.java | 1 + altosui/AltosDescent.java | 1 + altosui/AltosDialog.java | 1 + altosui/AltosDisplayThread.java | 1 + altosui/AltosEepromChunk.java | 1 + altosui/AltosEepromDelete.java | 1 + altosui/AltosEepromDownload.java | 1 + altosui/AltosEepromIterable.java | 1 + altosui/AltosEepromList.java | 1 + altosui/AltosEepromLog.java | 1 + altosui/AltosEepromManage.java | 1 + altosui/AltosEepromMonitor.java | 1 + altosui/AltosEepromRecord.java | 1 + altosui/AltosEepromTeleScience.java | 1 + altosui/AltosFile.java | 1 + altosui/AltosFlash.java | 1 + altosui/AltosFlashUI.java | 1 + altosui/AltosFlightInfoTableModel.java | 1 + altosui/AltosFlightReader.java | 1 + altosui/AltosFlightStats.java | 1 + altosui/AltosFlightStatsTable.java | 1 + altosui/AltosFlightStatus.java | 1 + altosui/AltosFlightStatusTableModel.java | 1 + altosui/AltosFlightUI.java | 1 + altosui/AltosFrame.java | 1 + altosui/AltosFreqList.java | 1 + altosui/AltosGraph.java | 1 + altosui/AltosGraphTime.java | 1 + altosui/AltosGraphUI.java | 1 + altosui/AltosGreatCircle.java | 1 + altosui/AltosHexfile.java | 1 + altosui/AltosIdleMonitorUI.java | 1 + altosui/AltosIgnite.java | 1 + altosui/AltosIgniteUI.java | 1 + altosui/AltosInfoTable.java | 1 + altosui/AltosKML.java | 1 + altosui/AltosLanded.java | 1 + altosui/AltosLaunch.java | 1 + altosui/AltosLaunchUI.java | 1 + altosui/AltosLed.java | 1 + altosui/AltosLights.java | 1 + altosui/AltosLog.java | 1 + altosui/AltosPad.java | 1 + altosui/AltosPreferences.java | 383 --------------------- altosui/AltosReader.java | 1 + altosui/AltosReplayReader.java | 1 + altosui/AltosRomconfig.java | 1 + altosui/AltosRomconfigUI.java | 1 + altosui/AltosScanUI.java | 1 + altosui/AltosSerial.java | 1 + altosui/AltosSiteMap.java | 1 + altosui/AltosSiteMapCache.java | 1 + altosui/AltosSiteMapPreload.java | 1 + altosui/AltosSiteMapTile.java | 1 + altosui/AltosState.java | 2 + altosui/AltosTelemetryReader.java | 120 +++++++ altosui/AltosUI.java | 1 + altosui/AltosUIPreferences.java | 23 +- altosui/AltosWriter.java | 2 + altosui/GrabNDrag.java | 1 + altosui/Makefile.am | 53 ++- altosui/altoslib/Makefile.am | 3 +- .../src/org/altusmetrum/AltosLib/AltosConvert.java | 44 +-- .../org/altusmetrum/AltosLib/AltosFrequency.java | 4 +- .../src/org/altusmetrum/AltosLib/AltosGPS.java | 56 +-- .../src/org/altusmetrum/AltosLib/AltosGPSSat.java | 4 +- .../src/org/altusmetrum/AltosLib/AltosParse.java | 14 +- .../org/altusmetrum/AltosLib/AltosPreferences.java | 365 ++++++++++++++++++++ .../src/org/altusmetrum/AltosLib/AltosRecord.java | 128 +++---- .../altusmetrum/AltosLib/AltosRecordCompanion.java | 14 +- .../altusmetrum/AltosLib/AltosTelemetryReader.java | 119 ------- 85 files changed, 734 insertions(+), 669 deletions(-) delete mode 100644 altosui/AltosPreferences.java create mode 100644 altosui/AltosTelemetryReader.java create mode 100644 altosui/altoslib/src/org/altusmetrum/AltosLib/AltosPreferences.java delete mode 100644 altosui/altoslib/src/org/altusmetrum/AltosLib/AltosTelemetryReader.java (limited to 'altosui/AltosLanded.java') diff --git a/altosui/Altos.java b/altosui/Altos.java index 3e2a7a40..380796cc 100644 --- a/altosui/Altos.java +++ b/altosui/Altos.java @@ -96,6 +96,7 @@ public class Altos extends AltosLib { static boolean map_initialized = false; static final int tab_elt_pad = 5; + static Font label_font; static Font value_font; static Font status_font; diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index c8e5f3af..38b3b30f 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosAscent extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/altosui/AltosBTManage.java b/altosui/AltosBTManage.java index 6d460701..d2899d65 100644 --- a/altosui/AltosBTManage.java +++ b/altosui/AltosBTManage.java @@ -29,6 +29,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosCSV.java b/altosui/AltosCSV.java index db398a61..be86a454 100644 --- a/altosui/AltosCSV.java +++ b/altosui/AltosCSV.java @@ -21,6 +21,7 @@ import java.lang.*; import java.io.*; import java.text.*; import java.util.*; +import org.altusmetrum.AltosLib.*; public class AltosCSV implements AltosWriter { File name; diff --git a/altosui/AltosCSVUI.java b/altosui/AltosCSVUI.java index 6d3e9065..2702668b 100644 --- a/altosui/AltosCSVUI.java +++ b/altosui/AltosCSVUI.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosCSVUI extends AltosDialog diff --git a/altosui/AltosChannelMenu.java b/altosui/AltosChannelMenu.java index abbb86f4..0249a0bd 100644 --- a/altosui/AltosChannelMenu.java +++ b/altosui/AltosChannelMenu.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosChannelMenu extends JComboBox implements ActionListener { int channel; diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index 82bde623..4ba8fe98 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosCompanionInfo extends JTable { private AltosFlightInfoTableModel model; diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index bd930206..35fef080 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosConfigData.java b/altosui/AltosConfigData.java index 64d9f095..ef34dd3e 100644 --- a/altosui/AltosConfigData.java +++ b/altosui/AltosConfigData.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosConfigFreqUI.java b/altosui/AltosConfigFreqUI.java index ecb55449..7958a21c 100644 --- a/altosui/AltosConfigFreqUI.java +++ b/altosui/AltosConfigFreqUI.java @@ -29,6 +29,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; class AltosEditFreqUI extends AltosDialog implements ActionListener { Frame frame; diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index eddb223f..62394fa6 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -28,6 +28,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index 1789cd25..deb179d6 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -30,6 +30,7 @@ import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; import javax.swing.plaf.basic.*; +import org.altusmetrum.AltosLib.*; class DelegatingRenderer implements ListCellRenderer { diff --git a/altosui/AltosDataChooser.java b/altosui/AltosDataChooser.java index c4a46d01..0d629b3c 100644 --- a/altosui/AltosDataChooser.java +++ b/altosui/AltosDataChooser.java @@ -26,6 +26,7 @@ import java.io.*; import java.util.*; import java.text.*; import java.util.prefs.*; +import org.altusmetrum.AltosLib.*; public class AltosDataChooser extends JFileChooser { JFrame frame; diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java index c3aabb0c..821b0771 100644 --- a/altosui/AltosDataPointReader.java +++ b/altosui/AltosDataPointReader.java @@ -9,6 +9,7 @@ import java.text.ParseException; import java.lang.UnsupportedOperationException; import java.util.NoSuchElementException; import java.util.Iterator; +import org.altusmetrum.AltosLib.*; class AltosDataPointReader implements Iterable { Iterator iter; diff --git a/altosui/AltosDebug.java b/altosui/AltosDebug.java index ce1cf5dd..23e38bc0 100644 --- a/altosui/AltosDebug.java +++ b/altosui/AltosDebug.java @@ -21,6 +21,7 @@ import java.lang.*; import java.io.*; import java.util.concurrent.*; import java.util.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 0fcd690b..664c5ea6 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosDescent extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/altosui/AltosDialog.java b/altosui/AltosDialog.java index 1e8e538c..ff38c3e4 100644 --- a/altosui/AltosDialog.java +++ b/altosui/AltosDialog.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosDisplayThread.java b/altosui/AltosDisplayThread.java index ce8d9159..03ce4efd 100644 --- a/altosui/AltosDisplayThread.java +++ b/altosui/AltosDisplayThread.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosDisplayThread extends Thread { diff --git a/altosui/AltosEepromChunk.java b/altosui/AltosEepromChunk.java index 77707f7b..e4d11658 100644 --- a/altosui/AltosEepromChunk.java +++ b/altosui/AltosEepromChunk.java @@ -21,6 +21,7 @@ import java.io.*; import java.util.*; import java.text.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosEepromChunk { diff --git a/altosui/AltosEepromDelete.java b/altosui/AltosEepromDelete.java index fcce8155..73f3a00f 100644 --- a/altosui/AltosEepromDelete.java +++ b/altosui/AltosEepromDelete.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index 8f7a8544..080bfc99 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosEepromIterable.java b/altosui/AltosEepromIterable.java index b8e21ece..11cb97e4 100644 --- a/altosui/AltosEepromIterable.java +++ b/altosui/AltosEepromIterable.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; /* * AltosRecords with an index field so they can be sorted by tick while preserving diff --git a/altosui/AltosEepromList.java b/altosui/AltosEepromList.java index 945746dd..6a656215 100644 --- a/altosui/AltosEepromList.java +++ b/altosui/AltosEepromList.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosEepromLog.java b/altosui/AltosEepromLog.java index 475d7f12..a24e82c0 100644 --- a/altosui/AltosEepromLog.java +++ b/altosui/AltosEepromLog.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index 1e06f4ca..563c90b3 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosEepromMonitor.java b/altosui/AltosEepromMonitor.java index 34f5b891..75643442 100644 --- a/altosui/AltosEepromMonitor.java +++ b/altosui/AltosEepromMonitor.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosEepromMonitor extends AltosDialog { diff --git a/altosui/AltosEepromRecord.java b/altosui/AltosEepromRecord.java index d8a07951..ea003a1e 100644 --- a/altosui/AltosEepromRecord.java +++ b/altosui/AltosEepromRecord.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosEepromTeleScience.java b/altosui/AltosEepromTeleScience.java index ee1840b0..0c237e11 100644 --- a/altosui/AltosEepromTeleScience.java +++ b/altosui/AltosEepromTeleScience.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosEepromTeleScience { int type; diff --git a/altosui/AltosFile.java b/altosui/AltosFile.java index e2b6d5a6..4cf7de3c 100644 --- a/altosui/AltosFile.java +++ b/altosui/AltosFile.java @@ -20,6 +20,7 @@ package altosui; import java.lang.*; import java.io.File; import java.util.*; +import org.altusmetrum.AltosLib.*; class AltosFile extends File { diff --git a/altosui/AltosFlash.java b/altosui/AltosFlash.java index e91e9806..bd0c8a50 100644 --- a/altosui/AltosFlash.java +++ b/altosui/AltosFlash.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosFlash { File file; diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java index f91c542d..4ab73a6d 100644 --- a/altosui/AltosFlashUI.java +++ b/altosui/AltosFlashUI.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosFlashUI extends AltosDialog diff --git a/altosui/AltosFlightInfoTableModel.java b/altosui/AltosFlightInfoTableModel.java index e23eff68..77969a89 100644 --- a/altosui/AltosFlightInfoTableModel.java +++ b/altosui/AltosFlightInfoTableModel.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosFlightInfoTableModel extends AbstractTableModel { final static private String[] columnNames = {"Field", "Value"}; diff --git a/altosui/AltosFlightReader.java b/altosui/AltosFlightReader.java index 3ddf171d..1ac9f848 100644 --- a/altosui/AltosFlightReader.java +++ b/altosui/AltosFlightReader.java @@ -21,6 +21,7 @@ import java.lang.*; import java.text.*; import java.io.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosFlightReader { String name; diff --git a/altosui/AltosFlightStats.java b/altosui/AltosFlightStats.java index 578be3f9..ab094c80 100644 --- a/altosui/AltosFlightStats.java +++ b/altosui/AltosFlightStats.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosFlightStats { double max_height; diff --git a/altosui/AltosFlightStatsTable.java b/altosui/AltosFlightStatsTable.java index 2d34c6e2..c311b231 100644 --- a/altosui/AltosFlightStatsTable.java +++ b/altosui/AltosFlightStatsTable.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosFlightStatsTable extends JComponent { GridBagLayout layout; diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index 45e55b4b..6a351004 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosFlightStatus extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/altosui/AltosFlightStatusTableModel.java b/altosui/AltosFlightStatusTableModel.java index 4c24b6ac..75bf16eb 100644 --- a/altosui/AltosFlightStatusTableModel.java +++ b/altosui/AltosFlightStatusTableModel.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosFlightStatusTableModel extends AbstractTableModel { private String[] columnNames = {"Height (m)", "State", "RSSI (dBm)", "Speed (m/s)" }; diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 5c6e0629..ddc54cbd 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosFlightUI extends AltosFrame implements AltosFlightDisplay, AltosFontListener { AltosVoice voice; diff --git a/altosui/AltosFrame.java b/altosui/AltosFrame.java index 36ddcae9..70598634 100644 --- a/altosui/AltosFrame.java +++ b/altosui/AltosFrame.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosFreqList.java b/altosui/AltosFreqList.java index e4135df7..1bbc97c6 100644 --- a/altosui/AltosFreqList.java +++ b/altosui/AltosFreqList.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosFreqList extends JComboBox { diff --git a/altosui/AltosGraph.java b/altosui/AltosGraph.java index fbcefd61..54d2bb0b 100644 --- a/altosui/AltosGraph.java +++ b/altosui/AltosGraph.java @@ -8,6 +8,7 @@ import java.io.*; import org.jfree.chart.JFreeChart; import org.jfree.chart.ChartUtilities; +import org.altusmetrum.AltosLib.*; abstract class AltosGraph { public String filename; diff --git a/altosui/AltosGraphTime.java b/altosui/AltosGraphTime.java index 6a084b2c..0955f6e6 100644 --- a/altosui/AltosGraphTime.java +++ b/altosui/AltosGraphTime.java @@ -12,6 +12,7 @@ import java.text.*; import java.awt.Color; import java.util.ArrayList; import java.util.HashMap; +import org.altusmetrum.AltosLib.*; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index c30dc476..527a7d28 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -12,6 +12,7 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.table.*; +import org.altusmetrum.AltosLib.*; import org.jfree.chart.ChartPanel; import org.jfree.chart.ChartUtilities; diff --git a/altosui/AltosGreatCircle.java b/altosui/AltosGreatCircle.java index fb1b6ab3..e4af3c18 100644 --- a/altosui/AltosGreatCircle.java +++ b/altosui/AltosGreatCircle.java @@ -18,6 +18,7 @@ package altosui; import java.lang.Math; +import org.altusmetrum.AltosLib.*; public class AltosGreatCircle { double distance; diff --git a/altosui/AltosHexfile.java b/altosui/AltosHexfile.java index 19e35ae1..d52b46c3 100644 --- a/altosui/AltosHexfile.java +++ b/altosui/AltosHexfile.java @@ -23,6 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.LinkedList; import java.util.Iterator; import java.util.Arrays; +import org.altusmetrum.AltosLib.*; class HexFileInputStream extends PushbackInputStream { public int line; diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 8eb0d520..02295ea9 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; class AltosADC { int tick; diff --git a/altosui/AltosIgnite.java b/altosui/AltosIgnite.java index 3e52ea36..c0cd44f1 100644 --- a/altosui/AltosIgnite.java +++ b/altosui/AltosIgnite.java @@ -25,6 +25,7 @@ import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.table.*; import javax.swing.event.*; +import org.altusmetrum.AltosLib.*; public class AltosIgnite { AltosDevice device; diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index 8623cbef..076d99b2 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -28,6 +28,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosIgniteUI extends AltosDialog diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index c023369e..aa6a6d4e 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosInfoTable extends JTable { private AltosFlightInfoTableModel model; diff --git a/altosui/AltosKML.java b/altosui/AltosKML.java index 6bdbecca..2993607b 100644 --- a/altosui/AltosKML.java +++ b/altosui/AltosKML.java @@ -21,6 +21,7 @@ import java.lang.*; import java.io.*; import java.text.*; import java.util.*; +import org.altusmetrum.AltosLib.*; public class AltosKML implements AltosWriter { diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 4dd9a2dd..a47e1cbd 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosLanded extends JComponent implements AltosFlightDisplay, ActionListener { GridBagLayout layout; diff --git a/altosui/AltosLaunch.java b/altosui/AltosLaunch.java index 77f681b8..0e493b91 100644 --- a/altosui/AltosLaunch.java +++ b/altosui/AltosLaunch.java @@ -25,6 +25,7 @@ import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.table.*; import javax.swing.event.*; +import org.altusmetrum.AltosLib.*; public class AltosLaunch { AltosDevice device; diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java index a6c36604..eb76243d 100644 --- a/altosui/AltosLaunchUI.java +++ b/altosui/AltosLaunchUI.java @@ -28,6 +28,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; class FireButton extends JButton { protected void processMouseEvent(MouseEvent e) { diff --git a/altosui/AltosLed.java b/altosui/AltosLed.java index e08e9960..1358cd48 100644 --- a/altosui/AltosLed.java +++ b/altosui/AltosLed.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosLed extends JLabel { ImageIcon on, off; diff --git a/altosui/AltosLights.java b/altosui/AltosLights.java index 2fa38412..8bd9e7de 100644 --- a/altosui/AltosLights.java +++ b/altosui/AltosLights.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosLights extends JComponent { diff --git a/altosui/AltosLog.java b/altosui/AltosLog.java index a5f1830d..740f0be6 100644 --- a/altosui/AltosLog.java +++ b/altosui/AltosLog.java @@ -22,6 +22,7 @@ import java.lang.*; import java.util.*; import java.text.ParseException; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; /* * This creates a thread to capture telemetry data and write it to diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 6ef66f7a..0a3f3d65 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; public class AltosPad extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/altosui/AltosPreferences.java b/altosui/AltosPreferences.java deleted file mode 100644 index 7510c7c2..00000000 --- a/altosui/AltosPreferences.java +++ /dev/null @@ -1,383 +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; version 2 of the License. - * - * 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.io.*; -import java.util.*; -import java.text.*; -import java.util.prefs.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.awt.Component; -import javax.swing.*; -import javax.swing.filechooser.FileSystemView; - -class AltosPreferences { - public static Preferences preferences; - - /* logdir preference name */ - final static String logdirPreference = "LOGDIR"; - - /* channel preference name */ - final static String channelPreferenceFormat = "CHANNEL-%d"; - - /* frequency preference name */ - final static String frequencyPreferenceFormat = "FREQUENCY-%d"; - - /* telemetry format preference name */ - final static String telemetryPreferenceFormat = "TELEMETRY-%d"; - - /* voice preference name */ - final static String voicePreference = "VOICE"; - - /* callsign preference name */ - final static String callsignPreference = "CALLSIGN"; - - /* firmware directory preference name */ - final static String firmwaredirPreference = "FIRMWARE"; - - /* serial debug preference name */ - final static String serialDebugPreference = "SERIAL-DEBUG"; - - /* scanning telemetry preferences name */ - final static String scanningTelemetryPreference = "SCANNING-TELEMETRY"; - - /* Launcher serial preference name */ - final static String launcherSerialPreference = "LAUNCHER-SERIAL"; - - /* Launcher channel preference name */ - final static String launcherChannelPreference = "LAUNCHER-CHANNEL"; - - /* Default logdir is ~/TeleMetrum */ - final static String logdirName = "TeleMetrum"; - - /* Log directory */ - static File logdir; - - /* Map directory -- hangs of logdir */ - static File mapdir; - - /* Frequency (map serial to frequency) */ - static Hashtable frequencies; - - /* Telemetry (map serial to telemetry format) */ - static Hashtable telemetries; - - /* Voice preference */ - static boolean voice; - - /* Callsign preference */ - static String callsign; - - /* Firmware directory */ - static File firmwaredir; - - /* Serial debug */ - static boolean serial_debug; - - /* Scanning telemetry */ - static int scanning_telemetry; - - /* List of frequencies */ - final static String common_frequencies_node_name = "COMMON-FREQUENCIES"; - static AltosFrequency[] common_frequencies; - - final static String frequency_count = "COUNT"; - final static String frequency_format = "FREQUENCY-%d"; - final static String description_format = "DESCRIPTION-%d"; - - static AltosFrequency[] load_common_frequencies() { - AltosFrequency[] frequencies = null; - boolean existing = false; - try { - existing = preferences.nodeExists(common_frequencies_node_name); - } catch (BackingStoreException be) { - existing = false; - } - if (existing) { - Preferences node = preferences.node(common_frequencies_node_name); - int count = node.getInt(frequency_count, 0); - - frequencies = new AltosFrequency[count]; - for (int i = 0; i < count; i++) { - double frequency; - String description; - - frequency = node.getDouble(String.format(frequency_format, i), 0.0); - description = node.get(String.format(description_format, i), null); - frequencies[i] = new AltosFrequency(frequency, description); - } - } else { - frequencies = new AltosFrequency[10]; - for (int i = 0; i < 10; i++) { - frequencies[i] = new AltosFrequency(434.550 + i * .1, - String.format("Channel %d", i)); - } - } - return frequencies; - } - - static void save_common_frequencies(AltosFrequency[] frequencies) { - Preferences node = preferences.node(common_frequencies_node_name); - - node.putInt(frequency_count, frequencies.length); - for (int i = 0; i < frequencies.length; i++) { - node.putDouble(String.format(frequency_format, i), frequencies[i].frequency); - node.put(String.format(description_format, i), frequencies[i].description); - } - } - static int launcher_serial; - - static int launcher_channel; - - public static void init() { - preferences = Preferences.userRoot().node("/org/altusmetrum/altosui"); - - /* Initialize logdir from preferences */ - String logdir_string = preferences.get(logdirPreference, null); - if (logdir_string != null) - logdir = new File(logdir_string); - else { - /* Use the file system view default directory */ - logdir = new File(FileSystemView.getFileSystemView().getDefaultDirectory(), logdirName); - if (!logdir.exists()) - logdir.mkdirs(); - } - mapdir = new File(logdir, "maps"); - if (!mapdir.exists()) - mapdir.mkdirs(); - - frequencies = new Hashtable(); - - telemetries = new Hashtable(); - - voice = preferences.getBoolean(voicePreference, true); - - callsign = preferences.get(callsignPreference,"N0CALL"); - - scanning_telemetry = preferences.getInt(scanningTelemetryPreference,(1 << Altos.ao_telemetry_standard)); - - launcher_serial = preferences.getInt(launcherSerialPreference, 0); - - launcher_channel = preferences.getInt(launcherChannelPreference, 0); - - String firmwaredir_string = preferences.get(firmwaredirPreference, null); - if (firmwaredir_string != null) - firmwaredir = new File(firmwaredir_string); - else - firmwaredir = null; - - serial_debug = preferences.getBoolean(serialDebugPreference, false); - AltosSerial.set_debug(serial_debug); - - common_frequencies = load_common_frequencies(); - - } - - static { init(); } - - static void flush_preferences() { - try { - preferences.flush(); - } catch (BackingStoreException ee) { -/* - if (component != null) - JOptionPane.showMessageDialog(component, - preferences.absolutePath(), - "Cannot save prefernces", - JOptionPane.ERROR_MESSAGE); - else -*/ - System.err.printf("Cannot save preferences\n"); - } - } - - public static void set_logdir(File new_logdir) { - logdir = new_logdir; - mapdir = new File(logdir, "maps"); - if (!mapdir.exists()) - mapdir.mkdirs(); - synchronized (preferences) { - preferences.put(logdirPreference, logdir.getPath()); - flush_preferences(); - } - } - - public static File logdir() { - return logdir; - } - - public static File mapdir() { - return mapdir; - } - - public static void set_frequency(int serial, double new_frequency) { - frequencies.put(serial, new_frequency); - synchronized (preferences) { - preferences.putDouble(String.format(frequencyPreferenceFormat, serial), new_frequency); - flush_preferences(); - } - } - - public static double frequency(int serial) { - if (frequencies.containsKey(serial)) - return frequencies.get(serial); - double frequency = preferences.getDouble(String.format(frequencyPreferenceFormat, serial), 0); - if (frequency == 0.0) { - int channel = preferences.getInt(String.format(channelPreferenceFormat, serial), 0); - frequency = AltosConvert.radio_channel_to_frequency(channel); - } - frequencies.put(serial, frequency); - return frequency; - } - - public static void set_telemetry(int serial, int new_telemetry) { - telemetries.put(serial, new_telemetry); - synchronized (preferences) { - preferences.putInt(String.format(telemetryPreferenceFormat, serial), new_telemetry); - flush_preferences(); - } - } - - public static int telemetry(int serial) { - if (telemetries.containsKey(serial)) - return telemetries.get(serial); - int telemetry = preferences.getInt(String.format(telemetryPreferenceFormat, serial), - Altos.ao_telemetry_standard); - telemetries.put(serial, telemetry); - return telemetry; - } - - public static void set_scanning_telemetry(int new_scanning_telemetry) { - scanning_telemetry = new_scanning_telemetry; - synchronized (preferences) { - preferences.putInt(scanningTelemetryPreference, scanning_telemetry); - flush_preferences(); - } - } - - public static int scanning_telemetry() { - return scanning_telemetry; - } - - public static void set_voice(boolean new_voice) { - voice = new_voice; - synchronized (preferences) { - preferences.putBoolean(voicePreference, voice); - flush_preferences(); - } - } - - public static boolean voice() { - return voice; - } - - public static void set_callsign(String new_callsign) { - callsign = new_callsign; - synchronized(preferences) { - preferences.put(callsignPreference, callsign); - flush_preferences(); - } - } - - public static String callsign() { - return callsign; - } - - public static void set_firmwaredir(File new_firmwaredir) { - firmwaredir = new_firmwaredir; - synchronized (preferences) { - preferences.put(firmwaredirPreference, firmwaredir.getPath()); - flush_preferences(); - } - } - - public static File firmwaredir() { - return firmwaredir; - } - - public static void set_serial_debug(boolean new_serial_debug) { - serial_debug = new_serial_debug; - AltosSerial.set_debug(serial_debug); - synchronized (preferences) { - preferences.putBoolean(serialDebugPreference, serial_debug); - flush_preferences(); - } - } - - public static boolean serial_debug() { - return serial_debug; - } - - public static void set_launcher_serial(int new_launcher_serial) { - launcher_serial = new_launcher_serial; - System.out.printf("set launcher serial to %d\n", new_launcher_serial); - synchronized (preferences) { - preferences.putInt(launcherSerialPreference, launcher_serial); - flush_preferences(); - } - } - - public static int launcher_serial() { - return launcher_serial; - } - - public static void set_launcher_channel(int new_launcher_channel) { - launcher_channel = new_launcher_channel; - System.out.printf("set launcher channel to %d\n", new_launcher_channel); - synchronized (preferences) { - preferences.putInt(launcherChannelPreference, launcher_channel); - flush_preferences(); - } - } - - public static int launcher_channel() { - return launcher_channel; - } - - public static Preferences bt_devices() { - return preferences.node("bt_devices"); - } - - public static AltosFrequency[] common_frequencies() { - return common_frequencies; - } - - public static void set_common_frequencies(AltosFrequency[] frequencies) { - common_frequencies = frequencies; - synchronized(preferences) { - save_common_frequencies(frequencies); - flush_preferences(); - } - } - - public static void add_common_frequency(AltosFrequency frequency) { - AltosFrequency[] new_frequencies = new AltosFrequency[common_frequencies.length + 1]; - int i; - - for (i = 0; i < common_frequencies.length; i++) { - if (frequency.frequency == common_frequencies[i].frequency) - return; - if (frequency.frequency < common_frequencies[i].frequency) - break; - new_frequencies[i] = common_frequencies[i]; - } - new_frequencies[i] = frequency; - for (; i < common_frequencies.length; i++) - new_frequencies[i+1] = common_frequencies[i]; - set_common_frequencies(new_frequencies); - } -} diff --git a/altosui/AltosReader.java b/altosui/AltosReader.java index b9280a0c..aafd5f81 100644 --- a/altosui/AltosReader.java +++ b/altosui/AltosReader.java @@ -20,6 +20,7 @@ package altosui; import java.io.*; import java.util.*; import java.text.*; +import org.altusmetrum.AltosLib.*; public class AltosReader { public AltosRecord read() throws IOException, ParseException { return null; } diff --git a/altosui/AltosReplayReader.java b/altosui/AltosReplayReader.java index eed56cff..f92c0328 100644 --- a/altosui/AltosReplayReader.java +++ b/altosui/AltosReplayReader.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; /* * Open an existing telemetry file and replay it in realtime diff --git a/altosui/AltosRomconfig.java b/altosui/AltosRomconfig.java index 55056b5e..0a283e51 100644 --- a/altosui/AltosRomconfig.java +++ b/altosui/AltosRomconfig.java @@ -17,6 +17,7 @@ package altosui; import java.io.*; +import org.altusmetrum.AltosLib.*; public class AltosRomconfig { public boolean valid; diff --git a/altosui/AltosRomconfigUI.java b/altosui/AltosRomconfigUI.java index e4e38c9c..306b8623 100644 --- a/altosui/AltosRomconfigUI.java +++ b/altosui/AltosRomconfigUI.java @@ -27,6 +27,7 @@ import java.io.*; import java.util.*; import java.text.*; import java.util.prefs.*; +import org.altusmetrum.AltosLib.*; public class AltosRomconfigUI extends AltosDialog diff --git a/altosui/AltosScanUI.java b/altosui/AltosScanUI.java index 2b9137d8..1be8aa26 100644 --- a/altosui/AltosScanUI.java +++ b/altosui/AltosScanUI.java @@ -28,6 +28,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; class AltosScanResult { String callsign; diff --git a/altosui/AltosSerial.java b/altosui/AltosSerial.java index afb9f21a..74e945f3 100644 --- a/altosui/AltosSerial.java +++ b/altosui/AltosSerial.java @@ -31,6 +31,7 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.table.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index 93c54d02..b57edcab 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -32,6 +32,7 @@ import java.lang.Math; import java.awt.geom.Point2D; import java.awt.geom.Line2D; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay { // preferred vertical step in a tile in naut. miles diff --git a/altosui/AltosSiteMapCache.java b/altosui/AltosSiteMapCache.java index 2e62cc45..f729a298 100644 --- a/altosui/AltosSiteMapCache.java +++ b/altosui/AltosSiteMapCache.java @@ -29,6 +29,7 @@ import java.text.*; import java.util.prefs.*; import java.net.URL; import java.net.URLConnection; +import org.altusmetrum.AltosLib.*; public class AltosSiteMapCache extends JLabel { public static boolean fetchMap(File file, String url) { diff --git a/altosui/AltosSiteMapPreload.java b/altosui/AltosSiteMapPreload.java index 5de7a05e..676b0790 100644 --- a/altosui/AltosSiteMapPreload.java +++ b/altosui/AltosSiteMapPreload.java @@ -33,6 +33,7 @@ import java.awt.geom.Point2D; import java.awt.geom.Line2D; import java.net.URL; import java.net.URLConnection; +import org.altusmetrum.AltosLib.*; class AltosMapPos extends Box { AltosUI owner; diff --git a/altosui/AltosSiteMapTile.java b/altosui/AltosSiteMapTile.java index 9e62bb47..34550219 100644 --- a/altosui/AltosSiteMapTile.java +++ b/altosui/AltosSiteMapTile.java @@ -30,6 +30,7 @@ import java.util.prefs.*; import java.lang.Math; import java.awt.geom.Point2D; import java.awt.geom.Line2D; +import org.altusmetrum.AltosLib.*; public class AltosSiteMapTile extends JLayeredPane { JLabel mapLabel; diff --git a/altosui/AltosState.java b/altosui/AltosState.java index 9c6f85eb..403c74be 100644 --- a/altosui/AltosState.java +++ b/altosui/AltosState.java @@ -21,6 +21,8 @@ package altosui; +import org.altusmetrum.AltosLib.*; + public class AltosState { AltosRecord data; diff --git a/altosui/AltosTelemetryReader.java b/altosui/AltosTelemetryReader.java new file mode 100644 index 00000000..dc7e4a75 --- /dev/null +++ b/altosui/AltosTelemetryReader.java @@ -0,0 +1,120 @@ +/* + * 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; version 2 of the License. + * + * 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.lang.*; +import java.text.*; +import java.io.*; +import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; + +class AltosTelemetryReader extends AltosFlightReader { + AltosDevice device; + AltosSerial serial; + AltosLog log; + AltosRecord previous; + double frequency; + int telemetry; + + LinkedBlockingQueue telem; + + AltosRecord read() throws InterruptedException, ParseException, AltosCRCException, IOException { + AltosLine l = telem.take(); + if (l.line == null) + throw new IOException("IO error"); + AltosRecord next = AltosTelemetry.parse(l.line, previous); + previous = next; + return next; + } + + void flush() { + telem.clear(); + } + + void close(boolean interrupted) { + serial.remove_monitor(telem); + log.close(); + serial.close(); + } + + public void set_frequency(double in_frequency) throws InterruptedException, TimeoutException { + frequency = in_frequency; + serial.set_radio_frequency(frequency); + } + + public boolean supports_telemetry(int telemetry) { + + try { + /* Version 1.0 or later firmware supports all telemetry formats */ + if (serial.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) + return true; + else + return false; + } + + /* Version 0.8 firmware only supports 0.8 telemetry */ + if (telemetry == Altos.ao_telemetry_0_8) + return true; + else + return false; + } catch (InterruptedException ie) { + return true; + } catch (TimeoutException te) { + return true; + } + } + + void save_frequency() { + AltosPreferences.set_frequency(device.getSerial(), frequency); + } + + void set_telemetry(int in_telemetry) { + telemetry = in_telemetry; + serial.set_telemetry(telemetry); + } + + void save_telemetry() { + AltosPreferences.set_telemetry(device.getSerial(), telemetry); + } + + File backing_file() { + return log.file(); + } + + public AltosTelemetryReader (AltosDevice in_device) + throws FileNotFoundException, AltosSerialInUseException, IOException, InterruptedException, TimeoutException { + device = in_device; + serial = new AltosSerial(device); + log = new AltosLog(serial); + name = device.toShortString(); + previous = null; + + telem = new LinkedBlockingQueue(); + frequency = AltosPreferences.frequency(device.getSerial()); + set_frequency(frequency); + telemetry = AltosPreferences.telemetry(device.getSerial()); + set_telemetry(telemetry); + serial.set_callsign(AltosUIPreferences.callsign()); + serial.add_monitor(telem); + } +} diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index a2816a3a..25c6c36b 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -27,6 +27,7 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.AltosLib.*; import libaltosJNI.*; diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java index da6c3968..38af734e 100644 --- a/altosui/AltosUIPreferences.java +++ b/altosui/AltosUIPreferences.java @@ -25,10 +25,9 @@ import java.util.concurrent.LinkedBlockingQueue; import java.awt.Component; import javax.swing.*; import javax.swing.filechooser.FileSystemView; +import org.altusmetrum.AltosLib.*; -/* import org.altusmetrum.AltosLib.*; */ - -class AltosUIPreferences extends AltosPreferences { +public class AltosUIPreferences extends AltosPreferences { /* font size preferences name */ final static String fontSizePreference = "FONT-SIZE"; @@ -47,6 +46,9 @@ class AltosUIPreferences extends AltosPreferences { static String look_and_feel = null; + /* Serial debug */ + static boolean serial_debug; + public static void init() { font_listeners = new LinkedList(); @@ -55,6 +57,8 @@ class AltosUIPreferences extends AltosPreferences { look_and_feel = preferences.get(lookAndFeelPreference, UIManager.getSystemLookAndFeelClassName()); ui_listeners = new LinkedList(); + serial_debug = preferences.getBoolean(serialDebugPreference, false); + AltosSerial.set_debug(serial_debug); } static { init(); } @@ -156,4 +160,17 @@ class AltosUIPreferences extends AltosPreferences { ui_listeners.remove(l); } } + public static void set_serial_debug(boolean new_serial_debug) { + serial_debug = new_serial_debug; + AltosSerial.set_debug(serial_debug); + synchronized (preferences) { + preferences.putBoolean(serialDebugPreference, serial_debug); + flush_preferences(); + } + } + + public static boolean serial_debug() { + return serial_debug; + } + } \ No newline at end of file diff --git a/altosui/AltosWriter.java b/altosui/AltosWriter.java index a172dff0..b7375204 100644 --- a/altosui/AltosWriter.java +++ b/altosui/AltosWriter.java @@ -21,6 +21,8 @@ import java.lang.*; import java.io.*; import java.text.*; import java.util.*; +import org.altusmetrum.AltosLib.*; + public interface AltosWriter { diff --git a/altosui/GrabNDrag.java b/altosui/GrabNDrag.java index e6b87b58..c350efec 100644 --- a/altosui/GrabNDrag.java +++ b/altosui/GrabNDrag.java @@ -27,6 +27,7 @@ import javax.swing.table.*; import java.io.*; import java.util.*; import java.text.*; +import org.altusmetrum.AltosLib.*; class GrabNDrag extends MouseInputAdapter { private JComponent scroll; diff --git a/altosui/Makefile.am b/altosui/Makefile.am index c3fd6bb6..cfe45302 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -6,7 +6,7 @@ man_MANS=altosui.1 altoslibdir=$(libdir)/altos -CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:libaltos:$(FREETTS)/*:/usr/share/java/*" +CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:altoslib/bin:libaltos:$(FREETTS)/*:/usr/share/java/*" bin_SCRIPTS=altosui @@ -66,10 +66,7 @@ altosui_JAVA = \ AltosFlightStatusUpdate.java \ AltosFlightUI.java \ AltosFontListener.java \ - AltosFrequency.java \ AltosFreqList.java \ - AltosGPS.java \ - AltosGPSSat.java \ AltosGreatCircle.java \ AltosHexfile.java \ Altos.java \ @@ -83,27 +80,11 @@ altosui_JAVA = \ AltosLanded.java \ AltosLed.java \ AltosLights.java \ - AltosLine.java \ AltosLog.java \ AltosPad.java \ - AltosParse.java \ - AltosUIPreferences.java \ - AltosPreferences.java \ AltosUIPreferences.java \ AltosReader.java \ - AltosRecord.java \ - AltosRecordCompanion.java \ - AltosRecordIterable.java \ AltosTelemetryReader.java \ - AltosTelemetryRecord.java \ - AltosTelemetryRecordRaw.java \ - AltosTelemetryRecordSensor.java \ - AltosTelemetryRecordConfiguration.java \ - AltosTelemetryRecordLocation.java \ - AltosTelemetryRecordSatellite.java \ - AltosTelemetryRecordCompanion.java \ - AltosTelemetryRecordLegacy.java \ - AltosTelemetryMap.java \ AltosReplayReader.java \ AltosRomconfig.java \ AltosRomconfigUI.java \ @@ -116,8 +97,7 @@ altosui_JAVA = \ AltosSiteMapCache.java \ AltosSiteMapTile.java \ AltosState.java \ - AltosTelemetry.java \ - AltosTelemetryIterable.java \ + AltosTelemetryReader.java \ AltosUI.java \ AltosUIListener.java \ AltosFrame.java \ @@ -148,6 +128,9 @@ FREETTS_CLASS= \ en_us.jar \ freetts.jar +ALTOSLIB_CLASS=\ + AltosLib.jar + LIBALTOS= \ libaltos.so \ libaltos.dylib \ @@ -200,7 +183,7 @@ LINUX_DIST=Altos-Linux-$(VERSION).tar.bz2 MACOSX_DIST=Altos-Mac-$(VERSION).zip WINDOWS_DIST=Altos-Windows-$(VERSION_DASH).exe -FAT_FILES=$(FATJAR) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) +FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) LINUX_EXTRA=altosui-fat @@ -214,7 +197,7 @@ all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb clean-local: -rm -rf classes $(JAR) $(FATJAR) \ - $(LINUX_DIST) $(MACOSX_DIST) windows $(WINDOWS_DIST) $(FREETTS_CLASS) \ + $(LINUX_DIST) $(MACOSX_DIST) windows $(WINDOWS_DIST) $(ALTOSLIB_CLASS) $(FREETTS_CLASS) \ $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log \ altosui altosui-test altosui-jdb macosx linux @@ -256,13 +239,13 @@ install-altosuiJAVA: altosui.jar classes/altosui: mkdir -p classes/altosui -$(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICON) +$(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICON) $(ALTOSLIB_CLASS) jar cfm $@ Manifest.txt \ $(ICONJAR) \ -C classes altosui \ -C libaltos libaltosJNI -$(FATJAR): classaltosui.stamp Manifest-fat.txt $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICON) +$(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICON) jar cfm $@ Manifest-fat.txt \ $(ICONJAR) \ -C classes altosui \ @@ -270,11 +253,11 @@ $(FATJAR): classaltosui.stamp Manifest-fat.txt $(FREETTS_CLASS) $(JFREECHART_CLA Manifest.txt: Makefile echo 'Main-Class: altosui.AltosUI' > $@ - echo "Class-Path: $(FREETTS)/freetts.jar $(JFREECHART)/jfreechart.jar $(JCOMMON)/jcommon.jar" >> $@ + echo "Class-Path: altoslib.jar $(FREETTS)/freetts.jar $(JFREECHART)/jfreechart.jar $(JCOMMON)/jcommon.jar" >> $@ Manifest-fat.txt: echo 'Main-Class: altosui.AltosUI' > $@ - echo "Class-Path: freetts.jar jfreechart.jar jcommon.jar" >> $@ + echo "Class-Path: altoslib.jar freetts.jar jfreechart.jar jcommon.jar" >> $@ altosui: Makefile echo "#!/bin/sh" > $@ @@ -283,7 +266,7 @@ altosui: Makefile altosui-test: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar altosui.jar "$$@"' >> $@ + echo 'exec java -cp ":altoslib/*:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar altosui.jar "$$@"' >> $@ chmod +x $@ altosui-jdb: Makefile @@ -317,6 +300,10 @@ build-altos-dll: build-altos64-dll: +cd libaltos && make altos64.dll +$(ALTOSLIB_CLASS): + -rm -f "$@" + $(LN_S) altoslib/"$@" . + $(FREETTS_CLASS): -rm -f "$@" $(LN_S) "$(FREETTS)"/"$@" . @@ -345,9 +332,11 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) cp -a AltosUI.app macosx/ mkdir -p macosx/AltOS macosx/AltosUI.app/Contents/Resources/Java cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar - cp -p $(FREETTS_CLASS) libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java - cp -p $(JFREECHART_CLASS) libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java - cp -p $(JCOMMON_CLASS) libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java + cp -p libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java + cp -p $(ALTOSLIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java + cp -p $(FREETTS_CLASS) macosx/AltosUI.app/Contents/Resources/Java + cp -p $(JFREECHART_CLASS) macosx/AltosUI.app/Contents/Resources/Java + cp -p $(JCOMMON_CLASS) macosx/AltosUI.app/Contents/Resources/Java cp -p $(MACOSX_EXTRA) macosx/AltOS cd macosx && zip -r ../$@ AltosUI.app AltOS diff --git a/altosui/altoslib/Makefile.am b/altosui/altoslib/Makefile.am index 9c655131..967c8d06 100644 --- a/altosui/altoslib/Makefile.am +++ b/altosui/altoslib/Makefile.am @@ -18,11 +18,12 @@ AltosLib_JAVA = \ $(SRC)/AltosGPSSat.java \ $(SRC)/AltosLine.java \ $(SRC)/AltosParse.java \ + $(SRC)/AltosPreferences.java \ $(SRC)/AltosRecordCompanion.java \ $(SRC)/AltosRecordIterable.java \ $(SRC)/AltosRecord.java \ - $(SRC)/AltosTelemetryIterable.java \ $(SRC)/AltosTelemetry.java \ + $(SRC)/AltosTelemetryIterable.java \ $(SRC)/AltosTelemetryMap.java \ $(SRC)/AltosTelemetryRecordCompanion.java \ $(SRC)/AltosTelemetryRecordConfiguration.java \ diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosConvert.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosConvert.java index 6773ab7e..3527b575 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosConvert.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosConvert.java @@ -41,27 +41,27 @@ public class AltosConvert { * in Joules/(kilogram-Kelvin). */ - static final double GRAVITATIONAL_ACCELERATION = -9.80665; - static final double AIR_GAS_CONSTANT = 287.053; - static final double NUMBER_OF_LAYERS = 7; - static final double MAXIMUM_ALTITUDE = 84852.0; - static final double MINIMUM_PRESSURE = 0.3734; - static final double LAYER0_BASE_TEMPERATURE = 288.15; - static final double LAYER0_BASE_PRESSURE = 101325; + public static final double GRAVITATIONAL_ACCELERATION = -9.80665; + public static final double AIR_GAS_CONSTANT = 287.053; + public static final double NUMBER_OF_LAYERS = 7; + public static final double MAXIMUM_ALTITUDE = 84852.0; + public static final double MINIMUM_PRESSURE = 0.3734; + public static final double LAYER0_BASE_TEMPERATURE = 288.15; + public static final double LAYER0_BASE_PRESSURE = 101325; /* lapse rate and base altitude for each layer in the atmosphere */ - static final double[] lapse_rate = { + public static final double[] lapse_rate = { -0.0065, 0.0, 0.001, 0.0028, 0.0, -0.0028, -0.002 }; - static final int[] base_altitude = { + public static final int[] base_altitude = { 0, 11000, 20000, 32000, 47000, 51000, 71000 }; /* outputs atmospheric pressure associated with the given altitude. * altitudes are measured with respect to the mean sea level */ - static double + public static double altitude_to_pressure(double altitude) { double base_temperature = LAYER0_BASE_TEMPERATURE; @@ -114,7 +114,7 @@ public class AltosConvert { /* outputs the altitude associated with the given pressure. the altitude returned is measured with respect to the mean sea level */ - static double + public static double pressure_to_altitude(double pressure) { @@ -178,19 +178,19 @@ public class AltosConvert { return altitude; } - static double + public static double cc_battery_to_voltage(double battery) { return battery / 32767.0 * 5.0; } - static double + public static double cc_ignitor_to_voltage(double ignite) { return ignite / 32767 * 15.0; } - static double radio_to_frequency(int freq, int setting, int cal, int channel) { + public static double radio_to_frequency(int freq, int setting, int cal, int channel) { double f; if (freq > 0) @@ -205,13 +205,13 @@ public class AltosConvert { return f + channel * 0.100; } - static int radio_frequency_to_setting(double frequency, int cal) { + public static int radio_frequency_to_setting(double frequency, int cal) { double set = frequency / 434.550 * cal; return (int) Math.floor (set + 0.5); } - static int radio_frequency_to_channel(double frequency) { + public static int radio_frequency_to_channel(double frequency) { int channel = (int) Math.floor ((frequency - 434.550) / 0.100 + 0.5); if (channel < 0) @@ -221,11 +221,11 @@ public class AltosConvert { return channel; } - static double radio_channel_to_frequency(int channel) { + public static double radio_channel_to_frequency(int channel) { return 434.550 + channel * 0.100; } - static int[] ParseHex(String line) { + public static int[] ParseHex(String line) { String[] tokens = line.split("\\s+"); int[] array = new int[tokens.length]; @@ -238,19 +238,19 @@ public class AltosConvert { return array; } - static double meters_to_feet(double meters) { + public static double meters_to_feet(double meters) { return meters * (100 / (2.54 * 12)); } - static double meters_to_mach(double meters) { + public static double meters_to_mach(double meters) { return meters / 343; /* something close to mach at usual rocket sites */ } - static double meters_to_g(double meters) { + public static double meters_to_g(double meters) { return meters / 9.80665; } - static int checksum(int[] data, int start, int length) { + public static int checksum(int[] data, int start, int length) { int csum = 0x5a; for (int i = 0; i < length; i++) csum += data[i + start]; diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosFrequency.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosFrequency.java index 6fd26dfd..f08ff116 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosFrequency.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosFrequency.java @@ -22,8 +22,8 @@ import java.util.*; import java.text.*; public class AltosFrequency { - double frequency; - String description; + public double frequency; + public String description; public String toString() { return String.format("%7.3f MHz %-20s", diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPS.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPS.java index 8cc7aa69..f078a469 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPS.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPS.java @@ -22,32 +22,32 @@ import java.text.*; public class AltosGPS { - final static int MISSING = AltosRecord.MISSING; - - int nsat; - boolean locked; - boolean connected; - double lat; /* degrees (+N -S) */ - double lon; /* degrees (+E -W) */ - int alt; /* m */ - int year; - int month; - int day; - int hour; - int minute; - int second; - - double ground_speed; /* m/s */ - int course; /* degrees */ - double climb_rate; /* m/s */ - double hdop; /* unitless */ - double vdop; /* unitless */ - int h_error; /* m */ - int v_error; /* m */ - - AltosGPSSat[] cc_gps_sat; /* tracking data */ - - void ParseGPSDate(String date) throws ParseException { + public final static int MISSING = AltosRecord.MISSING; + + public int nsat; + public boolean locked; + public boolean connected; + public double lat; /* degrees (+N -S) */ + public double lon; /* degrees (+E -W) */ + public int alt; /* m */ + public int year; + public int month; + public int day; + public int hour; + public int minute; + public int second; + + public double ground_speed; /* m/s */ + public int course; /* degrees */ + public double climb_rate; /* m/s */ + public double hdop; /* unitless */ + public double vdop; /* unitless */ + public int h_error; /* m */ + public int v_error; /* m */ + + public AltosGPSSat[] cc_gps_sat; /* tracking data */ + + public void ParseGPSDate(String date) throws ParseException { String[] ymd = date.split("-"); if (ymd.length != 3) throw new ParseException("error parsing GPS date " + date + " got " + ymd.length, 0); @@ -56,7 +56,7 @@ public class AltosGPS { day = AltosParse.parse_int(ymd[2]); } - void ParseGPSTime(String time) throws ParseException { + public void ParseGPSTime(String time) throws ParseException { String[] hms = time.split(":"); if (hms.length != 3) throw new ParseException("Error parsing GPS time " + time + " got " + hms.length, 0); @@ -65,7 +65,7 @@ public class AltosGPS { second = AltosParse.parse_int(hms[2]); } - void ClearGPSTime() { + public void ClearGPSTime() { year = month = day = 0; hour = minute = second = 0; } diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPSSat.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPSSat.java index 5fa8f987..faa1ec8d 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPSSat.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosGPSSat.java @@ -18,8 +18,8 @@ package org.altusmetrum.AltosLib; public class AltosGPSSat { - int svid; - int c_n0; + public int svid; + public int c_n0; public AltosGPSSat(int s, int c) { svid = s; diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java index 4c0a59cb..7d832f1a 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosParse.java @@ -21,11 +21,11 @@ import java.text.*; import java.lang.*; public class AltosParse { - static boolean isdigit(char c) { + public static boolean isdigit(char c) { return '0' <= c && c <= '9'; } - static int parse_int(String v) throws ParseException { + public static int parse_int(String v) throws ParseException { try { return AltosLib.fromdec(v); } catch (NumberFormatException e) { @@ -33,7 +33,7 @@ public class AltosParse { } } - static int parse_hex(String v) throws ParseException { + public static int parse_hex(String v) throws ParseException { try { return AltosLib.fromhex(v); } catch (NumberFormatException e) { @@ -41,7 +41,7 @@ public class AltosParse { } } - static double parse_double(String v) throws ParseException { + public static double parse_double(String v) throws ParseException { try { return Double.parseDouble(v); } catch (NumberFormatException e) { @@ -49,7 +49,7 @@ public class AltosParse { } } - static double parse_coord(String coord) throws ParseException { + public static double parse_coord(String coord) throws ParseException { String[] dsf = coord.split("\\D+"); if (dsf.length != 3) { @@ -65,13 +65,13 @@ public class AltosParse { return r; } - static String strip_suffix(String v, String suffix) { + public static String strip_suffix(String v, String suffix) { if (v.endsWith(suffix)) return v.substring(0, v.length() - suffix.length()); return v; } - static void word(String v, String m) throws ParseException { + public static void word(String v, String m) throws ParseException { if (!v.equals(m)) { throw new ParseException("error matching '" + v + "' '" + m + "'", 0); } diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosPreferences.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosPreferences.java new file mode 100644 index 00000000..43c7088d --- /dev/null +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosPreferences.java @@ -0,0 +1,365 @@ +/* + * 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; version 2 of the License. + * + * 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; + +import java.io.*; +import java.util.*; +import java.text.*; +import java.util.prefs.*; +import java.util.concurrent.LinkedBlockingQueue; +import java.awt.Component; +import javax.swing.*; +import javax.swing.filechooser.FileSystemView; + +public class AltosPreferences { + public static Preferences preferences; + + /* logdir preference name */ + public final static String logdirPreference = "LOGDIR"; + + /* channel preference name */ + public final static String channelPreferenceFormat = "CHANNEL-%d"; + + /* frequency preference name */ + public final static String frequencyPreferenceFormat = "FREQUENCY-%d"; + + /* telemetry format preference name */ + public final static String telemetryPreferenceFormat = "TELEMETRY-%d"; + + /* voice preference name */ + public final static String voicePreference = "VOICE"; + + /* callsign preference name */ + public final static String callsignPreference = "CALLSIGN"; + + /* firmware directory preference name */ + public final static String firmwaredirPreference = "FIRMWARE"; + + /* serial debug preference name */ + public final static String serialDebugPreference = "SERIAL-DEBUG"; + + /* scanning telemetry preferences name */ + public final static String scanningTelemetryPreference = "SCANNING-TELEMETRY"; + + /* Launcher serial preference name */ + public final static String launcherSerialPreference = "LAUNCHER-SERIAL"; + + /* Launcher channel preference name */ + public final static String launcherChannelPreference = "LAUNCHER-CHANNEL"; + + /* Default logdir is ~/TeleMetrum */ + public final static String logdirName = "TeleMetrum"; + + /* Log directory */ + public static File logdir; + + /* Map directory -- hangs of logdir */ + public static File mapdir; + + /* Frequency (map serial to frequency) */ + public static Hashtable frequencies; + + /* Telemetry (map serial to telemetry format) */ + public static Hashtable telemetries; + + /* Voice preference */ + public static boolean voice; + + /* Callsign preference */ + public static String callsign; + + /* Firmware directory */ + public static File firmwaredir; + + /* Scanning telemetry */ + public static int scanning_telemetry; + + /* List of frequencies */ + public final static String common_frequencies_node_name = "COMMON-FREQUENCIES"; + public static AltosFrequency[] common_frequencies; + + public final static String frequency_count = "COUNT"; + public final static String frequency_format = "FREQUENCY-%d"; + public final static String description_format = "DESCRIPTION-%d"; + + public static AltosFrequency[] load_common_frequencies() { + AltosFrequency[] frequencies = null; + boolean existing = false; + try { + existing = preferences.nodeExists(common_frequencies_node_name); + } catch (BackingStoreException be) { + existing = false; + } + if (existing) { + Preferences node = preferences.node(common_frequencies_node_name); + int count = node.getInt(frequency_count, 0); + + frequencies = new AltosFrequency[count]; + for (int i = 0; i < count; i++) { + double frequency; + String description; + + frequency = node.getDouble(String.format(frequency_format, i), 0.0); + description = node.get(String.format(description_format, i), null); + frequencies[i] = new AltosFrequency(frequency, description); + } + } else { + frequencies = new AltosFrequency[10]; + for (int i = 0; i < 10; i++) { + frequencies[i] = new AltosFrequency(434.550 + i * .1, + String.format("Channel %d", i)); + } + } + return frequencies; + } + + public static void save_common_frequencies(AltosFrequency[] frequencies) { + Preferences node = preferences.node(common_frequencies_node_name); + + node.putInt(frequency_count, frequencies.length); + for (int i = 0; i < frequencies.length; i++) { + node.putDouble(String.format(frequency_format, i), frequencies[i].frequency); + node.put(String.format(description_format, i), frequencies[i].description); + } + } + public static int launcher_serial; + + public static int launcher_channel; + + public static void init() { + preferences = Preferences.userRoot().node("/org/altusmetrum/altosui"); + + /* Initialize logdir from preferences */ + String logdir_string = preferences.get(logdirPreference, null); + if (logdir_string != null) + logdir = new File(logdir_string); + else { + /* Use the file system view default directory */ + logdir = new File(FileSystemView.getFileSystemView().getDefaultDirectory(), logdirName); + if (!logdir.exists()) + logdir.mkdirs(); + } + mapdir = new File(logdir, "maps"); + if (!mapdir.exists()) + mapdir.mkdirs(); + + frequencies = new Hashtable(); + + telemetries = new Hashtable(); + + voice = preferences.getBoolean(voicePreference, true); + + callsign = preferences.get(callsignPreference,"N0CALL"); + + scanning_telemetry = preferences.getInt(scanningTelemetryPreference,(1 << AltosLib.ao_telemetry_standard)); + + launcher_serial = preferences.getInt(launcherSerialPreference, 0); + + launcher_channel = preferences.getInt(launcherChannelPreference, 0); + + String firmwaredir_string = preferences.get(firmwaredirPreference, null); + if (firmwaredir_string != null) + firmwaredir = new File(firmwaredir_string); + else + firmwaredir = null; + + common_frequencies = load_common_frequencies(); + + } + + static { init(); } + + public static void flush_preferences() { + try { + preferences.flush(); + } catch (BackingStoreException ee) { +/* + if (component != null) + JOptionPane.showMessageDialog(component, + preferences.absolutePath(), + "Cannot save prefernces", + JOptionPane.ERROR_MESSAGE); + else +*/ + System.err.printf("Cannot save preferences\n"); + } + } + + public static void set_logdir(File new_logdir) { + logdir = new_logdir; + mapdir = new File(logdir, "maps"); + if (!mapdir.exists()) + mapdir.mkdirs(); + synchronized (preferences) { + preferences.put(logdirPreference, logdir.getPath()); + flush_preferences(); + } + } + + public static File logdir() { + return logdir; + } + + public static File mapdir() { + return mapdir; + } + + public static void set_frequency(int serial, double new_frequency) { + frequencies.put(serial, new_frequency); + synchronized (preferences) { + preferences.putDouble(String.format(frequencyPreferenceFormat, serial), new_frequency); + flush_preferences(); + } + } + + public static double frequency(int serial) { + if (frequencies.containsKey(serial)) + return frequencies.get(serial); + double frequency = preferences.getDouble(String.format(frequencyPreferenceFormat, serial), 0); + if (frequency == 0.0) { + int channel = preferences.getInt(String.format(channelPreferenceFormat, serial), 0); + frequency = AltosConvert.radio_channel_to_frequency(channel); + } + frequencies.put(serial, frequency); + return frequency; + } + + public static void set_telemetry(int serial, int new_telemetry) { + telemetries.put(serial, new_telemetry); + synchronized (preferences) { + preferences.putInt(String.format(telemetryPreferenceFormat, serial), new_telemetry); + flush_preferences(); + } + } + + public static int telemetry(int serial) { + if (telemetries.containsKey(serial)) + return telemetries.get(serial); + int telemetry = preferences.getInt(String.format(telemetryPreferenceFormat, serial), + AltosLib.ao_telemetry_standard); + telemetries.put(serial, telemetry); + return telemetry; + } + + public static void set_scanning_telemetry(int new_scanning_telemetry) { + scanning_telemetry = new_scanning_telemetry; + synchronized (preferences) { + preferences.putInt(scanningTelemetryPreference, scanning_telemetry); + flush_preferences(); + } + } + + public static int scanning_telemetry() { + return scanning_telemetry; + } + + public static void set_voice(boolean new_voice) { + voice = new_voice; + synchronized (preferences) { + preferences.putBoolean(voicePreference, voice); + flush_preferences(); + } + } + + public static boolean voice() { + return voice; + } + + public static void set_callsign(String new_callsign) { + callsign = new_callsign; + synchronized(preferences) { + preferences.put(callsignPreference, callsign); + flush_preferences(); + } + } + + public static String callsign() { + return callsign; + } + + public static void set_firmwaredir(File new_firmwaredir) { + firmwaredir = new_firmwaredir; + synchronized (preferences) { + preferences.put(firmwaredirPreference, firmwaredir.getPath()); + flush_preferences(); + } + } + + public static File firmwaredir() { + return firmwaredir; + } + + public static void set_launcher_serial(int new_launcher_serial) { + launcher_serial = new_launcher_serial; + System.out.printf("set launcher serial to %d\n", new_launcher_serial); + synchronized (preferences) { + preferences.putInt(launcherSerialPreference, launcher_serial); + flush_preferences(); + } + } + + public static int launcher_serial() { + return launcher_serial; + } + + public static void set_launcher_channel(int new_launcher_channel) { + launcher_channel = new_launcher_channel; + System.out.printf("set launcher channel to %d\n", new_launcher_channel); + synchronized (preferences) { + preferences.putInt(launcherChannelPreference, launcher_channel); + flush_preferences(); + } + } + + public static int launcher_channel() { + return launcher_channel; + } + + public static Preferences bt_devices() { + return preferences.node("bt_devices"); + } + + public static AltosFrequency[] common_frequencies() { + return common_frequencies; + } + + public static void set_common_frequencies(AltosFrequency[] frequencies) { + common_frequencies = frequencies; + synchronized(preferences) { + save_common_frequencies(frequencies); + flush_preferences(); + } + } + + public static void add_common_frequency(AltosFrequency frequency) { + AltosFrequency[] new_frequencies = new AltosFrequency[common_frequencies.length + 1]; + int i; + + for (i = 0; i < common_frequencies.length; i++) { + if (frequency.frequency == common_frequencies[i].frequency) + return; + if (frequency.frequency < common_frequencies[i].frequency) + break; + new_frequencies[i] = common_frequencies[i]; + } + new_frequencies[i] = frequency; + for (; i < common_frequencies.length; i++) + new_frequencies[i+1] = common_frequencies[i]; + set_common_frequencies(new_frequencies); + } +} diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecord.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecord.java index 120004a7..e4915af0 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecord.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecord.java @@ -23,64 +23,66 @@ import java.util.HashMap; import java.io.*; public class AltosRecord implements Comparable { - final static int MISSING = 0x7fffffff; - - static final int seen_flight = 1; - static final int seen_sensor = 2; - static final int seen_temp_volt = 4; - static final int seen_deploy = 8; - static final int seen_gps_time = 16; - static final int seen_gps_lat = 32; - static final int seen_gps_lon = 64; - static final int seen_companion = 128; - int seen; - - int version; - String callsign; - int serial; - int flight; - int rssi; - int status; - int state; - int tick; - - int accel; - int pres; - int temp; - int batt; - int drogue; - int main; - - int ground_accel; - int ground_pres; - int accel_plus_g; - int accel_minus_g; - - double acceleration; - double speed; - double height; - - int flight_accel; - int flight_vel; - int flight_pres; - - AltosGPS gps; - boolean new_gps; - - AltosIMU imu; - AltosMag mag; - - double time; /* seconds since boost */ - - int device_type; - int config_major; - int config_minor; - int apogee_delay; - int main_deploy; - int flight_log_max; - String firmware_version; - - AltosRecordCompanion companion; + public final static int MISSING = 0x7fffffff; + + public static final int seen_flight = 1; + public static final int seen_sensor = 2; + public static final int seen_temp_volt = 4; + public static final int seen_deploy = 8; + public static final int seen_gps_time = 16; + public static final int seen_gps_lat = 32; + public static final int seen_gps_lon = 64; + public static final int seen_companion = 128; + public int seen; + + public int version; + public String callsign; + public int serial; + public int flight; + public int rssi; + public int status; + public int state; + public int tick; + + public int accel; + public int pres; + public int temp; + public int batt; + public int drogue; + public int main; + + public int ground_accel; + public int ground_pres; + public int accel_plus_g; + public int accel_minus_g; + + public double acceleration; + public double speed; + public double height; + + public int flight_accel; + public int flight_vel; + public int flight_pres; + + public AltosGPS gps; + public boolean new_gps; + + public AltosIMU imu; + public AltosMag mag; + + public double time; /* seconds since boost */ + + public int device_type; + public int config_major; + public int config_minor; + public int apogee_delay; + public int main_deploy; + public int flight_log_max; + public String firmware_version; + + public AltosRecordCompanion companion; + +>>>>>>> 5a249bc... altosui: Complete split out of separate java library /* * Values for our MP3H6115A pressure sensor * @@ -95,10 +97,10 @@ public class AltosRecord implements Comparable { * 2.82V * 2047 / 3.3 counts/V = 1749 counts/115 kPa */ - static final double counts_per_kPa = 27 * 2047 / 3300; - static final double counts_at_101_3kPa = 1674.0; + public static final double counts_per_kPa = 27 * 2047 / 3300; + public static final double counts_at_101_3kPa = 1674.0; - static double + public static double barometer_to_pressure(double count) { return ((count / 16.0) / 2047.0 + 0.095) / 0.009 * 1000.0; @@ -193,7 +195,7 @@ public class AltosRecord implements Comparable { * = (value - 19791.268) / 32768 * 1.25 / 0.00247 */ - static double + public static double thermometer_to_temperature(double thermo) { return (thermo - 19791.268) / 32728.0 * 1.25 / 0.00247; @@ -205,7 +207,7 @@ public class AltosRecord implements Comparable { return thermometer_to_temperature(temp); } - double accel_counts_per_mss() { + public double accel_counts_per_mss() { double counts_per_g = Math.abs(accel_minus_g - accel_plus_g) / 2; return counts_per_g / 9.80665; diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecordCompanion.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecordCompanion.java index 4f8e80dc..c8cc6cac 100644 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecordCompanion.java +++ b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosRecordCompanion.java @@ -18,14 +18,14 @@ package org.altusmetrum.AltosLib; public class AltosRecordCompanion { - final static int board_id_telescience = 0x0a; - final static int MAX_CHANNELS = 12; + public final static int board_id_telescience = 0x0a; + public final static int MAX_CHANNELS = 12; - int tick; - int board_id; - int update_period; - int channels; - int[] companion_data; + public int tick; + public int board_id; + public int update_period; + public int channels; + public int[] companion_data; public AltosRecordCompanion(int in_channels) { channels = in_channels; diff --git a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosTelemetryReader.java b/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosTelemetryReader.java deleted file mode 100644 index bd94ee36..00000000 --- a/altosui/altoslib/src/org/altusmetrum/AltosLib/AltosTelemetryReader.java +++ /dev/null @@ -1,119 +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; version 2 of the License. - * - * 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; - -import java.lang.*; -import java.text.*; -import java.io.*; -import java.util.concurrent.*; - -class AltosTelemetryReader extends AltosFlightReader { - AltosDevice device; - AltosSerial serial; - AltosLog log; - AltosRecord previous; - double frequency; - int telemetry; - - LinkedBlockingQueue telem; - - AltosRecord read() throws InterruptedException, ParseException, AltosCRCException, IOException { - AltosLine l = telem.take(); - if (l.line == null) - throw new IOException("IO error"); - AltosRecord next = AltosTelemetry.parse(l.line, previous); - previous = next; - return next; - } - - void flush() { - telem.clear(); - } - - void close(boolean interrupted) { - serial.remove_monitor(telem); - log.close(); - serial.close(); - } - - public void set_frequency(double in_frequency) throws InterruptedException, TimeoutException { - frequency = in_frequency; - serial.set_radio_frequency(frequency); - } - - public boolean supports_telemetry(int telemetry) { - - try { - /* Version 1.0 or later firmware supports all telemetry formats */ - if (serial.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) - return true; - else - return false; - } - - /* Version 0.8 firmware only supports 0.8 telemetry */ - if (telemetry == Altos.ao_telemetry_0_8) - return true; - else - return false; - } catch (InterruptedException ie) { - return true; - } catch (TimeoutException te) { - return true; - } - } - - void save_frequency() { - AltosUIPreferences.set_frequency(device.getSerial(), frequency); - } - - void set_telemetry(int in_telemetry) { - telemetry = in_telemetry; - serial.set_telemetry(telemetry); - } - - void save_telemetry() { - AltosUIPreferences.set_telemetry(device.getSerial(), telemetry); - } - - File backing_file() { - return log.file(); - } - - public AltosTelemetryReader (AltosDevice in_device) - throws FileNotFoundException, AltosSerialInUseException, IOException, InterruptedException, TimeoutException { - device = in_device; - serial = new AltosSerial(device); - log = new AltosLog(serial); - name = device.toShortString(); - previous = null; - - telem = new LinkedBlockingQueue(); - frequency = AltosUIPreferences.frequency(device.getSerial()); - set_frequency(frequency); - telemetry = AltosUIPreferences.telemetry(device.getSerial()); - set_telemetry(telemetry); - serial.set_callsign(AltosUIPreferences.callsign()); - serial.add_monitor(telem); - } -} -- cgit v1.2.3 From 708e7937cba52982b91244cf89bfbff46d346135 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Mon, 10 Sep 2012 16:54:27 -0500 Subject: Changed package name from altosui to AltosUI --- altosui/Altos.java | 2 +- altosui/AltosAscent.java | 2 +- altosui/AltosBTDevice.java | 2 +- altosui/AltosBTDeviceIterator.java | 2 +- altosui/AltosBTKnown.java | 2 +- altosui/AltosBTManage.java | 2 +- altosui/AltosCSV.java | 2 +- altosui/AltosCSVUI.java | 2 +- altosui/AltosChannelMenu.java | 2 +- altosui/AltosCompanionInfo.java | 2 +- altosui/AltosConfig.java | 2 +- altosui/AltosConfigFreqUI.java | 2 +- altosui/AltosConfigTD.java | 2 +- altosui/AltosConfigTDUI.java | 2 +- altosui/AltosConfigUI.java | 2 +- altosui/AltosConfigureUI.java | 2 +- altosui/AltosDataChooser.java | 2 +- altosui/AltosDataPoint.java | 2 +- altosui/AltosDataPointReader.java | 2 +- altosui/AltosDebug.java | 2 +- altosui/AltosDescent.java | 2 +- altosui/AltosDevice.java | 2 +- altosui/AltosDeviceDialog.java | 2 +- altosui/AltosDialog.java | 2 +- altosui/AltosDisplayThread.java | 2 +- altosui/AltosEepromDelete.java | 2 +- altosui/AltosEepromDownload.java | 2 +- altosui/AltosEepromList.java | 2 +- altosui/AltosEepromManage.java | 2 +- altosui/AltosEepromMonitor.java | 2 +- altosui/AltosEepromSelect.java | 2 +- altosui/AltosFlash.java | 2 +- altosui/AltosFlashUI.java | 2 +- altosui/AltosFlightDisplay.java | 2 +- altosui/AltosFlightInfoTableModel.java | 2 +- altosui/AltosFlightStats.java | 2 +- altosui/AltosFlightStatsTable.java | 2 +- altosui/AltosFlightStatus.java | 2 +- altosui/AltosFlightStatusTableModel.java | 2 +- altosui/AltosFlightStatusUpdate.java | 2 +- altosui/AltosFlightUI.java | 2 +- altosui/AltosFontListener.java | 2 +- altosui/AltosFrame.java | 2 +- altosui/AltosFreqList.java | 2 +- altosui/AltosGraph.java | 2 +- altosui/AltosGraphTime.java | 2 +- altosui/AltosGraphUI.java | 2 +- altosui/AltosHexfile.java | 2 +- altosui/AltosIdleMonitorUI.java | 2 +- altosui/AltosIgniteUI.java | 2 +- altosui/AltosInfoTable.java | 2 +- altosui/AltosKML.java | 2 +- altosui/AltosLanded.java | 2 +- altosui/AltosLaunch.java | 2 +- altosui/AltosLaunchUI.java | 2 +- altosui/AltosLed.java | 2 +- altosui/AltosLights.java | 2 +- altosui/AltosPad.java | 2 +- altosui/AltosRomconfig.java | 2 +- altosui/AltosRomconfigUI.java | 2 +- altosui/AltosScanUI.java | 2 +- altosui/AltosSerial.java | 2 +- altosui/AltosSerialInUseException.java | 2 +- altosui/AltosSiteMap.java | 2 +- altosui/AltosSiteMapCache.java | 2 +- altosui/AltosSiteMapPreload.java | 2 +- altosui/AltosSiteMapTile.java | 2 +- altosui/AltosUI.java | 2 +- altosui/AltosUIListener.java | 2 +- altosui/AltosUIPreferences.java | 2 +- altosui/AltosUSBDevice.java | 2 +- altosui/AltosVersion.java.in | 2 +- altosui/AltosVoice.java | 2 +- altosui/AltosWriter.java | 2 +- altosui/GrabNDrag.java | 2 +- altosui/Makefile.am | 28 +++++++++++++--------------- 76 files changed, 88 insertions(+), 90 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/altosui/Altos.java b/altosui/Altos.java index cd17a93e..d3aad6b2 100644 --- a/altosui/Altos.java +++ b/altosui/Altos.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.util.*; diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index a158eb21..de6c90a1 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosBTDevice.java b/altosui/AltosBTDevice.java index 5e353fdd..a6eee085 100644 --- a/altosui/AltosBTDevice.java +++ b/altosui/AltosBTDevice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosBTDeviceIterator.java b/altosui/AltosBTDeviceIterator.java index 58ed86d5..8d9e6fe6 100644 --- a/altosui/AltosBTDeviceIterator.java +++ b/altosui/AltosBTDeviceIterator.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosBTKnown.java b/altosui/AltosBTKnown.java index 6a8e53cb..ad0672c6 100644 --- a/altosui/AltosBTKnown.java +++ b/altosui/AltosBTKnown.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosBTManage.java b/altosui/AltosBTManage.java index aeb964bb..a411c83e 100644 --- a/altosui/AltosBTManage.java +++ b/altosui/AltosBTManage.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosCSV.java b/altosui/AltosCSV.java index c876d9ca..c672b78f 100644 --- a/altosui/AltosCSV.java +++ b/altosui/AltosCSV.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/AltosCSVUI.java b/altosui/AltosCSVUI.java index 2702668b..a28c4ca6 100644 --- a/altosui/AltosCSVUI.java +++ b/altosui/AltosCSVUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosChannelMenu.java b/altosui/AltosChannelMenu.java index 0249a0bd..d7e7f58f 100644 --- a/altosui/AltosChannelMenu.java +++ b/altosui/AltosChannelMenu.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index 4ba8fe98..16c972b3 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index cae41858..0b386ac9 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigFreqUI.java b/altosui/AltosConfigFreqUI.java index 7958a21c..4f8bd0f2 100644 --- a/altosui/AltosConfigFreqUI.java +++ b/altosui/AltosConfigFreqUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigTD.java b/altosui/AltosConfigTD.java index 324a5988..f5d30250 100644 --- a/altosui/AltosConfigTD.java +++ b/altosui/AltosConfigTD.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigTDUI.java b/altosui/AltosConfigTDUI.java index f2058f69..f653d941 100644 --- a/altosui/AltosConfigTDUI.java +++ b/altosui/AltosConfigTDUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index 62394fa6..b0624ef2 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index da82e8e0..b46c1fae 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDataChooser.java b/altosui/AltosDataChooser.java index 4bd51c39..b003a606 100644 --- a/altosui/AltosDataChooser.java +++ b/altosui/AltosDataChooser.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDataPoint.java b/altosui/AltosDataPoint.java index 5e077320..80f62c2c 100644 --- a/altosui/AltosDataPoint.java +++ b/altosui/AltosDataPoint.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package altosui; +package AltosUI; interface AltosDataPoint { int version(); diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java index 821b0771..371c48cb 100644 --- a/altosui/AltosDataPointReader.java +++ b/altosui/AltosDataPointReader.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package altosui; +package AltosUI; import java.io.IOException; import java.text.ParseException; diff --git a/altosui/AltosDebug.java b/altosui/AltosDebug.java index 23e38bc0..4e394011 100644 --- a/altosui/AltosDebug.java +++ b/altosui/AltosDebug.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 62258814..2e3f26bd 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDevice.java b/altosui/AltosDevice.java index 1b5c1a91..dc045d7b 100644 --- a/altosui/AltosDevice.java +++ b/altosui/AltosDevice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosDeviceDialog.java b/altosui/AltosDeviceDialog.java index fa9d0013..7ab08b30 100644 --- a/altosui/AltosDeviceDialog.java +++ b/altosui/AltosDeviceDialog.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; diff --git a/altosui/AltosDialog.java b/altosui/AltosDialog.java index ff38c3e4..1de11317 100644 --- a/altosui/AltosDialog.java +++ b/altosui/AltosDialog.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDisplayThread.java b/altosui/AltosDisplayThread.java index cf69c414..0cf942e7 100644 --- a/altosui/AltosDisplayThread.java +++ b/altosui/AltosDisplayThread.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromDelete.java b/altosui/AltosEepromDelete.java index 73f3a00f..21f09d0e 100644 --- a/altosui/AltosEepromDelete.java +++ b/altosui/AltosEepromDelete.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index b04890cd..a4d6b26e 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromList.java b/altosui/AltosEepromList.java index 6a656215..2a88134c 100644 --- a/altosui/AltosEepromList.java +++ b/altosui/AltosEepromList.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index 563c90b3..27b03bed 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromMonitor.java b/altosui/AltosEepromMonitor.java index 75643442..daf8d0ba 100644 --- a/altosui/AltosEepromMonitor.java +++ b/altosui/AltosEepromMonitor.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromSelect.java b/altosui/AltosEepromSelect.java index 4ad78896..cb242183 100644 --- a/altosui/AltosEepromSelect.java +++ b/altosui/AltosEepromSelect.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; diff --git a/altosui/AltosFlash.java b/altosui/AltosFlash.java index bd0c8a50..996456fd 100644 --- a/altosui/AltosFlash.java +++ b/altosui/AltosFlash.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java index 66991d10..01421de9 100644 --- a/altosui/AltosFlashUI.java +++ b/altosui/AltosFlashUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightDisplay.java b/altosui/AltosFlightDisplay.java index 826f9522..e677fd6f 100644 --- a/altosui/AltosFlightDisplay.java +++ b/altosui/AltosFlightDisplay.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import org.altusmetrum.AltosLib.*; diff --git a/altosui/AltosFlightInfoTableModel.java b/altosui/AltosFlightInfoTableModel.java index 77969a89..cb798bcb 100644 --- a/altosui/AltosFlightInfoTableModel.java +++ b/altosui/AltosFlightInfoTableModel.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStats.java b/altosui/AltosFlightStats.java index ab094c80..d37f90b8 100644 --- a/altosui/AltosFlightStats.java +++ b/altosui/AltosFlightStats.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatsTable.java b/altosui/AltosFlightStatsTable.java index 87ba6aa8..bcfdd84e 100644 --- a/altosui/AltosFlightStatsTable.java +++ b/altosui/AltosFlightStatsTable.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index 6a351004..ee03698b 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatusTableModel.java b/altosui/AltosFlightStatusTableModel.java index c2cf8cd1..919c7704 100644 --- a/altosui/AltosFlightStatusTableModel.java +++ b/altosui/AltosFlightStatusTableModel.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatusUpdate.java b/altosui/AltosFlightStatusUpdate.java index d70fc7f8..a0b4e304 100644 --- a/altosui/AltosFlightStatusUpdate.java +++ b/altosui/AltosFlightStatusUpdate.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index ddc54cbd..08e8550f 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFontListener.java b/altosui/AltosFontListener.java index 0dda0f29..a0cb8a56 100644 --- a/altosui/AltosFontListener.java +++ b/altosui/AltosFontListener.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; public interface AltosFontListener { void font_size_changed(int font_size); diff --git a/altosui/AltosFrame.java b/altosui/AltosFrame.java index 70598634..cdbfe7d3 100644 --- a/altosui/AltosFrame.java +++ b/altosui/AltosFrame.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFreqList.java b/altosui/AltosFreqList.java index 1bbc97c6..a17afce6 100644 --- a/altosui/AltosFreqList.java +++ b/altosui/AltosFreqList.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosGraph.java b/altosui/AltosGraph.java index 54d2bb0b..a61a0976 100644 --- a/altosui/AltosGraph.java +++ b/altosui/AltosGraph.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package altosui; +package AltosUI; import java.io.*; diff --git a/altosui/AltosGraphTime.java b/altosui/AltosGraphTime.java index 0955f6e6..f00170ec 100644 --- a/altosui/AltosGraphTime.java +++ b/altosui/AltosGraphTime.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index 527a7d28..b571fc7d 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package altosui; +package AltosUI; import java.io.*; import java.util.ArrayList; diff --git a/altosui/AltosHexfile.java b/altosui/AltosHexfile.java index d52b46c3..435f13ee 100644 --- a/altosui/AltosHexfile.java +++ b/altosui/AltosHexfile.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 46ca3e5d..f67644fc 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index 78eba8e6..8c4c939f 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index c1400976..8caf5a80 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosKML.java b/altosui/AltosKML.java index ff0734b8..7e3b0e08 100644 --- a/altosui/AltosKML.java +++ b/altosui/AltosKML.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index a47e1cbd..5c3111a2 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosLaunch.java b/altosui/AltosLaunch.java index 0e493b91..67512cef 100644 --- a/altosui/AltosLaunch.java +++ b/altosui/AltosLaunch.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.io.*; import java.util.concurrent.*; diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java index 44481544..a4f12997 100644 --- a/altosui/AltosLaunchUI.java +++ b/altosui/AltosLaunchUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosLed.java b/altosui/AltosLed.java index 1358cd48..4bf43a53 100644 --- a/altosui/AltosLed.java +++ b/altosui/AltosLed.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosLights.java b/altosui/AltosLights.java index 8bd9e7de..92d11212 100644 --- a/altosui/AltosLights.java +++ b/altosui/AltosLights.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 0a3f3d65..8006190d 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosRomconfig.java b/altosui/AltosRomconfig.java index 0a283e51..1e3d7294 100644 --- a/altosui/AltosRomconfig.java +++ b/altosui/AltosRomconfig.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.io.*; import org.altusmetrum.AltosLib.*; diff --git a/altosui/AltosRomconfigUI.java b/altosui/AltosRomconfigUI.java index 306b8623..25d8d087 100644 --- a/altosui/AltosRomconfigUI.java +++ b/altosui/AltosRomconfigUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosScanUI.java b/altosui/AltosScanUI.java index 9da1290f..534451cb 100644 --- a/altosui/AltosScanUI.java +++ b/altosui/AltosScanUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosSerial.java b/altosui/AltosSerial.java index 6cee1609..61865bbd 100644 --- a/altosui/AltosSerial.java +++ b/altosui/AltosSerial.java @@ -19,7 +19,7 @@ * Deal with TeleDongle on a serial port */ -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/AltosSerialInUseException.java b/altosui/AltosSerialInUseException.java index 7380f331..ae97b3d2 100644 --- a/altosui/AltosSerialInUseException.java +++ b/altosui/AltosSerialInUseException.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; public class AltosSerialInUseException extends Exception { public AltosDevice device; diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index b57edcab..4195fc3f 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosSiteMapCache.java b/altosui/AltosSiteMapCache.java index f729a298..6e7e423b 100644 --- a/altosui/AltosSiteMapCache.java +++ b/altosui/AltosSiteMapCache.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosSiteMapPreload.java b/altosui/AltosSiteMapPreload.java index 676b0790..8c0850fa 100644 --- a/altosui/AltosSiteMapPreload.java +++ b/altosui/AltosSiteMapPreload.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosSiteMapTile.java b/altosui/AltosSiteMapTile.java index 34550219..1e1cca5a 100644 --- a/altosui/AltosSiteMapTile.java +++ b/altosui/AltosSiteMapTile.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 926d66f0..a1678299 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosUIListener.java b/altosui/AltosUIListener.java index 7ee62afc..e50b30b2 100644 --- a/altosui/AltosUIListener.java +++ b/altosui/AltosUIListener.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; public interface AltosUIListener { public void ui_changed(String look_and_feel); diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java index 10ab26c3..010d8e6a 100644 --- a/altosui/AltosUIPreferences.java +++ b/altosui/AltosUIPreferences.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.io.*; import java.util.*; diff --git a/altosui/AltosUSBDevice.java b/altosui/AltosUSBDevice.java index ed5f8307..0c953cbf 100644 --- a/altosui/AltosUSBDevice.java +++ b/altosui/AltosUSBDevice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosVersion.java.in b/altosui/AltosVersion.java.in index b0b3c0cf..d72e0936 100644 --- a/altosui/AltosVersion.java.in +++ b/altosui/AltosVersion.java.in @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; public class AltosVersion { public final static String version = "@VERSION@"; diff --git a/altosui/AltosVoice.java b/altosui/AltosVoice.java index ab74e0b3..ff83ac29 100644 --- a/altosui/AltosVoice.java +++ b/altosui/AltosVoice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; diff --git a/altosui/AltosWriter.java b/altosui/AltosWriter.java index b7375204..9031c268 100644 --- a/altosui/AltosWriter.java +++ b/altosui/AltosWriter.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.lang.*; import java.io.*; diff --git a/altosui/GrabNDrag.java b/altosui/GrabNDrag.java index c350efec..a984c43e 100644 --- a/altosui/GrabNDrag.java +++ b/altosui/GrabNDrag.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package altosui; +package AltosUI; import java.awt.*; import java.awt.image.*; diff --git a/altosui/Makefile.am b/altosui/Makefile.am index eb6ea2a3..9ca4f86e 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -112,11 +112,9 @@ LIBALTOS= \ libaltos.dylib \ altos.dll -# tmarble: test comment for change of package name -# from altosui to AltosUI -JAR=altosui.jar +JAR=AltosUI.jar -FATJAR=altosui-fat.jar +FATJAR=AltosUI-fat.jar # Icons ICONDIR=$(top_srcdir)/icon @@ -172,7 +170,7 @@ MACOSX_EXTRA=$(FIRMWARE) WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON) -all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb +all-local: classes/AltosUI $(JAR) altosui altosui-test altosui-jdb clean-local: -rm -rf classes $(JAR) $(FATJAR) \ @@ -209,43 +207,43 @@ endif altosuidir=$(datadir)/java -install-altosuiJAVA: altosui.jar +install-altosuiJAVA: AltosUI.jar @$(NORMAL_INSTALL) test -z "$(altosuidir)" || $(MKDIR_P) "$(DESTDIR)$(altosuidir)" - echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/altosui.jar'"; \ + echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/AltosUI.jar'"; \ $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosuidir)" -classes/altosui: - mkdir -p classes/altosui +classes/AltosUI: + mkdir -p classes/AltosUI $(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICON) $(ALTOSLIB_CLASS) jar cfm $@ Manifest.txt \ $(ICONJAR) \ - -C classes altosui \ + -C classes AltosUI \ -C libaltos libaltosJNI $(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICON) jar cfm $@ Manifest-fat.txt \ $(ICONJAR) \ - -C classes altosui \ + -C classes AltosUI \ -C libaltos libaltosJNI Manifest.txt: Makefile - echo 'Main-Class: altosui.AltosUI' > $@ + echo 'Main-Class: AltosUI.AltosUI' > $@ echo "Class-Path: AltosLib.jar $(FREETTS)/freetts.jar $(JFREECHART)/jfreechart.jar $(JCOMMON)/jcommon.jar" >> $@ Manifest-fat.txt: - echo 'Main-Class: altosui.AltosUI' > $@ + echo 'Main-Class: AltosUI.AltosUI' > $@ echo "Class-Path: AltosLib.jar freetts.jar jfreechart.jar jcommon.jar" >> $@ altosui: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@ + echo 'exec java -cp "$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/AltosUI.jar" "$$@"' >> $@ chmod +x $@ altosui-test: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "./*:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar altosui.jar "$$@"' >> $@ + echo 'exec java -cp "./*:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar AltosUI.jar "$$@"' >> $@ chmod +x $@ altosui-jdb: Makefile -- cgit v1.2.3 From 95268d681c9a6652d84db383f55a4fe8a4ac5173 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Tue, 11 Sep 2012 12:54:31 -0500 Subject: Reverted package name to 'altosui' from 'AltosUI' Also added emacs backup regex (*~) to .gitignore --- .gitignore | 2 +- altosui/Altos.java | 2 +- altosui/AltosAscent.java | 2 +- altosui/AltosBTDevice.java | 2 +- altosui/AltosBTDeviceIterator.java | 2 +- altosui/AltosBTKnown.java | 2 +- altosui/AltosBTManage.java | 2 +- altosui/AltosCSV.java | 2 +- altosui/AltosCSVUI.java | 2 +- altosui/AltosChannelMenu.java | 2 +- altosui/AltosCompanionInfo.java | 2 +- altosui/AltosConfig.java | 2 +- altosui/AltosConfigFreqUI.java | 2 +- altosui/AltosConfigTD.java | 2 +- altosui/AltosConfigTDUI.java | 2 +- altosui/AltosConfigUI.java | 2 +- altosui/AltosConfigureUI.java | 2 +- altosui/AltosDataChooser.java | 2 +- altosui/AltosDataPoint.java | 2 +- altosui/AltosDataPointReader.java | 2 +- altosui/AltosDebug.java | 2 +- altosui/AltosDescent.java | 2 +- altosui/AltosDevice.java | 2 +- altosui/AltosDeviceDialog.java | 2 +- altosui/AltosDialog.java | 2 +- altosui/AltosDisplayThread.java | 2 +- altosui/AltosEepromDelete.java | 2 +- altosui/AltosEepromDownload.java | 2 +- altosui/AltosEepromList.java | 2 +- altosui/AltosEepromManage.java | 2 +- altosui/AltosEepromMonitor.java | 2 +- altosui/AltosEepromSelect.java | 2 +- altosui/AltosFlash.java | 2 +- altosui/AltosFlashUI.java | 2 +- altosui/AltosFlightDisplay.java | 2 +- altosui/AltosFlightInfoTableModel.java | 2 +- altosui/AltosFlightStats.java | 2 +- altosui/AltosFlightStatsTable.java | 2 +- altosui/AltosFlightStatus.java | 2 +- altosui/AltosFlightStatusTableModel.java | 2 +- altosui/AltosFlightStatusUpdate.java | 2 +- altosui/AltosFlightUI.java | 2 +- altosui/AltosFontListener.java | 2 +- altosui/AltosFrame.java | 2 +- altosui/AltosFreqList.java | 2 +- altosui/AltosGraph.java | 2 +- altosui/AltosGraphTime.java | 2 +- altosui/AltosGraphUI.java | 2 +- altosui/AltosHexfile.java | 2 +- altosui/AltosIdleMonitorUI.java | 2 +- altosui/AltosIgniteUI.java | 2 +- altosui/AltosInfoTable.java | 2 +- altosui/AltosKML.java | 2 +- altosui/AltosLanded.java | 2 +- altosui/AltosLaunch.java | 2 +- altosui/AltosLaunchUI.java | 2 +- altosui/AltosLed.java | 2 +- altosui/AltosLights.java | 2 +- altosui/AltosPad.java | 2 +- altosui/AltosRomconfig.java | 2 +- altosui/AltosRomconfigUI.java | 2 +- altosui/AltosScanUI.java | 2 +- altosui/AltosSerial.java | 2 +- altosui/AltosSerialInUseException.java | 2 +- altosui/AltosSiteMap.java | 2 +- altosui/AltosSiteMapCache.java | 2 +- altosui/AltosSiteMapPreload.java | 2 +- altosui/AltosSiteMapTile.java | 2 +- altosui/AltosUI.java | 2 +- altosui/AltosUIListener.java | 2 +- altosui/AltosUIPreferences.java | 2 +- altosui/AltosUSBDevice.java | 2 +- altosui/AltosVersion.java.in | 2 +- altosui/AltosVoice.java | 2 +- altosui/AltosWriter.java | 2 +- altosui/GrabNDrag.java | 2 +- altosui/Makefile.am | 26 +++++++++++++------------- 77 files changed, 89 insertions(+), 89 deletions(-) (limited to 'altosui/AltosLanded.java') diff --git a/.gitignore b/.gitignore index 782be7f6..9f33ea3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ *.a *.adb *.asm @@ -41,7 +42,6 @@ autom4te.cache config.* config.h config.h.in -config.h.in~ config.log config.status build-stamp diff --git a/altosui/Altos.java b/altosui/Altos.java index d3aad6b2..cd17a93e 100644 --- a/altosui/Altos.java +++ b/altosui/Altos.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.util.*; diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index de6c90a1..a158eb21 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosBTDevice.java b/altosui/AltosBTDevice.java index a6eee085..5e353fdd 100644 --- a/altosui/AltosBTDevice.java +++ b/altosui/AltosBTDevice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosBTDeviceIterator.java b/altosui/AltosBTDeviceIterator.java index 8d9e6fe6..58ed86d5 100644 --- a/altosui/AltosBTDeviceIterator.java +++ b/altosui/AltosBTDeviceIterator.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosBTKnown.java b/altosui/AltosBTKnown.java index ad0672c6..6a8e53cb 100644 --- a/altosui/AltosBTKnown.java +++ b/altosui/AltosBTKnown.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosBTManage.java b/altosui/AltosBTManage.java index a411c83e..aeb964bb 100644 --- a/altosui/AltosBTManage.java +++ b/altosui/AltosBTManage.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosCSV.java b/altosui/AltosCSV.java index c672b78f..c876d9ca 100644 --- a/altosui/AltosCSV.java +++ b/altosui/AltosCSV.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/AltosCSVUI.java b/altosui/AltosCSVUI.java index a28c4ca6..2702668b 100644 --- a/altosui/AltosCSVUI.java +++ b/altosui/AltosCSVUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosChannelMenu.java b/altosui/AltosChannelMenu.java index d7e7f58f..0249a0bd 100644 --- a/altosui/AltosChannelMenu.java +++ b/altosui/AltosChannelMenu.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java index 16c972b3..4ba8fe98 100644 --- a/altosui/AltosCompanionInfo.java +++ b/altosui/AltosCompanionInfo.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 0b386ac9..cae41858 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigFreqUI.java b/altosui/AltosConfigFreqUI.java index 4f8bd0f2..7958a21c 100644 --- a/altosui/AltosConfigFreqUI.java +++ b/altosui/AltosConfigFreqUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigTD.java b/altosui/AltosConfigTD.java index f5d30250..324a5988 100644 --- a/altosui/AltosConfigTD.java +++ b/altosui/AltosConfigTD.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigTDUI.java b/altosui/AltosConfigTDUI.java index f653d941..f2058f69 100644 --- a/altosui/AltosConfigTDUI.java +++ b/altosui/AltosConfigTDUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index b0624ef2..62394fa6 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index b46c1fae..da82e8e0 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDataChooser.java b/altosui/AltosDataChooser.java index b003a606..4bd51c39 100644 --- a/altosui/AltosDataChooser.java +++ b/altosui/AltosDataChooser.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDataPoint.java b/altosui/AltosDataPoint.java index 80f62c2c..5e077320 100644 --- a/altosui/AltosDataPoint.java +++ b/altosui/AltosDataPoint.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package AltosUI; +package altosui; interface AltosDataPoint { int version(); diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java index 371c48cb..821b0771 100644 --- a/altosui/AltosDataPointReader.java +++ b/altosui/AltosDataPointReader.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package AltosUI; +package altosui; import java.io.IOException; import java.text.ParseException; diff --git a/altosui/AltosDebug.java b/altosui/AltosDebug.java index 4e394011..23e38bc0 100644 --- a/altosui/AltosDebug.java +++ b/altosui/AltosDebug.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java index 2e3f26bd..62258814 100644 --- a/altosui/AltosDescent.java +++ b/altosui/AltosDescent.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDevice.java b/altosui/AltosDevice.java index dc045d7b..1b5c1a91 100644 --- a/altosui/AltosDevice.java +++ b/altosui/AltosDevice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosDeviceDialog.java b/altosui/AltosDeviceDialog.java index 7ab08b30..fa9d0013 100644 --- a/altosui/AltosDeviceDialog.java +++ b/altosui/AltosDeviceDialog.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; diff --git a/altosui/AltosDialog.java b/altosui/AltosDialog.java index 1de11317..ff38c3e4 100644 --- a/altosui/AltosDialog.java +++ b/altosui/AltosDialog.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosDisplayThread.java b/altosui/AltosDisplayThread.java index 0cf942e7..cf69c414 100644 --- a/altosui/AltosDisplayThread.java +++ b/altosui/AltosDisplayThread.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromDelete.java b/altosui/AltosEepromDelete.java index 21f09d0e..73f3a00f 100644 --- a/altosui/AltosEepromDelete.java +++ b/altosui/AltosEepromDelete.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index a4d6b26e..b04890cd 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromList.java b/altosui/AltosEepromList.java index 2a88134c..6a656215 100644 --- a/altosui/AltosEepromList.java +++ b/altosui/AltosEepromList.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromManage.java b/altosui/AltosEepromManage.java index 27b03bed..563c90b3 100644 --- a/altosui/AltosEepromManage.java +++ b/altosui/AltosEepromManage.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromMonitor.java b/altosui/AltosEepromMonitor.java index daf8d0ba..75643442 100644 --- a/altosui/AltosEepromMonitor.java +++ b/altosui/AltosEepromMonitor.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosEepromSelect.java b/altosui/AltosEepromSelect.java index cb242183..4ad78896 100644 --- a/altosui/AltosEepromSelect.java +++ b/altosui/AltosEepromSelect.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; diff --git a/altosui/AltosFlash.java b/altosui/AltosFlash.java index 996456fd..bd0c8a50 100644 --- a/altosui/AltosFlash.java +++ b/altosui/AltosFlash.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlashUI.java b/altosui/AltosFlashUI.java index 01421de9..66991d10 100644 --- a/altosui/AltosFlashUI.java +++ b/altosui/AltosFlashUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightDisplay.java b/altosui/AltosFlightDisplay.java index e677fd6f..826f9522 100644 --- a/altosui/AltosFlightDisplay.java +++ b/altosui/AltosFlightDisplay.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import org.altusmetrum.AltosLib.*; diff --git a/altosui/AltosFlightInfoTableModel.java b/altosui/AltosFlightInfoTableModel.java index cb798bcb..77969a89 100644 --- a/altosui/AltosFlightInfoTableModel.java +++ b/altosui/AltosFlightInfoTableModel.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStats.java b/altosui/AltosFlightStats.java index d37f90b8..ab094c80 100644 --- a/altosui/AltosFlightStats.java +++ b/altosui/AltosFlightStats.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatsTable.java b/altosui/AltosFlightStatsTable.java index bcfdd84e..87ba6aa8 100644 --- a/altosui/AltosFlightStatsTable.java +++ b/altosui/AltosFlightStatsTable.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java index ee03698b..6a351004 100644 --- a/altosui/AltosFlightStatus.java +++ b/altosui/AltosFlightStatus.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatusTableModel.java b/altosui/AltosFlightStatusTableModel.java index 919c7704..c2cf8cd1 100644 --- a/altosui/AltosFlightStatusTableModel.java +++ b/altosui/AltosFlightStatusTableModel.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightStatusUpdate.java b/altosui/AltosFlightStatusUpdate.java index a0b4e304..d70fc7f8 100644 --- a/altosui/AltosFlightStatusUpdate.java +++ b/altosui/AltosFlightStatusUpdate.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 08e8550f..ddc54cbd 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFontListener.java b/altosui/AltosFontListener.java index a0cb8a56..0dda0f29 100644 --- a/altosui/AltosFontListener.java +++ b/altosui/AltosFontListener.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; public interface AltosFontListener { void font_size_changed(int font_size); diff --git a/altosui/AltosFrame.java b/altosui/AltosFrame.java index cdbfe7d3..70598634 100644 --- a/altosui/AltosFrame.java +++ b/altosui/AltosFrame.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosFreqList.java b/altosui/AltosFreqList.java index a17afce6..1bbc97c6 100644 --- a/altosui/AltosFreqList.java +++ b/altosui/AltosFreqList.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosGraph.java b/altosui/AltosGraph.java index a61a0976..54d2bb0b 100644 --- a/altosui/AltosGraph.java +++ b/altosui/AltosGraph.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package AltosUI; +package altosui; import java.io.*; diff --git a/altosui/AltosGraphTime.java b/altosui/AltosGraphTime.java index f00170ec..0955f6e6 100644 --- a/altosui/AltosGraphTime.java +++ b/altosui/AltosGraphTime.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java index b571fc7d..527a7d28 100644 --- a/altosui/AltosGraphUI.java +++ b/altosui/AltosGraphUI.java @@ -2,7 +2,7 @@ // Copyright (c) 2010 Anthony Towns // GPL v2 or later -package AltosUI; +package altosui; import java.io.*; import java.util.ArrayList; diff --git a/altosui/AltosHexfile.java b/altosui/AltosHexfile.java index 435f13ee..d52b46c3 100644 --- a/altosui/AltosHexfile.java +++ b/altosui/AltosHexfile.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index f67644fc..46ca3e5d 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index 8c4c939f..78eba8e6 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosInfoTable.java b/altosui/AltosInfoTable.java index 8caf5a80..c1400976 100644 --- a/altosui/AltosInfoTable.java +++ b/altosui/AltosInfoTable.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosKML.java b/altosui/AltosKML.java index 7e3b0e08..ff0734b8 100644 --- a/altosui/AltosKML.java +++ b/altosui/AltosKML.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java index 5c3111a2..a47e1cbd 100644 --- a/altosui/AltosLanded.java +++ b/altosui/AltosLanded.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosLaunch.java b/altosui/AltosLaunch.java index 67512cef..0e493b91 100644 --- a/altosui/AltosLaunch.java +++ b/altosui/AltosLaunch.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.io.*; import java.util.concurrent.*; diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java index a4f12997..44481544 100644 --- a/altosui/AltosLaunchUI.java +++ b/altosui/AltosLaunchUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosLed.java b/altosui/AltosLed.java index 4bf43a53..1358cd48 100644 --- a/altosui/AltosLed.java +++ b/altosui/AltosLed.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosLights.java b/altosui/AltosLights.java index 92d11212..8bd9e7de 100644 --- a/altosui/AltosLights.java +++ b/altosui/AltosLights.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java index 8006190d..0a3f3d65 100644 --- a/altosui/AltosPad.java +++ b/altosui/AltosPad.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosRomconfig.java b/altosui/AltosRomconfig.java index 1e3d7294..0a283e51 100644 --- a/altosui/AltosRomconfig.java +++ b/altosui/AltosRomconfig.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.io.*; import org.altusmetrum.AltosLib.*; diff --git a/altosui/AltosRomconfigUI.java b/altosui/AltosRomconfigUI.java index 25d8d087..306b8623 100644 --- a/altosui/AltosRomconfigUI.java +++ b/altosui/AltosRomconfigUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosScanUI.java b/altosui/AltosScanUI.java index 534451cb..9da1290f 100644 --- a/altosui/AltosScanUI.java +++ b/altosui/AltosScanUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosSerial.java b/altosui/AltosSerial.java index 61865bbd..6cee1609 100644 --- a/altosui/AltosSerial.java +++ b/altosui/AltosSerial.java @@ -19,7 +19,7 @@ * Deal with TeleDongle on a serial port */ -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/AltosSerialInUseException.java b/altosui/AltosSerialInUseException.java index ae97b3d2..7380f331 100644 --- a/altosui/AltosSerialInUseException.java +++ b/altosui/AltosSerialInUseException.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; public class AltosSerialInUseException extends Exception { public AltosDevice device; diff --git a/altosui/AltosSiteMap.java b/altosui/AltosSiteMap.java index 4195fc3f..b57edcab 100644 --- a/altosui/AltosSiteMap.java +++ b/altosui/AltosSiteMap.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosSiteMapCache.java b/altosui/AltosSiteMapCache.java index 6e7e423b..f729a298 100644 --- a/altosui/AltosSiteMapCache.java +++ b/altosui/AltosSiteMapCache.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosSiteMapPreload.java b/altosui/AltosSiteMapPreload.java index 8c0850fa..676b0790 100644 --- a/altosui/AltosSiteMapPreload.java +++ b/altosui/AltosSiteMapPreload.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosSiteMapTile.java b/altosui/AltosSiteMapTile.java index 1e1cca5a..34550219 100644 --- a/altosui/AltosSiteMapTile.java +++ b/altosui/AltosSiteMapTile.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.image.*; diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index a1678299..926d66f0 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.event.*; diff --git a/altosui/AltosUIListener.java b/altosui/AltosUIListener.java index e50b30b2..7ee62afc 100644 --- a/altosui/AltosUIListener.java +++ b/altosui/AltosUIListener.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; public interface AltosUIListener { public void ui_changed(String look_and_feel); diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java index 010d8e6a..10ab26c3 100644 --- a/altosui/AltosUIPreferences.java +++ b/altosui/AltosUIPreferences.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.io.*; import java.util.*; diff --git a/altosui/AltosUSBDevice.java b/altosui/AltosUSBDevice.java index 0c953cbf..ed5f8307 100644 --- a/altosui/AltosUSBDevice.java +++ b/altosui/AltosUSBDevice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.util.*; import libaltosJNI.*; diff --git a/altosui/AltosVersion.java.in b/altosui/AltosVersion.java.in index d72e0936..b0b3c0cf 100644 --- a/altosui/AltosVersion.java.in +++ b/altosui/AltosVersion.java.in @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; public class AltosVersion { public final static String version = "@VERSION@"; diff --git a/altosui/AltosVoice.java b/altosui/AltosVoice.java index ff83ac29..ab74e0b3 100644 --- a/altosui/AltosVoice.java +++ b/altosui/AltosVoice.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; diff --git a/altosui/AltosWriter.java b/altosui/AltosWriter.java index 9031c268..b7375204 100644 --- a/altosui/AltosWriter.java +++ b/altosui/AltosWriter.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.lang.*; import java.io.*; diff --git a/altosui/GrabNDrag.java b/altosui/GrabNDrag.java index a984c43e..c350efec 100644 --- a/altosui/GrabNDrag.java +++ b/altosui/GrabNDrag.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package AltosUI; +package altosui; import java.awt.*; import java.awt.image.*; diff --git a/altosui/Makefile.am b/altosui/Makefile.am index ca5d2b35..9f75d5e3 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -112,9 +112,9 @@ LIBALTOS= \ libaltos.dylib \ altos.dll -JAR=AltosUI.jar +JAR=altosui.jar -FATJAR=AltosUI-fat.jar +FATJAR=altosui-fat.jar # Icons ICONDIR=$(top_srcdir)/icon @@ -170,7 +170,7 @@ MACOSX_EXTRA=$(FIRMWARE) WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON) -all-local: classes/AltosUI $(JAR) altosui altosui-test altosui-jdb +all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb clean-local: -rm -rf classes $(JAR) $(FATJAR) \ @@ -207,43 +207,43 @@ endif altosuidir=$(datadir)/java -install-altosuiJAVA: AltosUI.jar +install-altosuiJAVA: altosui.jar @$(NORMAL_INSTALL) test -z "$(altosuidir)" || $(MKDIR_P) "$(DESTDIR)$(altosuidir)" - echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/AltosUI.jar'"; \ + echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosuidir)/altosui.jar'"; \ $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosuidir)" -classes/AltosUI: - mkdir -p classes/AltosUI +classes/altosui: + mkdir -p classes/altosui $(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICON) $(ALTOSLIB_CLASS) jar cfm $@ Manifest.txt \ $(ICONJAR) \ - -C classes AltosUI \ + -C classes altosui \ -C libaltos libaltosJNI $(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICON) jar cfm $@ Manifest-fat.txt \ $(ICONJAR) \ - -C classes AltosUI \ + -C classes altosui \ -C libaltos libaltosJNI Manifest.txt: Makefile - echo 'Main-Class: AltosUI.AltosUI' > $@ + echo 'Main-Class: altosui.AltosUI' > $@ echo "Class-Path: AltosLib.jar $(FREETTS)/freetts.jar $(JFREECHART)/jfreechart.jar $(JCOMMON)/jcommon.jar" >> $@ Manifest-fat.txt: - echo 'Main-Class: AltosUI.AltosUI' > $@ + echo 'Main-Class: altosui.AltosUI' > $@ echo "Class-Path: AltosLib.jar freetts.jar jfreechart.jar jcommon.jar" >> $@ altosui: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/AltosUI.jar" "$$@"' >> $@ + echo 'exec java -cp "$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@ chmod +x $@ altosui-test: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "./*:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar AltosUI.jar "$$@"' >> $@ + echo 'exec java -cp "./*:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar altosui.jar "$$@"' >> $@ chmod +x $@ altosui-jdb: Makefile -- cgit v1.2.3