summaryrefslogtreecommitdiff
path: root/altoslib/AltosEepromTM.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-08-31 23:11:39 -0500
committerKeith Packard <keithp@keithp.com>2013-08-31 23:11:39 -0500
commit77dc89ed5b7bf8f5b3fa3b6131660f1a98f583ea (patch)
treef2b92c6d3e92d4b807ec945285bf15d91585367a /altoslib/AltosEepromTM.java
parentc781469ff907a32bd43a5d781391b6859b14cd32 (diff)
altoslib/altosui: Further AltosState transition work
Parses most eeprom and telem records now; altosui updated to show from AltosState info. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosEepromTM.java')
-rw-r--r--altoslib/AltosEepromTM.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/altoslib/AltosEepromTM.java b/altoslib/AltosEepromTM.java
index 6945468b..461a7a9c 100644
--- a/altoslib/AltosEepromTM.java
+++ b/altoslib/AltosEepromTM.java
@@ -30,16 +30,16 @@ public class AltosEepromTM extends AltosEeprom {
public static final int record_length = 8;
- static double
- thermometer_to_temperature(double thermo)
- {
- return (thermo - 19791.268) / 32728.0 * 1.25 / 0.00247;
- }
-
public void write(PrintStream out) {
out.printf("%c %4x %4x %4x\n", cmd, tick, a, b);
}
+ public int record_length() { return record_length; }
+
+ public String string() {
+ return String.format("%c %4x %4x %4x\n", cmd, tick, a, b);
+ }
+
public void update_state(AltosState state) {
AltosGPS gps;
@@ -77,7 +77,7 @@ public class AltosEepromTM extends AltosEeprom {
break;
case AltosLib.AO_LOG_TEMP_VOLT:
state.set_tick(tick);
- state.set_temperature(thermometer_to_temperature(a));
+ state.set_temperature(AltosConvert.thermometer_to_temperature(a));
state.set_battery_voltage(AltosConvert.cc_battery_to_voltage(b));
break;
case AltosLib.AO_LOG_DEPLOY: