mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Reorder and make more consistent the Motor/ESC Configuration box
This commit is contained in:
parent
845155c8e2
commit
d54b9d1045
3 changed files with 34 additions and 46 deletions
|
@ -1019,7 +1019,7 @@
|
|||
"message": "SPI RX support"
|
||||
},
|
||||
"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": {
|
||||
"message": "Forward aux channels to servo outputs"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
TABS.configuration = {
|
||||
DSHOT_PROTOCOL_MIN_VALUE: 5,
|
||||
PROSHOT_PROTOCOL_VALUE: 0,
|
||||
SHOW_OLD_BATTERY_CONFIG: false,
|
||||
analyticsChanges: {},
|
||||
};
|
||||
|
@ -418,7 +417,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||
escprotocols.push('PROSHOT1000');
|
||||
self.PROSHOT_PROTOCOL_VALUE = escprotocols.length - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -453,31 +451,21 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
self.analyticsChanges['EscProtocol'] = newValue;
|
||||
|
||||
//hide not used setting for DSHOT protocol
|
||||
if (escProtocolValue >= self.DSHOT_PROTOCOL_MIN_VALUE) {
|
||||
$('div.minthrottle').hide();
|
||||
$('div.maxthrottle').hide();
|
||||
$('div.mincommand').hide();
|
||||
$('div.checkboxPwm').hide();
|
||||
$('div.unsyncedpwmfreq').hide();
|
||||
let digitalProtocol = (escProtocolValue >= self.DSHOT_PROTOCOL_MIN_VALUE);
|
||||
|
||||
$('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.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
|
||||
$('div.digitalIdlePercent').toggle(digitalProtocol);
|
||||
|
||||
} else {
|
||||
$('div.minthrottle').show();
|
||||
$('div.maxthrottle').show();
|
||||
$('div.mincommand').show();
|
||||
$('div.checkboxPwm').show();
|
||||
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
|
||||
$("input[id='unsyncedPWMSwitch']").change();
|
||||
$('div.checkboxDshotBidir').toggle(semver.gte(CONFIG.apiVersion, "1.42.0") && digitalProtocol);
|
||||
$('div.motorPoles').toggle(semver.gte(CONFIG.apiVersion, "1.42.0"));
|
||||
|
||||
$('div.digitalIdlePercent').hide();
|
||||
|
||||
$('div.checkboxDshotBidir').hide();
|
||||
$('div.motorPoles').hide();
|
||||
}
|
||||
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input
|
||||
$("input[id='unsyncedPWMSwitch']").change();
|
||||
|
||||
}).change();
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
</label>
|
||||
</div>
|
||||
<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" />
|
||||
</div>
|
||||
<span class="freelabel" i18n="configurationunsyndePwm"></span>
|
||||
|
@ -154,22 +154,9 @@
|
|||
<span i18n="configurationUnsyncedPWMFreq"></span>
|
||||
</label>
|
||||
</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="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" />
|
||||
</div>
|
||||
<span class="freelabel" i18n="configurationDisarmKillSwitch"></span>
|
||||
|
@ -184,14 +171,18 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<table cellpadding="0" cellspacing="0" style="margin-bottom: 5px;">
|
||||
<tbody class="features esc">
|
||||
<!-- table generated here -->
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- -->
|
||||
<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="number checkboxDshotBidir">
|
||||
<div style="float: left; height: 20px; margin-right: 14px; 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 class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
|
||||
</div>
|
||||
<div class="number motorPoles">
|
||||
|
@ -203,6 +194,15 @@
|
|||
</label>
|
||||
<div class="helpicon cf_tip" i18n_title="configurationMotorPolesHelp"></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">
|
||||
<label>
|
||||
<div class="numberspacer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue