Don't show AHRS info when it's invalid.

pull/610/head
Eric Westphal 2017-05-29 15:50:54 -04:00
rodzic fcc9322a57
commit 22ad90fb8a
1 zmienionych plików z 13 dodań i 14 usunięć

Wyświetl plik

@ -116,11 +116,22 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
$scope.SolutionText = solutionText;
$scope.gps_horizontal_accuracy = situation.GPSHorizontalAccuracy.toFixed(1);
if ($scope.gps_horizontal_accuracy > 99999) {
if ($scope.gps_horizontal_accuracy > 19999) {
$scope.gps_horizontal_accuracy = "\u221e";
$scope.gps_lat = "--";
$scope.gps_lon = "--";
$scope.gps_alt = "--";
$scope.gps_track = "--";
$scope.gps_speed = "--";
$scope.gps_vert_speed = "--";
$scope.map_opacity = 0.2;
$scope.map_mark_opacity = 0;
} else {
$scope.map_opacity = 1;
$scope.map_mark_opacity = 1;
}
$scope.gps_vertical_accuracy = (situation.GPSVerticalAccuracy*3.2808).toFixed(1); // accuracy is in meters, need to display in ft
if ($scope.gps_vertical_accuracy > 99999) {
if ($scope.gps_vertical_accuracy > 9999) {
$scope.gps_vertical_accuracy = "\u221e";
}
@ -212,21 +223,9 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
if (situation.AHRSStatus & 0x01) {
statusGPS.classList.remove("off");
statusGPS.classList.add("on");
$scope.map_opacity = 1;
$scope.map_mark_opacity = 1;
} else {
statusGPS.classList.add("off");
statusGPS.classList.remove("on");
$scope.gps_lat = "--";
$scope.gps_lon = "--";
$scope.gps_alt = "--";
$scope.gps_track = "--";
$scope.gps_speed = "--";
$scope.gps_vert_speed = "--";
$scope.gps_horizontal_accuracy = "\u221e";
$scope.gps_vertical_accuracy = "\u221e";
$scope.map_opacity = 0.2;
$scope.map_mark_opacity = 0;
}
if (situation.AHRSStatus & 0x02) {
statusIMU.classList.remove("off");