mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 11:59:51 +03:00
Added support for DJI wtfos MSP-OSD full screen 59x22 OSD
This commit is contained in:
parent
0917397880
commit
ffee3d3935
4 changed files with 74 additions and 18 deletions
|
@ -477,9 +477,9 @@ var mspHelper = (function (gui) {
|
||||||
data.getInt8(i + 13)
|
data.getInt8(i + 13)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE:
|
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE:
|
||||||
LOGIC_CONDITIONS.put(new LogicCondition(
|
LOGIC_CONDITIONS.put(new LogicCondition(
|
||||||
data.getInt8(0),
|
data.getInt8(0),
|
||||||
|
@ -788,7 +788,7 @@ var mspHelper = (function (gui) {
|
||||||
}
|
}
|
||||||
CONFIG.target = targetName;
|
CONFIG.target = targetName;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSPCodes.MSP_SET_CHANNEL_FORWARDING:
|
case MSPCodes.MSP_SET_CHANNEL_FORWARDING:
|
||||||
|
@ -2282,8 +2282,8 @@ var mspHelper = (function (gui) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.loadLogicConditions = function (callback) {
|
self.loadLogicConditions = function (callback) {
|
||||||
if (semver.gte(CONFIG.flightControllerVersion, "5.0.0")) {
|
if (semver.gte(CONFIG.flightControllerVersion, "5.0.0")) {
|
||||||
LOGIC_CONDITIONS.flush();
|
LOGIC_CONDITIONS.flush();
|
||||||
let idx = 0;
|
let idx = 0;
|
||||||
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, nextLogicCondition);
|
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, nextLogicCondition);
|
||||||
|
|
|
@ -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 :)
|
||||||
|
@ -538,7 +561,7 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-osd .settings select,
|
.tab-osd .settings select,
|
||||||
.tab-osd .settings input,
|
.tab-osd .settings input,
|
||||||
.tab-osd .osd_settings .switchery,
|
.tab-osd .osd_settings .switchery,
|
||||||
.tab-osd .unit_wrapper {
|
.tab-osd .unit_wrapper {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
|
53
tabs/osd.js
53
tabs/osd.js
|
@ -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();
|
||||||
|
|
|
@ -67,7 +67,7 @@ TABS.ports.initialize = function (callback) {
|
||||||
name: 'VTX_FFPV',
|
name: 'VTX_FFPV',
|
||||||
groups: ['peripherals'],
|
groups: ['peripherals'],
|
||||||
maxPorts: 1 }
|
maxPorts: 1 }
|
||||||
);
|
);
|
||||||
|
|
||||||
functionRules.push({
|
functionRules.push({
|
||||||
name: 'OPFLOW',
|
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);
|
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() {
|
function save_to_eeprom() {
|
||||||
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, on_saved_handler);
|
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, on_saved_handler);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue