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 = {
// 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,

View file

@ -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) {

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;
};

View file

@ -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);

View file

@ -495,12 +495,11 @@ 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.getInt8(i + 1),
data.getUint8(i + 2),
data.getUint8(i + 3),
data.getInt32(i + 4, true),
@ -510,22 +509,7 @@ var mspHelper = (function (gui) {
));
}
}
} 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;
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_STATUS:

View file

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

View file

@ -407,9 +407,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
localize();
if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) {
helper.mspBalancedInterval.add('logic_conditions_pull', 350, 1, getLogicConditionsStatus);
}
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_DATAFLASH_SUMMARY, false, false, function() {
MSP.send_message(MSPCodes.MSP_SDCARD_SUMMARY, false, false, function() {
var messageId = MSPCodes.MSP_BLACKBOX_CONFIG;
if (semver.gte(CONFIG.apiVersion, "2.3.0")) {
messageId = MSPCodes.MSP2_BLACKBOX_CONFIG;
}
MSP.send_message(messageId, false, false, load_html);
MSP.send_message(MSPCodes.MSP2_BLACKBOX_CONFIG, false, false, load_html);
});
});
});

View file

@ -40,13 +40,11 @@ TABS.ports.initialize = function (callback) {
maxPorts: 1 }
);
if (semver.gte(CONFIG.flightControllerVersion, "2.2.0")) {
functionRules.push({
name: 'GSM_SMS',
groups: ['telemetry'],
maxPorts: 1 }
);
}
// support configure RunCam Device
functionRules.push({
@ -71,7 +69,6 @@ TABS.ports.initialize = function (callback) {
maxPorts: 1 }
);
if (semver.gte(CONFIG.flightControllerVersion, "2.2.0")) {
functionRules.push({
name: 'OPFLOW',
groups: ['sensors'],
@ -83,24 +80,18 @@ TABS.ports.initialize = function (callback) {
groups: ['peripherals'],
maxPorts: 1 }
);
}
if (semver.gte(CONFIG.flightControllerVersion, "2.2.2")) {
functionRules.push({
name: 'FRSKY_OSD',
groups: ['peripherals'],
maxPorts: 1 }
);
}
if (semver.gte(CONFIG.flightControllerVersion, "2.4.0")) {
functionRules.push({
name: 'DJI_FPV',
groups: ['peripherals'],
maxPorts: 1 }
);
}
for (var i = 0; i < functionRules.length; i++) {
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>
</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>
<table class="mixer-table logic__table">

View file

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