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

Allow for 32 LCs and 8 GVARs

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-07-31 11:53:29 +02:00
parent 6270d101fd
commit 303c4b8d45
11 changed files with 73 additions and 109 deletions

View file

@ -3,7 +3,7 @@
var CONFIGURATOR = { var CONFIGURATOR = {
// all versions are specified and compared using semantic versioning http://semver.org/ // all versions are specified and compared using semantic versioning http://semver.org/
'minfirmwareVersionAccepted': '2.5.0', '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, 'connectionValid': false,
'connectionValidCliOnly': false, 'connectionValidCliOnly': false,
'cliActive': false, 'cliActive': false,

View file

@ -1000,6 +1000,10 @@ var FC = {
'GVAR 1', // 31 'GVAR 1', // 31
'GVAR 2', // 32 'GVAR 2', // 32
'GVAR 3', // 33 'GVAR 3', // 33
'GVAR 4', // 34
'GVAR 5', // 35
'GVAR 6', // 36
'GVAR 7', // 37
]; ];
}, },
getServoMixInputName: function (input) { getServoMixInputName: function (input) {

View file

@ -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; return self;
}; };

View file

@ -23,11 +23,6 @@ let LogicConditionsCollection = function () {
}; };
self.open = function () { self.open = function () {
if (semver.lt(CONFIG.flightControllerVersion, "2.2.0")) {
return;
}
self.render(); self.render();
$container.show(); $container.show();
}; };
@ -61,11 +56,6 @@ let LogicConditionsCollection = function () {
}; };
self.init = function ($element) { self.init = function ($element) {
if (semver.lt(CONFIG.flightControllerVersion, "2.2.0")) {
return;
}
$container = $element; $container = $element;
$container.find('.logic__save').click(self.onSave); $container.find('.logic__save').click(self.onSave);

View file

@ -495,37 +495,21 @@ var mspHelper = (function (gui) {
break; break;
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS: case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS:
LOGIC_CONDITIONS.flush(); LOGIC_CONDITIONS.flush();
if (semver.gte(CONFIG.flightControllerVersion, "2.5.0")) { if (data.byteLength % 14 === 0) {
if (data.byteLength % 14 === 0) { for (i = 0; i < data.byteLength; i += 14) {
for (i = 0; i < data.byteLength; i += 14) { LOGIC_CONDITIONS.put(new LogicCondition(
LOGIC_CONDITIONS.put(new LogicCondition( data.getInt8(i),
data.getInt8(i), data.getInt8(i + 1),
data.getUint8(i + 1), data.getUint8(i + 2),
data.getUint8(i + 2), data.getUint8(i + 3),
data.getUint8(i + 3), data.getInt32(i + 4, true),
data.getInt32(i + 4, true), data.getUint8(i + 8),
data.getUint8(i + 8), data.getInt32(i + 9, true),
data.getInt32(i + 9, true), data.getInt8(i + 13)
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)
));
}
} }
} }
break; break;
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_STATUS: case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_STATUS:

View file

@ -199,9 +199,7 @@ function onValidFirmware()
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice(); GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
onConnect(); onConnect();
if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) { helper.defaultsDialog.init();
helper.defaultsDialog.init();
}
$('#tabs ul.mode-connected .tab_setup a').click(); $('#tabs ul.mode-connected .tab_setup a').click();
}); });

View file

@ -407,9 +407,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
localize(); localize();
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, getLogicConditionsStatus);
}
GUI.content_ready(callback); GUI.content_ready(callback);
} }

View file

@ -20,11 +20,7 @@ TABS.onboard_logging.initialize = function (callback) {
MSP.send_message(MSPCodes.MSP_BF_CONFIG, false, false, function() { MSP.send_message(MSPCodes.MSP_BF_CONFIG, false, false, function() {
MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false, function() { MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false, function() {
MSP.send_message(MSPCodes.MSP_SDCARD_SUMMARY, false, false, function() { MSP.send_message(MSPCodes.MSP_SDCARD_SUMMARY, false, false, function() {
var messageId = MSPCodes.MSP_BLACKBOX_CONFIG; MSP.send_message(MSPCodes.MSP2_BLACKBOX_CONFIG, false, false, load_html);
if (semver.gte(CONFIG.apiVersion, "2.3.0")) {
messageId = MSPCodes.MSP2_BLACKBOX_CONFIG;
}
MSP.send_message(messageId, false, false, load_html);
}); });
}); });
}); });

View file

@ -40,13 +40,11 @@ TABS.ports.initialize = function (callback) {
maxPorts: 1 } maxPorts: 1 }
); );
if (semver.gte(CONFIG.flightControllerVersion, "2.2.0")) { functionRules.push({
functionRules.push({ name: 'GSM_SMS',
name: 'GSM_SMS', groups: ['telemetry'],
groups: ['telemetry'], maxPorts: 1 }
maxPorts: 1 } );
);
}
// support configure RunCam Device // support configure RunCam Device
functionRules.push({ functionRules.push({
@ -71,36 +69,29 @@ TABS.ports.initialize = function (callback) {
maxPorts: 1 } maxPorts: 1 }
); );
if (semver.gte(CONFIG.flightControllerVersion, "2.2.0")) { functionRules.push({
functionRules.push({ name: 'OPFLOW',
name: 'OPFLOW', groups: ['sensors'],
groups: ['sensors'], maxPorts: 1 }
maxPorts: 1 } );
);
functionRules.push({ functionRules.push({
name: 'ESC', name: 'ESC',
groups: ['peripherals'], groups: ['peripherals'],
maxPorts: 1 } maxPorts: 1 }
); );
}
if (semver.gte(CONFIG.flightControllerVersion, "2.2.2")) { functionRules.push({
functionRules.push({ name: 'FRSKY_OSD',
name: 'FRSKY_OSD', groups: ['peripherals'],
groups: ['peripherals'], maxPorts: 1 }
maxPorts: 1 } );
);
}
if (semver.gte(CONFIG.flightControllerVersion, "2.4.0")) {
functionRules.push({
name: 'DJI_FPV',
groups: ['peripherals'],
maxPorts: 1 }
);
}
functionRules.push({
name: 'DJI_FPV',
groups: ['peripherals'],
maxPorts: 1 }
);
for (var i = 0; i < functionRules.length; i++) { for (var i = 0; i < functionRules.length; i++) {
functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name); functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name);

View file

@ -8,24 +8,6 @@
<label class="gvar__value" data-gvar-index="0">0</label> <label class="gvar__value" data-gvar-index="0">0</label>
</div> </div>
</div> </div>
<div class="gvar__wrapper">
<div class="gvar__cell">
<h2>GVAR 1</h2>
<label class="gvar__value" data-gvar-index="1">0</label>
</div>
</div>
<div class="gvar__wrapper">
<div class="gvar__cell">
<h2>GVAR 2</h2>
<label class="gvar__value" data-gvar-index="2">0</label>
</div>
</div>
<div class="gvar__wrapper">
<div class="gvar__cell">
<h2>GVAR 3</h2>
<label class="gvar__value" data-gvar-index="3">0</label>
</div>
</div>
</div> </div>
<table class="mixer-table logic__table"> <table class="mixer-table logic__table">

View file

@ -13,7 +13,8 @@ TABS.programming.initialize = function (callback, scrollPosition) {
} }
loadChainer.setChain([ loadChainer.setChain([
mspHelper.loadLogicConditions mspHelper.loadLogicConditions,
mspHelper.loadGlobalVariablesStatus
]); ]);
loadChainer.setExitPoint(loadHtml); loadChainer.setExitPoint(loadHtml);
loadChainer.execute(); loadChainer.execute();
@ -38,6 +39,8 @@ TABS.programming.initialize = function (callback, scrollPosition) {
LOGIC_CONDITIONS.init($('#programming-main-content')); LOGIC_CONDITIONS.init($('#programming-main-content'));
LOGIC_CONDITIONS.render(); LOGIC_CONDITIONS.render();
GLOBAL_VARIABLES_STATUS.init($(".gvar__container"));
helper.tabs.init($('.tab-programming')); helper.tabs.init($('.tab-programming'));
localize(); localize();
@ -46,11 +49,9 @@ TABS.programming.initialize = function (callback, scrollPosition) {
saveChainer.execute(); saveChainer.execute();
}); });
if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) { helper.mspBalancedInterval.add('logic_conditions_pull', 100, 1, function () {
helper.mspBalancedInterval.add('logic_conditions_pull', 100, 1, function () { statusChainer.execute();
statusChainer.execute(); });
});
}
GUI.content_ready(callback); GUI.content_ready(callback);
} }