From f83c4604888a608b9e34f431d52d2ccaf7103054 Mon Sep 17 00:00:00 2001 From: Asier Ruiz <43983086+asizon@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:37:43 +0100 Subject: [PATCH] Fix/improve dynamicIdle hidding (#3624) Fix dynamicIdle hidding removed unused api version import sinplify hidding, idlerpm disabled string improve revert simplifing simplifing digitalIdle hidding revert sinplifing --- locales/en/messages.json | 2 +- src/js/tabs/motors.js | 15 ++------------- src/tabs/motors.html | 4 ++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 1cc37aab6e..98cdfcc2bc 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -4533,7 +4533,7 @@ "message": "Dynamic Idle improves control at low rpm and reduces risk of motor desyncs.

It improves PID authority, zero throttle stability, inverted hang time, and motor braking.

The Dynamic Idle min rpm should be set to around 3000 - 3500 rpm.

Visit this wiki entry 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" diff --git a/src/js/tabs/motors.js b/src/js/tabs/motors.js index 2d47185e6b..ac4a506329 100644 --- a/src/js/tabs/motors.js +++ b/src/js/tabs/motors.js @@ -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"; @@ -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); diff --git a/src/tabs/motors.html b/src/tabs/motors.html index d17fc680c5..9f65fd5b1c 100644 --- a/src/tabs/motors.html +++ b/src/tabs/motors.html @@ -107,9 +107,9 @@
- -
+ +