diff options
Diffstat (limited to 'telegps')
| -rw-r--r-- | telegps/.gitignore | 2 | ||||
| -rw-r--r-- | telegps/Info.plist.in | 29 | ||||
| -rw-r--r-- | telegps/Makefile.am | 67 | ||||
| -rw-r--r-- | telegps/TeleGPS.java | 104 | ||||
| -rw-r--r-- | telegps/TeleGPSConfig.java | 4 | ||||
| -rw-r--r-- | telegps/TeleGPSConfigUI.java | 124 | ||||
| -rw-r--r-- | telegps/TeleGPSDisplayThread.java | 4 | ||||
| -rw-r--r-- | telegps/TeleGPSGraphUI.java | 4 | ||||
| -rw-r--r-- | telegps/TeleGPSInfo.java | 4 | ||||
| -rw-r--r-- | telegps/TeleGPSPreferences.java | 2 | ||||
| -rw-r--r-- | telegps/TeleGPSState.java | 4 | ||||
| -rw-r--r-- | telegps/TeleGPSStatus.java | 4 | ||||
| -rw-r--r-- | telegps/TeleGPSStatusUpdate.java | 2 | ||||
| -rw-r--r-- | telegps/altusmetrum-telegps.desktop.in (renamed from telegps/telegps.desktop.in) | 4 | ||||
| -rw-r--r-- | telegps/telegps-windows.nsi.in | 137 |
15 files changed, 408 insertions, 87 deletions
diff --git a/telegps/.gitignore b/telegps/.gitignore index edb509f2..1af9e0f1 100644 --- a/telegps/.gitignore +++ b/telegps/.gitignore @@ -17,7 +17,7 @@ TeleGPS-Linux-*.tar.bz2 TeleGPS-Linux-*.sh TeleGPS-Mac-*.zip TeleGPS-Windows-*.exe -telegps.desktop +*.desktop telegps-windows.log *.dll *.dylib diff --git a/telegps/Info.plist.in b/telegps/Info.plist.in index df05bb6e..89870a8c 100644 --- a/telegps/Info.plist.in +++ b/telegps/Info.plist.in @@ -23,7 +23,34 @@ <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleIconFile</key> - <string>TeleGPS.icns</string> + <string>altusmetrum-telegps.icns</string> + <key>CFBundleDocumentTypes</key> + <array> + <dict> + <key>CFBundleTypeName</key> + <string>Telemetry</string> + <key>CFBundleTypeIconFile</key> + <string>application-vnd.altusmetrum.telemetry.icns</string> + <key>CFBundleTypeExtensions</key> + <array> + <string>telem</string> + </array> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + <dict> + <key>CFBundleTypeName</key> + <string>Eeprom</string> + <key>CFBundleTypeIconFile</key> + <string>application-vnd.altusmetrum.eeprom.icns</string> + <key>CFBundleTypeExtensions</key> + <array> + <string>eeprom</string> + </array> + <key>CFBundleTypeRole</key> + <string>Editor</string> + </dict> + </array> <key>Java</key> <dict> <key>MainClass</key> diff --git a/telegps/Makefile.am b/telegps/Makefile.am index 7b550e9e..3b33428e 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -58,23 +58,42 @@ ALTOSUILIB_CLASS=\ ICONDIR=$(top_srcdir)/icon JAVA_ICONS=\ - $(ICONDIR)/telegps-16.png \ - $(ICONDIR)/telegps-32.png \ - $(ICONDIR)/telegps-48.png \ - $(ICONDIR)/telegps-64.png \ - $(ICONDIR)/telegps-128.png \ - $(ICONDIR)/telegps-256.png + $(ICONDIR)/altusmetrum-telegps-16.png \ + $(ICONDIR)/altusmetrum-telegps-32.png \ + $(ICONDIR)/altusmetrum-telegps-48.png \ + $(ICONDIR)/altusmetrum-telegps-64.png \ + $(ICONDIR)/altusmetrum-telegps-128.png\ + $(ICONDIR)/altusmetrum-telegps-256.png # icon base names for jar -ICONJAR= -C $(ICONDIR) telegps-16.png \ - -C $(ICONDIR) telegps-32.png \ - -C $(ICONDIR) telegps-48.png \ - -C $(ICONDIR) telegps-64.png \ - -C $(ICONDIR) telegps-128.png \ - -C $(ICONDIR) telegps-256.png - -WINDOWS_ICON=$(ICONDIR)/telegps.ico -MACOSX_ICON=$(ICONDIR)/TeleGPS.icns +ICONJAR= \ + -C $(ICONDIR) altusmetrum-telegps-16.png \ + -C $(ICONDIR) altusmetrum-telegps-32.png \ + -C $(ICONDIR) altusmetrum-telegps-48.png \ + -C $(ICONDIR) altusmetrum-telegps-64.png \ + -C $(ICONDIR) altusmetrum-telegps-128.png\ + -C $(ICONDIR) altusmetrum-telegps-256.png + +WINDOWS_ICONS =\ + ../icon/altusmetrum-telegps.ico \ + ../icon/altusmetrum-telegps.exe + ../icon/application-vnd.altusmetrum.eeprom.ico \ + ../icon/application-vnd.altusmetrum.eeprom.exe \ + ../icon/application-vnd.altusmetrum.telemetry.ico \ + ../icon/application-vnd.altusmetrum.telemetry.exe + +MACOSX_ICONS =\ + ../icon/altusmetrum-telegps.icns \ + ../icon/application-vnd.altusmetrum.eeprom.icns \ + ../icon/application-vnd.altusmetrum.telemetry.icns + +LINUX_ICONS =\ + $(ICONDIR)/altusmetrum-altosui.svg \ + $(ICONDIR)/application-vnd.altusmetrum.eeprom.svg \ + $(ICONDIR)/application-vnd.altusmetrum.telemetry.svg + +LINUX_MIMETYPE =\ + $(ICONDIR)/org-altusmetrum-mimetypes.xml # Firmware FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx @@ -89,7 +108,7 @@ FIRMWARE_TG=$(FIRMWARE_TG_1_0) FIRMWARE=$(FIRMWARE_TG) $(FIRMWARE_TD) $(FIRMWARE_TBT) desktopdir = $(datadir)/applications -desktop_file = telegps.desktop +desktop_file = altusmetrum-telegps.desktop desktop_SCRIPTS = $(desktop_file) all-local: telegps-test telegps-jdb $(JAR) @@ -101,12 +120,12 @@ clean-local: $(ALTOSUILIB_CLASS) \ $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt \ telegps telegps-test telegps-jdb macosx linux windows telegps-windows.log \ - telegps-windows.nsi + telegps-windows.nsi *.desktop EXTRA_DIST = $(desktop_file).in $(desktop_file): $(desktop_file).in - sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/telegps.desktop.in > $@ + sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@ chmod +x $@ LINUX_DIST=TeleGPS-Linux-$(VERSION).tar.bz2 @@ -120,15 +139,15 @@ DOC=$(TELEGPS_DOC) FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) -LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) telegps.desktop.in ../icon/telegps.svg -LINUX_EXTRA=telegps-fat telegps.desktop.in +LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE) +LINUX_EXTRA=telegps-fat $(desktop_file).in MACOSX_INFO_PLIST=Info.plist MACOSX_README=ReadMe-Mac.rtf -MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_README) $(DOC) $(MACOSX_ICON) +MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_README) $(DOC) $(MACOSX_ICONS) MACOSX_EXTRA=$(FIRMWARE) -WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(DOC) $(WINDOWS_ICON) +WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(DOC) $(WINDOWS_ICONS) if FATINSTALL @@ -194,8 +213,6 @@ $(FATJAR): classtelegps.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CL -C classes org \ -C ../libaltos libaltosJNI -classaltosui.stamp: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) - libaltos.so: build-libaltos -rm -f "$@" $(LN_S) ../libaltos/.libs/"$@" . @@ -269,7 +286,7 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile cp -a $(DOC) macosx/Doc cp -p Info.plist macosx/TeleGPS.app/Contents mkdir -p macosx/AltOS-$(VERSION) macosx/TeleGPS.app/Contents/Resources/Java - cp -p $(MACOSX_ICON) macosx/TeleGPS.app/Contents/Resources + cp -p $(MACOSX_ICONS) macosx/TeleGPS.app/Contents/Resources cp -p $(FATJAR) macosx/TeleGPS.app/Contents/Resources/Java/telegps.jar cp -p libaltos.dylib macosx/TeleGPS.app/Contents/Resources/Java cp -p $(ALTOSLIB_CLASS) macosx/TeleGPS.app/Contents/Resources/Java diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index 6e68dd30..a4b221e8 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -23,8 +23,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPS extends AltosUIFrame @@ -32,12 +32,12 @@ public class TeleGPS { static String[] telegps_icon_names = { - "/telegps-16.png", - "/telegps-32.png", - "/telegps-48.png", - "/telegps-64.png", - "/telegps-128.png", - "/telegps-256.png" + "/altusmetrum-telegps-16.png", + "/altusmetrum-telegps-32.png", + "/altusmetrum-telegps-48.png", + "/altusmetrum-telegps-64.png", + "/altusmetrum-telegps-128.png", + "/altusmetrum-telegps-256.png" }; static { set_icon_names(telegps_icon_names); } @@ -58,8 +58,10 @@ public class TeleGPS JMenu file_menu; JMenu monitor_menu; JMenu device_menu; - AltosFreqList frequencies; + AltosUIFreqList frequencies; ActionListener frequency_listener; + AltosUIRateList rates; + ActionListener rate_listener; Container bag; @@ -184,6 +186,7 @@ public class TeleGPS telegps_status.disable_receive(); disable_frequency_menu(); + disable_rate_menu(); } void connect(AltosDevice device) { @@ -364,6 +367,40 @@ public class TeleGPS } + void enable_rate_menu(int serial, final AltosFlightReader reader) { + + if (rate_listener != null) + disable_rate_menu(); + + rate_listener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + int rate = rates.rate(); + try { + System.out.printf("set rate %d\n", rate); + reader.set_telemetry_rate(rate); + } catch (TimeoutException te) { + } catch (InterruptedException ie) { + } + reader.save_telemetry_rate(); + } + }; + + rates.addActionListener(rate_listener); + rates.set_product("Monitor"); + rates.set_serial(serial); + rates.set_rate(AltosUIPreferences.telemetry_rate(serial)); + rates.setEnabled(reader.supports_telemetry_rate(AltosLib.ao_telemetry_rate_2400)); + } + + void disable_rate_menu() { + if (rate_listener != null) { + rates.removeActionListener(rate_listener); + rates.setEnabled(false); + rate_listener = null; + } + + } + public void set_reader(AltosFlightReader reader, AltosDevice device) { status_update = new TeleGPSStatusUpdate(telegps_status); @@ -374,8 +411,10 @@ public class TeleGPS thread = new TeleGPSDisplayThread(this, voice(), this, reader); thread.start(); - if (device != null) + if (device != null) { enable_frequency_menu(device.getSerial(), reader); + enable_rate_menu(device.getSerial(), reader); + } } static int number_of_windows; @@ -409,16 +448,38 @@ public class TeleGPS private JMenu make_menu(String label, String[][] items) { JMenu menu = new JMenu(label); - for (int i = 0; i < items.length; i++) + for (int i = 0; i < items.length; i++) { + if (MAC_OS_X) { + if (items[i][1].equals("exit")) + continue; + if (items[i][1].equals("preferences")) + continue; + } add_menu(menu, items[i][0], items[i][1]); + } menu_bar.add(menu); return menu; } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + process_graph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + preferences(); + } + public TeleGPS() { AltosUIPreferences.set_component(this); + register_for_macosx_events(); + reader = null; bag = getContentPane(); @@ -434,9 +495,26 @@ public class TeleGPS file_menu = make_menu("File", file_menu_entries); monitor_menu = make_menu("Monitor", monitor_menu_entries); device_menu = make_menu("Device", device_menu_entries); - frequencies = new AltosFreqList(); + + frequencies = new AltosUIFreqList(); frequencies.setEnabled(false); - menu_bar.add(frequencies); + c.gridx = 0; + c.gridy = 0; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.WEST; + c.weightx = 0; + c.gridwidth = 1; + bag.add(frequencies, c); + + rates = new AltosUIRateList(); + rates.setEnabled(false); + c.gridx = 1; + c.gridy = 0; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.WEST; + c.weightx = 0; + c.gridwidth = 1; + bag.add(rates, c); displays = new LinkedList<AltosFlightDisplay>(); diff --git a/telegps/TeleGPSConfig.java b/telegps/TeleGPSConfig.java index 3505b0bb..e607a5a5 100644 --- a/telegps/TeleGPSConfig.java +++ b/telegps/TeleGPSConfig.java @@ -22,8 +22,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.text.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSConfig implements ActionListener { diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java index 5f269fd3..7a59bf48 100644 --- a/telegps/TeleGPSConfigUI.java +++ b/telegps/TeleGPSConfigUI.java @@ -21,8 +21,8 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSConfigUI extends AltosUIDialog @@ -37,7 +37,9 @@ public class TeleGPSConfigUI JLabel radio_calibration_label; JLabel radio_frequency_label; JLabel radio_enable_label; + JLabel rate_label; JLabel aprs_interval_label; + JLabel aprs_ssid_label; JLabel flight_log_max_label; JLabel callsign_label; JLabel tracker_motion_label; @@ -49,10 +51,12 @@ public class TeleGPSConfigUI JLabel product_value; JLabel version_value; JLabel serial_value; - AltosFreqList radio_frequency_value; + AltosUIFreqList radio_frequency_value; JTextField radio_calibration_value; JRadioButton radio_enable_value; + AltosUIRateList rate_value; JComboBox<String> aprs_interval_value; + JComboBox<Integer> aprs_ssid_value; JComboBox<String> flight_log_max_value; JTextField callsign_value; JComboBox<String> tracker_motion_value; @@ -72,6 +76,10 @@ public class TeleGPSConfigUI "10" }; + static Integer[] aprs_ssid_values = { + 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 + }; + static String[] tracker_motion_values_m = { "2", "5", @@ -141,6 +149,13 @@ public class TeleGPSConfigUI radio_enable_value.setToolTipText("Firmware version does not support disabling radio"); } + void set_rate_tool_tip() { + if (rate_value.isEnabled()) + rate_value.setToolTipText("Select telemetry baud rate"); + else + rate_value.setToolTipText("Firmware version does not support variable telemetry rates"); + } + void set_aprs_interval_tool_tip() { if (aprs_interval_value.isEnabled()) aprs_interval_value.setToolTipText("Enable APRS and set the interval between APRS reports"); @@ -148,6 +163,15 @@ public class TeleGPSConfigUI aprs_interval_value.setToolTipText("Hardware doesn't support APRS"); } + void set_aprs_ssid_tool_tip() { + if (aprs_ssid_value.isEnabled()) + aprs_interval_value.setToolTipText("Set the APRS SSID (secondary station identifier)"); + else if (aprs_interval_value.isEnabled()) + aprs_interval_value.setToolTipText("Software version doesn't support setting the APRS SSID"); + else + aprs_interval_value.setToolTipText("Hardware doesn't support APRS"); + } + void set_flight_log_max_tool_tip() { if (flight_log_max_value.isEnabled()) flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)"); @@ -255,7 +279,7 @@ public class TeleGPSConfigUI c.anchor = GridBagConstraints.LINE_START; c.insets = ir; c.ipady = 5; - radio_frequency_value = new AltosFreqList(); + radio_frequency_value = new AltosUIFreqList(); radio_frequency_value.addItemListener(this); pane.add(radio_frequency_value, c); radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency"); @@ -311,6 +335,31 @@ public class TeleGPSConfigUI set_radio_enable_tool_tip(); row++; + /* Telemetry Rate */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + rate_label = new JLabel("Telemetry baud rate:"); + pane.add(radio_enable_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + rate_value = new AltosUIRateList(); + rate_value.addItemListener(this); + pane.add(rate_value, c); + set_rate_tool_tip(); + row++; + /* APRS interval */ c = new GridBagConstraints(); c.gridx = 0; c.gridy = row; @@ -337,6 +386,33 @@ public class TeleGPSConfigUI set_aprs_interval_tool_tip(); row++; + /* APRS SSID */ + c = new GridBagConstraints(); + c.gridx = 0; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.LINE_START; + c.insets = il; + c.ipady = 5; + aprs_ssid_label = new JLabel("APRS SSID:"); + pane.add(aprs_ssid_label, c); + + c = new GridBagConstraints(); + c.gridx = 4; c.gridy = row; + c.gridwidth = 4; + c.fill = GridBagConstraints.HORIZONTAL; + c.weightx = 1; + c.anchor = GridBagConstraints.LINE_START; + c.insets = ir; + c.ipady = 5; + aprs_ssid_value = new JComboBox<Integer>(aprs_ssid_values); + aprs_ssid_value.setEditable(false); + aprs_ssid_value.addItemListener(this); + aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length); + pane.add(aprs_ssid_value, c); + set_aprs_ssid_tool_tip(); + row++; + /* Callsign */ c = new GridBagConstraints(); c.gridx = 0; c.gridy = row; @@ -566,12 +642,16 @@ public class TeleGPSConfigUI } public void units_changed(boolean imperial_units) { + boolean was_dirty = dirty; + if (tracker_motion_value.isEnabled()) { String motion = tracker_motion_value.getSelectedItem().toString(); tracker_motion_label.setText(get_tracker_motion_label()); set_tracker_motion_values(); set_tracker_motion((int) (AltosConvert.height.parse(motion, !imperial_units) + 0.5)); } + if (!was_dirty) + set_clean(); } /* set and get all of the dialog values */ @@ -590,6 +670,9 @@ public class TeleGPSConfigUI serial_value.setText(String.format("%d", serial)); } + public void set_altitude_32(int altitude_32) { + } + public void set_main_deploy(int new_main_deploy) { } @@ -657,6 +740,14 @@ public class TeleGPSConfigUI return -1; } + public void set_telemetry_rate(int new_rate) { + rate_value.set_rate(new_rate); + } + + public int telemetry_rate() { + return rate_value.rate(); + } + public void set_callsign(String new_callsign) { callsign_value.setVisible(new_callsign != null); callsign_value.setText(new_callsign); @@ -748,7 +839,12 @@ public class TeleGPSConfigUI } public void set_tracker_motion(int tracker_motion) { - tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion)); + if (tracker_motion < 0) { + tracker_motion_value.setEnabled(false); + } else { + tracker_motion_value.setEnabled(true); + tracker_motion_value.setSelectedItem(AltosConvert.height.say(tracker_motion)); + } } public int tracker_motion() throws AltosConfigDataException { @@ -756,7 +852,12 @@ public class TeleGPSConfigUI } public void set_tracker_interval(int tracker_interval) { - tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval)); + if (tracker_interval< 0) { + tracker_interval_value.setEnabled(false); + } else { + tracker_interval_value.setEnabled(true); + tracker_interval_value.setSelectedItem(String.format("%d", tracker_interval)); + } } public int tracker_interval() throws AltosConfigDataException { @@ -782,4 +883,15 @@ public class TeleGPSConfigUI return 0; return parse_int("aprs interval", s, false); } + + public void set_aprs_ssid(int new_aprs_ssid) { + aprs_ssid_value.setSelectedItem(Math.max(0,new_aprs_ssid)); + aprs_ssid_value.setVisible(new_aprs_ssid >= 0); + set_aprs_ssid_tool_tip(); + } + + public int aprs_ssid() throws AltosConfigDataException { + Integer i = (Integer) aprs_ssid_value.getSelectedItem(); + return i; + } } diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java index a3d4ea07..18b8d9fc 100644 --- a/telegps/TeleGPSDisplayThread.java +++ b/telegps/TeleGPSDisplayThread.java @@ -21,8 +21,8 @@ import java.awt.*; import javax.swing.*; import java.io.*; import java.text.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSDisplayThread extends Thread { diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java index 244eb7b9..b59b122c 100644 --- a/telegps/TeleGPSGraphUI.java +++ b/telegps/TeleGPSGraphUI.java @@ -26,8 +26,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; diff --git a/telegps/TeleGPSInfo.java b/telegps/TeleGPSInfo.java index e87fea90..1b4751b9 100644 --- a/telegps/TeleGPSInfo.java +++ b/telegps/TeleGPSInfo.java @@ -21,8 +21,8 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSInfo extends AltosUIFlightTab { diff --git a/telegps/TeleGPSPreferences.java b/telegps/TeleGPSPreferences.java index 8bd371f4..2738ceea 100644 --- a/telegps/TeleGPSPreferences.java +++ b/telegps/TeleGPSPreferences.java @@ -22,7 +22,7 @@ import java.awt.event.*; import java.beans.*; import javax.swing.*; import javax.swing.event.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSPreferences extends AltosUIConfigure diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java index a76182ed..27321c73 100644 --- a/telegps/TeleGPSState.java +++ b/telegps/TeleGPSState.java @@ -21,8 +21,8 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSState extends AltosUIFlightTab { diff --git a/telegps/TeleGPSStatus.java b/telegps/TeleGPSStatus.java index f3951a37..1d4415d6 100644 --- a/telegps/TeleGPSStatus.java +++ b/telegps/TeleGPSStatus.java @@ -19,8 +19,8 @@ package org.altusmetrum.telegps; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class TeleGPSStatus extends JComponent implements AltosFlightDisplay { GridBagLayout layout; diff --git a/telegps/TeleGPSStatusUpdate.java b/telegps/TeleGPSStatusUpdate.java index e7684d88..3d2b7f34 100644 --- a/telegps/TeleGPSStatusUpdate.java +++ b/telegps/TeleGPSStatusUpdate.java @@ -18,7 +18,7 @@ package org.altusmetrum.telegps; import java.awt.event.*; -import org.altusmetrum.altoslib_4.*; +import org.altusmetrum.altoslib_5.*; public class TeleGPSStatusUpdate implements ActionListener { diff --git a/telegps/telegps.desktop.in b/telegps/altusmetrum-telegps.desktop.in index 3d249d8a..7a1b3536 100644 --- a/telegps/telegps.desktop.in +++ b/telegps/altusmetrum-telegps.desktop.in @@ -3,8 +3,8 @@ Type=Application Name=TeleGPS GenericName=TeleGPS monitor, download and analysis Comment=View and log data from TeleGPS tracking devices -Icon=%icondir%/telegps.svg +Icon=%icondir%/altusmetrum-telegps.svg Exec=%bindir%/telegps %f Terminal=false -MimeType=text/plain; +MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom Categories=Education;Electronics;Science; diff --git a/telegps/telegps-windows.nsi.in b/telegps/telegps-windows.nsi.in index b4145520..603d4971 100644 --- a/telegps/telegps-windows.nsi.in +++ b/telegps/telegps-windows.nsi.in @@ -2,14 +2,24 @@ !addincludedir ../altosui/Instdrv/NSIS/Includes !include x64.nsh !include java.nsh +!include refresh-sh.nsh -Name "TeleGPS Installer" +!define REG_NAME "TeleGPS" +!define PROG_ID_TELEM "altusmetrum.telegps.telem.1" +!define PROG_ID_EEPROM "altusmetrum.telegps.eeprom.1" +!define FAT_NAME "telegps-fat.jar" +!define WIN_APP_ICON "altusmetrum-telegps.ico" +!define WIN_APP_EXE "altusmetrum-telegps.exe" +!define WIN_TELEM_EXE "application-vnd.altusmetrum.telemetry.exe" +!define WIN_EEPROM_EXE "application-vnd.altusmetrum.eeprom.exe" + +Name "${REG_NAME} Installer" ; Default install directory InstallDir "$PROGRAMFILES\AltusMetrum" ; Tell the installer where to re-install a new version -InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir" +InstallDirRegKey HKLM "Software\${REG_NAME}" "Install_Dir" LicenseText "GNU General Public License Version 2" LicenseData "../COPYING" @@ -19,7 +29,7 @@ RequestExecutionLevel admin ShowInstDetails Show -ComponentText "TeleGPS Software Installer" +ComponentText "${REG_NAME} Software and Driver Installer" Function .onInit DetailPrint "Checking host operating system" @@ -31,6 +41,16 @@ Function .onInit ${EndIf} FunctionEnd +Function un.onInit + DetailPrint "Checking host operating system" + ${If} ${RunningX64} + DetailPrint "Installer running on 64-bit host" + SetRegView 64 + StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum" + ${DisableX64FSRedirection} + ${EndIf} +FunctionEnd + ; Pages to present Page license @@ -66,12 +86,12 @@ done: SectionEnd -Section "TeleGPS Application" +Section "${REG_NAME} Application" Call DetectJRE SetOutPath $INSTDIR - File "telegps-fat.jar" + File "${FAT_NAME}" File "altoslib_@ALTOSLIB_VERSION@.jar" File "altosuilib_@ALTOSUILIB_VERSION@.jar" File "cmudict04.jar" @@ -86,13 +106,13 @@ Section "TeleGPS Application" File "*.dll" - File "../icon/*.ico" + File "../icon/${WIN_APP_ICON}" - CreateShortCut "$SMPROGRAMS\TeleGPS.lnk" "$SYSDIR\javaw.exe" "-jar telegps-fat.jar" "$INSTDIR\telegps.ico" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}" SectionEnd -Section "TeleGPS Desktop Shortcut" - CreateShortCut "$DESKTOP\TeleGPS.lnk" "$INSTDIR\telegps-fat.jar" "" "$INSTDIR\telegps.ico" +Section "${REG_NAME} Desktop Shortcut" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "TeleGPS, TeleDongle and TeleBT Firmware" @@ -114,38 +134,105 @@ Section "Documentation" File "../doc/telemetry.pdf" SectionEnd +Section "File Associations" + + ${DisableX64FSRedirection} + + SetOutPath $INSTDIR + + File "../icon/${WIN_APP_EXE}" + File "../icon/${WIN_TELEM_EXE}" + File "../icon/${WIN_EEPROM_EXE}" + + DeleteRegKey HKCR "${PROG_ID_TELEM}" + DeleteRegKey HKCR "${PROG_ID_EEPROM}" + + DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}" + DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" + DeleteRegKey HKCR ".telem\${PROG_ID_EEPROM}" + DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_EEPROM}" + + ; .eeprom elements + + WriteRegStr HKCR "${PROG_ID_EEPROM}" "" "Altus Metrum Log File" + WriteRegStr HKCR "${PROG_ID_EEPROM}" "FriendlyTypeName" "Altus Metrum Log File" + WriteRegStr HKCR "${PROG_ID_EEPROM}\CurVer" "" "${PROG_ID_EEPROM}" + WriteRegStr HKCR "${PROG_ID_EEPROM}\DefaultIcon" "" '"$INSTDIR\${WIN_EEPROM_EXE}",-101' + WriteRegExpandStr HKCR "${PROG_ID_EEPROM}\shell\open\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + + WriteRegStr HKCR ".eeprom" "" "${PROG_ID_EEPROM}" + WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File" + WriteRegStr HKCR ".eeprom" "Content Type" "application/vnd.altusmetrum.eeprom" + + WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" "" + WriteRegStr HKCR ".eeprom\${PROG_ID_EEPROM}" "" "${REG_NAME}" + + ; .telem elements + + WriteRegStr HKCR "${PROG_ID_TELEM}" "" "Altus Metrum Telemetry File" + WriteRegStr HKCR "${PROG_ID_TELEM}" "FriendlyTypeName" "Altus Metrum Telemetry File" + WriteRegStr HKCR "${PROG_ID_TELEM}\CurVer" "" "${PROG_ID_TELEM}" + WriteRegStr HKCR "${PROG_ID_TELEM}\DefaultIcon" "" '"$INSTDIR\${WIN_TELEM_EXE}",-101' + WriteRegExpandStr HKCR "${PROG_ID_TELEM}\shell\open\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + + WriteRegStr HKCR ".telem" "" "${PROG_ID_TELEM}" + WriteRegStr HKCR ".telem" "PerceivedType" "Altus Metrum Telemetry File" + WriteRegStr HKCR ".telem" "Content Type" "application/vnd.altusmetrum.telemetry" + + WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" "" + WriteRegStr HKCR ".telem\${PROG_ID_TELEM}" "" "${REG_NAME}" + + Call RefreshShellIcons +SectionEnd + Section "Uninstaller" ; Deal with the uninstaller + ${DisableX64FSRedirection} SetOutPath $INSTDIR ; Write the install path to the registry - WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "SOFTWARE\${REG_NAME}" "Install_Dir" "$INSTDIR" ; Write the uninstall keys for windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "DisplayName" "${REG_NAME}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "UninstallString" '"$INSTDIR\uninstall-${REG_NAME}.exe"' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoModify" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoRepair" "1" - WriteUninstaller "uninstall.exe" + WriteUninstaller "uninstall-${REG_NAME}.exe" SectionEnd Section "Uninstall" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" - DeleteRegKey HKLM "Software\AltusMetrum" - Delete "$INSTDIR\*.*" - RMDir "$INSTDIR" + ${DisableX64FSRedirection} - ; Remove devices - InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial - InstDrv::DeleteOemInfFiles /NOUNLOAD - InstDrv::RemoveAllDevices + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" + DeleteRegKey HKLM "SOFTWARE\${REG_NAME}" + + DetailPrint "Delete uninstall reg entries" + + DeleteRegKey HKCR "${PROG_ID_EEPROM}" + DeleteRegKey HKCR "${PROG_ID_TELEM}" + + DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}" + DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" + + DeleteRegKey HKCR ".telem\${PROG_ID_TELEM}" + DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" + + DetailPrint "Delete file association reg entries" + + Delete "$INSTDIR\${FAT_NAME}" + Delete "$INSTDIR\uninstall-${REG_NAME}.exe" + + Delete "$INSTDIR\${WIN_APP_ICON}" + Delete "$INSTDIR\${WIN_APP_EXE}" ; Remove shortcuts, if any - Delete "$SMPROGRAMS\TeleGPS.lnk" - Delete "$DESKTOP\TeleGPS.lnk" + Delete "$SMPROGRAMS\${REG_NAME}.lnk" + Delete "$DESKTOP\${REG_NAME}.lnk" + Call un.RefreshShellIcons SectionEnd |
