Make sure G Meter resets fully on power-up.

pull/578/head
Eric Westphal 2017-03-11 19:39:49 -05:00
rodzic d625f50446
commit 571bec5a57
2 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -163,6 +163,9 @@ function gMeterRenderer(locationId, plim, nlim) {
.addClass('marks')
.style('fill-opacity', '0');
this.min_el = gMeter.group().addClass('min');
this.min_el.polygon('0,0 -170,0 -160,-5 0,-5').addClass('pointer');
this.min_el.polygon('0,0 -170,0 -160,+5 0,+5').addClass('pointerBG');
this.pointer_el = gMeter.group().addClass('g');
this.pointer_el.polygon('0,0 -170,0 -150,-10 0,-10').addClass('pointer');
@ -172,10 +175,6 @@ function gMeterRenderer(locationId, plim, nlim) {
this.max_el.polygon('0,0 -170,0 -150,-5 0,-5').addClass('pointer');
this.max_el.polygon('0,0 -170,0 -150,+5 0,+5').addClass('pointerBG');
this.min_el = gMeter.group().addClass('min');
this.min_el.polygon('0,0 -170,0 -160,-5 0,-5').addClass('pointer');
this.min_el.polygon('0,0 -170,0 -160,+5 0,+5').addClass('pointerBG');
gMeter.circle(40).cx(0).cy(0).addClass('center');
var reset = gMeter.group().cx(-165).cy(165).addClass('reset');
@ -214,7 +213,8 @@ gMeterRenderer.prototype = {
},
reset: function() {
this.max = this.g;
this.min = this.g;
this.g = 1;
this.max = 1;
this.min = 1;
}
};

Wyświetl plik

@ -132,6 +132,9 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
statusGPS.classList.remove("on");
}
if (status.AHRSStatus & 0x02) {
if (statusIMU.classList.contains("off")) {
setTimeout(gMeter.reset(), 1000);
}
statusIMU.classList.remove("off");
statusIMU.classList.add("on");
} else {