2017-02-08 14:36:28 +01:00
|
|
|
$(document).ready( function() {
|
|
|
|
performTranslation();
|
|
|
|
var conf_editor_v4l2 = null;
|
|
|
|
var conf_editor_fg = null;
|
2018-12-27 23:11:32 +01:00
|
|
|
var conf_editor_instCapt = null;
|
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
function hideEl(el)
|
|
|
|
{
|
|
|
|
for(var i = 0; i<el.length; i++)
|
|
|
|
{
|
|
|
|
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
|
|
|
|
}
|
|
|
|
}
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
if(window.showOptHelp)
|
2017-01-17 21:53:35 +01:00
|
|
|
{
|
2018-12-27 23:11:32 +01:00
|
|
|
//fg
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont').append(createRow('conf_cont_instCapt'));
|
2018-12-27 23:11:32 +01:00
|
|
|
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
//fg
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont').append(createRow('conf_cont_fg'));
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
//v4l
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont').append(createRow('conf_cont_v4l'));
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
2019-06-05 18:19:08 +02:00
|
|
|
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
2017-01-17 21:53:35 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('#conf_cont').addClass('row');
|
2018-12-27 23:11:32 +01:00
|
|
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
|
2018-12-27 23:11:32 +01:00
|
|
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
|
2017-01-17 21:53:35 +01:00
|
|
|
}
|
2018-12-27 23:11:32 +01:00
|
|
|
//instCapt
|
|
|
|
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
|
2019-06-05 18:19:08 +02:00
|
|
|
instCapture: window.schema.instCapture
|
2018-12-27 23:11:32 +01:00
|
|
|
}, true, true);
|
|
|
|
|
|
|
|
conf_editor_instCapt.on('change',function() {
|
|
|
|
conf_editor_instCapt.validate().length ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#btn_submit_instCapt').off().on('click',function() {
|
|
|
|
requestWriteConfig(conf_editor_instCapt.getValue());
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
//fg
|
2016-12-21 18:24:03 +01:00
|
|
|
conf_editor_fg = createJsonEditor('editor_container_fg', {
|
2019-06-05 18:19:08 +02:00
|
|
|
framegrabber: window.schema.framegrabber
|
2016-12-21 18:24:03 +01:00
|
|
|
}, true, true);
|
2016-09-07 20:10:37 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
conf_editor_fg.on('change',function() {
|
|
|
|
conf_editor_fg.validate().length ? $('#btn_submit_fg').attr('disabled', true) : $('#btn_submit_fg').attr('disabled', false);
|
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2016-12-21 18:24:03 +01:00
|
|
|
$('#btn_submit_fg').off().on('click',function() {
|
|
|
|
requestWriteConfig(conf_editor_fg.getValue());
|
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
//vl4
|
2016-12-21 18:24:03 +01:00
|
|
|
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
|
2019-06-05 18:19:08 +02:00
|
|
|
grabberV4L2 : window.schema.grabberV4L2
|
2016-12-21 18:24:03 +01:00
|
|
|
}, true, true);
|
2016-09-10 23:30:05 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
conf_editor_v4l2.on('change',function() {
|
|
|
|
conf_editor_v4l2.validate().length ? $('#btn_submit_v4l2').attr('disabled', true) : $('#btn_submit_v4l2').attr('disabled', false);
|
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2016-12-21 18:24:03 +01:00
|
|
|
$('#btn_submit_v4l2').off().on('click',function() {
|
|
|
|
requestWriteConfig(conf_editor_v4l2.getValue());
|
2016-10-10 23:15:50 +02:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
//create introduction
|
2019-06-05 18:19:08 +02:00
|
|
|
if(window.showOptHelp)
|
2017-02-08 14:36:28 +01:00
|
|
|
{
|
|
|
|
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
|
|
|
|
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
|
|
|
}
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
//hide specific options
|
|
|
|
conf_editor_fg.on('ready',function() {
|
2019-06-05 18:19:08 +02:00
|
|
|
var grabbers = window.serverInfo.grabbers.available;
|
2017-02-28 17:53:41 +01:00
|
|
|
|
|
|
|
if(grabbers.indexOf('dispmanx') > -1)
|
2018-12-27 23:11:32 +01:00
|
|
|
hideEl(["device","pixelDecimation"]);
|
2017-02-28 17:53:41 +01:00
|
|
|
else if(grabbers.indexOf('x11') > -1)
|
|
|
|
hideEl(["device","width","height"]);
|
2017-09-01 08:50:37 +02:00
|
|
|
else if(grabbers.indexOf('osx') > -1 )
|
2018-12-27 23:11:32 +01:00
|
|
|
hideEl(["device","pixelDecimation"]);
|
2017-09-01 08:50:37 +02:00
|
|
|
else if(grabbers.indexOf('amlogic') > -1)
|
2018-12-27 23:11:32 +01:00
|
|
|
hideEl(["pixelDecimation"]);
|
2017-02-28 17:53:41 +01:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
removeOverlay();
|
2016-09-07 20:10:37 +02:00
|
|
|
});
|