Skip to content

Commit

Permalink
Updated video systems available based on MSP displayport being selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Hendrix authored and Jeff Hendrix committed Oct 5, 2022
1 parent 3d2d80b commit 6bbcce1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3601,7 +3601,7 @@
"message": "Show preview guides"
},
"osd_video_HELP": {
"message": "For HD keep within the red lines for 4:3, HDZero keep within the blue box for a higher refresh rate, AUTO/PAL the green line is NTSC limit ."
"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
42 changes: 30 additions & 12 deletions tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,9 @@ OSD.GUI.checkAndProcessSymbolPosition = function(pos, charCode) {
}
};

const mspVideoSystem = [1,3,4]; // indexes of PAL, HDZERO, & DJIWTF
const analogVideoSystem = [0,1,2]; // indexes of AUTO, PAL, & NTSC

OSD.GUI.updateVideoMode = function() {
// video mode
var $videoTypes = $('.video-types').empty();
Expand All @@ -2371,29 +2374,44 @@ OSD.GUI.updateVideoMode = function() {
}

if (OSD.data.isMspDisplay) {
if (OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] != 'HDZERO') {
if (mspVideoSystem.includes(OSD.data.preferences.video_system) == false) {
OSD.data.preferences.video_system = OSD.constants.VIDEO_TYPES.indexOf('HDZERO');
OSD.updateDisplaySize();
OSD.GUI.saveConfig();
}
} else {
if (OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'HDZERO' || OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'DJIWTF') {
if (analogVideoSystem.includes(OSD.data.preferences.video_system) == false) {
OSD.data.preferences.video_system = OSD.constants.VIDEO_TYPES.indexOf('AUTO')
OSD.updateDisplaySize();
OSD.GUI.saveConfig();
}
}

for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) {
if ((OSD.constants.VIDEO_TYPES[i] != 'HDZERO' && OSD.constants.VIDEO_TYPES[i] != 'DJIWTF') || OSD.data.isMspDisplay)
{
$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)
)
);
if (OSD.data.isMspDisplay) {
for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) {
if (mspVideoSystem.includes(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)
)
);
}
}
} else {
for (var i = 0; i < OSD.constants.VIDEO_TYPES.length; i++) {
if (analogVideoSystem.includes(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)
)
);
}
}
}

Expand Down

0 comments on commit 6bbcce1

Please sign in to comment.