1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

Activate groundstation when MSP switches to LTM

This commit is contained in:
Pawel Spychalski (DzikuVx) 2024-04-22 22:42:43 +02:00
parent eae4e132e5
commit 5d39267768
7 changed files with 13 additions and 6 deletions

View file

@ -93,7 +93,7 @@ GUI_control.prototype.log = function (message) {
GUI_control.prototype.tab_switch_cleanup = function (callback) {
MSP.callbacks_cleanup(); // we don't care about any old data that might or might not arrive
helper.interval.killAll(['global_data_refresh', 'msp-load-update']);
helper.interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
helper.mspBalancedInterval.flush();
if (this.active_tab) {

View file

@ -113,6 +113,8 @@ helper.interval = (function () {
publicScope.killAll = function (keep_array) {
var timers_killed = 0;
console.log('Killing all intervals except: ' + keep_array);
for (var i = (privateScope.intervals.length - 1); i >= 0; i--) { // reverse iteration
var keep = false;
if (keep_array) { // only run through the array if it exists
@ -133,5 +135,9 @@ helper.interval = (function () {
return timers_killed;
};
publicScope.list = function () {
return privateScope.intervals;
};
return publicScope;
})();

View file

@ -177,7 +177,7 @@ $(document).ready(function () {
var wasConnected = CONFIGURATOR.connectionValid;
helper.timeout.killAll();
helper.interval.killAll(['global_data_refresh', 'msp-load-update']);
helper.interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
helper.mspBalancedInterval.flush();
if (CONFIGURATOR.cliActive) {
@ -347,6 +347,7 @@ function onOpen(openInfo) {
//Add a timer that every 1s will check if LTM stream is receiving data and display alert if so
helper.interval.add('ltm-connection-check', function () {
console.log('Interval check');
if (helper.ltmDecoder.isReceiving()) {
helper.groundstation.activate($('#main-wrapper'));
}

View file

@ -746,7 +746,7 @@ TABS.firmware_flasher.onValidFirmware = function() {
TABS.firmware_flasher.closeTempConnection = function() {
helper.timeout.killAll();
helper.interval.killAll(['global_data_refresh', 'msp-load-update']);
helper.interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
helper.mspBalancedInterval.flush();
helper.mspQueue.flush();

View file

@ -91,7 +91,7 @@ TABS.logging.initialize = function (callback) {
GUI.log(chrome.i18n.getMessage('loggingErrorOneProperty'));
}
} else {
helper.interval.killAll(['global_data_refresh', 'msp-load-update']);
helper.interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
helper.mspBalancedInterval.flush();
$('.speed').prop('disabled', false);

View file

@ -413,7 +413,7 @@ TABS.outputs.initialize = function (callback) {
$voltageHelper = $(".current-voltage");
// timer initialization
helper.interval.killAll(['motor_and_status_pull', 'global_data_refresh', 'msp-load-update']);
helper.interval.killAll(['motor_and_status_pull', 'global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
helper.mspBalancedInterval.flush();
helper.interval.add('IMU_pull', function () {

View file

@ -420,7 +420,7 @@ TABS.sensors.initialize = function (callback) {
});
// timer initialization
helper.interval.killAll(['status_pull', 'global_data_refresh', 'msp-load-update']);
helper.interval.killAll(['status_pull', 'global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
// data pulling timers
if (checkboxes[0] || checkboxes[1] || checkboxes[2]) {