diff options
author | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2020-07-31 12:53:29 +0300 |
---|---|---|
committer | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2020-07-31 12:53:29 +0300 |
commit | 303c4b8d45b3ed692adc640c79bad6aa833ca097 (patch) | |
tree | 871486a5c2e8ae38dc0eb9b55326ba4b49c20dc2 /js | |
parent | 6270d101fdccaf314d5445add7ea0efac837434e (diff) |
Allow for 32 LCs and 8 GVARs
Diffstat (limited to 'js')
-rwxr-xr-x | js/data_storage.js | 2 | ||||
-rw-r--r-- | js/fc.js | 4 | ||||
-rw-r--r-- | js/globalVariablesStatus.js | 20 | ||||
-rw-r--r-- | js/logicConditionsCollection.js | 10 | ||||
-rw-r--r-- | js/msp/MSPHelper.js | 42 | ||||
-rwxr-xr-x | js/serial_backend.js | 4 |
6 files changed, 39 insertions, 43 deletions
diff --git a/js/data_storage.js b/js/data_storage.js index b583f769..cd61cd60 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -3,7 +3,7 @@ var CONFIGURATOR = { // all versions are specified and compared using semantic versioning http://semver.org/ 'minfirmwareVersionAccepted': '2.5.0', - 'maxFirmwareVersionAccepted': '2.7.0', // COndition is < (lt) so we accept all in 2.2 branch, not 2.3 actualy + 'maxFirmwareVersionAccepted': '2.7.0', // Condition is < (lt) so we accept all in 2.2 branch, not 2.3 actualy 'connectionValid': false, 'connectionValidCliOnly': false, 'cliActive': false, @@ -1000,6 +1000,10 @@ var FC = { 'GVAR 1', // 31 'GVAR 2', // 32 'GVAR 3', // 33 + 'GVAR 4', // 34 + 'GVAR 5', // 35 + 'GVAR 6', // 36 + 'GVAR 7', // 37 ]; }, getServoMixInputName: function (input) { diff --git a/js/globalVariablesStatus.js b/js/globalVariablesStatus.js index 57abc6c2..41669905 100644 --- a/js/globalVariablesStatus.js +++ b/js/globalVariablesStatus.js @@ -29,5 +29,25 @@ let GlobalVariablesStatus = function () { } } + self.init = function ($container) { + + let count = self.getAll().length; + let template = $container.find(".gvar__wrapper:first").prop("outerHTML"); + + $container.find(".gvar__wrapper").remove(); + + for (let i = 0; i < count; i++) { + $container.append(template); + let $last = $container.find(".gvar__wrapper:last"); + + $last.find("h2").html("GVAR " + i); + $last.find("label").attr("data-gvar-index", i); + $last.find("label").html("0"); + } + + $container.find(".gvar__wrapper").css("width", (100 / count) + "%"); + + } + return self; };
\ No newline at end of file diff --git a/js/logicConditionsCollection.js b/js/logicConditionsCollection.js index 4e920e27..10707f02 100644 --- a/js/logicConditionsCollection.js +++ b/js/logicConditionsCollection.js @@ -23,11 +23,6 @@ let LogicConditionsCollection = function () { }; self.open = function () { - - if (semver.lt(CONFIG.flightControllerVersion, "2.2.0")) { - return; - } - self.render(); $container.show(); }; @@ -61,11 +56,6 @@ let LogicConditionsCollection = function () { }; self.init = function ($element) { - - if (semver.lt(CONFIG.flightControllerVersion, "2.2.0")) { - return; - } - $container = $element; $container.find('.logic__save').click(self.onSave); diff --git a/js/msp/MSPHelper.js b/js/msp/MSPHelper.js index f3a7d944..d032c8e9 100644 --- a/js/msp/MSPHelper.js +++ b/js/msp/MSPHelper.js @@ -495,37 +495,21 @@ var mspHelper = (function (gui) { break; case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS: LOGIC_CONDITIONS.flush(); - if (semver.gte(CONFIG.flightControllerVersion, "2.5.0")) { - if (data.byteLength % 14 === 0) { - for (i = 0; i < data.byteLength; i += 14) { - LOGIC_CONDITIONS.put(new LogicCondition( - data.getInt8(i), - data.getUint8(i + 1), - data.getUint8(i + 2), - data.getUint8(i + 3), - data.getInt32(i + 4, true), - data.getUint8(i + 8), - data.getInt32(i + 9, true), - data.getInt8(i + 13) - )); - } - } - } else { - if (data.byteLength % 13 === 0) { - for (i = 0; i < data.byteLength; i += 13) { - LOGIC_CONDITIONS.put(new LogicCondition( - data.getInt8(i), - -1, - data.getInt8(i + 1), - data.getInt8(i + 2), - data.getInt32(i + 3, true), - data.getInt8(i + 7), - data.getInt32(i + 8, true), - data.getInt8(i + 12) - )); - } + if (data.byteLength % 14 === 0) { + for (i = 0; i < data.byteLength; i += 14) { + LOGIC_CONDITIONS.put(new LogicCondition( + data.getInt8(i), + data.getInt8(i + 1), + data.getUint8(i + 2), + data.getUint8(i + 3), + data.getInt32(i + 4, true), + data.getUint8(i + 8), + data.getInt32(i + 9, true), + data.getInt8(i + 13) + )); } } + break; case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_STATUS: diff --git a/js/serial_backend.js b/js/serial_backend.js index 6f400b31..6b2def52 100755 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -199,9 +199,7 @@ function onValidFirmware() GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice(); onConnect(); - if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) { - helper.defaultsDialog.init(); - } + helper.defaultsDialog.init(); $('#tabs ul.mode-connected .tab_setup a').click(); }); |