1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-20 14:55:15 +03:00

Reorder and make more consistent the Motor/ESC Configuration box

This commit is contained in:
Miguel Angel Mulero Martinez 2019-09-08 10:02:06 +02:00 committed by mikeller
parent 845155c8e2
commit d54b9d1045
3 changed files with 34 additions and 46 deletions

View file

@ -1019,7 +1019,7 @@
"message": "SPI RX support" "message": "SPI RX support"
}, },
"featureESC_SENSOR": { "featureESC_SENSOR": {
"message": "Use KISS/BLHeli_32 ESC telemetry as sensor" "message": "Use KISS/BLHeli_32 ESC telemetry <b>over a separate wire</b>"
}, },
"featureCHANNEL_FORWARDING": { "featureCHANNEL_FORWARDING": {
"message": "Forward aux channels to servo outputs" "message": "Forward aux channels to servo outputs"

View file

@ -2,7 +2,6 @@
TABS.configuration = { TABS.configuration = {
DSHOT_PROTOCOL_MIN_VALUE: 5, DSHOT_PROTOCOL_MIN_VALUE: 5,
PROSHOT_PROTOCOL_VALUE: 0,
SHOW_OLD_BATTERY_CONFIG: false, SHOW_OLD_BATTERY_CONFIG: false,
analyticsChanges: {}, analyticsChanges: {},
}; };
@ -418,7 +417,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
if (semver.gte(CONFIG.apiVersion, "1.36.0")) { if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
escprotocols.push('PROSHOT1000'); escprotocols.push('PROSHOT1000');
self.PROSHOT_PROTOCOL_VALUE = escprotocols.length - 1;
} }
} }
@ -453,31 +451,21 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
self.analyticsChanges['EscProtocol'] = newValue; self.analyticsChanges['EscProtocol'] = newValue;
//hide not used setting for DSHOT protocol //hide not used setting for DSHOT protocol
if (escProtocolValue >= self.DSHOT_PROTOCOL_MIN_VALUE) { let digitalProtocol = (escProtocolValue >= self.DSHOT_PROTOCOL_MIN_VALUE);
$('div.minthrottle').hide();
$('div.maxthrottle').hide();
$('div.mincommand').hide();
$('div.checkboxPwm').hide();
$('div.unsyncedpwmfreq').hide();
$('div.digitalIdlePercent').show(); $('div.minthrottle').toggle(!digitalProtocol);
$('div.maxthrottle').toggle(!digitalProtocol);
$('div.mincommand').toggle(!digitalProtocol);
$('div.checkboxPwm').toggle(!digitalProtocol);
$('div.unsyncedpwmfreq').toggle(!digitalProtocol);
$('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && escProtocolValue < self.PROSHOT_PROTOCOL_VALUE); $('div.digitalIdlePercent').toggle(digitalProtocol);
$('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
} else { $('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && digitalProtocol);
$('div.minthrottle').show(); $('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
$('div.maxthrottle').show();
$('div.mincommand').show();
$('div.checkboxPwm').show();
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
$("input[id='unsyncedPWMSwitch']").change();
$('div.digitalIdlePercent').hide(); //trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
$("input[id='unsyncedPWMSwitch']").change();
$('div.checkboxDshotBidir').hide();
$('div.motorPoles').hide();
}
}).change(); }).change();

View file

@ -141,7 +141,7 @@
</label> </label>
</div> </div>
<div class="number checkboxPwm"> <div class="number checkboxPwm">
<div style="float: left; height: 20px; margin-right: 5px; margin-left: 3px;"> <div style="float: left; height: 20px; margin-right: 14px; margin-left: 3px;">
<input type="checkbox" id="unsyncedPWMSwitch" class="toggle" /> <input type="checkbox" id="unsyncedPWMSwitch" class="toggle" />
</div> </div>
<span class="freelabel" i18n="configurationunsyndePwm"></span> <span class="freelabel" i18n="configurationunsyndePwm"></span>
@ -154,22 +154,9 @@
<span i18n="configurationUnsyncedPWMFreq"></span> <span i18n="configurationUnsyncedPWMFreq"></span>
</label> </label>
</div> </div>
<div class="number checkboxDshotBidir">
<div style="float: left; height: 20px; margin-right: 5px; margin-left: 3px;">
<input type="checkbox" id="dshotBidir" class="toggle" />
</div>
<span class="freelabel" i18n="configurationDshotBidir" />
<div class="helpicon cf_tip" i18n_title="configurationDshotBidirHelp" />
</div>
<table cellpadding="0" cellspacing="0" style="margin-bottom:10px;">
<tbody class="features esc">
<!-- table generated here -->
</tbody>
</table>
<!-- -->
<div class="disarm"> <div class="disarm">
<div class="checkbox"> <div class="checkbox">
<div style="float: left; height: 20px; margin-right: 15px; margin-left: 3px;"> <div style="float: left; height: 20px; margin-right: 14px; margin-left: 3px;">
<input type="checkbox" id="disarmkillswitch" class="toggle" /> <input type="checkbox" id="disarmkillswitch" class="toggle" />
</div> </div>
<span class="freelabel" i18n="configurationDisarmKillSwitch"></span> <span class="freelabel" i18n="configurationDisarmKillSwitch"></span>
@ -184,14 +171,18 @@
</label> </label>
</div> </div>
</div> </div>
<table cellpadding="0" cellspacing="0" style="margin-bottom: 5px;">
<tbody class="features esc">
<!-- table generated here -->
</tbody>
</table>
<!-- --> <!-- -->
<div class="number digitalIdlePercent"> <div class="number checkboxDshotBidir">
<label> <div style="float: left; height: 20px; margin-right: 14px; margin-left: 3px;">
<div class="numberspacer"> <input type="checkbox" id="dshotBidir" class="toggle" />
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/> </div>
</div> <span class="freelabel" i18n="configurationDshotBidir" />
<span i18n="configurationDigitalIdlePercent"></span> <div class="helpicon cf_tip" i18n_title="configurationDshotBidirHelp" />
</label>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div> <div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
</div> </div>
<div class="number motorPoles"> <div class="number motorPoles">
@ -203,6 +194,15 @@
</label> </label>
<div class="helpicon cf_tip" i18n_title="configurationMotorPolesHelp"></div> <div class="helpicon cf_tip" i18n_title="configurationMotorPolesHelp"></div>
</div> </div>
<div class="number digitalIdlePercent">
<label>
<div class="numberspacer">
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
</div>
<span i18n="configurationDigitalIdlePercent"></span>
</label>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
</div>
<div class="number minthrottle"> <div class="number minthrottle">
<label> <label>
<div class="numberspacer"> <div class="numberspacer">