X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosAscent.java;h=a158eb214d92ec33b4bec9c3597b5fb5f3c1630d;hb=2441090f26c3df66a6ce48d64e64384ce9e5ef82;hp=38b3b30fe8cec9ee6ccd79306b0696fd5add6cc9;hpb=3c2f601139d36761de6a8a2210545d082ef16133;p=fw%2Faltos diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index 38b3b30f..a158eb21 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -169,14 +169,14 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { max_value.setFont(Altos.value_font); } - void show(String format, double v) { + void show(AltosUnits units, double v) { if (v == AltosRecord.MISSING) { value.setText("Missing"); max_value.setText("Missing"); } else { - value.setText(String.format(format, v)); + value.setText(units.show(8, v)); if (v > max || max == AltosRecord.MISSING) { - max_value.setText(String.format(format, v)); + max_value.setText(units.show(8, v)); max = v; } } @@ -221,7 +221,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Height extends AscentValueHold { void show (AltosState state, int crc_errors) { - show("%6.0f m", state.height); + show(AltosConvert.height, state.height); } public Height (GridBagLayout layout, int y) { super (layout, y, "Height"); @@ -235,7 +235,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { double speed = state.speed; if (!state.ascent) speed = state.baro_speed; - show("%6.0f m/s", speed); + show(AltosConvert.speed, speed); } public Speed (GridBagLayout layout, int y) { super (layout, y, "Speed"); @@ -246,7 +246,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Accel extends AscentValueHold { void show (AltosState state, int crc_errors) { - show("%6.0f m/s²", state.acceleration); + show(AltosConvert.accel, state.acceleration); } public Accel (GridBagLayout layout, int y) { super (layout, y, "Acceleration");