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 21, 2024
1 parent 5ef26ae commit 89b28e6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 41 deletions.
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
68 changes: 28 additions & 40 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 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 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 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 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 89b28e6

Please sign in to comment.