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:
parent
386c23f8a4
commit
b8485457dd
6 changed files with 12 additions and 5 deletions
2
js/fc.js
2
js/fc.js
|
@ -1249,7 +1249,7 @@ var FC = {
|
|||
4: {
|
||||
name: "Logic Condition",
|
||||
type: "range",
|
||||
range: [0, 31],
|
||||
range: [0, (LOGIC_CONDITIONS.getMaxLogicConditionCount()-1)],
|
||||
default: 0
|
||||
},
|
||||
5: {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -221,6 +221,7 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
|
|||
LOGIC_CONDITIONS,
|
||||
self.getActivatorId,
|
||||
self.onActivatorChange,
|
||||
true,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -295,6 +295,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
|||
function () {
|
||||
servoRule.setConditionId($(this).val());
|
||||
},
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ TABS.programming.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
|
||||
function processHtml() {
|
||||
|
||||
LOGIC_CONDITIONS.init($('#subtab-lc'));
|
||||
LOGIC_CONDITIONS.render();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue