diff options
| author | Keith Packard <keithp@keithp.com> | 2013-04-13 12:13:18 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-04-13 12:13:18 -0700 |
| commit | 3cd8ff18a7546c1e251747ba26240cb130003ef1 (patch) | |
| tree | c02d8b775d91ca828c7cb3092bed363f62c00f99 /altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java | |
| parent | 192bc28fbe2a8613d0b42e4fb3f7674a1a50abc7 (diff) | |
altosdroid: Update UI even if no telem has been received. Center map.
This allows the receiver location to be displayed even when telemetry
is not.
Center the map on the first valid location, either receiver or
rocket. Update center if a significantly more precise location is received.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java')
| -rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java index 5070ec0b..3c168e37 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java @@ -102,35 +102,37 @@ public class TabPad extends Fragment implements AltosDroidTab { } public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver) { - mBatteryVoltageView.setText(String.format("%4.2f V", state.battery)); - mBatteryLights.set(state.battery > 3.7); - - mApogeeVoltageView.setText(String.format("%4.2f V", state.drogue_sense)); - mApogeeLights.set(state.drogue_sense > 3.2); - - mMainVoltageView.setText(String.format("%4.2f V", state.main_sense)); - mMainLights.set(state.main_sense > 3.2); - - if (state.data.flight != 0) { - if (state.data.state <= AltosLib.ao_flight_pad) - mDataLoggingView.setText("Ready to record"); - else if (state.data.state < AltosLib.ao_flight_landed) - mDataLoggingView.setText("Recording data"); - else - mDataLoggingView.setText("Recorded data"); - } else { - mDataLoggingView.setText("Storage full"); - } - mDataLoggingLights.set(state.data.flight != 0); - - if (state.gps != null) { - mGPSLockedView.setText(String.format("%4d sats", state.gps.nsat)); - mGPSLockedLights.set(state.gps.locked && state.gps.nsat >= 4); - if (state.gps_ready) - mGPSReadyView.setText("Ready"); - else - mGPSReadyView.setText(String.format("Waiting %d", state.gps_waiting)); - mGPSReadyLights.set(state.gps_ready); + if (state != null) { + mBatteryVoltageView.setText(String.format("%4.2f V", state.battery)); + mBatteryLights.set(state.battery > 3.7); + + mApogeeVoltageView.setText(String.format("%4.2f V", state.drogue_sense)); + mApogeeLights.set(state.drogue_sense > 3.2); + + mMainVoltageView.setText(String.format("%4.2f V", state.main_sense)); + mMainLights.set(state.main_sense > 3.2); + + if (state.data.flight != 0) { + if (state.data.state <= AltosLib.ao_flight_pad) + mDataLoggingView.setText("Ready to record"); + else if (state.data.state < AltosLib.ao_flight_landed) + mDataLoggingView.setText("Recording data"); + else + mDataLoggingView.setText("Recorded data"); + } else { + mDataLoggingView.setText("Storage full"); + } + mDataLoggingLights.set(state.data.flight != 0); + + if (state.gps != null) { + mGPSLockedView.setText(String.format("%4d sats", state.gps.nsat)); + mGPSLockedLights.set(state.gps.locked && state.gps.nsat >= 4); + if (state.gps_ready) + mGPSReadyView.setText("Ready"); + else + mGPSReadyView.setText(String.format("Waiting %d", state.gps_waiting)); + mGPSReadyLights.set(state.gps_ready); + } } if (receiver != null) { |
