mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-20 14:55:14 +03:00
Merge pull request #992 from iNavFlight/dzikuvx-compass-calibration-improvements
Compass calibration improvements
This commit is contained in:
commit
22aa1884b8
2 changed files with 18 additions and 9 deletions
|
@ -168,7 +168,7 @@
|
||||||
<div id="modal-compass-processing" class="is-hidden">
|
<div id="modal-compass-processing" class="is-hidden">
|
||||||
<div class="modal__content">
|
<div class="modal__content">
|
||||||
<h1 class="modal__title modal__title--center" data-i18n="accCalibrationProcessing"></h1>
|
<h1 class="modal__title modal__title--center" data-i18n="accCalibrationProcessing"></h1>
|
||||||
<div id="modal-compass-countdown" class="modal__text"></div>
|
<div class="modal-compass-countdown modal__text"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -199,27 +199,36 @@ TABS.calibration.initialize = function (callback) {
|
||||||
|
|
||||||
$(button).addClass('disabled');
|
$(button).addClass('disabled');
|
||||||
|
|
||||||
modalProcessing = new jBox('Modal', {
|
let modalProcessing = new jBox('Modal', {
|
||||||
width: 400,
|
width: 400,
|
||||||
height: 100,
|
height: 100,
|
||||||
animation: false,
|
animation: false,
|
||||||
closeOnClick: false,
|
closeOnClick: false,
|
||||||
closeOnEsc: false,
|
closeOnEsc: false,
|
||||||
content: $('#modal-compass-processing')
|
content: $('#modal-compass-processing').clone()
|
||||||
}).open();
|
}).open();
|
||||||
|
|
||||||
var countdown = 30;
|
var countdown = 30;
|
||||||
helper.interval.add('compass_calibration_interval', function () {
|
helper.interval.add('compass_calibration_interval', function () {
|
||||||
countdown--;
|
countdown--;
|
||||||
$('#modal-compass-countdown').text(countdown);
|
|
||||||
if (countdown === 0) {
|
if (countdown === 0) {
|
||||||
$(button).removeClass('disabled');
|
setTimeout(function () {
|
||||||
|
$(button).removeClass('disabled');
|
||||||
|
|
||||||
modalProcessing.close();
|
modalProcessing.close();
|
||||||
GUI.log(chrome.i18n.getMessage('initialSetupMagCalibEnded'));
|
GUI.log(chrome.i18n.getMessage('initialSetupMagCalibEnded'));
|
||||||
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, updateSensorData);
|
|
||||||
helper.interval.remove('compass_calibration_interval');
|
MSP.send_message(MSPCodes.MSP_CALIBRATION_DATA, false, false, updateSensorData);
|
||||||
|
helper.interval.remove('compass_calibration_interval');
|
||||||
|
|
||||||
|
//Cleanup
|
||||||
|
delete modalProcessing;
|
||||||
|
$('.jBox-wrapper').remove();
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
modalProcessing.content.find('.modal-compass-countdown').text(countdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue