summaryrefslogtreecommitdiff
path: root/altoslib
Commit message (Collapse)AuthorAge
* altoslib: Stop reflective JSON class walk at Object instead of nullKeith Packard2016-06-17
| | | | | | | | | Android has classes above Object which are all tied together which cause the object walking to fail in pretty spectacular ways. As Object has no interesting fields, that serves as a fine barrier to the super class walk and works on both android and real java. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add back some JSON exception debugging printfsKeith Packard2016-06-17
| | | | | | These make it possible to figure out where the JSON code went wrong. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add construction for remaining primitive array types to JSONKeith Packard2016-06-17
| | | | | | | AltosCompanion has an array of ints, which was missed until I tried a telemetry file with companion data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add null constructor for AltosCompanionKeith Packard2016-06-17
| | | | | | This lets it be used by the JSON code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Get rid of manual JSON encoding stuffKeith Packard2016-06-17
| | | | | | | Now that the reflective JSON stuff is working, we can delete all of the manual code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Improve AltosState save/restore debuggingKeith Packard2016-06-17
| | | | | | | When save/restore generate different values, write out the two versions to one.json and two.json for easy comparison. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Use reflection JSON code for frequency preferencesKeith Packard2016-06-17
| | | | | | | This replaces the non-reflective JSON code with reflective code, which is much shorter. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add JSON-based object saving/restoring codeKeith Packard2016-06-17
| | | | | | | This uses Java reflection to construct JSON strings for most Java objects. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add null constructors to AltosQuaternion and AltosRotationKeith Packard2016-06-16
| | | | | | These will be used in the reflection-based JSON code Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Remove AltosHashSet codeKeith Packard2016-06-15
| | | | | | Everything has switched to JSON now. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Switch preserved state format to JSONKeith Packard2016-06-15
| | | | | | This is much easier to debug than the icky strings with backslashes everywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: use miles for distances > 1000ft.Keith Packard2016-05-24
| | | | | | | This makes both the map line and the other distance displays use miles for distances greater than 1000 feet. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add AltosIdleReaderKeith Packard2016-05-15
| | | | | | | This provides an AltosFlightReader interface for monitor idle mode, making that easier to provide in TeleGPS Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add log_space to AltosStateKeith Packard2016-05-15
| | | | | | | TeleGPS doesn't have flight_log_max value, but does have log_space which we can use for the same thing in monitor idle mode. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Set version and log space from AltosIdleFetchKeith Packard2016-05-15
| | | | | | Just more data for monitor idle mode Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Allow empty values in AltosHashSet representationKeith Packard2016-05-15
| | | | | | Check for value termination before appending the first character. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Store saved state in version-independent formatKeith Packard2016-05-12
| | | | | | | Use AltosHashSet for AltosState so that AltosDroid doesn't lose tracker information when the application is upgraded. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Store common frequencies in library version-independent formKeith Packard2016-05-12
| | | | | | | | | | | | | | | Serializable Objects in java are very specific to the class being serialized. As we bump the name of the library on a regular basis to note API/ABI issues, this mean a saved a Serializable object in the preferences database will fail to load across library version upgrades. The saved tracker state and saved common frequencies were the only objects saved in this form; this patch adds infrastructure for writing objects in a version-independent form, and then adds support for saving frequencies in that form. Signed-off-by: Keith Packard <keithp@keithp.com>
* Bump java library versionsKeith Packard2016-05-12
| | | | | | Prepare for 1.6.4 release Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Get rid of AltosMap from AltosMapLoaderKeith Packard2016-05-11
| | | | | | | Cleans up the loader API and eliminates a AltosMapTile for every chunk of map data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Clean up map file and url handlingKeith Packard2016-05-11
| | | | | | move it all to AltosMapStore.java Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Allow map preloading to be abortedKeith Packard2016-05-11
| | | | | | | Close the map preload dialog and it would be nice to stop loading map bits. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Remove some debug printf callsKeith Packard2016-05-11
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Switch distance from m/ft to km/miles for large valuesKeith Packard2016-05-11
| | | | | | | This adds lots of infrastructure to deal with making the unit used depend on the value itself, and then uses it only for distances. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Fix map preloading callbacks, run in separate threadKeith Packard2016-05-05
| | | | | | | | | | | | | | | | | The map storage and tile callbacks were muddled together. Create clearly separate states for map data and have status updates be delivered when registering for new status events so that registration is sufficient to track the state without an explicit call to get the current state. Run the map tile creation in a separate thread so that even checking status of files on disk runs out of the UI thread. These fixes serve to make the pacifier update more smoothly, and also not over/under count tile loading so that the loading actually completes when all of the tiles are loaded. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Deal with TeleMetrum v2.0 MMA6555 being invertedKeith Packard2016-05-02
| | | | | | | | | | | | | | | | Dumping the MMA655X data with the 'A' command provides the raw sensor value. On TM v2.0 boards, the sensor is inverted, and all of the firmware uses the inverted value except for the 'dump the raw data' command. As a result, MonitorIdle was using the un-inverted value and displaying mystic values. I've fixed this in the ground station code by checking the product name and conditionally inverting the value (4095 - value) for TeleMetrum v2.0 products. Unknown products will generate a warning dialog on AltosUI so we'll catch places where we've failed to add a new product name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Flush during set_state. Don't store listener state.Keith Packard2016-04-30
| | | | | | | | The listener state wasn't used anyways, so don't bother storing it. Also, flush the state during set_state, which actually causes the state to be written out. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Correct stats for flights without a real landingKeith Packard2016-04-30
| | | | | | | | | | | | The landing time was miscomputed when the flight ended without entering the landed state, as when the recording terminates at apogee. This led to an uncomputed average boost accel, so that is now checked separately from max accel (which is done over the whole flight, not just boost). Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Make AltosPreferencesBackend abstract. Add set/put SerializableKeith Packard2016-04-28
| | | | | | | This lets us add functionality to this directly, such as the new serializable APIs. Signed-off-by: Keith Packard <keithp@keithp.com>
* altosdroid: Add configurable frequency setKeith Packard2016-04-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Fix key in AndroidManifest.xml.inKeith Packard2016-04-27
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altosdroid: Split setup functions to separate dialogKeith Packard2016-04-26
| | | | | | | Remove them from the options menu, handle all preferences through listeners. Signed-off-by: Keith Packard <keithp@keithp.com>
* altosdroid: Add idle mode monitoring, reboot. Start ignitersKeith Packard2016-04-25
| | | | | | | This adds three idle mode operations -- monitor idle, reboot flight computer and test igniters. The igniter test isn't quite wired up. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Don't try to drag lines around until map is loadedKeith Packard2016-04-22
| | | | | | When the transform is null, it's hard to draw lines. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Report exceptions caught while opening launch sites URLKeith Packard2016-04-22
| | | | | | This just dumps them to stdout, which helps debug on Linux at least. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Use feet per second for imperial speedKeith Packard2016-04-22
| | | | | | This is more useful during descent than miles per hour... Signed-off-by: Keith Packard <keithp@keithp.com>
* Fix java class differing only by caseJustin Vreeland2016-04-21
| | | | | | | | | | | | OSX and Windows cannot handle files with names differing only by case. When these files are present in either there's a constant unfixable change viewable in git status and git diff. Since this code can be run and compiled on both platforms names different only by case should be avoided. Signed-off-by: Justin Vreeland <vreeland.justin@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
* Update java library version numbersKeith Packard2016-04-21
| | | | | | Prepare for 1.6.3 release. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: switch from keySet() to keys() in altos map tilesKeith Packard2016-04-19
| | | | | | | Android appears to not have the keySet() API in the same way that regular java does, so use the alternate older keys() api instead. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Make AltosGPSSat implement SerializableKeith Packard2016-04-19
| | | | | | This is required to save state values in AltosDroid. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add debugging to AltosPreferences.state() etcKeith Packard2016-04-19
| | | | | | | This let me find why AltosDroid was losing the last state information for each target. Signed-off-by: Keith Packard <keithp@keithp.com>
* altosui,telegps: Do not allow radio calibration to be editedKeith Packard2016-03-26
| | | | | | | This leads to sorrow for almost everyone. If you want to edit this, use a terminal program. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: use env var LAUNCH_SITES to override default URLKeith Packard2016-03-26
| | | | | | This makes it easier to debug new launch site data before uploading. Signed-off-by: Keith Packard <keithp@keithp.com>
* Update java library versionsKeith Packard2016-01-10
| | | | | | altoslib is API incompatible with 1.6.1 release due to altos.state updates. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Remove debug message from AltosMapKeith Packard2016-01-10
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Keep downloading when a parse error occursKeith Packard2015-10-13
| | | | | | | Eventually, we'll hit a block with no valid data and give up. Until then, keep going in case the flight computer glitched and wrote bad data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Make sure .eeprom download file is flushed on exceptionKeith Packard2015-10-13
| | | | | | | Flush and close the eeprom file even if an exception occurs to make sure that contents of the file aren't lost. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Rotation off by factor of twoKeith Packard2015-10-13
| | | | | | | | | The rotation computation was off by a factor of two when converting the rates to a quaternion (the quaternion needs to be half of the actual rotation amount). This ended up presenting a tilt angle of twice what it should be. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Hide 'state' member and use accessor functionKeith Packard2015-10-13
| | | | | | | | Someone was smashing the state to 'landed' when no packets had been received for a while. Found that by making it impossible for anyone outside of AltosState to change the value. Signed-off-by: Keith Packard <keithp@keithp.com>
* altoslib: Add companion telemetry data supportKeith Packard2015-08-20
| | | | | | This got lost in the great telemetry rewrite Signed-off-by: Keith Packard <keithp@keithp.com>