From 066a01ad0b4e73fdb47b43a42c1d0b7fae81a180 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 16 Feb 2014 14:57:38 -0800 Subject: Put altusmetrum.svg and micropeak.svg in icon directory Signed-off-by: Keith Packard --- icon/altusmetrum.svg | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++ icon/micropeak.svg | 184 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 399 insertions(+) create mode 100644 icon/altusmetrum.svg create mode 100644 icon/micropeak.svg (limited to 'icon') diff --git a/icon/altusmetrum.svg b/icon/altusmetrum.svg new file mode 100644 index 00000000..256b8c5a --- /dev/null +++ b/icon/altusmetrum.svg @@ -0,0 +1,215 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icon/micropeak.svg b/icon/micropeak.svg new file mode 100644 index 00000000..e6fbe120 --- /dev/null +++ b/icon/micropeak.svg @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + -- cgit v1.2.3 From 948a614a62754fd4fffd9b84ad83fd444e4f0437 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 16 Feb 2014 15:17:40 -0800 Subject: Move .desktop and icon management out of debian dir This constructs a .desktop file from a template and installs it, along with suitable .svg icons, during the normal build process Signed-off-by: Keith Packard --- Makefile.am | 2 +- altosui/.gitignore | 2 ++ altosui/Makefile.am | 15 +++++++++++---- altosui/altos.desktop.in | 10 ++++++++++ altosui/linux-install.sh | 8 +++++++- configure.ac | 1 + debian/altos.desktop | 10 ---------- debian/altos.install | 2 -- icon/Makefile.am | 26 ++++++++++++++++++++++++++ 9 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 altosui/altos.desktop.in delete mode 100644 debian/altos.desktop create mode 100644 icon/Makefile.am (limited to 'icon') diff --git a/Makefile.am b/Makefile.am index fa4da1fe..f035bb39 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS=ao-tools src doc altoslib libaltos altosuilib altosui micropeak ao-utils altosdroid +SUBDIRS=ao-tools src doc icon altoslib libaltos altosuilib altosui micropeak ao-utils altosdroid EXTRA_DIST = ChangeLog diff --git a/altosui/.gitignore b/altosui/.gitignore index 4ee3f4ad..10b600e4 100644 --- a/altosui/.gitignore +++ b/altosui/.gitignore @@ -14,8 +14,10 @@ altosui-jdb classaltosui.stamp altos-windows.nsi Altos-Linux-*.tar.bz2 +Altos-Linux-*.sh Altos-Mac-*.zip Altos-Windows-*.exe +altos.desktop *.dll *.dylib *.so diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 20b234ab..03c1cfc9 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -103,6 +103,10 @@ LIBALTOS= \ libaltos.dylib \ altos.dll +desktopdir = $(datadir)/applications +desktop_file = altos.desktop +desktop_DATA = $(desktop_file) + JAR=altosui.jar FATJAR=altosui-fat.jar @@ -179,8 +183,8 @@ FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFR LINUX_LIBS=libaltos32.so libaltos64.so -LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) -LINUX_EXTRA=altosui-fat ../debian/altos.desktop ../debian/altusmetrum.xpm +LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) altos.desktop.in ../icon/altusmetrum.svg +LINUX_EXTRA=altosui-fat MACOSX_INFO_PLIST=Info.plist MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf @@ -196,6 +200,11 @@ clean-local: $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log altos-windows.nsi \ altosui altosui-test altosui-jdb macosx linux +EXTRA_DIST = $(desktop_file).in + +$(desktop_file): $(desktop_file).in + sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/altos.desktop.in > $@ + if FATINSTALL FATTARGET=$(FATDIR)/$(VERSION) @@ -335,8 +344,6 @@ $(LINUX_DIST): $(LINUX_FILES) $(LINUX_EXTRA) -rm -rf linux mkdir -p linux/AltOS cp -p $(LINUX_FILES) linux/AltOS - sed -e 's;/usr/bin;%BIN%;' -e 's;/usr/share/pixmaps;%BIN%;' $(srcdir)/../debian/altos.desktop > linux/AltOS/altos.desktop.in - cp -p $(srcdir)/../debian/altusmetrum.xpm linux/AltOS/altusmetrum.xpm cp -p altosui-fat linux/AltOS/altosui chmod +x linux/AltOS/altosui tar cjf $@ -C linux AltOS diff --git a/altosui/altos.desktop.in b/altosui/altos.desktop.in new file mode 100644 index 00000000..66114348 --- /dev/null +++ b/altosui/altos.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=AltOS UI +GenericName=Altus Metrum Ground Station +Comment=View and log downlink data from Altus Metrum products +Icon=%icondir%/altusmetrum.svg +Exec=%bindir%/altosui %f +Terminal=false +MimeType=text/plain; +Categories=Education;Electronics;Science; diff --git a/altosui/linux-install.sh b/altosui/linux-install.sh index c5101eb4..d7ec9517 100644 --- a/altosui/linux-install.sh +++ b/altosui/linux-install.sh @@ -144,7 +144,7 @@ BIN="$target_abs"/AltOS desktop="$target"/AltOS/altos.desktop rm -f "$desktop" -sed "s;%BIN%;$BIN;" "$target"/AltOS/altos.desktop.in > "$desktop" +sed -e "s;%bindir%;$BIN;" -e "s;%icondir%;$BIN;" "$target"/AltOS/altos.desktop.in > "$desktop" # # Figure out where to install the .desktop file. If we can, write it @@ -185,6 +185,12 @@ case "$?" in ;; esac +# +# Install icon to desktop if desired +# + + + finish 0 __ARCHIVE_BELOW__ diff --git a/configure.ac b/configure.ac index 6be99d1f..12cfdaa0 100644 --- a/configure.ac +++ b/configure.ac @@ -487,6 +487,7 @@ AC_OUTPUT([ Makefile src/Makedefs altoslib/Makefile +icon/Makefile altosuilib/Makefile altosuilib/AltosUIVersion.java altosui/Makefile diff --git a/debian/altos.desktop b/debian/altos.desktop deleted file mode 100644 index 2d93f29d..00000000 --- a/debian/altos.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Name=AltOS UI -GenericName=Altus Metrum Ground Station -Comment=View and log downlink data from Altus Metrum products -Icon=/usr/share/pixmaps/altusmetrum.svg -Exec=/usr/bin/altosui %f -Terminal=false -MimeType=text/plain; -Categories=Education;Electronics;Science; diff --git a/debian/altos.install b/debian/altos.install index 8bfdd837..50f21eb1 100644 --- a/debian/altos.install +++ b/debian/altos.install @@ -1,5 +1,3 @@ -debian/altos.desktop usr/share/applications -debian/altusmetrum.svg usr/share/pixmaps debian/altusmetrum.xpm usr/share/pixmaps src/*/*.ihx usr/share/altos src/*/*.map usr/share/altos diff --git a/icon/Makefile.am b/icon/Makefile.am new file mode 100644 index 00000000..eedb7760 --- /dev/null +++ b/icon/Makefile.am @@ -0,0 +1,26 @@ +RES=16 32 48 256 + +AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done) +MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done) + +ICO_FILES=altus-metrum.ico micro-peak.ico + +icondir = $(datadir)/icons/hicolor/scalable/apps + +AM_ICON = altusmetrum.svg +MP_ICON = micropeak.svg + +icon_DATA = $(AM_ICON) $(MP_ICON) + +EXTRA_DIST = $(icon_DATA) $(AM_FILES) $(MP_FILES) + +all-local: $(ICO_FILES) + +#clean-local: +# $(RM) -f $(ICO_FILES) + +altus-metrum.ico: $(AM_FILES) + icotool -c -o $@ $(AM_FILES) + +micro-peak.ico: $(MP_FILES) + icotool -c -o $@ $(MP_FILES) \ No newline at end of file -- cgit v1.2.3 From 3871b9ac036e3adfa1da089245fc7973b268c921 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 28 May 2014 21:56:52 -0700 Subject: telegps: Add 'Info' tab This contains a summary of the tracking info, including position, speed and course. Signed-off-by: Keith Packard --- altoslib/AltosConvert.java | 26 ++ altoslib/AltosGreatCircle.java | 26 +- altoslib/AltosState.java | 24 ++ altosui/AltosCSVUI.java | 104 -------- altosui/AltosDataChooser.java | 83 ------- altosui/AltosLed.java | 45 ---- altosui/AltosLights.java | 65 ----- altosui/Makefile.am | 15 +- altosuilib/AltosCSVUI.java | 103 ++++++++ altosuilib/AltosDataChooser.java | 82 +++++++ altosuilib/AltosLed.java | 45 ++++ altosuilib/AltosLights.java | 65 +++++ altosuilib/Makefile.am | 20 +- icon/telegps-128.png | Bin 0 -> 8736 bytes icon/telegps-16.png | Bin 0 -> 507 bytes icon/telegps-256.png | Bin 0 -> 21589 bytes icon/telegps-32.png | Bin 0 -> 1475 bytes icon/telegps-48.png | Bin 0 -> 2507 bytes icon/telegps-512.png | Bin 0 -> 56581 bytes icon/telegps-64.png | Bin 0 -> 3678 bytes icon/telegps.ico | Bin 0 -> 285478 bytes icon/telegps.svg | 215 ++++++++++++++++ telegps/Makefile.am | 1 + telegps/TeleGPS.java | 13 + telegps/TeleGPSInfo.java | 511 +++++++++++++++++++++++++++++++++++++++ 25 files changed, 1109 insertions(+), 334 deletions(-) delete mode 100644 altosui/AltosCSVUI.java delete mode 100644 altosui/AltosDataChooser.java delete mode 100644 altosui/AltosLed.java delete mode 100644 altosui/AltosLights.java create mode 100644 altosuilib/AltosCSVUI.java create mode 100644 altosuilib/AltosDataChooser.java create mode 100644 altosuilib/AltosLed.java create mode 100644 altosuilib/AltosLights.java create mode 100644 icon/telegps-128.png create mode 100644 icon/telegps-16.png create mode 100644 icon/telegps-256.png create mode 100644 icon/telegps-32.png create mode 100644 icon/telegps-48.png create mode 100644 icon/telegps-512.png create mode 100644 icon/telegps-64.png create mode 100644 icon/telegps.ico create mode 100644 icon/telegps.svg create mode 100644 telegps/TeleGPSInfo.java (limited to 'icon') diff --git a/altoslib/AltosConvert.java b/altoslib/AltosConvert.java index 484f6213..a65669da 100644 --- a/altoslib/AltosConvert.java +++ b/altoslib/AltosConvert.java @@ -371,4 +371,30 @@ public class AltosConvert { return 94; return (int) Math.floor (1.0/2.0 * (24.0e6/32.0) / freq + 0.5); } + + public static final int BEARING_LONG = 0; + public static final int BEARING_SHORT = 1; + public static final int BEARING_VOICE = 2; + + public static String bearing_to_words(int length, double bearing) { + String [][] bearing_string = { + { + "North", "North North East", "North East", "East North East", + "East", "East South East", "South East", "South South East", + "South", "South South West", "South West", "West South West", + "West", "West North West", "North West", "North North West" + }, { + "N", "NNE", "NE", "ENE", + "E", "ESE", "SE", "SSE", + "S", "SSW", "SW", "WSW", + "W", "WNW", "NW", "NNW" + }, { + "north", "nor nor east", "north east", "east nor east", + "east", "east sow east", "south east", "sow sow east", + "south", "sow sow west", "south west", "west sow west", + "west", "west nor west", "north west", "nor nor west " + } + }; + return bearing_string[length][(int)((bearing / 90 * 8 + 1) / 2)%16]; + } } diff --git a/altoslib/AltosGreatCircle.java b/altoslib/AltosGreatCircle.java index 39df4fc8..4782c34d 100644 --- a/altoslib/AltosGreatCircle.java +++ b/altoslib/AltosGreatCircle.java @@ -30,30 +30,12 @@ public class AltosGreatCircle implements Cloneable { static final double rad = Math.PI / 180; static final double earth_radius = 6371.2 * 1000; /* in meters */ - public static final int BEARING_LONG = 0; - public static final int BEARING_SHORT = 1; - public static final int BEARING_VOICE = 2; + public static final int BEARING_LONG = AltosConvert.BEARING_LONG; + public static final int BEARING_SHORT = AltosConvert.BEARING_SHORT; + public static final int BEARING_VOICE = AltosConvert.BEARING_VOICE; public String bearing_words(int length) { - String [][] bearing_string = { - { - "North", "North North East", "North East", "East North East", - "East", "East South East", "South East", "South South East", - "South", "South South West", "South West", "West South West", - "West", "West North West", "North West", "North North West" - }, { - "N", "NNE", "NE", "ENE", - "E", "ESE", "SE", "SSE", - "S", "SSW", "SW", "WSW", - "W", "WNW", "NW", "NNW" - }, { - "north", "nor nor east", "north east", "east nor east", - "east", "east sow east", "south east", "sow sow east", - "south", "sow sow west", "south west", "west sow west", - "west", "west nor west", "north west", "nor nor west " - } - }; - return bearing_string[length][(int)((bearing / 90 * 8 + 1) / 2)%16]; + return AltosConvert.bearing_to_words(length, bearing); } public AltosGreatCircle (double start_lat, double start_lon, double start_alt, diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 9e8e22ac..1162e522 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -389,6 +389,10 @@ public class AltosState implements Cloneable { private AltosGpsAltitude gps_altitude; + private AltosValue gps_ground_speed; + private AltosValue gps_ascent_rate; + private AltosValue gps_course; + public double altitude() { double a = altitude.value(); if (a != AltosLib.MISSING) @@ -419,6 +423,18 @@ public class AltosState implements Cloneable { gps_altitude.set(new_gps_altitude, time); } + public double gps_ground_speed() { + return gps_ground_speed.value(); + } + + public double gps_ascent_rate() { + return gps_ascent_rate.value(); + } + + public double gps_course() { + return gps_course.value(); + } + class AltosPressure extends AltosValue { void set(double p, double time) { super.set(p, time); @@ -695,6 +711,8 @@ public class AltosState implements Cloneable { gps_altitude = new AltosGpsAltitude(); gps_ground_altitude = new AltosGpsGroundAltitude(); + gps_ground_speed = new AltosValue(); + gps_ascent_rate = new AltosValue(); speak_tick = AltosLib.MISSING; speak_altitude = AltosLib.MISSING; @@ -877,6 +895,12 @@ public class AltosState implements Cloneable { gps_ground_altitude.set(gps.alt, time); } gps_altitude.set(gps.alt, time); + if (gps.climb_rate != AltosLib.MISSING) + gps_ascent_rate.set(gps.climb_rate, time); + if (gps.ground_speed != AltosLib.MISSING) + gps_ground_speed.set(gps.ground_speed, time); + if (gps.course != AltosLib.MISSING) + gps_course.set(gps.course, time); } if (gps.lat != 0 && gps.lon != 0 && pad_lat != AltosLib.MISSING && diff --git a/altosui/AltosCSVUI.java b/altosui/AltosCSVUI.java deleted file mode 100644 index a0fceee5..00000000 --- a/altosui/AltosCSVUI.java +++ /dev/null @@ -1,104 +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.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.io.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; - -public class AltosCSVUI - extends AltosUIDialog - implements ActionListener -{ - JFileChooser csv_chooser; - JPanel accessory; - JComboBox combo_box; - Iterable states; - AltosWriter writer; - - static String[] combo_box_items = { "Comma Separated Values (.CSV)", "Googleearth Data (.KML)" }; - - void set_default_file() { - File current = csv_chooser.getSelectedFile(); - String current_name = current.getName(); - String new_name = null; - String selected = (String) combo_box.getSelectedItem(); - - if (selected.contains("CSV")) - new_name = Altos.replace_extension(current_name, ".csv"); - else if (selected.contains("KML")) - new_name = Altos.replace_extension(current_name, ".kml"); - if (new_name != null) - csv_chooser.setSelectedFile(new File(new_name)); - } - - public void actionPerformed(ActionEvent e) { - if (e.getActionCommand().equals("comboBoxChanged")) - set_default_file(); - } - - public AltosCSVUI(JFrame frame, AltosStateIterable states, File source_file) { - this.states = states; - csv_chooser = new JFileChooser(source_file); - - accessory = new JPanel(); - accessory.setLayout(new GridBagLayout()); - - GridBagConstraints c = new GridBagConstraints(); - c.fill = GridBagConstraints.NONE; - c.weightx = 1; - c.weighty = 0; - c.insets = new Insets (4, 4, 4, 4); - - JLabel accessory_label = new JLabel("Export File Type"); - c.gridx = 0; - c.gridy = 0; - accessory.add(accessory_label, c); - - combo_box = new JComboBox(combo_box_items); - combo_box.addActionListener(this); - c.gridx = 0; - c.gridy = 1; - accessory.add(combo_box, c); - - csv_chooser.setAccessory(accessory); - csv_chooser.setSelectedFile(source_file); - set_default_file(); - int ret = csv_chooser.showSaveDialog(frame); - if (ret == JFileChooser.APPROVE_OPTION) { - File file = csv_chooser.getSelectedFile(); - String type = (String) combo_box.getSelectedItem(); - try { - if (type.contains("CSV")) - writer = new AltosCSV(file); - else - writer = new AltosKML(file); - writer.write(states); - writer.close(); - } catch (FileNotFoundException ee) { - JOptionPane.showMessageDialog(frame, - ee.getMessage(), - "Cannot open file", - JOptionPane.ERROR_MESSAGE); - } - } - } -} diff --git a/altosui/AltosDataChooser.java b/altosui/AltosDataChooser.java deleted file mode 100644 index 43726a44..00000000 --- a/altosui/AltosDataChooser.java +++ /dev/null @@ -1,83 +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 javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import java.io.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; - -public class AltosDataChooser extends JFileChooser { - JFrame frame; - String filename; - File file; - - public String filename() { - return filename; - } - - public File file() { - return file; - } - - public AltosStateIterable runDialog() { - int ret; - - ret = showOpenDialog(frame); - if (ret == APPROVE_OPTION) { - file = getSelectedFile(); - if (file == null) - return null; - filename = file.getName(); - try { - if (filename.endsWith("eeprom")) { - FileInputStream in = new FileInputStream(file); - return new AltosEepromFile(in); - } else if (filename.endsWith("telem")) { - FileInputStream in = new FileInputStream(file); - return new AltosTelemetryFile(in); - } else { - throw new FileNotFoundException(); - } - } catch (FileNotFoundException fe) { - JOptionPane.showMessageDialog(frame, - fe.getMessage(), - "Cannot open file", - JOptionPane.ERROR_MESSAGE); - } - } - return null; - } - - public AltosDataChooser(JFrame in_frame) { - frame = in_frame; - setDialogTitle("Select Flight Record File"); - setFileFilter(new FileNameExtensionFilter("TeleMetrum eeprom file", - "eeprom")); - setFileFilter(new FileNameExtensionFilter("Telemetry file", - "telem")); - setFileFilter(new FileNameExtensionFilter("TeleMega eeprom file", - "mega")); - setFileFilter(new FileNameExtensionFilter("EasyMini eeprom file", - "mini")); - setFileFilter(new FileNameExtensionFilter("Flight data file", - "telem", "eeprom", "mega", "mini")); - setCurrentDirectory(AltosUIPreferences.logdir()); - } -} diff --git a/altosui/AltosLed.java b/altosui/AltosLed.java deleted file mode 100644 index 93064f1e..00000000 --- a/altosui/AltosLed.java +++ /dev/null @@ -1,45 +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 javax.swing.*; - -public class AltosLed extends JLabel { - ImageIcon on, off; - - ImageIcon create_icon(String path) { - java.net.URL imgURL = AltosUI.class.getResource(path); - if (imgURL != null) - return new ImageIcon(imgURL); - System.err.printf("Cannot find icon \"%s\"\n", path); - return null; - } - - public void set(boolean set) { - if (set) - setIcon(on); - else - setIcon(off); - } - - public AltosLed(String on_path, String off_path) { - on = create_icon(on_path); - off = create_icon(off_path); - setIcon(off); - } -} diff --git a/altosui/AltosLights.java b/altosui/AltosLights.java deleted file mode 100644 index 7ad22f3e..00000000 --- a/altosui/AltosLights.java +++ /dev/null @@ -1,65 +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.awt.*; -import javax.swing.*; - -public class AltosLights extends JComponent { - - GridBagLayout gridbag; - - AltosLed red, green; - - ImageIcon create_icon(String path, String description) { - java.net.URL imgURL = AltosUI.class.getResource(path); - if (imgURL != null) - return new ImageIcon(imgURL, description); - System.err.printf("Cannot find icon \"%s\"\n", path); - return null; - } - - public void set (boolean on) { - if (on) { - red.set(false); - green.set(true); - } else { - red.set(true); - green.set(false); - } - } - - public AltosLights() { - GridBagConstraints c; - gridbag = new GridBagLayout(); - setLayout(gridbag); - - c = new GridBagConstraints(); - red = new AltosLed("/redled.png", "/grayled.png"); - c.gridx = 0; c.gridy = 0; - c.insets = new Insets (0, 5, 0, 5); - gridbag.setConstraints(red, c); - add(red); - red.set(true); - green = new AltosLed("/greenled.png", "/grayled.png"); - c.gridx = 1; c.gridy = 0; - gridbag.setConstraints(green, c); - add(green); - green.set(false); - } -} diff --git a/altosui/Makefile.am b/altosui/Makefile.am index c834646d..9eff1614 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -20,7 +20,6 @@ altosui_JAVA = \ AltosConfigureUI.java \ AltosConfigTD.java \ AltosConfigTDUI.java \ - AltosCSVUI.java \ AltosDescent.java \ AltosFlashUI.java \ AltosFlightInfoTableModel.java \ @@ -36,8 +35,6 @@ altosui_JAVA = \ AltosLaunchUI.java \ AltosInfoTable.java \ AltosLanded.java \ - AltosLed.java \ - AltosLights.java \ AltosPad.java \ AltosUIPreferencesBackend.java \ AltosRomconfigUI.java \ @@ -45,8 +42,7 @@ altosui_JAVA = \ AltosGraph.java \ AltosGraphDataPoint.java \ AltosGraphDataSet.java \ - AltosGraphUI.java \ - AltosDataChooser.java + AltosGraphUI.java JFREECHART_CLASS= \ jfreechart.jar @@ -94,20 +90,13 @@ JAVA_ICONS=\ $(ICONDIR)/altus-metrum-128.png \ $(ICONDIR)/altus-metrum-256.png -ICONS= $(ICONDIR)/redled.png $(ICONDIR)/redoff.png \ - $(ICONDIR)/greenled.png $(ICONDIR)/greenoff.png \ - $(ICONDIR)/grayled.png $(ICONDIR)/grayoff.png - # icon base names for jar ICONJAR= -C $(ICONDIR) altus-metrum-16.png \ -C $(ICONDIR) altus-metrum-32.png \ -C $(ICONDIR) altus-metrum-48.png \ -C $(ICONDIR) altus-metrum-64.png \ -C $(ICONDIR) altus-metrum-128.png \ - -C $(ICONDIR) altus-metrum-256.png \ - -C $(ICONDIR) redled.png -C $(ICONDIR) redoff.png \ - -C $(ICONDIR) greenled.png -C $(ICONDIR) greenoff.png \ - -C $(ICONDIR) grayon.png -C $(ICONDIR) grayled.png + -C $(ICONDIR) altus-metrum-256.png WINDOWS_ICON=$(ICONDIR)/altus-metrum.ico diff --git a/altosuilib/AltosCSVUI.java b/altosuilib/AltosCSVUI.java new file mode 100644 index 00000000..0a5e4fa2 --- /dev/null +++ b/altosuilib/AltosCSVUI.java @@ -0,0 +1,103 @@ +/* + * 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.altosuilib_2; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import java.io.*; +import org.altusmetrum.altoslib_4.*; + +public class AltosCSVUI + extends AltosUIDialog + implements ActionListener +{ + JFileChooser csv_chooser; + JPanel accessory; + JComboBox combo_box; + Iterable states; + AltosWriter writer; + + static String[] combo_box_items = { "Comma Separated Values (.CSV)", "Googleearth Data (.KML)" }; + + void set_default_file() { + File current = csv_chooser.getSelectedFile(); + String current_name = current.getName(); + String new_name = null; + String selected = (String) combo_box.getSelectedItem(); + + if (selected.contains("CSV")) + new_name = AltosLib.replace_extension(current_name, ".csv"); + else if (selected.contains("KML")) + new_name = AltosLib.replace_extension(current_name, ".kml"); + if (new_name != null) + csv_chooser.setSelectedFile(new File(new_name)); + } + + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand().equals("comboBoxChanged")) + set_default_file(); + } + + public AltosCSVUI(JFrame frame, AltosStateIterable states, File source_file) { + this.states = states; + csv_chooser = new JFileChooser(source_file); + + accessory = new JPanel(); + accessory.setLayout(new GridBagLayout()); + + GridBagConstraints c = new GridBagConstraints(); + c.fill = GridBagConstraints.NONE; + c.weightx = 1; + c.weighty = 0; + c.insets = new Insets (4, 4, 4, 4); + + JLabel accessory_label = new JLabel("Export File Type"); + c.gridx = 0; + c.gridy = 0; + accessory.add(accessory_label, c); + + combo_box = new JComboBox(combo_box_items); + combo_box.addActionListener(this); + c.gridx = 0; + c.gridy = 1; + accessory.add(combo_box, c); + + csv_chooser.setAccessory(accessory); + csv_chooser.setSelectedFile(source_file); + set_default_file(); + int ret = csv_chooser.showSaveDialog(frame); + if (ret == JFileChooser.APPROVE_OPTION) { + File file = csv_chooser.getSelectedFile(); + String type = (String) combo_box.getSelectedItem(); + try { + if (type.contains("CSV")) + writer = new AltosCSV(file); + else + writer = new AltosKML(file); + writer.write(states); + writer.close(); + } catch (FileNotFoundException ee) { + JOptionPane.showMessageDialog(frame, + ee.getMessage(), + "Cannot open file", + JOptionPane.ERROR_MESSAGE); + } + } + } +} diff --git a/altosuilib/AltosDataChooser.java b/altosuilib/AltosDataChooser.java new file mode 100644 index 00000000..14d28115 --- /dev/null +++ b/altosuilib/AltosDataChooser.java @@ -0,0 +1,82 @@ +/* + * 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.altosuilib_2; + +import javax.swing.*; +import javax.swing.filechooser.FileNameExtensionFilter; +import java.io.*; +import org.altusmetrum.altoslib_4.*; + +public class AltosDataChooser extends JFileChooser { + JFrame frame; + String filename; + File file; + + public String filename() { + return filename; + } + + public File file() { + return file; + } + + public AltosStateIterable runDialog() { + int ret; + + ret = showOpenDialog(frame); + if (ret == APPROVE_OPTION) { + file = getSelectedFile(); + if (file == null) + return null; + filename = file.getName(); + try { + if (filename.endsWith("eeprom")) { + FileInputStream in = new FileInputStream(file); + return new AltosEepromFile(in); + } else if (filename.endsWith("telem")) { + FileInputStream in = new FileInputStream(file); + return new AltosTelemetryFile(in); + } else { + throw new FileNotFoundException(); + } + } catch (FileNotFoundException fe) { + JOptionPane.showMessageDialog(frame, + fe.getMessage(), + "Cannot open file", + JOptionPane.ERROR_MESSAGE); + } + } + return null; + } + + public AltosDataChooser(JFrame in_frame) { + frame = in_frame; + setDialogTitle("Select Flight Record File"); + setFileFilter(new FileNameExtensionFilter("TeleMetrum eeprom file", + "eeprom")); + setFileFilter(new FileNameExtensionFilter("Telemetry file", + "telem")); + setFileFilter(new FileNameExtensionFilter("TeleMega eeprom file", + "mega")); + setFileFilter(new FileNameExtensionFilter("EasyMini eeprom file", + "mini")); + setFileFilter(new FileNameExtensionFilter("Flight data file", + "telem", "eeprom", "mega", "mini")); + setCurrentDirectory(AltosUIPreferences.logdir()); + } +} diff --git a/altosuilib/AltosLed.java b/altosuilib/AltosLed.java new file mode 100644 index 00000000..2debb62a --- /dev/null +++ b/altosuilib/AltosLed.java @@ -0,0 +1,45 @@ +/* + * 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.altosuilib_2; + +import javax.swing.*; + +public class AltosLed extends JLabel { + ImageIcon on, off; + + ImageIcon create_icon(String path) { + java.net.URL imgURL = AltosUILib.class.getResource(path); + if (imgURL != null) + return new ImageIcon(imgURL); + System.err.printf("Cannot find icon \"%s\"\n", path); + return null; + } + + public void set(boolean set) { + if (set) + setIcon(on); + else + setIcon(off); + } + + public AltosLed(String on_path, String off_path) { + on = create_icon(on_path); + off = create_icon(off_path); + setIcon(off); + } +} diff --git a/altosuilib/AltosLights.java b/altosuilib/AltosLights.java new file mode 100644 index 00000000..c91b70e9 --- /dev/null +++ b/altosuilib/AltosLights.java @@ -0,0 +1,65 @@ +/* + * 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.altosuilib_2; + +import java.awt.*; +import javax.swing.*; + +public class AltosLights extends JComponent { + + GridBagLayout gridbag; + + AltosLed red, green; + + ImageIcon create_icon(String path, String description) { + java.net.URL imgURL = AltosUILib.class.getResource(path); + if (imgURL != null) + return new ImageIcon(imgURL, description); + System.err.printf("Cannot find icon \"%s\"\n", path); + return null; + } + + public void set (boolean on) { + if (on) { + red.set(false); + green.set(true); + } else { + red.set(true); + green.set(false); + } + } + + public AltosLights() { + GridBagConstraints c; + gridbag = new GridBagLayout(); + setLayout(gridbag); + + c = new GridBagConstraints(); + red = new AltosLed("/redled.png", "/grayled.png"); + c.gridx = 0; c.gridy = 0; + c.insets = new Insets (0, 5, 0, 5); + gridbag.setConstraints(red, c); + add(red); + red.set(true); + green = new AltosLed("/greenled.png", "/grayled.png"); + c.gridx = 1; c.gridy = 0; + gridbag.setConstraints(green, c); + add(green); + green.set(false); + } +} diff --git a/altosuilib/Makefile.am b/altosuilib/Makefile.am index 4dc4c47f..f554fd74 100644 --- a/altosuilib/Makefile.am +++ b/altosuilib/Makefile.am @@ -50,6 +50,10 @@ altosuilib_JAVA = \ AltosEepromManage.java \ AltosEepromMonitorUI.java \ AltosEepromSelect.java \ + AltosCSVUI.java \ + AltosDataChooser.java \ + AltosLights.java \ + AltosLed.java \ AltosBTDevice.java \ AltosBTDeviceIterator.java \ AltosBTManage.java \ @@ -58,6 +62,18 @@ altosuilib_JAVA = \ JAR=altosuilib_$(ALTOSUILIB_VERSION).jar +# Icons +ICONDIR=$(top_srcdir)/icon + +ICONS= $(ICONDIR)/redled.png $(ICONDIR)/redoff.png \ + $(ICONDIR)/greenled.png $(ICONDIR)/greenoff.png \ + $(ICONDIR)/grayon.png $(ICONDIR)/grayled.png + +# icon base names for jar +ICONJAR= -C $(ICONDIR) redled.png -C $(ICONDIR) redoff.png \ + -C $(ICONDIR) greenled.png -C $(ICONDIR) greenoff.png \ + -C $(ICONDIR) grayon.png -C $(ICONDIR) grayled.png + all-local: $(JAR) clean-local: @@ -72,5 +88,5 @@ install-altosuilibJAVA: $(JAR) $(JAVAROOT): mkdir -p $(JAVAROOT) -$(JAR): classaltosuilib.stamp - jar cf $@ -C $(JAVAROOT) . +$(JAR): classaltosuilib.stamp $(ICONS) + jar cf $@ $(ICONJAR) -C $(JAVAROOT) . diff --git a/icon/telegps-128.png b/icon/telegps-128.png new file mode 100644 index 00000000..f1343d9e Binary files /dev/null and b/icon/telegps-128.png differ diff --git a/icon/telegps-16.png b/icon/telegps-16.png new file mode 100644 index 00000000..5bd45999 Binary files /dev/null and b/icon/telegps-16.png differ diff --git a/icon/telegps-256.png b/icon/telegps-256.png new file mode 100644 index 00000000..46e1670a Binary files /dev/null and b/icon/telegps-256.png differ diff --git a/icon/telegps-32.png b/icon/telegps-32.png new file mode 100644 index 00000000..c8588899 Binary files /dev/null and b/icon/telegps-32.png differ diff --git a/icon/telegps-48.png b/icon/telegps-48.png new file mode 100644 index 00000000..3bee98e6 Binary files /dev/null and b/icon/telegps-48.png differ diff --git a/icon/telegps-512.png b/icon/telegps-512.png new file mode 100644 index 00000000..47c47003 Binary files /dev/null and b/icon/telegps-512.png differ diff --git a/icon/telegps-64.png b/icon/telegps-64.png new file mode 100644 index 00000000..0ee086a6 Binary files /dev/null and b/icon/telegps-64.png differ diff --git a/icon/telegps.ico b/icon/telegps.ico new file mode 100644 index 00000000..bedf04ef Binary files /dev/null and b/icon/telegps.ico differ diff --git a/icon/telegps.svg b/icon/telegps.svg new file mode 100644 index 00000000..256b8c5a --- /dev/null +++ b/icon/telegps.svg @@ -0,0 +1,215 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/telegps/Makefile.am b/telegps/Makefile.am index 280b1e40..f8e2e63c 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -15,6 +15,7 @@ telegps_JAVA= \ TeleGPS.java \ TeleGPSStatus.java \ TeleGPSStatusUpdate.java \ + TeleGPSInfo.java \ TeleGPSConfig.java \ TeleGPSConfigUI.java \ TeleGPSPreferences.java diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index ad46fbdd..1bb505e0 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -53,6 +53,7 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo JTabbedPane pane; AltosSiteMap sitemap; + TeleGPSInfo gps_info; boolean has_map; JMenuBar menu_bar; @@ -115,10 +116,12 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo public void reset() { sitemap.reset(); + gps_info.reset(); } public void set_font() { sitemap.set_font(); + gps_info.set_font(); } public void font_size_changed(int font_size) { @@ -135,6 +138,7 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo state = new AltosState(); sitemap.show(state, listener_state); + gps_info.show(state, listener_state); telegps_status.show(state, listener_state); } @@ -225,6 +229,12 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo } void export() { + AltosDataChooser chooser; + chooser = new AltosDataChooser(this); + AltosStateIterable states = chooser.runDialog(); + if (states == null) + return; + new AltosCSVUI(this, states, chooser.file()); } void graph() { @@ -394,6 +404,9 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo sitemap = new AltosSiteMap(); pane.add("Site Map", sitemap); + gps_info = new TeleGPSInfo(); + pane.add("Info", gps_info); + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); AltosUIPreferences.register_font_listener(this); diff --git a/telegps/TeleGPSInfo.java b/telegps/TeleGPSInfo.java new file mode 100644 index 00000000..0fba77d5 --- /dev/null +++ b/telegps/TeleGPSInfo.java @@ -0,0 +1,511 @@ +/* + * 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.telegps; + +import java.awt.*; +import javax.swing.*; +import org.altusmetrum.altoslib_4.*; +import org.altusmetrum.altosuilib_2.*; + +public class TeleGPSInfo extends JComponent implements AltosFlightDisplay { + GridBagLayout layout; + JLabel cur, max; + + public class Info { + JLabel label; + 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, AltosListenerState listener_state) {} + + void show(String s) { + show(); + value.setText(s); + } + + void show(AltosUnits units, double v) { + show(units.show(8, v)); + } + + void show(String format, double v) { + show(String.format(format, v)); + } + + void reset() { + lights.set(false); + value.setText(""); + } + + void set_font() { + label.setFont(AltosUILib.label_font); + value.setFont(AltosUILib.value_font); + } + + public Info (GridBagLayout layout, int y, String text) { + GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; + + lights = new AltosLights(); + c.gridx = 0; c.gridy = y; + c.anchor = GridBagConstraints.CENTER; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; + layout.setConstraints(lights, c); + add(lights); + + label = new JLabel(text); + label.setFont(AltosUILib.label_font); + label.setHorizontalAlignment(SwingConstants.LEFT); + c.gridx = 1; c.gridy = y; + c.insets = new Insets(AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad); + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; + layout.setConstraints(label, c); + add(label); + + value = new JTextField(AltosUILib.text_width); + value.setFont(AltosUILib.value_font); + value.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = 2; c.gridy = y; + c.gridwidth = 2; + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; + layout.setConstraints(value, c); + add(value); + } + } + + public class Value { + JLabel label; + JTextField value; + void show(AltosState state, AltosListenerState listener_state) {} + + void reset() { + value.setText(""); + } + + void show() { + label.setVisible(true); + value.setVisible(true); + } + + void show(String s) { + show(); + value.setText(s); + } + + void show(AltosUnits units, double v) { + show(units.show(8, v)); + } + + void show(String format, double v) { + show(String.format(format, v)); + } + + void hide() { + label.setVisible(false); + value.setVisible(false); + } + void set_font() { + label.setFont(AltosUILib.label_font); + value.setFont(AltosUILib.value_font); + } + + public Value (GridBagLayout layout, int y, String text) { + GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; + + label = new JLabel(text); + label.setFont(AltosUILib.label_font); + label.setHorizontalAlignment(SwingConstants.LEFT); + c.gridx = 1; c.gridy = y; + c.insets = new Insets(AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad); + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; + layout.setConstraints(label, c); + add(label); + + value = new JTextField(AltosUILib.text_width); + value.setFont(AltosUILib.value_font); + value.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = 2; c.gridy = y; + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.BOTH; + c.gridwidth = 2; + c.weightx = 1; + layout.setConstraints(value, c); + add(value); + } + } + + public abstract class DualValue { + JLabel label; + JTextField value1; + JTextField value2; + + void reset() { + value1.setText(""); + value2.setText(""); + } + + void show() { + label.setVisible(true); + value1.setVisible(true); + value2.setVisible(true); + } + + void hide() { + label.setVisible(false); + value1.setVisible(false); + value2.setVisible(false); + } + + void set_font() { + label.setFont(AltosUILib.label_font); + value1.setFont(AltosUILib.value_font); + value2.setFont(AltosUILib.value_font); + } + + abstract void show(AltosState state, AltosListenerState listener_state); + + 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)); + } + + public DualValue (GridBagLayout layout, int x, int y, String text) { + GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; + + label = new JLabel(text); + label.setFont(AltosUILib.label_font); + label.setHorizontalAlignment(SwingConstants.LEFT); + c.gridx = x + 1; c.gridy = y; + c.insets = new Insets(AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad); + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; + layout.setConstraints(label, c); + add(label); + + value1 = new JTextField(AltosUILib.text_width); + value1.setFont(AltosUILib.value_font); + value1.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = x + 2; c.gridy = y; + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; + layout.setConstraints(value1, c); + add(value1); + + value2 = new JTextField(AltosUILib.text_width); + value2.setFont(AltosUILib.value_font); + value2.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = x + 3; c.gridy = y; + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; + c.gridwidth = 1; + layout.setConstraints(value2, c); + add(value2); + } + } + + public class ValueHold { + JLabel label; + JTextField value; + JTextField max_value; + double max; + + void show(AltosState state, AltosListenerState listener_state) {} + + void reset() { + value.setText(""); + max_value.setText(""); + max = AltosLib.MISSING; + } + + void set_font() { + label.setFont(AltosUILib.label_font); + value.setFont(AltosUILib.value_font); + max_value.setFont(AltosUILib.value_font); + } + + void show(AltosUnits units, double v) { + if (v == AltosLib.MISSING) { + value.setText("Missing"); + max_value.setText("Missing"); + } else { + value.setText(units.show(8, v)); + if (v > max || max == AltosLib.MISSING) { + max_value.setText(units.show(8, v)); + max = v; + } + } + } + + void hide() { + label.setVisible(false); + value.setVisible(false); + max_value.setVisible(false); + } + + public ValueHold (GridBagLayout layout, int y, String text) { + GridBagConstraints c = new GridBagConstraints(); + c.weighty = 1; + + label = new JLabel(text); + label.setFont(AltosUILib.label_font); + label.setHorizontalAlignment(SwingConstants.LEFT); + c.gridx = 1; c.gridy = y; + c.insets = new Insets(AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad); + c.anchor = GridBagConstraints.WEST; + c.fill = GridBagConstraints.VERTICAL; + c.weightx = 0; + layout.setConstraints(label, c); + add(label); + + value = new JTextField(AltosUILib.text_width); + value.setFont(AltosUILib.value_font); + value.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = 2; c.gridy = y; + c.anchor = GridBagConstraints.EAST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; + layout.setConstraints(value, c); + add(value); + + max_value = new JTextField(AltosUILib.text_width); + max_value.setFont(AltosUILib.value_font); + max_value.setHorizontalAlignment(SwingConstants.RIGHT); + c.gridx = 3; c.gridy = y; + c.anchor = GridBagConstraints.EAST; + c.fill = GridBagConstraints.BOTH; + c.weightx = 1; + layout.setConstraints(max_value, c); + add(max_value); + } + } + + + class Altitude extends ValueHold { + void show (AltosState state, AltosListenerState listener_state) { + show(AltosConvert.height, state.altitude()); + } + public Altitude (GridBagLayout layout, int y) { + super (layout, y, "Altitude"); + } + } + + Altitude altitude; + + class AscentRate extends ValueHold { + void show (AltosState state, AltosListenerState listener_state) { + show(AltosConvert.speed, state.gps_ascent_rate()); + } + public AscentRate (GridBagLayout layout, int y) { + super (layout, y, "Ascent Rate"); + } + } + + AscentRate ascent_rate; + + class GroundSpeed extends ValueHold { + void show (AltosState state, AltosListenerState listener_state) { + show(AltosConvert.speed, state.gps_ground_speed()); + } + public GroundSpeed (GridBagLayout layout, int y) { + super (layout, y, "Ground Speed"); + } + } + + GroundSpeed ground_speed; + + 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 Course extends DualValue { + void show (AltosState state, AltosListenerState listener_state) { + double course = state.gps_course(); + if (course != AltosLib.MISSING) + show( String.format("%3.0f°", course), + AltosConvert.bearing_to_words( + AltosConvert.BEARING_LONG, + course)); + } + public Course (GridBagLayout layout, int y) { + super (layout, 0, y, "Course"); + } + } + + Course course; + + class Lat extends Value { + void show (AltosState state, AltosListenerState listener_state) { + if (state.gps != null && state.gps.connected && state.gps.lat != AltosLib.MISSING) + show(pos(state.gps.lat,"N", "S")); + else + show("???"); + } + public Lat (GridBagLayout layout, int y) { + super (layout, y, "Latitude"); + } + } + + Lat lat; + + class Lon extends Value { + void show (AltosState state, AltosListenerState listener_state) { + if (state.gps != null && state.gps.connected && state.gps.lon != AltosLib.MISSING) + show(pos(state.gps.lon,"E", "W")); + else + show("???"); + } + public Lon (GridBagLayout layout, int y) { + super (layout, y, "Longitude"); + } + } + + Lon lon; + + class GPSLocked extends Info { + void show (AltosState state, AltosListenerState listener_state) { + if (state == null || state.gps == null) + hide(); + else { + show("%4d sats", state.gps.nsat); + lights.set(state.gps.locked && state.gps.nsat >= 4); + } + } + public GPSLocked (GridBagLayout layout, int y) { + super (layout, y, "GPS Locked"); + } + } + + GPSLocked gps_locked; + + public void reset() { + lat.reset(); + lon.reset(); + altitude.reset(); + ground_speed.reset(); + ascent_rate.reset(); + course.reset(); + gps_locked.reset(); + } + + public void set_font() { + cur.setFont(AltosUILib.label_font); + max.setFont(AltosUILib.label_font); + lat.set_font(); + lon.set_font(); + altitude.set_font(); + ground_speed.set_font(); + ascent_rate.set_font(); + course.set_font(); + gps_locked.set_font(); + } + + public void show(AltosState state, AltosListenerState listener_state) { + if (state.gps != null && state.gps.connected) { + lat.show(state, listener_state); + lon.show(state, listener_state); + } else { + lat.hide(); + lon.hide(); + } + altitude.show(state, listener_state); + ground_speed.show(state, listener_state); + ascent_rate.show(state, listener_state); + course.show(state, listener_state); + gps_locked.show(state, listener_state); + } + + public void labels(GridBagLayout layout, int y) { + GridBagConstraints c; + + cur = new JLabel("Current"); + cur.setFont(AltosUILib.label_font); + c = new GridBagConstraints(); + c.gridx = 2; c.gridy = y; + c.insets = new Insets(AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad, AltosUILib.tab_elt_pad); + layout.setConstraints(cur, c); + add(cur); + + max = new JLabel("Maximum"); + max.setFont(AltosUILib.label_font); + c.gridx = 3; c.gridy = y; + layout.setConstraints(max, c); + add(max); + } + + public String getName() { + return "Info"; + } + + public TeleGPSInfo() { + layout = new GridBagLayout(); + + setLayout(layout); + + /* Elements in ascent display: + * + * lat + * lon + * height + */ + int y = 0; + labels(layout, y++); + altitude = new Altitude(layout, y++); + ground_speed = new GroundSpeed(layout, y++); + ascent_rate = new AscentRate(layout, y++); + course = new Course(layout, y++); + lat = new Lat(layout, y++); + lon = new Lon(layout, y++); + gps_locked = new GPSLocked(layout, y++); + } +} -- cgit v1.2.3 From 8e7b8b0533e03e89425296d464b7a1a26fb63686 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 5 Jun 2014 16:52:36 -0700 Subject: telegps: Update icon and icon building Switch to satellite icon, build the osx and windows icons. Signed-off-by: Keith Packard --- debian/control | 2 +- icon/Makefile.am | 18 ++- icon/telegps-128.png | Bin 8736 -> 10163 bytes icon/telegps-16.png | Bin 507 -> 693 bytes icon/telegps-256.png | Bin 21589 -> 23474 bytes icon/telegps-32.png | Bin 1475 -> 1751 bytes icon/telegps-48.png | Bin 2507 -> 2962 bytes icon/telegps-512.png | Bin 56581 -> 0 bytes icon/telegps-64.png | Bin 3678 -> 4364 bytes icon/telegps.ico | Bin 285478 -> 354422 bytes icon/telegps.svg | 292 ++++++++++++++++++++++++++++----------------- telegps/telegps.desktop.in | 10 +- 12 files changed, 204 insertions(+), 118 deletions(-) delete mode 100644 icon/telegps-512.png (limited to 'icon') diff --git a/debian/control b/debian/control index f23a841a..6c28ca71 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: electronics Priority: optional Maintainer: Bdale Garbee Uploaders: Keith Packard -Build-Depends: debhelper (>= 7), autoconf, automake, gawk, libreadline-dev, libusb-1.0-0-dev, nickle, cc1111, xsltproc, fop, xmlto, docbook-xml, docbook-xsl, swig, default-jdk, freetts, libtool, libjfreechart-java, libbluetooth-dev, pkg-config, libelf-dev, libbluetooth-dev, libssl-dev, gcc-arm-none-eabi +Build-Depends: debhelper (>= 7), autoconf, automake, gawk, libreadline-dev, libusb-1.0-0-dev, nickle, cc1111, xsltproc, fop, xmlto, docbook-xml, docbook-xsl, swig, default-jdk, freetts, libtool, libjfreechart-java, libbluetooth-dev, pkg-config, libelf-dev, libbluetooth-dev, libssl-dev, gcc-arm-none-eabi, icotool, librsvg2-bin Standards-Version: 3.9.5 Homepage: http://altusmetrum.org/AltOS Vcs-Git: git://git.gag.com/fw/altos diff --git a/icon/Makefile.am b/icon/Makefile.am index eedb7760..60afdb1c 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -1,21 +1,26 @@ -RES=16 32 48 256 +RES=16 32 48 64 128 256 AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done) MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done) +TG_FILES=$(shell for i in $(RES); do echo telegps-$$i.png; done) -ICO_FILES=altus-metrum.ico micro-peak.ico +ICO_FILES=altus-metrum.ico micro-peak.ico telegps.ico icondir = $(datadir)/icons/hicolor/scalable/apps AM_ICON = altusmetrum.svg MP_ICON = micropeak.svg +TG_ICON = telegps.svg -icon_DATA = $(AM_ICON) $(MP_ICON) +icon_DATA = $(AM_ICON) $(MP_ICON) $(TG_ICON) -EXTRA_DIST = $(icon_DATA) $(AM_FILES) $(MP_FILES) +EXTRA_DIST = $(icon_DATA) $(AM_FILES) $(MP_FILES) $(TG_FILES) all-local: $(ICO_FILES) +$(TG_FILES): telegps.svg + for i in $(RES); do rsvg-convert -w $$i -o telegps-$$i.png telegps.svg; done + #clean-local: # $(RM) -f $(ICO_FILES) @@ -23,4 +28,7 @@ altus-metrum.ico: $(AM_FILES) icotool -c -o $@ $(AM_FILES) micro-peak.ico: $(MP_FILES) - icotool -c -o $@ $(MP_FILES) \ No newline at end of file + icotool -c -o $@ $(MP_FILES) + +telegps.ico: $(TG_FILES) + icotool -c -o $@ $(TG_FILES) diff --git a/icon/telegps-128.png b/icon/telegps-128.png index f1343d9e..6b72cc46 100644 Binary files a/icon/telegps-128.png and b/icon/telegps-128.png differ diff --git a/icon/telegps-16.png b/icon/telegps-16.png index 5bd45999..3010a4e1 100644 Binary files a/icon/telegps-16.png and b/icon/telegps-16.png differ diff --git a/icon/telegps-256.png b/icon/telegps-256.png index 46e1670a..7565b525 100644 Binary files a/icon/telegps-256.png and b/icon/telegps-256.png differ diff --git a/icon/telegps-32.png b/icon/telegps-32.png index c8588899..a01d41d1 100644 Binary files a/icon/telegps-32.png and b/icon/telegps-32.png differ diff --git a/icon/telegps-48.png b/icon/telegps-48.png index 3bee98e6..e9bbda08 100644 Binary files a/icon/telegps-48.png and b/icon/telegps-48.png differ diff --git a/icon/telegps-512.png b/icon/telegps-512.png deleted file mode 100644 index 47c47003..00000000 Binary files a/icon/telegps-512.png and /dev/null differ diff --git a/icon/telegps-64.png b/icon/telegps-64.png index 0ee086a6..b39c8f65 100644 Binary files a/icon/telegps-64.png and b/icon/telegps-64.png differ diff --git a/icon/telegps.ico b/icon/telegps.ico index bedf04ef..bbe2283e 100644 Binary files a/icon/telegps.ico and b/icon/telegps.ico differ diff --git a/icon/telegps.svg b/icon/telegps.svg index 256b8c5a..a14267bc 100644 --- a/icon/telegps.svg +++ b/icon/telegps.svg @@ -10,57 +10,25 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="141.19534" + height="135.41844" id="svg2" - width="191.28" - height="245.28" - version="1.0" - sodipodi:version="0.32" + version="1.1" inkscape:version="0.48.4 r9939" - sodipodi:docname="altusmetrum-only.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="/home/keithp/src/cc1111/altus-logo/bottom.png" - inkscape:export-xdpi="119.89881" - inkscape:export-ydpi="119.89881"> - - - - image/svg+xml - - - - - + sodipodi:docname="telegps.svg"> - - - - - - - - - + id="defs4"> + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="2560" + inkscape:window-height="1582" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + + + + image/svg+xml + + + + + - - - - + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-261.09094,-353.45446)"> + diff --git a/telegps/telegps.desktop.in b/telegps/telegps.desktop.in index abdf286f..3d249d8a 100644 --- a/telegps/telegps.desktop.in +++ b/telegps/telegps.desktop.in @@ -1,10 +1,10 @@ [Desktop Entry] Type=Application -Name=MicroPeak -GenericName=MicroPeak download and analysis -Comment=View and log data from MicroPeak altimeters -Icon=%icondir%/micropeak.svg -Exec=%bindir%/micropeak %f +Name=TeleGPS +GenericName=TeleGPS monitor, download and analysis +Comment=View and log data from TeleGPS tracking devices +Icon=%icondir%/telegps.svg +Exec=%bindir%/telegps %f Terminal=false MimeType=text/plain; Categories=Education;Electronics;Science; -- cgit v1.2.3 From 4ec960b705b87b15d015abb2a9a3e23eee414f1d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 14 Jun 2014 17:51:46 -0700 Subject: icon: Create all icons from .svg files Remove images from repository, leaving only the svg files and build instructions Signed-off-by: Keith Packard --- debian/control | 2 +- icon/.gitignore | 6 ++++++ icon/Makefile.am | 42 ++++++++++++++++++++++++++++++++++++++---- icon/altus-metrum-128.png | Bin 8736 -> 0 bytes icon/altus-metrum-16.png | Bin 507 -> 0 bytes icon/altus-metrum-256.png | Bin 21589 -> 0 bytes icon/altus-metrum-32.png | Bin 1475 -> 0 bytes icon/altus-metrum-48.png | Bin 2507 -> 0 bytes icon/altus-metrum-512.png | Bin 56581 -> 0 bytes icon/altus-metrum-64.png | Bin 3678 -> 0 bytes icon/altus-metrum.ico | Bin 285478 -> 0 bytes icon/make-png | 34 ++++++++++++++++++++++++++++++++++ icon/micro-peak.ico | Bin 285478 -> 0 bytes icon/micropeak-128.png | Bin 4394 -> 0 bytes icon/micropeak-16.png | Bin 534 -> 0 bytes icon/micropeak-256.png | Bin 8055 -> 0 bytes icon/micropeak-32.png | Bin 1072 -> 0 bytes icon/micropeak-48.png | Bin 1662 -> 0 bytes icon/micropeak-64.png | Bin 2240 -> 0 bytes icon/telegps-128.png | Bin 10163 -> 0 bytes icon/telegps-16.png | Bin 693 -> 0 bytes icon/telegps-256.png | Bin 23474 -> 0 bytes icon/telegps-32.png | Bin 1751 -> 0 bytes icon/telegps-48.png | Bin 2962 -> 0 bytes icon/telegps-64.png | Bin 4364 -> 0 bytes icon/telegps.ico | Bin 354422 -> 0 bytes 26 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 icon/.gitignore delete mode 100644 icon/altus-metrum-128.png delete mode 100644 icon/altus-metrum-16.png delete mode 100644 icon/altus-metrum-256.png delete mode 100644 icon/altus-metrum-32.png delete mode 100644 icon/altus-metrum-48.png delete mode 100644 icon/altus-metrum-512.png delete mode 100644 icon/altus-metrum-64.png delete mode 100644 icon/altus-metrum.ico create mode 100755 icon/make-png delete mode 100644 icon/micro-peak.ico delete mode 100644 icon/micropeak-128.png delete mode 100644 icon/micropeak-16.png delete mode 100644 icon/micropeak-256.png delete mode 100644 icon/micropeak-32.png delete mode 100644 icon/micropeak-48.png delete mode 100644 icon/micropeak-64.png delete mode 100644 icon/telegps-128.png delete mode 100644 icon/telegps-16.png delete mode 100644 icon/telegps-256.png delete mode 100644 icon/telegps-32.png delete mode 100644 icon/telegps-48.png delete mode 100644 icon/telegps-64.png delete mode 100644 icon/telegps.ico (limited to 'icon') diff --git a/debian/control b/debian/control index 13f8e1a3..1d4ee52f 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: electronics Priority: optional Maintainer: Bdale Garbee Uploaders: Keith Packard -Build-Depends: debhelper (>= 7), autoconf, automake, gawk, libreadline-dev, libusb-1.0-0-dev, nickle, cc1111, xsltproc, fop, xmlto, docbook-xml, docbook-xsl, swig, default-jdk, freetts, libtool, libjfreechart-java, libbluetooth-dev, pkg-config, libelf-dev, libbluetooth-dev, libssl-dev, gcc-arm-none-eabi, icoutils, librsvg2-bin +Build-Depends: debhelper (>= 7), autoconf, automake, gawk, libreadline-dev, libusb-1.0-0-dev, nickle, cc1111, xsltproc, fop, xmlto, docbook-xml, docbook-xsl, swig, default-jdk, freetts, libtool, libjfreechart-java, libbluetooth-dev, pkg-config, libelf-dev, libbluetooth-dev, libssl-dev, gcc-arm-none-eabi, icoutils, librsvg2-bin, icnsutils Standards-Version: 3.9.5 Homepage: http://altusmetrum.org/AltOS Vcs-Git: git://git.gag.com/fw/altos diff --git a/icon/.gitignore b/icon/.gitignore new file mode 100644 index 00000000..e89555de --- /dev/null +++ b/icon/.gitignore @@ -0,0 +1,6 @@ +altus-metrum-*.png +micropeak-*.png +telegps-*.png +*.ico +*.icns +*.build diff --git a/icon/Makefile.am b/icon/Makefile.am index 60afdb1c..db5577d6 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -1,10 +1,17 @@ -RES=16 32 48 64 128 256 +LINUX_RES=16 32 48 64 128 256 512 +MAC_RES=16 32 128 256 512 +WIN_RES=16 24 32 48 64 72 96 128 180 256 +RES=$(shell echo $(LINUX_RES) $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u) AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done) MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done) TG_FILES=$(shell for i in $(RES); do echo telegps-$$i.png; done) +MAC_TG_FILES=$(shell for i in $(MAC_RES); do echo telegps-$$i.png; done) +MAC_MP_FILES=$(shell for i in $(MAC_RES); do echo micropeak-$$i.png; done) +MAC_AM_FILES=$(shell for i in $(MAC_RES); do echo altus-metrum-$$i.png; done) ICO_FILES=altus-metrum.ico micro-peak.ico telegps.ico +ICNS_FILES=AltosUIIcon.icns TeleGPS.icns MicroPeak.icns icondir = $(datadir)/icons/hicolor/scalable/apps @@ -16,10 +23,28 @@ icon_DATA = $(AM_ICON) $(MP_ICON) $(TG_ICON) EXTRA_DIST = $(icon_DATA) $(AM_FILES) $(MP_FILES) $(TG_FILES) -all-local: $(ICO_FILES) +res: + echo $(RES) -$(TG_FILES): telegps.svg - for i in $(RES); do rsvg-convert -w $$i -o telegps-$$i.png telegps.svg; done +all-local: $(ICO_FILES) $(ICNS_FILES) + +clean-local: + $(RM) $(TG_FILES) $(MP_FILES) $(ICO_FILES) $(ICNS_FILES) *.build + +$(AM_FILES): altusmetrum.build + +altusmetrum.build: altusmetrum.svg + for i in $(RES); do ./make-png altusmetrum.svg $$i altus-metrum-$$i.png; done && touch $@ + +$(TG_FILES): telegps.build + +telegps.build: telegps.svg + for i in $(RES); do ./make-png telegps.svg $$i telegps-$$i.png; done && touch $@ + +$(MP_FILES): micropeak.build + +micropeak.build: micropeak.svg + for i in $(RES); do ./make-png micropeak.svg $$i micropeak-$$i.png; done && touch $@ #clean-local: # $(RM) -f $(ICO_FILES) @@ -32,3 +57,12 @@ micro-peak.ico: $(MP_FILES) telegps.ico: $(TG_FILES) icotool -c -o $@ $(TG_FILES) + +AltosUIIcon.icns: $(MAC_AM_FILES) + png2icns $@ $(MAC_AM_FILES) + +TeleGPS.icns: $(MAC_TG_FILES) + png2icns $@ $(MAC_TG_FILES) + +MicroPeak.icns: $(MAC_MP_FILES) + png2icns $@ $(MAC_MP_FILES) diff --git a/icon/altus-metrum-128.png b/icon/altus-metrum-128.png deleted file mode 100644 index f1343d9e..00000000 Binary files a/icon/altus-metrum-128.png and /dev/null differ diff --git a/icon/altus-metrum-16.png b/icon/altus-metrum-16.png deleted file mode 100644 index 5bd45999..00000000 Binary files a/icon/altus-metrum-16.png and /dev/null differ diff --git a/icon/altus-metrum-256.png b/icon/altus-metrum-256.png deleted file mode 100644 index 46e1670a..00000000 Binary files a/icon/altus-metrum-256.png and /dev/null differ diff --git a/icon/altus-metrum-32.png b/icon/altus-metrum-32.png deleted file mode 100644 index c8588899..00000000 Binary files a/icon/altus-metrum-32.png and /dev/null differ diff --git a/icon/altus-metrum-48.png b/icon/altus-metrum-48.png deleted file mode 100644 index 3bee98e6..00000000 Binary files a/icon/altus-metrum-48.png and /dev/null differ diff --git a/icon/altus-metrum-512.png b/icon/altus-metrum-512.png deleted file mode 100644 index 47c47003..00000000 Binary files a/icon/altus-metrum-512.png and /dev/null differ diff --git a/icon/altus-metrum-64.png b/icon/altus-metrum-64.png deleted file mode 100644 index 0ee086a6..00000000 Binary files a/icon/altus-metrum-64.png and /dev/null differ diff --git a/icon/altus-metrum.ico b/icon/altus-metrum.ico deleted file mode 100644 index bedf04ef..00000000 Binary files a/icon/altus-metrum.ico and /dev/null differ diff --git a/icon/make-png b/icon/make-png new file mode 100755 index 00000000..748cf32e --- /dev/null +++ b/icon/make-png @@ -0,0 +1,34 @@ +#!/bin/sh + +case $# in +3) + ;; +*) + echo "Usage: $0 " 1>&2 + exit 1 + ;; +esac + +SVG=$1 +SIZE=$2 +PNG=$3 + +SHADOW=$(($SIZE / 16)) +IMAGE=$(($SIZE - $SHADOW)) + +OPACITY=80 +BLUR=$(($SHADOW / 4)) +SHIFT=$(($SHADOW - $BLUR)) + +echo SHADOW $SHADOW IMAGE $IMAGE OPACITY $OPACITY SHIFT $SHIFT BLUR $BLUR + +TMP=image-$$.png + +trap "rm $TMP" 0 1 15 + +rsvg-convert -w $IMAGE -h $IMAGE -o $TMP $SVG + +convert $TMP \ + \( +clone -background black -shadow ${OPACITY}x${BLUR}+${SHIFT}+${SHIFT} \) \ + +swap -background none -layers merge -crop ${SIZE}x${SIZE}+0+0 +repage $PNG + diff --git a/icon/micro-peak.ico b/icon/micro-peak.ico deleted file mode 100644 index b672aa04..00000000 Binary files a/icon/micro-peak.ico and /dev/null differ diff --git a/icon/micropeak-128.png b/icon/micropeak-128.png deleted file mode 100644 index f045dc6a..00000000 Binary files a/icon/micropeak-128.png and /dev/null differ diff --git a/icon/micropeak-16.png b/icon/micropeak-16.png deleted file mode 100644 index d8140802..00000000 Binary files a/icon/micropeak-16.png and /dev/null differ diff --git a/icon/micropeak-256.png b/icon/micropeak-256.png deleted file mode 100644 index b96d4706..00000000 Binary files a/icon/micropeak-256.png and /dev/null differ diff --git a/icon/micropeak-32.png b/icon/micropeak-32.png deleted file mode 100644 index d34c5c12..00000000 Binary files a/icon/micropeak-32.png and /dev/null differ diff --git a/icon/micropeak-48.png b/icon/micropeak-48.png deleted file mode 100644 index 86dc4f7f..00000000 Binary files a/icon/micropeak-48.png and /dev/null differ diff --git a/icon/micropeak-64.png b/icon/micropeak-64.png deleted file mode 100644 index 6ca7c2eb..00000000 Binary files a/icon/micropeak-64.png and /dev/null differ diff --git a/icon/telegps-128.png b/icon/telegps-128.png deleted file mode 100644 index 6b72cc46..00000000 Binary files a/icon/telegps-128.png and /dev/null differ diff --git a/icon/telegps-16.png b/icon/telegps-16.png deleted file mode 100644 index 3010a4e1..00000000 Binary files a/icon/telegps-16.png and /dev/null differ diff --git a/icon/telegps-256.png b/icon/telegps-256.png deleted file mode 100644 index 7565b525..00000000 Binary files a/icon/telegps-256.png and /dev/null differ diff --git a/icon/telegps-32.png b/icon/telegps-32.png deleted file mode 100644 index a01d41d1..00000000 Binary files a/icon/telegps-32.png and /dev/null differ diff --git a/icon/telegps-48.png b/icon/telegps-48.png deleted file mode 100644 index e9bbda08..00000000 Binary files a/icon/telegps-48.png and /dev/null differ diff --git a/icon/telegps-64.png b/icon/telegps-64.png deleted file mode 100644 index b39c8f65..00000000 Binary files a/icon/telegps-64.png and /dev/null differ diff --git a/icon/telegps.ico b/icon/telegps.ico deleted file mode 100644 index bbe2283e..00000000 Binary files a/icon/telegps.ico and /dev/null differ -- cgit v1.2.3 From b825ea71ebcc4a8da3e339ab3e21b0ad47f2e48f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 14 Jun 2014 18:02:51 -0700 Subject: icon: Build windows ico files, clean built files Signed-off-by: Keith Packard --- icon/Makefile.am | 22 +++++++++++++--------- icon/make-png | 2 -- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'icon') diff --git a/icon/Makefile.am b/icon/Makefile.am index db5577d6..b36f6f7b 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -1,15 +1,19 @@ -LINUX_RES=16 32 48 64 128 256 512 MAC_RES=16 32 128 256 512 WIN_RES=16 24 32 48 64 72 96 128 180 256 -RES=$(shell echo $(LINUX_RES) $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u) +RES=$(shell echo $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u) AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done) MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done) TG_FILES=$(shell for i in $(RES); do echo telegps-$$i.png; done) + MAC_TG_FILES=$(shell for i in $(MAC_RES); do echo telegps-$$i.png; done) MAC_MP_FILES=$(shell for i in $(MAC_RES); do echo micropeak-$$i.png; done) MAC_AM_FILES=$(shell for i in $(MAC_RES); do echo altus-metrum-$$i.png; done) +WIN_TG_FILES=$(shell for i in $(WIN_RES); do echo telegps-$$i.png; done) +WIN_MP_FILES=$(shell for i in $(WIN_RES); do echo micropeak-$$i.png; done) +WIN_AM_FILES=$(shell for i in $(WIN_RES); do echo altus-metrum-$$i.png; done) + ICO_FILES=altus-metrum.ico micro-peak.ico telegps.ico ICNS_FILES=AltosUIIcon.icns TeleGPS.icns MicroPeak.icns @@ -29,7 +33,7 @@ res: all-local: $(ICO_FILES) $(ICNS_FILES) clean-local: - $(RM) $(TG_FILES) $(MP_FILES) $(ICO_FILES) $(ICNS_FILES) *.build + $(RM) altus-metrum-*.png telegps-*.png micropeak-*.png *.build *.ico *.icns $(AM_FILES): altusmetrum.build @@ -49,14 +53,14 @@ micropeak.build: micropeak.svg #clean-local: # $(RM) -f $(ICO_FILES) -altus-metrum.ico: $(AM_FILES) - icotool -c -o $@ $(AM_FILES) +altus-metrum.ico: $(WIN_AM_FILES) + icotool -c -o $@ $(WIN_AM_FILES) -micro-peak.ico: $(MP_FILES) - icotool -c -o $@ $(MP_FILES) +micro-peak.ico: $(WIN_MP_FILES) + icotool -c -o $@ $(WIN_MP_FILES) -telegps.ico: $(TG_FILES) - icotool -c -o $@ $(TG_FILES) +telegps.ico: $(WIN_TG_FILES) + icotool -c -o $@ $(WIN_TG_FILES) AltosUIIcon.icns: $(MAC_AM_FILES) png2icns $@ $(MAC_AM_FILES) diff --git a/icon/make-png b/icon/make-png index 748cf32e..bc865d9f 100755 --- a/icon/make-png +++ b/icon/make-png @@ -20,8 +20,6 @@ OPACITY=80 BLUR=$(($SHADOW / 4)) SHIFT=$(($SHADOW - $BLUR)) -echo SHADOW $SHADOW IMAGE $IMAGE OPACITY $OPACITY SHIFT $SHIFT BLUR $BLUR - TMP=image-$$.png trap "rm $TMP" 0 1 15 -- cgit v1.2.3 From 33da986161c38936cff82fe43046f0bcd5e24d8e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 14 Jun 2014 18:07:39 -0700 Subject: icon: Build resolutions needed for Java bits too Signed-off-by: Keith Packard --- icon/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'icon') diff --git a/icon/Makefile.am b/icon/Makefile.am index b36f6f7b..05a4956a 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -1,6 +1,7 @@ +JAVA_RES=16 32 48 64 128 256 MAC_RES=16 32 128 256 512 WIN_RES=16 24 32 48 64 72 96 128 180 256 -RES=$(shell echo $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u) +RES=$(shell echo $(JAVA_RES) $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u) AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done) MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done) -- cgit v1.2.3 From 23708b4760250f55e8e3b1a0141df9a9ee17a936 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 14 Jun 2014 18:34:09 -0700 Subject: icon: Make the icon shadows a bit less harsh Signed-off-by: Keith Packard --- icon/Makefile.am | 6 +++--- icon/make-png | 15 ++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'icon') diff --git a/icon/Makefile.am b/icon/Makefile.am index 05a4956a..92b5a6e8 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -38,17 +38,17 @@ clean-local: $(AM_FILES): altusmetrum.build -altusmetrum.build: altusmetrum.svg +altusmetrum.build: altusmetrum.svg make-png for i in $(RES); do ./make-png altusmetrum.svg $$i altus-metrum-$$i.png; done && touch $@ $(TG_FILES): telegps.build -telegps.build: telegps.svg +telegps.build: telegps.svg make-png for i in $(RES); do ./make-png telegps.svg $$i telegps-$$i.png; done && touch $@ $(MP_FILES): micropeak.build -micropeak.build: micropeak.svg +micropeak.build: micropeak.svg make-png for i in $(RES); do ./make-png micropeak.svg $$i micropeak-$$i.png; done && touch $@ #clean-local: diff --git a/icon/make-png b/icon/make-png index bc865d9f..d9dde54e 100755 --- a/icon/make-png +++ b/icon/make-png @@ -14,11 +14,17 @@ SIZE=$2 PNG=$3 SHADOW=$(($SIZE / 16)) -IMAGE=$(($SIZE - $SHADOW)) -OPACITY=80 -BLUR=$(($SHADOW / 4)) -SHIFT=$(($SHADOW - $BLUR)) +OPACITY=60 +BLUR=$(($SHADOW / 2)) + +if [ $BLUR = 0 ]; then + BLUR=1 +fi + +SHIFT=$(($SHADOW * 3 / 4)) + +IMAGE=$(($SIZE - $SHIFT - $BLUR)) TMP=image-$$.png @@ -29,4 +35,3 @@ rsvg-convert -w $IMAGE -h $IMAGE -o $TMP $SVG convert $TMP \ \( +clone -background black -shadow ${OPACITY}x${BLUR}+${SHIFT}+${SHIFT} \) \ +swap -background none -layers merge -crop ${SIZE}x${SIZE}+0+0 +repage $PNG - -- cgit v1.2.3 From ef6998c2d052bf639f257b71baefacf3a652506f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 15 Jun 2014 16:06:42 -0700 Subject: icon: Add drop-shadows to the SVG files; stop generating in the png versions Now everyone gets drop shadows. Signed-off-by: Keith Packard --- icon/Makefile.am | 12 ++--- icon/altusmetrum.svg | 59 +++++++++++++++++++----- icon/make-png | 37 ---------------- icon/micropeak.svg | 123 +++++++++++++++++++++++++++++++++------------------ icon/telegps.svg | 61 ++++++++++++++++++------- 5 files changed, 178 insertions(+), 114 deletions(-) delete mode 100755 icon/make-png (limited to 'icon') diff --git a/icon/Makefile.am b/icon/Makefile.am index 92b5a6e8..b1c00f4b 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -38,18 +38,18 @@ clean-local: $(AM_FILES): altusmetrum.build -altusmetrum.build: altusmetrum.svg make-png - for i in $(RES); do ./make-png altusmetrum.svg $$i altus-metrum-$$i.png; done && touch $@ +altusmetrum.build: altusmetrum.svg + for i in $(RES); do rsvg-convert -w $$i -h $$i -o altus-metrum-$$i.png altusmetrum.svg; done && touch $@ $(TG_FILES): telegps.build -telegps.build: telegps.svg make-png - for i in $(RES); do ./make-png telegps.svg $$i telegps-$$i.png; done && touch $@ +telegps.build: telegps.svg + for i in $(RES); do rsvg-convert -w $$i -h $$i -o telegps-$$i.png telegps.svg; done && touch $@ $(MP_FILES): micropeak.build -micropeak.build: micropeak.svg make-png - for i in $(RES); do ./make-png micropeak.svg $$i micropeak-$$i.png; done && touch $@ +micropeak.build: micropeak.svg + for i in $(RES); do rsvg-convert -w $$i -h $$i -o micropeak-$$i.png micropeak.svg; done && touch $@ #clean-local: # $(RM) -f $(ICO_FILES) diff --git a/icon/altusmetrum.svg b/icon/altusmetrum.svg index 256b8c5a..e8935a65 100644 --- a/icon/altusmetrum.svg +++ b/icon/altusmetrum.svg @@ -11,12 +11,12 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" id="svg2" - width="191.28" - height="245.28" + width="214.27165" + height="266.00192" version="1.0" sodipodi:version="0.32" inkscape:version="0.48.4 r9939" - sodipodi:docname="altusmetrum-only.svg" + sodipodi:docname="altusmetrum.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" inkscape:export-filename="/home/keithp/src/cc1111/altus-logo/bottom.png" inkscape:export-xdpi="119.89881" @@ -29,7 +29,7 @@ image/svg+xml - + @@ -171,13 +171,44 @@ fx="951.68713" fy="1205.2668" r="951.68701" /> + + + + + + + + inkscape:window-maximized="0" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="20" + fit-margin-bottom="20" /> + style="fill:url(#radialGradient3175);fill-opacity:1;stroke:url(#radialGradient3171);stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;filter:url(#filter3005)"> " 1>&2 - exit 1 - ;; -esac - -SVG=$1 -SIZE=$2 -PNG=$3 - -SHADOW=$(($SIZE / 16)) - -OPACITY=60 -BLUR=$(($SHADOW / 2)) - -if [ $BLUR = 0 ]; then - BLUR=1 -fi - -SHIFT=$(($SHADOW * 3 / 4)) - -IMAGE=$(($SIZE - $SHIFT - $BLUR)) - -TMP=image-$$.png - -trap "rm $TMP" 0 1 15 - -rsvg-convert -w $IMAGE -h $IMAGE -o $TMP $SVG - -convert $TMP \ - \( +clone -background black -shadow ${OPACITY}x${BLUR}+${SHIFT}+${SHIFT} \) \ - +swap -background none -layers merge -crop ${SIZE}x${SIZE}+0+0 +repage $PNG diff --git a/icon/micropeak.svg b/icon/micropeak.svg index e6fbe120..d37130f5 100644 --- a/icon/micropeak.svg +++ b/icon/micropeak.svg @@ -10,12 +10,12 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="45.831875" - height="39.638676" + width="49.03825" + height="43.606411" id="svg2" version="1.1" - inkscape:version="0.48.3.1 r9886" - sodipodi:docname="micropeak-logoonly.svg"> + inkscape:version="0.48.4 r9939" + sodipodi:docname="micropeak.svg"> + + + + + + + @@ -147,38 +178,42 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(-241.93841,-252.5146)"> + transform="translate(-241.43522,-252.43073)"> + id="g3000" + style="filter:url(#filter3027)"> + + + + sodipodi:nodetypes="cssc" + inkscape:connector-curvature="0" + id="path2991" + d="m 256.93561,290.70327 c 3.04022,-0.24413 4.30317,-2.66932 5.38268,-5.56604 1.68059,-4.50963 3.67214,-15.86904 8.62227,-20.55527 4.0668,-3.85 8.22354,-3.46656 8.22354,-3.46656" + style="fill:none;stroke:url(#linearGradient5349);stroke-width:2.9000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:none" /> + - - diff --git a/icon/telegps.svg b/icon/telegps.svg index a14267bc..1e390f3b 100644 --- a/icon/telegps.svg +++ b/icon/telegps.svg @@ -10,8 +10,8 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="141.19534" - height="135.41844" + width="151.43401" + height="144.50209" id="svg2" version="1.1" inkscape:version="0.48.4 r9939" @@ -243,6 +243,37 @@ r="70.597672" gradientTransform="matrix(1,0,0,0.95908583,137.14286,74.776711)" gradientUnits="userSpaceOnUse" /> + + + + + + + + fit-margin-top="-12" + fit-margin-left="-12" + fit-margin-right="-6" + fit-margin-bottom="-6" + inkscape:window-width="996" + inkscape:window-height="970" + inkscape:window-x="930" + inkscape:window-y="553" + inkscape:window-maximized="0" /> @@ -282,9 +313,9 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(-261.09094,-353.45446)"> + transform="translate(-258.97144,-351.91262)">