 Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
4 hours ago  Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
4 hours ago  Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
4 hours ago  Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
4 hours ago  Embed Video Encoder settings: working Save, logo upload, module removal
- New updateServerModuleSettings.php: saves the Embed Video Encoder
settings window (frame size, port, quality, time stamp / label / logo)
with range checks. Other module types get a clear "not supported".
- Settings window: Save button shown when the content provides
saveSettings(); the Time Stamp, Label and Logo tabs and the show
checkboxes are enabled again.
- Positions are pixel number fields (negative = from right / bottom edge,
as la_mojo uses them); font scale / thickness are number fields; line
type offers OpenCV values (normal 8, thin 4, antialiased 16, old 0/1
shown as 8/4). Hints explain positions and that the time stamp is only
drawn when the label is off.
- New uploadAsset.php: logo upload converts any GD-readable picture to an
RGBA PNG data/assets/images/<md5>.png and stores logo_md5; the preview
shows the current logo and the first upload proposes a size.
- doModuleOperation.php removal: real module type ids (2 Kafka, 6 SSDP,
8 Embed Video, 9 Modem, 12 BVMS, 13 Attention) and tables that do not
exist in the database are skipped instead of failing.
- Frame preview no longer fails when the Logo tab is not rendered yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
4 hours ago |
|
//<?php require_once('../../js_asm.php'); ?>
var addMediaServerDialog = null;function addMediaServer(){ if( addMediaServerDialog == null ){ addMediaServerDialog = new Ext.Window({ modal: true, title: '<?=$Labels->GetLabel("_ADD_MEDIA_SERVER_");?>', width: 800, height: 600, layout: 'fit', closeAction: 'hide', items:{ xtype: 'panel', html: 'KOKO' },bbar: [{ text: '<?=$Labels->GetLabel("_CANCEL_");?>', handler: function(){ addMediaServerDialog.hide(); } },{ id: 'con_to_src', text: '<?=$Labels->GetLabel("_ADD_");?>', disabled: false, handler: connectToSeleced }] }); }; addMediaServerDialog.show();};
var embedVideoEncoderId = 0;
function updateFramePreview(){ var canvas = document.getElementById("eve_frame_preview"); if( canvas != null ){ var ctx = canvas.getContext("2d"); ctx.beginPath(); ctx.fillStyle = "#eeeeee"; ctx.rect( 0, 0, 760, 400 ); ctx.fill(); ctx.closePath(); var f_w = 320; var f_h = 240; var f_p = 0; var fsid = Ext.getCmp('FRM_SIZE').getValue(); switch( fsid ){ case 1: f_w = 640; f_h = 480; f_p = 0; break; case 2: f_w = 800; f_h = 600; f_p = 0; break; case 3: f_w = 1280; f_h = 720; f_p = 1; break; case 4: f_w = 1024; f_h = 768; f_p = 0; break; case 5: f_w = 1920; f_h = 1080; f_p = 1; break; }; ctx.beginPath(); ctx.fillStyle = "#000000"; ctx.font = "20px Arial"; ctx.textAlign = "center"; ctx.textBaseline = "middle"; ctx.fillText( f_w+'x'+f_h, 380, 10 ); ctx.fill(); ctx.fillStyle = "#0000FF"; if( f_p ){ var t_w = 16 * ( 360 / 9 ); ctx.rect( (760-t_w)/2, 20, t_w, 360 ); } else { var t_w = 4 * ( 360 / 3 ); ctx.rect( (760-t_w)/2, 20, t_w, 360 ); }; ctx.fill(); ctx.closePath(); if( Ext.getCmp('eve_show_logo').getValue() ){ var image = document.getElementById('eve_logo_img'); if( image != null && image.complete && image.naturalHeight !== 0 ){ var i_w = Ext.getCmp('LOGO_WIDTH').getValue(); var i_h = Ext.getCmp('LOGO_HEIGHT').getValue(); ctx.drawImage( image, 120, 120, i_w, i_h ); }; }; };};
async function uploadFile() { let formData = new FormData(); formData.append("file", fileupload.files[0]); await fetch( '/upload.php', { method: "POST", body: formData }); alert('The file has been uploaded successfully.');}
function uploadEveLogo(){ var img_upload = document.getElementById('eve_logo_upload'); if( embedVideoEncoderId < 1 || img_upload == null || img_upload.files.length == 0 ) return; var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."}); llMask.show(); var formData = new FormData(); formData.append("file", img_upload.files[0]); formData.append("type", 'eve_logo'); formData.append("id", embedVideoEncoderId ); formData.append("UID", <?=$UserID;?> ); formData.append("SID", '<?=$Session;?>' ); fetch( '/lib/controller/uploadAsset.php', { method: 'POST', body: formData, credentials: 'same-origin' } ) .then( function( r ){ return r.json(); } ) .then( function( data ){ llMask.hide(); if( data.success ){ var image = document.getElementById('eve_logo_img'); if( image ){ image.onload = updateFramePreview; image.src = data.url; }; // first upload: propose the picture size, kept inside 256x256
var lw = Ext.getCmp('LOGO_WIDTH'), lh = Ext.getCmp('LOGO_HEIGHT'); if( lw && lh && ( !lw.getValue() || !lh.getValue() ) ){ var k = Math.min( 1, 256 / Math.max( data.width, data.height ) ); lw.setValue( Math.round( data.width * k ) ); lh.setValue( Math.round( data.height * k ) ); }; } else { Ext.Msg.show({ title: "<?=$Labels->GetLabel('_ERROR_MSG_');?>", msg: data.msg, buttons: Ext.Msg.OK, icon: Ext.MessageBox.ERROR }); }; }) .catch( function( e ){ llMask.hide(); Ext.Msg.show({ title: "<?=$Labels->GetLabel('_ERROR_MSG_');?>", msg: String( e ), buttons: Ext.Msg.OK, icon: Ext.MessageBox.ERROR }); });};
var moduleSettingsEditorWindow = null;
function showModuleSettingsEditor( ModuleID ){ if( moduleSettingsEditorWindow == null ){ moduleSettingsEditorWindow = new Ext.Window({ modal: true, id: 'mo_se_ed_wi', title: '', width: 792, height: 700, layout: 'fit', closeAction: 'hide', resizable: false, items:[], buttons: [{ id: 'mo_se_ed_save', text: "<?=$Labels->GetLabel('_SAVE_');?>", hidden: true, handler: function(){ var c = Ext.getCmp('mod_set_content'); if( c && typeof c.saveSettings == 'function' ) c.saveSettings(); } },{ text: "<?=$Labels->GetLabel('_CLOSE_');?>", handler: function(){ moduleSettingsEditorWindow.hide(); } }] }); }; embedVideoEncoderId = ModuleID; Ext.getCmp('mo_se_ed_save').hide(); moduleSettingsEditorWindow.show(); Ext.Ajax.request({ url: '/lib/controller/getModuleSettings.php', params: { MID: ModuleID, UID: <?=$UserID;?>, SID: '<?=$Session;?>', }, success: function( response, opts ){ var data = Ext.decode( response.responseText ); if( data.status = 'ok' ){ moduleSettingsEditorWindow.setTitle( data.wTitle ); moduleSettingsEditorWindow.removeAll( true ); moduleSettingsEditorWindow.add( data ); moduleSettingsEditorWindow.doLayout(); Ext.getCmp('mo_se_ed_save').setVisible( typeof data.saveSettings == 'function' ); } else { moduleSettingsEditorWindow.close(); moduleSettingsEditorWindow = null; Ext.Msg.show({ title: "<?=$Labels->GetLabel('_ERROR_MSG_');?>", msg: data.msg, buttons: Ext.Msg.OK, fn: function(){ //SettingsLidar3D.hide();
}, icon: Ext.MessageBox.ERROR }); }; }, failure: failureAJAXFunction });};/*function embedVideoEncoderSettings( ModuleID ){ if( embedVideoEncoderSettingsWindow == null ){ embedVideoEncoderSettingsWindow = new Ext.Window({ modal: true, title: '<?=$Labels->GetLabel('_EMBED_VIDEO_ENCODER_');?>', width: 792, height: 700, layout: 'fit', closeAction: 'hide', resizable: false, items:[{ layout: 'table', border: false, frame: false, autoScroll: true, defaults: { bodyStyle:'padding: 0px', border: false, }, layoutConfig: { columns: 4 }, items:[{ id: 'eve_frm_prev', html: '<canvas id="eve_frame_preview" width="760" height="400" style="background: #eeeeee; display: block; margin: 0 auto;"></canvas>', height: 400, width: 760, border: true, colspan: 4 },{ html: '<p><?=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:</p>' },{ xtype: 'combo', id: 'FRM_SIZE', width: 120, typeAhead: true, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ id: 0, fields: [ 'szId', 'szText' ], data: [ [0, '320x240'], [1, '640x480'], [2, '800x600'], [3, '1280x720'], [4, '1024x768'], [5, '1920x1080'] ] }), valueField: 'szId', displayField: 'szText', value: 0, listeners:{ beforeselect: updateFramePreview, //blur: updateFramePreview,
change: updateFramePreview } },{ html: '<p><?=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:</p>' },{ xtype: 'slider', id: 'COMP_QUAL', width: 120, minValue: 0, maxValue: 100, value: 70 },{ html: '<p><?=$Labels->GetLabel('_EVE_SHOW_TS_');?>:</p>' },{ xtype: 'checkbox', id: 'eve_show_ts', value: 0, handler: updateFramePreview },{ html: '<p><?=$Labels->GetLabel('_EVE_TS_POSX_');?>:</p>' },{ xtype: 'slider', id: 'TS_POSX', width: 120, minValue: 0, maxValue: 100, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_TS_POSY_');?>:</p>' },{ xtype: 'slider', id: 'TS_POSY', width: 120, minValue: 0, maxValue: 100, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:</p>' },{ xtype: 'checkbox', id: 'eve_transp_ts', value: 0 },{ html: '<p><?=$Labels->GetLabel('_EVE_FONT_TS_');?>:</p>' },{ xtype: 'combo', id: 'TS_FONT', width: 120, typeAhead: true, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ id: 0, fields: [ 'szId', 'szText' ], data: [ [0, 'SIMPLEX'], [1, 'PLAIN'], [2, 'DUPLEX'], [3, 'COMPLEX'], [4, 'TRIPLEX'], [5, 'COMPLEX_SMALL'], [6, 'SCRIPT_SIMPLEX'], [7, 'SCRIPT_COMPLEX'] ] }), valueField: 'szId', displayField: 'szText', value: 0 },{ html: '<p><?=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:</p>' },{ xtype: 'slider', id: 'TS_FSCALE', width: 120, minValue: 0.0, maxValue: 4.0, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:</p>' },{ xtype: 'slider', id: 'TS_FTHICK', width: 120, minValue: 1, maxValue: 8.0, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:</p>' },{ xtype: 'combo', id: 'TS_LINET', width: 120, typeAhead: true, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ id: 0, fields: [ 'szId', 'szText' ], data: [ [0, 'THIN'], [1, 'ANTIALIAZED'], [2, 'THICK'] ] }), valueField: 'szId', displayField: 'szText', value: 0 },{ html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:</p>' },{ xtype: 'checkbox', id: 'eve_show_lbl', value: 0, handler: updateFramePreview },{ html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSX_');?>:</p>' },{ xtype: 'slider', id: 'LBL_POSX', width: 120, minValue: 0, maxValue: 100, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSY_');?>:</p>' },{ xtype: 'slider', id: 'LBL_POSY', width: 120, minValue: 0, maxValue: 100, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:</p>' },{ xtype: 'checkbox', id: 'eve_transp_lbl', value: 0 },{ html: '<p><?=$Labels->GetLabel('_EVE_FONT_LBL_');?>:</p>' },{ xtype: 'combo', id: 'LBL_FONT', width: 120, typeAhead: true, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ id: 0, fields: [ 'szId', 'szText' ], data: [ [0, 'SIMPLEX'], [1, 'PLAIN'], [2, 'DUPLEX'], [3, 'COMPLEX'], [4, 'TRIPLEX'], [5, 'COMPLEX_SMALL'], [6, 'SCRIPT_SIMPLEX'], [7, 'SCRIPT_COMPLEX'] ] }), valueField: 'szId', displayField: 'szText', value: 0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:</p>' },{ xtype: 'slider', id: 'LBL_FSCALE', width: 120, minValue: 0.0, maxValue: 4.0, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:</p>' },{ xtype: 'slider', id: 'LBL_FTHICK', width: 120, minValue: 1, maxValue: 8.0, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:</p>' },{ xtype: 'combo', id: 'LBL_LINET', width: 120, typeAhead: true, triggerAction: 'all', lazyRender:true, mode: 'local', store: new Ext.data.ArrayStore({ id: 0, fields: [ 'szId', 'szText' ], data: [ [0, 'THIN'], [1, 'ANTIALIAZED'], [2, 'THICK'] ] }), valueField: 'szId', displayField: 'szText', value: 0 },{ html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:</p>' },{ xtype: 'checkbox', id: 'eve_show_logo', value: 0, handler: updateFramePreview },{ html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:</p>' },{ xtype: 'slider', id: 'LOGO_POSX', width: 120, minValue: 0, maxValue: 100, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:</p>' },{ xtype: 'slider', id: 'LOGO_POSY', width: 120, minValue: 0, maxValue: 100, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:</p>' },{ xtype: 'numberfield', id: 'LOGO_WIDTH', width: 120, minValue: 0, maxValue: 256, value: 1.0 },{ html: '<p><?=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:</p>' },{ xtype: 'numberfield', id: 'LOGO_HEIGHT', width: 120, minValue: 0, maxValue: 256, value: 1.0 },{ id: 'eve_logo_ph', html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>' },{ html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>' },{ html: '<p><?=$Labels->GetLabel('_EVE_PORT_');?>:</p>' },{ xtype: 'numberfield', id: 'WA_PORT', width: 120, minValue: 1000, maxValue: 65535, value: 8080 }] }], bbar: [{ text: '<?=$Labels->GetLabel("_CANCEL_");?>', handler: function(){ embedVideoEncoderSettingsWindow.hide(); } },{ id: 'con_to_src', text: '<?=$Labels->GetLabel("_OK_");?>', disabled: false, handler: function(){ } }] }); }; embedVideoEncoderSettingsWindow.show(); updateFramePreview(); /* Ext.Ajax.request({ url: '/lib/controller/getModuleSettings.php', params: { MID: ModuleID, UID: <?=$UserID;?>, SID: '<?=$Session;?>', }, success: function( response, opts ){ var data = Ext.decode( response.responseText ); if( data.error = false ){ embedVideoEncoderSettingsWindow.show(); Ext.getCmp('setting_master_ip').setValue( data.ip_address ); Ext.getCmp('setting_master_port').setValue( data.port ); Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address ); Ext.getCmp('setting_slave_port').setValue( data.aux_port ); Ext.getCmp('setting_lat').setValue( data.lat ); Ext.getCmp('setting_lon').setValue( data.lon ); Ext.getCmp('setting_alt').setValue( data.alt ); Ext.getCmp('setting_roll').setValue( data.roll ); Ext.getCmp('setting_pitch').setValue( data.pitch ); Ext.getCmp('setting_yaw').setValue( data.yaw ); } else { Ext.Msg.show({ title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>', msg: data.error_message, buttons: Ext.Msg.OK, fn: function(){ //SettingsLidar3D.hide();
}, icon: Ext.MessageBox.ERROR }); }; }, failure: failureAJAXFunction }); * /};*/
|