X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTabLanded.java;h=32c235e1b627dfbb0a2dbc48f94034cf2b94550c;hb=bc3fbcb35090be3856284ccf4d908ebf39d02bec;hp=5a70397825a47a969f391bd45c51e924bcc73ecf;hpb=b89fb51a963635e2effe3a31f803bfc29c2c46b7;p=fw%2Faltos diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java index 5a703978..32c235e1 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java @@ -17,7 +17,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_3.*; +import org.altusmetrum.altoslib_5.*; import android.app.Activity; import android.os.Bundle; @@ -28,7 +28,7 @@ import android.view.ViewGroup; import android.widget.TextView; import android.location.Location; -public class TabLanded extends Fragment implements AltosDroidTab { +public class TabLanded extends AltosDroidTab { AltosDroid mAltosDroid; private TextView mBearingView; @@ -73,7 +73,9 @@ public class TabLanded extends Fragment implements AltosDroidTab { mAltosDroid = null; } - public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver) { + public String tab_name() { return "landed"; } + + public void show(AltosState state, AltosGreatCircle from_receiver, Location receiver) { if (from_receiver != null) { mBearingView.setText(String.format("%3.0f°", from_receiver.bearing)); mDistanceView.setText(String.format("%6.0f m", from_receiver.distance)); @@ -87,12 +89,14 @@ public class TabLanded extends Fragment implements AltosDroidTab { mReceiverLatitudeView.setText(AltosDroid.pos(receiver.getLatitude(), "N", "S")); mReceiverLongitudeView.setText(AltosDroid.pos(receiver.getLongitude(), "W", "E")); } - + if (state != null) { mMaxHeightView.setText(String.format("%6.0f m", state.max_height())); - mMaxAccelView.setText(String.format("%6.0f m/s²", state.max_acceleration())); + if (state.max_acceleration() != AltosLib.MISSING) + mMaxAccelView.setText(String.format("%6.0f m/s²", state.max_acceleration())); + else + mMaxAccelView.setText("missing"); mMaxSpeedView.setText(String.format("%6.0f m/s", state.max_speed())); } } - }