From: Anthony Towns Date: Fri, 10 Sep 2010 05:50:01 +0000 (+1000) Subject: Merge branch 'master' of git://git.gag.com/fw/altos X-Git-Tag: debian/0.7.1+28+gd8a2f4c~13 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=7c2e4114a3a43f919a7a6c967d3f16e5d630f90f;hp=ddc83b4c401be965a9947782becf20cc8c54e6a2 Merge branch 'master' of git://git.gag.com/fw/altos --- diff --git a/ChangeLog b/ChangeLog index 70911434..8e1be97c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,467 @@ +commit 2d5e48c5dc0e822fdf430f43804c1e5e79fdbf84 +Author: Keith Packard +Date: Thu Sep 9 21:28:10 2010 -0700 + + Add --with-fat-dir configure option to publish finished stand-alone bits + + --with-fat-dir specifies a directory to copy the finished + linux/macosx/windows stand-alone ("fat") packages to. A sub-directory + will be created under the specified directory based on the product + version number and the files copied there. + + Signed-off-by: Keith Packard + +commit dd2b77b2a516a055f29191dcdfeb727e637aae86 +Author: Keith Packard +Date: Thu Sep 9 20:59:29 2010 -0700 + + altosui: libaltos.so is built with libtool -- it's in ../libaltos/.libs + + It used to be in ../libaltos + + Signed-off-by: Keith Packard + +commit 72a5c1258db92d0ddd660bfa875e8e55cab47af7 +Author: Keith Packard +Date: Thu Sep 9 20:39:41 2010 -0700 + + altosui: Remove some debug printfs. + + Signed-off-by: Keith Packard + +commit 031fd9a954f2e3447d0150eb4ecc81af7b620dca +Author: Keith Packard +Date: Thu Sep 9 20:36:12 2010 -0700 + + Add firmware and libaltos to 'fat' target at top-level + + This ensures that all of the necessary bits are available to construct + the distribution images. + + Signed-off-by: Keith Packard + +commit fcaa480b1dfeb2fd4044f9c4e1b6d50c46fc9984 +Author: Bdale Garbee +Date: Thu Sep 9 21:29:20 2010 -0600 + + update changelogs for Debian build + +commit 48f57997452e17564e28fe3e37403f6f63d32dea +Author: Keith Packard +Date: Thu Sep 9 20:24:42 2010 -0700 + + altosui: conflating USB product and vendor IDs is a bad idea + + We've now got a USB vendor ID called 'altusmetrum' for generic + altusmetrum devices (old USB ID 0x000A) while the general vendor name + for all devices is 'altusmetrum' as well. + + This patch splits vendors and products into separate name spaces, + products are prefixed with product_ and vendor with (oddly) vendor_. + + Signed-off-by: Keith Packard + +commit 632d276118ab04de67561104be650f8fb69a0450 +Author: Bdale Garbee +Date: Thu Sep 9 20:34:43 2010 -0600 + + update changelogs for Debian build + +commit 1ac3d7e3ba52d1b0dc834eaa5d7886c730eaf307 +Author: Bdale Garbee +Date: Thu Sep 9 20:34:22 2010 -0600 + + initial cut at an altosui man page + +commit 5c4e437975054d33604402591e1ea2f314932593 +Author: Bdale Garbee +Date: Thu Sep 9 20:06:09 2010 -0600 + + update changelogs for Debian build + +commit 0ea75761416bff299233991e961ba25b6c7dcf89 +Merge: 35d70c9 8ee3464 +Author: Bdale Garbee +Date: Thu Sep 9 20:05:27 2010 -0600 + + Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos + +commit 8ee3464d8064ebe1694c7b20177878c0d9961451 +Author: Keith Packard +Date: Thu Sep 9 17:54:41 2010 -0700 + + altosui: Display error dialog when AltOS JNI library can't be loaded + + Having an error dialog appear at application startup seems better than + simply failing to present the device dialog later on. + + Signed-off-by: Keith Packard + +commit 4224a7526e51eb8fbf1f0a31bae7ee68c6385095 +Author: Keith Packard +Date: Thu Sep 9 17:52:46 2010 -0700 + + altosui: Store libaltos.so in $(libdir)/altos + + It's not a public library, so hide it away in a subdirectory. + + Signed-off-by: Keith Packard + +commit 1e4c18777d982061f5e507a4d4f4f1cd4d685268 +Author: Keith Packard +Date: Thu Sep 9 17:49:37 2010 -0700 + + altosui: Need to have JVM include path substituted into libaltos Makefile + + The libaltos Makefile needs to find the relevant jni.h file, which is + found in the JVM_INCLUDE path, all nicely located by the configure.ac script. + + Signed-off-by: Keith Packard + +commit 35d70c92307dd478bc619b2f6c5a88e155cdad28 +Author: Bdale Garbee +Date: Thu Sep 9 17:27:07 2010 -0600 + + handle versioning of ihx files (poorly) by just wildcarding the file name, + which assumes there's only one matching .. probably ok on Debian? + +commit c286ada6457579d64e9d8ca44b927258b4a561da +Author: Bdale Garbee +Date: Thu Sep 9 16:27:40 2010 -0600 + + update changelogs for Debian build + +commit 6c0ae7e966a81ece35bccbe89d626a58afe899a2 +Author: Keith Packard +Date: Thu Sep 9 15:25:18 2010 -0700 + + altosui: remove FATJAR from all-local to avoid building fat .jar file + + the fat .jar file is used in non-native builds to run from a directory + containing all of the freetts jar files along with the altosui jar + file. We don't want this on a real install where freetts is installed separately. + + Signed-off-by: Keith Packard + +commit 737a64c57a8f979f51c3fa6b3f214520c736cf8a +Author: Keith Packard +Date: Thu Sep 9 15:22:14 2010 -0700 + + altosui: hack to make JAVAROOT directory get created before javac runs + + This ensures that the JAVAROOT directory gets created by adding it to + the variable used to set the CLASSPATH environment value. + + Signed-off-by: Keith Packard + +commit b456bd9d7bcd9d968e43c38eeb6fa6ad8c58f895 +Author: Keith Packard +Date: Thu Sep 9 15:11:41 2010 -0700 + + altosui: fix telemetrum.inf FFFE:000A product names on AMD64 and ia64 + + This appears to matter to Vista. Dunno why. + + Signed-off-by: Keith Packard + +commit 16980b848651a6b20a0b458446f0a19fb517539d +Author: Keith Packard +Date: Thu Sep 9 15:10:25 2010 -0700 + + altosui: Add explicit requirement to create classes directory + + The implicit ordering doesn't appear reliable. + + Signed-off-by: Keith Packard + +commit 15da683c2f747baef49c8b8d321a86faede0de30 +Author: Bdale Garbee +Date: Thu Sep 9 15:51:50 2010 -0600 + + update changelogs for Debian build + +commit 012e7176954a6b74b3b667317be0f6dc41d7ab70 +Author: Bdale Garbee +Date: Thu Sep 9 15:51:02 2010 -0600 + + add libtool to build deps + +commit 3e5824b9a71971ce99bfe38a1e860b421e265f02 +Author: Bdale Garbee +Date: Thu Sep 9 15:43:47 2010 -0600 + + update changelogs for Debian build + +commit 3d49d5f69b41c27003dbc5ccf1899014bd13bd99 +Author: Keith Packard +Date: Sun Sep 5 02:05:06 2010 -0700 + + altosui: ensure that 'altosui' script is installed. Pass arguments along. + + Signed-off-by: Keith Packard + +commit b61fec225ada6a9e252e4c7920101ee18c77cbdc +Author: Keith Packard +Date: Sun Sep 5 01:55:56 2010 -0700 + + altosui: eeprom files place 'boost' time in the flight number record. + + Instead of looking for the first state change record, use the Flight + record to get the boost tick. + + Signed-off-by: Keith Packard + +commit 6c653a4cba5fef8d49261cf1c024f3e86e9058c6 +Author: Keith Packard +Date: Sun Sep 5 01:52:36 2010 -0700 + + altosui: Record flight number when scanning file, not when running + + The very first record in the eeprom is the flight number, but it is + time-stamped with the 'boost' time, and so it gets sorted until much + later, delaying the return of data until the rocket enters boost + mode. This drops all of the nice pad GPS and state date on the floor. + + Signed-off-by: Keith Packard + +commit 38e1d87c8d449866faac026577fefa9a118428cb +Author: Keith Packard +Date: Sun Sep 5 01:23:53 2010 -0700 + + altosui: Use local .class files in the classpath + + This ensures that compiling only a few changed files will + locate the old .class files instead of using a stale .jar file. + +commit 9941b05a1d03dafd6cd899b5fe999ed769efb1d6 +Author: Keith Packard +Date: Sun Sep 5 01:21:14 2010 -0700 + + altosui: Prevent voice altitude data from queueing up + + When flight status changes rapidly, the queue of voice data can get + quite long. This change does two things -- first, it remembers when + the altitude reporting happens due to flight events and delays the + periodic reporting until a suitable time after that, second it ensures + that the voice data has all been delivered before generating a new + altitude report. + + Signed-off-by: Keith Packard + +commit 4dec5c36702d76dc95beada7c1d3222a638a2cbb +Author: Keith Packard +Date: Sun Sep 5 01:19:11 2010 -0700 + + altosui: Add AltosVoice.drain() to wait for queued speech to finish + + drain() blocks until all pending phrases have been processed, allowing + the UI code to avoid pending data that will end up stale by the time + it is emitted. + + Signed-off-by: Keith Packard + +commit 410ba89eef9c9817eef81b702966cb88820ff7c4 +Author: Keith Packard +Date: Sun Sep 5 01:13:01 2010 -0700 + + altosui: Start idle thread after the rocket leaves the pad + + This makes the first altitude report time consistently 10 seconds + after launch, instead of some random time depending on when the rocket + launched relative to the time the device connection was made. + + Signed-off-by: Keith Packard + +commit 6205547ec7191aab0259a8449520e966a96129e6 +Author: Keith Packard +Date: Sun Sep 5 01:08:50 2010 -0700 + + altosui: When replay thread is interrupted, don't make final report + + Normally, the replay process makes one final report after the file has + been parsed. However, if the reading process is interrupted to display + something else, this report is just annoying, so don't make it. + + Signed-off-by: Keith Packard + +commit 3d99584fcfe43b22e8581874e0ac77ce3d635d48 +Author: Keith Packard +Date: Sun Sep 5 01:03:18 2010 -0700 + + altosui: Add elevation and range data to main display + + Reported by voice, it's useful to see these on the display as well. + + Signed-off-by: Keith Packard + +commit 2d58f319a7c1a6a8ccc6a539722009996ba886ab +Author: Keith Packard +Date: Sun Sep 5 01:01:10 2010 -0700 + + altosui: Eeprom files contain only one date; save it. + + While reading eeprom files, the GPS record is reconstructed each time + the system sees the first GPS log item (the time field), but as the + date isn't repeated, we need to copy it from the old GPS data record. + + Signed-off-by: Keith Packard + +commit b2aa689bf3d61e4a3ebe7c828162d1be20aad0f6 +Author: Keith Packard +Date: Sun Sep 5 00:59:54 2010 -0700 + + altosui: Remove debugging printf from AltosEepromReader + + These were in place while validing the GPS data reconstruction code + that handles eeprom files missing the first GPS date line due to the + record overwriting bug in old firmware versions. + + Signed-off-by: Keith Packard + +commit eb0e7a59f0806734a4c959a3ce7c57f71cbe3986 +Author: Keith Packard +Date: Sun Sep 5 00:57:38 2010 -0700 + + altosui: Return AO_LOG_INVALID instead of exception for eeprom files + + When an eeprom file contains an invalid line, just return + AO_LOG_INVALID instead of throwing an exception. This allows us to + replay and parse files with extraneous serial communication. + + Signed-off-by: Keith Packard + +commit c3a17c71a45207dd715d537704f161de9219f0d7 +Author: Keith Packard +Date: Sat Sep 4 18:49:22 2010 -0700 + + altosui: Fix linux fat distribution + + Again, use 'cp -p' instead of 'cp -a' to get files into the archive + instead of links. Also, make the shell script 'altosui' instead of + 'altosui-fat'. + + Signed-off-by: Keith Packard + +commit 828e9e4c68e3ac90b6ba2e9fd5f131a9975f7e4a +Author: Keith Packard +Date: Sat Sep 4 18:39:58 2010 -0700 + + altosui: Fix up Mac OSX .zip file + + Must contain 'altosui.jar' instead of altosui-fat.jar. + Also, was using 'cp -a' instead of 'cp -p' which made files + represented by symlinks not end up in the archive. + + Signed-off-by: Keith Packard + +commit 044fd27449c70474f51b99dec25fd23d3c03a559 +Author: Keith Packard +Date: Sat Sep 4 18:20:45 2010 -0700 + + altosui: Fix windows installer to ship correct files + + Was shipping altosui.jar instead of altosui-fat.jar + + Signed-off-by: Keith Packard + +commit 148b927c3b8bc7b7b5c5356392032faf2b1203d3 +Author: Keith Packard +Date: Sat Sep 4 18:04:04 2010 -0700 + + Add top-level 'fat' target to aid building distribution files + + Signed-off-by: Keith Packard + +commit aed59e1c057c13e28fd368dc2592aa4628211097 +Author: Keith Packard +Date: Sat Sep 4 17:59:11 2010 -0700 + + Add version numbers to released files. Set version to 0.7.1 + + Instead of using git revision counts for version numbers, use explicit + versions numbers configured in the configure.ac file. Expose published + files with version numbers. + + Signed-off-by: Keith Packard + +commit 2808bba3efa1cff133cc060dabff06fab8b75388 +Author: Keith Packard +Date: Sat Sep 4 17:58:52 2010 -0700 + + Ignore libtool files. + +commit bc183400ab93d5902c52851319999cc77f27bc81 +Author: Keith Packard +Date: Sat Sep 4 17:35:17 2010 -0700 + + altos: add some SDCDB config files + +commit 887b11f6b9c81b9f15348d54017e700ca7dc5e55 +Author: Keith Packard +Date: Sat Sep 4 17:27:17 2010 -0700 + + Use autotools for altosui and libaltos + + This switches from hand-written Makefiles to automake with libtool + for these parts of the system. + + Signed-off-by: Keith Packard + +commit e844e8a0695e27af6f8e3e37a5e3bcc865b862e3 +Author: Keith Packard +Date: Sat Sep 4 01:13:42 2010 -0700 + + altosui: Add icons to application and Windows menus. + + Use the altus-metrum icon for an application icon and a windows start + menu/desktop icon. + + Signed-off-by: Keith Packard + +commit e9ea28504c646fc25791aab09b9e5faf73e0ac0c +Author: Keith Packard +Date: Sat Sep 4 01:08:34 2010 -0700 + + icon: add some icons for application programs + + altus-metrum.ico: Windows ICO file + altus-metrum-16x16.jpg: 16x16 jpg image for java + + Signed-off-by: Keith Packard + +commit f550677df016070430ed38bfa2b2be33f1b8c40a +Author: Keith Packard +Date: Sat Sep 4 00:16:41 2010 -0700 + + altosui: oops. renamed the nsis file to altos-windows.nsi + + And forgot to change the dependency in the Makefile + + Signed-off-by: Keith Packard + +commit c0988ddbf104ea729090c2e7e2a28cc6dc9e90f6 +Author: Keith Packard +Date: Sat Sep 4 00:14:15 2010 -0700 + + altosui: ignore built files + +commit ecb4a09535b6a8da0765010489a96e605dbdeb46 +Author: Keith Packard +Date: Sat Sep 4 00:13:11 2010 -0700 + + altosui: Add windows installer build using 'nsis' + + nsis happens to be packaged in debian, and it appears to build usable + installers, which is all very cool. + + Signed-off-by: Keith Packard + +commit bf22923cd8b4f6f954718358b411b5b10d8e7b4d +Author: Bdale Garbee +Date: Sat Sep 4 00:46:29 2010 -0400 + + update changelogs for Debian build + commit 59798c6fd11502a9c8b66090c23ba50eb250692e Author: Keith Packard Date: Fri Sep 3 12:43:45 2010 -0700 diff --git a/Makefile.am b/Makefile.am index 66d7cb55..264e577a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,4 +13,6 @@ ChangeLog: dist-hook: ChangeLog fat: + cd src && $(MAKE) all + cd ao-tools/libaltos && $(MAKE) all cd ao-tools/altosui && $(MAKE) fat diff --git a/ao-bringup/turnon_teledongle b/ao-bringup/turnon_teledongle index 7dbb82b5..216afa2a 100755 --- a/ao-bringup/turnon_teledongle +++ b/ao-bringup/turnon_teledongle @@ -42,7 +42,7 @@ read FREQ CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` echo "Programming flash with cal value " $CAL_VALUE -$AOLOAD --cal $CAL_VALUE /usr/share/altos/teledongle-v0.2.ihx $SERIAL +$AOLOAD --cal $CAL_VALUE /usr/share/altos/teledongle-v0.2*.ihx $SERIAL echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-bringup/turnon_telemetrum b/ao-bringup/turnon_telemetrum index 4086a1a8..440eda1b 100755 --- a/ao-bringup/turnon_telemetrum +++ b/ao-bringup/turnon_telemetrum @@ -42,7 +42,7 @@ read FREQ CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` echo "Programming flash with cal value " $CAL_VALUE -$AOLOAD --cal $CAL_VALUE /usr/share/altos/telemetrum-v1.0.ihx $SERIAL +$AOLOAD --cal $CAL_VALUE /usr/share/altos/telemetrum-v1.0*.ihx $SERIAL echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-tools/altosui/AltosConfig.java b/ao-tools/altosui/AltosConfig.java index 3d970748..7b6cd78c 100644 --- a/ao-tools/altosui/AltosConfig.java +++ b/ao-tools/altosui/AltosConfig.java @@ -238,12 +238,12 @@ public class AltosConfig implements Runnable, ActionListener { version = new string_ref("unknown"); product = new string_ref("unknown"); - device = AltosDeviceDialog.show(owner, AltosDevice.Any); + device = AltosDeviceDialog.show(owner, AltosDevice.product_any); serial_line = new AltosSerial(); if (device != null) { try { serial_line.open(device); - if (!device.matchProduct(AltosDevice.TeleMetrum)) + if (!device.matchProduct(AltosDevice.product_telemetrum)) remote = true; config_thread = new Thread(this); config_thread.start(); diff --git a/ao-tools/altosui/AltosDevice.java b/ao-tools/altosui/AltosDevice.java index e62a0a7a..f646305b 100644 --- a/ao-tools/altosui/AltosDevice.java +++ b/ao-tools/altosui/AltosDevice.java @@ -22,22 +22,76 @@ import libaltosJNI.*; public class AltosDevice extends altos_device { - static boolean initialized = false; - static { - try { - System.loadLibrary("altos"); - libaltos.altos_init(); + static public boolean initialized = false; + static public boolean loaded_library = false; + + public static boolean load_library() { + if (!initialized) { + try { + System.loadLibrary("altos"); + libaltos.altos_init(); + loaded_library = true; + } catch (UnsatisfiedLinkError e) { + loaded_library = false; + } initialized = true; - } catch (UnsatisfiedLinkError e) { - System.err.println("Native library failed to load.\n" + e); } + return loaded_library; + } + + static int usb_vendor_altusmetrum() { + if (load_library()) + return libaltosConstants.USB_VENDOR_ALTUSMETRUM; + return 0x000a; + } + + static int usb_product_altusmetrum() { + if (load_library()) + return libaltosConstants.USB_PRODUCT_ALTUSMETRUM; + return 0x000a; + } + + static int usb_product_altusmetrum_min() { + if (load_library()) + return libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MIN; + return 0x000a; + } + + static int usb_product_altusmetrum_max() { + if (load_library()) + return libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MAX; + return 0x000d; } - public final static int AltusMetrum = libaltosConstants.USB_PRODUCT_ALTUSMETRUM; - public final static int TeleMetrum = libaltosConstants.USB_PRODUCT_TELEMETRUM; - public final static int TeleDongle = libaltosConstants.USB_PRODUCT_TELEDONGLE; - public final static int TeleTerra = libaltosConstants.USB_PRODUCT_TELETERRA; - public final static int Any = 0x10000; - public final static int BaseStation = 0x10000 + 1; + + static int usb_product_telemetrum() { + if (load_library()) + return libaltosConstants.USB_PRODUCT_TELEMETRUM; + return 0x000b; + } + + static int usb_product_teledongle() { + if (load_library()) + return libaltosConstants.USB_PRODUCT_TELEDONGLE; + return 0x000c; + } + + static int usb_product_teleterra() { + if (load_library()) + return libaltosConstants.USB_PRODUCT_TELETERRA; + return 0x000d; + } + + public final static int vendor_altusmetrum = usb_vendor_altusmetrum(); + public final static int product_altusmetrum = usb_product_altusmetrum(); + public final static int product_telemetrum = usb_product_telemetrum(); + public final static int product_teledongle = usb_product_teledongle(); + public final static int product_teleterra = usb_product_teleterra(); + public final static int product_altusmetrum_min = usb_product_altusmetrum_min(); + public final static int product_altusmetrum_max = usb_product_altusmetrum_max(); + + + public final static int product_any = 0x10000; + public final static int product_basestation = 0x10000 + 1; public String toString() { String name = getName(); @@ -48,11 +102,11 @@ public class AltosDevice extends altos_device { } public boolean isAltusMetrum() { - if (getVendor() != libaltosConstants.USB_VENDOR_ALTUSMETRUM) + if (getVendor() != vendor_altusmetrum) return false; - if (getProduct() < libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MIN) + if (getProduct() < product_altusmetrum_min) return false; - if (getProduct() > libaltosConstants.USB_PRODUCT_ALTUSMETRUM_MAX) + if (getProduct() > product_altusmetrum_max) return false; return true; } @@ -62,15 +116,15 @@ public class AltosDevice extends altos_device { if (!isAltusMetrum()) return false; - if (want_product == Any) + if (want_product == product_any) return true; - if (want_product == BaseStation) - return matchProduct(TeleDongle) || matchProduct(TeleTerra); + if (want_product == product_basestation) + return matchProduct(product_teledongle) || matchProduct(product_teleterra); int have_product = getProduct(); - if (have_product == AltusMetrum) /* old devices match any request */ + if (have_product == product_altusmetrum) /* old devices match any request */ return true; if (want_product == have_product) @@ -80,7 +134,7 @@ public class AltosDevice extends altos_device { } static AltosDevice[] list(int product) { - if (!initialized) + if (!load_library()) return null; SWIGTYPE_p_altos_list list = libaltos.altos_list_start(); diff --git a/ao-tools/altosui/AltosDeviceDialog.java b/ao-tools/altosui/AltosDeviceDialog.java index 3df4c6eb..ec78e288 100644 --- a/ao-tools/altosui/AltosDeviceDialog.java +++ b/ao-tools/altosui/AltosDeviceDialog.java @@ -49,10 +49,15 @@ public class AltosDeviceDialog extends JDialog implements ActionListener { dialog.setVisible(true); return value; } else { - JOptionPane.showMessageDialog(frame, - "No AltOS devices available", - "No AltOS devices", - JOptionPane.ERROR_MESSAGE); + /* check for missing altos JNI library, which + * will put up its own error dialog + */ + if (AltosUI.load_library(frame)) { + JOptionPane.showMessageDialog(frame, + "No AltOS devices available", + "No AltOS devices", + JOptionPane.ERROR_MESSAGE); + } return null; } } diff --git a/ao-tools/altosui/AltosEepromDownload.java b/ao-tools/altosui/AltosEepromDownload.java index 6dbbd3eb..a7f64904 100644 --- a/ao-tools/altosui/AltosEepromDownload.java +++ b/ao-tools/altosui/AltosEepromDownload.java @@ -254,7 +254,7 @@ public class AltosEepromDownload implements Runnable { public AltosEepromDownload(JFrame given_frame) { frame = given_frame; - device = AltosDeviceDialog.show(frame, AltosDevice.Any); + device = AltosDeviceDialog.show(frame, AltosDevice.product_any); serial_line = new AltosSerial(); remote = false; @@ -262,7 +262,7 @@ public class AltosEepromDownload implements Runnable { if (device != null) { try { serial_line.open(device); - if (!device.matchProduct(AltosDevice.TeleMetrum)) + if (!device.matchProduct(AltosDevice.product_telemetrum)) remote = true; eeprom_thread = new Thread(this); eeprom_thread.start(); diff --git a/ao-tools/altosui/AltosFlashUI.java b/ao-tools/altosui/AltosFlashUI.java index 18795695..5ed417da 100644 --- a/ao-tools/altosui/AltosFlashUI.java +++ b/ao-tools/altosui/AltosFlashUI.java @@ -187,7 +187,7 @@ public class AltosFlashUI build_dialog(); - debug_dongle = AltosDeviceDialog.show(frame, AltosDevice.Any); + debug_dongle = AltosDeviceDialog.show(frame, AltosDevice.product_any); if (debug_dongle == null) return; diff --git a/ao-tools/altosui/AltosTelemetryReader.java b/ao-tools/altosui/AltosTelemetryReader.java index fdedbde2..ae9682ab 100644 --- a/ao-tools/altosui/AltosTelemetryReader.java +++ b/ao-tools/altosui/AltosTelemetryReader.java @@ -41,6 +41,7 @@ public class AltosTelemetryReader extends AltosReader { public AltosTelemetryReader (FileInputStream input) { boolean saw_boost = false; + int current_tick = 0; records = new LinkedList (); @@ -51,9 +52,20 @@ public class AltosTelemetryReader extends AltosReader { break; } try { + System.out.printf("%s\n", line); AltosTelemetry record = new AltosTelemetry(line); if (record == null) break; + if (records.isEmpty()) { + current_tick = record.tick; + } else { + int tick = record.tick | (current_tick & ~ 0xffff); + if (tick < current_tick - 0x1000) + tick += 0x10000; + current_tick = tick; + record.tick = current_tick; + } + System.out.printf("\tRSSI %d tick %d\n", record.rssi, record.tick); if (!saw_boost && record.state >= Altos.ao_flight_boost) { saw_boost = true; diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 3aaeb888..edee146d 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -70,8 +70,22 @@ public class AltosUI extends JFrame { public AltosVoice voice = new AltosVoice(); + public static boolean load_library(Frame frame) { + if (!AltosDevice.load_library()) { + JOptionPane.showMessageDialog(frame, + String.format("No AltOS library in \"%s\"", + System.getProperty("java.library.path","")), + "Cannot load device access library", + JOptionPane.ERROR_MESSAGE); + return false; + } + return true; + } + public AltosUI() { + load_library(null); + String[] statusNames = { "Height (m)", "State", "RSSI (dBm)", "Speed (m/s)" }; Object[][] statusData = { { "0", "pad", "-50", "0" } }; @@ -509,7 +523,8 @@ public class AltosUI extends JFrame { } private void ConnectToDevice() { - AltosDevice device = AltosDeviceDialog.show(AltosUI.this, AltosDevice.BaseStation); + AltosDevice device = AltosDeviceDialog.show(AltosUI.this, + AltosDevice.product_basestation); if (device != null) { try { diff --git a/ao-tools/altosui/Makefile.am b/ao-tools/altosui/Makefile.am index dd4b31e6..fa391889 100644 --- a/ao-tools/altosui/Makefile.am +++ b/ao-tools/altosui/Makefile.am @@ -1,7 +1,11 @@ JAVAROOT=classes AM_JAVACFLAGS=-encoding UTF-8 -CLASSPATH_ENV=CLASSPATH=".:classes:../libaltos:$(FREETTS)/*:/usr/share/java/*" +man_MANS=altosui.1 + +altoslibdir=$(libdir)/altos + +CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH=".:classes:../libaltos:$(FREETTS)/*:/usr/share/java/*" bin_SCRIPTS=altosui @@ -88,16 +92,40 @@ MACOSX_EXTRA=$(FIRMWARE) WINDOWS_FILES=$(FAT_FILES) altos.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON) -all-local: classes/altosui $(JAR) $(FATJAR) altosui altosui-test +all-local: classes/altosui $(JAR) altosui altosui-test clean-local: - -rm -rf classes/altosui $(JAR) $(FATJAR) \ - $(LINUX_DIST) $(MACOSX_DIST) $(WINDOWS_DIST) $(FREETTS_CLASS) \ + -rm -rf classes $(JAR) $(FATJAR) \ + $(LINUX_DIST) $(MACOSX_DIST) windows $(WINDOWS_DIST) $(FREETTS_CLASS) \ $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log \ altosui altosui-test macosx linux fat: $(FATJAR) $(LINUX_DIST) $(MACOSX_DIST) $(WINDOWS_DIST) +if FATINSTALL + +FATTARGET=$(FATDIR)/$(VERSION) + +LINUX_DIST_TARGET=$(FATTARGET)/$(LINUX_DIST) +MACOSX_DIST_TARGET=$(FATTARGET)/$(MACOSX_DIST) +WINDOWS_DIST_TARGET=$(FATTARGET)/$(WINDOWS_DIST) + +fat: $(LINUX_DIST_TARGET) $(MACOSX_DIST_TARGET) $(WINDOWS_DIST_TARGET) + +$(LINUX_DIST_TARGET): $(LINUX_DIST) + mkdir -p $(FATTARGET) + cp -p $< $@ + +$(MACOSX_DIST_TARGET): $(MACOSX_DIST) + mkdir -p $(FATTARGET) + cp -p $< $@ + +$(WINDOWS_DIST_TARGET): $(WINDOWS_DIST) + mkdir -p $(FATTARGET) + cp -p $< $@ + +endif + altosuidir=$(datadir)/java install-altosuiJAVA: altosui.jar @@ -131,15 +159,23 @@ Manifest-fat.txt: altosui: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "$(FREETTS)/*" -Djava.library.path="$(libdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@ + echo 'exec java -cp "$(FREETTS)/*" -Djava.library.path="$(altoslibdir)" -jar "$(altosuidir)/altosui.jar" "$$@"' >> $@ chmod +x $@ altosui-test: Makefile echo "#!/bin/sh" > $@ - echo 'exec java -cp "$(FREETTS)/*" -Djava.library.path="../libaltos" -jar altosui.jar "$$*"' >> $@ + echo 'exec java -cp "$(FREETTS)/*" -Djava.library.path="../libaltos/.libs" -jar altosui.jar "$$@"' >> $@ chmod +x $@ -$(LIBALTOS): +libaltos.so: + -rm -f "$@" + $(LN_S) ../libaltos/.libs/"$@" . + +libaltos.dylib: + -rm -f "$@" + $(LN_S) ../libaltos/"$@" . + +altos.dll: -rm -f "$@" $(LN_S) ../libaltos/"$@" . @@ -169,4 +205,4 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) $(WINDOWS_DIST): $(WINDOWS_FILES) altos-windows.nsi -rm -f $@ - makensis -Oaltos-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" altos-windows.nsi \ No newline at end of file + makensis -Oaltos-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" altos-windows.nsi diff --git a/ao-tools/altosui/altos-windows.nsi b/ao-tools/altosui/altos-windows.nsi index 6ebec214..37777fd6 100644 --- a/ao-tools/altosui/altos-windows.nsi +++ b/ao-tools/altosui/altos-windows.nsi @@ -40,6 +40,9 @@ Section "Install Driver" InstDriver SetOutPath $TEMP File "../../telemetrum.inf" InstDrv::InstallDriver /NOUNLOAD "$TEMP\telemetrum.inf" + + SetOutPath $INSTDIR + File "../../telemetrum.inf" SectionEnd Section "AltosUI Application" diff --git a/ao-tools/altosui/altosui.1 b/ao-tools/altosui/altosui.1 index c3130fce..57fa4489 100644 --- a/ao-tools/altosui/altosui.1 +++ b/ao-tools/altosui/altosui.1 @@ -16,7 +16,7 @@ .\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. .\" .\" -.TH AO-VIEW 1 "altosui" "" +.TH ALTOSUI 1 "altosui" "" .SH NAME altosui \- Rocket flight monitor .SH SYNOPSIS @@ -24,21 +24,23 @@ altosui \- Rocket flight monitor .SH DESCRIPTION .I altosui connects to a TeleDongle or TeleMetrum device through a USB serial device. -It provides a user interface to monitor, record and review rocket flight data. +It provides a menu-oriented +user interface to monitor, record and review rocket flight data. .SH USAGE When connected to a TeleDongle device, altosui turns on the radio receiver and listens for telemetry packets. It displays the received telemetry data, and reports flight status via voice synthesis. All received telemetry information is recorded to a file. .P -When connected to a TeleMetrum device, altosui downloads the eeprom -data and stores it in a file. +When connected to a TeleMetrum device, altosui can be used to configure the +TeleMetrum, and to downloads the eeprom data and store it in a file. +.P +A number of other menu options exist, including the ability to export flight +data in different formats. .SH FILES All data log files are recorded into a user-specified directory -(default ~/AltOS). Files are named using the current date, the serial +(default ~/TeleMetrum). Files are named using the current date, the serial number of the reporting device, the flight number recorded in the data and either '.telem' for telemetry data or '.eeprom' for eeprom data. -.SH "SEE ALSO" -ao-view(1), ao-load(1), ao-eeprom(1) .SH AUTHOR Keith Packard diff --git a/ao-tools/libaltos/Makefile.am b/ao-tools/libaltos/Makefile.am index 4d29d80e..388d2104 100644 --- a/ao-tools/libaltos/Makefile.am +++ b/ao-tools/libaltos/Makefile.am @@ -1,11 +1,22 @@ JAVAC=javac -AM_CFLAGS="-I$(JVM_INCLUDE)" +AM_CFLAGS=-DLINUX -DPOSIX_TTY -I$(JVM_INCLUDE) AM_JAVACFLAGS=-encoding UTF-8 -lib_LTLIBRARIES=libaltos.la +altoslibdir=$(libdir)/altos + +altoslib_LTLIBRARIES=libaltos.la + +libaltos_la_LDFLAGS = -version-info 1:0:1 libaltos_la_SOURCES=\ - libaltos.c + libaltos.c \ + libaltos_wrap.c + +noinst_PROGRAMS=cjnitest + +cjnitest_LDADD=libaltos.la + +LIBS= HFILES=libaltos.h @@ -18,6 +29,8 @@ $(SWIG_FILE): libaltos.i0 $(HFILES) all-local: classlibaltos.stamp +libaltos_wrap.c: classlibaltos.stamp + classlibaltos.stamp: $(SWIG_FILE) swig -java -package libaltosJNI $(SWIG_FILE) mkdir -p libaltosJNI @@ -25,4 +38,4 @@ classlibaltos.stamp: $(SWIG_FILE) touch classlibaltos.stamp clean-local: - -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) \ No newline at end of file + -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) libaltos_wrap.c diff --git a/configure.ac b/configure.ac index d376af3f..4bf8f7fe 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,16 @@ if test "x$JVM_INCLUDE" = "xauto"; then AC_MSG_RESULT([$JVM_INCLUDE]) fi +AC_SUBST(JVM_INCLUDE) + +AC_ARG_WITH(fat-dir, AS_HELP_STRING([--with-fat-dir=PATH], + [Set the directory to install the 'fat' distribution files to (defaults to not installing)]), + [FATDIR=$withval], [FATDIR=none]) + +AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"]) + +AC_SUBST(FATDIR) + AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S diff --git a/debian/changelog b/debian/changelog index 2005b64f..c808c50d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,87 @@ +altos (0.7.1) unstable; urgency=low + + [ Keith Packard ] + * Add firmware and libaltos to 'fat' target at top-level + * altosui: Remove some debug printfs. + * altosui: libaltos.so is built with libtool -- it's in + ../libaltos/.libs + * Add --with-fat-dir configure option to publish finished stand-alone + bits + + -- Bdale Garbee Thu, 09 Sep 2010 22:49:54 -0600 + +altos (0.7+96+g48f5799) unstable; urgency=low + + [ Keith Packard ] + * altosui: conflating USB product and vendor IDs is a bad idea + + -- Bdale Garbee Thu, 09 Sep 2010 21:29:13 -0600 + +altos (0.7+94+g1ac3d7e) unstable; urgency=low + + * initial cut at an altosui man page + + -- Bdale Garbee Thu, 09 Sep 2010 20:34:38 -0600 + +altos (0.7+92+g0ea7576) unstable; urgency=low + + [ Bdale Garbee ] + * handle versioning of ihx files (poorly) by just wildcarding the file + name + + [ Keith Packard ] + * altosui: Need to have JVM include path substituted into libaltos + Makefile + * altosui: Store libaltos.so in $(libdir)/altos + * altosui: Display error dialog when AltOS JNI library can't be loaded + + -- Bdale Garbee Thu, 09 Sep 2010 20:05:44 -0600 + +altos (0.7+86+g6c0ae7e) unstable; urgency=low + + [ Keith Packard ] + * altosui: Add explicit requirement to create classes directory + * altosui: fix telemetrum.inf FFFE:000A product names on AMD64 and + ia64 + * altosui: hack to make JAVAROOT directory get created before javac + runs + * altosui: remove FATJAR from all-local to avoid building fat .jar + file + + [ Bdale Garbee ] + * add libtool to build deps + + [ Keith Packard ] + * altosui: Add windows installer build using 'nsis' + * altosui: ignore built files + * altosui: oops. renamed the nsis file to altos-windows.nsi + * icon: add some icons for application programs + * altosui: Add icons to application and Windows menus. + * Use autotools for altosui and libaltos + * altos: add some SDCDB config files + * Ignore libtool files. + * Add version numbers to released files. Set version to 0.7.1 + * Add top-level 'fat' target to aid building distribution files + * altosui: Fix windows installer to ship correct files + * altosui: Fix up Mac OSX .zip file + * altosui: Fix linux fat distribution + * altosui: Return AO_LOG_INVALID instead of exception for eeprom files + * altosui: Remove debugging printf from AltosEepromReader + * altosui: Eeprom files contain only one date; save it. + * altosui: Add elevation and range data to main display + * altosui: When replay thread is interrupted, don't make final report + * altosui: Start idle thread after the rocket leaves the pad + * altosui: Add AltosVoice.drain() to wait for queued speech to finish + * altosui: Prevent voice altitude data from queueing up + * altosui: Use local .class files in the classpath + * altosui: Record flight number when scanning file, not when running + * altosui: eeprom files place 'boost' time in the flight number + record. + * altosui: ensure that 'altosui' script is installed. Pass arguments + along. + + -- Bdale Garbee Thu, 09 Sep 2010 15:43:28 -0600 + altos (0.7+53+g59798c6) unstable; urgency=low [ Keith Packard ] diff --git a/debian/control b/debian/control index 690eb78f..712e00d3 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: otherosfs Priority: extra Maintainer: Bdale Garbee Uploaders: Keith Packard -Build-Depends: debhelper (>= 7), autoconf, automake, flite1-dev, gawk, libasound2-dev, libgconf2-dev, libglade2-dev, libgtk2.0-dev, libreadline-dev, libusb-1.0-0-dev, nickle, sdcc, libplplot-dev, xsltproc, fop, docbook-xml, docbook-xsl, libsndfile1-dev, swig, openjdk-6-jdk, freetts +Build-Depends: debhelper (>= 7), autoconf, automake, flite1-dev, gawk, libasound2-dev, libgconf2-dev, libglade2-dev, libgtk2.0-dev, libreadline-dev, libusb-1.0-0-dev, nickle, sdcc, libplplot-dev, xsltproc, fop, docbook-xml, docbook-xsl, libsndfile1-dev, swig, openjdk-6-jdk, freetts, libtool Standards-Version: 3.9.1 Homepage: http://altusmetrum.org/AltOS diff --git a/telemetrum.inf b/telemetrum.inf index 0a81084b..0d1a5534 100755 --- a/telemetrum.inf +++ b/telemetrum.inf @@ -6,7 +6,7 @@ Signature = "$Windows NT$" Class = Modem ClassGUID ={4D36E96D-E325-11CE-BFC1-08002BE10318} Provider = %Mfg% -DriverVer = 08/05/2010,3.1.0.41 +DriverVer = 08/05/2010,7.1.0.0 [Manufacturer] %Mfg% = Models, NTx86, NTamd64, NTia64 @@ -18,13 +18,13 @@ DriverVer = 08/05/2010,3.1.0.41 %TeleTerra% = TELEMETRUM, USB\VID_FFFE&PID_000D [Models.NTamd64] -%TeleMetrum% = TELEMETRUM, USB\VID_FFFE&PID_000A +%AltusMetrum% = TELEMETRUM, USB\VID_FFFE&PID_000A %TeleMetrum% = TELEMETRUM, USB\VID_FFFE&PID_000B %TeleDongle% = TELEMETRUM, USB\VID_FFFE&PID_000C %TeleTerra% = TELEMETRUM, USB\VID_FFFE&PID_000D [Models.NTia64] -%TeleMetrum% = TELEMETRUM, USB\VID_FFFE&PID_000A +%AltusMetrum% = TELEMETRUM, USB\VID_FFFE&PID_000A %TeleMetrum% = TELEMETRUM, USB\VID_FFFE&PID_000B %TeleDongle% = TELEMETRUM, USB\VID_FFFE&PID_000C %TeleTerra% = TELEMETRUM, USB\VID_FFFE&PID_000D @@ -40,7 +40,7 @@ ExcludeFromSelect=USB\VID_FFFE&PID_000D [Strings] Mfg = "altusmetrum.org" -AltusMetrum = "Unknown AltusMetrum Device" +AltusMetrum = "AltusMetrum" TeleMetrum = "TeleMetrum" TeleDongle = "TeleDongle" TeleTerra = "TeleTerra"