Skip to content

Commit

Permalink
fix motor tab representation
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Sep 22, 2024
1 parent 5ef26ae commit 4a413cc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 44 deletions.
4 changes: 2 additions & 2 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1462,10 +1462,10 @@
"message": "Calibrate Gyro on first arm"
},
"configurationDigitalIdlePercent": {
"message": "Motor Idle ( %, static)"
"message": "Motor Idle Percent"
},
"configurationDigitalIdlePercentHelp": {
"message": "The 'Motor Idle (static)' value is the percent of maximum throttle that is sent to the ESCs when the throttle at minimum stick position and the craft is armed. <br><br>Increase it to gain more idle speed and avoid desyncs. Too high and the craft feels floaty. Too low and the motors can desync or be slow to start up."
"message": "<strong>Dynamic RPM disabled</strong><br/><br/>The 'Motor Idle Percentage' value is the percent of maximum throttle that is sent to the ESCs when the throttle at minimum stick position and the craft is armed. <br><br>Increase it to gain more idle speed and avoid desyncs. Too high and the craft feels floaty. Too low and the motors can desync or be slow to start up.<br/><br/><strong>Dynamic RPM enabled</strong><br/><br/>The maximum throttle allowed, after arming, before takeoff. If RPM is less than dyn_idle_min_rpm, or zero, this throttle value will be sent to the motors. When the motors start spinning, throttle is adjusted to maintain the set RPM, but cannot exceed this value until the quad takes off."
},
"configurationMotorPoles": {
"message": "Motor poles",
Expand Down
4 changes: 3 additions & 1 deletion src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { updateTabList } from "../utils/updateTabList";
import { isInt, getMixerImageSrc } from "../utils/common";
import * as d3 from 'd3';
import $ from 'jquery';
import semver from "semver-min";
import { API_VERSION_1_47 } from "../data_storage.js";

const motors = {
previousDshotBidir: null,
Expand Down Expand Up @@ -764,7 +766,7 @@ motors.initialize = async function (callback) {
$('div.digitalIdlePercent').toggle(protocolConfigured && digitalProtocol);
$('div.idleMinRpm').toggle(protocolConfigured && digitalProtocol && FC.MOTOR_CONFIG.use_dshot_telemetry);

if (FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry) {
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_47) && FC.ADVANCED_TUNING.idleMinRpm && FC.MOTOR_CONFIG.use_dshot_telemetry) {
$('div.digitalIdlePercent').hide();
}

Expand Down
70 changes: 29 additions & 41 deletions src/tabs/motors.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,57 +93,45 @@
<div class="helpicon cf_tip" i18n_title="configurationDshotBidirHelp"></div>
</div>
<div class="number motorPoles">
<label>
<div class="numberspacer">
<input type="number" name="motorPoles" min="4" max="255" step="1"/>
</div>
<span i18n="configurationMotorPolesLong"></span>
</label>
<div class="numberspacer">
<input type="number" name="motorPoles" min="4" max="255" step="1"/>
</div>
<span i18n="configurationMotorPolesLong"></span>
<div class="helpicon cf_tip" i18n_title="configurationMotorPolesHelp"></div>
</div>
<div class="number idleMinRpm">
<label>
<div class="numberspacer noarrows">
<input type="number" name="idleMinRpm" min="0" max="100" step="1" readonly/>
</div>
<span i18n="pidTuningIdleMinRpm"></span>
</label>
<div class="helpicon cf_tip" i18n_title="configurationMotorIdleRpmHelp"></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="numberspacer">
<input type="number" name="digitalIdlePercent" min="0.00" max="20.00" step="0.01"/>
</div>
<span i18n="configurationDigitalIdlePercent"></span>
<div class="helpicon cf_tip" i18n_title="configurationDigitalIdlePercentHelp"></div>
</div>
<div class="number idleMinRpm">
<div class="numberspacer noarrows">
<input type="number" name="idleMinRpm" min="0" max="100" step="1" readonly/>
</div>
<span i18n="pidTuningIdleMinRpm"></span>
<div class="helpicon cf_tip" i18n_title="configurationMotorIdleRpmHelp"></div>
</div>
<div class="number minthrottle">
<label>
<div class="numberspacer">
<input type="number" name="minthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimum"></span>
<div class="helpicon cf_tip" i18n_title="configurationThrottleMinimumHelp"></div>
</label>
<div class="numberspacer">
<input type="number" name="minthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimum"></span>
<div class="helpicon cf_tip" i18n_title="configurationThrottleMinimumHelp"></div>
</div>
<div class="number maxthrottle">
<label>
<div class="numberspacer">
<input type="number" name="maxthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMaximum"></span>
</label>
<div class="numberspacer">
<input type="number" name="maxthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMaximum"></span>
</div>
<div class="number mincommand">
<label>
<div class="numberspacer">
<input type="number" name="mincommand" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimumCommand"></span>
<div class="helpicon cf_tip" i18n_title="configurationThrottleMinimumCommandHelp"></div>
</label>
<div class="numberspacer">
<input type="number" name="mincommand" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimumCommand"></span>
<div class="helpicon cf_tip" i18n_title="configurationThrottleMinimumCommandHelp"></div>
</div>
</div>
</div>
Expand Down

0 comments on commit 4a413cc

Please sign in to comment.