Skip to content

Commit

Permalink
Merge pull request #1150 from avsaase/avs-shorter-osd-plus-code
Browse files Browse the repository at this point in the history
Option for local plus codes on osd
  • Loading branch information
DzikuVx authored Jan 8, 2021
2 parents 13d8b67 + 8bf8ed2 commit 6abfd68
Show file tree
Hide file tree
Showing 3 changed files with 13 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 @@ -3070,6 +3070,12 @@
"osdSettingMainVoltageDecimals": {
"message": "Main voltage decimals"
},
"osdSettingPLUS_CODE_DIGITS_HELP": {
"message": "Precision at the equator: 10=13.9x13.9m; 11=2.8x3.5m; 12=56x87cm; 13=11x22cm."
},
"osdSettingPLUS_CODE_SHORT_HELP": {
"message": "Removing 2, 4 and 6 leading digits requires a reference location within, respectively, ~800km, ~40km and ~2km to recover the original coordinates."
},
"osdSettingCRSF_LQ_FORMAT_HELP": {
"message": "TYPE1 shows LQ% as used by TBS hardware. TYPE2 shows RF Profile Modes (2=150Hz, 1=50Hz, 0=4Hz update rates) and LQ % [0..100%]. Tracer shows RFMode 1 (1=250Hz) and LQ % [0..100%]."
},
Expand Down
5 changes: 5 additions & 0 deletions tabs/osd.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ <h1 class="tab_title">
<label>
<select class="update_preview" data-setting="osd_coordinate_digits" data-live="true"></select> Coordinate Digits
</label>
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_DIGITS_HELP"></div>
<label>
<select class="update_preview" data-setting="osd_plus_code_digits" data-live="true"></select> Plus Code Digits
</label>
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_SHORT_HELP"></div>
<label>
<select class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select> Plus Code Remove Leading Digits
</label>
<label>
<select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select> Crosshairs Style
</label>
Expand Down
3 changes: 2 additions & 1 deletion tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,9 @@ OSD.constants = {
id: 97,
preview: function() {
let digits = parseInt(Settings.getInputValue('osd_plus_code_digits')) + 1;
let digitsRemoved = parseInt(Settings.getInputValue('osd_plus_code_short')) * 2;
console.log("DITIS", digits);
return '9547X6PM+VWCCC'.substr(0, digits);
return '9547X6PM+VWCCC'.substr(digitsRemoved, digits-digitsRemoved);
}
},
{
Expand Down

0 comments on commit 6abfd68

Please sign in to comment.