Browse Source

Before Changing RT Report from timeline to a Map

master
Evgeny Gagua 5 years ago
parent
commit
e0bdfbe767
  1. 11
      .gitignore
  2. 2
      index.php
  3. 12
      lib/controller/dash/node_13.js
  4. 88
      lib/controller/dash/node_3.js
  5. 4
      lib/controller/getDashBoardItems.php
  6. 55
      lib/controller/getDashBoardStatus.php
  7. 204
      lib/controller/getDeviceDraw.php
  8. 19
      lib/controller/getLocationNodes.php
  9. 16
      lib/controller/getNetworkNodeProps.php
  10. 46
      lib/controller/getNetworkServerProps.php
  11. 1
      lib/controller/props/1_node_prop.js
  12. 24
      lib/controller/props/2_node_prop.js
  13. 24
      lib/controller/props/3_node_prop.js
  14. 23
      lib/controller/props/4_node_prop.js
  15. 5
      lib/controller/props/loc_prop.js
  16. 116
      lib/javascript/jsapi_dynamic/rgoose_dashboard.js
  17. 413
      lib/javascript/jsapi_dynamic/rgoose_devices_module.js
  18. 349
      lib/javascript/jsapi_dynamic/rgoose_location_editor.js
  19. 66
      lib/javascript/jsapi_dynamic/rgoose_main.js
  20. 105
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  21. 12
      lib/javascript/jsapi_dynamic/rgoose_timeline.js
  22. 5
      lib/php/sys/r-goose_sys.php
  23. BIN
      style/assets/Untitled-1.psd
  24. BIN
      style/assets/Untitled-2.psd
  25. BIN
      style/assets/lfs_draw_empty_100.png
  26. BIN
      style/assets/lfs_draw_empty_12.png
  27. BIN
      style/assets/lfs_draw_empty_25.png
  28. BIN
      style/assets/lfs_draw_empty_50.png
  29. BIN
      style/assets/loading (1).gif
  30. BIN
      style/assets/loading.gif
  31. BIN
      style/assets/offline.png
  32. BIN
      style/assets/online.gif
  33. 7
      style/style.css

11
.gitignore

@ -1,8 +1,9 @@
*.mp4
*.ogg
*.webm
/temp/*
/storage/*
/saved_images/*
/lib/javascript/extjs/*
/lib/error.log
temp/*
storage/*
saved_images/*
lib/javascript/extjs/*
lib/error.log
lib/controller/data/*

2
index.php

@ -3,7 +3,7 @@
if( $CUser->Data['id'] > 1 ){
UI_PageHeaderExt(
'rgoose_general.js',
array('rgoose_timeline.js','rgoose_camera_editor.js','rgoose_mediaserver_module.js','rgoose_sysmap_editor.js','rgoose_location_editor.js','rgoose_dashboard.js','rgoose_main.js')
array('rgoose_timeline.js','rgoose_camera_editor.js','rgoose_mediaserver_module.js','rgoose_sysmap_editor.js','rgoose_location_editor.js','rgoose_dashboard.js','rgoose_main.js', 'rgoose_devices_module.js')
);
UI_PageBottomExt();
} else {

12
lib/controller/dash/node_13.js

@ -64,6 +64,18 @@
xtype: 'button',
text: 'PTZ Control',
width: 244,
listeners:{
mouseover: function( btn, e ){
if( e.buttons ){
alert("KOKO");
};
return false;
},
click: function( btn, e ){
alert("clc");
return true;
}
},
handler: function(){
alert("ptz ");
}

88
lib/controller/dash/node_3.js

@ -0,0 +1,88 @@
{
id: 'db_node_%%%NODEID%%%',
width: 258,
height: 320,
title: '%%%NODENAME%%%',
listeners:{
afterrender: function(){
cleanupDraw( %%%NODEID%%% );
drawZoomLevels[%%%NODEID%%%]=100;
}
},
items:[{
html: '<center><img id="draw_img_%%%NODEID%%%" src="/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%"><canvas id="targ_canvas_%%%NODEID%%%" style="display: none;" width="200" height="210"></canvas></center>',
height: '260px'
},{
id: 'status_%%%NODEID%%%',
border: true,
frame: true,
height: 36,
html: ''
}],
bbar:[{
xtype: 'button',
text: '12.5%',
enableToggle: true,
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(){
cleanupDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '25%',
enableToggle: true,
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(){
cleanupDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '50%',
enableToggle: true,
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(){
cleanupDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '100%',
pressed: true,
enableToggle: true,
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(){
cleanupDraw( %%%NODEID%%% );
};
};
}
}]
}

4
lib/controller/getDashBoardItems.php

@ -34,10 +34,14 @@
if(!file_exists( $TFN )) continue;
$TPL[$index] = file_get_contents( $TFN );
$TPL[$index] = str_replace('%%%NODEID%%%', ''.$R['id'] , $TPL[$index] );
$TPL[$index] = str_replace('%%%NODENAME%%%', ''.$R['name'] , $TPL[$index] );
switch( $R['type'] ){
case ARGUS_SERVER:{
break;
};
case ARGUS_2D_SENSOR:{
break;
};
case ARGUS_3D_SENSOR:{
break;
};

55
lib/controller/getDashBoardStatus.php

@ -0,0 +1,55 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$SiteID = intval( $_POST['SITE'] );
$UID = intval( $CUser->Data['id'] );
$Data = array();
$Data['nodes'] = array();
$QS = "SELECT * FROM nodes WHERE site_id = {$SiteID}";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) > 0 ){
foreach( $result as $R ){
$CN = array();
$CN['id'] = $R['id'];
$CN['status'] = intval($R['online']);
switch( $R['type'] ){
case ARGUS_SERVER:{
break;
};
case 3:
case ARGUS_2D_SENSOR:{
if( $CN['status'] ){
// check Targets
$CN['targets'] = array();
$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) AND (UNIX_TIMESTAMP(NOW())-ts)<60 ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY ts, ts_ms DESC LIMIT 32";
//echo $QS . "\n\n";
$zult = $DATABASE->Query( $QS );
if( count( $zult ) ){
$CN['status'] = 2; // Alarmed
$CT = array();
foreach( $zult as $Z ){
$CT['digital'] = $Z['range_digital'];
$CT['az'] = $Z['azimuth'];
$CN['targets'][] = $CT;
};
};
};
break;
};
case ARGUS_3D_SENSOR:{
break;
};
case ARGUS_IP_PTZ_CAMERA:{
break;
};
};
$index++;
$Data['nodes'][] = $CN;
};
};
echo json_encode( $Data );
} else {
echo '[]';
};
?>

204
lib/controller/getDeviceDraw.php

@ -4,22 +4,214 @@
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if(isset( $_POST['PID'] )){
$PID = intval($_POST['PID']);
header("Content-Type: image/png");
if(isset( $_POST['NID'] )){
$NID = intval($_POST['NID']);
} else {
$PID = intval($_GET['PID']);
$NID = intval($_GET['NID']);
};
if(isset( $_POST['AUX'] )){
$AUX = intval($_POST['AUX']);
} else {
$AUX = intval($_GET['AUX']);
};
$QS = "SELECT * FROM pictures WHERE id={$PID}";
$QS = "SELECT * FROM lrf_draw WHERE node_id={$NID} ORDER BY ts DESC LIMIT 1";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
loadPicture( $Result[0] );
if( $Result[0]['rendered'] == 'Y' ){
if( $AUX ){
$FN = "data/{$Result[0]['md5']}_{$AUX}.png";
} else {
$FN = "data/{$Result[0]['md5']}_100.png";
};
} else {
$FF = "data/{$Result[0]['md5']}.raw";
$FN = "ddd";
if( file_exists( $FF ) ) {
$FD = fopen( $FF, "rb" );
if( $FD ){
$CL = fread( $FD, 4 );
$size = unpack( "V", $CL );
$pts = array();
$as = $size[1];
for($i=0; $i< $as; $i++ ){
$CL = fread( $FD, 4 );
$T = unpack( "V", $CL );
//print_r( $T );
$pts[] = $T[1] >> 16;
};
fclose( $FD );
$QS = "SELECT ls.base_shift, ls.max_range FROM nodes ns LEFT JOIN lrf_sensors ls ON ( ls.id=ns.aux_id ) WHERE ns.id={$NID}";
$PP = $DATABASE->Query( $QS );
$stp = 2.0 * ( M_PI / $as );
$MR = intval( $PP[0]['max_range'] );
$S = ( M_PI / 3000.0 ) * intval( $PP[0]['base_shift'] );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_100.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, $MR . "m.", $black );
$maxR = 98.0;
$rst = $maxR / 1025.0;
$x0 = 100;
$y0 = 100;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_100.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_50.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 2 ) . "m.", $black );
$rst = $maxR / 513.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 513 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_50.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 4 ) . "m.", $black );
$rst = $maxR / 257.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 256 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_25.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 8 ) . "m.", $black );
$rst = $maxR / 129.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 128 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_12.png" );
imagedestroy( $IM );
$QS = "UPDATE lrf_draw SET rendered='Y' WHERE id={$Result[0]['id']}";
$DATABASE->Query( $QS );
if( $AUX ){
$FN = "data/{$Result[0]['md5']}_{$AUX}.png";
} else {
$FN = "data/{$Result[0]['md5']}_100.png";
};
};
} else {
echo "No Res"; exit();
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
};
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
} else {
loadNotPicture();
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
};
} else {
header('location: /');

19
lib/controller/getLocationNodes.php

@ -0,0 +1,19 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$GID = intval($_POST['SITE']);
$QS = "SELECT * FROM nodes WHERE site_id={$GID}";
$Result = $DATABASE->Query( $QS, false );
$Data = "{ xtype: 'panel', frame: false, bodyStyle:'padding:5px 5px 0', items: [";
foreach( $Result as $CD ){
$cid = intval($CD['id']);
$ct = intval($CD['type']);
if( in_array( $ct, array( 2, 3, 5, 13 ) ) ){
$Data .= "{ xtype: 'button', text: '{$CD['name']}', width: '100%', handler: function(){ loadNodeLocationProps({$cid}); } },";
};
};
echo $Data . "{}] }";
} else {
echo "{}";
};
?>

16
lib/controller/getNetworkNodeProps.php

@ -23,6 +23,14 @@
$Data = str_replace('%%%DEVICE_ID%%%', $CC['device_id'] , $Data );
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
$Data = str_replace('%%%MAX_RANGE%%%', $CC['max_range'] , $Data );
$Data = str_replace('%%%M_ORDER%%%', $CC['m_order'] , $Data );
$Data = str_replace('%%%M_OFFSET%%%', $CC['m_offset'] , $Data );
$Data = str_replace('%%%M_WIDTH%%%', $CC['m_width'] , $Data );
$Data = str_replace('%%%M_SST%%%', $CC['m_sst'] , $Data );
$Data = str_replace('%%%S_ORDER%%%', $CC['s_order'] , $Data );
$Data = str_replace('%%%S_OFFSET%%%', $CC['s_offset'] , $Data );
$Data = str_replace('%%%S_WIDTH%%%', $CC['s_width'] , $Data );
$Data = str_replace('%%%S_SST%%%', $CC['s_sst'] , $Data );
break;
};
case ARGUS_3D_SENSOR:{
@ -35,6 +43,14 @@
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
$Data = str_replace('%%%IP_ADDRESS%%%', $CC['ip_address'] , $Data );
$Data = str_replace('%%%IP_PORT%%%', $CC['port'] , $Data );
$Data = str_replace('%%%M_ORDER%%%', $CC['m_order'] , $Data );
$Data = str_replace('%%%M_OFFSET%%%', $CC['m_offset'] , $Data );
$Data = str_replace('%%%M_WIDTH%%%', $CC['m_width'] , $Data );
$Data = str_replace('%%%M_SST%%%', $CC['m_sst'] , $Data );
$Data = str_replace('%%%S_ORDER%%%', $CC['s_order'] , $Data );
$Data = str_replace('%%%S_OFFSET%%%', $CC['s_offset'] , $Data );
$Data = str_replace('%%%S_WIDTH%%%', $CC['s_width'] , $Data );
$Data = str_replace('%%%S_SST%%%', $CC['s_sst'] , $Data );
break;
};
case 13:{

46
lib/controller/getNetworkServerProps.php

@ -53,8 +53,50 @@
};
$Data = str_replace('%%%SOCKETS%%%', $SocketsData, $Data );
//Get Modules
$ModulesData = '{}';
$Data = str_replace('%%%MODULES%%%', $ModulesData, $Data );
$QS = "SELECT * FROM `server_modules` WHERE `server_id`={$Props['aux_id']}";
$MDAT = $DATABASE->Query( $QS );
if(count($MDAT)){
$MODITEMS = array();
foreach( $MDAT as $M ){
switch( $M['type'] ){
case 1:{
//ZLMedia
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Media Server\'}';
break;
};
case 2:{
//DCB_USB
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Dry Contacts\'}';
break;
};
case 3:{
//Kafka
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Kafka Proxy\'}';
break;
};
case 4:{
//GPS
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'GPS Anchor\'}';
break;
};
case 5:{
//Netvork
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Network Proxy\'}';
break;
};
case 6:{
//FlyHunter
$MODITEMS[] = '{ xtype:\'button\', width: \'100%\', text:\'Fly Hunter\', handler: function(){ module_prop_FlyHunter('.$M['id'].'); } }';
break;
};
};
};
$IMPL = implode( ',', $MODITEMS );
$ModulesData = "{ items: [{$IMPL}]}";
$Data = str_replace('%%%MODULES%%%', $ModulesData, $Data );
} else {
$Data = str_replace('%%%MODULES%%%', '', $Data );
};
echo $Data;
} else {
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';

1
lib/controller/props/1_node_prop.js

@ -1,4 +1,5 @@
{
//ALS-LGS sensor
xtype: 'form',
labelWidth: 40, // label settings here cascade unless overridden
frame: false,

24
lib/controller/props/2_node_prop.js

@ -45,6 +45,7 @@
text: 'Change Settings',
width: '100%',
handler: function(){
return LRF1D2_settings();
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
@ -105,7 +106,7 @@
}
},{
xtype:'fieldset',
title: 'Master LRF',
title: 'LRF Settings',
collapsible: true,
autoHeight: true,
defaults: {
@ -124,26 +125,5 @@
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%M_SST%%%</p>'
}]
},{
xtype:'fieldset',
title: 'Slave LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%S_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%S_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%S_WIDTH%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%S_SST%%%</p>'
}]
}]
}

24
lib/controller/props/3_node_prop.js

@ -45,6 +45,7 @@
text: 'Change Settings',
width: '100%',
handler: function(){
return LRF1D2_settings();
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
@ -105,7 +106,7 @@
}
},{
xtype:'fieldset',
title: 'Master LRF',
title: 'LRF Settings',
collapsible: true,
autoHeight: true,
defaults: {
@ -124,26 +125,5 @@
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%M_SST%%%</p>'
}]
},{
xtype:'fieldset',
title: 'Slave LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%S_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%S_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%S_WIDTH%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%S_SST%%%</p>'
}]
}]
}

23
lib/controller/props/4_node_prop.js

@ -105,7 +105,7 @@
}
},{
xtype:'fieldset',
title: 'Master LRF',
title: 'LRF Settings',
collapsible: true,
autoHeight: true,
defaults: {
@ -124,26 +124,5 @@
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%M_SST%%%</p>'
}]
},{
xtype:'fieldset',
title: 'Slave LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%S_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%S_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%S_WIDTH%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%S_SST%%%</p>'
}]
}]
}

5
lib/controller/props/loc_prop.js

@ -37,6 +37,11 @@
value: %%%ALT%%%,
name: 'salt',
allowBlank:false
},{
xtype: 'button',
text: 'Set To Anchor Position',
width: '100%',
handler: setNodeLocationToAnchor
}]
},{
xtype:'fieldset',

116
lib/javascript/jsapi_dynamic/rgoose_dashboard.js

@ -28,6 +28,121 @@ function updateDashBoardItemLayout( id, x, y ){
});
};
var drawZoomLevels = Array();
function cleanupDraw( a ){
var canvas = document.getElementById('targ_canvas_'+a );
var ctx = canvas.getContext('2d');
var img = document.getElementById('draw_img_'+a );
ctx.drawImage( img, 0, 0 );
canvas.style='display: block;';
img.style='display: none;';
};
function DrawTargets( a, b ){
var canvas = document.getElementById('targ_canvas_'+a );
var ctx = canvas.getContext('2d');
var img = document.getElementById('draw_img_'+a );
ctx.drawImage( img, 0, 0 );
canvas.style='display: block;';
img.style='display: none;';
for( var i=0; i< b.length; i++ ){
switch( drawZoomLevels[a] ){
case 12:{
if( b[i].digital < 256 ){
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000";
var r = (196 / 256) * b[i].digital;
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 25:{
if( b[i].digital < 512 ){
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000";
var r = (196 / 512) * b[i].digital;
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, 5, 5 );
};
break;
};
case 50:{
if( b[i].digital < 1024 ){
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000";
var r = (196 / 1024) * b[i].digital;
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, 4, 4 );
};
break;
};
default:{
var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000";
var r = (196 / 2048) * b[i].digital;
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;
};
};
};
};
function fetchSiteStatus(){
Ext.Ajax.request({
url: '/lib/controller/getDashBoardStatus.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.nodes.length > 0 ){
for( i=0; i < data.nodes.length; i++ ){
var tt = Ext.getCmp('status_'+data.nodes[i].id );
if( tt != undefined ){
switch( data.nodes[i].status ){
case 0:{
cleanupDraw( data.nodes[i].id );
tt.update('<table style="background-color:#808080; color:#ffff00;" border="0" width="100%"><tr><td>Offline</td><td width="16"><img width="16px" src="/style/assets/offline.png"></td></tr></table>');
break;
};
case 1:{
cleanupDraw( data.nodes[i].id );
tt.update('<table style="background-color:#008000; color:#ffff00;" border="0" width="100%"><tr><td>Online</td><td width="16"><img width="16px" src="/style/assets/online.gif"></td></tr></table>');
break;
};
case 2:{
DrawTargets( data.nodes[i].id, data.nodes[i].targets );
tt.update('<table style="background-color:#ff0000; color:#ffff00;" border="0" width="100%"><tr><td>Alarm</td><td width="16"><img width="16px" src="/style/assets/online.gif"></td></tr></table>');
break;
};
};
};
};
};
},
failure: function( response, opts ) {
}
});
};
function loadDashBoard(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
@ -47,6 +162,7 @@ function loadDashBoard(){
tPanel.removeAll(true);
for( i=0; i < data.length; i++) tPanel.add( data[i] );
tPanel.doLayout();
tlInterval = window.setInterval( fetchSiteStatus, 333, selectedSite );
},
failure: function( response, opts ) {
var tPanel = Ext.getCmp('main_portal');

413
lib/javascript/jsapi_dynamic/rgoose_devices_module.js

@ -35,3 +35,416 @@ var devicesStore = new Ext.data.JsonStore({
})
});
var LRF1D2_st_win = null;
var LRF2D2_st_win = null;
var LRF16D3_st_win = null;
function loadFullLRF1D2Data( NodeID ){
Ext.Ajax.request({
url: '/lib/controller/getSettingsLidsr3D.php',
params: {
NID: NodeID,
UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>',
},
success: function( response, opts ){
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: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
});
};
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: 2
},
items:[{
html: 'Status',
frame: false,
border: false
},{
html: '<p class="green">ONLINE</p>',
frame: false,
border: false
},{
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'
},{
frame: false,
border: false
},{
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',
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'
},{
frame: false,
border: false
},{
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: 'Camera/DC Settings'
},{
title: 'Width Table'
},{
title: 'Zoom/Tilt Table'
}]
}
});
};
LRF1D2_st_win.show();
loadFullLRF1D2Data( SelectedNodeID );
};
function LRF2D2_settings(){
};
function LRF16D3_settings(){
};

349
lib/javascript/jsapi_dynamic/rgoose_location_editor.js

@ -615,63 +615,82 @@ function updateLocation( e ){
});
};
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 ){
//loadNodeLocationProps( locationSelectedNode );
loadLocationEditor();
}
});
};
function loadLocationNodes(){
Ext.Ajax.request({
url: '/lib/controller/getLocationItems.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
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:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 2:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 3:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 4:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 5:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 6:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 10:
case 12:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 11:
case 13:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
};
//bindPopup('A pretty CSS3 popup.<br> Easily customizable.');//.openPopup();
};
for( i=0; i < data.length; i++){
switch( data[i].type ){
case 1:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 2:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 3:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 4:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 5:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 6:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 10:
case 12:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
case 11:
case 13:{
L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dragend', updateLocation );
break;
};
};
//bindPopup('A pretty CSS3 popup.<br> 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();
tPanel.remove(0);
tPanel.add( { html: 'Failed to load dashboard!' } );
tPanel.doLayout();
}
});
};
@ -845,142 +864,156 @@ function loadNodeLocationProps( NodeID ){
Ext.Ajax.request({
url: '/lib/controller/getLocationNodeProps.php',
params: {
NID: <?=$SiteID;?>,
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
NODE: NodeID
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();
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
},
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 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: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
});
};
function loadLocationEditor(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( 'Location Map' );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_LOC_MAP_LBL_');?>' );
tPanel.add({
columnWidth: 0.83,
frame: false,
border: false,
columnWidth: 0.83,
frame: false,
border: false,
items: [{
layout: 'fit',
height: PanelH-150,
flex: 1,
height: PanelH-150,
flex: 1,
//border: true,
items:{
id: 'location_map'
}
items:{
id: 'location_map'
}
},{
layout: 'table',
title: 'Site Properties',
fileUpload: true,
flex: 1,
defaults: {
bodyStyle:'padding:20px'
},
layoutConfig: {
// The total column count must be specified here
columns: 7
},
items:[{
html: 'System Anchor Lat:'
},{
xtype: 'textfield',
id: 'siteLat',
value: SiteLat
},{
html: 'Lon:'
},{
xtype: 'textfield',
id: 'siteLon',
value: SiteLon
},{
html: 'Alt:'
},{
xtype: 'textfield',
id: 'siteAlt',
value: SiteAlt
},{
xtype: 'button',
text: 'Update',
handler: updateSiteAnchor
},{
html: 'Map Type:'
},{
xtype: 'radio',
name: 'map_type',
boxLabel: 'Regular WGS84 Map',
checked: true,
value: 0
},{
xtype: 'radio',
name: 'map_type',
boxLabel: 'Custom Image',
value: 1
},{
xtype: 'combo',
disabled: true,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: ['myId', 'displayText' ],
data: [[1, 'item1'], [2, 'item2']]
}),
valueField: 'myId',
displayField: 'displayText'
},{
colspan: 2,
xtype: 'fileuploadfield',
id: 'form-file',
disabled: true,
emptyText: 'Select an image',
fieldLabel: 'Photo',
name: 'photo-path',
buttonText: 'UPLOAD',
buttonCfg: {
iconCls: 'upload-icon'
}
}]
}]
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: '<center>Select Item From Map</center>'
}
});
title: 'Properties',
xtype: 'panel',
flex: 1,
height: 700,
columnWidth: 0.17,
layout: 'fit',
id: 'prop_content',
items:{
html: '<center>Select Item From Map</center>'
}
});
tPanel.doLayout();
map = L.map('location_map').setView([SiteLat, SiteLon], 17);
L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).bindPopup("<b>System Anchor!</b>");//.openPopup();
L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
/*
var map = L.map('map', {

66
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -63,6 +63,8 @@ Ext.onReady(function(){
//alert( winW + 'x' + winH );
CheckWindowSize();
Ext.QuickTips.init();
var viewport = new Ext.Viewport({
id: 'main_viewport',
layout:'border',
@ -159,27 +161,53 @@ Ext.onReady(function(){
},{
title: 'Profile Settings',
html: '<p>Panel content!</p>'
}
<?php
if( $CUser->Data['access'] > 5 ){
?>,{
title: 'Admin Settings',
items:[{
xtype: 'button',
width: '100%',
id:'adm_acc',
text: 'Users Management',
handler: function( b, e ){
window.location = '/login.php?UID=1';
}
},{
xtype: 'button',
width: '100%',
id:'adm_acclog',
text: 'Access Log',
handler: function( b, e ){
window.location = '/login.php?UID=1';
}
}]
}
<?php
};
?>
]
},{
xtype: 'panel',
region:'center',
margins: '5 5 5 0',
id: 'main_content',
title: 'System Dashboard',
items:[{
xtype: 'portal',
id: 'main_portal',
frame: false,
border: false,
items:{
html: '<p style="padding:10px;color:#556677;font-size:11px;"><center><img src="/style/img/logo.png"></center></p>'
},
listeners:{
drop: function( a ){
updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
}
}
}]
xtype: 'panel',
region:'center',
margins: '5 5 5 0',
id: 'main_content',
title: 'System Dashboard',
items:[{
xtype: 'portal',
id: 'main_portal',
frame: false,
border: false,
items:{
html: '<p style="padding:10px;color:#556677;font-size:11px;"><center><img src="/style/img/logo.png"></center></p>'
},
listeners:{
drop: function( a ){
updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
}
}
}]
}]
});
loadDashBoard();

105
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js

@ -414,6 +414,111 @@ function loadServerProperties( NodeID ){
}*/
});
};
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: [ <?php
$QS="SELECT so.id, so.name FROM nodes no LEFT JOIN sockets so ON( so.node_id = no.id ) WHERE ( no.type=0 OR no.type=20 ) AND no.site_id={$SiteID} AND so.type=1";
$RR=$DATABASE->Query( $QS );
if( count( $RR ) ){
$RE=array();
foreach( $RR as $R ){
$RE[] = "[ {$R['id']}, '{$R['name']}']";
};
echo implode( ',', $RE );
} else {
echo "[0, 'No UARTS DEFINED']";
};
?>]
}),
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: [ <?php
$QS="SELECT ca.id, ca.channel_id, dcb.serial_id FROM module_dcr_chanels ca LEFT JOIN modules_dcr dcb ON( ca.dcr_id = dcb.id ) WHERE dcb.site_id={$SiteID}";
$RR=$DATABASE->Query( $QS );
if( count( $RR ) ){
$RE=array();
foreach( $RR as $R ){
$RE[] = "[ {$R['id']}, '{$R['serial_id']}_{$R['channel_id']}']";
};
echo implode( ',', $RE );
} else {
echo "[0, 'No DCB Connected']";
};
?>]
}),
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: function( response, opts ) {
}
});
};
function loadSystemEditor(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );

12
lib/javascript/jsapi_dynamic/rgoose_timeline.js

@ -104,12 +104,12 @@ function LocRenderer( val ){
var eventsListColModel = new Ext.grid.ColumnModel({
columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "date",width: 80, 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: 80, sortable: false, dataIndex: 'event' },
{header: "targ", width: 200, sortable: false, dataindex: 'data' },
{header: "ID", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "Date",width: 80, 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: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'device' },
{header: "Event", width: 80, sortable: false, dataIndex: 'event' },
{header: "Info", width: 200, sortable: false, dataindex: 'data' },
{header: "", width: 20, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer }
],
defaults: {

5
lib/php/sys/r-goose_sys.php

@ -4,6 +4,11 @@ function getIfIp($IF){
return $RVal;
};
function generate2DMapImage( $datafile, $a ){
$image = @imagecreate( 150, 150 ) or die("Cannot Initialize new GD image stream");
};
function generate3DMapImage( $datafile, $byMin = true, $imagefile='' ){
$thumbnail = imagecreatetruecolor( 2304, 288);
if(!$thumbnail) {

BIN
style/assets/Untitled-1.psd

Binary file not shown.

BIN
style/assets/Untitled-2.psd

Binary file not shown.

BIN
style/assets/lfs_draw_empty_100.png

Binary file not shown.

After

Width: 200  |  Height: 200  |  Size: 12 KiB

BIN
style/assets/lfs_draw_empty_12.png

Binary file not shown.

After

Width: 200  |  Height: 200  |  Size: 7.8 KiB

BIN
style/assets/lfs_draw_empty_25.png

Binary file not shown.

After

Width: 200  |  Height: 200  |  Size: 10 KiB

BIN
style/assets/lfs_draw_empty_50.png

Binary file not shown.

After

Width: 200  |  Height: 200  |  Size: 11 KiB

BIN
style/assets/loading (1).gif

Binary file not shown.

After

Width: 128  |  Height: 128  |  Size: 61 KiB

BIN
style/assets/loading.gif

Binary file not shown.

After

Width: 200  |  Height: 200  |  Size: 111 KiB

BIN
style/assets/offline.png

Binary file not shown.

After

Width: 16  |  Height: 16  |  Size: 2.8 KiB

BIN
style/assets/online.gif

Binary file not shown.

After

Width: 128  |  Height: 128  |  Size: 50 KiB

7
style/style.css

@ -245,3 +245,10 @@ object:hover {
transform: scale(0.6, 0.6);
}
}
.dev_draw_container {
}
.dev_draw_img{
}
Loading…
Cancel
Save