altoslib: BMX160 driver now returns µT values for mag sensor
[fw/altos] / altosuilib / AltosInfoTable.java
index 09e497a5ec01a049ea5d54251bf24d14e840053e..72d4fb56275e423b1bb16a23c8ddf7b5f6840c3a 100644 (file)
@@ -201,9 +201,9 @@ public class AltosInfoTable extends JTable implements AltosFlightDisplay, Hierar
                                if (state.gps.lon != AltosLib.MISSING)
                                        info_add_deg(1, "Longitude", state.gps.lon, 'E', 'W');
                                if (state.gps.alt != AltosLib.MISSING)
-                                       info_add_row(1, "GPS altitude", "%8.1f", state.gps.alt);
+                                       info_add_row(1, "GPS altitude", "%8.1f m", state.gps.alt);
                                if (state.gps_height != AltosLib.MISSING)
-                                       info_add_row(1, "GPS height", "%8.1f", state.gps_height);
+                                       info_add_row(1, "GPS height", "%8.1f m", state.gps_height);
 
                                if (state.gps.ground_speed != AltosLib.MISSING && state.gps.course != AltosLib.MISSING)
                                        info_add_row(1, "GPS ground speed", "%6.1f m/s %3d°",
@@ -280,9 +280,10 @@ public class AltosInfoTable extends JTable implements AltosFlightDisplay, Hierar
                        info_add_row(3, "Gyro yaw", "%8.1f °/s", state.gyro_yaw());
                        if (state.mag_along() != AltosLib.MISSING) {
                                /* Report mag in nanoteslas (1 G = 100000 nT (or γ)) */
-                               info_add_row(3, "Mag along", "%8.1f γ", state.mag_along() * 100000.0);
-                               info_add_row(3, "Mag across", "%8.1f γ", state.mag_across() * 100000.0);
-                               info_add_row(3, "Mag Through", "%8.1f γ", state.mag_through() * 100000.0);
+                               info_add_row(3, "Mag along", "%8.1f µT", state.mag_along() * 100.0);
+                               info_add_row(3, "Mag across", "%8.1f µT", state.mag_across() * 100.0);
+                               info_add_row(3, "Mag Through", "%8.1f µT", state.mag_through() * 100.0);
+                               info_add_row(3, "Mag Bearing", "%8.1f°", Math.atan2(state.mag_across(), state.mag_through()) * 180/Math.PI);
                        }
                }