Update settings display on web UI after orientation.

pull/641/head
Eric Westphal 2017-06-28 19:09:45 -04:00
rodzic 2a132bb9cc
commit d854fb01be
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -156,7 +156,7 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
newsettings = {
"GLimits": settings["GLimits"]
};
console.log(angular.toJson(newsettings));
// console.log(angular.toJson(newsettings));
setSettings(angular.toJson(newsettings));
}
};
@ -228,13 +228,14 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
};
$scope.setOrientation = function(action) {
console.log("sending " + action + " message.");
// console.log("sending " + action + " message.");
$http.post(URL_AHRS_ORIENT, action).
then(function (response) {
console.log("sent " + action + " message.");
// console.log("sent " + action + " message.");
setTimeout(getSettings, 5000); // Sleep to allow leveling to finish.
}, function(response) {
// failure: cancel the calibration
console.log(response.data);
// console.log(response.data);
$scope.Orientation_Failure_Message = response.data;
switch (action) {
case "forward":
@ -246,4 +247,4 @@ function SettingsCtrl($rootScope, $scope, $state, $location, $window, $http) {
$scope.Ui.turnOn("modalCalibrateFailed");
});
};
}
}