From: Keith Packard Date: Thu, 29 Jul 2010 19:07:49 +0000 (-0700) Subject: Merge remote branch 'origin/master' X-Git-Tag: debian/0.6+290+g7877496~1 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=7877496d47ce6d25210c0e1c6500666dbfc0876c;hp=4cf39b13a574cb656999cf329f5b08e7f910604b Merge remote branch 'origin/master' --- diff --git a/ao-tools/altosui/AltOS Package Configuration.pmdoc/01altosui-contents.xml b/ao-tools/altosui/AltOS Package Configuration.pmdoc/01altosui-contents.xml new file mode 100644 index 00000000..18e00fe4 --- /dev/null +++ b/ao-tools/altosui/AltOS Package Configuration.pmdoc/01altosui-contents.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ao-tools/altosui/AltOS Package Configuration.pmdoc/01altosui.xml b/ao-tools/altosui/AltOS Package Configuration.pmdoc/01altosui.xml new file mode 100644 index 00000000..6170931b --- /dev/null +++ b/ao-tools/altosui/AltOS Package Configuration.pmdoc/01altosui.xml @@ -0,0 +1 @@ +org.altusmetrum.altosUi.AltosUI.pkg0.7AltosUI.app/Applications/AltosUI.appinstallTo.pathinstallFrom.isRelativeTypeversionparentrequireAuthorizationinstallTo01altosui-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/ao-tools/altosui/AltOS Package Configuration.pmdoc/index.xml b/ao-tools/altosui/AltOS Package Configuration.pmdoc/index.xml new file mode 100644 index 00000000..fabe54a6 --- /dev/null +++ b/ao-tools/altosui/AltOS Package Configuration.pmdoc/index.xml @@ -0,0 +1 @@ +AltOS UI/Users/keithp/altos/ao-tools/altosui/AltosUI.pkgorg.altusmetrumInstall AltOS User Interfacealtusmetrum.jpg01altosui.xmlproperties.anywhereDomainproperties.titleproperties.customizeOptiondescriptionproperties.userDomainproperties.systemDomain \ No newline at end of file diff --git a/ao-tools/altosui/AltosDeviceDialog.java b/ao-tools/altosui/AltosDeviceDialog.java index 536a8057..c60bd7c3 100644 --- a/ao-tools/altosui/AltosDeviceDialog.java +++ b/ao-tools/altosui/AltosDeviceDialog.java @@ -152,10 +152,8 @@ public class AltosDeviceDialog extends JDialog implements ActionListener { //Handle clicks on the Set and Cancel buttons. public void actionPerformed(ActionEvent e) { - if ("select".equals(e.getActionCommand())) { - System.out.printf("got select action\n"); + if ("select".equals(e.getActionCommand())) AltosDeviceDialog.value = (altos_device)(list.getSelectedValue()); - } AltosDeviceDialog.dialog.setVisible(false); } diff --git a/ao-tools/altosui/AltosEeprom.java b/ao-tools/altosui/AltosEeprom.java index 6162521f..4c537a89 100644 --- a/ao-tools/altosui/AltosEeprom.java +++ b/ao-tools/altosui/AltosEeprom.java @@ -199,9 +199,9 @@ public class AltosEeprom implements Runnable { if (eeprom_file == null) { if (serial != 0 && flight != 0 && want_file) { if (year != 0 && month != 0 && day != 0) - eeprom_name = new AltosFile(year, month, day, serial, flight, "eeprom-new"); + eeprom_name = new AltosFile(year, month, day, serial, flight, "eeprom"); else - eeprom_name = new AltosFile(serial, flight, "eeprom-new"); + eeprom_name = new AltosFile(serial, flight, "eeprom"); monitor.set_file(eeprom_name.getName()); eeprom_file = new FileWriter(eeprom_name); @@ -229,7 +229,7 @@ public class AltosEeprom implements Runnable { done = true; } if (eeprom_file == null) { - eeprom_name = new AltosFile(serial,flight,"eeprom-new"); + eeprom_name = new AltosFile(serial,flight,"eeprom"); eeprom_file = new FileWriter(eeprom_name); if (eeprom_file != null) { FlushPending(eeprom_file, eeprom_pending); diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index a5566ab8..efa63f68 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -104,10 +104,8 @@ public class AltosSerial implements Runnable { } public void close() { - if (altos != null) { + if (altos != null) libaltos.altos_close(altos); - altos = null; - } if (input_thread != null) { try { input_thread.interrupt(); @@ -116,6 +114,10 @@ public class AltosSerial implements Runnable { } input_thread = null; } + if (altos != null) { + libaltos.altos_free(altos); + altos = null; + } } public void putc(char c) { diff --git a/ao-tools/altosui/AltosUI.app/Contents/Info.plist b/ao-tools/altosui/AltosUI.app/Contents/Info.plist new file mode 100644 index 00000000..97b1b59c --- /dev/null +++ b/ao-tools/altosui/AltosUI.app/Contents/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleName + altosui + CFBundleVersion + 100.0 + CFBundleAllowMixedLocalizations + true + CFBundleExecutable + JavaApplicationStub + CFBundleDevelopmentRegion + English + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleGetInfoString + AltOS UI version 0.7 + CFBundleInfoDictionaryVersion + 6.0 + CFBundleIconFile + AltosUIIcon.icns + Java + + MainClass + altosui.AltosUI + JVMVersion + 1.5+ + ClassPath + + $JAVAROOT/altosui.jar + $JAVAROOT/freetts.jar + + + + diff --git a/ao-tools/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub b/ao-tools/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub new file mode 100755 index 00000000..c661d3e1 Binary files /dev/null and b/ao-tools/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub differ diff --git a/ao-tools/altosui/AltosUI.app/Contents/PkgInfo b/ao-tools/altosui/AltosUI.app/Contents/PkgInfo new file mode 100644 index 00000000..8a43480f --- /dev/null +++ b/ao-tools/altosui/AltosUI.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPLAM.O diff --git a/ao-tools/altosui/AltosUI.app/Contents/Resources/AltosUIIcon.icns b/ao-tools/altosui/AltosUI.app/Contents/Resources/AltosUIIcon.icns new file mode 100644 index 00000000..fe49f362 Binary files /dev/null and b/ao-tools/altosui/AltosUI.app/Contents/Resources/AltosUIIcon.icns differ diff --git a/ao-tools/altosui/AltosUIIcon.icns b/ao-tools/altosui/AltosUIIcon.icns deleted file mode 100644 index fe49f362..00000000 Binary files a/ao-tools/altosui/AltosUIIcon.icns and /dev/null differ diff --git a/ao-tools/altosui/Makefile b/ao-tools/altosui/Makefile index 2c284aaa..790aecda 100644 --- a/ao-tools/altosui/Makefile +++ b/ao-tools/altosui/Makefile @@ -29,13 +29,21 @@ FREETTSJAR= \ cmutimelex.jar \ cmu_us_kal.jar \ en_us.jar \ - freetts.jar \ - freetts-jsapi10.jar \ - jsapi.jar + freetts.jar JAVAFLAGS=-Xlint:unchecked -all: altosui.jar +OS:=$(shell uname) + +ifeq ($(OS),Linux) +ALTOSUI_APP=altosui +endif + +ifeq ($(OS),Darwin) +ALTOSUI_APP=AltosUI.app/Contents/Resources/Java/altosui.jar +endif + +all: altosui.jar $(ALTOSUI_APP) $(CLASSFILES): @@ -56,6 +64,23 @@ classes/libaltosJNI: $(FREETTSJAR): ln -s $(FREETTSLIB)/$@ . +ifeq ($(OS),Darwin) +RESOURCES=altosui.jar $(FREETTSJAR) ../libaltos/libaltos.dylib + +$(ALTOSUI_APP): $(RESOURCES) + mkdir -p AltosUI.app/Contents/Resources/Java + cp $(RESOURCES) AltosUI.app/Contents/Resources/Java + +endif + +ifeq ($(OS),Linux) +altosui: + echo "#!/bin/sh" > $@ + echo "exec java -Djava.library.path=../libaltos -jar altosui.jar" >> $@ + chmod +x ./altosui +endif + clean: rm -f *.class $(FREETTSJAR) altosui.jar + rm -f AltosUI.app/Contents/Resources/Java/* rm -rf classes diff --git a/ao-tools/altosui/altusmetrum.jpg b/ao-tools/altosui/altusmetrum.jpg new file mode 100644 index 00000000..04027921 Binary files /dev/null and b/ao-tools/altosui/altusmetrum.jpg differ diff --git a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml b/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml deleted file mode 100644 index e19a1e4c..00000000 --- a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml b/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml deleted file mode 100644 index 5d84e5f0..00000000 --- a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml +++ /dev/null @@ -1 +0,0 @@ -org.altusmetrum.altosUi.AltosUI.pkg1.0/Users/keithp/AltosUI.app/Applications/AltosUI.appinstallTo.pathparentrequireAuthorizationinstallTo01altosui-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml b/ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml deleted file mode 100644 index 1277db62..00000000 --- a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml +++ /dev/null @@ -1 +0,0 @@ -AltOS UI/Users/keithp/Documents/AltosUI.pkgorg.altusmetrum01altosui.xmlproperties.title \ No newline at end of file diff --git a/ao-tools/libaltos/Makefile b/ao-tools/libaltos/Makefile index 0bbd304c..fa5127eb 100644 --- a/ao-tools/libaltos/Makefile +++ b/ao-tools/libaltos/Makefile @@ -51,7 +51,7 @@ JAVAFLAGS=-Xlint:unchecked all: libaltos.$(LIBEXT) cjnitest $(CLASSFILES) .java.class: - javac -cp "$(CLASSPATH)" $(JAVAFLAGS) $*.java + javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java CFLAGS=$(OS_CFLAGS) -O0 -g -I. diff --git a/ao-tools/libaltos/libaltos.c b/ao-tools/libaltos/libaltos.c index df0d5b2e..00fb2125 100644 --- a/ao-tools/libaltos/libaltos.c +++ b/ao-tools/libaltos/libaltos.c @@ -567,6 +567,14 @@ void altos_close(struct altos_file *file) { close(file->fd); + file->fd = -1; +} + +void +altos_free(struct altos_file *file) +{ + if (file->fd != -1) + close(file->fd); free(file); } @@ -592,6 +600,8 @@ altos_flush(struct altos_file *file) while (file->out_used) { int ret; + if (file->fd < 0) + return -EBADF; ret = write (file->fd, file->out_data, file->out_used); if (ret < 0) return -errno; @@ -610,6 +620,8 @@ altos_getchar(struct altos_file *file, int timeout) int ret; altos_flush(file); + if (file->fd < 0) + return -EBADF; ret = read(file->fd, file->in_data, USB_BUF_SIZE); if (ret < 0) return -errno; diff --git a/ao-tools/libaltos/libaltos.h b/ao-tools/libaltos/libaltos.h index 782f244e..53026e0a 100644 --- a/ao-tools/libaltos/libaltos.h +++ b/ao-tools/libaltos/libaltos.h @@ -42,6 +42,8 @@ altos_open(struct altos_device *device); void altos_close(struct altos_file *file); +void altos_free(struct altos_file *file); + int altos_putchar(struct altos_file *file, char c);