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.

438 lines
13 KiB

5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. {
  2. id: 'db_node_%%%NODEID%%%',
  3. //width: 258,
  4. //height: 336,
  5. title: '%%%NODENAME%%%',
  6. draggable: false,
  7. collapsible: false,
  8. tools: [{
  9. id:'toggle',
  10. handler: function( a, b, p ){
  11. fsDrawID = %%%NODEID%%%;
  12. exitFromFF = function(){
  13. nodeTHREEviewers[%%%NODEID%%%].renderer.setSize( nodeTHREEviewers[%%%NODEID%%%].container.clientWidth, (nodeTHREEviewers[%%%NODEID%%%].container.clientHeight-60) );
  14. exitFromFF = null;
  15. };
  16. fullScreen( 'div_radar_%%%NODEID%%%' );
  17. //var el = document.getElementById('draw_svg_'+fsDrawID );
  18. //var nW = Math.floor( ( window.screen.height/window.screen.width ) * 100 );
  19. //el.removeAttribute("width");
  20. //el.setAttribute( "width", nW+'%' );
  21. nodeTHREEviewers[%%%NODEID%%%].renderer.setSize( window.screen.width, window.screen.height );//200 );
  22. }
  23. }],
  24. listeners:{
  25. beforedestroy: function(){
  26. if( typeof nodeTHREEviewers[%%%NODEID%%%] !== 'undefined' ){
  27. //nodeTHREEviewers[%%%NODEID%%%].container
  28. // object.geometry.dispose(); object.material.dispose(); scene.remove( object );
  29. stopAnimation();
  30. nodeTHREEviewers[%%%NODEID%%%].renderer.renderLists.dispose();
  31. delete nodeTHREEviewers[%%%NODEID%%%].renderer;
  32. delete nodeTHREEviewers[%%%NODEID%%%].scene;
  33. delete nodeTHREEviewers[%%%NODEID%%%].mesh;
  34. delete nodeTHREEviewers[%%%NODEID%%%].geometry;
  35. delete nodeTHREEviewers[%%%NODEID%%%].material;
  36. delete nodeTHREEviewers[%%%NODEID%%%].texture;
  37. delete nodeTHREEviewers[%%%NODEID%%%].camera;
  38. delete nodeTHREEviewers[%%%NODEID%%%];
  39. };
  40. return true;
  41. },
  42. afterrender: function( p ){
  43. var W = p.getWidth();
  44. var H = W + 28;
  45. //if( %%%APPTYPE%%% == 2 ){
  46. // H = PanelH - p.ownerCt.getHeight() + 64;
  47. // if( H > ( W * 0.5625 )+ 32 ){
  48. // H = ( W * 0.5625 ) + 32;
  49. // };
  50. //} else {
  51. // H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight();
  52. //};
  53. //alert( W + ' koko ' + H );
  54. p.setHeight( H );
  55. Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setHeight( H );//- 70 );
  56. //Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setWidth( H );// - 70 );
  57. var el = document.getElementById( 'div_radar_%%%NODEID%%%' )
  58. //el.removeAttribute("height");
  59. el.removeAttribute("style");
  60. el.setAttribute("style","display: block; padding: 5px; width: \'100%\'; height:"+(H-20)+"px");
  61. //el.setAttribute( "height", H-20 );//'86%' );
  62. //cleanupDraw( %%%NODEID%%% );
  63. //drawZoomLevels[%%%NODEID%%%]=100;
  64. //const panorama = new PANOLENS.ImagePanorama( '/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%' );
  65. //const viewer = new PANOLENS.Viewer({container: 'targ_canvas_%%%NODEID%%%' });
  66. //viewer.add( panorama );
  67. nodeTHREEviewers[%%%NODEID%%%] = {};
  68. nodeTHREEviewers[%%%NODEID%%%].container = document.getElementById( 'div_radar_%%%NODEID%%%' );
  69. nodeTHREEviewers[%%%NODEID%%%].camera = new THREE.PerspectiveCamera( 100, 1, 1, 600 );
  70. nodeTHREEviewers[%%%NODEID%%%].camera.fov = 75;
  71. nodeTHREEviewers[%%%NODEID%%%].scene = new THREE.Scene();
  72. nodeTHREEviewers[%%%NODEID%%%].geometry = new THREE.SphereGeometry( 500, 60, 40 );
  73. // invert the geometry on the x-axis so that all of the faces point inward
  74. nodeTHREEviewers[%%%NODEID%%%].geometry.scale( -1, 1, 1 );
  75. nodeTHREEviewers[%%%NODEID%%%].texture = new THREE.TextureLoader().load( '/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%' );
  76. nodeTHREEviewers[%%%NODEID%%%].material = new THREE.MeshBasicMaterial( { map: nodeTHREEviewers[%%%NODEID%%%].texture } );
  77. nodeTHREEviewers[%%%NODEID%%%].mesh = new THREE.Mesh( nodeTHREEviewers[%%%NODEID%%%].geometry, nodeTHREEviewers[%%%NODEID%%%].material );
  78. nodeTHREEviewers[%%%NODEID%%%].scene.add( nodeTHREEviewers[%%%NODEID%%%].mesh );
  79. nodeTHREEviewers[%%%NODEID%%%].scene.add( l3dMapOverlayMesh );
  80. nodeTHREEviewers[%%%NODEID%%%].renderer = new THREE.WebGLRenderer();
  81. nodeTHREEviewers[%%%NODEID%%%].renderer.setPixelRatio( 1 );
  82. nodeTHREEviewers[%%%NODEID%%%].renderer.setSize( nodeTHREEviewers[%%%NODEID%%%].container.clientWidth, (H-80) );
  83. nodeTHREEviewers[%%%NODEID%%%].container.appendChild( nodeTHREEviewers[%%%NODEID%%%].renderer.domElement );
  84. nodeTHREEviewers[%%%NODEID%%%].container.style.touchAction = 'none';
  85. nodeTHREEviewers[%%%NODEID%%%].container.myVID = %%%NODEID%%%;
  86. nodeTHREEviewers[%%%NODEID%%%].container.addEventListener( 'pointerdown', onPointerDown );
  87. nodeTHREEviewers[%%%NODEID%%%].container.addEventListener( 'wheel', onDocumentMouseWheel );
  88. nodeTHREEviewers[%%%NODEID%%%].targets = new Array();
  89. nodeTHREEviewers[%%%NODEID%%%].targetShowCopunter = 0;
  90. nodeTHREEviewers[%%%NODEID%%%].targetIndex = 0;
  91. //addl3dTarget( %%%NODEID%%%, 200, Math.PI/4, Math.PI/4 );
  92. //addl3dTarget( %%%NODEID%%%, 150, 0, 0 );
  93. //document.addEventListener( 'wheel', onDocumentMouseWheel );
  94. /*
  95. container.addEventListener( 'dragover', function ( event ) {
  96. event.preventDefault();
  97. event.dataTransfer.dropEffect = 'copy';
  98. } );
  99. container.addEventListener('dragenter', function () {
  100. document.body.style.opacity = 0.5;
  101. } );
  102. container.addEventListener('dragleave', function () {
  103. document.body.style.opacity = 1;
  104. } );
  105. container.addEventListener('drop', function ( event ) {
  106. event.preventDefault();
  107. const reader = new FileReader();
  108. reader.addEventListener( 'load', function ( event ) {
  109. material.map.image.src = event.target.result;
  110. material.map.needsUpdate = true;
  111. } );
  112. reader.readAsDataURL( event.dataTransfer.files[ 0 ] );
  113. document.body.style.opacity = 1;
  114. } );
  115. */
  116. /*
  117. document.addEventListener( 'dragover', function ( event ) {
  118. event.preventDefault();
  119. event.dataTransfer.dropEffect = 'copy';
  120. } );
  121. document.addEventListener( 'dragenter', function () {
  122. document.body.style.opacity = 0.5;
  123. } );
  124. document.addEventListener( 'dragleave', function () {
  125. document.body.style.opacity = 1;
  126. } );
  127. document.addEventListener( 'drop', function ( event ) {
  128. event.preventDefault();
  129. const reader = new FileReader();
  130. reader.addEventListener( 'load', function ( event ) {
  131. material.map.image.src = event.target.result;
  132. material.map.needsUpdate = true;
  133. } );
  134. reader.readAsDataURL( event.dataTransfer.files[ 0 ] );
  135. document.body.style.opacity = 1;
  136. } );
  137. */
  138. //animateTargets();
  139. animate();
  140. //
  141. //window.addEventListener( 'resize', onWindowResize );
  142. }
  143. },
  144. layout:'border',
  145. items:[{
  146. id: 'cp_radar_%%%NODEID%%%',
  147. region: 'center',
  148. html: '<div id="div_radar_%%%NODEID%%%" style="display: block; padding: 5px; width: \'100%\'; height: \'100%\';"></div>',
  149. width: '56%'
  150. },{
  151. region: 'east',
  152. collapsible: true,
  153. minSize: 75, // defaults to 50
  154. maxSize: 220,
  155. frame: false,
  156. border: false,
  157. collapsed: true,
  158. collapseMode: 'mini',
  159. title: '%%%LABEL%%%TOOLBOX%%%',
  160. floatable: true,
  161. animFloat: false,
  162. autoHide: true,
  163. id: 'toolbox_%%%NODEID%%%',
  164. //unstyled: true,
  165. margins: '5 0 0 5',
  166. //cmargins: '5 0 5 5',
  167. width: 200,
  168. items:[{
  169. xtype: 'spacer',
  170. height: 3
  171. },{
  172. xtype: 'button',
  173. id: 'cp_clear_btn_%%%NODEID%%%',
  174. width: '100%',
  175. disabled: true,
  176. text: '%%%LABEL%%%CLEALARM%%%',
  177. iconCls: 'ctrl_panel_clean_sm',
  178. iconAlign: 'left',
  179. handler: function(){
  180. doDeviceOperation( 1, 125,'', true );
  181. }
  182. },{
  183. xtype: 'spacer',
  184. height: 3
  185. },{
  186. xtype: 'button',
  187. id: 'cp_draw_btn_%%%NODEID%%%',
  188. width: '100%',
  189. text: '%%%LABEL%%%DRABACKGROUND%%%',
  190. iconCls: 'ctrl_panel_drawscan_sm',
  191. iconAlign: 'left',
  192. disabled: true,
  193. handler: function(){
  194. doDeviceOperation( %%%NODEID%%%, 3,'', true );
  195. }
  196. },{
  197. xtype: 'spacer',
  198. height: 3
  199. },{
  200. xtype: 'button',
  201. id: 'cp_study_btn_%%%NODEID%%%',
  202. width: '100%',
  203. text: '%%%LABEL%%%STUBACKGROUND%%%',
  204. iconCls: 'ctrl_panel_study_sm',
  205. iconAlign: 'left',
  206. disabled: true,
  207. handler: function(){
  208. doDeviceOperation( %%%NODEID%%%, 2,'', true );
  209. }
  210. },{
  211. xtype: 'spacer',
  212. height: 3
  213. },{
  214. xtype: 'button',
  215. text: '%%%LABEL%%%MASKEDITOR%%%',
  216. id: 'DMED_%%%NODEID%%%',
  217. width: '100%',
  218. disabled: true,
  219. iconCls: 'ctrl_panel_drawscan_sm',
  220. handler: function(){
  221. showMaskEditor( false, 0, %%%NODEID%%% );
  222. }
  223. },{
  224. xtype: 'spacer',
  225. height: 3
  226. },{
  227. xtype: 'panel',
  228. title: '%%%LABEL%%%MASKMNGR%%%',
  229. height: 70,
  230. frame: true,
  231. flex: 1,
  232. layout: 'hbox',
  233. items:[{
  234. xtype: 'button',
  235. enableToggle: true,
  236. width: '20%',
  237. scale: 'medium',//scale: 'small',
  238. id: 'mz_btn_%%%NODEID%%%_0',
  239. iconCls: 'mask_zone1_btn',
  240. iconAlign: 'top',
  241. pressed: false,
  242. disabled: true,
  243. handler: function(){
  244. if( Ext.getCmp('mz_btn_%%%NODEID%%%_0').pressed){
  245. doMaskOperation( %%%NODEID%%%, 1, 0 );
  246. } else {
  247. doMaskOperation( %%%NODEID%%%, 0, 0 );
  248. };
  249. }
  250. },{
  251. xtype: 'button',
  252. enableToggle: true,
  253. width: '20%',
  254. scale: 'medium',
  255. id: 'mz_btn_%%%NODEID%%%_1',
  256. iconCls: 'mask_zone2_btn',
  257. iconAlign: 'top',
  258. pressed: false,
  259. disabled: true,
  260. handler: function(){
  261. if( Ext.getCmp('mz_btn_%%%NODEID%%%_1').pressed){
  262. doMaskOperation( %%%NODEID%%%, 1, 1 );
  263. } else {
  264. doMaskOperation( %%%NODEID%%%, 0, 1 );
  265. };
  266. }
  267. },{
  268. xtype: 'button',
  269. enableToggle: true,
  270. width: '19%',
  271. scale: 'medium',//scale: 'large',
  272. id: 'mz_btn_%%%NODEID%%%_2',
  273. iconCls: 'mask_zone3_btn',
  274. iconAlign: 'top',
  275. pressed: false,
  276. disabled: true,
  277. handler: function(){
  278. if( Ext.getCmp('mz_btn_%%%NODEID%%%_2').pressed){
  279. doMaskOperation( %%%NODEID%%%, 1, 2 );
  280. } else {
  281. doMaskOperation( %%%NODEID%%%, 0, 2 );
  282. };
  283. }
  284. },{
  285. xtype: 'button',
  286. enableToggle: true,
  287. width: '20%',
  288. scale: 'medium',//scale: 'large',
  289. id: 'mz_btn_%%%NODEID%%%_3',
  290. iconCls: 'mask_zone4_btn',
  291. iconAlign: 'top',
  292. pressed: false,
  293. disabled: true,
  294. handler: function(){
  295. if( Ext.getCmp('mz_btn_%%%NODEID%%%_3').pressed){
  296. doMaskOperation( %%%NODEID%%%, 1, 3 );
  297. } else {
  298. doMaskOperation( %%%NODEID%%%, 0, 3 );
  299. };
  300. }
  301. },{
  302. xtype: 'button',
  303. enableToggle: true,
  304. width: '20%',
  305. scale: 'medium',//scale: 'large',
  306. id: 'mz_btn_%%%NODEID%%%_4',
  307. iconCls: 'mask_zone5_btn',
  308. iconAlign: 'top',
  309. pressed: false,
  310. disabled: true,
  311. handler: function(){
  312. if( Ext.getCmp('mz_btn_%%%NODEID%%%_4').pressed){
  313. doMaskOperation( %%%NODEID%%%, 1, 4 );
  314. } else {
  315. doMaskOperation( %%%NODEID%%%, 0, 4 );
  316. };
  317. }
  318. }]
  319. },{
  320. xtype: 'spacer',
  321. height: 3
  322. },{
  323. xtype: 'button',
  324. width: '100%',
  325. enableToggle: true,
  326. id: 'cp_ack_btn_%%%NODEID%%%',
  327. text: '%%%LABEL%%%ACKNOLAGE%%%',
  328. iconCls: 'ctrl_panel_clean_sm',
  329. iconAlign: 'left',
  330. disabled: true,
  331. handler: function(){
  332. if( Ext.getCmp('cp_ack_btn_%%%NODEID%%%').pressed){
  333. //doMaskOperation( %%%NODEID%%%, 1, 4 );
  334. doAckOperation( %%%NODEID%%%, 1 );
  335. } else {
  336. //doMaskOperation( %%%NODEID%%%, 0, 4 );
  337. doAckOperation( %%%NODEID%%%, 0 );
  338. };
  339. }
  340. }/*,{
  341. xtype: 'panel',
  342. title: 'Detection Sensitivity',
  343. height: 95,
  344. frame: true,
  345. flex: 1,
  346. layout: 'hbox',
  347. items:[{
  348. xtype: 'button',
  349. text: 'Factory',
  350. id: 'DDSPBTN0',
  351. width: 80,
  352. iconCls: 'detection_btn_factory',
  353. enableToggle: true,
  354. toggleGroup: 'det_sens_btn_grp',
  355. disabled: true,
  356. scale: 'large',
  357. iconAlign: 'top'
  358. },{
  359. xtype: 'button',
  360. text: 'Low',
  361. id: 'DDSPBTN1',
  362. width: 80,
  363. iconCls: 'detection_btn_low',
  364. enableToggle: true,
  365. toggleGroup: 'det_sens_btn_grp',
  366. disabled: true,
  367. scale: 'large',
  368. iconAlign: 'top'
  369. },{
  370. xtype: 'button',
  371. text: 'Meduim',
  372. id: 'DDSPBTN2',
  373. width: 80,
  374. iconCls: 'detection_btn_medium',
  375. enableToggle: true,
  376. toggleGroup: 'det_sens_btn_grp',
  377. disabled: true,
  378. scale: 'large',
  379. iconAlign: 'top'
  380. },{
  381. xtype: 'button',
  382. text: 'High',
  383. id: 'DDSPBTN3',
  384. width: 80,
  385. iconCls: 'detection_btn_high',
  386. enableToggle: true,
  387. toggleGroup: 'det_sens_btn_grp',
  388. disabled: true,
  389. scale: 'large',
  390. iconAlign: 'top'
  391. }]
  392. }*/]
  393. }],
  394. bbar:[{
  395. xtype: 'panel',
  396. id: 'status_%%%NODEID%%%',
  397. border: false,
  398. frame: false,
  399. width: 800,
  400. height: 28,
  401. html: ''
  402. }]
  403. }