Skip to content

Commit

Permalink
Merge pull request #1379 from iNavFlight/mrd_add_precision_to_osd_rpm
Browse files Browse the repository at this point in the history
Added selectable precision to the OSD RPM
  • Loading branch information
DzikuVx authored Oct 28, 2021
2 parents df6fd90 + f5a5d22 commit 6022caa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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

0 comments on commit 6022caa

Please sign in to comment.