X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosDescent.java;h=d6de8b980ae9d94ce97c22a20071502cf3374123;hp=379946e1e1c644439a8953a91423dbe5485e976f;hb=b47517d4c2e49f6f7b9954d2c85f96397fe1103e;hpb=89f44c5587ea4f927d5e398b6af919df0d6561c3 diff --git a/ao-tools/altosui/AltosDescent.java b/ao-tools/altosui/AltosDescent.java index 379946e1..d6de8b98 100644 --- a/ao-tools/altosui/AltosDescent.java +++ b/ao-tools/altosui/AltosDescent.java @@ -69,7 +69,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { value.setFont(Altos.value_font); value.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = 2; c.gridy = y; - c.gridwidth = 2; + c.gridwidth = 2; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.BOTH; c.weightx = 1; @@ -112,7 +112,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { value.setFont(Altos.value_font); value.setHorizontalAlignment(SwingConstants.RIGHT); c.gridx = x + 2; c.gridy = y; - c.gridwidth = 2; + c.gridwidth = 2; c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.BOTH; c.weightx = 1; @@ -133,9 +133,9 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { abstract void show(AltosState state, int crc_errors); void show(String v1, String v2) { - value1.setText(v1); - value2.setText(v2); - } + value1.setText(v1); + value2.setText(v2); + } void show(String f1, double v1, String f2, double v2) { value1.setText(String.format(f1, v1)); value2.setText(String.format(f2, v2)); @@ -178,13 +178,12 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { } } - class Height extends DescentDualValue { + class Height extends DescentValue { void show (AltosState state, int crc_errors) { - show("%6.0f m", state.height, - "%3.0f°", state.elevation); + show("%6.0f m", state.height); } public Height (GridBagLayout layout, int x, int y) { - super (layout, x, y, "Height/Elevation"); + super (layout, x, y, "Height"); } } @@ -218,13 +217,13 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class LatLon extends DescentDualValue { void show (AltosState state, int crc_errors) { if (state.gps != null) - show(pos(state.gps.lat,"N", "S"), - pos(state.gps.lon,"W", "E")); + show(pos(state.gps.lat,"N", "S"), + pos(state.gps.lon,"W", "E")); else show("???", "???"); } public LatLon (GridBagLayout layout, int x, int y) { - super (layout, x, y, "Lat/Long"); + super (layout, x, y, "Latitude, Longitude"); } } @@ -257,26 +256,27 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { class Bearing extends DescentDualValue { void show (AltosState state, int crc_errors) { if (state.from_pad != null) { - show( state.from_pad.bearing_words( - AltosGreatCircle.BEARING_LONG), - String.format("%3.0f°", state.from_pad.bearing)); + show( String.format("%3.0f°", state.from_pad.bearing), + state.from_pad.bearing_words( + AltosGreatCircle.BEARING_LONG)); } else { show("???", "???"); } } public Bearing (GridBagLayout layout, int x, int y) { super (layout, x, y, "Bearing"); - } + } } Bearing bearing; - class Range extends DescentValue { + class Range extends DescentDualValue { void show (AltosState state, int crc_errors) { - show("%6.0f m", state.range); + show("%6.0f m", state.range, + "%3.0f°", state.elevation); } public Range (GridBagLayout layout, int x, int y) { - super (layout, x, y, "Range"); + super (layout, x, y, "Range, Elevation"); } } @@ -308,11 +308,11 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay { setLayout(layout); /* Elements in descent display */ - speed = new Speed(layout, 0, 0); - height = new Height(layout, 0, 1); - range = new Range(layout, 0, 2); - bearing = new Bearing(layout, 0, 3); - latlon = new LatLon(layout, 0, 4); + speed = new Speed(layout, 0, 0); + height = new Height(layout, 0, 1); + range = new Range(layout, 0, 2); + bearing = new Bearing(layout, 0, 3); + latlon = new LatLon(layout, 0, 4); apogee = new Apogee(layout, 5); main = new Main(layout, 6);