kopia lustrzana https://github.com/cyoung/stratux
Add Gyro Calibration button to AHRS page in web UI
rodzic
b42350f1cf
commit
de865c6961
|
@ -1,32 +1,4 @@
|
|||
<div class="col-sm-12">
|
||||
<div class="col-sm-6 hider">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><span class="panel_label">GPS</span></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<span class="col-xs-12">
|
||||
<div class="map-container">
|
||||
<div id="map_display" class="world-map" ng-attr-style="background-position:{{map_pos_x + 'px ' + map_pos_y + 'px'}}; width:{{map_width}}px; height:{{map_height}}px; opacity:{{map_opacity}};">
|
||||
<div class="mark-position" ng-style="{left: map_mark_x+'px', top: map_mark_y+'px', opacity: map_mark_opacity}">
|
||||
<span class="fa fa-crosshairs"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
<div class="row">
|
||||
<strong class="col-xs-6 text-center">Location:</strong>
|
||||
<strong class="col-xs-6 text-center">Track:</strong>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="col-xs-6 text-center">{{gps_lat}}, {{gps_lon}} ± {{gps_horizontal_accuracy}} m <br>
|
||||
{{gps_alt}} ± {{gps_vertical_accuracy}} ft @ {{gps_vert_speed}} ft/min</span>
|
||||
<span class="col-xs-6 text-center">{{gps_track}}° @ {{gps_speed}} KTS</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><span ng-click="hideClick()" class="panel_label">AHRS</span></div>
|
||||
|
@ -48,7 +20,10 @@
|
|||
<div class="col-xs-12">
|
||||
<div class="separator"></div>
|
||||
<div class="col-xs-3">
|
||||
<a ng-click="AHRSCage()" class="btn btn-primary" ng-disabled="IsCaging()">Reset /<br>Level</a>
|
||||
<button class="btn btn-primary btn-block" ng-click="AHRSCage()"
|
||||
ng-disabled="IsCaging || !IMU_Sensor_Enabled">Set Level</button>
|
||||
<button class="btn btn-primary btn-block" ng-click="AHRSCalibrate()"
|
||||
ng-disabled="IsCaging || !IMU_Sensor_Enabled">Zero Drift</button>
|
||||
</div>
|
||||
<div class="col-xs-9">
|
||||
<div class="row">
|
||||
|
@ -80,6 +55,34 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 hider">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><span class="panel_label">GPS</span></div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<span class="col-xs-12">
|
||||
<div class="map-container">
|
||||
<div id="map_display" class="world-map" ng-attr-style="background-position:{{map_pos_x + 'px ' + map_pos_y + 'px'}}; width:{{map_width}}px; height:{{map_height}}px; opacity:{{map_opacity}};">
|
||||
<div class="mark-position" ng-style="{left: map_mark_x+'px', top: map_mark_y+'px', opacity: map_mark_opacity}">
|
||||
<span class="fa fa-crosshairs"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
<div class="row">
|
||||
<strong class="col-xs-6 text-center">Location:</strong>
|
||||
<strong class="col-xs-6 text-center">Track:</strong>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="col-xs-6 text-center">{{gps_lat}}, {{gps_lon}} ± {{gps_horizontal_accuracy}} m <br>
|
||||
{{gps_alt}} ± {{gps_vertical_accuracy}} ft @ {{gps_vert_speed}} ft/min</span>
|
||||
<span class="col-xs-6 text-center">{{gps_track}}° @ {{gps_speed}} KTS</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-6 hider">
|
||||
|
|
|
@ -255,10 +255,12 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
statusCal.classList.add("blink");
|
||||
statusCal.classList.remove("on");
|
||||
statusCal.innerText = "Caging";
|
||||
$scope.IsCaging = true;
|
||||
} else {
|
||||
statusCal.classList.remove("blink");
|
||||
statusCal.classList.add("on");
|
||||
statusCal.innerText = "Ready";
|
||||
$scope.IsCaging = false;
|
||||
}
|
||||
if (situation.AHRSStatus & 0x10) {
|
||||
statusLog.classList.remove("off");
|
||||
|
@ -269,10 +271,10 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
}
|
||||
|
||||
msg_ix = ahrs.messages.indexOf(MSG_LEVELING[0]);
|
||||
if (statusCal.innerText === "Caging" && msg_ix < 0) {
|
||||
if ($scope.IsCaging && msg_ix < 0) {
|
||||
ahrs.messages = ahrs.messages.concat(MSG_LEVELING);
|
||||
ahrs.turn_off();
|
||||
} else if (statusCal.innerText !== "Caging" && msg_ix >= 0) {
|
||||
} else if (!$scope.IsCaging && msg_ix >= 0) {
|
||||
ahrs.messages.splice(msg_ix, MSG_LEVELING.length);
|
||||
ahrs.turn_on();
|
||||
}
|
||||
|
@ -379,11 +381,25 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
};
|
||||
|
||||
$scope.AHRSCage = function() {
|
||||
if (statusCal.innerText !== "Caging") {
|
||||
if (!$scope.IsCaging) {
|
||||
$http.post(URL_AHRS_CAGE).then(function (response) {
|
||||
// do nothing
|
||||
}, function (response) {
|
||||
// do nothing
|
||||
ahrs.messages = ahrs.messages.concat(response.data);
|
||||
window.setTimeout(function() {
|
||||
ahrs.messages.splice(ahrs.messages.indexOf(response.data), 1);
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.AHRSCalibrate = function() {
|
||||
if (!$scope.IsCaging) {
|
||||
$http.post(URL_AHRS_CAL).then(function (response) {
|
||||
}, function (response) {
|
||||
ahrs.messages = ahrs.messages.concat(response.data);
|
||||
window.setTimeout(function() {
|
||||
ahrs.messages.splice(ahrs.messages.indexOf(response.data), 1);
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -401,6 +417,7 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
$http.get(URL_SETTINGS_GET).
|
||||
then(function (response) {
|
||||
settings = angular.fromJson(response.data);
|
||||
$scope.IMU_Sensor_Enabled = settings.IMU_Sensor_Enabled;
|
||||
if (settings.GLimits === "" || settings.GLimits === undefined) {
|
||||
settings.GLimits = "-1.76 4.4";
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue