summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2018-10-08 17:49:47 -0600
committerBdale Garbee <bdale@gag.com>2018-10-08 17:49:47 -0600
commit34658a1236e34891b41a0a51a480717db98779e7 (patch)
tree1e29cdc000c50e4f01e5c54aa69befd8e6919524
parent3a2a5a05bb6372d9003905cee7afdfcd6d38ae7e (diff)
parent88ae4c5ebd64215f05f5efc18f9660560b409ace (diff)
Merge branch 'master' into branch-1.8
-rw-r--r--Makefile.am2
-rw-r--r--Releasing18
-rw-r--r--altosdroid/res/layout/map_preload.xml2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java3
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java9
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java11
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java2
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java2
-rw-r--r--altoslib/AltosAccel.java2
-rw-r--r--altoslib/AltosAccelCal.java2
-rw-r--r--altoslib/AltosAccelCalListener.java2
-rw-r--r--altoslib/AltosCRCException.java2
-rw-r--r--altoslib/AltosCSV.java4
-rw-r--r--altoslib/AltosCalData.java2
-rw-r--r--altoslib/AltosCompanion.java2
-rw-r--r--altoslib/AltosConfigData.java2
-rw-r--r--altoslib/AltosConfigDataException.java2
-rw-r--r--altoslib/AltosConfigValues.java2
-rw-r--r--altoslib/AltosConvert.java2
-rw-r--r--altoslib/AltosDataListener.java2
-rw-r--r--altoslib/AltosDataProvider.java2
-rw-r--r--altoslib/AltosDebug.java2
-rw-r--r--altoslib/AltosDistance.java2
-rw-r--r--altoslib/AltosEeprom.java2
-rw-r--r--altoslib/AltosEepromChunk.java2
-rw-r--r--altoslib/AltosEepromDownload.java2
-rw-r--r--altoslib/AltosEepromFile.java2
-rw-r--r--altoslib/AltosEepromList.java2
-rw-r--r--altoslib/AltosEepromLog.java2
-rw-r--r--altoslib/AltosEepromMonitor.java2
-rw-r--r--altoslib/AltosEepromRecord.java2
-rw-r--r--altoslib/AltosEepromRecordFireTwo.java2
-rw-r--r--altoslib/AltosEepromRecordFull.java2
-rw-r--r--altoslib/AltosEepromRecordGps.java2
-rw-r--r--altoslib/AltosEepromRecordMega.java2
-rw-r--r--altoslib/AltosEepromRecordMetrum.java2
-rw-r--r--altoslib/AltosEepromRecordMini.java2
-rw-r--r--altoslib/AltosEepromRecordSet.java2
-rw-r--r--altoslib/AltosEepromRecordTiny.java2
-rw-r--r--altoslib/AltosFile.java2
-rw-r--r--altoslib/AltosFilterListener.java2
-rw-r--r--altoslib/AltosFlash.java6
-rw-r--r--altoslib/AltosFlashListener.java6
-rw-r--r--altoslib/AltosFlightDisplay.java2
-rw-r--r--altoslib/AltosFlightReader.java2
-rw-r--r--altoslib/AltosFlightSeries.java2
-rw-r--r--altoslib/AltosFlightStats.java2
-rw-r--r--altoslib/AltosFontListener.java2
-rw-r--r--altoslib/AltosForce.java2
-rw-r--r--altoslib/AltosFrequency.java2
-rw-r--r--altoslib/AltosGPS.java2
-rw-r--r--altoslib/AltosGPSSat.java2
-rw-r--r--altoslib/AltosGPSTimeValue.java2
-rw-r--r--altoslib/AltosGreatCircle.java2
-rw-r--r--altoslib/AltosHeight.java2
-rw-r--r--altoslib/AltosHexfile.java12
-rw-r--r--altoslib/AltosHexsym.java2
-rw-r--r--altoslib/AltosIMU.java2
-rw-r--r--altoslib/AltosIdle.java2
-rw-r--r--altoslib/AltosIdleFetch.java2
-rw-r--r--altoslib/AltosIdleMonitor.java2
-rw-r--r--altoslib/AltosIdleMonitorListener.java2
-rw-r--r--altoslib/AltosIdleReader.java2
-rw-r--r--altoslib/AltosIgnite.java2
-rw-r--r--altoslib/AltosImage.java2
-rw-r--r--altoslib/AltosJson.java32
-rw-r--r--altoslib/AltosKML.java2
-rw-r--r--altoslib/AltosLatLon.java2
-rw-r--r--altoslib/AltosLatitude.java2
-rw-r--r--altoslib/AltosLaunchSite.java2
-rw-r--r--altoslib/AltosLaunchSiteListener.java2
-rw-r--r--altoslib/AltosLaunchSites.java14
-rw-r--r--altoslib/AltosLib.java11
-rw-r--r--altoslib/AltosLine.java2
-rw-r--r--altoslib/AltosLink.java2
-rw-r--r--altoslib/AltosListenerState.java2
-rw-r--r--altoslib/AltosLocation.java2
-rw-r--r--altoslib/AltosLog.java2
-rw-r--r--altoslib/AltosLongitude.java2
-rw-r--r--altoslib/AltosMag.java2
-rw-r--r--altoslib/AltosMap.java10
-rw-r--r--altoslib/AltosMapCache.java2
-rw-r--r--altoslib/AltosMapCacheListener.java2
-rw-r--r--altoslib/AltosMapInterface.java2
-rw-r--r--altoslib/AltosMapLine.java2
-rw-r--r--altoslib/AltosMapLoader.java5
-rw-r--r--altoslib/AltosMapLoaderListener.java2
-rw-r--r--altoslib/AltosMapMark.java2
-rw-r--r--altoslib/AltosMapPath.java2
-rw-r--r--altoslib/AltosMapPathPoint.java2
-rw-r--r--altoslib/AltosMapRectangle.java2
-rw-r--r--altoslib/AltosMapStore.java153
-rw-r--r--altoslib/AltosMapStoreListener.java2
-rw-r--r--altoslib/AltosMapTile.java2
-rw-r--r--altoslib/AltosMapTileListener.java2
-rw-r--r--altoslib/AltosMapTransform.java2
-rw-r--r--altoslib/AltosMapTypeListener.java2
-rw-r--r--altoslib/AltosMapZoomListener.java2
-rw-r--r--altoslib/AltosMma655x.java2
-rw-r--r--altoslib/AltosMs5607.java2
-rw-r--r--altoslib/AltosNoSymbol.java2
-rw-r--r--altoslib/AltosOrient.java2
-rw-r--r--altoslib/AltosParse.java2
-rw-r--r--altoslib/AltosPointDouble.java2
-rw-r--r--altoslib/AltosPointInt.java2
-rw-r--r--altoslib/AltosPreferences.java2
-rw-r--r--altoslib/AltosPreferencesBackend.java2
-rw-r--r--altoslib/AltosPresTemp.java2
-rw-r--r--altoslib/AltosPressure.java2
-rw-r--r--altoslib/AltosProgrammer.java2
-rw-r--r--altoslib/AltosPyro.java2
-rw-r--r--altoslib/AltosPyroName.java2
-rw-r--r--altoslib/AltosQuaternion.java2
-rw-r--r--altoslib/AltosRecordSet.java2
-rw-r--r--altoslib/AltosRectangle.java2
-rw-r--r--altoslib/AltosReplayReader.java2
-rw-r--r--altoslib/AltosRomconfig.java60
-rw-r--r--altoslib/AltosRotation.java2
-rw-r--r--altoslib/AltosRotationRate.java2
-rw-r--r--altoslib/AltosSavedState.java2
-rw-r--r--altoslib/AltosSelfFlash.java10
-rw-r--r--altoslib/AltosSensorEMini.java2
-rw-r--r--altoslib/AltosSensorMM.java2
-rw-r--r--altoslib/AltosSensorMega.java2
-rw-r--r--altoslib/AltosSensorMetrum.java2
-rw-r--r--altoslib/AltosSensorTGPS.java2
-rw-r--r--altoslib/AltosSensorTM.java2
-rw-r--r--altoslib/AltosSensorTMini2.java2
-rw-r--r--altoslib/AltosSensorTMini3.java2
-rw-r--r--altoslib/AltosSpeed.java2
-rw-r--r--altoslib/AltosState.java2
-rw-r--r--altoslib/AltosStateName.java2
-rw-r--r--altoslib/AltosStringInputStream.java2
-rw-r--r--altoslib/AltosTelemetry.java2
-rw-r--r--altoslib/AltosTelemetryCompanion.java2
-rw-r--r--altoslib/AltosTelemetryConfiguration.java2
-rw-r--r--altoslib/AltosTelemetryFile.java2
-rw-r--r--altoslib/AltosTelemetryIterable.java2
-rw-r--r--altoslib/AltosTelemetryLegacy.java2
-rw-r--r--altoslib/AltosTelemetryLocation.java2
-rw-r--r--altoslib/AltosTelemetryMap.java2
-rw-r--r--altoslib/AltosTelemetryMegaData.java2
-rw-r--r--altoslib/AltosTelemetryMegaSensor.java2
-rw-r--r--altoslib/AltosTelemetryMetrumData.java2
-rw-r--r--altoslib/AltosTelemetryMetrumSensor.java2
-rw-r--r--altoslib/AltosTelemetryMini2.java2
-rw-r--r--altoslib/AltosTelemetryMini3.java2
-rw-r--r--altoslib/AltosTelemetryRaw.java2
-rw-r--r--altoslib/AltosTelemetryReader.java2
-rw-r--r--altoslib/AltosTelemetrySatellite.java2
-rw-r--r--altoslib/AltosTelemetrySensor.java2
-rw-r--r--altoslib/AltosTelemetryStandard.java2
-rw-r--r--altoslib/AltosTemperature.java2
-rw-r--r--altoslib/AltosTime.java2
-rw-r--r--altoslib/AltosTimeSeries.java2
-rw-r--r--altoslib/AltosTimeValue.java2
-rw-r--r--altoslib/AltosUnitInfo.java106
-rw-r--r--altoslib/AltosUnitInfoListener.java19
-rw-r--r--altoslib/AltosUnits.java2
-rw-r--r--altoslib/AltosUnitsListener.java2
-rw-r--r--altoslib/AltosUnitsRange.java2
-rw-r--r--altoslib/AltosUnknownProduct.java2
-rw-r--r--altoslib/AltosUsbId.java2
-rw-r--r--altoslib/AltosVersion.java.in8
-rw-r--r--altoslib/AltosVoltage.java2
-rw-r--r--altoslib/AltosWriter.java2
-rw-r--r--altoslib/Makefile.am4
-rw-r--r--altosui/Altos.java4
-rw-r--r--altosui/AltosAscent.java4
-rw-r--r--altosui/AltosCompanionInfo.java4
-rw-r--r--altosui/AltosConfigFC.java4
-rw-r--r--altosui/AltosConfigFCUI.java4
-rw-r--r--altosui/AltosConfigPyroUI.java4
-rw-r--r--altosui/AltosConfigTD.java4
-rw-r--r--altosui/AltosConfigTDUI.java4
-rw-r--r--altosui/AltosConfigureUI.java2
-rw-r--r--altosui/AltosDescent.java4
-rw-r--r--altosui/AltosFlightStatus.java4
-rw-r--r--altosui/AltosFlightStatusTableModel.java2
-rw-r--r--altosui/AltosFlightStatusUpdate.java2
-rw-r--r--altosui/AltosFlightUI.java4
-rw-r--r--altosui/AltosGraphUI.java4
-rw-r--r--altosui/AltosIdleMonitorUI.java4
-rw-r--r--altosui/AltosIgniteUI.java4
-rw-r--r--altosui/AltosIgnitor.java4
-rw-r--r--altosui/AltosLanded.java4
-rw-r--r--altosui/AltosLaunch.java2
-rw-r--r--altosui/AltosLaunchUI.java2
-rw-r--r--altosui/AltosPad.java4
-rwxr-xr-xaltosui/AltosUI.app/Contents/MacOS/JavaApplicationStubbin61296 -> 31253 bytes
-rw-r--r--altosui/AltosUI.java4
-rw-r--r--altosui/Makefile.am9
-rw-r--r--altosui/ReadMe-Mac.rtf77
-rw-r--r--altosui/altos-windows.nsi.in1
-rwxr-xr-xaltosui/install-macosx9
-rw-r--r--altosuilib/AltosBTDevice.java4
-rw-r--r--altosuilib/AltosBTDeviceIterator.java4
-rw-r--r--altosuilib/AltosBTKnown.java4
-rw-r--r--altosuilib/AltosBTManage.java4
-rw-r--r--altosuilib/AltosCSVUI.java4
-rw-r--r--altosuilib/AltosConfigFreqUI.java4
-rw-r--r--altosuilib/AltosDataChooser.java4
-rw-r--r--altosuilib/AltosDevice.java3
-rw-r--r--altosuilib/AltosDeviceDialog.java40
-rw-r--r--altosuilib/AltosDeviceUIDialog.java2
-rw-r--r--altosuilib/AltosDisplayThread.java4
-rw-r--r--altosuilib/AltosEepromDelete.java4
-rw-r--r--altosuilib/AltosEepromGrapher.java4
-rw-r--r--altosuilib/AltosEepromManage.java4
-rw-r--r--altosuilib/AltosEepromMonitorUI.java4
-rw-r--r--altosuilib/AltosEepromSelect.java4
-rw-r--r--altosuilib/AltosFlashUI.java306
-rw-r--r--altosuilib/AltosFlightInfoTableModel.java2
-rw-r--r--altosuilib/AltosFlightStatsTable.java4
-rw-r--r--altosuilib/AltosGraph.java4
-rw-r--r--altosuilib/AltosInfoTable.java4
-rw-r--r--altosuilib/AltosLed.java2
-rw-r--r--altosuilib/AltosLights.java2
-rw-r--r--altosuilib/AltosPositionListener.java2
-rw-r--r--altosuilib/AltosRomconfigUI.java79
-rw-r--r--altosuilib/AltosScanUI.java4
-rw-r--r--altosuilib/AltosSerial.java4
-rw-r--r--altosuilib/AltosSerialInUseException.java2
-rw-r--r--altosuilib/AltosShapeListener.java2
-rw-r--r--altosuilib/AltosUIAccelCal.java4
-rw-r--r--altosuilib/AltosUIAxis.java4
-rw-r--r--altosuilib/AltosUIConfigure.java9
-rw-r--r--altosuilib/AltosUIDataMissing.java2
-rw-r--r--altosuilib/AltosUIDataPoint.java2
-rw-r--r--altosuilib/AltosUIDataSet.java2
-rw-r--r--altosuilib/AltosUIDialog.java2
-rw-r--r--altosuilib/AltosUIEnable.java4
-rw-r--r--altosuilib/AltosUIFlightSeries.java4
-rw-r--r--altosuilib/AltosUIFlightTab.java4
-rw-r--r--altosuilib/AltosUIFrame.java2
-rw-r--r--altosuilib/AltosUIFreqList.java4
-rw-r--r--altosuilib/AltosUIGraph.java4
-rw-r--r--altosuilib/AltosUIGrapher.java4
-rw-r--r--altosuilib/AltosUIImage.java2
-rw-r--r--altosuilib/AltosUIIndicator.java4
-rw-r--r--altosuilib/AltosUILib.java4
-rw-r--r--altosuilib/AltosUILineStyle.java4
-rw-r--r--altosuilib/AltosUIListener.java2
-rw-r--r--altosuilib/AltosUIMap.java32
-rw-r--r--altosuilib/AltosUIMapPreload.java11
-rw-r--r--altosuilib/AltosUIMarker.java4
-rw-r--r--altosuilib/AltosUIPreferences.java4
-rw-r--r--altosuilib/AltosUIPreferencesBackend.java4
-rw-r--r--altosuilib/AltosUIRateList.java4
-rw-r--r--altosuilib/AltosUITelemetryList.java4
-rw-r--r--altosuilib/AltosUITimeSeries.java4
-rw-r--r--altosuilib/AltosUIUnitsIndicator.java4
-rw-r--r--altosuilib/AltosUIVoltageIndicator.java4
-rw-r--r--altosuilib/AltosUSBDevice.java20
-rw-r--r--altosuilib/AltosVoice.java2
-rw-r--r--altosuilib/GrabNDrag.java56
-rw-r--r--altosuilib/Makefile.am1
-rwxr-xr-xaltosuilib/OSXAdapter.java2
-rwxr-xr-xao-bringup/fix-telebt52
-rw-r--r--ao-tools/ao-cal-freq/ao-cal-freq.120
-rw-r--r--ao-tools/ao-cal-freq/ao-cal-freq.c141
-rw-r--r--ao-tools/ao-flash/Makefile.am4
-rwxr-xr-xao-tools/ao-flash/ao-reset-lpc9
-rw-r--r--ao-tools/ao-flash/ao-reset-lpc.135
-rw-r--r--configure.ac27
-rw-r--r--doc/.gitignore1
-rw-r--r--doc/Makefile.am (renamed from doc/Makefile)23
-rw-r--r--doc/RELNOTES8
-rw-r--r--doc/altusmetrum-docinfo.xml9
-rw-r--r--doc/map-loading.dot35
-rw-r--r--doc/map-loading.txt221
-rw-r--r--doc/micropeak-docinfo.xml16
-rw-r--r--doc/release-notes-1.8.7.inc37
-rw-r--r--doc/release-notes.inc4
-rw-r--r--doc/specs.inc18
-rw-r--r--doc/telegps-docinfo.xml10
-rw-r--r--doc/telemini.inc50
-rw-r--r--doc/usage.inc19
-rw-r--r--map-server/Makefile.am1
-rw-r--r--map-server/altos-map/.gitignore1
-rw-r--r--map-server/altos-map/Makefile.am6
-rwxr-xr-xmap-server/altos-map/altos-map-fake5
-rw-r--r--map-server/altos-map/altos-map.c293
-rw-r--r--map-server/altos-mapd/.gitignore6
-rw-r--r--map-server/altos-mapd/AltosMapd.java235
-rw-r--r--map-server/altos-mapd/AltosMapdClient.java156
-rw-r--r--map-server/altos-mapd/AltosMapdPreferences.java85
-rw-r--r--map-server/altos-mapd/AltosMapdServer.java24
-rw-r--r--map-server/altos-mapd/Makefile.am73
-rw-r--r--map-server/altos-mapd/Manifest.txt2
-rw-r--r--map-server/altos-mapd/altos-mapd-default4
-rw-r--r--map-server/altos-mapd/altos-mapd.service14
-rw-r--r--map-server/altos-mapj/.gitignore6
-rw-r--r--map-server/altos-mapj/AltosMap.java182
-rw-r--r--map-server/altos-mapj/Makefile.am62
-rw-r--r--map-server/altos-mapj/Manifest.txt2
-rwxr-xr-xmap-server/altos-mapj/altos-mapj-fake6
-rw-r--r--micropeak/Makefile.am6
-rw-r--r--micropeak/MicroData.java4
-rw-r--r--micropeak/MicroDeviceDialog.java2
-rw-r--r--micropeak/MicroDownload.java4
-rw-r--r--micropeak/MicroExport.java4
-rw-r--r--micropeak/MicroFile.java4
-rw-r--r--micropeak/MicroFileChooser.java4
-rw-r--r--micropeak/MicroFrame.java2
-rwxr-xr-xmicropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStubbin61296 -> 31253 bytes
-rw-r--r--micropeak/MicroPeak.java4
-rw-r--r--micropeak/MicroRaw.java4
-rw-r--r--micropeak/MicroSave.java4
-rw-r--r--micropeak/MicroSerial.java2
-rw-r--r--micropeak/MicroSerialLog.java2
-rw-r--r--micropeak/MicroUSB.java23
-rw-r--r--micropeak/ReadMe-Mac.rtf76
-rw-r--r--src/Makefile1
-rw-r--r--src/drivers/ao_mma655x.c2
-rw-r--r--src/drivers/ao_ms5607.c47
-rw-r--r--src/fox1ihu/flash-loader/ao_pins.h2
-rw-r--r--src/kernel/ao.h2
-rw-r--r--src/kernel/ao_config.c3
-rw-r--r--src/kernel/ao_log.c12
-rw-r--r--src/kernel/ao_log.h2
-rw-r--r--src/kernel/ao_log_big.c56
-rw-r--r--src/kernel/ao_log_gps.c64
-rw-r--r--src/kernel/ao_log_mega.c106
-rw-r--r--src/kernel/ao_log_metrum.c54
-rw-r--r--src/kernel/ao_log_mini.c42
-rw-r--r--src/lpc/ao_serial_lpc.c5
-rw-r--r--src/stm/ao_timer.c5
-rw-r--r--src/stmf0/ao_serial_stm.c8
-rw-r--r--telegps/Makefile.am6
-rw-r--r--telegps/ReadMe-Mac.rtf155
-rwxr-xr-xtelegps/TeleGPS.app/Contents/MacOS/JavaApplicationStubbin61296 -> 31253 bytes
-rw-r--r--telegps/TeleGPS.java4
-rw-r--r--telegps/TeleGPSConfig.java4
-rw-r--r--telegps/TeleGPSConfigUI.java4
-rw-r--r--telegps/TeleGPSDisplayThread.java4
-rw-r--r--telegps/TeleGPSGraphUI.java4
-rw-r--r--telegps/TeleGPSInfo.java4
-rw-r--r--telegps/TeleGPSPreferences.java2
-rw-r--r--telegps/TeleGPSState.java4
-rw-r--r--telegps/TeleGPSStatus.java4
-rw-r--r--telegps/TeleGPSStatusUpdate.java2
363 files changed, 3391 insertions, 1016 deletions
diff --git a/Makefile.am b/Makefile.am
index 4f47417e..89fdd6c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/Releasing b/Releasing
index 7908a064..a20b6dc0 100644
--- 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)
diff --git a/altosdroid/res/layout/map_preload.xml b/altosdroid/res/layout/map_preload.xml
index 321e5ee3..4e60df2d 100644
--- a/altosdroid/res/layout/map_preload.xml
+++ b/altosdroid/res/layout/map_preload.xml
@@ -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"
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java
index 359b5832..0d09abd8 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java
index 5906ff98..2ae06522 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDebug.java
@@ -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.*;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
index 0776fa00..1bcb67ef 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
@@ -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 + ")");
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java
index 05cb0f6b..a443b6e9 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidLink.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java
index 8730e8ad..6da90a3d 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidMapInterface.java
@@ -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);
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java
index 0670005a..8bb78c00 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
index 01ec0af9..854fe86d 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
@@ -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";
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
index ec73f5e3..9594f85f 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
index 2a728cf7..1aebcd36 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java
@@ -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) {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java
index b71cdd62..37e4435a 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOnline.java
@@ -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.*;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java
index 77947b4b..0b235f28 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosUsb.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
index fedfdb52..ae3299fa 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java
index ace0a7d6..3130d2a1 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/IdleModeActivity.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java
index eccf5c59..a172451d 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/IgniterActivity.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java
index ff599fda..d5101166 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/ManageFrequenciesActivity.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java
index b93eaa19..ec88d2d6 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/MapTypeActivity.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java
index 9c43870f..e393b566 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/PreloadMapActivity.java
@@ -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,
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java b/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java
index 6c2d9d7a..bad0b821 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/SetupActivity.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java
index 5349612c..8997d967 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabFlight.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
index d239d988..a2f997f1 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
@@ -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.*;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java
index ba5afba5..f317ae91 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java
index ac211230..3df48385 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java
index 56f235c1..49ba5476 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java
@@ -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;
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java
index 69685dc7..5cfa647b 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java
index caf288a0..22a2bbd7 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java
@@ -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 {
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java
index 77cee787..74d5cd22 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryState.java
@@ -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 {
diff --git a/altoslib/AltosAccel.java b/altoslib/AltosAccel.java
index 8fefefc5..8bc6db6d 100644
--- a/altoslib/AltosAccel.java
+++ b/altoslib/AltosAccel.java
@@ -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.*;
diff --git a/altoslib/AltosAccelCal.java b/altoslib/AltosAccelCal.java
index f98090ef..be5497a3 100644
--- a/altoslib/AltosAccelCal.java
+++ b/altoslib/AltosAccelCal.java
@@ -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.*;
diff --git a/altoslib/AltosAccelCalListener.java b/altoslib/AltosAccelCalListener.java
index 17359245..2c5439b4 100644
--- a/altoslib/AltosAccelCalListener.java
+++ b/altoslib/AltosAccelCalListener.java
@@ -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.*;
diff --git a/altoslib/AltosCRCException.java b/altoslib/AltosCRCException.java
index 5c398d3c..f9687654 100644
--- a/altoslib/AltosCRCException.java
+++ b/altoslib/AltosCRCException.java
@@ -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;
diff --git a/altoslib/AltosCSV.java b/altoslib/AltosCSV.java
index a8de23f0..a08db23e 100644
--- a/altoslib/AltosCSV.java
+++ b/altoslib/AltosCSV.java
@@ -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); }
diff --git a/altoslib/AltosCalData.java b/altoslib/AltosCalData.java
index 5bc6c4fd..d448fdfe 100644
--- a/altoslib/AltosCalData.java
+++ b/altoslib/AltosCalData.java
@@ -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
diff --git a/altoslib/AltosCompanion.java b/altoslib/AltosCompanion.java
index 5ce333f8..1e1bad98 100644
--- a/altoslib/AltosCompanion.java
+++ b/altoslib/AltosCompanion.java
@@ -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.*;
diff --git a/altoslib/AltosConfigData.java b/altoslib/AltosConfigData.java
index 8d0bb479..48dab421 100644
--- a/altoslib/AltosConfigData.java
+++ b/altoslib/AltosConfigData.java
@@ -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.*;
diff --git a/altoslib/AltosConfigDataException.java b/altoslib/AltosConfigDataException.java
index fe6336b6..48ec35df 100644
--- a/altoslib/AltosConfigDataException.java
+++ b/altoslib/AltosConfigDataException.java
@@ -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 {
diff --git a/altoslib/AltosConfigValues.java b/altoslib/AltosConfigValues.java
index 10478fd4..9d02b2f0 100644
--- a/altoslib/AltosConfigValues.java
+++ b/altoslib/AltosConfigValues.java
@@ -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 */
diff --git a/altoslib/AltosConvert.java b/altoslib/AltosConvert.java
index ed16541a..d2460187 100644
--- a/altoslib/AltosConvert.java
+++ b/altoslib/AltosConvert.java
@@ -19,7 +19,7 @@
/*
* Sensor data conversion functions
*/
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
import java.util.*;
diff --git a/altoslib/AltosDataListener.java b/altoslib/AltosDataListener.java
index 9a1e1465..709b71b6 100644
--- a/altoslib/AltosDataListener.java
+++ b/altoslib/AltosDataListener.java
@@ -12,7 +12,7 @@
* General Public License for more details.
*/
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
public abstract class AltosDataListener {
diff --git a/altoslib/AltosDataProvider.java b/altoslib/AltosDataProvider.java
index 9589a8e6..bb179580 100644
--- a/altoslib/AltosDataProvider.java
+++ b/altoslib/AltosDataProvider.java
@@ -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;
diff --git a/altoslib/AltosDebug.java b/altoslib/AltosDebug.java
index a44eb12f..57e97a18 100644
--- a/altoslib/AltosDebug.java
+++ b/altoslib/AltosDebug.java
@@ -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.*;
diff --git a/altoslib/AltosDistance.java b/altoslib/AltosDistance.java
index 38efbf1a..6560f9ed 100644
--- a/altoslib/AltosDistance.java
+++ b/altoslib/AltosDistance.java
@@ -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 {
diff --git a/altoslib/AltosEeprom.java b/altoslib/AltosEeprom.java
index 124bd478..1ececde1 100644
--- a/altoslib/AltosEeprom.java
+++ b/altoslib/AltosEeprom.java
@@ -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.*;
diff --git a/altoslib/AltosEepromChunk.java b/altoslib/AltosEepromChunk.java
index 4f12c190..1c1e80c7 100644
--- a/altoslib/AltosEepromChunk.java
+++ b/altoslib/AltosEepromChunk.java
@@ -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.*;
diff --git a/altoslib/AltosEepromDownload.java b/altoslib/AltosEepromDownload.java
index 547b523f..280414f8 100644
--- a/altoslib/AltosEepromDownload.java
+++ b/altoslib/AltosEepromDownload.java
@@ -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.*;
diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java
index 067f0302..839f0aa0 100644
--- a/altoslib/AltosEepromFile.java
+++ b/altoslib/AltosEepromFile.java
@@ -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.*;
diff --git a/altoslib/AltosEepromList.java b/altoslib/AltosEepromList.java
index c55bcaaa..a9551d85 100644
--- a/altoslib/AltosEepromList.java
+++ b/altoslib/AltosEepromList.java
@@ -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.*;
diff --git a/altoslib/AltosEepromLog.java b/altoslib/AltosEepromLog.java
index ba722b89..0da3e991 100644
--- a/altoslib/AltosEepromLog.java
+++ b/altoslib/AltosEepromLog.java
@@ -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.*;
diff --git a/altoslib/AltosEepromMonitor.java b/altoslib/AltosEepromMonitor.java
index 11144a3a..f58df11b 100644
--- a/altoslib/AltosEepromMonitor.java
+++ b/altoslib/AltosEepromMonitor.java
@@ -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.*;
diff --git a/altoslib/AltosEepromRecord.java b/altoslib/AltosEepromRecord.java
index 43e8ea4d..22cb8f89 100644
--- a/altoslib/AltosEepromRecord.java
+++ b/altoslib/AltosEepromRecord.java
@@ -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> {
diff --git a/altoslib/AltosEepromRecordFireTwo.java b/altoslib/AltosEepromRecordFireTwo.java
index d6b74d1b..38b6c841 100644
--- a/altoslib/AltosEepromRecordFireTwo.java
+++ b/altoslib/AltosEepromRecordFireTwo.java
@@ -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.*;
diff --git a/altoslib/AltosEepromRecordFull.java b/altoslib/AltosEepromRecordFull.java
index 7e92d353..dc421d8d 100644
--- a/altoslib/AltosEepromRecordFull.java
+++ b/altoslib/AltosEepromRecordFull.java
@@ -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;
diff --git a/altoslib/AltosEepromRecordGps.java b/altoslib/AltosEepromRecordGps.java
index 5cf5db39..e2fd7928 100644
--- a/altoslib/AltosEepromRecordGps.java
+++ b/altoslib/AltosEepromRecordGps.java
@@ -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.*;
diff --git a/altoslib/AltosEepromRecordMega.java b/altoslib/AltosEepromRecordMega.java
index 86343fe0..6b28c50a 100644
--- a/altoslib/AltosEepromRecordMega.java
+++ b/altoslib/AltosEepromRecordMega.java
@@ -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;
diff --git a/altoslib/AltosEepromRecordMetrum.java b/altoslib/AltosEepromRecordMetrum.java
index 888a06cc..102d1407 100644
--- a/altoslib/AltosEepromRecordMetrum.java
+++ b/altoslib/AltosEepromRecordMetrum.java
@@ -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;
diff --git a/altoslib/AltosEepromRecordMini.java b/altoslib/AltosEepromRecordMini.java
index 55696693..2d212df0 100644
--- a/altoslib/AltosEepromRecordMini.java
+++ b/altoslib/AltosEepromRecordMini.java
@@ -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;
diff --git a/altoslib/AltosEepromRecordSet.java b/altoslib/AltosEepromRecordSet.java
index 36075931..27f81df6 100644
--- a/altoslib/AltosEepromRecordSet.java
+++ b/altoslib/AltosEepromRecordSet.java
@@ -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.*;
diff --git a/altoslib/AltosEepromRecordTiny.java b/altoslib/AltosEepromRecordTiny.java
index 06ee9d54..428a9fc5 100644
--- a/altoslib/AltosEepromRecordTiny.java
+++ b/altoslib/AltosEepromRecordTiny.java
@@ -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;
diff --git a/altoslib/AltosFile.java b/altoslib/AltosFile.java
index 6f98b87a..e96b19db 100644
--- a/altoslib/AltosFile.java
+++ b/altoslib/AltosFile.java
@@ -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.*;
diff --git a/altoslib/AltosFilterListener.java b/altoslib/AltosFilterListener.java
index fe91100a..d870c083 100644
--- a/altoslib/AltosFilterListener.java
+++ b/altoslib/AltosFilterListener.java
@@ -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);
diff --git a/altoslib/AltosFlash.java b/altoslib/AltosFlash.java
index 9bf0da25..e6b05713 100644
--- a/altoslib/AltosFlash.java
+++ b/altoslib/AltosFlash.java
@@ -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();
diff --git a/altoslib/AltosFlashListener.java b/altoslib/AltosFlashListener.java
index 60052133..120e7146 100644
--- a/altoslib/AltosFlashListener.java
+++ b/altoslib/AltosFlashListener.java
@@ -16,8 +16,12 @@
* 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);
}
diff --git a/altoslib/AltosFlightDisplay.java b/altoslib/AltosFlightDisplay.java
index 8fe33c5e..7743fda5 100644
--- a/altoslib/AltosFlightDisplay.java
+++ b/altoslib/AltosFlightDisplay.java
@@ -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();
diff --git a/altoslib/AltosFlightReader.java b/altoslib/AltosFlightReader.java
index 671bf638..a4724f04 100644
--- a/altoslib/AltosFlightReader.java
+++ b/altoslib/AltosFlightReader.java
@@ -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.*;
diff --git a/altoslib/AltosFlightSeries.java b/altoslib/AltosFlightSeries.java
index 182bdd19..32bd6c5e 100644
--- a/altoslib/AltosFlightSeries.java
+++ b/altoslib/AltosFlightSeries.java
@@ -12,7 +12,7 @@
* General Public License for more details.
*/
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
import java.util.*;
diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java
index 2760321d..7c8ed85e 100644
--- a/altoslib/AltosFlightStats.java
+++ b/altoslib/AltosFlightStats.java
@@ -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.*;
diff --git a/altoslib/AltosFontListener.java b/altoslib/AltosFontListener.java
index 97947d0b..736d2426 100644
--- a/altoslib/AltosFontListener.java
+++ b/altoslib/AltosFontListener.java
@@ -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);
diff --git a/altoslib/AltosForce.java b/altoslib/AltosForce.java
index 47fb900c..99fe2671 100644
--- a/altoslib/AltosForce.java
+++ b/altoslib/AltosForce.java
@@ -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 {
diff --git a/altoslib/AltosFrequency.java b/altoslib/AltosFrequency.java
index dfe33789..58f503c5 100644
--- a/altoslib/AltosFrequency.java
+++ b/altoslib/AltosFrequency.java
@@ -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.*;
diff --git a/altoslib/AltosGPS.java b/altoslib/AltosGPS.java
index b6ca3576..8037eb93 100644
--- a/altoslib/AltosGPS.java
+++ b/altoslib/AltosGPS.java
@@ -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.*;
diff --git a/altoslib/AltosGPSSat.java b/altoslib/AltosGPSSat.java
index 8d3b316a..6c045a31 100644
--- a/altoslib/AltosGPSSat.java
+++ b/altoslib/AltosGPSSat.java
@@ -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.*;
diff --git a/altoslib/AltosGPSTimeValue.java b/altoslib/AltosGPSTimeValue.java
index e15c60e3..5ad1afa1 100644
--- a/altoslib/AltosGPSTimeValue.java
+++ b/altoslib/AltosGPSTimeValue.java
@@ -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;
diff --git a/altoslib/AltosGreatCircle.java b/altoslib/AltosGreatCircle.java
index f1cb1940..cd5b9636 100644
--- a/altoslib/AltosGreatCircle.java
+++ b/altoslib/AltosGreatCircle.java
@@ -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.*;
diff --git a/altoslib/AltosHeight.java b/altoslib/AltosHeight.java
index 668080f1..f65ca899 100644
--- a/altoslib/AltosHeight.java
+++ b/altoslib/AltosHeight.java
@@ -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 {
diff --git a/altoslib/AltosHexfile.java b/altoslib/AltosHexfile.java
index f2ab4bea..609d1bcb 100644
--- a/altoslib/AltosHexfile.java
+++ b/altoslib/AltosHexfile.java
@@ -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;
}
diff --git a/altoslib/AltosHexsym.java b/altoslib/AltosHexsym.java
index 4f56af9a..b1323484 100644
--- a/altoslib/AltosHexsym.java
+++ b/altoslib/AltosHexsym.java
@@ -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;
diff --git a/altoslib/AltosIMU.java b/altoslib/AltosIMU.java
index df81c9dd..114dfcf9 100644
--- a/altoslib/AltosIMU.java
+++ b/altoslib/AltosIMU.java
@@ -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.*;
diff --git a/altoslib/AltosIdle.java b/altoslib/AltosIdle.java
index b5ee20d0..6c6758ca 100644
--- a/altoslib/AltosIdle.java
+++ b/altoslib/AltosIdle.java
@@ -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.*;
diff --git a/altoslib/AltosIdleFetch.java b/altoslib/AltosIdleFetch.java
index 88a5dab4..88a65e63 100644
--- a/altoslib/AltosIdleFetch.java
+++ b/altoslib/AltosIdleFetch.java
@@ -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.*;
diff --git a/altoslib/AltosIdleMonitor.java b/altoslib/AltosIdleMonitor.java
index 834d9aa5..99d31921 100644
--- a/altoslib/AltosIdleMonitor.java
+++ b/altoslib/AltosIdleMonitor.java
@@ -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.*;
diff --git a/altoslib/AltosIdleMonitorListener.java b/altoslib/AltosIdleMonitorListener.java
index 1ddec09a..43e2376f 100644
--- a/altoslib/AltosIdleMonitorListener.java
+++ b/altoslib/AltosIdleMonitorListener.java
@@ -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);
diff --git a/altoslib/AltosIdleReader.java b/altoslib/AltosIdleReader.java
index d15e2174..24477d62 100644
--- a/altoslib/AltosIdleReader.java
+++ b/altoslib/AltosIdleReader.java
@@ -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.*;
diff --git a/altoslib/AltosIgnite.java b/altoslib/AltosIgnite.java
index 767c00fb..50c0f22d 100644
--- a/altoslib/AltosIgnite.java
+++ b/altoslib/AltosIgnite.java
@@ -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.*;
diff --git a/altoslib/AltosImage.java b/altoslib/AltosImage.java
index abe9d56f..210a37c1 100644
--- a/altoslib/AltosImage.java
+++ b/altoslib/AltosImage.java
@@ -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.*;
diff --git a/altoslib/AltosJson.java b/altoslib/AltosJson.java
index 52c9b41e..b981c365 100644
--- a/altoslib/AltosJson.java
+++ b/altoslib/AltosJson.java
@@ -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);
diff --git a/altoslib/AltosKML.java b/altoslib/AltosKML.java
index d5248a17..cafc7f96 100644
--- a/altoslib/AltosKML.java
+++ b/altoslib/AltosKML.java
@@ -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.*;
diff --git a/altoslib/AltosLatLon.java b/altoslib/AltosLatLon.java
index 6fcc43fe..cd7015e3 100644
--- a/altoslib/AltosLatLon.java
+++ b/altoslib/AltosLatLon.java
@@ -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;
diff --git a/altoslib/AltosLatitude.java b/altoslib/AltosLatitude.java
index f43397d0..4c8ea0b2 100644
--- a/altoslib/AltosLatitude.java
+++ b/altoslib/AltosLatitude.java
@@ -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"; }
diff --git a/altoslib/AltosLaunchSite.java b/altoslib/AltosLaunchSite.java
index 19fb4858..a71e138d 100644
--- a/altoslib/AltosLaunchSite.java
+++ b/altoslib/AltosLaunchSite.java
@@ -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.*;
diff --git a/altoslib/AltosLaunchSiteListener.java b/altoslib/AltosLaunchSiteListener.java
index 0d926353..ecae488c 100644
--- a/altoslib/AltosLaunchSiteListener.java
+++ b/altoslib/AltosLaunchSiteListener.java
@@ -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.*;
diff --git a/altoslib/AltosLaunchSites.java b/altoslib/AltosLaunchSites.java
index 365f19e3..2c04c90e 100644
--- a/altoslib/AltosLaunchSites.java
+++ b/altoslib/AltosLaunchSites.java
@@ -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();
diff --git a/altoslib/AltosLib.java b/altoslib/AltosLib.java
index 7d2b68e0..8b0170ae 100644
--- a/altoslib/AltosLib.java
+++ b/altoslib/AltosLib.java
@@ -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;
diff --git a/altoslib/AltosLine.java b/altoslib/AltosLine.java
index b3833f64..a18366ed 100644
--- a/altoslib/AltosLine.java
+++ b/altoslib/AltosLine.java
@@ -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;
diff --git a/altoslib/AltosLink.java b/altoslib/AltosLink.java
index 3ad34891..44202c0c 100644
--- a/altoslib/AltosLink.java
+++ b/altoslib/AltosLink.java
@@ -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.*;
diff --git a/altoslib/AltosListenerState.java b/altoslib/AltosListenerState.java
index 949d2271..44820471 100644
--- a/altoslib/AltosListenerState.java
+++ b/altoslib/AltosListenerState.java
@@ -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.*;
diff --git a/altoslib/AltosLocation.java b/altoslib/AltosLocation.java
index 45831004..0ffc044e 100644
--- a/altoslib/AltosLocation.java
+++ b/altoslib/AltosLocation.java
@@ -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 {
diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java
index 44bea646..3111a2cd 100644
--- a/altoslib/AltosLog.java
+++ b/altoslib/AltosLog.java
@@ -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.*;
diff --git a/altoslib/AltosLongitude.java b/altoslib/AltosLongitude.java
index b2134cbb..6c7f715b 100644
--- a/altoslib/AltosLongitude.java
+++ b/altoslib/AltosLongitude.java
@@ -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"; }
diff --git a/altoslib/AltosMag.java b/altoslib/AltosMag.java
index 0d8ec69f..cbf9ecff 100644
--- a/altoslib/AltosMag.java
+++ b/altoslib/AltosMag.java
@@ -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.*;
diff --git a/altoslib/AltosMap.java b/altoslib/AltosMap.java
index 286cf1bb..b033cbff 100644
--- a/altoslib/AltosMap.java
+++ b/altoslib/AltosMap.java
@@ -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;
diff --git a/altoslib/AltosMapCache.java b/altoslib/AltosMapCache.java
index 54d2dbdd..01b39b47 100644
--- a/altoslib/AltosMapCache.java
+++ b/altoslib/AltosMapCache.java
@@ -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.*;
diff --git a/altoslib/AltosMapCacheListener.java b/altoslib/AltosMapCacheListener.java
index 8c07e3c1..b7d851b8 100644
--- a/altoslib/AltosMapCacheListener.java
+++ b/altoslib/AltosMapCacheListener.java
@@ -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);
diff --git a/altoslib/AltosMapInterface.java b/altoslib/AltosMapInterface.java
index 5089db64..e407e0fe 100644
--- a/altoslib/AltosMapInterface.java
+++ b/altoslib/AltosMapInterface.java
@@ -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.*;
diff --git a/altoslib/AltosMapLine.java b/altoslib/AltosMapLine.java
index f2174935..b971711e 100644
--- a/altoslib/AltosMapLine.java
+++ b/altoslib/AltosMapLine.java
@@ -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;
diff --git a/altoslib/AltosMapLoader.java b/altoslib/AltosMapLoader.java
index b57591df..4047907d 100644
--- a/altoslib/AltosMapLoader.java
+++ b/altoslib/AltosMapLoader.java
@@ -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();
diff --git a/altoslib/AltosMapLoaderListener.java b/altoslib/AltosMapLoaderListener.java
index 7f36c002..3ef8789d 100644
--- a/altoslib/AltosMapLoaderListener.java
+++ b/altoslib/AltosMapLoaderListener.java
@@ -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);
diff --git a/altoslib/AltosMapMark.java b/altoslib/AltosMapMark.java
index 4ef179ef..a263f814 100644
--- a/altoslib/AltosMapMark.java
+++ b/altoslib/AltosMapMark.java
@@ -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;
diff --git a/altoslib/AltosMapPath.java b/altoslib/AltosMapPath.java
index 1542a4e9..7104b2f6 100644
--- a/altoslib/AltosMapPath.java
+++ b/altoslib/AltosMapPath.java
@@ -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;
diff --git a/altoslib/AltosMapPathPoint.java b/altoslib/AltosMapPathPoint.java
index 409a6a5c..9a1edd42 100644
--- a/altoslib/AltosMapPathPoint.java
+++ b/altoslib/AltosMapPathPoint.java
@@ -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;
diff --git a/altoslib/AltosMapRectangle.java b/altoslib/AltosMapRectangle.java
index 0751aa33..8a28f218 100644
--- a/altoslib/AltosMapRectangle.java
+++ b/altoslib/AltosMapRectangle.java
@@ -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;
diff --git a/altoslib/AltosMapStore.java b/altoslib/AltosMapStore.java
index 4eba3a04..2f85fb8d 100644
--- a/altoslib/AltosMapStore.java
+++ b/altoslib/AltosMapStore.java
@@ -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();
diff --git a/altoslib/AltosMapStoreListener.java b/altoslib/AltosMapStoreListener.java
index 1fb7194a..6d9a00a8 100644
--- a/altoslib/AltosMapStoreListener.java
+++ b/altoslib/AltosMapStoreListener.java
@@ -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);
diff --git a/altoslib/AltosMapTile.java b/altoslib/AltosMapTile.java
index 4b01e437..6318c40d 100644
--- a/altoslib/AltosMapTile.java
+++ b/altoslib/AltosMapTile.java
@@ -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.*;
diff --git a/altoslib/AltosMapTileListener.java b/altoslib/AltosMapTileListener.java
index 3c6275a0..971d7744 100644
--- a/altoslib/AltosMapTileListener.java
+++ b/altoslib/AltosMapTileListener.java
@@ -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);
diff --git a/altoslib/AltosMapTransform.java b/altoslib/AltosMapTransform.java
index b6d4f435..6bc6c6f8 100644
--- a/altoslib/AltosMapTransform.java
+++ b/altoslib/AltosMapTransform.java
@@ -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;
diff --git a/altoslib/AltosMapTypeListener.java b/altoslib/AltosMapTypeListener.java
index 94401a00..f1b9d074 100644
--- a/altoslib/AltosMapTypeListener.java
+++ b/altoslib/AltosMapTypeListener.java
@@ -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);
diff --git a/altoslib/AltosMapZoomListener.java b/altoslib/AltosMapZoomListener.java
index c4a0acd6..7044a220 100644
--- a/altoslib/AltosMapZoomListener.java
+++ b/altoslib/AltosMapZoomListener.java
@@ -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);
diff --git a/altoslib/AltosMma655x.java b/altoslib/AltosMma655x.java
index 0f6022ac..3a728ac4 100644
--- a/altoslib/AltosMma655x.java
+++ b/altoslib/AltosMma655x.java
@@ -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.*;
diff --git a/altoslib/AltosMs5607.java b/altoslib/AltosMs5607.java
index 5b3ba65d..c4ddaea9 100644
--- a/altoslib/AltosMs5607.java
+++ b/altoslib/AltosMs5607.java
@@ -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.*;
diff --git a/altoslib/AltosNoSymbol.java b/altoslib/AltosNoSymbol.java
index 8372d396..b824b7f1 100644
--- a/altoslib/AltosNoSymbol.java
+++ b/altoslib/AltosNoSymbol.java
@@ -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) {
diff --git a/altoslib/AltosOrient.java b/altoslib/AltosOrient.java
index 4546a798..8f532da1 100644
--- a/altoslib/AltosOrient.java
+++ b/altoslib/AltosOrient.java
@@ -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 {
diff --git a/altoslib/AltosParse.java b/altoslib/AltosParse.java
index 77cf969d..8ba4d5b2 100644
--- a/altoslib/AltosParse.java
+++ b/altoslib/AltosParse.java
@@ -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.*;
diff --git a/altoslib/AltosPointDouble.java b/altoslib/AltosPointDouble.java
index 301d07b0..59e2f76c 100644
--- a/altoslib/AltosPointDouble.java
+++ b/altoslib/AltosPointDouble.java
@@ -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;
diff --git a/altoslib/AltosPointInt.java b/altoslib/AltosPointInt.java
index 25f5dd2a..50503cd8 100644
--- a/altoslib/AltosPointInt.java
+++ b/altoslib/AltosPointInt.java
@@ -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;
diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java
index c511332b..f277f31a 100644
--- a/altoslib/AltosPreferences.java
+++ b/altoslib/AltosPreferences.java
@@ -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.*;
diff --git a/altoslib/AltosPreferencesBackend.java b/altoslib/AltosPreferencesBackend.java
index 00fd2c6d..559cff07 100644
--- a/altoslib/AltosPreferencesBackend.java
+++ b/altoslib/AltosPreferencesBackend.java
@@ -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.*;
diff --git a/altoslib/AltosPresTemp.java b/altoslib/AltosPresTemp.java
index 4cd382c8..3869528e 100644
--- a/altoslib/AltosPresTemp.java
+++ b/altoslib/AltosPresTemp.java
@@ -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;
diff --git a/altoslib/AltosPressure.java b/altoslib/AltosPressure.java
index 507a4cee..63884a44 100644
--- a/altoslib/AltosPressure.java
+++ b/altoslib/AltosPressure.java
@@ -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 {
diff --git a/altoslib/AltosProgrammer.java b/altoslib/AltosProgrammer.java
index e4f57578..1872392d 100644
--- a/altoslib/AltosProgrammer.java
+++ b/altoslib/AltosProgrammer.java
@@ -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.*;
diff --git a/altoslib/AltosPyro.java b/altoslib/AltosPyro.java
index fea4fd59..b716f4e3 100644
--- a/altoslib/AltosPyro.java
+++ b/altoslib/AltosPyro.java
@@ -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.*;
diff --git a/altoslib/AltosPyroName.java b/altoslib/AltosPyroName.java
index 0152e479..0a2c5a66 100644
--- a/altoslib/AltosPyroName.java
+++ b/altoslib/AltosPyroName.java
@@ -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 {
diff --git a/altoslib/AltosQuaternion.java b/altoslib/AltosQuaternion.java
index 6d6bc12c..98790f5f 100644
--- a/altoslib/AltosQuaternion.java
+++ b/altoslib/AltosQuaternion.java
@@ -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 */
diff --git a/altoslib/AltosRecordSet.java b/altoslib/AltosRecordSet.java
index 91cce624..a84cc3f9 100644
--- a/altoslib/AltosRecordSet.java
+++ b/altoslib/AltosRecordSet.java
@@ -12,7 +12,7 @@
* General Public License for more details.
*/
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
import java.util.*;
diff --git a/altoslib/AltosRectangle.java b/altoslib/AltosRectangle.java
index 810388ed..3b46bd7c 100644
--- a/altoslib/AltosRectangle.java
+++ b/altoslib/AltosRectangle.java
@@ -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;
diff --git a/altoslib/AltosReplayReader.java b/altoslib/AltosReplayReader.java
index fab28cac..1960aac0 100644
--- a/altoslib/AltosReplayReader.java
+++ b/altoslib/AltosReplayReader.java
@@ -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.*;
diff --git a/altoslib/AltosRomconfig.java b/altoslib/AltosRomconfig.java
index 44a3fa60..ebeb76f3 100644
--- a/altoslib/AltosRomconfig.java
+++ b/altoslib/AltosRomconfig.java
@@ -16,12 +16,14 @@
* 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);
diff --git a/altoslib/AltosRotation.java b/altoslib/AltosRotation.java
index eec8c529..54b3b1f9 100644
--- a/altoslib/AltosRotation.java
+++ b/altoslib/AltosRotation.java
@@ -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;
diff --git a/altoslib/AltosRotationRate.java b/altoslib/AltosRotationRate.java
index 492f1217..b8490d79 100644
--- a/altoslib/AltosRotationRate.java
+++ b/altoslib/AltosRotationRate.java
@@ -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 {
diff --git a/altoslib/AltosSavedState.java b/altoslib/AltosSavedState.java
index 66876864..3e572dc3 100644
--- a/altoslib/AltosSavedState.java
+++ b/altoslib/AltosSavedState.java
@@ -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.*;
diff --git a/altoslib/AltosSelfFlash.java b/altoslib/AltosSelfFlash.java
index c7ea147f..0250cce7 100644
--- a/altoslib/AltosSelfFlash.java
+++ b/altoslib/AltosSelfFlash.java
@@ -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;
diff --git a/altoslib/AltosSensorEMini.java b/altoslib/AltosSensorEMini.java
index 1bdbb60c..e7f540fd 100644
--- a/altoslib/AltosSensorEMini.java
+++ b/altoslib/AltosSensorEMini.java
@@ -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;
diff --git a/altoslib/AltosSensorMM.java b/altoslib/AltosSensorMM.java
index 00873afe..a689aef0 100644
--- a/altoslib/AltosSensorMM.java
+++ b/altoslib/AltosSensorMM.java
@@ -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;
diff --git a/altoslib/AltosSensorMega.java b/altoslib/AltosSensorMega.java
index e58b03a1..0aa52176 100644
--- a/altoslib/AltosSensorMega.java
+++ b/altoslib/AltosSensorMega.java
@@ -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;
diff --git a/altoslib/AltosSensorMetrum.java b/altoslib/AltosSensorMetrum.java
index e01d57cc..efed1a6f 100644
--- a/altoslib/AltosSensorMetrum.java
+++ b/altoslib/AltosSensorMetrum.java
@@ -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;
diff --git a/altoslib/AltosSensorTGPS.java b/altoslib/AltosSensorTGPS.java
index 14514413..485e8b3c 100644
--- a/altoslib/AltosSensorTGPS.java
+++ b/altoslib/AltosSensorTGPS.java
@@ -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;
diff --git a/altoslib/AltosSensorTM.java b/altoslib/AltosSensorTM.java
index bdedaa9c..a25f4d19 100644
--- a/altoslib/AltosSensorTM.java
+++ b/altoslib/AltosSensorTM.java
@@ -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;
diff --git a/altoslib/AltosSensorTMini2.java b/altoslib/AltosSensorTMini2.java
index 9b5a1854..941e82a2 100644
--- a/altoslib/AltosSensorTMini2.java
+++ b/altoslib/AltosSensorTMini2.java
@@ -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;
diff --git a/altoslib/AltosSensorTMini3.java b/altoslib/AltosSensorTMini3.java
index b92def03..e43c05c5 100644
--- a/altoslib/AltosSensorTMini3.java
+++ b/altoslib/AltosSensorTMini3.java
@@ -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;
diff --git a/altoslib/AltosSpeed.java b/altoslib/AltosSpeed.java
index 2a8ccedc..af10ad27 100644
--- a/altoslib/AltosSpeed.java
+++ b/altoslib/AltosSpeed.java
@@ -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 {
diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java
index 68097faf..93104fb0 100644
--- a/altoslib/AltosState.java
+++ b/altoslib/AltosState.java
@@ -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 {
diff --git a/altoslib/AltosStateName.java b/altoslib/AltosStateName.java
index 5ba21f27..e5292d30 100644
--- a/altoslib/AltosStateName.java
+++ b/altoslib/AltosStateName.java
@@ -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 {
diff --git a/altoslib/AltosStringInputStream.java b/altoslib/AltosStringInputStream.java
index 48fff3ea..ee2415ca 100644
--- a/altoslib/AltosStringInputStream.java
+++ b/altoslib/AltosStringInputStream.java
@@ -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.*;
diff --git a/altoslib/AltosTelemetry.java b/altoslib/AltosTelemetry.java
index a374519d..a19e4226 100644
--- a/altoslib/AltosTelemetry.java
+++ b/altoslib/AltosTelemetry.java
@@ -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.*;
diff --git a/altoslib/AltosTelemetryCompanion.java b/altoslib/AltosTelemetryCompanion.java
index c6dfe3eb..091c8bd8 100644
--- a/altoslib/AltosTelemetryCompanion.java
+++ b/altoslib/AltosTelemetryCompanion.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryConfiguration.java b/altoslib/AltosTelemetryConfiguration.java
index c8026a83..4411a77d 100644
--- a/altoslib/AltosTelemetryConfiguration.java
+++ b/altoslib/AltosTelemetryConfiguration.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryFile.java b/altoslib/AltosTelemetryFile.java
index e51455f8..679c6809 100644
--- a/altoslib/AltosTelemetryFile.java
+++ b/altoslib/AltosTelemetryFile.java
@@ -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.*;
diff --git a/altoslib/AltosTelemetryIterable.java b/altoslib/AltosTelemetryIterable.java
index d3e4ce67..8cd0c9c7 100644
--- a/altoslib/AltosTelemetryIterable.java
+++ b/altoslib/AltosTelemetryIterable.java
@@ -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.*;
diff --git a/altoslib/AltosTelemetryLegacy.java b/altoslib/AltosTelemetryLegacy.java
index 027f601e..d2b29835 100644
--- a/altoslib/AltosTelemetryLegacy.java
+++ b/altoslib/AltosTelemetryLegacy.java
@@ -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.*;
diff --git a/altoslib/AltosTelemetryLocation.java b/altoslib/AltosTelemetryLocation.java
index e2925a58..25570bf9 100644
--- a/altoslib/AltosTelemetryLocation.java
+++ b/altoslib/AltosTelemetryLocation.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryMap.java b/altoslib/AltosTelemetryMap.java
index a7ddc684..fa275e1d 100644
--- a/altoslib/AltosTelemetryMap.java
+++ b/altoslib/AltosTelemetryMap.java
@@ -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;
diff --git a/altoslib/AltosTelemetryMegaData.java b/altoslib/AltosTelemetryMegaData.java
index f5961c8c..1a0bff31 100644
--- a/altoslib/AltosTelemetryMegaData.java
+++ b/altoslib/AltosTelemetryMegaData.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryMegaSensor.java b/altoslib/AltosTelemetryMegaSensor.java
index 4c64b554..e97e18e2 100644
--- a/altoslib/AltosTelemetryMegaSensor.java
+++ b/altoslib/AltosTelemetryMegaSensor.java
@@ -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); }
diff --git a/altoslib/AltosTelemetryMetrumData.java b/altoslib/AltosTelemetryMetrumData.java
index 8cd09b41..4a9dcd64 100644
--- a/altoslib/AltosTelemetryMetrumData.java
+++ b/altoslib/AltosTelemetryMetrumData.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryMetrumSensor.java b/altoslib/AltosTelemetryMetrumSensor.java
index 79d3a499..383f645a 100644
--- a/altoslib/AltosTelemetryMetrumSensor.java
+++ b/altoslib/AltosTelemetryMetrumSensor.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryMini2.java b/altoslib/AltosTelemetryMini2.java
index 3ea287ac..86e10539 100644
--- a/altoslib/AltosTelemetryMini2.java
+++ b/altoslib/AltosTelemetryMini2.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryMini3.java b/altoslib/AltosTelemetryMini3.java
index c66f8e61..b1831442 100644
--- a/altoslib/AltosTelemetryMini3.java
+++ b/altoslib/AltosTelemetryMini3.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryRaw.java b/altoslib/AltosTelemetryRaw.java
index f2108d68..88f23f5e 100644
--- a/altoslib/AltosTelemetryRaw.java
+++ b/altoslib/AltosTelemetryRaw.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryReader.java b/altoslib/AltosTelemetryReader.java
index 8fb61a4f..de957f65 100644
--- a/altoslib/AltosTelemetryReader.java
+++ b/altoslib/AltosTelemetryReader.java
@@ -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.*;
diff --git a/altoslib/AltosTelemetrySatellite.java b/altoslib/AltosTelemetrySatellite.java
index 0965df9f..8213a43e 100644
--- a/altoslib/AltosTelemetrySatellite.java
+++ b/altoslib/AltosTelemetrySatellite.java
@@ -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); }
diff --git a/altoslib/AltosTelemetrySensor.java b/altoslib/AltosTelemetrySensor.java
index dc8efa9b..2219088a 100644
--- a/altoslib/AltosTelemetrySensor.java
+++ b/altoslib/AltosTelemetrySensor.java
@@ -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 {
diff --git a/altoslib/AltosTelemetryStandard.java b/altoslib/AltosTelemetryStandard.java
index 2a1c9365..3f585cea 100644
--- a/altoslib/AltosTelemetryStandard.java
+++ b/altoslib/AltosTelemetryStandard.java
@@ -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) {
diff --git a/altoslib/AltosTemperature.java b/altoslib/AltosTemperature.java
index efc6d5e1..b1526a4b 100644
--- a/altoslib/AltosTemperature.java
+++ b/altoslib/AltosTemperature.java
@@ -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 {
diff --git a/altoslib/AltosTime.java b/altoslib/AltosTime.java
index 5c6ab037..d0057969 100644
--- a/altoslib/AltosTime.java
+++ b/altoslib/AltosTime.java
@@ -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; }
diff --git a/altoslib/AltosTimeSeries.java b/altoslib/AltosTimeSeries.java
index c6a780a3..75225e15 100644
--- a/altoslib/AltosTimeSeries.java
+++ b/altoslib/AltosTimeSeries.java
@@ -12,7 +12,7 @@
* General Public License for more details.
*/
-package org.altusmetrum.altoslib_12;
+package org.altusmetrum.altoslib_13;
import java.util.*;
diff --git a/altoslib/AltosTimeValue.java b/altoslib/AltosTimeValue.java
index 298ac7f0..e94370a7 100644
--- a/altoslib/AltosTimeValue.java
+++ b/altoslib/AltosTimeValue.java
@@ -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
index 00000000..2a9f470a
--- /dev/null
+++ b/altoslib/AltosUnitInfo.java
@@ -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
index 00000000..3753df46
--- /dev/null
+++ b/altoslib/AltosUnitInfoListener.java
@@ -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);
+}
diff --git a/altoslib/AltosUnits.java b/altoslib/AltosUnits.java
index e1194487..9295b8e8 100644
--- a/altoslib/AltosUnits.java
+++ b/altoslib/AltosUnits.java
@@ -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.*;
diff --git a/altoslib/AltosUnitsListener.java b/altoslib/AltosUnitsListener.java
index 1f06afbf..e37027a6 100644
--- a/altoslib/AltosUnitsListener.java
+++ b/altoslib/AltosUnitsListener.java
@@ -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);
diff --git a/altoslib/AltosUnitsRange.java b/altoslib/AltosUnitsRange.java
index 6bf0d91f..58f918ba 100644
--- a/altoslib/AltosUnitsRange.java
+++ b/altoslib/AltosUnitsRange.java
@@ -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.*;
diff --git a/altoslib/AltosUnknownProduct.java b/altoslib/AltosUnknownProduct.java
index e4bebcd4..dd108a2e 100644
--- a/altoslib/AltosUnknownProduct.java
+++ b/altoslib/AltosUnknownProduct.java
@@ -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;
diff --git a/altoslib/AltosUsbId.java b/altoslib/AltosUsbId.java
index e3794304..5c70341d 100644
--- a/altoslib/AltosUsbId.java
+++ b/altoslib/AltosUsbId.java
@@ -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;
diff --git a/altoslib/AltosVersion.java.in b/altoslib/AltosVersion.java.in
index c8399f2e..6b660bb5 100644
--- a/altoslib/AltosVersion.java.in
+++ b/altoslib/AltosVersion.java.in
@@ -16,14 +16,8 @@
* 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;
- }
}
diff --git a/altoslib/AltosVoltage.java b/altoslib/AltosVoltage.java
index ef53ac11..aca82e28 100644
--- a/altoslib/AltosVoltage.java
+++ b/altoslib/AltosVoltage.java
@@ -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 {
diff --git a/altoslib/AltosWriter.java b/altoslib/AltosWriter.java
index c77e48b0..7bb0ec0d 100644
--- a/altoslib/AltosWriter.java
+++ b/altoslib/AltosWriter.java
@@ -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 {
diff --git a/altoslib/Makefile.am b/altoslib/Makefile.am
index 7c5d767d..92976332 100644
--- a/altoslib/Makefile.am
+++ b/altoslib/Makefile.am
@@ -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
diff --git a/altosui/Altos.java b/altosui/Altos.java
index 9f176c4b..36b951e3 100644
--- a/altosui/Altos.java
+++ b/altosui/Altos.java
@@ -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 {
diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java
index ab052e5f..be3f9ce7 100644
--- a/altosui/AltosAscent.java
+++ b/altosui/AltosAscent.java
@@ -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;
diff --git a/altosui/AltosCompanionInfo.java b/altosui/AltosCompanionInfo.java
index 95e1d2d9..9c788971 100644
--- a/altosui/AltosCompanionInfo.java
+++ b/altosui/AltosCompanionInfo.java
@@ -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;
diff --git a/altosui/AltosConfigFC.java b/altosui/AltosConfigFC.java
index 5e2aa7f4..01ba9c0d 100644
--- a/altosui/AltosConfigFC.java
+++ b/altosui/AltosConfigFC.java
@@ -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 {
diff --git a/altosui/AltosConfigFCUI.java b/altosui/AltosConfigFCUI.java
index 9bd265f0..b4c37e0b 100644
--- a/altosui/AltosConfigFCUI.java
+++ b/altosui/AltosConfigFCUI.java
@@ -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
diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java
index 62c434ac..c05b6e91 100644
--- a/altosui/AltosConfigPyroUI.java
+++ b/altosui/AltosConfigPyroUI.java
@@ -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
diff --git a/altosui/AltosConfigTD.java b/altosui/AltosConfigTD.java
index 9fedc56d..4c6d1846 100644
--- a/altosui/AltosConfigTD.java
+++ b/altosui/AltosConfigTD.java
@@ -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 {
diff --git a/altosui/AltosConfigTDUI.java b/altosui/AltosConfigTDUI.java
index 3ff56218..12b6e4bf 100644
--- a/altosui/AltosConfigTDUI.java
+++ b/altosui/AltosConfigTDUI.java
@@ -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
diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java
index acafc659..8b62a212 100644
--- a/altosui/AltosConfigureUI.java
+++ b/altosui/AltosConfigureUI.java
@@ -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
diff --git a/altosui/AltosDescent.java b/altosui/AltosDescent.java
index 2cc65b08..09db6ac0 100644
--- a/altosui/AltosDescent.java
+++ b/altosui/AltosDescent.java
@@ -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 {
diff --git a/altosui/AltosFlightStatus.java b/altosui/AltosFlightStatus.java
index a5e5a4ef..207c44b4 100644
--- a/altosui/AltosFlightStatus.java
+++ b/altosui/AltosFlightStatus.java
@@ -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;
diff --git a/altosui/AltosFlightStatusTableModel.java b/altosui/AltosFlightStatusTableModel.java
index 9c4e1bee..823dbc3c 100644
--- a/altosui/AltosFlightStatusTableModel.java
+++ b/altosui/AltosFlightStatusTableModel.java
@@ -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 = {
diff --git a/altosui/AltosFlightStatusUpdate.java b/altosui/AltosFlightStatusUpdate.java
index b8b0d38a..2f9c728c 100644
--- a/altosui/AltosFlightStatusUpdate.java
+++ b/altosui/AltosFlightStatusUpdate.java
@@ -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 {
diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java
index 44e995be..8742b8ca 100644
--- a/altosui/AltosFlightUI.java
+++ b/altosui/AltosFlightUI.java
@@ -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;
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java
index f387ed9b..59b06c18 100644
--- a/altosui/AltosGraphUI.java
+++ b/altosui/AltosGraphUI.java
@@ -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;
diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java
index 584f143a..fc76b2b6 100644
--- a/altosui/AltosIdleMonitorUI.java
+++ b/altosui/AltosIdleMonitorUI.java
@@ -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;
diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java
index debbf763..406b51cf 100644
--- a/altosui/AltosIgniteUI.java
+++ b/altosui/AltosIgniteUI.java
@@ -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
diff --git a/altosui/AltosIgnitor.java b/altosui/AltosIgnitor.java
index 7c7d1fba..38332b2f 100644
--- a/altosui/AltosIgnitor.java
+++ b/altosui/AltosIgnitor.java
@@ -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 {
diff --git a/altosui/AltosLanded.java b/altosui/AltosLanded.java
index c2e14923..5952238a 100644
--- a/altosui/AltosLanded.java
+++ b/altosui/AltosLanded.java
@@ -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 {
diff --git a/altosui/AltosLaunch.java b/altosui/AltosLaunch.java
index f1893cf5..7e47586d 100644
--- a/altosui/AltosLaunch.java
+++ b/altosui/AltosLaunch.java
@@ -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;
diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java
index 8a24ed3e..56b211ac 100644
--- a/altosui/AltosLaunchUI.java
+++ b/altosui/AltosLaunchUI.java
@@ -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) {
diff --git a/altosui/AltosPad.java b/altosui/AltosPad.java
index 0aeef8e1..60f58905 100644
--- a/altosui/AltosPad.java
+++ b/altosui/AltosPad.java
@@ -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 {
diff --git a/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub b/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub
index c661d3e1..16966918 100755
--- a/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub
+++ b/altosui/AltosUI.app/Contents/MacOS/JavaApplicationStub
Binary files differ
diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java
index 02e49a94..82ec4746 100644
--- a/altosui/AltosUI.java
+++ b/altosui/AltosUI.java
@@ -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();
diff --git a/altosui/Makefile.am b/altosui/Makefile.am
index 805c5550..144d21d7 100644
--- a/altosui/Makefile.am
+++ b/altosui/Makefile.am
@@ -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
diff --git a/altosui/ReadMe-Mac.rtf b/altosui/ReadMe-Mac.rtf
index 8a95262c..c15994bc 100644
--- a/altosui/ReadMe-Mac.rtf
+++ b/altosui/ReadMe-Mac.rtf
@@ -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}
@@ -19,38 +20,40 @@
{\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
diff --git a/altosui/altos-windows.nsi.in b/altosui/altos-windows.nsi.in
index 23d6f6bd..be9fb433 100644
--- a/altosui/altos-windows.nsi.in
+++ b/altosui/altos-windows.nsi.in
@@ -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
index 00000000..aebfd527
--- /dev/null
+++ b/altosui/install-macosx
@@ -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 *
diff --git a/altosuilib/AltosBTDevice.java b/altosuilib/AltosBTDevice.java
index 5b9ab06a..dcc1f39f 100644
--- a/altosuilib/AltosBTDevice.java
+++ b/altosuilib/AltosBTDevice.java
@@ -16,10 +16,10 @@
* 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 {
diff --git a/altosuilib/AltosBTDeviceIterator.java b/altosuilib/AltosBTDeviceIterator.java
index ac9068d0..11d9dacd 100644
--- a/altosuilib/AltosBTDeviceIterator.java
+++ b/altosuilib/AltosBTDeviceIterator.java
@@ -16,11 +16,11 @@
* 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;
diff --git a/altosuilib/AltosBTKnown.java b/altosuilib/AltosBTKnown.java
index 56f1991f..e8efc2c6 100644
--- a/altosuilib/AltosBTKnown.java
+++ b/altosuilib/AltosBTKnown.java
@@ -16,10 +16,10 @@
* 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>();
diff --git a/altosuilib/AltosBTManage.java b/altosuilib/AltosBTManage.java
index aec4c34d..ee0b56ee 100644
--- a/altosuilib/AltosBTManage.java
+++ b/altosuilib/AltosBTManage.java
@@ -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;
diff --git a/altosuilib/AltosCSVUI.java b/altosuilib/AltosCSVUI.java
index 442e3de3..c8c6161c 100644
--- a/altosuilib/AltosCSVUI.java
+++ b/altosuilib/AltosCSVUI.java
@@ -16,13 +16,13 @@
* 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
diff --git a/altosuilib/AltosConfigFreqUI.java b/altosuilib/AltosConfigFreqUI.java
index 055d34f9..618d6517 100644
--- a/altosuilib/AltosConfigFreqUI.java
+++ b/altosuilib/AltosConfigFreqUI.java
@@ -16,14 +16,14 @@
* 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;
diff --git a/altosuilib/AltosDataChooser.java b/altosuilib/AltosDataChooser.java
index b417c732..caa63e7a 100644
--- a/altosuilib/AltosDataChooser.java
+++ b/altosuilib/AltosDataChooser.java
@@ -16,12 +16,12 @@
* 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;
diff --git a/altosuilib/AltosDevice.java b/altosuilib/AltosDevice.java
index 44f71f7a..a5a068b4 100644
--- a/altosuilib/AltosDevice.java
+++ b/altosuilib/AltosDevice.java
@@ -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);
}
diff --git a/altosuilib/AltosDeviceDialog.java b/altosuilib/AltosDeviceDialog.java
index 77249bfc..d8a24b18 100644
--- a/altosuilib/AltosDeviceDialog.java
+++ b/altosuilib/AltosDeviceDialog.java
@@ -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.
diff --git a/altosuilib/AltosDeviceUIDialog.java b/altosuilib/AltosDeviceUIDialog.java
index f3409cce..93ab178f 100644
--- a/altosuilib/AltosDeviceUIDialog.java
+++ b/altosuilib/AltosDeviceUIDialog.java
@@ -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.*;
diff --git a/altosuilib/AltosDisplayThread.java b/altosuilib/AltosDisplayThread.java
index 5e691ac4..3726f515 100644
--- a/altosuilib/AltosDisplayThread.java
+++ b/altosuilib/AltosDisplayThread.java
@@ -16,13 +16,13 @@
* 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 {
diff --git a/altosuilib/AltosEepromDelete.java b/altosuilib/AltosEepromDelete.java
index d7dde6df..d7d0b2b7 100644
--- a/altosuilib/AltosEepromDelete.java
+++ b/altosuilib/AltosEepromDelete.java
@@ -16,13 +16,13 @@
* 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;
diff --git a/altosuilib/AltosEepromGrapher.java b/altosuilib/AltosEepromGrapher.java
index a29f64ea..b8d3bdaa 100644
--- a/altosuilib/AltosEepromGrapher.java
+++ b/altosuilib/AltosEepromGrapher.java
@@ -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 {
diff --git a/altosuilib/AltosEepromManage.java b/altosuilib/AltosEepromManage.java
index 1adf1f0a..cab3e8c7 100644
--- a/altosuilib/AltosEepromManage.java
+++ b/altosuilib/AltosEepromManage.java
@@ -16,13 +16,13 @@
* 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 {
diff --git a/altosuilib/AltosEepromMonitorUI.java b/altosuilib/AltosEepromMonitorUI.java
index fc6c95c6..8f6a9b9e 100644
--- a/altosuilib/AltosEepromMonitorUI.java
+++ b/altosuilib/AltosEepromMonitorUI.java
@@ -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;
diff --git a/altosuilib/AltosEepromSelect.java b/altosuilib/AltosEepromSelect.java
index f88f2bd6..427826fa 100644
--- a/altosuilib/AltosEepromSelect.java
+++ b/altosuilib/AltosEepromSelect.java
@@ -16,13 +16,13 @@
* 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;
diff --git a/altosuilib/AltosFlashUI.java b/altosuilib/AltosFlashUI.java
index 802e8eb3..b91776aa 100644
--- a/altosuilib/AltosFlashUI.java
+++ b/altosuilib/AltosFlashUI.java
@@ -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;
}
/*
diff --git a/altosuilib/AltosFlightInfoTableModel.java b/altosuilib/AltosFlightInfoTableModel.java
index 943c9207..0bb346ae 100644
--- a/altosuilib/AltosFlightInfoTableModel.java
+++ b/altosuilib/AltosFlightInfoTableModel.java
@@ -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.*;
diff --git a/altosuilib/AltosFlightStatsTable.java b/altosuilib/AltosFlightStatsTable.java
index 8f7e9bff..49fb4fbc 100644
--- a/altosuilib/AltosFlightStatsTable.java
+++ b/altosuilib/AltosFlightStatsTable.java
@@ -16,12 +16,12 @@
* 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;
diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java
index a758bcde..60eae962 100644
--- a/altosuilib/AltosGraph.java
+++ b/altosuilib/AltosGraph.java
@@ -16,14 +16,14 @@
* 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.*;
diff --git a/altosuilib/AltosInfoTable.java b/altosuilib/AltosInfoTable.java
index e759394b..86917319 100644
--- a/altosuilib/AltosInfoTable.java
+++ b/altosuilib/AltosInfoTable.java
@@ -16,13 +16,13 @@
* 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;
diff --git a/altosuilib/AltosLed.java b/altosuilib/AltosLed.java
index b53e7604..e3caf38b 100644
--- a/altosuilib/AltosLed.java
+++ b/altosuilib/AltosLed.java
@@ -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.*;
diff --git a/altosuilib/AltosLights.java b/altosuilib/AltosLights.java
index 7b02d770..02cc77d1 100644
--- a/altosuilib/AltosLights.java
+++ b/altosuilib/AltosLights.java
@@ -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.*;
diff --git a/altosuilib/AltosPositionListener.java b/altosuilib/AltosPositionListener.java
index f44735e2..ca98ca64 100644
--- a/altosuilib/AltosPositionListener.java
+++ b/altosuilib/AltosPositionListener.java
@@ -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);
diff --git a/altosuilib/AltosRomconfigUI.java b/altosuilib/AltosRomconfigUI.java
index 74323218..fd670d4e 100644
--- a/altosuilib/AltosRomconfigUI.java
+++ b/altosuilib/AltosRomconfigUI.java
@@ -16,12 +16,12 @@
* 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));
}
diff --git a/altosuilib/AltosScanUI.java b/altosuilib/AltosScanUI.java
index c63f027c..fad1b2cd 100644
--- a/altosuilib/AltosScanUI.java
+++ b/altosuilib/AltosScanUI.java
@@ -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;
diff --git a/altosuilib/AltosSerial.java b/altosuilib/AltosSerial.java
index d7c6129c..1c2e3cd5 100644
--- a/altosuilib/AltosSerial.java
+++ b/altosuilib/AltosSerial.java
@@ -20,13 +20,13 @@
* 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.*;
/*
diff --git a/altosuilib/AltosSerialInUseException.java b/altosuilib/AltosSerialInUseException.java
index c8ca4d56..51474e8a 100644
--- a/altosuilib/AltosSerialInUseException.java
+++ b/altosuilib/AltosSerialInUseException.java
@@ -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;
diff --git a/altosuilib/AltosShapeListener.java b/altosuilib/AltosShapeListener.java
index 6bf52fd4..1e2e0618 100644
--- a/altosuilib/AltosShapeListener.java
+++ b/altosuilib/AltosShapeListener.java
@@ -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);
diff --git a/altosuilib/AltosUIAccelCal.java b/altosuilib/AltosUIAccelCal.java
index af72a21d..e2c917b1 100644
--- a/altosuilib/AltosUIAccelCal.java
+++ b/altosuilib/AltosUIAccelCal.java
@@ -16,14 +16,14 @@
* 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
diff --git a/altosuilib/AltosUIAxis.java b/altosuilib/AltosUIAxis.java
index 52873363..59c5357a 100644
--- a/altosuilib/AltosUIAxis.java
+++ b/altosuilib/AltosUIAxis.java
@@ -16,14 +16,14 @@
* 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.*;
diff --git a/altosuilib/AltosUIConfigure.java b/altosuilib/AltosUIConfigure.java
index 6ca8c777..e61b5d52 100644
--- a/altosuilib/AltosUIConfigure.java
+++ b/altosuilib/AltosUIConfigure.java
@@ -16,14 +16,14 @@
* 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++;
diff --git a/altosuilib/AltosUIDataMissing.java b/altosuilib/AltosUIDataMissing.java
index 05227e1d..043fd69b 100644
--- a/altosuilib/AltosUIDataMissing.java
+++ b/altosuilib/AltosUIDataMissing.java
@@ -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;
diff --git a/altosuilib/AltosUIDataPoint.java b/altosuilib/AltosUIDataPoint.java
index 36fadeaf..b82a7825 100644
--- a/altosuilib/AltosUIDataPoint.java
+++ b/altosuilib/AltosUIDataPoint.java
@@ -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;
diff --git a/altosuilib/AltosUIDataSet.java b/altosuilib/AltosUIDataSet.java
index ddda3d3d..8602473d 100644
--- a/altosuilib/AltosUIDataSet.java
+++ b/altosuilib/AltosUIDataSet.java
@@ -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();
diff --git a/altosuilib/AltosUIDialog.java b/altosuilib/AltosUIDialog.java
index 5eafa457..292c5cc1 100644
--- a/altosuilib/AltosUIDialog.java
+++ b/altosuilib/AltosUIDialog.java
@@ -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.*;
diff --git a/altosuilib/AltosUIEnable.java b/altosuilib/AltosUIEnable.java
index 851e831f..ef9a692a 100644
--- a/altosuilib/AltosUIEnable.java
+++ b/altosuilib/AltosUIEnable.java
@@ -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.*;
diff --git a/altosuilib/AltosUIFlightSeries.java b/altosuilib/AltosUIFlightSeries.java
index 407e5ab4..49c7226c 100644
--- a/altosuilib/AltosUIFlightSeries.java
+++ b/altosuilib/AltosUIFlightSeries.java
@@ -12,12 +12,12 @@
* 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.*;
diff --git a/altosuilib/AltosUIFlightTab.java b/altosuilib/AltosUIFlightTab.java
index cf6a0c74..1633d9b9 100644
--- a/altosuilib/AltosUIFlightTab.java
+++ b/altosuilib/AltosUIFlightTab.java
@@ -16,13 +16,13 @@
* 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;
diff --git a/altosuilib/AltosUIFrame.java b/altosuilib/AltosUIFrame.java
index b7eee664..301bdc68 100644
--- a/altosuilib/AltosUIFrame.java
+++ b/altosuilib/AltosUIFrame.java
@@ -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.*;
diff --git a/altosuilib/AltosUIFreqList.java b/altosuilib/AltosUIFreqList.java
index 7a5c3543..f3f7035d 100644
--- a/altosuilib/AltosUIFreqList.java
+++ b/altosuilib/AltosUIFreqList.java
@@ -16,10 +16,10 @@
* 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> {
diff --git a/altosuilib/AltosUIGraph.java b/altosuilib/AltosUIGraph.java
index 40f415f1..098e9a52 100644
--- a/altosuilib/AltosUIGraph.java
+++ b/altosuilib/AltosUIGraph.java
@@ -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.*;
diff --git a/altosuilib/AltosUIGrapher.java b/altosuilib/AltosUIGrapher.java
index 916d0b3f..642072fa 100644
--- a/altosuilib/AltosUIGrapher.java
+++ b/altosuilib/AltosUIGrapher.java
@@ -16,14 +16,14 @@
* 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.*;
diff --git a/altosuilib/AltosUIImage.java b/altosuilib/AltosUIImage.java
index f23b50bc..4ced80fd 100644
--- a/altosuilib/AltosUIImage.java
+++ b/altosuilib/AltosUIImage.java
@@ -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;
diff --git a/altosuilib/AltosUIIndicator.java b/altosuilib/AltosUIIndicator.java
index ac2e6f06..6baa185c 100644
--- a/altosuilib/AltosUIIndicator.java
+++ b/altosuilib/AltosUIIndicator.java
@@ -16,11 +16,11 @@
* 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;
diff --git a/altosuilib/AltosUILib.java b/altosuilib/AltosUILib.java
index 81a8b131..704782f4 100644
--- a/altosuilib/AltosUILib.java
+++ b/altosuilib/AltosUILib.java
@@ -16,12 +16,12 @@
* 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 {
diff --git a/altosuilib/AltosUILineStyle.java b/altosuilib/AltosUILineStyle.java
index 387281a3..872ef9c7 100644
--- a/altosuilib/AltosUILineStyle.java
+++ b/altosuilib/AltosUILineStyle.java
@@ -12,14 +12,14 @@
* 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.*;
diff --git a/altosuilib/AltosUIListener.java b/altosuilib/AltosUIListener.java
index 54a00661..3c54fb54 100644
--- a/altosuilib/AltosUIListener.java
+++ b/altosuilib/AltosUIListener.java
@@ -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);
diff --git a/altosuilib/AltosUIMap.java b/altosuilib/AltosUIMap.java
index 2e1e8f16..8dfdba64 100644
--- a/altosuilib/AltosUIMap.java
+++ b/altosuilib/AltosUIMap.java
@@ -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);
}
}
diff --git a/altosuilib/AltosUIMapPreload.java b/altosuilib/AltosUIMapPreload.java
index 81cda0d2..ffd974ac 100644
--- a/altosuilib/AltosUIMapPreload.java
+++ b/altosuilib/AltosUIMapPreload.java
@@ -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;
diff --git a/altosuilib/AltosUIMarker.java b/altosuilib/AltosUIMarker.java
index 90cdb291..63e81024 100644
--- a/altosuilib/AltosUIMarker.java
+++ b/altosuilib/AltosUIMarker.java
@@ -16,14 +16,14 @@
* 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.*;
diff --git a/altosuilib/AltosUIPreferences.java b/altosuilib/AltosUIPreferences.java
index a2014065..062cb49d 100644
--- a/altosuilib/AltosUIPreferences.java
+++ b/altosuilib/AltosUIPreferences.java
@@ -16,13 +16,13 @@
* 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 {
diff --git a/altosuilib/AltosUIPreferencesBackend.java b/altosuilib/AltosUIPreferencesBackend.java
index 163ba173..7c05e0e5 100644
--- a/altosuilib/AltosUIPreferencesBackend.java
+++ b/altosuilib/AltosUIPreferencesBackend.java
@@ -16,11 +16,11 @@
* 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 {
diff --git a/altosuilib/AltosUIRateList.java b/altosuilib/AltosUIRateList.java
index d1c15ce0..1717fb69 100644
--- a/altosuilib/AltosUIRateList.java
+++ b/altosuilib/AltosUIRateList.java
@@ -16,10 +16,10 @@
* 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> {
diff --git a/altosuilib/AltosUITelemetryList.java b/altosuilib/AltosUITelemetryList.java
index f884cd41..84f190e6 100644
--- a/altosuilib/AltosUITelemetryList.java
+++ b/altosuilib/AltosUITelemetryList.java
@@ -16,11 +16,11 @@
* 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> {
diff --git a/altosuilib/AltosUITimeSeries.java b/altosuilib/AltosUITimeSeries.java
index e85e3c17..4c2f9ba9 100644
--- a/altosuilib/AltosUITimeSeries.java
+++ b/altosuilib/AltosUITimeSeries.java
@@ -16,14 +16,14 @@
* 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.*;
diff --git a/altosuilib/AltosUIUnitsIndicator.java b/altosuilib/AltosUIUnitsIndicator.java
index bbfebef6..19687c32 100644
--- a/altosuilib/AltosUIUnitsIndicator.java
+++ b/altosuilib/AltosUIUnitsIndicator.java
@@ -16,11 +16,11 @@
* 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 {
diff --git a/altosuilib/AltosUIVoltageIndicator.java b/altosuilib/AltosUIVoltageIndicator.java
index 297a6531..c8797b72 100644
--- a/altosuilib/AltosUIVoltageIndicator.java
+++ b/altosuilib/AltosUIVoltageIndicator.java
@@ -16,11 +16,11 @@
* 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 {
diff --git a/altosuilib/AltosUSBDevice.java b/altosuilib/AltosUSBDevice.java
index 49f966f3..f43d6bef 100644
--- a/altosuilib/AltosUSBDevice.java
+++ b/altosuilib/AltosUSBDevice.java
@@ -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;
diff --git a/altosuilib/AltosVoice.java b/altosuilib/AltosVoice.java
index 1d579a16..264eede3 100644
--- a/altosuilib/AltosVoice.java
+++ b/altosuilib/AltosVoice.java
@@ -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
index 665ef89e..00000000
--- a/altosuilib/GrabNDrag.java
+++ /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);
- }
- }
-}
diff --git a/altosuilib/Makefile.am b/altosuilib/Makefile.am
index c65a3d15..c00144f8 100644
--- a/altosuilib/Makefile.am
+++ b/altosuilib/Makefile.am
@@ -9,7 +9,6 @@ SRC=.
altosuilibdir = $(datadir)/java
altosuilib_JAVA = \
- GrabNDrag.java \
AltosDevice.java \
AltosDeviceDialog.java \
AltosPositionListener.java \
diff --git a/altosuilib/OSXAdapter.java b/altosuilib/OSXAdapter.java
index c338396f..c05412ce 100755
--- a/altosuilib/OSXAdapter.java
+++ b/altosuilib/OSXAdapter.java
@@ -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
index 00000000..35933e9f
--- /dev/null
+++ b/ao-bringup/fix-telebt
@@ -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"
diff --git a/ao-tools/ao-cal-freq/ao-cal-freq.1 b/ao-tools/ao-cal-freq/ao-cal-freq.1
index bfc3101c..695a0dbf 100644
--- a/ao-tools/ao-cal-freq/ao-cal-freq.1
+++ b/ao-tools/ao-cal-freq/ao-cal-freq.1
@@ -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
diff --git a/ao-tools/ao-cal-freq/ao-cal-freq.c b/ao-tools/ao-cal-freq/ao-cal-freq.c
index 12c2a3ae..838fbab3 100644
--- a/ao-tools/ao-cal-freq/ao-cal-freq.c
+++ b/ao-tools/ao-cal-freq/ao-cal-freq.c
@@ -38,14 +38,15 @@
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;
}
diff --git a/ao-tools/ao-flash/Makefile.am b/ao-tools/ao-flash/Makefile.am
index 4231dc21..ed928439 100644
--- a/ao-tools/ao-flash/Makefile.am
+++ b/ao-tools/ao-flash/Makefile.am
@@ -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
index 00000000..d4316136
--- /dev/null
+++ b/ao-tools/ao-flash/ao-reset-lpc
@@ -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
index 00000000..826b6fbf
--- /dev/null
+++ b/ao-tools/ao-flash/ao-reset-lpc.1
@@ -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
+
diff --git a/configure.ac b/configure.ac
index c5de6a5d..7f7eec93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"
diff --git a/doc/.gitignore b/doc/.gitignore
index 786123a3..06ad43eb 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -4,3 +4,4 @@
*.raw
titlepage.templates.xsl
fop-cfg.xml
+map-loading.svg
diff --git a/doc/Makefile b/doc/Makefile.am
index 3661a6d6..450053f1 100644
--- a/doc/Makefile
+++ b/doc/Makefile.am
@@ -2,7 +2,12 @@
# 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 \
@@ -194,7 +199,8 @@ RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
ONEFILE_TXT_FILES=\
altos.txt \
companion.txt \
- telemetry.txt
+ telemetry.txt \
+ map-loading.txt
ONEFILE_RAW_FILES=$(ONEFILE_TXT_FILES:.txt=.raw)
ONEFILE_PDF_FILES=$(ONEFILE_TXT_FILES:.txt=.pdf)
@@ -215,6 +221,8 @@ HTML_REVHISTORY=\
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
@@ -244,7 +252,10 @@ PUBLISH_DOC=$(PUBLISH_HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
DOC=$(HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
-.SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
+SUFFIXES = .dot .svg .tmpl .xsl .inc .txt .raw .pdf .html
+
+.dot.svg:
+ dot -Tsvg -o$@ $*.dot
.txt.raw:
sed -e 's/^[ ]*//' -e 's/^\\//' $*.txt > $@
@@ -253,18 +264,20 @@ DOC=$(HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
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
+ 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:
- @touch $@
+ 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
diff --git a/doc/RELNOTES b/doc/RELNOTES
index 748d2b5b..678ac17e 100644
--- a/doc/RELNOTES
+++ b/doc/RELNOTES
@@ -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
diff --git a/doc/altusmetrum-docinfo.xml b/doc/altusmetrum-docinfo.xml
index 7b696b97..18bc644d 100644
--- a/doc/altusmetrum-docinfo.xml
+++ b/doc/altusmetrum-docinfo.xml
@@ -47,6 +47,15 @@
<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>
<revremark>
diff --git a/doc/map-loading.dot b/doc/map-loading.dot
new file mode 100644
index 00000000..f5be02ef
--- /dev/null
+++ b/doc/map-loading.dot
@@ -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
index 00000000..1b39dd6b
--- /dev/null
+++ b/doc/map-loading.txt
@@ -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.
diff --git a/doc/micropeak-docinfo.xml b/doc/micropeak-docinfo.xml
index 37c6e770..6fab12b8 100644
--- a/doc/micropeak-docinfo.xml
+++ b/doc/micropeak-docinfo.xml
@@ -5,7 +5,7 @@
<email>keithp@keithp.com</email>
</author>
<copyright>
- <year>2014</year>
+ <year>2018</year>
<holder>Keith Packard</holder>
</copyright>
<mediaobject>
@@ -32,6 +32,20 @@
<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>
<revremark>
diff --git a/doc/release-notes-1.8.7.inc b/doc/release-notes-1.8.7.inc
new file mode 100644
index 00000000..f8b7b103
--- /dev/null
+++ b/doc/release-notes-1.8.7.inc
@@ -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.
+
+
diff --git a/doc/release-notes.inc b/doc/release-notes.inc
index 693699df..1183fd12 100644
--- a/doc/release-notes.inc
+++ b/doc/release-notes.inc
@@ -1,6 +1,10 @@
[appendix]
== Release Notes
:leveloffset: 2
+ include::release-notes-1.8.7.raw[]
+
+ <<<<
+ :leveloffset: 2
include::release-notes-1.8.6.raw[]
<<<<
diff --git a/doc/specs.inc b/doc/specs.inc
index f09d6fc9..1b7ea74b 100644
--- a/doc/specs.inc
+++ b/doc/specs.inc
@@ -76,6 +76,15 @@
|1MB
|-
|3.7-12V
+
+ |EasyMini v2.0
+ |MS5607 30km (100k')
+ |-
+ |-
+ |-
+ |1MB
+ |-
+ |3.7-12V
endif::easymini[]
ifdef::telemega[]
@@ -96,6 +105,15 @@
|8MB
|40mW
|3.7V
+
+ |TeleMega v3.0
+ |MS5607 30km (100k')
+ |MMA6555 102g
+ |uBlox Max-7Q
+ |MPU9250
+ |8MB
+ |40mW
+ |3.7V
endif::telemega[]
ifdef::easymega[]
diff --git a/doc/telegps-docinfo.xml b/doc/telegps-docinfo.xml
index 5e347cfd..4d3533de 100644
--- a/doc/telegps-docinfo.xml
+++ b/doc/telegps-docinfo.xml
@@ -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>
@@ -38,6 +38,14 @@
<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>
<revremark>
diff --git a/doc/telemini.inc b/doc/telemini.inc
index b40582a2..08893dfb 100644
--- a/doc/telemini.inc
+++ b/doc/telemini.inc
@@ -94,6 +94,56 @@
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
diff --git a/doc/usage.inc b/doc/usage.inc
index d010f398..dd795bdd 100644
--- a/doc/usage.inc
+++ b/doc/usage.inc
@@ -323,3 +323,22 @@
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
index 00000000..39ff8014
--- /dev/null
+++ b/map-server/Makefile.am
@@ -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
index 00000000..1158b56a
--- /dev/null
+++ b/map-server/altos-map/.gitignore
@@ -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
index 00000000..6925957b
--- /dev/null
+++ b/map-server/altos-map/Makefile.am
@@ -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
index 00000000..1bf5f8e2
--- /dev/null
+++ b/map-server/altos-map/altos-map-fake
@@ -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
index 00000000..38701076
--- /dev/null
+++ b/map-server/altos-map/altos-map.c
@@ -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
index 00000000..5f5ce0ae
--- /dev/null
+++ b/map-server/altos-mapd/.gitignore
@@ -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
index 00000000..29528541
--- /dev/null
+++ b/map-server/altos-mapd/AltosMapd.java
@@ -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
index 00000000..6c95da8f
--- /dev/null
+++ b/map-server/altos-mapd/AltosMapdClient.java
@@ -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
index 00000000..fcfe3261
--- /dev/null
+++ b/map-server/altos-mapd/AltosMapdPreferences.java
@@ -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
index 00000000..db7f7dc1
--- /dev/null
+++ b/map-server/altos-mapd/AltosMapdServer.java
@@ -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
index 00000000..39f67536
--- /dev/null
+++ b/map-server/altos-mapd/Makefile.am
@@ -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
index 00000000..42c0313b
--- /dev/null
+++ b/map-server/altos-mapd/Manifest.txt
@@ -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
index 00000000..1611f0b6
--- /dev/null
+++ b/map-server/altos-mapd/altos-mapd-default
@@ -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
index 00000000..ba263c2a
--- /dev/null
+++ b/map-server/altos-mapd/altos-mapd.service
@@ -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
index 00000000..c5d593e6
--- /dev/null
+++ b/map-server/altos-mapj/.gitignore
@@ -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
index 00000000..ad0a4f5f
--- /dev/null
+++ b/map-server/altos-mapj/AltosMap.java
@@ -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
index 00000000..f447adb6
--- /dev/null
+++ b/map-server/altos-mapj/Makefile.am
@@ -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
index 00000000..1a285b40
--- /dev/null
+++ b/map-server/altos-mapj/Manifest.txt
@@ -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
index 00000000..f600fec7
--- /dev/null
+++ b/map-server/altos-mapj/altos-mapj-fake
@@ -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
+
diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am
index 5e153b82..f01c5c9f 100644
--- a/micropeak/Makefile.am
+++ b/micropeak/Makefile.am
@@ -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
diff --git a/micropeak/MicroData.java b/micropeak/MicroData.java
index 6a9adf3f..96053ac5 100644
--- a/micropeak/MicroData.java
+++ b/micropeak/MicroData.java
@@ -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;
diff --git a/micropeak/MicroDeviceDialog.java b/micropeak/MicroDeviceDialog.java
index db2662a0..c39dab96 100644
--- a/micropeak/MicroDeviceDialog.java
+++ b/micropeak/MicroDeviceDialog.java
@@ -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 {
diff --git a/micropeak/MicroDownload.java b/micropeak/MicroDownload.java
index e5f54821..e656dc6f 100644
--- a/micropeak/MicroDownload.java
+++ b/micropeak/MicroDownload.java
@@ -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;
diff --git a/micropeak/MicroExport.java b/micropeak/MicroExport.java
index 36700e75..a98140ba 100644
--- a/micropeak/MicroExport.java
+++ b/micropeak/MicroExport.java
@@ -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 {
diff --git a/micropeak/MicroFile.java b/micropeak/MicroFile.java
index 20f6db55..9e50aa8d 100644
--- a/micropeak/MicroFile.java
+++ b/micropeak/MicroFile.java
@@ -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 {
diff --git a/micropeak/MicroFileChooser.java b/micropeak/MicroFileChooser.java
index 85f7aed4..c7a6d782 100644
--- a/micropeak/MicroFileChooser.java
+++ b/micropeak/MicroFileChooser.java
@@ -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;
diff --git a/micropeak/MicroFrame.java b/micropeak/MicroFrame.java
index d9ad8404..8129aedb 100644
--- a/micropeak/MicroFrame.java
+++ b/micropeak/MicroFrame.java
@@ -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 = {
diff --git a/micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub b/micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub
index c661d3e1..16966918 100755
--- a/micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub
+++ b/micropeak/MicroPeak.app/Contents/MacOS/JavaApplicationStub
Binary files differ
diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java
index c6a2a3c9..eee5bc07 100644
--- a/micropeak/MicroPeak.java
+++ b/micropeak/MicroPeak.java
@@ -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 {
diff --git a/micropeak/MicroRaw.java b/micropeak/MicroRaw.java
index 7a60499e..9d022d0a 100644
--- a/micropeak/MicroRaw.java
+++ b/micropeak/MicroRaw.java
@@ -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 {
diff --git a/micropeak/MicroSave.java b/micropeak/MicroSave.java
index 9da76914..d6e354f2 100644
--- a/micropeak/MicroSave.java
+++ b/micropeak/MicroSave.java
@@ -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 {
diff --git a/micropeak/MicroSerial.java b/micropeak/MicroSerial.java
index c1b2a7ad..04b58a87 100644
--- a/micropeak/MicroSerial.java
+++ b/micropeak/MicroSerial.java
@@ -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;
diff --git a/micropeak/MicroSerialLog.java b/micropeak/MicroSerialLog.java
index d33a36b3..0a1481c4 100644
--- a/micropeak/MicroSerialLog.java
+++ b/micropeak/MicroSerialLog.java
@@ -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 {
diff --git a/micropeak/MicroUSB.java b/micropeak/MicroUSB.java
index a2db3835..092c3d44 100644
--- a/micropeak/MicroUSB.java
+++ b/micropeak/MicroUSB.java
@@ -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;
diff --git a/micropeak/ReadMe-Mac.rtf b/micropeak/ReadMe-Mac.rtf
index f831c3f9..6445187a 100644
--- a/micropeak/ReadMe-Mac.rtf
+++ b/micropeak/ReadMe-Mac.rtf
@@ -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
diff --git a/src/Makefile b/src/Makefile
index 0dafb5ec..a1ff84c2 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -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 \
diff --git a/src/drivers/ao_mma655x.c b/src/drivers/ao_mma655x.c
index b9f1709c..5d44bffd 100644
--- a/src/drivers/ao_mma655x.c
+++ b/src/drivers/ao_mma655x.c
@@ -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,
diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c
index 914e0c1b..53ed992a 100644
--- a/src/drivers/ao_ms5607.c
+++ b/src/drivers/ao_ms5607.c
@@ -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
}
diff --git a/src/fox1ihu/flash-loader/ao_pins.h b/src/fox1ihu/flash-loader/ao_pins.h
index 19f29b08..c4fa69bd 100644
--- a/src/fox1ihu/flash-loader/ao_pins.h
+++ b/src/fox1ihu/flash-loader/ao_pins.h
@@ -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 */
diff --git a/src/kernel/ao.h b/src/kernel/ao.h
index 2bd0e367..0a3981d7 100644
--- a/src/kernel/ao.h
+++ b/src/kernel/ao.h
@@ -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
diff --git a/src/kernel/ao_config.c b/src/kernel/ao_config.c
index 25634ffc..86d4838f 100644
--- a/src/kernel/ao_config.c
+++ b/src/kernel/ao_config.c
@@ -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);
}
diff --git a/src/kernel/ao_log.c b/src/kernel/ao_log.c
index f70c7232..5fb086ce 100644
--- a/src/kernel/ao_log.c
+++ b/src/kernel/ao_log.c
@@ -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
diff --git a/src/kernel/ao_log.h b/src/kernel/ao_log.h
index 5f04ef9a..e2f1e0e4 100644
--- a/src/kernel/ao_log.h
+++ b/src/kernel/ao_log.h
@@ -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)
diff --git a/src/kernel/ao_log_big.c b/src/kernel/ao_log_big.c
index 28a893c7..7d7332e9 100644
--- a/src/kernel/ao_log_big.c
+++ b/src/kernel/ao_log_big.c
@@ -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();
diff --git a/src/kernel/ao_log_gps.c b/src/kernel/ao_log_gps.c
index a55d93f1..7284932c 100644
--- a/src/kernel/ao_log_gps.c
+++ b/src/kernel/ao_log_gps.c
@@ -27,37 +27,37 @@
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;
diff --git a/src/kernel/ao_log_mega.c b/src/kernel/ao_log_mega.c
index c6bdf1e2..0ae4e536 100644
--- a/src/kernel/ao_log_mega.c
+++ b/src/kernel/ao_log_mega.c
@@ -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();
diff --git a/src/kernel/ao_log_metrum.c b/src/kernel/ao_log_metrum.c
index afb8f637..34729070 100644
--- a/src/kernel/ao_log_metrum.c
+++ b/src/kernel/ao_log_metrum.c
@@ -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();
diff --git a/src/kernel/ao_log_mini.c b/src/kernel/ao_log_mini.c
index af2fa605..12c5d6bb 100644
--- a/src/kernel/ao_log_mini.c
+++ b/src/kernel/ao_log_mini.c
@@ -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();
diff --git a/src/lpc/ao_serial_lpc.c b/src/lpc/ao_serial_lpc.c
index 0011744d..d5cf930a 100644
--- a/src/lpc/ao_serial_lpc.c
+++ b/src/lpc/ao_serial_lpc.c
@@ -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
}
}
diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c
index 7b526902..9d118b72 100644
--- a/src/stm/ao_timer.c
+++ b/src/stm/ao_timer.c
@@ -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);
diff --git a/src/stmf0/ao_serial_stm.c b/src/stmf0/ao_serial_stm.c
index 59cfde2e..5097041a 100644
--- a/src/stmf0/ao_serial_stm.c
+++ b/src/stmf0/ao_serial_stm.c
@@ -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);
diff --git a/telegps/Makefile.am b/telegps/Makefile.am
index 2fe231f1..106ce55a 100644
--- a/telegps/Makefile.am
+++ b/telegps/Makefile.am
@@ -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
diff --git a/telegps/ReadMe-Mac.rtf b/telegps/ReadMe-Mac.rtf
index 48a82ed3..476fc096 100644
--- a/telegps/ReadMe-Mac.rtf
+++ b/telegps/ReadMe-Mac.rtf
@@ -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
diff --git a/telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub b/telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub
index c661d3e1..16966918 100755
--- a/telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub
+++ b/telegps/TeleGPS.app/Contents/MacOS/JavaApplicationStub
Binary files differ
diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java
index 1433c9e1..24cc379f 100644
--- a/telegps/TeleGPS.java
+++ b/telegps/TeleGPS.java
@@ -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
diff --git a/telegps/TeleGPSConfig.java b/telegps/TeleGPSConfig.java
index 7fc15ba9..e9d5b833 100644
--- a/telegps/TeleGPSConfig.java
+++ b/telegps/TeleGPSConfig.java
@@ -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 {
diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java
index 87683c2b..03652302 100644
--- a/telegps/TeleGPSConfigUI.java
+++ b/telegps/TeleGPSConfigUI.java
@@ -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
diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java
index fdf0e201..defd588e 100644
--- a/telegps/TeleGPSDisplayThread.java
+++ b/telegps/TeleGPSDisplayThread.java
@@ -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 {
diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java
index c68f2bad..5d4fc9cf 100644
--- a/telegps/TeleGPSGraphUI.java
+++ b/telegps/TeleGPSGraphUI.java
@@ -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;
diff --git a/telegps/TeleGPSInfo.java b/telegps/TeleGPSInfo.java
index 383a0a44..dcfbace5 100644
--- a/telegps/TeleGPSInfo.java
+++ b/telegps/TeleGPSInfo.java
@@ -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 {
diff --git a/telegps/TeleGPSPreferences.java b/telegps/TeleGPSPreferences.java
index 58b3ae35..31d435d0 100644
--- a/telegps/TeleGPSPreferences.java
+++ b/telegps/TeleGPSPreferences.java
@@ -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
diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java
index 21173394..0c15cbb1 100644
--- a/telegps/TeleGPSState.java
+++ b/telegps/TeleGPSState.java
@@ -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 {
diff --git a/telegps/TeleGPSStatus.java b/telegps/TeleGPSStatus.java
index e1be69a4..493917e5 100644
--- a/telegps/TeleGPSStatus.java
+++ b/telegps/TeleGPSStatus.java
@@ -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;
diff --git a/telegps/TeleGPSStatusUpdate.java b/telegps/TeleGPSStatusUpdate.java
index 1b66d142..d583fa5d 100644
--- a/telegps/TeleGPSStatusUpdate.java
+++ b/telegps/TeleGPSStatusUpdate.java
@@ -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 {