altosdroid: Add imperial unit support
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / TabLanded.java
index 32c235e1b627dfbb0a2dbc48f94034cf2b94550c..b257b9365d652c51fc67a3db2676138bb1fe53c6 100644 (file)
@@ -78,7 +78,7 @@ public class TabLanded extends AltosDroidTab {
        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"));
@@ -91,12 +91,9 @@ public class TabLanded extends AltosDroidTab {
                }
 
                if (state != null) {
-                       mMaxHeightView.setText(String.format("%6.0f m", state.max_height()));
-                       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()));
+                       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());
                }
        }
 }