mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-17 21:35:30 +03:00
#DJI-HD-OSD-Support
This commit is contained in:
parent
ffce2c9a57
commit
da1ce634b0
6 changed files with 377 additions and 45 deletions
|
@ -2701,6 +2701,60 @@
|
||||||
"fixedWingNavigationConfiguration": {
|
"fixedWingNavigationConfiguration": {
|
||||||
"message": "Fixed Wing Navigation Settings"
|
"message": "Fixed Wing Navigation Settings"
|
||||||
},
|
},
|
||||||
|
"osd_unsupported_msg1": {
|
||||||
|
"message" : "Your flight controller isn't responding to OSD commands. This probably means that it does not have an integrated OSD."
|
||||||
|
},
|
||||||
|
"osd_unsupported_msg2": {
|
||||||
|
"message" : "Note that some flight controllers have an onboard <a href=\"https://www.youtube.com/watch?v=ikKH_6SQ-Tk\" target=\"_blank\">MinimOSD</a> that can be flashed and configured with <a href=\"https://github.com/ShikOfTheRa/scarab-osd/releases/latest\" target=\"_blank\">scarab-osd</a>, however the MinimOSD cannot be configured through this interface."
|
||||||
|
},
|
||||||
|
"osd_elements": {
|
||||||
|
"message" : "Elements"
|
||||||
|
},
|
||||||
|
"osd_preview_title": {
|
||||||
|
"message" : "Preview <span>(drag to change position)</span>"
|
||||||
|
},
|
||||||
|
"osd_preview_title_drag":{
|
||||||
|
"message": ""
|
||||||
|
},
|
||||||
|
"osd_video_format": {
|
||||||
|
"message" : "Video Format"
|
||||||
|
},
|
||||||
|
"osd_units": {
|
||||||
|
"message" : "Units"
|
||||||
|
},
|
||||||
|
"osd_main_voltage_decimals": {
|
||||||
|
"message" : "Voltage Decimals"
|
||||||
|
},
|
||||||
|
"osd_coordinate_digits": {
|
||||||
|
"message" : "Coordinate Digits"
|
||||||
|
},
|
||||||
|
"osd_plus_code_digits": {
|
||||||
|
"message" : "Plus Code Digits"
|
||||||
|
},
|
||||||
|
"osd_plus_code_short": {
|
||||||
|
"message" : "Plus Code Remove Leading Digits"
|
||||||
|
},
|
||||||
|
"osd_crosshairs_style": {
|
||||||
|
"message" : "Crosshairs Style"
|
||||||
|
},
|
||||||
|
"osd_left_sidebar_scroll": {
|
||||||
|
"message" : "Left Sidebar Scroll"
|
||||||
|
},
|
||||||
|
"osd_right_sidebar_scroll": {
|
||||||
|
"message" : "Right Sidebar Scroll"
|
||||||
|
},
|
||||||
|
"osd_crsf_lq_format": {
|
||||||
|
"message" : "Crossfire LQ Format"
|
||||||
|
},
|
||||||
|
"osd_sidebar_scroll_arrows": {
|
||||||
|
"message" : "Sidebar Scroll Arrows"
|
||||||
|
},
|
||||||
|
"osd_home_position_arm_screen": {
|
||||||
|
"message" : "Home Position on Arming Screen"
|
||||||
|
},
|
||||||
|
"osd_alarms": {
|
||||||
|
"message" : "Alarms"
|
||||||
|
},
|
||||||
"osdLayoutDefault": {
|
"osdLayoutDefault": {
|
||||||
"message": "Default Layout"
|
"message": "Default Layout"
|
||||||
},
|
},
|
||||||
|
@ -3196,6 +3250,66 @@
|
||||||
"osdSettingCRSF_LQ_FORMAT_HELP": {
|
"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%]."
|
"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%]."
|
||||||
},
|
},
|
||||||
|
"osd_dji_HD_FPV": {
|
||||||
|
"message" : "DJI HD FPV"
|
||||||
|
},
|
||||||
|
"osd_dji_hide_unsupported": {
|
||||||
|
"message": "Hide unsupported elements"
|
||||||
|
},
|
||||||
|
"osd_dji_ESC_temp": {
|
||||||
|
"message" : "Source of ESC Temperature"
|
||||||
|
},
|
||||||
|
"osd_dji_RSSI_source": {
|
||||||
|
"message" : "Source of RSSI"
|
||||||
|
},
|
||||||
|
"osd_dji_GPS_source": {
|
||||||
|
"message" : "Source of GPS Speed"
|
||||||
|
},
|
||||||
|
"osd_dji_speed_source": {
|
||||||
|
"message" : "Source of 3D Speed"
|
||||||
|
},
|
||||||
|
"osd_dji_use_craft_name_elements": {
|
||||||
|
"message" : "Use craft name for messages and additional elements.</span><br/>Elements in <span class=\"blue\">blue</span> appear in Craft Name."
|
||||||
|
},
|
||||||
|
"osd_dji_adjustments": {
|
||||||
|
"message" : "Show adjustments in Craft Name"
|
||||||
|
},
|
||||||
|
"osd_dji_cn_alternating_duration": {
|
||||||
|
"message" : "Craft Name alternating duration (in 1/10 sec)"
|
||||||
|
},
|
||||||
|
"osd_font_default": {
|
||||||
|
"message" : "Default"
|
||||||
|
},
|
||||||
|
"osd_font_vision": {
|
||||||
|
"message" : "Vision"
|
||||||
|
},
|
||||||
|
"osd_font_impact": {
|
||||||
|
"message" : "Impact"
|
||||||
|
},
|
||||||
|
"osd_font_impact_mini": {
|
||||||
|
"message" : "Impact mini"
|
||||||
|
},
|
||||||
|
"osd_font_clarity": {
|
||||||
|
"message" : "Clarity"
|
||||||
|
},
|
||||||
|
"osd_font_clarity_medium": {
|
||||||
|
"message" : "Clarity medium"
|
||||||
|
},
|
||||||
|
"osd_font_bold": {
|
||||||
|
"message" : "Bold"
|
||||||
|
},
|
||||||
|
"osd_font_large": {
|
||||||
|
"message" : "Large"
|
||||||
|
},
|
||||||
|
"osd_font_load_file": {
|
||||||
|
"message" : "Open Font File"
|
||||||
|
},
|
||||||
|
"osd_font_upload": {
|
||||||
|
"message" : "Upload Font"
|
||||||
|
},
|
||||||
|
"osd_font_manager": {
|
||||||
|
"message" : "Font Manager"
|
||||||
|
},
|
||||||
"uploadingCharacters": {
|
"uploadingCharacters": {
|
||||||
"message": "Uploading..."
|
"message": "Uploading..."
|
||||||
},
|
},
|
||||||
|
|
1
config.yml
Normal file
1
config.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
theme: jekyll-theme-slate
|
|
@ -21,7 +21,7 @@ var Settings = (function () {
|
||||||
if (!s) {
|
if (!s) {
|
||||||
// Setting doesn't exist.
|
// Setting doesn't exist.
|
||||||
input.val(null);
|
input.val(null);
|
||||||
parent.hide();
|
parent.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parent.show();
|
parent.show();
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
background-color: #575757;
|
background-color: #575757;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blue {
|
||||||
|
color: #151f8c;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-osd .spacer_box_title {
|
.tab-osd .spacer_box_title {
|
||||||
float: none;
|
float: none;
|
||||||
}
|
}
|
||||||
|
@ -448,7 +452,7 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-osd .settings select {
|
.tab-osd .settings select {
|
||||||
width: 61px;
|
width: 65px;
|
||||||
margin-right: 11px;
|
margin-right: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,6 +460,19 @@ button {
|
||||||
margin-right: 25px;
|
margin-right: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-osd .settings .djiCraftNameElements {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
margin-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-bottom {
|
||||||
|
border-bottom: none !important;
|
||||||
|
padding-bottom: 0 i !important;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
||||||
.tab-osd .content_wrapper {
|
.tab-osd .content_wrapper {
|
||||||
height: calc(100% - 30px);
|
height: calc(100% - 30px);
|
||||||
|
|
123
tabs/osd.html
123
tabs/osd.html
|
@ -1,11 +1,9 @@
|
||||||
<div class="tab-osd toolbar_fixed_bottom">
|
<div class="tab-osd toolbar_fixed_bottom">
|
||||||
<div class="content_wrapper">
|
<div class="content_wrapper">
|
||||||
<h1 class="tab_title">
|
<h1 class="tab_title" data-i18n="tabOSD"></h1>
|
||||||
OSD
|
|
||||||
</h1>
|
|
||||||
<div class="unsupported hide">
|
<div class="unsupported hide">
|
||||||
<p class="note">Your flight controller isn't responding to OSD commands. This probably means that it does not have an integrated OSD.</p>
|
<p data-i18n="osd_unsupported_msg1" class="note"></p>
|
||||||
<p class="note">Note that some flight controllers have an onboard <a href="https://www.youtube.com/watch?v=ikKH_6SQ-Tk" target="_blank">MinimOSD</a> that can be flashed and configured with <a href="https://github.com/ShikOfTheRa/scarab-osd/releases/latest" target="_blank">scarab-osd</a>, however the MinimOSD cannot be configured through this interface.</p>
|
<p data-i18n="osd_unsupported_msg2" class="note"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="supported hide">
|
<div class="supported hide">
|
||||||
<div class="cf_column third_left osd__elements">
|
<div class="cf_column third_left osd__elements">
|
||||||
|
@ -16,9 +14,7 @@
|
||||||
<div
|
<div
|
||||||
class="gui_box_titlebar"
|
class="gui_box_titlebar"
|
||||||
style="margin-bottom: 0">
|
style="margin-bottom: 0">
|
||||||
<div class="spacer_box_title">
|
<div class="spacer_box_title" data-i18n="osd_elements"></div>
|
||||||
Elements
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<div class="display-fields"></div>
|
<div class="display-fields"></div>
|
||||||
|
@ -29,9 +25,7 @@
|
||||||
<div class="cf_column twothird">
|
<div class="cf_column twothird">
|
||||||
<div class="gui_box grey preview" style="float: left; position: fixed;">
|
<div class="gui_box grey preview" style="float: left; position: fixed;">
|
||||||
<div class="gui_box_titlebar image">
|
<div class="gui_box_titlebar image">
|
||||||
<div class="spacer_box_title">
|
<div class="spacer_box_title" data-i18n="osd_preview_title"></div>
|
||||||
Preview <span>(drag to change position)</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="display-layout">
|
<div class="display-layout">
|
||||||
<div class="col right">
|
<div class="col right">
|
||||||
|
@ -43,9 +37,7 @@
|
||||||
<div class="cf_column third_right" style="width: calc(100% - 377px);">
|
<div class="cf_column third_right" style="width: calc(100% - 377px);">
|
||||||
<div class="gui_box grey">
|
<div class="gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title">Video
|
<div class="spacer_box_title" data-i18n="osd_video_format"></div>
|
||||||
Format
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<div class="video-types"></div>
|
<div class="video-types"></div>
|
||||||
|
@ -53,56 +45,64 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="gui_box grey settings-container">
|
<div class="gui_box grey settings-container">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" data-i18n="settings">
|
<div class="spacer_box_title" data-i18n="settings"></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<label class="units">
|
<label class="units">
|
||||||
<select id="unit_mode" name="unit_mode"></select> Units
|
<select id="unit_mode" name="unit_mode"></select>
|
||||||
|
<span data-i18n="osd_units"></span>
|
||||||
<div class="helpicon cf_tip" style="margin-top: 2px"></div>
|
<div class="helpicon cf_tip" style="margin-top: 2px"></div>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_main_voltage_decimals" data-live="true"></select> Voltage Decimals
|
<select class="update_preview" data-setting="osd_main_voltage_decimals" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_main_voltage_decimals"></span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_coordinate_digits" data-live="true"></select> Coordinate Digits
|
<select class="update_preview" data-setting="osd_coordinate_digits" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_coordinate_digits"></span>
|
||||||
</label>
|
</label>
|
||||||
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_DIGITS_HELP"></div>
|
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_DIGITS_HELP"></div>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_plus_code_digits" data-live="true"></select> Plus Code Digits
|
<select class="update_preview" data-setting="osd_plus_code_digits" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_plus_code_digits"></span>
|
||||||
</label>
|
</label>
|
||||||
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_SHORT_HELP"></div>
|
<div class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_SHORT_HELP"></div>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select> Plus Code Remove Leading Digits
|
<select class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_plus_code_short"></span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select> Crosshairs Style
|
<select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_crosshairs_style"></span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_left_sidebar_scroll" data-live="true"></select> Left Sidebar Scroll
|
<select class="update_preview" data-setting="osd_left_sidebar_scroll" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_left_sidebar_scroll"></span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_right_sidebar_scroll" data-live="true"></select> Right Sidebar Scroll
|
<select class="update_preview" data-setting="osd_right_sidebar_scroll" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_right_sidebar_scroll"></span>
|
||||||
</label>
|
</label>
|
||||||
<div class="helpicon cf_tip" data-i18n_title="osdSettingCRSF_LQ_FORMAT_HELP"></div>
|
<div class="helpicon cf_tip" data-i18n_title="osdSettingCRSF_LQ_FORMAT_HELP"></div>
|
||||||
<label>
|
<label>
|
||||||
<select class="update_preview" data-setting="osd_crsf_lq_format" data-live="true"></select> Crossfire LQ Format
|
<select class="update_preview" data-setting="osd_crsf_lq_format" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_crsf_lq_format"></span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" class="toggle update_preview" data-setting="osd_sidebar_scroll_arrows" data-live="true"> Sidebar Scroll Arrows
|
<input type="checkbox" class="toggle update_preview" data-setting="osd_sidebar_scroll_arrows" data-live="true">
|
||||||
|
<span data-i18n="osd_sidebar_scroll_arrows"></span>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" class="toggle update_preview" data-setting="osd_home_position_arm_screen" data-live="true"> Home Position on Arming Screen
|
<input type="checkbox" class="toggle update_preview" data-setting="osd_home_position_arm_screen" data-live="true">
|
||||||
|
<span data-i18n="osd_home_position_arm_screen"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="gui_box grey alarms-container">
|
<div class="gui_box grey alarms-container">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title">
|
<div class="spacer_box_title" data-i18n="osd_alarms"></div>
|
||||||
Alarms
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box settings">
|
<div class="spacer_box settings">
|
||||||
<label for="rssi_alarm">
|
<label for="rssi_alarm">
|
||||||
|
@ -188,6 +188,45 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="gui_box grey dji-hd-container">
|
||||||
|
<div class="gui_box_titlebar">
|
||||||
|
<div class="spacer_box_title" data-i18n="osd_dji_HD_FPV"></div>
|
||||||
|
</div>
|
||||||
|
<div class="spacer_box settings">
|
||||||
|
<label id="djiUnsupportedElements">
|
||||||
|
<span data-i18n="osd_dji_hide_unsupported"></span>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<select id="djiEscTempSource" data-setting="dji_esc_temp_source" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_dji_ESC_temp"></span>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<select id="djiRssiSource" data-setting="dji_rssi_source" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_dji_RSSI_source"></span>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<select data-setting="osd_speed_source" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_dji_GPS_source"></span>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<select data-setting="dji_message_speed_source" data-live="true"></select>
|
||||||
|
<span data-i18n="osd_dji_speed_source"></span>
|
||||||
|
</label>
|
||||||
|
<div class="djiCraftNameElements">
|
||||||
|
<span><input type="checkbox" id="useCraftnameForMessages" data-setting="dji_use_name_for_messages" data-live="true" class="toggle"/>
|
||||||
|
<span data-i18n="osd_dji_use_craft_name_elements"></span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<label>
|
||||||
|
<select id="djiAdjustments" data-setting="dji_use_adjustments" data-live="true" class="toggle"></select>
|
||||||
|
<span data-i18n="osd_dji_adjustments"></span>
|
||||||
|
</label>
|
||||||
|
<label for="cn_alternating_duration">
|
||||||
|
<input id="cn_alternating_duration" data-setting="dji_cn_alternating_duration" data-setting-multiplier="1" type="number" data-step="1"></input>
|
||||||
|
<span data-i18n="osd_dji_cn_alternating_duration"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="fontmanagercontent" style="display:none; width:712px;">
|
<div id="fontmanagercontent" style="display:none; width:712px;">
|
||||||
|
@ -195,15 +234,15 @@
|
||||||
<h1 class="tab_title">Font:</h1>
|
<h1 class="tab_title">Font:</h1>
|
||||||
<div class="content_wrapper font-preview"></div>
|
<div class="content_wrapper font-preview"></div>
|
||||||
<div class="fontbuttons">
|
<div class="fontbuttons">
|
||||||
<button data-font-file="default">Default</button>
|
<button data-font-file="default" data-i18n="osd_font_default"></button>
|
||||||
<button data-font-file="vision">Vision</button>
|
<button data-font-file="vision" data-i18n="osd_font_vision"></button>
|
||||||
<button data-font-file="impact">Impact</button>
|
<button data-font-file="impact" data-i18n="osd_font_impact"></button>
|
||||||
<button data-font-file="impact_mini">Impact mini</button>
|
<button data-font-file="impact_mini" data-i18n="osd_font_impact_mini"></button>
|
||||||
<button data-font-file="clarity">Clarity</button>
|
<button data-font-file="clarity" data-i18n="osd_font_clarity"></button>
|
||||||
<button data-font-file="clarity_medium">Clarity medium</button>
|
<button data-font-file="clarity_medium" data-i18n="osd_font_clarity_medium"></button>
|
||||||
<button data-font-file="bold">Bold</button>
|
<button data-font-file="bold" data-i18n="osd_font_bold"></button>
|
||||||
<button data-font-file="large">Large</button>
|
<button data-font-file="large" data-i18n="osd_font_large"></button>
|
||||||
<button class="load_font_file">Open Font File</button>
|
<button class="load_font_file" data-i18n="osd_font_load_file"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<a name="progressbar"></a>
|
<a name="progressbar"></a>
|
||||||
|
@ -212,7 +251,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="default_btn green" style="width:100%; float:left; margin-bottom: 0;">
|
<div class="default_btn green" style="width:100%; float:left; margin-bottom: 0;">
|
||||||
<a class="flash_font active">Upload Font</a>
|
<a class="flash_font active" data-i18n="osd_font_upload"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear-both"></div>
|
<div class="clear-both"></div>
|
||||||
|
@ -222,10 +261,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="content_toolbar supported hide">
|
<div class="content_toolbar supported hide">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a class="active save" href="#" >Save</a>
|
<a class="active save" href="#" data-i18n="save"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a class="fonts" id="fontmanager" href="#" >Font Manager</a>
|
<a class="fonts" id="fontmanager" href="#" data-i18n="osd_font_manager"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
163
tabs/osd.js
163
tabs/osd.js
|
@ -426,10 +426,62 @@ OSD.initData = function () {
|
||||||
items: [],
|
items: [],
|
||||||
groups: {},
|
groups: {},
|
||||||
display_items: [],
|
display_items: [],
|
||||||
preview: []
|
preview: [],
|
||||||
|
isDjiHdFpv: false
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OSD.DjiElements = {
|
||||||
|
supported: [
|
||||||
|
"RSSI_VALUE",
|
||||||
|
"MAIN_BATT_VOLTAGE",
|
||||||
|
"MAIN_BATT_CELL_VOLTAGE",
|
||||||
|
"CRAFT_NAME",
|
||||||
|
"FLYMODE",
|
||||||
|
"ESC_TEMPERATURE",
|
||||||
|
"ALTITUDE",
|
||||||
|
"VARIO_NUM",
|
||||||
|
"CROSSHAIRS",
|
||||||
|
"HORIZON_SIDEBARS",
|
||||||
|
"PITCH_ANGLE",
|
||||||
|
"ROLL_ANGLE",
|
||||||
|
"CURRENT_DRAW",
|
||||||
|
"MAH_DRAWN",
|
||||||
|
"GPS_SPEED",
|
||||||
|
"GPS_SATS",
|
||||||
|
"LONGITUDE",
|
||||||
|
"LATITUDE",
|
||||||
|
"DIRECTION_TO_HOME",
|
||||||
|
"DISTANCE_TO_HOME"
|
||||||
|
],
|
||||||
|
emptyGroups: [
|
||||||
|
"MapsAndRadars",
|
||||||
|
"GForce",
|
||||||
|
"Timers",
|
||||||
|
"VTX",
|
||||||
|
"CRSF",
|
||||||
|
"GVars",
|
||||||
|
"PIDs",
|
||||||
|
"PIDOutputs",
|
||||||
|
"PowerLimits"
|
||||||
|
],
|
||||||
|
supportedSettings: [
|
||||||
|
"units"
|
||||||
|
],
|
||||||
|
supportedAlarms: [
|
||||||
|
"rssi_alarm",
|
||||||
|
"osd_alt_alarm"
|
||||||
|
],
|
||||||
|
craftNameElements: [
|
||||||
|
"MESSAGES",
|
||||||
|
"THROTTLE_POSITION",
|
||||||
|
"THROTTLE_POSITION_AUTO_THR",
|
||||||
|
"3D_SPEED",
|
||||||
|
"EFFICIENCY_MAH",
|
||||||
|
"TRIP_DIST"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
OSD.constants = {
|
OSD.constants = {
|
||||||
VISIBLE: 0x0800,
|
VISIBLE: 0x0800,
|
||||||
VIDEO_TYPES: [
|
VIDEO_TYPES: [
|
||||||
|
@ -1659,6 +1711,13 @@ OSD.reload = function(callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MSP.promise(MSPCodes.MSP2_CF_SERIAL_CONFIG).then(function (resp) {
|
||||||
|
$.each(SERIAL_CONFIG.ports, function(index, port){
|
||||||
|
OSD.data.isDjiHdFpv = port.functions.includes('DJI_FPV');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
MSP.promise(MSPCodes.MSP2_INAV_OSD_LAYOUTS).then(function (resp) {
|
MSP.promise(MSPCodes.MSP2_INAV_OSD_LAYOUTS).then(function (resp) {
|
||||||
|
|
||||||
OSD.msp.decodeLayoutCounts(resp);
|
OSD.msp.decodeLayoutCounts(resp);
|
||||||
|
@ -2062,6 +2121,7 @@ OSD.GUI.updateFields = function() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var groupContainer = $tmpl.clone().addClass('osd_group').show();
|
var groupContainer = $tmpl.clone().addClass('osd_group').show();
|
||||||
|
groupContainer.attr('id', group.name);
|
||||||
var groupTitleContainer = groupContainer.find('.spacer_box_title');
|
var groupTitleContainer = groupContainer.find('.spacer_box_title');
|
||||||
var groupTitle = chrome.i18n.getMessage(group.name);
|
var groupTitle = chrome.i18n.getMessage(group.name);
|
||||||
groupTitleContainer.text(groupTitle);
|
groupTitleContainer.text(groupTitle);
|
||||||
|
@ -2155,11 +2215,102 @@ OSD.GUI.updateFields = function() {
|
||||||
}
|
}
|
||||||
$tmpl.parent().append(groupContainer);
|
$tmpl.parent().append(groupContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#djiUnsupportedElements').prepend(
|
||||||
|
$('<input type="checkbox" class="toggle" />')
|
||||||
|
.attr('checked', OSD.data.isDjiHdFpv)
|
||||||
|
.on('change', function () {
|
||||||
|
OSD.GUI.updateDjiView(this.checked);
|
||||||
|
OSD.GUI.updatePreviews();
|
||||||
|
})
|
||||||
|
);
|
||||||
// TODO: If we add more switches somewhere else, this
|
// TODO: If we add more switches somewhere else, this
|
||||||
// needs to be called after all of them have been set up
|
// needs to be called after all of them have been set up
|
||||||
GUI.switchery();
|
GUI.switchery();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OSD.GUI.removeBottomLines = function(){
|
||||||
|
// restore
|
||||||
|
$('.display-field').removeClass('no-bottom');
|
||||||
|
$('.gui_box').each(function(index, gui_box){
|
||||||
|
var elements = $(gui_box).find('.display-fields, .settings').children();
|
||||||
|
var lastVisible = false;
|
||||||
|
elements.each(function(index, element){
|
||||||
|
if ($(element).is(':visible')) {
|
||||||
|
lastVisible = $(element);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (lastVisible) {
|
||||||
|
lastVisible.addClass('no-bottom');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
OSD.GUI.updateDjiMessageElements = function(on) {
|
||||||
|
$('.display-field').each(function(index, element) {
|
||||||
|
var name = $(element).find('input').attr('name');
|
||||||
|
if (OSD.DjiElements.craftNameElements.includes(name)) {
|
||||||
|
if (on) {
|
||||||
|
$(element)
|
||||||
|
.addClass('blue')
|
||||||
|
.show();
|
||||||
|
} else if ($('#djiUnsupportedElements').find('input').is(':checked')) {
|
||||||
|
$(element).hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!on) {
|
||||||
|
$(element).removeClass('blue');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
OSD.GUI.removeBottomLines();
|
||||||
|
};
|
||||||
|
|
||||||
|
OSD.GUI.updateDjiView = function(on) {
|
||||||
|
if (on) {
|
||||||
|
$(OSD.DjiElements.emptyGroups).each(function(index, groupName) {
|
||||||
|
$('#osdGroup' + groupName).hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
var displayFields = $('.display-field');
|
||||||
|
displayFields.each(function(index, element) {
|
||||||
|
var name = $(element).find('input').attr('name');
|
||||||
|
if (!OSD.DjiElements.supported.includes(name)) {
|
||||||
|
$(element).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var settings = $('.settings-container').find('.settings').children();
|
||||||
|
settings.each(function(index, element) {
|
||||||
|
var name = $(element).attr('class');
|
||||||
|
if (!OSD.DjiElements.supportedSettings.includes(name)) {
|
||||||
|
$(element).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var alarms = $('.alarms-container').find('.settings').children();
|
||||||
|
alarms.each(function(index, element) {
|
||||||
|
var name = $(element).attr('for');
|
||||||
|
if (!OSD.DjiElements.supportedAlarms.includes(name)) {
|
||||||
|
$(element).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$(OSD.DjiElements.emptyGroups).each(function(index, groupName) {
|
||||||
|
$('#osdGroup' + groupName).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.display-field')
|
||||||
|
.show()
|
||||||
|
.removeClass('no-bottom');
|
||||||
|
|
||||||
|
$('.settings-container, .alarms-container').find('.settings').children()
|
||||||
|
.show()
|
||||||
|
.removeClass('no-bottom');
|
||||||
|
}
|
||||||
|
OSD.GUI.updateDjiMessageElements($('#useCraftnameForMessages').is(':checked'));
|
||||||
|
};
|
||||||
|
|
||||||
OSD.GUI.updateMapPreview = function(mapCenter, name, directionSymbol, centerSymbol) {
|
OSD.GUI.updateMapPreview = function(mapCenter, name, directionSymbol, centerSymbol) {
|
||||||
if ($('input[name="' + name + '"]').prop('checked')) {
|
if ($('input[name="' + name + '"]').prop('checked')) {
|
||||||
var mapInitialX = OSD.data.display_size.x - 2;
|
var mapInitialX = OSD.data.display_size.x - 2;
|
||||||
|
@ -2194,6 +2345,11 @@ OSD.GUI.updatePreviews = function() {
|
||||||
if (!itemData.isVisible) {
|
if (!itemData.isVisible) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// DJI HD FPV: Hide elements that only appear in craft name
|
||||||
|
if (OSD.DjiElements.craftNameElements.includes(item.name) &&
|
||||||
|
$('#djiUnsupportedElements').find('input').is(':checked')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var j = (itemData.position >= 0) ? itemData.position : itemData.position + OSD.data.display_size.total;
|
var j = (itemData.position >= 0) ? itemData.position : itemData.position + OSD.data.display_size.total;
|
||||||
// create the preview image
|
// create the preview image
|
||||||
item.preview_img = new Image();
|
item.preview_img = new Image();
|
||||||
|
@ -2358,6 +2514,7 @@ OSD.GUI.updateAll = function() {
|
||||||
OSD.GUI.updateUnits();
|
OSD.GUI.updateUnits();
|
||||||
OSD.GUI.updateFields();
|
OSD.GUI.updateFields();
|
||||||
OSD.GUI.updatePreviews();
|
OSD.GUI.updatePreviews();
|
||||||
|
OSD.GUI.updateDjiView(OSD.data.isDjiHdFpv);
|
||||||
};
|
};
|
||||||
|
|
||||||
OSD.GUI.update = function() {
|
OSD.GUI.update = function() {
|
||||||
|
@ -2547,6 +2704,10 @@ TABS.osd.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#useCraftnameForMessages').on('change', function() {
|
||||||
|
OSD.GUI.updateDjiMessageElements(this.checked);
|
||||||
|
});
|
||||||
|
|
||||||
// Update SENSOR_CONFIG, used to detect
|
// Update SENSOR_CONFIG, used to detect
|
||||||
// OSD_AIR_SPEED
|
// OSD_AIR_SPEED
|
||||||
mspHelper.loadSensorConfig(function () {
|
mspHelper.loadSensorConfig(function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue