altosui: Add elevation and range data to main display
authorKeith Packard <keithp@keithp.com>
Sun, 5 Sep 2010 08:03:18 +0000 (01:03 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 5 Sep 2010 08:03:18 +0000 (01:03 -0700)
Reported by voice, it's useful to see these on the display as well.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/altosui/AltosUI.java

index 37625e8..6a1814f 100644 (file)
@@ -231,11 +231,19 @@ public class AltosUI extends JFrame {
 
                        if (state.npad > 0) {
                                if (state.from_pad != null) {
-                                       info_add_row(1, "Distance from pad", "%6.0f m", state.from_pad.distance);
-                                       info_add_row(1, "Direction from pad", "%6.0f°", state.from_pad.bearing);
+                                       info_add_row(1, "Distance from pad", "%6d m",
+                                                    (int) (state.from_pad.distance + 0.5));
+                                       info_add_row(1, "Direction from pad", "%6d°",
+                                                    (int) (state.from_pad.bearing + 0.5));
+                                       info_add_row(1, "Elevation from pad", "%6d°",
+                                                    (int) (state.elevation + 0.5));
+                                       info_add_row(1, "Range from pad", "%6d m",
+                                                    (int) (state.range + 0.5));
                                } else {
                                        info_add_row(1, "Distance from pad", "unknown");
                                        info_add_row(1, "Direction from pad", "unknown");
+                                       info_add_row(1, "Elevation from pad", "unknown");
+                                       info_add_row(1, "Range from pad", "unknown");
                                }
                                info_add_deg(1, "Pad latitude", state.pad_lat, 'N', 'S');
                                info_add_deg(1, "Pad longitude", state.pad_lon, 'E', 'W');