X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTabLanded.java;h=d37891f793aff866e2c0130652044ac8c92929aa;hp=f42b46b55520d7fbf8551e676ddda47dfebafe41;hb=4315b91d7afc2391e3f7444906ac226500bf1345;hpb=3cd8ff18a7546c1e251747ba26240cb130003ef1 diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java index f42b46b5..d37891f7 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_1.*; +import org.altusmetrum.altoslib_7.*; 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,26 +73,27 @@ 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)); + set_value(mDistanceView, AltosConvert.distance, 6, from_receiver.distance); } if (state != null && state.gps != null) { mTargetLatitudeView.setText(AltosDroid.pos(state.gps.lat, "N", "S")); - mTargetLongitudeView.setText(AltosDroid.pos(state.gps.lon, "W", "E")); + mTargetLongitudeView.setText(AltosDroid.pos(state.gps.lon, "E", "W")); } if (receiver != null) { mReceiverLatitudeView.setText(AltosDroid.pos(receiver.getLatitude(), "N", "S")); - mReceiverLongitudeView.setText(AltosDroid.pos(receiver.getLongitude(), "W", "E")); + mReceiverLongitudeView.setText(AltosDroid.pos(receiver.getLongitude(), "E", "W")); } - + if (state != null) { - mMaxHeightView.setText(String.format("%6.0f m", state.max_height)); - mMaxAccelView.setText(String.format("%6.0f m/s²", state.max_acceleration)); - mMaxSpeedView.setText(String.format("%6.0f m/s", state.max_speed())); + set_value(mMaxHeightView, AltosConvert.height, 6, state.max_height()); + set_value(mMaxAccelView, AltosConvert.accel, 6, state.max_acceleration()); + set_value(mMaxSpeedView, AltosConvert.speed, 6, state.max_speed()); } } - }