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