1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 11:59:51 +03:00

UI for LC activator

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-04-14 14:43:27 +02:00
parent c005214a2b
commit d40b1c8fab
4 changed files with 30 additions and 0 deletions

View file

@ -3152,6 +3152,9 @@
"logicClose": { "logicClose": {
"message": "Close" "message": "Close"
}, },
"logicActivator": {
"message": "Active"
},
"save": { "save": {
"message": "Save" "message": "Save"
}, },

View file

@ -73,6 +73,7 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
let $cT = $(event.currentTarget); let $cT = $(event.currentTarget);
self.setEnabled(!!$cT.prop('checked')); self.setEnabled(!!$cT.prop('checked'));
self.renderStatus(); self.renderStatus();
self.renderActivator();
}; };
self.getOperatorMetadata = function () { self.getOperatorMetadata = function () {
@ -205,6 +206,28 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
} }
} }
self.onActivatorChange = function (event) {
let $cT = $(event.currentTarget);
self.setActivatorId($cT.val());
}
self.renderActivator = function () {
let $e = $row.find(".logic_cell__activator");
if (self.getEnabled()) {
GUI.renderLogicConditionSelect(
$e,
LOGIC_CONDITIONS,
self.getActivatorId,
self.onActivatorChange,
true
);
} else {
$e.html("");
}
}
self.render = function (index, $container) { self.render = function (index, $container) {
$container.find('tbody').append('<tr>\ $container.find('tbody').append('<tr>\
@ -213,6 +236,7 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
<td class="logic_cell__operation"></td>\ <td class="logic_cell__operation"></td>\
<td class="logic_cell__operandA"></td>\ <td class="logic_cell__operandA"></td>\
<td class="logic_cell__operandB"></td>\ <td class="logic_cell__operandB"></td>\
<td class="logic_cell__activator"></div></td>\
<td class="logic_cell__flags"></div></td>\ <td class="logic_cell__flags"></div></td>\
<td class="logic_cell__status"></td>\ <td class="logic_cell__status"></td>\
</tr>\ </tr>\
@ -247,6 +271,7 @@ let LogicCondition = function (enabled, activatorId, operation, operandAType, op
self.renderOperand(0); self.renderOperand(0);
self.renderOperand(1); self.renderOperand(1);
self.renderStatus(); self.renderStatus();
self.renderActivator();
} }
return self; return self;

View file

@ -137,6 +137,7 @@
<th style="width: 120px" data-i18n="logicOperation"></th> <th style="width: 120px" data-i18n="logicOperation"></th>
<th data-i18n="logicOperandA"></th> <th data-i18n="logicOperandA"></th>
<th data-i18n="logicOperandB"></th> <th data-i18n="logicOperandB"></th>
<th data-i18n="logicActivator"></th>
<th data-i18n="logicFlags"></th> <th data-i18n="logicFlags"></th>
<th data-i18n="logicStatus"></th> <th data-i18n="logicStatus"></th>
</tr> </tr>

View file

@ -43,6 +43,7 @@
<th style="width: 120px" data-i18n="logicOperation"></th> <th style="width: 120px" data-i18n="logicOperation"></th>
<th data-i18n="logicOperandA"></th> <th data-i18n="logicOperandA"></th>
<th data-i18n="logicOperandB"></th> <th data-i18n="logicOperandB"></th>
<th data-i18n="logicActivator"></th>
<th style="width: 40px" data-i18n="logicFlags"></th> <th style="width: 40px" data-i18n="logicFlags"></th>
<th style="width: 50px" data-i18n="logicStatus"></th> <th style="width: 50px" data-i18n="logicStatus"></th>
</tr> </tr>