X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTabAscent.java;h=c146c27746d274dbde683582fff5dc9ee56064fa;hp=0e141ae47e942e2983333a1ef526c79b67b13c2d;hb=2b2ebd2fee46158abd1ae050cd6d1040ead849a0;hpb=ff332e640b27c6be37dabef58ebac350ac2347b2 diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java index 0e141ae4..c146c277 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java @@ -17,7 +17,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_1.*; +import org.altusmetrum.altoslib_5.*; import android.app.Activity; import android.os.Bundle; @@ -29,7 +29,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.location.Location; -public class TabAscent extends Fragment implements AltosDroidTab { +public class TabAscent extends AltosDroidTab { AltosDroid mAltosDroid; private TextView mHeightView; @@ -85,14 +85,18 @@ public class TabAscent extends Fragment implements AltosDroidTab { mAltosDroid = null; } - public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver) { + public String tab_name() { + return "ascent"; + } + + public void show(AltosState state, AltosGreatCircle from_receiver, Location receiver) { if (state != null) { - mHeightView.setText(AltosDroid.number("%6.0f m", state.height)); - mMaxHeightView.setText(AltosDroid.number("%6.0f m", state.max_height)); + mHeightView.setText(AltosDroid.number("%6.0f m", state.height())); + mMaxHeightView.setText(AltosDroid.number("%6.0f m", state.max_height())); mSpeedView.setText(AltosDroid.number("%6.0f m/s", state.speed())); mMaxSpeedView.setText(AltosDroid.number("%6.0f m/s", state.max_speed())); - mAccelView.setText(AltosDroid.number("%6.0f m/s²", state.acceleration)); - mMaxAccelView.setText(AltosDroid.number("%6.0f m/s²", state.max_acceleration)); + mAccelView.setText(AltosDroid.number("%6.0f m/s²", state.acceleration())); + mMaxAccelView.setText(AltosDroid.number("%6.0f m/s²", state.max_acceleration())); if (state.gps != null) { mLatitudeView.setText(AltosDroid.pos(state.gps.lat, "N", "S")); @@ -102,11 +106,11 @@ public class TabAscent extends Fragment implements AltosDroidTab { mLongitudeView.setText(""); } - mApogeeVoltageView.setText(AltosDroid.number("%4.2f V", state.drogue_sense)); - mApogeeLights.set(state.drogue_sense > 3.2, state.drogue_sense == AltosRecord.MISSING); + mApogeeVoltageView.setText(AltosDroid.number("%4.2f V", state.apogee_voltage)); + mApogeeLights.set(state.apogee_voltage > 3.2, state.apogee_voltage == AltosLib.MISSING); - mMainVoltageView.setText(AltosDroid.number("%4.2f V", state.main_sense)); - mMainLights.set(state.main_sense > 3.2, state.main_sense == AltosRecord.MISSING); + mMainVoltageView.setText(AltosDroid.number("%4.2f V", state.main_voltage)); + mMainLights.set(state.main_voltage > 3.2, state.main_voltage == AltosLib.MISSING); } } }