From d54b9d10458f340d1e5482564bae7b38a3b655e0 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Sun, 8 Sep 2019 10:02:06 +0200 Subject: [PATCH] Reorder and make more consistent the Motor/ESC Configuration box --- locales/en/messages.json | 2 +- src/js/tabs/configuration.js | 34 +++++++++------------------- src/tabs/configuration.html | 44 ++++++++++++++++++------------------ 3 files changed, 34 insertions(+), 46 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index aad1d317..1687fe01 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -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 over a separate wire" }, "featureCHANNEL_FORWARDING": { "message": "Forward aux channels to servo outputs" diff --git a/src/js/tabs/configuration.js b/src/js/tabs/configuration.js index 8553ac23..b1772620 100644 --- a/src/js/tabs/configuration.js +++ b/src/js/tabs/configuration.js @@ -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(); diff --git a/src/tabs/configuration.html b/src/tabs/configuration.html index 7ddc315d..a6386b95 100644 --- a/src/tabs/configuration.html +++ b/src/tabs/configuration.html @@ -141,7 +141,7 @@
-
+
@@ -154,22 +154,9 @@
-
-
- -
- -
-
- - - - -
-
-
+
@@ -184,14 +171,18 @@
+ + + + +
-
- +
+
+ +
+ +
@@ -203,6 +194,15 @@
+
+ +
+