mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-24 16:55:22 +03:00
Activate / deactivate groundstation mode
This commit is contained in:
parent
c7b924e67b
commit
1f718efe07
2 changed files with 22 additions and 4 deletions
|
@ -8,6 +8,7 @@ helper.groundstation = (function () {
|
|||
privateScope = {};
|
||||
|
||||
privateScope.activated = false;
|
||||
privateScope.$viewport = null;
|
||||
privateScope.$gsViewport = null;
|
||||
|
||||
publicScope.isActivated = function () {
|
||||
|
@ -22,12 +23,14 @@ helper.groundstation = (function () {
|
|||
|
||||
helper.interval.add('gsUpdateGui', privateScope.updateGui, 200);
|
||||
|
||||
$viewport.find(".tab_container").hide();
|
||||
$viewport.find('#content').hide();
|
||||
$viewport.find('#status-bar').hide();
|
||||
privateScope.$viewport = $viewport;
|
||||
|
||||
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.show();
|
||||
|
||||
privateScope.activated = true;
|
||||
|
@ -42,6 +45,16 @@ helper.groundstation = (function () {
|
|||
|
||||
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;
|
||||
GUI.log(chrome.i18n.getMessage('gsDeactivated'));
|
||||
}
|
||||
|
|
|
@ -129,6 +129,11 @@ $(document).ready(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
|
||||
|
||||
var clicks = $(this).data('clicks');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue