1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 20:10:11 +03:00

Added support for DJI wtfos MSP-OSD full screen 59x22 OSD

This commit is contained in:
Jeff Hendrix 2022-10-01 00:40:50 -06:00
parent 0917397880
commit ffee3d3935
4 changed files with 74 additions and 18 deletions

View file

@ -453,6 +453,29 @@ button {
width: calc(50% - 317px) !important; 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 { .tab-osd .preview {
/* please don't copy the generic background image from another project /* please don't copy the generic background image from another project
* and replace the one that @nathantsoi took :) * and replace the one that @nathantsoi took :)

View file

@ -532,22 +532,26 @@ OSD.constants = {
'AUTO', 'AUTO',
'PAL', 'PAL',
'NTSC', 'NTSC',
'HD' 'HDZERO',
'DJIWTF'
], ],
VIDEO_LINES: { VIDEO_LINES: {
PAL: 16, PAL: 16,
NTSC: 13, NTSC: 13,
HD: 18 HDZERO: 18,
DJIWTF: 22
}, },
VIDEO_COLS: { VIDEO_COLS: {
PAL: 30, PAL: 30,
NTSC: 30, NTSC: 30,
HD: 50 HDZERO: 50,
DJIWTF: 60
}, },
VIDEO_BUFFER_CHARS: { VIDEO_BUFFER_CHARS: {
PAL: 480, PAL: 480,
NTSC: 390, NTSC: 390,
HD: 900 HDZERO: 900,
DJIWTF: 1320
}, },
UNIT_TYPES: [ UNIT_TYPES: [
{name: 'osdUnitImperial', value: 0}, {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 // set the preview size based on the video type
$('.third_left').toggleClass('preview_hd_side', (video_type == 'HD')) $('.third_left').toggleClass('preview_hd_side', (video_type == 'HDZERO'))
$('.preview').toggleClass('preview_hd cut43_left', (video_type == 'HD')) $('.preview').toggleClass('preview_hd cut43_left', (video_type == 'HDZERO'))
$('.third_right').toggleClass('preview_hd_side', (video_type == 'HD')) $('.third_right').toggleClass('preview_hd_side', (video_type == 'HDZERO'))
$('.left_43_margin').toggleClass('hd_43_left', (video_type == 'HD')) $('.left_43_margin').toggleClass('hd_43_left', (video_type == 'HDZERO'))
$('.right_43_margin').toggleClass('hd_43_right', (video_type == 'HD')) $('.right_43_margin').toggleClass('hd_43_right', (video_type == 'HDZERO'))
}; };
OSD.saveAlarms = function(callback) { OSD.saveAlarms = function(callback) {
@ -2354,7 +2365,7 @@ OSD.GUI.checkAndProcessSymbolPosition = function(pos, charCode) {
OSD.GUI.updateVideoMode = function() { OSD.GUI.updateVideoMode = function() {
// video mode // video mode
var $videoTypes = $('.video-types').empty(); 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( $videoTypes.append(
$('<label/>') $('<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 () { $videoTypes.find(':radio').click(function () {
OSD.data.preferences.video_system = $(this).data('type'); OSD.data.preferences.video_system = $(this).data('type');
OSD.updateDisplaySize(); OSD.updateDisplaySize();