From 14f956e481df6f95cfdbb5f7eb5606e518459720 Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Fri, 25 Aug 2023 08:05:40 -0700 Subject: [PATCH] GeoZones Works in Mojo --- index.php | 6 +- lib/controller/dash/node_1.js | 322 +++++++-- lib/controller/data/mysqlitedb.db | Bin 319488 -> 319488 bytes lib/controller/doSensorOperation.php | 2 +- lib/controller/getDashBoardItems.php | 74 +- lib/controller/getGeoAlerts.php | 63 ++ lib/controller/getGeoZones.php | 647 ++++++++++++++++++ lib/controller/getSensorEditor.php | 3 +- lib/javascript/jsapi_dynamic/mojo_main.js | 19 +- lib/javascript/jsapi_dynamic/mojo_map.js | 326 +++++++++ .../jsapi_dynamic/mojo_monitoring.js | 2 +- lib/javascript/jsapi_dynamic/mojo_reports.js | 227 +----- lib/javascript/jsapi_dynamic/mojo_settings.js | 5 +- lib/javascript/jsapi_dynamic/rgoose_map.js | 0 ...g => 20f21b4f01f1b7587f728b05dfc9f4aa.png} | Bin 15 files changed, 1382 insertions(+), 314 deletions(-) create mode 100644 lib/controller/getGeoAlerts.php create mode 100644 lib/controller/getGeoZones.php create mode 100644 lib/javascript/jsapi_dynamic/mojo_map.js delete mode 100644 lib/javascript/jsapi_dynamic/rgoose_map.js rename style/assets/{mer-big-1.png => 20f21b4f01f1b7587f728b05dfc9f4aa.png} (100%) diff --git a/index.php b/index.php index 9a8a060..a30ce22 100644 --- a/index.php +++ b/index.php @@ -6,13 +6,13 @@ UI_PageHeaderExt( 'mojo_general.js', array( - 'mojo_global_vars.js', - 'rgoose_map.js', + 'mojo_global_vars.js', 'mojo_reports.js', 'rgoose_devices.js', 'rgoose_cameras.js', 'rgoose_modules.js', 'mojo_monitoring.js', + 'mojo_map.js', 'rgoose_location_editor.js', 'mojo_dashboard.js', 'mojo_users.js', @@ -27,12 +27,12 @@ 'mojo_general.js', array( 'mojo_global_vars.js', - 'rgoose_map.js', 'mojo_reports.js', 'rgoose_devices.js', 'rgoose_cameras.js', 'rgoose_modules.js', 'mojo_monitoring.js', + 'mojo_map.js', 'mojo_dashboard.js', 'mojo_settings.js', 'mojo_main.js' diff --git a/lib/controller/dash/node_1.js b/lib/controller/dash/node_1.js index d93f46c..a17ba5f 100644 --- a/lib/controller/dash/node_1.js +++ b/lib/controller/dash/node_1.js @@ -1,31 +1,267 @@ { id: 'db_node_%%%NODEID%%%', - width: 258, - height: 320, title: '%%%NODENAME%%%', + draggable: false, + collapsible: false, tools: [{ - id:'gear', - handler: function(){ - //Ext.Msg.alert('Message', 'The Settings tool was clicked.'); - showSensorToolBox( %%%NODEID%%% ); + id:'toggle', + handler: function( a, b, p ){ + fsDrawID = %%%NODEID%%%; + fullScreen( 'div_radar_%%%NODEID%%%' ); + var el = document.getElementById('draw_svg_'+fsDrawID ); + var nW = Math.floor( ( window.screen.height/window.screen.width ) * 100 ); + el.removeAttribute("width"); + el.setAttribute( "width", nW+'%' ); } }], listeners:{ - afterrender: function(){ - cleanup2DDraw( %%%NODEID%%% ); - drawZoomLevels[%%%NODEID%%%]=100; - //Deffer + afterrender: function(p){ + masks_statuses[%%%NODEID%%%] = 0; + masks_exist[%%%NODEID%%%] = 0; + + var W=p.getWidth(); + var H=9*(W/16); + p.setHeight( H + 32 ); + Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setHeight( H - 18 ); + //document.getElementById('draw_svg_%%%NODEID%%%').setAttribute("width", H-45 ); + set2DZoomLevel( %%%NODEID%%%, 100 ); + var el = document.getElementById('div_radar_%%%NODEID%%%'); + el.addEventListener( "fullscreenchange", ( evt )=>{ + if( document.fullscreenElement ){ + } else { + if( fsDrawID ){ + var el = document.getElementById('draw_svg_'+fsDrawID ); + el.removeAttribute("width"); + el.setAttribute( "width", '86%' ); + fsDrawID = 0; + }; + }; + }); + window.setTimeout( load2DDraw, 10*%%%NODEID%%%, %%%NODEID%%% ); } }, + layout: 'hbox', items:[{ - html: '
', - height: '260px' + id: 'cp_radar_%%%NODEID%%%', + html: '
100 m.502512.5
', + width: '56%' },{ - id: 'status_%%%NODEID%%%', - border: true, - frame: true, - height: 36, - html: '' + frame: false, + border: false, + width: '44%', + items:[{ + xtype: 'button', + id: 'cp_clear_btn_%%%NODEID%%%', + width: '100%', + disabled: true, + text: 'Clear Alarm', + iconCls: 'ctrl_panel_clean_sm', + iconAlign: 'left', + handler: function(){ + doDeviceOperation( 1, 125,'', true ); + } + },{ + xtype: 'spacer', + height: 3 + },{ + xtype: 'button', + id: 'cp_draw_btn_%%%NODEID%%%', + width: '100%', + text: 'Draw Background', + iconCls: 'ctrl_panel_drawscan_sm', + iconAlign: 'left', + disabled: true, + handler: function(){ + doDeviceOperation( %%%NODEID%%%, 3,'', true ); + } + },{ + xtype: 'spacer', + height: 3 + },{ + xtype: 'button', + id: 'cp_study_btn_%%%NODEID%%%', + width: '100%', + text: 'Study Background', + iconCls: 'ctrl_panel_study_sm', + iconAlign: 'left', + disabled: true, + handler: function(){ + doDeviceOperation( %%%NODEID%%%, 2,'', true ); + } + },{ + xtype: 'spacer', + height: 3 + },{ + xtype: 'panel', + title: 'Masking Management', + height: 145, + frame: true, + flex: 1, + layout: 'vbox', + items:[{ + xtype: 'button', + text: 'Mask Editor', + id: 'DMED_%%%NODEID%%%', + width: '100%', + disabled: true, + handler: function(){ + showMaskEditor( false, 0, %%%NODEID%%% ); + } + },{ + xtype: 'spacer', + height: 3 + },{ + xtype: 'panel', + id: 'DMEBB_%%%NODEID%%%', + frame: true, + border: false, + flex: 1, + width: '100%', + height: 53, + layout: 'hbox', + items:[{ + xtype: 'button', + enableToggle: true, + width: '20%', + scale: 'medium',//scale: 'small', + id: 'mz_btn_%%%NODEID%%%_0', + iconCls: 'mask_zone1_btn', + iconAlign: 'top', + pressed: false, + disabled: true, + handler: function(){ + if( Ext.getCmp('mz_btn_%%%NODEID%%%_0').pressed){ + doMaskOperation( %%%NODEID%%%, 1, 0 ); + } else { + doMaskOperation( %%%NODEID%%%, 0, 0 ); + }; + } + },{ + xtype: 'button', + enableToggle: true, + width: '20%', + scale: 'medium', + id: 'mz_btn_%%%NODEID%%%_1', + iconCls: 'mask_zone2_btn', + iconAlign: 'top', + pressed: false, + disabled: true, + handler: function(){ + if( Ext.getCmp('mz_btn_%%%NODEID%%%_1').pressed){ + doMaskOperation( %%%NODEID%%%, 1, 1 ); + } else { + doMaskOperation( %%%NODEID%%%, 0, 1 ); + }; + } + },{ + xtype: 'button', + enableToggle: true, + width: '19%', + scale: 'medium',//scale: 'large', + id: 'mz_btn_%%%NODEID%%%_2', + iconCls: 'mask_zone3_btn', + iconAlign: 'top', + pressed: false, + disabled: true, + handler: function(){ + if( Ext.getCmp('mz_btn_%%%NODEID%%%_2').pressed){ + doMaskOperation( %%%NODEID%%%, 1, 2 ); + } else { + doMaskOperation( %%%NODEID%%%, 0, 2 ); + }; + } + },{ + xtype: 'button', + enableToggle: true, + width: '20%', + scale: 'medium',//scale: 'large', + id: 'mz_btn_%%%NODEID%%%_3', + iconCls: 'mask_zone4_btn', + iconAlign: 'top', + pressed: false, + disabled: true, + handler: function(){ + if( Ext.getCmp('mz_btn_%%%NODEID%%%_3').pressed){ + doMaskOperation( %%%NODEID%%%, 1, 3 ); + } else { + doMaskOperation( %%%NODEID%%%, 0, 3 ); + }; + } + },{ + xtype: 'button', + enableToggle: true, + width: '20%', + scale: 'medium',//scale: 'large', + id: 'mz_btn_%%%NODEID%%%_4', + iconCls: 'mask_zone5_btn', + iconAlign: 'top', + pressed: false, + disabled: true, + handler: function(){ + if( Ext.getCmp('mz_btn_%%%NODEID%%%_4').pressed){ + doMaskOperation( %%%NODEID%%%, 1, 4 ); + } else { + doMaskOperation( %%%NODEID%%%, 0, 4 ); + }; + } + }] + }] + },{ + xtype: 'spacer', + height: 3 + }/*,{ + xtype: 'panel', + title: 'Detection Sensitivity', + height: 95, + frame: true, + flex: 1, + layout: 'hbox', + items:[{ + xtype: 'button', + text: 'Factory', + id: 'DDSPBTN0', + width: 80, + iconCls: 'detection_btn_factory', + enableToggle: true, + toggleGroup: 'det_sens_btn_grp', + disabled: true, + scale: 'large', + iconAlign: 'top' + },{ + xtype: 'button', + text: 'Low', + id: 'DDSPBTN1', + width: 80, + iconCls: 'detection_btn_low', + enableToggle: true, + toggleGroup: 'det_sens_btn_grp', + disabled: true, + scale: 'large', + iconAlign: 'top' + },{ + xtype: 'button', + text: 'Meduim', + id: 'DDSPBTN2', + width: 80, + iconCls: 'detection_btn_medium', + enableToggle: true, + toggleGroup: 'det_sens_btn_grp', + disabled: true, + scale: 'large', + iconAlign: 'top' + },{ + xtype: 'button', + text: 'High', + id: 'DDSPBTN3', + width: 80, + iconCls: 'detection_btn_high', + enableToggle: true, + toggleGroup: 'det_sens_btn_grp', + disabled: true, + scale: 'large', + iconAlign: 'top' + }] + }*/] }], bbar:[{ xtype: 'button', @@ -34,14 +270,9 @@ id: 'zoom_bt12_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=12; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + set2DZoomLevel( %%%NODEID%%%, 12 ); + }; } },{ xtype: 'button', @@ -50,14 +281,9 @@ id: 'zoom_bt25_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=25; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + set2DZoomLevel( %%%NODEID%%%, 25 ); + }; } },{ xtype: 'button', @@ -66,14 +292,9 @@ id: 'zoom_bt50_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=50; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + set2DZoomLevel( %%%NODEID%%%, 50 ); + }; } },{ xtype: 'button', @@ -83,14 +304,17 @@ id: 'zoom_bt100_%%%NODEID%%%', toggleGroup: 'zoom_tg_%%%NODEID%%%', toggleHandler: function( bt, st ){ - if( st ){ - drawZoomLevels[%%%NODEID%%%]=100; - var img = document.getElementById('draw_img_%%%NODEID%%%'); - img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100"; - img.onload = function(){ - cleanup2DDraw( %%%NODEID%%% ); - }; - }; + if( st ){ + set2DZoomLevel( %%%NODEID%%%, 100 ); + }; } + },{ + xtype: 'panel', + id: 'status_%%%NODEID%%%', + border: false, + frame: false, + width: 800, + height: 28, + html: '' }] } \ No newline at end of file diff --git a/lib/controller/data/mysqlitedb.db b/lib/controller/data/mysqlitedb.db index 7f7b1335d7ca1156561e2ff761ef49ccf83e806e..a20e4be03cb2c8cffb18a6aa490148960625384c 100644 GIT binary patch delta 1838 zcmah}TWl0n7(Tb%J+sq2|CZipE8VRvAQ#JC+HSWGTCC7SXeBlnB$jrzJ8d`J3(ibI zA_;Bci$t{0nBhfZL}S22u&eBgLHc6Q5K+7mniS#%9t24UK1gCcv!x}(7-uqj_P?C} z|IhdT-x)t!Hh#A36d7nAK{Y~PxGkQ98K{O6A`FwTA2N^-eXtsS5r2#8;z#kR_)xqf zUWYER7h*!do1!j1QF_sLK-AEBtPKw8rrDp)4fE26=xUtNlPRs=vlzvX*WPX)*+WqS7jy%_VhHg&hdc{ikv{jdDvfhIOld zD3z95`Yl6iPGw6g>6!-(rniFDDuY@^H#D=PoCbK>80ybx=BQa+M&o>HCcC4lgwYj? zC72)tZ76z;?M~;kq$#RtgW~Km^{kmQ%&D&2=H`zPQ$4g6XL8B0v~Ci$RtlzW?9mOA za~G}Rds9Ox6K0WbsqU$nTwOhPL?6%qHgq#LX2_#1Q!!n^cc%ueF{zvGz`;Bor~Yyd zM-kkH-{2CQhtFUd-h-q0(vEQ$R=FE7tf1ue>77LNED4Vh)x9XZ{{m56i$bHDsBBTF zdWooXQSiP+RI(_b6GX-Lglp$p^7AKMeoo*Jk^^x_rk(&2QKz205Sf~}&?yZC1O=Ft zh7W)>(r!Gp>p~E#`PsQu!IB)J;tmpb;5fvj$2DP33;cxIs&a(+%G!o?s*M3Z$|M}^ zQxm1FWIM6@1l}&ZQbXY;g1c}BZpy7!V40g?j#bsg6a^E;6s|ZhInYuEq@UsQA~Xl# zz>+&adlM{LleA*2G@q;k*08KTT{3x9FA(qOe$OasU<$7C`5X5UXRcg#CtX* z^*tLbYhQ1u7XP;~yinyi1aoi;&dEX+o_tNmN6=R3lF6~m{XkmkcPUCezMp`AqfnL< z;nM?{g}lg*kO(@jm_QB9GPSVb_$aL_kILdVZSu( z2LB)_L)G2goB>t{QMi3DK-R4dCzH()JrYmE!?8pt5(_8w=4d3*5(~v6p?JK_nWl|i z7ovv?R|6#IcPK~U41(X`Yd8bPW$ahLo}Q;=$%@7EF0FnSmq>E1tmxg;)BE%@{oxuW zJB=|{)|FFrlQp6nlI4-@4*8?YFh^W^^ZL$Q)-rPGv~DaQdc*1a4LSC=Wx7jH<&hbR zZFhN?j8;w=V_Z=rQf@zMN6=pI4v-MEPjuokgrgo02d;GUiPAplg~`UPy}@36aLh=~ z!5d`X!@~hwgOnnHW##h0@*|}9ms2#4clio<9A5@|c8&xY=ZrX0TI!rYj3W37c8Xuc zyJA$f^Eu&-2^GmoB}Vqf6580S>efi8UE8CLq#jpQgr!Nrh=-Xz6ieu_q1K^9TU(+< zZ)=IQMw7`wEuKuY4JD&3^nodBZ;M2mO?QbC+kUY`-nYblyM%7`8m^*FcFDda^Vtt!yUyhk2~fA)7!A$QOJ`ahf=UsW@-TZgXGOcNhSh6NyRtCiC%eRQp)*H gyzCF~Wc5TYH`;RA&zPUeodr*b{RIUaV)G~e0kCkaiU0rr delta 5534 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 AND `type`< 10 AND `enable`=1"; $R = $DATABASE->Query( $QS ); - $idx = 0; if( count( $R ) ){ foreach( $R as $DD ){ if( $idx < 3 ){ @@ -435,29 +451,11 @@ kahkjahskfgkgkh; case 3:{ $STA[0]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:["; $STA[1]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:["; - $STA[2]="{ columnWidth: 1.0, stylse:'padding:10px 0 10px 10px', items:["; - $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1"; - $R = $DATABASE->Query( $QS ); - $idx = 0; - if( count( $R ) ){ - foreach( $R as $DD ){ - if( $idx < 1 ){ - $TFN = 'dash/node_' . $DD['type'] . '.js'; - if(!file_exists( $TFN )) continue; - $TPL = file_get_contents( $TFN ); - $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); - $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); - $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); - $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); - $OUT[]= $STA[$idx] . $TPL . $END; - } else break; - $idx++; - }; - } else { - for( ;$idx<1;$idx++ ){ - $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END; - }; - }; + $STA[2]="{ columnWidth: .35, stylse:'padding:10px 0 10px 10px', items:["; + $STA[3]="{ columnWidth: .65, stylse:'padding:10px 0 10px 10px', items:["; + + $OUT[]= $STA[0] . $DUMMY['map'] . $END; + $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 14 AND `enable`=1"; $R = $DATABASE->Query( $QS ); $idx = 0; @@ -518,7 +516,29 @@ kahkjahskfgkgkh; $OUT[]= $STA[1+$idx] . $T . $END; }; }; - $OUT[]= $STA[2] . $DUMMY['log'] . /*','. $DUMMY['map'].*/ $END; + $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1"; + $R = $DATABASE->Query( $QS ); + $idx = 0; + if( count( $R ) ){ + foreach( $R as $DD ){ + if( $idx < 1 ){ + $TFN = 'dash/node_' . $DD['type'] . '.js'; + if(!file_exists( $TFN )) continue; + $TPL = file_get_contents( $TFN ); + $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL ); + $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL ); + $TPL = str_replace('%%%USERID%%%', $UserID, $TPL ); + $TPL = str_replace('%%%SESSION%%%', $Session, $TPL ); + $OUT[]= $STA[2+$idx] . $TPL . $END; + } else break; + $idx++; + }; + } else { + for( ;$idx<1;$idx++ ){ + $OUT[]= $STA[2+$idx] . $DUMMY['sensor'] . $END; + }; + }; + $OUT[]= $STA[3] . $DUMMY['log'] . $END; break; }; case 4: diff --git a/lib/controller/getGeoAlerts.php b/lib/controller/getGeoAlerts.php new file mode 100644 index 0000000..c68ab8e --- /dev/null +++ b/lib/controller/getGeoAlerts.php @@ -0,0 +1,63 @@ +Data['id'] > 1 ){ + $Data = array(); + $Data['evt'] = array(); + $Data['other'] = array(); + $SID = intval($_POST['SITE']); + //$QS = "SELECT ec.id, ec.lon, ec.lat, ls.lon as src_lon, ls.lat as src_lat, ls.max_range as max_range FROM events_cloud ec LEFT JOIN nodes nd ON ( nd.id = ec.node_id ) LEFT JOIN lrf_sensors ls ON ( ls.id = nd.aux_id ) WHERE ec.lat IS NOT NULL AND ec.lon IS NOT NULL ORDER BY ec.ts DESC, ec.ts_ms DESC LIMIT 20"; + $QS = "SELECT ec.id, ec.lon, ec.lat FROM events_cloud ec WHERE ec.lat IS NOT NULL AND ec.lon IS NOT NULL ORDER BY ec.ts DESC, ec.ts_ms DESC LIMIT 20"; + $Result = $DATABASE->Query( $QS, false ); + date_default_timezone_set('UTC'); + //foreach( array_reverse ( $Result ) as $CD ){ + foreach( $Result as $CD ){ + $Data['evt'][] = $CD; + }; + $SSD = getServerNode( $SID ); + $QS="SELECT * FROM target_filters WHERE server_id={$SSD}"; + $Result = $DATABASE->Query( $QS, false ); + foreach( $Result as $R ){ + switch( $R['type'] ){ + case 1:{ + //APF + $QS = "SELECT * FROM `target_filter_apf` WHERE `id`={$R['aux_id']}"; + $Juno = $DATABASE->Query( $QS, false ); + if( count( $Juno ) ){ + $CC = $Juno[0]; + $A = new gPoint(); + $A->setLongLat($CC['lon'],$CC['lat']); + $A->convertLLtoTM(); + $XC = $A->E(); + $YC = $A->N(); + $Z = $A->Z(); + $ANG = (pi()/180)*floatval( $CC['yaw'] ); + $QS = "SELECT * FROM `target_filter_apf_boxes` WHERE `filter_id`={$R['aux_id']}"; + $Obubu = $DATABASE->Query( $QS, false ); + foreach( $Obubu as $G ){ + $P['type']='circle'; + $P['color']='#00FF00'; + $TX = floatval($G['x']); + $TY = floatval($G['y']); + $CR = sqrt($TX*$TX+$TY*$TY); + if( $TX != 0 ){ + $CA = atan( $TY/$TX ); + } else { + $CA = 0; + }; + $A->setUTM($XC+$CR*cos($CA+$ANG),$YC+$CR*sin($CA+$ANG),$Z); + $A->convertTMtoLL(); + $P['loc']=array('lat'=>$A->Lat(),'lon'=>$A->Long()); + $Data['other'][] = $P; + }; + }; + break; + }; + }; + }; + echo json_encode( $Data ); + } else { + header('location: /'); + }; +?> \ No newline at end of file diff --git a/lib/controller/getGeoZones.php b/lib/controller/getGeoZones.php new file mode 100644 index 0000000..179c325 --- /dev/null +++ b/lib/controller/getGeoZones.php @@ -0,0 +1,647 @@ +setUTM( 485962.4143066, 4919314.7793823, '32T' ); + + $Z->convertTMtoLL(); + + $Z->printUTM(); + echo "\n\n"; + + $Z->printLatLong(); + echo "\n\n"; + + exit(); +*/ + + if( $CUser->Data['id'] > 1 ){ + $Data = array(); + if( 1 ){ + $QS = "SELECT * FROM system_props LIMIT 1"; + $SR = $DATABASE->Query( $QS, false ); + if( count( $SR ) ){ + $SS = $SR[0]; + $ANCHOR = new gPoint(); + $ANCHOR->setLongLat( floatval( $SS['anchor_lon'] ), floatval( $SS['anchor_lat'] ) ); + $ANCHOR->convertLLtoTM(); + $BASE_X = $ANCHOR->E(); + $BASE_Y = $ANCHOR->N(); + $BASE_Z = floatval( $SS['anchor_alt'] ); + $BASE_ZONE = $ANCHOR->Z(); + $QS = "SELECT * FROM nodes WHERE ((type!=0)AND(type!=20))"; + $Result = $DATABASE->Query( $QS, false ); + date_default_timezone_set('UTC'); + //print_r( $Result ); + foreach( $Result as $R ){ + $Zone = array(); + switch( $R['type'] ){ + case 122:{ + break; + // Lfs - MND + $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range FROM lrf_sensors WHERE id={$R['aux_id']}"; + $D = $DATABASE->Query( $QS, false ); + if( count( $D ) ){ + $CC = $D[0]; + $A = new gPoint(); + $A->setUTM( $CC['x'], $CC['y'] ); + $A->convertTMtoLL(); + $LAT = $A->Lat(); + $LON = $A->Long(); + //$A->setLongLat($CC['lon'],$CC['lat']); + //$A->convertLLtoTM(); + $XC = $A->E(); + $YC = $A->N(); + $Z = $A->Z(); + $RAN = floatval( $CC['max_range'] ); + if( 1 ){ + $K = pi()/18.0;//10 deg + $Points = array(); + $Points[] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $SANG = ( pi() / 180 ) * floatval( $CC['yaw'] ); + for( $i = 0; $i < 11; $i++ ){ + $CA = $i * $K; + $B = new gPoint(); + $B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z ); + $B->convertTMtoLL(); + $Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + }; + + if(1){ + $ZMARK = array(); + $B = new gPoint(); + + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + + //$SANG = $SANG - ( pi() / 180 ); + //$RAN = $RAN + 0.5; + //$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + //$B->convertTMtoLL(); + //$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + + //$SANG = $SANG + ( pi() / 180 ); + //$RAN = $RAN + 0.5; + //$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + //$B->convertTMtoLL(); + //$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + + //$SANG = $SANG + ( pi() / 180 ); + //$RAN = $RAN - 0.5; + //$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + //$B->convertTMtoLL(); + //$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + } + + $Zone['type']='poly'; + $Zone['points']=$Points; + $Zone['color'] = '#880000'; + $Zone['center'] = array( 'lat'=>$LAT, 'lon'=>$LON ); + } else { + /* + $A->setUTM( $XC-$RAN, $YC+$RAN, $Z ); + $A->convertTMtoLL(); + $LTLAT = $A->Lat(); + $LTLON = $A->Long(); + $A->setUTM( $XC+$RAN, $YC-$RAN, $Z ); + $A->convertTMtoLL(); + $RBLAT = $A->Lat(); + $RBLON = $A->Long(); + $Zone['type']='image'; + $Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id']; + $Zone['bounds']=array(array($LTLAT,$LTLON),array($RBLAT,$RBLON)); + //*/ + //* + $RA = sqrt( $RAN * $RAN * 2 ); + $CA = ( pi() / 180 ) * floatval( $CC['yaw'] ); + $SANG = pi()/4*3; + $A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z ); + $A->convertTMtoLL(); + $Zone['type']='image_rot'; + $Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id']; + $Zone['topleft']=array($A->Lat(),$A->Long()); + $SANG = pi() / 4; + $A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z ); + $A->convertTMtoLL(); + $Zone['topright']=array($A->Lat(),$A->Long()); + $SANG = pi() / 4*5; + $A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z ); + $A->convertTMtoLL(); + $Zone['bottomleft']=array($A->Lat(),$A->Long()); + + $ZMARK = array(); + $B = new gPoint(); + + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + //*/ + }; + $Zone['name'] = $R['name']; + $Data[] = $Zone; + }; + break; + }; + case 2:{ + //LFS + $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range, base_shift FROM lrf_sensors WHERE id={$R['aux_id']}"; + $D = $DATABASE->Query( $QS, false ); + $Zone['dev_is_source'] = true; + $Zone['dev_type'] = intval( $R['type'] ); + $Zone['dev_id'] = intval( $R['id'] ); + $Zone['dev_name'] = $R['name']; + if( count( $D ) ){ + $CC = $D[0]; + $A = new gPoint(); + $A->setUTM( $BASE_X + floatval( $CC['x'] ), $BASE_Y + floatval( $CC['y'] ), $BASE_ZONE ); + $A->convertTMtoLL(); + $LAT = $A->Lat(); + $LON = $A->Long(); + $XC = $A->E(); + $YC = $A->N(); + $Z = $A->Z(); + $RAN = floatval( $CC['max_range'] ); + + $K = pi()/ 36; // 5 deg// + $Points = array(); + $Points[] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $SANG = ( pi() / 180 ) * floatval( $CC['z_rot'] ) + ( pi()/3000.0 * floatval( $CC['base_shift'] ) ); + for( $i = 0; $i < 20; $i++ ){ + $CA = $i * $K; + $B = new gPoint(); + $B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z ); + $B->convertTMtoLL(); + $Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + }; + $ZMARK = array(); + $B = new gPoint(); + $SANG = $SANG - ( pi()/3000.0 * floatval( $CC['base_shift'] ) ); + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + $Zone['type']='poly'; + $Zone['points']=$Points; + $Zone['color'] = '#880000'; + $Zone['center'] = array( 'lat'=>$LAT,'lon'=>$LON ); + $Zone['name'] = $R['name']; + $Data[] = $Zone; + }; + break; + }; + case 3:{ + // PLS 200 + $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range, base_shift FROM lrf_sensors WHERE id={$R['aux_id']}"; + $D = $DATABASE->Query( $QS, false ); + $Zone['dev_is_source'] = true; + $Zone['dev_type'] = 3; + $Zone['dev_id'] = intval( $R['id'] ); + $Zone['dev_name'] = $R['name']; + if( count( $D ) ){ + $CC = $D[0]; + $A = new gPoint(); + $A->setUTM( $BASE_X + floatval( $CC['x'] ), $BASE_Y + floatval( $CC['y'] ), $BASE_ZONE ); + $A->convertTMtoLL(); + $LAT = $A->Lat(); + $LON = $A->Long(); + + //$A = new gPoint(); + //$A->setLongLat($CC['lon'],$CC['lat']); + //$A->convertLLtoTM(); + $XC = $A->E(); + $YC = $A->N(); + $Z = $A->Z(); + $RAN = floatval( $CC['max_range'] ); + if(1){ + $K = pi()/ 36; // 10 deg// + $Points = array(); + $Points[] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $SANG = ( pi() / 180 ) * floatval( $CC['z_rot'] ) + ( pi()/3000.0 * floatval( $CC['base_shift'] ) ); + for( $i = 0; $i < 40; $i++ ){ + $CA = $i * $K; + $B = new gPoint(); + $B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z ); + $B->convertTMtoLL(); + $Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + }; + + if(1){ + $ZMARK = array(); + $B = new gPoint(); + // PLS + $SANG = $SANG - ( pi()/3000.0 * floatval( $CC['base_shift'] ) ); + + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + + //$SANG = $SANG - ( pi() / 180 ); + //$RAN = $RAN + 0.5; + //$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + //$B->convertTMtoLL(); + //$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + + //$SANG = $SANG + ( pi() / 180 ); + //$RAN = $RAN + 0.5; + //$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + //$B->convertTMtoLL(); + //$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + + //$SANG = $SANG + ( pi() / 180 ); + //$RAN = $RAN - 0.5; + //$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + //$B->convertTMtoLL(); + //$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + } + $Zone['type']='poly'; + $Zone['points']=$Points; + $Zone['color'] = '#880000'; + $Zone['center'] = array( 'lat'=>$LAT,'lon'=>$LON ); + } else { + /* + $A->setUTM( $XC-$RAN, $YC+$RAN, $Z ); + $A->convertTMtoLL(); + $LTLAT = $A->Lat(); + $LTLON = $A->Long(); + $A->setUTM( $XC+$RAN, $YC-$RAN, $Z ); + $A->convertTMtoLL(); + $RBLAT = $A->Lat(); + $RBLON = $A->Long(); + $Zone['type']='image'; + $Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id']; + $Zone['bounds']=array(array($LTLAT,$LTLON),array($RBLAT,$RBLON)); + //*/ + //* + $RA = sqrt( $RAN * $RAN * 2 ); + $CA = ( pi() / 180 ) * floatval( $CC['yaw'] ); + $SANG = pi()/4*3; + $A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z ); + $A->convertTMtoLL(); + $Zone['type']='image_rot'; + $Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id']; + $Zone['topleft']=array($A->Lat(),$A->Long()); + $SANG = pi() / 4; + $A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z ); + $A->convertTMtoLL(); + $Zone['topright']=array($A->Lat(),$A->Long()); + $SANG = pi() / 4*5; + $A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z ); + $A->convertTMtoLL(); + $Zone['bottomleft']=array($A->Lat(),$A->Long()); + //*/ + $ZMARK = array(); + $B = new gPoint(); + + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + }; + $Zone['name'] = $R['name']; + $Data[] = $Zone; + }; + break; + }; + case 1://ALS + case 4://PLS360 + case 5:{//3D + $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range FROM lrf_sensors WHERE id={$R['aux_id']}"; + $D = $DATABASE->Query( $QS, false ); + $Zone['dev_is_source'] = true; + $Zone['dev_type'] = intval( $R['type'] ); + $Zone['dev_id'] = intval( $R['id'] ); + $Zone['dev_name'] = $R['name']; + if( count( $D ) ){ + $CC = $D[0]; + $A = new gPoint(); + $A->setUTM( $BASE_X + floatval( $CC['x'] ), $BASE_Y + floatval( $CC['y'] ), $BASE_ZONE ); + $A->convertTMtoLL(); + $LAT = $A->Lat(); + $LON = $A->Long(); + + //$A = new gPoint(); + //$A->setLongLat($CC['lon'],$CC['lat']); + //$A->convertLLtoTM(); + $YC = $A->N(); + $XC = $A->E(); + $Z = $A->Z(); + + $Zone['type']='circle'; + $Zone['radius'] = floatval( $CC['max_range'] ); + $Zone['color'] = '#8800FF'; + $Zone['center'] = array('lat'=>$LAT,'lon'=>$LON); + + $SANG = ( pi() / 180 ) * floatval( $CC['z_rot'] ); + $RAN = floatval( $CC['max_range'] ); + $ZMARK = array(); + $B = new gPoint(); + + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + $Zone['name'] = $R['name']; + $Data[] = $Zone; + }; + break; + }; + case 10: + case 12:{ // Camera Static + $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range, imager_type, lens_f FROM cameras WHERE id={$R['aux_id']}"; + $D = $DATABASE->Query( $QS, false ); + if( count( $D ) ){ + $CC = $D[0]; + $A = new gPoint(); + $A->setUTM( $BASE_X + floatval( $CC['x'] ), $BASE_Y + floatval( $CC['y'] ), $BASE_ZONE ); + $A->convertTMtoLL(); + $LAT = $A->Lat(); + $LON = $A->Long(); + $YC = $A->N(); + $XC = $A->E(); + $Z = $A->Z(); + $CFOV = (2.0*atan($AC_imager_width[$CC['imager_type']]/(2.0*$cam_predef_focal_length[$CC['lens_f']]))); + $Points = array(); + $A = new gPoint(); + $Points[] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $K = floatval( $CFOV ) / 40; + $SANG = (M_PI/180) * floatval( $CC['z_rot'] ) - ($CFOV/2.0); + $RAN = floatval( $CC['max_range'] ); + for( $i = 0; $i < 41; $i++ ){ + $CA = $i * $K; + $B = new gPoint(); + $B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z ); + $B->convertTMtoLL(); + $Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + }; + $Zone['type']='poly'; + $Zone['points']=$Points; + $Zone['color'] = '#000088'; + $Zone['center'] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $ZMARK = array(); + $B = new gPoint(); + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG+( $CFOV / 2.0 ) ), $YC + $RAN * sin( $SANG +( $CFOV / 2.0 ) ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + $Zone['name'] = $R['name']; + $Data[] = $Zone; + }; + break; + }; + case 11: + case 13:{ // Camera PTZ + $QS = "SELECT x, y, x_rot, y_rot, z_rot, max_range, pan_angles FROM cameras WHERE id={$R['aux_id']}"; + $D = $DATABASE->Query( $QS, false ); + if( count( $D ) ){ + $CC = $D[0]; + $A = new gPoint(); + $A->setUTM( $BASE_X + floatval( $CC['x'] ), $BASE_Y + floatval( $CC['y'] ), $BASE_ZONE ); + $A->convertTMtoLL(); + $LAT = $A->Lat(); + $LON = $A->Long(); + $YC = $A->N(); + $XC = $A->E(); + $Z = $A->Z(); + if( intval( $CC['pan_angles'] ) < 360 ){ + $Points = array(); + $A = new gPoint(); + $Points[] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $K = ( pi()/180.0 ) * floatval($CC['pan_angles']) / 40; + $SANG = ( pi() / 180 ) * floatval( $CC['z_rot'] ); + $RAN = floatval( $CC['max_range'] ); + for( $i = 0; $i < 41; $i++ ){ + $CA = $i * $K; + $B = new gPoint(); + $B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z ); + $B->convertTMtoLL(); + $Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + }; + $Zone['type']='poly'; + $Zone['points']=$Points; + $Zone['color'] = '#000088'; + $Zone['center'] = array( 'lat'=>$LAT, 'lon'=>$LON ); + $ZMARK = array(); + $B = new gPoint(); + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + } else { + $Zone['type']='circle'; + $Zone['radius'] = floatval( $CC['max_range'] ); + $Zone['color'] = '#000088'; + $Zone['center'] = array('lat'=>$LAT,'lon'=>$LON); + $SANG = ( pi() / 180 ) * floatval( $CC['z_rot'] ); + $RAN = floatval( $CC['max_range'] ); + $ZMARK = array(); + $B = new gPoint(); + //$RAN = $RAN - 0.5; + $B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z ); + $B->convertTMtoLL(); + $ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long()); + $Zone['zang'] = $ZMARK; + }; + $Zone['name'] = $R['name']; + $Data[] = $Zone; + }; + break; + }; + }; + }; + /* + $SSD = getServerNode( $SID ); + $QS="SELECT * FROM target_filters WHERE server_id={$SSD}"; + $RF=array();//$DATABASE->Query( $QS, false ); + foreach( $RF as $F ){ + switch( intval($F['type']) ){ + case 1:{ + $QS="SELECT * FROM target_filter_apf WHERE id={$F['aux_id']}"; + $SD=$DATABASE->Query( $QS, false ); + $CC=$SD[0]; + if( count($SD) ){ + $Zone['type']='poly'; + $Zone['color'] = '#FF00FF'; + $Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']); + + $QS="SELECT * FROM target_filter_apf_anchors WHERE filter_id={$F['aux_id']}"; + $RA=$DATABASE->Query( $QS, false ); + + $Points = array(); + $A = new gPoint(); + $A->setLongLat($CC['lon'],$CC['lat']); + $A->convertLLtoTM(); + $YC = $A->N(); + $XC = $A->E(); + $Z = $A->Z(); + $ANG = (pi()/180)*floatval( $CC['yaw'] ); + foreach( $RA as $G ){ + $TX = floatval($G['x']); + $TY = floatval($G['y']); + $CR = sqrt($TX*$TX+$TY*$TY); + if( $TX != 0 ){ + $CA = atan( $TY/$TX ); + } else { + $CA = 0; + }; + $A->setUTM($XC+$CR*cos($CA+$ANG),$YC+$CR*sin($CA+$ANG),$Z); + $A->convertTMtoLL(); + $Points[]=array('lat'=>$A->Lat(),'lon'=>$A->Long()); + }; + $Zone['points']=$Points; + $Data[] = $Zone; + }; + break; + }; + }; + }; + */ + }; + }; + $ZZ['zones']=$Data; + $ZZ['totalCount'] = count( $Data ); + echo json_encode( $ZZ ); + } else { + header('location: /'); + }; +?> \ No newline at end of file diff --git a/lib/controller/getSensorEditor.php b/lib/controller/getSensorEditor.php index 283923e..b0cdef6 100644 --- a/lib/controller/getSensorEditor.php +++ b/lib/controller/getSensorEditor.php @@ -180,7 +180,8 @@ JOJOKA; [75,'75 Meters'], [150,'150 Meters'], [200,'200 Meters'], - [300,'300 Meters'] + [300,'300 Meters'], + [350,'350 Meters'] ] }), valueField: 'range', diff --git a/lib/javascript/jsapi_dynamic/mojo_main.js b/lib/javascript/jsapi_dynamic/mojo_main.js index dec6f72..1c44bff 100644 --- a/lib/javascript/jsapi_dynamic/mojo_main.js +++ b/lib/javascript/jsapi_dynamic/mojo_main.js @@ -121,7 +121,7 @@ function failureAJAXFunction( responce, opts ){ window.clearInterval( tlInterval ); tlInterval = null; }; - playSound(); + //playSound(); //Ext.Msg.show({ // title:'GetLabel('_REQ_FAILURE_');?>', // msg: 'GetLabel('_AJX_REQFAILURE_');?>', @@ -338,7 +338,7 @@ Ext.onReady(function(){ layout: 'table', baseCls: 'x-plain', layoutConfig: { - columns: 11 + columns: 13 }, frame: false, border: true, @@ -406,7 +406,7 @@ Ext.onReady(function(){ frame: false, border: false, margins: {top:5, right:0, bottom:0, left:0}, - width: PanelW-700, + width: PanelW - , html: '

'+ap_title+'

' },{ xtype: 'spacer', @@ -438,7 +438,18 @@ Ext.onReady(function(){ }; Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode ); } - } ] diff --git a/lib/javascript/jsapi_dynamic/mojo_map.js b/lib/javascript/jsapi_dynamic/mojo_map.js new file mode 100644 index 0000000..80149ea --- /dev/null +++ b/lib/javascript/jsapi_dynamic/mojo_map.js @@ -0,0 +1,326 @@ +// + + + +var ActiveZones = null; + + +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: , + SID: '' + }, + 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: , + UID: , + SID: '', + 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(){ + 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("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' ); +}; diff --git a/lib/javascript/jsapi_dynamic/mojo_monitoring.js b/lib/javascript/jsapi_dynamic/mojo_monitoring.js index 5a23cbb..4709caf 100644 --- a/lib/javascript/jsapi_dynamic/mojo_monitoring.js +++ b/lib/javascript/jsapi_dynamic/mojo_monitoring.js @@ -52,7 +52,7 @@ function initMonitoring(){ updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position ); } } - }); + }); Ext.getCmp('main_content').doLayout(); var tPanel = Ext.getCmp('main_portal'); tPanel.removeAll(true); diff --git a/lib/javascript/jsapi_dynamic/mojo_reports.js b/lib/javascript/jsapi_dynamic/mojo_reports.js index db317bf..fd105ed 100644 --- a/lib/javascript/jsapi_dynamic/mojo_reports.js +++ b/lib/javascript/jsapi_dynamic/mojo_reports.js @@ -8,7 +8,7 @@ var tlGroups = new vis.DataSet(); var tlItems = new vis.DataSet(); var selecredActiveSourceFilter = 0; -var ActiveZones = null; + var rep_store_id = 0; var rep_array = new Array(); @@ -561,232 +561,7 @@ function clickDeviceSelector( id ){ }; }; -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: , - SID: '' - }, - 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: , - UID: , - SID: '', - 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 ); diff --git a/lib/javascript/jsapi_dynamic/mojo_settings.js b/lib/javascript/jsapi_dynamic/mojo_settings.js index aac5179..46db0fc 100644 --- a/lib/javascript/jsapi_dynamic/mojo_settings.js +++ b/lib/javascript/jsapi_dynamic/mojo_settings.js @@ -1073,7 +1073,8 @@ function addSensor(){ [75,'75 Meters'], [150,'150 Meters'], [200,'200 Meters'], - [300,'300 Meters'] + [300,'300 Meters'], + [350,'350 Meters'] ] }), valueField: 'range', @@ -2649,7 +2650,7 @@ function initSettingsView(){ }Data['sipi_enable'] ) ){ + if( 0 && intval( $CUser->Data['sipi_enable'] ) ){ ?> { xtype: 'button', 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/style/assets/mer-big-1.png b/style/assets/20f21b4f01f1b7587f728b05dfc9f4aa.png similarity index 100% rename from style/assets/mer-big-1.png rename to style/assets/20f21b4f01f1b7587f728b05dfc9f4aa.png