summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
Diffstat (limited to 'altosui')
-rw-r--r--altosui/Altos.java2
-rw-r--r--altosui/AltosDataPoint.java1
-rw-r--r--altosui/AltosDataPointReader.java1
-rw-r--r--altosui/AltosEepromDownload.java8
-rw-r--r--altosui/AltosEepromIterable.java9
-rw-r--r--altosui/AltosGraphUI.java2
6 files changed, 16 insertions, 7 deletions
diff --git a/altosui/Altos.java b/altosui/Altos.java
index a087f73a..6a2d9b9b 100644
--- a/altosui/Altos.java
+++ b/altosui/Altos.java
@@ -36,7 +36,7 @@ public class Altos {
static final int AO_LOG_GPS_ALT = 'H';
static final int AO_LOG_GPS_SAT = 'V';
static final int AO_LOG_GPS_DATE = 'Y';
- static final int AO_LOG_HEIGHT = 'h';
+ static final int AO_LOG_PRESSURE = 'P';
/* Added for header fields in eeprom files */
static final int AO_LOG_CONFIG_VERSION = 1000;
diff --git a/altosui/AltosDataPoint.java b/altosui/AltosDataPoint.java
index 66313e03..5e077320 100644
--- a/altosui/AltosDataPoint.java
+++ b/altosui/AltosDataPoint.java
@@ -25,5 +25,6 @@ interface AltosDataPoint {
double battery_voltage();
double drogue_voltage();
double main_voltage();
+ boolean has_accel();
}
diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java
index 4335421c..fa48013f 100644
--- a/altosui/AltosDataPointReader.java
+++ b/altosui/AltosDataPointReader.java
@@ -59,6 +59,7 @@ class AltosDataPointReader implements Iterable<AltosDataPoint> {
public double battery_voltage() { return record.battery_voltage(); }
public double drogue_voltage() { return record.drogue_voltage(); }
public double main_voltage() { return record.main_voltage(); }
+ public boolean has_accel() { return has_accel; }
};
}
diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java
index 5c704968..82f01ef5 100644
--- a/altosui/AltosEepromDownload.java
+++ b/altosui/AltosEepromDownload.java
@@ -155,15 +155,17 @@ public class AltosEepromDownload implements Runnable {
int s = v ^ 0x8000;
if (Altos.ao_flight_startup <= s && s <= Altos.ao_flight_invalid) {
- r = new AltosEepromRecord(Altos.AO_LOG_STATE, tiny_tick, s, 0);
- if (s == Altos.ao_flight_landed)
+ state = s;
+ r = new AltosEepromRecord(Altos.AO_LOG_STATE, tiny_tick, state, 0);
+ if (state == Altos.ao_flight_landed)
done = true;
state = s;
any_valid = true;
} else {
if (v != 0xffff)
any_valid = true;
- r = new AltosEepromRecord(Altos.AO_LOG_HEIGHT, tiny_tick, v, 0);
+
+ r = new AltosEepromRecord(Altos.AO_LOG_PRESSURE, tiny_tick, 0, v);
/*
* The flight software records ascent data every 100ms, and descent
diff --git a/altosui/AltosEepromIterable.java b/altosui/AltosEepromIterable.java
index 624e1dd3..16349b88 100644
--- a/altosui/AltosEepromIterable.java
+++ b/altosui/AltosEepromIterable.java
@@ -134,8 +134,13 @@ public class AltosEepromIterable extends AltosRecordIterable {
eeprom.seen |= seen_sensor;
has_accel = true;
break;
- case Altos.AO_LOG_HEIGHT:
- state.height = (short) record.a;
+ case Altos.AO_LOG_PRESSURE:
+ state.pres = record.b;
+ state.flight_pres = state.pres;
+ if (eeprom.n_pad_samples == 0) {
+ eeprom.n_pad_samples++;
+ state.ground_pres = state.pres;
+ }
eeprom.seen |= seen_sensor;
break;
case Altos.AO_LOG_TEMP_VOLT:
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java
index e98c302b..4b994b47 100644
--- a/altosui/AltosGraphUI.java
+++ b/altosui/AltosGraphUI.java
@@ -35,7 +35,7 @@ public class AltosGraphUI extends JFrame
AltosGraphTime.Element speed =
new AltosGraphTime.TimeSeries("Speed (m/s)", "Vertical Speed", green) {
public void gotTimeData(double time, AltosDataPoint d) {
- if (d.state() < Altos.ao_flight_drogue) {
+ if (d.state() < Altos.ao_flight_drogue && d.has_accel()) {
series.add(time, d.accel_speed());
} else {
series.add(time, d.baro_speed());