1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 19:40:22 +03:00

Get GVAR status from FC

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-04-10 21:37:24 +02:00
parent 1f92a1383a
commit f85a17d1ad
7 changed files with 61 additions and 8 deletions

View file

@ -4,7 +4,8 @@ TABS.programming = {};
TABS.programming.initialize = function (callback, scrollPosition) {
let loadChainer = new MSPChainerClass(),
saveChainer = new MSPChainerClass();
saveChainer = new MSPChainerClass(),
statusChainer = new MSPChainerClass();
if (GUI.active_tab != 'programming') {
GUI.active_tab = 'programming';
@ -24,6 +25,12 @@ TABS.programming.initialize = function (callback, scrollPosition) {
mspHelper.saveToEeprom
]);
statusChainer.setChain([
mspHelper.loadLogicConditionsStatus,
mspHelper.loadGlobalVariablesStatus
]);
statusChainer.setExitPoint(onStatusPullDone);
function loadHtml() {
GUI.load("./tabs/programming.html", processHtml);
}
@ -45,16 +52,14 @@ TABS.programming.initialize = function (callback, scrollPosition) {
});
if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) {
helper.mspBalancedInterval.add('logic_conditions_pull', 350, 1, getLogicConditionsStatus);
helper.mspBalancedInterval.add('logic_conditions_pull', 350, 1, function () {
statusChainer.execute();
});
}
GUI.content_ready(callback);
}
function getLogicConditionsStatus() {
mspHelper.loadSensorStatus(onStatusPullDone);
}
function onStatusPullDone() {
LOGIC_CONDITIONS.update(LOGIC_CONDITIONS_STATUS);
}