From 11fbcf5e30e0cd09f2d6b448911d2ef62b7f29c7 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Tue, 11 Sep 2012 22:48:04 -0500 Subject: Added the feature to AC to default --with-android to $ANDROID_SDK (if set) Fixed typos in altosui/Makefile.am (had removed JCOMMON, but it's from AC) Jenkins changes: - added android sdk - will now record artifacts: altoslib/AltosLib.jar,altosui/altosui.jar,**/*.apk --- altosui/Makefile.am | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 9f75d5e3..04820294 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -6,7 +6,7 @@ man_MANS=altosui.1 altoslibdir=$(libdir)/altos -CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:../altoslib/*:libaltos::$(JFREECHART)/jfreechart.jar:$(FREETTS)/freetts.jar" +CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:../altoslib/*:libaltos:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar:$(FREETTS)/freetts.jar" bin_SCRIPTS=altosui diff --git a/configure.ac b/configure.ac index 8ce94180..8b002662 100644 --- a/configure.ac +++ b/configure.ac @@ -72,7 +72,7 @@ AC_SUBST(JVM_INCLUDE) AC_ARG_WITH(android, AS_HELP_STRING([--with-android=PATH], [Set android SDK path (default searches in a variety of places)]), - [ANDROID_SDK=$withval], [ANDROID_SDK=auto]) + [ANDROID_SDK=$withval], [ANDROID_SDK=${ANDROID_SDK:-auto}]) echo ANDROID_SDK set to $ANDROID_SDK -- cgit v1.2.3 From 1a154ce0b9fc3ea360d6bc7e17d6debb2da94438 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2012 22:03:17 -0700 Subject: Include AltosLib.jar in windows install Otherwise, altosui doesn't do much. Signed-off-by: Keith Packard --- altosui/altos-windows.nsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/altosui/altos-windows.nsi b/altosui/altos-windows.nsi index 986919d4..20dd65f0 100644 --- a/altosui/altos-windows.nsi +++ b/altosui/altos-windows.nsi @@ -88,6 +88,7 @@ Section "AltosUI Application" SetOutPath $INSTDIR File "altosui-fat.jar" + File "AltosLib.jar" File "cmudict04.jar" File "cmulex.jar" File "cmu_time_awb.jar" @@ -157,6 +158,9 @@ Section "Uninstall" Delete "$INSTDIR\*.*" RMDir "$INSTDIR" + ; Remove .inf file + Delete "$WINDIR\Inf\telemetrum.inf" + ; Remove devices InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial InstDrv::DeleteOemInfFiles /NOUNLOAD @@ -165,4 +169,5 @@ Section "Uninstall" ; Remove shortcuts, if any Delete "$SMPROGRAMS\AltusMetrum.lnk" Delete "$DESKTOP\AltusMetrum.lnk" + SectionEnd -- cgit v1.2.3 From 3fa5fbdfd1ab257028f272fbc32759b39608ddaf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2012 23:04:19 -0700 Subject: Clean up Windows event handles on com port close This avoids having to wait for the receiver to timeout before we can open the same com port again. This patch also adds a bit more debugging -- it prints Windows error messages to stdout along with the file/line where the error was generated. Signed-off-by: Keith Packard --- altosui/libaltos/libaltos.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/altosui/libaltos/libaltos.c b/altosui/libaltos/libaltos.c index 515432f9..ab6ca878 100644 --- a/altosui/libaltos/libaltos.c +++ b/altosui/libaltos/libaltos.c @@ -941,7 +941,7 @@ struct altos_file { }; static void -altos_set_last_windows_error(void) +_altos_set_last_windows_error(char *file, int line) { DWORD error = GetLastError(); TCHAR message[1024]; @@ -952,9 +952,13 @@ altos_set_last_windows_error(void) message, sizeof (message) / sizeof (TCHAR), NULL); + if (error != ERROR_SUCCESS) + printf ("%s:%d %s\n", file, line, message); altos_set_last_error(error, message); } +#define altos_set_last_windows_error() _altos_set_last_windows_error(__FILE__, __LINE__) + PUBLIC struct altos_list * altos_list_start(void) { @@ -1161,6 +1165,7 @@ altos_flush(struct altos_file *file) if (!WriteFile(file->handle, data, used, &put, &file->ov_write)) { if (GetLastError() != ERROR_IO_PENDING) { altos_set_last_windows_error(); + printf ("\tflush write error\n"); return LIBALTOS_ERROR; } ret = WaitForSingleObject(file->ov_write.hEvent, INFINITE); @@ -1168,11 +1173,13 @@ altos_flush(struct altos_file *file) case WAIT_OBJECT_0: if (!GetOverlappedResult(file->handle, &file->ov_write, &put, FALSE)) { altos_set_last_windows_error(); + printf ("\tflush result error\n"); return LIBALTOS_ERROR; } break; default: altos_set_last_windows_error(); + printf ("\tflush wait error\n"); return LIBALTOS_ERROR; } } @@ -1188,7 +1195,6 @@ altos_open(struct altos_device *device) { struct altos_file *file = calloc (1, sizeof (struct altos_file)); char full_name[64]; - DCB dcbSerialParams = {0}; COMMTIMEOUTS timeouts; if (!file) @@ -1201,6 +1207,7 @@ altos_open(struct altos_device *device) FILE_FLAG_OVERLAPPED, NULL); if (file->handle == INVALID_HANDLE_VALUE) { altos_set_last_windows_error(); + printf ("cannot open %s\n", full_name); free(file); return NULL; } @@ -1214,24 +1221,6 @@ altos_open(struct altos_device *device) timeouts.WriteTotalTimeoutConstant = 0; SetCommTimeouts(file->handle, &timeouts); - dcbSerialParams.DCBlength = sizeof(dcbSerialParams); - if (!GetCommState(file->handle, &dcbSerialParams)) { - altos_set_last_windows_error(); - CloseHandle(file->handle); - free(file); - return NULL; - } - dcbSerialParams.BaudRate = CBR_9600; - dcbSerialParams.ByteSize = 8; - dcbSerialParams.StopBits = ONESTOPBIT; - dcbSerialParams.Parity = NOPARITY; - if (!SetCommState(file->handle, &dcbSerialParams)) { - altos_set_last_windows_error(); - CloseHandle(file->handle); - free(file); - return NULL; - } - return file; } @@ -1241,6 +1230,10 @@ altos_close(struct altos_file *file) if (file->handle != INVALID_HANDLE_VALUE) { CloseHandle(file->handle); file->handle = INVALID_HANDLE_VALUE; + SetEvent(file->ov_read.hEvent); + SetEvent(file->ov_write.hEvent); + CloseHandle(file->ov_read.hEvent); + CloseHandle(file->ov_write.hEvent); } } -- cgit v1.2.3 From 87f9a8923656f275f74cfb6c8c6a57bbe59e74f8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2012 23:36:26 -0700 Subject: altosui: Initialize imperial units checkbox with correct value Use imperial units preference instead of serial debug preference. Cut & paste programming failure... Signed-off-by: Keith Packard --- altosui/AltosConfigureUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java index da82e8e0..249fc35a 100644 --- a/altosui/AltosConfigureUI.java +++ b/altosui/AltosConfigureUI.java @@ -246,7 +246,7 @@ public class AltosConfigureUI c.anchor = GridBagConstraints.WEST; pane.add(new JLabel("Imperial Units"), c); - imperial_units = new JRadioButton("Enable", AltosUIPreferences.serial_debug()); + imperial_units = new JRadioButton("Enable", AltosUIPreferences.imperial_units()); imperial_units.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JRadioButton item = (JRadioButton) e.getSource(); -- cgit v1.2.3 From b3c3c6eabd6837f0e72acee3906c8f71c6f0030e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2012 23:37:20 -0700 Subject: altosui: Don't say a decimal point for distances in meters Useful for distances in miles, but not meters. Signed-off-by: Keith Packard --- altoslib/AltosDistance.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/altoslib/AltosDistance.java b/altoslib/AltosDistance.java index a5e7331c..a6026d4a 100644 --- a/altoslib/AltosDistance.java +++ b/altoslib/AltosDistance.java @@ -44,6 +44,8 @@ public class AltosDistance extends AltosUnits { } int say_fraction() { - return 1; + if (AltosConvert.imperial_units) + return 1; + return 0; } } \ No newline at end of file -- cgit v1.2.3 From 42bbe15512533f2d958b8219a02fbd256593092a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2012 02:26:32 -0700 Subject: altosui: Initialize flight velocity to zero when reading eeprom files Otherwise, the integration of velocity will start at MISSING and get stranger. Fortunately, we know the initial velocity of the rocket when sitting on the pad. Signed-off-by: Keith Packard --- altoslib/AltosEepromIterable.java | 1 + 1 file changed, 1 insertion(+) diff --git a/altoslib/AltosEepromIterable.java b/altoslib/AltosEepromIterable.java index 1aa816e1..2ac10e85 100644 --- a/altoslib/AltosEepromIterable.java +++ b/altoslib/AltosEepromIterable.java @@ -200,6 +200,7 @@ public class AltosEepromIterable extends AltosRecordIterable { state.state = AltosLib.ao_flight_pad; state.accel_plus_g = 15758; state.accel_minus_g = 16294; + state.flight_vel = 0; /* Pull in static data from the flight and gps_date records */ if (flight_record != null) -- cgit v1.2.3 From f0f4f907042e12815284abe1b63ae2d4a5a2d598 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2012 02:30:59 -0700 Subject: doc: Mention changes to flight data download UI Signed-off-by: Keith Packard --- doc/release-notes-1.1.xsl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/release-notes-1.1.xsl b/doc/release-notes-1.1.xsl index 79ea39ee..519cd40c 100644 --- a/doc/release-notes-1.1.xsl +++ b/doc/release-notes-1.1.xsl @@ -66,6 +66,11 @@ Add configuration for the new apogee-lockout value. A menu provides a list of reasonable values, or the value can be set by hand. + + Changed how flight data are downloaded. Now there's an initial + dialog asking which flights to download, and after that + finishes, a second dialog comes up asking which flights to delete. + Re-compute time spent in each state for the flight graph; this figures out the actual boost and landing times instead of -- cgit v1.2.3 From 3e4fc0b3953655eb720372d9b4274cd4bca19556 Mon Sep 17 00:00:00 2001 From: Tom Marble Date: Wed, 12 Sep 2012 10:05:42 -0500 Subject: Reference specific dependent jars in the AltosUI launchers --- altosui/Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 04820294..36969846 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -230,25 +230,25 @@ $(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(FREETTS_CLASS Manifest.txt: Makefile echo 'Main-Class: altosui.AltosUI' > $@ - echo "Class-Path: AltosLib.jar $(FREETTS)/freetts.jar $(JFREECHART)/jfreechart.jar $(JCOMMON)/jcommon.jar" >> $@ + echo "Class-Path: AltosLib.jar $(FREETTS)/freetts.jar $(JCOMMON)/jcommon.jar $(JFREECHART)/jfreechart.jar" >> $@ Manifest-fat.txt: echo 'Main-Class: altosui.AltosUI' > $@ - echo "Class-Path: AltosLib.jar freetts.jar jfreechart.jar jcommon.jar" >> $@ + echo "Class-Path: AltosLib.jar freetts.jar jcommon.jar jfreechart.jar" >> $@ altosui: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@ + echo 'exec java -cp "$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@ chmod +x $@ altosui-test: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "./*:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" -jar altosui.jar "$$@"' >> $@ + echo 'exec java -cp "./*:$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="libaltos/.libs" -jar altosui.jar "$$@"' >> $@ chmod +x $@ altosui-jdb: Makefile echo "#!/bin/sh" > $@ - echo 'exec jdb -classpath "classes:libaltos:$(FREETTS)/*:$(JFREECHART)/*:$(JCOMMON)/*" -Djava.library.path="libaltos/.libs" altosui/AltosUI "$$@"' >> $@ + echo 'exec jdb -classpath "classes:libaltos:$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="libaltos/.libs" altosui/AltosUI "$$@"' >> $@ chmod +x $@ libaltos.so: build-libaltos -- cgit v1.2.3 From 1b5340c2b75c500011355c4889da443c4b9c4891 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2012 13:07:01 -0700 Subject: altosui: Add multi-sized icons to all windows This lets the window system pick a better size for presentation Signed-off-by: Keith Packard --- altosui/AltosFlightUI.java | 4 ---- altosui/AltosFrame.java | 23 +++++++++++++++++++++++ altosui/AltosIdleMonitorUI.java | 4 ---- altosui/AltosUI.java | 4 ---- altosui/Makefile-standalone | 15 +++++++++++---- altosui/Makefile.am | 19 +++++++++++++++---- icon/altus-metrum-128.png | Bin 0 -> 8736 bytes icon/altus-metrum-16.png | Bin 0 -> 507 bytes icon/altus-metrum-16x16.jpg | Bin 1100 -> 0 bytes icon/altus-metrum-256.png | Bin 0 -> 21589 bytes icon/altus-metrum-32.png | Bin 0 -> 1475 bytes icon/altus-metrum-48.png | Bin 0 -> 2507 bytes icon/altus-metrum-512.png | Bin 0 -> 56581 bytes icon/altus-metrum-64.png | Bin 0 -> 3678 bytes 14 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 icon/altus-metrum-128.png create mode 100644 icon/altus-metrum-16.png delete mode 100644 icon/altus-metrum-16x16.jpg create mode 100644 icon/altus-metrum-256.png create mode 100644 icon/altus-metrum-32.png create mode 100644 icon/altus-metrum-48.png create mode 100644 icon/altus-metrum-512.png create mode 100644 icon/altus-metrum-64.png diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index ddc54cbd..600d8acc 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -170,10 +170,6 @@ public class AltosFlightUI extends AltosFrame implements AltosFlightDisplay, Alt GridBagConstraints c = new GridBagConstraints(); - java.net.URL imgURL = AltosUI.class.getResource("/altus-metrum-16x16.jpg"); - if (imgURL != null) - setIconImage(new ImageIcon(imgURL).getImage()); - setTitle(String.format("AltOS %s", reader.name)); /* Stick channel selector at top of table for telemetry monitoring */ diff --git a/altosui/AltosFrame.java b/altosui/AltosFrame.java index 70598634..338b363e 100644 --- a/altosui/AltosFrame.java +++ b/altosui/AltosFrame.java @@ -44,14 +44,37 @@ public class AltosFrame extends JFrame implements AltosUIListener { this.pack(); } + static final String[] icon_names = { + "/altus-metrum-16.png", + "/altus-metrum-32.png", + "/altus-metrum-48.png", + "/altus-metrum-64.png", + "/altus-metrum-128.png", + "/altus-metrum-256.png" + }; + + public void set_icon() { + ArrayList icons = new ArrayList(); + + for (int i = 0; i < icon_names.length; i++) { + java.net.URL imgURL = AltosUI.class.getResource(icon_names[i]); + if (imgURL != null) + icons.add(new ImageIcon(imgURL).getImage()); + } + + setIconImages(icons); + } + public AltosFrame() { AltosUIPreferences.register_ui_listener(this); addWindowListener(new AltosFrameListener()); + set_icon(); } public AltosFrame(String name) { super(name); AltosUIPreferences.register_ui_listener(this); addWindowListener(new AltosFrameListener()); + set_icon(); } } diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 46ca3e5d..510579c5 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -106,10 +106,6 @@ public class AltosIdleMonitorUI extends AltosFrame implements AltosFlightDisplay GridBagConstraints c = new GridBagConstraints(); - java.net.URL imgURL = AltosUI.class.getResource("/altus-metrum-16x16.jpg"); - if (imgURL != null) - setIconImage(new ImageIcon(imgURL).getImage()); - setTitle(String.format("AltOS %s", device.toShortString())); /* Stick frequency selector at top of table for telemetry monitoring */ diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 926d66f0..9977e82b 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -105,10 +105,6 @@ public class AltosUI extends AltosFrame { load_library(null); - java.net.URL imgURL = AltosUI.class.getResource("/altus-metrum-16x16.jpg"); - if (imgURL != null) - setIconImage(new ImageIcon(imgURL).getImage()); - AltosUIPreferences.set_component(this); pane = getContentPane(); diff --git a/altosui/Makefile-standalone b/altosui/Makefile-standalone index 0d9931d5..23163e40 100644 --- a/altosui/Makefile-standalone +++ b/altosui/Makefile-standalone @@ -44,7 +44,14 @@ CLASSFILES=\ AltosRomconfigUI.class \ AltosVoice.class -JAVA_ICON=../icon/altus-metrum-16x16.jpg +JAVA_ICONS=\ + ../icon/altus-metrum-16.png \ + ../icon/altus-metrum-32.png \ + ../icon/altus-metrum-48.png \ + ../icon/altus-metrum-64.png \ + ../icon/altus-metrum-128.png \ + ../icon/altus-metrum-256.png + WINDOWS_ICON=../icon/altus-metrum.ico # where altosui.jar gets installed @@ -109,7 +116,7 @@ classes/libaltosJNI: classes/images: mkdir -p classes/images - ln -sf ../$(JAVA_ICON) classes/images + ln -sf ../$(JAVA_ICONS) classes/images altosui: echo "#!/bin/sh" > $@ @@ -123,11 +130,11 @@ fat/altosui: echo 'exec java -Djava.library.path="$$DIR" -jar "$$DIR"/altosui.jar' >> $@ chmod +x $@ -fat/altosui.jar: $(CLASSFILES) $(JAVA_ICON) fat/classes/Manifest.txt +fat/altosui.jar: $(CLASSFILES) $(JAVA_ICONS) fat/classes/Manifest.txt mkdir -p fat/classes test -L fat/classes/altosui || ln -sf ../.. fat/classes/altosui mkdir -p fat/classes/images - cp $(JAVA_ICON) fat/classes/images + cp $(JAVA_ICONS) fat/classes/images test -L fat/classes/libaltosJNI || ln -sf ../../libaltos/libaltosJNI fat/classes/libaltosJNI cd ./fat/classes && jar cfm ../../$@ Manifest.txt images/* altosui/*.class libaltosJNI/*.class diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 36969846..6010df58 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -119,14 +119,25 @@ FATJAR=altosui-fat.jar # Icons ICONDIR=$(top_srcdir)/icon -JAVA_ICON=$(ICONDIR)/altus-metrum-16x16.jpg +JAVA_ICONS=\ + $(ICONDIR)/altus-metrum-16.png \ + $(ICONDIR)/altus-metrum-32.png \ + $(ICONDIR)/altus-metrum-48.png \ + $(ICONDIR)/altus-metrum-64.png \ + $(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-16x16.jpg \ +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 @@ -216,13 +227,13 @@ install-altosuiJAVA: altosui.jar classes/altosui: mkdir -p classes/altosui -$(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICON) $(ALTOSLIB_CLASS) +$(JAR): classaltosui.stamp Manifest.txt $(JAVA_ICONS) $(ALTOSLIB_CLASS) jar cfm $@ Manifest.txt \ $(ICONJAR) \ -C classes altosui \ -C libaltos libaltosJNI -$(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICON) +$(FATJAR): classaltosui.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) $(JAVA_ICONS) jar cfm $@ Manifest-fat.txt \ $(ICONJAR) \ -C classes altosui \ diff --git a/icon/altus-metrum-128.png b/icon/altus-metrum-128.png new file mode 100644 index 00000000..f1343d9e Binary files /dev/null and b/icon/altus-metrum-128.png differ diff --git a/icon/altus-metrum-16.png b/icon/altus-metrum-16.png new file mode 100644 index 00000000..5bd45999 Binary files /dev/null and b/icon/altus-metrum-16.png differ diff --git a/icon/altus-metrum-16x16.jpg b/icon/altus-metrum-16x16.jpg deleted file mode 100644 index 8d8bbc6a..00000000 Binary files a/icon/altus-metrum-16x16.jpg and /dev/null differ diff --git a/icon/altus-metrum-256.png b/icon/altus-metrum-256.png new file mode 100644 index 00000000..46e1670a Binary files /dev/null and b/icon/altus-metrum-256.png differ diff --git a/icon/altus-metrum-32.png b/icon/altus-metrum-32.png new file mode 100644 index 00000000..c8588899 Binary files /dev/null and b/icon/altus-metrum-32.png differ diff --git a/icon/altus-metrum-48.png b/icon/altus-metrum-48.png new file mode 100644 index 00000000..3bee98e6 Binary files /dev/null and b/icon/altus-metrum-48.png differ diff --git a/icon/altus-metrum-512.png b/icon/altus-metrum-512.png new file mode 100644 index 00000000..47c47003 Binary files /dev/null and b/icon/altus-metrum-512.png differ diff --git a/icon/altus-metrum-64.png b/icon/altus-metrum-64.png new file mode 100644 index 00000000..0ee086a6 Binary files /dev/null and b/icon/altus-metrum-64.png differ -- cgit v1.2.3 From 19e35de47157923670b1864ce7b04f8d82f3bdea Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2012 16:06:59 -0700 Subject: altosui: Lock access to preferences data These are accessed by several different threads, so keep things sane by just holding locks across all access. Signed-off-by: Keith Packard --- altoslib/AltosPreferences.java | 119 ++++++++++++++++++++++++---------------- altosui/AltosUIPreferences.java | 22 +++++--- 2 files changed, 87 insertions(+), 54 deletions(-) diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index 065b6e99..0e7b2bd3 100644 --- a/altoslib/AltosPreferences.java +++ b/altoslib/AltosPreferences.java @@ -202,173 +202,200 @@ public class AltosPreferences { } public static void set_logdir(File new_logdir) { - logdir = new_logdir; - mapdir = new File(logdir, "maps"); - if (!mapdir.exists()) - mapdir.mkdirs(); synchronized (preferences) { + logdir = new_logdir; + mapdir = new File(logdir, "maps"); + if (!mapdir.exists()) + mapdir.mkdirs(); preferences.put(logdirPreference, logdir.getPath()); flush_preferences(); } } public static File logdir() { - return logdir; + synchronized (preferences) { + return logdir; + } } public static File mapdir() { - return mapdir; + synchronized (preferences) { + return mapdir; + } } public static void set_frequency(int serial, double new_frequency) { - frequencies.put(serial, new_frequency); synchronized (preferences) { + frequencies.put(serial, new_frequency); preferences.putDouble(String.format(frequencyPreferenceFormat, serial), new_frequency); flush_preferences(); } } public static double frequency(int serial) { - if (frequencies.containsKey(serial)) - return frequencies.get(serial); - double frequency = preferences.getDouble(String.format(frequencyPreferenceFormat, serial), 0); - if (frequency == 0.0) { - int channel = preferences.getInt(String.format(channelPreferenceFormat, serial), 0); - frequency = AltosConvert.radio_channel_to_frequency(channel); + synchronized (preferences) { + if (frequencies.containsKey(serial)) + return frequencies.get(serial); + double frequency = preferences.getDouble(String.format(frequencyPreferenceFormat, serial), 0); + if (frequency == 0.0) { + int channel = preferences.getInt(String.format(channelPreferenceFormat, serial), 0); + frequency = AltosConvert.radio_channel_to_frequency(channel); + } + frequencies.put(serial, frequency); + return frequency; } - frequencies.put(serial, frequency); - return frequency; } public static void set_telemetry(int serial, int new_telemetry) { - telemetries.put(serial, new_telemetry); synchronized (preferences) { + telemetries.put(serial, new_telemetry); preferences.putInt(String.format(telemetryPreferenceFormat, serial), new_telemetry); flush_preferences(); } } public static int telemetry(int serial) { - if (telemetries.containsKey(serial)) - return telemetries.get(serial); - int telemetry = preferences.getInt(String.format(telemetryPreferenceFormat, serial), - AltosLib.ao_telemetry_standard); - telemetries.put(serial, telemetry); - return telemetry; + synchronized (preferences) { + if (telemetries.containsKey(serial)) + return telemetries.get(serial); + int telemetry = preferences.getInt(String.format(telemetryPreferenceFormat, serial), + AltosLib.ao_telemetry_standard); + telemetries.put(serial, telemetry); + return telemetry; + } } public static void set_scanning_telemetry(int new_scanning_telemetry) { - scanning_telemetry = new_scanning_telemetry; synchronized (preferences) { + scanning_telemetry = new_scanning_telemetry; preferences.putInt(scanningTelemetryPreference, scanning_telemetry); flush_preferences(); } } public static int scanning_telemetry() { - return scanning_telemetry; + synchronized (preferences) { + return scanning_telemetry; + } } public static void set_voice(boolean new_voice) { - voice = new_voice; synchronized (preferences) { + voice = new_voice; preferences.putBoolean(voicePreference, voice); flush_preferences(); } } public static boolean voice() { - return voice; + synchronized (preferences) { + return voice; + } } public static void set_callsign(String new_callsign) { - callsign = new_callsign; synchronized(preferences) { + callsign = new_callsign; preferences.put(callsignPreference, callsign); flush_preferences(); } } public static String callsign() { - return callsign; + synchronized(preferences) { + return callsign; + } } public static void set_firmwaredir(File new_firmwaredir) { - firmwaredir = new_firmwaredir; synchronized (preferences) { + firmwaredir = new_firmwaredir; preferences.put(firmwaredirPreference, firmwaredir.getPath()); flush_preferences(); } } public static File firmwaredir() { - return firmwaredir; + synchronized (preferences) { + return firmwaredir; + } } public static void set_launcher_serial(int new_launcher_serial) { - launcher_serial = new_launcher_serial; synchronized (preferences) { + launcher_serial = new_launcher_serial; preferences.putInt(launcherSerialPreference, launcher_serial); flush_preferences(); } } public static int launcher_serial() { - return launcher_serial; + synchronized (preferences) { + return launcher_serial; + } } public static void set_launcher_channel(int new_launcher_channel) { - launcher_channel = new_launcher_channel; synchronized (preferences) { + launcher_channel = new_launcher_channel; preferences.putInt(launcherChannelPreference, launcher_channel); flush_preferences(); } } public static int launcher_channel() { - return launcher_channel; + synchronized (preferences) { + return launcher_channel; + } } public static Preferences bt_devices() { - return preferences.node("bt_devices"); + synchronized (preferences) { + return preferences.node("bt_devices"); + } } public static AltosFrequency[] common_frequencies() { - return common_frequencies; + synchronized (preferences) { + return common_frequencies; + } } public static void set_common_frequencies(AltosFrequency[] frequencies) { - common_frequencies = frequencies; synchronized(preferences) { + common_frequencies = frequencies; save_common_frequencies(frequencies); flush_preferences(); } } public static void add_common_frequency(AltosFrequency frequency) { - AltosFrequency[] new_frequencies = new AltosFrequency[common_frequencies.length + 1]; + AltosFrequency[] old_frequencies = common_frequencies(); + AltosFrequency[] new_frequencies = new AltosFrequency[old_frequencies.length + 1]; int i; - for (i = 0; i < common_frequencies.length; i++) { - if (frequency.frequency == common_frequencies[i].frequency) + for (i = 0; i < old_frequencies.length; i++) { + if (frequency.frequency == old_frequencies[i].frequency) return; - if (frequency.frequency < common_frequencies[i].frequency) + if (frequency.frequency < old_frequencies[i].frequency) break; - new_frequencies[i] = common_frequencies[i]; + new_frequencies[i] = old_frequencies[i]; } new_frequencies[i] = frequency; - for (; i < common_frequencies.length; i++) - new_frequencies[i+1] = common_frequencies[i]; + for (; i < old_frequencies.length; i++) + new_frequencies[i+1] = old_frequencies[i]; set_common_frequencies(new_frequencies); } public static boolean imperial_units() { - return AltosConvert.imperial_units; + synchronized(preferences) { + return AltosConvert.imperial_units; + } } public static void set_imperial_units(boolean imperial_units) { - AltosConvert.imperial_units = imperial_units; synchronized (preferences) { + AltosConvert.imperial_units = imperial_units; preferences.putBoolean(unitsPreference, imperial_units); flush_preferences(); } diff --git a/altosui/AltosUIPreferences.java b/altosui/AltosUIPreferences.java index 10ab26c3..8f1e45d9 100644 --- a/altosui/AltosUIPreferences.java +++ b/altosui/AltosUIPreferences.java @@ -102,15 +102,17 @@ public class AltosUIPreferences extends AltosPreferences { } } public static int font_size() { - return font_size; + synchronized (preferences) { + return font_size; + } } static void set_fonts() { } public static void set_font_size(int new_font_size) { - font_size = new_font_size; synchronized (preferences) { + font_size = new_font_size; preferences.putInt(fontSizePreference, font_size); flush_preferences(); Altos.set_fonts(font_size); @@ -132,12 +134,12 @@ public class AltosUIPreferences extends AltosPreferences { } public static void set_look_and_feel(String new_look_and_feel) { - look_and_feel = new_look_and_feel; try { - UIManager.setLookAndFeel(look_and_feel); + UIManager.setLookAndFeel(new_look_and_feel); } catch (Exception e) { } synchronized(preferences) { + look_and_feel = new_look_and_feel; preferences.put(lookAndFeelPreference, look_and_feel); flush_preferences(); for (AltosUIListener l : ui_listeners) @@ -146,7 +148,9 @@ public class AltosUIPreferences extends AltosPreferences { } public static String look_and_feel() { - return look_and_feel; + synchronized (preferences) { + return look_and_feel; + } } public static void register_ui_listener(AltosUIListener l) { @@ -161,16 +165,18 @@ public class AltosUIPreferences extends AltosPreferences { } } public static void set_serial_debug(boolean new_serial_debug) { - serial_debug = new_serial_debug; - AltosLink.set_debug(serial_debug); + AltosLink.set_debug(new_serial_debug); synchronized (preferences) { + serial_debug = new_serial_debug; preferences.putBoolean(serialDebugPreference, serial_debug); flush_preferences(); } } public static boolean serial_debug() { - return serial_debug; + synchronized (preferences) { + return serial_debug; + } } } \ No newline at end of file -- cgit v1.2.3 From 8ee29fe48771dd22a0c5428761ee53a728495d11 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 12 Sep 2012 16:07:41 -0700 Subject: altosui: Serialize data access in TD config code Setting the values was being done in the UI thread instead of the Serial thread, which left the serial thread with uninitialized values when it went to update the displayed value for the current frequency. All fixed now. Signed-off-by: Keith Packard --- altosui/AltosConfigTD.java | 150 ++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 84 deletions(-) diff --git a/altosui/AltosConfigTD.java b/altosui/AltosConfigTD.java index 324a5988..71d628b3 100644 --- a/altosui/AltosConfigTD.java +++ b/altosui/AltosConfigTD.java @@ -74,7 +74,6 @@ public class AltosConfigTD implements ActionListener { string_ref version; string_ref product; AltosConfigTDUI config_ui; - boolean serial_started; boolean made_visible; boolean get_int(String line, String label, int_ref x) { @@ -108,17 +107,7 @@ public class AltosConfigTD implements ActionListener { } } - void start_serial() throws InterruptedException, TimeoutException { - serial_started = true; - } - - void stop_serial() throws InterruptedException { - if (!serial_started) - return; - serial_started = false; - } - - void update_ui() { + synchronized void update_ui() { config_ui.set_serial(serial.get()); config_ui.set_product(product.get()); config_ui.set_version(version.get()); @@ -131,7 +120,7 @@ public class AltosConfigTD implements ActionListener { } } - void process_line(String line) { + void finish_input(String line) { if (line == null) { abort(); return; @@ -141,63 +130,82 @@ public class AltosConfigTD implements ActionListener { update_ui(); return; } - get_string(line, "Config version", config_version); - get_int(line, "serial-number", serial); - get_int(line, "Radio channel:", radio_channel); - get_int(line, "Radio cal:", radio_calibration); - get_int(line, "Frequency:", radio_frequency); - get_int(line, "Radio setting:", radio_setting); - get_string(line,"software-version", version); - get_string(line,"product", product); } - final static int serial_mode_read = 0; - final static int serial_mode_save = 1; - final static int serial_mode_reboot = 2; - - class SerialData implements Runnable { - AltosConfigTD config; - int serial_mode; - - void process_line(String line) { - config.process_line(line); - } - void callback(String in_line) { - final String line = in_line; + synchronized void process_line(String line) { + if (line == null || line.equals("all finished")) { + final String last_line = line; Runnable r = new Runnable() { public void run() { - process_line(line); + finish_input(last_line); } }; SwingUtilities.invokeLater(r); + } else { + get_string(line, "Config version", config_version); + get_int(line, "serial-number", serial); + get_int(line, "Radio channel:", radio_channel); + get_int(line, "Radio cal:", radio_calibration); + get_int(line, "Frequency:", radio_frequency); + get_int(line, "Radio setting:", radio_setting); + get_string(line,"software-version", version); + get_string(line,"product", product); } + } + + synchronized void reset_data() { + serial.set(0); + radio_channel.set(0); + radio_setting.set(0); + radio_frequency.set(0); + radio_calibration.set(1186611); + config_version.set("0.0"); + version.set("unknown"); + product.set("unknown"); + } - void reset_data() { - serial.set(0); + synchronized double frequency() { + return AltosConvert.radio_to_frequency(radio_frequency.get(), + radio_setting.get(), + radio_calibration.get(), + radio_channel.get()); + } + + synchronized void set_frequency(double freq) { + int frequency = radio_frequency.get(); + int setting = radio_setting.get(); + + if (frequency > 0) { + radio_frequency.set((int) Math.floor (freq * 1000 + 0.5)); + } else if (setting > 0) { + radio_setting.set(AltosConvert.radio_frequency_to_setting(freq, + radio_calibration.get())); radio_channel.set(0); - radio_setting.set(0); - radio_frequency.set(0); - radio_calibration.set(1186611); - config_version.set("0.0"); - version.set("unknown"); - product.set("unknown"); + } else { + radio_channel.set(AltosConvert.radio_frequency_to_channel(freq)); } + } + + final static int serial_mode_read = 0; + final static int serial_mode_save = 1; + final static int serial_mode_reboot = 2; + + class SerialData implements Runnable { + AltosConfigTD config; + int serial_mode; void get_data() { try { boolean been_there = false; - config.start_serial(); - reset_data(); + config.reset_data(); for (;;) { - config.serial_line.printf("c s\nf\nl\nv\n"); + config.serial_line.printf("c s\nf\nv\n"); for (;;) { try { String line = config.serial_line.get_reply(5000); - if (line == null) - stop_serial(); - callback(line); - if (line.startsWith("software-version")) + config.process_line(line); + if (line != null && line.startsWith("software-version")) break; } catch (Exception e) { break; @@ -212,17 +220,13 @@ public class AltosConfigTD implements ActionListener { config.serial_line.flush_input(); } } catch (InterruptedException ie) { - } catch (TimeoutException te) { - } finally { - try { - stop_serial(); - } catch (InterruptedException ie) { - } } - double pref_frequency = AltosPreferences.frequency(serial.get()); - if (pref_frequency != 0) - radio_frequency.set((int) Math.floor (pref_frequency * 1000 + 0.5)); - callback("all finished"); + /* + * This makes sure the displayed frequency respects the limits that the + * available firmware version might place on the actual frequency + */ + config.set_frequency(AltosPreferences.frequency(serial.get())); + config.process_line("all finished"); } void save_data() { @@ -280,31 +284,9 @@ public class AltosConfigTD implements ActionListener { update_ui(); } - double frequency() { - return AltosConvert.radio_to_frequency(radio_frequency.get(), - radio_setting.get(), - radio_calibration.get(), - radio_channel.get()); - } - - void set_frequency(double freq) { - int frequency = radio_frequency.get(); - int setting = radio_setting.get(); - - if (frequency > 0) { - radio_frequency.set((int) Math.floor (freq * 1000 + 0.5)); - } else if (setting > 0) { - radio_setting.set(AltosConvert.radio_frequency_to_setting(freq, - radio_calibration.get())); - radio_channel.set(0); - } else { - radio_channel.set(AltosConvert.radio_frequency_to_channel(freq)); - } - } - void save_data() { - - set_frequency(config_ui.radio_frequency()); + double freq = config_ui.radio_frequency(); + set_frequency(freq); run_serial_thread(serial_mode_save); } -- cgit v1.2.3 From 07d9ba938f2742da1bce5d8df55cbc236207a981 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 12 Sep 2012 19:50:07 -0600 Subject: update Releasing for non-native versioning and builds on debian branch --- Releasing | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/Releasing b/Releasing index 4d2f8e71..1944507e 100644 --- a/Releasing +++ b/Releasing @@ -1,17 +1,36 @@ These are Bdale's notes on how to do a release. - update the version in configure.ac and commit - - git tag -a - - - make sure checked-out tree is "clean" so git won't complain - - git-buildpackage - - at this point, we have Debian packages - + git checkout master + - update the version in configure.ac + git log > ChangeLog + git commit -a + - make absolutely sure checked-out tree is "clean" + - if this is an x.y release, then: + git checkout -b branch- + git tag -a + - if this is an x.y.z release, then: + git checkout branch- # the x.y parts only + git merge master + git tag -a # full x.y.z version + + - edit .git/gbp.conf to use branch- as upstream if needed + + git checkout debian + git merge branch- + + - verify debian/changelog is "clean" ending in last release version + - craft a suitable debian/changelog entry, possibly using: + git-dch --release --new-version=-1 --multimaint-merge + + git commit -n debian/changelog -m "update changelog for Debian build" + + git-buildpackage --git-no-pristine-tar + pristine-tar commit ../build-area/altos/altos_.orig.tar.gz git tag debian/ + - at this point we have packages in ~/debian/build-area/altos, now + we move on to the non-Debian part of the release process + make distclean ./autogen.sh --with-fat-dir=/home/bdale/web/altusmetrum/AltOS/releases -- cgit v1.2.3