Skip to content

Commit

Permalink
Merge pull request iNavFlight#1627 from jeffhendrix/dji_wtf
Browse files Browse the repository at this point in the history
Added support for DJI wtfos MSP-OSD full screen 60x22 OSD
  • Loading branch information
DzikuVx authored Oct 18, 2022
2 parents 11e6a7f + 6bbcce1 commit ef565e2
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 45 deletions.
6 changes: 6 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3606,6 +3606,12 @@
"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%]."
},
"osd_video_show_guides": {
"message": "Show preview guides"
},
"osd_video_HELP": {
"message": "For HD: red lines show 4:3 screen, HDZero: keep within the blue box for a higher refresh rate, AUTO/PAL: green line is NTSC limit."
},
"osd_dji_HD_FPV": {
"message" : "DJI HD FPV"
},
Expand Down
10 changes: 5 additions & 5 deletions js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ var mspHelper = (function (gui) {
data.getInt8(i + 13)
));
}
}
}
break;

case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE:
LOGIC_CONDITIONS.put(new LogicCondition(
data.getInt8(0),
Expand Down Expand Up @@ -788,7 +788,7 @@ var mspHelper = (function (gui) {
}
CONFIG.target = targetName;
}

break;

case MSPCodes.MSP_SET_CHANNEL_FORWARDING:
Expand Down Expand Up @@ -2282,8 +2282,8 @@ var mspHelper = (function (gui) {
}
};

self.loadLogicConditions = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "5.0.0")) {
self.loadLogicConditions = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "5.0.0")) {
LOGIC_CONDITIONS.flush();
let idx = 0;
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, nextLogicCondition);
Expand Down
77 changes: 70 additions & 7 deletions src/css/tabs/osd.css
Original file line number Diff line number Diff line change
Expand Up @@ -430,29 +430,92 @@ button {
left: calc(50% - 197px);
}

.tab-osd .preview_hd {
.tab-osd .preview_hdzero {
width: 600px !important;
left: calc(50% - 317px) !important;
}

.tab-osd .hd_43_left {
border-left: 1px solid red;
.tab-osd .hdzero_43_left {
border-left: 2px solid red;
position: absolute;
left: 60px;
height: calc(100% - 27px);
}

.tab-osd .hd_43_right {
border-right: 1px solid red;
.tab-osd .hdzero_43_right {
border-right: 2px solid red;
position: absolute;
right: 60px;
height: calc(100% - 27px);
}

.tab-osd .preview_hd_side {
.tab-osd .preview_hdzero_side {
width: calc(50% - 317px) !important;
}

.tab-osd .preview_dji_hd {
width: 720px !important;
left: calc(50% - 377px) !important;
}

.tab-osd .dji_hd_43_left {
border-left: 2px solid red;
position: absolute;
left: 84px;
height: calc(100% - 27px);
}

.tab-osd .dji_hd_43_right {
border-right: 2px solid red;
position: absolute;
right: 84px;
height: calc(100% - 27px);
}

.tab-osd .preview_dji_hd_side {
width: calc(50% - 377px) !important;
}

.tab-osd .hd_3016_top {
border-top: 2px solid blue;
position: absolute;
top: 46px;
left: 120px;
width: 360px;
}

.tab-osd .hd_3016_bottom {
border-bottom: 2px solid blue;
position: absolute;
bottom: 18px;
left: 120px;
width: 360px;
}

.tab-osd .hd_3016_left {
border-left: 2px solid blue;
position: absolute;
top: 46px;
left: 120px;
height: 288px;
}

.tab-osd .hd_3016_right {
border-right: 2px solid blue;
position: absolute;
top: 46px;
right: 120px;
height: 288px;
}

.tab-osd .ntsc_bottom {
border-bottom: 2px solid green;
position: absolute;
bottom: 54px;
left: 0px;
width: 100%;
}

.tab-osd .preview {
/* please don't copy the generic background image from another project
* and replace the one that @nathantsoi took :)
Expand Down Expand Up @@ -538,7 +601,7 @@ button {
}

.tab-osd .settings select,
.tab-osd .settings input,
.tab-osd .settings input,
.tab-osd .osd_settings .switchery,
.tab-osd .unit_wrapper {
vertical-align: top;
Expand Down
28 changes: 19 additions & 9 deletions tabs/osd.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
</div>
<div class="display-layout">
<div class="col right">
<div class="left_43_margin"></div>
<div class="right_43_margin"></div>
<div class="preview">
</div>
<div class="hd_43_margin_left"></div>
<div class="hd_43_margin_right"></div>
<div class="hd_3016_box_top"></div>
<div class="hd_3016_box_bottom"></div>
<div class="hd_3016_box_left"></div>
<div class="hd_3016_box_right"></div>
<div class="pal_ntsc_box_bottom"></div>
<div class="preview"></div>
</div>
</div>
</div>
Expand All @@ -46,6 +50,12 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
<div class="spacer_box">
<div class="video-types"></div>
</div>
<div class="spacer_box settings">
<div for="osd_video_show_guides" class="helpicon cf_tip" data-i18n_title="osd_video_HELP"></div>
<label id="videoGuides">
<span data-i18n="osd_video_show_guides"></span>
</label>
</div>
</div>
<div class="gui_box grey settings-container">
<div class="gui_box_titlebar">
Expand Down Expand Up @@ -82,12 +92,12 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
<div for="plusCodeShort" class="helpicon cf_tip" data-i18n_title="osdSettingPLUS_CODE_SHORT_HELP"></div>
<label>
<select id="plusCodeShort" class="update_preview" data-setting="osd_plus_code_short" data-live="true"></select>
<span data-i18n="osd_plus_code_short"></span>
<span data-i18n="osd_plus_code_short"></span>
</label>
<div for="rpmPrecision" class="helpicon cf_tip" data-i18n_title="osd_esc_rpm_precision_help"></div>
<label>
<select id="rpmPrecision" class="update_preview" data-setting="osd_esc_rpm_precision" data-live="true"></select>
<span data-i18n="osd_esc_rpm_precision"></span>
<span data-i18n="osd_esc_rpm_precision"></span>
</label>
<label>
<select class="update_preview" data-setting="osd_crosshairs_style" data-live="true"></select>
Expand Down Expand Up @@ -210,7 +220,7 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
</label>
</div>
</div>
<div class="gui_box grey dji-hd-container">
<div class="gui_box grey dji-hd-container" id="dji_settings">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="osd_dji_HD_FPV"></div>
</div>
Expand All @@ -231,7 +241,7 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
<span data-i18n="osd_dji_GPS_source"></span>
</label>
<label>
<select data-setting="dji_message_speed_source" data-live="true"></select>
<select data-setting="dji_message_speed_source" data-live="true"></select>
<span data-i18n="osd_dji_speed_source"></span>
</label>
<label class="djiCraftNameElements">
Expand Down Expand Up @@ -281,7 +291,7 @@ <h1 class="tab_title" data-i18n="tabOSD"></h1>
<span data-i18n="osdSwitchInd3"></span>
</label>
</div>
</div>
</div>
</div>
<div id="fontmanagercontent" style="display:none; width:712px;">
<div class="font-picker" style="margin-bottom: 10px;">
Expand Down
Loading

0 comments on commit ef565e2

Please sign in to comment.