1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +03:00

Fixed and enhanced LC display

This commit is contained in:
Darren Lines 2022-08-13 19:40:38 +01:00
parent 386c23f8a4
commit b8485457dd
6 changed files with 12 additions and 5 deletions

View file

@ -1249,7 +1249,7 @@ var FC = {
4: {
name: "Logic Condition",
type: "range",
range: [0, 31],
range: [0, (LOGIC_CONDITIONS.getMaxLogicConditionCount()-1)],
default: 0
},
5: {

View file

@ -300,7 +300,7 @@ GUI_control.prototype.renderOperandValue = function ($container, operandMetadata
* @param {function} onChange
* @param {boolean} withAlways
*/
GUI_control.prototype.renderLogicConditionSelect = function ($container, logicConditions, current, onChange, withAlways) {
GUI_control.prototype.renderLogicConditionSelect = function ($container, logicConditions, current, onChange, withAlways, onlyEnabled) {
let $select = $container.append('<select class="mix-rule-condition">').find("select"),
lcCount = logicConditions.getCount();
@ -309,8 +309,10 @@ GUI_control.prototype.renderLogicConditionSelect = function ($container, logicCo
$select.append('<option value="-1">Always</option>')
}
for (let i = 0; i < lcCount ; i++) {
if (!onlyEnabled || (logicConditions.isEnabled(i))) {
$select.append('<option value="' + i + '">Logic Condition ' + i + ' </option>');
}
}
$select.val(current).change(onChange);
}

View file

@ -221,6 +221,7 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
LOGIC_CONDITIONS,
self.getActivatorId,
self.onActivatorChange,
true,
true
);
} else {

View file

@ -28,6 +28,10 @@ let LogicConditionsCollection = function () {
return data.length
};
self.isEnabled = function (lcID) {
return data[lcID].getEnabled();
}
self.open = function () {
self.render();
$container.show();

View file

@ -295,6 +295,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
function () {
servoRule.setConditionId($(this).val());
},
true,
true
);

View file

@ -40,7 +40,6 @@ TABS.programming.initialize = function (callback, scrollPosition) {
}
function processHtml() {
LOGIC_CONDITIONS.init($('#subtab-lc'));
LOGIC_CONDITIONS.render();