Skip to content

Commit

Permalink
Fix/improve dynamicIdle hidding (#3624)
Browse files Browse the repository at this point in the history
Fix dynamicIdle hidding

removed unused api version import

sinplify hidding, idlerpm disabled string improve

revert simplifing

simplifing digitalIdle hidding

 revert sinplifing
  • Loading branch information
asizon authored Nov 2, 2023
1 parent af9ec79 commit f83c460
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4533,7 +4533,7 @@
"message": "Dynamic Idle improves control at low rpm and reduces risk of motor desyncs. <br /><br /> It improves PID authority, zero throttle stability, inverted hang time, and motor braking.<br /><br />The Dynamic Idle min rpm should be set to around 3000 - 3500 rpm. <br /><br />Visit <a href=\"https://betaflight.com/docs/wiki/archive/Tuning-Dynamic-Idle\" target=\"_blank\" rel=\"noopener noreferrer\">this wiki entry</a> for more info."
},
"pidTuningIdleMinRpmDisabled": {
"message": "Dynamic Idle is OFF because Dshot Telemetry is OFF"
"message": "Dynamic Idle is DISABLED because Dshot Telemetry is OFF"
},
"pidTuningAcroTrainerAngleLimit": {
"message": "Acro Trainer Angle Limit"
Expand Down
15 changes: 2 additions & 13 deletions src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import FC from "../fc";
import MSP from "../msp";
import { mixerList } from "../model";
import MSPCodes from "../msp/MSPCodes";
import { API_VERSION_1_42, API_VERSION_1_44, API_VERSION_1_46 } from "../data_storage";
import { API_VERSION_1_42, API_VERSION_1_44 } from "../data_storage";
import EscProtocols from "../utils/EscProtocols";
import { updateTabList } from "../utils/updateTabList";
import { isInt, getMixerImageSrc } from "../utils/common";
Expand Down Expand Up @@ -772,19 +772,8 @@ motors.initialize = async function (callback) {

$('div.digitalIdlePercent').toggle(protocolConfigured && digitalProtocol);

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('input[name="digitalIdlePercent"]').prop('disabled', protocolConfigured && digitalProtocol && FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry);
}

if (FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
$('div.digitalIdlePercent').hide();
} else {
const dynamicIdle = FC.ADVANCED_TUNING.idleMinRpm * 100;
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercentDisabled', { dynamicIdle }));
}
} else {
$('span.digitalIdlePercentDisabled').text(i18n.getMessage('configurationDigitalIdlePercent'));
$('div.digitalIdlePercent').hide();
}

$('.escSensor').toggle(protocolConfigured && digitalProtocol);
Expand Down
4 changes: 2 additions & 2 deletions src/tabs/motors.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
<div class="numberspacer">
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
</div>
<span class="digitalIdlePercentDisabled"></span>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
<span i18n="configurationDigitalIdlePercent"></span>
</label>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
</div>
<div class="number minthrottle">
<label>
Expand Down

0 comments on commit f83c460

Please sign in to comment.