Merge branch 'master' into branch-1.8
authorBdale Garbee <bdale@gag.com>
Mon, 8 Oct 2018 23:49:47 +0000 (17:49 -0600)
committerBdale Garbee <bdale@gag.com>
Mon, 8 Oct 2018 23:49:47 +0000 (17:49 -0600)
364 files changed:
Makefile.am
Releasing
altosdroid/res/layout/map_preload.xml
altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java
altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java
altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java
altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java
altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java
altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java
altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java
altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java
altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java
altoslib/AltosAccel.java
altoslib/AltosAccelCal.java
altoslib/AltosAccelCalListener.java
altoslib/AltosCRCException.java
altoslib/AltosCSV.java
altoslib/AltosCalData.java
altoslib/AltosCompanion.java
altoslib/AltosConfigData.java
altoslib/AltosConfigDataException.java
altoslib/AltosConfigValues.java
altoslib/AltosConvert.java
altoslib/AltosDataListener.java
altoslib/AltosDataProvider.java
altoslib/AltosDebug.java
altoslib/AltosDistance.java
altoslib/AltosEeprom.java
altoslib/AltosEepromChunk.java
altoslib/AltosEepromDownload.java
altoslib/AltosEepromFile.java
altoslib/AltosEepromList.java
altoslib/AltosEepromLog.java
altoslib/AltosEepromMonitor.java
altoslib/AltosEepromRecord.java
altoslib/AltosEepromRecordFireTwo.java
altoslib/AltosEepromRecordFull.java
altoslib/AltosEepromRecordGps.java
altoslib/AltosEepromRecordMega.java
altoslib/AltosEepromRecordMetrum.java
altoslib/AltosEepromRecordMini.java
altoslib/AltosEepromRecordSet.java
altoslib/AltosEepromRecordTiny.java
altoslib/AltosFile.java
altoslib/AltosFilterListener.java
altoslib/AltosFlash.java
altoslib/AltosFlashListener.java
altoslib/AltosFlightDisplay.java
altoslib/AltosFlightReader.java
altoslib/AltosFlightSeries.java
altoslib/AltosFlightStats.java
altoslib/AltosFontListener.java
altoslib/AltosForce.java
altoslib/AltosFrequency.java
altoslib/AltosGPS.java
altoslib/AltosGPSSat.java
altoslib/AltosGPSTimeValue.java
altoslib/AltosGreatCircle.java
altoslib/AltosHeight.java
altoslib/AltosHexfile.java
altoslib/AltosHexsym.java
altoslib/AltosIMU.java
altoslib/AltosIdle.java
altoslib/AltosIdleFetch.java
altoslib/AltosIdleMonitor.java
altoslib/AltosIdleMonitorListener.java
altoslib/AltosIdleReader.java
altoslib/AltosIgnite.java
altoslib/AltosImage.java
altoslib/AltosJson.java
altoslib/AltosKML.java
altoslib/AltosLatLon.java
altoslib/AltosLatitude.java
altoslib/AltosLaunchSite.java
altoslib/AltosLaunchSiteListener.java
altoslib/AltosLaunchSites.java
altoslib/AltosLib.java
altoslib/AltosLine.java
altoslib/AltosLink.java
altoslib/AltosListenerState.java
altoslib/AltosLocation.java
altoslib/AltosLog.java
altoslib/AltosLongitude.java
altoslib/AltosMag.java
altoslib/AltosMap.java
altoslib/AltosMapCache.java
altoslib/AltosMapCacheListener.java
altoslib/AltosMapInterface.java
altoslib/AltosMapLine.java
altoslib/AltosMapLoader.java
altoslib/AltosMapLoaderListener.java
altoslib/AltosMapMark.java
altoslib/AltosMapPath.java
altoslib/AltosMapPathPoint.java
altoslib/AltosMapRectangle.java
altoslib/AltosMapStore.java
altoslib/AltosMapStoreListener.java
altoslib/AltosMapTile.java
altoslib/AltosMapTileListener.java
altoslib/AltosMapTransform.java
altoslib/AltosMapTypeListener.java
altoslib/AltosMapZoomListener.java
altoslib/AltosMma655x.java
altoslib/AltosMs5607.java
altoslib/AltosNoSymbol.java
altoslib/AltosOrient.java
altoslib/AltosParse.java
altoslib/AltosPointDouble.java
altoslib/AltosPointInt.java
altoslib/AltosPreferences.java
altoslib/AltosPreferencesBackend.java
altoslib/AltosPresTemp.java
altoslib/AltosPressure.java
altoslib/AltosProgrammer.java
altoslib/AltosPyro.java
altoslib/AltosPyroName.java
altoslib/AltosQuaternion.java
altoslib/AltosRecordSet.java
altoslib/AltosRectangle.java
altoslib/AltosReplayReader.java
altoslib/AltosRomconfig.java
altoslib/AltosRotation.java
altoslib/AltosRotationRate.java
altoslib/AltosSavedState.java
altoslib/AltosSelfFlash.java
altoslib/AltosSensorEMini.java
altoslib/AltosSensorMM.java
altoslib/AltosSensorMega.java
altoslib/AltosSensorMetrum.java
altoslib/AltosSensorTGPS.java
altoslib/AltosSensorTM.java
altoslib/AltosSensorTMini2.java
altoslib/AltosSensorTMini3.java
altoslib/AltosSpeed.java
altoslib/AltosState.java
altoslib/AltosStateName.java
altoslib/AltosStringInputStream.java
altoslib/AltosTelemetry.java
altoslib/AltosTelemetryCompanion.java
altoslib/AltosTelemetryConfiguration.java
altoslib/AltosTelemetryFile.java
altoslib/AltosTelemetryIterable.java
altoslib/AltosTelemetryLegacy.java
altoslib/AltosTelemetryLocation.java
altoslib/AltosTelemetryMap.java
altoslib/AltosTelemetryMegaData.java
altoslib/AltosTelemetryMegaSensor.java
altoslib/AltosTelemetryMetrumData.java
altoslib/AltosTelemetryMetrumSensor.java
altoslib/AltosTelemetryMini2.java
altoslib/AltosTelemetryMini3.java
altoslib/AltosTelemetryRaw.java
altoslib/AltosTelemetryReader.java
altoslib/AltosTelemetrySatellite.java
altoslib/AltosTelemetrySensor.java
altoslib/AltosTelemetryStandard.java
altoslib/AltosTemperature.java
altoslib/AltosTime.java
altoslib/AltosTimeSeries.java
altoslib/AltosTimeValue.java
altoslib/AltosUnitInfo.java [new file with mode: 0644]
altoslib/AltosUnitInfoListener.java [new file with mode: 0644]
altoslib/AltosUnits.java
altoslib/AltosUnitsListener.java
altoslib/AltosUnitsRange.java
altoslib/AltosUnknownProduct.java
altoslib/AltosUsbId.java
altoslib/AltosVersion.java.in
altoslib/AltosVoltage.java
altoslib/AltosWriter.java
altoslib/Makefile.am
altosui/Altos.java
altosui/AltosAscent.java
altosui/AltosCompanionInfo.java
altosui/AltosConfigFC.java
altosui/AltosConfigFCUI.java
altosui/AltosConfigPyroUI.java
altosui/AltosConfigTD.java
altosui/AltosConfigTDUI.java
altosui/AltosConfigureUI.java
altosui/AltosDescent.java
altosui/AltosFlightStatus.java
altosui/AltosFlightStatusTableModel.java
altosui/AltosFlightStatusUpdate.java
altosui/AltosFlightUI.java
altosui/AltosGraphUI.java
altosui/AltosIdleMonitorUI.java
altosui/AltosIgniteUI.java
altosui/AltosIgnitor.java
altosui/AltosLanded.java
altosui/AltosLaunch.java
altosui/AltosLaunchUI.java
altosui/AltosPad.java
altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub
altosui/AltosUI.java
altosui/Makefile.am
altosui/ReadMe-Mac.rtf
altosui/altos-windows.nsi.in
altosui/install-macosx [new file with mode: 0755]
altosuilib/AltosBTDevice.java
altosuilib/AltosBTDeviceIterator.java
altosuilib/AltosBTKnown.java
altosuilib/AltosBTManage.java
altosuilib/AltosCSVUI.java
altosuilib/AltosConfigFreqUI.java
altosuilib/AltosDataChooser.java
altosuilib/AltosDevice.java
altosuilib/AltosDeviceDialog.java
altosuilib/AltosDeviceUIDialog.java
altosuilib/AltosDisplayThread.java
altosuilib/AltosEepromDelete.java
altosuilib/AltosEepromGrapher.java
altosuilib/AltosEepromManage.java
altosuilib/AltosEepromMonitorUI.java
altosuilib/AltosEepromSelect.java
altosuilib/AltosFlashUI.java
altosuilib/AltosFlightInfoTableModel.java
altosuilib/AltosFlightStatsTable.java
altosuilib/AltosGraph.java
altosuilib/AltosInfoTable.java
altosuilib/AltosLed.java
altosuilib/AltosLights.java
altosuilib/AltosPositionListener.java
altosuilib/AltosRomconfigUI.java
altosuilib/AltosScanUI.java
altosuilib/AltosSerial.java
altosuilib/AltosSerialInUseException.java
altosuilib/AltosShapeListener.java
altosuilib/AltosUIAccelCal.java
altosuilib/AltosUIAxis.java
altosuilib/AltosUIConfigure.java
altosuilib/AltosUIDataMissing.java
altosuilib/AltosUIDataPoint.java
altosuilib/AltosUIDataSet.java
altosuilib/AltosUIDialog.java
altosuilib/AltosUIEnable.java
altosuilib/AltosUIFlightSeries.java
altosuilib/AltosUIFlightTab.java
altosuilib/AltosUIFrame.java
altosuilib/AltosUIFreqList.java
altosuilib/AltosUIGraph.java
altosuilib/AltosUIGrapher.java
altosuilib/AltosUIImage.java
altosuilib/AltosUIIndicator.java
altosuilib/AltosUILib.java
altosuilib/AltosUILineStyle.java
altosuilib/AltosUIListener.java
altosuilib/AltosUIMap.java
altosuilib/AltosUIMapPreload.java
altosuilib/AltosUIMarker.java
altosuilib/AltosUIPreferences.java
altosuilib/AltosUIPreferencesBackend.java
altosuilib/AltosUIRateList.java
altosuilib/AltosUITelemetryList.java
altosuilib/AltosUITimeSeries.java
altosuilib/AltosUIUnitsIndicator.java
altosuilib/AltosUIVoltageIndicator.java
altosuilib/AltosUSBDevice.java
altosuilib/AltosVoice.java
altosuilib/GrabNDrag.java [deleted file]
altosuilib/Makefile.am
altosuilib/OSXAdapter.java
ao-bringup/fix-telebt [new file with mode: 0755]
ao-tools/ao-cal-freq/ao-cal-freq.1
ao-tools/ao-cal-freq/ao-cal-freq.c
ao-tools/ao-flash/Makefile.am
ao-tools/ao-flash/ao-reset-lpc [new file with mode: 0755]
ao-tools/ao-flash/ao-reset-lpc.1 [new file with mode: 0644]
configure.ac
doc/.gitignore
doc/Makefile [deleted file]
doc/Makefile.am [new file with mode: 0644]
doc/RELNOTES
doc/altusmetrum-docinfo.xml
doc/map-loading.dot [new file with mode: 0644]
doc/map-loading.txt [new file with mode: 0644]
doc/micropeak-docinfo.xml
doc/release-notes-1.8.7.inc [new file with mode: 0644]
doc/release-notes.inc
doc/specs.inc
doc/telegps-docinfo.xml
doc/telemini.inc
doc/usage.inc
map-server/Makefile.am [new file with mode: 0644]
map-server/altos-map/.gitignore [new file with mode: 0644]
map-server/altos-map/Makefile.am [new file with mode: 0644]
map-server/altos-map/altos-map-fake [new file with mode: 0755]
map-server/altos-map/altos-map.c [new file with mode: 0644]
map-server/altos-mapd/.gitignore [new file with mode: 0644]
map-server/altos-mapd/AltosMapd.java [new file with mode: 0644]
map-server/altos-mapd/AltosMapdClient.java [new file with mode: 0644]
map-server/altos-mapd/AltosMapdPreferences.java [new file with mode: 0644]
map-server/altos-mapd/AltosMapdServer.java [new file with mode: 0644]
map-server/altos-mapd/Makefile.am [new file with mode: 0644]
map-server/altos-mapd/Manifest.txt [new file with mode: 0644]
map-server/altos-mapd/altos-mapd-default [new file with mode: 0644]
map-server/altos-mapd/altos-mapd.service [new file with mode: 0644]
map-server/altos-mapj/.gitignore [new file with mode: 0644]
map-server/altos-mapj/AltosMap.java [new file with mode: 0644]
map-server/altos-mapj/Makefile.am [new file with mode: 0644]
map-server/altos-mapj/Manifest.txt [new file with mode: 0644]
map-server/altos-mapj/altos-mapj-fake [new file with mode: 0755]
micropeak/Makefile.am
micropeak/MicroData.java
micropeak/MicroDeviceDialog.java
micropeak/MicroDownload.java
micropeak/MicroExport.java
micropeak/MicroFile.java
micropeak/MicroFileChooser.java
micropeak/MicroFrame.java
micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub
micropeak/MicroPeak.java
micropeak/MicroRaw.java
micropeak/MicroSave.java
micropeak/MicroSerial.java
micropeak/MicroSerialLog.java
micropeak/MicroUSB.java
micropeak/ReadMe-Mac.rtf
src/Makefile
src/drivers/ao_mma655x.c
src/drivers/ao_ms5607.c
src/fox1ihu/flash-loader/ao_pins.h
src/kernel/ao.h
src/kernel/ao_config.c
src/kernel/ao_log.c
src/kernel/ao_log.h
src/kernel/ao_log_big.c
src/kernel/ao_log_gps.c
src/kernel/ao_log_mega.c
src/kernel/ao_log_metrum.c
src/kernel/ao_log_mini.c
src/lpc/ao_serial_lpc.c
src/stm/ao_timer.c
src/stmf0/ao_serial_stm.c
telegps/Makefile.am
telegps/ReadMe-Mac.rtf
telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub
telegps/TeleGPS.java
telegps/TeleGPSConfig.java
telegps/TeleGPSConfigUI.java
telegps/TeleGPSDisplayThread.java
telegps/TeleGPSGraphUI.java
telegps/TeleGPSInfo.java
telegps/TeleGPSPreferences.java
telegps/TeleGPSState.java
telegps/TeleGPSStatus.java
telegps/TeleGPSStatusUpdate.java

index 4f47417eccf00c9bc5846d97a4847339ab366664..89fdd6c9ce8e9290aa320cd489971877a5610427 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS=ao-tools src doc icon altoslib libaltos altosuilib altosui micropeak ao-utils altosdroid telegps
+SUBDIRS=ao-tools src doc icon altoslib libaltos altosuilib altosui micropeak ao-utils altosdroid telegps map-server
 
 EXTRA_DIST = ChangeLog
 
index 7908a064e03c8fbdc24426cdd386d86da1593e83..a20b6dc084e0d461eafb68422e0917ca6bdc48ac 100644 (file)
--- a/Releasing
+++ b/Releasing
@@ -17,6 +17,8 @@ These are Keith's notes on how to do a release
 
        - update the version and date in configure.ac if Bdale hasn't already
 
+       - follow instructions in doc/RELNOTES
+
        - make sure there is a doc/release-notes-<version>.inc
 
        - make sure doc/release-notes.inc points at that
@@ -32,6 +34,14 @@ These are Bdale's notes on how to do a release.
        - make sure build environment is up to date
                sudo cowbuilder --update
 
+       - ensure i386 build support is available, and we have tools to build
+         installers for Windows and Mac OS X
+
+               sudo dpkg --add-architecture i386
+               sudo apt update
+               sudo apt install gcc-multilib genisoimage nsis
+               (need some mingw packages too, but not sure which offhand)
+
        - make sure ~/web/altusmetrum has no pending pullable commits
 
        git checkout master
@@ -91,7 +101,7 @@ These are Bdale's notes on how to do a release.
        - 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
+       make distclean  (just to be sure, this should do nothing)
 
        ./autogen.sh --enable-multi-arch \
                --with-fat-dir=/home/bdale/web/altusmetrum/
@@ -99,7 +109,7 @@ These are Bdale's notes on how to do a release.
 
        - store a stable copy of ARM binaries for production use
 
-       cp src/chaoskey-v1.0/{*.elf,*.ihx} \
+       cp src/chaoskey-v1.0/{*.elf,*.ihx,*.bin} \
           src/easymega-v1.0/{*.elf,*.ihx} \
           src/easymini-v1.0/{*.elf,*.ihx} \
           src/easymini-v2.0/{*.elf,*.ihx} \
@@ -113,6 +123,8 @@ These are Bdale's notes on how to do a release.
           src/telemega-v3.0/{*.elf,*.ihx} \
           src/telemetrum-v2.0/{*.elf,*.ihx} \
           src/telemini-v3.0/{*.elf,*.ihx} \
+          src/telelco-v2.0/{*.elf,*.ihx} \
+          src/telefireeight-v1.0/{*.elf,*.ihx} \
           ~/altusmetrumllc/Binaries/
        cp src/chaoskey-v1.0/flash-loader/{*.elf,*.bin} \
           src/easymega-v1.0/flash-loader/*.elf \
@@ -128,6 +140,8 @@ These are Bdale's notes on how to do a release.
           src/telemega-v3.0/flash-loader/*.elf \
           src/telemetrum-v2.0/flash-loader/*.elf \
           src/telemini-v3.0/flash-loader/{*.elf,*.bin} \
+          src/telelco-v2.0/flash-loader/*.elf \
+          src/telefireeight-v1.0/flash-loader/*.elf \
           ~/altusmetrumllc/Binaries/loaders/
        (cd ~/altusmetrumllc ; git add Binaries ; git commit -a) 
        - remove previous versions (only keep latest release)
index 321e5ee3f824c22f603b3f67ed06c1d6392af192..4e60df2df4324ae9948c01f2a00bbb57c1f9c367 100644 (file)
@@ -62,6 +62,7 @@
                android:layout_height="wrap_content"
                android:text="@string/preload_types"
                />
+<!--
       <CheckBox android:id="@+id/preload_hybrid"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
@@ -82,6 +83,7 @@
                android:layout_height="wrap_content"
                android:text="@string/preload_terrain"
                />
+-->
       <TextView android:id="@+id/preload_min_zoom_label"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
index 359b58321ed11995d805cc5a583aa539fd9d890c..0d09abd88051fba1ebe631613849d15ad6f38f59 100644 (file)
@@ -31,7 +31,7 @@ import android.bluetooth.BluetoothSocket;
 import android.os.Handler;
 //import android.os.Message;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosBluetooth extends AltosDroidLink {
 
index 5906ff985625f3e50477b8ad512c9ce2aaefe890..2ae065222b756351bd406b75ba338e9c642d5739 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Arrays;
 import java.io.*;
 import java.lang.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.app.Activity;
 import android.graphics.*;
index 0776fa0027fb382270e06107657341e20935f3ed..1bcb67ef72e849c56f682a803bc815e1d26dcf90 100644 (file)
@@ -52,7 +52,7 @@ import android.hardware.usb.*;
 import android.graphics.*;
 import android.graphics.drawable.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class SavedState {
        long    received_time;
@@ -678,7 +678,6 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener,
                // Display the Version
                mVersion = (TextView) findViewById(R.id.version);
                mVersion.setText("Version: " + BuildInfo.version +
-                                (AltosVersion.has_google_maps_api_key() ? " maps" : "") +
                                 " Built: " + BuildInfo.builddate + " " + BuildInfo.buildtime + " " + BuildInfo.buildtz +
                                 " (" + BuildInfo.branch + "-" + BuildInfo.commitnum + "-" + BuildInfo.commithash + ")");
 
index 05cb0f6b9ea9219a60154a4ddc3c549e4a52e780..a443b6e987e8fce060001c06d1ca84b70a62cde2 100644 (file)
@@ -25,7 +25,7 @@ import java.util.UUID;
 
 import android.os.Handler;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public abstract class AltosDroidLink extends AltosLink {
 
index 8730e8adb3f356787436c378a711b9c427719bf4..6da90a3df9aeab9c03802502705f749908a3d77b 100644 (file)
@@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid;
 import java.util.*;
 import java.io.*;
 import android.location.Location;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public interface AltosDroidMapInterface {
        public void onCreateView(AltosDroid altos_droid);
index 0670005a26efded41f5d69b259c01114ca2ceeb0..8bb78c00dce6fd915551aca270bcbe99e062b648 100644 (file)
@@ -22,7 +22,7 @@ import java.util.*;
 import java.text.*;
 
 import android.content.Context;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosDroidPreferences extends AltosPreferences {
 
index 01ec0af941d5b93d49fdba9092b4b5be3a192c71..854fe86d6edaa6ab29c16fea6666c95ce151e458 100644 (file)
@@ -25,7 +25,7 @@ import android.content.SharedPreferences;
 import android.os.Environment;
 import android.util.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosDroidPreferencesBackend extends AltosPreferencesBackend {
        public final static String        NAME    = "org.altusmetrum.AltosDroid";
index ec73f5e3c4ba5f102278719b7ec20ee4a3283ec9..9594f85fa44c2b0d7876ea11246342fbf0dbdb2e 100644 (file)
@@ -18,7 +18,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 import android.location.Location;
 import android.app.Activity;
 import android.graphics.Color;
index 2a728cf73bf4f2f735eb74f3aeb0d4d0b0760349..1aebcd3656fbfd62fc837354b1655fecc1d1a08f 100644 (file)
@@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid;
 import java.util.*;
 import java.io.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.app.Activity;
 import android.graphics.*;
@@ -86,7 +86,7 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal
        AltosMap                map;
        AltosDroid              altos_droid;
 
-       static int scale = 2;
+       static int scale = 1;
 
        AltosLatLon     here;
        AltosLatLon     there;
@@ -160,11 +160,10 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal
                                                message = "Internal error";
                                                break;
                                        case AltosMapTile.failed:
-                                               message = "Network error, check connection";
+                                               message = "Network error";
                                                break;
                                        case AltosMapTile.forbidden:
-                                               message = "Too many requests, try later";
-                                               AltosDebug.debug("Forbidden map response %d\n", AltosMapStore.forbidden_response);
+                                               message = "Outside of known launch areas";
                                                break;
                                        }
                                        if (message != null) {
index b71cdd62eff6517d6a05786c45b859a079f5b997..37e4435a68b0482b5a81832f6f577cdfee22cf77 100644 (file)
@@ -20,7 +20,7 @@ package org.altusmetrum.AltosDroid;
 
 import java.util.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import com.google.android.gms.maps.*;
 import com.google.android.gms.maps.model.*;
index 77947b4b3e6ed39d2b1670070b5fea4182596a3f..0b235f2820e6f5d427e48db6818827cc9c18f319 100644 (file)
@@ -29,7 +29,7 @@ import android.hardware.usb.*;
 import android.app.*;
 import android.os.Handler;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUsb extends AltosDroidLink {
 
index fedfdb52ada23851db26f9c24d907256b628f7a2..ae3299facba66c76ea1ed15aa02308b276a982ac 100644 (file)
@@ -23,7 +23,7 @@ import android.speech.tts.TextToSpeech;
 import android.speech.tts.TextToSpeech.OnInitListener;
 import android.location.Location;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosVoice {
 
index ace0a7d6465cd953057b681e5271d04d8ab58bf2..3130d2a1937c784cf49d6b198d0513215e0f4182 100644 (file)
@@ -35,7 +35,7 @@ import android.view.View.OnClickListener;
 import android.widget.*;
 import android.widget.AdapterView.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class IdleModeActivity extends Activity {
        private EditText callsign;
index eccf5c598a24fefc11495e26aaea7383b6c19f1b..a172451d0395a8c74ec4f90c23b8980885c861aa 100644 (file)
@@ -33,7 +33,7 @@ import android.view.View.*;
 import android.widget.*;
 import android.widget.AdapterView.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class IgniterItem {
        public String name;
index ff599fdacec5ab9ee38355980ea6010a02b3ef63..d5101166e9524d6a512e09f17f63bf802d477ad5 100644 (file)
@@ -33,7 +33,7 @@ import android.view.inputmethod.*;
 import android.widget.*;
 import android.widget.AdapterView.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class FrequencyItem {
        public AltosFrequency frequency;
index b93eaa1962cb91329392c7ef2180395be57b714b..ec88d2d61af6f79d5de78ea33467f4b976b13fb2 100644 (file)
@@ -35,7 +35,7 @@ import android.view.View.OnClickListener;
 import android.widget.*;
 import android.widget.AdapterView.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class MapTypeActivity extends Activity {
        private Button hybrid;
index 9c43870f76c9838e55133da661ee0f3ffb896509..e393b566ba9362c3017603dfbe5eada5180c4810 100644 (file)
@@ -42,7 +42,7 @@ import android.location.LocationManager;
 import android.location.LocationListener;
 import android.location.Criteria;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 /**
  * This Activity appears as a dialog. It lists any paired devices and
@@ -54,10 +54,12 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
 
        private ArrayAdapter<AltosLaunchSite> known_sites_adapter;
 
+/*
        private CheckBox        hybrid;
        private CheckBox        satellite;
        private CheckBox        roadmap;
        private CheckBox        terrain;
+*/
 
        private Spinner         known_sites_spinner;
        private Spinner         min_zoom;
@@ -196,17 +198,22 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
                return r;
        }
 
+/*
        private int bit(CheckBox box, int value) {
                if (box.isChecked())
                        return 1 << value;
                return 0;
        }
+*/
 
        private int types() {
+/*
                return (bit(hybrid, AltosMap.maptype_hybrid) |
                        bit(satellite, AltosMap.maptype_satellite) |
                        bit(roadmap, AltosMap.maptype_roadmap) |
                        bit(terrain, AltosMap.maptype_terrain));
+*/
+               return 1 << AltosMap.maptype_hybrid;
        }
 
        private void load() {
@@ -318,12 +325,14 @@ public class PreloadMapActivity extends Activity implements AltosLaunchSiteListe
                latitude = (EditText) findViewById(R.id.preload_latitude);
                longitude = (EditText) findViewById(R.id.preload_longitude);
 
+/*
                hybrid = (CheckBox) findViewById(R.id.preload_hybrid);
                satellite = (CheckBox) findViewById(R.id.preload_satellite);
                roadmap = (CheckBox) findViewById(R.id.preload_roadmap);
                terrain = (CheckBox) findViewById(R.id.preload_terrain);
 
                hybrid.setChecked(true);
+*/
 
                min_zoom = (Spinner) findViewById(R.id.preload_min_zoom);
                add_numbers(min_zoom,
index 6c2d9d7ae9eefc9758c85361cbf631e7f3569662..bad0b821a3ecc8bdf6078855979719773572412c 100644 (file)
@@ -31,7 +31,7 @@ import android.view.View.*;
 import android.widget.*;
 import android.widget.AdapterView.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class SetupActivity extends Activity {
        private Spinner select_rate;
index 5349612cc1ec823a602a619dfe07766bc4923b9f..8997d967dccee52c435225a9036daa3dbee1417b 100644 (file)
@@ -18,7 +18,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index d239d988ad488f36bebb9909e0c06d43aed6bc96..a2f997f1f597a4323576bf02a195a7ec3c769924 100644 (file)
@@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid;
 import java.util.*;
 import java.io.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.app.Activity;
 import android.graphics.*;
index ba5afba5c8b1b81323fecc4705d4aa80d4efda66..f317ae912c77dc3b03614a5886769337d362dfed 100644 (file)
@@ -18,7 +18,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index ac211230446082324a81c241862e2c52ddd4379c..3df4838522fa787ba19d3531d0d62218a1ffb818 100644 (file)
@@ -18,7 +18,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index 56f235c1a8c4b17a6def2665906bc5faf403b4e8..49ba54766d2c8264cd392d00505098d7f52d0e7b 100644 (file)
@@ -1,6 +1,6 @@
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
index 69685dc7a843010f994ceff365877dd8801f991c..5cfa647bd5b4bf7fec78695f541ad7c678e674db 100644 (file)
@@ -26,7 +26,7 @@ import java.util.*;
 import java.util.concurrent.*;
 import android.os.Handler;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 
 public class TelemetryReader extends Thread {
index caf288a04b62864270650d3a6330270d78fae39a..22a2bbd75bd4724a781df8fa6dd1e54fb25410f5 100644 (file)
@@ -41,7 +41,7 @@ import android.os.Looper;
 import android.widget.Toast;
 import android.location.Criteria;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class TelemetryService extends Service implements AltosIdleMonitorListener {
 
index 77cee787b56219fc27b4fab518c057389fa411d6..74d5cd22231aff3f98933aea1bfe11b8a3601c88 100644 (file)
@@ -19,7 +19,7 @@
 package org.altusmetrum.AltosDroid;
 
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 import android.location.Location;
 
 public class TelemetryState {
index 8fefefc5f0bf0be3166782bcec85a472f9f0e732..8bc6db6dd8c8e439f92ecab1e6961d922f23b6c1 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index f98090efaec35edcfe452b00acf4ef65f16302a4..be5497a36690e85f080775bae3cc0beef07a73cf 100644 (file)
@@ -16,7 +16,7 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.concurrent.*;
index 173592458845cf6862c958e5ad6aeb2bee517905..2c5439b4bf7588c5e1cda961fdd08e48741be31e 100644 (file)
@@ -16,7 +16,7 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.concurrent.*;
index 5c398d3cfb3bb42fd332f16b4807ef6bcc098feb..f9687654cb0157cf8b3187ca2905b77c3a141ceb 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosCRCException extends Exception {
        public int rssi;
index a8de23f0cc828132bf4ce008dc38841dbe94350c..a08db23e5e938f9ebe53d93925300f9cc2c2ebab 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
@@ -209,7 +209,7 @@ public class AltosCSV implements AltosWriter {
        }
 
        void write_advanced_header() {
-               out.printf("accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z,mag_x,mag_y,mag_z,tilt");
+               out.printf("accel_x,accel_y,accel_z,gyro_roll,gyro_pitch,gyro_yaw,mag_x,mag_y,mag_z,tilt");
        }
 
        double accel_along() { return series.value(AltosFlightSeries.accel_along_name, indices); }
index 5bc6c4fd5b51299db71f92c868d22caa73d34988..d448fdfe5d468edc586d8d61c23dcd0a9f71cae7 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 /*
  * Calibration and other data needed to construct 'real' values from various data
index 5ce333f8a9782564e3c804a56addf31a6cf7292d..1e1bad98b25330d27261ce239517b467df4a01e6 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index 8d0bb47938f056dec65127f5b732d90b268fdb95..48dab421b148c391e74fb03ed2240e7f0140cc18 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.text.*;
index fe6336b6baba6aa7ceb2d4a909a66b672b42afae..48ec35df09f2a4e0a63fb163fb7e43b3bfb614c2 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosConfigDataException extends Exception {
 
index 10478fd4f96313dff8684792356f2cc0be3e44c5..9d02b2f0d42a61abab74964ef5b48e60d7a2bb32 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosConfigValues {
        /* set and get all of the dialog values */
index ed16541a7d832a5a5424340470f8b053145f22bb..d246018700bfd1d0746330f6724e27ab86f208c9 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * Sensor data conversion functions
  */
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 
index 9a1e1465fbb19aa39781f33904ce7f09ac65c1ed..709b71b63037f3618add139a5032d0e32260fd8c 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public abstract class AltosDataListener {
 
index 9589a8e65db8829a00e902e6470c3f719b0887dc..bb179580c7f7588422ce35bb7206ec911bebdd61 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosDataProvider {
        public void     provide_data(AltosDataListener listener) throws InterruptedException, AltosUnknownProduct;
index a44eb12fc002fd93589ce4278b16c2ee26a5ce3f..57e97a18fe36cd50e92479b47ab05583d30625b2 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index 38efbf1abf004b06c9612312898e8687bf871cf9..6560f9ed10a51ab2b554ff21505e29605028c71c 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosDistance extends AltosUnits {
 
index 124bd478e0131fecb4dca900e4ee79c2c8b71e67..1ececde19bca9e61371aa1077cb6adad645fe14c 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.io.*;
index 4f12c190f61936af2d9bd58e0fcac1c3364b900c..1c1e80c7d20714ac821af6c35841174edaf2a999 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 import java.util.concurrent.*;
index 547b523f362aea1532da2962fdf1644269af2e23..280414f8e9a32d5b81906ec50a7fd6b73c527519 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 067f030218a3dd5ea140ff5b105e544f5d8ca4a3..839f0aa0dff23f35e591b68e1d308933c3452b2a 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index c55bcaaa2a3c6ef6b13feb32b3476eba76c877cd..a9551d85b4b9b97924c1072c192caac93e853724 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index ba722b89085abee35973977d6244d32669a03c62..0da3e991dcee4b13dd7348771fcd277a44c4d58b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.text.*;
index 11144a3ada74497ea96b831eb011d6e26bad31c8..f58df11b7e13a54a14259943e36bc47bce9c2cf6 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index 43e8ea4dbeccefa323e7ad273f0029c1750e8313..22cb8f894b2f7d73ac5078032b09026304d01b06 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public abstract class AltosEepromRecord implements Comparable<AltosEepromRecord> {
 
index d6b74d1b2c9946a11abcf8b919ff15694b81ba4e..38b6c841518983e39a9ff0c8dc73e081a89284f7 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 7e92d35377bc1912d5a8363d80d82bc370dd838f..dc421d8dd70b948ad5613ea95b691bceee416597 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosEepromRecordFull extends AltosEepromRecord {
        public static final int record_length = 8;
index 5cf5db3966c86faecfda5f996bc5d4246755936f..e2fd7928aa2b9ffdf590ec096b1b6b0d4bc7d939 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 86343fe058c4f112d2f91bd9faf0446bac15722d..6b28c50a42e67a935ad7ab723153bb8c996c3a80 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosEepromRecordMega extends AltosEepromRecord {
        public static final int record_length = 32;
index 888a06cca2fbe02316525f6a01f7e10428ee4168..102d1407f7ce3121c7111fed312c8b084672f0f8 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosEepromRecordMetrum extends AltosEepromRecord {
        public static final int record_length = 16;
index 5569669344f51ca3a8bc609b7aeaa91e60f6fe62..2d212df09df88074a87a3068a7c312bc340e4aef 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosEepromRecordMini extends AltosEepromRecord {
        public static final int record_length = 16;
index 360759314d4bf9e123bf2e109271f66beb6375ff..27f81df6d31f86bfdf094d0cc97898ff861810e6 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 06ee9d54508575d142dc66c8e3a07fb3a6e3c4ed..428a9fc59a8709fd8b1a06fa5a506d8a58bd59de 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosEepromRecordTiny extends AltosEepromRecord implements AltosDataProvider {
        public static final int record_length = 2;
index 6f98b87ac5fb033f748e855eb6019ba621fd53d1..e96b19db823c87cd274ded9002bb6ef1f6432f40 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.File;
 import java.util.*;
index fe91100a5391691b7868c3b53f3ad512effd3a8f..d870c08326ddd0014202d5c6ad48df1c40242dce 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosFilterListener {
        void filter_changed(double speed_filter, double accel_filter);
index 9bf0da2526e8e9339f1ca496836d7e829f83c454..e6b0571342212f93d763a746ab1d17753b672640 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
@@ -257,7 +257,7 @@ public class AltosFlash extends AltosProgrammer {
                        int flash_addr = (int) image.address;
                        int image_start = 0;
 
-                       action("start", 0);
+                       action(AltosFlashListener.flash_start, 0);
                        action(0, image.data.length);
                        while (remain > 0 && !aborted) {
                                int this_time = remain;
@@ -293,7 +293,7 @@ public class AltosFlash extends AltosProgrammer {
                                action(image.data.length - remain, image.data.length);
                        }
                        if (!aborted) {
-                               action("done", 100);
+                               action(AltosFlashListener.flash_done, 100);
                                if (debug != null) {
                                        debug.set_pc((int) image.address);
                                        debug.resume();
index 60052133a09ceb999ff3122a4738aa8af9e16014..120e714688533dc45aef64f99dc738b4b2e08f30 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosFlashListener {
+
+       public final static String flash_start = "start";
+       public final static String flash_done = "done";
+
        public void position(String label, int percent);
 }
index 8fe33c5e037b3f1c1a9a442a562ccbde41b88aec..7743fda546249d2e7b068c48ba8f827d17fd49c3 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosFlightDisplay extends AltosUnitsListener, AltosFontListener {
        void reset();
index 671bf63834bfaa5bd155a47ab33c785f8daf5eeb..a4724f0450986f355e303f9191129b5b4aa6210b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 import java.io.*;
index 182bdd19bd511fdcc8533147719c346ffe566c1a..32bd6c5ef63f6aae98d0fef1fb0141f45efc7fcd 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 
index 2760321d0940685ca20a5ea910db20efa9455f95..7c8ed85e589d7f89623c116b7f32d2830d0d070e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index 97947d0b48f4fa501b03d2206f5462edfc1e3282..736d24265d69bd8741af9b300dc7e864d0ad1a12 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosFontListener {
        void font_size_changed(int font_size);
index 47fb900cd080b3b56e4abfd5977dee5f4d345b47..99fe2671e9696496d0677f6435609970053710d7 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosForce extends AltosUnits {
 
index dfe337897f02e3da3c402173101bce076a4790fb..58f503c565d16db931668c33e8df2b2e4c7c838a 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index b6ca3576b4096e061d2d59090c0ae9a93e544db2..8037eb93deb37ec63e44b49d5b3975c7e31b8dd8 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 import java.util.concurrent.*;
index 8d3b316af45d3dfc4cecf50c925ac7712d125c89..6c045a31289f8188ec857da1a1378ae360d2e542 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.text.*;
index e15c60e3d792d7e0cb9e9008b20600e55181df08..5ad1afa1fa71be5b4909c1c70262531f7a39d061 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosGPSTimeValue {
        public double   time;
index f1cb1940f1f9010ef799f8cdfa1d606aeb7969d6..cd5b9636a4bea28957048bc87f2accf7dc6f712d 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.lang.Math;
 import java.io.*;
index 668080f1216158a73909c10b85e0c224741c4f3a..f65ca89931e1bdd2be489e0219d5cee1c7a791ba 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosHeight extends AltosUnits {
 
index f2ab4bead5c3883dd8cd1e16d5020b8cf63eb484..609d1bcb366f9f3ae747633f1f0a51e8894d04ad 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.LinkedList;
@@ -354,11 +354,6 @@ public class AltosHexfile {
 
                int product_len = get_u8(a);
 
-               System.out.printf("Product is at %x length %d\n", a, product_len);
-
-               for (int i = 0; i < product_len; i++)
-                       System.out.printf(" %2d: %02x\n", i, get_u8(a+i));
-
                if (product_len <= 0)
                        return null;
 
@@ -367,12 +362,11 @@ public class AltosHexfile {
                for (int i = 0; i < product_len - 2; i += 2) {
                        int     c = get_u16(a + 2 + i);
 
-                       System.out.printf("character %x\n", c);
-
                        product += Character.toString((char) c);
                }
 
-               System.out.printf("product %s\n", product);
+               if (AltosLink.debug)
+                       System.out.printf("product %s\n", product);
 
                return product;
        }
index 4f56af9a37630096f4210cc3c45077707c23a624..b1323484d96339646bb4a3690746c02a7c7d4625 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosHexsym {
        String  name;
index df81c9ddea979a3b56fb2ca91760c33aa9204afb..114dfcf908624a5905d04ee8b546bb143295ca72 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.*;
 import java.io.*;
index b5ee20d00910eb756ea56c18c1b282d1eef32df0..6c6758ca0c414986bc9fa9d33571c40709d13d1c 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 88a5dab4eafd4885ff36abe7d8914a1e1a80df72..88a65e63bb7001fcdf5f4e3fb087d641284e6945 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 834d9aa54055a981ab209c008811f603266668ed..99d3192133f116e3cdbc5a89f48b9c34d548d160 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.concurrent.*;
index 1ddec09a13240feb0c26d57c036f92594574ddb4..43e2376f110410b277d8e44650befa48b4715ace 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosIdleMonitorListener {
        public void update(AltosState state, AltosListenerState listener_state);
index d15e217487f482815e29281a8fece2c3016e7b98..24477d623bcbb997f352938488010bc9caab7915 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 import java.io.*;
index 767c00fbaf1689d4f8c5399518656c6594496995..50c0f22d570deb779acb70a35f8dbec3be1a82b6 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.io.*;
index abe9d56f9c0fe052b4b533467080bf211703d574..210a37c17f9af8be7585bfdc0319392aadc676f0 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index 52c9b41e6d7d81f8dcd5d804eacad421568d3098..b981c36513939a7de503de3ce111473bf2b13a4e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
@@ -63,18 +63,22 @@ class JsonUtil {
                        result.append("\t");
                return result;
        }
-       static NumberFormat get_nf_json() {
-               DecimalFormat nf = (DecimalFormat) NumberFormat.getNumberInstance(Locale.ROOT);
-               nf.setParseIntegerOnly(false);
-               nf.setGroupingUsed(false);
-               nf.setMaximumFractionDigits(17);
-               nf.setMinimumFractionDigits(0);
-               nf.setMinimumIntegerDigits(1);
-               nf.setDecimalSeparatorAlwaysShown(false);
-               return nf;
-       }
 
-       static NumberFormat nf_json = get_nf_json();
+       NumberFormat _nf_json;
+
+       NumberFormat nf_json() {
+               if (_nf_json == null) {
+                       DecimalFormat nf = (DecimalFormat) NumberFormat.getNumberInstance(Locale.ROOT);
+                       nf.setParseIntegerOnly(false);
+                       nf.setGroupingUsed(false);
+                       nf.setMaximumFractionDigits(17);
+                       nf.setMinimumFractionDigits(0);
+                       nf.setMinimumIntegerDigits(1);
+                       nf.setDecimalSeparatorAlwaysShown(false);
+                       _nf_json = nf;
+               }
+               return _nf_json;
+       }
 }
 
 class JsonHash extends JsonUtil {
@@ -372,7 +376,7 @@ class JsonLexer extends JsonUtil {
                                        String dstr = dbuf.toString();
                                        double dval;
                                        try {
-                                               dval = nf_json.parse(dstr).doubleValue();
+                                               dval = nf_json().parse(dstr).doubleValue();
                                        } catch (ParseException pe) {
                                                return new JsonToken(JsonToken._error, dstr);
                                        }
@@ -612,7 +616,7 @@ public class AltosJson extends JsonUtil {
                        } else if (Double.isNaN(d_number)) {
                                result.append("NaN");
                        } else {
-                               String dval = nf_json.format(d_number);
+                               String dval = nf_json().format(d_number);
                                if (dval.equals("-0"))
                                        dval = "0";
                                result.append(dval);
index d5248a17377be645fab9164c40b5ebaa1ea05cc9..cafc7f96bf0e11591f1a861463575b7974f987b0 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 6fcc43feabd591513a466c260be4a9fe040c7f44..cd7015e3cb363f93cad745a19251803a4afbc0f6 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosLatLon {
        public double   lat;
index f43397d0f086f225fe369cbdb622bd9ebb707af5..4c8ea0b24dc5da1b521cffde8f65fa2b227a3902 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosLatitude extends AltosLocation {
        public String pos() { return "N"; }
index 19fb48589e26b367ab6019bb9385e6a9b4a046d0..a71e138d30d67d70eb95dc768af03a455a859d7b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.*;
index 0d9263530ae48ef8d71293b81ecbd9f243cd4765..ecae488c35ac6d789dfd3ba89e236b38ecc1efbe 100644 (file)
@@ -15,7 +15,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.*;
index 365f19e325e4825932633a50d08bb3a59c4c3b3f..2c04c90eeeb50a28d905a1b1233dbcc61e40a21a 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.*;
@@ -30,6 +30,8 @@ public class AltosLaunchSites extends Thread {
        LinkedList<AltosLaunchSite>     sites;
        AltosLaunchSiteListener         listener;
 
+       public static String            launch_sites_url;
+
        void notify_complete() {
                listener.notify_launch_sites(sites);
        }
@@ -50,9 +52,13 @@ public class AltosLaunchSites extends Thread {
                try {
                        String  path;
 
-                       path = System.getenv(AltosLib.launch_sites_env);
-                       if (path == null)
-                               path = AltosLib.launch_sites_url;
+                       if (launch_sites_url != null)
+                               path = launch_sites_url;
+                       else {
+                               path = System.getenv(AltosLib.launch_sites_env);
+                               if (path == null)
+                                       path = AltosLib.launch_sites_url;
+                       }
                        url = new URL(path);
                        URLConnection uc = url.openConnection();
 
index 7d2b68e0bfe94d56788f06ca9a4e2d7f51168aef..8b0170aed140c2b3e85acf718a4def736a6d84b6 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.io.*;
@@ -180,6 +180,10 @@ public class AltosLib {
                return device_type == product_telemega || device_type == product_easymega;
        }
 
+       public static boolean has_radio(int device_type) {
+               return device_type != product_easymini && device_type != product_easymega;
+       }
+
        public static boolean has_gps(int device_type) {
                return device_type == product_telemetrum ||
                        device_type == product_telemega ||
@@ -222,10 +226,13 @@ public class AltosLib {
                "Compressed", "Uncompressed"
        };
 
-       public static final String launch_sites_url = "http://www.altusmetrum.org/AltOS/launch-sites.txt";
+       public static final String launch_sites_url = "https://maps.altusmetrum.org/launch-sites.txt";
        public static final String launch_sites_env = "LAUNCH_SITES";
 //     public static final String launch_sites_url = "file:///home/keithp/misc/text/altusmetrum/AltOS/launch-sites.txt";
 
+       public static final String unit_info_url = "https://altusmetrum.org/cgi-bin/unitinfo.cgi?sn=%d";
+       public static final String unit_info_env = "UNIT_INFO";
+
        public static final int ao_telemetry_standard_len = 32;
        public static final int ao_telemetry_0_9_len = 95;
        public static final int ao_telemetry_0_8_len = 94;
index b3833f6402327e233cb4872ffc8c5432f79357a3..a18366ed24cbd35cba4fd589841f1186c80aee0e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosLine {
        public String   line;
index 3ad3489173e149557c7d0caf437eae9ab8bfdf93..44202c0c80eb0b6ebe1a53d4d46cadd78d3b7a2d 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.concurrent.*;
index 949d2271ce52914ec6d3805600fc81b886c63cc0..448204714db32d0ab901455f2d8652c425d80455 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index 45831004aa22ea708a6ce384a299007ba50dde08..0ffc044e944afe86c3c078c6d3acd73d1a71f4c3 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public abstract class AltosLocation extends AltosUnits {
 
index 44bea6465859e7ff2a91e8c3c65bd173fdafc508..3111a2cda462bd153e1345ca7a27f27032e18669 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.text.*;
index b2134cbb3b3b3f87eeec0ccbfe782145bac9a862..6c7f715b216116360851e35be8ee8eabc534ef26 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosLongitude extends AltosLocation {
        public String pos() { return "E"; }
index 0d8ec69fec6ecf85bd448d988b4de25577169673..cbf9ecff21917b716dc60b2a1b05235220a9202e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.*;
 import java.io.*;
index 286cf1bb696de34e2992728af6e0328810ecf45a..b033cbff75b59e855f62c42ccca1dc3e3fbd257f 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.*;
@@ -211,12 +211,14 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener {
        }
 
        public boolean set_maptype(int maptype) {
+/*
                if (maptype != this.maptype) {
                        this.maptype = maptype;
                        tiles.clear();
                        repaint();
                        return true;
                }
+*/
                return false;
        }
 
@@ -339,7 +341,9 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener {
                                        AltosLatLon     ul = transform.lat_lon(point);
                                        AltosLatLon     center = transform.lat_lon(new AltosPointDouble(x + AltosMap.px_size/2, y + AltosMap.px_size/2));
                                        AltosMapTile tile = map_interface.new_tile(cache, ul, center, zoom, maptype, px_size, scale);
-                                       debug("show state %s url %s\n", AltosMapTile.status_name(tile.store.status()), tile.store.url);
+                                       int status = tile.store.status();
+                                       if (status == AltosMapTile.fetching)
+                                               debug("Fetching %.6f %.6f %d\n", center.lat, center.lon, zoom);
                                        tile.add_listener(this);
                                        tiles.put(point, tile);
                                }
@@ -350,7 +354,7 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener {
        public void set_load_params(int new_zoom, int new_type, double lat, double lon, int radius, AltosMapTileListener listener) {
                if (AltosMap.min_zoom <= new_zoom && new_zoom <= AltosMap.max_zoom)
                        zoom = new_zoom;
-               maptype = new_type;
+/*             maptype = new_type; */
                load_centre = new AltosLatLon(lat, lon);
                load_radius = radius;
                load_listener = listener;
index 54d2dbddbc927c1d5576d19004245871147a8ef2..01b39b472d00f0fbb2851525e2a99e4904e1d459 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.net.*;
index 8c07e3c1dd056501b52b898b5ee397fd520bca9c..b7d851b877eebef98400111ca50defbd28cb3f83 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosMapCacheListener {
        public void map_cache_changed(int map_cache);
index 5089db646c6d70081ad3f638804e798bdd50fc2c..e407e0feadff8065efa56ad9ad65843bf83370f8 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.net.*;
index f2174935f84a632c81d3fc2bc0b8ebb5ba09200a..b971711e6d3f0aa0654855a4a6a7fcf7e3e7e016 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.Math;
index b57591df175da770eb8feb98344530f5050132cc..4047907d89d4a92fea4ca5b5f60f783d784e10ed 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
@@ -214,7 +214,10 @@ public class AltosMapLoader extends Thread implements AltosMapStoreListener {
                this.min_z = min_z;
                this.max_z = max_z;
                this.radius = radius;
+/*
                this.all_types = all_types;
+*/
+               this.all_types = 1 << AltosMap.maptype_hybrid;
                this.scale = scale;
                this.abort = false;
                start();
index 7f36c0028f83c0f1b8a45b2dcbbc5f7c2aea623f..3ef8789d1e5822ecace758315a3270d451ba356e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosMapLoaderListener {
        public abstract void loader_start(int max);
index 4ef179ef538b71a833e96c95bfca65911d071704..a263f814400ef3ad1b460835d41cb281879a7c34 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.Math;
index 1542a4e9bea71ed0afdcd84260b2a8e81294f191..7104b2f63767eede8705e61190a1d96a3572f156 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.Math;
index 409a6a5cf65b635b1b356fbb11ff309bb602cb7a..9a1edd421c62c0bba375f2b51b45023ab8c2c31e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.Math;
index 0751aa336d9c77f31cdd9b4c95cc42381783d200..8a28f21846f3ea292134d379371fddca2876655a 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosMapRectangle {
        AltosLatLon     ul, lr;
index 4eba3a044296987c5f1ebaa3b0a3cff548a8e3de..2f85fb8db49602828ead9ca853796f3fc9fd9a06 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.net.*;
@@ -48,9 +48,21 @@ public class AltosMapStore {
                                              chlat, lat, chlon, lon, maptype_string, zoom, scale == 1 ? "" : String.format("-%d", scale), format_string));
        }
 
+       public static String google_maps_api_key = null;
+
+       private static String google_map_url(AltosLatLon center, int zoom, int maptype, int px_size, int scale, String format_string) {
+               return String.format("http://maps.google.com/maps/api/staticmap?center=%.6f,%.6f&zoom=%d&size=%dx%d&scale=%d&sensor=false&maptype=%s&format=%s&key=%s",
+                                    center.lat, center.lon, zoom, px_size, px_size, scale,
+                                    AltosMap.maptype_names[maptype], format_string, google_maps_api_key);
+       }
+
+       private static String altos_map_url(AltosLatLon center, int zoom, int maptype, int px_size, int scale, String format_string) {
+               return String.format("https://maps.altusmetrum.org/cgi-bin/altos-map?lat=%.6f&lon=%.6f&zoom=%d",
+                                    center.lat, center.lon, zoom);
+       }
+
        private static String map_url(AltosLatLon center, int zoom, int maptype, int px_size, int scale) {
                String format_string;
-               int z = zoom;
 
                if (maptype == AltosMap.maptype_hybrid || maptype == AltosMap.maptype_satellite || maptype == AltosMap.maptype_terrain)
                        format_string = "jpg";
@@ -58,17 +70,17 @@ public class AltosMapStore {
                        format_string = "png32";
 
                for (int s = 1; s < scale; s <<= 1)
-                       z--;
+                       zoom--;
+
+               px_size /= scale;
 
-               if (AltosVersion.has_google_maps_api_key())
-                       return String.format("http://maps.google.com/maps/api/staticmap?center=%.6f,%.6f&zoom=%d&size=%dx%d&scale=%d&sensor=false&maptype=%s&format=%s&key=%s",
-                                            center.lat, center.lon, z, px_size/scale, px_size/scale, scale, AltosMap.maptype_names[maptype], format_string, AltosVersion.google_maps_api_key);
+               if (google_maps_api_key != null)
+                       return google_map_url(center, zoom, maptype, px_size, scale, format_string);
                else
-                       return String.format("http://maps.google.com/maps/api/staticmap?center=%.6f,%.6f&zoom=%d&size=%dx%d&scale=%d&sensor=false&maptype=%s&format=%s",
-                                            center.lat, center.lon, z, px_size/scale, px_size/scale, AltosMap.maptype_names[maptype], format_string);
+                       return altos_map_url(center, zoom, maptype, px_size, scale, format_string);
        }
 
-       public int status() {
+       public synchronized int status() {
                return status;
        }
 
@@ -88,11 +100,6 @@ public class AltosMapStore {
                        listener.notify_store(this, status);
        }
 
-       static Object   forbidden_lock = new Object();
-       static long     forbidden_time;
-       static boolean  forbidden_set;
-       public static int forbidden_response;
-
        private int fetch_url() {
                URL u;
 
@@ -102,48 +109,64 @@ public class AltosMapStore {
                        return AltosMapTile.bad_request;
                }
 
-               byte[] data;
+               byte[] data = null;
                URLConnection uc = null;
-               try {
-                       uc = u.openConnection();
-                       String type = uc.getContentType();
-                       int contentLength = uc.getContentLength();
-                       if (uc instanceof HttpURLConnection) {
-                               int response = ((HttpURLConnection) uc).getResponseCode();
-                               switch (response) {
-                               case HttpURLConnection.HTTP_FORBIDDEN:
-                               case HttpURLConnection.HTTP_PAYMENT_REQUIRED:
-                               case HttpURLConnection.HTTP_UNAUTHORIZED:
-                                       synchronized (forbidden_lock) {
-                                               forbidden_time = System.nanoTime();
-                                               forbidden_set = true;
-                                               forbidden_response = response;
+
+               int status = AltosMapTile.failed;
+               int tries = 0;
+
+               while (tries < 10 && status != AltosMapTile.fetched) {
+                       try {
+                               uc = u.openConnection();
+                               String type = uc.getContentType();
+                               int contentLength = uc.getContentLength();
+                               if (uc instanceof HttpURLConnection) {
+                                       int response = ((HttpURLConnection) uc).getResponseCode();
+                                       switch (response) {
+                                       case HttpURLConnection.HTTP_FORBIDDEN:
+                                       case HttpURLConnection.HTTP_PAYMENT_REQUIRED:
+                                       case HttpURLConnection.HTTP_UNAUTHORIZED:
                                                return AltosMapTile.forbidden;
                                        }
                                }
-                       }
-                       InputStream in = new BufferedInputStream(uc.getInputStream());
-                       int bytesRead = 0;
-                       int offset = 0;
-                       data = new byte[contentLength];
-                       while (offset < contentLength) {
-                               bytesRead = in.read(data, offset, data.length - offset);
-                               if (bytesRead == -1)
-                                       break;
-                               offset += bytesRead;
-                       }
-                       in.close();
+                               InputStream in = new BufferedInputStream(uc.getInputStream());
+                               int bytesRead = 0;
+                               int offset = 0;
+                               data = new byte[contentLength];
+                               while (offset < contentLength) {
+                                       bytesRead = in.read(data, offset, data.length - offset);
+                                       if (bytesRead == -1)
+                                               break;
+                                       offset += bytesRead;
+                               }
+                               in.close();
 
-                       if (offset != contentLength)
-                               return AltosMapTile.failed;
+                               if (offset == contentLength)
+                                       status = AltosMapTile.fetched;
+                               else
+                                       status = AltosMapTile.failed;
 
-               } catch (IOException e) {
-                       return AltosMapTile.failed;
+                       } catch (IOException e) {
+                               status = AltosMapTile.failed;
+                       }
+
+                       if (status != AltosMapTile.fetched) {
+                               try {
+                                       Thread.sleep(100);
+                               } catch (InterruptedException ie) {
+                               }
+                               tries++;
+                               System.out.printf("Fetch failed, retrying %d\n", tries);
+                       }
                }
 
+               if (status != AltosMapTile.fetched)
+                       return status;
+
                try {
                        FileOutputStream out = new FileOutputStream(file);
-                       out.write(data);
+                       if (data != null)
+                               out.write(data);
                        out.flush();
                        out.close();
                } catch (FileNotFoundException e) {
@@ -158,18 +181,19 @@ public class AltosMapStore {
 
        static Object   fetch_lock = new Object();
 
-       static final long       forbidden_interval = 60l * 1000l * 1000l * 1000l;
-       static final long       google_maps_ratelimit_ms = 1200;
-
        static Object   fetcher_lock = new Object();
 
        static LinkedList<AltosMapStore> waiting = new LinkedList<AltosMapStore>();
        static LinkedList<AltosMapStore> running = new LinkedList<AltosMapStore>();
 
-       static final int concurrent_fetchers = 128;
+       static int concurrent_fetchers() {
+               if (google_maps_api_key == null)
+                       return 16;
+               return 128;
+       }
 
        static void start_fetchers() {
-               while (!waiting.isEmpty() && running.size() < concurrent_fetchers) {
+               while (!waiting.isEmpty() && running.size() < concurrent_fetchers()) {
                        AltosMapStore   s = waiting.remove();
                        running.add(s);
                        Thread lt = s.make_fetcher_thread();
@@ -200,33 +224,10 @@ public class AltosMapStore {
                                        return;
                                }
 
-                               synchronized(forbidden_lock) {
-                                       if (forbidden_set && (System.nanoTime() - forbidden_time) < forbidden_interval) {
-                                               notify_listeners(AltosMapTile.forbidden);
-                                               return;
-                                       }
-                               }
-
                                int new_status;
 
-                               if (!AltosVersion.has_google_maps_api_key()) {
-                                       synchronized (fetch_lock) {
-                                               long startTime = System.nanoTime();
-                                               new_status = fetch_url();
-                                               if (new_status == AltosMapTile.fetched) {
-                                                       long duration_ms = (System.nanoTime() - startTime) / 1000000;
-                                                       if (duration_ms < google_maps_ratelimit_ms) {
-                                                               try {
-                                                                       Thread.sleep(google_maps_ratelimit_ms - duration_ms);
-                                                               } catch (InterruptedException e) {
-                                                                       Thread.currentThread().interrupt();
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               } else {
-                                       new_status = fetch_url();
-                               }
+                               new_status = fetch_url();
+
                                notify_listeners(new_status);
                        } finally {
                                finish_fetcher();
index 1fb7194a932ecf632263c2dcd71f5fda18a0be68..6d9a00a8e3be2d186e610924ebdc3943866a68bb 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosMapStoreListener {
        abstract void notify_store(AltosMapStore store, int status);
index 4b01e437b898c3c8dfb46445bf99c61ebd9202e7..6318c40d0c46a66ed0078859ae26818a0b348585 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 3c6275a076451fd1afa2633bb720283c9a26cfae..971d7744cb268d6b5b5cca4511ec2ef0c8f9bccf 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosMapTileListener {
        abstract public void notify_tile(AltosMapTile tile, int status);
index b6d4f4356af8166b4dd3322092aaa2ce9682dd39..6bc6c6f809baaa114dcb6928c94f0b49ceea601b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.lang.Math;
index 94401a0031045496e7bae9bdc5e5a701e24206bf..f1b9d0747654c70a55b399ed3e69d730dbc7385f 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosMapTypeListener {
        public void map_type_changed(int map_type);
index c4a0acd64175e625db023ea8292606d47c290713..7044a220eeabe46a31986b67d8d869853438fb33 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosMapZoomListener {
        abstract public void zoom_changed(int zoom);
index 0f6022ac4d89c34ac077e9eb8a477bb6caeb6e0f..3a728ac4d3f6092af73c3301c8316f7340d315df 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.*;
 
index 5b3ba65d2040a1df3331312e899e09c8042e6266..c4ddaea9528ce14caae4b06d2eb388b69afe3e6a 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.*;
 import java.io.*;
index 8372d39675303b6367786902e006dd5e01ba8b11..b824b7f1871a2fb6a425a996f83875ca3fb86119 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosNoSymbol extends Exception {
        public AltosNoSymbol(String name) {
index 4546a798cde8d30d8e653d0c4f7ad212bdebfcc4..8f532da10bd858da6a8ca95a91ef9e224f7d40ea 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosOrient extends AltosUnits {
 
index 77cf969df33fa357390bc7c011ac0d8806f6d556..8ba4d5b2ee5e3cbadd8272a123c10854dc07f76f 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.text.*;
index 301d07b058004567df2ea4e08b129d2b02ad076c..59e2f76c9fff051508a7f8d246dc3d35b616cca1 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosPointDouble {
        public double   x, y;
index 25f5dd2a9693df3bc9177d7ccf639ac590902656..50503cd87b59658e1999dc7fd0b5383d14d6ba93 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosPointInt {
        public int      x, y;
index c511332bac7a3c967ee348939f47db2a1ed010a9..f277f31a2eac62e5c686c501f390702276708dfc 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 00fd2c6d75d7a7e4f2d093083eb8331e8a405381..559cff07a057412b2b98e19fd312769c61b3793b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 4cd382c8b44d406db884817bb0da4268841426f6..3869528e2eb6fe9114a644bbd7c289f161d72de3 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosPresTemp {
        double  pres = AltosLib.MISSING;
index 507a4ceeb7d152d44bb542e1e4386f9bb1c5d687..63884a44960be9c37620e3d16fa6777e0d4923dd 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosPressure extends AltosUnits {
 
index e4f575789261e7d4108e3338bb9e347733cdb2b9..1872392d805c26136c22973938d54916d4c98dca 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index fea4fd5955f7f03d87aa926034b8f294b7df90b2..b716f4e3c8532a0c91793922ab90615c08725f4d 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.text.*;
index 0152e479b9e1b15396b86d0b58172ddecd1cc5cc..0a2c5a6675d9fcc4e26508438510343622a2e4c9 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosPyroName extends AltosUnits {
 
index 6d6bc12c1cf434c01357d4ea3e011addb998c1af..98790f5fcfecbc68701dd28b930434a5d69eff5c 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosQuaternion {
        double  r;              /* real bit */
index 91cce624a423d581bd374bce327523244a12b1a5..a84cc3f9a5564a96cedde236d63a3612e3f76e97 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 
index 810388ed458283f909a9286300edfebd498651e7..3b46bd7c12435afff4cf18ce30763fff2ee41582 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosRectangle {
        public int      x, y, width, height;
index fab28cac3cddeec78dde18ef1a6020ae39d10365..1960aac002269476d54a185511d1b9d54de2f8fe 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 44a3fa6097fc8d376394824614cab76edd493c81..ebeb76f32b54375db7ed9b1be2469f3658f0f949 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
+import java.util.concurrent.*;
 
-public class AltosRomconfig {
+public class AltosRomconfig implements AltosUnitInfoListener {
        public boolean  valid;
+       public boolean  radio_calibration_broken;
        public int      version;
        public int      check;
        public int      serial_number;
@@ -32,15 +34,11 @@ public class AltosRomconfig {
        static private long find_address(AltosHexfile hexfile, String name, int len) throws AltosNoSymbol {
                AltosHexsym symbol = hexfile.lookup_symbol(name);
                if (symbol == null) {
-                       System.out.printf("no symbol %s\n", name);
                        throw new AltosNoSymbol(name);
                }
                if (hexfile.address <= symbol.address && symbol.address + len <= hexfile.max_address) {
-                       System.out.printf("%s: %x\n", name, symbol.address);
                        return symbol.address;
                }
-               System.out.printf("invalid symbol addr %x len %d range is %x - %x\n",
-                                 symbol.address, len, hexfile.address, hexfile.max_address);
                throw new AltosNoSymbol(name);
        }
 
@@ -121,40 +119,60 @@ public class AltosRomconfig {
        final static String ao_radio_cal = "ao_radio_cal";
        final static String ao_usb_descriptors = "ao_usb_descriptors";
 
+       Semaphore       unit_info_done;
+
+       public void notify_unit_info(AltosUnitInfo unit_info) {
+               unit_info_done.release();
+       }
+
+       private void fetch_radio_cal() {
+               unit_info_done = new Semaphore(0);
+               AltosUnitInfo   info = new AltosUnitInfo(serial_number, this);
+
+               /* Block waiting for the rf calibration data */
+               radio_calibration_broken = true;
+               try {
+                       unit_info_done.acquire();
+                       int new_cal = info.rfcal();
+                       if (new_cal != AltosLib.MISSING) {
+                               radio_calibration = new_cal;
+                               radio_calibration_broken = false;
+                       }
+               } catch (InterruptedException ie) {
+               }
+       }
+
        public AltosRomconfig(AltosHexfile hexfile) {
                try {
-                       System.out.printf("Attempting symbols\n");
                        version = get_int(hexfile, ao_romconfig_version, 2);
-                       System.out.printf("version %d\n", version);
                        check = get_int(hexfile, ao_romconfig_check, 2);
-                       System.out.printf("check %d\n", check);
                        if (check == (~version & 0xffff)) {
                                switch (version) {
                                case 2:
                                case 1:
                                        serial_number = get_int(hexfile, ao_serial_number, 2);
-                                       System.out.printf("serial %d\n", serial_number);
                                        try {
                                                radio_calibration = get_int(hexfile, ao_radio_cal, 4);
                                        } catch (AltosNoSymbol missing) {
                                                radio_calibration = 0;
                                        }
+
                                        valid = true;
+
+                                       /* XXX TeleBT v4.0 units originally shipped without RF calibration programmed. Go fetch
+                                        * the correct value from the web site
+                                        */
+                                       if (serial_number == 2584 ||
+                                           (3686 <= serial_number && serial_number <= 3938 && radio_calibration == 5695485))
+                                       {
+                                               fetch_radio_cal();
+                                       }
+
                                        break;
                                }
                        }
-                       System.out.printf("attempting usbid\n");
                        usb_id = hexfile.find_usb_id();
-                       if (usb_id == null)
-                               System.out.printf("No usb id\n");
-                       else
-                               System.out.printf("usb id: %04x:%04x\n",
-                                                 usb_id.vid, usb_id.pid);
                        usb_product = hexfile.find_usb_product();
-                       if (usb_product == null)
-                               System.out.printf("No usb product\n");
-                       else
-                               System.out.printf("usb product: %s\n", usb_product);
 
                } catch (AltosNoSymbol missing) {
                        valid = false;
@@ -197,7 +215,6 @@ public class AltosRomconfig {
 
                                if (addr < base)
                                        base = addr;
-                               System.out.printf("symbol %s at %x base %x\n", name, addr, base);
                        } catch (AltosNoSymbol ns) {
                                if (name_required(name))
                                        throw (ns);
@@ -214,7 +231,6 @@ public class AltosRomconfig {
                                long    addr = find_address(hexfile, name, len) + len;
                                if (addr > bounds)
                                        bounds = addr;
-                               System.out.printf("symbol %s at %x bounds %x\n", name, addr, bounds);
                        } catch (AltosNoSymbol ns) {
                                if (name_required(name))
                                        throw (ns);
index eec8c5296fd8956ba4f89f35b382c8bdc832cd2f..54b3b1f939a46d1d12fff739fe8b658994afd035 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosRotation extends AltosQuaternion {
        private AltosQuaternion         rotation;
index 492f1217312a1cf9728447132edfddf3792223ca..b8490d79d981b8537854458b0fa719ead79a6b88 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosRotationRate extends AltosUnits {
 
index 6687686468b283e62c805197a25f249f075b6335..3e572dc3cee78cc85baedf1a6bec3d0dcb145ffb 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
index c7ea147f97d70bd667b165e093ba6afef0652944..0250cce741a6d1f3c64713418f5a953b12f04412 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 
@@ -45,7 +45,6 @@ public class AltosSelfFlash extends AltosProgrammer {
                int b;
                byte[]  data = new byte[len];
 
-               System.out.printf("read_memory %x %d\n", addr, len);
                for (int offset = 0; offset < len; offset += 0x100) {
                        link.printf("R %x\n", addr + offset);
                        byte[]  reply = link.get_binary_reply(5000, 0x100);
@@ -101,7 +100,7 @@ public class AltosSelfFlash extends AltosProgrammer {
                        long flash_addr = image.address;
                        int image_start = 0;
 
-                       action("start", 0);
+                       action(AltosFlashListener.flash_start, 0);
                        action(0, image.data.length);
                        while (remain > 0 && !aborted) {
                                int this_time = remain;
@@ -129,7 +128,7 @@ public class AltosSelfFlash extends AltosProgrammer {
                                action(image.data.length - remain, image.data.length);
                        }
                        if (!aborted) {
-                               action("done", 100);
+                               action(AltosFlashListener.flash_done, 100);
                        }
                        close();
                } catch (IOException ie) {
@@ -161,7 +160,8 @@ public class AltosSelfFlash extends AltosProgrammer {
                        long base = AltosRomconfig.fetch_base(image);
                        long bounds = AltosRomconfig.fetch_bounds(image);
 
-                       System.out.printf("rom base %x bounds %x\n", base, bounds);
+                       if (link.debug)
+                               System.out.printf("rom base %x bounds %x\n", base, bounds);
                        return read_hexfile(base, (int) (bounds - base));
                } catch (AltosNoSymbol ns) {
                        return null;
index 1bdbb60c4a33624ed2a6c95e2c36f33a181f5eac..e7f540fde55d76ab5c26d6cc26c666b113d0210b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index 00873afe5fd343ab86ee8a6cfaa5b1cff4cc0c17..a689aef013610eb37f6748fee8bb49d0d73462bd 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index e58b03a1342e329be3741d93fb5049328ee511ff..0aa52176d48b03ba6fdad5c5fb892414bf26bf38 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index e01d57cc6bacaf9085f9c55d5fc59a6ed6cf38be..efed1a6f55883b0b54a0c9d99c3db1049b017567 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index 14514413de9aceadb57ef6aa0b05251e6a331996..485e8b3caa2048d7735763c19d61abd84775ba56 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index bdedaa9c88b1218cb64e8a1a91dfbbd0c1163145..a25f4d1962474eaeedd613ba6af8d7eec1fe6ed4 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index 9b5a18545070e7e331886a8e62f33af712aaa179..941e82a2c271540c3648e3015a606bda9be4144c 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index b92def03475357ca1b563615501f292ae6392004..e43c05c5b3f8adb7c3ecf3637190899df0caee37 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.concurrent.TimeoutException;
 
index 2a8ccedcd47a89523ad844bbfc975c5464102da1..af10ad274642666c53ccf2168108ec22fe9e319d 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosSpeed extends AltosUnits {
 
index 68097faf8bb6b589d600b61adfd4d9e6ae0b4df3..93104fb0878c946468aaec1f898b3e844de4c6af 100644 (file)
@@ -20,7 +20,7 @@
  * Track flight state from telemetry or eeprom data stream
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosState extends AltosDataListener {
 
index 5ba21f27f8317f32151733e1a0d714573a87aacc..e5292d307fb3b23facf9db907a27d2e3039bde9a 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosStateName extends AltosUnits {
 
index 48fff3ea72223d28d1ddfb4be65be1bcbbf0478e..ee2415caafce894c444ce16c89405441131dfa27 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 import java.io.*;
index a374519d41c50d34508fb6dc1971ae37ba763b4c..a19e4226160a7e7d561a8c36a003191b26789419 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 
index c6dfe3eb90a54d2a1579bc7610a12d75260d1439..091c8bd88d20e16a12c5290ad29cbe31d0801c68 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTelemetryCompanion extends AltosTelemetryStandard {
 
index c8026a8353923535b364e3d769944f5305f80926..4411a77d44c635d601582b17cf3805f09b5a50d3 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetryConfiguration extends AltosTelemetryStandard {
index e51455f8bb8c00cd4dabb62aa134276942e2e5f9..679c6809559508a7b7c8719e8255b0d0ac00837a 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index d3e4ce67b83bcd5342557eaa066877c57cbb05fe..8cd0c9c7a274c94dfc50672dc972d44b59154023 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.io.*;
 import java.util.*;
index 027f601e1aa553fa022ae12636e55ee9ac8d7f58..d2b29835616432bcf5b0ccbd54b217b66e7d42a1 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 
index e2925a58c165caf6e534b4c729b8996547e56ff0..25570bf934f8c923d3fed8da473eff1852136408 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetryLocation extends AltosTelemetryStandard {
index a7ddc684ee1a25b7bd2b72d5ba269d10937f17cc..fa275e1df8a5b00a89111da78e19ab78a4c1812f 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 import java.text.*;
 import java.util.HashMap;
 
index f5961c8c03c87443c946fdf94615ba4b7e7cc701..1a0bff315f3474109d508bf85995be71574f1dff 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTelemetryMegaData extends AltosTelemetryStandard {
 
index 4c64b55456b9ef8731593aafc2c2177ff0132aa2..e97e18e2872da723093e5fbf4704d1dd55102e08 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
        int     orient() { return int8(5); }
index 8cd09b41c3b697a60a7350a00952d2cdbfc2cb2d..4a9dcd64d31a3fd1234fd57c163f51ac18e53510 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetryMetrumData extends AltosTelemetryStandard {
index 79d3a499dcad7edde7443852bac42c4028484dce..383f645ad7e2244c5b4bbe3573155873152ac7d0 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetryMetrumSensor extends AltosTelemetryStandard {
index 3ea287ac23de4206022c2a67c3aee38ce043d5b0..86e10539bc46737962183dfaed9a38aedee42ba4 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetryMini2 extends AltosTelemetryStandard {
index c66f8e6114316da6e6e1538b6b96066505b5ff5e..b18314420203f1053f9ae42f66f96a3dac8bdae1 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetryMini3 extends AltosTelemetryStandard {
index f2108d6861bbcf886987555f5d1bc34023b1f859..88f23f5e07615a98838f94ac01f42429bcf18264 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTelemetryRaw extends AltosTelemetryStandard {
        public AltosTelemetryRaw(int[] bytes) throws AltosCRCException {
index 8fb61a4fe32490cbc4a31a6f16dbb71f33d0f643..de957f65b34005fccc1f87b0f33eab6b56ff0057 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 import java.io.*;
index 0965df9fec8df6c3c42a96267c1b9d0512fd2ff1..8213a43eda437694d44fb81e5991c1d33fe40f00 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTelemetrySatellite extends AltosTelemetryStandard {
        int             channels() { return uint8(5); }
index dc8efa9b1d7c3a269b9b1c4371d870f1547e6e3b..2219088a07fc133fd84067743adfea467562c04c 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 
 public class AltosTelemetrySensor extends AltosTelemetryStandard {
index 2a1c93652f08d8f42379deb693c587fdda1eb3e5..3f585ceafb49f5721ceef61907231342fc1a4a12 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public abstract class AltosTelemetryStandard extends AltosTelemetry {
        public int int8(int off) {
index efc6d5e122902801ea686e6b78b58ceec8180982..b1526a4b8ce0dcb4b4863bb94f96926c4d2417a5 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTemperature extends AltosUnits {
 
index 5c6ab0378f356d56ee2b48adab1de1e859426049..d0057969017caaf02b7e258632636ffe9a55ef3d 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTime extends AltosUnits {
        public double value(double v, boolean imperial_units) { return v; }
index c6a780a31a6e41023a8ceaccb5799b85ad287b71..75225e1558d236ae45bdd34e72509fcce48905ab 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.util.*;
 
index 298ac7f05d78f5c1e6b64a5f3ab0f0c363b29343..e94370a7e853ddd9ed03b99ef20b5c2fa5d3893c 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosTimeValue {
        public double   time;
diff --git a/altoslib/AltosUnitInfo.java b/altoslib/AltosUnitInfo.java
new file mode 100644 (file)
index 0000000..2a9f470
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package org.altusmetrum.altoslib_13;
+
+import java.io.*;
+import java.lang.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.net.*;
+import java.text.*;
+
+public class AltosUnitInfo extends Thread {
+       int                     sn;
+       int                     rfcal;
+       AltosUnitInfoListener   listener;
+       String                  json_string;
+
+       public int sn() {
+               return sn;
+       }
+
+       public int rfcal() {
+               return rfcal;
+       }
+
+       void add(String line) {
+               if (json_string == null) {
+                       json_string = line;
+               } else {
+                       json_string = json_string + "\n" + line;
+               }
+       }
+
+       void notify_complete() {
+               rfcal = AltosLib.MISSING;
+
+               if (json_string != null) {
+                       System.out.printf("json_string: %s\n", json_string);
+                       AltosJson json = AltosJson.fromString(json_string);
+                       System.out.printf("json: %s\n", json);
+                       String rfcal_string = null;
+                       try {
+                               AltosJson unitinfo = json.get("unitinfo");
+                               rfcal_string = unitinfo.get_string("rfcal", null);
+                               if (rfcal_string != null)
+                                       rfcal = Integer.parseInt(rfcal_string);
+                       } catch (NumberFormatException ne) {
+                               System.out.printf("mal-formed integer %s\n", rfcal_string);
+                       } catch (IllegalArgumentException ie) {
+                               System.out.printf("mal-formed json\n");
+                       }
+               }
+               listener.notify_unit_info(this);
+       }
+
+       public void run() {
+               try {
+                       String  format;
+
+                       format = System.getenv(AltosLib.unit_info_env);
+                       if (format == null)
+                               format = AltosLib.unit_info_url;
+
+                       String path = String.format(format, sn);
+
+                       URL url = new URL(path);
+
+                       System.out.printf("URL: %s\n", path);
+
+                       URLConnection uc = url.openConnection();
+
+                       InputStreamReader in_stream = new InputStreamReader(uc.getInputStream(), AltosLib.unicode_set);
+                       BufferedReader in = new BufferedReader(in_stream);
+
+                       for (;;) {
+                               String line = in.readLine();
+                               if (line == null)
+                                       break;
+                               add(line);
+                       }
+               } catch (Exception e) {
+                       System.out.printf("file exception %s\n", e.toString());
+               } finally {
+                       notify_complete();
+               }
+       }
+
+       public AltosUnitInfo(int sn, AltosUnitInfoListener listener) {
+               this.listener = listener;
+               this.sn = sn;
+               this.rfcal = AltosLib.MISSING;
+               start();
+       }
+}
diff --git a/altoslib/AltosUnitInfoListener.java b/altoslib/AltosUnitInfoListener.java
new file mode 100644 (file)
index 0000000..3753df4
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package org.altusmetrum.altoslib_13;
+
+public interface AltosUnitInfoListener {
+       public abstract void notify_unit_info(AltosUnitInfo unit_info);
+}
index e119448767d024a07a962b73a2afff61bbf4cf66..9295b8e82410d249e0e7d1b42758fabbceaabdee 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 
index 1f06afbf1d1fce81daad204727d9dd7fccd48294..e37027a60fa94e86151240e8d165267c3f9bc2da 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosUnitsListener {
        public void units_changed(boolean imperial_units);
index 6bf0d91fc8baf470f8cf2500791a0381caf73693..58f918bacf9167522c8e7b4e45cb8e5dadeb92df 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import java.text.*;
 
index e4bebcd44a0297d4fb3ef70e4038f05e4de18497..dd108a2e74a111c5c7a04c3d2ee3b8d069b7f4c4 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosUnknownProduct extends Exception {
        public String product;
index e37943043e2342f7875fddbce8b450713ab388b9..5c70341d6b089a10c49899ec5575612cc57a4f0b 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosUsbId {
        public int      vid;
index c8399f2ec8419db637a2c2d183ab7a59747ab887..6b660bb5494613ec442371cbb63ecf69808b5e2d 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosVersion {
        public final static String version = "@VERSION@";
-
-       public final static String google_maps_api_key = "@GOOGLEKEY@";
-
-       public static boolean has_google_maps_api_key() {
-               return google_maps_api_key != null && google_maps_api_key.length() > 1;
-       }
 }
index ef53ac11cd3072e277b0224a7c81e53e619bb957..aca82e281661f3d18cde0bbb099994c0acbd484b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public class AltosVoltage extends AltosUnits {
 
index c77e48b0d7d17fb762538f4e88d2c5eca22adacd..7bb0ec0d55ef417d9628cdc24f6b5980dcea0d43 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 public interface AltosWriter {
 
index 7c5d767d7916d34ac1fad9f32e7c1560c67c9a0f..929763324a3788f5aacb5875e7f4d4646ae6f09e 100644 (file)
@@ -183,7 +183,9 @@ altoslib_JAVA = \
        AltosMapLoader.java \
        AltosMapTypeListener.java \
        AltosJson.java \
-       AltosVersion.java
+       AltosVersion.java \
+       AltosUnitInfo.java \
+       AltosUnitInfoListener.java
 
 JAR=altoslib_$(ALTOSLIB_VERSION).jar
 
index 9f176c4bef2a236f8a581a806446a297966a2192..36b951e3c2c99ce283753fa97411be2749a5150c 100644 (file)
@@ -21,8 +21,8 @@ package altosui;
 import java.awt.*;
 import libaltosJNI.*;
 
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class Altos extends AltosUILib {
 
index ab052e5f6c0831d06df71f1f2aaa75328346cbb0..be3f9ce757897c69bce8b746bf28337e77c40b4c 100644 (file)
@@ -22,8 +22,8 @@ import java.util.*;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosAscent extends AltosUIFlightTab {
        JLabel  cur, max;
index 95e1d2d90a7469054f745cf585ffb01488f00cd2..9c788971f78056996e5eeabb5170d16896f7b7dd 100644 (file)
@@ -20,8 +20,8 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosCompanionInfo extends JTable implements AltosFlightDisplay {
        private AltosFlightInfoTableModel model;
index 5e2aa7f4ef405470c0106a3255fb9a7bf8399e55..01ba9c0d37639c02417a21b3a10f42935e86ad77 100644 (file)
@@ -23,8 +23,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosConfigFC implements ActionListener {
 
index 9bd265f096f92c67900b47d454c1b18454972434..b4c37e0bff7143f8163c3df5cc8683a6efa09600 100644 (file)
@@ -23,8 +23,8 @@ import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosConfigFCUI
        extends AltosUIDialog
index 62c434ac72c71cd29ff582629cd2f8a2263b073d..c05b6e9197d8d1b66c4708094be327cd20cafb19 100644 (file)
@@ -23,8 +23,8 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosConfigPyroUI
        extends AltosUIDialog
index 9fedc56db94ac4d42e8bd5b776ad29fe13f679b4..4c6d18469b7a2881fe7d59f77b05e33049e25b1f 100644 (file)
@@ -22,8 +22,8 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosConfigTD implements ActionListener {
 
index 3ff5621843d4166a4e47e213124274b19c37630c..12b6e4bf55b943a32556bd6d8a22553ec9744d7f 100644 (file)
@@ -22,8 +22,8 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosConfigTDUI
        extends AltosUIDialog
index acafc65996f3e22b6c5359ffd809d63789b7e9e2..8b62a212a0e8350526b2db1dfff9fa95e20653ea 100644 (file)
@@ -23,7 +23,7 @@ import java.awt.event.*;
 import java.beans.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosConfigureUI
        extends AltosUIConfigure
index 2cc65b088b5ea9d208422dd572eec7ec6efb7eaf..09db6ac01be20e762c5cd6a593f0d66cd08d1c3c 100644 (file)
@@ -22,8 +22,8 @@ import java.util.*;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosDescent extends AltosUIFlightTab {
 
index a5e5a4efec4fea8fae1f2dd3f78c9539145e492d..207c44b48da275e086944f5b1dbef1521fb254e1 100644 (file)
@@ -20,8 +20,8 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosFlightStatus extends JComponent implements AltosFlightDisplay {
        GridBagLayout   layout;
index 9c4e1beed300ab3330cd84e575cb0affcffbfa87..823dbc3c01072b68683c17af41d7b89009b26dbf 100644 (file)
@@ -28,7 +28,7 @@ import java.util.*;
 import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.LinkedBlockingQueue;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosFlightStatusTableModel extends AbstractTableModel {
        private String[] columnNames = {
index b8b0d38a9d56bf7f2a62a623d896727c4bf13eae..2f9c728c79ffa70ae7fef405b7906a6d4cbd09c8 100644 (file)
@@ -19,7 +19,7 @@
 package altosui;
 
 import java.awt.event.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosFlightStatusUpdate implements ActionListener {
 
index 44e995be300e8be012a3ce01fcd3d55c279a5af4..8742b8ca33210b8983c2d5504b2266a472d8e58d 100644 (file)
@@ -23,8 +23,8 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.util.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay {
        AltosVoice              voice;
index f387ed9bcceab91f8fda37c78a24393104537b2f..59b06c18da42a68a03934df79a0713f528121281 100644 (file)
@@ -24,8 +24,8 @@ import java.util.ArrayList;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 import org.jfree.chart.ChartPanel;
 import org.jfree.chart.JFreeChart;
index 584f143a9d112f17f6e6ea80b8b8d5b534feed92..fc76b2b658c87db172a8043bce7e6912679ae7fa 100644 (file)
@@ -25,8 +25,8 @@ import javax.swing.event.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.Arrays;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener {
        AltosDevice             device;
index debbf763481136e781ff274d165da27c2d0abb54..406b51cf2f1ef25edd7f3a2342745471ab98f802 100644 (file)
@@ -25,8 +25,8 @@ import java.io.*;
 import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosIgniteUI
        extends AltosUIDialog
index 7c7d1fba2cac14c925f018494f7d3bd638f74b9a..38332b2f367c28d579f5122efcf75174313daa61 100644 (file)
@@ -21,8 +21,8 @@ package altosui;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosIgnitor extends AltosUIFlightTab {
 
index c2e149232cbfed35871e0a96680d74d8a54b29d8..5952238a3f772b725e6c7f3ba7f7dcc930ee3c37 100644 (file)
@@ -22,8 +22,8 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosLanded extends AltosUIFlightTab implements ActionListener {
 
index f1893cf505a3cf5a92625e6e3137e9a63efaf28a..7e47586d17be8d40d0a633268aa8a68c1ebbe2da 100644 (file)
@@ -21,7 +21,7 @@ package altosui;
 import java.io.*;
 import java.util.concurrent.*;
 import java.awt.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosLaunch {
        AltosDevice     device;
index 8a24ed3e1f2a54beefac6eef78077cf3b5e1e541..56b211acd146e26a532d05a8f767fc03b928af71 100644 (file)
@@ -24,7 +24,7 @@ import javax.swing.*;
 import java.io.*;
 import java.text.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 class FireButton extends JButton {
        protected void processMouseEvent(MouseEvent e) {
index 0aeef8e159cd92bf79c3826f5f445c162deca8e7..60f5890588cd218a00b6f34d693b060b3221c89a 100644 (file)
@@ -19,8 +19,8 @@
 package altosui;
 
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosPad extends AltosUIFlightTab {
 
index c661d3e15cee1d93f2e7732df096700c8862fd41..16966918da4e3f715b18f4e71db0714ebb17f56e 100755 (executable)
Binary files a/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub and b/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub differ
index 02e49a94a82954412d4212730776b3cdceab8362..82ec47465f90a30477bd434daafe270ca7631b24 100644 (file)
@@ -23,8 +23,8 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosUI extends AltosUIFrame implements AltosEepromGrapher {
        public AltosVoice voice = new AltosVoice();
index 805c55505ed76d6115c4ee00678bc7f7c3136f93..144d21d73cd9bb3131d31d5f52658a8db481a914 100644 (file)
@@ -141,7 +141,8 @@ FIRMWARE_TBT=$(FIRMWARE_TBT_1_0) $(FIRMWARE_TBT_3_0) $(FIRMWARE_TBT_4_0)
 
 FIRMWARE_TMEGA_1_0=$(top_srcdir)/src/telemega-v1.0/telemega-v1.0-$(VERSION).ihx
 FIRMWARE_TMEGA_2_0=$(top_srcdir)/src/telemega-v2.0/telemega-v2.0-$(VERSION).ihx
-FIRMWARE_TMEGA=$(FIRMWARE_TMEGA_1_0) $(FIRMWARE_TMEGA_2_0)
+FIRMWARE_TMEGA_3_0=$(top_srcdir)/src/telemega-v3.0/telemega-v3.0-$(VERSION).ihx
+FIRMWARE_TMEGA=$(FIRMWARE_TMEGA_1_0) $(FIRMWARE_TMEGA_2_0) $(FIRMWARE_TMEGA_3_0)
 
 FIRMWARE_EMINI_1_0=$(top_srcdir)/src/easymini-v1.0/easymini-v1.0-$(VERSION).ihx
 FIRMWARE_EMINI=$(FIRMWARE_EMINI_1_0)
@@ -183,7 +184,8 @@ LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(L
 LINUX_EXTRA=altosui-fat
 
 MACOSX_INFO_PLIST=Info.plist
-MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICONS)
+MACOSX_INSTALL=install-macosx
+MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICONS) $(MACOSX_INSTALL)
 MACOSX_EXTRA=$(FIRMWARE)
 
 WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICONS)
@@ -374,7 +376,8 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
        -rm -rf macosx
        mkdir macosx
        cp -a AltosUI.app macosx/
-       cp -a ReadMe-Mac.rtf macosx/ReadMe.rtf
+       cp -a $(MACOSX_INSTALL) macosx
+       cp -a ReadMe-Mac.rtf macosx/ReadMe-AltosUI.rtf
        mkdir -p macosx/Doc
        cp -a $(DOC) macosx/Doc
        cp -p Info.plist macosx/AltosUI.app/Contents
index 8a95262ccd3b1eb54b49b80023f8cb725a771ba3..c15994bc42b60df001407519c5c82711e0574e62 100644 (file)
@@ -1,13 +1,14 @@
 {\rtf1\ansi\deff3\adeflang1025
-{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset128 Liberation Serif{\*\falt Times New Roman};}{\f4\fswiss\fprq2\fcharset128 Arial;}{\f5\fnil\fprq2\fcharset128 SimSun;}{\f6\fnil\fprq2\fcharset128 Raghindi;}{\f7\fnil\fprq0\fcharset128 Raghindi;}}
-{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
-{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033 Normal;}
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset0 Arial;}{\f5\froman\fprq2\fcharset0 Helvetica LT Std;}{\f6\froman\fprq2\fcharset0 Helvetica{\*\falt Arial};}{\f7\fnil\fprq2\fcharset0 SimSun;}{\f8\fnil\fprq2\fcharset0 Helvetica LT Std;}{\f9\fnil\fprq2\fcharset0 Helvetica{\*\falt Arial};}{\f10\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+{\stylesheet{\s0\snext0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033 Normal;}
 {\*\cs15\snext15 Numbering Symbols;}
-{\s16\sbasedon0\snext17\sb240\sa120\keepn\hich\af5\dbch\af6\afs28\loch\f4\fs28 Heading;}
-{\s17\sbasedon0\snext17\sb0\sa120 Text body;}
-{\s18\sbasedon17\snext18\sb0\sa120\dbch\af7 List;}
-{\s19\sbasedon0\snext19\sb120\sa120\noline\i\dbch\af7\afs24\ai\fs24 Caption;}
-{\s20\sbasedon0\snext20\noline\dbch\af7 Index;}
+{\s16\sbasedon0\snext17\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f4\fs28\lang1033 Heading;}
+{\s17\sbasedon0\snext17\sl276\slmult1\ql\nowidctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f3\fs24\lang1033 Text Body;}
+{\s18\sbasedon17\snext18\sl276\slmult1\ql\nowidctlpar\hyphpar0\sb0\sa120\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f3\fs24\lang1033 List;}
+{\s19\sbasedon0\snext19\ql\nowidctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\i\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f3\fs24\lang1033 Caption;}
+{\s20\sbasedon0\snext20\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f3\fs24\lang1033 Index;}
+{\s21\sbasedon0\snext21\ql\nowidctlpar\hyphpar0\sb0\sa120\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\loch\f3\fs24\lang1033 Text body;}
 }{\*\listtable{\list\listtemplateid1
 {\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00);}{\levelnumbers\'01;}\fi-360\li720}
 {\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080}
 {\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240}
 {\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600}\listid1}
 {\list\listtemplateid2
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-432\li432}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-576\li576}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-720\li720}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-864\li864}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-1008\li1008}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-1152\li1152}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-1296\li1296}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-1440\li1440}
-{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow0{\leveltext \'00;}{\levelnumbers;}\fi-1584\li1584}\listid2}
-}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}{\info{\creatim\yr2013\mo1\dy6\hr13\min7}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern3500}}\deftab709
-
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}\listid2}
+}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}{\*\generator LibreOffice/6.1.2.1$Linux_X86_64 LibreOffice_project/10$Build-1}{\info{\creatim\yr2013\mo1\dy6\hr13\min7}{\revtim\yr2018\mo10\dy5\hr19\min22}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab709
+\hyphauto0\viewscale150
 {\*\pgdsctbl
-{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default;}}
-\formshade\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
-\pgndec\pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
+{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Default Style;}}
+\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
 Installing AltOS software for Mac OS X Computers}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
-}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af7\langfe1081\dbch\af9\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
 The AltOS distribution for Mac OS X consists of:}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
-}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\listtext\pard\plain  1)\tab}\ilvl0\ls1 \li720\ri0\lin720\rin0\fi-360{\rtlch \ltrch\loch
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033{\listtext\pard\plain  1)\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\li720\ri0\lin720\rin0\fi-360{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
 The AltosUI application}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\listtext\pard\plain  2)\tab}\ilvl0\ls1 \li720\ri0\lin720\rin0\fi-360{\rtlch \ltrch\loch
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033{\listtext\pard\plain  2)\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\li720\ri0\lin720\rin0\fi-360{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
 Current AltOS firmware for Altus Metrum products}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
-}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
-Install the AltosUI application by dragging it to your Applications folder (or wherever else you want to install it).}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
-}
-\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\hich\af5\langfe2052\dbch\af6\afs24\alang1081\loch\f3\fs24\lang1033{\rtlch \ltrch\loch
-The AltOS firmware can be used to update your Altus Metrum products to the latest firmware version, you can copy it to your disk if you like, or simply use it directly from the installation disk image.}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+Install the AltosUI application by control-clicking the install-macosx script and selecting \u8220\'93Open\u8221\'94 from the menu. This will display a dialog asking if you are sure you want to open it. Select \u8220\'93Open\u8221\'94 from the dialog to execute the script. This will install the software, documentation and firmware in your home Applications/AltOS folder. You can move it afte}{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+r}{\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+wards if you choose.}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af7\langfe1081\dbch\af8\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1033\sl240\slmult1\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af7\langfe1081\dbch\af9\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+Thanks for choosing AltusMetrum products!}
 \par }
\ No newline at end of file
index 23d6f6bd25f0c807d8f4601da76170c0ff7a11dc..be9fb4338437378903cc31cada689e20a0e69253 100644 (file)
@@ -136,6 +136,7 @@ Section "Firmware"
        File "../src/telebt-v4.0/telebt-v4.0-${VERSION}.ihx"
        File "../src/telemega-v1.0/telemega-v1.0-${VERSION}.ihx"
        File "../src/telemega-v2.0/telemega-v2.0-${VERSION}.ihx"
+       File "../src/telemega-v3.0/telemega-v3.0-${VERSION}.ihx"
        File "../src/easymini-v1.0/easymini-v1.0-${VERSION}.ihx"
        File "../src/easymini-v2.0/easymini-v2.0-${VERSION}.ihx"
        File "../src/easymega-v1.0/easymega-v1.0-${VERSION}.ihx"
diff --git a/altosui/install-macosx b/altosui/install-macosx
new file mode 100755 (executable)
index 0000000..aebfd52
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+dir=`dirname "$0"`
+cd "$dir"
+mkdir -p ~/Applications/AltOS
+find ~/Applications/AltOS -type d -print0 | xargs -0 chmod +w
+cp -f -a * ~/Applications/AltOS
+cd ~/Applications/AltOS
+chmod +w *
+xattr -c *
index 5b9ab06ade76dceacee37ddd7e8c72a2baedf032..dcc1f39f02cd958a93e112821c32d6df659d4c2d 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import libaltosJNI.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosBTDevice extends altos_bt_device implements AltosDevice {
 
index ac9068d08f004c1b2661f6dbe474a4edf28d461a..11d9dacdc8ba706130acdc54f77c3f2a23cc6203 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.util.*;
 import libaltosJNI.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosBTDeviceIterator implements Iterator<AltosBTDevice> {
        AltosBTDevice   current;
index 56f1991f19d9f5f30c25f60c8343b3b27f567bca..e8efc2c654adb98852be7e4110e64fc721562668 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosBTKnown implements Iterable<AltosBTDevice> {
        LinkedList<AltosBTDevice>       devices = new LinkedList<AltosBTDevice>();
index aec4c34d2351eb47bc001bde58c2cb78df5c810b..ee0b56ee101aa5b41a4d2236679662e090b07730 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -24,7 +24,7 @@ import javax.swing.*;
 import javax.swing.plaf.basic.*;
 import java.util.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosBTManage extends AltosUIDialog implements ActionListener, Iterable<AltosBTDevice> {
        LinkedBlockingQueue<AltosBTDevice> found_devices;
index 442e3de3520483cf092c1555e482249d01449fb5..c8c6161c7978e6b9ec3a8ccc59b000d2c8b437b9 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosCSVUI
        extends AltosUIDialog
index 055d34f919456a237bedf08311c1d7ea945af88a..618d6517339d9fe9f762cf1fd3c6118d063c2707 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.text.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class AltosEditFreqUI extends AltosUIDialog implements ActionListener {
        Frame           frame;
index b417c732239a9292bef679688cb5ea08b6755f18..caa63e7a4deb702ab0a5a1b54437c06828c90cab 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosDataChooser extends JFileChooser {
        JFrame  frame;
index 44f71f7a96e08d6a208124b01e64eb2545b79956..a5a068b4d95f2eef7d7694c43b425f195558a2c5 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import libaltosJNI.*;
 
@@ -28,4 +28,5 @@ public interface AltosDevice {
        public abstract boolean matchProduct(int product);
        public abstract String getErrorString();
        public SWIGTYPE_p_altos_file open();
+       public abstract boolean equals(Object obj);
 }
index 77249bfcca014a6cd7b6cb3acc86f1aac6fb690f..d8a24b1841d0e0c58c3606907055c8622e96863e 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
 import java.awt.*;
@@ -31,6 +31,8 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL
        public Frame                    frame;
        public int                      product;
        public JPanel                   buttonPane;
+       private Timer                   timer;
+       AltosDevice[]                   devices;
 
        public AltosDevice getValue() {
                return value;
@@ -39,8 +41,16 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL
        public abstract AltosDevice[] devices();
 
        public void update_devices() {
-               AltosDevice[] devices = devices();
+               AltosDevice selected = list.getSelectedValue();
+
+               devices = devices();
                list.setListData(devices);
+               for (AltosDevice d : devices) {
+                       if (d.equals(selected)) {
+                               list.setSelectedValue(d, true);
+                               break;
+                       }
+               }
                select_button.setEnabled(devices.length > 0);
        }
 
@@ -53,8 +63,6 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL
                frame = in_frame;
                value = null;
 
-               AltosDevice[]   devices = devices();
-
                cancel_button = new JButton("Cancel");
                cancel_button.setActionCommand("cancel");
                cancel_button.addActionListener(this);
@@ -62,8 +70,7 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL
                select_button = new JButton("Select");
                select_button.setActionCommand("select");
                select_button.addActionListener(this);
-               if (devices.length == 0)
-                       select_button.setEnabled(false);
+               select_button.setEnabled(false);
                getRootPane().setDefaultButton(select_button);
 
                list = new JList<AltosDevice>(devices) {
@@ -143,10 +150,31 @@ public abstract class AltosDeviceDialog extends AltosUIDialog implements ActionL
                contentPane.add(buttonPane, BorderLayout.PAGE_END);
 
                //Initialize values.
+               update_devices();
                if (devices != null && devices.length != 0)
                        list.setSelectedValue(devices[0], true);
                pack();
                setLocationRelativeTo(location);
+
+               timer = new Timer(1000, new ActionListener () {
+                               public void actionPerformed(ActionEvent evt) {
+                                       update_devices();
+                               }
+                       });
+
+               addComponentListener(new ComponentListener() {
+                               public void componentShown(ComponentEvent e) {
+                                       timer.start();
+                               }
+                               public void componentMoved(ComponentEvent e) {
+                               }
+                               public void componentResized(ComponentEvent e) {
+                               }
+                               public void componentHidden(ComponentEvent e) {
+                                       timer.stop();
+                               }
+                       });
+
        }
 
        //Handle clicks on the Set and Cancel buttons.
index f3409cced157500951119fdb2853c1639c093d8d..93ab178f579150b38201a3c231ac26fbce823fec 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
 import java.awt.*;
index 5e691ac4c47683bb603ac163f28c4665f2206b2e..3726f51526c92f4ad0a34a2ad8a7d49f12f8c894 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import javax.swing.*;
 import java.io.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosDisplayThread extends Thread {
 
index d7dde6df42864709eacf4a61567457d2b21fd524..d7d0b2b7608ed9c84f6b6f24495133d365538515 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosEepromDelete implements Runnable {
        AltosEepromList         flights;
index a29f64eace2572606a529dc9be3144ed8e587af4..b8d3bdaa171c4c18a0fcf3fb5f6347c3afada8e4 100644 (file)
@@ -12,9 +12,9 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public interface AltosEepromGrapher {
 
index 1adf1f0a98d97d570aee0721a9a724547bfe59b1..cab3e8c70f1249428d59ecf4515a66ce8c826fdf 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosEepromManage implements ActionListener {
 
index fc6c95c6e01b9b5b37057e74df9b8f31c955e736..8f6a9b9e1ea5b4b96cfc3c3182a5d333c445590d 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.*;
@@ -24,7 +24,7 @@ import java.util.concurrent.*;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
        class result_holder {
                static int result;
index f88f2bd6ad528713cc358bad57ac4a3d3092973a..427826fad46b49feb40fdb2b8ed0bf99fa3975b7 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
 import javax.swing.border.*;
 import java.awt.*;
 import java.awt.event.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class AltosEepromItem implements ActionListener {
        AltosEepromLog  log;
index 802e8eb3ca764a30589ecff335ad45d73ff90fdb..b91776aa198ebb120c4b0a633c3a4d21ff1830cf 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -24,7 +24,7 @@ import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosFlashUI
        extends AltosUIDialog
@@ -116,10 +116,10 @@ public class AltosFlashUI
                                                              JOptionPane.ERROR_MESSAGE);
                                setVisible(false);
                                dispose();
-                       } else if (cmd.equals("done")) {
+                       } else if (cmd.equals(AltosFlashListener.flash_done)) {
                                setVisible(false);
                                dispose();
-                       } else if (cmd.equals("start")) {
+                       } else if (cmd.equals(AltosFlashListener.flash_start)) {
                                setVisible(true);
                        } else {
                                pbar.setValue(e.getID());
@@ -278,6 +278,12 @@ public class AltosFlashUI
        }
 
        boolean rom_config_matches (AltosRomconfig a, AltosRomconfig b) {
+               if (a == null || b == null)
+                       return (a == null && b == null);
+
+               if (!a.valid || !b.valid)
+                       return false;
+
                if (a.usb_id != null && b.usb_id != null &&
                    (a.usb_id.vid != b.usb_id.vid ||
                     a.usb_id.pid != b.usb_id.pid))
@@ -294,20 +300,42 @@ public class AltosFlashUI
                AltosRomconfig  new_config;
 
                if (!rom_config_matches(existing_config, image_config)) {
+                       int ret;
+                       if (existing_config == null || !existing_config.valid) {
+                               ret = JOptionPane.showConfirmDialog(this,
+                                                                   String.format("Cannot determine target device type\nImage is %04x:%04x %s\nFlash anyways?",
+                                                                                 image_config.usb_id.vid,
+                                                                                 image_config.usb_id.pid,
+                                                                                 image_config.usb_product),
+                                                                   "Unknown Target Device",
+                                                                   JOptionPane.YES_NO_OPTION);
+                       } else {
+                               ret = JOptionPane.showConfirmDialog(this,
+                                                                   String.format("Device is %04x:%04x %s\nImage is %04x:%04x %s\nFlash anyways?",
+                                                                                 existing_config.usb_id.vid,
+                                                                                 existing_config.usb_id.pid,
+                                                                                 existing_config.usb_product,
+                                                                                 image_config.usb_id.vid,
+                                                                                 image_config.usb_id.pid,
+                                                                                 image_config.usb_product),
+                                                                   "Image doesn't match Device",
+                                                                   JOptionPane.YES_NO_OPTION);
+                       }
+                       if (ret != JOptionPane.YES_OPTION)
+                               return false;
+               }
+
+               if (existing_config.radio_calibration_broken) {
                        int ret = JOptionPane.showConfirmDialog(this,
-                                                               String.format("Device is %04x:%04x %s\nImage is %04x:%04x %s\nFlash anyways?",
-                                                                             existing_config.usb_id.vid,
-                                                                             existing_config.usb_id.pid,
-                                                                             existing_config.usb_product,
-                                                                             image_config.usb_id.vid,
-                                                                             image_config.usb_id.pid,
-                                                                             image_config.usb_product),
-                                                               "Image doesn't match Device",
+                                                               String.format("Radio calibration value %d may be incorrect\nFlash anyways?",
+                                                                             existing_config.radio_calibration),
+                                                               "Radio Calibration Invalid",
                                                                JOptionPane.YES_NO_OPTION);
                        if (ret != JOptionPane.YES_OPTION)
                                return false;
                }
 
+
                new_config = AltosRomconfigUI.show(frame, existing_config);
                if (new_config == null)
                        return false;
@@ -329,7 +357,7 @@ public class AltosFlashUI
                                                                    device.toShortString()),
                                                      "Device in use",
                                                      JOptionPane.ERROR_MESSAGE);
-               } else if (e instanceof IOException) {
+               } else {
                        JOptionPane.showMessageDialog(frame,
                                                      e.getMessage(),
                                                      file.toString(),
@@ -412,45 +440,235 @@ public class AltosFlashUI
 
        flash_task      flasher;
 
-       private boolean open_device() throws InterruptedException {
-               try {
-                       link = new AltosSerial(device);
-                       if (is_pair_programmed())
-                               return true;
 
-                       if (link == null)
-                               throw new IOException(String.format("%s: open failed", device.toShortString()));
+       class open_task implements Runnable {
+               AltosDevice     device;
+               Thread          t;
+               open_dialog     dialog;
 
-                       while (!link.is_loader()) {
-                               link.to_loader();
+               public void do_exception(final Exception e) {
+                       SwingUtilities.invokeLater(
+                               new Runnable() {
+                                       public void run() {
+                                               try { dialog.open_exception(e); } catch (Exception ex) { }
+                                       }
+                               });
+               }
 
-                               java.util.List<AltosDevice> devices = null;
+               public void do_success(final AltosLink link) {
+                       SwingUtilities.invokeLater(
+                               new Runnable() {
+                                       public void run() {
+                                               try { dialog.open_success(link); } catch (Exception ex) { }
+                                       }
+                               });
+               }
 
-                               for (int tries = 0; tries < 10; tries++) {
-                                       Thread.sleep(100);
-                                       devices = AltosUSBDevice.list(AltosLib.product_altusmetrum);
-                                       if (devices.size() != 0)
-                                               break;
-                               }
+               public void do_failure() {
+                       SwingUtilities.invokeLater(
+                               new Runnable() {
+                                       public void run() {
+                                               try { dialog.open_failure(); } catch (Exception ex) { }
+                                       }
+                               });
+               }
+
+               public void do_cancel() {
+                       SwingUtilities.invokeLater(
+                               new Runnable() {
+                                       public void run() {
+                                               try { dialog.open_cancel(); } catch (Exception ex) { }
+                                       }
+                               });
+               }
+
+               public void run () {
+                       try {
+                               AltosLink link = null;
+
+                               for (;;) {
+                                       System.out.printf("Attempting to open %s\n", device.toShortString());
+
+                                       link = new AltosSerial(device);
 
-                               if (devices.size() == 1)
-                                       device = devices.get(0);
-                               else {
-                                       device = AltosDeviceUIDialog.show(frame, AltosLib.product_altusmetrum);
-                                       if (device == null)
-                                               return false;
+                                       if (link == null)
+                                               throw new IOException(String.format("%s: open failed",
+                                                                                   device.toShortString()));
+
+                                       /* See if the link is usable already */
+                                       if (is_pair_programmed() || link.is_loader()) {
+                                               System.out.printf("Device ready for use\n");
+                                               do_success(link);
+                                               return;
+                                       }
+
+                                       java.util.List<AltosDevice> prev_devices =
+                                               AltosUSBDevice.list(AltosLib.product_altusmetrum);
+
+                                       /* Nope, switch to loader and
+                                        * wait for it to re-appear
+                                        */
+
+                                       System.out.printf("Switch to loader\n");
+
+                                       link.to_loader();
+
+                                       /* This is a bit fragile, but
+                                        * I'm not sure what else to
+                                        * do other than ask the user.
+                                        *
+                                        * Search for a device which
+                                        * wasn't there before we
+                                        * asked the target to switch
+                                        * to loader mode
+                                        */
+
+                                       device = null;
+                                       for (;;) {
+                                               Thread.sleep(100);
+                                               java.util.List<AltosDevice> devices =
+                                                       AltosUSBDevice.list(AltosLib.product_altusmetrum);
+
+                                               for (AltosDevice d : devices) {
+                                                       boolean matched = false;
+                                                       System.out.printf("\tfound device %s\n", d.toShortString());
+                                                       for (AltosDevice p : prev_devices)
+                                                               if (d.equals(p)) {
+                                                                       matched = true;
+                                                                       break;
+                                                               }
+                                                       if (!matched) {
+                                                               System.out.printf("Identified new device %s\n", d.toShortString());
+                                                               device = d;
+                                                               break;
+                                                       }
+                                               }
+                                               if (device != null)
+                                                       break;
+                                       }
                                }
-                               link = new AltosSerial(device);
+                       } catch (AltosSerialInUseException ee) {
+                               do_exception(ee);
+                       } catch (FileNotFoundException fe) {
+                               do_exception(fe);
+                       } catch (IOException ie) {
+                               do_exception (ie);
+                       } catch (InterruptedException ie) {
                        }
-                       return true;
-               } catch (AltosSerialInUseException ee) {
-                       exception(ee);
-               } catch (FileNotFoundException fe) {
-                       exception(fe);
-               } catch (IOException ie) {
-                       exception (ie);
                }
-               return false;
+
+               public void cancel() {
+                       t.interrupt();
+               }
+
+               public open_task(AltosDevice device, open_dialog dialog) {
+                       this.device = device;
+                       this.dialog = dialog;
+                       t = new Thread(this);
+                       t.start();
+               }
+       }
+
+       class open_dialog
+               extends AltosUIDialog
+               implements ActionListener
+       {
+               AltosUIFrame owner;
+
+               private JLabel  opening_label;
+               private JButton cancel_button;
+
+               boolean done = false;
+
+               AltosLink link = null;
+
+               open_task open = null;
+
+               public void open_exception(Exception e) {
+                       System.out.printf("open_exception\n");
+                       setVisible(false);
+                       exception(e);
+                       done = true;
+               }
+
+               public void open_success(AltosLink link) {
+                       System.out.printf("open_success\n");
+                       setVisible(false);
+                       this.link = link;
+                       done = true;
+               }
+
+               public void open_failure() {
+                       System.out.printf("open_failure\n");
+                       setVisible(false);
+                       done = true;
+               }
+
+               public void open_cancel() {
+                       System.out.printf("open_cancel\n");
+                       setVisible(false);
+                       done = true;
+               }
+
+               public AltosLink do_open(open_task open) throws InterruptedException {
+                       this.open = open;
+                       setVisible(true);
+                       return link;
+               }
+
+               public void actionPerformed(ActionEvent e) {
+                       String cmd = e.getActionCommand();
+
+                       if (cmd.equals("cancel"))
+                               if (open != null)
+                                       open.cancel();
+                       done = true;
+                       setVisible(false);
+               }
+
+               public open_dialog(AltosUIFrame in_owner) {
+                       super(in_owner, "Open Flash Target Device", true);
+                       owner = in_owner;
+
+                       Container               pane = getContentPane();
+                       GridBagConstraints      c = new GridBagConstraints();
+                       Insets                  i = new Insets(4,4,4,4);
+
+
+                       pane.setLayout(new GridBagLayout());
+
+                       opening_label = new JLabel("Opening Device");
+                       c.fill = GridBagConstraints.HORIZONTAL;
+                       c.anchor = GridBagConstraints.LINE_START;
+                       c.insets = i;
+                       c.weightx = 0;
+                       c.weighty = 0;
+
+                       c.gridx = 0;
+                       c.gridy = 0;
+
+                       pane.add(opening_label, c);
+
+                       cancel_button = new JButton("Cancel");
+                       cancel_button.addActionListener(this);
+                       cancel_button.setActionCommand("cancel");
+
+                       c.gridy = 1;
+                       pane.add(cancel_button, c);
+                       pack();
+                       setLocationRelativeTo(owner);
+               }
+       }
+
+       private boolean open_device() throws InterruptedException {
+
+               open_dialog     dialog = new open_dialog(frame);
+
+               open_task       open = new open_task(device, dialog);
+
+               link = dialog.do_open(open);
+
+               return link != null;
        }
 
        /*
index 943c9207d3ed866e96aacba5ee3a7bf18d6494c8..0bb346aec9797ac59ea0385a7accd73356d3f739 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.table.*;
 
index 8f7e9bffff69f9786ccfbb44a070e44a8bd0822a..49fb4fbcadd53e50d94d76aa818d26a864ac3da3 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import javax.swing.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosFlightStatsTable extends JComponent implements AltosFontListener {
        GridBagLayout   layout;
index a758bcdecb284f70e37f6a647acf1617d3793ccd..60eae96247c787dc8f96ad1350371d3db3282b7e 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index e759394bb4645e0f304bad9017641630248d5849..86917319cf04c3353166eff81fa41660924c552a 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.table.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosInfoTable extends JTable implements AltosFlightDisplay, HierarchyListener {
        private AltosFlightInfoTableModel model;
index b53e760439058a75ebf954b534239e9033c89636..e3caf38ba7d1df5614407b703a526fe441cd2d62 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
 
index 7b02d770cc97d608ef355b81cd9cf31b4a24916c..02cc77d17332f73e86f9a3daa5be1f565d657fff 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import javax.swing.*;
index f44735e2d9796d23a5a6457ad4625a772a8fa91e..ca98ca64a6fce4408a6844574d5cbee789a0c192 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public interface AltosPositionListener {
        public void position_changed(int position);
index 743232180bb3dea9ccb1d21d9f0f36a0d6022324..fd670d4ec9df439081ee7533662989f9e2223083 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosRomconfigUI
        extends AltosUIDialog
@@ -40,10 +40,10 @@ public class AltosRomconfigUI
        JButton         cancel;
 
        /* Build the UI using a grid bag */
-       public AltosRomconfigUI(JFrame in_owner) {
-               super (in_owner, "Configure TeleMetrum Rom Values", true);
+       public AltosRomconfigUI(JFrame frame, AltosRomconfig config) {
+               super (frame, "Configure Rom Values", true);
 
-               owner = in_owner;
+               owner = frame;
                GridBagConstraints c;
 
                Insets il = new Insets(4,4,4,4);
@@ -52,9 +52,11 @@ public class AltosRomconfigUI
                pane = getContentPane();
                pane.setLayout(new GridBagLayout());
 
+               int y = 0;
+
                /* Serial */
                c = new GridBagConstraints();
-               c.gridx = 0; c.gridy = 0;
+               c.gridx = 0; c.gridy = y;
                c.gridwidth = 3;
                c.fill = GridBagConstraints.NONE;
                c.anchor = GridBagConstraints.LINE_START;
@@ -63,7 +65,7 @@ public class AltosRomconfigUI
                pane.add(serial_label, c);
 
                c = new GridBagConstraints();
-               c.gridx = 3; c.gridy = 0;
+               c.gridx = 3; c.gridy = y;
                c.gridwidth = 3;
                c.fill = GridBagConstraints.HORIZONTAL;
                c.weightx = 1;
@@ -72,31 +74,37 @@ public class AltosRomconfigUI
                serial_value = new JTextField("00000000");
                pane.add(serial_value, c);
 
-               /* Radio calibration value */
-               c = new GridBagConstraints();
-               c.gridx = 0; c.gridy = 1;
-               c.gridwidth = 3;
-               c.fill = GridBagConstraints.NONE;
-               c.anchor = GridBagConstraints.LINE_START;
-               c.insets = il;
-               c.ipady = 5;
-               radio_calibration_label = new JLabel("Radio Calibration:");
-               pane.add(radio_calibration_label, c);
-
-               c = new GridBagConstraints();
-               c.gridx = 3; c.gridy = 1;
-               c.gridwidth = 3;
-               c.fill = GridBagConstraints.HORIZONTAL;
-               c.weightx = 1;
-               c.anchor = GridBagConstraints.LINE_START;
-               c.insets = ir;
-               c.ipady = 5;
-               radio_calibration_value = new JTextField("00000000");
-               pane.add(radio_calibration_value, c);
+               y++;
+
+               if (AltosLib.has_radio(config.usb_id.pid)) {
+                       /* Radio calibration value */
+                       c = new GridBagConstraints();
+                       c.gridx = 0; c.gridy = y;
+                       c.gridwidth = 3;
+                       c.fill = GridBagConstraints.NONE;
+                       c.anchor = GridBagConstraints.LINE_START;
+                       c.insets = il;
+                       c.ipady = 5;
+                       radio_calibration_label = new JLabel("Radio Calibration:");
+                       pane.add(radio_calibration_label, c);
+
+                       c = new GridBagConstraints();
+                       c.gridx = 3; c.gridy = y;
+                       c.gridwidth = 3;
+                       c.fill = GridBagConstraints.HORIZONTAL;
+                       c.weightx = 1;
+                       c.anchor = GridBagConstraints.LINE_START;
+                       c.insets = ir;
+                       c.ipady = 5;
+                       radio_calibration_value = new JTextField("00000000");
+                       pane.add(radio_calibration_value, c);
+
+                       y++;
+               }
 
                /* Buttons */
                c = new GridBagConstraints();
-               c.gridx = 0; c.gridy = 2;
+               c.gridx = 0; c.gridy = y;
                c.gridwidth = 3;
                c.fill = GridBagConstraints.NONE;
                c.anchor = GridBagConstraints.CENTER;
@@ -107,7 +115,7 @@ public class AltosRomconfigUI
                ok.setActionCommand("ok");
 
                c = new GridBagConstraints();
-               c.gridx = 3; c.gridy = 2;
+               c.gridx = 3; c.gridy = y;
                c.gridwidth = 3;
                c.fill = GridBagConstraints.NONE;
                c.anchor = GridBagConstraints.CENTER;
@@ -117,12 +125,10 @@ public class AltosRomconfigUI
                cancel.addActionListener(this);
                cancel.setActionCommand("cancel");
 
+               y++;
+
                pack();
                setLocationRelativeTo(owner);
-       }
-
-       public AltosRomconfigUI(JFrame frame, AltosRomconfig config) {
-               this(frame);
                set(config);
        }
 
@@ -155,10 +161,15 @@ public class AltosRomconfigUI
        }
 
        int radio_calibration() {
+               if (radio_calibration_value == null)
+                       return 0;
+
                return Integer.parseInt(radio_calibration_value.getText());
        }
 
        void set_radio_calibration(int calibration) {
+               if (radio_calibration_value == null)
+                       return;
                radio_calibration_value.setText(String.format("%d", calibration));
        }
 
index c63f027c12d7c0de1e12a95475937feae6d2ae77..fad1b2cde8ce72f9b7c4f2dec9cd5b734707804f 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -26,7 +26,7 @@ import java.io.*;
 import java.util.*;
 import java.text.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class AltosScanResult {
        String          callsign;
index d7c6129cdf1e21e4b595e9436fe30b75e305b62d..1c2e3cd53402ba17dd61acd219433cc8ec85c262 100644 (file)
  * Deal with TeleDongle on a serial port
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.*;
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 import libaltosJNI.*;
 
 /*
index c8ca4d569c84e4485e0cc9c6b2eb68ef489b56e2..51474e8a597af8a34c7e463bad98cdca7a4d2daf 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public class AltosSerialInUseException extends Exception {
        public AltosDevice      device;
index 6bf52fd45663a6c48f5654cc81d0f1ddc90585cf..1e2e0618e5baaa7a418bccadfd5dd7bc59081f76 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public interface AltosShapeListener {
        void set_shapes_visible(boolean visible);
index af72a21d4b4af5314e06bd7f6277bc9e7acf65d5..e2c917b1bed94596e059cda80abec2660eed2e13 100644 (file)
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUIAccelCal
        extends AltosUIDialog
index 528733638a0e9cb4c4cfa7e70ecca9efd1fa6644..59c5357ad7a10f6067f8c44378d2d54d3d9677ae 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index 6ca8c777137926e7dae9d3f87f3a0ea1ab1a0619..e61b5d5205d96d15dc5816c0c6663188fa437d35 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class DelegatingRenderer implements ListCellRenderer<Object> {
 
@@ -270,9 +270,8 @@ public class AltosUIConfigure
                         constraints(0, 3));
                row++;
 
-               pane.add(new JLabel (String.format("AltOS version %s (%smaps key)",
-                                                  AltosVersion.version,
-                                                  AltosVersion.has_google_maps_api_key() ? "" : "no ")),
+               pane.add(new JLabel (String.format("AltOS version %s",
+                                                  AltosVersion.version)),
                         constraints(0, 3));
                row++;
 
index 05227e1da069e0a99db41797ce5b584af2df8e97..043fd69bddc4fcfe864ef62f344c07f445ae25b9 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public class AltosUIDataMissing extends Exception {
        public int      id;
index 36fadeaf52d5a3fbf73f9670b15b5a1da372dbff..b82a78258e5cefc4ad9d7278566df6a080430c9b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public interface AltosUIDataPoint {
        public abstract double x() throws AltosUIDataMissing;
index ddda3d3d91908d089fa3362e336d7b6c36ceccf5..8602473dcf3d6fe44a08d94312bb29be23d80239 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public interface AltosUIDataSet {
        public abstract String name();
index 5eafa45782377da6c9b3dc0e38fa2215b32eaa5f..292c5cc17202334a6829b5a4aabfa84eb5c5be13 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
index 851e831f43c8cd952d5df755c6e4b00853afab0d..ef9a692a62a47ce07339378d6dc92e6d64e53b19 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -25,7 +25,7 @@ import javax.swing.event.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index 407e5ab4c27d00559f59cc3647d910608ce98120..49c7226c74139108e0d35c03fd17ef91764de478 100644 (file)
  * General Public License for more details.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.util.*;
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index cf6a0c746ac4114d4b56f2ed605ebd7efdd42614..1633d9b9170560283448d9cf7538f96d26345579 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.util.*;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public abstract class AltosUIFlightTab extends JComponent implements AltosFlightDisplay, HierarchyListener {
        public GridBagLayout    layout;
index b7eee66453bdd8000390cb9b31a8641353493b1a..301bdc68de43c65b75afac2334240f00cbfbf9ea 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
index 7a5c3543a8e05324d9ca985f3d881d095d9fd33a..f3f7035d56d885b69ff2f34ee280e809256f25e5 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUIFreqList extends JComboBox<AltosFrequency> {
 
index 40f415f1b6c26518bd735e8a8840dd53f4a7eb2d..098e9a52f17ebe28add7f8f3829f10f86279f278 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.*;
@@ -24,7 +24,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index 916d0b3fca236c83167548d3901ede1e167e2ca3..642072fa98be0e6912b82d38ca4f1ba72f48b095 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index f23b50bc0f369fbd2f414780a68ec2d38a7ed359..4ced80fd2d94158082d3b96da284d4ac4592633b 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
 
 import javax.swing.*;
 import javax.imageio.ImageIO;
index ac2e6f0663df2c38d79f905bab67754f0eb7e173..6baa185c0cf44170095ebe126b6b74212bc8c09f 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public abstract class AltosUIIndicator implements AltosFontListener, AltosUnitsListener {
        JLabel          label;
index 81a8b131e1b2e46c645469e1e2053c4270393713..704782f45feb0f4a9ce04f62fb16aef57ee3a2c4 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import libaltosJNI.*;
 
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUILib extends AltosLib {
 
index 387281a3bf4fd7998885ef70ad32c66c49a55a87..872ef9c7242ea46a5e611a3c408df070bc7b97c7 100644 (file)
  * General Public License for more details.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index 54a0066196b5121bc25afd4d1039ff8cb1b78ffc..3c54fb54c5ec504127581ecf96df4109c30af165 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 public interface AltosUIListener {
        public void ui_changed(String look_and_feel);
index 2e1e8f160bf8f5a2899c1993c1a534a9bdb224d6..8dfdba64c8bca8da70beb0f8462e6c2e3882341c 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -28,7 +28,7 @@ import java.awt.geom.*;
 import java.util.*;
 import java.util.concurrent.*;
 import javax.imageio.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosMapInterface {
 
@@ -106,7 +106,7 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
                }
 
                private boolean is_drag_event(MouseEvent e) {
-                       return e.getModifiers() == InputEvent.BUTTON1_MASK;
+                       return e.getModifiersEx() == InputEvent.BUTTON1_DOWN_MASK;
                }
 
                /* MouseMotionListener methods */
@@ -264,6 +264,21 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
 
                        if (image != null) {
                                g.drawImage(image, point.x, point.y, null);
+/*
+ * Useful when debugging map fetching problems
+ *
+                               String message = String.format("%.6f %.6f", center.lat, center.lon);
+                               g.setFont(tile_font);
+                               g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+                               Rectangle2D bounds = tile_font.getStringBounds(message, g.getFontRenderContext());
+
+                               float x = px_size / 2.0f;
+                               float y = px_size / 2.0f;
+                               x = x - (float) bounds.getWidth() / 2.0f;
+                               y = y + (float) bounds.getHeight() / 2.0f;
+                               g.setColor(Color.RED);
+                               g.drawString(message, (float) point_double.x + x, (float) point_double.y + y);
+*/
                        } else {
                                g.setColor(Color.GRAY);
                                g.fillRect(point.x, point.y, px_size, px_size);
@@ -278,10 +293,10 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
                                                message = "Internal error";
                                                break;
                                        case AltosMapTile.failed:
-                                               message = "Network error, check connection";
+                                               message = "Network error";
                                                break;
                                        case AltosMapTile.forbidden:
-                                               message = "Too many requests, try later";
+                                               message = "Outside of known launch areas";
                                                break;
                                        }
                                        if (message != null && tile_font != null) {
@@ -386,8 +401,10 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
        JLabel  zoom_label;
 
        public void set_maptype(int type) {
+/*
                map.set_maptype(type);
                maptype_combo.setSelectedIndex(type);
+*/
        }
 
        /* AltosUIMapPreload functions */
@@ -433,7 +450,9 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
        /* internal layout bits */
        private GridBagLayout layout = new GridBagLayout();
 
+/*
        JComboBox<String>       maptype_combo;
+*/
 
        MapView view;
 
@@ -522,6 +541,7 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
                c.weighty = 0;
                add(zoom_out, c);
 
+/*
                maptype_combo = new JComboBox<String>(map.maptype_labels);
 
                maptype_combo.setEditable(false);
@@ -540,7 +560,7 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
                c.weightx = 0;
                c.weighty = 0;
                add(maptype_combo, c);
-
+*/
                map = new AltosMap(this);
        }
 }
index 81cda0d2952c100cdac7fcb39a5c21ee392366b9..ffd974acd16855aaa6f8386b70a25a81aae596a7 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import java.awt.event.*;
@@ -27,7 +27,7 @@ import java.text.*;
 import java.lang.Math;
 import java.net.URL;
 import java.net.URLConnection;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 class AltosUIMapPos extends Box implements ActionListener {
        AltosUIMapPreload       preload;
@@ -144,7 +144,9 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I
        JToggleButton   load_button;
        JButton         close_button;
 
+/*
        JCheckBox[]     maptypes = new JCheckBox[AltosMap.maptype_terrain - AltosMap.maptype_hybrid + 1];
+*/
 
        JComboBox<Integer>      min_zoom;
        JComboBox<Integer>      max_zoom;
@@ -215,11 +217,14 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I
 
 
        private int all_types() {
+/*
                int all_types = 0;
                for (int t = AltosMap.maptype_hybrid; t <= AltosMap.maptype_terrain; t++)
                        if (maptypes[t].isSelected())
                                all_types |= (1 << t);
                return all_types;
+*/
+               return 1 << AltosMap.maptype_hybrid;
        }
 
        void center_map(double latitude, double longitude) {
@@ -485,6 +490,7 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I
 
                pane.add(close_button, c);
 
+/*
                JLabel  types_label = new JLabel("Map Types");
                c.gridx = 2;
                c.gridwidth = 2;
@@ -501,6 +507,7 @@ public class AltosUIMapPreload extends AltosUIFrame implements ActionListener, I
                        c.gridy = (type & 1) + 3;
                        pane.add(maptypes[type], c);
                }
+*/
 
                JLabel  min_zoom_label = new JLabel("Minimum Zoom");
                c.gridx = 4;
index 90cdb291728e1e7cb4ab43011a5a9de02f439f0d..63e8102410686e8446c7eaec1731aa7873707dd0 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index a2014065d731d4f519110c982417aedaeb8f4b8e..062cb49dd2d090156667606275f6bd9e2334550b 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.*;
 import java.awt.Component;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUIPreferences extends AltosPreferences {
 
index 163ba173f2076f1fac0386ea7ceb8ddaf023b5f1..7c05e0e584f3094e181f775027e3a8ad0c67429e 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.File;
 import java.util.prefs.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 import javax.swing.filechooser.FileSystemView;
 
 public class AltosUIPreferencesBackend extends AltosPreferencesBackend {
index d1c15ce0d44fa2994ace90cc532d2097915bcb5e..1717fb69b98934a5e4ed4588747926f497e9689f 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class AltosUIRateList extends JComboBox<String> {
 
index f884cd412312ca9d2ff1b82c2943da313d1e799c..84f190e6da3eaaa5978a1bb3b2739f1d7ee7e656 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.util.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 
 public class AltosUITelemetryList extends JComboBox<String> {
index e85e3c17774aadde406577d93e7a5cdd82cf0635..4c2f9ba9a85e608b029c5f92d5c24d5f00acc9e7 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.io.*;
 import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index bbfebef6c1c4652e812c9eae2f25e8b6f0c50e4a..19687c3273f967cec56bc5308c11307ff2102018 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public abstract class AltosUIUnitsIndicator extends AltosUIIndicator {
 
index 297a65312d086f1234118045e2262c0ed6eae427..c8797b7235812122e690ec2949b448850c03396e 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public abstract class AltosUIVoltageIndicator extends AltosUIUnitsIndicator {
 
index 49f966f330b56e9f7c3f7fc53bc3dd9c0a161c2c..f43d6befda46e57ec9ee26f0d105452308afe9b9 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.util.*;
 import libaltosJNI.*;
@@ -94,6 +94,24 @@ public class AltosUSBDevice  extends altos_device implements AltosDevice {
                return false;
        }
 
+       public int hashCode() {
+               return getVendor() ^ getProduct() ^ getSerial() ^ getPath().hashCode();
+       }
+
+       public boolean equals(Object o) {
+               if (o == null)
+                       return false;
+
+               if (!(o instanceof AltosUSBDevice))
+                       return false;
+               AltosUSBDevice other = (AltosUSBDevice) o;
+
+               return getVendor() == other.getVendor() &&
+                       getProduct() == other.getProduct() &&
+                       getSerial() == other.getSerial() &&
+                       getPath().equals(other.getPath());
+       }
+
        static public java.util.List<AltosDevice> list(int product) {
                if (!AltosUILib.load_library())
                        return null;
index 1d579a166deaedd2a1772176405e981c71e9c879..264eede3e27f23a4416fd4f30c84c05992027483 100644 (file)
@@ -16,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import com.sun.speech.freetts.Voice;
 import com.sun.speech.freetts.VoiceManager;
diff --git a/altosuilib/GrabNDrag.java b/altosuilib/GrabNDrag.java
deleted file mode 100644 (file)
index 665ef89..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright © 2010 Anthony Towns <aj@erisian.com.au>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
-package org.altusmetrum.altosuilib_12;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.MouseInputAdapter;
-
-class GrabNDrag extends MouseInputAdapter {
-       private JComponent scroll;
-       private Point startPt = new Point();
-
-       public GrabNDrag(JComponent scroll) {
-               this.scroll = scroll;
-               scroll.addMouseMotionListener(this);
-               scroll.addMouseListener(this);
-               scroll.setAutoscrolls(true);
-       }
-
-       public static boolean grab_n_drag(MouseEvent e) {
-               return e.getModifiers() == InputEvent.BUTTON1_MASK;
-       }
-
-       public void mousePressed(MouseEvent e) {
-               if (grab_n_drag(e))
-                       startPt.setLocation(e.getPoint());
-       }
-       public void mouseDragged(MouseEvent e) {
-               if (grab_n_drag(e)) {
-                       int xd = e.getX() - startPt.x;
-                       int yd = e.getY() - startPt.y;
-
-                       Rectangle r = scroll.getVisibleRect();
-                       r.x -= xd;
-                       r.y -= yd;
-                       scroll.scrollRectToVisible(r);
-               }
-       }
-}
index c65a3d1516c5e80e8a1a24a4d3e4b5162f41d914..c00144f8cfb9ef99b745669ec315699aac0b7aaa 100644 (file)
@@ -9,7 +9,6 @@ SRC=.
 altosuilibdir = $(datadir)/java
 
 altosuilib_JAVA = \
-       GrabNDrag.java \
        AltosDevice.java \
        AltosDeviceDialog.java \
        AltosPositionListener.java \
index c338396f90545da359e4cf1fe62e93d3ba6eb381..c05412cee7fce6df3576245da77c19b739ff9ecd 100755 (executable)
@@ -55,7 +55,7 @@ Copyright © 2003-2007 Apple, Inc., All Rights Reserved
 
 */
 
-package org.altusmetrum.altosuilib_12;
+package org.altusmetrum.altosuilib_13;
 
 import java.lang.reflect.*;
 import java.util.HashMap;
diff --git a/ao-bringup/fix-telebt b/ao-bringup/fix-telebt
new file mode 100755 (executable)
index 0000000..35933e9
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+VERSION=4.0
+REPO=~/altusmetrumllc/Binaries
+PRODUCT=TeleBT
+
+ALTOS_FILE=$REPO/telebt-v$VERSION-*.elf
+
+if [ -x /usr/bin/ao-usbload ]; then
+       USBLOAD=/usr/bin/ao-usbload
+else
+       echo "Can't find ao-usbload!  Aborting."
+       exit 1
+fi
+
+dev_serial=`ao-list | awk '/'"$PRODUCT"'-v'"$VERSION"'/ { printf("%s %s\n", $3, $2); exit(0); }'`
+dev=`echo $dev_serial | awk '{print $1;}'`
+serial=`echo $dev_serial | awk '{print $2;}'`
+
+case "$dev" in
+/dev/tty*)
+       ;;
+*)
+       echo 'No '"$PRODUCT"'-v'"$VERSION"' found'
+       exit 1
+       ;;
+esac
+
+rfcal=`wget -O - -q 'http://altusmetrum.org/cgi-bin/unitinfo.cgi?sn='$serial | jq '.unitinfo.rfcal | tonumber'`
+
+case $? in
+0)
+       ;;
+*)
+       echo "Fetch rfcal for $serial failed"
+       exit 1
+       ;;
+esac
+
+case "$rfcal" in
+[0-9]*)
+       ;;
+*)
+       echo "Serial $serial: invalid rfcal $rfcal"
+       ;;
+esac
+
+echo "$PRODUCT"'-v'"$VERSION $serial $dev rfcal $rfcal"
+
+$USBLOAD --cal=$rfcal --tty=$dev $ALTOS_FILE || exit 1
+
+echo "$PRODUCT"'-v'"$VERSION $serial $dev is ready to ship"
index bfc3101cd759ad7e2c1f985a947f0b78f7fd9fbf..695a0dbf3c8ba8bffa19a9184e2d2682c03049e4 100644 (file)
@@ -25,6 +25,10 @@ ao-cal-freq \- Calibrate AltOS flight computer frequency
 [\--tty \fItty-device\fP]
 [\-D \fIaltos-device\fP]
 [\--device \fIaltos-device\fP]
+[\-v] [\--verbose]
+[\-n] [\--nosave]
+[\-o \fIcal-value-output-file\fP]
+[\--output \fIcal-value-output-file\fP]
 .SH DESCRIPTION
 .I ao-cal-freq
 drives the frequency calibration process and saves the result.
@@ -49,10 +53,22 @@ TeleMega
 Leaving out the product name will cause the tool to select a suitable
 product, leaving out the serial number will cause the tool to match
 one of the available devices.
+.TP
+\-o cal-value-output-file | --output cal-value-output-file
+Writes the resulting calibration value to the specified file.
+.TP
+\-n | --nosave
+Inhibits saving the calibration value on the device. Necessary for
+devices which don't have on-board configuration storage.
+.TP
+\-v | --verbose
+Makes
+.I ao-cal-freq
+chatty about communication with the target device.
 .SH USAGE
 .I ao-cal-freq
 opens the target device, interactively calibrates the frequency, then
-shows the resulting calibration values and saves them to configuration
-memory.
+shows the resulting calibration values and (optionally) saves them to
+configuration memory and/or a file.
 .SH AUTHOR
 Keith Packard
index 12c2a3ae9f6c845b809025a37068844d7d1c7e8b..838fbab3a6f6947844a97e692d58515b75093b44 100644 (file)
 static const struct option options[] = {
        { .name = "tty", .has_arg = 1, .val = 'T' },
        { .name = "device", .has_arg = 1, .val = 'D' },
-       { .name = "raw", .has_arg = 0, .val = 'r' },
        { .name = "verbose", .has_arg = 0, .val = 'v' },
+       { .name = "output", .has_arg = 1, .val = 'o' },
+       { .name = "nosave", .has_arg = 0, .val = 'n' },
        { 0, 0, 0, 0},
 };
 
 static void usage(char *program)
 {
-       fprintf(stderr, "usage: %s [--verbose] [--device=<device>] [-tty=<tty>]\n", program);
+       fprintf(stderr, "usage: %s [--verbose] [--nosave] [--device=<device>] [-tty=<tty>] [--output=<cal-value-file>]\n", program);
        exit(1);
 }
 
@@ -168,7 +169,60 @@ await_key(void)
 }
 
 int
-do_cal(char *tty) {
+do_save(struct cc_usb *usb)
+{
+       int ret = 0;
+
+       printf("Saving calibration to device\n");
+       cc_usb_printf(usb, "c w\nv\n");
+       for (;;) {
+               char    line[512];
+
+               cc_usb_getline(usb, line, sizeof (line));
+               if (strstr(line, "Nothing to save"))
+                       ret = 1;
+               if (strstr(line, "Saved"))
+                       ret = 1;
+               if (strstr(line, "software-version"))
+                       break;
+       }
+       if (!ret) {
+               printf("Calibration save failed\n");
+       }
+       return ret;
+}
+
+int
+do_output(char *output, int cur_cal)
+{
+       printf ("Saving calibration value to file \"%s\"\n", output);
+
+       FILE    *out = fopen(output, "w");
+       int     ret = 1;
+
+       if (!out) {
+               perror(output);
+               return 0;
+       }
+
+       if (fprintf(out, "%d\n", cur_cal) < 0) {
+               perror("fprintf");
+               ret = 0;
+       }
+       if (fflush(out) != 0) {
+               perror("fflush");
+               ret = 0;
+       }
+       if (fclose(out) != 0) {
+               perror("fclose");
+               ret = 0;
+       }
+       return ret;
+}
+
+int
+do_cal(char *tty, int save, char *output)
+{
        struct cc_usb *usb = NULL;
        struct flash    *b;
        char    line[1024];
@@ -180,36 +234,26 @@ do_cal(char *tty) {
        int     cur_cal;
        int     new_cal;
        int     ret = 1;
+       int     changed = 0;
 
        for(;;) {
                usb = cc_usb_open(tty);
 
-               if (!usb)
-                       exit(1);
+               if (!usb) {
+                       fprintf(stderr, "failed to open device\n");
+                       ret = 0;
+                       break;
+               }
 
                cc_usb_printf(usb, "E 0\n");
 
-               cc_usb_sync(usb);
-               cc_usb_printf(usb, "C 1\n");
-               cc_usb_sync(usb);
-
-               printf("Generating RF carrier. Please enter measured frequency [enter for done]: ");
-               fflush(stdout);
-               fgets(line, sizeof (line) - 1, stdin);
-               cc_usb_printf(usb, "C 0\n");
-               cc_usb_sync(usb);
-
-               measured_freq = strtod(line, &line_end);
-               if (line_end == line)
-                       break;
-
                b = flash(usb);
 
                cur_cal_words = find_flash(b, "Radio cal:");
                cur_freq_words = find_flash(b, "Frequency:");
 
                if (!cur_cal_words || !cur_freq_words) {
-                       printf("no response\n");
+                       fprintf(stderr, "no response\n");
                        ret = 0;
                        break;
                }
@@ -218,19 +262,50 @@ do_cal(char *tty) {
                cur_freq = atoi(cur_freq_words[1]);
 
                printf ("Current radio calibration %d\n", cur_cal);
-               printf ("Current radio frequency: %d\n", cur_freq);
+               printf ("Current radio frequency: %7.3f\n", cur_freq / 1000.0);
+
+               cc_usb_sync(usb);
+               cc_usb_printf(usb, "C 1\n");
+               cc_usb_sync(usb);
+
+               printf("Generating RF carrier. Please enter measured frequency [enter for done]: ");
+               fflush(stdout);
+               fgets(line, sizeof (line) - 1, stdin);
+               cc_usb_printf(usb, "C 0\n");
+               cc_usb_sync(usb);
 
+               measured_freq = strtod(line, &line_end);
+               if (line_end == line)
+                       break;
 
                new_cal = floor ((((double) cur_freq / 1000.0) / measured_freq) * cur_cal + 0.5);
 
-               printf ("Programming flash with cal value %d\n", new_cal);
+               if (new_cal == cur_cal) {
+                       printf("Calibration value %d unchanged\n", cur_cal);
+               } else {
+                       printf ("Setting cal value %d\n", new_cal);
 
-               cc_usb_printf (usb, "c f %d\nc w\n", new_cal);
-               cc_usb_sync(usb);
+                       cc_usb_printf (usb, "c f %d\n", new_cal);
+                       changed = 1;
+                       cc_usb_sync(usb);
+               }
                cc_usb_close(usb);
        }
-       if (usb)
+       if (usb) {
+               if (ret && save) {
+                       if (changed) {
+                               if (!do_save(usb))
+                                       ret = 0;
+                       } else {
+                               printf("Calibration unchanged, not saving\n");
+                       }
+               }
+               if (ret && output) {
+                       if (!do_output(output, cur_cal))
+                               ret = 0;
+               }
                cc_usb_close(usb);
+       }
        return ret;
 }
 
@@ -247,10 +322,12 @@ main (int argc, char **argv)
        char                    *tty = NULL;
        int                     success;
        int                     verbose = 0;
+       int                     save = 1;
        int                     ret = 0;
        int                     expected_size;
+       char                    *output = NULL;
 
-       while ((c = getopt_long(argc, argv, "vrT:D:c:s:", options, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "vnT:D:o:", options, NULL)) != -1) {
                switch (c) {
                case 'T':
                        tty = optarg;
@@ -261,6 +338,12 @@ main (int argc, char **argv)
                case 'v':
                        verbose++;
                        break;
+               case 'n':
+                       save = 0;
+                       break;
+               case 'o':
+                       output = optarg;
+                       break;
                default:
                        usage(argv[0]);
                        break;
@@ -268,8 +351,7 @@ main (int argc, char **argv)
        }
 
        ao_verbose = verbose;
-
-       if (verbose > 1)
+       if (verbose)
                ccdbg_add_debug(CC_DEBUG_BITBANG);
 
        if (!tty)
@@ -281,6 +363,7 @@ main (int argc, char **argv)
        if (!tty)
                tty="/dev/ttyACM0";
 
-       if (!do_cal(tty))
+       if (!do_cal(tty, save, output))
                ret = 1;
+       return ret;
 }
index 4231dc2133d1dd069790ef7cc1df25f74b305198..ed9284397dc3a817b4dad9139ffdb33a242b5633 100644 (file)
@@ -1,3 +1,3 @@
-bin_SCRIPTS=ao-flash-stm ao-flash-lpc ao-flash-stm32f0x
+bin_SCRIPTS=ao-flash-stm ao-flash-lpc ao-flash-stm32f0x ao-reset-lpc
 
-man_MANS = ao-flash-stm.1 ao-flash-lpc.1 ao-flash-stm32f0x.1
+man_MANS = ao-flash-stm.1 ao-flash-lpc.1 ao-flash-stm32f0x.1 ao-reset-lpc.1
diff --git a/ao-tools/ao-flash/ao-reset-lpc b/ao-tools/ao-flash/ao-reset-lpc
new file mode 100755 (executable)
index 0000000..d431613
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+cmds=/tmp/flash$$
+trap "rm $cmds" 0 1 15
+echo "reset" > $cmds
+openocd \
+       -f interface/stlink-v2.cfg \
+       -f target/lpc11xx.cfg \
+       -f $cmds \
+       -c shutdown
diff --git a/ao-tools/ao-flash/ao-reset-lpc.1 b/ao-tools/ao-flash/ao-reset-lpc.1
new file mode 100644 (file)
index 0000000..826b6fb
--- /dev/null
@@ -0,0 +1,35 @@
+.\"
+.\" Copyright © 2018 Bdale Garbee <bdale@gag.com>
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+.\" General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License along
+.\" with this program; if not, write to the Free Software Foundation, Inc.,
+.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+.\"
+.\"
+.TH AO-RESET-LPC 1 "ao-reset-lpc" ""
+.SH NAME
+ao-reset-lpc \- reset an LPC11U14-based AltOS device using openocd
+.SH SYNOPSIS
+.B "ao-reset-lpc"
+.SH DESCRIPTION
+.I ao-reset-lpc
+resets the target device.
+.SH USAGE
+.I ao-reset-lpc
+is a simple script that passes the correct arguments to openocd to
+reset the target device via a connected STlink debugging dongle.
+.SH "SEE ALSO"
+openocd(1)
+.SH AUTHOR
+Bdale Garbee
+
index c5de6a5d5beda38dea77df3f4c2ccd18d86ffaa0..7f7eec931dc36c684f99ab11abbe7757673c96cd 100644 (file)
@@ -18,13 +18,13 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([altos], 1.8.6)
+AC_INIT([altos], 1.8.7)
 ANDROID_VERSION=17
 AC_CONFIG_SRCDIR([src/kernel/ao.h])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-RELEASE_DATE=2018-06-17
+RELEASE_DATE=2018-10-08
 AC_SUBST(RELEASE_DATE)
 
 VERSION_DASH=`echo $VERSION | sed 's/\./-/g'`
@@ -34,8 +34,8 @@ AC_SUBST(ANDROID_VERSION)
 dnl ==========================================================================
 dnl Java library versions
 
-ALTOSUILIB_VERSION=12
-ALTOSLIB_VERSION=12
+ALTOSUILIB_VERSION=13
+ALTOSLIB_VERSION=13
 
 AC_SUBST(ALTOSLIB_VERSION)
 AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package])
@@ -173,8 +173,8 @@ AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
 AC_SUBST(FATDIR)
 
 AC_ARG_WITH(google-key, AS_HELP_STRING([--with-google-key=PATH],
-           [Set the file to read the google maps API key from (defaults to ~/altusmetrumllc/google-maps-api-key)]),
-           [GOOGLEKEYFILE=$withval], [GOOGLEKEYFILE=$HOME/altusmetrumllc/google-maps-api-key])
+           [Set the file to read the AltosDroid maps API key from (defaults to ~/altusmetrumllc/google-altosdroid-maps-api-key)]),
+           [GOOGLEKEYFILE=$withval], [GOOGLEKEYFILE=$HOME/altusmetrumllc/google-altosdroid-maps-api-key])
 
 if test -r "$GOOGLEKEYFILE" -a -s "$GOOGLEKEYFILE"; then
        GOOGLEKEY=`cat "$GOOGLEKEYFILE"`
@@ -184,6 +184,12 @@ else
        HAVE_GOOGLE_KEY="no"
 fi
 
+AC_ARG_ENABLE(faketime, AS_HELP_STRING([--enable-faketime],
+              [Use faketime program to ensure pdf files are reproducible (default=no)]),
+             [FAKETIME=$enableval], [FAKETIME=no])
+
+AM_CONDITIONAL(FAKETIME, [test x$FAKETIME = xyes])
+
 AC_SUBST(GOOGLEKEY)
 
 AC_PROG_CC
@@ -411,6 +417,8 @@ if test "x$HAVE_NICKLE" = "xno"; then
        AC_MSG_ERROR([Please install nickle to build AltOs])
 fi
 
+PKG_CHECK_MODULES([JANSSON], [jansson])
+
 AC_ARG_WITH([readline],
            [AS_HELP_STRING([--with-readline],
                              [enable readline functionality in ao-dbg @<:@default=auto@:>@])],
@@ -519,6 +527,7 @@ AC_OUTPUT([
 Makefile
 src/Makedefs
 src/chaoskey-v1.0/org.altusmetrum.ChaosKey.metainfo.xml
+doc/Makefile
 altoslib/Makefile
 altoslib/AltosVersion.java
 icon/Makefile
@@ -564,6 +573,10 @@ ao-tools/ao-usbtrng/Makefile
 ao-tools/ao-chaosread/Makefile
 ao-tools/ao-makebin/Makefile
 ao-utils/Makefile
+map-server/Makefile
+map-server/altos-mapd/Makefile
+map-server/altos-map/Makefile
+map-server/altos-mapj/Makefile
 src/Version
 ])
 
@@ -590,7 +603,7 @@ echo "    freetts.....................: ${FREETTS}"
 echo "    jfreechart..................: ${JFREECHART}"
 echo "    jcommon.....................: ${JCOMMON}"
 echo "    JVM include.................: ${JVM_INCLUDE}"
-echo "    Google maps API key.........: ${HAVE_GOOGLE_KEY}"
+echo "    AltosDroid maps API key.....: ${HAVE_GOOGLE_KEY}"
 if test x${ANDROID_SDK} != "xno"; then
 echo ""
 echo "  Android path"
index 786123a3d43c0afd5db2710b8574a8e3ddef9953..06ad43eb20dbf6b9233c8e9294127d99ddd5e87f 100644 (file)
@@ -4,3 +4,4 @@
 *.raw
 titlepage.templates.xsl
 fop-cfg.xml
+map-loading.svg
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644 (file)
index 3661a6d..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-#
-#      http://docbook.sourceforge.net/release/xsl/current/README
-#
-
-RELNOTES_INC=\
-       release-notes-1.8.6.inc \
-       release-notes-1.8.5.inc \
-       release-notes-1.8.4.inc \
-       release-notes-1.8.3.inc \
-       release-notes-1.8.2.inc \
-       release-notes-1.8.1.inc \
-       release-notes-1.8.inc \
-       release-notes-1.7.inc \
-       release-notes-1.6.8.inc \
-       release-notes-1.6.5.inc \
-       release-notes-1.6.4.inc \
-       release-notes-1.6.3.inc \
-       release-notes-1.6.2.inc \
-       release-notes-1.6.1.inc \
-       release-notes-1.6.inc \
-       release-notes-1.5.inc \
-       release-notes-1.4.2.inc \
-       release-notes-1.4.1.inc \
-       release-notes-1.4.inc \
-       release-notes-1.3.2.inc \
-       release-notes-1.3.1.inc \
-       release-notes-1.3.inc \
-       release-notes-1.2.1.inc \
-       release-notes-1.2.inc \
-       release-notes-1.1.1.inc \
-       release-notes-1.1.inc \
-       release-notes-1.0.1.inc \
-       release-notes-0.9.2.inc \
-       release-notes-0.9.inc \
-       release-notes-0.8.inc \
-       release-notes-0.7.1.inc
-
-IMAGES=\
-       altosui.png \
-       ascent.png \
-       configure-altimeter.png \
-       configure-altosui.png \
-       configure-groundstation.png \
-       configure-pyro.png \
-       descent.png \
-       device-selection.png \
-       easymega.svg \
-       easymega-v1.0-bottom.jpg \
-       easymega-v1.0-top.jpg \
-       easymini.svg \
-       easymini-top.jpg \
-       fire-igniter.png \
-       graph-configure.png \
-       graph-map.png \
-       graph.png \
-       graph-stats.png \
-       ignitor.png \
-       landed.png \
-       launch-pad.png \
-       load-maps.png \
-       micropeak-app.png \
-       micropeak-back.jpg \
-       micropeak-device-dialog.png \
-       micropeak-dime.jpg \
-       micropeak-download.png \
-       micropeak-graph-configure.png \
-       micropeak-graph.png \
-       micropeak-nofont.svg \
-       micropeak-preferences.png \
-       micropeak-raw-data.png \
-       micropeak-save-dialog.png \
-       micropeak-statistics.png \
-       MicroPeakUSB-2.0-inuse.jpg \
-       MicroPeakUSB-2.0.jpg \
-       monitor-idle.png \
-       scan-channels.png \
-       site-map.png \
-       table.png \
-       telegps-configure.png \
-       telegps-graph-configure.png \
-       telegps-graph-graph.png \
-       telegps-graph-map.png \
-       telegps-graph-stats.png \
-       telegps-info.png \
-       telegps-location.png \
-       telegps-map.png \
-       telegps-preferences.png \
-       telegps-scan.png \
-       telegps-status.png \
-       telegps-table.png \
-       telegps-v1.0-top.jpg \
-       telemega.svg \
-       telemega-v1.0-top.jpg \
-       telemetrum.svg \
-       telemetrum-v1.1-thside.jpg \
-       telemetrum-v2.0-th.jpg \
-       telemini-v1.svg \
-       telemini-v1-top.jpg \
-       telemini-v3.svg \
-       telemini-v3.0-top.jpg \
-       telemini-v3.0-bottom.jpg \
-       altusmetrum-oneline.svg \
-       telegps-oneline.svg \
-       micropeak-oneline.svg
-
-TXT_FILES=altusmetrum.txt
-
-COMMON_INC_FILES=\
-       config-device.inc \
-       config-ui.inc \
-       load-maps.inc \
-       aprs-operation.inc \
-       handling.inc
-
-INC_FILES=\
-       dedication.inc \
-       intro.inc \
-       getting-started.inc \
-       usage.inc \
-       telemetrum.inc \
-       telemini.inc \
-       easymini-device.inc \
-       telemega.inc \
-       easymega.inc \
-       installation.inc \
-       using-am-products.inc \
-       updating-firmware.inc \
-       altosui.inc \
-       altosdroid.inc \
-       system-operation.inc \
-       pyro-channels.inc \
-       flight-data-recording.inc \
-       specs.inc \
-       $(COMMON_INC_FILES) \
-       release-notes.inc \
-       $(RELNOTES_INC)
-
-RAW_FILES=$(TXT_FILES:.txt=.raw) $(INC_FILES:.inc=.raw)
-
-TELEGPS_INC_FILES=\
-       telegps-dedication.inc \
-       telegps-quick-start.inc \
-       telegps-using.inc \
-       telegps-system-operation.inc \
-       telegps-application.inc \
-       telegps-specs.inc \
-       telegps-updating-firmware.inc \
-       telegps-release-notes.inc \
-       $(COMMON_INC_FILES)
-
-TELEGPS_TXT_FILES=\
-       telegps.txt
-
-TELEGPS_RAW_FILES=$(TELEGPS_TXT_FILES:.txt=.raw) $(TELEGPS_INC_FILES:.inc=.raw)
-
-MICROPEAK_TXT_FILES=\
-       micropeak.txt
-
-MICROPEAK_INC_FILES=
-
-MICROPEAK_RAW_FILES=$(MICROPEAK_TXT_FILES:.txt=.raw) $(MICROPEAK_INC_FILES:.inc=.raw)
-
-EASYMINI_TXT_FILES=\
-       easymini.txt
-
-EASYMINI_INC_FILES=$(INC_FILES) easymini-release-notes.inc
-
-
-EASYMINI_RAW_FILES=$(EASYMINI_TXT_FILES:.txt=.raw) $(EASYMINI_INC_FILES:.inc=.raw)
-
-OUTLINE_TXT_FILES=\
-       easymega-outline.txt \
-       easymini-outline.txt \
-       telemega-outline.txt \
-       telemetrum-outline.txt \
-       telemini-v1-outline.txt \
-       telemini-v3-outline.txt \
-       telegps-outline.txt
-
-OUTLINE_RAW_FILES=$(OUTLINE_TXT_FILES:.txt=.raw)
-
-OUTLINE_PDF_FILES=$(OUTLINE_TXT_FILES:.txt=.pdf)
-
-SVG=\
-       easymini.svg \
-       telemega.svg \
-       telemetrum.svg \
-       telemini-v1.svg \
-       telemini-v3.svg \
-       easymega.svg
-
-RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
-
-ONEFILE_TXT_FILES=\
-       altos.txt \
-       companion.txt \
-       telemetry.txt
-
-ONEFILE_RAW_FILES=$(ONEFILE_TXT_FILES:.txt=.raw)
-ONEFILE_PDF_FILES=$(ONEFILE_TXT_FILES:.txt=.pdf)
-ONEFILE_HTML_FILES=$(ONEFILE_TXT_FILES:.txt=.html)
-
-AM_HTML=am.html
-
-PUBLISH_HTML=altusmetrum.html micropeak.html telegps.html easymini.html $(ONEFILE_HTML_FILES)
-
-HTML=$(PUBLISH_HTML) $(RELNOTES_HTML)
-
-HTML_REVHISTORY=\
-       altusmetrum-revhistory.html \
-       micropeak-revhistory.html \
-       telegps-revhistory.html \
-       easymini-revhistory.html
-
-PDF=altusmetrum.pdf micropeak.pdf telegps.pdf easymini.pdf $(ONEFILE_PDF_FILES) \
-       $(OUTLINE_PDF_FILES)
-
-FOP_STYLE=am-fo.xsl
-HTML_STYLE=am-html.xsl
-COMMON_STYLE=common.xsl
-FOP_XCONF=fop.xconf
-STYLESHEET=am.css
-
-FONTS=\
-       fonts/DejaVuSansMono-BoldOblique.ttf \
-       fonts/DejaVuSansMono-Bold.ttf \
-       fonts/DejaVuSansMono-Oblique.ttf \
-       fonts/DejaVuSansMono.ttf \
-       fonts/OpenSans-Light.ttf \
-       fonts/OpenSans-LightItalic.ttf \
-       fonts/OpenSans-Regular.ttf \
-       fonts/OpenSans-Italic.ttf \
-       fonts/OpenSans-Semibold.ttf \
-       fonts/OpenSans-SemiboldItalic.ttf
-
-TEMPLATES_TMPL=titlepage.templates.tmpl
-
-TEMPLATES_XSL=$(TEMPLATES_TMPL:.tmpl=.xsl)
-
-PDF_CONFIG_FILES=$(FOP_STYLE) $(COMMON_STYLE) $(FOP_XCONF) $(TEMPLATES_XSL)
-HTML_CONFIG_FILES=$(HTML_STYLE) $(COMMON_STYLE) $(TEMPLATES_XSL)
-
-PUBLISH_DOC=$(PUBLISH_HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
-
-DOC=$(HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
-
-.SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
-
-.txt.raw:
-       sed -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
-
-.inc.raw:
-       sed -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
-
-.raw.html:
-       a2x --verbose -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(FOP_STYLE) --fop --fop-opts="-c $(FOP_XCONF)" $*.raw
-       a2x --verbose -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(HTML_STYLE) --stylesheet=$(STYLESHEET) $*.raw
-       case $* in release-notes*) ./fix-html $*.html ;; esac
-
-.html.pdf:
-       @touch $@
-
-.tmpl.xsl:
-       xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl
-
-all:   $(HTML) $(PDF)
-
-altusmetrum-revhistory.html: altusmetrum.html
-
-micropeak-revhistory.html: micropeak.html
-
-telegps-revhistory.html: telegps.html
-
-altusmetrum.pdf altusmetrum.html: altusmetrum-docinfo.xml $(RAW_FILES) $(IMAGES)
-
-telegps.html telegps.pdf: telegps-docinfo.xml $(TELEGPS_RAW_FILES) $(IMAGES)
-
-micropeak.pdf micropeak.html: micropeak-docinfo.xml $(MICROPEAK_RAW_FILES) $(IMAGES)
-
-easymini.pdf easymini.html: easymini-docinfo.xml $(EASYMINI_RAW_FILES) $(IMAGES)
-
-telemini-v1-outline.pdf: telemini-v1-outline.txt telemini-v1.svg
-
-telemini-v3-outline.pdf: telemini-v3-outline.txt telemini-v3.svg
-
-install:       all
-
-WEB_ROOT=/home/bdale/web/
-
-publish:       $(PUBLISH_DOC) $(FONTS)
-       cp $(PUBLISH_DOC) $(WEB_ROOT)/altusmetrum/AltOS/doc/
-       mkdir -p $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/
-       cp $(FONTS) $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/
-       (cd $(WEB_ROOT)/altusmetrum ; \
-        git add $(WEB_ROOT)/altusmetrum/AltOS/doc/* ; \
-        git add $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/* ; \
-        echo "update docs" | \
-        git commit -F - $(WEB_ROOT)/altusmetrum/AltOS/doc/* $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/* ; \
-        git push)
-
-publish-keithp:        am.html $(PUBLISH_DOC) $(FONTS)
-       scp -p am.html $(PUBLISH_DOC) keithp.com:~keithp/public_html/altos
-       scp -p $(FONTS) keithp.com:~keithp/public_html/altos/fonts
-
-clean:
-       rm -f am.html $(HTML) $(HTML_REVHISTORY) $(PDF) $(TEMPLATES_XSL) $(RAW_FILES) $(TELEGPS_RAW_FILES) $(MICROPEAK_RAW_FILES)
-
-distclean: clean
-       rm -f $(HTML) $(PDF)
-
-$(PDF): $(PDF_CONFIG_FILES)
-$(HTML): $(HTML_CONFIG_FILES)
-
-am.html: Makefile make-am-html $(HTML)
-       sh ./make-am-html $(HTML) > $@
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644 (file)
index 0000000..450053f
--- /dev/null
@@ -0,0 +1,328 @@
+#
+#      http://docbook.sourceforge.net/release/xsl/current/README
+#
+
+if FAKETIME
+FAKETIME=TZ=UTC faketime -f '$(RELEASE_DATE) 00:00:00 i0'
+endif
+
+RELNOTES_INC=\
+       release-notes-1.8.7.inc \
+       release-notes-1.8.6.inc \
+       release-notes-1.8.5.inc \
+       release-notes-1.8.4.inc \
+       release-notes-1.8.3.inc \
+       release-notes-1.8.2.inc \
+       release-notes-1.8.1.inc \
+       release-notes-1.8.inc \
+       release-notes-1.7.inc \
+       release-notes-1.6.8.inc \
+       release-notes-1.6.5.inc \
+       release-notes-1.6.4.inc \
+       release-notes-1.6.3.inc \
+       release-notes-1.6.2.inc \
+       release-notes-1.6.1.inc \
+       release-notes-1.6.inc \
+       release-notes-1.5.inc \
+       release-notes-1.4.2.inc \
+       release-notes-1.4.1.inc \
+       release-notes-1.4.inc \
+       release-notes-1.3.2.inc \
+       release-notes-1.3.1.inc \
+       release-notes-1.3.inc \
+       release-notes-1.2.1.inc \
+       release-notes-1.2.inc \
+       release-notes-1.1.1.inc \
+       release-notes-1.1.inc \
+       release-notes-1.0.1.inc \
+       release-notes-0.9.2.inc \
+       release-notes-0.9.inc \
+       release-notes-0.8.inc \
+       release-notes-0.7.1.inc
+
+IMAGES=\
+       altosui.png \
+       ascent.png \
+       configure-altimeter.png \
+       configure-altosui.png \
+       configure-groundstation.png \
+       configure-pyro.png \
+       descent.png \
+       device-selection.png \
+       easymega.svg \
+       easymega-v1.0-bottom.jpg \
+       easymega-v1.0-top.jpg \
+       easymini.svg \
+       easymini-top.jpg \
+       fire-igniter.png \
+       graph-configure.png \
+       graph-map.png \
+       graph.png \
+       graph-stats.png \
+       ignitor.png \
+       landed.png \
+       launch-pad.png \
+       load-maps.png \
+       micropeak-app.png \
+       micropeak-back.jpg \
+       micropeak-device-dialog.png \
+       micropeak-dime.jpg \
+       micropeak-download.png \
+       micropeak-graph-configure.png \
+       micropeak-graph.png \
+       micropeak-nofont.svg \
+       micropeak-preferences.png \
+       micropeak-raw-data.png \
+       micropeak-save-dialog.png \
+       micropeak-statistics.png \
+       MicroPeakUSB-2.0-inuse.jpg \
+       MicroPeakUSB-2.0.jpg \
+       monitor-idle.png \
+       scan-channels.png \
+       site-map.png \
+       table.png \
+       telegps-configure.png \
+       telegps-graph-configure.png \
+       telegps-graph-graph.png \
+       telegps-graph-map.png \
+       telegps-graph-stats.png \
+       telegps-info.png \
+       telegps-location.png \
+       telegps-map.png \
+       telegps-preferences.png \
+       telegps-scan.png \
+       telegps-status.png \
+       telegps-table.png \
+       telegps-v1.0-top.jpg \
+       telemega.svg \
+       telemega-v1.0-top.jpg \
+       telemetrum.svg \
+       telemetrum-v1.1-thside.jpg \
+       telemetrum-v2.0-th.jpg \
+       telemini-v1.svg \
+       telemini-v1-top.jpg \
+       telemini-v3.svg \
+       telemini-v3.0-top.jpg \
+       telemini-v3.0-bottom.jpg \
+       altusmetrum-oneline.svg \
+       telegps-oneline.svg \
+       micropeak-oneline.svg
+
+TXT_FILES=altusmetrum.txt
+
+COMMON_INC_FILES=\
+       config-device.inc \
+       config-ui.inc \
+       load-maps.inc \
+       aprs-operation.inc \
+       handling.inc
+
+INC_FILES=\
+       dedication.inc \
+       intro.inc \
+       getting-started.inc \
+       usage.inc \
+       telemetrum.inc \
+       telemini.inc \
+       easymini-device.inc \
+       telemega.inc \
+       easymega.inc \
+       installation.inc \
+       using-am-products.inc \
+       updating-firmware.inc \
+       altosui.inc \
+       altosdroid.inc \
+       system-operation.inc \
+       pyro-channels.inc \
+       flight-data-recording.inc \
+       specs.inc \
+       $(COMMON_INC_FILES) \
+       release-notes.inc \
+       $(RELNOTES_INC)
+
+RAW_FILES=$(TXT_FILES:.txt=.raw) $(INC_FILES:.inc=.raw)
+
+TELEGPS_INC_FILES=\
+       telegps-dedication.inc \
+       telegps-quick-start.inc \
+       telegps-using.inc \
+       telegps-system-operation.inc \
+       telegps-application.inc \
+       telegps-specs.inc \
+       telegps-updating-firmware.inc \
+       telegps-release-notes.inc \
+       $(COMMON_INC_FILES)
+
+TELEGPS_TXT_FILES=\
+       telegps.txt
+
+TELEGPS_RAW_FILES=$(TELEGPS_TXT_FILES:.txt=.raw) $(TELEGPS_INC_FILES:.inc=.raw)
+
+MICROPEAK_TXT_FILES=\
+       micropeak.txt
+
+MICROPEAK_INC_FILES=
+
+MICROPEAK_RAW_FILES=$(MICROPEAK_TXT_FILES:.txt=.raw) $(MICROPEAK_INC_FILES:.inc=.raw)
+
+EASYMINI_TXT_FILES=\
+       easymini.txt
+
+EASYMINI_INC_FILES=$(INC_FILES) easymini-release-notes.inc
+
+
+EASYMINI_RAW_FILES=$(EASYMINI_TXT_FILES:.txt=.raw) $(EASYMINI_INC_FILES:.inc=.raw)
+
+OUTLINE_TXT_FILES=\
+       easymega-outline.txt \
+       easymini-outline.txt \
+       telemega-outline.txt \
+       telemetrum-outline.txt \
+       telemini-v1-outline.txt \
+       telemini-v3-outline.txt \
+       telegps-outline.txt
+
+OUTLINE_RAW_FILES=$(OUTLINE_TXT_FILES:.txt=.raw)
+
+OUTLINE_PDF_FILES=$(OUTLINE_TXT_FILES:.txt=.pdf)
+
+SVG=\
+       easymini.svg \
+       telemega.svg \
+       telemetrum.svg \
+       telemini-v1.svg \
+       telemini-v3.svg \
+       easymega.svg
+
+RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
+
+ONEFILE_TXT_FILES=\
+       altos.txt \
+       companion.txt \
+       telemetry.txt \
+       map-loading.txt
+
+ONEFILE_RAW_FILES=$(ONEFILE_TXT_FILES:.txt=.raw)
+ONEFILE_PDF_FILES=$(ONEFILE_TXT_FILES:.txt=.pdf)
+ONEFILE_HTML_FILES=$(ONEFILE_TXT_FILES:.txt=.html)
+
+AM_HTML=am.html
+
+PUBLISH_HTML=altusmetrum.html micropeak.html telegps.html easymini.html $(ONEFILE_HTML_FILES)
+
+HTML=$(PUBLISH_HTML) $(RELNOTES_HTML)
+
+HTML_REVHISTORY=\
+       altusmetrum-revhistory.html \
+       micropeak-revhistory.html \
+       telegps-revhistory.html \
+       easymini-revhistory.html
+
+PDF=altusmetrum.pdf micropeak.pdf telegps.pdf easymini.pdf $(ONEFILE_PDF_FILES) \
+       $(OUTLINE_PDF_FILES)
+
+MAP_DOT_FILES=map-loading.dot
+MAP_SVG_FILES=$(MAP_DOT_FILES:.dot=.svg)
+FOP_STYLE=am-fo.xsl
+HTML_STYLE=am-html.xsl
+COMMON_STYLE=common.xsl
+FOP_XCONF=fop.xconf
+STYLESHEET=am.css
+
+FONTS=\
+       fonts/DejaVuSansMono-BoldOblique.ttf \
+       fonts/DejaVuSansMono-Bold.ttf \
+       fonts/DejaVuSansMono-Oblique.ttf \
+       fonts/DejaVuSansMono.ttf \
+       fonts/OpenSans-Light.ttf \
+       fonts/OpenSans-LightItalic.ttf \
+       fonts/OpenSans-Regular.ttf \
+       fonts/OpenSans-Italic.ttf \
+       fonts/OpenSans-Semibold.ttf \
+       fonts/OpenSans-SemiboldItalic.ttf
+
+TEMPLATES_TMPL=titlepage.templates.tmpl
+
+TEMPLATES_XSL=$(TEMPLATES_TMPL:.tmpl=.xsl)
+
+PDF_CONFIG_FILES=$(FOP_STYLE) $(COMMON_STYLE) $(FOP_XCONF) $(TEMPLATES_XSL)
+HTML_CONFIG_FILES=$(HTML_STYLE) $(COMMON_STYLE) $(TEMPLATES_XSL)
+
+PUBLISH_DOC=$(PUBLISH_HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
+
+DOC=$(HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
+
+SUFFIXES = .dot .svg .tmpl .xsl .inc .txt .raw .pdf .html
+
+.dot.svg:
+       dot -Tsvg -o$@ $*.dot
+
+.txt.raw:
+       sed -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
+
+.inc.raw:
+       sed -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
+
+.raw.html:
+       a2x -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(HTML_STYLE) --stylesheet=$(STYLESHEET) $*.raw
+       case $* in release-notes*) ./fix-html $*.html ;; esac
+       $(FAKETIME) a2x -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(FOP_STYLE) --fop --fop-opts="-c $(FOP_XCONF)" $*.raw
+
+.html.pdf:
+       echo $@
+
+.tmpl.xsl:
+       xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl
+
+all:   $(HTML) $(PDF)
+
+map-loading.raw: $(MAP_SVG_FILES)
+
+altusmetrum-revhistory.html: altusmetrum.html
+
+micropeak-revhistory.html: micropeak.html
+
+telegps-revhistory.html: telegps.html
+
+altusmetrum.pdf altusmetrum.html: altusmetrum-docinfo.xml $(RAW_FILES) $(IMAGES)
+
+telegps.html telegps.pdf: telegps-docinfo.xml $(TELEGPS_RAW_FILES) $(IMAGES)
+
+micropeak.pdf micropeak.html: micropeak-docinfo.xml $(MICROPEAK_RAW_FILES) $(IMAGES)
+
+easymini.pdf easymini.html: easymini-docinfo.xml $(EASYMINI_RAW_FILES) $(IMAGES)
+
+telemini-v1-outline.pdf: telemini-v1-outline.txt telemini-v1.svg
+
+telemini-v3-outline.pdf: telemini-v3-outline.txt telemini-v3.svg
+
+install:       all
+
+WEB_ROOT=/home/bdale/web/
+
+publish:       $(PUBLISH_DOC) $(FONTS)
+       cp $(PUBLISH_DOC) $(WEB_ROOT)/altusmetrum/AltOS/doc/
+       mkdir -p $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/
+       cp $(FONTS) $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/
+       (cd $(WEB_ROOT)/altusmetrum ; \
+        git add $(WEB_ROOT)/altusmetrum/AltOS/doc/* ; \
+        git add $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/* ; \
+        echo "update docs" | \
+        git commit -F - $(WEB_ROOT)/altusmetrum/AltOS/doc/* $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/* ; \
+        git push)
+
+publish-keithp:        am.html $(PUBLISH_DOC) $(FONTS)
+       scp -p am.html $(PUBLISH_DOC) keithp.com:~keithp/public_html/altos
+       scp -p $(FONTS) keithp.com:~keithp/public_html/altos/fonts
+
+clean:
+       rm -f am.html $(HTML) $(HTML_REVHISTORY) $(PDF) $(TEMPLATES_XSL) $(RAW_FILES) $(TELEGPS_RAW_FILES) $(MICROPEAK_RAW_FILES)
+
+distclean: clean
+       rm -f $(HTML) $(PDF)
+
+$(PDF): $(PDF_CONFIG_FILES)
+$(HTML): $(HTML_CONFIG_FILES)
+
+am.html: Makefile make-am-html $(HTML)
+       sh ./make-am-html $(HTML) > $@
index 748d2b5b428539355fa329a244b3eab6c2d85c68..678ac17ef8eb63605ff01b10740223319d9b5354 100644 (file)
@@ -1,12 +1,12 @@
 Creating documentation for a new release of AltOS
 
+* Write release notes in release-notes-${version}.inc. Add to
+  Makefile
+
 * Make sure that doc/altusmetrum-docinfo.xml has the right copyright 
   year, and add release to the revision history at the front (release 
   notes will be pulled in by release-notes.inc)
 
-* Write release notes in release-notes-${version}.inc. Add to
-  Makefile
-
 * Add references to that as appropriate from each of the
   documents:
 
@@ -34,3 +34,5 @@ Creating documentation for a new release of AltOS
        telemetry-docinfo.xml
 
 * Add release-notes-${version}.inc to git
+
+* Make sure new hardware specs are documented in specs.inc
index 7b696b97e9bba1104fc97ba9b72c174447a6ba5e..18bc644d24906c3d88d1afabd981e36199c5442c 100644 (file)
 </legalnotice>
 <revhistory>
   <?dbhtml filename="altusmetrum-revhistory.html"?>
+  <revision>
+    <revnumber>1.8.7</revnumber>
+    <date>8 Oct  2018</date>
+    <revremark>
+      Include TeleMega v3.0 firmware in release. Fix TeleBT v4.0 RF
+      calibration to factory value when reflashing. Fix map images.
+      Fix Mac OS X support.
+    </revremark>
+  </revision>
   <revision>
     <revnumber>1.8.6</revnumber>
     <date>6 Aug 2018</date>
diff --git a/doc/map-loading.dot b/doc/map-loading.dot
new file mode 100644 (file)
index 0000000..f5be02e
--- /dev/null
@@ -0,0 +1,35 @@
+digraph map_loading {
+       edge [arrowsize=0.5; style="setlinewidth(2)"]
+       node [style=filled; fontcolor=white; color=invis; shape=box; arrowsize=0.5; fontname="DejaVu Sans,sans-serif"; fontsize=12; height=0.2;];
+       edge [decorate=true; fontname="DejaVu Sans,sans-serif"; fontsize=8];
+       graph [fontname="DejaVu Sans,sans-serif"; fontsize=15; ]
+       rankdir="TB";
+       ranksep=0.5;
+       nodesep=0.5;
+       color=invis;
+       fillcolor="#c0c0c0";
+       fontcolor="white";
+
+       app -> apache [label="AltOS Map URI"]
+       apache -> app [label="Google Map tile"]
+
+       apache -> cgi_script [label="AltOS Map URI"]
+       cgi_script -> cache_manager [label="AltOS Tile Request"]
+
+       cgi_script -> apache [label="Google Map tile"]
+
+       cache_manager -> cgi_script [label="AltOS Tile Reply"]
+
+       cache_manager -> disk_files [label="AltOS tile files" dir="both"]
+       cache_manager -> google_maps [label="Google Map URI"]
+
+       google_maps -> cache_manager [label="Google Map tile"]
+
+       app [color="#885931" label="Application"]
+       apache [color="#d12127" label="Apache Web Server"]
+       cgi_script [color="#551a8b" label="AltOS Map CGI Script"]
+       cache_manager [color="#c75b1c" label="AltOS Map Cache Manager"]
+       disk_files [color="#4f81bd" label="File System"]
+       google_maps [color="#4cbb44" label="Google Maps"]
+}
+       
diff --git a/doc/map-loading.txt b/doc/map-loading.txt
new file mode 100644 (file)
index 0000000..1b39dd6
--- /dev/null
@@ -0,0 +1,221 @@
+= Loading Map Tiles from Google Maps
+:doctype: article
+
+== The Google Maps Problem
+
+Until recently, Google Maps could be used without fee to fetch map
+tiles. Applications could load map tiles anonymously or using a key;
+when used anonymously, the number of tiles that could be loaded per
+day and the rate at which tiles could be loaded was throttled to make
+the API practical only for development purpose. With an application
+key, the number of tiles available per day was much higher, and there
+was no rate limiting. This was usually sufficient for Altos Metrum
+customer use.
+
+However, this has changed and now there is no way to load map tiles
+anonymously, and any application key must be tied to a credit
+card. The tile cap for free usage is now monthly instead of
+daily. Because the key is tied to a credit card, we should not ship it
+with the application any longer. And because the cap is monthly
+instead of daily, we need some way to control usage by our
+applications.
+
+=== The Proposed Solution — An Intermediate Service
+
+To give us some measure of control over tile loading, we will want to
+interpose a server controlled by us between the application and Google
+Maps. This will let us store the Google Maps key in a secure location,
+and also control tile loading by each user.
+
+image::map-loading.svg[align="center"]
+
+== AltOS Map Service
+
+This service receives a URL request and replies with either a map tile
+or an error. It is functionally equivalent to the Google Maps service,
+except that it can control use of the Google Maps API.
+
+=== AltOS Map CGI Script
+
+The AltOS Map CGI Script is a straightforward script which connects to
+the AltOS Map Cache Manager, transmits a URL describing the desired
+map tile and receives back a filename (or error), then sends the
+contents of that file back through Apache to the requesting
+application. The name of the script is 'altos-map'.
+
+==== Inputs
+
+The AltOS Map CGI Script will parse the provided AltOS Map URI or
+AltOS Version URI.
+
+==== Outputs
+
+For AltOS Map URLs, the CGI Script will return either the contents of
+the associated Google Map tile or an error indicating what failed:
+
+_200 OK_: The map tile image data or version information
+
+_400 Bad Request_: The URL is malformed or not compatible with the
+version supported by the service
+
+_403 Forbidden_: The map tile is outside the areas supported by the
+current AltOS Map service area
+
+_408 Request Timeout_: Attempts to fetch the tile from Google Maps
+timed out.
+
+_503 Service Unavailable_: The service is temporarily refusing to
+satisfy this request due to resource limitations.
+
+=== AltOS Map Cache Manager
+
+This is a service running on the local machine and available over a
+local network socket. It translates an AltOS Map URL into a local
+filename containing the contents of the associated Google Maps
+tile. The name of the cache manager is 'altos-mapd'. It will listen
+for requests on port 16717.
+
+=== AltOS Map URI
+
+AltOS uses a limited subset of the Google Maps, and the AltOS Map URIs
+only encode those elements which we currently use. This specification
+describes AltOS Map URI format version 1.0.0. The application is
+required to provide URIs compatible with the format supported by the
+server. The elements of the  elements are:
+
+ * Latitude of center point
+ * Longitude of center point
+ * Zoom level (from bushes to planets)
+
+Encoding this in a URI is straightforward:
+
+\      altos-map?lat=<lat>&lon=<lon>&zoom=<zoom>
+
+Latitude and longitude are both encoded using decimal degrees with 6
+digits following the decimal point.
+
+Zoom levels can range from 1 (world) to 20 (buildings). Higher zoom
+levels show smaller areas at greater detail.
+
+The only Google Map type supported by version 1.0.0 of the service is
+“hybrid”, which combines road graphics on top of satellite images.
+
+Version 1.0.0 always returns images which are 512x512 pixels.
+
+If we need additional elements in the URL, we can add them in the
+future and bump the supported version number.
+
+=== AltOS Version URI
+
+To allow applications to discover what AltOS Map URI version is supported by the
+AltOS Map service, the application may query the version of the API
+supported using the Version URI. The application provides the version
+that it supports and the AltOS Map service returns a version not
+greater than the client version:
+
+\      altos-map?version=<client-major>.<client-minor>.<client-revision>
+\      →
+\      <server-major>.<server-minor>.<server.revision>
+
+=== AltOS Tile Request
+
+The AltOS Map CGI Script parses the Map URI and passes that
+information to the AltOS Map Cache Manager using the AltOS Tile
+Specifier syntax. This is a JSON representation of the same data
+provided by the URI:
+
+\      {
+\              "lat": <latitude>,
+\              "lon": <longitude>,
+\              "zoom": <zoom-level>,
+\              "remote_addr": "<IPv4 or IPv6 address of requesting client>"
+\      }
+
+Latitude and longitude are both encoded using decimal degrees with 6
+digits following the decimal point.
+
+=== AltOS Tile Reply
+
+Sent back from the Cache Manager to the CGI Script, this encodes the
+status of the request and the filename of any tile data available. It
+is encoded in JSON format:
+
+\      {
+\              "status": <HTTP status>,
+\              "filename": "<absolute path to image file>",
+\              "content_type": "<HTTP content-type>"
+\      }
+
+The “filename” and “content-type” elements are only included when
+the status is _200 OK_.
+
+=== AltOS Tile Filename
+
+While the current AltOS Map URI version only supports a limited subset
+of the Google Maps functionality, we'll encode more of that data in
+filenames to allow for easy expansion of functionality in the
+future. The elements of an AltOS Tile filename consist of :
+
+ * Latitude, with N/S indicator (instead of a sign)
+ * Longitude, with E/W indicator (instead of a sign)
+ * Map type.
+ * Zoom level
+ * Scale factor. Scale, and the preceding hyphen are omitted for a scale factor of 1.
+ * Image format suffix. '.jpg' for JPEG files and '.png' for PNG files.
+
+Latitude and longitude are both encoded using decimal degrees with 6
+digits following the decimal point.
+
+Map type is one of :
+
+ _hybrid_: Road graphics over satellite images
+ _roadmap_: Symbolic road map
+ _satellite_: Un-annotated satellite images
+ _terrain_: Topographic map
+
+Here's what map filenames look like:
+
+\      map-{N,S}<lat>,{E,W}<lon>-<type>-<zoom>[-<scale>].<format>
+\
+\      map-N36.508532,W107.823944-hybrid-18.jpg
+
+To transmit this name from the AltOS Map Cache Manager back to the
+Altos Map CGI script, the filename will be wrapped in a JSON string
+
+== Implementation
+
+The AltOS Map CGI Script and AltOS Map Cache Manager will both be
+implemented in Java as much of the required Google Maps infrastructure
+is already available in that language.
+
+=== Access Control
+
+No access control to the service is planned at this point. If
+necessary, we could implement username/password access control for each
+user of the service.
+
+=== Location Restrictions
+
+To avoid unbounded usage, and confine the utility of this service to
+AltOS users, the service will only offer map tiles whose center
+location is within 10 miles of one of the sites registered in
+our launch sites database.
+
+To allow testing of the registered launch site database, a database of
+privileged clients will be supported. Privileged clients will have
+unlimited access to the service.
+
+=== Per-Client Restrictions
+
+We should implement a per-day limit on the number of tiles provided to
+a particular requesting client. We can also rate limit clients to a
+certain number of tiles per minute to reduce the bandwidth consumed
+out of our server.
+
+=== Cache Lifetime Restrictions.
+
+The Google Maps API allows for caching of map data for no more than 30
+days. To honor this, the Cache Manager will re-fetch any requested
+tiles when the cached version is older than this. If the fetch fails,
+the cache manager will continue to serve the data from the cached
+version of the file.
index 37c6e7704e592c57a33b3fa01fa5bf0c4a5c9de5..6fab12b8770e676838f862485fbc88a9a08328b8 100644 (file)
@@ -5,7 +5,7 @@
   <email>keithp@keithp.com</email>
 </author>
 <copyright>
-  <year>2014</year>
+  <year>2018</year>
   <holder>Keith Packard</holder>
 </copyright>
 <mediaobject>
 </legalnotice>
 <revhistory>
   <?dbhtml filename="micropeak-revhistory.html"?>
+  <revision>
+    <revnumber>1.8.7</revnumber>
+    <date>8 October 2018</date>
+    <revremark>
+      Poll for MicroPeak USB while the device dialog is open. Fix Mac OS X support.
+    </revremark>
+  </revision>
+  <revision>
+    <revnumber>1.8.6</revnumber>
+    <date>6 August 2018</date>
+    <revremark>
+      Report altimeter-recorded maximum height value
+    </revremark>
+  </revision>
   <revision>
     <revnumber>1.3.2</revnumber>
     <date>12 February 2014</date>
diff --git a/doc/release-notes-1.8.7.inc b/doc/release-notes-1.8.7.inc
new file mode 100644 (file)
index 0000000..f8b7b10
--- /dev/null
@@ -0,0 +1,37 @@
+= Release Notes for Version 1.8.7
+:toc!:
+:doctype: article
+
+       Version 1.8.7
+
+       == AltOS
+
+       * Include TeleMega v3.0 firmware
+       
+       == AltosUI, TeleGPS, MicroPeak
+
+       * Poll for new devices while Device dialog is displayed
+
+       * Wait for device to re-appear when flashing new firmware
+
+       * Fetch correct TeleBT v4.0 RF calibration values from web
+          site when reflashing.
+
+       * Change gyro headings in .csv files from x/y/z to
+          roll/pitch/yaw
+
+       * Add documentation about Packet Link mode
+
+       * Add documentation about forcing TeleMini RF parameters to
+          known values.
+
+       * Create a proxy server for Google Maps to re-enable map
+          images
+
+       * Fix Java version info in all distributed jar files so that
+          applications will run with standard Mac OS X Java.
+
+       * Replace JavaApplicationStub for Mac OS X so that
+          applications will run with Oracle Java.
+
+       
index 693699dfd73af2106260acae29ffa704ce404194..1183fd122a172abf753e1065c32344d6c32c8734 100644 (file)
@@ -1,5 +1,9 @@
 [appendix]
 == Release Notes
+       :leveloffset: 2
+       include::release-notes-1.8.7.raw[]
+
+       <<<<
        :leveloffset: 2
        include::release-notes-1.8.6.raw[]
 
index f09d6fc9e7290587fce1099c17235ba76147291a..1b7ea74b3ef3f160849c1294173123076dd95b06 100644 (file)
        |1MB
        |-
        |3.7-12V
+
+       |EasyMini v2.0
+       |MS5607 30km (100k')
+       |-
+       |-
+       |-
+       |1MB
+       |-
+       |3.7-12V
        endif::easymini[]
 
        ifdef::telemega[]
        |8MB
        |40mW
        |3.7V
+
+       |TeleMega v3.0
+       |MS5607 30km (100k')
+       |MMA6555 102g
+       |uBlox Max-7Q
+       |MPU9250
+       |8MB
+       |40mW
+       |3.7V
        endif::telemega[]
 
        ifdef::easymega[]
index 5e347cfdeedc6eeb3aef767bfef797050b73e097..4d3533de0b0d62867f957847e4e5c5f37736cda7 100644 (file)
@@ -10,7 +10,7 @@
   <email>keithp@keithp.com</email>
 </author>
 <copyright>
-  <year>2015</year>
+  <year>2018</year>
   <holder>Bdale Garbee and Keith Packard</holder>
 </copyright>
 <mediaobject>
 </legalnotice>
 <revhistory>
   <?dbhtml filename="telegps-revhistory.html"?>
+  <revision>
+    <revnumber>1.8.7</revnumber>
+    <date>08 Oct 2018</date>
+    <revremark>
+      Fix TeleBT v4.0 RF calibration to factory value when
+      reflashing. Fix map images. Fix Mac OS X support.
+    </revremark>
+  </revision>
   <revision>
     <revnumber>1.8.3</revnumber>
     <date>11 Dec 2017</date>
index b40582a2093638c72321bd5cb84cf9b253f33eb9..08893dfba63da04f11c3362f6e3684968846502b 100644 (file)
                the left power switch wire. Hook a lead to either of the
                mounting holes for a ground connection.
 
+       === Using Packet Link Mode with TeleMini
+
+               After TeleMini powers up, it will check to see if some
+               device is attempting to communicate with it using
+               Packet Link Mode. If so, it will switch to idle mode
+               and start communicating. To switch to flight mode,
+               reboot the device either over the radio link or by
+               powering it off and back on.
+
+               If no ground station is attempting to communicate
+               using Packet Link Mode, TeleMini will enter pad mode
+               and prepare for flight.
+
+               The sequence of operations to use Packet Link Mode
+               with TeleMini is:
+
+               1. Configure the ground station data rate, frequency
+               and callsign to match the TeleMini settings.
+
+               2. Start Packet Link Mode in the ground station by
+               selecting the desired operation (Safe Flight Data,
+               Configure Altimeter, Fire Igniter or Monitor
+               Idle). Select the TeleBT or TeleDongle device. The
+               red LED should begin flashing rapidly.
+
+               3. Turn on TeleMini. You should see the red LED flash
+               very rapidly during the initial communication burst,
+               but it should then slow down when the link is idle.
+
+               Once TeleMini is in Idle mode, it will stay in that
+               mode until rebooted. That means you can stop one
+               Packet Link operation, wait a while and start another
+               Packet Link operation.
+
+       === Forcing TeleMini radio parameters to known defaults
+
+               If you don't know what the TeleMini frequency and
+               callsign settings are, you can temporarily force it
+               back to the original default values (frequency
+               434.550MHz, callsign N0CALL) by connecting a wire
+               between hole 3 and hole 7 on the debug connector. Hole
+               3 has the square pad around it, hole 7 is the one
+               nearest the MS5607 baro sensor, which is a rectangular
+               component with a metal cap that has two holes in it.
+
+               Once TeleMini has been powered up with this wire
+               connected, the wire may be removed. The radio
+               parameters will stay set to these default values until
+               changed by the user or when the device is rebooted.
+
        === TeleMini v1
 
                TeleMini v1 is the earlier version of this product. It
index d010f398e76d926559dc5eb398217f074b0b88f3..dd795bdd4125f7a0ad55987a1a0ba35d000ce12c 100644 (file)
                different kind of battery to any of these will destroy
                the board.
                endif::telemega,easymega,telemetrum[]
+
+       === Using Packet Link Mode
+
+               All AltusMetrum flight computers that have a radio can
+               communicate with the ground station software for
+               configuration and other operations using the Packet
+               Link mode. This uses radio communication instead of a
+               USB cable. To set this up, the ground station software
+               must be configured to the correct data rate, frequency
+               and callsign.
+
+               You can monitor Packet Link mode from TeleBT or
+               TeleDongle by watching the LEDs. Each time the device
+               transmits, the red LED will flash. When the link is
+               busy, or when the link is not working, the device will
+               transmit 10 times per second, so the LED will flash
+               rapidly. When the link is working and there is no data
+               to send, the link will flash once per second, and the
+               LED will flash more slowly.
diff --git a/map-server/Makefile.am b/map-server/Makefile.am
new file mode 100644 (file)
index 0000000..39ff801
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS=altos-mapd altos-map altos-mapj
diff --git a/map-server/altos-map/.gitignore b/map-server/altos-map/.gitignore
new file mode 100644 (file)
index 0000000..1158b56
--- /dev/null
@@ -0,0 +1 @@
+altos-map
diff --git a/map-server/altos-map/Makefile.am b/map-server/altos-map/Makefile.am
new file mode 100644 (file)
index 0000000..6925957
--- /dev/null
@@ -0,0 +1,6 @@
+bin_PROGRAMS = altos-map
+
+altos_map_SOURCES = altos-map.c
+
+altos_map_LDADD = $(JANSSON_LIBS)
+altos_map_CFLAGS = $(JANSSON_CFLAGS) $(WARN_CFLAGS)
diff --git a/map-server/altos-map/altos-map-fake b/map-server/altos-map/altos-map-fake
new file mode 100755 (executable)
index 0000000..1bf5f8e
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+# map-N43.799102,W120.586281-hybrid-20.jpg
+export QUERY_STRING="lat=43.799102&lon=-120.586281&zoom=20"
+export REMOTE_ADDR="127.0.0.1"
+./altos-map
diff --git a/map-server/altos-map/altos-map.c b/map-server/altos-map/altos-map.c
new file mode 100644 (file)
index 0000000..3870107
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include <jansson.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <netinet/ip.h>
+
+#define ALTOS_MAP_PORT 16717
+
+#define MISSING                0x7fffffff
+
+#define ALTOS_MAP_PROTOCOL_VERSION     "1.0.0"
+
+static char *
+reason_string(int code)
+{
+       switch (code) {
+       case 200:
+               return "OK";
+       case 400:
+               return "Bad Request";
+       case 403:
+               return "Forbidden";
+       case 404:
+               return "Not Found";
+       case 408:
+               return "Request Timeout";
+       default:
+               return "Failure";
+       }
+}
+
+static void
+write_status(int status)
+{
+       printf("Status: %d %s\n", status, reason_string(status));
+}
+
+static void
+write_type(char * type)
+{
+       printf("Content-Type: %s\n", type);
+}
+
+static void
+fail(int status, char *format, ...)
+{
+       va_list ap;
+
+       write_status(status);
+       write_type("text/html");
+       printf("\n");
+       printf("<html>\n");
+       printf("<head><title>Map Fetch Failure</title></head>\n");
+       printf("<body>\n");
+       va_start(ap, format);
+       vprintf(format, ap);
+       va_end(ap);
+       printf("</body>\n");
+       printf("</html>\n");
+       exit(1);
+}
+
+static char *
+getenv_copy(const char *name)
+{
+       const char *value = getenv(name);
+
+       if (!value)
+               return NULL;
+
+       return strdup(value);
+}
+
+static double
+parse_double(char *string)
+{
+       char *end;
+       double value;
+
+       value = strtod(string, &end);
+       if (*end)
+               fail(400, "Invalid double %s", string);
+       return value;
+}
+
+static int
+parse_int(char *string)
+{
+       char *end;
+       long int value;
+
+       value = strtol(string, &end, 10);
+       if (*end)
+               fail(400, "Invalid int %s", string);
+       if (value < INT_MIN || INT_MAX < value)
+               fail(400, "Int value out of range %ld", value);
+       return (int) value;
+}
+
+
+static int
+connect_service(void)
+{
+       struct sockaddr_in      altos_map_addr = {
+               .sin_family = AF_INET,
+               .sin_port = htons(ALTOS_MAP_PORT),
+               .sin_addr = {
+                       .s_addr = htonl(INADDR_LOOPBACK),
+               },
+       };
+
+       int     s = socket(AF_INET, SOCK_STREAM, 0);
+
+       if (s < 0)
+               return -1;
+
+       if (connect (s, (const struct sockaddr *) &altos_map_addr, sizeof (altos_map_addr)) < 0) {
+               close (s);
+               return -1;
+       }
+
+       return s;
+}
+
+int main(int argc, char **argv)
+{
+
+       char *query_string = getenv_copy("QUERY_STRING");
+
+       if (query_string == NULL)
+               fail(400, "%s", "Missing query string");
+
+       char *remote_addr = getenv_copy("REMOTE_ADDR");
+
+       if (remote_addr == NULL)
+               fail(400, "%s", "Missing remote address");
+
+       double  lon = MISSING;
+       double  lat = MISSING;
+       int     zoom = MISSING;
+       char    *version = NULL;
+
+       char    *query, *query_save = NULL;
+       char    *query_start = query_string;
+
+       while ((query = strtok_r(query_start, "&", &query_save)) != NULL) {
+               query_start = NULL;
+
+               char    *token, *token_save = NULL;
+               char    *token_start = query;
+
+               char    *name = NULL;
+               char    *value = NULL;
+
+               while ((token = strtok_r(token_start, "=", &token_save)) != NULL) {
+                       token_start = NULL;
+                       if (name == NULL)
+                               name = token;
+                       else if (value == NULL)
+                               value = token;
+                       else
+                               break;
+               }
+
+               if (name && value) {
+                       if (!strcmp(name, "lon"))
+                               lon = parse_double(value);
+                       else if (!strcmp(name, "lat"))
+                               lat = parse_double(value);
+                       else if (!strcmp(name, "zoom"))
+                               zoom = parse_int(value);
+                       else if (!strcmp(name, "version"))
+                               version = value;
+                       else
+                               fail(400, "Extra query param \"%s\"", query);
+               }
+       }
+
+       if (version != NULL) {
+               printf("Content-Type: text/plain\n");
+               printf("\n");
+               printf("%s\n", ALTOS_MAP_PROTOCOL_VERSION);
+               return 0;
+       }
+       if (lon == MISSING)
+               fail(400, "Missing longitude");
+       if (lat == MISSING)
+               fail(400, "Missing latitude");
+       if (zoom == MISSING)
+               fail(400, "Missing zoom");
+
+       int     s = -1;
+       int     tries = 0;
+
+       while (tries < 10 && s < 0) {
+               s = connect_service();
+               if (s < 0) {
+                       usleep(100 * 1000);
+                       tries++;
+               }
+       }
+
+       if (s < 0)
+               fail(408, "Cannot connect AltOS map daemon");
+
+       FILE    *sf = fdopen(s, "r+");
+
+       if (sf == NULL)
+               fail(400, "allocation failure");
+
+       json_t *request = json_pack("{s:f s:f s:i s:s}", "lat", lat, "lon", lon, "zoom", zoom, "remote_addr", remote_addr);
+
+       if (request == NULL)
+               fail(400, "Cannot create JSON request");
+
+       if (json_dumpf(request, sf, 0) < 0)
+               fail(400, "Cannot write JSON request");
+
+       fflush(sf);
+
+       json_error_t    error;
+       json_t          *reply = json_loadf(sf, 0, &error);
+
+       if (!reply)
+               fail(400, "Cannot read JSON reply");
+
+       int     status;
+
+       if (json_unpack(reply, "{s:i}", "status", &status) < 0)
+               fail(400, "No status returned");
+
+       if (status != 200)
+               fail(status, "Bad cache status");
+
+       char    *filename, *content_type;
+
+       if (json_unpack(reply, "{s:s s:s}", "filename", &filename, "content_type", &content_type) < 0)
+               fail(400, "JSON reply parse failure");
+
+       int     fd = open(filename, O_RDONLY);
+
+       if (fd < 0)
+               fail(400, "%s: %s", filename, strerror(errno));
+
+       struct stat     statb;
+
+       if (fstat(fd, &statb) < 0)
+               fail(400, "%s: %s", filename, strerror(errno));
+
+       printf("Content-Type: %s\n", content_type);
+       printf("Content-Length: %lu\n", (unsigned long) statb.st_size);
+       printf("\n");
+       fflush(stdout);
+
+       char    buf[4096];
+       ssize_t bytes_read;
+
+       while ((bytes_read = read(fd, buf, sizeof (buf))) > 0) {
+               ssize_t total_write = 0;
+               while (total_write < bytes_read) {
+                       ssize_t bytes_write = write(1, buf + total_write, bytes_read - total_write);
+                       if (bytes_write <= 0)
+                               return 1;
+                       total_write += bytes_write;
+               }
+       }
+       if (bytes_read < 0)
+               return 1;
+       return 0;
+}
diff --git a/map-server/altos-mapd/.gitignore b/map-server/altos-mapd/.gitignore
new file mode 100644 (file)
index 0000000..5f5ce0a
--- /dev/null
@@ -0,0 +1,6 @@
+*.stamp
+*.jar
+altos-mapd
+altos-mapd-jdb
+altos-mapd-test
+classes
diff --git a/map-server/altos-mapd/AltosMapd.java b/map-server/altos-mapd/AltosMapd.java
new file mode 100644 (file)
index 0000000..2952854
--- /dev/null
@@ -0,0 +1,235 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package altosmapd;
+
+import java.net.*;
+import java.io.*;
+import java.text.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import org.altusmetrum.altoslib_13.*;
+
+public class AltosMapd implements AltosLaunchSiteListener {
+
+       public static int port = 16717;
+
+       public final static int maptype = AltosMap.maptype_hybrid;
+
+       public final static int px_size = 512;
+
+       public final static int scale = 1;
+
+       public static int max_zoom = 17;
+
+       public static double valid_radius = 17000;      /* 17km */
+
+       public String map_dir = null;
+       public String launch_sites_file = null;
+       public String key_file = null;
+
+       public void usage() {
+               System.out.printf("usage: altos-mapd [--mapdir <map-directory] [--launch-sites <launch-sites-file>]\n" +
+                                 "                  [--radius <valid-radius-m> [--port <port>] [--key <key-file>]\n" +
+                                 "                  [--max-zoom <max-zoom-level>\n");
+               System.exit(1);
+       }
+
+       private static Semaphore launch_sites_ready;
+
+       private static List<AltosLaunchSite> launch_sites;
+
+       public void notify_launch_sites(List<AltosLaunchSite> sites) {
+               synchronized (launch_sites_ready) {
+                       if (sites != null) {
+                               launch_sites = sites;
+                               launch_sites_ready.release();
+                       }
+               }
+       }
+
+       private static boolean west_of(double a, double b) {
+               double  diff = b - a;
+
+               while (diff >= 360.0)
+                       diff -= 360.0;
+               while (diff <= -360.0)
+                       diff += 360.0;
+
+               return diff >= 0;
+       }
+
+       public static boolean check_lat_lon(double lat, double lon, int zoom) {
+
+               if (zoom > max_zoom)
+                       return false;
+
+               AltosMapTransform       transform = new AltosMapTransform(px_size, px_size, zoom, new AltosLatLon(lat, lon));
+
+               AltosLatLon             upper_left = transform.screen_lat_lon(new AltosPointInt(0, 0));
+               AltosLatLon             lower_right = transform.screen_lat_lon(new AltosPointInt(px_size, px_size));
+
+               synchronized (launch_sites_ready) {
+                       if (launch_sites == null) {
+                               try {
+                                       launch_sites_ready.acquire();
+                               } catch (InterruptedException ie) {
+                                       return false;
+                               }
+                       }
+               }
+               if (launch_sites == null) {
+                       System.out.printf("No launch site data available, refusing all requests\n");
+                       return false;
+               }
+
+               for (AltosLaunchSite site : launch_sites) {
+
+                       /* Figure out which point in the tile to
+                        * measure to the site That's one of the edges
+                        * or the site location depend on where the
+                        * site is in relation to the tile
+                        */
+
+                       double          check_lon;
+
+                       if (west_of(site.longitude, upper_left.lon))
+                               check_lon = upper_left.lon;
+                       else if (west_of(lower_right.lon, site.longitude))
+                               check_lon = lower_right.lon;
+                       else
+                               check_lon = site.longitude;
+
+                       double          check_lat;
+
+                       if (site.latitude < lower_right.lat)
+                               check_lat = lower_right.lat;
+                       else if (upper_left.lat < site.latitude)
+                               check_lat = upper_left.lat;
+                       else
+                               check_lat = site.latitude;
+
+                       AltosGreatCircle gc = new AltosGreatCircle(site.latitude, site.longitude,
+                                                                  check_lat, check_lon);
+
+                       if (gc.distance <= valid_radius)
+                               return true;
+               }
+
+               return false;
+       }
+
+       AltosMapdServer server;
+
+       public void process(String[] args) {
+
+               AltosPreferences.init(new AltosMapdPreferences());
+
+               int skip = 1;
+               for (int i = 0; i < args.length; i += skip) {
+                       skip = 1;
+                       if (args[i].equals("--mapdir") && i < args.length-1) {
+                               map_dir = args[i+1];
+                               skip = 2;
+                       } else if (args[i].equals("--launch-sites") && i < args.length-1) {
+                               launch_sites_file = args[i+1];
+                               skip = 2;
+                       } else if (args[i].equals("--radius") && i < args.length-1) {
+                               try {
+                                       valid_radius = AltosParse.parse_double_locale(args[i+1]);
+                               } catch (ParseException pe) {
+                                       usage();
+                               }
+                               skip = 2;
+                       } else if (args[i].equals("--port") && i < args.length-1) {
+                               try {
+                                       port = AltosParse.parse_int(args[i+1]);
+                               } catch (ParseException pe) {
+                                       usage();
+                               }
+                               skip = 2;
+                       } else if (args[i].equals("--key") && i < args.length-1) {
+                               key_file = args[i+1];
+                               skip = 2;
+                       } else if (args[i].equals("--max-zoom") && i < args.length-1) {
+                               try {
+                                       max_zoom = AltosParse.parse_int(args[i+1]);
+                               } catch (ParseException pe) {
+                                       usage();
+                               }
+                               skip = 2;
+                       } else {
+                               usage();
+                       }
+               }
+
+               if (map_dir == null)
+                       usage();
+
+               if (key_file != null) {
+                       try {
+                               BufferedReader key_reader = new BufferedReader(new FileReader(key_file));
+
+                               String line = key_reader.readLine();
+                               if (line == null || line.length() != 39) {
+                                       System.out.printf("%s: invalid contents %d \"%s\"\n",
+                                                         key_file, line.length(), line);
+                                       usage();
+                               }
+                               key_reader.close();
+                               AltosMapStore.google_maps_api_key = line;
+                       } catch (Exception e) {
+                               System.out.printf("%s: %s\n", key_file, e.toString());
+                               usage();
+                       }
+               }
+
+               AltosPreferences.mapdir = new File(map_dir);
+
+               if (launch_sites_file != null)
+                       AltosLaunchSites.launch_sites_url = "file://" + launch_sites_file;
+
+               launch_sites_ready = new Semaphore(0);
+
+               new AltosLaunchSites(this);
+
+               try {
+                       server = new AltosMapdServer(port);
+               } catch (IOException ie) {
+                       System.out.printf("Cannot bind to port %d: %s\n", port, ie.toString());
+                       usage();
+               }
+
+               for (;;) {
+                       try {
+                               Socket client = server.accept();
+                               if (client == null) {
+                                       System.out.printf("accept failed\n");
+                                       continue;
+                               }
+                               new AltosMapdClient(client);
+                       } catch (Exception e) {
+                               System.out.printf("Exception %s\n", e.toString());
+                       }
+               }
+       }
+
+       public void AltosMapd() {
+       }
+
+       public static void main(final String[] args) {
+               new AltosMapd().process(args);
+       }
+}
diff --git a/map-server/altos-mapd/AltosMapdClient.java b/map-server/altos-mapd/AltosMapdClient.java
new file mode 100644 (file)
index 0000000..6c95da8
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package altosmapd;
+
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.io.*;
+
+import org.altusmetrum.altoslib_13.*;
+
+public class AltosMapdClient extends Thread implements AltosMapStoreListener {
+       private Socket          socket;
+       private AltosJson       request;
+       private AltosJson       reply;
+
+       private int             http_status;
+
+       private void set_status(int status) {
+               http_status = status;
+               reply.put("status", status);
+       }
+
+       private void set_filename(String filename) {
+               reply.put("filename", filename);
+
+       }
+
+       private void set_content_type(String content_type) {
+               reply.put("content_type", content_type);
+       }
+
+       private String content_type(File file) {
+               String content_type = "application/octet-stream";
+               String basename = file.getName();
+               if (basename.endsWith(".jpg"))
+                       content_type = "image/jpeg";
+               if (basename.endsWith(".png"))
+                       content_type = "image/png";
+               return content_type;
+       }
+
+       private void set_file(File file) {
+               set_filename(file.getAbsolutePath());
+               set_content_type(content_type(file));
+       }
+
+       private Semaphore store_ready;
+
+       public void notify_store(AltosMapStore map_store, int status) {
+               if (status != AltosMapTile.fetching)
+                       store_ready.release();
+       }
+
+       public void run() {
+               reply = new AltosJson();
+               try {
+                       request = AltosJson.fromInputStream(socket.getInputStream());
+
+                       if (request == null) {
+                               set_status(400);
+                               System.out.printf("client failed %d\n", http_status);
+                       } else {
+
+                               double  lat = request.get_double("lat", AltosLib.MISSING);
+                               double  lon = request.get_double("lon", AltosLib.MISSING);
+                               int     zoom = request.get_int("zoom", AltosLib.MISSING);
+                               String  addr = request.get_string("remote_addr", null);
+
+                               if (lat == AltosLib.MISSING ||
+                                   lon == AltosLib.MISSING ||
+                                   zoom == AltosLib.MISSING ||
+                                   addr == null)
+                               {
+                                       set_status(400);
+                               } else if (!AltosMapd.check_lat_lon(lat, lon, zoom)) {
+                                       set_status(403);        /* Forbidden */
+                               } else {
+
+                                       store_ready = new Semaphore(0);
+
+                                       AltosMapStore   map_store = AltosMapStore.get(new AltosLatLon(lat, lon),
+                                                                                     zoom,
+                                                                                     AltosMapd.maptype,
+                                                                                     AltosMapd.px_size,
+                                                                                     AltosMapd.scale);
+                                       int status;
+
+                                       if (map_store == null) {
+                                               status = AltosMapTile.failed;
+                                       } else {
+                                               map_store.add_listener(this);
+
+                                               try {
+                                                       store_ready.acquire();
+                                               } catch (Exception ie) {
+                                               }
+
+                                               status = map_store.status();
+                                       }
+
+                                       if (status == AltosMapTile.fetched || status == AltosMapTile.loaded) {
+                                               set_status(200);
+                                               set_file(map_store.file);
+                                       } else if (status == AltosMapTile.failed) {
+                                               set_status(404);
+                                       } else if (status == AltosMapTile.fetching) {
+                                               set_status(408);
+                                       } else if (status == AltosMapTile.bad_request) {
+                                               set_status(400);
+                                       } else if (status == AltosMapTile.forbidden) {
+                                               set_status(403);
+                                       } else {
+                                               set_status(400);
+                                       }
+                               }
+                               System.out.printf("%s: %.6f %.6f %d status %d\n",
+                                                 addr, lat, lon, zoom, http_status);
+                       }
+               } catch (Exception e) {
+                       System.out.printf("client exception %s\n", e.toString());
+                       e.printStackTrace(System.out);
+                       set_status(400);
+
+               } finally {
+                       try {
+                               Writer writer = new PrintWriter(socket.getOutputStream());
+                               reply.write(writer);
+                               writer.write('\n');
+                               writer.flush();
+                       } catch (IOException ie) {
+                       }
+                       try {
+                               socket.close();
+                       } catch (IOException ie) {
+                       }
+               }
+       }
+
+       public AltosMapdClient(Socket socket) {
+               this.socket = socket;
+               start();
+       }
+}
diff --git a/map-server/altos-mapd/AltosMapdPreferences.java b/map-server/altos-mapd/AltosMapdPreferences.java
new file mode 100644 (file)
index 0000000..fcfe326
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package altosmapd;
+
+import java.io.*;
+
+import org.altusmetrum.altoslib_13.*;
+
+public class AltosMapdPreferences extends AltosPreferencesBackend {
+
+       public String  getString(String key, String def) {
+               return def;
+       }
+       public void    putString(String key, String value) {
+       }
+
+       public int     getInt(String key, int def) {
+               return def;
+       }
+
+       public void    putInt(String key, int value) {
+       }
+
+       public double  getDouble(String key, double def) {
+               return def;
+       }
+
+       public void    putDouble(String key, double value) {
+       }
+
+       public boolean getBoolean(String key, boolean def) {
+               return def;
+       }
+
+       public void    putBoolean(String key, boolean value) {
+       }
+
+       public byte[]  getBytes(String key, byte[] def) {
+               return def;
+       }
+
+       public void    putBytes(String key, byte[] value) {
+       }
+
+       public boolean nodeExists(String key) {
+               return false;
+       }
+
+       public AltosPreferencesBackend node(String key) {
+               return this;
+       }
+
+       public String[] keys() {
+               return null;
+       }
+
+       public void    remove(String key) {
+       }
+
+       public void    flush() {
+       }
+
+       public File homeDirectory() {
+               return new File (".");
+       }
+
+       public void debug(String format, Object ... arguments) {
+               System.out.printf(format, arguments);
+       }
+
+       public AltosMapdPreferences() {
+       }
+}
diff --git a/map-server/altos-mapd/AltosMapdServer.java b/map-server/altos-mapd/AltosMapdServer.java
new file mode 100644 (file)
index 0000000..db7f7dc
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package altosmapd;
+
+import java.net.*;
+import java.io.*;
+
+public class AltosMapdServer extends ServerSocket {
+       public AltosMapdServer(int port) throws IOException {
+               super(port, 256, InetAddress.getLoopbackAddress());
+       }
+}
diff --git a/map-server/altos-mapd/Makefile.am b/map-server/altos-mapd/Makefile.am
new file mode 100644 (file)
index 0000000..39f6753
--- /dev/null
@@ -0,0 +1,73 @@
+JAVAROOT=classes
+AM_JAVACFLAGS=-target 1.6 -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked -source 6
+
+altoslibdir=$(libdir)/altos
+
+CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH="$(JAVAROOT):../../altoslib/*"
+
+bin_SCRIPTS=altos-mapd
+
+altosmapd_JAVA = \
+       AltosMapd.java \
+       AltosMapdServer.java \
+       AltosMapdClient.java \
+       AltosMapdPreferences.java
+
+ALTOSLIB_CLASS=\
+       altoslib_$(ALTOSLIB_VERSION).jar
+
+JAR=altosmapd.jar
+
+FATJAR=altosmapd-fat.jar
+
+all-local: classes/altosmapd $(JAR) altos-mapd altos-mapd-test altos-mapd-jdb
+
+defaultsdir=$(sysconfdir)/default
+
+defaults_DATA=altos-mapd-default
+
+systemddir=$(libdir)/systemd/system
+
+systemd_DATA=altos-mapd.service
+
+install-altosmapdJAVA: altosmapd.jar
+       @$(NORMAL_INSTALL)
+       test -z "$(altosmapddir)" || $(MKDIR_P) "$(DESTDIR)$(altosmapddir)"
+       echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosmapddir)/altosdmap.jar'"; \
+       $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosmapddir)"
+
+classes/altosmapd:
+       mkdir -p classes/altosmapd
+
+$(JAR): classaltosmapd.stamp Manifest.txt $(ALTOSLIB_CLASS)
+       jar cfm $@ Manifest.txt \
+               -C classes altosmapd
+
+altosmapddir=$(datadir)/java
+
+$(FATJAR): classaltosmapd.stamp Manifest-fat.txt $(ALTOSLIB_CLASS)
+       jar cfm $@ Manifest-fat.txt \
+               -C classes altosmapd
+
+altos-mapd: Makefile
+       echo "#!/bin/sh" > $@
+       echo 'exec java -Djava.library.path="$(altoslibdir)" -jar "$(altosmapddir)/altosmapd.jar" "$$@"' >> $@
+       chmod +x $@
+
+altos-mapd-test: Makefile
+       echo '#!/bin/sh' > $@
+       echo 'dir="$$(dirname $$0)"' >> $@
+       echo 'cd "$$dir"' >> $@
+       echo 'altosmapd="$$(pwd -P)"' >> $@
+       echo 'exec java -jar "$$altosmapd/altosmapd.jar" "$$@"' >> $@
+       chmod +x $@
+
+altos-mapd-jdb: Makefile
+       echo "#!/bin/sh" > $@
+       echo 'exec jdb altosmapd/AltosMapd "$$@"' >> $@
+       chmod +x $@
+
+$(ALTOSLIB_CLASS):
+       -rm -f "$@"
+       $(LN_S) ../../altoslib/"$@" .
+
diff --git a/map-server/altos-mapd/Manifest.txt b/map-server/altos-mapd/Manifest.txt
new file mode 100644 (file)
index 0000000..42c0313
--- /dev/null
@@ -0,0 +1,2 @@
+Main-Class: altosmapd.AltosMapd
+Class-Path: altoslib_13.jar
diff --git a/map-server/altos-mapd/altos-mapd-default b/map-server/altos-mapd/altos-mapd-default
new file mode 100644 (file)
index 0000000..1611f0b
--- /dev/null
@@ -0,0 +1,4 @@
+MAPKEY=/home/altos-mapd/google-maps-api-key
+MAPDIR=/home/altos-mapd/maps
+LAUNCHSITES=/var/www/html/launch-sites.txt
+MAXZOOM=17
diff --git a/map-server/altos-mapd/altos-mapd.service b/map-server/altos-mapd/altos-mapd.service
new file mode 100644 (file)
index 0000000..ba263c2
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=AltOS Map Cache
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+Type=simple
+User=altos-mapd
+Restart=always
+EnvironmentFile=/etc/default/altos-mapd-default
+ExecStart=/usr/bin/altos-mapd --key $MAPKEY --mapdir $MAPDIR --launch-sites $LAUNCHSITES --max-zoom $MAXZOOM
+
+[Install]
+WantedBy=multi-user.target
diff --git a/map-server/altos-mapj/.gitignore b/map-server/altos-mapj/.gitignore
new file mode 100644 (file)
index 0000000..c5d593e
--- /dev/null
@@ -0,0 +1,6 @@
+altos-mapj
+altos-mapj-jdb
+altos-mapj-test
+*.jar
+*.stamp
+classes
diff --git a/map-server/altos-mapj/AltosMap.java b/map-server/altos-mapj/AltosMap.java
new file mode 100644 (file)
index 0000000..ad0a4f5
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Copyright © 2018 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+package altosmap;
+
+import java.net.*;
+import java.io.*;
+import java.util.*;
+import java.text.*;
+
+import org.altusmetrum.altoslib_13.*;
+
+public class AltosMap {
+
+       public final static int port = 16717;
+
+       public final static String protocol_version = "1.0.0";
+
+       String  query_string;
+       String  remote_addr;
+
+       public String reason_string(int code) {
+               switch (code) {
+               case 200:
+                       return "OK";
+               case 400:
+                       return "Bad Request";
+               case 403:
+                       return "Forbidden";
+               case 404:
+                       return "Not Found";
+               case 408:
+                       return "Request Timeout";
+               default:
+                       return "Failure";
+               }
+       }
+
+       public void write_status(int status) {
+               System.out.printf("Status: %d %s\n", status, reason_string(status));
+       }
+
+       public void write_type(String type) {
+               System.out.printf("Content-Type: %s\n", type);
+       }
+
+       public void fail(int status, String reason) {
+               write_status(status);
+               write_type("text/html");
+               System.out.printf("\n");
+               System.out.printf("<html>\n");
+               System.out.printf("<head><title>Map Fetch Failure</title></head>\n");
+               System.out.printf("<body>%s</body>\n", reason);
+               System.out.printf("</html>\n");
+               System.exit(1);
+       }
+
+       public void process() {
+               query_string = System.getenv("QUERY_STRING");
+
+               if (query_string == null)
+                       fail(400, "Missing query string");
+
+               remote_addr = System.getenv("REMOTE_ADDR");
+
+               if (remote_addr == null)
+                       fail(400, "Missing remote address");
+
+               String[] queries = query_string.split("&");
+
+               double  lon = AltosLib.MISSING;
+               double  lat = AltosLib.MISSING;
+               int     zoom = AltosLib.MISSING;
+               String  version = null;
+
+               try {
+                       for (String query : queries) {
+                               String[] q = query.split("=");
+                               if (q.length >= 2) {
+                                       String name = q[0];
+                                       String value = q[1];
+                                       if (name.equals("lon"))
+                                               lon = AltosParse.parse_double_net(value);
+                                       else if (name.equals("lat"))
+                                               lat = AltosParse.parse_double_net(value);
+                                       else if (name.equals("zoom"))
+                                               zoom = AltosParse.parse_int(value);
+                                       else if (name.equals("version"))
+                                               version = value;
+                                       else
+                                               fail(400, String.format("Extra query param \"%s\"", query));
+                               }
+                       }
+               } catch (ParseException pe) {
+                       fail(400, String.format("Invalid query: %s", pe.toString()));
+               }
+
+               if (version != null) {
+                       System.out.printf("Content-Type: text/plain\n");
+                       System.out.printf("\n");
+                       System.out.printf("%s\n", protocol_version);
+               } else {
+                       if (lon == AltosLib.MISSING)
+                               fail(400, "Missing longitude");
+                       if (lat == AltosLib.MISSING)
+                               fail(400, "Missing latitude");
+                       if (zoom == AltosLib.MISSING)
+                               fail(400, "Missing zoom");
+
+                       try {
+                               Socket  socket = null;
+                               int tries = 0;
+
+                               while (tries < 10 && socket == null) {
+                                       try {
+                                               socket = new Socket(InetAddress.getLoopbackAddress(), port);
+                                       } catch (IOException ie) {
+                                               Thread.sleep(100);
+                                               tries++;
+                                       }
+                               }
+
+                               AltosJson       request = new AltosJson();
+
+                               request.put("lat", lat);
+                               request.put("lon", lon);
+                               request.put("zoom", zoom);
+                               request.put("remote_addr", remote_addr);
+
+                               Writer writer = new PrintWriter(socket.getOutputStream());
+                               request.write(writer);
+                               writer.flush();
+
+                               AltosJson       reply = AltosJson.fromInputStream(socket.getInputStream());
+
+                               int status = reply.get_int("status", 400);
+
+                               if (status != 200)
+                                       fail(status, "Bad cache status");
+
+                               String filename = reply.get_string("filename", null);
+                               try {
+                                       File file = new File(filename);
+                                       long length = file.length();
+                                       FileInputStream in = new FileInputStream(file);
+                                       String content_type = reply.get_string("content_type", null);
+                                       System.out.printf("Content-Type: %s\n", content_type);
+                                       System.out.printf("Content-Length: %d\n", file.length());
+                                       System.out.printf("\n");
+                                       byte[] buf = new byte[4096];
+                                       int bytes_read;
+                                       while ((bytes_read = in.read(buf)) > 0)
+                                               System.out.write(buf);
+                               } catch (IOException ie) {
+                                       fail(404, String.format("IO Exception: %s", ie.toString()));
+                               }
+                       } catch (Exception e) {
+                               fail(404, String.format("Exception %s", e.toString()));
+                       }
+               }
+       }
+
+       public AltosMap() {
+       }
+
+       public static void main(final String[] args) {
+
+               new AltosMap().process();
+
+       }
+}
diff --git a/map-server/altos-mapj/Makefile.am b/map-server/altos-mapj/Makefile.am
new file mode 100644 (file)
index 0000000..f447adb
--- /dev/null
@@ -0,0 +1,62 @@
+JAVAROOT=classes
+AM_JAVACFLAGS=-target 1.6 -encoding UTF-8 -Xlint:deprecation -Xlint:unchecked -source 6
+
+altoslibdir=$(libdir)/altos
+
+CLASSPATH_ENV=mkdir -p $(JAVAROOT); CLASSPATH="$(JAVAROOT):../../altoslib/*"
+
+bin_SCRIPTS=altos-mapj
+
+altosmap_JAVA = \
+       AltosMap.java
+
+ALTOSLIB_CLASS=\
+       altoslib_$(ALTOSLIB_VERSION).jar
+
+JAR=altosmap.jar
+
+FATJAR=altosmap-fat.jar
+
+all-local: classes/altosmap $(JAR) altos-mapj altos-mapj-test altos-mapj-jdb
+
+install-altosmapJAVA: altosmap.jar
+       @$(NORMAL_INSTALL)
+       test -z "$(altosmapdir)" || $(MKDIR_P) "$(DESTDIR)$(altosmapdir)"
+       echo " $(INSTALL_DATA)" "$<" "'$(DESTDIR)$(altosmapdir)/altosmap.jar'"; \
+       $(INSTALL_DATA) "$<" "$(DESTDIR)$(altosmapdir)"
+
+classes/altosmap:
+       mkdir -p classes/altosmap
+
+$(JAR): classaltosmap.stamp Manifest.txt $(ALTOSLIB_CLASS)
+       jar cfm $@ Manifest.txt \
+               -C classes altosmap
+
+altosmapdir=$(datadir)/java
+
+$(FATJAR): classaltosmap.stamp Manifest-fat.txt $(ALTOSLIB_CLASS)
+       jar cfm $@ Manifest-fat.txt \
+               -C classes altosmap
+
+altos-mapj: Makefile
+       echo "#!/bin/sh" > $@
+       echo 'exec java -Djava.library.path="$(altoslibdir)" -jar "$(altosmapdir)/altosmap.jar" "$$@"' >> $@
+       chmod +x $@
+
+altos-mapj-test: Makefile
+       echo '#!/bin/sh' > $@
+       echo 'dir="$$(dirname $$0)"' >> $@
+       echo 'cd "$$dir"' >> $@
+       echo 'altosmap="$$(pwd -P)"' >> $@
+       echo 'exec java -jar "$$altosmap/altosmap.jar" "$$@"' >> $@
+       chmod +x $@
+
+altos-mapj-jdb: Makefile
+       echo "#!/bin/sh" > $@
+       echo 'exec jdb altosmap/AltosMap "$$@"' >> $@
+       chmod +x $@
+
+$(ALTOSLIB_CLASS):
+       -rm -f "$@"
+       $(LN_S) ../../altoslib/"$@" .
+
diff --git a/map-server/altos-mapj/Manifest.txt b/map-server/altos-mapj/Manifest.txt
new file mode 100644 (file)
index 0000000..1a285b4
--- /dev/null
@@ -0,0 +1,2 @@
+Main-Class: altosmap.AltosMap
+Class-Path: altoslib_13.jar
diff --git a/map-server/altos-mapj/altos-mapj-fake b/map-server/altos-mapj/altos-mapj-fake
new file mode 100755 (executable)
index 0000000..f600fec
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+# map-N43.799102,W120.586281-hybrid-20.jpg
+export QUERY_STRING="lat=43.799102&lon=-120.586281&zoom=20"
+export REMOTE_ADDR="127.0.0.1"
+./altos-mapj-test
+
index 5e153b82af85cdc6a4085f6f00dd53adfe5f3ff4..f01c5c9f6d276f16d5a174945c95b1d39d065799 100644 (file)
@@ -137,7 +137,8 @@ MACOSX_DRIVERS=$(MACOSX_DRIVER_1) $(MACOSX_DRIVER_0)
 
 MACOSX_INFO_PLIST=Info.plist
 MACOSX_README=ReadMe-Mac.rtf
-MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_DRIVERS) $(MACOSX_README) $(DOC) $(MACOSX_ICONS)
+MACOSX_INSTALL=../altosui/install-macosx
+MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_DRIVERS) $(MACOSX_README) $(DOC) $(MACOSX_ICONS) $(MACOSX_INSTALL)
 
 $(MACOSX_DRIVER_0):
        wget -O $@ $(MACOSX_DRIVER_0_URL)
@@ -306,7 +307,8 @@ $(MACOSX_DIST): $(MACOSX_FILES)
        -rm -rf macosx
        mkdir macosx
        cp -a MicroPeak.app macosx/
-       cp -a $(MACOSX_README) macosx/ReadMe.rtf
+       cp -a $(MACOSX_README) macosx/ReadMe-MicroPeak.rtf
+       cp -a $(MACOSX_INSTALL) macosx
        cp -a $(DOC) macosx
        cp -p Info.plist macosx/MicroPeak.app/Contents
        cp -p $(MACOSX_DRIVERS) macosx
index 6a9adf3ff32a5427b6a10c43ab18646a52d45433..96053ac55ca712c8e8c45f12441eff8ed5779c7d 100644 (file)
@@ -21,8 +21,8 @@ package org.altusmetrum.micropeak;
 import java.lang.*;
 import java.io.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroData {
        public int              ground_pressure;
index db2662a0af1657bcbb2cc790c2cc3311f1b19841..c39dab96c9535aa29cd07b94f6d5d097164ea139 100644 (file)
@@ -22,7 +22,7 @@ import javax.swing.*;
 import java.awt.*;
 import java.awt.event.*;
 import java.util.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroDeviceDialog extends AltosDeviceDialog {
 
index e5f548214dc8324910c56542bbea55f3e5a1281c..e656dc6fb214292000aaca59b43d1c6f3fffc98f 100644 (file)
@@ -24,8 +24,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroDownload extends AltosUIDialog implements Runnable, ActionListener, MicroSerialLog, WindowListener {
        MicroPeak       owner;
index 36700e755c6f39cbcdf7f72a2f51ec5790061674..a98140ba5970ed1dd86a20d2aa087564cd501d81 100644 (file)
@@ -24,8 +24,8 @@ import java.util.ArrayList;
 import java.awt.*;
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroExport extends JFileChooser {
 
index 20f6db55be32ef4a5daf9201c5feb3eb328ee10b..9e50aa8de65f285253ff64d70f1dee1c55e2ad56 100644 (file)
@@ -20,8 +20,8 @@ package org.altusmetrum.micropeak;
 
 import java.io.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroFile {
 
index 85f7aed4cdf64e115086bccd11ebdee2063d50f0..c7a6d782c7abc06ffe8a74973abc86d706951d10 100644 (file)
@@ -21,8 +21,8 @@ package org.altusmetrum.micropeak;
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroFileChooser extends JFileChooser {
        JFrame  frame;
index d9ad8404ca4c5ac75269c50e238e6ff95b066bfe..8129aedbd621f71fa5c38570ccf22a85056c1a9c 100644 (file)
@@ -22,7 +22,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.util.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroFrame extends AltosUIFrame {
        static String[] micro_icon_names = {
index c661d3e15cee1d93f2e7732df096700c8862fd41..16966918da4e3f715b18f4e71db0714ebb17f56e 100755 (executable)
Binary files a/micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub and b/micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub differ
index c6a2a3c9d5decb678bd5d3b656102f97639815bb..eee5bc07a04b0bd4c6711fa0efd4f386c993a01b 100644 (file)
@@ -24,8 +24,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroPeak extends MicroFrame implements ActionListener, ItemListener, AltosFilterListener {
 
index 7a60499e1859d4475e04fbea893bf14b948cb2ea..9d022d0ac270819de1a4617b000c2f635b619fbd 100644 (file)
@@ -21,8 +21,8 @@ package org.altusmetrum.micropeak;
 import java.awt.*;
 import java.io.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroRaw extends JTextArea implements AltosFontListener {
 
index 9da769144c3b13584916fd829d212478e271d1ae..d6e354f261a881e5903a4b227392ce96af98ad69 100644 (file)
@@ -25,8 +25,8 @@ import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroSave extends JFileChooser {
 
index c1b2a7ad3425466528ca534210dd3937f8977a21..04b58a87dab060e40ae4eaa02f691e5204d1499e 100644 (file)
@@ -21,7 +21,7 @@ package org.altusmetrum.micropeak;
 import java.util.*;
 import java.io.*;
 import libaltosJNI.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroSerial extends InputStream {
        SWIGTYPE_p_altos_file   file;
index d33a36b3ac5807cf8b1fe62aab1cd2d279009671..0a1481c45911feb5cb5927af1ddc9b6321fd1e40 100644 (file)
@@ -21,7 +21,7 @@ package org.altusmetrum.micropeak;
 import java.util.*;
 import java.io.*;
 import libaltosJNI.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public interface MicroSerialLog {
 
index a2db383515ed30dd8055a9842e56bef16ecbfc03..092c3d44ef34d8c6bad9bc7f31726053f7072da0 100644 (file)
@@ -20,8 +20,8 @@ package org.altusmetrum.micropeak;
 
 import java.util.*;
 import libaltosJNI.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class MicroUSB extends altos_device implements AltosDevice {
 
@@ -97,6 +97,25 @@ public class MicroUSB extends altos_device implements AltosDevice {
                return isFTDI() || isMicro();
        }
 
+       public int hashCode() {
+               return getVendor() ^ getProduct() ^ getSerial() ^ getPath().hashCode();
+       }
+
+       public boolean equals(Object o) {
+               if (o == null)
+                       return false;
+
+               if (!(o instanceof MicroUSB))
+                       return false;
+
+               MicroUSB other = (MicroUSB) o;
+
+               return getVendor() == other.getVendor() &&
+                       getProduct() == other.getProduct() &&
+                       getSerial() == other.getSerial() &&
+                       getPath().equals(other.getPath());
+       }
+
        static java.util.List<MicroUSB> list() {
                if (!load_library())
                        return null;
index f831c3f9133da07864eb6a434a5394b689abea85..6445187a439d7f9b35368ede2bed5c21dd00e9a5 100644 (file)
@@ -1,19 +1,61 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\margl1440\margr1440\vieww10800\viewh8400\viewkind0
-\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
+{\rtf1\ansi\deff3\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f5\froman\fprq2\fcharset0 Helvetica{\*\falt Arial};}{\f6\froman\fprq2\fcharset0 Helvetica LT Std;}{\f7\fnil\fprq2\fcharset0 SimSun;}{\f8\fnil\fprq2\fcharset0 Arial Unicode MS;}{\f9\fnil\fprq2\fcharset0 Helvetica{\*\falt Arial};}{\f10\fnil\fprq2\fcharset0 Helvetica LT Std;}{\f11\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+{\stylesheet{\s0\snext0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033 Normal;}
+{\s15\sbasedon0\snext16\ql\nowidctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f4\fs28 Heading;}
+{\s16\sbasedon0\snext16\sl276\slmult1\ql\nowidctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24 Text Body;}
+{\s17\sbasedon16\snext17\sl276\slmult1\ql\nowidctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24 List;}
+{\s18\sbasedon0\snext18\ql\nowidctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\i\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24 Caption;}
+{\s19\sbasedon0\snext19\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24 Index;}
+}{\*\listtable{\list\listtemplateid1
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00);}{\levelnumbers\'01;}\fi-360\li720}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600}\listid1}
+{\list\listtemplateid2
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}\listid2}
+}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}{\*\generator LibreOffice/6.1.2.1$Linux_X86_64 LibreOffice_project/10$Build-1}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr2018\mo10\dy5\hr19\min22}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab720
+\hyphauto0\viewscale150
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}}
+\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af8\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
+Installing MicroPeak software for Mac OS X computers}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\cf0\kerning1\dbch\af8\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
 
-\f0\fs24 \cf0 Installing MicroPeak software for Mac OS X computers\
-\
-There are two files included in the Mac OS X distribution:\
-\
- 1) The MicroPeak application\
-\
- 2) The FTDI device drivers\
-\
-As with most Mac OS X applications, install MicroPeak by dragging it from the distribution disk image to a suitable place on your computer.\
-\
-To communicate with the MicroPeak serial adapter, you need to installed the FTDI device drivers, which is done by double-clicking on the FTDIUSBSerialDriver disk image. Inside that is the FTDI USB Serial Driver package. Double click on that and it will guide you through the installation process.\
-\
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033{\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+The MicroPeak distribution for Mac OS X consists of:}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033{\listtext\pard\plain  1)\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\li720\ri0\lin720\rin0\fi-360{\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+The MicroPeak application}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033{\listtext\pard\plain  2)\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\li720\ri0\lin720\rin0\fi-360{\cf0\kerning1\dbch\af7\langfe1081\dbch\af10\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+Mac OS X driver for FTDI USB devices}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\li720\ri0\lin720\rin0\fi0\cf0\kerning1\dbch\af8\langfe1081\dbch\af10\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f6\hich\af6
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af7\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+Install the MicroPeak application by control-clicking the install-macosx script and selecting \u8220\'93Open\u8221\'94 from the menu. This will display a dialog asking if you are sure you want to open it. Select \u8220\'93Open\u8221\'94 from the dialog to execute the script. This will install the software, documentation and firmware in your home Applications/AltOS folder. You can move it afte}{\cf0\kerning1\dbch\af7\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+r}{\cf0\kerning1\dbch\af7\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\lang1033\loch\f5\hich\af5
+wards if you choose.}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\cf0\kerning1\dbch\af8\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af8\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
+To communicate with the MicroPeak serial adapter, you need to installed the FTDI device drivers, which is done by double-clicking on the FTDIUSBSerialDriver disk image. Inside that is the FTDI USB Serial Driver package. Double click on that and it will guide you through the installation process.}
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\cf0\kerning1\dbch\af8\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
+
+\par \pard\plain \s0\ql\nowidctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af8\langfe1081\dbch\af11\afs24\alang1033\loch\f3\fs24\lang1033\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af8\langfe1081\dbch\af9\afs24\alang1033\rtlch \ltrch\loch\fs24\loch\f5\hich\af5
 Thanks for choosing AltusMetrum products!}
+\par }
\ No newline at end of file
index 0dafb5ec701879ff86288833cdd738f5c1f2cbc7..a1ff84c29cd6cffc00b07e5068354bfee46e3ead 100644 (file)
@@ -25,7 +25,6 @@ SDCCDIRS=\
        telerepeat-v1.0
 
 ARMM3DIRS=\
-       fox1ihu fox1ihu/flash-loader \
        easymega-v1.0 easymega-v1.0/flash-loader \
        telemega-v0.1 telemega-v0.1/flash-loader \
        telemega-v1.0 telemega-v1.0/flash-loader \
index b9f1709c9cf57ae2dd20ba3897ad1975f6c8a720..5d44bffdae8982bead6f95152be2d4ddd0acf111 100644 (file)
@@ -30,8 +30,6 @@
 #define PRINTD(l,...) 
 #endif
 
-uint8_t        ao_mma655x_spi_index = AO_MMA655X_SPI_INDEX;
-
 static void
 ao_mma655x_start(void) {
        ao_spi_get_bit(AO_MMA655X_CS_PORT,
index 914e0c1b3c7b620ca40c23ee82f88c9ac5b5576e..53ed992afcece518c6a3a4b015c2d6aae9411cf9 100644 (file)
@@ -57,10 +57,11 @@ ao_ms5607_crc(uint8_t *prom)
        uint8_t         cnt;
        uint16_t        n_rem = 0;
        uint8_t         n_bit;
+       uint8_t         *p = prom;
 
        prom[15] = 0;
        for (cnt = 0; cnt < 16; cnt++) {
-               n_rem ^= prom[cnt];
+               n_rem ^= *p++;
                for (n_bit = 8; n_bit > 0; n_bit--) {
                        if (n_rem & 0x8000)
                                n_rem = (n_rem << 1) ^ 0x3000;
@@ -73,12 +74,33 @@ ao_ms5607_crc(uint8_t *prom)
        return n_rem;
 }
 
+static int
+ao_ms5607_prom_valid(uint8_t *prom)
+{
+       uint8_t crc;
+       int     i;
+       uint8_t *p;
+
+       /* Look for a value other than 0x0000 or 0xffff */
+       p = prom;
+       for (i = 0; i < 16; i++)
+               if (*p++ + 1 > 1)
+                       break;
+       if (i == 16)
+               return FALSE;
+
+       crc = ao_ms5607_crc(prom);
+       if (crc != (prom[15] & 0xf))
+               return FALSE;
+
+       return TRUE;
+}
+
 static void
 ao_ms5607_prom_read(__xdata struct ao_ms5607_prom *prom)
 {
-       uint8_t                 addr;
-       uint8_t                 crc;
-       __xdata uint16_t        *r;
+       uint8_t         addr;
+       uint16_t        *r;
 
        r = (__xdata uint16_t *) prom;
        for (addr = 0; addr < 8; addr++) {
@@ -89,22 +111,19 @@ ao_ms5607_prom_read(__xdata struct ao_ms5607_prom *prom)
                ao_ms5607_stop();
                r++;
        }
-       crc = ao_ms5607_crc((uint8_t *) prom);
-       if (crc != (((uint8_t *) prom)[15] & 0xf)) {
-#if HAS_TASK
-               printf ("MS5607 PROM CRC error (computed %x actual %x)\n",
-                       crc, (((uint8_t *) prom)[15] & 0xf));
-               flush();
-#endif
+
+       if (!ao_ms5607_prom_valid((uint8_t *) prom))
                ao_panic(AO_PANIC_SELF_TEST_MS5607);
-       }
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
        /* Byte swap */
        r = (uint16_t *) prom;
        for (addr = 0; addr < 8; addr++) {
-               uint16_t        t = *r;
-               *r++ = (t << 8) | (t >> 8);
+               uint8_t         *t = (uint8_t *) r;
+               uint8_t a = t[0];
+               t[0] = t[1];
+               t[1] = a;
+               r++;
        }
 #endif
 }
index 19f29b0881822151e2dc4612807e5ed6958c7c1c..c4fa69bde8191be1ab4459e0df4005459a9c1301 100644 (file)
@@ -45,7 +45,7 @@
                AO_WATCHDOG_PORT->odr ^= (1 << AO_WATCHDOG_BIT);        \
        } while (0)
 
-#define HAS_TICK               1
+#define HAS_TICK               0
 #include <ao_flash_stm_pins.h>
 
 /* Attached signal, PB8 */
index 2bd0e3673d47701eb12565566260aeeb48eb5780..0a3981d743b323c229ef75323867e42a2fca0369 100644 (file)
@@ -662,7 +662,7 @@ ao_radio_init(void);
 
 #if HAS_MONITOR
 
-extern const char const * const ao_state_names[];
+extern const char * const ao_state_names[];
 
 #define AO_MONITOR_RING        8
 
index 25634ffc3178ab88769867ae0d9b9b2df416cfcd..86d4838fbe8d6630a458c0904bf459e9aeb29ee8 100644 (file)
@@ -243,6 +243,9 @@ _ao_config_get(void)
        if (ao_force_freq) {
                ao_config.frequency = 434550;
                ao_config.radio_cal = ao_radio_cal;
+#if HAS_RADIO_RATE
+               ao_config.radio_rate = AO_CONFIG_DEFAULT_RADIO_RATE;
+#endif
                ao_xmemcpy(&ao_config.callsign, CODE_TO_XDATA(AO_CONFIG_DEFAULT_CALLSIGN),
                       sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1);
        }
index f70c723296afb753b930546553cc6ceee44c6792..5fb086cee816712d4347ceb99c37fa37a794ec62 100644 (file)
@@ -117,7 +117,7 @@ ao_log_erase_mark(void)
  * structure.
  */
 
-__xdata ao_log_type log;
+__xdata ao_log_type ao_log_data;
 
 static uint8_t
 ao_log_csum(__xdata uint8_t *b) __reentrant
@@ -154,7 +154,7 @@ ao_log_write(__xdata ao_log_type *log) __reentrant
 uint8_t
 ao_log_check_data(void)
 {
-       if (ao_log_csum((uint8_t *) &log) != 0)
+       if (ao_log_csum((uint8_t *) &ao_log_data) != 0)
                return 0;
        return 1;
 }
@@ -162,7 +162,7 @@ ao_log_check_data(void)
 uint8_t
 ao_log_check_clear(void)
 {
-       uint8_t *b = (uint8_t *) &log;
+       uint8_t *b = (uint8_t *) &ao_log_data;
        uint8_t i;
 
        for (i = 0; i < sizeof (ao_log_type); i++) {
@@ -176,17 +176,17 @@ int16_t
 ao_log_flight(uint8_t slot)
 {
        if (!ao_storage_read(ao_log_pos(slot),
-                            &log,
+                            &ao_log_data,
                             sizeof (ao_log_type)))
                return -(int16_t) (slot + 1);
 
        if (ao_log_check_clear())
                return 0;
 
-       if (!ao_log_check_data() || log.type != AO_LOG_FLIGHT)
+       if (!ao_log_check_data() || ao_log_data.type != AO_LOG_FLIGHT)
                return -(int16_t) (slot + 1);
 
-       return log.u.flight.flight;
+       return ao_log_data.u.flight.flight;
 }
 #endif
 
index 5f04ef9ab676839e7b136308803eee200cbf470d..e2f1e0e4c9eb284335130ed084d9740648e70621 100644 (file)
@@ -507,7 +507,7 @@ typedef struct ao_log_record ao_log_type;
 #endif
 
 #ifndef AO_LOG_UNCOMMON
-extern __xdata ao_log_type log;
+extern __xdata ao_log_type ao_log_data;
 
 #define AO_LOG_SIZE sizeof(ao_log_type)
 
index 28a893c700e11a609b2043c85db289c206c5297c..7d7332e9d1fe0a917d1ad8b4eed4a519859bd8eb 100644 (file)
@@ -41,13 +41,13 @@ ao_log(void)
        while (!ao_log_running)
                ao_sleep(&ao_log_running);
 
-       log.type = AO_LOG_FLIGHT;
-       log.tick = ao_sample_tick;
+       ao_log_data.type = AO_LOG_FLIGHT;
+       ao_log_data.tick = ao_sample_tick;
 #if HAS_ACCEL
-       log.u.flight.ground_accel = ao_ground_accel;
+       ao_log_data.u.flight.ground_accel = ao_ground_accel;
 #endif
-       log.u.flight.flight = ao_flight_number;
-       ao_log_write(&log);
+       ao_log_data.u.flight.flight = ao_flight_number;
+       ao_log_write(&ao_log_data);
 
        /* Write the whole contents of the ring to the log
         * when starting up.
@@ -58,38 +58,38 @@ ao_log(void)
        for (;;) {
                /* Write samples to EEPROM */
                while (ao_log_data_pos != ao_sample_data) {
-                       log.tick = ao_data_ring[ao_log_data_pos].tick;
-                       if ((int16_t) (log.tick - next_sensor) >= 0) {
-                               log.type = AO_LOG_SENSOR;
-                               log.u.sensor.accel = ao_data_ring[ao_log_data_pos].adc.accel;
-                               log.u.sensor.pres = ao_data_ring[ao_log_data_pos].adc.pres;
-                               ao_log_write(&log);
+                       ao_log_data.tick = ao_data_ring[ao_log_data_pos].tick;
+                       if ((int16_t) (ao_log_data.tick - next_sensor) >= 0) {
+                               ao_log_data.type = AO_LOG_SENSOR;
+                               ao_log_data.u.sensor.accel = ao_data_ring[ao_log_data_pos].adc.accel;
+                               ao_log_data.u.sensor.pres = ao_data_ring[ao_log_data_pos].adc.pres;
+                               ao_log_write(&ao_log_data);
                                if (ao_log_state <= ao_flight_coast)
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_ASCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_ASCENT;
                                else
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_DESCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_DESCENT;
                        }
-                       if ((int16_t) (log.tick - next_other) >= 0) {
-                               log.type = AO_LOG_TEMP_VOLT;
-                               log.u.temp_volt.temp = ao_data_ring[ao_log_data_pos].adc.temp;
-                               log.u.temp_volt.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
-                               ao_log_write(&log);
-                               log.type = AO_LOG_DEPLOY;
-                               log.u.deploy.drogue = ao_data_ring[ao_log_data_pos].adc.sense_d;
-                               log.u.deploy.main = ao_data_ring[ao_log_data_pos].adc.sense_m;
-                               ao_log_write(&log);
-                               next_other = log.tick + AO_OTHER_INTERVAL;
+                       if ((int16_t) (ao_log_data.tick - next_other) >= 0) {
+                               ao_log_data.type = AO_LOG_TEMP_VOLT;
+                               ao_log_data.u.temp_volt.temp = ao_data_ring[ao_log_data_pos].adc.temp;
+                               ao_log_data.u.temp_volt.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
+                               ao_log_write(&ao_log_data);
+                               ao_log_data.type = AO_LOG_DEPLOY;
+                               ao_log_data.u.deploy.drogue = ao_data_ring[ao_log_data_pos].adc.sense_d;
+                               ao_log_data.u.deploy.main = ao_data_ring[ao_log_data_pos].adc.sense_m;
+                               ao_log_write(&ao_log_data);
+                               next_other = ao_log_data.tick + AO_OTHER_INTERVAL;
                        }
                        ao_log_data_pos = ao_data_ring_next(ao_log_data_pos);
                }
                /* Write state change to EEPROM */
                if (ao_flight_state != ao_log_state) {
                        ao_log_state = ao_flight_state;
-                       log.type = AO_LOG_STATE;
-                       log.tick = ao_sample_tick;
-                       log.u.state.state = ao_log_state;
-                       log.u.state.reason = 0;
-                       ao_log_write(&log);
+                       ao_log_data.type = AO_LOG_STATE;
+                       ao_log_data.tick = ao_sample_tick;
+                       ao_log_data.u.state.state = ao_log_state;
+                       ao_log_data.u.state.reason = 0;
+                       ao_log_write(&ao_log_data);
 
                        if (ao_log_state == ao_flight_landed)
                                ao_log_stop();
index a55d93f115791b0d391e249a03e6e20cd4e9de7e..7284932cf6f2c98d2558931ff3895964258179d2 100644 (file)
 void
 ao_log_gps_flight(void)
 {
-       log.type = AO_LOG_FLIGHT;
-       log.tick = ao_time();
-       log.u.flight.flight = ao_flight_number;
-       ao_log_write(&log);
+       ao_log_data.type = AO_LOG_FLIGHT;
+       ao_log_data.tick = ao_time();
+       ao_log_data.u.flight.flight = ao_flight_number;
+       ao_log_write(&ao_log_data);
 }
 
 void
 ao_log_gps_data(uint16_t tick, struct ao_telemetry_location *gps_data)
 {
-       log.tick = tick;
-       log.type = AO_LOG_GPS_TIME;
-       log.u.gps.latitude = gps_data->latitude;
-       log.u.gps.longitude = gps_data->longitude;
-       log.u.gps.altitude_low = gps_data->altitude_low;
-       log.u.gps.altitude_high = gps_data->altitude_high;
+       ao_log_data.tick = tick;
+       ao_log_data.type = AO_LOG_GPS_TIME;
+       ao_log_data.u.gps.latitude = gps_data->latitude;
+       ao_log_data.u.gps.longitude = gps_data->longitude;
+       ao_log_data.u.gps.altitude_low = gps_data->altitude_low;
+       ao_log_data.u.gps.altitude_high = gps_data->altitude_high;
 
-       log.u.gps.hour = gps_data->hour;
-       log.u.gps.minute = gps_data->minute;
-       log.u.gps.second = gps_data->second;
-       log.u.gps.flags = gps_data->flags;
-       log.u.gps.year = gps_data->year;
-       log.u.gps.month = gps_data->month;
-       log.u.gps.day = gps_data->day;
-       log.u.gps.course = gps_data->course;
-       log.u.gps.ground_speed = gps_data->ground_speed;
-       log.u.gps.climb_rate = gps_data->climb_rate;
-       log.u.gps.pdop = gps_data->pdop;
-       log.u.gps.hdop = gps_data->hdop;
-       log.u.gps.vdop = gps_data->vdop;
-       log.u.gps.mode = gps_data->mode;
-       ao_log_write(&log);
+       ao_log_data.u.gps.hour = gps_data->hour;
+       ao_log_data.u.gps.minute = gps_data->minute;
+       ao_log_data.u.gps.second = gps_data->second;
+       ao_log_data.u.gps.flags = gps_data->flags;
+       ao_log_data.u.gps.year = gps_data->year;
+       ao_log_data.u.gps.month = gps_data->month;
+       ao_log_data.u.gps.day = gps_data->day;
+       ao_log_data.u.gps.course = gps_data->course;
+       ao_log_data.u.gps.ground_speed = gps_data->ground_speed;
+       ao_log_data.u.gps.climb_rate = gps_data->climb_rate;
+       ao_log_data.u.gps.pdop = gps_data->pdop;
+       ao_log_data.u.gps.hdop = gps_data->hdop;
+       ao_log_data.u.gps.vdop = gps_data->vdop;
+       ao_log_data.u.gps.mode = gps_data->mode;
+       ao_log_write(&ao_log_data);
 }
 
 void
@@ -65,27 +65,27 @@ ao_log_gps_tracking(uint16_t tick, struct ao_telemetry_satellite *gps_tracking_d
 {
        uint8_t c, n, i;
 
-       log.tick = tick;
-       log.type = AO_LOG_GPS_SAT;
+       ao_log_data.tick = tick;
+       ao_log_data.type = AO_LOG_GPS_SAT;
        i = 0;
        n = gps_tracking_data->channels;
        for (c = 0; c < n; c++)
-               if ((log.u.gps_sat.sats[i].svid = gps_tracking_data->sats[c].svid))
+               if ((ao_log_data.u.gps_sat.sats[i].svid = gps_tracking_data->sats[c].svid))
                {
-                       log.u.gps_sat.sats[i].c_n = gps_tracking_data->sats[c].c_n_1;
+                       ao_log_data.u.gps_sat.sats[i].c_n = gps_tracking_data->sats[c].c_n_1;
                        i++;
                        if (i >= 12)
                                break;
                }
-       log.u.gps_sat.channels = i;
-       ao_log_write(&log);
+       ao_log_data.u.gps_sat.channels = i;
+       ao_log_write(&ao_log_data);
 }
 
 int8_t
 ao_log_check(uint32_t pos)
 {
        if (!ao_storage_read(pos,
-                            &log,
+                            &ao_log_data,
                             sizeof (struct ao_log_gps)))
                return AO_LOG_INVALID;
 
index c6bdf1e23c53cba1d4329bccdfdc21a591c8c851..0ae4e53616c9f57a16478cc161a8cdee7c56ce48 100644 (file)
@@ -47,22 +47,22 @@ ao_log(void)
                ao_sleep(&ao_log_running);
 
 #if HAS_FLIGHT
-       log.type = AO_LOG_FLIGHT;
-       log.tick = ao_sample_tick;
+       ao_log_data.type = AO_LOG_FLIGHT;
+       ao_log_data.tick = ao_sample_tick;
 #if HAS_ACCEL
-       log.u.flight.ground_accel = ao_ground_accel;
+       ao_log_data.u.flight.ground_accel = ao_ground_accel;
 #endif
 #if HAS_GYRO
-       log.u.flight.ground_accel_along = ao_ground_accel_along;
-       log.u.flight.ground_accel_across = ao_ground_accel_across;
-       log.u.flight.ground_accel_through = ao_ground_accel_through;
-       log.u.flight.ground_roll = ao_ground_roll;
-       log.u.flight.ground_pitch = ao_ground_pitch;
-       log.u.flight.ground_yaw = ao_ground_yaw;
+       ao_log_data.u.flight.ground_accel_along = ao_ground_accel_along;
+       ao_log_data.u.flight.ground_accel_across = ao_ground_accel_across;
+       ao_log_data.u.flight.ground_accel_through = ao_ground_accel_through;
+       ao_log_data.u.flight.ground_roll = ao_ground_roll;
+       ao_log_data.u.flight.ground_pitch = ao_ground_pitch;
+       ao_log_data.u.flight.ground_yaw = ao_ground_yaw;
 #endif
-       log.u.flight.ground_pres = ao_ground_pres;
-       log.u.flight.flight = ao_flight_number;
-       ao_log_write(&log);
+       ao_log_data.u.flight.ground_pres = ao_ground_pres;
+       ao_log_data.u.flight.flight = ao_flight_number;
+       ao_log_write(&ao_log_data);
 #endif
 
        /* Write the whole contents of the ring to the log
@@ -74,54 +74,54 @@ ao_log(void)
        for (;;) {
                /* Write samples to EEPROM */
                while (ao_log_data_pos != ao_data_head) {
-                       log.tick = ao_data_ring[ao_log_data_pos].tick;
-                       if ((int16_t) (log.tick - next_sensor) >= 0) {
-                               log.type = AO_LOG_SENSOR;
+                       ao_log_data.tick = ao_data_ring[ao_log_data_pos].tick;
+                       if ((int16_t) (ao_log_data.tick - next_sensor) >= 0) {
+                               ao_log_data.type = AO_LOG_SENSOR;
 #if HAS_MS5607
-                               log.u.sensor.pres = ao_data_ring[ao_log_data_pos].ms5607_raw.pres;
-                               log.u.sensor.temp = ao_data_ring[ao_log_data_pos].ms5607_raw.temp;
+                               ao_log_data.u.sensor.pres = ao_data_ring[ao_log_data_pos].ms5607_raw.pres;
+                               ao_log_data.u.sensor.temp = ao_data_ring[ao_log_data_pos].ms5607_raw.temp;
 #endif
 #if HAS_MPU6000
-                               log.u.sensor.accel_x = ao_data_ring[ao_log_data_pos].mpu6000.accel_x;
-                               log.u.sensor.accel_y = ao_data_ring[ao_log_data_pos].mpu6000.accel_y;
-                               log.u.sensor.accel_z = ao_data_ring[ao_log_data_pos].mpu6000.accel_z;
-                               log.u.sensor.gyro_x = ao_data_ring[ao_log_data_pos].mpu6000.gyro_x;
-                               log.u.sensor.gyro_y = ao_data_ring[ao_log_data_pos].mpu6000.gyro_y;
-                               log.u.sensor.gyro_z = ao_data_ring[ao_log_data_pos].mpu6000.gyro_z;
+                               ao_log_data.u.sensor.accel_x = ao_data_ring[ao_log_data_pos].mpu6000.accel_x;
+                               ao_log_data.u.sensor.accel_y = ao_data_ring[ao_log_data_pos].mpu6000.accel_y;
+                               ao_log_data.u.sensor.accel_z = ao_data_ring[ao_log_data_pos].mpu6000.accel_z;
+                               ao_log_data.u.sensor.gyro_x = ao_data_ring[ao_log_data_pos].mpu6000.gyro_x;
+                               ao_log_data.u.sensor.gyro_y = ao_data_ring[ao_log_data_pos].mpu6000.gyro_y;
+                               ao_log_data.u.sensor.gyro_z = ao_data_ring[ao_log_data_pos].mpu6000.gyro_z;
 #endif
 #if HAS_HMC5883
-                               log.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].hmc5883.x;
-                               log.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].hmc5883.z;
-                               log.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].hmc5883.y;
+                               ao_log_data.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].hmc5883.x;
+                               ao_log_data.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].hmc5883.z;
+                               ao_log_data.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].hmc5883.y;
 #endif
 #if HAS_MPU9250
-                               log.u.sensor.accel_x = ao_data_ring[ao_log_data_pos].mpu9250.accel_x;
-                               log.u.sensor.accel_y = ao_data_ring[ao_log_data_pos].mpu9250.accel_y;
-                               log.u.sensor.accel_z = ao_data_ring[ao_log_data_pos].mpu9250.accel_z;
-                               log.u.sensor.gyro_x = ao_data_ring[ao_log_data_pos].mpu9250.gyro_x;
-                               log.u.sensor.gyro_y = ao_data_ring[ao_log_data_pos].mpu9250.gyro_y;
-                               log.u.sensor.gyro_z = ao_data_ring[ao_log_data_pos].mpu9250.gyro_z;
-                               log.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].mpu9250.mag_x;
-                               log.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].mpu9250.mag_z;
-                               log.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].mpu9250.mag_y;
+                               ao_log_data.u.sensor.accel_x = ao_data_ring[ao_log_data_pos].mpu9250.accel_x;
+                               ao_log_data.u.sensor.accel_y = ao_data_ring[ao_log_data_pos].mpu9250.accel_y;
+                               ao_log_data.u.sensor.accel_z = ao_data_ring[ao_log_data_pos].mpu9250.accel_z;
+                               ao_log_data.u.sensor.gyro_x = ao_data_ring[ao_log_data_pos].mpu9250.gyro_x;
+                               ao_log_data.u.sensor.gyro_y = ao_data_ring[ao_log_data_pos].mpu9250.gyro_y;
+                               ao_log_data.u.sensor.gyro_z = ao_data_ring[ao_log_data_pos].mpu9250.gyro_z;
+                               ao_log_data.u.sensor.mag_x = ao_data_ring[ao_log_data_pos].mpu9250.mag_x;
+                               ao_log_data.u.sensor.mag_z = ao_data_ring[ao_log_data_pos].mpu9250.mag_z;
+                               ao_log_data.u.sensor.mag_y = ao_data_ring[ao_log_data_pos].mpu9250.mag_y;
 #endif
-                               log.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
-                               ao_log_write(&log);
+                               ao_log_data.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
+                               ao_log_write(&ao_log_data);
                                if (ao_log_state <= ao_flight_coast)
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_ASCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_ASCENT;
                                else
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_DESCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_DESCENT;
                        }
-                       if ((int16_t) (log.tick - next_other) >= 0) {
-                               log.type = AO_LOG_TEMP_VOLT;
-                               log.u.volt.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
-                               log.u.volt.v_pbatt = ao_data_ring[ao_log_data_pos].adc.v_pbatt;
-                               log.u.volt.n_sense = AO_ADC_NUM_SENSE;
+                       if ((int16_t) (ao_log_data.tick - next_other) >= 0) {
+                               ao_log_data.type = AO_LOG_TEMP_VOLT;
+                               ao_log_data.u.volt.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
+                               ao_log_data.u.volt.v_pbatt = ao_data_ring[ao_log_data_pos].adc.v_pbatt;
+                               ao_log_data.u.volt.n_sense = AO_ADC_NUM_SENSE;
                                for (i = 0; i < AO_ADC_NUM_SENSE; i++)
-                                       log.u.volt.sense[i] = ao_data_ring[ao_log_data_pos].adc.sense[i];
-                               log.u.volt.pyro = ao_pyro_fired;
-                               ao_log_write(&log);
-                               next_other = log.tick + AO_OTHER_INTERVAL;
+                                       ao_log_data.u.volt.sense[i] = ao_data_ring[ao_log_data_pos].adc.sense[i];
+                               ao_log_data.u.volt.pyro = ao_pyro_fired;
+                               ao_log_write(&ao_log_data);
+                               next_other = ao_log_data.tick + AO_OTHER_INTERVAL;
                        }
                        ao_log_data_pos = ao_data_ring_next(ao_log_data_pos);
                }
@@ -129,11 +129,11 @@ ao_log(void)
                /* Write state change to EEPROM */
                if (ao_flight_state != ao_log_state) {
                        ao_log_state = ao_flight_state;
-                       log.type = AO_LOG_STATE;
-                       log.tick = ao_time();
-                       log.u.state.state = ao_log_state;
-                       log.u.state.reason = 0;
-                       ao_log_write(&log);
+                       ao_log_data.type = AO_LOG_STATE;
+                       ao_log_data.tick = ao_time();
+                       ao_log_data.u.state.state = ao_log_state;
+                       ao_log_data.u.state.reason = 0;
+                       ao_log_write(&ao_log_data);
 
                        if (ao_log_state == ao_flight_landed)
                                ao_log_stop();
index afb8f637d292316a393aa4db5e70d056166c435a..347290706db23d6e962b934449a9fac305901c3b 100644 (file)
@@ -46,14 +46,14 @@ ao_log(void)
                ao_sleep(&ao_log_running);
 
 #if HAS_FLIGHT
-       log.type = AO_LOG_FLIGHT;
-       log.tick = ao_sample_tick;
+       ao_log_data.type = AO_LOG_FLIGHT;
+       ao_log_data.tick = ao_sample_tick;
 #if HAS_ACCEL
-       log.u.flight.ground_accel = ao_ground_accel;
+       ao_log_data.u.flight.ground_accel = ao_ground_accel;
 #endif
-       log.u.flight.ground_pres = ao_ground_pres;
-       log.u.flight.flight = ao_flight_number;
-       ao_log_write(&log);
+       ao_log_data.u.flight.ground_pres = ao_ground_pres;
+       ao_log_data.u.flight.flight = ao_flight_number;
+       ao_log_write(&ao_log_data);
 #endif
 
        /* Write the whole contents of the ring to the log
@@ -65,29 +65,29 @@ ao_log(void)
        for (;;) {
                /* Write samples to EEPROM */
                while (ao_log_data_pos != ao_data_head) {
-                       log.tick = ao_data_ring[ao_log_data_pos].tick;
-                       if ((int16_t) (log.tick - next_sensor) >= 0) {
-                               log.type = AO_LOG_SENSOR;
+                       ao_log_data.tick = ao_data_ring[ao_log_data_pos].tick;
+                       if ((int16_t) (ao_log_data.tick - next_sensor) >= 0) {
+                               ao_log_data.type = AO_LOG_SENSOR;
 #if HAS_MS5607
-                               log.u.sensor.pres = ao_data_ring[ao_log_data_pos].ms5607_raw.pres;
-                               log.u.sensor.temp = ao_data_ring[ao_log_data_pos].ms5607_raw.temp;
+                               ao_log_data.u.sensor.pres = ao_data_ring[ao_log_data_pos].ms5607_raw.pres;
+                               ao_log_data.u.sensor.temp = ao_data_ring[ao_log_data_pos].ms5607_raw.temp;
 #endif
 #if HAS_ACCEL
-                               log.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
+                               ao_log_data.u.sensor.accel = ao_data_accel(&ao_data_ring[ao_log_data_pos]);
 #endif
-                               ao_log_write(&log);
+                               ao_log_write(&ao_log_data);
                                if (ao_log_state <= ao_flight_coast)
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_ASCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_ASCENT;
                                else
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_DESCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_DESCENT;
                        }
-                       if ((int16_t) (log.tick - next_other) >= 0) {
-                               log.type = AO_LOG_TEMP_VOLT;
-                               log.u.volt.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
-                               log.u.volt.sense_a = ao_data_ring[ao_log_data_pos].adc.sense_a;
-                               log.u.volt.sense_m = ao_data_ring[ao_log_data_pos].adc.sense_m;
-                               ao_log_write(&log);
-                               next_other = log.tick + AO_OTHER_INTERVAL;
+                       if ((int16_t) (ao_log_data.tick - next_other) >= 0) {
+                               ao_log_data.type = AO_LOG_TEMP_VOLT;
+                               ao_log_data.u.volt.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
+                               ao_log_data.u.volt.sense_a = ao_data_ring[ao_log_data_pos].adc.sense_a;
+                               ao_log_data.u.volt.sense_m = ao_data_ring[ao_log_data_pos].adc.sense_m;
+                               ao_log_write(&ao_log_data);
+                               next_other = ao_log_data.tick + AO_OTHER_INTERVAL;
                        }
                        ao_log_data_pos = ao_data_ring_next(ao_log_data_pos);
                }
@@ -95,11 +95,11 @@ ao_log(void)
                /* Write state change to EEPROM */
                if (ao_flight_state != ao_log_state) {
                        ao_log_state = ao_flight_state;
-                       log.type = AO_LOG_STATE;
-                       log.tick = ao_time();
-                       log.u.state.state = ao_log_state;
-                       log.u.state.reason = 0;
-                       ao_log_write(&log);
+                       ao_log_data.type = AO_LOG_STATE;
+                       ao_log_data.tick = ao_time();
+                       ao_log_data.u.state.state = ao_log_state;
+                       ao_log_data.u.state.reason = 0;
+                       ao_log_write(&ao_log_data);
 
                        if (ao_log_state == ao_flight_landed)
                                ao_log_stop();
index af2fa6059e11ca33c66fc8f8817d1b6126717031..12c5d6bb61cb3523dccbb286a3f029de639ef559 100644 (file)
@@ -44,11 +44,11 @@ ao_log(void)
                ao_sleep(&ao_log_running);
 
 #if HAS_FLIGHT
-       log.type = AO_LOG_FLIGHT;
-       log.tick = ao_sample_tick;
-       log.u.flight.flight = ao_flight_number;
-       log.u.flight.ground_pres = ao_ground_pres;
-       ao_log_write(&log);
+       ao_log_data.type = AO_LOG_FLIGHT;
+       ao_log_data.tick = ao_sample_tick;
+       ao_log_data.u.flight.flight = ao_flight_number;
+       ao_log_data.u.flight.ground_pres = ao_ground_pres;
+       ao_log_write(&ao_log_data);
 #endif
 
        /* Write the whole contents of the ring to the log
@@ -60,23 +60,23 @@ ao_log(void)
        for (;;) {
                /* Write samples to EEPROM */
                while (ao_log_data_pos != ao_data_head) {
-                       log.tick = ao_data_ring[ao_log_data_pos].tick;
-                       if ((int16_t) (log.tick - next_sensor) >= 0) {
-                               log.type = AO_LOG_SENSOR;
-                               ao_log_pack24(log.u.sensor.pres,
+                       ao_log_data.tick = ao_data_ring[ao_log_data_pos].tick;
+                       if ((int16_t) (ao_log_data.tick - next_sensor) >= 0) {
+                               ao_log_data.type = AO_LOG_SENSOR;
+                               ao_log_pack24(ao_log_data.u.sensor.pres,
                                              ao_data_ring[ao_log_data_pos].ms5607_raw.pres);
-                               ao_log_pack24(log.u.sensor.temp,
+                               ao_log_pack24(ao_log_data.u.sensor.temp,
                                              ao_data_ring[ao_log_data_pos].ms5607_raw.temp);
 #if AO_LOG_FORMAT != AO_LOG_FORMAT_DETHERM
-                               log.u.sensor.sense_a = ao_data_ring[ao_log_data_pos].adc.sense_a;
-                               log.u.sensor.sense_m = ao_data_ring[ao_log_data_pos].adc.sense_m;
-                               log.u.sensor.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
+                               ao_log_data.u.sensor.sense_a = ao_data_ring[ao_log_data_pos].adc.sense_a;
+                               ao_log_data.u.sensor.sense_m = ao_data_ring[ao_log_data_pos].adc.sense_m;
+                               ao_log_data.u.sensor.v_batt = ao_data_ring[ao_log_data_pos].adc.v_batt;
 #endif
-                               ao_log_write(&log);
+                               ao_log_write(&ao_log_data);
                                if (ao_log_state <= ao_flight_coast)
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_ASCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_ASCENT;
                                else
-                                       next_sensor = log.tick + AO_SENSOR_INTERVAL_DESCENT;
+                                       next_sensor = ao_log_data.tick + AO_SENSOR_INTERVAL_DESCENT;
                        }
                        ao_log_data_pos = ao_data_ring_next(ao_log_data_pos);
                }
@@ -84,11 +84,11 @@ ao_log(void)
                /* Write state change to EEPROM */
                if (ao_flight_state != ao_log_state) {
                        ao_log_state = ao_flight_state;
-                       log.type = AO_LOG_STATE;
-                       log.tick = ao_time();
-                       log.u.state.state = ao_log_state;
-                       log.u.state.reason = 0;
-                       ao_log_write(&log);
+                       ao_log_data.type = AO_LOG_STATE;
+                       ao_log_data.tick = ao_time();
+                       ao_log_data.u.state.state = ao_log_state;
+                       ao_log_data.u.state.reason = 0;
+                       ao_log_write(&ao_log_data);
 
                        if (ao_log_state == ao_flight_landed)
                                ao_log_stop();
index 0011744d2e931258e1c76898d2a2a8f7e8e86cc4..d5cf930af949076bf2829c489f69ee2ea001178b 100644 (file)
@@ -66,8 +66,9 @@ lpc_usart_isr(void)
        }
        if (wake_input) {
                ao_wakeup(&ao_usart_rx_fifo);
-               if (stdin)
-                       ao_wakeup(&ao_stdin_ready);
+#if USE_SERIAL_0_STDIN
+               ao_wakeup(&ao_stdin_ready);
+#endif
        }
 }
 
index 7b526902169abc46cbb2f7bc61fbcab8e525c293..9d118b721349d2198f69e37f7e32dd73ee593734 100644 (file)
@@ -26,6 +26,8 @@
 #define HAS_TICK 1
 #endif
 
+#if HAS_TICK || defined(AO_TIMER_HOOK)
+
 #if HAS_TICK
 volatile AO_TICK_TYPE ao_tick_count;
 
@@ -34,6 +36,7 @@ ao_time(void)
 {
        return ao_tick_count;
 }
+#endif
 
 #if AO_DATA_ALL
 volatile __data uint8_t        ao_data_interval = 1;
@@ -44,7 +47,9 @@ void stm_systick_isr(void)
 {
        ao_validate_cur_stack();
        if (stm_systick.csr & (1 << STM_SYSTICK_CSR_COUNTFLAG)) {
+#if HAS_TICK
                ++ao_tick_count;
+#endif
 #if HAS_TASK_QUEUE
                if (ao_task_alarm_tick && (int16_t) (ao_tick_count - ao_task_alarm_tick) >= 0)
                        ao_task_check_alarm((uint16_t) ao_tick_count);
index 59cfde2ed8bc044fb9580fd4693f195dc1f9e4ee..5097041a7e10693cb55a25598acb06490087745b 100644 (file)
@@ -56,14 +56,14 @@ _ao_usart_cts(struct ao_stm_usart *usart)
 #endif
 
 static void
-_ao_usart_rx(struct ao_stm_usart *usart, int stdin)
+_ao_usart_rx(struct ao_stm_usart *usart, int is_stdin)
 {
        if (usart->reg->isr & (1 << STM_USART_ISR_RXNE)) {
                usart->reg->icr = (1 << STM_USART_ICR_ORECF);
                if (!ao_fifo_full(usart->rx_fifo)) {
                        ao_fifo_insert(usart->rx_fifo, usart->reg->rdr);
                        ao_wakeup(&usart->rx_fifo);
-                       if (stdin)
+                       if (is_stdin)
                                ao_wakeup(&ao_stdin_ready);
 #if HAS_SERIAL_SW_FLOW
                        /* If the fifo is nearly full, turn off RTS and wait
@@ -81,9 +81,9 @@ _ao_usart_rx(struct ao_stm_usart *usart, int stdin)
 }
 
 static void
-ao_usart_isr(struct ao_stm_usart *usart, int stdin)
+ao_usart_isr(struct ao_stm_usart *usart, int is_stdin)
 {
-       _ao_usart_rx(usart, stdin);
+       _ao_usart_rx(usart, is_stdin);
 
        if (!_ao_usart_tx_start(usart))
                usart->reg->cr1 &= ~(1<< STM_USART_CR1_TXEIE);
index 2fe231f16ddb8f711769e4d05755875ea62fb85e..106ce55ac12f28f4ad9467ae81c63caa240cb9ad 100644 (file)
@@ -155,7 +155,8 @@ LINUX_EXTRA=telegps-fat $(desktop_file).in
 
 MACOSX_INFO_PLIST=Info.plist
 MACOSX_README=ReadMe-Mac.rtf
-MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_README) $(DOC) $(MACOSX_ICONS)
+MACOSX_INSTALL=../altosui/install-macosx
+MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_README) $(DOC) $(MACOSX_ICONS) $(MACOSX_INSTALL)
 MACOSX_EXTRA=$(FIRMWARE)
 
 WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(DOC) $(WINDOWS_ICONS)
@@ -315,7 +316,8 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
        -rm -rf macosx
        mkdir macosx
        cp -a TeleGPS.app macosx/
-       cp -a $(MACOSX_README) macosx/ReadMe.rtf
+       cp -a $(MACOSX_README) macosx/ReadMe-TeleGPS.rtf
+       cp -a $(MACOSX_INSTALL) macosx
        mkdir -p macosx/Doc
        cp -a $(DOC) macosx/Doc
        cp -p Info.plist macosx/TeleGPS.app/Contents
index 48a82ed32f1388817e34f1fdfcc3347b5de05477..476fc096777f3e8ef065f0fc2b5550cdbfed5ca3 100644 (file)
@@ -1,58 +1,97 @@
-{\rtf1\ansi\ansicpg1252\deff0\uc1
-{\fonttbl
-{\f0\fnil\fcharset0\fprq0\fttruetype Helvetica;}
-{\f1\fnil\fcharset0\fprq0\fttruetype Arial;}
-{\f2\fnil\fcharset0\fprq0\fttruetype Liberation Serif;}
-{\f3\fnil\fcharset0\fprq0\fttruetype Courier New;}}
-{\colortbl
-\red0\green0\blue0;
-\red255\green255\blue255;
-\red255\green255\blue255;}
-{\stylesheet
-{\s6\fi-431\li720\sbasedon28\snext28 Contents 1;}
-{\s7\fi-431\li1440\sbasedon28\snext28 Contents 2;}
-{\s1\fi-431\li720 Arrowhead List;}
-{\s27\fi-431\li720\sbasedon28 Lower Roman List;}
-{\s29\tx431\sbasedon20\snext28 Numbered Heading 1;}
-{\s30\tx431\sbasedon21\snext28 Numbered Heading 2;}
-{\s12\fi-431\li720 Diamond List;}
-{\s9\fi-431\li2880\sbasedon28\snext28 Contents 4;}
-{\s8\fi-431\li2160\sbasedon28\snext28 Contents 3;}
-{\s31\tx431\sbasedon22\snext28 Numbered Heading 3;}
-{\s32\fi-431\li720 Numbered List;}
-{\s15\sbasedon28 Endnote Text;}
-{\*\cs14\fs20\super Endnote Reference;}
-{\s4\fi-431\li720 Bullet List;}
-{\s5\tx1584\sbasedon29\snext28 Chapter Heading;}
-{\s35\fi-431\li720 Square List;}
-{\s11\fi-431\li720 Dashed List;}
-{\s22\sb440\sa60\f1\fs24\b\sbasedon28\snext28 Heading 3;}
-{\s37\fi-431\li720 Tick List;}
-{\s24\fi-431\li720 Heart List;}
-{\s40\fi-431\li720\sbasedon32 Upper Roman List;}
-{\s39\fi-431\li720\sbasedon32 Upper Case List;}
-{\s16\fi-288\li288\fs20\sbasedon28 Footnote;}
-{\s19\fi-431\li720 Hand List;}
-{\s18\fs20\sbasedon28 Footnote Text;}
-{\s20\sb440\sa60\f1\fs34\b\sbasedon28\snext28 Heading 1;}
-{\s21\sb440\sa60\f1\fs28\b\sbasedon28\snext28 Heading 2;}
-{\s10\qc\sb240\sa120\f1\fs32\b\sbasedon28\snext28 Contents Header;}
-{\s23\sb440\sa60\f1\fs24\b\sbasedon28\snext28 Heading 4;}
-{\s28\f2\fs24 Normal;}
-{\s26\fi-431\li720\sbasedon32 Lower Case List;}
-{\s2\li1440\ri1440\sa120\sbasedon28 Block Text;}
-{\s33\f3\sbasedon28 Plain Text;}
-{\s34\tx1584\sbasedon29\snext28 Section Heading;}
-{\s25\fi-431\li720 Implies List;}
-{\s3\fi-431\li720 Box List;}
-{\s36\fi-431\li720 Star List;}
-{\*\cs17\fs20\super Footnote Reference;}
-{\s38\fi-431\li720 Triangle List;}
-{\s13\fi-288\li288\sbasedon28 Endnote;}}
-\kerning0\cf0\ftnbj\fet2\ftnstart1\ftnnar\aftnnar\ftnstart1\aftnstart1\aenddoc\revprop3{\*\rdf}{\info\uc1}\deftab720\viewkind1\paperw12240\paperh15840\margl1440\margr1440\widowctrl
-\sectd\sbknone\colsx0\pgncont\ltrsect
-\pard\plain\ltrpar\ql\sl240\slmult1\itap0\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\f0\fs24\lang1033{\*\listtag0}\abinodiroverride\ltrch Installing }{\f0\fs24\lang1033{\*\listtag0}TeleGPS}{\f0\fs24\lang1033{\*\listtag0} software for Mac OS X computers}{\f0\fs24\lang1033{\*\listtag0}\par}
-\pard\plain\ltrpar\ql\sl240\slmult1\itap0\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\f0\fs24\lang1033{\*\listtag0}\par}
-\pard\plain\ltrpar\ql\sl240\slmult1\itap0\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\f0\fs24\lang1033{\*\listtag0}\abinodiroverride\ltrch As with most Mac OS X applications, install }{\f0\fs24\lang1033{\*\listtag0}TeleGPS}{\f0\fs24\lang1033{\*\listtag0} by dragging it from the distribution disk image to a suitable place on your computer.}{\f0\fs24\lang1033{\*\listtag0}\par}
-\pard\plain\ltrpar\ql\sl240\slmult1\itap0\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\f0\fs24\lang1033{\*\listtag0}\par}
-\pard\plain\ltrpar\ql\sl240\slmult1\itap0\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\f0\fs24\lang1033{\*\listtag0}\abinodiroverride\ltrch Thanks for choosing AltusMetrum products!}{\f0\fs24\lang1033{\*\listtag0}\par}}
\ No newline at end of file
+{\rtf1\ansi\deff3\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\froman\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f5\fswiss\fprq2\fcharset0 Arial;}{\f6\froman\fprq2\fcharset0 Helvetica{\*\falt Arial};}{\f7\froman\fprq2\fcharset0 Arial;}{\f8\froman\fprq2\fcharset0 Courier New;}{\f9\froman\fprq2\fcharset0 Helvetica LT Std;}{\f10\fnil\fprq2\fcharset0 SimSun;}{\f11\fnil\fprq2\fcharset0 Courier New;}{\f12\fnil\fprq2\fcharset0 Arial Unicode MS;}{\f13\fnil\fprq2\fcharset0 Arial;}{\f14\fnil\fprq2\fcharset0 Helvetica{\*\falt Arial};}{\f15\fnil\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f16\fnil\fprq2\fcharset0 Helvetica LT Std;}}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+{\stylesheet{\s0\snext0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033 Normal;}
+{\s1\sbasedon19\snext1\ql\widctlpar\hyphpar0\sb440\sa60\keepn\ltrpar\cf0\b\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f5\fs34\lang1033 Heading 1;}
+{\s2\sbasedon19\snext2\ql\widctlpar\hyphpar0\sb440\sa60\keepn\ltrpar\cf0\b\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f5\fs28\lang1033 Heading 2;}
+{\s3\sbasedon19\snext3\ql\widctlpar\hyphpar0\sb440\sa60\keepn\ltrpar\cf0\b\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f5\fs24\lang1033 Heading 3;}
+{\s4\sbasedon19\snext4\ql\widctlpar\hyphpar0\sb440\sa60\keepn\ltrpar\cf0\b\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f5\fs24\lang1033 Heading 4;}
+{\*\cs15\snext15\super\fs20 Endnote Characters;}
+{\*\cs16\snext16\super\fs20 Endnote Anchor;}
+{\*\cs17\snext17\super\fs20 Footnote Characters;}
+{\*\cs18\snext18\super\fs20 Footnote Anchor;}
+{\s19\sbasedon0\snext20\ql\widctlpar\hyphpar0\sb240\sa120\keepn\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f4\fs28\lang1033 Heading;}
+{\s20\sbasedon0\snext20\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Text Body;}
+{\s21\sbasedon20\snext21\sl276\slmult1\ql\widctlpar\hyphpar0\sb0\sa140\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 List;}
+{\s22\sbasedon0\snext22\ql\widctlpar\hyphpar0\sb120\sa120\ltrpar\cf0\i\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Caption;}
+{\s23\sbasedon0\snext23\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Index;}
+{\s24\snext24\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Arrowhead List;}
+{\s25\sbasedon0\snext25\ql\widctlpar\hyphpar0\li1440\ri1440\lin1440\rin1440\fi0\sb0\sa120\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Block Text;}
+{\s26\snext26\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Box List;}
+{\s27\snext27\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Bullet List;}
+{\s28\snext28\tx1584\nowidctlpar\hyphpar0\cf0\kerning1\dbch\af17\langfe2052\dbch\af12\afs24\alang1081\loch\f3\hich\af3\fs24\lang1033 Chapter Heading;}
+{\s29\sbasedon23\snext29\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Contents 1;}
+{\s30\sbasedon23\snext30\ql\widctlpar\hyphpar0\li1440\ri0\lin1440\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Contents 2;}
+{\s31\sbasedon23\snext31\ql\widctlpar\hyphpar0\li2160\ri0\lin2160\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Contents 3;}
+{\s32\sbasedon23\snext32\ql\widctlpar\hyphpar0\li2880\ri0\lin2880\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Contents 4;}
+{\s33\snext33\qc\nowidctlpar\hyphpar0\sb240\sa120\ltrpar\cf0\b\kerning1\dbch\af12\langfe1081\dbch\af13\afs32\alang1033\loch\f7\fs24\lang1033 Contents Header;}
+{\s34\snext34\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Dashed List;}
+{\s35\snext35\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Diamond List;}
+{\s36\sbasedon0\snext36\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f3\fs24\lang1033 Endnote;}
+{\s37\sbasedon0\snext37\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f3\fs20\lang1033 Footnote;}
+{\s38\snext38\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Hand List;}
+{\s39\snext39\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Heart List;}
+{\s40\snext40\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Implies List;}
+{\s41\snext41\ql\widctlpar\li720\ri0\lin720\rin0\fi-431\ltrpar\hyphpar0\dbch\af11\cf0\kerning1\langfe2052\dbch\af12\afs24\alang1081\loch\f6\fs24\lang1033 Lower Case List;}
+{\s42\snext42\ql\nowidctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\alang1033\loch\f3\fs24\lang1033 Lower Roman List;}
+{\s43\snext43\ql\nowidctlpar\tx431\hyphpar0\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\alang1033\loch\f3\fs24\lang1033 Numbered Heading 1;}
+{\s44\snext44\ql\nowidctlpar\tx431\hyphpar0\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\alang1033\loch\f3\fs24\lang1033 Numbered Heading 2;}
+{\s45\snext45\ql\nowidctlpar\tx431\hyphpar0\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\alang1033\loch\f3\fs24\lang1033 Numbered Heading 3;}
+{\s46\snext46\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Numbered List;}
+{\s47\sbasedon0\snext47\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f8\fs24\lang1033 Plain Text;}
+{\s48\sbasedon43\snext48\ql\nowidctlpar\tx1584\hyphpar0\ltrpar\cf0\kerning1\dbch\af12\langfe1081\dbch\af15\afs24\alang1033\loch\f3\fs24 Section Heading;}
+{\s49\snext49\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Square List;}
+{\s50\snext50\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Star List;}
+{\s51\snext51\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Tick List;}
+{\s52\snext52\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f6\fs24\lang1033 Triangle List;}
+{\s53\sbasedon46\snext53\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f6\fs24\lang1033 Upper Case List;}
+{\s54\sbasedon46\snext54\ql\widctlpar\hyphpar0\li720\ri0\lin720\rin0\fi-431\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\loch\f6\fs24\lang1033 Upper Roman List;}
+}{\*\listtable{\list\listtemplateid1
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00);}{\levelnumbers\'01;}\fi-360\li720}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'01.;}{\levelnumbers\'01;}\fi-360\li1080}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'02.;}{\levelnumbers\'01;}\fi-360\li1440}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'03.;}{\levelnumbers\'01;}\fi-360\li1800}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'04.;}{\levelnumbers\'01;}\fi-360\li2160}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'05.;}{\levelnumbers\'01;}\fi-360\li2520}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'06.;}{\levelnumbers\'01;}\fi-360\li2880}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'07.;}{\levelnumbers\'01;}\fi-360\li3240}
+{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'08.;}{\levelnumbers\'01;}\fi-360\li3600}\listid1}
+{\list\listtemplateid2
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}
+{\listlevel\levelnfc255\leveljc0\levelstartat1\levelfollow2{\leveltext \'00;}{\levelnumbers;}\fi0\li0}\listid2}
+}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}{\*\generator LibreOffice/6.1.2.1$Linux_X86_64 LibreOffice_project/10$Build-1}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr2018\mo10\dy5\hr19\min21}{\printim\yr0\mo0\dy0\hr0\min0}}{\*\userprops}\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720\deftab720
+\hyphauto0\viewscale150
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}
+{\pgdsc1\pgdscuse451\pgndec\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt1 Endnote;}}
+\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1440\margr1440\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnar
+{\*\ftnsep\chftnsep}\pgndec\pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033\sl240\slmult1\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af11\langfe1081\dbch\af14\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+Installing TeleGPS software for Mac OS X computers}
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033\sl240\slmult1\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\cf0\kerning1\dbch\af11\langfe1081\dbch\af14\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033{\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+The TeleGPS distribution for Mac OS X consists of:}
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033{\listtext\pard\plain  1)\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\li720\ri0\lin720\rin0\fi-360{\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+The TeleGPS application}
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033{\listtext\pard\plain  2)\tab}\ilvl0\ls1 \li1440\ri0\lin1440\rin0\fi-360\li720\ri0\lin720\rin0\fi-360{\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+Current AltOS firmware for TeleGPS products}
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033{\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+Install the TeleGPS application by control-clicking the install-macosx script and selecting \u8220\'93Open\u8221\'94 from the menu. This will display a dialog asking if you are sure you want to open it. Select \u8220\'93Open\u8221\'94 from the dialog to execute the script. This will install the software, documentation and firmware in your home Applications/AltOS folder. You can move it afte}{\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+r}{\cf0\kerning1\dbch\af10\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+wards if you choose.}
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033\cf0\kerning1\dbch\af11\langfe1081\dbch\af16\rtlch \ltrch\loch\fs24\lang1033\loch\f9\hich\af9
+
+\par \pard\plain \s0\ql\widctlpar\hyphpar0\ltrpar\cf0\kerning1\dbch\af11\langfe1081\dbch\af15\afs24\alang1081\loch\f3\fs24\lang1033\sl240\slmult1\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640{\cf0\kerning1\dbch\af10\langfe1081\dbch\af14\rtlch \ltrch\loch\fs24\lang1033\loch\f6\hich\af6
+Thanks for choosing AltusMetrum products!}
+\par }
\ No newline at end of file
index c661d3e15cee1d93f2e7732df096700c8862fd41..16966918da4e3f715b18f4e71db0714ebb17f56e 100755 (executable)
Binary files a/telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub and b/telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub differ
index 1433c9e164c01bade972e009d7a7b42f6c13d0e8..24cc379fcec9a1879068d5154de8fcfc60c3c4fb 100644 (file)
@@ -25,8 +25,8 @@ import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPS
        extends AltosUIFrame
index 7fc15ba991695fd5d2fa2705442591a78933d9c4..e9d5b8338e22a18cf871c219d9d557db9393da2d 100644 (file)
@@ -23,8 +23,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSConfig implements ActionListener {
 
index 87683c2baf5b3155f7731bf2d9ebef8914e0e0c1..03652302b31c6dc98e780537ebb3c713c9582971 100644 (file)
@@ -23,8 +23,8 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSConfigUI
        extends AltosUIDialog
index fdf0e2019af56c66af8acadc61d2b56535791e1d..defd588e722d931a13b0d675529fc377203f006f 100644 (file)
@@ -22,8 +22,8 @@ import java.awt.*;
 import javax.swing.*;
 import java.io.*;
 import java.text.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSDisplayThread extends Thread {
 
index c68f2badbdaf3a06a00e35454fa5b69e7a58fe85..5d4fc9cf8be5137500ada48aaa7d0cf867876fe0 100644 (file)
@@ -27,8 +27,8 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 import org.jfree.chart.ChartPanel;
 import org.jfree.chart.JFreeChart;
index 383a0a4449f93c01df1fc58b83ba3eb43435fcb4..dcfbace5fa823b2094d300fbbe62064f6d0706fd 100644 (file)
@@ -22,8 +22,8 @@ import java.util.*;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSInfo extends AltosUIFlightTab {
 
index 58b3ae35950a5ba80a488d451d9276d043824bdc..31d435d0fb28f7fd8be4c3788300ce8a9b18cf80 100644 (file)
@@ -23,7 +23,7 @@ import java.awt.event.*;
 import java.beans.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSPreferences
        extends AltosUIConfigure
index 2117339486751156f07072c393cf60b5c2a95720..0c15cbb1d3724ae3c3d6ab87ebf257f21672acc7 100644 (file)
@@ -22,8 +22,8 @@ import java.util.*;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSState extends AltosUIFlightTab {
 
index e1be69a495717f156e1f5ea5d9a0c09e97eedc0e..493917e568ecac679d87506f3ed375f01f0bda6d 100644 (file)
@@ -20,8 +20,8 @@ package org.altusmetrum.telegps;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_12.*;
-import org.altusmetrum.altosuilib_12.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class TeleGPSStatus extends JComponent implements AltosFlightDisplay {
        GridBagLayout   layout;
index 1b66d14215d495d5bd7fca352584c9d1e94b543d..d583fa5df40bdc524d67264c350bf5997ad848cc 100644 (file)
@@ -19,7 +19,7 @@
 package org.altusmetrum.telegps;
 
 import java.awt.event.*;
-import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altoslib_13.*;
 
 public class TeleGPSStatusUpdate implements ActionListener {