1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

Layout in place, now I need the msp messages to laod and save overrides

This commit is contained in:
Marcelo Bezerra 2023-09-02 17:58:01 +02:00
parent 96ec2da3ce
commit 553bde1b37
3 changed files with 64 additions and 0 deletions

View file

@ -5474,5 +5474,8 @@
},
"targetPrefetchFailNoPort": {
"message": "Cannot prefetch target: No port"
},
"timerOutputs": {
"message": "Timer outputs"
}
}

View file

@ -28,6 +28,34 @@
</div>
</div>
</div>
<div class="platform-type gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="timerOutputs"></div>
</div>
<div class="spacer_box" id="timerOutputsList">
<!--
<div class="select">
<select id="platform-type"></select>
<label for="platform-type">
<span data-i18n="platformType"></span>
</label>
</div>
<div class="checkbox">
<input id="motor_direction_inverted" type="checkbox" class="toggle" data-setting="motor_direction_inverted" />
<label for="motor_direction_inverted"><span data-i18n="motor_direction_inverted"></span></label>
<div class="helpicon cf_tip" data-i18n_title="motor_direction_inverted_hint"></div>
</div>
<div class="select">
<select id="output_mode" data-setting="output_mode"></select>
<label for="output_mode">
<span data-i18n="output_modeTitle"></span>
</label>
</div>
-->
</div>
</div>
</div>
<div class="rightWrapper">
<div class="platform-type gui_box grey">

View file

@ -82,6 +82,38 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
}
function renderTimerOverride() {
let outputCount = OUTPUT_MAPPING.getOutputCount(),
$container = $('#timerOutputsList'), timers = {};
for(let i = 0; i < outputCount; ++i) {
let timer = OUTPUT_MAPPING.getTimerId(i);
timers[timer] = true;
console.log("timer: " + i + " " + timer);
}
let usedTimers = Object.keys(timers).sort((a,b) => a-b);
for (t of usedTimers) {
console.log("timer settings: " + t);
$container.append(
'<div class="select">' +
'<select id="timer-output-' + t + '">' +
'<option>AUTO</option>'+
'<option>MOTORS</option>'+
'<option>SERVOS</option>'+
'</select>' +
'<label for="timer-output-' + t + '">' +
'<span> T' + t + '</span>' +
'</label>' +
'</div>'
);
}
}
function renderOutputMapping() {
let outputMap = OUTPUT_MAPPING.getOutputTable(
MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER,
@ -704,6 +736,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
renderOutputTable();
renderOutputMapping();
renderTimerOverride();
LOGIC_CONDITIONS.init($('#logic-wrapper'));