Merge pull request #1683 from iNavFlight/MrD_update-MSPDisplayPort-and-add-Avatar-stuff

Update MSPDisplayPort and add Walksnail Avatar settings
pull/1696/head
Darren Lines 2 years ago committed by GitHub
commit 6bc27d22f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -430,6 +430,31 @@ button {
left: calc(50% - 197px);
}
.tab-osd .preview_avatar {
width: 636px !important; /* 12 X char width */
left: calc(50% - 335px) !important; /* width / 2 + 17 */
}
.tab-osd .hd_avatar_43_left {
border-left: 2px solid red;
position: absolute;
/*left: 77.5px; // Calculated correct position */
left: 30px;
height: calc(100% - 27px);
}
.tab-osd .hd_avatar_43_right {
border-right: 2px solid red;
position: absolute;
/* right: 77.5px; // Calculated correct position */
right: 36px;
height: calc(100% - 27px);
}
.tab-osd .preview_avatar_side {
width: calc(50% - 335px) !important;
}
.tab-osd .preview_hdzero {
width: 600px !important;
left: calc(50% - 317px) !important;
@ -508,6 +533,50 @@ button {
height: 288px;
}
.tab-osd .hd_avatar_bottom {
border-bottom: 2px solid purple;
position: absolute;
bottom: 33px;
left: 0px;
right: 0px;
}
.tab-osd .hd_avatar_storagebox_t {
border-top: 2px solid purple;
position: absolute;
top: 56px;
height: 1px;
right: 34px;
width: 48px;
}
.tab-osd .hd_avatar_storagebox_b {
border-bottom: 2px solid purple;
position: absolute;
top: 88px;
height: 1px;
right: 34px;
width: 48px;
}
.tab-osd .hd_avatar_storagebox_l {
border-left: 2px solid purple;
position: absolute;
top: 56px;
height: 35px;
right: 80px;
width: 1px;
}
.tab-osd .hd_avatar_storagebox_r {
border-right: 2px solid purple;
position: absolute;
top: 56px;
height: 35px;
right: 32px;
width: 1px;
}
.tab-osd .ntsc_bottom {
border-bottom: 2px solid green;
position: absolute;

@ -38,6 +38,11 @@
<div class="hd_3016_box_left"></div>
<div class="hd_3016_box_right"></div>
<div class="pal_ntsc_box_bottom"></div>
<div class="hd_avatar_storage_box_top"></div>
<div class="hd_avatar_storage_box_bottom"></div>
<div class="hd_avatar_storage_box_left"></div>
<div class="hd_avatar_storage_box_right"></div>
<div class="hd_avatar_bottom_bar"></div>
<div class="preview"></div>
</div>
</div>
@ -48,7 +53,7 @@
<div class="spacer_box_title" data-i18n="osd_video_format"></div>
</div>
<div class="spacer_box">
<div class="video-types"></div>
<select class="video-types"></select>
</div>
<div class="spacer_box settings">
<div for="osd_video_show_guides" class="helpicon cf_tip" data-i18n_title="osd_video_HELP"></div>

@ -123,7 +123,7 @@ SYM.AH_AIRCRAFT4 = 0x1A6;
SYM.AH_CROSSHAIRS = new Array(0x166, 0x1A4, new Array(0x190, 0x191, 0x192), new Array(0x193, 0x194, 0x195), new Array(0x196, 0x197, 0x198), new Array(0x199, 0x19A, 0x19B), new Array (0x19C, 0x19D, 0x19E), new Array (0x19F, 0x1A0, 0x1A1));
var video_type = null;
var isGuidesChecked = false;
var FONT = FONT || {};
FONT.initData = function () {
@ -539,6 +539,7 @@ OSD.constants = {
'NTSC',
'HDZERO',
'DJIWTF',
'AVATAR',
'BF43COMPAT'
],
VIDEO_LINES: {
@ -546,6 +547,7 @@ OSD.constants = {
NTSC: 13,
HDZERO: 18,
DJIWTF: 22,
AVATAR: 20,
BF43COMPAT: 16,
},
VIDEO_COLS: {
@ -553,6 +555,7 @@ OSD.constants = {
NTSC: 30,
HDZERO: 50,
DJIWTF: 60,
AVATAR: 53,
BF43COMPAT: 30
},
VIDEO_BUFFER_CHARS: {
@ -560,6 +563,7 @@ OSD.constants = {
NTSC: 390,
HDZERO: 900,
DJIWTF: 1320,
AVATAR: 1060,
BF43COMPAT: 480
},
UNIT_TYPES: [
@ -2100,15 +2104,20 @@ OSD.updateDisplaySize = function () {
}
}
// set the preview size if dji wtf
// set the preview size based on the video type
// -- AVATAR
$('.third_left').toggleClass('preview_avatar_side', (video_type == 'AVATAR'))
$('.preview').toggleClass('preview_avatar cut43_left', (video_type == 'AVATAR'))
$('.third_right').toggleClass('preview_avatar_side', (video_type == 'AVATAR'))
// -- 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')
// set the preview size based on the video type
// -- HD ZERO
$('.third_left').toggleClass('preview_hdzero_side', (video_type == 'HDZERO'))
$('.preview').toggleClass('preview_hdzero cut43_left', (video_type == 'HDZERO'))
$('.third_right').toggleClass('preview_hdzero_side', (video_type == 'HDZERO'))
OSD.GUI.updateGuidesView($('#videoGuides').find('input').is(':checked'));
};
@ -2392,7 +2401,7 @@ OSD.GUI.checkAndProcessSymbolPosition = function(pos, charCode) {
}
};
const mspVideoSystem = [1,3,4,5]; // indexes of PAL, HDZERO, DJIWTF, & BF43COMPAT
const mspVideoSystem = [1,3,4,5,6]; // indexes of PAL, HDZERO, DJIWTF,AVATAR, & BF43COMPAT
const analogVideoSystem = [0,1,2]; // indexes of AUTO, PAL, & NTSC
OSD.GUI.updateVideoMode = function() {
@ -2422,11 +2431,9 @@ OSD.GUI.updateVideoMode = function() {
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)
$('<option value="' + OSD.constants.VIDEO_TYPES[i] + '">' + OSD.constants.VIDEO_TYPES[i] + '</option>')
.prop('selected', i === OSD.data.preferences.video_system)
.data('type', i)
)
);
}
}
@ -2435,18 +2442,16 @@ OSD.GUI.updateVideoMode = function() {
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)
$('<option value="' + OSD.constants.VIDEO_TYPES[i] + '">' + OSD.constants.VIDEO_TYPES[i] + '</option>')
.prop('selected', i === OSD.data.preferences.video_system)
.data('type', i)
)
);
}
}
}
$videoTypes.find(':radio').click(function () {
OSD.data.preferences.video_system = $(this).data('type');
$videoTypes.change(function () {
OSD.data.preferences.video_system = $(this).find(':selected').data('type');
OSD.updateDisplaySize();
OSD.GUI.saveConfig();
});
@ -2620,9 +2625,10 @@ OSD.GUI.updateFields = function() {
if ($('#videoGuidesToggle').length == false) {
$('#videoGuides').prepend(
$('<input id="videoGuidesToggle" type="checkbox" class="toggle" />')
.attr('checked', false)
.attr('checked', isGuidesChecked)
.on('change', function () {
OSD.GUI.updateGuidesView(this.checked);
chrome.storage.local.set({'showOSDGuides': this.checked});
OSD.GUI.updatePreviews();
})
);
@ -2664,8 +2670,6 @@ OSD.GUI.removeBottomLines = function(){
});
};
OSD.GUI.updateDjiMessageElements = function(on) {
$('.display-field').each(function(index, element) {
var name = $(element).find('input').attr('name');
@ -2699,6 +2703,15 @@ OSD.GUI.updateGuidesView = function(on) {
$('.hd_43_margin_left').toggleClass('dji_hd_43_left', (isDJIWTF && on))
$('.hd_43_margin_right').toggleClass('dji_hd_43_right', (isDJIWTF && on))
isAvatar = OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'AVATAR';
$('.hd_43_margin_left').toggleClass('hd_avatar_43_left', (isAvatar && on))
$('.hd_43_margin_right').toggleClass('hd_avatar_43_right', (isAvatar && on))
$('.hd_avatar_bottom_bar').toggleClass('hd_avatar_bottom', (isAvatar && on))
$('.hd_avatar_storage_box_top').toggleClass('hd_avatar_storagebox_t', (isAvatar && on))
$('.hd_avatar_storage_box_bottom').toggleClass('hd_avatar_storagebox_b', (isAvatar && on))
$('.hd_avatar_storage_box_left').toggleClass('hd_avatar_storagebox_l', (isAvatar && on))
$('.hd_avatar_storage_box_right').toggleClass('hd_avatar_storagebox_r', (isAvatar && on))
isPAL = OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'PAL' || OSD.constants.VIDEO_TYPES[OSD.data.preferences.video_system] == 'AUTO';
$('.pal_ntsc_box_bottom').toggleClass('ntsc_bottom', (isPAL && on))
};
@ -2836,7 +2849,7 @@ OSD.GUI.updatePreviews = function() {
var centerPosition = (OSD.data.display_size.x * OSD.data.display_size.y / 2);
if (OSD.data.display_size.y % 2 == 0) {
centerPosition += OSD.data.display_size.x / 2;
centerPosition += Math.floor(OSD.data.display_size.x / 2);
}
let hudCenterPosition = centerPosition - (OSD.constants.VIDEO_COLS[video_type] * $('#osd_horizon_offset').val());
@ -2970,7 +2983,7 @@ OSD.GUI.updateAll = function() {
OSD.GUI.updateUnits();
OSD.GUI.updateFields();
OSD.GUI.updatePreviews();
OSD.GUI.updateGuidesView(false);
OSD.GUI.updateGuidesView($('#videoGuides').find('input').is(':checked'));
OSD.GUI.updateDjiView(OSD.data.isDjiHdFpv && !OSD.data.isMspDisplay);
};
@ -3029,6 +3042,12 @@ TABS.osd.initialize = function (callback) {
});
});
// Initialise guides checkbox
chrome.storage.local.get('showOSDGuides', function (result) {
if (typeof result.showOSDGuides !== 'undefined') {
isGuidesChecked = result.showOSDGuides;
}
});
// Setup switch indicators
$(".osdSwitchInd_channel option").each(function() {

Loading…
Cancel
Save