diff options
author | Jeff Hendrix <Jeff.Hendrix@wdc.com> | 2022-10-01 09:40:50 +0300 |
---|---|---|
committer | Jeff Hendrix <Jeff.Hendrix@wdc.com> | 2022-10-02 22:45:23 +0300 |
commit | ffee3d3935a3da851a81088942e394db3a682e17 (patch) | |
tree | 407f63f6b237b0b42363688fcb6f203a48f95bc2 | |
parent | 0917397880d8eaba4ca8ffb65d9af0e52e252cf0 (diff) |
Added support for DJI wtfos MSP-OSD full screen 59x22 OSD
-rw-r--r-- | js/msp/MSPHelper.js | 10 | ||||
-rw-r--r-- | src/css/tabs/osd.css | 25 | ||||
-rw-r--r-- | tabs/osd.js | 53 | ||||
-rw-r--r-- | tabs/ports.js | 4 |
4 files changed, 74 insertions, 18 deletions
diff --git a/js/msp/MSPHelper.js b/js/msp/MSPHelper.js index 01b5789d..ec9b976d 100644 --- a/js/msp/MSPHelper.js +++ b/js/msp/MSPHelper.js @@ -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), @@ -788,7 +788,7 @@ var mspHelper = (function (gui) { } CONFIG.target = targetName; } - + break; case MSPCodes.MSP_SET_CHANNEL_FORWARDING: @@ -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); diff --git a/src/css/tabs/osd.css b/src/css/tabs/osd.css index 89db9aef..4375a2ba 100644 --- a/src/css/tabs/osd.css +++ b/src/css/tabs/osd.css @@ -453,6 +453,29 @@ button { 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: 1px solid red; + position: absolute; + left: 72px; + height: calc(100% - 27px); +} + +.tab-osd .dji_hd_43_right { + border-right: 1px solid red; + position: absolute; + right: 72px; + height: calc(100% - 27px); +} + +.tab-osd .preview_dji_hd_side { + width: calc(50% - 377px) !important; +} + .tab-osd .preview { /* please don't copy the generic background image from another project * and replace the one that @nathantsoi took :) @@ -538,7 +561,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; diff --git a/tabs/osd.js b/tabs/osd.js index 44bd89d3..099ff15f 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -532,22 +532,26 @@ OSD.constants = { 'AUTO', 'PAL', 'NTSC', - 'HD' + 'HDZERO', + 'DJIWTF' ], VIDEO_LINES: { PAL: 16, NTSC: 13, - HD: 18 + HDZERO: 18, + DJIWTF: 22 }, VIDEO_COLS: { PAL: 30, NTSC: 30, - HD: 50 + HDZERO: 50, + DJIWTF: 60 }, VIDEO_BUFFER_CHARS: { PAL: 480, NTSC: 390, - HD: 900 + HDZERO: 900, + DJIWTF: 1320 }, UNIT_TYPES: [ {name: 'osdUnitImperial', value: 0}, @@ -2063,12 +2067,19 @@ OSD.updateDisplaySize = function () { } } + // set the preview size if dji wtf + $('.third_left').toggleClass('preview_dji_hd_side', video_type == 'DJIWTF') + $('.preview').toggleClass('preview_dji_hd cut43_left', video_type == 'DJIWTF') + $('.third_right').toggleClass('preview_dji_hd_side', video_type == 'DJIWTF') + $('.left_43_margin').toggleClass('dji_hd_43_left', video_type == 'DJIWTF') + $('.right_43_margin').toggleClass('dji_hd_43_right', video_type == 'DJIWTF') + // set the preview size based on the video type - $('.third_left').toggleClass('preview_hd_side', (video_type == 'HD')) - $('.preview').toggleClass('preview_hd cut43_left', (video_type == 'HD')) - $('.third_right').toggleClass('preview_hd_side', (video_type == 'HD')) - $('.left_43_margin').toggleClass('hd_43_left', (video_type == 'HD')) - $('.right_43_margin').toggleClass('hd_43_right', (video_type == 'HD')) + $('.third_left').toggleClass('preview_hd_side', (video_type == 'HDZERO')) + $('.preview').toggleClass('preview_hd cut43_left', (video_type == 'HDZERO')) + $('.third_right').toggleClass('preview_hd_side', (video_type == 'HDZERO')) + $('.left_43_margin').toggleClass('hd_43_left', (video_type == 'HDZERO')) + $('.right_43_margin').toggleClass('hd_43_right', (video_type == 'HDZERO')) }; OSD.saveAlarms = function(callback) { @@ -2354,7 +2365,7 @@ OSD.GUI.checkAndProcessSymbolPosition = function(pos, charCode) { OSD.GUI.updateVideoMode = function() { // video mode var $videoTypes = $('.video-types').empty(); - for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) { + for (var i = 0; i < OSD.constants.VIDEO_TYPES.length - 2; i++) { $videoTypes.append( $('<label/>') @@ -2365,6 +2376,28 @@ OSD.GUI.updateVideoMode = function() { ); } + // Add HD modes if MSP Displayport is selected + var isHdOsd = false; + + $.each(SERIAL_CONFIG.ports, function(index, port){ + if(port.functions.includes('MSP_DISPLAYPORT')) { + isHdOsd = true; + } + }); + + if (isHdOsd) { + for (var i = OSD.constants.VIDEO_TYPES.length - 2; i < OSD.constants.VIDEO_TYPES.length; i++) { + + $videoTypes.append( + $('<label/>') + .append($('<input name="video_system" type="radio"/>' + OSD.constants.VIDEO_TYPES[i] + '</label>') + .prop('checked', i === OSD.data.preferences.video_system) + .data('type', i) + ) + ); + } + } + $videoTypes.find(':radio').click(function () { OSD.data.preferences.video_system = $(this).data('type'); OSD.updateDisplaySize(); diff --git a/tabs/ports.js b/tabs/ports.js index f6320ed9..b17966f4 100644 --- a/tabs/ports.js +++ b/tabs/ports.js @@ -67,7 +67,7 @@ TABS.ports.initialize = function (callback) { name: 'VTX_FFPV', groups: ['peripherals'], maxPorts: 1 } - ); + ); functionRules.push({ name: 'OPFLOW', @@ -335,7 +335,7 @@ TABS.ports.initialize = function (callback) { }); MSP.send_message(MSPCodes.MSP2_SET_CF_SERIAL_CONFIG, mspHelper.crunch(MSPCodes.MSP2_SET_CF_SERIAL_CONFIG), false, save_to_eeprom); - + function save_to_eeprom() { MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, on_saved_handler); } |