Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

567 lines
14 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var addMediaServerDialog = null;
  3. function addMediaServer(){
  4. if( addMediaServerDialog == null ){
  5. addMediaServerDialog = new Ext.Window({
  6. modal: true,
  7. title: '<?=$Labels->GetLabel("_ADD_MEDIA_SERVER_");?>',
  8. width: 800,
  9. height: 600,
  10. layout: 'fit',
  11. closeAction: 'hide',
  12. items:{
  13. xtype: 'panel',
  14. html: 'KOKO'
  15. },bbar: [{
  16. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  17. handler: function(){
  18. addMediaServerDialog.hide();
  19. }
  20. },{
  21. id: 'con_to_src',
  22. text: '<?=$Labels->GetLabel("_ADD_");?>',
  23. disabled: false,
  24. handler: connectToSeleced
  25. }]
  26. });
  27. };
  28. addMediaServerDialog.show();
  29. };
  30. var embedVideoEncoderId = 0;
  31. function updateFramePreview(){
  32. var canvas = document.getElementById("eve_frame_preview");
  33. if( canvas != null ){
  34. var ctx = canvas.getContext("2d");
  35. ctx.beginPath();
  36. ctx.fillStyle = "#eeeeee";
  37. ctx.rect( 0, 0, 760, 400 );
  38. ctx.fill();
  39. ctx.closePath();
  40. var f_w = 320;
  41. var f_h = 240;
  42. var f_p = 0;
  43. var fsid = Ext.getCmp('FRM_SIZE').getValue();
  44. switch( fsid ){
  45. case 1: f_w = 640; f_h = 480; f_p = 0; break;
  46. case 2: f_w = 800; f_h = 600; f_p = 0; break;
  47. case 3: f_w = 1280; f_h = 720; f_p = 1; break;
  48. case 4: f_w = 1024; f_h = 768; f_p = 0; break;
  49. case 5: f_w = 1920; f_h = 1080; f_p = 1; break;
  50. };
  51. ctx.beginPath();
  52. ctx.fillStyle = "#000000";
  53. ctx.font = "20px Arial";
  54. ctx.textAlign = "center";
  55. ctx.textBaseline = "middle";
  56. ctx.fillText( f_w+'x'+f_h, 380, 10 );
  57. ctx.fill();
  58. ctx.fillStyle = "#0000FF";
  59. if( f_p ){
  60. var t_w = 16 * ( 360 / 9 );
  61. ctx.rect( (760-t_w)/2, 20, t_w, 360 );
  62. } else {
  63. var t_w = 4 * ( 360 / 3 );
  64. ctx.rect( (760-t_w)/2, 20, t_w, 360 );
  65. };
  66. ctx.fill();
  67. ctx.closePath();
  68. if( Ext.getCmp('eve_show_logo').getValue() ){
  69. var image = document.getElementById('eve_logo_img');
  70. if( image.complete && image.naturalHeight !== 0 ){
  71. var i_w = Ext.getCmp('LOGO_WIDTH').getValue();
  72. var i_h = Ext.getCmp('LOGO_HEIGHT').getValue();
  73. ctx.drawImage( image, 120, 120, i_w, i_h );
  74. };
  75. };
  76. };
  77. };
  78. async function uploadFile() {
  79. let formData = new FormData();
  80. formData.append("file", fileupload.files[0]);
  81. await fetch( '/upload.php', {
  82. method: "POST",
  83. body: formData
  84. });
  85. alert('The file has been uploaded successfully.');
  86. }
  87. function uploadEveLogo(){
  88. if( embedVideoEncoderId > -1 ){
  89. var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."});
  90. llMask.show();
  91. var formData = new FormData();
  92. var img_upload = document.getElementById('eve_logo_upload');
  93. formData.append("file", img_upload.files[0]);
  94. formData.append("type", 'eve_logo');
  95. formData.append("id", embedVideoEncoderId );
  96. $.ajax({
  97. type: 'POST',
  98. url: '/lib/controller/uploadAsset.php',
  99. data: formData,
  100. cache: false,
  101. contentType: false,
  102. processData: false,
  103. success: function( data ){
  104. llMask.hide();
  105. console.log("success");
  106. console.log( data );
  107. },
  108. error: function( data ){
  109. llMask.hide();
  110. console.log("error");
  111. console.log(data);
  112. }
  113. });
  114. /*
  115. Ext.Ajax.request({
  116. url: SITE_URL+'upload/',
  117. headers: {'Content-type':'multipart/form-data'},
  118. form: filefield.up('form').getForm(),
  119. isUpload: true,
  120. success: function(response, options) { console.log(arguments); },
  121. failure: function(response, options) { console.log(arguments); }
  122. });
  123. */
  124. };
  125. };
  126. var moduleSettingsEditorWindow = null;
  127. function showModuleSettingsEditor( ModuleID ){
  128. if( moduleSettingsEditorWindow == null ){
  129. moduleSettingsEditorWindow = new Ext.Window({
  130. modal: true,
  131. id: 'mo_se_ed_wi',
  132. title: '',
  133. width: 792,
  134. height: 700,
  135. layout: 'fit',
  136. closeAction: 'hide',
  137. resizable: false,
  138. items:[],
  139. buttons: [{
  140. text: "<?=$Labels->GetLabel('_CLOSE_');?>",
  141. handler: function(){
  142. moduleSettingsEditorWindow.hide();
  143. }
  144. }]
  145. });
  146. };
  147. moduleSettingsEditorWindow.show();
  148. Ext.Ajax.request({
  149. url: '/lib/controller/getModuleSettings.php',
  150. params: {
  151. MID: ModuleID,
  152. UID: <?=$UserID;?>,
  153. SID: '<?=$Session;?>',
  154. },
  155. success: function( response, opts ){
  156. var data = Ext.decode( response.responseText );
  157. if( data.status = 'ok' ){
  158. moduleSettingsEditorWindow.setTitle( data.wTitle );
  159. moduleSettingsEditorWindow.removeAll( true );
  160. moduleSettingsEditorWindow.add( data );
  161. moduleSettingsEditorWindow.doLayout();
  162. } else {
  163. moduleSettingsEditorWindow.close();
  164. moduleSettingsEditorWindow = null;
  165. Ext.Msg.show({
  166. title: "<?=$Labels->GetLabel('_ERROR_MSG_');?>",
  167. msg: data.msg,
  168. buttons: Ext.Msg.OK,
  169. fn: function(){
  170. //SettingsLidar3D.hide();
  171. },
  172. icon: Ext.MessageBox.ERROR
  173. });
  174. };
  175. },
  176. failure: failureAJAXFunction
  177. });
  178. };
  179. /*
  180. function embedVideoEncoderSettings( ModuleID ){
  181. if( embedVideoEncoderSettingsWindow == null ){
  182. embedVideoEncoderSettingsWindow = new Ext.Window({
  183. modal: true,
  184. title: '<?=$Labels->GetLabel('_EMBED_VIDEO_ENCODER_');?>',
  185. width: 792,
  186. height: 700,
  187. layout: 'fit',
  188. closeAction: 'hide',
  189. resizable: false,
  190. items:[{
  191. layout: 'table',
  192. border: false,
  193. frame: false,
  194. autoScroll: true,
  195. defaults: {
  196. bodyStyle:'padding: 0px',
  197. border: false,
  198. },
  199. layoutConfig: {
  200. columns: 4
  201. },
  202. items:[{
  203. id: 'eve_frm_prev',
  204. html: '<canvas id="eve_frame_preview" width="760" height="400" style="background: #eeeeee; display: block; margin: 0 auto;"></canvas>',
  205. height: 400,
  206. width: 760,
  207. border: true,
  208. colspan: 4
  209. },{
  210. html: '<p><?=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:</p>'
  211. },{
  212. xtype: 'combo',
  213. id: 'FRM_SIZE',
  214. width: 120,
  215. typeAhead: true,
  216. triggerAction: 'all',
  217. lazyRender:true,
  218. mode: 'local',
  219. store: new Ext.data.ArrayStore({
  220. id: 0,
  221. fields: [ 'szId', 'szText' ],
  222. data: [
  223. [0, '320x240'],
  224. [1, '640x480'],
  225. [2, '800x600'],
  226. [3, '1280x720'],
  227. [4, '1024x768'],
  228. [5, '1920x1080']
  229. ]
  230. }),
  231. valueField: 'szId',
  232. displayField: 'szText',
  233. value: 0,
  234. listeners:{
  235. beforeselect: updateFramePreview,
  236. //blur: updateFramePreview,
  237. change: updateFramePreview
  238. }
  239. },{
  240. html: '<p><?=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:</p>'
  241. },{
  242. xtype: 'slider',
  243. id: 'COMP_QUAL',
  244. width: 120,
  245. minValue: 0,
  246. maxValue: 100,
  247. value: 70
  248. },{
  249. html: '<p><?=$Labels->GetLabel('_EVE_SHOW_TS_');?>:</p>'
  250. },{
  251. xtype: 'checkbox',
  252. id: 'eve_show_ts',
  253. value: 0,
  254. handler: updateFramePreview
  255. },{
  256. html: '<p><?=$Labels->GetLabel('_EVE_TS_POSX_');?>:</p>'
  257. },{
  258. xtype: 'slider',
  259. id: 'TS_POSX',
  260. width: 120,
  261. minValue: 0,
  262. maxValue: 100,
  263. value: 1.0
  264. },{
  265. html: '<p><?=$Labels->GetLabel('_EVE_TS_POSY_');?>:</p>'
  266. },{
  267. xtype: 'slider',
  268. id: 'TS_POSY',
  269. width: 120,
  270. minValue: 0,
  271. maxValue: 100,
  272. value: 1.0
  273. },{
  274. html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:</p>'
  275. },{
  276. xtype: 'checkbox',
  277. id: 'eve_transp_ts',
  278. value: 0
  279. },{
  280. html: '<p><?=$Labels->GetLabel('_EVE_FONT_TS_');?>:</p>'
  281. },{
  282. xtype: 'combo',
  283. id: 'TS_FONT',
  284. width: 120,
  285. typeAhead: true,
  286. triggerAction: 'all',
  287. lazyRender:true,
  288. mode: 'local',
  289. store: new Ext.data.ArrayStore({
  290. id: 0,
  291. fields: [ 'szId', 'szText' ],
  292. data: [
  293. [0, 'SIMPLEX'],
  294. [1, 'PLAIN'],
  295. [2, 'DUPLEX'],
  296. [3, 'COMPLEX'],
  297. [4, 'TRIPLEX'],
  298. [5, 'COMPLEX_SMALL'],
  299. [6, 'SCRIPT_SIMPLEX'],
  300. [7, 'SCRIPT_COMPLEX']
  301. ]
  302. }),
  303. valueField: 'szId',
  304. displayField: 'szText',
  305. value: 0
  306. },{
  307. html: '<p><?=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:</p>'
  308. },{
  309. xtype: 'slider',
  310. id: 'TS_FSCALE',
  311. width: 120,
  312. minValue: 0.0,
  313. maxValue: 4.0,
  314. value: 1.0
  315. },{
  316. html: '<p><?=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:</p>'
  317. },{
  318. xtype: 'slider',
  319. id: 'TS_FTHICK',
  320. width: 120,
  321. minValue: 1,
  322. maxValue: 8.0,
  323. value: 1.0
  324. },{
  325. html: '<p><?=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:</p>'
  326. },{
  327. xtype: 'combo',
  328. id: 'TS_LINET',
  329. width: 120,
  330. typeAhead: true,
  331. triggerAction: 'all',
  332. lazyRender:true,
  333. mode: 'local',
  334. store: new Ext.data.ArrayStore({
  335. id: 0,
  336. fields: [ 'szId', 'szText' ],
  337. data: [
  338. [0, 'THIN'],
  339. [1, 'ANTIALIAZED'],
  340. [2, 'THICK']
  341. ]
  342. }),
  343. valueField: 'szId',
  344. displayField: 'szText',
  345. value: 0
  346. },{
  347. html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:</p>'
  348. },{
  349. xtype: 'checkbox',
  350. id: 'eve_show_lbl',
  351. value: 0,
  352. handler: updateFramePreview
  353. },{
  354. html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSX_');?>:</p>'
  355. },{
  356. xtype: 'slider',
  357. id: 'LBL_POSX',
  358. width: 120,
  359. minValue: 0,
  360. maxValue: 100,
  361. value: 1.0
  362. },{
  363. html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSY_');?>:</p>'
  364. },{
  365. xtype: 'slider',
  366. id: 'LBL_POSY',
  367. width: 120,
  368. minValue: 0,
  369. maxValue: 100,
  370. value: 1.0
  371. },{
  372. html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:</p>'
  373. },{
  374. xtype: 'checkbox',
  375. id: 'eve_transp_lbl',
  376. value: 0
  377. },{
  378. html: '<p><?=$Labels->GetLabel('_EVE_FONT_LBL_');?>:</p>'
  379. },{
  380. xtype: 'combo',
  381. id: 'LBL_FONT',
  382. width: 120,
  383. typeAhead: true,
  384. triggerAction: 'all',
  385. lazyRender:true,
  386. mode: 'local',
  387. store: new Ext.data.ArrayStore({
  388. id: 0,
  389. fields: [ 'szId', 'szText' ],
  390. data: [
  391. [0, 'SIMPLEX'],
  392. [1, 'PLAIN'],
  393. [2, 'DUPLEX'],
  394. [3, 'COMPLEX'],
  395. [4, 'TRIPLEX'],
  396. [5, 'COMPLEX_SMALL'],
  397. [6, 'SCRIPT_SIMPLEX'],
  398. [7, 'SCRIPT_COMPLEX']
  399. ]
  400. }),
  401. valueField: 'szId',
  402. displayField: 'szText',
  403. value: 0
  404. },{
  405. html: '<p><?=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:</p>'
  406. },{
  407. xtype: 'slider',
  408. id: 'LBL_FSCALE',
  409. width: 120,
  410. minValue: 0.0,
  411. maxValue: 4.0,
  412. value: 1.0
  413. },{
  414. html: '<p><?=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:</p>'
  415. },{
  416. xtype: 'slider',
  417. id: 'LBL_FTHICK',
  418. width: 120,
  419. minValue: 1,
  420. maxValue: 8.0,
  421. value: 1.0
  422. },{
  423. html: '<p><?=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:</p>'
  424. },{
  425. xtype: 'combo',
  426. id: 'LBL_LINET',
  427. width: 120,
  428. typeAhead: true,
  429. triggerAction: 'all',
  430. lazyRender:true,
  431. mode: 'local',
  432. store: new Ext.data.ArrayStore({
  433. id: 0,
  434. fields: [ 'szId', 'szText' ],
  435. data: [
  436. [0, 'THIN'],
  437. [1, 'ANTIALIAZED'],
  438. [2, 'THICK']
  439. ]
  440. }),
  441. valueField: 'szId',
  442. displayField: 'szText',
  443. value: 0
  444. },{
  445. html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:</p>'
  446. },{
  447. xtype: 'checkbox',
  448. id: 'eve_show_logo',
  449. value: 0,
  450. handler: updateFramePreview
  451. },{
  452. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:</p>'
  453. },{
  454. xtype: 'slider',
  455. id: 'LOGO_POSX',
  456. width: 120,
  457. minValue: 0,
  458. maxValue: 100,
  459. value: 1.0
  460. },{
  461. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:</p>'
  462. },{
  463. xtype: 'slider',
  464. id: 'LOGO_POSY',
  465. width: 120,
  466. minValue: 0,
  467. maxValue: 100,
  468. value: 1.0
  469. },{
  470. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:</p>'
  471. },{
  472. xtype: 'numberfield',
  473. id: 'LOGO_WIDTH',
  474. width: 120,
  475. minValue: 0,
  476. maxValue: 256,
  477. value: 1.0
  478. },{
  479. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:</p>'
  480. },{
  481. xtype: 'numberfield',
  482. id: 'LOGO_HEIGHT',
  483. width: 120,
  484. minValue: 0,
  485. maxValue: 256,
  486. value: 1.0
  487. },{
  488. id: 'eve_logo_ph',
  489. html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>'
  490. },{
  491. html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>'
  492. },{
  493. html: '<p><?=$Labels->GetLabel('_EVE_PORT_');?>:</p>'
  494. },{
  495. xtype: 'numberfield',
  496. id: 'WA_PORT',
  497. width: 120,
  498. minValue: 1000,
  499. maxValue: 65535,
  500. value: 8080
  501. }]
  502. }],
  503. bbar: [{
  504. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  505. handler: function(){
  506. embedVideoEncoderSettingsWindow.hide();
  507. }
  508. },{
  509. id: 'con_to_src',
  510. text: '<?=$Labels->GetLabel("_OK_");?>',
  511. disabled: false,
  512. handler: function(){
  513. }
  514. }]
  515. });
  516. };
  517. embedVideoEncoderSettingsWindow.show();
  518. updateFramePreview();
  519. /*
  520. Ext.Ajax.request({
  521. url: '/lib/controller/getModuleSettings.php',
  522. params: {
  523. MID: ModuleID,
  524. UID: <?=$UserID;?>,
  525. SID: '<?=$Session;?>',
  526. },
  527. success: function( response, opts ){
  528. var data = Ext.decode( response.responseText );
  529. if( data.error = false ){
  530. embedVideoEncoderSettingsWindow.show();
  531. Ext.getCmp('setting_master_ip').setValue( data.ip_address );
  532. Ext.getCmp('setting_master_port').setValue( data.port );
  533. Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
  534. Ext.getCmp('setting_slave_port').setValue( data.aux_port );
  535. Ext.getCmp('setting_lat').setValue( data.lat );
  536. Ext.getCmp('setting_lon').setValue( data.lon );
  537. Ext.getCmp('setting_alt').setValue( data.alt );
  538. Ext.getCmp('setting_roll').setValue( data.roll );
  539. Ext.getCmp('setting_pitch').setValue( data.pitch );
  540. Ext.getCmp('setting_yaw').setValue( data.yaw );
  541. } else {
  542. Ext.Msg.show({
  543. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  544. msg: data.error_message,
  545. buttons: Ext.Msg.OK,
  546. fn: function(){
  547. //SettingsLidar3D.hide();
  548. },
  549. icon: Ext.MessageBox.ERROR
  550. });
  551. };
  552. },
  553. failure: failureAJAXFunction
  554. });
  555. * /
  556. };*/