mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-19 22:35:15 +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 class="modal__content">
|
||||
<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>
|
||||
|
||||
|
|
|
@ -199,27 +199,36 @@ TABS.calibration.initialize = function (callback) {
|
|||
|
||||
$(button).addClass('disabled');
|
||||
|
||||
modalProcessing = new jBox('Modal', {
|
||||
let modalProcessing = new jBox('Modal', {
|
||||
width: 400,
|
||||
height: 100,
|
||||
animation: false,
|
||||
closeOnClick: false,
|
||||
closeOnEsc: false,
|
||||
content: $('#modal-compass-processing')
|
||||
content: $('#modal-compass-processing').clone()
|
||||
}).open();
|
||||
|
||||
var countdown = 30;
|
||||
helper.interval.add('compass_calibration_interval', function () {
|
||||
countdown--;
|
||||
$('#modal-compass-countdown').text(countdown);
|
||||
if (countdown === 0) {
|
||||
setTimeout(function () {
|
||||
$(button).removeClass('disabled');
|
||||
|
||||
modalProcessing.close();
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupMagCalibEnded'));
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue