').css({
- background: 'RGBA(0,0,0,.5) url(' + src + ') no-repeat center',
- backgroundSize: 'contain',
- width: '100%',
- height: '100%',
- position: 'fixed',
- zIndex: '10000',
- top: '0',
- left: '0',
- cursor: 'zoom-out'
- }).click(function() {
- removeModal();
- }).appendTo('body');
- //handling ESC
- $('body').on('keyup.modal-close', function(e) {
- if (e.key === 'Escape') {
- removeModal();
- }
- });
- });
- //tlInterval = window.setTimeout( fetchSiteStatus, 333, selectedSite );
- fetchSiteStatus();
- },
- failure: failureAJAXFunction
- });
-};
-
-var ack_2d_marker = null;
-var mode_add_ack = false;
-function startAdd2DACK( a ){
- mode_add_ack = true;
- ack_2d[a] = 1;
-};
-
-function onClickAdd2DACK(){
-};
-
-function finishAdd2DACK(){
- if( mode_add_ack ){
- mode_add_ack = false;
- };
-};
-
-function cancelAdd2DACK(){
- if( mode_add_ack ){
- mode_add_ack = false;
- };
-};
-
-function clear2DACK( a ){
-
-};
-
-function doAckOperation( NodeID, Cmd ){
- if( Cmd ){
- Ext.Msg.show({
- title: "=$Labels->GetLabel("_INFO_MSG_");?>",
- msg: "=$Labels->GetLabel("_DEV_ACK_START_");?>",
- buttons: Ext.Msg.YESNOCANCEL,
- fn: function( btn ){
- if( btn == 'yes' ){
- selectROI_mode = 1;
- t = Ext.getCmp('cp_radar_'+NodeID );
- if( t != undefined ){
- t.addClass( 'yellow_bg' );
- };
- t = Ext.getCmp('toolbox_'+NodeID );
- if( t != undefined ){
- W = t.ownerCt.ownerCt.getWidth();
- H = t.ownerCt.ownerCt.getHeight();
- if( H ){
- if( ( W / H ) < 1.5 ) t.collapse( true );
- };
- };
- t = document.getElementById('draw_svg_'+NodeID );
- if( t != undefined ){
- t.style.cursor = 'cell';
- };
- } else {
- t = Ext.getCmp('cp_ack_btn_'+NodeID );
- if( t != undefined ) t.toggle( false, true );
- };
- },
- icon: Ext.MessageBox.QUESTION
- });
- } else {
- Ext.Msg.show({
- title: "=$Labels->GetLabel("_INFO_MSG_");?>",
- msg: "=$Labels->GetLabel("_DEV_ACK_STOP_");?>",
- buttons: Ext.Msg.YESNOCANCEL,
- fn: function( btn ){
- if( btn == 'yes' ){
- if( selectROI_mode ){
- t = Ext.getCmp('cp_radar_'+NodeID );
- if( t != undefined ){
- t.removeClass( 'yellow_bg' );
- };
- t = document.getElementById('draw_svg_'+NodeID );
- if( t != undefined ){
- t.style.cursor = 'crosshair';
- };
- } else {
- doMaskOperation( NodeID, 3, 5 );
- }
- } else {
- t = Ext.getCmp('cp_ack_btn_'+NodeID );
- if( t != undefined ) t.toggle( true, true );
- };
- },
- icon: Ext.MessageBox.QUESTION
- });
- };
-};
diff --git a/lib/javascript/jsapi_dynamic/mojo_logs.js b/lib/javascript/jsapi_dynamic/mojo_logs.js
deleted file mode 100644
index 30c1582..0000000
--- a/lib/javascript/jsapi_dynamic/mojo_logs.js
+++ /dev/null
@@ -1,269 +0,0 @@
-//
-
-var um_selected_log_id = 0;
-
-var um_server_log_store = new Ext.data.JsonStore({
- root: 'records',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'type',
- type: 'string'
- },{
- name: 'ts',
- type: 'string'
- },{
- name: 'ptr',
- type: 'string'
- },{
- name: 'module',
- type: 'string'
- },{
- name: 'msg',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listServerLog.php',
- headers: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- }
- })
-});
-
-var um_server_log_col_model_opt = {
- columns: [
- {header: "=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
- {header: "=$Labels->GetLabel("_POINTER_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'ptr' },
- {header: "=$Labels->GetLabel("_MODULE_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'module' },
- {header: "=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'msg' }
- ],
- defaults: {
- sortable: false,
- menuDisabled: true,
- width: 100
- }
-};
-
-
-var um_log_sel_model_opt = {
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec) {
- um_selected_log_id = rec.data.id;
- }
- }
-};
-
-
-var um_access_log_store = new Ext.data.JsonStore({
- root: 'records',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'user',
- type: 'string'
- },{
- name: 'ts',
- type: 'string'
- },{
- name: 'cmd',
- type: 'int'
- },{
- name: 'data_line',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listAccessLog.php',
- headers: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- }
- })
-});
-
-function um_action_renderer( val ){
- switch( val ){
- case 1: return "=$Labels->GetLabel("_LOGIN_");?>";
- case 13: return "=$Labels->GetLabel("_ACCESS_DENIED_");?>";
- case 145: return "=$Labels->GetLabel("_SCREEN_RESIZE_");?>";
- };
- return "unknown action";
-};
-
-var um_access_log_col_model_opt = {
- columns: [
- {header: "=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "=$Labels->GetLabel("_USER_");?>",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'user' },
- {header: "=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, renderer: unix_ts_renderer, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
- {header: "=$Labels->GetLabel("_ACTION_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: um_action_renderer, dataIndex: 'cmd' },
- {header: "=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, dataindex: 'data_line' }
- ],
- defaults: {
- sortable: false,
- menuDisabled: true,
- width: 100
- }
-};
-var um_access_log_sel_model_opt = {
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec) {
- um_selected_log_id = rec.data.id;
- }
- }
-};
-
-function loadAccessLog(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- var tPanel = Ext.getCmp('main_content');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( '=$Labels->GetLabel("_ACC_LOG_");?>' );
- tPanel.add({
- columnWidth: 1.0,
- frame: false,
- border: false,
- items: [{
- xtype: 'panel',
- layout: 'fit',
- layoutConfig: {
- align : 'stretch',
- pack : 'start'
- },
- height: PanelH-5,
- flex: 1,
- frame: false,
- border: false,
- items:{
- frame: false,
- height: PanelH-5,
- xtype: 'grid',
- forceFit: true,
- viewConfig: {
- forceFit: true,
- getRowClass: function( record, rowIndex, rowParams, store){
- switch( record.get('cmd') ){
- case 1: return 'row-level01';
- case 2: return 'row-level02';
- case 3: return 'row-level03';
- case 4: return 'row-level04';
- case 145: return 'row-level05';
- };
- return '';
- }
- },
- ds: um_access_log_store,
- cm: new Ext.grid.ColumnModel( um_access_log_col_model_opt ),
- sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt )
- },tbar: [{
- xtype: 'button',
- id: 'um_access_reload_btn',
- text: '=$Labels->GetLabel("_RELOAD_");?>',
- handler: function(){
- um_access_log_store.reload();
- }
- }]
- }]
- });
- tPanel.doLayout();
- um_selected_log_id = 0;
- um_access_log_store.reload();
-};
-
-function loadServerLog(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- var tPanel = Ext.getCmp('main_content');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( '=$Labels->GetLabel("_SERV_LOG_");?>' );
- tPanel.add({
- columnWidth: 1.0,
- frame: false,
- border: false,
- items: [{
- xtype: 'panel',
- layout: 'fit',
- layoutConfig: {
- align : 'stretch',
- pack : 'start'
- },
- height: PanelH-5,
- flex: 1,
- frame: false,
- border: false,
- items:{
- frame: false,
- height: PanelH-5,
- xtype: 'grid',
- forceFit: true,
- viewConfig: {
- forceFit: true,
- getRowClass: function( record, rowIndex, rowParams, store){
- switch( record.get('type') ){
- case '01': return 'row-level01';
- case '02': return 'row-level02';
- case '03': return 'row-level03';
- case '04': return 'row-level04';
- case '05': return 'row-level05';
- };
- return '';
- }
- },
- ds: um_server_log_store,
- cm: new Ext.grid.ColumnModel( um_server_log_col_model_opt ),
- sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt )
- },tbar: [{
- xtype: 'button',
- id: 'um_server_reload_btn',
- text: '=$Labels->GetLabel("_RELOAD_");?>',
- handler: function(){
- um_server_log_store.reload();
- }
- },{
- xtype: 'button',
- id: 'um_server_clean_btn',
- text: '=$Labels->GetLabel("_CLEAR_");?>',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/clearServerLog.php',
- params: {
- NID: NID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- um_server_log_store.reload();
- }
- });
- }
- }]
- }]
- });
- tPanel.doLayout();
- um_selected_log_id = 0;
- um_server_log_store.reload();
- tlInterval = window.setInterval( um_server_log_store.reload, 333, 0 );
-};
-
-
-
diff --git a/lib/javascript/jsapi_dynamic/mojo_map.js b/lib/javascript/jsapi_dynamic/mojo_map.js
deleted file mode 100644
index 62fa91f..0000000
--- a/lib/javascript/jsapi_dynamic/mojo_map.js
+++ /dev/null
@@ -1,2561 +0,0 @@
-//
-
-
-
-var ActiveZones = null;
-var map = null;
-var map_ed = null;
-var markers = [];
-
-var mapListStore = new Ext.data.JsonStore({
- root: 'maps',
- totalProperty: 'totalCount',
- idProperty: 'map_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'//,
- //SITE: =$SiteID;?>
-
- },
- fields: [{
- name: 'map_id',
- type: 'int'
- },{
- name: 'map_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listMaps.php'
- })
-});
-
-var selectedMarkerIcon = L.icon({
- iconUrl: '/style/assets/cursor.png',
- iconSize: [32, 32],
- iconAnchor: [16, 16]//,
- //popupAnchor: [-3, -76],
- //shadowUrl: 'my-icon-shadow.png',
- //shadowSize: [68, 95],
- //shadowAnchor: [22, 94]
-});
-
-selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } );
-
-
-function getZoneByNode( nid ){
- var rVal = -1;
- for( var i=0; i < ActiveZones.totalCount; i++ ){
- if( ActiveZones.zones[i].dev_id == nid ){
- rVal = i;
- break;
- };
- };
- return rVal;
-};
-
-function turnOffAllGzButThis( nid ){
- var chocho = -1;
- for( var i=0; i < ActiveZones.totalCount; i++ ){
- if( ActiveZones.zones[i].dev_id == nid ) chocho = i;
- map.removeLayer( ActiveZones.fig[i] );
- map.removeLayer( ActiveZones.zang[i] );
- map.removeLayer( ActiveZones.center[i] );
- };
- if( chocho > -1 ){
- map.addLayer( ActiveZones.fig[chocho] );
- map.addLayer( ActiveZones.zang[chocho] );
- map.addLayer( ActiveZones.center[chocho] );
- var cVisible = L.featureGroup( Array( ActiveZones.fig[chocho], ActiveZones.zang[chocho], ActiveZones.center[chocho] ) );
- map.flyToBounds( cVisible.getBounds() );
- };
-};
-
-function turnAllGzOn(){
- var tall = Array();
- for( var i=0; i < ActiveZones.totalCount; i++ ){
- tall[i*3] = ActiveZones.fig[i];
- tall[i*3+1] = ActiveZones.zang[i];
- tall[i*3+2] = ActiveZones.center[i];
- if(!map.hasLayer(ActiveZones.fig[i])) map.addLayer( ActiveZones.fig[i] );
- if(!map.hasLayer(ActiveZones.zang[i])) map.addLayer( ActiveZones.zang[i] );
- if(!map.hasLayer(ActiveZones.center[i])) map.addLayer( ActiveZones.center[i] );
- };
- var cVisible = L.featureGroup( tall );
- //window.setTimeout(() => {
- // map.flyToBounds( cVisible.getBounds() );
- //}, 500);
- map.flyToBounds( cVisible.getBounds() );
-};
-
-function loadMapZones( SiteID ){
- Ext.Ajax.request({
- url: '/lib/controller/getGeoZones.php',
- params: {
- SITE: SiteID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- var pp = Ext.getCmp('sources_panel');
- if( typeof pp !== 'undefined' ) pp.removeAll();
- ActiveZones = data;
- ActiveZones.fig = new Array();
- ActiveZones.zang = new Array();
- ActiveZones.center = new Array();
- for(var i = 0; i < data.totalCount; i++ ) {
- switch( data.zones[i].type ){
- case 'circle':{
- //L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ).addTo( map );
- ActiveZones.fig[i] = new L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } );
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- case 'poly':{
- ActiveZones.fig[i] = new L.polygon( data.zones[i].points, {color: data.zones[i].color, dashArray: "4 1 2 3", weight: 1, opacity: 0.8, clickable: false, interactive: false, bubblingMouseEvents: false });//.addTo(map);
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- case 'image':{
- ActiveZones.fig[i] = L.imageOverlay( data.zones[i].url, data.zones[i].bounds, { opacity: 1.0 });//.addTo( map );
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- case 'image_rot':{
- ActiveZones.fig[i] = L.imageOverlay.rotated( data.zones[i].url, data.zones[i].topleft, data.zones[i].topright, data.zones[i].bottomleft, {
- opacity: 0.8 //,
- //interactive: true,
- //attribution: "Historical building plan ©
Instituto Geogr?fico Nacional de Espa?a "
- });//.addTo( map );
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- };
- /*
- if( data.zones[i].dev_is_source ){
- if( typeof pp !== 'undefined' ) {
- var sty = '';
- if( selecredActiveSourceFilter == data.zones[i].dev_id ){
- sty = 'cardDeviceSourceSelected';
- } else {
- sty = 'cardDeviceSource';
- };
- pp.add( {
- id: data.zones[i].dev_id+'_container',
- frame: false,
- border: false,
- width: 130,
- height: 130,
- html: '
'+data.zones[i].dev_name+'
'
- });
- };
- };*/
- if( data.zones[i].zang != undefined ){
- //L.polygon( data.zones[i].zang, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
- ActiveZones.zang[i] = L.circle( data.zones[i].zang, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } );//.addTo( map );
- };
- if( data.zones[i].center != undefined ){
- //L.polygon( data.zones[i].zmark, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
- ActiveZones.center[i] = L.circle( data.zones[i].center, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } );//.addTo( map );
- };
- };
- //if( selecredActiveSourceFilter == 0 ){
- turnAllGzOn();
- //} else {
- // turnOffAllGzButThis( selecredActiveSourceFilter );
- //};
- //if( typeof pp !== 'undefined' ) pp.doLayout();
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- }
- });
-};
-
-var cevt = Array();
-var coz = Array();
-
-function showEventsOnMap( data, removeCursor ){
- if( removeCursor == undefined ) removeCursor = true;
- if( removeCursor ) map.removeLayer( selectedMarker );
- if( cevt.length ){
- for( i=0; i< cevt.length; i++ ){
- if( cevt[i]!= null ){
- cevt[i].remove();
- delete( cevt[i] );
- cevt[i] = null;
- };
- };
- };
- if( coz.length ){
- for( i=0; i< coz.length; i++ ){
- if( coz[i]!= null ){
- coz[i].remove();
- delete( coz[i] );
- coz[i]=null;
- };
- };
- };
-
- var idx = 0;
- for( i=0; i < data.length; i++ ){
- if( data[i].targets != undefined ){
- var zz = ( 1.0 / ( data[i].targets.length + 0 ) );
- var cp_color='#FF0000';
- for( j = 0; j < data[i].targets.length; j++ ){
- //switch( data.log[i].event ){
- // case 36: cp_color='#0000FF'; break;
- //};
- cLon = data[i].targets[j].lon;
- cLat = data[i].targets[j].lat;
- cevt[idx] = L.circleMarker( [cLat, cLon], {id:data[i].id, color: cp_color, radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } );//.on('click', function( e, a ){
- // loadEventPropertiesByID( this.options.id );
- //} );
- cevt[idx].addTo(map);
- idx++;
- };
- };
- };
-};
-
-function LoadMapEventsZ( Mode ){
- if( tlLoadLocker ) return;
- tlLoadLocker = true;
- Ext.Ajax.request({
- url: '/lib/controller/getGeoAlerts.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MODE: Mode
- },
- success: function( response, opts ){
- if( cevt.length ){
- for( i=0; i< cevt.length; i++ ){
- if( cevt[i]!= null ){
- cevt[i].remove();
- delete( cevt[i] );
- cevt[i] = null;
- };
- };
- };
- if( coz.length ){
- for( i=0; i< coz.length; i++ ){
- if( coz[i]!= null ){
- coz[i].remove();
- delete( coz[i] );
- coz[i]=null;
- };
- };
- };
- var data = Ext.decode( response.responseText );
- var zz = ( 1.0 / ( data.evt.length + 0 ) );
- for( i=0; i < data.evt.length; i++ ){
- cevt[i] = L.circleMarker( [data.evt[i].lat,data.evt[i].lon], {id:data.evt[i].id, color: '#FF0000', radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } ).on('click', function( e, a ){
- loadEventProperties( this.options.id );
- } );
- cevt[i].addTo(map);
- };
- for( i=0; i < data.other.length; i++ ){
- switch( data.other[i].type ){
- case 'circle':{
- coz[i] = L.circleMarker( data.other[i].loc, {id:data.other[i].id, color: data.other[i].color, radius: 5, stroke: false, fillOpacity: 1.0 } );
- coz[i].addTo(map);
- break;
- };
- };
- };
-
- //eventsListStore.reload();
- tlLoadLocker = false;
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- tlLoadLocker = false;
- }
- });
-};
-function initMapMonitoring__00(){
- map = L.map('event_map',{
- attributionControl: true,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- }).setView([SiteLat, SiteLon], 17);
- //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("
=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");
-
- var mapLayers = [];
-
- /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
- subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
- attribution: '©
Bing Maps ',
- detectRetina: true
- });*/
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '©
OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data ©
OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: ©
OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: ©
OpenTopoMap (
CC-BY-SA ) ',
- maxZoom: 19
- });
- /*
- mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps ©
Thunderforest , Data ©
OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps ©
Thunderforest , Data ©
OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps ©
Thunderforest , Data ©
OpenStreetMap contributors ',
- maxZoom: 22
- });
- */
-
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- //L.control.layers( baseMaps ).addTo(map);
-
- mapLayers["MyMap"].addTo(map);
-
- /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '©
OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- }).addTo(map); */
- //loadTimeLineGroups( selectedSite );
- loadMapZones( 0 );
- //getData( 'arch' );
-};
-function initMapMonitoring(){
- var aK = true;
- if( MAP_SET.attribution == '' ) aK = false;
- var mapLayers = [];
- if( map != null ){
- //ToDo: must be moved to Upper Menu changer
- map.off();
- map.remove();
- map = null;
- };
- switch( MAP_SET.type ){
- case 1: {
- map = L.map( 'event_map',{
- //attributionControl: aK,
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- });
- map.setView([SiteLat, SiteLon], 17 );
- //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
- // attribution: MAP_SET.attribution,
- // maxNativeZoom: MAP_SET.maxNativeZoom,
- // maxZoom: MAP_SET.maxZoom
- //});
- L.tileLayer( MAP_SET.layer_url, {
- attribution: MAP_SET.attribution,
- attributionControl: false,
- maxNativeZoom: MAP_SET.maxNativeZoom,
- //minZoom: 0,
- maxZoom: MAP_SET.maxZoom
- }).addTo( map );
- break;
- };
- case 2:{
- map = L.map( 'event_map',{
- crs: L.CRS.Simple,
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,*/
- zoom: 2,
- minZoom: -1,
- maxZoom: 4,
- keyboard: false
- });
- var bounds = [[MAP_SET.bounds_lx,MAP_SET.bounds_ly], [MAP_SET.bounds_rx,MAP_SET.bounds_ry]];
- var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
- //map.setView([SiteLat, SiteLon], -1 );
- break;
- };
- case 3:{
- map = L.map( 'event_map',{
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat,SiteLon],
- zoom: MAP_SET.maxZoom - 2,
- minZoom: MAP_SET.maxZoom - 4,
- maxZoom: MAP_SET.maxZoom,
- keyboard: false
- });
- var bounds = [[MAP_SET.bounds_ly,MAP_SET.bounds_lx], [MAP_SET.bounds_ry,MAP_SET.bounds_rx]];
- var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
- break;
- };
- };
- //ToDo: Fix Initial Zoom level -> May be saving into a user profile
- loadMapZones( 0 );
-};
-
-function initMapReporting(){
- var aK = true;
- if( MAP_SET.attribution == '' ) aK = false;
- var mapLayers = [];
- if( map != null ){
- //ToDo: must be moved to Upper Menu changer
- map.off();
- map.remove();
- map = null;
- };
- switch( MAP_SET.type ){
- case 1:{
- map = L.map( 'report_map',{
- //attributionControl: aK,
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- });
- map.setView([SiteLat, SiteLon], 17 );
- //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
- // attribution: MAP_SET.attribution,
- // maxNativeZoom: MAP_SET.maxNativeZoom,
- // maxZoom: MAP_SET.maxZoom
- //});
- L.tileLayer( MAP_SET.layer_url, {
- attribution: MAP_SET.attribution,
- attributionControl: false,
- maxNativeZoom: MAP_SET.maxNativeZoom,
- minZoom: 0,
- maxZoom: MAP_SET.maxZoom
- }).addTo( map );
- break;
- };
- case 2:{
- map = L.map( 'report_map',{
- crs: L.CRS.Simple,
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,*/
- zoom: 0,
- minZoom: -1,
- maxZoom: 4,
- keyboard: false
- });
- var bounds = [[MAP_SET.bounds_lx,MAP_SET.bounds_ly], [MAP_SET.bounds_rx,MAP_SET.bounds_ry]];
- var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
- //map.setView([SiteLat, SiteLon], -1 );
- break;
- };
- case 3:{
- map = L.map( 'report_map',{
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat,SiteLon],
- zoom: MAP_SET.maxZoom - 2,
- minZoom: MAP_SET.maxZoom - 4,
- maxZoom: MAP_SET.maxZoom,
- keyboard: false
- });
- var bounds = [[MAP_SET.bounds_ly,MAP_SET.bounds_lx], [MAP_SET.bounds_ry,MAP_SET.bounds_rx]];
- var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map );
- break;
- };
- };
- //ToDo: Fix Initial Zoom level -> May be saving into a user profile
- loadMapZones( 0 );
-};
-
-var iconSaver = null;
-var markerSaver = null;
-
-function updateLocation( e ){
- locationSelectedNode = e.target.options.mycustomid;
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 0,
- SID: '=$Session;?>',
- LAT: e.target._latlng.lat,
- LON: e.target._latlng.lng
- },
- success: function( response, opts ){
- loadNodeLocationProps( locationSelectedNode );
- },
- failure: failureAJAXFunction
- });
-};
-
-function markerDblClick( e ){
- if( iconSaver == null ){
- iconSaver = e.target.options.icon;
- markerSaver = e.target;
- e.target.setIcon( SNAPE_Icon );
- for( i=0; i< markers.length; i++){
- if( markers[i].options.mycustomid != e.target.options.mycustomid ){
- markers[i].setOpacity( 0.1 );
- } else {
- markers[i].setOpacity( 1.0 );
- }
- };
- } else {
- if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
- e.target.setIcon( iconSaver );
- iconSaver = null;
- markerSaver = null;
- for( i=0; i< markers.length; i++){
- markers[i].setOpacity( 1.0 );
- };
- } else {
- markerSaver.setIcon( iconSaver );
- iconSaver = e.target.options.icon;
- markerSaver = e.target;
- e.target.setIcon( SNAPE_Icon );
- for( i=0; i< markers.length; i++){
- if( markers[i].options.mycustomid != e.target.options.mycustomid ){
- markers[i].setOpacity( 0.1 );
- } else {
- markers[i].setOpacity( 1.0 );
- }
- };
- };
- };
-};
-
-function setNodeLocationToAnchor(){
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 0,
- SID: '=$Session;?>',
- LAT: SiteLat,
- LON: SiteLon,
- ALT: SiteAlt
- },
- success: function( response, opts ){
- loadLocationEditor('sys_location_map');
- },
- failure: failureAJAXFunction
- });
-};
-
-function setNodeLocationByDelta(){
- var dx = Ext.getCmp('dx').getValue();
- var dy = Ext.getCmp('dy').getValue();
- var dz = Ext.getCmp('dz').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 3,
- SID: '=$Session;?>',
- LAT: dx,
- LON: dy,
- ALT: dz
- },
- success: function( response, opts ){
- loadLocationEditor('sys_location_map');
- },
- failure: failureAJAXFunction
- });
-};
-
-//viewport
-
-function Events() {
- this.events = { };
-}
-
-Events.prototype.on = function(name, fn) {
- var events = this.events[name];
- if (events == undefined) {
- this.events[name] = [ fn ];
- this.emit('event:on', fn);
- } else {
- if (events.indexOf(fn) == -1) {
- events.push(fn);
- this.emit('event:on', fn);
- }
- }
- return this;
-}
-
-Events.prototype.once = function(name, fn) {
- var events = this.events[name];
- fn.once = true;
- if (!events) {
- this.events[name] = [ fn ];
- this.emit('event:once', fn);
- } else {
- if (events.indexOf(fn) == -1) {
- events.push(fn);
- this.emit('event:once', fn);
- }
- }
- return this;
-}
-
-Events.prototype.emit = function(name, args) {
- var events = this.events[name];
- if (events) {
- var i = events.length;
- while(i--) {
- if (events[i]) {
- events[i].call(this, args);
- if (events[i].once) {
- delete events[i];
- }
- }
- }
- }
- return this;
-}
-
-Events.prototype.unbind = function(name, fn) {
- if (name) {
- var events = this.events[name];
- if (events) {
- if (fn) {
- var i = events.indexOf(fn);
- if (i != -1) {
- delete events[i];
- }
- } else {
- delete this.events[name];
- }
- }
- } else {
- delete this.events;
- this.events = { };
- }
- return this;
-}
-
-var userPrefix;
-
-var prefix = (function () {
- var styles = window.getComputedStyle(document.documentElement, ''),
- pre = (Array.prototype.slice
- .call(styles)
- .join('')
- .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
- )[1],
- dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1];
- userPrefix = {
- dom: dom,
- lowercase: pre,
- css: '-' + pre + '-',
- js: pre[0].toUpperCase() + pre.substr(1)
- };
-})();
-
-function bindEvent(element, type, handler) {
- if(element.addEventListener) {
- element.addEventListener(type, handler, false);
- } else {
- element.attachEvent('on' + type, handler);
- }
-}
-
-function Viewport(data) {
- events.add( this );
-
- var self = this;
-
- this.element = data.element;
- this.fps = data.fps;
- this.sensivity = data.sensivity;
- this.sensivityFade = data.sensivityFade;
- this.touchSensivity = data.touchSensivity;
- this.speed = data.speed;
-
- this.lastX = 0;
- this.lastY = 0;
- this.mouseX = 0;
- this.mouseY = 0;
- this.distanceX = 0;
- this.distanceY = 0;
- this.positionX = 0;
- this.positionY = 0;
- this.positionZ = 0;
- this.torqueX = 0;
- this.torqueY = 0;
-
- this.down = false;
- this.upsideDown = false;
-
- this.previousPositionX = 0;
- this.previousPositionY = 0;
- this.previousPositionZ = 0;
-
- this.currentSide = 0;
- this.calculatedSide = 0;
-
-
- bindEvent(data.element /*document*/, 'mousedown', function() { self.down = true; });
-
- bindEvent(data.element, 'mouseup', function() { self.down = false; });
-
- bindEvent(data.element, 'keyup', function() { self.down = false; });
-
- bindEvent(data.element, 'mousemove', function(e) { self.mouseX = e.pageX; self.mouseY = e.pageY; });
-
- bindEvent(data.element, 'touchstart', function(e) {
- self.down = true;
- e.touches ? e = e.touches[0] : null;
- self.mouseX = e.pageX / self.touchSensivity;
- self.mouseY = e.pageY / self.touchSensivity;
- self.lastX = self.mouseX;
- self.lastY = self.mouseY;
- });
-
- bindEvent(data.element, 'touchmove', function(e) {
- if(e.preventDefault) {
- e.preventDefault();
- }
-
- if(e.touches.length == 1) {
-
- e.touches ? e = e.touches[0] : null;
-
- self.mouseX = e.pageX / self.touchSensivity;
- self.mouseY = e.pageY / self.touchSensivity;
-
- }
- });
-
- bindEvent(data.element, 'touchend', function(e) {
- self.down = false;
- });
-
- setInterval(this.animate.bind(this), this.fps);
-
-}
-
-
-var events = new Events();
-
-events.add = function(obj) {
- obj.events = { };
-}
-
-events.implement = function(fn) {
- fn.prototype = Object.create(Events.prototype);
-}
-
-
-
-events.implement(Viewport);
-
-Viewport.prototype.animate = function() {
-
- this.distanceX = (this.mouseX - this.lastX);
- this.distanceY = (this.mouseY - this.lastY);
-
- this.lastX = this.mouseX;
- this.lastY = this.mouseY;
-
- if(this.down) {
- this.torqueX = this.torqueX * this.sensivityFade + (this.distanceX * this.speed - this.torqueX) * this.sensivity;
- this.torqueY = this.torqueY * this.sensivityFade + (this.distanceY * this.speed - this.torqueY) * this.sensivity;
- }
-
- if(Math.abs(this.torqueX) > 1.0 || Math.abs(this.torqueY) > 1.0) {
- if(!this.down) {
- this.torqueX *= this.sensivityFade;
- this.torqueY *= this.sensivityFade;
- }
-
- this.positionY -= this.torqueY;
-
- if(this.positionY > 360) {
- this.positionY -= 360;
- } else if(this.positionY < 0) {
- this.positionY += 360;
- }
-
- if(this.positionY > 90 && this.positionY < 270) {
- this.positionX -= this.torqueX;
-
- if(!this.upsideDown) {
- this.upsideDown = true;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
-
- } else {
-
- this.positionX += this.torqueX;
-
- if(this.upsideDown) {
- this.upsideDown = false;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
- }
-
- if(this.positionX > 360) {
- this.positionX -= 360;
- } else if(this.positionX < 0) {
- this.positionX += 360;
- }
-
- if(!(this.positionY >= 46 && this.positionY <= 130) && !(this.positionY >= 220 && this.positionY <= 308)) {
- if(this.upsideDown) {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 3;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 2;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 5;
- } else {
- this.calculatedSide = 4;
- }
- } else {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 5;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 4;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 3;
- } else {
- this.calculatedSide = 2;
- }
- }
- } else {
- if(this.positionY >= 46 && this.positionY <= 130) {
- this.calculatedSide = 6;
- }
-
- if(this.positionY >= 220 && this.positionY <= 308) {
- this.calculatedSide = 1;
- }
- }
-
- if(this.calculatedSide !== this.currentSide) {
- this.currentSide = this.calculatedSide;
- this.emit('sideChange');
- }
-
- }
-
- this.element.style[userPrefix.js + 'Transform'] = 'rotateX(' + this.positionY + 'deg) rotateY(' + this.positionX + 'deg) rotateZ('+this.positionZ + 'deg)';
-
- if(this.positionY != this.previousPositionY || this.positionX != this.previousPositionX || this.positionZ != this.previousPositionZ ) {
- this.previousPositionY = this.positionY;
- this.previousPositionX = this.positionX;
- this.previousPositionZ = this.positionZ;
- this.emit('rotate');
- }
-
-}
-
-Viewport.prototype.setDirect = function( A, B, C ) {
-
- if( 1 ) {
-
- this.positionX = A;
- this.positionY = B;
- this.positionZ = C;
-
- if(this.positionY > 360) {
- this.positionY -= 360;
- } else if(this.positionY < 0) {
- this.positionY += 360;
- }
-
- if(this.positionY > 90 && this.positionY < 270) {
- if(!this.upsideDown) {
- this.upsideDown = true;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
- } else {
- if(this.upsideDown) {
- this.upsideDown = false;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
- }
-
- if(this.positionX > 360) {
- this.positionX -= 360;
- } else if(this.positionX < 0) {
- this.positionX += 360;
- }
-
- if(!(this.positionY >= 46 && this.positionY <= 130) && !(this.positionY >= 220 && this.positionY <= 308)) {
- if(this.upsideDown) {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 3;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 2;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 5;
- } else {
- this.calculatedSide = 4;
- }
- } else {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 5;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 4;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 3;
- } else {
- this.calculatedSide = 2;
- }
- }
- } else {
- if(this.positionY >= 46 && this.positionY <= 130) {
- this.calculatedSide = 6;
- }
-
- if(this.positionY >= 220 && this.positionY <= 308) {
- this.calculatedSide = 1;
- }
- }
-
- if(this.calculatedSide !== this.currentSide) {
- this.currentSide = this.calculatedSide;
- this.emit('sideChange');
- }
-
- }
-
- this.element.style[userPrefix.js + 'Transform'] = 'rotateX(' + this.positionY + 'deg) rotateY(' + this.positionX + 'deg) rotateZ('+this.positionZ + 'deg)';
-
- if(this.positionY != this.previousPositionY || this.positionX != this.previousPositionX || this.positionZ != this.previousPositionZ ) {
- this.previousPositionY = this.positionY;
- this.previousPositionX = this.positionX;
- this.previousPositionZ = this.positionZ;
- this.emit('rotate');
- }
-}
-
-
-
-function Cube(data) {
- var self = this;
-
- this.element = data.element;
- this.sides = this.element.getElementsByClassName('side');
-
- this.viewport = data.viewport;
- this.viewport.on('rotate', function() {
- self.rotateSides();
- });
- this.viewport.on('upsideDown', function(obj) {
- self.upsideDown(obj);
- });
- this.viewport.on('sideChange', function() {
- self.sideChange();
- });
-}
-
-Cube.prototype.rotateSides = function() {
- var viewport = this.viewport;
- if(viewport.positionY > 90 && viewport.positionY < 270) {
- this.sides[0].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + (viewport.positionX + viewport.torqueX) + 'deg)';
- this.sides[5].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + -(viewport.positionX + 180 + viewport.torqueX) + 'deg)';
- } else {
- this.sides[0].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + (viewport.positionX - viewport.torqueX) + 'deg)';
- this.sides[5].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + -(viewport.positionX + 180 - viewport.torqueX) + 'deg)';
- }
-}
-
-Cube.prototype.upsideDown = function(obj) {
-
- var deg = (obj.upsideDown == true) ? '180deg' : '0deg';
- var i = 5;
-
- while(i > 0 && --i) {
- this.sides[i].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + deg + ')';
- }
-
-}
-
-Cube.prototype.sideChange = function() {
-
- for(var i = 0; i < this.sides.length; ++i) {
- this.sides[i].getElementsByClassName('cube-image')[0].className = 'cube-image';
- }
-
- this.sides[this.viewport.currentSide - 1].getElementsByClassName('cube-image')[0].className = 'cube-image active';
-
-}
-
-Cube.prototype.set = function( A, B, C ) {
- //C = C + 90.0;
- this.viewport.setDirect( A, B, C );
-}
-
-//var viewport = new Viewport({
-// element: document.getElementsByClassName('cube')[0],
-// fps: 20,
-// sensivity: .1,
-// sensivityFade: .93,
-// speed: 2,
-// touchSensivity: 1.5
-//});
-
-//new Cube({
-// viewport: viewport,
-// element: document.getElementsByClassName('cube')[0]
-//});
-
-
-
-
-
-
-var LRF3D_Icon = L.icon({
- iconUrl: '/style/assets/5_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var LFS_Icon = L.icon({
- iconUrl: '/style/assets/2_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PLS200_Icon = L.icon({
- iconUrl: '/style/assets/3_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PLSNET200_Icon = L.icon({
- iconUrl: '/style/assets/6_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PLS360_Icon = L.icon({
- iconUrl: '/style/assets/4_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var ALS_Icon = L.icon({
- iconUrl: '/style/assets/1_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PTZCAM_Icon = L.icon({
- iconUrl: '/style/assets/12_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var FIXCAM_Icon = L.icon({
- iconUrl: '/style/assets/11_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var SITEZ_Icon = L.icon({
- iconUrl: '/style/assets/centre_1.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [32, 32], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
-});
-
-var SNAPE_Icon = L.icon({
- iconUrl: '/style/assets/cursor.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [32, 32], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
-});
-
-function loadLocationNodes(){
- Ext.Ajax.request({
- url: '/lib/controller/getLocationItems.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data!= null ){
- var i = 0;
- var tall = Array();
- for( ; i < data.length; i++){
- switch( data[i].type ){
- case 1:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 2:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 3:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 4:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 5:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 6:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 10:
- case 12:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 11:
- case 13:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- };
- tall[i] = markers[i];
- };
- tall[i++] = ed_anchor;
- var cVisible = L.featureGroup( tall );
- map_ed.flyToBounds( cVisible.getBounds() );
- } else {
- map_ed.setView([SiteLat, SiteLon], 4 );
- };
- },
- failure: function( response, opts ) {
- //var tPanel = Ext.getCmp('main_portal');
- //tPanel.remove(0);
- //tPanel.add( { html: 'Failed to load dashboard!' } );
- //tPanel.doLayout();
- }
- });
-};
-
-var orientationEditorWindow = null;
-var cubeViewport = null;
-var cube = null;
-var curX = 0;
-var curY = 0;
-var curZ = 0;
-var bk_upd = false;
-
-
-function setCubeOrientation( A, B, C ){
- if( bk_upd ) return;
- bk_upd = true;
- curX = A;
- curY = B;
- curZ = C;
- var t = Ext.getCmp('roll_sld');
- t.setValue( A );
- t = Ext.getCmp('roll');
- t.setValue( A );
- t = Ext.getCmp('pitch_sld');
- t.setValue( B );
- t = Ext.getCmp('pitch');
- t.setValue( B );
- t = Ext.getCmp('yaw_sld');
- t.setValue( C );
- t = Ext.getCmp('yaw');
- t.setValue( C );
- if( cube != null ) cube.set( curX, curY, curZ );
- bk_upd = false;
-};
-
-
-function orientationEditor(){
- if( orientationEditorWindow == null ){
- orientationEditorWindow = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel('_ORIENTATION_');?>',
- closeAction: 'hide',
- width: 640,
- height: 500,
- items:[{
- layout: 'table',
- defaults: {
- bodyStyle:'padding:5px'
- },
- layoutConfig: {
- columns: 3
- },
- items:[{
- html: 'Roll:'
- },{
- xtype: 'textfield',
- id: 'roll',
- name: 'roll',
- value: 30.0029,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( nv / 1.0, curY, curZ );
- }
- }
- },{
- xtype: 'slider',
- id: 'roll_sld',
- width: 200,
- value: 30.0029,
- minValue: -180.0,
- maxValue: 180.0,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( nv, curY, curZ );
- }
- }
- },{
- html: 'Pitch:'
- },{
- xtype: 'textfield',
- id: 'pitch',
- name: 'pitch',
- value: 30.0029,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( curX, nv / 1.0, curZ );
- }
- }
- },{
- xtype: 'slider',
- id: 'pitch_sld',
- width: 200,
- value: 30.0029,
- minValue: -180.0,
- maxValue: 180.0,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( curX, nv, curZ );
- }
- }
- },{
- html: 'Yaw:'
- },{
- xtype: 'textfield',
- id: 'yaw',
- name: 'yaw',
- value: 30.0029,
- listeners:{
- change: function( sl, nv, tt ){
- //alert( nv );
- setCubeOrientation( curX, curY, nv / 1.0 );
- }
- }
- },{
- xtype: 'slider',
- id: 'yaw_sld',
- width: 200,
- value: 30.0029,
- minValue: -180.0,
- maxValue: 180.0,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( curX, curY, nv );
- }
- }
- }]
- },{
- html: '
'
- }],
- buttons:[{
- text: 'Cancel',
- width: 200,
- handler: function(){
- orientationEditorWindow.hide();
- }
- },{
- text: 'Apply',
- width: 200,
- handler: function(){
- Ext.getCmp('sroll').setValue( Ext.getCmp('roll').getValue() );
- Ext.getCmp('spitch').setValue( Ext.getCmp('pitch').getValue() );
- Ext.getCmp('syaw').setValue( Ext.getCmp('yaw').getValue() );
- orientationEditorWindow.hide();
- }
- }]
- });
-
- orientationEditorWindow.show();
-
- cubeViewport = new Viewport({
- element: document.getElementsByClassName('cube')[0],
- fps: 20,
- sensivity: .1,
- sensivityFade: .93,
- speed: 2,
- touchSensivity: 1.5
- });
-
- cube = new Cube({
- viewport: cubeViewport,
- element: document.getElementsByClassName('cube')[0]
- });
- } else {
- orientationEditorWindow.show();
- };
- setCubeOrientation( Ext.getCmp('sroll').getValue(), Ext.getCmp('spitch').getValue(), Ext.getCmp('syaw').getValue() );
-};
-
-
-var locationSelectedNode = 0;
-function loadLoactionProps( e ){
- if( typeof e == 'number' ){
- locationSelectedNode = e;
- } else {
- locationSelectedNode = e.sourceTarget.options.mycustomid;
- }
- loadNodeLocationProps( locationSelectedNode );
-};
-
-
-function loadNodeLocationProps( NodeID ){
- //alert( 'Node: ' + NodeID );
- Ext.Ajax.request({
- url: '/lib/controller/getLocationNodeProps.php',
- params: {
- NID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NODE: NodeID
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( data );
- tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-function LoadNodesList(){
- Ext.Ajax.request({
- url: '/lib/controller/getLocationNodes.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( data );
- tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-function reloadSiteMapData(){
- Ext.Ajax.request({
- url: '/lib/controller/getMapData.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- MAP_ID = parseInt( data.selected_map );
- MAP_IS_LOCAL = (MAP_ID)?data.local_binding:false;
- MAP_SET = data.maps;
- Ext.getCmp('lab_123').update( '=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> '+((MAP_IS_LOCAL)?'Pos X':'=$Labels->GetLabel('_LON_SHORT_LBL_');?>')+':' );
- Ext.getCmp('lab_124').update( ((MAP_IS_LOCAL)?'Pos Y':'=$Labels->GetLabel('_LAT_SHORT_LBL_');?>')+':' );
- document.getElementById('lab_125').src = ((MAP_IS_LOCAL)?'/style/assets/map_mode_decart.png':'/style/assets/map_mode_wgs84.png');
- loadLocationEditor('sys_location_map');
- },
- failure: failureAJAXFunction
- });
-};
-var ed_anchor = null;
-function loadLocationEditor( el_id , node_type, node_id, lat, lon ){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- if( node_type == undefined ) node_type = 0;
- if( lat == undefined ){
- lat = SiteLat;
- lon = SiteLon;
- };
- //var cMSET = mapListStore.getAt( MAP_ID );
- //alert( MAP_SET.id );
- var aK = true;
- if( MAP_SET.attribution == '' ) aK = false;
- var mapLayers = [];
-
- if( map_ed != undefined ){
- map_ed.off();
- map_ed.remove();
- };
- switch( MAP_SET.type ){
- case 1:{
- map_ed = L.map( el_id,{
- attributionControl: aK,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat,SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- });
- //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
- // attribution: MAP_SET.attribution,
- // maxNativeZoom: MAP_SET.maxNativeZoom,
- // maxZoom: MAP_SET.maxZoom
- //});
- L.tileLayer( MAP_SET.layer_url, {
- attribution: MAP_SET.attribution,
- maxNativeZoom: MAP_SET.maxNativeZoom,
- minZoom: 0,
- maxZoom: MAP_SET.maxZoom
- }).addTo( map_ed );
- break;
- };
- case 2:{
- map_ed = L.map( el_id,{
- crs: L.CRS.Simple,
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat,SiteLon],
- /*zoomControl: false,*/
- zoom: 0,
- minZoom: 0,
- maxZoom: 4,
- keyboard: false
- });
- var bounds = [[MAP_SET.bounds_lx,MAP_SET.bounds_ly], [MAP_SET.bounds_rx,MAP_SET.bounds_ry]];
- var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map_ed );
- break;
- };
- case 3:{
- map_ed = L.map( el_id,{
- attributionControl: false,
- preferCanvas: true,
- zoomControl: true,
- center: [SiteLat,SiteLon],
- zoom: MAP_SET.maxZoom - 2,
- minZoom: MAP_SET.maxZoom - 4,
- maxZoom: MAP_SET.maxZoom,
- keyboard: false
- });
- var bounds = [[MAP_SET.bounds_ly,MAP_SET.bounds_lx], [MAP_SET.bounds_ry,MAP_SET.bounds_rx]];
- var image = L.imageOverlay( '/lib/controller/data/assets/images/'+MAP_SET.layer_url, bounds ).addTo( map_ed );
- break;
- };
- };
- map_ed.setView([SiteLat,SiteLon], MAP_SET.maxZoom );
- if( node_type ){
- ed_anchor = L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map_ed).bindPopup("
=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");//.openPopup();
- } else {
- ed_anchor = L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map_ed).on('click', LoadNodesList ).bindPopup("
=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");//.openPopup();
- };
-
- /*
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '©
OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data ©
OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: ©
OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: ©
OpenTopoMap (
CC-BY-SA ) ',
- maxZoom: 19
- });
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- L.control.layers( baseMaps ).addTo( map_ed );
- mapLayers["MyMap"].addTo( map_ed );
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '©
OpenStreetMap contributors'
- }).addTo( map_ed );
- */
- if( node_type ){
- switch( node_type ){
- case 1:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: ALS_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 2:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: LFS_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 3:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: PLS200_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 4:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: PLS360_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 5:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: LRF3D_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 6:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: PLSNET200_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 10:
- case 12:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: FIXCAM_Icon, mycustomid: node_id} ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 11:
- case 13:{
- markers[0] = L.marker([lat,lon], {draggable: true,icon: PTZCAM_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- };
- } else loadLocationNodes();
-};
-
-function updateSiteAnchor(){
- SiteLat = Ext.getCmp('siteLat').getValue();
- SiteLon = Ext.getCmp('siteLon').getValue();
- SiteAlt = Ext.getCmp('siteAlt').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 1,
- SID: '=$Session;?>',
- LAT: SiteLat,
- LON: SiteLon,
- ALT: SiteAlt
- },
- success: function(){
- loadLocationEditor('sys_location_map');
- },
- failure: failureAJAXFunction
- });
-};
-
-function updateSiteMap(){
- MAP_ID = Ext.getCmp('siteMap').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 4,
- SID: '=$Session;?>',
- MID: MAP_ID
- },
- success: function( response, opts ){
- reloadSiteMapData();
- },
- failure: failureAJAXFunction
- });
-};
-
-var mapDataLoadded = false;
-// Call this to prepare all data once in Session
-function prepareMapData(){
- //if( ap_type == 1 ) return;//Metro No Map ...
- if( !mapDataLoadded ){
- mapListStore.load();
- };
-};
-
-function updateLocationOrientation(){
- var tLat = Ext.getCmp('slat').getValue();
- var tLon = Ext.getCmp('slon').getValue();
- var tAlt = Ext.getCmp('salt').getValue();
- var tRoll = Ext.getCmp('sroll').getValue();
- var tPitch = Ext.getCmp('spitch').getValue();
- var tYaw = Ext.getCmp('syaw').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- UID: =$UserID;?>,
- TYPE: 2,
- SID: '=$Session;?>',
- LAT: tLat,
- LON: tLon,
- ALT: tAlt,
- YAW: tYaw,
- ROLL: tRoll,
- PITCH: tPitch
- },
- failure: failureAJAXFunction
- });
-};
-
-var iconSaver = null;
-var markerSaver = null;
-
-function updateLocation( e ){
- locationSelectedNode = e.target.options.mycustomid;
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 0,
- SID: '=$Session;?>',
- LAT: e.target._latlng.lat,
- LON: e.target._latlng.lng
- },
- success: function( response, opts ){
- loadNodeLocationProps( locationSelectedNode );
- },
- failure: failureAJAXFunction
- });
-};
-
-function markerDblClick( e ){
- if( iconSaver == null ){
- iconSaver = e.target.options.icon;
- markerSaver = e.target;
- e.target.setIcon( SNAPE_Icon );
- for( i=0; i< markers.length; i++){
- if( markers[i].options.mycustomid != e.target.options.mycustomid ){
- markers[i].setOpacity( 0.1 );
- } else {
- markers[i].setOpacity( 1.0 );
- }
- };
- } else {
- if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
- e.target.setIcon( iconSaver );
- iconSaver = null;
- markerSaver = null;
- for( i=0; i< markers.length; i++){
- markers[i].setOpacity( 1.0 );
- };
- } else {
- markerSaver.setIcon( iconSaver );
- iconSaver = e.target.options.icon;
- markerSaver = e.target;
- e.target.setIcon( SNAPE_Icon );
- for( i=0; i< markers.length; i++){
- if( markers[i].options.mycustomid != e.target.options.mycustomid ){
- markers[i].setOpacity( 0.1 );
- } else {
- markers[i].setOpacity( 1.0 );
- }
- };
- };
- };
-};
-/*
-function setNodeLocationToAnchor(){
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 0,
- SID: '=$Session;?>',
- LAT: SiteLat,
- LON: SiteLon,
- ALT: SiteAlt
- },
- success: function( response, opts ){
- loadLocationEditor('sys_location_map');
- },
- failure: failureAJAXFunction
- });
-};
-
-function setNodeLocationByDelta(){
- var dx = Ext.getCmp('dx').getValue();
- var dy = Ext.getCmp('dy').getValue();
- var dz = Ext.getCmp('dz').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 3,
- SID: '=$Session;?>',
- LAT: dx,
- LON: dy,
- ALT: dz
- },
- success: function( response, opts ){
- loadLocationEditor();
- },
- failure: failureAJAXFunction
- });
-};
-*/
-var mapCreatorWindow = null;
-
-function createNewMap(){
- if( mapCreatorWindow == null ){
- mapCreatorWindow = new Ext.Window({
- width: 800,
- height: 580,
- title: "=$Labels->GetLabel('_CREATE_CUSTOM_MAP_');?>",
- modal: true,
- frame: true,
- border: false,
- resizable: false,
- items: [{
- xtype: 'tabpanel',
- id: 'mcr_tbp',
- activeTab: 0,
- items:[{
- xtype: 'form',
- title: "=$Labels->GetLabel('_INTER_MAP_');?>",
- id: 'map_map_frm',
- fileUpload: true,
- labelWidth: 250,
- labelAlign: 'right',
- height: 490,
- items:[{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_NAME_MAP_');?>",
- name: 'map_name',
- width: 540,
- },{
- xtype: 'hidden',
- name: 'ctype',
- value: 1
- },{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_TILE_URL_MAP_');?>",
- name: 'map_url',
- width: 540,
- },{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_LAYER_ATTRIB_');?>",
- name: 'map_attr',
- width: 540,
- },{
- xtype: 'textarea',
- fieldLabel: "=$Labels->GetLabel('_DESCRIPTION_');?>",
- name: 'map_desc',
- width: 540,
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAX_ZOOM_');?>",
- name: 'map_maxz',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '18',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>",
- name: 'map_maxnz',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '16',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- }]
- },{
- xtype: 'form',
- title: "=$Labels->GetLabel('_LOCAL_PIC_MAP_');?>",
- id: 'map_pic_frm',
- fileUpload: true,
- height: 490,
- //autoHeight: true,
- //bodyStyle: 'padding: 10px 10px 0 10px;',
- labelWidth: 250,
- labelAlign: 'right',
- defaults: {
- //anchor: '95%',
- //allowBlank: false,
- msgTarget: 'side'
- },
- items: [{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_MAP_NAME_');?>",
- id: 'map_name_2',
- name: 'map_name',
- width: 540
- },{
- xtype: 'hidden',
- name: 'ctype',
- value: 2
- },{
- xtype: 'fileuploadfield',
- id: 'form-file',
- emptyText: "=$Labels->GetLabel('_SELE_ANIMAGE_');?>",
- fieldLabel: "=$Labels->GetLabel('_MAP_PICTURE_');?>",
- width: 500,
- name: 'map_image',
- buttonText: "=$Labels->GetLabel('_BROWSE_');?>"
- },{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_LAYER_ATTRIB_');?>",
- name: 'map_attr',
- width: 540,
- },{
- xtype: 'textarea',
- fieldLabel: "=$Labels->GetLabel('_DESCRIPTION_');?>",
- name: 'map_desc',
- width: 540,
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAX_ZOOM_');?>",
- editable: false,
- typeAhead: true,
- id: 'map_maxz',
- name: 'map_maxz',
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '4',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>",
- editable: false,
- typeAhead: true,
- id: 'map_maxnz',
- name: 'map_maxnz',
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '4',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_TOP_PIC_BOUND_');?>",
- name: 'map_tpb',
- value: 0,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_LEFT_PIC_BOUND_');?>",
- name: 'map_lpb',
- value: 0,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_RIGHT_PIC_BOUND_');?>",
- name: 'map_rpb',
- value: 0,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_BOT_PIC_BOUND_');?>",
- name: 'map_bpb',
- value: 0,
- width: 540,
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAP_COORD_SYSTEM_');?>",
- editable: false,
- typeAhead: true,
- hiddenName: 'map_corsys',
- triggerAction: 'all',
- width: 540,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['C_SYS_V','C_SYS'],
- data: [[0,'Meters from map Centre'], [1,'WGS84(GPS)']]
- }),
- listeners:{
- select: function( a, b, c ){
- if( c ){
- Ext.getCmp('map_height').hide();
- Ext.getCmp('map_maxz').hide();
- Ext.getCmp('map_maxnz').hide();
- Ext.getCmp('map_width').hide();
- Ext.getCmp('map_cpp').hide();
- Ext.getCmp('map_cpb').show();
- } else {
- Ext.getCmp('map_height').show();
- Ext.getCmp('map_maxz').show();
- Ext.getCmp('map_maxnz').show();
- Ext.getCmp('map_width').show();
- Ext.getCmp('map_cpp').show();
- Ext.getCmp('map_cpb').hide();
- };
- }
- },
- value: '0',
- valueField: 'C_SYS_V',
- displayField: 'C_SYS'
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_MAP_WIDTH_');?>",
- id: 'map_height',
- name: 'map_height',
- decimalPrecision: 2,
- value: 1000.00,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_MAP_HEIGHT_');?>",
- id: 'map_width',
- name: 'map_width',
- decimalPrecision: 2,
- value: 1000.00,
- width: 540,
- },{
- xtype: 'panel',
- id: 'map_cpp',
- frame: false,
- border: false,
- layout: 'table',
- layoutConfig: {
- columns: 5
- },
- items:[{
- xtype: 'spacer',
- width: 250,
- html: "
=$Labels->GetLabel('_MAP_CENTER_MODE_');?>:
"
- },{
- xtype: 'radio',
- name: 'bounds_mode',
- inputValue: 0,
- checked: 1
- },{
- width: 80,
- html: '
'
- },{
- xtype: 'radio',
- name: 'bounds_mode',
- checked: 0,
- inputValue: 1
- },{
- html: '
'
- }]
- },{
- xtype: 'panel',
- id: 'map_cpb',
- frame: false,
- border: false,
- hidden: true,
- layout: 'table',
- layoutConfig: {
- columns: 5
- },
- items:[{
- xtype: 'spacer',
- width: 250,
- html: "
=$Labels->GetLabel('_MAP_LEFT_CORCORD_');?>:
"
- },{
- xtype: 'spacer',
- width: 100,
- html: "
=$Labels->GetLabel('_LAT_');?>
"
- },{
- xtype: 'numberfield',
- id: 'map_lcclat',
- name: 'map_lcclat',
- decimalPrecision: 8,
- value: 32.0001,
- width: 150,
- },{
- xtype: 'spacer',
- width: 100,
- html: "
=$Labels->GetLabel('_LON_');?>
"
- },{
- xtype: 'numberfield',
- id: 'map_lcclon',
- name: 'map_lcclon',
- decimalPrecision: 8,
- value: 32.0001,
- width: 150,
- },{
- xtype: 'spacer',
- width: 250,
- html: "
=$Labels->GetLabel('_MAP_RIGHT_CORCORD_');?>:
"
- },{
- xtype: 'spacer',
- width: 100,
- html: "
=$Labels->GetLabel('_LAT_');?>
"
- },{
- xtype: 'numberfield',
- id: 'map_rcclat',
- name: 'map_rcclat',
- decimalPrecision: 8,
- value: 32.0001,
- width: 150,
- },{
- xtype: 'spacer',
- width: 100,
- html: "
=$Labels->GetLabel('_LON_');?>
"
- },{
- xtype: 'numberfield',
- id: 'map_rcclon',
- name: 'map_rcclon',
- decimalPrecision: 8,
- value: 32.0001,
- width: 150,
- }]
- }]
- }]
- }],
- bbar:[ '->',{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- //Ext.getCmp('map_map_frm').getForm().reset();
- //Ext.getCmp('map_pic_frm').getForm().reset();
- mapCreatorWindow.destroy();
- }
- },{
- text: '=$Labels->GetLabel('_CREATE_NEW_LBL_');?>',
- handler: function(){
- var tt = Ext.getCmp('mcr_tbp').getActiveTab();
- if( tt.id == 'map_map_frm' ){
- if( Ext.getCmp('map_map_frm').getForm().isValid()){
- Ext.getCmp('map_map_frm').getForm().submit({
- url: '/lib/controller/addMap.php',
- waitMsg: 'Uploading Data...',
- encoding: 'multipart/form-data',
- success: function(fp, o){
- //msg('Success', 'Processed file "'+o.result.file+'" on the server');
- //alert('Processed file on the server');
- mapCreatorWindow.destroy();
- }
- });
- };
- } else {
- if( Ext.getCmp('map_pic_frm').getForm().isValid()){
- Ext.getCmp('map_pic_frm').getForm().submit({
- url: '/lib/controller/addMap.php',
- waitMsg: 'Uploading Image...',
- encoding: 'multipart/form-data',
- success: function(fp, o){
- //msg('Success', 'Processed file "'+o.result.file+'" on the server');
- //alert('Processed file on the server');
- mapCreatorWindow.destroy();
- }
- });
- };
- };
- }
- }],
- listeners:{
- beforedestroy: function(){
- mapCreatorWindow = null;
- }
- }
- });
- };
- mapCreatorWindow.show();
-};
-
-var mapEditorWindow = null;
-function deleteCurrentMap(){
- Ext.Ajax.request({
- url: '/lib/controller/delMapData.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MID: MAP_ID
- },
- success: function( response, opts ){
- location.reload();
- }
- });
-};
-function editCurrentMap(){
- Ext.Ajax.request({
- url: '/lib/controller/getMapData.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MID: MAP_ID
- },
- success: function( response, opts ){
- var newMapData = Ext.decode( response.responseText );
- if( mapEditorWindow == null ){
- switch( newMapData.type ){
- case 1:{
- mapEditorWindow = new Ext.Window({
- width: 800,
- height: 440,
- title: 'Edit Current Map',
- modal: true,
- //closeAction: 'hide',
- frame: true,
- border: false,
- resizable: false,
- items: [{
- xtype: 'form',
- id: 'map_map_frm',
- labelWidth: 250,
- labelAlign: 'right',
- height: 350,
- items:[{
- xtype: 'textfield',
- fieldLabel: 'Map Name',
- id: 'map_name_1',
- name: 'map_name',
- width: 540,
- },{
- xtype: 'hidden',
- name: 'ctype',
- value: 1
- },{
- xtype: 'textfield',
- fieldLabel: 'Tiles URL Pattern',
- name: 'map_url',
- width: 540,
- },{
- xtype: 'textfield',
- fieldLabel: 'Layer Attribution',
- name: 'map_attr',
- width: 540,
- },{
- xtype: 'textarea',
- fieldLabel: 'Description',
- name: 'map_desc',
- width: 540,
- },{
- xtype: 'combo',
- fieldLabel: 'Max Zoom',
- name: 'map_maxz',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '18',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- },{
- xtype: 'combo',
- fieldLabel: 'Max Native Zoom',
- name: 'map_maxnz',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '16',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- }]
- }],
- bbar:[ '->',{
- text: "=$Labels->GetLabel('_CANCEL_');?>",
- handler: function(){
- mapEditorWindow.destroy();
- }
- },{
- text: "=$Labels->GetLabel('_APPLY_CHANGES_');?>",
- handler: function(){
- var tt = Ext.getCmp('mcr_tbp').getActiveTab();
- if( tt.id == 'map_map_frm' ){
- if( Ext.getCmp('map_map_frm').getForm().isValid()){
- Ext.getCmp('map_map_frm').getForm().submit({
- url: '/lib/controller/updateMap.php',
- waitMsg: "=$Labels->GetLabel('_UPDATING_DATA_');?>...",
- clientValidation: false,
- encoding: 'multipart/form-data',
- success: function(f,a){
- alert('Processed file on the server1');
- //mapEditorWindow.hide();
- //mapEditorWindow.destroy();
- }
- });
- };
- } else {
- if( Ext.getCmp('map_pic_frm').getForm().isValid()){
- Ext.getCmp('map_pic_frm').getForm().submit({
- url: '/lib/controller/updateMap.php',
- clientValidation: false,
- waitMsg: "=$Labels->GetLabel('_UPDATING_DATA_');?>...",
- encoding: 'multipart/form-data',
- success: function( f, a ){
- alert('Processed file on the server2');
- //mapEditorWindow.hide();
- //mapEditorWindow.destroy();
- }
- });
- };
- };
- }
- }],
- listeners: {
- beforedestroy: function(){
- mapEditorWindow = null;
- }
- }
- });
- break;
- };
- default:{
- mapEditorWindow = new Ext.Window({
- width: 800,
- height: 540,
- title: "=$Labels->GetLabel('_EDIT_CUR_MAP_');?>",
- modal: true,
- frame: true,
- border: false,
- resizable: false,
- items: [{
- xtype: 'form',
- id: 'map_edt_frm',
- height: 480,
- //autoHeight: true,
- //bodyStyle: 'padding: 10px 10px 0 10px;',
- labelWidth: 250,
- labelAlign: 'right',
- defaults: {
- //anchor: '95%',
- //allowBlank: false,
- msgTarget: 'side'
- },
- items:[{
- xtype: 'spacer',
- height: 6
- },{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_MAP_NAME_');?>",
- name: 'map_name',
- value: newMapData.name,
- width: 540
- },{
- xtype: 'hidden',
- name: 'MID',
- value: newMapData.id
- },{
- xtype: 'panel',
- frame: false,
- border: false,
- html: '
'
- },{
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_LAYER_ATTRIB_');?>",
- name: 'map_attr',
- value: newMapData.attribution,
- width: 540,
- },{
- xtype: 'textarea',
- fieldLabel: "=$Labels->GetLabel('_DESCRIPTION_');?>",
- name: 'map_desc',
- value: newMapData.desc,
- width: 540,
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAX_ZOOM_');?>",
- editable: false,
- typeAhead: true,
- name: 'map_maxz',
- value: newMapData.maxZoom,
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '16',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>",
- editable: false,
- typeAhead: true,
- name: 'map_maxnz',
- value: newMapData.maxNativeZoom,
- triggerAction: 'all',
- width: 100,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['zoom_l'],
- data: [['16'], ['17'],['18'],['19'],['20'],['21'],['22'],['23'],['24'],['25'],['26'],['27'],['28']]
- }),
- value: '16',
- valueField: 'zoom_l',
- displayField: 'zoom_l'
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_TOP_PIC_BOUND_');?>",
- name: 'map_tpb',
- value: newMapData.img_tb,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_LEFT_PIC_BOUND_');?>",
- name: 'map_lpb',
- value: newMapData.img_lb,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_RIGHT_PIC_BOUND_');?>",
- name: 'map_rpb',
- value: newMapData.img_rb,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_BOT_PIC_BOUND_');?>",
- name: 'map_bpb',
- value: newMapData.img_bb,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_MAP_WIDTH_');?>",
- name: 'map_width',
- decimalPrecision: 2,
- value: newMapData.img_map_w,
- width: 540,
- },{
- xtype: 'numberfield',
- fieldLabel: "=$Labels->GetLabel('_MAP_HEIGHT_');?>",
- name: 'map_height',
- decimalPrecision: 2,
- value: newMapData.img_map_h,
- width: 540,
- },{
- xtype: 'panel',
- frame: false,
- border: false,
- layout: 'table',
- layoutConfig: {
- columns: 5
- },
- items:[{
- xtype: 'spacer',
- width: 250,
- html: "
=$Labels->GetLabel('_MAP_CENTER_MODE_');?>:
"
- },{
- xtype: 'radio',
- name: 'bounds_mode',
- inputValue: 0,
- checked: (newMapData.bounds_mode == 0)
- },{
- width: 80,
- border: false,
- html: '
'
- },{
- xtype: 'radio',
- name: 'bounds_mode',
- inputValue: 1,
- checked: (newMapData.bounds_mode != 0)
- },{
- html: '
'
- }]
- }]
- }],
- bbar:[ '->',{
- text: "=$Labels->GetLabel('_CANCEL_');?>",
- handler: function(){
- mapEditorWindow.destroy();
- }
- },{
- text: '=$Labels->GetLabel('_APPLY_CHANGES_');?>',
- handler: function(){
- if( Ext.getCmp('map_edt_frm').getForm().isValid()){
- Ext.getCmp('map_edt_frm').getForm().submit({
- url: '/lib/controller/updateMap.php',
- waitMsg: "=$Labels->GetLabel('_UPDATING_DATA_');?>...",
- encoding: 'multipart/form-data',
- success: function(fp, o){
- mapEditorWindow.destroy();
- }
- });
- };
- }
- }],
- listeners: {
- beforedestroy: function(){
- mapEditorWindow = null;
- }
- }
- });
- break;
- };
- };
-
- };
- mapEditorWindow.show();
- },
- failure: failureAJAXFunction
- });
-};
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/mojo_metro.js b/lib/javascript/jsapi_dynamic/mojo_metro.js
deleted file mode 100644
index ad5e090..0000000
--- a/lib/javascript/jsapi_dynamic/mojo_metro.js
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-
-
-
-function loadMetroControlUpper(){
-
- Ext.Ajax.request({
- url: '/lib/controller/getMetroUpperSensorEditor.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- var tComp = Ext.getCmp('main_content');
- if( data.status == 'ok' ){
- if( tComp!= null ){
- var content = Ext.decode( data.content );
- tComp.removeAll( true );
- tComp.add( content );
- tComp.doLayout();
- };
- } else {
- if( tComp!= null ){
- tComp.removeAll( true );
- tComp.add( data );
- tComp.doLayout();
- };
- };
- },
- failure: function(){
- }
- });
-};
-
-function loadMetroControlBottom(){
- Ext.Ajax.request({
- url: '/lib/controller/getMetroBottomSensorEditor.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- var tComp = Ext.getCmp('main_content');
- if( data.status == 'ok' ){
- if( tComp!= null ){
- var content = Ext.decode( data.content );
- tComp.removeAll( true );
- tComp.add( content );
- tComp.doLayout();
- };
- } else {
- if( tComp!= null ){
- tComp.removeAll( true );
- tComp.add( data );
- tComp.doLayout();
- };
- };
- },
- failure: function(){
- }
- });
-};
-
-function loadMetroControlFusion(){
- Ext.Ajax.request({
- url: '/lib/controller/getMetroFusionEditor.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- var tComp = Ext.getCmp('main_content');
- if( data.status == 'ok' ){
- if( tComp!= null ){
- var content = Ext.decode( data.content );
- tComp.removeAll( true );
- tComp.add( content );
- tComp.doLayout();
- };
- } else {
- if( tComp!= null ){
- tComp.removeAll( true );
- tComp.add( data );
- tComp.doLayout();
- };
- };
- },
- failure: function(){
- }
- });
-};
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/mojo_reports.js b/lib/javascript/jsapi_dynamic/mojo_reports.js
deleted file mode 100644
index 413554d..0000000
--- a/lib/javascript/jsapi_dynamic/mojo_reports.js
+++ /dev/null
@@ -1,1593 +0,0 @@
-//
-
-
-var map = null;
-var selectedMarker = null;
-var timelineObj = null;
-var tlGroups = new vis.DataSet();
-var tlItems = new vis.DataSet();
-
-var selecredActiveSourceFilter = 0;
-
-
-var rep_store_id = 0;
-var rep_array = new Array();
-var rep_store = new Ext.data.JsonStore({
- autoDestroy: false,
- storeId: 'log_store',
- //idIndex: 0,
- idProperty: 'id',
- fields: [
- {name: 'id', type: 'int' },
- {name: 'node_id', type: 'int' },
- {name: 'geo', type: 'bool' },
- {name: 'node_name', type: 'string' },
- {name: 'dts', type: 'string'},
- {name: 'ts', type: 'int'},
- {name: 'ms', type: 'string'},
- {name: 'type', type: 'int'},
- {name: 'range', type: 'string'},
- {name: 'az', type: 'string'},
- {name: 'el', type: 'string'},
- {name: 'r', type: 'int'},
- {name: 'width', type: 'int'},
- //{name: 'video_id',type: 'int'},
- {name: 'video',type: 'bool'},
- {name: 'lat', type: 'float'},
- {name: 'lon', type: 'float'}
- //{name: 'alt', type: 'float'},
- //{name: 'area', type: 'float'},
- //{name: 'video', type: 'string'},
- //{name: 'v_cpoint', type: 'int'}
- ]
-});
-function rep_sn_Renderer( value, meta, record ){
- //Must be set according to events
- var kaka = record.data.node_id % 3;
- return '
'+value+'
';
-};
-function rep_et_Renderer( value, meta, record ){
- var kaka = record.data.node_id % 3;
- switch( value ){
- case 6: ov = "=$Labels->GetLabel('_EVT_MSG_STUMO_');?>"; break;
- case 7: ov = "=$Labels->GetLabel('_EVT_MSG_BUMO_');?>"; break;
- case 8: ov = "=$Labels->GetLabel('_EVT_MSG_FLIPO_');?>"; break;
- case 9: ov = "=$Labels->GetLabel('_EVT_MSG_SCANC_');?>"; break;
- case 12: ov = "=$Labels->GetLabel('_EVT_MSG_B2DTRG_');?>"; break;
- case 13: ov = "=$Labels->GetLabel('_EVT_MSG_W2DTRG_');?>"; break;
- case 36: ov = "=$Labels->GetLabel('_EVT_MSG_ROI_');?>"; break;
- case 39: ov = "=$Labels->GetLabel('_EVT_MSG_TF_CT_');?>"; break;
- case 40: ov = "=$Labels->GetLabel('_EVT_MSG_TF_USD_');?>"; break;
- case 41: ov = "=$Labels->GetLabel('_EVT_MSG_TF_BSD_');?>"; break;
- case 42: ov = "=$Labels->GetLabel('_EVT_MSG_TF_TD_');?>"; break;
- case 43: ov = "=$Labels->GetLabel('_EVT_MSG_TF_TUPD_');?>"; break;
- case 44: ov = "=$Labels->GetLabel('_EVT_MSG_TF_SUSPA_');?>"; break;
- case 45: ov = "=$Labels->GetLabel('_EVT_MSG_TF_SUSPN_');?>"; break;
- case 46: ov = "=$Labels->GetLabel('_EVT_MSG_TF_RD_');?>"; break;
- case 47: ov = "=$Labels->GetLabel('_EVT_MSG_TF_DD_');?>"; break;
- case 48: ov = "=$Labels->GetLabel('_EVT_MSG_TF_SUSPD_');?>"; break;
- case 49: ov = "=$Labels->GetLabel('_EVT_MSG_TF_DIFD_');?>"; break;
- case 52: ov = "=$Labels->GetLabel('_EVT_MSG_EVT_START_');?>"; break;
- case 53: ov = "=$Labels->GetLabel('_EVT_MSG_EVT_END_');?>"; break;
- case 54: ov = "=$Labels->GetLabel('_EVT_MSG_EVT_CLOMA_');?>"; break;
- case 55: ov = "=$Labels->GetLabel('_EVT_MSG_CONNECTED_');?>"; break;
- case 56: ov = "=$Labels->GetLabel('_EVT_MSG_DISCONNECTED_');?>"; break;
- case 57: ov = "=$Labels->GetLabel('_EVT_MSG_COM_JAMED_');?>"; break;
- case 58: ov = "=$Labels->GetLabel('_EVT_MSG_VIFDEC_');?>"; break;
- case 59: ov = "=$Labels->GetLabel('_EVT_MSG_VIFINC_');?>"; break;
- case 68: ov = "=$Labels->GetLabel('_EVT_MSG_ACKON_');?>"; break;
- case 69: ov = "=$Labels->GetLabel('_EVT_MSG_ACKOFF_');?>"; break;
- case 70: ov = "=$Labels->GetLabel('_EVT_MSG_MASKON_');?>"; break;
- case 71: ov = "=$Labels->GetLabel('_EVT_MSG_MASKOFF_');?>"; break;
- default: ov = "=$Labels->GetLabel('_EVENT_');?> ["+value+"]";
- };
- return '
'+ov+'
';
-};
-
-var rep_ColModel_ops = {
- columns: [
- {header: "=$Labels->GetLabel('_TIME_');?>", width: 100, fixed: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'dts' },
- {header: "=$Labels->GetLabel('_SOURCE_');?>", width: 100, renderer: rep_sn_Renderer, align: 'left', css: 'vertical-align: middle;', dataIndex: 'node_name' },
- {header: "=$Labels->GetLabel('_TYPE_');?>", width: 180, renderer: rep_et_Renderer, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'type' },
- {header: "=$Labels->GetLabel('_RANGE_');?>", width: 100, dataIndex: 'range' },
- {header: "=$Labels->GetLabel('_AZIMUTH_');?>", width: 100, dataIndex: 'az' },
- {header: "=$Labels->GetLabel('_WIDTH_');?>", width: 100, dataIndex: 'width' }
- ],
- defaults: {
- sortable: false,
- fixed: true,
- menuDisabled: true,
- width: 100
- }
-};
-var cRowSelected = -1;
-var rep_SelModel_ops = {
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec ) {
- cRowSelected = row;
- if( map!= undefined ) if( map != null ){
- if( selectedMarker!= null ){
- selectedMarker.remove();
- if( rec.data.geo ){
- //alert( 'Geo!' );
- //map.removeLayer( selectedMarker );
- //tt = ''+EventRec.geo.lat+' '+EventRec.geo.lon;
- selectedMarker.setLatLng([rec.data.lat, rec.data.lon]);
- selectedMarker.addTo( map );
- };
- };
- };
- loadEventData( rec.data );
- //alert( rec.data.id );
- //loadEventProperties( rec.data );
- //SelectedEvent = rec.data.id;
- //alert( SelectedEvent );
- //var CB = Ext.getCmp('con_to_src');
- //CB.enable();
- //selectedArchiveRecord = rec;
- //if( rec.data.bk_type!=3 ){
- //
- //} else {
- //
- //};
- }
- }
-};
-
-var cevt = Array();
-var coz = Array();
-
-function showHistoryOnMap( data, removeCursor ){
- if( removeCursor ) map.removeLayer( selectedMarker );
- if( cevt.length ){
- for( i=0; i< cevt.length; i++ ){
- if( cevt[i]!= null ){
- cevt[i].remove();
- delete( cevt[i] );
- cevt[i] = null;
- };
- };
- };
- if( coz.length ){
- for( i=0; i< coz.length; i++ ){
- if( coz[i]!= null ){
- coz[i].remove();
- delete( coz[i] );
- coz[i]=null;
- };
- };
- };
- if( data.log.length ){
- var zz = 1.0 / ( data.log.length + 1 );
- var idx = 0;
- for( i=0; i < data.log.length; i++ ){
- if( data.log[i].geo ){
- var cp_color='#FF0000';
- var opa = ( 1.0 - i * zz );
- switch( data.log[i].type ){
- case 36: cp_color='#0000FF'; opa = 1.0; break;
- };
- cevt[idx] = L.circleMarker( [data.log[i].lat, data.log[i].lon], {id:data.log[i].id, color: cp_color, radius: 5, stroke: false, fillOpacity: opa } );//.on('click', function( e, a ){ loadEventPropertiesByID( this.options.id ); } );
- cevt[idx].addTo(map);
- idx++;
- };
- };
- };
-};
-
-var selectedMarkerIcon = L.icon({
- iconUrl: '/style/assets/cursor.png',
- iconSize: [32, 32],
- iconAnchor: [16, 16]//,
- //popupAnchor: [-3, -76],
- //shadowUrl: 'my-icon-shadow.png',
- //shadowSize: [68, 95],
- //shadowAnchor: [22, 94]
-});
-
-selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } );
-
-var tlOptions = {
- groupOrder: 'content', // groupOrder can be a property name or a sorting function
- stack: true,
- showCurrentTime: true,
- //verticalScroll: true,
- //zoomKey: 'ctrlKey',
- minHeight: 308,
- maxHeight: 308
-};
-var tlLoadLocker = false;
-var tlLastTS = 0;
-var tlInterval = null;
-var tlMonitoring = false;
-
-
-
-
-// Calendar
-
-var CurrentDate=(new Date())/1000;
-
-var today=new Date();
-var SY=1900+today.getYear();
-var SMO=today.getMonth()+1;
-var SD=today.getDate();
-var SelectedDay = SD;
-var Dates = new Array();
-function CheckDate(D){
- for(j_index=0;j_index
GetMonthLength(CurrentDate) ) SD = GetMonthLength(CurrentDate);
- loadCalendarDates();
-};
-function ShiftFWD(){
- CurrentDate=CurrentDate+24*3600*GetMonthLength(CurrentDate);
- BuildCalendar();
- SMO = GetMonthNum(CurrentDate);
- SY = GetYear(CurrentDate);
- if( SD > GetMonthLength(CurrentDate) ) SD = GetMonthLength(CurrentDate);
- loadCalendarDates();
-};
-
-function GetMonthName(UTS){ // Unix Time Stamp
- var MoNames= new Array();
- MoNames[0]='January';
- MoNames[1]='February';
- MoNames[2]='March';
- MoNames[3]='April';
- MoNames[4]='May';
- MoNames[5]='June';
- MoNames[6]='July';
- MoNames[7]='August';
- MoNames[8]='September';
- MoNames[9]='October';
- MoNames[10]='November';
- MoNames[11]='December';
- CDate=new Date();
- CDate.setTime(UTS*1000);
- CMo=CDate.getMonth();
- return MoNames[CMo];
-};
-
-function GetMonthShift(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- CDate.setTime((UTS-(CDate.getDate()-1)*86400)*1000);
- return CDate.getDay();
-};
-
-function GetMonthLength(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- CD=CDate.getDate();
- RetVal=31;
- CDate.setTime((UTS+(31-CD)*86400)*1000);
- if ( CDate.getDate()==31) return RetVal;
- RetVal=30;
- CDate.setTime((UTS+(30-CD)*86400)*1000);
- if ( CDate.getDate()==30) return RetVal;
- RetVal=29;
- CDate.setTime((UTS+(29-CD)*86400)*1000);
- if ( CDate.getDate()==29) return RetVal;
- RetVal=28;
- CDate.setTime((UTS+(28-CD)*86400)*1000);
- if ( CDate.getDate()==28) return RetVal;
- return -1;
-};
-
-function GetMonthNum(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- return CDate.getMonth()+1;
-};
-
-function GetYear(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- y=CDate.getYear();
- if (y<100)y+=2000;
- if (y<200)y+=1900;
- return y;
-};
-function GetDay(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- y=CDate.getDate();
- return y;
-};
-
-function selectDate( m, d ){
- SY = GetYear(CurrentDate);
- SMO = m;
- SD = d;
- SelectedDay = SD;
- getData( 'arch' );
-};
-
-function BuildCalendar( ){
- Msh=GetMonthShift(CurrentDate);
- Mnm=GetMonthName(CurrentDate);
- Mln=GetMonthLength(CurrentDate);
- Mid=GetMonthNum(CurrentDate);
- Mye=GetYear(CurrentDate);
- InDTA=''+Mnm+' '+Mye+' ';
- InDTA+='Su Mo Tu We Th Fr Sa ';
- InDTA+='';
- for(index=0;index
';
- };
- for(;index<(Mln+Msh);index++){
- if( CheckDate(index-Msh+1) ){
- //InDTA+=''+(index-Msh+1).toString()+'
';
- if( SD == index ){
- InDTA+=''+(index-Msh+1).toString()+'
';
- } else {
- InDTA+=''+(index-Msh+1).toString()+'
';
- };
- } else {
- if( SD == index ){
- InDTA+=''+(index-Msh+1).toString()+'
';
- } else {
- InDTA+=''+(index-Msh+1).toString()+'
';
- };
- };
- if ((index+1)%7==0){
- InDTA+=' ';
- };
- };
- for(;(index)%7!=0;index++){
- InDTA+='
';
- };
- InDTA+='
';
- tab=document.getElementById('calendar_TD');
- tab.innerHTML=InDTA;
-};
-
-
-function loadCalendarDates(){
- ReportSelectionMode = 0;
- Ext.MessageBox.wait("=$Labels->GetLabel('_Loading_Calo_');?>","=$Labels->GetLabel('_Please_Wait_');?>",{
- width: '100%',
- hidden: true,
- progress: true,
- closable: false
- });
- ReportLayoutLoadded = false;
- Ext.Ajax.request({
- url: '/lib/controller/getEventDates.php',
- params: {
- NID: selecredActiveSourceFilter,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- SYE: SY,
- SMO: SMO
- },
- success: function( response, opts ){
- Ext.MessageBox.hide();
- var data = Ext.decode( response.responseText );
- if( data.status == 'ok' ){
- Dates = data.days;
- BuildCalendar();
- //for( var i = 0; i < data.days.length; i++ ){
- //
- //};
- };
- },
- failure: function( response, opts ) {
- Ext.MessageBox.hide();
- }
- });
-};
-
-
-
-
-
-
-
-
-var eventsListStore = new Ext.data.JsonStore({
- root: 'log',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'date',
- type: 'string'
- },{
- name: 'time',
- type: 'string'
- },{
- name: 'device',
- type: 'string'
- },{
- name: 'event',
- type: 'int'
- },{
- name: 'data',
- type: 'string',
- },{
- name: 'has_target',
- type: 'boolean'
- },{
- name: 'has_geo',
- type: 'boolean'
- },{
- name: 'has_images',
- type: 'boolean'
- },{
- name: 'images',
- type: 'Array'
- },{
- name: 'dev_type',
- type: 'int'
- },{
- name: 'geo',
- type: 'object'
- }] /*,
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/getEventRecords.php',
- headers: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NID: 1
- }
- })*/
-});
-
-var SelectedEvent = 0;
-var EventPanelWindow = null;
-function showEventPanel(){
- if( EventPanelWindow == null ){
- EventPanelWindow = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel("_EVENT_VIEWER_");?>',
- width: winW*0.66,
- height: winH*0.66,
- layout: 'fit',
- closeAction: 'hide',
- items:[{
- title: 'Cameras',
- html:'koko',
- autoScroll: true,
- height: 320
- },{
- html: 'koko22',
- height: 320
- }]
- });
- };
- EventPanelWindow .show();
-};
-
-function ModeRenderer(val){
- var p1, p2, p3;
- if( ( val & 1 ) == 1 ){
- p1 = ' ';
- } else {
- p1 = ' ';
- };
- if( ( val & 2 ) == 2 ){
- p2 = ' ';
- } else {
- p2 = ' ';
- };
- if( ( val & 4 ) == 4 ){
- p3 = ' ';
- } else {
- p3 = ' ';
- };
- return p1+p2+p3;
-};
-
-function LocRenderer( val ){
- if( val ){
- return ' ';
- };
- return ' ';
-};
-function PicRenderer( val ){
- if( val ){
- return ' ';
- };
- return ' ';
-};
-
-function EvtTypeRenderer( val ){
- switch( val ){
- case 6: return 'Device Enters Into Study Mode';
- case 7: return 'Device Is BUSY';
- case 8: return 'Flip Complete';
- case 9: return 'Scan Complete';
- case 10:
- case 11:
- case 12:
- case 13:
- case 14: return 'Target';
- case 36: return 'Region Of Interest';
- default: return 'Event ['+val+']';
- };
-};
-
-var eventsListColModel_ops = {
- columns: [
- {header: "ID", width: 100, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "Date",width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' },
- {header: "Time", width: 80, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'time' },
- {header: "Device", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'device' },
- {header: "Event", width: 120, sortable: false, dataIndex: 'event', renderer: EvtTypeRenderer },
- {header: "Info", width: 200, sortable: false, dataindex: 'data' },
- {header: "", width: 25, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer },
- {header: "", width: 25, sortable: false, dataIndex: 'has_images', renderer: PicRenderer }
- ],
- defaults: {
- sortable: true,
- menuDisabled: true,
- width: 100
- },
- listeners: {
- hiddenchange: function(cm, colIndex, hidden) {
- //saveConfig(colIndex, hidden);
- }
- }
-};
-var SelectedRow = -1;
-
-var eventsListSelModel_ops = {
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec ) {
- loadEventProperties( rec.data );
- SelectedEvent = rec.data.id;
- SelectedRow = row;
- //alert( SelectedEvent );
- //var CB = Ext.getCmp('con_to_src');
- //CB.enable();
- }
- }
-};
-
-function loadTimeLineGroups( NID ){
- Ext.Ajax.request({
- url: '/lib/controller/getTimeLineGroups.php',
- params: {
- NID: NID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- //for(var i = 0; i < data.length; i++) {
- //tlGroups.add(data[i]);
- //};
- tlGroups.update( data );
- loadTimeLineItems( SelectedSite );
- tlInterval = window.setInterval( loadTimeLineItems, 333, SelectedSite );
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- }/*,
- callback: function(options,success,response){
- // use this if you need to perform your own success/failure checking
- }*/
- });
-};
-
-function clickDeviceSelector( id ){
- var rr = document.getElementById(id+'_div');
- if( selecredActiveSourceFilter != id ){
- if( selecredActiveSourceFilter > 0 ){
- var oo = document.getElementById( selecredActiveSourceFilter + '_div');
- oo.classList.remove( "cardDeviceSourceSelected" );
- oo.classList.add( "cardDeviceSource" );
- };
- rr.classList.remove( "cardDeviceSource" );
- rr.classList.add( "cardDeviceSourceSelected" );
- selecredActiveSourceFilter = id;
- turnOffAllGzButThis( selecredActiveSourceFilter );
- } else {
- selecredActiveSourceFilter = 0;
- rr.classList.remove( "cardDeviceSourceSelected" );
- rr.classList.add( "cardDeviceSource" );
- turnAllGzOn();
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( {
- title: 'Event Information',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- html: 'Select an Event from TimeLine to See Information
'
- } );
- tPanel.doLayout();
-
- };
-};
-
-
-function loadEventPropertiesByID( id ){
- var d = eventsListStore.findExact( 'id', id );
- if( d > -1 ) {
- var EventRec = eventsListStore.getAt( d );
- loadEventProperties( EventRec.data );
- };
-};
-
-function loadEventProperties( EventRec ){
- var tPanel = Ext.getCmp('prop_content');
- tPanel.removeAll();// remove( 0 );
- var tt = '';
- if( map!=undefined) if(map!=null){
- if( selectedMarker!= null ){
- selectedMarker.remove();
- //map.removeLayer( selectedMarker );
- if( EventRec.has_geo ){
- tt = ''+EventRec.geo.lat+' '+EventRec.geo.lon;
- selectedMarker.setLatLng([EventRec.geo.lat, EventRec.geo.lon]);
- selectedMarker.addTo( map );
- };
- };
- };
- tPanel.add( {
- title: 'Event Details',
- html: '' + EventRec.device+'
'+tt+' '
- } );
- if( EventRec.has_images ){
- for( var i=0; i < EventRec.images.length; i++ ){
- tPanel.add( {
- frame: false,
- html: ' '
- });
- };
- };
- tPanel.doLayout();
-};
-
-var cEventTSS = 0;
-var cEventETS = 0;
-
-var VSRCC ='';
-function setVideoSource( mid, frame ){
- var video_t = document.getElementById( 'video-img-' + mid );
- if( video_t != undefined ){
- video_t.src = "/video_view/stream?id="+videoNfo[mid][1]+"&TS="+videoNfo[mid][0]+"&sf=" + frame;
- };
-};
-
-function loadEventData( record ){
- ReportSelectionMode = 3; // Just One Event
- cEventTSS = record.ts+record.ms/1000;
- clearAllRadars();
- if( record.type == 13 || record.type == 14 || record.type == 36 ){
- markEventOnRadar( record.node_id, record.az, record.r );
- };
- if( record.video ){
- showVideos();
- Ext.Ajax.request({
- url: '/lib/controller/getVideoInfo.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- TS: record.ts,
- ID: record.id
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.videos != undefined ){
- if( data.videos.length ){
- for( i=0; i < data.videos.length; i++ ){
- //var video_t = document.getElementById( 'video-'+data.videos[i].media_stream_id );
- videoNfo[data.videos[i].media_stream_id] = [];
- videoNfo[data.videos[i].media_stream_id][0] = data.ts;
- videoNfo[data.videos[i].media_stream_id][1] = data.videos[i].md5;
- videoNfo[data.videos[i].media_stream_id][2] = data.videos[i].fps;
- data.videos[i].frame -= 20;
- if( data.videos[i].frame < 0 ) data.videos[i].frame = 0;
-
- setVideoSource( data.videos[i].media_stream_id, data.videos[i].frame );
-
- var slider_t = Ext.getCmp( 'video-slider-'+data.videos[i].media_stream_id );
-
- if( slider_t != undefined ){
- slider_t.setMaxValue( 60 * data.videos[i].fps );
- slider_t.suspendEvents();
- slider_t.setValue( data.videos[i].frame );
- slider_t.resumeEvents();
- };
- };
- };
- };
- }
- });
- } else {
- hideVideos();
- };
-};
-
-function clearAllRadars(){
- for( i=1; i< 1000; i++ ){
- var csvg = document.getElementById( 'draw_svgr_' + i );
- if( csvg!= undefined ){
- var roi = csvg.getElementById( "roi" );
- if( roi != null ) csvg.removeChild( roi );
- };
- };
-};
-
-function markEventOnRadar( rid, az, range ){
- var csvg = document.getElementById( 'draw_svgr_' + rid );
- if( csvg!= undefined ){
- var roi = csvg.getElementById( "roi" );
- if( roi != null ) csvg.removeChild( roi );
- var bBox = csvg.getBBox();
- var max = 2048;
- switch( drawZoomLevels[rid] ){
- case 50: max = 1024; break;
- case 25: max = 512; break;
- case 12: max = 256; break;
- };
- if( range < max ){
- var ak = 2.0*Math.PI/360;
- var ok = 1.0/35;
-
- var rk = bBox.width / ( max * 2 );
- var cpx = bBox.width / 2.0;
- var cpy = bBox.height / 2.0;
-
- x = cpx + rk * range * Math.cos( az*ak );
- y = cpy - rk * range * Math.sin( az*ak );
- var cc = document.createElementNS('http://www.w3.org/2000/svg', "circle");
- var rz = bBox.width / csvg.clientWidth;
- cc.setAttributeNS(null, "cx", x );
- cc.setAttributeNS(null, "cy", y );
- cc.setAttributeNS(null, "r", ""+(6*rz)+"" );
- cc.setAttributeNS(null, "stroke", "#800000" );
- cc.setAttributeNS(null, "stroke-width", ""+(2*rz)+"" );
- cc.setAttributeNS(null, "stroke-opacity", ""+(1.0));
- cc.setAttributeNS(null, "fill", "#ff0000" );
- cc.setAttributeNS(null, "fill-opacity", ""+(1.0));
- cc.setAttributeNS(null, "id", "roi" );
- csvg.appendChild( cc );
- };
- };
-};
-
-function getData( Mode, ST/* = 0*/, ET /*= 0*/, SR /*= 0*/, DR /*= 0*/){
- if( tlLoadLocker ) return;
- tlLoadLocker = true;
- if( Mode == 'arch' ){
- Ext.MessageBox.wait("Loading Data","Please Wait",{
- width: '100%',
- hidden: true,
- animate: true,
- progress: true,
- closable: false
- });
- };
- Ext.Ajax.request({
- url: '/lib/controller/getEventRecords.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MODE: Mode,
- FIL: selecredActiveSourceFilter,
- SDA: SD,
- SMO: SMO,
- SYE: SY,
- STM: ST,
- ETM: ET,
- STR: SR,
- DIR: DR
- },
- success: function( response, opts ){
- tlLoadLocker = false;
- var data = Ext.decode(response.responseText);
- if( data.updateFROMTO ){
- Ext.getCmp('STimeFROM').setValue( data.STT );
- Ext.getCmp('STimeTO').setValue( data.ENT );
- if( data.SLD > 0 ){
- SMO = GetMonthNum(data.SLD);
- SY = GetYear(data.SLD);
- SD = GetDay(data.SLD);
- BuildCalendar();
- };
- };
- eventsListStore.loadData( data, false );
-
- if( Mode == 'arch' ){
- showHistoryOnMap( data, true );
- Ext.MessageBox.hide();
- if( DR > 0 ){
- Ext.getCmp('evtArchLog').getView().focusRow( eventsListStore.getCount() - 1 );
- Ext.getCmp('evtArchLog').getSelectionModel().selectLastRow();
- };
- if( DR < 0 ){
- Ext.getCmp('evtArchLog').getView().focusRow( 0 );
- Ext.getCmp('evtArchLog').getSelectionModel().selectFirstRow();
- };
- } else {
- showHistoryOnMap( data, false );
- //LoadMapEventsZ( Mode );
- };
- },
- failure: failureAJAXFunction
- });
-
-};
-
-function loadArchive(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 2 );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( 'Events Archive' );
- tPanel.add({
- columnWidth: 0.83,
- frame: false,
- border: false,
- items: [{
- title: 'Site Map',
- frame: false,
- border: false,
- layout: 'vbox',
- layoutConfig: {
- align : 'stretch',
- pack : 'start',
- },
- height: PanelH-300,
- items:[{
- height: PanelH-325,
- flex: 1,
- frame: false,
- border: false,
- layout: 'fit',
- items:{
- id: 'event_map',
- html: ' '
- }
- }]
- },{
- frame: false,
- border: false,
- collapsible: false,
- draggable: false,
- layout: 'hbox',
- items:[{
- layout: 'form',
- title: 'Date/Time',
- width: 200,
- frame: true,
- border: false,
- labelAlign: 'right',
- labelWidth: 50,
- defaults: { width: 80},
- items: [{
- xtype: 'combo',
- id: 'STimeFROM',
- fieldLabel: 'From',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 120,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['ss', 'displayText' ],
- data: []
- }),
- valueField: 'ss',
- displayField: 'displayText'
- },{
- xtype: 'combo',
- id: 'STimeTO',
- fieldLabel: 'Till',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 120,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['ss', 'displayText' ],
- data: []
- }),
- valueField: 'ss',
- displayField: 'displayText'
- }],
- html: '',
- buttons: [{
- xtype: 'button',
- text: 'Display History',
- handler: function(){
- var STU = Ext.getCmp('STimeFROM').getValue();
- var ETU = Ext.getCmp('STimeTO').getValue();
- getData( 'arch', STU, ETU );
- }
- }]
- },{
- title: 'Event Log',
- frame: false,
- height: 303,
- id: 'evtArchLog',
- xtype: 'grid',
- ds: eventsListStore,
- cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
- listeners:{
- keydown: function( e ) {
- if( e.getKey() == e.UP ){
- if( SelectedRow == 0 ){
- var id = eventsListStore.getAt( 0 ).id;
- getData( 'arch', 0, 0, id, 1 );
-
- };
- };
- if( e.getKey() == e.DOWN ){
- if( SelectedRow == ( eventsListStore.getCount() - 1 ) ){
- var id = eventsListStore.getAt( SelectedRow ).id;
- getData( 'arch', 0, 0, id, -1 );
- Ext.getCmp('evtArchLog').getSelectionModel().selectFirstRow();
- Ext.getCmp('evtArchLog').focus( false, true );
- };
- };
- }
- }
- }]
- }]
- });
- tPanel.add({
- columnWidth: 0.17,
- frame: true,
- title: 'Event Information',
- id: 'prop_content',
- border: false,
- items: [{
- html:"=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
"
- }]
- });
-
- tPanel.doLayout();
- /*
- Ext.getCmp('evtLog').getEl().set({tabindex: "0"});
- Ext.getCmp('evtLog').getEl().addKeyMap({
- eventName: "keyup",
- binding: [{
- key: Ext.EventObject.SPACE,
- fn: function(){ alert("Space key pressed"); }
- },{
- key: [Ext.EventObject.LEFT, Ext.EventObject.RIGHT],
- shift: true,
- fn: function(){ alert("Left or right pressed while pressing shift"); }
- }]
- });
- */
- //BuildCalendar();
- loadCalendarDates();
-
- map = L.map('event_map',{
- attributionControl: true,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- }).setView([SiteLat, SiteLon], 17);
- //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");
-
- var mapLayers = [];
-
- /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
- subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
- attribution: '© Bing Maps ',
- detectRetina: true
- });*/
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data © OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: © OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA ) ',
- maxZoom: 19
- });
- /*
- mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- */
-
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- L.control.layers( baseMaps ).addTo(map);
-
- mapLayers["MyMap"].addTo(map);
-
- /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- }).addTo(map); */
- //loadTimeLineGroups( selectedSite );
- loadMapZones( SelectedSite );
- getData( 'arch' );
- //eventsListStore.load({params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
-};
-
-function loadMonitoring(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 1 );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( 'Events Monitoring' );
- tPanel.add({
- columnWidth: 0.83,
- frame: false,
- border: false,
- items: [{
- title: '=$Labels->getLabel('_MAP_MONITORING_');?>',
- frame: false,
- border: false,
- collapsible: false,
- draggable: false,
- layout: 'vbox',
- layoutConfig: {
- align : 'stretch',
- pack : 'start',
- },
- height: PanelH-300,
- items:[{
- height: PanelH-325,
- flex: 1,
- frame: false,
- border: false,
- layout: 'fit',
- items:{
- id: 'event_map',
- html: ' '
- }
- }]
- },{
- frame: false,
- border: true,
- collapsible: false,
- draggable: false,
- layout: 'hbox',
- items:[{
- title: 'Alarm Sources',
- xtype: 'panel',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- id: 'sources_panel',
- width: 160,
- autoScroll: 'auto',
- height: 303
- },{
- title: 'Event Log',
- height: 303,
- xtype: 'grid',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- ds: eventsListStore,
- cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
- bbar: [{
- text: 'Clear',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/clearEventCloud.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- },
- failure: function( response, opts ) {
- }
- });
- }
- }]
- }]
- }]
- });
- tPanel.add({
- columnWidth: 0.17,
- title: 'Event Information',
- frame: true,
- id: 'prop_content',
- border: false,
- items: [{
- html:"=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
"
- }]
- });
-
- tPanel.doLayout();
- map = L.map('event_map',{
- attributionControl: true,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- }).setView([SiteLat, SiteLon], 17);
- //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");
-
- var mapLayers = [];
-
- /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
- subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
- attribution: '© Bing Maps ',
- detectRetina: true
- });*/
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data © OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: © OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA ) ',
- maxZoom: 19
- });
- /*
- mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- */
-
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- L.control.layers( baseMaps ).addTo(map);
-
- mapLayers["MyMap"].addTo(map);
-
- /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- }).addTo(map); */
-
- loadMapZones( SelectedSite );
- tlInterval = window.setInterval( getData, 333, 'live' );
-};
-
-
-function loadOnlineMonitoring(devID){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- var tPanel = Ext.getCmp('main_content');
- tPanel.removeAll( true );
- tPanel.add({
- html: 'Device Monitoring '+devID
- });
- tPanel.doLayout();
-};
-
-function shutImg( img, a /* = '' */){
- if( a == '' ){
- img.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAI=;';
- } else {
- img.src = a;
- };
-};
-
-var ReportMask = null;
-var ReportLayoutLoadded = false;
-var ReportSelectionMode = 0; //All
-function loadReportSegment( ts, bid, eid ){
- if( !ReportLayoutLoadded ){
- ReportMask = new Ext.LoadMask(Ext.getCmp('main_content').getEl(), {msg:"Please wait..."});
- ReportMask.show();
- Ext.Ajax.request({
- url: '/lib/controller/getReportLayout.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'//,
- //BID: nid,
- //EID: evt_ts
- },
- success: function(response, opts ){
- var data = Ext.decode( response.responseText );
- var tPanel = Ext.getCmp('main_content');
- tPanel.removeAll(true);
- Ext.getCmp('main_content').add({
- xtype: 'portal',
- id: 'segment_portal',
- frame: false,
- border: false,
- items:{
- html: ''
- },
- listeners:{
- drop: function( a ){
- updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
- }
- }
- });
- Ext.getCmp('main_content').doLayout();
- tPanel = Ext.getCmp('segment_portal');
- //nodeDashboardStatuses = new Array();
- for( i=0; i < data.length; i++) tPanel.add( data[i] );
- tPanel.doLayout();
- ReportMask.hide();
- ReportLayoutLoadded = true;
- loadReportData( ts, bid, eid );
- },
- error: function(){
- ReportMask.hide();
- }
- });
- } else {
- loadReportData( ts, bid, eid );
- };
-};
-
-function loadReportData( ts, bid, eid ){
- ReportSelectionMode = 2; // Session Selected
- hideVideos();
- Ext.Ajax.request({
- url: '/lib/controller/getHistoryEvents.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- TS: ts,
- BID: bid,
- EID: eid,
- },
- success: function(response, opts ){
- var data = Ext.decode( response.responseText );
- if( data.log != undefined ){
- if( map != undefined ) if( map != null ) showHistoryOnMap( data, true );
- if( data.log.length ){
- rep_store_id = data.log[0].id;
- rep_array = data.log;//.concat( rep_array );
- //if( log_array.length > 32 ){
- // log_array = log_array.slice( 0, 31 );
- //};
- rep_store.removeAll();
- rep_store.loadData( rep_array );
- };
-
- } else {
- // alert('No Log');
- // clear the log
- rep_store.removeAll();
- };
- }
- });
-};
-
-function loadReportDayTree( ts ){
- ReportSelectionMode = 1;//Day Selected
- ReportMask = new Ext.LoadMask(Ext.getCmp('left_side_menu').getEl(), {msg:"Please wait..."});
- ReportMask.show();
- Ext.Ajax.request({
- url: '/lib/controller/getHistoryDay.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- DTS: ts
- },
- success: function(response, opts ){
- var data = Ext.decode( response.responseText );
- var sPanel = Ext.getCmp('left_side_menu');
- sPanel.removeAll( true );
- sPanel.add({
- xtype: 'panel',
- layout: 'vbox',
-
- frame: true,
- border: false,
- items:[{
- xtype: 'spacer',
- height: 3
- },{
- html: ''+( new Date( ts * 1000)).toLocaleDateString()+'
'+data.sessions+'
'+data.events+'
'+data.videos+'
',
- frame: false,
- width: '100%',
- border: false
- },{
- xtype: 'spacer',
- height: 5
- },{
- xtype: 'treepanel',
- autoScroll: true,
- width: '100%',
- height: PanelH-206,
- border: true,
- frame: true,
- loader: new Ext.tree.TreeLoader(),
- rootVisible: false,
- root: new Ext.tree.AsyncTreeNode( data ),
- listeners: {
- click: function(n) {
- if( n.attributes.leaf ){
- Ext.getCmp('chu_adate').show();
- sPanel.doLayout();
- loadReportSegment( ts, n.attributes.bid, n.attributes.eid );
- //Ext.Msg.alert('Navigation Tree Click', 'You clicked: "' + n.attributes.ts + '"');
- };
- }
- }
- },{
- xtype: 'spacer',
- height: 10
- },{
- xtype: 'button',
- id: 'chu_adate',
- text: 'Show Dates',
- hidden: true,
- width: '100%',
- iconCls: 'reports_dates_btn',
- scale: 'large',
- handler: function(){
- Ext.getCmp('chu_adate').hide();
- initReportsView();
- }
- }]
- });
- sPanel.doLayout();
- ReportMask.hide();
- }
- });
-};
-
-var videoElements = [];
-var videoNfo=[];
-
-function hideVideos(){
- if( videoElements.length ) for( i = 0; i < videoElements.length; i++ ) hideVideo( videoElements[i] );
-};
-function hideVideo( a ){
- var tt = Ext.getCmp( 'video-ctl-panel-' + a );
- if( tt != undefined ) tt.hide();
- var video_t = document.getElementById( 'video-img-' + a );
- if( video_t != undefined ){
- video_t.src = "/style/assets/no-signal.png";
- };
-};
-function showVideo( a ){
- var tt = Ext.getCmp( 'video-ctl-panel-' + a );
- if( tt != undefined ) tt.show();
-};
-function showVideos(){
- if( videoElements.length ) for( i = 0; i < videoElements.length; i++ ) showVideo( videoElements[i] );
-};
-
-function downloadCurrentVideo( stid ){
- var d = new Date( videoNfo[stid][0] * 1000 );
- var videoFileDownloadTarget = d.getFullYear()+'_'+(d.getMonth()+1)+'_'+d.getDate()+'_'+d.getHours()+'-'+d.getMinutes()+'-'+d.getSeconds()+'.mp4';
- // TS, MD5, FPS
- downloadVideoFile( videoNfo[stid][0], videoNfo[stid][1], videoNfo[stid][2], videoFileDownloadTarget );
-};
-
-function initReportsView(){
- ReportSelectionMode = 0; // All History
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- ReportLayoutLoadded = false;
- var tPanel = Ext.getCmp('main_content');
- var sPanel = Ext.getCmp('left_side_menu');
- tPanel.removeAll( true );
- sPanel.removeAll( true );
- tPanel.add({
- xtype: 'panel',
- height: PanelH+15,
- html: '
',
- listeners:{
- afterrender: function(){
- ReportMask = new Ext.LoadMask(Ext.getCmp('main_content').getEl(), {msg:"=$Labels->GetLabel('_Please_Wait_');?>..."});
- ReportMask.show();
- var jj = (PanelW - 230)/55;
- changeStyleSheet('amap-empty-day','{width: '+jj+'px; height: '+jj+'px;}');
- changeStyleSheet('amap-week-day','{width: '+jj+'px; height: '+jj+'px;}');
- changeStyleSheet('amap-week-name','{width: '+jj+'px; height: '+jj+'px;}');
- Ext.Ajax.request({
- url: '/lib/controller/getHistoryDates.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function(response, opts ){
- var data = Ext.decode( response.responseText );
- var activityMap = new ActivityMap( data, {
- id: "dji-volume-map",
- parent: '#activity_ph',
- showTitle: false,
- showYears: true,
- width: 100,
- hue: 1,
- fit: true,
- compact: true,
- timeColumn: "t",
- valueColumn: "v"
- });
- activityMap.render();
- ReportMask.hide();
- },
- error: function(){
- ReportMask.hide();
- }
- });
- }
- }
- });
- tPanel.doLayout();
- sPanel.add({
- xtype: 'panel',
- frame: true,
- border: false,
- items: [{
- html: '=$Labels->GetLabel('_PLS_SEL_CAL_DATE_');?>
',
- height: PanelH - 30
- }]
- });
- sPanel.doLayout();
-};
-
-function downloadVideoFile( a, b, c, d ){
- ReportMask = new Ext.LoadMask( Ext.getBody(), {msg:"=$Labels->GetLabel('_Please_Wait_');?>..."} );
- ReportMask.show();
- Ext.Ajax.request({
- url: '/lib/controller/downloadVideo.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- FTS: a,
- FMD: b,
- FPS: c
- },
- success: function(response, opts ){
- const a = document.createElement('a');
- a.style.display = 'none';
- a.href = response.responseText;
- a.download = d;
- document.body.appendChild(a);
- a.click();
- ReportMask.hide();
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_SUCCESS_');?>',
- msg: '=$Labels->GetLabel('_VIDEO_FILE_HAS_DOWNLOADED_');?>',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- },
- error: function(){
- ReportMask.hide();
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_REQ_FAILURE_');?>',
- msg: '=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- }
- });
-};
diff --git a/lib/javascript/jsapi_dynamic/rgoose_cameras.js b/lib/javascript/jsapi_dynamic/rgoose_cameras.js
deleted file mode 100644
index 01c2292..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_cameras.js
+++ /dev/null
@@ -1,1664 +0,0 @@
-//
-
-
-var SelectedCam = 0;
-var SelectedSource = 0;
-var SelectedCamTYPE = 0;
-
-var connectIPCamDialog = null;
-var connectAnalCamDialog = null;
-var addIpCamDialog = null;
-var addAnalogCamDialog = null;
-
-var cameraListStore = new Ext.data.JsonStore({
- root: 'nodes',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'name',
- type: 'string'
- },{
- name: 'hardware',
- type: 'string'
- },{
- name: 'caps',
- type: 'string'
- },{
- name: 'ip',
- type: 'string'
- },{
- name: 'mac',
- type: 'string'
- },{
- name: 'ena',
- type: 'int'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listMediaSources.php',
- headers: {
- 'UID': '=$CUser->Data['id'];?>',
- 'SID': '=$Session;?>'
- }
- })
-});
-
-var sourceListStore = new Ext.data.JsonStore({
- root: 'nodes',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'name',
- type: 'string'
- },{
- name: 'encode',
- type: 'string'
- },{
- name: 'bitrate',
- type: 'int'
- },{
- name: 'size',
- type: 'string'
- }]
-});
-
-var IPCameraListSelModel = new Ext.grid.RowSelectionModel({
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec) {
- SelectedCam = rec.data.id;
- var CB = Ext.getCmp('con_to_ip_src');
- if( rec.data.ena ){
- CB.enable();
- } else {
- CB.disable();
- };
- }
- }
-});
-
-var AnalogCameraListSelModel = new Ext.grid.RowSelectionModel({
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec) {
- SelectedSource = rec.data.id;
- var CB = Ext.getCmp('con_to_anal_src');
- var CC = Ext.getCmp('cha_an_strim_set');
- if( rec.data.ena ){
- CB.enable();
- CC.enable();
- } else {
- CB.disable();
- CC.disable();
- };
- }
- }
-});
-
-var sourceListSelModel = new Ext.grid.RowSelectionModel({
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec) {
- SelectedSource = rec.data.id;
- Ext.getCmp('pic_prev').update( ' ' );
- }
- }
-});
-
-function camCapRenderer(val){
- var p1, p2, p3;
- if( ( val & 1 ) == 1 ){
- p1 = ' ';
- } else {
- p1 = ' ';
- };
- if( ( val & 2 ) == 2 ){
- p2 = ' ';
- } else {
- p2 = ' ';
- };
- if( ( val & 4 ) == 4 ){
- p3 = ' ';
- } else {
- p3 = ' ';
- };
- return p1+p2+p3;
-};
-
-var IPCameraListColModel = new Ext.grid.ColumnModel({
- columns: [
- {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "Type",width: 60, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'caps' },
- {header: "IP Address", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ip' },
- {header: "MAC", width: 120, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'mac' },
- {header: "Name", dataIndex: 'name' },
- {header: "HW", menuDisabled: true, dataIndex: 'hardware' }
- ],
- defaults: {
- sortable: true,
- menuDisabled: true,
- width: 100
- },
- listeners: {
- hiddenchange: function(cm, colIndex, hidden) {
- //saveConfig(colIndex, hidden);
- }
- }
-});
-
-var AnalogCameraListColModel = new Ext.grid.ColumnModel({
- columns: [
- {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "Type",width: 60, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'caps' },
- {header: "Frame Size", width: 60, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ip' },
- {header: "Device", width: 120, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'mac' },
- {header: "Name", width: 200, dataIndex: 'name' },
- {header: "HW", menuDisabled: true, dataIndex: 'hardware' }
- ],
- defaults: {
- sortable: true,
- menuDisabled: true,
- width: 100
- },
- listeners: {
- hiddenchange: function(cm, colIndex, hidden) {
- //saveConfig(colIndex, hidden);
- }
- }
-});
-
-var sourceListColModel = new Ext.grid.ColumnModel({
- columns: [
- {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "Name", dataIndex: 'name' },
- {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
- {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
- {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
- ],
- defaults: {
- sortable: false,
- menuDisabled: true,
- width: 100
- },
- listeners: {
- hiddenchange: function(cm, colIndex, hidden) {
- //saveConfig(colIndex, hidden);
- }
- }
-});
-
-function discoverOnvifSources(){
- Ext.Ajax.request({
- url: '/lib/controller/listAndDiscoverOnvifSources.php',
- params: {
- NID: 0,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- cameraListStore.reload();
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadCameraSettings( SC ){
- Ext.Ajax.request({
- url: '/lib/controller/getCameraSettings.php',
- params: {
- CID: SC,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- if( data.success ){
- } else {
- };
- },
- failure: function( response, opts ) {
- Ext.getCmp('cam_login').setValue('');
- Ext.getCmp('cam_password').setValue('');
- Ext.getCmp('cac_tab').enable();
- Ext.getCmp('str_tab').disable();
- Ext.getCmp('ptz_tab').disable();
- Ext.getCmp('loc_tab').disable();
- Ext.getCmp('coc_tabs').setActiveTab( 0 );
- sourceListStore.removeAll();
- }
- });
-};
-
-function preloadOnvifCredentials( SC ){
- showIPCamPropDialog();
- Ext.Ajax.request({
- url: '/lib/controller/getIpCamCredentials.php',
- params: {
- CID: SC,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- if( data.success ){
- Ext.getCmp('cam_login').setValue( data.login );
- Ext.getCmp('cam_password').setValue( data.password );
- Ext.getCmp('cam_auth_mode').setValue( data.auth_mode );
- Ext.getCmp('acm_btn').enable();
- Ext.getCmp('cac_tab').disable();
- Ext.getCmp('lens_tab').enable();
- Ext.getCmp('str_tab').enable();
- Ext.getCmp('ptz_tab').enable();
- Ext.getCmp('coc_tabs').setActiveTab( 1 );
- sourceListStore.loadData( data, false );
- var tpic = document.getElementById('pic_prev');
- if( tpic != null ) tpic.src = '/lib/controller/getVideoFeed.php?UID==$CUser->Data['id'];?>&SID=$Session;?>&FID='+data.nodes[0].id;
- //document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID==$CUser->Data['id'];?>&SID=$Session;?>&FID='+data.nodes[0].id;
- } else {
- Ext.getCmp('cam_login').setValue('');
- Ext.getCmp('cam_password').setValue('');
- Ext.getCmp('cam_auth_mode').setValue( 0 );
- Ext.getCmp('acm_btn').disable();
- Ext.getCmp('cac_tab').enable();
- Ext.getCmp('lens_tab').disable();
- Ext.getCmp('str_tab').disable();
- Ext.getCmp('ptz_tab').disable();
- Ext.getCmp('coc_tabs').setActiveTab( 0 );
- sourceListStore.removeAll();
- if( data.error != null ){
- Ext.Msg.show({
- title:"=$Labels->GetLabel('Error_Message');?>",
- msg: data['error'],
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- //fn: processResult,
- //animEl: 'elId',
- icon: Ext.MessageBox.ERROR //QUESTION
- });
- };
- };
- },
- failure: function( response, opts ) {
- Ext.getCmp('cam_login').setValue('');
- Ext.getCmp('cam_password').setValue('');
- Ext.getCmp('cam_auth_mode').setValue( 0 );
- Ext.getCmp('cac_tab').enable();
- Ext.getCmp('lens_tab').disable();
- Ext.getCmp('str_tab').disable();
- Ext.getCmp('ptz_tab').disable();
- Ext.getCmp('coc_tabs').setActiveTab( 0 );
- sourceListStore.removeAll();
- }
- });
-};
-
-function discoverOnvifProfiles( CamID, camUser, camPasswd, Auth ){
- Ext.Ajax.request({
- url: '/lib/controller/discoverOnvifProfiles.php',
- params: {
- NID: 0,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- CID: CamID,
- GUG: camUser,
- GOG: camPasswd,
- GAT: Auth
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- Ext.getCmp('cac_tab').getEl().unmask();
- if( data['success'] == true ){
- Ext.getCmp('acm_btn').enable();
- Ext.getCmp('cac_tab').disable();
- Ext.getCmp('lens_tab').enable();
- Ext.getCmp('str_tab').enable();
- Ext.getCmp('ptz_tab').enable();
- Ext.getCmp('coc_tabs').setActiveTab( 1 );
- sourceListStore.loadData( data, false );
- var tpic = document.getElementById('pic_prev');
- if( tpic != null ) tpic.src = '/lib/controller/getCameraPreview.php?UID==$CUser->Data['id'];?>&SID=$Session;?>&FID='+data.nodes[0].id;
- } else {
- Ext.Msg.show({
- title:"=$Labels->GetLabel('Error_Message');?>",
- msg: data['error'],
- width: 640,
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- //fn: processResult,602811123
- //animEl: 'elId',
- icon: Ext.MessageBox.ERROR //QUESTION
- });
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-var CamPropType = 0;
-
-function showIPCamPropDialog(){
- if( connectIPCamDialog == null ){
- connectIPCamDialog = new Ext.Window({
- modal: true,
- title: (CamPropType)?"=$Labels->GetLabel('_CON_2_IP_CAM_');?>":"IP Camera Settings",
- width: 600,
- height: 500,
- layout: 'vbox',
- closeAction: 'hide',
- border: false,
- items:[{
- xtype: 'form',
- width: '100%',
- labelWidth: 200,
- labelAlign: 'right',
- labelSeparator: '',
- items: [{
- xtype: 'spacer',
- height: 5
- },{
- id: 'cam_label',
- xtype: 'textfield',
- fieldLabel: "=$Labels->GetLabel('_CAM_MAP_NAME_');?>"
- //width: 200
- },{
- xtype: 'combo',
- fieldLabel: "=$Labels->GetLabel('_CTL_SERVER_NODE_');?>",
- lazyRender: true,
- id: 'cam_server_id',
- //width: 200,
- disabled: false,
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: ServerListStore,
- valueField: 'server_id',
- displayField: 'server_name'
- },{
- xtype: 'spacer',
- height: 5
- }]
- },{
- id: 'coc_tabs',
- xtype: 'tabpanel',
- activeTab: 0,
- items: [{
- title: "=$Labels->GetLabel('_CAC_TAB_');?>",
- id: 'cac_tab',
- layout: 'table',
- width: '100%',
- border: false,
- disabled: false,
- defaults: {
- border: false,
- frame: false,
- bodyStyle: 'padding:10px'
- },
- layoutConfig: {
- columns: 3
- },
- items: [{
- colspan: 3,
- html: "=$Labels->GetLabel('_PROV_CAC_');?>
"
- },{
- html: "=$Labels->GetLabel('_LOGIN_0_');?>
",
- width: 170
- },{
- id: 'cam_login',
- xtype: 'textfield',
- width: 200
- },{
- html: ' '
- },{
- html: "=$Labels->GetLabel('_PASSWORD_0_');?>
"
- },{
- id: 'cam_password',
- xtype: 'textfield',
- inputType: 'password',
- width: 200
- },{
- html: ' '
- },{
- html: "=$Labels->GetLabel('_AUTH_MODE_0_');?>
"
- },{
- id: 'cam_auth_mode',
- xtype: 'combo',
- lazyRender: true,
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['mode','mode_txt'],
- data: [
- [0,'BASIC'],
- [1,'DIGEST'],
- [2,'DIGEST_IE'],
- [3,'BEARER'],
- [4,'NEGOTIATE'],
- [5,'NTLM'],
- [6,'NTLM_WB'],
- [7,'ANY'],
- [8,'ANYSAFE'],
- [9,'ONLY'],
- [10,'AWS_SIGV4']
- ]
- }),
- valueField: 'mode',
- displayField: 'mode_txt',
- value: 0,
- width: 200
- },{
- html: ' '
- },{
- html: ' '
- },{
- xtype: 'button',
- text: "Connect to Camera",
- width: '100%',
- handler: function(){
- Ext.getCmp('cac_tab').getEl().mask("Please wait...","x-mask-loading");
- var User = Ext.getCmp('cam_login').getValue();
- var Passwd = Ext.getCmp('cam_password').getValue();
- var Auth = Ext.getCmp('cam_auth_mode').getValue();
- discoverOnvifProfiles( SelectedCam, User, Passwd, Auth );
- }
- },{
- html: ' '
- }]
- },{
- title: "=$Labels->GetLabel('_STREAMS_');?>",
- id: 'str_tab',
- frame: false,
- disabled: true,
- items:[{
- xtype: 'grid',
- //title: "=$Labels->GetLabel('_STREAMS_');?>",
- height: 124,
- frame: false,
- disableSelection: true,
- ds: sourceListStore,
- cm: sourceListColModel,
- sm: sourceListSelModel
- },{
- height: 300,
- id: 'pic_prev',
- width: 600,
- html: ' '
-
- }]
- },{
- title: 'Lens Settings',
- id: 'lens_tab',
- disabled: true,
- items:[{
- layout: 'table',
- layoutConfig: {
- columns: 3
- },
- defaults: {
- frame: false,
- bodyStyle: 'padding:10px',
- border: false
- },
- items:[{
- width: 200,
- html: "Sensor Size"
- },{
- xtype: 'combo',
- fieldLabel: "Sensor Size",
- lazyRender: true,
- id: 'sens_size',
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['size','size_txt'],
- data: [
- [0,'1/3.6"'],
- [1,'1/3.2"'],
- [2,'1/3"'],
- [3,'1/2.7"'],
- [4,'1/2"'],
- [5,'1/1.8"'],
- [6,'2/3"'],
- [7,'1"'],
- [8,'4/3"'],
- [9,'APS-C'],
- [10,'35 mm'],
- [11,'645']
- ]
- }),
- valueField: 'size',
- displayField: 'size_txt',
- value: 0
- },{
- html: ' '
- },{
- html: 'Focal Length'
- },{
- xtype: 'combo',
- fieldLabel: "Lens Focal Length",
- lazyRender: true,
- id: 'lens_fl',
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['fl','fl_txt'],
- data: [
- [0,'2.7 mm.'],
- [1,'3.0 mm.'],
- [2,'3.2 mm.'],
- [3,'3.5 mm.'],
- [4,'3.7 mm.'],
- [5,'3.9 mm.'],
- [6,'4.0 mm.'],
- [7,'4.3 mm.'],
- [8,'4.8 mm.'],
- [9,'5.0 mm.'],
- [10,'5.1 mm.'],
- [11,'5.5 mm.'],
- [12,'5.8 mm.'],
- [13,'6.0 mm.'],
- [14,'6.2 mm.'],
- [15,'6.6 mm.'],
- [16,'7.0 mm.'],
- [17,'7.1 mm.'],
- [18,'7.5 mm.'],
- [19,'7.6 mm.'],
- [20,'8.0 mm.'],
- [21,'8.6 mm.'],
- [22,'8.9 mm.'],
- [23,'9.0 mm.'],
- [24,'9.2 mm.'],
- [25,'9.3 mm.'],
- [26,'10.0 mm.'],
- [27,'10.5 mm.'],
- [28,'10.6 mm.'],
- [29,'10.7 mm.'],
- [30,'11.0 mm.'],
- [31,'11.3 mm.'],
- [32,'12.0 mm.'],
- [33,'12.9 mm.'],
- [34,'13.0 mm.'],
- [35,'13.5 mm.'],
- [36,'13.6 mm.'],
- [37,'14.0 mm.'],
- [38,'14.6 mm.'],
- [39,'15.0 mm.'],
- [40,'15.1 mm.'],
- [41,'15.5 mm.'],
- [42,'16.0 mm.'],
- [43,'17.0 mm.'],
- [44,'17.5 mm.'],
- [44,'17.7 mm.'],
- [45,'18.0 mm.'],
- [46,'18.2 mm.'],
- [47,'19.0 mm.']
- ]
- }),
- valueField: 'fl',
- displayField: 'fl_txt',
- value: 0
- },{
- html: ' '
- },{
- html: "Fixed Zoom"
- },{
- xtype: 'radio',
- id: 'no_zoom',
- name: 'zoom_ena',
- value: 1,
- checked: true
- },{
- html: ' '
- },{
- html: 'Variable Zoom'
- },{
- xtype: 'radio',
- id: 'on_zoom',
- hideLabel: false,
- fieldLabel: 'Variable Zoom',
- name: 'zoom_ena',
- value: 0,
- checked: false,
- handler: function( a, c ){
- if( c ){
- Ext.getCmp('zoom_val').enable();
- Ext.getCmp('zoom_val').setValue( 1 );
- var zz = Ext.getCmp('zoom_d');
- if( zz.rendered ) zz.update('X 1
');
- } else {
- Ext.getCmp('zoom_val').disable();
- var zz = Ext.getCmp('zoom_d');
- if( zz.rendered ) zz.update(' ');
- };
- }
- },{
- html: ' '
- },{
- html: 'Zoom Ratio'
- },{
- xtype: 'slider',
- id: 'zoom_val',
- disabled: true,
- minValue: 1.0,
- maxValue: 40.0,
- listeners:{
- change: function( a, c, b ){
- var zz = Ext.getCmp('zoom_d');
- if( zz.rendered ) zz.update('X '+ c + '
');
- }
- }
- },{
- id: 'zoom_d',
- html: ' '
- }]
- }]
- },{
- title: '=$Labels->GetLabel('_PTZ_TAB_');?>',
- id: 'ptz_tab',
- disabled: true,
- items:[{
- layout: 'table',
- layoutConfig: {
- columns: 3
- },
- defaults: {
- frame: false,
- bodyStyle: 'padding:10px',
- border: false
- },
- items:[{
- width: 200,
- html: '=$Labels->GetLabel('__PTZ_CONTROL__');?>'
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('__PTZ_CONTROL__');?>',
- lazyRender: true,
- id: 'ptz_proto',
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['type','type_txt'],
- data: [
- [0,'=$Labels->GetLabel('_NO_PTZ_');?>'],
- [1,'Sony VISCA'],
- [2,'Pelco-D'],
- [3,'OnVif'],
- [4,'PSIA'],
- [5,'GB/T28181']
- ]
- }),
- value: 0,
- valueField: 'type',
- displayField: 'type_txt',
- listeners:{
- change: function( a, c, b ){
- if( c > 0 ){
- if( c != 3 ){
- Ext.getCmp('uart_id').enable();
- Ext.getCmp('prot_id').enable();
- } else {
- Ext.getCmp('uart_id').disable();
- Ext.getCmp('prot_id').disable();
- };
- Ext.getCmp('pan_mode').enable();
- Ext.getCmp('tilt_mode').enable();
- Ext.getCmp('pan_ang').enable();
- Ext.getCmp('tilt_ang').enable();
- } else {
- Ext.getCmp('uart_id').disable();
- Ext.getCmp('prot_id').disable();
- Ext.getCmp('pan_mode').disable();
- Ext.getCmp('tilt_mode').disable();
- Ext.getCmp('pan_ang').disable();
- Ext.getCmp('tilt_ang').disable();
- };
- }
- }
- },{
- html: ' '
- },{
- html: '=$Labels->GetLabel('_UART_PORT_');?>'
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('_UART_PORT_');?>',
- lazyRender: true,
- id: 'uart_id',
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- disabled: true,
- store: new Ext.data.ArrayStore({
- fields: ['uart','uart_txt'],
- data: [Query( $QS );
- if( count( $RR ) ){
- $RE=array();
- foreach( $RR as $R ){
- $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
- };
- echo implode( ',', $RE );
- } else {
- echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
- };
- ?>]
- }),
- valueField: 'uart',
- displayField: 'uart_txt'
- },{
- html: ' '
- },{
- html: '=$Labels->GetLabel('_CAM_PROTO_ID_');?>'
- },{
- xtype: 'numberfield',
- id: 'prot_id',
- width: '95%',
- disabled: true,
- minValue: 0,
- maxValue: 255
- },{
- html: ' '
- },{
- html: 'Pan Model'
- },{
- xtype: 'combo',
- fieldLabel: 'Pan Model',
- lazyRender: true,
- id: 'pan_mode',
- disabled: true,
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['pm','pm_txt'],
- data: [
- [0,'Regular'],
- [1,'Reversed']
- ]
- }),
- valueField: 'pm',
- displayField: 'pm_txt',
- value: 0
- },{
- html: ' '
- },{
- html: 'Tottal Pan Angles'
- },{
- xtype: 'numberfield',
- id: 'pan_ang',
- width: '95%',
- disabled: true,
- minValue: 0,
- maxValue: 360,
- value: 360
- },{
- html: ' '
- },{
- html: 'Tilt Model'
- },{
- xtype: 'combo',
- fieldLabel: 'Tilt Model',
- lazyRender: true,
- id: 'tilt_mode',
- disabled: true,
- mode: 'local',
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['tm','tm_txt'],
- data: [
- [0,'Regular'],
- [1,'Reversed'],
- [2,'Shifted 90°'],
- [3,'Rev-Shifted 90°']
- ]
- }),
- valueField: 'tm',
- displayField: 'tm_txt',
- value: 0
- },{
- html: ' '
- },{
- html: 'Tottal Tilt Angles'
- },{
- xtype: 'numberfield',
- id: 'tilt_ang',
- width: '95%',
- disabled: true,
- minValue: 0,
- maxValue: 180,
- value: 90
- },{
- html: ' '
- }]
- }]
- }]
- }],
- bbar:[{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- //addDialog.close();
- //addDialog = null;
- connectCamDialog.hide();
- //connectOnvifDialog = null;
- }
- },'->',{
- text: 'Add Camera to Map',
- id: 'acm_btn',
- disabled: true,
- handler: function(){
- var CLAB = Ext.getCmp('cam_label').getValue();
- var CPTZP = Ext.getCmp('ptz_proto').getValue();
- var CPTZU = Ext.getCmp('uart_id').getValue();
- var CPTZID = Ext.getCmp('prot_id').getValue();
- var CPANM = Ext.getCmp('pan_mode').getValue();
- var CTILTM = Ext.getCmp('tilt_mode').getValue();
- var CPANANG = Ext.getCmp('pan_ang').getValue();
- var CTILTANG = Ext.getCmp('tilt_ang').getValue();
- var CIMAGER = Ext.getCmp('sens_size').getValue();
- var CLFL = Ext.getCmp('lens_fl').getValue();
- var CZOOM = Ext.getCmp('zoom_val').getValue();
- var SRVID = Ext.getCmp('cam_server_id').getValue();
- var AllOK = true;
- if( CLAB == '' ) {
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide Camera Name!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( SelectedSource == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Select Image Source!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( SRVID == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Select Server to Connect Camera!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( ( SelectedCamTYPE == 11 || SelectedCamTYPE == 13 ) && CPTZP == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide PTZ Protocol type!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZU == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide UART Port!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZID == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide Camera ID!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( AllOK ){
- Ext.Ajax.request({
- url: '/lib/controller/addNetworkNode.php',
- params: {
- SITEID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- CID: SelectedCam,
- STREAM: SelectedSource,
- SRVID: SRVID,
- LAB: CLAB,
- UART: CPTZU,
- PROTOID: CPTZID,
- PANMODE: CPANM,
- TILTMODE: CTILTM,
- PANANG: CPANANG,
- TILTANG: CTILTANG,
- IMSIZE: CIMAGER,
- LFL: CLFL,
- ZOOM: CZOOM,
- PTZ: CPTZP,
- TYPE: SelectedCamTYPE
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.success ){
- addIpCamDialog.close();
- addIpCamDialog = null;
- connectIPCamDialog.close();
- connectIPCamDialog = null;
- } else {
- Ext.Msg.show({
- title:'Error Message',
- msg: data.msg,
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- fn: function(){
- //SettingsLidar3D.hide();
- },
- //animEl: 'elId',
- icon: Ext.MessageBox.ERROR //QUESTION
- });
- };
- },
- failure: failureAJAXFunction
- });
- };
- }
- }]
- });
- } else {
-
- };
- connectIPCamDialog.show();
-};
-
-function showAnalCamPropDialog(){
- if( connectAnalCamDialog == null ){
- connectAnalCamDialog = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel('_CREA_ANAL_CAM_');?>',
- width: 600,
- height: 500,
- layout: 'vbox',
- closeAction: 'hide',
- border: false,
- items:[{
- xtype: 'form',
- width: '100%',
- labelWidth: 200,
- labelAlign: 'right',
- labelSeparator: '',
- items: [{
- xtype: 'spacer',
- height: 5
- },{
- id: 'cam_label',
- xtype: 'textfield',
- fieldLabel: '=$Labels->GetLabel('_CAM_MAP_NAME_');?>'
- //width: 200
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('_CTL_SERVER_NODE_');?>',
- lazyRender: true,
- id: 'cam_server_id',
- //width: 200,
- disabled: false,
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: ServerListStore,
- valueField: 'server_id',
- displayField: 'server_name'
- },{
- xtype: 'spacer',
- height: 5
- }]
- },{
- id: 'coc_tabs',
- xtype: 'tabpanel',
- activeTab: 0,
- items: [{
- title: 'Lens Settings',
- xtype: 'form',
- id: 'lens_tab',
- disabled: false,
- items:[{
- layout: 'table',
- layoutConfig: {
- columns: 3
- },
- defaults: {
- frame: false,
- bodyStyle: 'padding:10px',
- border: false
- },
- items:[{
- width: 200,
- html: 'Sensor Size'
- },{
- xtype: 'combo',
- fieldLabel: 'Sensor Size',
- lazyRender: true,
- id: 'sens_size',
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['size','size_txt'],
- data: [
- [0,'1/3.6"'],
- [1,'1/3.2"'],
- [2,'1/3"'],
- [3,'1/2.7"'],
- [4,'1/2"'],
- [5,'1/1.8"'],
- [6,'2/3"'],
- [7,'1"'],
- [8,'4/3"'],
- [9,'APS-C'],
- [10,'35 mm'],
- [11,'645']
- ]
- }),
- valueField: 'size',
- displayField: 'size_txt'
- },{
- html: ' '
- },{
- html: 'Fixed Zoom'
- },{
- xtype: 'radio',
- id: 'no_zoom',
- name: 'zoom_ena',
- value: 0,
- checked: true
- },{
- html: ' '
- },{
- html: 'Variable Zoom'
- },{
- xtype: 'radio',
- id: 'on_zoom',
- hideLabel: false,
- fieldLabel: 'Variable Zoom',
- html: 'koko',
- name: 'zoom_ena',
- value: 1,
- checked: false,
- handler: function( a, c ){
- if( c ){
- Ext.getCmp('max_foc').enable();
- Ext.getCmp('zoom_val').enable();
- var mf = Ext.getCmp('min_foc').getValue();
- if( mf > 0 ){
- Ext.getCmp('max_foc').setValue( mf );
- Ext.getCmp('zoom_val').setValue( 1 );
- };
- } else {
- Ext.getCmp('max_foc').disable();
- Ext.getCmp('zoom_val').disable();
- Ext.getCmp('zoom_disp').update(' ');
- };
- }
- },{
- html: ' '
- },{
- html: 'Min. Focal Length'
- },{
- xtype: 'numberfield',
- id: 'min_foc',
- width: '95%',
- minValue: 1.0,
- maxValue: 270.0
- },{
- html: ' '
- },{
- html: 'Max. Focal Length'
- },{
- xtype: 'numberfield',
- id: 'max_foc',
- width: '95%',
- disabled: true,
- minValue: 1.0,
- maxValue: 270.0,
- listeners:{
- change: function( a, c, b ){
- if( b == c ) return;
- var mf = Ext.getCmp('min_foc').getValue();
- if( mf > 0 ){
- if( c < mf ){
- Ext.getCmp('max_foc').setValue( mf );
- } else {
- var zl = c / mf;
- Ext.getCmp('zoom_val').setValue( zl );
- };
- };
- }
- }
- },{
- html: ' '
- },{
- html: 'Zoom Ratio'
- },{
- xtype: 'slider',
- id: 'zoom_val',
- disabled: true,
- minValue: 1.0,
- maxValue: 40.0,
- listeners:{
- change: function( a, c, b ){
- var mf = Ext.getCmp('min_foc').getValue();
- if( mf > 0 ){
- Ext.getCmp('max_foc').setValue( mf*c );
- Ext.getCmp('zoom_disp').update('X '+ c + '
');
- };
- }
- }
- },{
- id: 'zoom_disp',
- html: ' '
- }]
- }]
- },{
- title: '=$Labels->GetLabel('_PTZ_TAB_');?>',
- id: 'ptz_tab',
- disabled: true,
- items:[{
- layout: 'table',
- layoutConfig: {
- columns: 3
- },
- defaults: {
- frame: false,
- bodyStyle: 'padding:10px',
- border: false
- },
- items:[{
- width: 200,
- html: '=$Labels->GetLabel('__PTZ_CONTROL__');?>'
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('__PTZ_CONTROL__');?>',
- lazyRender: true,
- id: 'ptz_proto',
- mode: 'local',
- forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['type','type_txt'],
- data: [
- [0,'=$Labels->GetLabel('_NO_PTZ_');?>'],
- [1,'Sony VISCA'],
- [2,'Pelco-D'],
- [3,'OnVif'],
- [4,'PSIA'],
- [5,'GB/T28181']
- ]
- }),
- valueField: 'type',
- displayField: 'type_txt',
- listeners:{
- change: function( a, c, b ){
- if( c > 0 ){
- if( c != 3 ){
- Ext.getCmp('uart_id').enable();
- Ext.getCmp('prot_id').enable();
- } else {
- Ext.getCmp('uart_id').disable();
- Ext.getCmp('prot_id').disable();
- };
- Ext.getCmp('pan_mode').enable();
- Ext.getCmp('tilt_mode').enable();
- Ext.getCmp('pan_ang').enable();
- Ext.getCmp('tilt_ang').enable();
- } else {
- Ext.getCmp('uart_id').disable();
- Ext.getCmp('prot_id').disable();
- Ext.getCmp('pan_mode').disable();
- Ext.getCmp('tilt_mode').disable();
- Ext.getCmp('pan_ang').disable();
- Ext.getCmp('tilt_ang').disable();
- };
- }
- }
- },{
- html: ' '
- },{
- html: '=$Labels->GetLabel('_UART_PORT_');?>'
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('_UART_PORT_');?>',
- lazyRender: true,
- id: 'uart_id',
- mode: 'local',
- disabled: true,
- forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['uart','uart_txt'],
- data: [Query( $QS );
- if( count( $RR ) ){
- $RE=array();
- foreach( $RR as $R ){
- $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
- };
- echo implode( ',', $RE );
- } else {
- echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
- };
- ?>]
- }),
- valueField: 'uart',
- displayField: 'uart_txt'
- },{
- html: ' '
- },{
- html: '=$Labels->GetLabel('_CAM_PROTO_ID_');?>'
- },{
- xtype: 'numberfield',
- id: 'prot_id',
- width: '95%',
- disabled: true,
- minValue: 0,
- maxValue: 255
- },{
- html: ' '
- },{
- html: 'Pan Model'
- },{
- xtype: 'combo',
- fieldLabel: 'Pan Model',
- lazyRender: true,
- id: 'pan_mode',
- forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
- disabled: true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['pm','pm_txt'],
- data: [
- [0,'Regular'],
- [1,'Reversed']
- ]
- }),
- valueField: 'pm',
- displayField: 'pm_txt'
- },{
- html: ' '
- },{
- html: 'Tottal Pan Angles'
- },{
- xtype: 'numberfield',
- id: 'pan_ang',
- width: '95%',
- disabled: true,
- minValue: 0,
- maxValue: 360
- },{
- html: ' '
- },{
- html: 'Tilt Model'
- },{
- xtype: 'combo',
- fieldLabel: 'Tilt Model',
- lazyRender: true,
- id: 'tilt_mode',
- disabled: true,
- forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- fields: ['tm','tm_txt'],
- data: [
- [0,'Regular'],
- [1,'Reversed'],
- [2,'Shifted 90°'],
- [3,'Rev-Shifted 90°']
- ]
- }),
- valueField: 'tm',
- displayField: 'tm_txt'
- },{
- html: ' '
- },{
- html: 'Tottal Tilt Angles'
- },{
- xtype: 'numberfield',
- id: 'tilt_ang',
- width: '95%',
- disabled: true,
- minValue: 0,
- maxValue: 180
- },{
- html: ' '
- }]
- }]
- }]
- }],
- bbar:[{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- //connectAnalCamDialog.hide();
- connectAnalCamDialog.close();
- connectAnalCamDialog = null;
- }
- },'->',{
- text: '=$Labels->GetLabel('_ADD_CAMERA2SITE_');?>',
- id: 'acm_btn',
- handler: function(){
- var CLAB = Ext.getCmp('cam_label').getValue();
- var CPTZP = Ext.getCmp('ptz_proto').getValue();
- var CPTZU = Ext.getCmp('uart_id').getValue();
- var CPTZID = Ext.getCmp('prot_id').getValue();
- var CPANM = Ext.getCmp('pan_mode').getValue();
- var CTILTM = Ext.getCmp('tilt_mode').getValue();
- var CPANANG = Ext.getCmp('pan_ang').getValue();
- var CTILTANG = Ext.getCmp('tilt_ang').getValue();
- var CIMAGER = Ext.getCmp('sens_size').getValue();
- var CMINF = Ext.getCmp('min_foc').getValue();
- var CMAXF = Ext.getCmp('max_foc').getValue();
- var SRVID = Ext.getCmp('cam_server_id').getValue();
- var AllOK = true;
- if( CLAB == '' ) {
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide Camera Name!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( SelectedSource == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Select Image Source!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( SRVID == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Select Server to Connect Camera!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( ( SelectedCamTYPE == 11 || SelectedCamTYPE == 13 ) && CPTZP == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide PTZ Protocol type!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZU == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide UART Port!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( ( CPTZP == 1 || CPTZP == 2 ) && CPTZID == 0 ){
- AllOK = false;
- Ext.Msg.show({
- title:'Data Error!',
- msg: 'Please Provide Camera ID!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- return;
- };
- if( AllOK ){
- Ext.Ajax.request({
- url: '/lib/controller/addNetworkNode.php',
- params: {
- SITEID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- CID: SelectedCam,
- STREAM: SelectedSource,
- SRVID: SRVID,
- LAB: CLAB,
- UART: CPTZU,
- PROTOID: CPTZID,
- PANMODE: CPANM,
- TILTMODE: CTILTM,
- PANANG: CPANANG,
- TILTANG: CTILTANG,
- IMSIZE: CIMAGER,
- FMIN: CMINF,
- FMAX: CMAXF,
- PTZ: CPTZP,
- TYPE: SelectedCamTYPE
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.success ){
- reloadNetworkData();
- addAnalogCamDialog.close();
- addAnalogCamDialog = null;
- connectAnalCamDialog.close();
- connectAnalCamDialog = null;
- } else {
- Ext.Msg.show({
- title:'Data Error!',
- msg: data.msg,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- };
- //loadSystemEditor();
- },
- failure: failureAJAXFunction
- });
- };
- }
- }]
- });
- } else {
-
- };
- connectAnalCamDialog.show();
- if( SelectedCamTYPE == 11 ){
- Ext.getCmp('ptz_tab').enable();
- Ext.getCmp('on_zoom').enable();
- } else {
- Ext.getCmp('ptz_tab').disable();
- Ext.getCmp('on_zoom').disable();
- };
-};
-
-function connectToSeleced(){
- CamPropType = 1;
- if( SelectedCam > 0 ){
- preloadOnvifCredentials( SelectedCam );
- //loadCameraSettings( SelectedCam );
- };
-};
-
-function addIpCam(){
- if( addIpCamDialog == null ){
- addIpCamDialog = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel('_DET_IP_CAMERA_LST_');?>',
- width: 800,
- height: 600,
- layout: 'fit',
- closeAction: 'hide',
- items:{
- xtype: 'grid',
- frame: false,
- border: false,
- ds: cameraListStore,
- cm: IPCameraListColModel,
- sm: IPCameraListSelModel,
- viewConfig: {
- forceFit: true
- },
- bbar: [{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- addIpCamDialog.hide();
- }
- },'->',{
- id: 'con_to_ip_src',
- text: '=$Labels->GetLabel('_CONNECT_2_SEL_');?>',
- disabled: ( SelectedCam == 0 ),
- handler: connectToSeleced
- }]
- }
- });
- };
- addIpCamDialog.show();
- cameraListStore.load({params:{cam_sources:'ipv'}});
-};
-
-function addAnalogCam(){
- if( addAnalogCamDialog == null ){
- addAnalogCamDialog = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel('_ANAL_SOURCES_LST_');?>',
- width: 800,
- height: 600,
- layout: 'fit',
- closeAction: 'hide',
- items:[{
- xtype: 'grid',
- frame: false,
- border: false,
- ds: cameraListStore,
- cm: AnalogCameraListColModel,
- sm: AnalogCameraListSelModel,
- viewConfig: {
- forceFit: true
- }
- }],
- bbar: [{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- addAnalogCamDialog.hide();
- }
- },'->',{
- id: 'cha_an_strim_set',
- text: '=$Labels->GetLabel('_SETTINGS_');?>',
- disabled: ( SelectedSource == 0 ),
- handler: function(){
- editAnalogStream( SelectedSource );
- }
- },{
- id: 'con_to_anal_src',
- text: '=$Labels->GetLabel('_CONNECT_2_SEL_');?>',
- disabled: ( SelectedSource == 0 ),
- handler: function(){
- //alert( 'Cam Type:'+SelectedCamTYPE );
- showAnalCamPropDialog();
- }
- }]
- });
- };
- addAnalogCamDialog.show();
- cameraListStore.load({params:{cam_sources:'anal'}});
-};
-var changer_locked = false;
-function changeASS( stream, id ){
- if(changer_locked) return;
- changer_locked = true;
- var ll = Ext.getCmp( id );
- var name = ll.name;
- var value = ll.getValue();
- Ext.Ajax.request({
- url: '/lib/controller/setAnalogStreamCtrl.php',
- params: {
- STREAM: stream,
- PID: name,
- VALUE: value,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- changer_locked = false;
- // If the response is JSON, you have to decode it
- //var data = Ext.decode(response.responseText);
- },
- failure: failureAJAXFunction
- });
-};
-
-var AnalogStreamEditor = null;
-
-function editAnalogStream( SelStream, live=0 ){
- if( AnalogStreamEditor == null ){
- AnalogStreamEditor = new Ext.Window({
- modal: ((live==0)?true:false),
- title: 'Analog Input Settings',
- width: 440,
- height: 400,
- layout: 'fit',
- closeAction: 'hide',
- buttonAlign:'center',
- items:[{
- }],
- bbar: ['->',{
- text: '=$Labels->GetLabel('_CLOSE_');?>',
- handler: function(){//discoverOnvifSources
- AnalogStreamEditor.hide();
- }
- }]
- });
- };
- AnalogStreamEditor.show();
- Ext.Ajax.request({
- url: '/lib/controller/getAnalogStreamCtrl.php',
- params: {
- STREAM: SelStream,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- AnalogStreamEditor.removeAll( true );
- AnalogStreamEditor.add( data );
- AnalogStreamEditor.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-
diff --git a/lib/javascript/jsapi_dynamic/rgoose_dashboard.js b/lib/javascript/jsapi_dynamic/rgoose_dashboard.js
deleted file mode 100644
index cdc9622..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_dashboard.js
+++ /dev/null
@@ -1,1299 +0,0 @@
-//
-
-
-
-
-var serverToolBox = null;
-var currentNodeID = 0;
-
-
-//import * as THREE from 'three';
-
-//let camera, scene, renderer;
-var l3dMapOverlayTexture = new THREE.TextureLoader().load( '/lib/controller/data/assets/images/mask_3d.png' );
-var l3dMapOverlayMaterial = new THREE.MeshBasicMaterial( { map: l3dMapOverlayTexture, alphaTest: 0.7 } );
-var l3dMapOverlayGeometry = new THREE.SphereGeometry( 490, 60, 40 );
-// invert the geometry on the x-axis so that all of the faces point inward
- l3dMapOverlayGeometry.scale( -1, 1, 1 );
-var l3dMapOverlayMesh = new THREE.Mesh( l3dMapOverlayGeometry, l3dMapOverlayMaterial );
-
-function addl3dTarget( id, radius, az, el, color = 0xff0000 ){
- if( id > 0 ){
- var target = {};
- target.geometry = new THREE.BoxGeometry( 10, 10, 10 );
- //target.geometry = new THREE.OctahedronGeometry({ radius : 20 });
- //target.geometry.translate( x, y, z );
-
- // Turn back into Cartesian coordinates
- var fi = (Math.PI/2) - el;
- var x = radius * Math.sin( fi) * Math.cos( az );
- var y = radius * Math.sin( fi ) * Math.sin( az );
- var z = radius * Math.cos( fi );
-
- //alert( "Cords: "+x+" "+y+" "+z+" An:"+az+" "+el);
- //target.geometry.position.set( x, y, z ); //translate( x, y, z );
- target.material = new THREE.MeshBasicMaterial( {color: color} );
- target.mesh = new THREE.Mesh( target.geometry, target.material );
- nodeTHREEviewers[id].scene.add( target.mesh );
- target.mesh.position.set( x, z, y );
- nodeTHREEviewers[id].targets.push( target );
- };
-};
-
-function cleanup3DDraw( id ){
- if( typeof nodeTHREEviewers[id] !== 'undefined' ){
- if( typeof nodeTHREEviewers[id].targets !== 'undefined' ){
- for( var z=0; z < nodeTHREEviewers[id].targets.length; z++ ){
- nodeTHREEviewers[id].scene.remove( nodeTHREEviewers[id].targets[z].mesh );
- delete nodeTHREEviewers[id].targets[z].mesh;
- delete nodeTHREEviewers[id].targets[z].material;
- delete nodeTHREEviewers[id].targets[z].geometry;
- delete nodeTHREEviewers[id].targets[z];
- };
- nodeTHREEviewers[id].targets = [];
- //nodeTHREEviewers[id].renderer.render( nodeTHREEviewers[id].scene, nodeTHREEviewers[id].camera );
- };
- };
-};
-
-function DrawClicker( id, event ){
- var x = event.offsetX-100;
- var y = event.offsetY-100;
- switch( drawZoomLevels[ id ] ){
- case 100:{
- var r = Math.round( 1024.0 / 98 * Math.sqrt( x*x + y*y ) );
- if( r > 1024 ) r = 1024;
- break;
- };
- case 50:{
- var r = Math.round( 512.0 / 98 * Math.sqrt( x*x + y*y ) );
- if( r > 512 ) r = 512;
- break;
- };
- case 25:{
- var r = Math.round( 256.0 / 98 * Math.sqrt( x*x + y*y ) );
- if( r > 256 ) r = 256;
- break;
- };
- case 12:{
- var r = Math.round( 128.0 / 98 * Math.sqrt( x*x + y*y ) );
- if( r > 128 ) r = 128;
- break;
- };
- default:{
- var r = -1;
- break;
- };
- };
- if( r > -1 ){
- var z = Math.round( -1.0 * Math.atan2(y, x) * 3000 / Math.PI );
- if( z < 0 ) z += 6000 ;
- doDeviceOperation( id, 42, r+':'+z, true );
- };
-};
-
-function Draw3DTargets( k, b ){
- cleanup3DDraw( k );
- for( var z = 0; z < b.length; z++ ){
- var az = b[z].az * ( Math.PI/180.0 );
- var el = b[z].el * ( Math.PI/180.0 );
- //addl3dTarget( k, b[z].range, az, el, b[z].color );
- addl3dTarget( k, 280, az, el, b[z].color );
- };
-};
-
-let isUserInteracting = false, onPointerDownMouseX = 0, onPointerDownMouseY = 0,
- lon = 0, onPointerDownLon = 0,
- lat = 0, onPointerDownLat = 0,
- phi = 0, theta = 0;
-
- function onWindowResize() {
-
- camera.aspect = window.innerWidth / window.innerHeight;
- camera.updateProjectionMatrix();
-
- renderer.setSize( window.innerWidth, window.innerHeight );
-
- };
-
- function onPointerDown( event ) {
-
- if ( event.isPrimary === false ) return;
-
- isUserInteracting = true;
-
- onPointerDownMouseX = event.clientX;
- onPointerDownMouseY = event.clientY;
-
- onPointerDownLon = lon;
- onPointerDownLat = lat;
-
- document.addEventListener( 'pointermove', onPointerMove );
- document.addEventListener( 'pointerup', onPointerUp );
-
- };
-
- function onPointerMove( event ) {
-
- if ( event.isPrimary === false ) return;
-
- lon = ( onPointerDownMouseX - event.clientX ) * 0.1 + onPointerDownLon;
- lat = ( event.clientY - onPointerDownMouseY ) * 0.1 + onPointerDownLat;
-
- };
-
- function onPointerUp() {
-
- if ( event.isPrimary === false ) return;
-
- isUserInteracting = false;
-
- document.removeEventListener( 'pointermove', onPointerMove );
- document.removeEventListener( 'pointerup', onPointerUp );
-
- };
-
- function onDocumentMouseWheel( event ) {
- var id = event.currentTarget.myVID;
- if( id > 0 ){
- const fov = nodeTHREEviewers[id].camera.fov + event.deltaY * 0.05;
- nodeTHREEviewers[id].camera.fov = THREE.MathUtils.clamp( fov, 10, 75 );
- nodeTHREEviewers[id].camera.updateProjectionMatrix();
- };
- };
- function reload3dTexture( id ){
- if( typeof nodeTHREEviewers[id] !== 'undefined' ){
- stopAnimation();
- //while( nodeTHREEviewers[id].scene.children.length > 0){
- // nodeTHREEviewers[id].scene.remove(nodeTHREEviewers[id].scene.children[0]);
- //};
- nodeTHREEviewers[id].scene.remove( nodeTHREEviewers[id].mesh );
- //nodeTHREEviewers[id].mesh.geometry.dispose();
- //nodeTHREEviewers[id].mesh.material.dispose();
- delete nodeTHREEviewers[id].mesh;
- delete nodeTHREEviewers[id].material;
- delete nodeTHREEviewers[id].texture;
- delete nodeTHREEviewers[id].geometry;
-
- nodeTHREEviewers[id].geometry = new THREE.SphereGeometry( 500, 60, 40 );
- nodeTHREEviewers[id].geometry.scale( -1, 1, 1 );
- nodeTHREEviewers[id].texture = new THREE.TextureLoader().load( '/lib/controller/getDeviceDraw.php?NID='+id );
- nodeTHREEviewers[id].material = new THREE.MeshBasicMaterial( { map: nodeTHREEviewers[id].texture } );
- nodeTHREEviewers[id].mesh = new THREE.Mesh( nodeTHREEviewers[id].geometry, nodeTHREEviewers[id].material );
-
- nodeTHREEviewers[id].scene.add( nodeTHREEviewers[id].mesh );
- animate();
- //nodeTHREEviewers[id].material.map.needsUpdate = true;
- //nodeTHREEviewers[id].material.needsUpdate = true
- //alert( ' reloadded ' );
- };
- };
- function stopAnimation(){
- if( nodeTHREEanimationId > 0 ) cancelAnimationFrame( nodeTHREEanimationId );
- };
- function animate( ) {
- if( nodeTHREEanimationId > 0 ) cancelAnimationFrame( nodeTHREEanimationId );
- nodeTHREEanimationId = requestAnimationFrame( animate );
- nodeTHREEviewers.forEach( function(element, index, array){
- if ( isUserInteracting === false ) {
-
- lon += 0.5;
-
- }
-
- lat = Math.max( - 85, Math.min( 85, lat ) );
- phi = THREE.MathUtils.degToRad( 90 - lat );
- theta = THREE.MathUtils.degToRad( lon );
-
- const x = 500 * Math.sin( phi ) * Math.cos( theta );
- const y = 500 * Math.cos( phi );
- const z = 500 * Math.sin( phi ) * Math.sin( theta );
-
- element.camera.lookAt( x, y, z );
-
- element.renderer.render( element.scene, element.camera );
- });
- //update( id );
- };
- function animateTargets(){
- if( nodeTHREEanimationId > 0 ) cancelAnimationFrame( nodeTHREEanimationId );
- nodeTHREEanimationId = requestAnimationFrame( animateTargets );
- nodeTHREEviewers.forEach( function(element, index, array){
- if ( isUserInteracting === false ) {
-
- if( element.targetShowCopunter ){
- element.targetShowCopunter--;
- } else {
- element.camera.lookAt( element.targets[element.targetIndex].mesh.position );
- element.targetShowCopunter = 100;
- element.renderer.render( element.scene, element.camera );
- element.targetIndex++;
- if( element.targetIndex == element.targets.length ) element.targetIndex = 0;
- };
- };
- });
- };
- function update() {
-
- if ( isUserInteracting === false ) {
-
- lon += 0.5;
-
- }
-
- lat = Math.max( - 85, Math.min( 85, lat ) );
- phi = THREE.MathUtils.degToRad( 90 - lat );
- theta = THREE.MathUtils.degToRad( lon );
-
- const x = 500 * Math.sin( phi ) * Math.cos( theta );
- const y = 500 * Math.cos( phi );
- const z = 500 * Math.sin( phi ) * Math.sin( theta );
-
- camera.lookAt( x, y, z );
-
- renderer.render( scene, camera );
-
- };
-
-
-
-function Pie(cx, cy, radius, data) {
-
- var decimals = 4;
- var total = 0;
- var offset = 0;
- var offset2;
- var arr = [];
- var x;
- var y;
- var la;
- var radians;
-
- for (var i = 0; i < data.length; i++)
- total += data[i].value;
-
- for (var i = 0; i < data.length; i++) {
-
- var item = data[i];
- var tmp = {};
-
- tmp.index = i;
- tmp.value = item.value;
- radians = ((((item.value / total) * 360) * Math.PI) / 180).floor(decimals);
- offset2 = ((offset / total) * 360).floor(decimals);
- tmp.data = item;
-
- x = (cx + Math.sin(radians) * radius).floor(decimals);
- y = (cy - Math.cos(radians) * radius).floor(decimals);
- la = radians > Math.PI ? 1 : 0;
-
- // Arc
- tmp.d = 'M{0} {1},L{0} {2},A{3} {3},0 {4} 1,{5} {6}Z'.format(cx, cy, cy - radius, radius, la, x, y);
- tmp.transform = 'rotate({0}, {1}, {2})'.format(offset2, cx, cy);
-
- // Text
- x = (cx + Math.sin(radians / 2) * radius / 2).floor(decimals);
- y = (cy - Math.cos(radians / 2) * radius / 2).floor(decimals);
- tmp.text = 'x="{0}" y="{1}" transform="rotate({2},{0},{1})"'.format(x, y, -offset2);
-
- offset += item.value;
- arr.push(tmp);
- }
-
- return arr;
-}
-
-function Donut(cx, cy, radius, data) {
- function arcradius(cx, cy, radius, degrees) {
- var radians = (degrees - 90) * Math.PI / 180.0;
- return { x: cx + (radius * Math.cos(radians)), y: cy + (radius * Math.sin(radians)) };
- }
-
- var decimals = 4;
- var total = 0;
- var arr = [];
- var beg = 0;
- var end = 0;
- var count = 0;
-
- var half = radius / 2;
- var midpoint = radius / 2.4;
-
- for (var i = 0; i < data.length; i++)
- total += data[i].value;
-
- for (var i = 0; i < data.length; i++) {
- var item = data[i];
- var tmp = {};
-
- //var p = (((item.value + 1) / total) * 100).floor( 2 );
- var p = Math.floor(((item.value + 1) / total) * 100);
-
- count += p;
-
- if (i === length - 1 && count < 100)
- p = p + (100 - count);
-
- end = beg + ((360 / 100) * p);
- tmp.index = i;
- tmp.value = item.value;
- tmp.data = item;
-
- var b = arcradius(cx, cy, radius, end);
- var e = arcradius(cx, cy, radius, beg);
- var la = (end - beg) <= 180 ? 0 : 1;
-
- tmp.d = ['M', Math.floor( b.x ), Math.floor( b.y ), 'A', radius, radius, 0, la, 0, Math.floor( e.x ), Math.floor( e.y ) ].join(' ');
- arr.push(tmp);
- beg = end;
- }
-
- return arr;
-}
-
-//Pie Chart Usage
-/*
-var svg = $('#yoursvgelement');
-var data = [{ value: 33 }, { value: 20 }, { value: 80 }, { value: 48 }];
-var centerX = 300;
-var centerY = 300;
-var radius = 250;
-var color = ['#F6BB42', '#8CC152', '#3BAFDA', '#967ADC', '#DA4453'];
-
-var arr = Pie(centerX, centerY, radius, data);
-for (var i = 0; i < arr.length; i++) {
- var item = arr[i];
- svg.asvg('{3} '.format(item.transform, item.d, item.text, item.value, color[i]));
-}
-*/
-
-// Donut Chart Usage
-/*
-var svg = $('#yoursvgelement');
-var data = [{ value: 33 }, { value: 20 }, { value: 80 }, { value: 48 }];
-var centerX = 300;
-var centerY = 300;
-var radius = 250;
-var color = ['#F6BB42', '#8CC152', '#3BAFDA', '#967ADC', '#DA4453'];
-
-var arr = Donut(centerX, centerY, radius, data);
-for (var i = 0; i < arr.length; i++) {
- var item = arr[i];
- svg.asvg(' '.format(item.d, color[i]));
-}
-*/
-
-function makePtzMove( me ){
- var name = me.target.id;
- Ext.Ajax.request({
- url: '/lib/controller/camMakeMove.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- CMD: name
- },
- //success: function( response, opts ){
- //},
- failure: failureAJAXFunction
- });
-};
-
-function ptzCtrl( a ){
-
-};
-
-function makePtzStop( me ){
- var name = me.target.id;
- Ext.Ajax.request({
- url: '/lib/controller/camStop.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- CMD: name
- },
- //success: function( response, opts ){
- //},
- failure: failureAJAXFunction
- });
-};
-
-function fullScreen( id = '' ){
- if(
- id == '' ||
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement
- ){
- if( document.exitFullscreen ){
- document.exitFullscreen();
- }else if( document.mozCancelFullScreen ){
- document.mozCancelFullScreen();
- }else if( document.webkitExitFullscreen ){
- document.webkitExitFullscreen();
- }else if( document.msExitFullscreen ){
- document.msExitFullscreen();
- };
- }else{
- //element = $('#container').get(0);
- var element = document.getElementById( id ); //Ext.getCmp( id );
- if( element.requestFullscreen ){
- element.requestFullscreen();
- }else if( element.mozRequestFullScreen ){
- element.mozRequestFullScreen();
- }else if( element.webkitRequestFullscreen ){
- element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
- }else if( element.msRequestFullscreen ){
- element.msRequestFullscreen();
- };
- };
-};
-
-function updateDashBoardItemLayout( id, x, y ){
- Ext.Ajax.request({
- url: '/lib/controller/updateDashBoardItems.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- PANEL: id,
- X: x,
- Y: y
- },
- success: function( response, opts ){
- //var data = Ext.decode(response.responseText);
- //var tPanel = Ext.getCmp('main_portal');
- //tPanel.removeAll(true);
- //for( i=0; i < data.length; i++) tPanel.add( data[i] );
- //tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-var drawZoomLevels = Array();
-
-function cleanup2DDraw( a ){
- var canvas = document.getElementById('targ_canvas_'+a );
- var img = document.getElementById('draw_img_'+a );
- if( canvas != 'undefined' ){
- canvas.style='display: block; cursor: crosshair;'; //cursor: auto;
- img.style='display: none;';
- var ctx = canvas.getContext('2d');
- ctx.drawImage( img, 0, 0 );
- };
-};
-
-function Draw2DTargets( k, b ){
- var canvas = document.getElementById('targ_canvas_'+k );
- var ctx = canvas.getContext('2d');
- var img = document.getElementById('draw_img_'+k );
- ctx.drawImage( img, 0, 0 );
- canvas.style='display: block;';
- img.style='display: none;';
- for( var i=0; i< b.length; i++ ){
- switch( drawZoomLevels[k] ){
- case 12:{
- if( b[i].digital < 256 ){
- var cc = 255 - i ;//* ( 255 / 33 );
- //ctx.fillStyle = "#" + cc.toString(16) + "0000";
- ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
- //ctx.strokeStyle = "#FF0000";
- var r = (196 * b[i].digital)/ 512;
- var a = -1.0 * b[i].az * ( Math.PI / 180 );
- var x = 100 + Math.cos( a ) * r;
- var y = 100 + Math.sin( a ) * r;
- ctx.fillRect( x, y, 24, 24 );
- };
- break;
- };
- case 25:{
- if( b[i].digital < 512 ){
- var cc = 255 - i ;//* ( 255 / 33 );
- //ctx.fillStyle = "#" + cc.toString(16) + "0000";
- ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
- //ctx.strokeStyle = "#FF0000";
- var r = (196 * b[i].digital)/ 1024;
- var a = -1.0 * b[i].az * ( Math.PI / 180 );
- var x = 100 + Math.cos( a ) * r;
- var y = 100 + Math.sin( a ) * r;
- ctx.fillRect( x, y, 12, 12 );
- };
- break;
- };
- case 50:{
- if( b[i].digital < 1024 ){
- var cc = 255 - i ;//* ( 255 / 33 );
- //ctx.fillStyle = "#" + cc.toString(16) + "0000";
- ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
- //ctx.strokeStyle = "#FF0000";
- var r = (196 * b[i].digital) / 2048;
- var a = -1.0 * b[i].az * ( Math.PI / 180 );
- var x = 100 + Math.cos( a ) * r;
- var y = 100 + Math.sin( a ) * r;
- ctx.fillRect( x, y, 6, 6 );
- };
- break;
- };
- case 100:{
- var cc = 255 - i ;//* ( 255 / 33 );
- //ctx.fillStyle = "#" + cc.toString(16) + "0000";
- ctx.fillStyle = "rgba(255, 0, 0,"+((b.length - i)/ b.length )+")";
- //ctx.strokeStyle = "#FF0000";
- var r = (196 * b[i].digital)/ 4096;
- var a = -1.0 * b[i].az * ( Math.PI / 180 );
- var x = 100 + Math.cos( a ) * r;
- var y = 100 + Math.sin( a ) * r;
- ctx.fillRect( x, y, 3, 3 );
- break;
- };
- };
- };
-};
-
-var lastNotificationID = 0;
-
-function setDonatStatus( node_id, param_id, value ){
- alert('zaza');
- var val1D = document.getElementById('status_'+node_id+'_donut'+param_id+'_segment1');
- var val2D = document.getElementById('status_'+node_id+'_donut'+param_id+'_segment2');
- var val3D = document.getElementById('status_'+node_id+'_donut'+param_id+'_segment3');
-
- var val1 = (value>-1)?value:0;
- var val2 = (value>-1)?100 - val1:0;//data.nodes[i].cpu5 * 100;
- var val3 = (value>-1)?0:100;//data.nodes[i].cpu15 * 100;
- var totalValue = document.getElementById('status_'+node_id+'_totalValue'+param_id);
- if( totalValue == undefined ) return;
- var total = val1+val2+val3;
-
- var per1 = val1/total*100;
- var per2 = val2/total*100;
- var per3 = val3/total*100;
- var offset = 25;
- if( ( val1 != undefined ) && ( value > -1 ) ){
- totalValue.textContent = val1+'%';
- } else {
- totalValue.textContent = 'No Data';
- };
-
- val1D.style.transition = "stroke-dasharray 0.5s ease-in-out, stroke-dashoffset 0.5s ease-in-out";
- val1D.style.strokeDasharray = per1+" "+(100-per1);
- val1D.style.strokeDashoffset = offset;
-
- val2D.style.transition = "stroke-dasharray 0.5s ease-in-out, stroke-dashoffset 0.5s ease-in-out";
- val2D.style.strokeDasharray = per2+" "+(100-per2);
- val2D.style.strokeDashoffset = 100-per1+offset;
-
- val3D.style.transition = "stroke-dasharray 0.5s ease-in-out, stroke-dashoffset 0.5s ease-in-out";
- val3D.style.strokeDasharray = per3+" "+(100-per3);
- val3D.style.strokeDashoffset = 100-(per1+per2)+offset;
-};
-
-function fetchSiteStatus(){
- Ext.Ajax.request({
- url: '/lib/controller/getStatus.php',
- params: {
- SITE: =$SiteID;?>,
- LNID: lastNotificationID,
- SPID: StatusTS,
- LOAT: LoadTS,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- StatusTS = data.CTS;
- if( data.nodes.length > 0 ){
- for( i=0; i < data.nodes.length; i++ ){
- if( data.nodes[i].type == 0 ){
- //Handle Server Status
- if ( data.nodes[i].status ){
- setDonatStatus( data.nodes[i].id, 0, data.nodes[i].cpu5 );
- setDonatStatus( data.nodes[i].id, 1, data.nodes[i].mem );
- setDonatStatus( data.nodes[i].id, 2, data.nodes[i].disk );
- document.getElementById('status_'+data.nodes[i].id+'_txt').innerHTML="Server is Online";
- document.getElementById('status_'+data.nodes[i].id+'_img').src = "/style/icons/icons/accept.png";
- } else {
- setDonatStatus( data.nodes[i].id, 0, -1 );
- setDonatStatus( data.nodes[i].id, 1, -1 );
- setDonatStatus( data.nodes[i].id, 2, -1 );
- document.getElementById('status_'+data.nodes[i].id+'_txt').innerHTML="Server is Offline";
- document.getElementById('status_'+data.nodes[i].id+'_img').src = "/style/icons/icons/stop.png";
- };
- };
- // Sesors
- if( data.nodes[i].type > 0 && data.nodes[i].type < 7 ){
- if( data.nodes[i].reload_draw ){
- reload3dTexture( data.nodes[i].id );
- LoadTS = StatusTS;
- };
- };
- // Cameras
- if( data.nodes[i].type > 9 && data.nodes[i].type < 14 ){
- var iel = document.getElementById('img-'+data.nodes[i].id );
- if( iel != null ){
- if( !data.nodes[i].valid ){
- if( iel.src != "/style/assets/no-signal.png" ) iel.src = "/style/assets/no-signal.png";
- } else {
- if( data.nodes[i].src != iel.src ) iel.src = data.nodes[i].src;
- };
-
- };
- };
- var tt = Ext.getCmp('status_'+data.nodes[i].id );
- if( tt != undefined ){
- if( data.nodes[i].type < 5 && data.nodes[i].type > 0 ){
- if( data.nodes[i].status == 4 ){
- Draw2DTargets( data.nodes[i].id, data.nodes[i].targets );
- } else {
- cleanup2DDraw( data.nodes[i].id );
- };
- };
- if( data.nodes[i].type == 5 ){//addl3dTarget( id, radius, az, el, color = 0xff0000 )
- if( data.nodes[i].status == 4 ){
- //DrawTargets( data.nodes[i].id, data.nodes[i].targets );
- //addl3dTarget( data.nodes[i].id, data.nodes[i].targets[0].digital, data.nodes[i].targets[0].az, data.nodes[i].targets[0].el );
- //addl3dTarget( data.nodes[i].id, 150, data.nodes[i].targets[0].az, data.nodes[i].targets[0].el );
- Draw3DTargets( data.nodes[i].id, data.nodes[i].targets );
- animateTargets();
- } else {
- cleanup3DDraw( data.nodes[i].id );
- animate();
- };
- var ca = document.getElementById( 'status_canvas_' + data.nodes[i].id );
- var ctx = ca.getContext('2d');
- //if( stat_present );
- ca.style='display: block;';
- ctx.font = "10px Arial";
- ctx.fillStyle = "rgba(255, 255, 255, 255)";
- ctx.fillText( "Master:", 5, 8 );
- ctx.fillText( "Slave:", 5, 24 );
- //var cc = 255 - i ;//* ( 255 / 33 );
- //ctx.fillStyle = "#" + cc.toString(16) + "0000";
- //ctx.fillStyle = "rgba(255, 0, 0, 100)";//+((b.length - i)/ b.length )+")";
- if( data.nodes[i].master_present ){
- ctx.fillStyle = "rgba(0, 255, 0, 255)";
- } else {
- ctx.fillStyle = "rgba(128, 0, 0, 255)";
- };
- ctx.fillRect( 43, 1, 8, 8 );
- if( data.nodes[i].stat_present ){
- ctx.strokeStyle = "#FFFF00";
- ctx.strokeRect( 43, 1, 8, 8 );
- ctx.beginPath();
- ctx.moveTo( 51, 5 );
- ctx.lineTo( 56, 5 );
- ctx.lineTo( 56, 2 );
- ctx.lineTo( 103, 2 );
- ctx.lineTo( 103, 5 );
- ctx.moveTo( 63, 5 );
- ctx.lineTo( 143, 5 );
- ctx.stroke();
- for( z=0; z < 8; z++ ){
- //ctx.strokeStyle = "#FFFF00";
- //ctx.fillStyle = "rgba(0, 255, 0, 255)";
- ctx.fillStyle = "rgba(20, 20, 20, 255)";
- h = 19 - ( 19 * data.nodes[i].runtime.mp[z] );
- ha = 19 - h;
- ctx.fillRect( 64 + z*10, 7, 2, h );
- if( ha > 0 ) {
- if( data.nodes[i].runtime.mp[z] > 0.8 ){
- ctx.fillStyle = "rgba(0, 255, 0, 255)";
- } else if ( data.nodes[i].runtime.mp[z] > 0.5 ){
- ctx.fillStyle = "rgba( 255, 255, 0, 255)";
- } else if ( data.nodes[i].runtime.mp[z] > 0.3 ){
- ctx.fillStyle = "rgba( 255, 128, 0, 255)";
- } else {
- ctx.fillStyle = "rgba( 255, 0, 0, 255)";
- };
- ctx.fillRect( 64 + z*10, 7+h, 2, ha );
- };
- ctx.fillStyle = "rgba(20, 20, 20, 255)";
- h = 19 - ( 19 * data.nodes[i].runtime.gp[z] );
- ha = 19 - h;
- ctx.fillRect( 67 + z*10, 7, 2, h );
- if( ha > 0 ) {
- if( data.nodes[i].runtime.gp[z] > 0.8 ){
- ctx.fillStyle = "rgba(0, 255, 0, 255)";
- } else if ( data.nodes[i].runtime.gp[z] > 0.5 ){
- ctx.fillStyle = "rgba( 255, 255, 0, 255)";
- } else if ( data.nodes[i].runtime.gp[z] > 0.3 ){
- ctx.fillStyle = "rgba( 255, 128, 0, 255)";
- } else {
- ctx.fillStyle = "rgba( 255, 0, 0, 255)";
- };
- ctx.fillRect( 67 + z*10, 7+h, 2, ha );
- };
- ctx.fillStyle = "rgba(20, 20, 20, 255)";
- h = 19 - ( 19 * data.nodes[i].runtime.wp[z] );
- ha = 19 - h;
- ctx.fillRect( 70 + z*10, 7, 2, h );
- if( ha > 0 ){
- if( data.nodes[i].runtime.wp[z] > 0.8 ){
- ctx.fillStyle = "rgba(0, 255, 0, 255)";
- } else if ( data.nodes[i].runtime.wp[z] > 0.5 ){
- ctx.fillStyle = "rgba( 255, 255, 0, 255)";
- } else if ( data.nodes[i].runtime.wp[z] > 0.3 ){
- ctx.fillStyle = "rgba( 255, 128, 0, 255)";
- } else {
- ctx.fillStyle = "rgba( 255, 0, 0, 255)";
- };
- ctx.fillRect( 70 + z*10, 7+h, 2, ha );
- };
- };
- //ffmpeg -f v4l2 -framerate -thread_queue_size 512 -i -f alsa -thread_queue_size 512 -i -t -c:v h264 -c:a aac -pix_fmt yuv420p
- } else {
- ctx.strokeStyle = "#808080";
- ctx.strokeRect( 43, 1, 8, 8 );
- ctx.beginPath();
- ctx.moveTo( 51, 5 );
- ctx.lineTo( 56, 5 );
- ctx.lineTo( 56, 2 );
- ctx.lineTo( 103, 2 );
- ctx.lineTo( 103, 5 );
- ctx.moveTo( 63, 5 );
- ctx.lineTo( 143, 5 );
- ctx.stroke();
- ctx.fillStyle = "rgba( 128, 0, 0, 255)";
- for( z=0; z < 8; z++ ){
- ctx.fillRect( 64 + z*10, 7, 2, 19 );
- ctx.fillRect( 67 + z*10, 7, 2, 19 );
- ctx.fillRect( 70 + z*10, 7, 2, 19 );
- //https://www.ebay.com/itm/304440983138
- };
- };
- if( data.nodes[i].slave_present ){
- ctx.strokeStyle = "#FFFF00";
- ctx.fillStyle = "rgba(0, 255, 0, 255)";
- } else {
- ctx.strokeStyle = "#808080";
- ctx.fillStyle = "rgba(128, 0, 0, 255)";
- };
- ctx.fillRect( 43, 17, 8, 8 );
- ctx.strokeRect( 43, 17, 8, 8 );
-
- ctx.beginPath();
- ctx.moveTo( 51, 21 );
- ctx.lineTo( 56, 21 );
- ctx.lineTo( 56, 31 );
- ctx.lineTo( 187, 31 );
- ctx.lineTo( 187, 28 );
- ctx.moveTo( 147, 28 );
- ctx.lineTo( 227, 28 );
- ctx.stroke();
- for( z=8; z < 16; z++ ){
- //ctx.strokeStyle = "#FFFF00";
- //ctx.fillStyle = "rgba(0, 255, 0, 255)";
- ctx.fillRect( 68 + z*10, 7, 2, 19 );
- ctx.fillRect( 71 + z*10, 7, 2, 19 );
- ctx.fillRect( 74 + z*10, 7, 2, 19 );
- //ctx.strokeRect( 43, 1, 8, 8 );
- };
- };
- if( typeof nodeDashboardStatuses[i] === 'undefined' || nodeDashboardStatuses[i] != data.nodes[i].status ){
- nodeDashboardStatuses[i] = data.nodes[i].status;
- switch( data.nodes[i].status ){
- case 0:{
- if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id );
- tt.update('Offline
');
- break;
- };
- case 1:{
- if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id );
- tt.update('Online
');
- break;
- };
- case 2:{
- if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id );
- tt.update('Initializing
');
- break;
- };
- case 3:{
- if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id );
- tt.update('Trouble
');
- break;
- };
- case 4:{
- if( data.nodes[i].type == 3 ) cleanup2DDraw( data.nodes[i].id, data.nodes[i].targets );
- tt.update('Alarm
');
- break;
- };
-
- };
- };
- };
- };
- };
- if( data.notifications.length > 0 ){
- sndExcl.play();
- for( i=0; i < data.notifications.length; i++ ){
- /*const not = PNotify.alert({
- title: 'You Will Receive a Side',
- text: 'You have no choice.',
- icon: 'fas fa-info-circle',
- hide: false,
- closer: false,
- sticker: false,
- destroy: true,
- modules: new Map([
- ...PNotify.defaultModules,
- [PNotifyConfirm, {
- confirm: true,
- buttons: [{
- text: 'Ok',
- primary: true,
- click: notice => notice.close()
- }]
- }]
- ])
- });
- */
- const l = PNotify.alert({
- type: data.notifications[i].type,
- text: data.notifications[i].msg,
- textTrusted: true,
- stack: NotificationStack,
- title: data.notifications[i].action,
- hide: data.notifications[i].hide,
- closer: data.notifications[i].hide,
- sticker: data.notifications[i].hide,
- destroy: true,
- modules: (data.notifications[i].react )? new Map([
- ...PNotify.defaultModules,
- [PNotifyConfirm, {
- confirm: true,
- buttons: [{
- text: 'Ok',
- primary: true,
- click: ( notice, value, evt ) => {
- notice.close();
- if( notice.title!='' ){
- resolveDeviceMistmatch( notice.title );
- };
- }
- }]
- }]
- ]): null
- });
- /*
- if( data.notifications[i].react ){
- l.on('click', (notice, value) => {
- notice.close();
- resolveDeviceMistmatch( notice.title );
- });
- };
- */
- lastNotificationID = data.notifications[i].id;
- };
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadDashBoard(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 0 );
- Ext.Ajax.request({
- url: '/lib/controller/getDashBoardItems.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- Ext.getCmp('main_content').setTitle( '=$Labels->GetLabel('_SYS_DASHBOARD_');?>' );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll(true);
- nodeDashboardStatuses = new Array();
- for( i=0; i < data.length; i++) tPanel.add( data[i] );
- tPanel.doLayout();
- $('img[data-enlargeable]').addClass('img-enlargeable').click(function() {
- var src = $(this).attr('src');
- var modal;
-
- function removeModal() {
- modal.remove();
- $('body').off('keyup.modal-close');
- }
- modal = $('').css({
- background: 'RGBA(0,0,0,.5) url(' + src + ') no-repeat center',
- backgroundSize: 'contain',
- width: '100%',
- height: '100%',
- position: 'fixed',
- zIndex: '10000',
- top: '0',
- left: '0',
- cursor: 'zoom-out'
- }).click(function() {
- removeModal();
- }).appendTo('body');
- //handling ESC
- $('body').on('keyup.modal-close', function(e) {
- if (e.key === 'Escape') {
- removeModal();
- }
- });
- });
- tlInterval = window.setInterval( fetchSiteStatus, 333, selectedSite );
- },
- failure: failureAJAXFunction
- });
-};
-
-function showServerToolBox( ServerNodeId ){
- currentNodeID = ServerNodeId;
- if( serverToolBox == null ){
- serverToolBox = new Ext.Window({
- title: '=$Labels->GetLabel('_SERV_CTLPANEL_SHRT_');?>',
- modal: true,
- width: 400,
- height: 328,
- closeAction: 'hide',
- items:[{
- xtype: 'button',
- text: 'Restart',
- width: '100%',
- textAlign: 'left',
- iconCls: 'server_btn_restart',
- scale: 'large',
- iconAlign: 'left',
- handler: function(){
- doDeviceOperation( currentNodeID, 250,'', true );
- }
- },{
- xtype: 'button',
- text: 'Initialize Hardware',
- width: '100%',
- textAlign: 'left',
- iconCls: 'server_btn_hwinit',
- scale: 'large',
- iconAlign: 'left',
- handler: function(){
- doDeviceOperation( currentNodeID, 251,'', true );
- }
- },{
- xtype: 'button',
- text: 'Sync Time With Browser',
- width: '100%',
- textAlign: 'left',
- iconCls: 'server_btn_timeinit',
- scale: 'large',
- iconAlign: 'left',
- handler: function(){
- doDeviceOperation( currentNodeID, 252, ((new Date())/1000), true );
- }
- }]
- });
- };
- serverToolBox.show();
-};
-
-var detectionProfileWindow = null;
-var deviceCtrlNode = '';
-function showSensorToolBox( NodeID ){
- currentNodeID = NodeID;
- deviceCtrlNode = NodeID + ':0';
- if( detectionProfileWindow == null ){
- detectionProfileWindow = new Ext.Window({
- title: '=$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>',
- modal: true,
- width: 340,
- height: 328,
- autoScroll: 'auto',
- closeAction: 'hide',
- resizable: false,
- items:[{
- xtype: 'panel',
- title: '=$Labels->GetLabel('_SPEC_FUNCTI_');?>',
- height: 95,
- id: 'sf_panel',
- frame: true,
- flex: 1,
- layout: 'vbox',
- hidden: true,
- items:[{
- xtype: 'button',
- text: 'Resolve Trouble',
- width: '100%',
- iconCls: 'ctrl_panel_cog',
- scale: 'large',
- iconAlign: 'left',
- handler: function(){
- detectionProfileWindow.hide();
- resolveDeviceMistmatch( deviceCtrlNode );
- }
- }]
- },{
- xtype: 'panel',
- title: '=$Labels->GetLabel('_DET_GENWORKS_');?>',
- height: 193,
- frame: true,
- flex: 1,
- layout: 'vbox',
- items:[{
- xtype: 'button',
- width: '100%',
- text: 'Clear Alarm',
- scale: 'large',
- iconCls: 'ctrl_panel_clean',
- iconAlign: 'left',
- handler: function(){
- clearDeviceEvents( deviceCtrlNode );
- }
- },{
- xtype: 'button',
- width: '100%',
- text: 'Draw Background',
- scale: 'large',
- iconCls: 'ctrl_panel_drawscan',
- iconAlign: 'left',
- handler: function(){
- doDeviceOperation( deviceCtrlNode, 3 );
- }
- },{
- xtype: 'button',
- width: '100%',
- text: 'Force Study Background',
- scale: 'large',
- iconCls: 'ctrl_panel_study',
- iconAlign: 'left',
- handler: function(){
- doDeviceOperation( deviceCtrlNode, 2 );
- }
- },{
- xtype: 'button',
- width: '100%',
- buttonAlign: 'left',
- //text: '
',
- text: 'Force Reset Sensor',
- scale: 'large',
- iconCls: 'ctrl_panel_reset',
- iconAlign: 'left',
- handler: function(){
- doDeviceOperation( deviceCtrlNode, 1 );
- }
- }]
- },{
- xtype: 'panel',
- title: 'Zone Masking Management',
- height: 140,
- frame: true,
- flex: 1,
- layout: 'vbox',
- items:[{
- xtype: 'button',
- text: 'Mask Editor',
- id: 'DMED',
- width: '100%',
- handler: function(){
- showMaskEditor( true, 0, deviceCtrlNode );
- }
- },{
- xtype: 'spacer',
- height: 6
- },{
- xtype: 'panel',
- frame: false,
- border: false,
- flex: 1,
- width: '100%',
- height: 40,
- layout: 'hbox',
- items:[{
- xtype: 'button',
- enableToggle: true,
- width: '20%',
- scale: 'large',
- id: 'mz_btn_0',
- iconCls: 'mask_zone1_btn',
- iconAlign: 'top',
- pressed: false,
- disabled: true,
- handler: function(){
- Ext.getCmp('MAPPLY').enable();
- }
- },{
- xtype: 'button',
- enableToggle: true,
- width: '20%',
- scale: 'large',
- id: 'mz_btn_1',
- iconCls: 'mask_zone2_btn',
- iconAlign: 'top',
- pressed: false,
- disabled: true,
- handler: function(){
- Ext.getCmp('MAPPLY').enable();
- }
- },{
- xtype: 'button',
- enableToggle: true,
- width: '20%',
- scale: 'large',
- id: 'mz_btn_2',
- iconCls: 'mask_zone3_btn',
- iconAlign: 'top',
- pressed: false,
- disabled: true,
- handler: function(){
- Ext.getCmp('MAPPLY').enable();
- }
- },{
- xtype: 'button',
- enableToggle: true,
- width: '20%',
- scale: 'large',
- id: 'mz_btn_3',
- iconCls: 'mask_zone4_btn',
- iconAlign: 'top',
- pressed: false,
- disabled: true,
- handler: function(){
- Ext.getCmp('MAPPLY').enable();
- }
- },{
- xtype: 'button',
- enableToggle: true,
- width: '20%',
- scale: 'large',
- id: 'mz_btn_4',
- iconCls: 'mask_zone5_btn',
- iconAlign: 'top',
- pressed: false,
- disabled: true,
- handler: function(){
- Ext.getCmp('MAPPLY').enable();
- }
- }]
- },{
- xtype: 'spacer',
- height: 6
- },{
- xtype: 'button',
- text: 'Apply Zone Masks',
- id: 'MAPPLY',
- disabled: true,
- width: '100%',
- handler: function(){
-
- }
- }]
- },{
- xtype: 'panel',
- title: '=$Labels->GetLabel('_DET_SENSITIVITY_');?>',
- height: 95,
- frame: true,
- flex: 1,
- layout: 'hbox',
- items:[Data['access']>4 ){
- ?>{
- 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'
- }]
- }]
- });
- };
- detectionProfileWindow.show();
- var myMask = new Ext.LoadMask( detectionProfileWindow.getEl(), {msg:"Please wait..."});
- myMask.show();
-
- Ext.Ajax.request({
- url: '/lib/controller/getDetectionProfile.php',
- params: {
- SITE: SelectedSite,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NID: NodeID
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- myMask.hide();
- detectionProfileWindow.setTitle( '['+data.name + '] =$Labels->GetLabel('_DEV_CTLPANEL_SHRT_');?>');
- if(data.masks_array != 'undefined' ){
- for( i = 0; i < 5; i++ ){
- var cE = Ext.getCmp('mz_btn_'+i );
- if( data.masks_array[i]=='E'){
- cE.enable();
- cE.toggle( true, true );
- } else {
- cE.toggle( false, true );
- if( data.masks_array[i]=='D' ){
- cE.enable();
- } else {
- cE.disable();
- };
- };
- };
- };
- if( data.data_status == 3 ){
- if( data.profiles.length > 1 ){
- for( i=0; i < data.profiles.length; i++ ){
- Ext.getCmp('DDSPBTN'+i ).enable();
- if( i == data.profile_id ) Ext.getCmp('DDSPBTN'+i ).toggle( true, false );
- };
- } else {
- Ext.getCmp('DDSPBTN0').toggle( true, false );
- Ext.getCmp('DDSPBTN0').disable();
- };
- } else if( data.data_status == 4 ){
- Ext.getCmp('sf_panel').show();
- };
- detectionProfileWindow.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
diff --git a/lib/javascript/jsapi_dynamic/rgoose_devices.js b/lib/javascript/jsapi_dynamic/rgoose_devices.js
deleted file mode 100644
index c01ca0a..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_devices.js
+++ /dev/null
@@ -1,2515 +0,0 @@
-//
-
-
-
-var devices = new Array();
-var cameras = new Array();
-
-var systemDevicesAreLoadded = false;
-
-function loadSystemDevices(){
- Ext.Ajax.request({
- url: '/lib/controller/getSystemDevices.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- devices = data.sensors;
- cameras = data.cameras;
- systemDevicesAreLoadded = true;
- },
- failure: failureAJAXFunction
- });
-};
-
-function getSensorByNodeId( NID ){
- if( systemDevicesAreLoadded ) for( i=0; i< devices.length; i++ ) if( devices[i].node_id == NID ) return devices[i];
- return null;
-};
-
-function getSensorById( SID ){
- if( systemDevicesAreLoadded ) for( i=0; i< devices.length; i++) if( devices[i].id == SID ) return devices[i];
- return null;
-};
-
-function getCameraByNodeId( NID ){
- if( systemDevicesAreLoadded ) for( i=0; i< cameras.length; i++) if( cameras[i].node_id == NID ) return cameras[i];
- return null;
-};
-
-function getCameraById( SID ){
- if( systemDevicesAreLoadded ) for( i=0; i< cameras.length; i++) if( cameras[i].id == SID ) return cameras[i];
- return null;
-};
-
-
-var UartListStore = new Ext.data.JsonStore({
- root: 'ports',
- totalProperty: 'totalCount',
- idProperty: 'uart_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- SITE: =$SiteID;?>
- },
- fields: [{
- name: 'uart_id',
- type: 'int'
- },{
- name: 'uart_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listUarts.php'
- })
-});
-
-var ServersListStore = new Ext.data.JsonStore({
- root: 'servers',
- totalProperty: 'totalCount',
- idProperty: 'server_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- SITE: =$SiteID;?>
- },
- fields: [{
- name: 'server_id',
- type: 'int'
- },{
- name: 'server_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listServers.php'
- })
-});
-
-var ServerListStore = new Ext.data.JsonStore({
- root: 'servers',
- totalProperty: 'totalCount',
- idProperty: 'server_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- SITE: =$SiteID;?>
- },
- fields: [{
- name: 'server_id',
- type: 'int'
- },{
- name: 'server_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listServers.php'
- })
-});
-
-function loadSettingsLidar3D( NodeID, Master ){
- SelectedNodeID = NodeID;
- Ext.Ajax.request({
- url: '/lib/controller/getSettingsLidsr3D.php',
- params: {
- NID: NodeID,
- MST: ((Master)?1:0),
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- 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 );
- },
- failure: failureAJAXFunction
- });
-};
-
-function saveSettingsLidar3D( ){
- if( SelectedNodeID == 0 ) return;
- t1 = Ext.getCmp('setting_master_ip').getValue();
- t2 = Ext.getCmp('setting_master_port').getValue();
- t3 = Ext.getCmp('setting_slave_ip').getValue();
- t4 = Ext.getCmp('setting_slave_port').getValue();
- t5 = Ext.getCmp('setting_lat').getValue();
- t6 = Ext.getCmp('setting_lon').getValue();
- t7 = Ext.getCmp('setting_alt').getValue();
- t8 = Ext.getCmp('setting_roll').getValue();
- t9 = Ext.getCmp('setting_pitch').getValue();
- t10 = Ext.getCmp('setting_yaw').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/setSettingsLidsr3D.php',
- params: {
- NID: SelectedNodeID,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MIP: t1,
- MPP: t2,
- SIP: t3,
- SPP: t4,
- LAT: t5,
- LON: t6,
- ALT: t7,
- ROL: t8,
- PCH: t9,
- YAW: t10
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- if( data.success == true ) {
- Ext.Msg.show({
- title:"=$Labels->GetLabel('_INFO_MSG_');?>",
- msg: "=$Labels->GetLabel('_SETTING_SAVE_OK_');?>",
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- fn: function(){
- SettingsLidar3D.hide();
- },
- //animEl: 'elId',
- icon: Ext.MessageBox.INFO //QUESTION
- });
- } else {
- Ext.Msg.show({
- title: "=$Labels->GetLabel('_ERROR_MSG_');?>",
- msg: data['error'],
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- fn: function(){
- SettingsLidar3D.hide();
- },
- //animEl: 'elId',
- icon: Ext.MessageBox.ERROR //QUESTION
- });
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-
-function editSettingsLidar3D( NodeID, Master ){
- if( SettingsLidar3D == null ){
- SettingsLidar3D = new Ext.Window({
- modal: true,
- title: "=$Labels->GetLabel('_EDIT_LRF3D_SETTINGS_');?>",
- width: 773,
- height: 600,
- layout: 'fit',
- closeAction: 'hide',
- listeners:{
- beforehide : function(){
- Ext.getCmp('connectstarterbutton').toggle( false, false );
- }
- },
- items:[{
- layout: 'table',
- border: false,
- defaults: {
- // applied to each contained panel
- bodyStyle:'padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:10px;'
- },
- layoutConfig: {
- // The total column count must be specified here
- columns: 4
- },
- items: [{
- border: false,
- html: 'Master IP Address:'
- },{
- xtype: 'textfield',
- id: 'setting_master_ip',
- width: '70%'
- },{
- border: false,
- html: 'Port:'
- },{
- xtype: 'textfield',
- id: 'setting_master_port',
- width: '30%'
- },{
- border: false,
- html: 'Slave IP Address:'
- },{
- xtype: 'textfield',
- id: 'setting_slave_ip',
- width: '70%'
- },{
- border: false,
- html: 'Port:'
- },{
- xtype: 'textfield',
- id: 'setting_slave_port',
- width: '30%'
- },{
- border: false,
- html: 'Position Lat/Lon/Alt:'
- },{
- xtype: 'textfield',
- id: 'setting_lat',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_lon',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_alt',
- width: '30%'
- },{
- border: false,
- html: 'Orientation Roll/Pitch/Yaw:'
- },{
- xtype: 'textfield',
- id: 'setting_roll',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_pitch',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_yaw',
- width: '30%'
- }]
- }],
- bbar: [{
- text: '=$Labels->GetLabel("_CANCEL_");?>',
- handler: function(){
- SettingsLidar3D.hide();
- }
- },{
- text: '=$Labels->GetLabel("_SAVE_");?>',
- handler: SaveSettingsLidar3D
- }]
- });
- };
- SettingsLidar3D.show();
- loadSettingsLidar3D( NodeID, Master );
-};
-
-var devicesStore = new Ext.data.JsonStore({
- root: 'nodes',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'name',
- type: 'string'
- },{
- name: 'hardware',
- type: 'string'
- },{
- name: 'caps',
- type: 'int'
- },{
- name: 'ip',
- type: 'string'
- },{
- name: 'mac',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listDiscoveredCameraSources.php',
- headers: {
- 'UID': '=$CUser->Data['id'];?>',
- 'SID': '=$Session;?>'
- }
- })
-});
-
-var LRF1D2_st_win = null;
-var LRF2D2_st_win = null;
-var LRF16D3_st_win = null;
-
-var currentDeviceOperatioId = 0;
-var currentOperationTO = 0;
-var currentOperationTimer = null;
-var lastOperationCode = 0;
-function checkDeviceOperationStatus(){
- if( currentOperationTO ){
- currentOperationTO--;
- Ext.Ajax.request({
- url: '/lib/controller/checkDeviceOperation.php',
- params: {
- OID: currentDeviceOperatioId,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( !data.success ){
- Ext.MessageBox.hide();
- Ext.Msg.show({
- title:'Node Command Status',
- msg: data.msg,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- } else {
- if( lastOperationCode != data.code || data.code == 0 ){
- lastOperationCode = data.code;
- currentOperationTO = 20;
- };
- if( data.code < 100 ){
- currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 );
- } else {
- Ext.MessageBox.hide();
- switch( data.code ){
- case 120:
- case 100:
- default:
- Ext.Msg.show({
- title:'Node Command Status',
- msg: 'Operation Complete',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- };
- };
- };
- },
- failure: failureAJAXFunction
- });
- } else {
- Ext.MessageBox.hide();
- Ext.Msg.show({
- title:'Node Command Status',
- msg: 'Operation Status - Time Out!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- };
-};
-
-function doDeviceOperation( NodeID, OpCode, Param='', nowait=false ){
- if( !nowait ){
- Ext.MessageBox.wait("=$Labels->GetLabel('_Loading_Calo_');?>","=$Labels->GetLabel('_Please_Wait_');?>",{
- width: '100%',
- hidden: true,
- progress: true,
- closable: false
- });
- };
-
- Ext.Ajax.request({
- url: '/lib/controller/doNodeOperation.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- CMD: OpCode,
- SID: '=$Session;?>',
- PARAM: Param
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( !data.success ){
- if( !nowait ) Ext.MessageBox.hide();
- Ext.Msg.show({
- title:'Node Command Status',
- msg: data.msg,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- } else {
- if( !nowait ){
- currentDeviceOperatioId = data.operation_id;
- currentOperationTO = 20;
- lastOperationCode = 0;
- currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 );
- };
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function clearDeviceEvents( NodeID ){
- Ext.Ajax.request({
- url: '/lib/controller/clearEventCloud.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadFullLRF1D2Data( NodeID ){
-
- if( LRF1D2_st_win == null ) return;
-
- Ext.Ajax.request({
- url: '/lib/controller/getSettingsLRF.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- if( LRF1D2_st_win!= null ){
- var data = Ext.decode(response.responseText);
- if( data.online ){
- switch( data.data_status ){
- case 0: Ext.getCmp('dev_online').update('
ONLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('dev_online').update('
ONLINE/Synced
'); break;
- case 2: Ext.getCmp('dev_online').update('
ONLINE/Data Not Applyed
'); break;
- };
- } else {
- switch( data.data_status ){
- case 0: Ext.getCmp('dev_online').update('
OFFLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('dev_online').update('
OFFLINE/Synced
'); break;
- case 2: Ext.getCmp('dev_online').update('
OFFLINE/Data Not Applyed
'); break;
- };
- };
- Ext.getCmp('dev_name').setValue( data.name );
- Ext.getCmp('serial_num').setValue( data.serial );
- Ext.getCmp('version_id').setValue( data.version );
- Ext.getCmp('device_id').setValue( data.device_id );
- Ext.getCmp('com_spd').setValue( data.com_spd );
- Ext.getCmp('max_range').setValue( data.max_range );
- Ext.getCmp('base_shift').setValue( data.base_shift );
- Ext.getCmp('com_spd').setValue( data.uart_speed );
- Ext.getCmp('mlrf_offset').setValue( data.m_offset );
- Ext.getCmp('slrf_offset').setValue( data.s_offset );
- Ext.getCmp('mlrf_delta').setValue( data.m_delta );
- Ext.getCmp('slrf_delta').setValue( data.s_delta );
- Ext.getCmp('mlrf_width').setValue( data.m_width );
- Ext.getCmp('slrf_width').setValue( data.s_width );
- Ext.getCmp('mlrf_order').setValue( data.m_order );
- Ext.getCmp('slrf_order').setValue( data.s_order );
- Ext.getCmp('mlrf_sst').setValue( data.m_sst );
- Ext.getCmp('slrf_sst').setValue( data.s_sst );
- Ext.getCmp('mlrf_flip').setValue( data.m_flip );
- Ext.getCmp('slrf_flip').setValue( data.s_flip );
- Ext.getCmp('mlrf_sun').setValue( data.m_sun );
- Ext.getCmp('slrf_sun').setValue( data.s_sun );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadFullLRF2D2Data( NodeID ){
-
- if( LRF2D2_st_win == null ) return;
-
- Ext.Ajax.request({
- url: '/lib/controller/getSettingsLRF.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- if( LRF2D2_st_win!= null ){
- var data = Ext.decode(response.responseText);
- if( data.online ){
- switch( data.data_status ){
- case 0: Ext.getCmp('LRF2D2_dev_status').update('
ONLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('LRF2D2_dev_status').update('
ONLINE/Synced
'); break;
- case 2: Ext.getCmp('LRF2D2_dev_status').update('
ONLINE/Data Not Applyed
'); break;
- };
- } else {
- switch( data.data_status ){
- case 0: Ext.getCmp('LRF2D2_dev_status').update('
OFFLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('LRF2D2_dev_status').update('
OFFLINE/Synced
'); break;
- case 2: Ext.getCmp('LRF2D2_dev_status').update('
OFFLINE/Data Not Applyed
'); break;
- };
- };
- Ext.getCmp('LRF2D2_name').setValue( data.name );
- Ext.getCmp('LRF2D2_serial_num').setValue( data.serial );
- Ext.getCmp('LRF2D2_version_id').setValue( data.version );
- Ext.getCmp('LRF2D2_device_id').setValue( data.device_id );
- Ext.getCmp('LRF2D2_com_spd').setValue( data.com_spd );
- Ext.getCmp('LRF2D2_max_range').setValue( data.max_range );
- Ext.getCmp('LRF2D2_base_shift').setValue( data.base_shift );
- Ext.getCmp('LRF2D2_com_spd').setValue( data.uart_speed );
- Ext.getCmp('mlrf_offset').setValue( data.master_profile.offset );
- Ext.getCmp('slrf_offset').setValue( data.slave_profile.offset );
- Ext.getCmp('mlrf_delta').setValue( data.master_profile.delta );
- Ext.getCmp('slrf_delta').setValue( data.slave_profile.delta );
- Ext.getCmp('mlrf_width').setValue( data.master_profile.width );
- Ext.getCmp('slrf_width').setValue( data.slave_profile.width );
- Ext.getCmp('mlrf_order').setValue( data.master_profile.order );
- Ext.getCmp('slrf_order').setValue( data.slave_profile.order );
- Ext.getCmp('mlrf_sst').setValue( data.master_profile.sst );
- Ext.getCmp('slrf_sst').setValue( data.slave_profile.sst );
- Ext.getCmp('mlrf_flip').setValue( data.master_profile.flip );
- Ext.getCmp('slrf_flip').setValue( data.slave_profile.flip );
- Ext.getCmp('mlrf_sun').setValue( data.master_profile.sun );
- Ext.getCmp('slrf_sun').setValue( data.slave_profile.sun );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function LRF1D2_settings(){
- if( LRF1D2_st_win == null ){
- LRF1D2_st_win = new Ext.Window({
- title: 'Sensor Settings',
- modal: true,
- width: 800,
- height: 600,
- closeAction: 'hide',
- items:{
- xtype: 'tabpanel',
- activeTab: 0,
- items:[{
- title: 'General Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 3
- },
- items:[{
- html: 'Status',
- frame: false,
- border: false
- },{
- html: '
ONLINE
',
- id: 'dev_online',
- frame: false,
- border: false
- },{},{
- html: 'Device Title',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'dev_name',
- readOnly: false,
- value: 'KOKO'
- },{},{
- html: 'Serial Number',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'serial_num',
- readOnly: true,
- value: '1212'
- },{},{
- html: 'Version ID',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'version_id',
- readOnly: true,
- value: 'LiberManDA122'
- },{},{
- html: 'Device Adress',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'device_id'
- },{
- xtype: 'button',
- id: 'upddiBTN',
- text: 'Update Device Address',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Address?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Device COM Speed',
- frame: false,
- border: false
- },{
- xtype: 'combo',
- id: 'com_spd',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: '100%',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['mySPD', 'displayText' ],
- data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
- }),
- valueField: 'mySPD',
- displayField: 'displayText'
- },{
- xtype: 'button',
- id: 'updspBTN',
- text: 'Set Device Speed',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Speed?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Detection Maximal Range',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'max_range',
- readOnly: true,
- value: '1212'
- },{},{
- html: 'Base Shift',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'base_shift',
- readOnly: true,
- value: '1212'
- },{}]
- },{
- title: 'Mantenence',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 2
- },
- items:[{
- html: 'Restart Device',
- frame: false,
- border: false
- },{
- xtype: 'button',
- id: 'rstBTN',
- text: 'Full Reset',
- handler: function(){
- Ext.Msg.show({
- title:'Reset Device?',
- msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'rstBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- }]
- },{
- title: 'Detection Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 4
- },
- items:[{
- html: 'Master Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_offset',
- name: 'mlrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Slave Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_offset',
- name: 'slrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Master Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_delta',
- name: 'mlrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_delta',
- name: 'slrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_width',
- name: 'mlrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Slave Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_width',
- name: 'slrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Master Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_order',
- name: 'mlrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_order',
- name: 'slrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sst',
- name: 'mlrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sst',
- name: 'slrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Mastr Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_flip',
- name: 'mlrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Slave Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_flip',
- name: 'slrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Master Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sun',
- name: 'mlrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sun',
- name: 'slrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- }]
- },{
- title: 'Embed Options'
- },{
- title: 'Target Width Table'
- }]
- }
- });
- };
- LRF1D2_st_win.show();
- loadFullLRF1D2Data( SelectedNodeID );
-};
-
-function LRF2D2_settings(){
- if( LRF2D2_st_win == null ){
- LRF2D2_st_win = new Ext.Window({
- title: 'Sensor Settings',
- modal: true,
- width: 800,
- height: 600,
- closeAction: 'hide',
- items:{
- xtype: 'tabpanel',
- activeTab: 0,
- items:[{
- title: 'General Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 3
- },
- items:[{
- html: 'Status',
- frame: false,
- border: false
- },{
- html: '
ONLINE
',
- id: 'LRF2D2_dev_status',
- frame: false,
- border: false
- },{},{
- html: 'Device Title',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'LRF2D2_name',
- readOnly: false,
- value: ''
- },{},{
- html: 'Serial Number',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'LRF2D2_serial_num',
- readOnly: true,
- value: '1212'
- },{},{
- html: 'Version ID',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'LRF2D2_version_id',
- readOnly: true,
- value: 'LiberManDA122'
- },{},{
- html: 'Device Adress',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'LRF2D2_device_id'
- },{
- xtype: 'button',
- text: 'Update Device Address',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Address?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Device COM Speed',
- frame: false,
- border: false
- },{
- xtype: 'combo',
- id: 'LRF2D2_com_spd',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: '100%',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['mySPD', 'displayText' ],
- data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
- }),
- valueField: 'mySPD',
- displayField: 'displayText'
- },{
- xtype: 'button',
- text: 'Set Device Speed',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Speed?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Detection Maximal Range',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'LRF2D2_max_range',
- readOnly: false,
- value: '1212'
- },{},{
- html: 'Base Shift',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'LRF2D2_base_shift',
- readOnly: false,
- value: '1212'
- },{
- xtype: 'button',
- text: 'Update Base Shift',
- handler: function(){
- var bash = Ext.getCmp('LRF2D2_base_shift').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLrfSettings_baseshift.php',
- params: {
- NID: SelectedNodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- PID: 0,
- BASH: bash
- },
- success: function( response, opts ){
- loadFullLRF2D2Data( SelectedNodeID );
- },
- failure: failureAJAXFunction
- });
- }
- }]
- },{
- title: 'Detection Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 4
- },
- items:[{
- html: 'Master Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_offset',
- name: 'mlrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Slave Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_offset',
- name: 'slrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Master Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_delta',
- name: 'mlrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_delta',
- name: 'slrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_width',
- name: 'mlrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Slave Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_width',
- name: 'slrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Master Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_order',
- name: 'mlrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_order',
- name: 'slrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sst',
- name: 'mlrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sst',
- name: 'slrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Mastr Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_flip',
- name: 'mlrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Slave Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_flip',
- name: 'slrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Master Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sun',
- name: 'mlrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sun',
- name: 'slrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- xtype: 'button',
- text: 'Update Detection Settings',
- width: '100%',
- colspan: 4,
- handler: function(){
- var MOFS=Ext.getCmp('mlrf_offset').getValue();
- var MDEL=Ext.getCmp('mlrf_delta').getValue();
- var MWIT=Ext.getCmp('mlrf_width').getValue();
- var MORD=Ext.getCmp('mlrf_order').getValue();
- var MSST=Ext.getCmp('mlrf_sst').getValue();
- var MFLP=Ext.getCmp('mlrf_flip').getValue();
- var MSUN=Ext.getCmp('mlrf_sun').getValue();
- var SOFS=Ext.getCmp('slrf_offset').getValue();
- var SDEL=Ext.getCmp('slrf_delta').getValue();
- var SWIT=Ext.getCmp('slrf_width').getValue();
- var SORD=Ext.getCmp('slrf_order').getValue();
- var SSST=Ext.getCmp('slrf_sst').getValue();
- var SFLP=Ext.getCmp('slrf_flip').getValue();
- var SSUN=Ext.getCmp('slrf_sun').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateDetecttionProfile.php',
- params: {
- NID: SelectedNodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- PID: 0,
- MOFS: MOFS,
- MDEL: MDEL,
- MWIT: MWIT,
- MORD: MORD,
- MSST: MSST,
- MFLP: MFLP,
- MSUN: MSUN,
- SOFS: SOFS,
- SDEL: SDEL,
- SWIT: SWIT,
- SORD: SORD,
- SSST: SSST,
- SFLP: SFLP,
- SSUN: SSUN
- },
- success: function( response, opts ){
- loadFullLRF2D2Data( SelectedNodeID );
- },
- failure: failureAJAXFunction
- });
- }
- }]
- },{
- title: 'Embed Options'
- },{
- title: 'Target Width Table'
- },{
- title: 'Mantenence',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 2
- },
- items:[{
- html: 'Restart Device',
- frame: false,
- border: false
- },{
- xtype: 'button',
- id: 'rstBTN',
- text: 'Full Reset',
- handler: function(){
- Ext.Msg.show({
- title:'Reset Device?',
- msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'rstBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- }]
- }]
- }
- });
- };
- LRF2D2_st_win.show();
- loadFullLRF2D2Data( SelectedNodeID );
-};
-
-function LRF16D3_settings(){
-};
-
-var currentResolveDeviceNode = 0;
-var ResolveDeviceNodeWin = null;
-
-function resolveDeviceMistmatch( NodeID ){
- currentResolveDeviceNode = NodeID;
- if( ResolveDeviceNodeWin == null ){
- ResolveDeviceNodeWin = new Ext.Window({
- title: "=$Labels->GetLabel('_WDEV_MISTMATCH_');?>",
- modal: true,
- width: 500,
- height: 200,
- closeAction: 'hide',
- items:[{
- xtype: 'spacer',
- style: {
- marginTop: '13px'
- },
- html: "
=$Labels->GetLabel('_DEV_MISTMATT1_');?> ",
- height: 30
- },{
- xtype: 'button',
- width: '100%',
- text: 'It is Newly Connected Device',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/validateNode.php',
- params: {
- NID: currentResolveDeviceNode,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MET: 1
- },
- success: function( response, opts ){
- ResolveDeviceNodeWin.hide();
- },
- failure: failureAJAXFunction
- });
- }
- },{
- xtype: 'button',
- width: '100%',
- text: "Apply Existing Detection Profiles to Newly Connected Device",
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/validateNode.php',
- params: {
- NID: currentResolveDeviceNode,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MET: 1
- },
- success: function( response, opts ){
- ResolveDeviceNodeWin.hide();
- },
- failure: failureAJAXFunction
- });
- }
- },{
- xtype: 'button',
- width: '100%',
- text: "Discard old Detection Profiles and Start Device Setup Wizard",
- handler: function(){
- ResolveDeviceNodeWin.hide();
- startDeviceDetectionWizard( currentResolveDeviceNode );
- }
- },{
- xtype: 'button',
- width: '100%',
- text: "Discard old Detection Profiles and Load Factory Settings from Device"
- },{
- xtype: 'button',
- width: '100%',
- text: "Discard this Connection for NOW"
- }]
- });
- };
- ResolveDeviceNodeWin.show();
-};
-
-var DeviceDetectionWizardWnd = null;
-var DDWizardActiveDevice = '';
-var RangeSetBlocker = false;
-function startDeviceDetectionWizard( NodeID ){
- DDWizardActiveDevice = NodeID
- if( DeviceDetectionWizardWnd == null ){
- DeviceDetectionWizardWnd = new Ext.Window({
- title: '=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
- modal: true,
- width: 500,
- height: 208,
- closeAction: 'hide',
- items:[{
- xtype: 'tabpanel',
- activeTab: 1,
- items: [{
- title: "=$Labels->GetLabel('_WDEV_DET_WIZ0_');?>",
- frame: false,
- xtype: 'form',
- items:[{
- xtype: 'spacer',
- height: 20
- },{
- xtype: 'combo',
- id: 'DDWizST',
- fieldLabel: "=$Labels->GetLabel('_DEV_TYPE_FLD_');?>",
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: [
- 'dtId',
- 'dtText'
- ],
- data: [
- [1, "=$Labels->GetLabel('_DEV_TYPE_ALS_');?>"],
- [2, "=$Labels->GetLabel('_DEV_TYPE_LFS_');?>"],
- [3, "=$Labels->GetLabel('_DEV_TYPE_PLS200_');?>"],
- [4, "=$Labels->GetLabel('_DEV_TYPE_PLS360_');?>"],
- [5, "=$Labels->GetLabel('_DEV_TYPE_3D_');?>"],
- [6, "=$Labels->GetLabel('_DEV_TYPE_NPLS200_');?>"]
- ]
- }),
- valueField: 'dtId',
- displayField: 'dtText'
- },{
- xtype: 'numberfield',
- id: 'DDWizSR',
- fieldLabel: "=$Labels->GetLabel('_DEV_RANGE_FLD_');?>",
- minValue: 15.0,
- maxValue: 300.0,
- listeners:{
- change: function( m, nv, ov ){
- if( RangeSetBlocker ) return;
- RangeSetBlocker = true;
- Ext.getCmp('DDWizSRS').setValue( nv );
- RangeSetBlocker = false;
- }
- }
- },{
- xtype: 'slider',
- id: 'DDWizSRS',
- fieldLabel: "=$Labels->GetLabel('_DEV_RANGE_FLD_');?>",
- minValue: 15.0,
- maxValue: 300.0,
- listeners:{
- change: function( m, nv, ov ){
- if( RangeSetBlocker ) return;
- RangeSetBlocker = true;
- Ext.getCmp('DDWizSR').setValue( nv );
- RangeSetBlocker = false;
- }
- }
- },{
- xtype: 'spacer',
- height: 10
- }]
- },{
- title: "=$Labels->GetLabel('_WDEV_DET_WIZ1_');?>",
- frame: false,
- xtype: 'form',
- labelWidth: 120,
- items:[{
- xtype: 'spacer',
- height: 20
- },{
- xtype: 'combo',
- id: 'DDWizIT',
- fieldLabel: "=$Labels->GetLabel('_DEV_ITYPE_FLD_');?>",
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- mode: 'local',
- value: 1,
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: [
- 'dpId',
- 'dpText'
- ],
- data: [
- [1, "=$Labels->GetLabel('_DEV_PL_HORI_');?>"],
- [2, "=$Labels->GetLabel('_DEV_PL_VERT_');?>"],
- [3, "=$Labels->GetLabel('_DEV_PL_ANG_');?>"]
- ]
- }),
- valueField: 'dpId',
- displayField: 'dpText'
- }]
- },{
- title: "=$Labels->GetLabel('_WDEV_DET_WIZ2_');?>",
- html: 'Another one'
- },{
- title: "=$Labels->GetLabel('_WDEV_DET_WIZ3_');?>",
- html: 'Another one'
- }]
- }],
- bbar:[{
- text: "Create Profiles And Finish",
- handler: function(){
- DeviceDetectionWizardWnd.hide();
- }
- },{
- text: "Advanced Config",
- handler: function(){
- DeviceDetectionWizardWnd.hide();
- startAdvancedDeviceDetection( DDWizardActiveDevice );
- }
- }]
- });
- };
- Ext.Ajax.request({
- url: '/lib/controller/getNodeBasicNfo.php',
- params: {
- NID: DDWizardActiveDevice,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- DeviceDetectionWizardWnd.setTitle( "=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [" + data.name+"]" );
- Ext.getCmp('DDWizST').setValue( data.type );
- RangeSetBlocker = true;
- Ext.getCmp('DDWizSR').setValue( data.range );
- Ext.getCmp('DDWizSRS').setValue( data.range );
- RangeSetBlocker = false;
- DeviceDetectionWizardWnd.show();
- },
- failure: failureAJAXFunction
- });
-};
-
-var DeviceDetectionAdvancedWnd = null;
-var DeviceDetectionProfileNames = ['factory default', 'low sens', 'medium sens', 'high sens'];
-function loadAdvancedDeviceDetectionSettings(){
- Ext.getCmp('ADD_TP').removeAll( false );
- Ext.Ajax.request({
- url: '/lib/controller/getNodeAdvancedNfo.php',
- params: {
- NID: DDWizardActiveDevice,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- DeviceDetectionAdvancedWnd.setTitle( "=$Labels->GetLabel('_WDEV_DET_WIZT_');?> ["+data.name+"]" );
- if( data.profiles.length > 0 ){
- if( data.profiles.length > 3 ) Ext.getCmp('ADD_PADD_BTN').disable();
- switch( data.type ){
- case 1:
- case 5:{
- for( i = 0; i < data.profiles.length / 2; i++){
- };
- break;
- };
- case 2:
- case 3:
- case 4:
- case 6:{
- for( i = 0; i < data.profiles.length; i++){
- Ext.getCmp('ADD_TP').add({
- title: DeviceDetectionProfileNames[ data.profiles[i].id ],
- xtype: 'form',
- frame: false,
- items:[{xtype: 'spacer', height: 10 },{
- xtype: 'numberfield',
- id: 'OFFSET_P'+data.profiles[i].id,
- fieldLabel: 'OFFSET',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].offset
- },{
- xtype: 'numberfield',
- id: 'DELTA_P'+data.profiles[i].id,
- fieldLabel: 'DELTA',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].delta
- },{
- xtype: 'numberfield',
- id: 'WIDTH_P'+data.profiles[i].id,
- fieldLabel: 'WIDTH',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].width
- },{
- xtype: 'numberfield',
- id: 'SST_P'+data.profiles[i].id,
- fieldLabel: 'SST',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].sst
- },{
- xtype: 'numberfield',
- id: 'FLIP_P'+data.profiles[i].id,
- fieldLabel: 'FLIP',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].flip
- },{
- xtype: 'numberfield',
- id: 'SUN_P'+data.profiles[i].id,
- fieldLabel: 'SUN',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].sun
- }]
- });
- };
- break;
- };
- };
- //
- } else {
- Ext.getCmp('ADD_TP').add({
- title: 'Error!',
- html: 'No Profiles Defined'
- });
- };
- DeviceDetectionAdvancedWnd.show();
- },
- failure: failureAJAXFunction
- });
-};
-
-function startAdvancedDeviceDetection( NodeID ){
- DDWizardActiveDevice = NodeID;
- if( DeviceDetectionAdvancedWnd == null ){
- DeviceDetectionAdvancedWnd = new Ext.Window({
- title: '=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
- modal: true,
- width: 500,
- height: 300,
- closeAction: 'hide',
- items:[{
- xtype: 'tabpanel',
- id: 'ADD_TP',
- frame: false,
- border: false,
- activeTab: 0,
- items: []
- }],
- bbar:[{
- id: 'ADD_PADD_BTN',
- text: 'Add Detection Profile',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/addDetectionProfile.php',
- params: {
- NID: DDWizardActiveDevice,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- loadAdvancedDeviceDetectionSettings();
- },
- failure: failureAJAXFunction
- });
- }
- },{
- text: 'Apply And Finish'
- },{
- text: 'Use Wizard'
- }]
- });
- };
- loadAdvancedDeviceDetectionSettings();
-};
-
-var maskEditorDiv = null;
-var MEPanel = null;
-function handleFSMaskEditorClose( event ){
- if ( document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement ){
- } else {
- MEPanel.destroy();
- maskEditorDiv.remove();
- MaskEditorActive = false;
- maskEditorDiv = null;
- MEPanel = null;
- document.removeEventListener( 'fullscreenchange', handleFSMaskEditorClose );
- };
-};
-
-function hideMaskEditor(){
- MaskEditorActive = false;
- if(
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement
- ){
- if( document.exitFullscreen ){
- document.exitFullscreen();
- }else if( document.mozCancelFullScreen ){
- document.mozCancelFullScreen();
- }else if( document.webkitExitFullscreen ){
- document.webkitExitFullscreen();
- }else if( document.msExitFullscreen ){
- document.msExitFullscreen();
- };
- // Removal Done by event!
- //maskEditorDiv.remove();
- //maskEditorDiv = null;
- //document.removeEventListener( 'fullscreenchange', handleFSMaskEditorClose );
- };
-};
-var values = {
- paths: 50,
- minPoints: 5,
- maxPoints: 15,
- minRadius: 30,
- maxRadius: 90
-};
-
-var hitOptions = {
- segments: true,
- stroke: true,
- fill: true,
- tolerance: 10
-};
-
-var polycolors = new Array();
-var polyindex = 0;
-var poligones = new Array();
-
-var segment = null;
-var path = null;
-var MaskProject = null;
-var MaskEditorMode = 0;
-
-function onMouseDown(event) {
- segment = path = null;
- var hitResult = MaskProject.hitTest( event.point, hitOptions );
- if (!hitResult) return;
-
- if( event.modifiers.shift ){
- if (hitResult.type == 'segment') {
- hitResult.segment.remove();
- };
- return;
- };
- if( hitResult ){
- path = hitResult.item;
- if( hitResult.type == 'segment' ){
- segment = hitResult.segment;
- path.fullySelected = false;
- segment.selected = true;
- } else if( hitResult.type == 'stroke' ){
- var location = hitResult.location;
- segment = path.insert(location.index + 1, event.point);
- //path.smooth();
- path.fullySelected = false;
- segment.selected = true;
- } else if ( hitResult.type == 'fill' ){
- path.fullySelected = true;
- };
- }
- //movePath = ;
- //if( movePath ) MaskProject.activeLayer.addChild(hitResult.item);
-}
-var c_m_X = 0;
-var c_m_Y = 0;
-function onMouseMove( e ) {
- //e.preventDefault();
- //e.stopPropagation();
- var mx = parseInt( e.offsetX - deviceMapLeftShift );
- var my = parseInt( e.offsetY - deviceMapTopShift );
- if( ( mx != c_m_X ) || ( my!= c_m_Y ) ){
- c_m_X = mx;
- c_m_Y = my;
- var t = Ext.getCmp('me_coords_panel');
- if( t!= undefined ){
- var k = 2048 / ( cMapImageWidth );
- var j = 2048 / ( cMapImageHeight );
- var jaja = parseInt( mx * k - 1024 );
- var juju = parseInt( my * j - 1024 );
- if( juju != 0 ){
- if( juju < 0 ){
- az = ( Math.atan( jaja / juju ) * ( 180 / Math.PI )+90).toFixed(1);
- } else {
- az = ( Math.atan( jaja / juju ) * ( 180 / Math.PI )+270).toFixed(1);
- };
- } else {
- if( jaja < 0 ) {
- az = 90;
- } else {
- az = 270;
- };
- };
- range = ( ( ME_max_range / 1024 ) * Math.sqrt( Math.pow( jaja, 2 ) + Math.pow( juju, 2 ) )).toFixed(2);
- t.update('
Range:' + range + ' m. Azimuth:' + az + '° ');
- };
- };
-}
-function onPathMouseMove( event ) {
- //event.preventDefault();
- //event.stopPropagation();
- var mx = event.point.x - deviceMapLeftShift;
- var my = event.point.y - deviceMapTopShift;
- if( ( mx != c_m_X ) || ( my != c_m_Y ) ){
- c_m_X = mx;
- c_m_Y = my;
- var t = Ext.getCmp('me_coords_panel');
- if( t!= undefined ){
- t.update('
'+c_m_X+'x'+c_m_Y+' ');
- };
- };
- //MaskProject.activeLayer.selected = false;
- //if( event.item ) {
- //event.item.selected = true;
- // event.item.fullySelected = true;
- //};
-}
-
-function onMouseDrag(event) {
- var mx = event.point.x - deviceMapLeftShift;
- var my = event.point.y - deviceMapTopShift;
- if( ( mx != c_m_X ) || ( my != c_m_Y ) ){
- c_m_X = mx;
- c_m_Y = my;
- var t = Ext.getCmp('me_coords_panel');
- if( t!= undefined ){
- var k = 2048 / ( cMapImageWidth );
- var j = 2048 / ( cMapImageHeight );
- var jaja = parseInt( c_m_X * k - 1024 );
- var juju = parseInt( c_m_Y * j - 1024 );
- if( juju != 0 ){
- if( juju < 0 ){
- az = ( Math.atan( jaja / juju ) * ( 180 / Math.PI )+90).toFixed(1);
- } else {
- az = ( Math.atan( jaja / juju ) * ( 180 / Math.PI )+270).toFixed(1);
- };
- } else {
- if( jaja < 0 ) {
- az = 90;
- } else {
- az = 270;
- };
- };
- range = ( ( ME_max_range / 1024 ) * Math.sqrt( Math.pow( jaja, 2 ) + Math.pow( juju, 2 ) )).toFixed(2);
- t.update('
Range:' + range + ' m. Azimuth:' + az + '° ');
- };
- };
- if( segment ){
- //segment.point += event.delta;
- segment.point = event.point;
- //path.smooth();
- };
- //else if (path) {
- // path.position += event.delta;
- //}
-}
-var absDrawMapSizes = [[4096,4096],[2304,288]];
-var deviceMapScaling = 1.0;
-var deviceMapTopShift = 100;
-var deviceMapLeftShift = 100;
-var cMapImageWidth = 0;
-var cMapImageHeight = 0;
-var cMapCanvasWidth = 0;
-var cMapCanvasHeight = 0;
-var cMapType = 0;
-var cMaskLRF = 0;
-var cMaskID = 0;
-
-function SaveCurrentMask( NodeID, MaskID, LRFID ){
- var serial = MaskProject.exportJSON();
- Ext.Ajax.request({
- url: '/lib/controller/uploadDeviceMask.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MID: MaskID,
- LID: LRFID,
- MDTA: serial,
- MIH: cMapImageHeight,
- MIW: cMapImageWidth,
- MSHX: deviceMapLeftShift,
- MSHY: deviceMapTopShift,
- DSTD: 1
- },
- success: function( response, opts ){
- //var data = Ext.decode(response.responseText);
- //hideMaskEditor();
- },
- failure: failureAJAXFunction
- });
-}
-
-
-function doMaskOperation( NodeID, Cmd, Mid = 0, LRFID = 0 ){
- Ext.Ajax.request({
- url: '/lib/controller/doMaskOperation.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- CMD: Cmd,
- MID: Mid,
- LID: LRFID
- },
- success: function( response, opts ){
- load2DMasks( NodeID );
- },
- failure: failureAJAXFunction
- });
-}
-
-var ME_max_range = 100;
-function showMaskEditor( fromDevTool, DevType, NodeID ){
- //alert( "DevType: "+DevType + " Dev Map size: "+ absDrawMapSizes[DevType][0]+"x"+absDrawMapSizes[DevType][1] );
- cMapType = DevType;
- if( DevType == 1 ){
- deviceMapScaling = ( window.screen.height * window.devicePixelRatio - 130 - ( deviceMapTopShift * 2 )) / absDrawMapSizes[DevType][1];
- } else {
- deviceMapScaling = ( window.screen.width * window.devicePixelRatio - 30 - ( deviceMapLeftShift * 2 )) / absDrawMapSizes[DevType][0];
- };
- cMapImageHeight = deviceMapScaling * absDrawMapSizes[DevType][1];
- cMapImageWidth = deviceMapScaling * absDrawMapSizes[DevType][0];
- cMapCanvasWidth = cMapImageWidth + (deviceMapLeftShift * 2);
- cMapCanvasHeight = cMapImageHeight + (deviceMapTopShift * 2);
- if( fromDevTool ){
- detectionProfileWindow.hide();
- };
- if(
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement
- ){
- //fs mode allready
- hideMaskEditor();
- }else{
- if( maskEditorDiv == null ){
- maskEditorDiv = document.createElement("div");
- maskEditorDiv.style.height="200px";
- maskEditorDiv.style.width="200px";
- maskEditorDiv.style.position="relative";
- //var svg = document.getElementById('draw_svg_'+parseInt( NodeID ) );
- //var svgCode = window.btoa(svg.outerHTML);
- //maskEditorDiv.style.background = "url(data:image/svg+xml;base64," + svgCode + ")";
- //maskEditorDiv.style.background = 'solid red;';
- //maskEditorDiv.style.backgroundImage = "url('style/wicons/011.png')";
- //append div as a child to body
- document.body.appendChild( maskEditorDiv );
- //var elem = document.createElement("img"); 'getDeviceMap.php?NID='+NodeID
- //elem.setAttribute("src", "/lib/controller/data/device_draws/75c85fec4be204fc0bc0452f53b5a3df_map.png");
- //elem.setAttribute("height", "80%");
- //elem.setAttribute("width", "130");
- //maskEditorDiv.appendChild( elem );
- //alert( window.screen.width * window.devicePixelRatio + "x" + window.screen.height * window.devicePixelRatio);
- if( MEPanel == null ){
- var ww = window.screen.width * window.devicePixelRatio;
- var hh = window.screen.height * window.devicePixelRatio;
- MEPanel = new Ext.Panel( {
- title: 'Mask Editor',
- renderTo: maskEditorDiv,
- width: ww,
- height: hh,
- frame: true,
- autoScroll: true,
- items:[{
- xtype: 'panel',
- width: cMapCanvasWidth,
- //html: '
',
- html: '
',
- listeners:{
- afterrender: function(){
- //Doing a custom svg here for background!
- var chicha = document.getElementById( 'popomas' );
- var cSensor = getSensorByNodeId( NodeID );
- if( cSensor!= null ){
- ME_max_range = cSensor.max_range;
- } else {
- ME_max_range = 100;
- };
- //var svg = document.getElementById('draw_svg_'+parseInt( NodeID ) );
- //var svgCode = window.btoa(svg.outerHTML);
- //chicha.style.backgroundImage = "url(data:image/svg+xml;base64," + svgCode + ")";
- //chicha.style.backgroundImage = "url('style/wicons/011.png')";
- $("#mask_canvas").mousemove( onMouseMove );
- MaskEditorActive = true;
- MaskEditorDevice = NodeID;
- loadMaskDraw( NodeID );
- }
- }
- }],
- tbar:[{
- text:'New Polygone',
- id: 'me_b_newp',
- enableToggle: true,
- toggleGroup: 'me_topbar_grp',
- pressed: false,
- handler: function( btn ){
- if( btn.pressed ) setMaskEditorMode( 0 );
- }
- }/*,{
- text:'Delete Polygone',
- id: 'me_b_delp',
- enableToggle: true,
- toggleGroup: 'me_topbar_grp'
- },{
- text:'Delete Point',
- id: 'me_b_delpo',
- enableToggle: true,
- toggleGroup: 'me_topbar_grp'
- }*/,{
- text:'Clear Mask',
- id: 'me_b_delm',
- handler: function(){
- if( MaskProject!= null ){
- doMaskOperation( NodeID, 3, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- setMaskEditorMode( 0 );
- }
- },{
- text:'1',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: (cMaskID == 0 ),
- handler: function(){
- if( cMaskID != 0 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 0;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'2',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 1 ),
- handler: function(){
- if( cMaskID != 1 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 1;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'3',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 2 ),
- handler: function(){
- if( cMaskID != 2 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 2;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'4',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 3 ),
- handler: function(){
- if( cMaskID != 3 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 3;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'5',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 4 ),
- handler: function(){
- if( cMaskID != 4 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 4;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'Acknowladge Mask',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 5 ),
- handler: function(){
- if( cMaskID != 5 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 5;
- loadDeviceMask( NodeID, cMaskID );
- }
- },'->',{
- xtype: 'panel',
- frame: 'false',
- id: 'me_coords_panel',
- border: true,
- width: 230,
- height: 30,
- html: '
'
- }],
- buttons:[{
- text: 'Cancel',
- handler: function(){
- hideMaskEditor();
- }
- },{
- text:'Save Mask and Close',
- handler: function(){
- var serial = MaskProject.exportJSON();
- Ext.Ajax.request({
- url: '/lib/controller/uploadDeviceMask.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MID: cMaskID,
- LID: 0,
- MDTA: serial,
- MIH: cMapImageHeight,
- MIW: cMapImageWidth,
- //MSF: deviceMapScaling,
- MSHX: deviceMapLeftShift,
- MSHY: deviceMapTopShift,
- DSTD: 0
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- hideMaskEditor();
- load2DMasks( NodeID );
- },
- failure: failureAJAXFunction
- });
- }
- }]
- });
- };
- MEPanel.doLayout();
- //if( MaskProject == null ){
- var canvas = document.getElementById('mask_canvas');
- paper.settings.handleSize = 10;
- MaskProject = new paper.Project( canvas );
- //canvas.addEventListener( 'mousemove', onMaskMouseMove );
- canvas.addEventListener( 'mousedown', onMaskMouseDown );
- //canvas.addEventListener( 'mouseup', onMaskMouseUp );
- //canvas.addEventListener( 'mousedrag', onMaskMouseMove );
- //};
- cMaskID = 0;
- loadDeviceMask( NodeID, cMaskID );
- };
- //maskEditorDiv = $('#container').get(0);
- //var maskEditorDiv = document.getElementById( id ); //Ext.getCmp( id );
- if( maskEditorDiv.requestFullscreen ){
- maskEditorDiv.requestFullscreen();
- }else if( maskEditorDiv.mozRequestFullScreen ){
- maskEditorDiv.mozRequestFullScreen();
- }else if( maskEditorDiv.webkitRequestFullscreen ){
- maskEditorDiv.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
- }else if( maskEditorDiv.msRequestFullscreen ){
- maskEditorDiv.msRequestFullscreen();
- };
- document.addEventListener( 'fullscreenchange', handleFSMaskEditorClose );
- };
-};
-
-function loadMaskDraw( a ){
- Ext.Ajax.request({
- url: '/lib/controller/getDeviceDraw.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NID: a
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.count > 0 ){
- //draws_2d[a] = data.data;
- var csvg = document.getElementById( 'draw_svg_me' );
-
- if( csvg != undefined ){
- var draw = csvg.getElementById( "draw" );
- if( draw != null ) csvg.removeChild( draw );
-
- var p2 = 2.0*Math.PI;
- var so = -10 * p2 / 360.0;
-
- var bBox = csvg.getBBox();
- var newpath = document.createElementNS('http://www.w3.org/2000/svg', "polygon");
- var ak = 2.0*Math.PI/draws_2d[a].length;
- var cpx = bBox.width / 2.0;
- var cpy = bBox.height / 2.0;
- var max = 1024;
- //switch( drawZoomLevels[a] ){
- // case 50: max = 512; break;
- // case 25: max = 256; break;
- // case 12: max = 128; break;
- //};
- var rk = bBox.width / ( max * 2 );
- var pp = '';
- var jj = '';
- for( i=0;i
Data['id'];?>',
- SID: '=$Session;?>',
- MID: LayerID,
- LID: LrfID
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
-
- if( data.length > 0 ){
- for( i = 0; i < data.length; i++ ){
- //var
- path = new paper.Path();
- path.strokeColor = 'black';
- //var lightness = (Math.random() - 0.5) * 0.4 + 0.4;
- //var hue = Math.random() * 360;
- //path.fillColor = { hue: hue, saturation: 1, lightness: lightness };
- path.fillColor = data[i].colour;
- path.closed = true;
- path.opacity = 0.5;
- //path.onMouseMove = onPathMouseMove;
- path.onMouseDown = onMouseDown;
- path.onMouseDrag = onMouseDrag;
- //path.onMouseUp = function( event ){
- // path.add(event.point);
- //}
- if( data[i].points.length > 2 ){
- if( cMapType == 1 ){
- var tX = data[i].points[0][0] * deviceMapScaling + deviceMapLeftShift;
- var tY = data[i].points[0][1] * deviceMapScaling + deviceMapTopShift;
- path.moveTo( [tX,tY] );
- for(k = 1; k < data[i].points.length; k++ ){
- tX = data[i].points[k][0] * deviceMapScaling + deviceMapLeftShift;
- tY = data[i].points[k][1] * deviceMapScaling + deviceMapTopShift;
- path.lineTo( [tX,tY] );
- };
- } else {
- var tX = ( 2047 + parseInt( data[i].points[0][0]) ) * deviceMapScaling + deviceMapLeftShift;
- var tY = ( 2047 + parseInt( data[i].points[0][1]) ) * deviceMapScaling + deviceMapTopShift;
- path.moveTo( [tX,tY] );
- for(k = 1; k < data[i].points.length; k++ ){
- tX = ( 2047 + parseInt(data[i].points[k][0]) ) * deviceMapScaling + deviceMapLeftShift;
- tY = ( 2047 + parseInt(data[i].points[k][1]) ) * deviceMapScaling + deviceMapTopShift;
- path.lineTo( [tX,tY] );
- };
- };
- path.fullySelected = true;
- paper.view.draw();
- };
- poligones.push(path);
- setMaskEditorMode( 4 );
- };
- } else {
- setMaskEditorMode( 0 );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function onMaskMouseDown( evt ){
- switch( MaskEditorMode ){
- case 0:{
- path = new paper.Path();
- path.strokeColor = 'black';
- path.fillColor = '#ff8020';
- path.onMouseDown = onMouseDown;
- path.onMouseDrag = onMouseDrag;
- //path.onMouseMove = onPathMouseMove;
- path.fullySelected = true;
- path.closed = true;
- path.opacity = 0.5;
- path.moveTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- setMaskEditorMode( 1 );
- break;
- };
- case 1:{
- path.lineTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- if( path.segments.length == 3 ){
- setMaskEditorMode( 4 );
- };
- };
- };
- //if( MaskEditorMode == 0 ){
- //
- //} else {
- // path.lineTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- //};
-};
-
-function onMaskMouseUp( evt ){
- if( MaskEditorMode == 4 ){
- //path.lineTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- path.fullySelected = true;
- path.onMouseDown = onMouseDown;
- path.onMouseDrag = onMouseDrag;
- //path.onMouseMove = onPathMouseMove;
- paper.view.draw();
- //poligones.push( path );
- setMaskEditorMode( 1 );
- };
-};
-
-function onMaskMouseMove( event ){
- if( MaskEditorMode == 4 ){
- //paper.view.draw();
- };
-};
-
-
-
diff --git a/lib/javascript/jsapi_dynamic/rgoose_devices_.js b/lib/javascript/jsapi_dynamic/rgoose_devices_.js
deleted file mode 100644
index ce91639..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_devices_.js
+++ /dev/null
@@ -1,2370 +0,0 @@
-//
-
-
-
-var devices = new Array();
-var cameras = new Array();
-
-var systemDevicesAreLoadded = false;
-
-function loadSystemDevices(){
- Ext.Ajax.request({
- url: '/lib/controller/getSystemDevices.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- devices = data.sensors;
- cameras = data.cameras;
- systemDevicesAreLoadded = true;
- },
- failure: failureAJAXFunction
- });
-};
-
-function getSensorByNodeId( NID ){
- if( systemDevicesAreLoadded ) for( i=0; i< devices.length; i++ ) if( devices[i].node_id == NID ) return devices[i];
- return null;
-};
-
-function getSensorById( SID ){
- if( systemDevicesAreLoadded ) for( i=0; i< devices.length; i++) if( devices[i].id == SID ) return devices[i];
- return null;
-};
-
-function getCameraByNodeId( NID ){
- if( systemDevicesAreLoadded ) for( i=0; i< cameras.length; i++) if( cameras[i].node_id == NID ) return cameras[i];
- return null;
-};
-
-function getCameraById( SID ){
- if( systemDevicesAreLoadded ) for( i=0; i< cameras.length; i++) if( cameras[i].id == SID ) return cameras[i];
- return null;
-};
-
-
-var UartListStore = new Ext.data.JsonStore({
- root: 'ports',
- totalProperty: 'totalCount',
- idProperty: 'uart_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- SITE: =$SiteID;?>
- },
- fields: [{
- name: 'uart_id',
- type: 'int'
- },{
- name: 'uart_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listUarts.php'
- })
-});
-
-var ServersListStore = new Ext.data.JsonStore({
- root: 'servers',
- totalProperty: 'totalCount',
- idProperty: 'server_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- SITE: =$SiteID;?>
- },
- fields: [{
- name: 'server_id',
- type: 'int'
- },{
- name: 'server_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listServers.php'
- })
-});
-
-var ServerListStore = new Ext.data.JsonStore({
- root: 'servers',
- totalProperty: 'totalCount',
- idProperty: 'server_id',
- remoteSort: false,
- baseParams: {
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- SITE: =$SiteID;?>
- },
- fields: [{
- name: 'server_id',
- type: 'int'
- },{
- name: 'server_name',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listServers.php'
- })
-});
-
-function loadSettingsLidar3D( NodeID, Master ){
- SelectedNodeID = NodeID;
- Ext.Ajax.request({
- url: '/lib/controller/getSettingsLidsr3D.php',
- params: {
- NID: NodeID,
- MST: ((Master)?1:0),
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- 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 );
- },
- failure: failureAJAXFunction
- });
-};
-
-function saveSettingsLidar3D( ){
- if( SelectedNodeID == 0 ) return;
- t1 = Ext.getCmp('setting_master_ip').getValue();
- t2 = Ext.getCmp('setting_master_port').getValue();
- t3 = Ext.getCmp('setting_slave_ip').getValue();
- t4 = Ext.getCmp('setting_slave_port').getValue();
- t5 = Ext.getCmp('setting_lat').getValue();
- t6 = Ext.getCmp('setting_lon').getValue();
- t7 = Ext.getCmp('setting_alt').getValue();
- t8 = Ext.getCmp('setting_roll').getValue();
- t9 = Ext.getCmp('setting_pitch').getValue();
- t10 = Ext.getCmp('setting_yaw').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/setSettingsLidsr3D.php',
- params: {
- NID: SelectedNodeID,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MIP: t1,
- MPP: t2,
- SIP: t3,
- SPP: t4,
- LAT: t5,
- LON: t6,
- ALT: t7,
- ROL: t8,
- PCH: t9,
- YAW: t10
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- if( data.success == true ) {
- Ext.Msg.show({
- title:'=$Labels->GetLabel("_INFO_MSG_");?>',
- msg: '=$Labels->GetLabel("_SETTING_SAVE_OK_");?>',
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- fn: function(){
- SettingsLidar3D.hide();
- },
- //animEl: 'elId',
- icon: Ext.MessageBox.INFO //QUESTION
- });
- } else {
- Ext.Msg.show({
- title:'=$Labels->GetLabel("_ERROR_MSG_");?>',
- msg: data['error'],
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- fn: function(){
- SettingsLidar3D.hide();
- },
- //animEl: 'elId',
- icon: Ext.MessageBox.ERROR //QUESTION
- });
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-
-function editSettingsLidar3D( NodeID, Master ){
- if( SettingsLidar3D == null ){
- SettingsLidar3D = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel("_EDIT_LRF3D_SETTINGS_");?>',
- width: 773,
- height: 600,
- layout: 'fit',
- closeAction: 'hide',
- listeners:{
- beforehide : function(){
- Ext.getCmp('connectstarterbutton').toggle( false, false );
- }
- },
- items:[{
- layout: 'table',
- border: false,
- defaults: {
- // applied to each contained panel
- bodyStyle:'padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:10px;'
- },
- layoutConfig: {
- // The total column count must be specified here
- columns: 4
- },
- items: [{
- border: false,
- html: 'Master IP Address:'
- },{
- xtype: 'textfield',
- id: 'setting_master_ip',
- width: '70%'
- },{
- border: false,
- html: 'Port:'
- },{
- xtype: 'textfield',
- id: 'setting_master_port',
- width: '30%'
- },{
- border: false,
- html: 'Slave IP Address:'
- },{
- xtype: 'textfield',
- id: 'setting_slave_ip',
- width: '70%'
- },{
- border: false,
- html: 'Port:'
- },{
- xtype: 'textfield',
- id: 'setting_slave_port',
- width: '30%'
- },{
- border: false,
- html: 'Position Lat/Lon/Alt:'
- },{
- xtype: 'textfield',
- id: 'setting_lat',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_lon',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_alt',
- width: '30%'
- },{
- border: false,
- html: 'Orientation Roll/Pitch/Yaw:'
- },{
- xtype: 'textfield',
- id: 'setting_roll',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_pitch',
- width: '30%'
- },{
- xtype: 'textfield',
- id: 'setting_yaw',
- width: '30%'
- }]
- }],
- bbar: [{
- text: '=$Labels->GetLabel("_CANCEL_");?>',
- handler: function(){
- SettingsLidar3D.hide();
- }
- },{
- text: '=$Labels->GetLabel("_SAVE_");?>',
- handler: SaveSettingsLidar3D
- }]
- });
- };
- SettingsLidar3D.show();
- loadSettingsLidar3D( NodeID, Master );
-};
-
-var devicesStore = new Ext.data.JsonStore({
- root: 'nodes',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'name',
- type: 'string'
- },{
- name: 'hardware',
- type: 'string'
- },{
- name: 'caps',
- type: 'int'
- },{
- name: 'ip',
- type: 'string'
- },{
- name: 'mac',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/listDiscoveredCameraSources.php',
- headers: {
- 'UID': '=$CUser->Data['id'];?>',
- 'SID': '=$Session;?>'
- }
- })
-});
-
-var LRF1D2_st_win = null;
-var LRF2D2_st_win = null;
-var LRF16D3_st_win = null;
-
-var currentDeviceOperatioId = 0;
-var currentOperationTO = 0;
-var currentOperationTimer = null;
-var lastOperationCode = 0;
-function checkDeviceOperationStatus(){
- if( currentOperationTO ){
- currentOperationTO--;
- Ext.Ajax.request({
- url: '/lib/controller/checkDeviceOperation.php',
- params: {
- OID: currentDeviceOperatioId,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( !data.success ){
- Ext.MessageBox.hide();
- Ext.Msg.show({
- title:'Node Command Status',
- msg: data.msg,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- } else {
- if( lastOperationCode != data.code || data.code == 0 ){
- lastOperationCode = data.code;
- currentOperationTO = 20;
- };
- if( data.code < 100 ){
- currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 );
- } else {
- Ext.MessageBox.hide();
- switch( data.code ){
- case 120:
- case 100:
- default:
- Ext.Msg.show({
- title:'Node Command Status',
- msg: 'Operation Complete',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- };
- };
- };
- },
- failure: failureAJAXFunction
- });
- } else {
- Ext.MessageBox.hide();
- Ext.Msg.show({
- title:'Node Command Status',
- msg: 'Operation Status - Time Out!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- };
-};
-
-function doDeviceOperation( NodeID, OpCode, Param='', nowait=false ){
- if( !nowait ){
- Ext.MessageBox.wait("=$Labels->GetLabel('_Loading_Calo_');?>","=$Labels->GetLabel('_Please_Wait_');?>",{
- width: '100%',
- hidden: true,
- progress: true,
- closable: false
- });
- };
-
- Ext.Ajax.request({
- url: '/lib/controller/doNodeOperation.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- CMD: OpCode,
- SID: '=$Session;?>',
- PARAM: Param
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( !data.success ){
- if( !nowait ) Ext.MessageBox.hide();
- Ext.Msg.show({
- title:'Node Command Status',
- msg: data.msg,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- } else {
- if( !nowait ){
- currentDeviceOperatioId = data.operation_id;
- currentOperationTO = 20;
- lastOperationCode = 0;
- currentOperationTimer = window.setTimeout( checkDeviceOperationStatus, 100 );
- };
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function clearDeviceEvents( NodeID ){
- Ext.Ajax.request({
- url: '/lib/controller/clearEventCloud.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadFullLRF1D2Data( NodeID ){
-
- if( LRF1D2_st_win == null ) return;
-
- Ext.Ajax.request({
- url: '/lib/controller/getSettingsLRF.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- if( LRF1D2_st_win!= null ){
- var data = Ext.decode(response.responseText);
- if( data.online ){
- switch( data.data_status ){
- case 0: Ext.getCmp('dev_online').update('ONLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('dev_online').update('ONLINE/Synced
'); break;
- case 2: Ext.getCmp('dev_online').update('ONLINE/Data Not Applyed
'); break;
- };
- } else {
- switch( data.data_status ){
- case 0: Ext.getCmp('dev_online').update('OFFLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('dev_online').update('OFFLINE/Synced
'); break;
- case 2: Ext.getCmp('dev_online').update('OFFLINE/Data Not Applyed
'); break;
- };
- };
- Ext.getCmp('dev_name').setValue( data.name );
- Ext.getCmp('serial_num').setValue( data.serial );
- Ext.getCmp('version_id').setValue( data.version );
- Ext.getCmp('device_id').setValue( data.device_id );
- Ext.getCmp('com_spd').setValue( data.com_spd );
- Ext.getCmp('max_range').setValue( data.max_range );
- Ext.getCmp('base_shift').setValue( data.base_shift );
- Ext.getCmp('com_spd').setValue( data.uart_speed );
- Ext.getCmp('mlrf_offset').setValue( data.m_offset );
- Ext.getCmp('slrf_offset').setValue( data.s_offset );
- Ext.getCmp('mlrf_delta').setValue( data.m_delta );
- Ext.getCmp('slrf_delta').setValue( data.s_delta );
- Ext.getCmp('mlrf_width').setValue( data.m_width );
- Ext.getCmp('slrf_width').setValue( data.s_width );
- Ext.getCmp('mlrf_order').setValue( data.m_order );
- Ext.getCmp('slrf_order').setValue( data.s_order );
- Ext.getCmp('mlrf_sst').setValue( data.m_sst );
- Ext.getCmp('slrf_sst').setValue( data.s_sst );
- Ext.getCmp('mlrf_flip').setValue( data.m_flip );
- Ext.getCmp('slrf_flip').setValue( data.s_flip );
- Ext.getCmp('mlrf_sun').setValue( data.m_sun );
- Ext.getCmp('slrf_sun').setValue( data.s_sun );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadFullLRF2D2Data( NodeID ){
-
- if( LRF2D2_st_win == null ) return;
-
- Ext.Ajax.request({
- url: '/lib/controller/getSettingsLRF.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- if( LRF2D2_st_win!= null ){
- var data = Ext.decode(response.responseText);
- if( data.online ){
- switch( data.data_status ){
- case 0: Ext.getCmp('LRF2D2_dev_status').update('ONLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('LRF2D2_dev_status').update('ONLINE/Synced
'); break;
- case 2: Ext.getCmp('LRF2D2_dev_status').update('ONLINE/Data Not Applyed
'); break;
- };
- } else {
- switch( data.data_status ){
- case 0: Ext.getCmp('LRF2D2_dev_status').update('OFFLINE/Data Incomplete
'); break;
- case 1: Ext.getCmp('LRF2D2_dev_status').update('OFFLINE/Synced
'); break;
- case 2: Ext.getCmp('LRF2D2_dev_status').update('OFFLINE/Data Not Applyed
'); break;
- };
- };
- Ext.getCmp('LRF2D2_name').setValue( data.name );
- Ext.getCmp('LRF2D2_serial_num').setValue( data.serial );
- Ext.getCmp('LRF2D2_version_id').setValue( data.version );
- Ext.getCmp('LRF2D2_device_id').setValue( data.device_id );
- Ext.getCmp('LRF2D2_com_spd').setValue( data.com_spd );
- Ext.getCmp('LRF2D2_max_range').setValue( data.max_range );
- Ext.getCmp('LRF2D2_base_shift').setValue( data.base_shift );
- Ext.getCmp('LRF2D2_com_spd').setValue( data.uart_speed );
- Ext.getCmp('mlrf_offset').setValue( data.master_profile.offset );
- Ext.getCmp('slrf_offset').setValue( data.slave_profile.offset );
- Ext.getCmp('mlrf_delta').setValue( data.master_profile.delta );
- Ext.getCmp('slrf_delta').setValue( data.slave_profile.delta );
- Ext.getCmp('mlrf_width').setValue( data.master_profile.width );
- Ext.getCmp('slrf_width').setValue( data.slave_profile.width );
- Ext.getCmp('mlrf_order').setValue( data.master_profile.order );
- Ext.getCmp('slrf_order').setValue( data.slave_profile.order );
- Ext.getCmp('mlrf_sst').setValue( data.master_profile.sst );
- Ext.getCmp('slrf_sst').setValue( data.slave_profile.sst );
- Ext.getCmp('mlrf_flip').setValue( data.master_profile.flip );
- Ext.getCmp('slrf_flip').setValue( data.slave_profile.flip );
- Ext.getCmp('mlrf_sun').setValue( data.master_profile.sun );
- Ext.getCmp('slrf_sun').setValue( data.slave_profile.sun );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function LRF1D2_settings(){
- if( LRF1D2_st_win == null ){
- LRF1D2_st_win = new Ext.Window({
- title: 'Sensor Settings',
- modal: true,
- width: 800,
- height: 600,
- closeAction: 'hide',
- items:{
- xtype: 'tabpanel',
- activeTab: 0,
- items:[{
- title: 'General Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 3
- },
- items:[{
- html: 'Status',
- frame: false,
- border: false
- },{
- html: 'ONLINE
',
- id: 'dev_online',
- frame: false,
- border: false
- },{},{
- html: 'Device Title',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'dev_name',
- readOnly: false,
- value: 'KOKO'
- },{},{
- html: 'Serial Number',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'serial_num',
- readOnly: true,
- value: '1212'
- },{},{
- html: 'Version ID',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'version_id',
- readOnly: true,
- value: 'LiberManDA122'
- },{},{
- html: 'Device Adress',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'device_id'
- },{
- xtype: 'button',
- id: 'upddiBTN',
- text: 'Update Device Address',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Address?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Device COM Speed',
- frame: false,
- border: false
- },{
- xtype: 'combo',
- id: 'com_spd',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: '100%',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['mySPD', 'displayText' ],
- data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
- }),
- valueField: 'mySPD',
- displayField: 'displayText'
- },{
- xtype: 'button',
- id: 'updspBTN',
- text: 'Set Device Speed',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Speed?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Detection Maximal Range',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'max_range',
- readOnly: true,
- value: '1212'
- },{},{
- html: 'Base Shift',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'base_shift',
- readOnly: true,
- value: '1212'
- },{}]
- },{
- title: 'Mantenence',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 2
- },
- items:[{
- html: 'Restart Device',
- frame: false,
- border: false
- },{
- xtype: 'button',
- id: 'rstBTN',
- text: 'Full Reset',
- handler: function(){
- Ext.Msg.show({
- title:'Reset Device?',
- msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'rstBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- }]
- },{
- title: 'Detection Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 4
- },
- items:[{
- html: 'Master Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_offset',
- name: 'mlrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Slave Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_offset',
- name: 'slrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Master Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_delta',
- name: 'mlrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_delta',
- name: 'slrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_width',
- name: 'mlrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Slave Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_width',
- name: 'slrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Master Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_order',
- name: 'mlrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_order',
- name: 'slrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sst',
- name: 'mlrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sst',
- name: 'slrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Mastr Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_flip',
- name: 'mlrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Slave Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_flip',
- name: 'slrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Master Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sun',
- name: 'mlrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sun',
- name: 'slrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- }]
- },{
- title: 'Embed Options'
- },{
- title: 'Target Width Table'
- }]
- }
- });
- };
- LRF1D2_st_win.show();
- loadFullLRF1D2Data( SelectedNodeID );
-};
-
-function LRF2D2_settings(){
- if( LRF2D2_st_win == null ){
- LRF2D2_st_win = new Ext.Window({
- title: 'Sensor Settings',
- modal: true,
- width: 800,
- height: 600,
- closeAction: 'hide',
- items:{
- xtype: 'tabpanel',
- activeTab: 0,
- items:[{
- title: 'General Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 3
- },
- items:[{
- html: 'Status',
- frame: false,
- border: false
- },{
- html: 'ONLINE
',
- id: 'LRF2D2_dev_status',
- frame: false,
- border: false
- },{},{
- html: 'Device Title',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'LRF2D2_name',
- readOnly: false,
- value: ''
- },{},{
- html: 'Serial Number',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'LRF2D2_serial_num',
- readOnly: true,
- value: '1212'
- },{},{
- html: 'Version ID',
- frame: false,
- border: false
- },{
- xtype: 'field',
- id: 'LRF2D2_version_id',
- readOnly: true,
- value: 'LiberManDA122'
- },{},{
- html: 'Device Adress',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'LRF2D2_device_id'
- },{
- xtype: 'button',
- text: 'Update Device Address',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Address?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Device COM Speed',
- frame: false,
- border: false
- },{
- xtype: 'combo',
- id: 'LRF2D2_com_spd',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: '100%',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['mySPD', 'displayText' ],
- data: [[4800,'4800'],[9600,'9600'],[14400,'14400'],[19200,'19200'],[38400, '38400'],[56000,'56000'],[57600,'57600'],[115200,'115200']]
- }),
- valueField: 'mySPD',
- displayField: 'displayText'
- },{
- xtype: 'button',
- text: 'Set Device Speed',
- handler: function(){
- Ext.Msg.show({
- title:'Update Device Speed?',
- msg: 'Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'upddiBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- },{
- html: 'Detection Maximal Range',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'LRF2D2_max_range',
- readOnly: false,
- value: '1212'
- },{},{
- html: 'Base Shift',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'LRF2D2_base_shift',
- readOnly: false,
- value: '1212'
- },{
- xtype: 'button',
- text: 'Update Base Shift',
- handler: function(){
- var bash = Ext.getCmp('LRF2D2_base_shift').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLrfSettings_baseshift.php',
- params: {
- NID: SelectedNodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- PID: 0,
- BASH: bash
- },
- success: function( response, opts ){
- loadFullLRF2D2Data( SelectedNodeID );
- },
- failure: failureAJAXFunction
- });
- }
- }]
- },{
- title: 'Detection Settings',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 4
- },
- items:[{
- html: 'Master Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_offset',
- name: 'mlrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Slave Offset',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_offset',
- name: 'slrf_offset',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 60',
- maxValue: 60,
- minText: 'No Negative Values Allowed',
- minValue: 0,
- },{
- html: 'Master Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_delta',
- name: 'mlrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Delta',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_delta',
- name: 'slrf_delta',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 320',
- maxValue: 320,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_width',
- name: 'mlrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Slave Width',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_width',
- name: 'slrf_width',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 1800 - 16000',
- maxValue: 16000,
- minText: 'The Range is: 1800 - 16000',
- minValue: 1800
- },{
- html: 'Master Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_order',
- name: 'mlrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Order',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_order',
- name: 'slrf_order',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 10',
- maxValue: 10,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Master SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sst',
- name: 'mlrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave SST',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sst',
- name: 'slrf_sst',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Mastr Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_flip',
- name: 'mlrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Slave Flip',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_flip',
- name: 'slrf_flip',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 8 - 128',
- maxValue: 128,
- minText: 'The Range is: 8 - 128',
- minValue: 8
- },{
- html: 'Master Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'mlrf_sun',
- name: 'mlrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- html: 'Slave Sun',
- frame: false,
- border: false
- },{
- xtype: 'numberfield',
- id: 'slrf_sun',
- name: 'slrf_sun',
- allowBlank: false,
- allowDecimals: false,
- maxText: 'The Range is: 0 - 100',
- maxValue: 100,
- minText: 'No Negative Values Allowed',
- minValue: 0
- },{
- xtype: 'button',
- text: 'Update Detection Settings',
- width: '100%',
- colspan: 4,
- handler: function(){
- var MOFS=Ext.getCmp('mlrf_offset').getValue();
- var MDEL=Ext.getCmp('mlrf_delta').getValue();
- var MWIT=Ext.getCmp('mlrf_width').getValue();
- var MORD=Ext.getCmp('mlrf_order').getValue();
- var MSST=Ext.getCmp('mlrf_sst').getValue();
- var MFLP=Ext.getCmp('mlrf_flip').getValue();
- var MSUN=Ext.getCmp('mlrf_sun').getValue();
- var SOFS=Ext.getCmp('slrf_offset').getValue();
- var SDEL=Ext.getCmp('slrf_delta').getValue();
- var SWIT=Ext.getCmp('slrf_width').getValue();
- var SORD=Ext.getCmp('slrf_order').getValue();
- var SSST=Ext.getCmp('slrf_sst').getValue();
- var SFLP=Ext.getCmp('slrf_flip').getValue();
- var SSUN=Ext.getCmp('slrf_sun').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateDetecttionProfile.php',
- params: {
- NID: SelectedNodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- PID: 0,
- MOFS: MOFS,
- MDEL: MDEL,
- MWIT: MWIT,
- MORD: MORD,
- MSST: MSST,
- MFLP: MFLP,
- MSUN: MSUN,
- SOFS: SOFS,
- SDEL: SDEL,
- SWIT: SWIT,
- SORD: SORD,
- SSST: SSST,
- SFLP: SFLP,
- SSUN: SSUN
- },
- success: function( response, opts ){
- loadFullLRF2D2Data( SelectedNodeID );
- },
- failure: failureAJAXFunction
- });
- }
- }]
- },{
- title: 'Embed Options'
- },{
- title: 'Target Width Table'
- },{
- title: 'Mantenence',
- xtype: 'form',
- layout: 'table',
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- columns: 2
- },
- items:[{
- html: 'Restart Device',
- frame: false,
- border: false
- },{
- xtype: 'button',
- id: 'rstBTN',
- text: 'Full Reset',
- handler: function(){
- Ext.Msg.show({
- title:'Reset Device?',
- msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
- buttons: Ext.Msg.YESNOCANCEL,
- //fn: processResult,
- animEl: 'rstBTN',
- icon: Ext.MessageBox.QUESTION
- });
- }
- }]
- }]
- }
- });
- };
- LRF2D2_st_win.show();
- loadFullLRF2D2Data( SelectedNodeID );
-};
-
-function LRF16D3_settings(){
-};
-
-var currentResolveDeviceNode = 0;
-var ResolveDeviceNodeWin = null;
-
-function resolveDeviceMistmatch( NodeID ){
- currentResolveDeviceNode = NodeID;
- if( ResolveDeviceNodeWin == null ){
- ResolveDeviceNodeWin = new Ext.Window({
- title: '=$Labels->GetLabel('_WDEV_MISTMATCH_');?>',
- modal: true,
- width: 500,
- height: 200,
- closeAction: 'hide',
- items:[{
- xtype: 'spacer',
- style: {
- marginTop: '13px'
- },
- html: '=$Labels->GetLabel('_DEV_MISTMATT1_');?> ',
- height: 30
- },{
- xtype: 'button',
- width: '100%',
- text: 'It is Newly Connected Device',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/validateNode.php',
- params: {
- NID: currentResolveDeviceNode,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MET: 1
- },
- success: function( response, opts ){
- ResolveDeviceNodeWin.hide();
- },
- failure: failureAJAXFunction
- });
- }
- },{
- xtype: 'button',
- width: '100%',
- text: 'Apply Existing Detection Profiles to Newly Connected Device',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/validateNode.php',
- params: {
- NID: currentResolveDeviceNode,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MET: 1
- },
- success: function( response, opts ){
- ResolveDeviceNodeWin.hide();
- },
- failure: failureAJAXFunction
- });
- }
- },{
- xtype: 'button',
- width: '100%',
- text: 'Discard old Detection Profiles and Start Device Setup Wizard',
- handler: function(){
- ResolveDeviceNodeWin.hide();
- startDeviceDetectionWizard( currentResolveDeviceNode );
- }
- },{
- xtype: 'button',
- width: '100%',
- text: 'Discard old Detection Profiles and Load Factory Settings from Device'
- },{
- xtype: 'button',
- width: '100%',
- text: 'Discard this Connection for NOW'
- }]
- });
- };
- ResolveDeviceNodeWin.show();
-};
-
-var DeviceDetectionWizardWnd = null;
-var DDWizardActiveDevice = '';
-var RangeSetBlocker = false;
-function startDeviceDetectionWizard( NodeID ){
- DDWizardActiveDevice = NodeID
- if( DeviceDetectionWizardWnd == null ){
- DeviceDetectionWizardWnd = new Ext.Window({
- title: '=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
- modal: true,
- width: 500,
- height: 208,
- closeAction: 'hide',
- items:[{
- xtype: 'tabpanel',
- activeTab: 1,
- items: [{
- title: '=$Labels->GetLabel('_WDEV_DET_WIZ0_');?>',
- frame: false,
- xtype: 'form',
- items:[{
- xtype: 'spacer',
- height: 20
- },{
- xtype: 'combo',
- id: 'DDWizST',
- fieldLabel: '=$Labels->GetLabel('_DEV_TYPE_FLD_');?>',
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: [
- 'dtId',
- 'dtText'
- ],
- data: [
- [1, '=$Labels->GetLabel('_DEV_TYPE_ALS_');?>'],
- [2, '=$Labels->GetLabel('_DEV_TYPE_LFS_');?>'],
- [3, '=$Labels->GetLabel('_DEV_TYPE_PLS200_');?>'],
- [4, '=$Labels->GetLabel('_DEV_TYPE_PLS360_');?>'],
- [5, '=$Labels->GetLabel('_DEV_TYPE_3D_');?>'],
- [6, '=$Labels->GetLabel('_DEV_TYPE_NPLS200_');?>']
- ]
- }),
- valueField: 'dtId',
- displayField: 'dtText'
- },{
- xtype: 'numberfield',
- id: 'DDWizSR',
- fieldLabel: '=$Labels->GetLabel('_DEV_RANGE_FLD_');?>',
- minValue: 15.0,
- maxValue: 300.0,
- listeners:{
- change: function( m, nv, ov ){
- if( RangeSetBlocker ) return;
- RangeSetBlocker = true;
- Ext.getCmp('DDWizSRS').setValue( nv );
- RangeSetBlocker = false;
- }
- }
- },{
- xtype: 'slider',
- id: 'DDWizSRS',
- fieldLabel: '=$Labels->GetLabel('_DEV_RANGE_FLD_');?>',
- minValue: 15.0,
- maxValue: 300.0,
- listeners:{
- change: function( m, nv, ov ){
- if( RangeSetBlocker ) return;
- RangeSetBlocker = true;
- Ext.getCmp('DDWizSR').setValue( nv );
- RangeSetBlocker = false;
- }
- }
- },{
- xtype: 'spacer',
- height: 10
- }]
- },{
- title: '=$Labels->GetLabel('_WDEV_DET_WIZ1_');?>',
- frame: false,
- xtype: 'form',
- labelWidth: 120,
- items:[{
- xtype: 'spacer',
- height: 20
- },{
- xtype: 'combo',
- id: 'DDWizIT',
- fieldLabel: '=$Labels->GetLabel('_DEV_ITYPE_FLD_');?>',
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- mode: 'local',
- value: 1,
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: [
- 'dpId',
- 'dpText'
- ],
- data: [
- [1, '=$Labels->GetLabel('_DEV_PL_HORI_');?>'],
- [2, '=$Labels->GetLabel('_DEV_PL_VERT_');?>'],
- [3, '=$Labels->GetLabel('_DEV_PL_ANG_');?>']
- ]
- }),
- valueField: 'dpId',
- displayField: 'dpText'
- }]
- },{
- title: '=$Labels->GetLabel('_WDEV_DET_WIZ2_');?>',
- html: 'Another one'
- },{
- title: '=$Labels->GetLabel('_WDEV_DET_WIZ3_');?>',
- html: 'Another one'
- }]
- }],
- bbar:[{
- text: 'Create Profiles And Finish',
- handler: function(){
- DeviceDetectionWizardWnd.hide();
- }
- },{
- text: 'Advanced Config',
- handler: function(){
- DeviceDetectionWizardWnd.hide();
- startAdvancedDeviceDetection( DDWizardActiveDevice );
- }
- }]
- });
- };
- Ext.Ajax.request({
- url: '/lib/controller/getNodeBasicNfo.php',
- params: {
- NID: DDWizardActiveDevice,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- DeviceDetectionWizardWnd.setTitle( '=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [' + data.name+']' );
- Ext.getCmp('DDWizST').setValue( data.type );
- RangeSetBlocker = true;
- Ext.getCmp('DDWizSR').setValue( data.range );
- Ext.getCmp('DDWizSRS').setValue( data.range );
- RangeSetBlocker = false;
- DeviceDetectionWizardWnd.show();
- },
- failure: failureAJAXFunction
- });
-};
-
-var DeviceDetectionAdvancedWnd = null;
-var DeviceDetectionProfileNames = ['factory default', 'low sens', 'medium sens', 'high sens'];
-function loadAdvancedDeviceDetectionSettings(){
- Ext.getCmp('ADD_TP').removeAll( false );
- Ext.Ajax.request({
- url: '/lib/controller/getNodeAdvancedNfo.php',
- params: {
- NID: DDWizardActiveDevice,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- DeviceDetectionAdvancedWnd.setTitle( '=$Labels->GetLabel('_WDEV_DET_WIZT_');?> [' + data.name+']' );
- if( data.profiles.length > 0 ){
- if( data.profiles.length > 3 ) Ext.getCmp('ADD_PADD_BTN').disable();
- switch( data.type ){
- case 1:
- case 5:{
- for( i = 0; i < data.profiles.length / 2; i++){
- };
- break;
- };
- case 2:
- case 3:
- case 4:
- case 6:{
- for( i = 0; i < data.profiles.length; i++){
- Ext.getCmp('ADD_TP').add({
- title: DeviceDetectionProfileNames[ data.profiles[i].id ],
- xtype: 'form',
- frame: false,
- items:[{xtype: 'spacer', height: 10 },{
- xtype: 'numberfield',
- id: 'OFFSET_P'+data.profiles[i].id,
- fieldLabel: 'OFFSET',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].offset
- },{
- xtype: 'numberfield',
- id: 'DELTA_P'+data.profiles[i].id,
- fieldLabel: 'DELTA',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].delta
- },{
- xtype: 'numberfield',
- id: 'WIDTH_P'+data.profiles[i].id,
- fieldLabel: 'WIDTH',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].width
- },{
- xtype: 'numberfield',
- id: 'SST_P'+data.profiles[i].id,
- fieldLabel: 'SST',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].sst
- },{
- xtype: 'numberfield',
- id: 'FLIP_P'+data.profiles[i].id,
- fieldLabel: 'FLIP',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].flip
- },{
- xtype: 'numberfield',
- id: 'SUN_P'+data.profiles[i].id,
- fieldLabel: 'SUN',
- minValue: 15.0,
- maxValue: 300.0,
- value: data.profiles[i].sun
- }]
- });
- };
- break;
- };
- };
- //
- } else {
- Ext.getCmp('ADD_TP').add({
- title: 'Error!',
- html: 'No Profiles Defined'
- });
- };
- DeviceDetectionAdvancedWnd.show();
- },
- failure: failureAJAXFunction
- });
-};
-
-function startAdvancedDeviceDetection( NodeID ){
- DDWizardActiveDevice = NodeID;
- if( DeviceDetectionAdvancedWnd == null ){
- DeviceDetectionAdvancedWnd = new Ext.Window({
- title: '=$Labels->GetLabel('_WDEV_DET_WIZT_');?>',
- modal: true,
- width: 500,
- height: 300,
- closeAction: 'hide',
- items:[{
- xtype: 'tabpanel',
- id: 'ADD_TP',
- frame: false,
- border: false,
- activeTab: 0,
- items: []
- }],
- bbar:[{
- id: 'ADD_PADD_BTN',
- text: 'Add Detection Profile',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/addDetectionProfile.php',
- params: {
- NID: DDWizardActiveDevice,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- loadAdvancedDeviceDetectionSettings();
- },
- failure: failureAJAXFunction
- });
- }
- },{
- text: 'Apply And Finish'
- },{
- text: 'Use Wizard'
- }]
- });
- };
- loadAdvancedDeviceDetectionSettings();
-};
-
-var maskEditorDiv = null;
-var MEPanel = null;
-function handleFSMaskEditorClose( event ){
- if ( document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement ){
- } else {
- MEPanel.destroy();
- maskEditorDiv.remove();
- maskEditorDiv = null;
- MEPanel = null;
- document.removeEventListener( 'fullscreenchange', handleFSMaskEditorClose );
- };
-};
-
-function hideMaskEditor(){
- if(
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement
- ){
- if( document.exitFullscreen ){
- document.exitFullscreen();
- }else if( document.mozCancelFullScreen ){
- document.mozCancelFullScreen();
- }else if( document.webkitExitFullscreen ){
- document.webkitExitFullscreen();
- }else if( document.msExitFullscreen ){
- document.msExitFullscreen();
- };
- // Removal Done by event!
- //maskEditorDiv.remove();
- //maskEditorDiv = null;
- //document.removeEventListener( 'fullscreenchange', handleFSMaskEditorClose );
- };
-};
-var values = {
- paths: 50,
- minPoints: 5,
- maxPoints: 15,
- minRadius: 30,
- maxRadius: 90
-};
-
-var hitOptions = {
- segments: true,
- stroke: true,
- fill: true,
- tolerance: 10
-};
-
-var polycolors = new Array();
-var polyindex = 0;
-var poligones = new Array();
-
-var segment = null;
-var path = null;
-var MaskProject = null;
-var MaskEditorMode = 0;
-
-function onMouseDown(event) {
- segment = path = null;
- var hitResult = MaskProject.hitTest( event.point, hitOptions );
- if (!hitResult) return;
-
- if( event.modifiers.shift ){
- if (hitResult.type == 'segment') {
- hitResult.segment.remove();
- };
- return;
- };
- if( hitResult ){
- path = hitResult.item;
- if( hitResult.type == 'segment' ){
- segment = hitResult.segment;
- path.fullySelected = false;
- segment.selected = true;
- } else if( hitResult.type == 'stroke' ){
- var location = hitResult.location;
- segment = path.insert(location.index + 1, event.point);
- //path.smooth();
- path.fullySelected = false;
- segment.selected = true;
- } else if ( hitResult.type == 'fill' ){
- path.fullySelected = true;
- };
- }
- //movePath = ;
- //if( movePath ) MaskProject.activeLayer.addChild(hitResult.item);
-}
-
-function onMouseMove(event) {
- MaskProject.activeLayer.selected = false;
- if( event.item ) {
- //event.item.selected = true;
- event.item.fullySelected = true;
- };
-}
-
-function onMouseDrag(event) {
- if( segment ){
- //segment.point += event.delta;
- segment.point = event.point;
- //path.smooth();
- };
- //else if (path) {
- // path.position += event.delta;
- //}
-}
-var absDrawMapSizes = [[4096,4096],[2304,288]];
-var deviceMapScaling = 1.0;
-var deviceMapTopShift = 100;
-var deviceMapLeftShift = 100;
-var cMapImageWidth = 0;
-var cMapImageHeight = 0;
-var cMapCanvasWidth = 0;
-var cMapCanvasHeight = 0;
-var cMapType = 0;
-var cMaskLRF = 0;
-var cMaskID = 0;
-
-function SaveCurrentMask( NodeID, MaskID = 0, LRFID = 0 ){
- var serial = MaskProject.exportJSON();
- Ext.Ajax.request({
- url: '/lib/controller/uploadDeviceMask.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MID: MaskID,
- LID: LRFID,
- MDTA: serial,
- MIH: cMapImageHeight,
- MIW: cMapImageWidth,
- MSHX: deviceMapLeftShift,
- MSHY: deviceMapTopShift,
- DSTD: 1
- },
- success: function( response, opts ){
- //var data = Ext.decode(response.responseText);
- //hideMaskEditor();
- },
- failure: failureAJAXFunction
- });
-}
-
-
-function doMaskOperation( NodeID, Cmd, Mid = 0, LRFID = 0 ){
- Ext.Ajax.request({
- url: '/lib/controller/doMaskOperation.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- CMD: Cmd,
- MID: Mid,
- LID: LRFID
- },
- success: function( response, opts ){
- //var data = Ext.decode(response.responseText);
- //hideMaskEditor();
- },
- failure: failureAJAXFunction
- });
-}
-
-function showMaskEditor( fromDevTool, DevType, NodeID ){
- //alert( "DevType: "+DevType + " Dev Map size: "+ absDrawMapSizes[DevType][0]+"x"+absDrawMapSizes[DevType][1] );
- cMapType = DevType;
- if( DevType == 1 ){
- deviceMapScaling = ( window.screen.height * window.devicePixelRatio - 130 - ( deviceMapTopShift * 2 )) / absDrawMapSizes[DevType][1];
- } else {
- deviceMapScaling = ( window.screen.width * window.devicePixelRatio - 30 - ( deviceMapLeftShift * 2 )) / absDrawMapSizes[DevType][0];
- };
- cMapImageHeight = deviceMapScaling * absDrawMapSizes[DevType][1];
- cMapImageWidth = deviceMapScaling * absDrawMapSizes[DevType][0];
- cMapCanvasWidth = cMapImageWidth + (deviceMapLeftShift * 2);
- cMapCanvasHeight = cMapImageHeight + (deviceMapTopShift * 2);
- if( fromDevTool ){
- detectionProfileWindow.hide();
- };
- if(
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.mozFullScreenElement ||
- document.msFullscreenElement
- ){
- //fs mode allready
- hideMaskEditor();
- }else{
- if( maskEditorDiv == null ){
- maskEditorDiv = document.createElement("div");
- maskEditorDiv.style.height="200px";
- maskEditorDiv.style.width="200px";
- //var svg = document.getElementById('draw_svg_'+parseInt( NodeID ) );
- //var svgCode = window.btoa(svg.outerHTML);
- //maskEditorDiv.style.background = "url(data:image/svg+xml;base64," + svgCode + ")";
- //maskEditorDiv.style.background = 'solid red;';
- //maskEditorDiv.style.backgroundImage = "url('style/wicons/011.png')";
- //append div as a child to body
- document.body.appendChild( maskEditorDiv );
- //var elem = document.createElement("img"); 'getDeviceMap.php?NID='+NodeID
- //elem.setAttribute("src", "/lib/controller/data/device_draws/75c85fec4be204fc0bc0452f53b5a3df_map.png");
- //elem.setAttribute("height", "80%");
- //elem.setAttribute("width", "130");
- //maskEditorDiv.appendChild( elem );
- //alert( window.screen.width * window.devicePixelRatio + "x" + window.screen.height * window.devicePixelRatio);
- if( MEPanel == null ){
- var ww = window.screen.width * window.devicePixelRatio;
- var hh = window.screen.height * window.devicePixelRatio;
- MEPanel = new Ext.Panel( {
- title: 'Mask Editor',
- renderTo: maskEditorDiv,
- width: ww,
- height: hh,
- frame: true,
- autoScroll: true,
- items:[{
- xtype: 'panel',
- width: cMapCanvasWidth,
- html: '',
- listeners:{
- afterrender: function(){
- //Doing a custom svg here for background!
- var chicha = document.getElementById( 'popomas' );
- var svg = document.getElementById('draw_svg_'+parseInt( NodeID ) );
- var svgCode = window.btoa(svg.outerHTML);
- chicha.style.backgroundImage = "url(data:image/svg+xml;base64," + svgCode + ")";
- //chicha.style.backgroundImage = "url('style/wicons/011.png')";
- //alert( NodeID );
- /*
-
- var svg = document.querySelector('#svg');
- var svgCode = encodeURI(svg.outerHTML);
-
- element.style.backgroundImage = "url(data:image/svg+xml;utf8," + svgCode + ")";
-
- function set_gridSize (num) {
- num = Number(num);
-
- var xml = '
';
- var data = $($.parseXML(xml));
-
- var defs = data.children("svg").children("defs");
- defs.children("#smallGrid").attr({ height: num, width: num });
- var path = defs.children("#smallGrid").children().attr("d");
- var arr = path.split(" ");
- arr[1] = num;
- arr[arr.length - 1] = num;
- path = arr.join(" ");
- defs.children("#smallGrid").children("path").attr("d", path)
- defs.children("#grid").attr({ height: num * 10, width: num * 10 });
- defs.children("#grid").children("rect").attr({ height: num * 10, width: num * 10 });
- var path = defs.children("#grid").children("path").attr("d");
- var arr = path.split(" ");
- arr[1] = num*10;
- arr[arr.length - 1] = num*10;
- path = arr.join(" ");
- defs.children("#grid").children("path").attr("d", path);
-
- return "url(data:image/svg+xml;base64," + Base64.encode(new XMLSerializer().serializeToString(defs.parent()[0]))+")";
- }; */
- }
- }
- }],
- tbar:[{
- text:'New Polygone',
- id: 'me_b_newp',
- enableToggle: true,
- toggleGroup: 'me_topbar_grp',
- pressed: false,
- handler: function( btn ){
- if( btn.pressed ) setMaskEditorMode( 0 );
- }
- }/*,{
- text:'Delete Polygone',
- id: 'me_b_delp',
- enableToggle: true,
- toggleGroup: 'me_topbar_grp'
- },{
- text:'Delete Point',
- id: 'me_b_delpo',
- enableToggle: true,
- toggleGroup: 'me_topbar_grp'
- }*/,{
- text:'Clear Mask',
- id: 'me_b_delm',
- handler: function(){
- if( MaskProject!= null ){
- doMaskOperation( NodeID, 3, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- setMaskEditorMode( 0 );
- }
- },{
- text:'1',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: (cMaskID == 0 ),
- handler: function(){
- if( cMaskID != 0 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 0;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'2',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 1 ),
- handler: function(){
- if( cMaskID != 1 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 1;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'3',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 2 ),
- handler: function(){
- if( cMaskID != 2 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 2;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'4',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 3 ),
- handler: function(){
- if( cMaskID != 3 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 3;
- loadDeviceMask( NodeID, cMaskID );
- }
- },{
- text:'5',
- enableToggle: true,
- toggleGroup: 'me_maskbar_grp',
- pressed: ( cMaskID == 4 ),
- handler: function(){
- if( cMaskID != 4 ){
- SaveCurrentMask( NodeID, cMaskID );
- };
- MaskProject = new paper.Project( canvas );
- paper.view.draw();
- cMaskID = 4;
- loadDeviceMask( NodeID, cMaskID );
- }
- }],
- buttons:[{
- text: 'Cancel',
- handler: function(){
- hideMaskEditor();
- }
- },{
- text:'Save Mask and Close',
- handler: function(){
- var serial = MaskProject.exportJSON();
- Ext.Ajax.request({
- url: '/lib/controller/uploadDeviceMask.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MID: cMaskID,
- LID: 0,
- MDTA: serial,
- MIH: cMapImageHeight,
- MIW: cMapImageWidth,
- //MSF: deviceMapScaling,
- MSHX: deviceMapLeftShift,
- MSHY: deviceMapTopShift
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- hideMaskEditor();
- },
- failure: failureAJAXFunction
- });
- }
- }]
- });
- };
- MEPanel.doLayout();
- //if( MaskProject == null ){
- var canvas = document.getElementById('mask_canvas');
- paper.settings.handleSize = 10;
- MaskProject = new paper.Project( canvas );
- //canvas.addEventListener( 'mousemove', onMaskMouseMove );
- canvas.addEventListener( 'mousedown', onMaskMouseDown );
- //canvas.addEventListener( 'mouseup', onMaskMouseUp );
- //canvas.addEventListener( 'mousedrag', onMaskMouseMove );
- //};
- cMaskID = 0;
- loadDeviceMask( NodeID, cMaskID );
- };
- //maskEditorDiv = $('#container').get(0);
- //var maskEditorDiv = document.getElementById( id ); //Ext.getCmp( id );
- if( maskEditorDiv.requestFullscreen ){
- maskEditorDiv.requestFullscreen();
- }else if( maskEditorDiv.mozRequestFullScreen ){
- maskEditorDiv.mozRequestFullScreen();
- }else if( maskEditorDiv.webkitRequestFullscreen ){
- maskEditorDiv.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
- }else if( maskEditorDiv.msRequestFullscreen ){
- maskEditorDiv.msRequestFullscreen();
- };
- document.addEventListener( 'fullscreenchange', handleFSMaskEditorClose );
- };
-};
-
-function setMaskEditorMode( nM ){
- switch( nM ){
- case 0:{
- var MEP = Ext.getCmp('me_b_newp');
- if( !MEP.pressed ) MEP.toggle( true );
- var caca = document.getElementById('mask_canvas');
- caca.style.cursor = 'crosshair';
- break;
- };
- case 1:{
- var MEP = Ext.getCmp('me_b_newp');
- if( !MEP.pressed ) MEP.toggle( false );
- //MEP = Ext.getCmp('me_b_delp');
- //if( !MEP.pressed ) MEP.toggle( false );
- //MEP = Ext.getCmp('me_b_delpo');
- //if( !MEP.pressed ) MEP.toggle( false );
- if( MaskProject!= null ){
- if( MaskProject.isEmpty() ){
- //MEP = Ext.getCmp('me_b_delp');
- //MEP.disable();
- //MEP = Ext.getCmp('me_b_delpo');
- //MEP.disable();
- MEP = Ext.getCmp('me_b_delm');
- MEP.disable();
- setMaskEditorMode( 0 );
- } else {
- //MEP = Ext.getCmp('me_b_delp');
- //MEP.enable();
- //MEP = Ext.getCmp('me_b_delpo');
- //MEP.enable();
- MEP = Ext.getCmp('me_b_delm');
- MEP.enable();
- };
- };
- var caca = document.getElementById('mask_canvas');
- caca.style.cursor = 'default';
- break;
- };
- case 2:{
- //var MEP = Ext.getCmp('me_b_delp');
- //if( !MEP.pressed ) MEP.toggle( true );
- break;
- };
- case 3:{
- //var MEP = Ext.getCmp('me_b_delpo');
- //if( !MEP.pressed ) MEP.toggle( true );
- break;
- };
- case 4:{
-
- };
- };
- MaskEditorMode = nM;
-};
-
-function loadDeviceMask( NodeID, LayerID = 0, LrfID = 0 ){
- Ext.Ajax.request({
- url: '/lib/controller/getDeviceMask.php',
- params: {
- NID: NodeID,
- UID: '=$CUser->Data['id'];?>',
- SID: '=$Session;?>',
- MID: LayerID,
- LID: LrfID
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
-
- if( data.length > 0 ){
- for( i = 0; i < data.length; i++ ){
- //var
- path = new paper.Path();
- path.strokeColor = 'black';
- //var lightness = (Math.random() - 0.5) * 0.4 + 0.4;
- //var hue = Math.random() * 360;
- //path.fillColor = { hue: hue, saturation: 1, lightness: lightness };
- path.fillColor = data[i].colour;
- path.closed = true;
- path.opacity = 0.5;
- //path.onMouseMove = onMouseMove;
- path.onMouseDown = onMouseDown;
- path.onMouseDrag = onMouseDrag;
- //path.onMouseUp = function( event ){
- // path.add(event.point);
- //}
- if( data[i].points.length > 2 ){
- if( cMapType == 1 ){
- var tX = data[i].points[0][0] * deviceMapScaling + deviceMapLeftShift;
- var tY = data[i].points[0][1] * deviceMapScaling + deviceMapTopShift;
- path.moveTo( [tX,tY] );
- for(k = 1; k < data[i].points.length; k++ ){
- tX = data[i].points[k][0] * deviceMapScaling + deviceMapLeftShift;
- tY = data[i].points[k][1] * deviceMapScaling + deviceMapTopShift;
- path.lineTo( [tX,tY] );
- };
- } else {
- var tX = ( 2047 + parseInt( data[i].points[0][0]) ) * deviceMapScaling + deviceMapLeftShift;
- var tY = ( 2047 + parseInt( data[i].points[0][1]) ) * deviceMapScaling + deviceMapTopShift;
- path.moveTo( [tX,tY] );
- for(k = 1; k < data[i].points.length; k++ ){
- tX = ( 2047 + parseInt(data[i].points[k][0]) ) * deviceMapScaling + deviceMapLeftShift;
- tY = ( 2047 + parseInt(data[i].points[k][1]) ) * deviceMapScaling + deviceMapTopShift;
- path.lineTo( [tX,tY] );
- };
- };
- path.fullySelected = true;
- paper.view.draw();
- };
- poligones.push(path);
- setMaskEditorMode( 4 );
- };
- } else {
- setMaskEditorMode( 0 );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function onMaskMouseDown( evt ){
- switch( MaskEditorMode ){
- case 0:{
- path = new paper.Path();
- path.strokeColor = 'black';
- path.fillColor = '#ff8020';
- path.onMouseDown = onMouseDown;
- path.onMouseDrag = onMouseDrag;
- //path.onMouseMove = onMouseMove;
- path.fullySelected = true;
- path.closed = true;
- path.opacity = 0.5;
- path.moveTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- setMaskEditorMode( 1 );
- break;
- };
- case 1:{
- path.lineTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- if( path.segments.length == 3 ){
- setMaskEditorMode( 4 );
- };
- };
- };
- //if( MaskEditorMode == 0 ){
- //
- //} else {
- // path.lineTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- //};
-};
-
-function onMaskMouseUp( evt ){
- if( MaskEditorMode == 4 ){
- //path.lineTo( [ evt.pageX - $(document).scrollLeft() - $('#mask_canvas').offset().left, evt.pageY - $(document).scrollTop() - $('#mask_canvas').offset().top ] );
- path.fullySelected = true;
- path.onMouseDown = onMouseDown;
- path.onMouseDrag = onMouseDrag;
- paper.view.draw();
- //poligones.push( path );
- setMaskEditorMode( 1 );
- };
-};
-
-function onMaskMouseMove( event ){
- if( MaskEditorMode == 4 ){
- //paper.view.draw();
- };
-};
-
-
-
diff --git a/lib/javascript/jsapi_dynamic/rgoose_location_editor.js b/lib/javascript/jsapi_dynamic/rgoose_location_editor.js
deleted file mode 100644
index 735a40a..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_location_editor.js
+++ /dev/null
@@ -1,1255 +0,0 @@
-//
-
-
-var map = null;
-var markers = [];
-
-function Events() {
- this.events = { };
-}
-
-Events.prototype.on = function(name, fn) {
- var events = this.events[name];
- if (events == undefined) {
- this.events[name] = [ fn ];
- this.emit('event:on', fn);
- } else {
- if (events.indexOf(fn) == -1) {
- events.push(fn);
- this.emit('event:on', fn);
- }
- }
- return this;
-}
-
-Events.prototype.once = function(name, fn) {
- var events = this.events[name];
- fn.once = true;
- if (!events) {
- this.events[name] = [ fn ];
- this.emit('event:once', fn);
- } else {
- if (events.indexOf(fn) == -1) {
- events.push(fn);
- this.emit('event:once', fn);
- }
- }
- return this;
-}
-
-Events.prototype.emit = function(name, args) {
- var events = this.events[name];
- if (events) {
- var i = events.length;
- while(i--) {
- if (events[i]) {
- events[i].call(this, args);
- if (events[i].once) {
- delete events[i];
- }
- }
- }
- }
- return this;
-}
-
-Events.prototype.unbind = function(name, fn) {
- if (name) {
- var events = this.events[name];
- if (events) {
- if (fn) {
- var i = events.indexOf(fn);
- if (i != -1) {
- delete events[i];
- }
- } else {
- delete this.events[name];
- }
- }
- } else {
- delete this.events;
- this.events = { };
- }
- return this;
-}
-
-var userPrefix;
-
-var prefix = (function () {
- var styles = window.getComputedStyle(document.documentElement, ''),
- pre = (Array.prototype.slice
- .call(styles)
- .join('')
- .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
- )[1],
- dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1];
- userPrefix = {
- dom: dom,
- lowercase: pre,
- css: '-' + pre + '-',
- js: pre[0].toUpperCase() + pre.substr(1)
- };
-})();
-
-function bindEvent(element, type, handler) {
- if(element.addEventListener) {
- element.addEventListener(type, handler, false);
- } else {
- element.attachEvent('on' + type, handler);
- }
-}
-
-function Viewport(data) {
- events.add( this );
-
- var self = this;
-
- this.element = data.element;
- this.fps = data.fps;
- this.sensivity = data.sensivity;
- this.sensivityFade = data.sensivityFade;
- this.touchSensivity = data.touchSensivity;
- this.speed = data.speed;
-
- this.lastX = 0;
- this.lastY = 0;
- this.mouseX = 0;
- this.mouseY = 0;
- this.distanceX = 0;
- this.distanceY = 0;
- this.positionX = 0;
- this.positionY = 0;
- this.positionZ = 0;
- this.torqueX = 0;
- this.torqueY = 0;
-
- this.down = false;
- this.upsideDown = false;
-
- this.previousPositionX = 0;
- this.previousPositionY = 0;
- this.previousPositionZ = 0;
-
- this.currentSide = 0;
- this.calculatedSide = 0;
-
-
- bindEvent(data.element /*document*/, 'mousedown', function() { self.down = true; });
-
- bindEvent(data.element, 'mouseup', function() { self.down = false; });
-
- bindEvent(data.element, 'keyup', function() { self.down = false; });
-
- bindEvent(data.element, 'mousemove', function(e) { self.mouseX = e.pageX; self.mouseY = e.pageY; });
-
- bindEvent(data.element, 'touchstart', function(e) {
- self.down = true;
- e.touches ? e = e.touches[0] : null;
- self.mouseX = e.pageX / self.touchSensivity;
- self.mouseY = e.pageY / self.touchSensivity;
- self.lastX = self.mouseX;
- self.lastY = self.mouseY;
- });
-
- bindEvent(data.element, 'touchmove', function(e) {
- if(e.preventDefault) {
- e.preventDefault();
- }
-
- if(e.touches.length == 1) {
-
- e.touches ? e = e.touches[0] : null;
-
- self.mouseX = e.pageX / self.touchSensivity;
- self.mouseY = e.pageY / self.touchSensivity;
-
- }
- });
-
- bindEvent(data.element, 'touchend', function(e) {
- self.down = false;
- });
-
- setInterval(this.animate.bind(this), this.fps);
-
-}
-
-
-var events = new Events();
-
-events.add = function(obj) {
- obj.events = { };
-}
-
-events.implement = function(fn) {
- fn.prototype = Object.create(Events.prototype);
-}
-
-
-
-events.implement(Viewport);
-
-Viewport.prototype.animate = function() {
-
- this.distanceX = (this.mouseX - this.lastX);
- this.distanceY = (this.mouseY - this.lastY);
-
- this.lastX = this.mouseX;
- this.lastY = this.mouseY;
-
- if(this.down) {
- this.torqueX = this.torqueX * this.sensivityFade + (this.distanceX * this.speed - this.torqueX) * this.sensivity;
- this.torqueY = this.torqueY * this.sensivityFade + (this.distanceY * this.speed - this.torqueY) * this.sensivity;
- }
-
- if(Math.abs(this.torqueX) > 1.0 || Math.abs(this.torqueY) > 1.0) {
- if(!this.down) {
- this.torqueX *= this.sensivityFade;
- this.torqueY *= this.sensivityFade;
- }
-
- this.positionY -= this.torqueY;
-
- if(this.positionY > 360) {
- this.positionY -= 360;
- } else if(this.positionY < 0) {
- this.positionY += 360;
- }
-
- if(this.positionY > 90 && this.positionY < 270) {
- this.positionX -= this.torqueX;
-
- if(!this.upsideDown) {
- this.upsideDown = true;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
-
- } else {
-
- this.positionX += this.torqueX;
-
- if(this.upsideDown) {
- this.upsideDown = false;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
- }
-
- if(this.positionX > 360) {
- this.positionX -= 360;
- } else if(this.positionX < 0) {
- this.positionX += 360;
- }
-
- if(!(this.positionY >= 46 && this.positionY <= 130) && !(this.positionY >= 220 && this.positionY <= 308)) {
- if(this.upsideDown) {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 3;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 2;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 5;
- } else {
- this.calculatedSide = 4;
- }
- } else {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 5;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 4;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 3;
- } else {
- this.calculatedSide = 2;
- }
- }
- } else {
- if(this.positionY >= 46 && this.positionY <= 130) {
- this.calculatedSide = 6;
- }
-
- if(this.positionY >= 220 && this.positionY <= 308) {
- this.calculatedSide = 1;
- }
- }
-
- if(this.calculatedSide !== this.currentSide) {
- this.currentSide = this.calculatedSide;
- this.emit('sideChange');
- }
-
- }
-
- this.element.style[userPrefix.js + 'Transform'] = 'rotateX(' + this.positionY + 'deg) rotateY(' + this.positionX + 'deg) rotateZ('+this.positionZ + 'deg)';
-
- if(this.positionY != this.previousPositionY || this.positionX != this.previousPositionX || this.positionZ != this.previousPositionZ ) {
- this.previousPositionY = this.positionY;
- this.previousPositionX = this.positionX;
- this.previousPositionZ = this.positionZ;
- this.emit('rotate');
- }
-
-}
-
-Viewport.prototype.setDirect = function( A, B, C ) {
-
- if( 1 ) {
-
- this.positionX = A;
- this.positionY = B;
- this.positionZ = C;
-
- if(this.positionY > 360) {
- this.positionY -= 360;
- } else if(this.positionY < 0) {
- this.positionY += 360;
- }
-
- if(this.positionY > 90 && this.positionY < 270) {
- if(!this.upsideDown) {
- this.upsideDown = true;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
- } else {
- if(this.upsideDown) {
- this.upsideDown = false;
- this.emit('upsideDown', { upsideDown: this.upsideDown });
- }
- }
-
- if(this.positionX > 360) {
- this.positionX -= 360;
- } else if(this.positionX < 0) {
- this.positionX += 360;
- }
-
- if(!(this.positionY >= 46 && this.positionY <= 130) && !(this.positionY >= 220 && this.positionY <= 308)) {
- if(this.upsideDown) {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 3;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 2;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 5;
- } else {
- this.calculatedSide = 4;
- }
- } else {
- if(this.positionX >= 42 && this.positionX <= 130) {
- this.calculatedSide = 5;
- } else if(this.positionX >= 131 && this.positionX <= 223) {
- this.calculatedSide = 4;
- } else if(this.positionX >= 224 && this.positionX <= 314) {
- this.calculatedSide = 3;
- } else {
- this.calculatedSide = 2;
- }
- }
- } else {
- if(this.positionY >= 46 && this.positionY <= 130) {
- this.calculatedSide = 6;
- }
-
- if(this.positionY >= 220 && this.positionY <= 308) {
- this.calculatedSide = 1;
- }
- }
-
- if(this.calculatedSide !== this.currentSide) {
- this.currentSide = this.calculatedSide;
- this.emit('sideChange');
- }
-
- }
-
- this.element.style[userPrefix.js + 'Transform'] = 'rotateX(' + this.positionY + 'deg) rotateY(' + this.positionX + 'deg) rotateZ('+this.positionZ + 'deg)';
-
- if(this.positionY != this.previousPositionY || this.positionX != this.previousPositionX || this.positionZ != this.previousPositionZ ) {
- this.previousPositionY = this.positionY;
- this.previousPositionX = this.positionX;
- this.previousPositionZ = this.positionZ;
- this.emit('rotate');
- }
-}
-
-
-
-function Cube(data) {
- var self = this;
-
- this.element = data.element;
- this.sides = this.element.getElementsByClassName('side');
-
- this.viewport = data.viewport;
- this.viewport.on('rotate', function() {
- self.rotateSides();
- });
- this.viewport.on('upsideDown', function(obj) {
- self.upsideDown(obj);
- });
- this.viewport.on('sideChange', function() {
- self.sideChange();
- });
-}
-
-Cube.prototype.rotateSides = function() {
- var viewport = this.viewport;
- if(viewport.positionY > 90 && viewport.positionY < 270) {
- this.sides[0].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + (viewport.positionX + viewport.torqueX) + 'deg)';
- this.sides[5].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + -(viewport.positionX + 180 + viewport.torqueX) + 'deg)';
- } else {
- this.sides[0].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + (viewport.positionX - viewport.torqueX) + 'deg)';
- this.sides[5].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + -(viewport.positionX + 180 - viewport.torqueX) + 'deg)';
- }
-}
-
-Cube.prototype.upsideDown = function(obj) {
-
- var deg = (obj.upsideDown == true) ? '180deg' : '0deg';
- var i = 5;
-
- while(i > 0 && --i) {
- this.sides[i].getElementsByClassName('cube-image')[0].style[userPrefix.js + 'Transform'] = 'rotate(' + deg + ')';
- }
-
-}
-
-Cube.prototype.sideChange = function() {
-
- for(var i = 0; i < this.sides.length; ++i) {
- this.sides[i].getElementsByClassName('cube-image')[0].className = 'cube-image';
- }
-
- this.sides[this.viewport.currentSide - 1].getElementsByClassName('cube-image')[0].className = 'cube-image active';
-
-}
-
-Cube.prototype.set = function( A, B, C ) {
- //C = C + 90.0;
- this.viewport.setDirect( A, B, C );
-}
-
-//var viewport = new Viewport({
-// element: document.getElementsByClassName('cube')[0],
-// fps: 20,
-// sensivity: .1,
-// sensivityFade: .93,
-// speed: 2,
-// touchSensivity: 1.5
-//});
-
-//new Cube({
-// viewport: viewport,
-// element: document.getElementsByClassName('cube')[0]
-//});
-
-
-
-
-
-var LRF3D_Icon = L.icon({
- iconUrl: '/style/assets/5_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var LFS_Icon = L.icon({
- iconUrl: '/style/assets/2_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PLS200_Icon = L.icon({
- iconUrl: '/style/assets/3_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PLSNET200_Icon = L.icon({
- iconUrl: '/style/assets/6_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PLS360_Icon = L.icon({
- iconUrl: '/style/assets/4_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var ALS_Icon = L.icon({
- iconUrl: '/style/assets/1_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var PTZCAM_Icon = L.icon({
- iconUrl: '/style/assets/12_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var FIXCAM_Icon = L.icon({
- iconUrl: '/style/assets/11_node.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [64, 64], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
-});
-
-var SITEZ_Icon = L.icon({
- iconUrl: '/style/assets/centre_1.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [32, 32], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
-});
-
-var SNAPE_Icon = L.icon({
- iconUrl: '/style/assets/cursor.png',
- //shadowUrl: 'leaf-shadow.png',
- iconSize: [32, 32], // size of the icon
- //shadowSize: [50, 64], // size of the shadow
- iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
- //shadowAnchor: [4, 62], // the same for the shadow
- popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
-});
-
-var locationSelectedNode = 0;
-function loadLoactionProps( e ){
- if( typeof e == 'number' ){
- locationSelectedNode = e;
- } else {
- locationSelectedNode = e.sourceTarget.options.mycustomid;
- }
- loadNodeLocationProps( locationSelectedNode );
-};
-
-function updateSiteAnchor(){
- SiteLat = Ext.getCmp('siteLat').getValue();
- SiteLon = Ext.getCmp('siteLon').getValue();
- SiteAlt = Ext.getCmp('siteAlt').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 1,
- SID: '=$Session;?>',
- LAT: SiteLat,
- LON: SiteLon,
- ALT: SiteAlt
- },
- failure: failureAJAXFunction
- });
-};
-
-function updateLocationOrientation(){
- var tLat = Ext.getCmp('slat').getValue();
- var tLon = Ext.getCmp('slon').getValue();
- var tAlt = Ext.getCmp('salt').getValue();
- var tRoll = Ext.getCmp('sroll').getValue();
- var tPitch = Ext.getCmp('spitch').getValue();
- var tYaw = Ext.getCmp('syaw').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- UID: =$UserID;?>,
- TYPE: 2,
- SID: '=$Session;?>',
- LAT: tLat,
- LON: tLon,
- ALT: tAlt,
- YAW: tYaw,
- ROLL: tRoll,
- PITCH: tPitch
- },
- failure: failureAJAXFunction
- });
-};
-
-var iconSaver = null;
-var markerSaver = null;
-
-function updateLocation( e ){
- locationSelectedNode = e.target.options.mycustomid;
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 0,
- SID: '=$Session;?>',
- LAT: e.target._latlng.lat,
- LON: e.target._latlng.lng
- },
- success: function( response, opts ){
- loadNodeLocationProps( locationSelectedNode );
- },
- failure: failureAJAXFunction
- });
-};
-
-function markerDblClick( e ){
- if( iconSaver == null ){
- iconSaver = e.target.options.icon;
- markerSaver = e.target;
- e.target.setIcon( SNAPE_Icon );
- for( i=0; i< markers.length; i++){
- if( markers[i].options.mycustomid != e.target.options.mycustomid ){
- markers[i].setOpacity( 0.1 );
- } else {
- markers[i].setOpacity( 1.0 );
- }
- };
- } else {
- if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
- e.target.setIcon( iconSaver );
- iconSaver = null;
- markerSaver = null;
- for( i=0; i< markers.length; i++){
- markers[i].setOpacity( 1.0 );
- };
- } else {
- markerSaver.setIcon( iconSaver );
- iconSaver = e.target.options.icon;
- markerSaver = e.target;
- e.target.setIcon( SNAPE_Icon );
- for( i=0; i< markers.length; i++){
- if( markers[i].options.mycustomid != e.target.options.mycustomid ){
- markers[i].setOpacity( 0.1 );
- } else {
- markers[i].setOpacity( 1.0 );
- }
- };
- };
- };
-};
-
-function setNodeLocationToAnchor(){
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 0,
- SID: '=$Session;?>',
- LAT: SiteLat,
- LON: SiteLon,
- ALT: SiteAlt
- },
- success: function( response, opts ){
- loadLocationEditor();
- },
- failure: failureAJAXFunction
- });
-};
-
-function setNodeLocationByDelta(){
- var dx = Ext.getCmp('dx').getValue();
- var dy = Ext.getCmp('dy').getValue();
- var dz = Ext.getCmp('dz').getValue();
- Ext.Ajax.request({
- url: '/lib/controller/updateLocation.php',
- params: {
- NODE: locationSelectedNode,
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- TYPE: 3,
- SID: '=$Session;?>',
- LAT: dx,
- LON: dy,
- ALT: dz
- },
- success: function( response, opts ){
- loadLocationEditor();
- },
- failure: failureAJAXFunction
- });
-};
-
-
-function loadLocationNodes(){
- Ext.Ajax.request({
- url: '/lib/controller/getLocationItems.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- for( i=0; i < data.length; i++){
- switch( data[i].type ){
- case 1:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 2:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 3:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 4:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 5:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 6:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 10:
- case 12:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- case 11:
- case 13:{
- markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
- break;
- };
- };
- //bindPopup('A pretty CSS3 popup.
Easily customizable.');//.openPopup();
- };
- },
- failure: function( response, opts ) {
- var tPanel = Ext.getCmp('main_portal');
- tPanel.remove(0);
- tPanel.add( { html: 'Failed to load dashboard!' } );
- tPanel.doLayout();
- }
- });
-};
-
-var orientationEditorWindow = null;
-var cubeViewport = null;
-var cube = null;
-var curX = 0;
-var curY = 0;
-var curZ = 0;
-var bk_upd = false;
-
-
-function setCubeOrientation( A, B, C ){
- if( bk_upd ) return;
- bk_upd = true;
- curX = A;
- curY = B;
- curZ = C;
- var t = Ext.getCmp('roll_sld');
- t.setValue( A );
- t = Ext.getCmp('roll');
- t.setValue( A );
- t = Ext.getCmp('pitch_sld');
- t.setValue( B );
- t = Ext.getCmp('pitch');
- t.setValue( B );
- t = Ext.getCmp('yaw_sld');
- t.setValue( C );
- t = Ext.getCmp('yaw');
- t.setValue( C );
- if( cube != null ) cube.set( curX, curY, curZ );
- bk_upd = false;
-};
-
-function orientationEditor(){
- if( orientationEditorWindow == null ){
- orientationEditorWindow = new Ext.Window({
- modal: true,
- title: 'Orientation',
- closeAction: 'hide',
- width: 640,
- height: 500,
- items:[{
- layout: 'table',
- defaults: {
- bodyStyle:'padding:5px'
- },
- layoutConfig: {
- columns: 3
- },
- items:[{
- html: 'Roll:'
- },{
- xtype: 'textfield',
- id: 'roll',
- name: 'roll',
- value: 30.0029,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( nv / 1.0, curY, curZ );
- }
- }
- },{
- xtype: 'slider',
- id: 'roll_sld',
- width: 200,
- value: 30.0029,
- minValue: -180.0,
- maxValue: 180.0,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( nv, curY, curZ );
- }
- }
- },{
- html: 'Pitch:'
- },{
- xtype: 'textfield',
- id: 'pitch',
- name: 'pitch',
- value: 30.0029,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( curX, nv / 1.0, curZ );
- }
- }
- },{
- xtype: 'slider',
- id: 'pitch_sld',
- width: 200,
- value: 30.0029,
- minValue: -180.0,
- maxValue: 180.0,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( curX, nv, curZ );
- }
- }
- },{
- html: 'Yaw:'
- },{
- xtype: 'textfield',
- id: 'yaw',
- name: 'yaw',
- value: 30.0029,
- listeners:{
- change: function( sl, nv, tt ){
- //alert( nv );
- setCubeOrientation( curX, curY, nv / 1.0 );
- }
- }
- },{
- xtype: 'slider',
- id: 'yaw_sld',
- width: 200,
- value: 30.0029,
- minValue: -180.0,
- maxValue: 180.0,
- listeners:{
- change: function( sl, nv, tt ){
- setCubeOrientation( curX, curY, nv );
- }
- }
- }]
- },{
- html: '
'
- }],
- buttons:[{
- text: 'Cancel',
- width: 200,
- handler: function(){
- orientationEditorWindow.hide();
- }
- },{
- text: 'Apply',
- width: 200,
- handler: function(){
- Ext.getCmp('sroll').setValue( Ext.getCmp('roll').getValue() );
- Ext.getCmp('spitch').setValue( Ext.getCmp('pitch').getValue() );
- Ext.getCmp('syaw').setValue( Ext.getCmp('yaw').getValue() );
- orientationEditorWindow.hide();
- }
- }]
- });
-
- orientationEditorWindow.show();
-
- cubeViewport = new Viewport({
- element: document.getElementsByClassName('cube')[0],
- fps: 20,
- sensivity: .1,
- sensivityFade: .93,
- speed: 2,
- touchSensivity: 1.5
- });
-
- cube = new Cube({
- viewport: cubeViewport,
- element: document.getElementsByClassName('cube')[0]
- });
- } else {
- orientationEditorWindow.show();
- };
- setCubeOrientation( Ext.getCmp('sroll').getValue(), Ext.getCmp('spitch').getValue(), Ext.getCmp('syaw').getValue() );
-};
-
-
-function loadNodeLocationProps( NodeID ){
- //alert( 'Node: ' + NodeID );
- Ext.Ajax.request({
- url: '/lib/controller/getLocationNodeProps.php',
- params: {
- NID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NODE: NodeID
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( data );
- tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-function LoadNodesList(){
- Ext.Ajax.request({
- url: '/lib/controller/getLocationNodes.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( data );
- tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-
-function loadLocationEditor(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( '=$Labels->GetLabel('_LOC_MAP_LBL_');?>' );
- tPanel.add({
- columnWidth: 0.83,
- frame: false,
- border: false,
- items: [{
- layout: 'fit',
- height: PanelH-150,
- flex: 1,
- //border: true,
- items:{
- id: 'location_map'
- }
- },{
- layout: 'table',
- title: '=$Labels->GetLabel('_SITE_PROP_LBL_');?>',
- flex: 1,
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- // The total column count must be specified here
- columns: 7,
- textAlign: 'center'
- },
- items:[{
- html: '=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> =$Labels->GetLabel('_LAT_SHORT_LBL_');?>:'
- },{
- xtype: 'textfield',
- id: 'siteLat',
- value: SiteLat
- },{
- html: '=$Labels->GetLabel('_LON_SHORT_LBL_');?>:'
- },{
- xtype: 'textfield',
- id: 'siteLon',
- value: SiteLon
- },{
- html: '=$Labels->GetLabel('_ALT_SHORT_LBL_');?>:'
- },{
- xtype: 'textfield',
- id: 'siteAlt',
- value: SiteAlt
- },{
- xtype: 'button',
- text: '=$Labels->GetLabel('_UPDATE_LBL_');?>',
- handler: updateSiteAnchor
- },{
- html: '=$Labels->GetLabel('_MAP_TYP_LBL_');?>:'
- },{
- xtype: 'radio',
- name: 'map_type',
- boxLabel: '=$Labels->GetLabel('_MAP_REG_LBL_');?>',
- checked: true,
- value: 0
- },{
- xtype: 'radio',
- name: 'map_type',
- boxLabel: '=$Labels->GetLabel('_MAP_CUST_LBL_');?>',
- colspan: 2,
- value: 1
- },{
- xtype: 'combo',
- disabled: true,
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- colspan: 2,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['myId', 'displayText' ],
- data: [[1, 'item1'], [2, 'item2']]
- }),
- valueField: 'myId',
- displayField: 'displayText'
- },{
-
- xtype: 'button',
- id: 'add-c_map-btn',
- disabled: true,
- text: '=$Labels->GetLabel('_CREATE_NEW_LBL_');?>'
- }]
- }]
- });
- tPanel.add({
- title: 'Properties',
- xtype: 'panel',
- flex: 1,
- height: 700,
- columnWidth: 0.17,
- layout: 'fit',
- id: 'prop_content',
- items:[{
- html:'
=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
- }]
- });
- tPanel.doLayout();
- map = L.map('location_map',{
- attributionControl: true,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- }).setView([SiteLat, SiteLon], 17);
- L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map).on('click', LoadNodesList ).bindPopup("
=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");//.openPopup();
- var mapLayers = [];
-
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '©
OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles ©
Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data ©
OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: ©
OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: ©
OpenTopoMap (
CC-BY-SA ) ',
- maxZoom: 19
- });
- /*
- mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps ©
Thunderforest , Data ©
OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps ©
Thunderforest , Data ©
OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps ©
Thunderforest , Data ©
OpenStreetMap contributors ',
- maxZoom: 22
- });
- */
-
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- L.control.layers( baseMaps ).addTo(map);
-
- mapLayers["MyMap"].addTo(map);
- /*
- Ext.Ajax.request({
- url: '/lib/controller/getNetwork.php',
- params: {
- NID: selectedSite,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- /*
- layout: { improvedLayout: false }
- physics: { enabled: true}
-
- For the node, set a property called fixed:
-
- fixed: { x: true , y: true }
- Here is the son of the node:
-
- {id: 1, value: 2, label: 'xx' , x: 320, y:170 , fixed: { x: true , y: true } }
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- netwodkData.nodes = new vis.DataSet( data.nodes );
- netwodkData.edges = new vis.DataSet( data.edges );
- //map.createPane( 'my_network' );
- //map.getPane('my_network').style.zIndex = 1650;
- //map.getPane('my_network').style.pointerEvents = 'none';
- //map.getPane('my_network').innerHTML = "
";
- //var container = document.getElementById(Ext.getCmp('net_cont').body.id);
- //var container = document.getElementById( 'net_cont' );
- var container =map.getPane('markerPane');
- networkObj = new vis.Network( container, netwodkData, networkOpts );
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- }
- });
- */
-/*
-var map = L.map('map', {
- crs: L.CRS.Simple
-});
-
-var map = L.map('map', {
- crs: L.CRS.Simple,
- minZoom: -5
-});
-
-var bounds = [[0,0], [1000,1000]];
-var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
-
-var bounds = [[-26.5,-25], [1021.5,1023]];
-var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
-
-map.fitBounds(bounds);
-
-var sol = L.latLng([ 145, 175.2 ]);
-L.marker(sol).addTo(map);
-map.setView( [70, 120], 1);
-
-var travel = L.polyline([sol, deneb]).addTo(map);
-
-
-
-L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
- attribution: 'Map data ©
OpenStreetMap contributors, Imagery ©
Mapbox ',
- maxZoom: 18,
- id: 'mapbox/streets-v11',
- tileSize: 512,
- zoomOffset: -1,
- accessToken: 'your.mapbox.access.token'
-}).addTo(mymap);
-
-var circle = L.circle([51.508, -0.11], {
- color: 'red',
- fillColor: '#f03',
- fillOpacity: 0.5,
- radius: 500
-}).addTo(mymap);
-
-var polygon = L.polygon([
- [51.509, -0.08],
- [51.503, -0.06],
- [51.51, -0.047]
-]).addTo(mymap);
-marker.bindPopup("
Hello world! I am a popup.").openPopup();
-circle.bindPopup("I am a circle.");
-polygon.bindPopup("I am a polygon.");
-
-
-function onMapClick(e) {
- alert("You clicked the map at " + e.latlng);
-}
-
-mymap.on('click', onMapClick);
-
-
-*/
-
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '©
OpenStreetMap contributors'
- }).addTo(map);
-
- loadLocationNodes();
-};
diff --git a/lib/javascript/jsapi_dynamic/rgoose_main.js b/lib/javascript/jsapi_dynamic/rgoose_main.js
deleted file mode 100644
index e30fc79..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_main.js
+++ /dev/null
@@ -1,479 +0,0 @@
-//
-
-function ssShowSS() {
- ssStopTimer();
- document.removeEventListener( "mousemove", ssResetTimer );
- document.removeEventListener( "mousedown", ssResetTimer );
- document.removeEventListener( "keypress", ssResetTimer );
- document.removeEventListener( "touchmove", ssResetTimer );
-
- document.addEventListener( "mousemove", ssHideSS, false );
- document.addEventListener( "mousedown", ssHideSS, false );
- document.addEventListener( "keypress", ssHideSS, false );
- document.addEventListener( "touchmove", ssHideSS, false );
- document.getElementById('ss_bg').className='ss_bg_overlay';
- document.getElementById('ss_content').className='ss_overlay';
- ssShowTime();
- if( ssInterval == null ){
- ssInterval = window.setInterval( ssShowTime, 333 );
- };
- ssIsActive = true;
-};
-function ssShowTime(){
- document.getElementById('ss_content').style.fontSize = '240px';
- var currentdate = new Date();
- var cTime = (( currentdate.getHours()<10 )? '0'+currentdate.getHours(): currentdate.getHours() ) + ":" + (( currentdate.getMinutes()<10 )? '0'+currentdate.getMinutes(): currentdate.getMinutes() ) + ":" + (( currentdate.getSeconds()<10 )? '0'+currentdate.getSeconds(): currentdate.getSeconds() );
- document.getElementById('ss_content').innerHTML= cTime;
-};
-function ssResetTimer() {
- ssStopTimer();
- ssStartTimer();
-};
-
-function ssStartTimer() {
- if( ssTimer == null ){
- ssTimer = window.setTimeout( ssShowSS, ssTimeOut );
- };
-};
-function ssStopTimer() {
- if( ssTimer ){
- window.clearTimeout( ssTimer );
- ssTimer = null;
- };
-};
-
-function ssSetupTimer() {
- document.addEventListener( "mousemove", ssResetTimer, false);
- document.addEventListener( "mousedown", ssResetTimer, false);
- document.addEventListener( "keypress", ssResetTimer, false);
- document.addEventListener( "touchmove", ssResetTimer, false);
- ssStartTimer();
-};
-
-function ssHideSS(){
- document.getElementById('ss_bg').className='ss_hidden';
- document.getElementById('ss_content').className='ss_hidden';
- document.removeEventListener( "mousemove", ssHideSS );
- document.removeEventListener( "mousedown", ssHideSS );
- document.removeEventListener( "keypress", ssHideSS );
- document.removeEventListener( "touchmove", ssHideSS );
- if( ssInterval != null ){
- window.clearInterval( ssInterval );
- ssInterval = null;
- };
- ssSetupTimer();
- ssIsActive = false;
-};
-
-
-
-var sndBeep = new Howl({
- src: [
- '/style/assets/audio/beep-07a.mp3',
- '/style/assets/audio/beep-07a.wav'
- ],
- loop: false,
- volume: 0.99,
- onend: function() {
- //console.log('Finished!');
- }
-});
-var sndExcl = new Howl({
- src: [
- '/style/assets/audio/button-42.mp3',
- '/style/assets/audio/button-42.wav'
- ],
- loop: false,
- volume: 0.99
-});
-
-function playSound( t ){
- if( SoundEnable ){
- switch( t ){
- case 1:{
- sndBeep.play();
- break;
- };
- default:{
- sndExcl.play();
- };
- };
- };
-};
-
-function doRefresh(){
- window.location="/?t="+123;
-};
-
-function doLogout(){
- window.location = '/login.php?UID=1';
-};
-
-function stopStatusUpdater(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- };
-};
-
-function failureAJAXFunction( responce, opts ){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- };
- playSound();
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_REQ_FAILURE_');?>',
- msg: '=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- doLogout();
-};
-
-function updateUserScreenResolution( x, y ){
- Ext.Ajax.request({
- url: '/lib/controller/updateUserSettings.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- SSS: 15,
- WID: x,
- HEI: y
- },
- success: function( response, opts ){
- doRefresh();
- },
- failure: failureAJAXFunction
- });
-};
-
-function setUserContent( c_id ){
- initView = c_id;
- Ext.Ajax.request({
- url: '/lib/controller/updateUserSettings.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- SSS: 26,
- CID: initView
- },
- failure: failureAJAXFunction
- });
-};
-
-function updateUserContent(){
- cid = content_lvl3 + content_lvl2 * 10 + content_lvl1*100 + content_lvl0*1000;
- if( initView != cid ) setUserContent( cid );
-};
-
-var gSessionValidatorInterval = null;
-
-function sessionValidator(){
- Ext.Ajax.request({
- url: '/lib/controller/validateUserSession.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( !data.sessionIsValid ){
- playSound();
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_REQ_FAILURE_');?>',
- msg: '=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- doLogout();
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function doCheckWindowSize(){
- if (parseInt(navigator.appVersion)>3) {
- if (navigator.appName=="Netscape") {
- winW2 = window.innerWidth;
- winH2 = window.innerHeight;
- if ( winH2<700 ) winH2=700;
- };
- if (navigator.appName.indexOf("Microsoft")!=-1) {
- winW2 = document.body.offsetWidth;
- winH2 = document.body.offsetHeight;
- if ( winH2<700 ) winH2=700;
- };
- };
- if ( winW2 != winW || winH2!=winH ){
- updateUserScreenResolution( winW2, winH2 );
- };
-};
-
-
-
-var NotificationStack = null;
-
-function tryKeepScreenAlive(minutes) {
- navigator.wakeLock.request("screen").then(lock => {
- setTimeout(() => lock.release(), minutes * 60 * 1000);
- });
-}
-
-function showContent( cid ){
- if( cid != initView ) setUserContent( cid );
- var lvl0 = Math.floor( initView / 1000 );
- var lvl1 = Math.floor( ( initView % 1000 )/ 100 );
- var lvl2 = Math.floor( ( initView % 100 )/ 10 );
- var lvl3 = initView % 10;
- if( lvl3 != content_lvl3 ){ content_lvl3 = lvl3; };
- if( lvl2 != content_lvl2 ){ content_lvl2 = lvl2; };
- if( lvl1 != content_lvl1 ){ content_lvl1 = lvl1; };
-
- if( lvl0 != content_lvl0 ){
- content_lvl0 = lvl0;
- switch( lvl0 ){
- case 0:{
- var tt = Ext.getCmp('tbtn_0');
- tt.toggle( true, false );
- var tP = Ext.getCmp('left_side_menu');
- if( tP.isVisible() ) tP.setVisible( false );
- initMonitoring();
- Ext.getCmp('main_viewport').doLayout();
- break;
- };
- case 1:{
- var tt = Ext.getCmp('tbtn_1');
- tt.toggle( true, false );
- var tP = Ext.getCmp('left_side_menu');
- tP.setVisible( true );
- Ext.getCmp('main_viewport').doLayout();
- break;
- };
- case 2:{
- var tt = Ext.getCmp('tbtn_2');
- tt.toggle( true, false );
- var tP = Ext.getCmp('left_side_menu');
- if( !tP.isVisible() ) tP.setVisible( true );
- var tZ = Ext.getCmp('right_side_menu');
- if( tZ.isVisible() ) tZ.setVisible( false );
- initSettingsView();
- Ext.getCmp('main_viewport').doLayout();
- break;
- };
- };
- };
-};
-
-Ext.onReady(function(){
- if ('wakeLock' in navigator) {
- // Screen Wake Lock API supported
- tryKeepScreenAlive(10);
- };
-
-
- doCheckWindowSize();
- gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
- NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
- //window.onresize = doCheckWindowSize;
- Ext.QuickTips.init();
-
- if( ssEnabled ){
- ssSetupTimer();
- $(window).focus(function() {
- ssResetTimer();
- });
- $(window).blur(function() {
- ssStopTimer();
- });
- };
-
-
- var viewport = new Ext.Viewport({
- id: 'main_viewport',
- layout:'border',
- frame: false,
- border: false,
- items: [{
- xtype: 'panel',
- region: 'north',
- baseCls: 'x-plain',
- height: 60,
- //layout: 'fit',
- layout: 'hbox',
- frame: false,
- border: false,
- items:[{
- xtype: 'panel',
- width: '100%',
- layout: 'table',
- baseCls: 'x-plain',
- layoutConfig: {
- columns: 11
- },
- frame: false,
- border: true,
- margins: {top:10, right:10, bottom:10, left:10},
- items:[{
- xtype: 'panel',
- baseCls: 'x-plain',
- frame: false,
- border: false,
- margins: {top:5, right:20, bottom:0, left:20},
- html: '
'
- },{
- xtype: 'spacer',
- width: 10
- },{
- xtype: 'button',
- text: '=$Labels->GetLabel('_MONITORING_');?>',
- id: 'tbtn_0',
- iconCls: 'mon',
- scale: 'large',
- enableToggle: true,
- //pressed: (Math.floor(initView/100)==0),
- allowDepress: false,
- toggleGroup: 'gopa_gopa',
- toggleHandler: function( bt, state ){
- if( state ) showContent( 0 );
- }
- },{
- xtype: 'spacer',
- width: 10
- },{
- xtype: 'button',
- text: '=$Labels->GetLabel('_REPO_HISTORY_');?>',
- id: 'tbtn_1',
- iconCls: 'rep',
- scale: 'large',
- enableToggle: true,
- //pressed: (Math.floor(initView/100)==1),
- allowDepress: false,
- toggleGroup: 'gopa_gopa',
- toggleHandler: function( bt, state ){
- if( state ) {
- content_lvl0 = 2000;
- updateUserContent();
- };
- }
- },{
- xtype: 'spacer',
- width: 10
- },{
- xtype: 'button',
- text: '=$Labels->GetLabel('_SETTINGS_');?>',
- id: 'tbtn_2',
- iconCls: 'cog',
- scale: 'large',
- enableToggle: true,
- allowDepress: false,
- toggleGroup: 'gopa_gopa',
- toggleHandler: function( bt, state ){
- if( state ) showContent( 2000 );
- }
- },{
- xtype: 'spacer',
- width: 10
- },{
- xtype: 'panel',
- baseCls: 'x-plain',
- frame: false,
- border: false,
- margins: {top:5, right:0, bottom:0, left:0},
- width: PanelW-700,
- html: '
'+ap_title+'
'
- },{
- xtype: 'spacer',
- width: 10
- },{
- xtype: 'button',
- id: 'logout_btn',
- text: 'Logout',
- iconCls: 'lout',
- scale: 'large',
- style:'text-align: right;',
- handler: doLogout
- }{
- xtype: 'button',
- id: 'snd_mode_btn',
- text: 'Sound',
- iconCls: 'snd'+SoundMode,
- scale: 'large',
- style:'text-align: right;',
- handler: function(){
- if( SoundMode == 0 ){
- SoundMode = 3;
- } else {
- SoundMode --;
- };
- Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode );
- }
- }
- ]
- }]
- },{
- xtype: 'panel',
- id:'left_side_menu',
- region:'west',
- bsaseCls:'x-plain',
- //title: '=$Labels->GetLabel('_SEC_SYSTEM_');?>',
- collapsible: true,
- split:true,
- width:180,
- minWidth: 180,
- maxWidth: 180,
- hidden: (Math.floor(initView/100)==0),
- layout:'accordion',
- margins: '5 0 5 5',
- cmargins:'5 5 5 5',
- layoutConfig:{
- animate: true//,
- //activeOnTop: true
- },
- items: []
- },{
- xtype: 'panel',
- region:'center',
- margins: '5 5 5 0',
- id: 'main_content',
- //title: '=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
- items:[{
- xtype: 'portal',
- id: 'main_portal',
- frame: false,
- border: false,
- items:{
- html: ''
- }//,
- //listeners:{
- // drop: function( a ){
- // updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
- // }
- //}
- }]
- },{
- xtype: 'panel',
- region:'east',
- id:'right_side_menu',
- //title: '',
- margins: '5 5 5 0',
- //id: 'help_content',
- frame: false,
- border: false,
- collapsible: false,
- split:true,
- width:200,
- minWidth: 150,
- maxWidth: 200,
- items:[]
- }]
- });
- showContent( initView );
-});
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/rgoose_map.js b/lib/javascript/jsapi_dynamic/rgoose_map.js
deleted file mode 100644
index e69de29..0000000
diff --git a/lib/javascript/jsapi_dynamic/rgoose_modules.js b/lib/javascript/jsapi_dynamic/rgoose_modules.js
deleted file mode 100644
index 7d1b0a3..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_modules.js
+++ /dev/null
@@ -1,575 +0,0 @@
-//
-
-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.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(){
- if( embedVideoEncoderId > -1 ){
- var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."});
- llMask.show();
- var formData = new FormData();
- var img_upload = document.getElementById('eve_logo_upload');
- formData.append("file", img_upload.files[0]);
- formData.append("type", 'eve_logo');
- formData.append("id", embedVideoEncoderId );
- $.ajax({
- type: 'POST',
- url: '/lib/controller/uploadAsset.php',
- data: formData,
- cache: false,
- contentType: false,
- processData: false,
- success: function( data ){
- llMask.hide();
- console.log("success");
- console.log( data );
- },
- error: function( data ){
- llMask.hide();
- console.log("error");
- console.log(data);
- }
- });
- /*
- Ext.Ajax.request({
- url: SITE_URL+'upload/',
- headers: {'Content-type':'multipart/form-data'},
- form: filefield.up('form').getForm(),
- isUpload: true,
- success: function(response, options) { console.log(arguments); },
- failure: function(response, options) { console.log(arguments); }
- });
- */
-
- };
-};
-
-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: [{
- text: "=$Labels->GetLabel('_CANCEL_');?>",
- handler: function(){
- moduleSettingsEditorWindow.hide();
- }
- },{
- id: 'con_to_src',
- text: "=$Labels->GetLabel('_OK_');?>",
- disabled: false,
- handler: function(){
- Ext.getCmp('mod_set_content').saveSettings();
- }
- }]
- });
- };
- 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();
- } 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: '
',
- height: 400,
- width: 760,
- border: true,
- colspan: 4
- },{
- html: '
=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:
'
- },{
- 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: '
=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:
'
- },{
- xtype: 'slider',
- id: 'COMP_QUAL',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 70
- },{
- html: '
=$Labels->GetLabel('_EVE_SHOW_TS_');?>:
'
- },{
- xtype: 'checkbox',
- id: 'eve_show_ts',
- value: 0,
- handler: updateFramePreview
- },{
- html: '
=$Labels->GetLabel('_EVE_TS_POSX_');?>:
'
- },{
- xtype: 'slider',
- id: 'TS_POSX',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_TS_POSY_');?>:
'
- },{
- xtype: 'slider',
- id: 'TS_POSY',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:
'
- },{
- xtype: 'checkbox',
- id: 'eve_transp_ts',
- value: 0
- },{
- html: '
=$Labels->GetLabel('_EVE_FONT_TS_');?>:
'
- },{
- 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: '
=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:
'
- },{
- xtype: 'slider',
- id: 'TS_FSCALE',
- width: 120,
- minValue: 0.0,
- maxValue: 4.0,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:
'
- },{
- xtype: 'slider',
- id: 'TS_FTHICK',
- width: 120,
- minValue: 1,
- maxValue: 8.0,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:
'
- },{
- 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: '
=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:
'
- },{
- xtype: 'checkbox',
- id: 'eve_show_lbl',
- value: 0,
- handler: updateFramePreview
- },{
- html: '
=$Labels->GetLabel('_EVE_LBL_POSX_');?>:
'
- },{
- xtype: 'slider',
- id: 'LBL_POSX',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_LBL_POSY_');?>:
'
- },{
- xtype: 'slider',
- id: 'LBL_POSY',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:
'
- },{
- xtype: 'checkbox',
- id: 'eve_transp_lbl',
- value: 0
- },{
- html: '
=$Labels->GetLabel('_EVE_FONT_LBL_');?>:
'
- },{
- 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: '
=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:
'
- },{
- xtype: 'slider',
- id: 'LBL_FSCALE',
- width: 120,
- minValue: 0.0,
- maxValue: 4.0,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:
'
- },{
- xtype: 'slider',
- id: 'LBL_FTHICK',
- width: 120,
- minValue: 1,
- maxValue: 8.0,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:
'
- },{
- 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: '
=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:
'
- },{
- xtype: 'checkbox',
- id: 'eve_show_logo',
- value: 0,
- handler: updateFramePreview
- },{
- html: '
=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:
'
- },{
- xtype: 'slider',
- id: 'LOGO_POSX',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:
'
- },{
- xtype: 'slider',
- id: 'LOGO_POSY',
- width: 120,
- minValue: 0,
- maxValue: 100,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:
'
- },{
- xtype: 'numberfield',
- id: 'LOGO_WIDTH',
- width: 120,
- minValue: 0,
- maxValue: 256,
- value: 1.0
- },{
- html: '
=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:
'
- },{
- xtype: 'numberfield',
- id: 'LOGO_HEIGHT',
- width: 120,
- minValue: 0,
- maxValue: 256,
- value: 1.0
- },{
- id: 'eve_logo_ph',
- html: '
'
- },{
- html: '
'
- },{
- html: '
=$Labels->GetLabel('_EVE_PORT_');?>:
'
- },{
- 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
- });
- * /
-};*/
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/rgoose_reports.js b/lib/javascript/jsapi_dynamic/rgoose_reports.js
deleted file mode 100644
index ae4581d..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_reports.js
+++ /dev/null
@@ -1,1237 +0,0 @@
-//
-
-
-var map = null;
-var selectedMarker = null;
-var timelineObj = null;
-var tlGroups = new vis.DataSet();
-var tlItems = new vis.DataSet();
-
-var selecredActiveSourceFilter = 0;
-var ActiveZones = null;
-
-var selectedMarkerIcon = L.icon({
- iconUrl: '/style/assets/cursor.png',
- iconSize: [32, 32],
- iconAnchor: [16, 16]//,
- //popupAnchor: [-3, -76],
- //shadowUrl: 'my-icon-shadow.png',
- //shadowSize: [68, 95],
- //shadowAnchor: [22, 94]
-});
-
-selectedMarker = L.marker([SiteLat, SiteLon], { draggable: false, icon: selectedMarkerIcon } );
-
-var tlOptions = {
- groupOrder: 'content', // groupOrder can be a property name or a sorting function
- stack: true,
- showCurrentTime: true,
- //verticalScroll: true,
- //zoomKey: 'ctrlKey',
- minHeight: 308,
- maxHeight: 308
-};
-var tlLoadLocker = false;
-var tlLastTS = 0;
-var tlInterval = null;
-var tlMonitoring = false;
-
-
-
-
-// Calendar
-
-var CurrentDate=(new Date())/1000;
-
-var today=new Date();
-var SY=1900+today.getYear();
-var SMO=today.getMonth()+1;
-var SD=today.getDate();
-var SelectedDay = SD;
-var Dates = new Array();
-function CheckDate(D){
- for(j_index=0;j_index
GetMonthLength(CurrentDate) ) SD = GetMonthLength(CurrentDate);
- loadCalendarDates();
-};
-function ShiftFWD(){
- CurrentDate=CurrentDate+24*3600*GetMonthLength(CurrentDate);
- BuildCalendar();
- SMO = GetMonthNum(CurrentDate);
- SY = GetYear(CurrentDate);
- if( SD > GetMonthLength(CurrentDate) ) SD = GetMonthLength(CurrentDate);
- loadCalendarDates();
-};
-
-function GetMonthName(UTS){ // Unix Time Stamp
- var MoNames= new Array();
- MoNames[0]='January';
- MoNames[1]='February';
- MoNames[2]='March';
- MoNames[3]='April';
- MoNames[4]='May';
- MoNames[5]='June';
- MoNames[6]='July';
- MoNames[7]='August';
- MoNames[8]='September';
- MoNames[9]='October';
- MoNames[10]='November';
- MoNames[11]='December';
- CDate=new Date();
- CDate.setTime(UTS*1000);
- CMo=CDate.getMonth();
- return MoNames[CMo];
-};
-
-function GetMonthShift(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- CDate.setTime((UTS-(CDate.getDate()-1)*86400)*1000);
- return CDate.getDay();
-};
-
-function GetMonthLength(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- CD=CDate.getDate();
- RetVal=31;
- CDate.setTime((UTS+(31-CD)*86400)*1000);
- if ( CDate.getDate()==31) return RetVal;
- RetVal=30;
- CDate.setTime((UTS+(30-CD)*86400)*1000);
- if ( CDate.getDate()==30) return RetVal;
- RetVal=29;
- CDate.setTime((UTS+(29-CD)*86400)*1000);
- if ( CDate.getDate()==29) return RetVal;
- RetVal=28;
- CDate.setTime((UTS+(28-CD)*86400)*1000);
- if ( CDate.getDate()==28) return RetVal;
- return -1;
-};
-
-function GetMonthNum(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- return CDate.getMonth()+1;
-};
-
-function GetYear(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- y=CDate.getYear();
- if (y<100)y+=2000;
- if (y<200)y+=1900;
- return y;
-};
-function GetDay(UTS){ // Unix Time Stamp
- CDate=new Date();
- CDate.setTime(UTS*1000);
- y=CDate.getDate();
- return y;
-};
-
-function selectDate( m, d ){
- SY = GetYear(CurrentDate);
- SMO = m;
- SD = d;
- SelectedDay = SD;
- getData( 'arch' );
-};
-
-function BuildCalendar( ){
- Msh=GetMonthShift(CurrentDate);
- Mnm=GetMonthName(CurrentDate);
- Mln=GetMonthLength(CurrentDate);
- Mid=GetMonthNum(CurrentDate);
- Mye=GetYear(CurrentDate);
- InDTA=''+Mnm+' '+Mye+' ';
- InDTA+='Su Mo Tu We Th Fr Sa ';
- InDTA+='';
- for(index=0;index
';
- };
- for(;index<(Mln+Msh);index++){
- if( CheckDate(index-Msh+1) ){
- //InDTA+=''+(index-Msh+1).toString()+'
';
- if( SD == index ){
- InDTA+=''+(index-Msh+1).toString()+'
';
- } else {
- InDTA+=''+(index-Msh+1).toString()+'
';
- };
- } else {
- if( SD == index ){
- InDTA+=''+(index-Msh+1).toString()+'
';
- } else {
- InDTA+=''+(index-Msh+1).toString()+'
';
- };
- };
- if ((index+1)%7==0){
- InDTA+=' ';
- };
- };
- for(;(index)%7!=0;index++){
- InDTA+='
';
- };
- InDTA+='
';
- tab=document.getElementById('calendar_TD');
- tab.innerHTML=InDTA;
-};
-
-
-function loadCalendarDates(){
- Ext.MessageBox.wait("=$Labels->GetLabel('_Loading_Calo_');?>","=$Labels->GetLabel('_Please_Wait_');?>",{
- width: '100%',
- hidden: true,
- progress: true,
- closable: false
- });
- Ext.Ajax.request({
- url: '/lib/controller/getEventDates.php',
- params: {
- NID: selecredActiveSourceFilter,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- SYE: SY,
- SMO: SMO
- },
- success: function( response, opts ){
- Ext.MessageBox.hide();
- var data = Ext.decode( response.responseText );
- if( data.status == 'ok' ){
- Dates = data.days;
- BuildCalendar();
- //for( var i = 0; i < data.days.length; i++ ){
- //
- //};
- };
- },
- failure: function( response, opts ) {
- Ext.MessageBox.hide();
- }
- });
-};
-
-
-
-
-
-
-
-
-var eventsListStore = new Ext.data.JsonStore({
- root: 'log',
- totalProperty: 'totalCount',
- idProperty: 'id',
- remoteSort: true,
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'date',
- type: 'string'
- },{
- name: 'time',
- type: 'string'
- },{
- name: 'device',
- type: 'string'
- },{
- name: 'event',
- type: 'int'
- },{
- name: 'data',
- type: 'string',
- },{
- name: 'has_target',
- type: 'boolean'
- },{
- name: 'has_geo',
- type: 'boolean'
- },{
- name: 'has_images',
- type: 'boolean'
- },{
- name: 'images',
- type: 'Array'
- },{
- name: 'dev_type',
- type: 'int'
- },{
- name: 'geo',
- type: 'object'
- }] /*,
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/controller/getEventRecords.php',
- headers: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NID: 1
- }
- })*/
-});
-
-var SelectedEvent = 0;
-var EventPanelWindow = null;
-function showEventPanel(){
- if( EventPanelWindow == null ){
- EventPanelWindow = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel("_EVENT_VIEWER_");?>',
- width: winW*0.66,
- height: winH*0.66,
- layout: 'fit',
- closeAction: 'hide',
- items:[{
- title: 'Cameras',
- html:'koko',
- autoScroll: true,
- height: 320
- },{
- html: 'koko22',
- height: 320
- }]
- });
- };
- EventPanelWindow .show();
-};
-
-function ModeRenderer(val){
- var p1, p2, p3;
- if( ( val & 1 ) == 1 ){
- p1 = ' ';
- } else {
- p1 = ' ';
- };
- if( ( val & 2 ) == 2 ){
- p2 = ' ';
- } else {
- p2 = ' ';
- };
- if( ( val & 4 ) == 4 ){
- p3 = ' ';
- } else {
- p3 = ' ';
- };
- return p1+p2+p3;
-};
-
-function LocRenderer( val ){
- if( val ){
- return ' ';
- };
- return ' ';
-};
-function PicRenderer( val ){
- if( val ){
- return ' ';
- };
- return ' ';
-};
-
-function EvtTypeRenderer( val ){
- switch( val ){
- case 6: return 'Device Enters Into Study Mode';
- case 7: return 'Device Is BUSY';
- case 8: return 'Flip Complete';
- case 9: return 'Scan Complete';
- case 10:
- case 11:
- case 12:
- case 13:
- case 14: return 'Target';
- case 36: return 'Region Of Interest';
- default: return 'Event ['+val+']';
- };
-};
-
-var eventsListColModel_ops = {
- columns: [
- {header: "ID", width: 100, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "Date",width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' },
- {header: "Time", width: 80, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'time' },
- {header: "Device", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'device' },
- {header: "Event", width: 120, sortable: false, dataIndex: 'event', renderer: EvtTypeRenderer },
- {header: "Info", width: 200, sortable: false, dataindex: 'data' },
- {header: "", width: 25, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer },
- {header: "", width: 25, sortable: false, dataIndex: 'has_images', renderer: PicRenderer }
- ],
- defaults: {
- sortable: true,
- menuDisabled: true,
- width: 100
- },
- listeners: {
- hiddenchange: function(cm, colIndex, hidden) {
- //saveConfig(colIndex, hidden);
- }
- }
-};
-var SelectedRow = -1;
-
-var eventsListSelModel_ops = {
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec ) {
- loadEventProperties( rec.data );
- SelectedEvent = rec.data.id;
- SelectedRow = row;
- //alert( SelectedEvent );
- //var CB = Ext.getCmp('con_to_src');
- //CB.enable();
- }
- }
-};
-
-function loadTimeLineGroups( NID ){
- Ext.Ajax.request({
- url: '/lib/controller/getTimeLineGroups.php',
- params: {
- NID: NID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- //for(var i = 0; i < data.length; i++) {
- //tlGroups.add(data[i]);
- //};
- tlGroups.update( data );
- loadTimeLineItems( SelectedSite );
- tlInterval = window.setInterval( loadTimeLineItems, 333, SelectedSite );
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- }/*,
- callback: function(options,success,response){
- // use this if you need to perform your own success/failure checking
- }*/
- });
-};
-
-function clickDeviceSelector( id ){
- var rr = document.getElementById(id+'_div');
- if( selecredActiveSourceFilter != id ){
- if( selecredActiveSourceFilter > 0 ){
- var oo = document.getElementById( selecredActiveSourceFilter + '_div');
- oo.classList.remove( "cardDeviceSourceSelected" );
- oo.classList.add( "cardDeviceSource" );
- };
- rr.classList.remove( "cardDeviceSource" );
- rr.classList.add( "cardDeviceSourceSelected" );
- selecredActiveSourceFilter = id;
- turnOffAllGzButThis( selecredActiveSourceFilter );
- } else {
- selecredActiveSourceFilter = 0;
- rr.classList.remove( "cardDeviceSourceSelected" );
- rr.classList.add( "cardDeviceSource" );
- turnAllGzOn();
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( {
- title: 'Event Information',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- html: 'Select an Event from TimeLine to See Information
'
- } );
- tPanel.doLayout();
-
- };
-};
-function getZoneByNode( nid ){
- var rVal = -1;
- for( var i=0; i < ActiveZones.totalCount; i++ ){
- if( ActiveZones.zones[i].dev_id == nid ){
- rVal = i;
- break;
- };
- };
- return rVal;
-};
-
-function turnOffAllGzButThis( nid ){
- var chocho = -1;
- for( var i=0; i < ActiveZones.totalCount; i++ ){
- if( ActiveZones.zones[i].dev_id == nid ) chocho = i;
- map.removeLayer( ActiveZones.fig[i] );
- map.removeLayer( ActiveZones.zang[i] );
- map.removeLayer( ActiveZones.center[i] );
- };
- if( chocho > -1 ){
- map.addLayer( ActiveZones.fig[chocho] );
- map.addLayer( ActiveZones.zang[chocho] );
- map.addLayer( ActiveZones.center[chocho] );
- var cVisible = L.featureGroup( Array( ActiveZones.fig[chocho], ActiveZones.zang[chocho], ActiveZones.center[chocho] ) );
- map.flyToBounds( cVisible.getBounds() );
- };
-};
-
-function turnAllGzOn(){
- var tall = Array();
- for( var i=0; i < ActiveZones.totalCount; i++ ){
- tall[i*3] = ActiveZones.fig[i];
- tall[i*3+1] = ActiveZones.zang[i];
- tall[i*3+2] = ActiveZones.center[i];
- if(!map.hasLayer(ActiveZones.fig[i])) map.addLayer( ActiveZones.fig[i] );
- if(!map.hasLayer(ActiveZones.zang[i])) map.addLayer( ActiveZones.zang[i] );
- if(!map.hasLayer(ActiveZones.center[i])) map.addLayer( ActiveZones.center[i] );
- };
- var cVisible = L.featureGroup( tall );
- map.flyToBounds( cVisible.getBounds() );
-};
-
-function loadMapZones( SID ){
- Ext.Ajax.request({
- url: '/lib/controller/getGeoZones.php',
- params: {
- SITE: SID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- var pp = Ext.getCmp('sources_panel');
- if( typeof pp !== 'undefined' ) pp.removeAll();
- ActiveZones = data;
- ActiveZones.fig = new Array();
- ActiveZones.zang = new Array();
- ActiveZones.center = new Array();
- for(var i = 0; i < data.totalCount; i++ ) {
- switch( data.zones[i].type ){
- case 'circle':{
- //L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ).addTo( map );
- ActiveZones.fig[i] = new L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } );
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- case 'poly':{
- ActiveZones.fig[i] = new L.polygon( data.zones[i].points, {color: data.zones[i].color, dashArray: "4 1 2 3", weight: 1, opacity: 0.8, clickable: false, interactive: false, bubblingMouseEvents: false });//.addTo(map);
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- case 'image':{
- ActiveZones.fig[i] = L.imageOverlay( data.zones[i].url, data.zones[i].bounds, { opacity: 1.0 });//.addTo( map );
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- case 'image_rot':{
- ActiveZones.fig[i] = L.imageOverlay.rotated( data.zones[i].url, data.zones[i].topleft, data.zones[i].topright, data.zones[i].bottomleft, {
- opacity: 0.8 //,
- //interactive: true,
- //attribution: "Historical building plan © Instituto Geográfico Nacional de España "
- });//.addTo( map );
- //map.addLayer( ActiveZones.fig[i] );
- break;
- };
- };
- if( data.zones[i].dev_is_source ){
- if( typeof pp !== 'undefined' ) {
- var sty = '';
- if( selecredActiveSourceFilter == data.zones[i].dev_id ){
- sty = 'cardDeviceSourceSelected';
- } else {
- sty = 'cardDeviceSource';
- };
- pp.add( {
- id: data.zones[i].dev_id+'_container',
- frame: false,
- border: false,
- width: 130,
- height: 130,
- html: ''+data.zones[i].dev_name+'
'
- });
- };
- };
- if( data.zones[i].zang != undefined ){
- //L.polygon( data.zones[i].zang, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
- ActiveZones.zang[i] = L.circle( data.zones[i].zang, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } );//.addTo( map );
- };
- if( data.zones[i].center != undefined ){
- //L.polygon( data.zones[i].zmark, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
- ActiveZones.center[i] = L.circle( data.zones[i].center, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } ).addTo( map );
- };
- };
- if( selecredActiveSourceFilter == 0 ){
- turnAllGzOn();
- } else {
- turnOffAllGzButThis( selecredActiveSourceFilter );
- };
- if( typeof pp !== 'undefined' ) pp.doLayout();
- //LoadMapEvents( SelectedSite );
- //tlInterval = window.setInterval( LoadMapEvents, 333, SelectedSite );
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- }
- });
-};
-
-var cevt = Array();
-var coz = Array();
-
-function showEventsOnMap( data, removeCursor = true ){
- if( removeCursor ) map.removeLayer( selectedMarker );
- if( cevt.length ){
- for( i=0; i< cevt.length; i++ ){
- if( cevt[i]!= null ){
- cevt[i].remove();
- delete( cevt[i] );
- cevt[i] = null;
- };
- };
- };
- if( coz.length ){
- for( i=0; i< coz.length; i++ ){
- if( coz[i]!= null ){
- coz[i].remove();
- delete( coz[i] );
- coz[i]=null;
- };
- };
- };
- var zz = ( 1.0 / ( data.log.length + 0 ) );
- var idx = 0;
- for( i=0; i < data.log.length; i++ ){
- if( data.log[i].has_geo ){
- var cp_color='#FF0000';
- switch( data.log[i].event ){
- case 36: cp_color='#0000FF'; break;
- };
- cevt[idx] = L.circleMarker( [data.log[i].geo.lat, data.log[i].geo.lon], {id:data.log[i].id, color: cp_color, radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } ).on('click', function( e, a ){
- loadEventPropertiesByID( this.options.id );
- } );
- cevt[idx].addTo(map);
- idx++;
- };
- };
-};
-
-function LoadMapEventsZ( Mode ){
- if( tlLoadLocker ) return;
- tlLoadLocker = true;
- Ext.Ajax.request({
- url: '/lib/controller/getGeoAlerts.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MODE: Mode
- },
- success: function( response, opts ){
- if( cevt.length ){
- for( i=0; i< cevt.length; i++ ){
- if( cevt[i]!= null ){
- cevt[i].remove();
- delete( cevt[i] );
- cevt[i] = null;
- };
- };
- };
- if( coz.length ){
- for( i=0; i< coz.length; i++ ){
- if( coz[i]!= null ){
- coz[i].remove();
- delete( coz[i] );
- coz[i]=null;
- };
- };
- };
- var data = Ext.decode( response.responseText );
- var zz = ( 1.0 / ( data.evt.length + 0 ) );
- for( i=0; i < data.evt.length; i++ ){
- cevt[i] = L.circleMarker( [data.evt[i].lat,data.evt[i].lon], {id:data.evt[i].id, color: '#FF0000', radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } ).on('click', function( e, a ){
- loadEventProperties( this.options.id );
- } );
- cevt[i].addTo(map);
- };
- for( i=0; i < data.other.length; i++ ){
- switch( data.other[i].type ){
- case 'circle':{
- coz[i] = L.circleMarker( data.other[i].loc, {id:data.other[i].id, color: data.other[i].color, radius: 5, stroke: false, fillOpacity: 1.0 } );
- coz[i].addTo(map);
- break;
- };
- };
- };
-
- //eventsListStore.reload();
- tlLoadLocker = false;
- },
- failure: function( response, opts ) {
- //Ext.fly('some_div').update('Fail!');
- tlLoadLocker = false;
- }
- });
-};
-
-function loadEventPropertiesByID( id ){
- var d = eventsListStore.findExact( 'id', id );
- if( d > -1 ) {
- var EventRec = eventsListStore.getAt( d );
- loadEventProperties( EventRec.data );
- };
-};
-
-function loadEventProperties( EventRec ){
- var tPanel = Ext.getCmp('prop_content');
- tPanel.removeAll();// remove( 0 );
- var tt = '';
- if( selectedMarker!= null ){
- selectedMarker.remove();
- //map.removeLayer( selectedMarker );
- if( EventRec.has_geo ){
- tt = ''+EventRec.geo.lat+' '+EventRec.geo.lon;
- selectedMarker.setLatLng([EventRec.geo.lat, EventRec.geo.lon]);
- selectedMarker.addTo( map );
- };
- };
- tPanel.add( {
- title: 'Event Details',
- html: '' + EventRec.device+'
'+tt+' '
- } );
- if( EventRec.has_images ){
- for( var i=0; i < EventRec.images.length; i++ ){
- tPanel.add( {
- frame: false,
- html: ' '
- });
- };
- };
- tPanel.doLayout();
-};
-
-function getData( Mode, ST = 0, ET = 0, SR = 0, DR = 0 ){
- if( tlLoadLocker ) return;
- tlLoadLocker = true;
- if( Mode == 'arch' ){
- Ext.MessageBox.wait("Loading Data","Please Wait",{
- width: '100%',
- hidden: true,
- animate: true,
- progress: true,
- closable: false
- });
- };
- Ext.Ajax.request({
- url: '/lib/controller/getEventRecords.php',
- params: {
- SITE: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MODE: Mode,
- FIL: selecredActiveSourceFilter,
- SDA: SD,
- SMO: SMO,
- SYE: SY,
- STM: ST,
- ETM: ET,
- STR: SR,
- DIR: DR
- },
- success: function( response, opts ){
- tlLoadLocker = false;
- var data = Ext.decode(response.responseText);
- if( data.updateFROMTO ){
- Ext.getCmp('STimeFROM').setValue( data.STT );
- Ext.getCmp('STimeTO').setValue( data.ENT );
- if( data.SLD > 0 ){
- SMO = GetMonthNum(data.SLD);
- SY = GetYear(data.SLD);
- SD = GetDay(data.SLD);
- BuildCalendar();
- };
- };
- eventsListStore.loadData( data, false );
-
- if( Mode == 'arch' ){
- showEventsOnMap( data, true );
- Ext.MessageBox.hide();
- if( DR > 0 ){
- Ext.getCmp('evtArchLog').getView().focusRow( eventsListStore.getCount() - 1 );
- Ext.getCmp('evtArchLog').getSelectionModel().selectLastRow();
- };
- if( DR < 0 ){
- Ext.getCmp('evtArchLog').getView().focusRow( 0 );
- Ext.getCmp('evtArchLog').getSelectionModel().selectFirstRow();
- };
- } else {
- showEventsOnMap( data, false );
- //LoadMapEventsZ( Mode );
- };
- },
- failure: failureAJAXFunction
- });
-
-};
-
-function loadArchive(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 2 );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( 'Events Archive' );
- tPanel.add({
- columnWidth: 0.83,
- frame: false,
- border: false,
- items: [{
- title: 'Site Map',
- frame: false,
- border: false,
- layout: 'vbox',
- layoutConfig: {
- align : 'stretch',
- pack : 'start',
- },
- height: PanelH-300,
- items:[{
- height: PanelH-325,
- flex: 1,
- frame: false,
- border: false,
- layout: 'fit',
- items:{
- id: 'event_map',
- html: ' '
- }
- }]
- },{
- frame: false,
- border: false,
- collapsible: false,
- draggable: false,
- layout: 'hbox',
- items:[{
- layout: 'form',
- title: 'Date/Time',
- width: 200,
- frame: true,
- border: false,
- labelAlign: 'right',
- labelWidth: 50,
- defaults: { width: 80},
- items: [{
- xtype: 'combo',
- id: 'STimeFROM',
- fieldLabel: 'From',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 120,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['ss', 'displayText' ],
- data: []
- }),
- valueField: 'ss',
- displayField: 'displayText'
- },{
- xtype: 'combo',
- id: 'STimeTO',
- fieldLabel: 'Till',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- width: 120,
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['ss', 'displayText' ],
- data: []
- }),
- valueField: 'ss',
- displayField: 'displayText'
- }],
- html: '',
- buttons: [{
- xtype: 'button',
- text: 'Display History',
- handler: function(){
- var STU = Ext.getCmp('STimeFROM').getValue();
- var ETU = Ext.getCmp('STimeTO').getValue();
- getData( 'arch', STU, ETU );
- }
- }]
- },{
- title: 'Event Log',
- frame: false,
- height: 303,
- id: 'evtArchLog',
- xtype: 'grid',
- ds: eventsListStore,
- cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
- listeners:{
- keydown: function( e ) {
- if( e.getKey() == e.UP ){
- if( SelectedRow == 0 ){
- var id = eventsListStore.getAt( 0 ).id;
- getData( 'arch', 0, 0, id, 1 );
-
- };
- };
- if( e.getKey() == e.DOWN ){
- if( SelectedRow == ( eventsListStore.getCount() - 1 ) ){
- var id = eventsListStore.getAt( SelectedRow ).id;
- getData( 'arch', 0, 0, id, -1 );
- Ext.getCmp('evtArchLog').getSelectionModel().selectFirstRow();
- Ext.getCmp('evtArchLog').focus( false, true );
- };
- };
- }
- }
- }]
- }]
- });
- tPanel.add({
- columnWidth: 0.17,
- frame: true,
- title: 'Event Information',
- id: 'prop_content',
- border: false,
- items: [{
- html:'=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
- }]
- });
-
- tPanel.doLayout();
- /*
- Ext.getCmp('evtLog').getEl().set({tabindex: "0"});
- Ext.getCmp('evtLog').getEl().addKeyMap({
- eventName: "keyup",
- binding: [{
- key: Ext.EventObject.SPACE,
- fn: function(){ alert("Space key pressed"); }
- },{
- key: [Ext.EventObject.LEFT, Ext.EventObject.RIGHT],
- shift: true,
- fn: function(){ alert("Left or right pressed while pressing shift"); }
- }]
- });
- */
- //BuildCalendar();
- loadCalendarDates();
-
- map = L.map('event_map',{
- attributionControl: true,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- }).setView([SiteLat, SiteLon], 17);
- //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");
-
- var mapLayers = [];
-
- /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
- subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
- attribution: '© Bing Maps ',
- detectRetina: true
- });*/
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data © OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: © OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA ) ',
- maxZoom: 19
- });
- /*
- mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- */
-
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- L.control.layers( baseMaps ).addTo(map);
-
- mapLayers["MyMap"].addTo(map);
-
- /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- }).addTo(map); */
- //loadTimeLineGroups( selectedSite );
- loadMapZones( SelectedSite );
- getData( 'arch' );
- //eventsListStore.load({params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
-};
-
-function loadMonitoring(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 1 );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( 'Events Monitoring' );
- tPanel.add({
- columnWidth: 0.83,
- frame: false,
- border: false,
- items: [{
- title: '=$Labels->getLabel('_MAP_MONITORING_');?>',
- frame: false,
- border: false,
- collapsible: false,
- draggable: false,
- layout: 'vbox',
- layoutConfig: {
- align : 'stretch',
- pack : 'start',
- },
- height: PanelH-300,
- items:[{
- height: PanelH-325,
- flex: 1,
- frame: false,
- border: false,
- layout: 'fit',
- items:{
- id: 'event_map',
- html: ' '
- }
- }]
- },{
- frame: false,
- border: true,
- collapsible: false,
- draggable: false,
- layout: 'hbox',
- items:[{
- title: 'Alarm Sources',
- xtype: 'panel',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- id: 'sources_panel',
- width: 160,
- autoScroll: 'auto',
- height: 303
- },{
- title: 'Event Log',
- height: 303,
- xtype: 'grid',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- ds: eventsListStore,
- cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
- bbar: [{
- text: 'Clear',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/clearEventCloud.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- },
- failure: function( response, opts ) {
- }
- });
- }
- }]
- }]
- }]
- });
- tPanel.add({
- columnWidth: 0.17,
- title: 'Event Information',
- frame: true,
- id: 'prop_content',
- border: false,
- items: [{
- html:'=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
- }]
- });
-
- tPanel.doLayout();
- map = L.map('event_map',{
- attributionControl: true,
- //preferCanvas: true,
- zoomControl: true,
- center: [SiteLat, SiteLon],
- /*zoomControl: false,
- zoom: 17,
- minZoom: 17,
- maxZoom: 17,*/
- keyboard: false
- }).setView([SiteLat, SiteLon], 17);
- //L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> ");
-
- var mapLayers = [];
-
- /*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
- subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
- attribution: '© Bing Maps ',
- detectRetina: true
- });*/
- mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- })
- // https://leaflet-extras.github.io/leaflet-providers/preview/
- mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
- maxZoom: 19
- });
-
- mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
- maxZoom: 19
- });
-
- mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
- attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
- maxZoom: 24
- });
-
- mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
- attribution: 'Map data © OpenStreetMap contributors',
- maxZoom: 19
- });
-
- mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
- attribution: 'Kartendaten: © OpenStreetMap -Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA ) ',
- maxZoom: 19
- });
- /*
- mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
- attribution: 'Maps © Thunderforest , Data © OpenStreetMap contributors ',
- maxZoom: 22
- });
- */
-
- var baseMaps = {
- "MyMap": mapLayers["MyMap"],
- "OpenStreetMap": mapLayers["OpenStreetMap"],
- "OpenTopoMap": mapLayers["OpenTopoMap"],
- "EsriSat": mapLayers["EsriSat"],
- "EsriStreet": mapLayers["EsriStreet"],
- "EsriTopo": mapLayers["EsriTopo"],
- //"Bing": mapLayers["Bing"],
- //"OSM-Cycle": mapLayers["Cycle"],
- //"Landscape": mapLayers["Landscape"],
- //"Outdoor": mapLayers["Outdoor"],
- };
- L.control.layers( baseMaps ).addTo(map);
-
- mapLayers["MyMap"].addTo(map);
-
- /*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: '© OpenStreetMap contributors',
- maxNativeZoom: 18,
- maxZoom: 24,
- }).addTo(map); */
-
- loadMapZones( SelectedSite );
- tlInterval = window.setInterval( getData, 333, 'live' );
-};
-
-
-function loadOnlineMonitoring(devID){
- var tPanel = Ext.getCmp('main_content');
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
-
- tPanel.remove(0);
- tPanel.add({
- html: 'Device Monitoring '+devID
- });
- tPanel.doLayout();
-};
-
diff --git a/lib/javascript/jsapi_dynamic/rgoose_single_ipi.js b/lib/javascript/jsapi_dynamic/rgoose_single_ipi.js
deleted file mode 100644
index daeacd9..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_single_ipi.js
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-
-
-
-
-function loadSingleIPI(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 11 );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( 'Single IPI Monitoring' );
- tPanel.add({
- columnWidth: 1,//0.83
- frame: false,
- border: false,
- items: [{
- title: '=$Labels->getLabel('_VIDEO_MONITORING_');?>',
-Query( $QS );
-?>
- frame: false,
- border: false,
- collapsible: false,
- draggable: false,
- layout: 'vbox',
- layoutConfig: {
- align : 'stretch',
- pack : 'start',
- },
- height: PanelH-300,
- items:[{
- height: PanelH-325,
- flex: 1,
- frame: false,
- border: false,
- layout: 'fit',
- items:{
- id: 'event_map',
- html:
-Query( $QS );
- $MODULE_DATA = $S[0];
- $FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $STREAMID;
- echo "' '";
- } else if( count( $RetVal ) ){
- echo "' Too Many Cameras are Defined For this Site'";
- } else {
- echo "' No Cameras Defined On the Site!'";
- };
-?>
- }
- }]
- },{
- frame: false,
- border: true,
- collapsible: false,
- draggable: false,
- layout: 'hbox',
- items:[{
- title: 'Event Log',
- height: 303,
- xtype: 'grid',
- border: false,
- frame: false,
- collapsible: false,
- draggable: false,
- ds: eventsListStore,
- cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
- bbar: [{
- text: 'Clear',
- handler: function(){
- Ext.Ajax.request({
- url: '/lib/controller/clearEventCloud.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- },
- failure: function( response, opts ) {
- }
- });
- }
- }]
- }]
- }]
- });
- //tPanel.add({
- // columnWidth: 0.17,
- // title: 'Event Information',
- // frame: true,
- // id: 'prop_content',
- // border: false,
- // items: [{
- // html:'=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
- // }]
- //});
- tPanel.doLayout();
-};
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/rgoose_swupgrade.js b/lib/javascript/jsapi_dynamic/rgoose_swupgrade.js
deleted file mode 100644
index 8795d06..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_swupgrade.js
+++ /dev/null
@@ -1,569 +0,0 @@
-//
-
-
-
-
-var muploader = null;
-
-var uploads_store_id = 0;
-var uploads_store = new Ext.data.ArrayStore({
- autoDestroy: false,
- storeId: 'up_store',
- idIndex: 0,
- fields: [
- {name: 'id', type: 'int' },
- {name: 'file_name', type: 'string'},
- {name: 'file_id', type: 'string'},
- {name: 'size', type: 'string'},
- {name: 'progress', type: 'int'},
- {name: 'status', type: 'string' }
- ]
-});
-
-var uploaded_store_id = 0;
-var uploaded_store = new Ext.data.ArrayStore({
- autoDestroy: false,
- storeId: 'mod_store',
- idIndex: 0,
- fields: [
- {name: 'id', type: 'int' },
- {name: 'file_name', type: 'string'},
- {name: 'size', type: 'int'},
- {name: 'status', type: 'int'},
- {name: 'ts', type: 'string' },
- {name: 'memo', type: 'string' }
- ]
-});
-
-function progressRenderer( value, meta, record ){
- Ext.defer( function( id ){
- var p = new Ext.ProgressBar({
- id: 'progress_'+id,
- renderTo: 'div_'+id,
- animate: false,
- width: '100%',
- value: 0,
- text: 'Upload Pending',
- });
- }, 50, undefined, [ record.data.file_id ] );
- return '
';
-};
-
-var fileUploadsColModel_ops = {
- columns: [
- {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "File Name", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
- {header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
- {header: "Progress", width: 150, renderer: progressRenderer, dataIndex: 'progress' },
- {header: " ", width: 50, dataIndex: 'status3' }
- ],
- defaults: {
- sortable: false,
- fixed: true,
- menuDisabled: true,
- width: 100
- }
-};
-
-function loadModuleFiles( sensorID ){
- Ext.Ajax.request({
- url: '/lib/controller/getDeviceFiles.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- DID: sensorID
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- uploaded_store.removeAll();
- uploaded_store.loadData( data.files );
- },
- failure: failureAJAXFunction
- });
-};
-function onModuleFileRenderer( value, meta, record ){
- if( value == 0 ){
- rv = ' ';
- } else {
- if( value < 101 ){
- rv = ' ';
- } else {
- rv = ' ';
- };
- };
- return rv;
-};
-
-var fileModuleColModel_ops = {
- columns: [
- {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "File Name", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
- {header: "Size", width: 80, renderer: plupload.formatSize, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
- {header: "Time", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
- {header: "Status", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' },
- {header: "Memo", dataIndex: 'memo' }
- ],
- defaults: {
- sortable: false,
- fixed: true,
- menuDisabled: true,
- width: 100
- }
-};
-
-var fileUploadsSelModel_ops = {
- singleSelect: true
-};
-
-
-
-function archiveTypeRenderer( value, meta, record ){
- var alt_txt = '';
- var img_src = '';
- if( record.data.bk_type == 3 ){
- alt_txt = 'Full System Snapeshot';
- img_src = '/style/icons/icons/rosette.png';
- } else {
- alt_txt = 'Database Backup';
- img_src = '/style/icons/icons/database.png';
- };
- return '';
-};
-
-var taskIsArmed = false;
-
-var archives_store = new Ext.data.JsonStore({
- root: 'backups',
- totalProperty: 'totalCount',
- idProperty: 'id',
- //remoteSort: true,
- autoLoad: true,
- //url: '/lib/php/setup_toolkit/list_vault.php',
- storeId: 'a_store',
- fields: [{
- name: 'id',
- type: 'int'
- },{
- name: 'bk_type',
- type: 'int'
- },{
- name: 'file_name',
- type: 'string'
- },{
- name: 'base_version',
- type: 'string'
- },{
- name: 'ts',
- type: 'string'
- },{
- name: 'size',
- type: 'string'
- }],
- proxy : new Ext.data.HttpProxy({
- method: 'POST',
- prettyUrls: false,
- url: '/lib/php/setup_toolkit/list_vault.php',
- headers: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- }
- })
-});
-
-
-var archivesColModel_ops = {
- columns: [
- {header: "Type", width: 50, align: 'center', css: 'vertical-align: middle;', renderer: archiveTypeRenderer, dataIndex: 'bk_type' },
- {header: "Version", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'base_version' },
- {header: "Name", width: 280, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
- {header: "Date", width: 120, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
- {header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' }
- ],
- defaults: {
- sortable: false,
- fixed: true,
- menuDisabled: true,
- width: 100
- }
-};
-
-var selectedArchiveRecord = null;
-
-var archivesSelModel_ops = {
- singleSelect: true,
- listeners: {
- rowselect: function(sm, row, rec ) {
- //loadEventProperties( rec.data );
- //SelectedEvent = rec.data.id;
- //alert( SelectedEvent );
- //var CB = Ext.getCmp('con_to_src');
- //CB.enable();
- selectedArchiveRecord = rec;
- if( rec.data.bk_type!=3 ){
-
- } else {
-
- };
- }
- }
-};
-
-var initial_md5 = '';
-
-function updateTaskStatus(){
- Ext.Ajax.request({
- url: '/lib/php/setup_toolkit/getTaskStatus.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- IMD: initial_md5
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- switch( data.status ){
- case 0:{
- Ext.getCmp('ch_ta_btn').disable();
- if( taskIsArmed ){
- taskIsArmed = false;
- archives_store.reload();
- };
- break;
- };
- case 1:{
- Ext.getCmp('ch_ta_btn').enable();
- taskIsArmed = true;
- break;
- };
- case 2:{
- Ext.getCmp('ch_ta_btn').disable();
- break;
- };
- };
- Ext.getCmp('ctask_status').update( ''+data.msg +': ' + data.status_desc+'
' );
- if( initial_md5 != data.log_md5 ){
- initial_md5 = data.log_md5;
- Ext.getCmp('task_log').setRawValue( data.status_log );
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function createNewTask( task_id, param = '' ){
- Ext.Ajax.request({
- url: '/lib/php/setup_toolkit/createNewTask.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- TID: task_id,
- PRM: param
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.status == 0 ){
- Ext.Msg.show({
- title:'Error',
- msg: data.error,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function deleteNewTask(){
- Ext.Ajax.request({
- url: '/lib/php/setup_toolkit/cleanNewTask.php',
- params: {
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.status == 0 ){
- Ext.Msg.show({
- title:'Error',
- msg: data.error,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- };
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadUpgradeManagmenet(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 5 );
- initial_md5 = '';
- Ext.getCmp('main_content').setTitle( '=$Labels->GetLabel('_SWU_DASHBOARD_');?>' );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll(true);
- tPanel.add({
- columnWidth: 1.0,
- frame: false,
- border: false,
- items: [{
- frame: false,
- border: false,
- collapsible: false,
- draggable: false,
- layout: 'vbox',
- //layoutConfig: {
- // align : 'stretch',
- // pack : 'start',
- //},
- height: PanelH,
- items:[{
- title: '=$Labels->getLabel('_MAP_MONITORING_');?>',
- xtype: 'panel',
- height: PanelH-300,
- //flex: 1,
- frame: true,
- width: '100%',
- border: false,
- layout: {
- type: 'table',
- columns: 2,
- tableAttrs: {
- valign: 'top',
- style: 'valign:top;width:100%;'
- }
- },
- defaults: {
- frame: true,
- border: false,
- height: ( PanelH-400 ) / 2,
- style: 'margin: 5px;width:400px;display:block;'
- },
- items:[{
- title: 'Current System Info',
- width: '100%',
- //flex: 1,
- html: 'Current Web Version: =$ARGUS_WEB_VERSION;?>
'
- },{
- title: 'Tasks',
- //width: 400,
- layout: 'vbox',
- items:[{
- xtype: 'button',
- width: '100%',
- text: 'Create Database Backup',
- handler: function(){
- createNewTask( 2 );
- }
- },{
- xtype: 'button',
- width: '100%',
- text: 'Create Full Snapeshot',
- handler: function(){
- createNewTask( 255 );
- }
- }]
- },{
- title: 'Archives',
- height: 250,
- width: '100%',
- tbar:[{
- text: 'Restore',
- id: 'ar_restore_btn',
- handler: function(){
- createNewTask(1, selectedArchiveRecord.data.file_name );
- }
- },{
- text: 'Download',
- id: 'ar_download_btn',
- handler: function(){
- if( selectedArchiveRecord!= null ){
- window.open( '/lib/php/setup_toolkit/vault/'+selectedArchiveRecord.data.base_version + '/'+ selectedArchiveRecord.data.file_name );
- };
- }
- },{
- text: 'Delete',
- id: 'ar_delete_btn',
- handler: function(){
- createNewTask(100, selectedArchiveRecord.data.file_name );
- }
- }],
- items:[{
- xtype: 'grid',
- id: 'archives_grid',
- border: false,
- frame: false,
- autoScroll: true,
- //width: '100%',
- lazyRender: true,
- height: 210,
- ds: archives_store,
- cm: new Ext.grid.ColumnModel( archivesColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( archivesSelModel_ops ),
- viewConfig: {
- // forceFit: true
- }
- }]
- },{
- title: 'Task Status',
- height: 250,
- //flex: 1,
- items:[{
- xtype: 'spacer',
- height: 4
- },{
- id: 'ctask_status',
- border: true,
- html: ''
- },{
- xtype: 'spacer',
- height: 4
- },{
- xtype: 'textarea',
- id: 'task_log',
- height: ( PanelH-320 ) / 2 - 120,
- style: 'font-size:9px;width:100%;margin-bottom:4px;',
- readOnly: true,
- autoScroll: true,
- value: ''
- },{
- xtype: 'progress',
- id: 'task_progress',
- value: 1.0,
- text: 'idle',
- disabled: true
- }],
- tbar:[{
- text: 'Cancel Task',
- id: 'ch_ta_btn',
- disabled: true,
- handler: deleteNewTask
- }]
- }]
-
- },{
- title: '=$Labels->getLabel('_UPLOAD_PACKAGE_');?>',
- xtype: 'panel',
- height: 300,
- //flex: 1,
- frame: true,
- border: false,
- //layout: 'vbox',
- items:[{
- xtype:'button',
- id: 'pickfiles',
- width: '100%',
- text: 'Choose File'
- },{
- height: 200,
- xtype: 'grid',
- id: 'upload_grid',
- border: false,
- frame: false,
- mode: 'local',
- lazyRender: true,
- width: '100%',
- autoScroll: true,
- ds: uploads_store,
- cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
- sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
- viewConfig: {
- forceFit: true
- },
- bbar: [{
- text: 'Clear',
- width: '100%',
- handler: function(){
- muploader.splice();
- uploads_store.removeAll();
- }
- }]
- },{
- xtype:'button',
- id: 'umpalumpa',
- width: '100%',
- disabled: true,
- text: 'Upload',
- handler: function(){
- if( muploader!= null ){
- muploader.start();
- };
- }
- }],
- listeners:{
- afterrender: function(){
- muploader = new plupload.Uploader({
- runtimes : 'html5,html4',
- browse_button : Ext.getDom('pickfiles'), // you can pass in id...
- //container: document.getElementById('upupu'), // ... or DOM Element itself
- max_file_size : '1000mb',
- chunk_size: '200kb',
- max_retries: 3,
- multi_selection: false,
- max_file_count: 1,
- // Fake server response here
- url: '/lib/php/setup_toolkit/upload.php',
- //url: "/echo/json",
-
- //flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',
- //silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap',
- filters : [
- //{title : "Image files", extensions : "jpg,gif,png"},
- {title : "Archive files", extensions : "rar,zip,gz,bz2"}
- ],
-
- init: {
- PostInit: function() {
- //$('filelist').innerHTML = '';
-
- //$('uploadfiles').onclick = function() {
- // uploader.start();
- // return false;
- //};
- },
-
- FilesAdded: function( up, files ) {
- Ext.getCmp('umpalumpa').enable();
- plupload.each( files, function(file) {
- uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
- uploads_store_id++;
- Ext.getCmp('upload_grid').doLayout();
- });
- },
-
- UploadProgress: function(up, file) {
- var pb = Ext.getCmp( 'progress_'+file.id );
- if( file.percent < 100 ){
- pb.updateProgress( file.percent / 100, file.percent + '%', false );
- } else {
- pb.updateProgress( 1.0, 'Uploaded', false );
- };
- },
-
- Error: function(up, err) {
- Ext.Msg.show({
- title:'Upload Status',
- msg: "Error #" + err.code + ": " + err.message,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.ERROR
- });
- }
- }
- });
- muploader.init();
- }
- }
- }]
- }]
- });
- muploader = null;
- uploads_store.removeAll();
- tPanel.doLayout();
- archives_store.load();//{params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
- updateTaskStatus();
- tlInterval = window.setInterval( updateTaskStatus, 333 );
-};
\ No newline at end of file
diff --git a/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js b/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
deleted file mode 100644
index 84ebee2..0000000
--- a/lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
+++ /dev/null
@@ -1,1170 +0,0 @@
-//
-
-
-
-var resourceInfoWindow = null;
-var settingsAreChanged = false;
-var settingsChanged = [];
-
-function settingsChangeNotifier( A ){
- settingsAreChanged = true;
- if( !settingsChanged.includes( A ) ){
- settingsChanged[settingsChanged.length] = A;
- };
-};
-
-function cleanupChangeNotifier(){
- settingsAreChanged = false;
- settingsChanged = [];
-};
-
-function removeAllFromSite(){
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_CLEAR_SITE_');?>',
- msg: '=$Labels->GetLabel('_SITE_DEL_ALL_ABO_');?>',
- buttons: Ext.Msg.YESNO,
- icon: Ext.MessageBox.WARNING,
- fn: function(btn, text){
- if (btn == 'yes'){
- Ext.Ajax.request({
- url: '/lib/controller/resetAllSettings.php',
- params: {
- SAID: SelectedSite,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- doRefresh();
- },
- failure: failureAJAXFunction
- });
- };
- }
- });
-};
-
-function showResourceInfo( rid ){
- Ext.Ajax.request({
- url: '/lib/controller/getResourceInfo.php',
- params: {
- RID: rid,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( resourceInfoWindow == null ){
- resourceInfoWindow = new Ext.Window({
- title: '=$Labels->GetLabel('_RES_INFO_');?>',
- modal: true,
- width: 800,
- height: 400,
- resizable: false,
- layout: 'fit',
- closeAction: 'hide',
- items: [],
- buttons:[{
- text: `close`,
- handler: function(){
- resourceInfoWindow.hide();
- }
- }]
- });
- };
- resourceInfoWindow.removeAll( true );
- resourceInfoWindow.add( data );
- resourceInfoWindow.show();
- },
- failure: failureAJAXFunction
- });
-};
-
-var settingsWindow = null;
-function showSettings( nid, tab = 0 ){
- Ext.Ajax.request({
- url: '/lib/controller/getNodeSettings.php',
- params: {
- NID: nid,
- TAB: tab,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- if( settingsWindow == null ){
- settingsWindow = new Ext.Window({
- title: '=$Labels->GetLabel('_SETTINGS_');?>',
- modal: true,
- resizable: false,
- width: 800,
- height: 400,
- layout: 'fit',
- closeAction: 'hide',
- items: [],
- buttons:[{
- text: `=$Labels->GetLabel('_CLOSE_');?>`,
- handler: function(){
- if( settingsAreChanged ){
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
- msg: '=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
- buttons: Ext.Msg.YESNO,
- icon: Ext.MessageBox.WARNING,
- fn: function(btn, text){
- if( btn == 'yes' ){
- cleanupChangeNotifier();
- settingsWindow.hide();
- } else {
- var TT = Ext.getCmp('node_settings_content');
- TT.updateSettings();
- };
- }
- });
- } else {
- settingsWindow.hide();
- };
- }
- }]
- });
- };
- settingsWindow.show();
- settingsWindow.removeAll( true );
- settingsWindow.add( data );
- settingsWindow.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-function editResource( rid ){
- var loadEditor = true;
- if( settingsAreChanged ){
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
- msg: '=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
- buttons: Ext.Msg.YESNO,
- icon: Ext.MessageBox.WARNING,
- fn: function(btn, text){
- if( btn == 'yes' ){
- cleanupChangeNotifier();
- } else {
- loadEditor = false;
- };
- }
- });
- };
- if( loadEditor ){
- Ext.Ajax.request({
- url: '/lib/controller/getResourceEditor.php',
- params: {
- RID: rid,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var resourceEdPanel = Ext.getCmp('res_ed_small');
- if( resourceEdPanel ){
- resourceEdPanel.removeAll( true );
- resourceEdPanel.add( data );
- resourceEdPanel.doLayout();
- };
- },
- failure: failureAJAXFunction
- });
- };
-};
-
-function editModule( mid ){
- var loadEditor = true;
- if( settingsAreChanged ){
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
- msg: '=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
- buttons: Ext.Msg.YESNO,
- icon: Ext.MessageBox.WARNING,
- fn: function(btn, text){
- if( btn == 'yes' ){
- cleanupChangeNotifier();
- } else {
- loadEditor = false;
- };
- }
- });
- };
- if( loadEditor ){
- Ext.Ajax.request({
- url: '/lib/controller/getModuleEditor.php',
- params: {
- MID: mid,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var moduleEdPanel = Ext.getCmp('mod_ed_small');
- if( moduleEdPanel ){
- moduleEdPanel.removeAll( true );
- moduleEdPanel.add( data );
- moduleEdPanel.doLayout();
- };
- },
- failure: failureAJAXFunction
- });
- };
-};
-
-function editWidthTable( did ){
- var loadEditor = true;
- if( settingsAreChanged ){
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
- msg: '=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
- buttons: Ext.Msg.YESNO,
- icon: Ext.MessageBox.WARNING,
- fn: function(btn, text){
- if( btn == 'yes' ){
- cleanupChangeNotifier();
- } else {
- loadEditor = false;
- };
- }
- });
- };
- if( loadEditor ){
- Ext.Ajax.request({
- url: '/lib/controller/getWidthTableEditor.php',
- params: {
- DID: did,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var resourceEdPanel = Ext.getCmp('dep_ed_small');
- if( resourceEdPanel ){
- resourceEdPanel.removeAll( true );
- resourceEdPanel.add( data );
- resourceEdPanel.doLayout();
- };
- },
- failure: failureAJAXFunction
- });
- };
-};
-
-function renderer_mask_0( a ){ return ( a & 1 )?' ':' ';};
-function renderer_mask_1( a ){ return ( a & ( 1 << 1 ) )?' ':' ';};
-function renderer_mask_2( a ){ return ( a & ( 1 << 2 ) )?' ':' ';};
-function renderer_mask_3( a ){ return ( a & ( 1 << 3 ) )?' ':' ';};
-function renderer_mask_4( a ){ return ( a & ( 1 << 4 ) )?' ':' ';};
-
-function renderer_day_0( a ){ return ( a & 1 )?' ':'';};
-function renderer_day_1( a ){ return ( a & ( 1 << 1 ) )?' ':'';};
-function renderer_day_2( a ){ return ( a & ( 1 << 2 ) )?' ':'';};
-function renderer_day_3( a ){ return ( a & ( 1 << 3 ) )?' ':'';};
-function renderer_day_4( a ){ return ( a & ( 1 << 4 ) )?' ':'';};
-function renderer_day_5( a ){ return ( a & ( 1 << 5 ) )?' ':'';};
-function renderer_day_6( a ){ return ( a & ( 1 << 6 ) )?' ':'';};
-function renderer_day_s( a ){ return ( a & ( 1 << 7 ) )?' ':'';};
-
-function editMaskSchedule( did ){
- var loadEditor = true;
- if( settingsAreChanged ){
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
- msg: '=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
- buttons: Ext.Msg.YESNO,
- icon: Ext.MessageBox.WARNING,
- fn: function(btn, text){
- if( btn == 'yes' ){
- cleanupChangeNotifier();
- } else {
- loadEditor = false;
- };
- }
- });
- };
- if( loadEditor ){
- Ext.Ajax.request({
- url: '/lib/controller/getMaskScheduleEditor.php',
- params: {
- DID: did,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var resourceEdPanel = Ext.getCmp('dep_ed_small');
- if( resourceEdPanel ){
- resourceEdPanel.removeAll( true );
- resourceEdPanel.add( data );
- resourceEdPanel.doLayout();
- };
- },
- failure: failureAJAXFunction
- });
- };
-};
-
-function reloadNetworkData(){
- Ext.Ajax.request({
- url: '/lib/controller/getNetwork.php',
- params: {
- NID: SelectedSite,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- netwodkData.nodes = new vis.DataSet( data.nodes );
- netwodkData.edges = new vis.DataSet( data.edges );
- networkObj.setData( netwodkData );
- networkObj.redraw();
- },
- failure: failureAJAXFunction
- });
-};
-
-function createNode( STYPE ){
- Ext.Ajax.request({
- url: '/lib/controller/addNetworkNode.php',
- params: {
- NID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- TYPE: STYPE
- },
- success: function( response, opts ){
- reloadNetworkData( =$SiteID;?> );
- },
- failure: failureAJAXFunction
- });
-};
-
-function removeModule( ID ){
- Ext.Msg.show({
- title:'Q!',
- msg: 'Are you sure delete this Module?',
- buttons: Ext.Msg.YESNOCANCEL,
- fn: function( btn, text ){
- if( btn == 'yes' ){
- Ext.Ajax.request({
- url: '/lib/controller/doModuleOperation.php',
- params: {
- OPID: 1,
- MID: ID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function(){
- showSettings( SelectedNodeID, 2 );
- }
- });
- };
- },
- icon: Ext.MessageBox.QUESTION
- });
-};
-
-function enableModule( ID ){
- Ext.Ajax.request({
- url: '/lib/controller/doModuleOperation.php',
- params: {
- OPID: 2,
- OPCODE: 1,
- MID: ID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function(){
- showSettings( SelectedNodeID, 2 );
- }
- });
-};
-
-function disableModule( ID ){
- Ext.Ajax.request({
- url: '/lib/controller/doModuleOperation.php',
- params: {
- OPID: 2,
- OPCODE: 0,
- MID: ID,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function(){
- showSettings( SelectedNodeID, 2 );
- }
- });
-};
-
-var addSensor_window = null;
-function addSerialSensor( sensorType ){
- if( addSensor_window!= null ){
- addSensor_window.hide();
- addSensor_window.destroy();
- addSensor_window = null;
- };
- var TTL = '';
- var IMG = '';
- switch( sensorType ){
- case 1: TTL = '=$Labels->GetLabel("_DLG_ADD_ALS_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzrm9.png'; break;
- case 2: TTL = '=$Labels->GetLabel("_DLG_ADD_LFS_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzqb2.png'; break;
- case 3: TTL = '=$Labels->GetLabel("_DLG_ADD_PLS200_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzqh3.png'; break;
- case 4: TTL = '=$Labels->GetLabel("_DLG_ADD_PLS360_");?>'; IMG = '/style/assets/!cid_ii_jvmzuzqx6.png'; break;
- };
- addSensor_window = new Ext.Window({
- modal: true,
- title: TTL,
- width: 400,
- height: 400,
- layout: 'fit',
- closeAction: 'hide',
- items:[{
- xtype: 'form',
- frame: false,
- border: false,
- hideLabels: false,
- labelAlign: 'right', // or 'right' or 'top'
- //labelSeparator: '>>', // takes precedence over layoutConfig value
- labelWidth: 160, // defaults to 100
- labelPad: 8, // defaults to 5, must specify labelWidth to be honored
- items:[{
- xtype:'panel',
- frame: false,
- border: false,
- html: ' ',
- height: '200px'
- },{
- html: ' ',
- frame: false,
- border: false,
- },{
- fieldLabel: '=$Labels->GetLabel('_DEVICE_NAME_');?>',
- xtype: 'textfield',
- width: 200,
- id: 'p200_dev_name',
- allowBlank: false
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('_SENSOR_MAX_RANGE_');?>',
- lazyRender: true,
- id: 'p200_range',
- width: 200,
- mode: 'local',
- disabled: false,
- forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
- store: new Ext.data.ArrayStore({
- fields: ['range','range_txt'],
- data: [[35,'35'],[60,'60'],[120,'120'],[150,'150'],[160,'160'],[200,'200'],[300,'300']]
- }),
- valueField: 'range',
- displayField: 'range_txt'
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('_UART_PORT_');?>',
- lazyRender: true,
- id: 'p200_uart_id',
- width: 200,
- disabled: false,
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: UartListStore,
- valueField: 'uart_id',
- displayField: 'uart_name'
- },{
- fieldLabel: '=$Labels->GetLabel('_PROTO_DEVICE_ID_');?>',
- xtype: 'numberfield',
- id: 'p200_dev_id',
- width: 200,
- allowBlank: false,
- allowNegative: false,
- minValue: 0,
- maxValue: 255
- }],
- bbar:[ '->',{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- addSensor_window.hide();
- }
- },{
- text: '=$Labels->GetLabel('_ADD_');?>',
- handler: function(){
- var uart_id_val = Ext.getCmp('p200_uart_id').getValue();
- var dev_id_val = Ext.getCmp('p200_dev_id').getValue();
- var sname = Ext.getCmp('p200_dev_name').getValue();
- var range = parseInt( Ext.getCmp('p200_range').getValue());
- if( sname != '' && uart_id_val != '' && range > 0 ){
- var uart_id = parseInt( uart_id_val );
- var dev_id = parseInt( dev_id_val );
- Ext.Ajax.request({
- url: '/lib/controller/addNetworkNode.php',
- params: {
- SITEID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- TYPE: sensorType,
- SNAME: sname,
- RANGE: range,
- UART: uart_id,
- DEVID: dev_id
- },
- success: function( response, opts ){
- addSensor_window.hide();
- reloadNetworkData( =$SiteID;?> );
- },
- failure: failureAJAXFunction
- });
- } else {
- playSound();
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_WRO_VALUES_');?>',
- msg: '=$Labels->GetLabel('_WRO_VAL_MSG_');?>',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- };
- }
- }]
- }]
- });
- if( addSensor_window != null ){
- addSensor_window.show();
- };
-};
-
-var add3D_window = null;
-function addSensor_3D(){
- if( add3D_window == null ){
- add3D_window = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel("_DLG_ADD_3DSENS_");?>',
- width: 400,
- height: 400,
- layout: 'fit',
- closeAction: 'hide',
- items:[{
- xtype: 'form',
- frame: false,
- border: false,
- hideLabels: false,
- labelAlign: 'right', // or 'right' or 'top'
- //labelSeparator: '>>', // takes precedence over layoutConfig value
- labelWidth: 160, // defaults to 100
- labelPad: 8, // defaults to 5, must specify labelWidth to be honored
- items:[{
- xtype:'panel',
- frame: false,
- border: false,
- html: ' ',
- height: '200px'
- },{
- html: ' ',
- frame: false,
- border: false,
- },{
- fieldLabel: '=$Labels->GetLabel('_DEVICE_NAME_');?>',
- xtype: 'textfield',
- width: 200,
- id: 's3d_dev_name',
- allowBlank: false
- },{
- xtype: 'combo',
- fieldLabel: '=$Labels->GetLabel('_DLG_CON_SEVER_NODE_');?>',
- lazyRender: true,
- id: 's3d_server',
- width: 200,
- disabled: false,
- forceSelection: true,
- triggerAction: 'all',
- editable: false,
- disableKeyFilter: true,
- store: ServerListStore,
- valueField: 'server_id',
- displayField: 'server_name'
- },{
- fieldLabel: '=$Labels->GetLabel('_DEVICE_IP_');?>',
- xtype: 'textfield',
- id: 's3d_dev_addr',
- width: 200,
- allowBlank: false
- },{
- fieldLabel: '=$Labels->GetLabel('_DEVICE_PORT_');?>',
- xtype: 'numberfield',
- id: 's3d_dev_port',
- width: 200,
- allowBlank: false,
- allowNegative: false,
- value: 2222,
- minValue: 1000,
- maxValue: 65535
- }],
- bbar:[ '->',{
- text: '=$Labels->GetLabel('_CANCEL_');?>',
- handler: function(){
- add3D_window.hide();
- }
- },{
- text: '=$Labels->GetLabel('_ADD_');?>',
- handler: function(){
- var dev_addr = Ext.getCmp('s3d_dev_addr').getValue();
- var dev_port = parseInt( Ext.getCmp('s3d_dev_port').getValue() );
- var dev_server = parseInt( Ext.getCmp('s3d_server').getValue() );
- var dev_name = Ext.getCmp('s3d_dev_name').getValue();
- if( dev_name != '' && dev_addr != '' && dev_port > 0 && dev_server > 0 ){
- Ext.Ajax.request({
- url: '/lib/controller/addNetworkNode.php',
- params: {
- SITEID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- TYPE: 5,
- SNAME: dev_name,
- PORT: dev_port,
- ADDR: dev_addr,
- SERVER: dev_server
- },
- success: function( response, opts ){
- add3D_window.hide();
- // If the response is JSON, you have to decode it
- reloadNetworkData( =$SiteID;?> );
- },
- failure: failureAJAXFunction
- });
- } else {
- playSound();
- Ext.Msg.show({
- title:'=$Labels->GetLabel('_WRO_VALUES_');?>',
- msg: '=$Labels->GetLabel('_WRO_VAL_MSG_');?>',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- };
- }
- }]
- }]
- });
- };
- add3D_window.show();
-};
-
-
-function loadNodeSockets( NID, store ){
- Ext.Ajax.request({
- url: '/lib/controller/listNodeSockets.php',
- params: {
- NID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- DID: NID
- },
- success: function( response, opts ){
- var data = Ext.decode( response.responseText );
- if( data['success'] == true ){
- store.loadData( data, false );
- } else {
- Ext.Msg.show({
- title: '=$Labels->GetLabel('_ERROR_MSG_TITLE_');?>',
- msg: data['error'],
- buttons: Ext.Msg.OK,//YESNOCANCEL,
- //fn: processResult,
- //animEl: 'elId',
- icon: Ext.MessageBox.ERROR //QUESTION
- });
- };
- //Ext.getCmp('zigzag').getEl().unmask();
- },
- failure: failureAJAXFunction
- });
-};
-
-function createConnection( SID, EID, CTY ){
- if( addConnectionDialog == null ){
- addConnectionDialog = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel('_ADD_CONNECTION_');?>',
- width: 773,
- height: 600,
- layout: 'hbox',
- closeAction: 'hide',
- listeners:{
- beforehide : function(){
- Ext.getCmp('connectstarterbutton').toggle( false, false );
- }
- },
- items:[{
- xtype: 'grid',
- width: 380,
- height: 400,
- ds: A_socketsListStore,
- cm: socketListColModel,
- sm: A_socketSelModel
- },{
- xtype: 'grid',
- width: 380,
- height: 400,
- ds: B_socketsListStore,
- cm: socketListColModel,
- sm: B_socketSelModel
- }],
- bbar: [{
- text: '=$Labels->GetLabel("_CANCEL_");?>',
- handler: function(){
- addConnectionDialog.hide();
- }
- },{
- id: 'con_to_src',
- text: '=$Labels->GetLabel("_ADD_");?>',
- disabled: true,
- handler: function(){
- if( selected_A_socket != null && selected_B_socket != null ){
- Ext.Ajax.request({
- url: '/lib/controller/addConnection.php',
- params: {
- NID: =$SiteID;?>,
- SNID: SID,
- SOSID: selected_A_socket.id,
- ENID: EID,
- SOEID: selected_B_socket.id,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.status ){
- //reloadNetworkData( NID );
- netwodkData.edges.add( data.edge );
- } else {
- startCreateConnection();
- //alert( data.message );
- };
- Ext.getCmp('connectstarterbutton').toggle( false, false );
- },
- failure: failureAJAXFunction
- });
- };
- }
- }]
- });
- };
- loadNodeSockets( SID, A_socketsListStore );
- loadNodeSockets( EID, B_socketsListStore );
- addConnectionDialog.show();
-};
-
-function loadNodeProperties( NodeID ){
- SelectedNodeID = NodeID;
- Ext.Ajax.request({
- url: '/lib/controller/getNetworkNodeProps.php',
- params: {
- NID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- NODE: NodeID
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( data );
- tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-var mp_FlyHunterWindow = null;
-
-function module_prop_FlyHunter( module_id ){
- if( mp_FlyHunterWindow == null ){
- mp_FlyHunterWindow = new Ext.Window({
- modal: true,
- title: '=$Labels->GetLabel('_FHM_PROPS_');?>',
- width: 773,
- height: 600,
- layout: 'table',
- closeAction: 'hide',
- flex: 1,
- defaults: {
- bodyStyle:'padding:20px'
- },
- layoutConfig: {
- // The total column count must be specified here
- columns: 2
- },
- items:[{
- html: 'Radio LINK UART Port'
- },{
- xtype: 'combo',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 0,
- fields: ['myId', 'displayText' ],
- data: [ Query( $QS );
- if( count( $RR ) ){
- $RE=array();
- foreach( $RR as $R ){
- $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
- };
- echo implode( ',', $RE );
- } else {
- echo "[0, '".$Labels->GetLabel('_NO_UARTS_DEF_')."']";
- };
- ?>]
- }),
- valueField: 'myId',
- displayField: 'displayText'
- },{
- html: 'ChakaLaka DC Channel'
- },{
- xtype: 'combo',
- editable: false,
- typeAhead: true,
- triggerAction: 'all',
- lazyRender:true,
- mode: 'local',
- store: new Ext.data.ArrayStore({
- id: 1,
- fields: ['myId', 'displayText' ],
- data: [ Query( $QS );
- $RR=array();
- if( count( $RR ) ){
- $RE=array();
- foreach( $RR as $R ){
- $RE[] = "[ {$R['id']}, '{$R['serial_id']}_{$R['channel_id']}']";
- };
- echo implode( ',', $RE );
- } else {
- echo "[0, '".$Labels->GetLabel('_NO_DCB_DEF_')."']";
- };
- ?>]
- }),
- valueField: 'myId',
- displayField: 'displayText'
- }],
- bbar:[{
- text:'cancel'
- },{
- text:'submit'
- }]
- });
- };
- mp_FlyHunterWindow.show();
- Ext.Ajax.request({
- url: '/lib/controller/getModuleProps.php',
- params: {
- NID: =$SiteID;?>,
- UID: =$UserID;?>,
- SID: '=$Session;?>',
- MODULE: module_id
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- var tPanel = Ext.getCmp('prop_content');
- tPanel.remove(0);
- tPanel.add( data );
- tPanel.doLayout();
- },
- failure: failureAJAXFunction
- });
-};
-
-function loadSystemEditor(){
- if( tlInterval!= null ){
- window.clearInterval( tlInterval );
- tlInterval = null;
- timelineObj = null;
- };
- setUserContent( 3 );
- var tPanel = Ext.getCmp('main_portal');
- tPanel.removeAll( true );
- Ext.getCmp('main_content').setTitle( '=$Labels->GetLabel('_SYS_MAP_');?>' );
- tPanel.add({
- columnWidth: 0.83,
- frame: false,
- border: false,
- items: [{
- xtype: 'panel',
- layout: 'fit',
- layoutConfig: {
- align : 'stretch',
- pack : 'start'
- //padding:'5',
- //align:'middle'
- },
- height: PanelH-5,
- flex: 1,
- frame: false,
- border: false,
- items:{
- id: 'sys_map'
- },
- tbar: [{
- xtype: 'splitbutton',
- text: '=$Labels->GetLabel('_SMM_ADD_LSEN_');?>',
- split: true,
- enableToggle : undefined,
- menu : {
- items: [{
- text:'ALS',
- icon: '/style/assets/!cid_ii_jvmzuzrq10.png',
- handler: function(){
- addSerialSensor( 1 );
- }
- },{
- text:'LFS',
- icon: '/style/assets/!cid_ii_jvmzuzpt0.png',
- handler: function(){
- addSerialSensor( 2 );
- }
- },{
- text:'PLS-200',
- icon: '/style/assets/!cid_ii_jvmzuzql4.png',
- handler: function(){
- addSerialSensor( 3 );
- }
- },{
- text:'PLS-360',
- icon: '/style/assets/!cid_ii_jvmzuzr87.png',
- handler: function(){
- addSerialSensor( 4 );
- }
- },{
- text:'3DLIDAR',
- icon: '/style/assets/unnamed34.png',
- handler: function(){
- addSensor_3D();
- }
- }]
- }
- },{
- xtype: 'splitbutton',
- text: '=$Labels->GetLabel('_SMM_ADD_ADDIT_');?>',
- split: true,
- enableToggle : true,
- menu : {
- items: [{
- text:'Argus Event Server',
- icon: '/style/assets/0_node.png',
- handler: function(){
- addServer();
- }
- },{
- text:'Static Analog Camera',
- icon: '/style/assets/11_node.png',
- handler: function(){
- SelectedCamTYPE = 10;
- addAnalogCam();
- }
- },{
- text:'PTZ Analog Camera',
- icon: '/style/assets/12_node.png',
- handler: function(){
- SelectedCamTYPE = 11;
- addAnalogCam();
- }
- },{
- text:'Static IP Camera',
- icon: '/style/assets/11_node.png',
- handler: function(){
- SelectedCamTYPE = 12;
- addIpCam();
- }
- },{
- text:'PTZ IP Camera',
- icon: '/style/assets/12_node.png',
- handler: function(){
- SelectedCamTYPE = 13;
- addIpCam();
- }
- },{
- text:'DVR/Video Server/Streamer',
- icon: '/style/assets/videoServer.png',
- handler: function(){
- addMediaServer();
- }
- },{
- text:'Network Video Recorder',
- icon: '/style/assets/15_node.png'
- },{
- text:'Ethernet to UART transeiver',
- icon: '/style/assets/eth2uart.png',
- handler: function(){
- addEthernet2Uart();
- }
- },{
- text:'DC to Ethernet (ADAM)',
- icon: '/style/assets/adam-1.png',
- }]
- }
- },{
- xtype: 'button',
- id: 'deletecomponentbutton',
- text: 'Remove Component',
- enableToggle: true,
- handler: function(){
- if( InComponentRemoveMode ){
- Ext.getCmp('deletecomponentbutton').toggle( false, false );
- InComponentRemoveMode = false;
- } else {
- Ext.getCmp('deletecomponentbutton').toggle( true, true );
- InComponentRemoveMode = true;
- };
- }
- },{
- xtype: 'button',
- id:'deleteallcomponents',
- text: '=$Labels->GetLabel('_CLEAR_SITE_');?>',
- handler: removeAllFromSite
- }]
- }]
- });
- tPanel.add({
- title: '=$Labels->GetLabel('_PROPERTIES_');?>',
- xtype: 'panel',
- flex: 1,
- height: PanelH-5,
- //width: 210,
- columnWidth: 0.17,
- layout: 'fit',
- frame: false,
- id: 'prop_content',
- border: false,
- items:[{
- html:'=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?>
'
- }]
- });
- tPanel.doLayout();
-
- Ext.Ajax.request({
- url: '/lib/controller/getNetwork.php',
- params: {
- NID: SelectedSite,
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- // If the response is JSON, you have to decode it
- var data = Ext.decode(response.responseText);
- netwodkData.nodes = new vis.DataSet( data.nodes );
- netwodkData.edges = new vis.DataSet( data.edges );
- var container = document.getElementById(Ext.getCmp('sys_map').body.id);
- networkObj = new vis.Network(container, netwodkData, networkOpts );
- networkObj.on("click", function (params) {
- //if(!connectionAddMode){
- if( !InComponentRemoveMode ){
- if( params.nodes.length > 0 ){
- loadNodeProperties( params.nodes[0] );
- } else if( params.edges.length > 0 ){
- selectedConnection = netwodkData.edges.get(params.edges[0]);
- loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
- };
- } else {
- if( params.nodes.length > 0 ){
- if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
- Ext.Msg.show({
- title:'Remove Server Component!',
- msg: 'You can not remove Server component!',
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- } else {
- Ext.Msg.show({
- title:'Remove Component?',
- msg: 'You are about to remove. Are you sure to do so?',
- buttons: Ext.Msg.YESNOCANCEL,
- fn: function( result ){
- if( result=='yes' ){
- Ext.Ajax.request({
- url: '/lib/controller/removeNode.php',
- params: {
- SAID: =$SiteID;?>,
- NID: params.nodes[0],
- UID: =$UserID;?>,
- SID: '=$Session;?>'
- },
- success: function( response, opts ){
- var data = Ext.decode(response.responseText);
- if( data.sucess == false ){
- Ext.Msg.show({
- title:'Request Failure!',
- msg: data.error,
- buttons: Ext.Msg.OK,
- icon: Ext.MessageBox.INFO
- });
- } else {
- stopCreateConnection();
- InComponentRemoveMode = false;
- loadSystemEditor();
- };
- },
- failure: failureAJAXFunction
- });
- };
- },
- //animEl: 'elId',
- icon: Ext.MessageBox.QUESTION
- });
- };
- };
- };
- //};
- });
- /*
- networkObj.on("doubleClick", function (params) {
- //if(!connectionAddMode){
- if( !InComponentRemoveMode ){
- if( params.nodes.length > 0 ){
- loadNodeProperties( params.nodes[0] );
- } else if( params.edges.length > 0 ){
- selectedConnection = netwodkData.edges.get(params.edges[0]);
- loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
- };
- } else {
- alert( 'Remove' );
- };
- //};
- });
- */
- /*
- networkObj.on("dragStart", function (params) {
- if( connectionAddMode ){
- var tID = this.getNodeAt(params.pointer.DOM);
- if( tID != undefined ){
- newConnectionStart = tID;
- };
- };
- });
- networkObj.on("dragEnd", function (params) {
- if( connectionAddMode ){
- var tID = this.getNodeAt(params.pointer.DOM);
- if( tID != undefined ){
- newConnectionEnd = tID;
- //selectedConnection = netwodkData.edges[netwodkData.edges.length];
- //selectedConnection.color = {
- // color: '#ff0000',
- // opacity: 0.3,
- // highlight: 'blue'
- //};
- //networkObj.addEdgeMode(0);
- createConnection( newConnectionStart, newConnectionEnd );
- connectionAddMode = false;
- };
- };
- });
- */
- },
- failure: failureAJAXFunction
- });
-};
diff --git a/lib/javascript/jsapi_dynamic/testus.js b/lib/javascript/jsapi_dynamic/testus.js
deleted file mode 100644
index 38b8cbb..0000000
--- a/lib/javascript/jsapi_dynamic/testus.js
+++ /dev/null
@@ -1,29 +0,0 @@
-http://192.168.1.82:9989/onvif…..;subtype=0
-
-subtype=
-
-0 for Main Stream
-
-1 for Extra Stream ;)
-
-
-
\ No newline at end of file
diff --git a/lib/php/argus/server.php b/lib/php/argus/server.php
index d45b9e2..97c21ed 100644
--- a/lib/php/argus/server.php
+++ b/lib/php/argus/server.php
@@ -188,7 +188,7 @@ $SVG['C']['U']=<<
-
+
@@ -209,8 +209,8 @@ $SVG['C']['U']=<<
-
-
+
+
@@ -220,10 +220,10 @@ $SVG['C']['U']=<<{$RTitle}
DATA_BIUNDARY;
-$SVG['C'][1]=<<
+$SVG['C']['B']=<<
-
+
@@ -233,7 +233,7 @@ $SVG['C'][1]=<<
-
+
@@ -251,18 +251,21 @@ $SVG['C'][1]=<<
-
-
-
-
+
+
+
+
+
-
-
-
- {$Title}
+
+
+
+
+ {$LTitle}
+ {$RTitle}
DATA_BIUNDARY;
-$SVG['C'][2]=<<
@@ -304,7 +307,7 @@ $SVG['C'][2]=<<{$Title}
DATA_BIUNDARY;
-$SVG['C'][3]=<<
@@ -895,7 +898,8 @@ function getPlatformName( $id ){
function getOnlineStatus( $mid ){
global $DATABASE;
if( $mid ){
- $QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10";
+ $CTS = time() - 3; // 3 seconds lag
+ $QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10 AND `ts`>={$CTS}";
$RV = $DATABASE->Query( $QS, false );
return ( count( $RV ) > 0 );
};
@@ -926,7 +930,7 @@ DATA_BOUNDARY;
return "{ xtype:'panel', border: false, frame: false, html: '". str_ireplace( "\n",'', $AA )."'}";
};
-function createChopLabel( $line1, $line2, $Lines, $Track="", $color_class="", $oncli="" ){
+function createChopLabel( $line1, $line2, $Lines, $Track="", $color_class="", $oncli="", $atds="", $id ='' ){
if( $Track!=''){
$TR_INS=<<{$Track}
@@ -934,15 +938,25 @@ DATA_BOUNDARY;
} else {
$TR_INS = '';
};
+if( $atds!= "" ){
+ if( is_array( $atds ) ){
+ $ADDTD=' ';
+ foreach( $atds as $A ) $ADDTD.=''.$A.' ';
+ } else {
+ $ADDTD=' '.$atds.' ';
+ };
+} else {
+ $ADDTD='';
+};
if( $oncli!=''){
$ACTION ='onclick="'.$oncli.';"';
} else {
$ACTION ='';
};
$AA=<<
+
- {$line1} {$TR_INS}
+ {$line1} {$TR_INS}{$ADDTD}
{$line2}
diff --git a/lib/php/argus/templates.php b/lib/php/argus/templates.php
index 0aa77a1..8233d15 100644
--- a/lib/php/argus/templates.php
+++ b/lib/php/argus/templates.php
@@ -340,7 +340,7 @@ $PLATFORM_PLATFORM_CTX=<<
'
+ }],
+ listeners:{
+ afterrender: function( p ){
+ var zz = p.findParentByType('panel');
+ var xx = zz.getInnerWidth() * 450 / 1600;
+ var yy = xx * 1600 / 900;
+ p.setWidth( yy );
+ p.setHeight( xx + 32 );
+ //var z = Ext.getCmp('j_video_%%MID%%');
+ //z.setHeight( xx );
+ //z.setWidth( yy );
+ //var jv = document.getElementById('video_player_%%MID%%');
+ //jv.setAttribute('height', ''+xx);
+ //jv.setAttribute('width', ''+yy);
+ }
+ }
+}
+DATA_BOUNDARY;
+
+$EMPTY_NO_AC_VIDEO_CTX=<<Query( "UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ", false );
} else {
- $CTS = time();
- //$DATABASE->Query( "UPDATE users SET login_ts={$CTS}, SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
- $DATABASE->Query( "UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
+ if( $this->Data['id'] > 2 ){
+ $CTS = time();
+ $DATABASE->Query( "UPDATE users SET login_ts={$CTS}, SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
+ } else {
+ $DATABASE->Query( "UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
+ };
};
$LOG->login();
return true;
diff --git a/lib/version.var b/lib/version.var
index 14e4cd2..082ad2d 100644
--- a/lib/version.var
+++ b/lib/version.var
@@ -1 +1 @@
-20241231
\ No newline at end of file
+20251012
\ No newline at end of file
diff --git a/style/assets/bul_green_rst.png b/style/assets/bul_green_rst.png
index 59b7b19..9d2b20b 100644
Binary files a/style/assets/bul_green_rst.png and b/style/assets/bul_green_rst.png differ
diff --git a/style/style.css b/style/style.css
index 2fd762c..8aba79d 100644
--- a/style/style.css
+++ b/style/style.css
@@ -1091,6 +1091,17 @@ A.CalendarDS:hover {
background-position: 10px 10px;
background-size: 110px 110px;
}
+.appis_logo_img{
+ display: block;
+ border-radius: 64px;
+ width: 128px;
+ height: 128px;
+ background-color: #4169e1;
+ background-image: url('wicons/025.png');
+ background-repeat: no-repeat;
+ background-position: 10px 10px;
+ background-size: 110px 110px;
+}
.server_img_set{
display: block;
border-radius: 128px;
@@ -2030,6 +2041,36 @@ input[type="range"]:focus::-moz-range-thumb {
color: silver;
background-color: #232d38;
}
+.mon_scada_status_tag_ok{
+ display: block;
+ border-radius: 5px;
+ font: bold 9px arial;
+ width: 120px;
+ padding: 5px;
+ text-align: center;
+ margin-top: 3px;
+ margin-bottom: 3px;
+ color: yellow;
+ background-color: darkgreen;
+}
+.mon_scada_head_ok{
+ font-size: 9px!important;
+ font-weight: bold!important;
+ text-align: center;
+ width: 70px;
+ border-radius: 5px;
+ color: yellow;
+ background-color: darkgreen;
+}
+.mon_scada_head_active{
+ font-size: 9px!important;
+ font-weight: bold!important;
+ text-align: center;
+ width: 70px;
+ border-radius: 5px;
+ color: white;
+ background-color: red;
+}
.mon_module_btn{
border-radius: 5px;
cursor: pointer;
@@ -2145,4 +2186,7 @@ input[type="range"]:focus::-moz-range-thumb {
width: 135px;
overflow: hidden;
+}
+.aaBB{
+ height: 12px;
}
\ No newline at end of file