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.
439 lines
13 KiB
439 lines
13 KiB
{
|
|
id: 'db_node_%%%NODEID%%%',
|
|
//width: 258,
|
|
//height: 336,
|
|
title: '%%%NODENAME%%%',
|
|
draggable: false,
|
|
collapsible: false,
|
|
tools: [{
|
|
id:'toggle',
|
|
handler: function( a, b, p ){
|
|
fsDrawID = %%%NODEID%%%;
|
|
exitFromFF = function(){
|
|
nodeTHREEviewers[%%%NODEID%%%].renderer.setSize( nodeTHREEviewers[%%%NODEID%%%].container.clientWidth, (nodeTHREEviewers[%%%NODEID%%%].container.clientHeight-60) );
|
|
exitFromFF = null;
|
|
};
|
|
fullScreen( 'div_radar_%%%NODEID%%%' );
|
|
|
|
//var el = document.getElementById('draw_svg_'+fsDrawID );
|
|
//var nW = Math.floor( ( window.screen.height/window.screen.width ) * 100 );
|
|
//el.removeAttribute("width");
|
|
//el.setAttribute( "width", nW+'%' );
|
|
nodeTHREEviewers[%%%NODEID%%%].renderer.setSize( window.screen.width, window.screen.height );//200 );
|
|
}
|
|
}],
|
|
listeners:{
|
|
beforedestroy: function(){
|
|
if( typeof nodeTHREEviewers[%%%NODEID%%%] !== 'undefined' ){
|
|
//nodeTHREEviewers[%%%NODEID%%%].container
|
|
// object.geometry.dispose(); object.material.dispose(); scene.remove( object );
|
|
stopAnimation();
|
|
nodeTHREEviewers[%%%NODEID%%%].renderer.renderLists.dispose();
|
|
delete nodeTHREEviewers[%%%NODEID%%%].renderer;
|
|
delete nodeTHREEviewers[%%%NODEID%%%].scene;
|
|
delete nodeTHREEviewers[%%%NODEID%%%].mesh;
|
|
delete nodeTHREEviewers[%%%NODEID%%%].geometry;
|
|
delete nodeTHREEviewers[%%%NODEID%%%].material;
|
|
delete nodeTHREEviewers[%%%NODEID%%%].texture;
|
|
delete nodeTHREEviewers[%%%NODEID%%%].camera;
|
|
delete nodeTHREEviewers[%%%NODEID%%%];
|
|
};
|
|
return true;
|
|
},
|
|
afterrender: function( p ){
|
|
var W = p.getWidth();
|
|
var H = W + 28;
|
|
//if( %%%APPTYPE%%% == 2 ){
|
|
// H = PanelH - p.ownerCt.getHeight() + 64;
|
|
// if( H > ( W * 0.5625 )+ 32 ){
|
|
// H = ( W * 0.5625 ) + 32;
|
|
// };
|
|
//} else {
|
|
// H = document.body.clientHeight - p.ownerCt.ownerCt.getHeight();
|
|
//};
|
|
//alert( W + ' koko ' + H );
|
|
p.setHeight( H );
|
|
Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setHeight( H );//- 70 );
|
|
//Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setWidth( H );// - 70 );
|
|
var el = document.getElementById( 'div_radar_%%%NODEID%%%' )
|
|
//el.removeAttribute("height");
|
|
el.removeAttribute("style");
|
|
el.setAttribute("style","display: block; padding: 5px; width: \'100%\'; height:"+(H-20)+"px");
|
|
//el.setAttribute( "height", H-20 );//'86%' );
|
|
//cleanupDraw( %%%NODEID%%% );
|
|
//drawZoomLevels[%%%NODEID%%%]=100;
|
|
//const panorama = new PANOLENS.ImagePanorama( '/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%' );
|
|
//const viewer = new PANOLENS.Viewer({container: 'targ_canvas_%%%NODEID%%%' });
|
|
//viewer.add( panorama );
|
|
nodeTHREEviewers[%%%NODEID%%%] = {};
|
|
nodeTHREEviewers[%%%NODEID%%%].container = document.getElementById( 'div_radar_%%%NODEID%%%' );
|
|
|
|
nodeTHREEviewers[%%%NODEID%%%].camera = new THREE.PerspectiveCamera( 100, 1, 1, 600 );
|
|
nodeTHREEviewers[%%%NODEID%%%].camera.fov = 75;
|
|
nodeTHREEviewers[%%%NODEID%%%].scene = new THREE.Scene();
|
|
nodeTHREEviewers[%%%NODEID%%%].geometry = new THREE.SphereGeometry( 500, 60, 40 );
|
|
// invert the geometry on the x-axis so that all of the faces point inward
|
|
nodeTHREEviewers[%%%NODEID%%%].geometry.scale( -1, 1, 1 );
|
|
|
|
nodeTHREEviewers[%%%NODEID%%%].texture = new THREE.TextureLoader().load( '/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%' );
|
|
nodeTHREEviewers[%%%NODEID%%%].material = new THREE.MeshBasicMaterial( { map: nodeTHREEviewers[%%%NODEID%%%].texture } );
|
|
nodeTHREEviewers[%%%NODEID%%%].mesh = new THREE.Mesh( nodeTHREEviewers[%%%NODEID%%%].geometry, nodeTHREEviewers[%%%NODEID%%%].material );
|
|
nodeTHREEviewers[%%%NODEID%%%].scene.add( nodeTHREEviewers[%%%NODEID%%%].mesh );
|
|
nodeTHREEviewers[%%%NODEID%%%].scene.add( l3dMapOverlayMesh );
|
|
|
|
nodeTHREEviewers[%%%NODEID%%%].renderer = new THREE.WebGLRenderer();
|
|
nodeTHREEviewers[%%%NODEID%%%].renderer.setPixelRatio( 1 );
|
|
nodeTHREEviewers[%%%NODEID%%%].renderer.setSize( nodeTHREEviewers[%%%NODEID%%%].container.clientWidth, (H-80) );
|
|
nodeTHREEviewers[%%%NODEID%%%].container.appendChild( nodeTHREEviewers[%%%NODEID%%%].renderer.domElement );
|
|
|
|
nodeTHREEviewers[%%%NODEID%%%].container.style.touchAction = 'none';
|
|
nodeTHREEviewers[%%%NODEID%%%].container.myVID = %%%NODEID%%%;
|
|
|
|
nodeTHREEviewers[%%%NODEID%%%].container.addEventListener( 'pointerdown', onPointerDown );
|
|
nodeTHREEviewers[%%%NODEID%%%].container.addEventListener( 'wheel', onDocumentMouseWheel );
|
|
nodeTHREEviewers[%%%NODEID%%%].targets = new Array();
|
|
nodeTHREEviewers[%%%NODEID%%%].targetShowCopunter = 0;
|
|
nodeTHREEviewers[%%%NODEID%%%].targetIndex = 0;
|
|
|
|
//addl3dTarget( %%%NODEID%%%, 200, Math.PI/4, Math.PI/4 );
|
|
//addl3dTarget( %%%NODEID%%%, 150, 0, 0 );
|
|
//document.addEventListener( 'wheel', onDocumentMouseWheel );
|
|
/*
|
|
container.addEventListener( 'dragover', function ( event ) {
|
|
|
|
event.preventDefault();
|
|
event.dataTransfer.dropEffect = 'copy';
|
|
|
|
} );
|
|
container.addEventListener('dragenter', function () {
|
|
|
|
document.body.style.opacity = 0.5;
|
|
|
|
} );
|
|
container.addEventListener('dragleave', function () {
|
|
|
|
document.body.style.opacity = 1;
|
|
|
|
} );
|
|
container.addEventListener('drop', function ( event ) {
|
|
|
|
event.preventDefault();
|
|
|
|
const reader = new FileReader();
|
|
reader.addEventListener( 'load', function ( event ) {
|
|
|
|
material.map.image.src = event.target.result;
|
|
material.map.needsUpdate = true;
|
|
|
|
} );
|
|
reader.readAsDataURL( event.dataTransfer.files[ 0 ] );
|
|
|
|
document.body.style.opacity = 1;
|
|
|
|
} );
|
|
*/
|
|
/*
|
|
document.addEventListener( 'dragover', function ( event ) {
|
|
|
|
event.preventDefault();
|
|
event.dataTransfer.dropEffect = 'copy';
|
|
|
|
} );
|
|
|
|
document.addEventListener( 'dragenter', function () {
|
|
|
|
document.body.style.opacity = 0.5;
|
|
|
|
} );
|
|
|
|
document.addEventListener( 'dragleave', function () {
|
|
|
|
document.body.style.opacity = 1;
|
|
|
|
} );
|
|
|
|
document.addEventListener( 'drop', function ( event ) {
|
|
|
|
event.preventDefault();
|
|
|
|
const reader = new FileReader();
|
|
reader.addEventListener( 'load', function ( event ) {
|
|
|
|
material.map.image.src = event.target.result;
|
|
material.map.needsUpdate = true;
|
|
|
|
} );
|
|
reader.readAsDataURL( event.dataTransfer.files[ 0 ] );
|
|
|
|
document.body.style.opacity = 1;
|
|
|
|
} );
|
|
*/
|
|
//animateTargets();
|
|
animate();
|
|
|
|
//
|
|
|
|
//window.addEventListener( 'resize', onWindowResize );
|
|
}
|
|
},
|
|
layout:'border',
|
|
items:[{
|
|
id: 'cp_radar_%%%NODEID%%%',
|
|
region: 'center',
|
|
html: '<div id="div_radar_%%%NODEID%%%" style="display: block; padding: 5px; width: \'100%\'; height: \'100%\';"></div>',
|
|
width: '56%'
|
|
},{
|
|
region: 'east',
|
|
collapsible: true,
|
|
minSize: 75, // defaults to 50
|
|
maxSize: 220,
|
|
frame: false,
|
|
border: false,
|
|
collapsed: true,
|
|
collapseMode: 'mini',
|
|
title: '%%%LABEL%%%TOOLBOX%%%',
|
|
floatable: true,
|
|
animFloat: false,
|
|
autoHide: true,
|
|
id: 'toolbox_%%%NODEID%%%',
|
|
//unstyled: true,
|
|
margins: '5 0 0 5',
|
|
//cmargins: '5 0 5 5',
|
|
width: 200,
|
|
items:[{
|
|
xtype: 'spacer',
|
|
height: 3
|
|
},{
|
|
xtype: 'button',
|
|
id: 'cp_clear_btn_%%%NODEID%%%',
|
|
width: '100%',
|
|
disabled: true,
|
|
text: '%%%LABEL%%%CLEALARM%%%',
|
|
iconCls: 'ctrl_panel_clean_sm',
|
|
iconAlign: 'left',
|
|
handler: function(){
|
|
doDeviceOperation( 1, 125,'', true );
|
|
}
|
|
},{
|
|
xtype: 'spacer',
|
|
height: 3
|
|
},{
|
|
xtype: 'button',
|
|
id: 'cp_draw_btn_%%%NODEID%%%',
|
|
width: '100%',
|
|
text: '%%%LABEL%%%DRABACKGROUND%%%',
|
|
iconCls: 'ctrl_panel_drawscan_sm',
|
|
iconAlign: 'left',
|
|
disabled: true,
|
|
handler: function(){
|
|
doDeviceOperation( %%%NODEID%%%, 3,'', true );
|
|
}
|
|
},{
|
|
xtype: 'spacer',
|
|
height: 3
|
|
},{
|
|
xtype: 'button',
|
|
id: 'cp_study_btn_%%%NODEID%%%',
|
|
width: '100%',
|
|
text: '%%%LABEL%%%STUBACKGROUND%%%',
|
|
iconCls: 'ctrl_panel_study_sm',
|
|
iconAlign: 'left',
|
|
disabled: true,
|
|
handler: function(){
|
|
doDeviceOperation( %%%NODEID%%%, 2,'', true );
|
|
}
|
|
},{
|
|
xtype: 'spacer',
|
|
height: 3
|
|
},{
|
|
xtype: 'button',
|
|
text: '%%%LABEL%%%MASKEDITOR%%%',
|
|
id: 'DMED_%%%NODEID%%%',
|
|
width: '100%',
|
|
disabled: true,
|
|
iconCls: 'ctrl_panel_drawscan_sm',
|
|
handler: function(){
|
|
showMaskEditor( false, 0, %%%NODEID%%% );
|
|
}
|
|
},{
|
|
xtype: 'spacer',
|
|
height: 3
|
|
},{
|
|
xtype: 'panel',
|
|
title: '%%%LABEL%%%MASKMNGR%%%',
|
|
height: 70,
|
|
frame: true,
|
|
flex: 1,
|
|
layout: 'hbox',
|
|
items:[{
|
|
xtype: 'button',
|
|
enableToggle: true,
|
|
width: '20%',
|
|
scale: 'medium',//scale: 'small',
|
|
id: 'mz_btn_%%%NODEID%%%_0',
|
|
iconCls: 'mask_zone1_btn',
|
|
iconAlign: 'top',
|
|
pressed: false,
|
|
disabled: true,
|
|
handler: function(){
|
|
if( Ext.getCmp('mz_btn_%%%NODEID%%%_0').pressed){
|
|
doMaskOperation( %%%NODEID%%%, 1, 0 );
|
|
} else {
|
|
doMaskOperation( %%%NODEID%%%, 0, 0 );
|
|
};
|
|
}
|
|
},{
|
|
xtype: 'button',
|
|
enableToggle: true,
|
|
width: '20%',
|
|
scale: 'medium',
|
|
id: 'mz_btn_%%%NODEID%%%_1',
|
|
iconCls: 'mask_zone2_btn',
|
|
iconAlign: 'top',
|
|
pressed: false,
|
|
disabled: true,
|
|
handler: function(){
|
|
if( Ext.getCmp('mz_btn_%%%NODEID%%%_1').pressed){
|
|
doMaskOperation( %%%NODEID%%%, 1, 1 );
|
|
} else {
|
|
doMaskOperation( %%%NODEID%%%, 0, 1 );
|
|
};
|
|
}
|
|
},{
|
|
xtype: 'button',
|
|
enableToggle: true,
|
|
width: '19%',
|
|
scale: 'medium',//scale: 'large',
|
|
id: 'mz_btn_%%%NODEID%%%_2',
|
|
iconCls: 'mask_zone3_btn',
|
|
iconAlign: 'top',
|
|
pressed: false,
|
|
disabled: true,
|
|
handler: function(){
|
|
if( Ext.getCmp('mz_btn_%%%NODEID%%%_2').pressed){
|
|
doMaskOperation( %%%NODEID%%%, 1, 2 );
|
|
} else {
|
|
doMaskOperation( %%%NODEID%%%, 0, 2 );
|
|
};
|
|
}
|
|
},{
|
|
xtype: 'button',
|
|
enableToggle: true,
|
|
width: '20%',
|
|
scale: 'medium',//scale: 'large',
|
|
id: 'mz_btn_%%%NODEID%%%_3',
|
|
iconCls: 'mask_zone4_btn',
|
|
iconAlign: 'top',
|
|
pressed: false,
|
|
disabled: true,
|
|
handler: function(){
|
|
if( Ext.getCmp('mz_btn_%%%NODEID%%%_3').pressed){
|
|
doMaskOperation( %%%NODEID%%%, 1, 3 );
|
|
} else {
|
|
doMaskOperation( %%%NODEID%%%, 0, 3 );
|
|
};
|
|
}
|
|
},{
|
|
xtype: 'button',
|
|
enableToggle: true,
|
|
width: '20%',
|
|
scale: 'medium',//scale: 'large',
|
|
id: 'mz_btn_%%%NODEID%%%_4',
|
|
iconCls: 'mask_zone5_btn',
|
|
iconAlign: 'top',
|
|
pressed: false,
|
|
disabled: true,
|
|
handler: function(){
|
|
if( Ext.getCmp('mz_btn_%%%NODEID%%%_4').pressed){
|
|
doMaskOperation( %%%NODEID%%%, 1, 4 );
|
|
} else {
|
|
doMaskOperation( %%%NODEID%%%, 0, 4 );
|
|
};
|
|
}
|
|
}]
|
|
},{
|
|
xtype: 'spacer',
|
|
height: 3
|
|
},{
|
|
xtype: 'button',
|
|
width: '100%',
|
|
enableToggle: true,
|
|
id: 'cp_ack_btn_%%%NODEID%%%',
|
|
text: '%%%LABEL%%%ACKNOLAGE%%%',
|
|
iconCls: 'ctrl_panel_clean_sm',
|
|
iconAlign: 'left',
|
|
disabled: true,
|
|
handler: function(){
|
|
if( Ext.getCmp('cp_ack_btn_%%%NODEID%%%').pressed){
|
|
//doMaskOperation( %%%NODEID%%%, 1, 4 );
|
|
doAckOperation( %%%NODEID%%%, 1 );
|
|
} else {
|
|
//doMaskOperation( %%%NODEID%%%, 0, 4 );
|
|
doAckOperation( %%%NODEID%%%, 0 );
|
|
};
|
|
}
|
|
}/*,{
|
|
xtype: 'panel',
|
|
title: 'Detection Sensitivity',
|
|
height: 95,
|
|
frame: true,
|
|
flex: 1,
|
|
layout: 'hbox',
|
|
items:[{
|
|
xtype: 'button',
|
|
text: 'Factory',
|
|
id: 'DDSPBTN0',
|
|
width: 80,
|
|
iconCls: 'detection_btn_factory',
|
|
enableToggle: true,
|
|
toggleGroup: 'det_sens_btn_grp',
|
|
disabled: true,
|
|
scale: 'large',
|
|
iconAlign: 'top'
|
|
},{
|
|
xtype: 'button',
|
|
text: 'Low',
|
|
id: 'DDSPBTN1',
|
|
width: 80,
|
|
iconCls: 'detection_btn_low',
|
|
enableToggle: true,
|
|
toggleGroup: 'det_sens_btn_grp',
|
|
disabled: true,
|
|
scale: 'large',
|
|
iconAlign: 'top'
|
|
},{
|
|
xtype: 'button',
|
|
text: 'Meduim',
|
|
id: 'DDSPBTN2',
|
|
width: 80,
|
|
iconCls: 'detection_btn_medium',
|
|
enableToggle: true,
|
|
toggleGroup: 'det_sens_btn_grp',
|
|
disabled: true,
|
|
scale: 'large',
|
|
iconAlign: 'top'
|
|
},{
|
|
xtype: 'button',
|
|
text: 'High',
|
|
id: 'DDSPBTN3',
|
|
width: 80,
|
|
iconCls: 'detection_btn_high',
|
|
enableToggle: true,
|
|
toggleGroup: 'det_sens_btn_grp',
|
|
disabled: true,
|
|
scale: 'large',
|
|
iconAlign: 'top'
|
|
}]
|
|
}*/]
|
|
}],
|
|
bbar:[{
|
|
xtype: 'panel',
|
|
id: 'status_%%%NODEID%%%',
|
|
border: false,
|
|
frame: false,
|
|
width: 800,
|
|
height: 28,
|
|
html: ''
|
|
}]
|
|
}
|