Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added selectable precision to the OSD RPM #1379

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,12 @@
"osd_plus_code_short": {
"message" : "Plus Code Remove Leading Digits"
},
"osd_esc_rpm_precision": {
"message": "ESC RPM precision"
},
"osd_esc_rpm_precision_help": {
"message": "The number of digits shown in the RPM display. If the RPM is higher than the number of digits, it will be shown in thousand RPM with as many decimal places as allowed."
},
"osd_crosshairs_style": {
"message" : "Crosshairs Style"
},
Expand Down
5 changes: 5 additions & 0 deletions tabs/osd.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
<select class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select>
<span data-i18n="osd_plus_code_short"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="osd_esc_rpm_precision_help"></div>
<label>
<select class="update_preview" data-setting="osd_esc_rpm_precision" data-live="true"></select>
<span data-i18n="osd_esc_rpm_precision"></span>
</label>
<label>
<select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select>
<span data-i18n="osd_crosshairs_style"></span>
Expand Down
5 changes: 4 additions & 1 deletion tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,10 @@ OSD.constants = {
name: 'ESC_RPM',
id: 106,
min_version: '2.3.0',
preview: FONT.symbol(SYM.RPM) + '983',
preview: function(){
let rpmPreview = '112974'.substr((6 - parseInt(Settings.getInputValue('osd_esc_rpm_precision'))));
return FONT.symbol(SYM.RPM) + rpmPreview;
}
},
{
name: 'GLIDESLOPE',
Expand Down