--- /dev/null
+<pkg-contents spec="1.12"><f n="AltosUI.app" o="keithp" g="keithp" p="16877" pt="/Users/keithp/altos/ao-tools/altosui/AltosUI.app" m="false" t="file"><f n="Contents" o="keithp" g="keithp" p="16877"><f n="Info.plist" o="keithp" g="keithp" p="33188"/><f n="MacOS" o="keithp" g="keithp" p="16877"><f n="JavaApplicationStub" o="keithp" g="keithp" p="33133"/></f><f n="PkgInfo" o="keithp" g="keithp" p="33188"/><f n="Resources" o="keithp" g="keithp" p="16877"><f n="AltosUIIcon.icns" o="keithp" g="keithp" p="33188"/><f n="Java" o="keithp" g="keithp" p="16877"/></f></f></f></pkg-contents>
\ No newline at end of file
--- /dev/null
+<pkgref spec="1.12" uuid="C5762664-2F26-4536-94C4-56F0FBC08D1A"><config><identifier>org.altusmetrum.altosUi.AltosUI.pkg</identifier><version>0.7</version><description></description><post-install type="none"/><installFrom relative="true" mod="true">AltosUI.app</installFrom><installTo mod="true" relocatable="true">/Applications/AltosUI.app</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>installFrom.isRelativeType</mod><mod>version</mod><mod>parent</mod><mod>requireAuthorization</mod><mod>installTo</mod></config><contents><file-list>01altosui-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file
--- /dev/null
+<pkmkdoc spec="1.12"><properties><title>AltOS UI</title><build>/Users/keithp/altos/ao-tools/altosui/AltosUI.pkg</build><organization>org.altusmetrum</organization><userSees ui="both"/><min-target os="3"/><domain system="true" user="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Install AltOS User Interface</description><contents><choice title="AltosUI" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.altusmetrum.altosUi.AltosUI.pkg"/></choice></contents><resources bg-scale="tofit" bg-align="center"><locale lang="en"><resource relative="true" mod="true" type="background">altusmetrum.jpg</resource></locale></resources><flags/><item type="file">01altosui.xml</item><mod>properties.anywhereDomain</mod><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>description</mod><mod>properties.userDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
\ No newline at end of file
//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);
}
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);
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);
}
public void close() {
- if (altos != null) {
+ if (altos != null)
libaltos.altos_close(altos);
- altos = null;
- }
if (input_thread != null) {
try {
input_thread.interrupt();
}
input_thread = null;
}
+ if (altos != null) {
+ libaltos.altos_free(altos);
+ altos = null;
+ }
}
public void putc(char c) {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+ <key>CFBundleName</key>
+ <string>altosui</string>
+ <key>CFBundleVersion</key>
+ <string>100.0</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <string>true</string>
+ <key>CFBundleExecutable</key>
+ <string>JavaApplicationStub</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleGetInfoString</key>
+ <string>AltOS UI version 0.7</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleIconFile</key>
+ <string>AltosUIIcon.icns</string>
+ <key>Java</key>
+ <dict>
+ <key>MainClass</key>
+ <string>altosui.AltosUI</string>
+ <key>JVMVersion</key>
+ <string>1.5+</string>
+ <key>ClassPath</key>
+ <array>
+ <string>$JAVAROOT/altosui.jar</string>
+ <string>$JAVAROOT/freetts.jar</string>
+ </array>
+ </dict>
+</dict>
+</plist>
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):
$(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
+++ /dev/null
-<pkg-contents spec="1.12"><f n="AltosUI.app" o="keithp" g="keithp" p="16877" pt="/Users/keithp/AltosUI.app" m="false" t="file"><f n="Contents" o="keithp" g="keithp" p="16877"><f n="Info.plist" o="keithp" g="keithp" p="33188"/><f n="MacOS" o="keithp" g="keithp" p="16877"><f n="JavaApplicationStub" o="keithp" g="keithp" p="33133"/></f><f n="PkgInfo" o="keithp" g="keithp" p="33188"/><f n="Resources" o="keithp" g="keithp" p="16877"><f n="AltosUIIcon.icns" o="keithp" g="keithp" p="33188"/><f n="Java" o="keithp" g="keithp" p="16877"><f n="altosui.jar" o="keithp" g="keithp" p="33188"/><f n="cmu_time_awb.jar" o="keithp" g="keithp" p="33188"/><f n="cmu_us_kal.jar" o="keithp" g="keithp" p="33188"/><f n="cmudict04.jar" o="keithp" g="keithp" p="33188"/><f n="cmulex.jar" o="keithp" g="keithp" p="33188"/><f n="cmutimelex.jar" o="keithp" g="keithp" p="33188"/><f n="en_us.jar" o="keithp" g="keithp" p="33188"/><f n="freetts-jsapi10.jar" o="keithp" g="keithp" p="33188"/><f n="freetts.jar" o="keithp" g="keithp" p="33188"/><f n="libaltos.dylib" o="keithp" g="keithp" p="33188"/></f></f></f></f></pkg-contents>
\ No newline at end of file
+++ /dev/null
-<pkgref spec="1.12" uuid="C5762664-2F26-4536-94C4-56F0FBC08D1A"><config><identifier>org.altusmetrum.altosUi.AltosUI.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><installFrom>/Users/keithp/AltosUI.app</installFrom><installTo mod="true" relocatable="true">/Applications/AltosUI.app</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>parent</mod><mod>requireAuthorization</mod><mod>installTo</mod></config><contents><file-list>01altosui-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file
+++ /dev/null
-<pkmkdoc spec="1.12"><properties><title>AltOS UI</title><build>/Users/keithp/Documents/AltosUI.pkg</build><organization>org.altusmetrum</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="AltosUI" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.altusmetrum.altosUi.AltosUI.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01altosui.xml</item><mod>properties.title</mod></pkmkdoc>
\ No newline at end of file
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.
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);
}
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;
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;
void altos_close(struct altos_file *file);
+void altos_free(struct altos_file *file);
+
int
altos_putchar(struct altos_file *file, char c);