1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 08:45:26 +03:00

Activate / deactivate groundstation mode

This commit is contained in:
Pawel Spychalski (DzikuVx) 2024-03-07 21:03:45 +01:00
parent c7b924e67b
commit 1f718efe07
2 changed files with 22 additions and 4 deletions

View file

@ -8,6 +8,7 @@ helper.groundstation = (function () {
privateScope = {}; privateScope = {};
privateScope.activated = false; privateScope.activated = false;
privateScope.$viewport = null;
privateScope.$gsViewport = null; privateScope.$gsViewport = null;
publicScope.isActivated = function () { publicScope.isActivated = function () {
@ -22,12 +23,14 @@ helper.groundstation = (function () {
helper.interval.add('gsUpdateGui', privateScope.updateGui, 200); helper.interval.add('gsUpdateGui', privateScope.updateGui, 200);
$viewport.find(".tab_container").hide(); privateScope.$viewport = $viewport;
$viewport.find('#content').hide();
$viewport.find('#status-bar').hide(); privateScope.$viewport.find(".tab_container").hide();
privateScope.$viewport.find('#content').hide();
privateScope.$viewport.find('#status-bar').hide();
privateScope.$viewport.find('#connectbutton a.connect_state').text(chrome.i18n.getMessage('disconnect')).addClass('active');
privateScope.$gsViewport = $viewport.find('#view-groundstation'); privateScope.$gsViewport = $viewport.find('#view-groundstation');
privateScope.$gsViewport.show(); privateScope.$gsViewport.show();
privateScope.activated = true; privateScope.activated = true;
@ -42,6 +45,16 @@ helper.groundstation = (function () {
helper.interval.remove('gsUpdateGui'); helper.interval.remove('gsUpdateGui');
if (privateScope.$viewport !== null) {
privateScope.$viewport.find(".tab_container").show();
privateScope.$viewport.find('#content').show();
privateScope.$viewport.find('#status-bar').show();
}
if (privateScope.$gsViewport !== null) {
privateScope.$gsViewport.hide();
}
privateScope.activated = false; privateScope.activated = false;
GUI.log(chrome.i18n.getMessage('gsDeactivated')); GUI.log(chrome.i18n.getMessage('gsDeactivated'));
} }

View file

@ -129,6 +129,11 @@ $(document).ready(function () {
}); });
$('div.connect_controls a.connect').click(function () { $('div.connect_controls a.connect').click(function () {
if (helper.groundstation.isActivated()) {
helper.groundstation.deactivate();
}
if (GUI.connect_lock != true) { // GUI control overrides the user control if (GUI.connect_lock != true) { // GUI control overrides the user control
var clicks = $(this).data('clicks'); var clicks = $(this).data('clicks');