Browse Source

After Slovakia Tests

master
Evgeny Gagua 5 years ago
parent
commit
7e5d236bc6
  1. 32
      index.php
  2. 18
      lib/controller/addConnection.php
  3. 49
      lib/controller/addNetworkNode.php
  4. 11
      lib/controller/clearEventCloud.php
  5. 2
      lib/controller/getDashBoardItems.php
  6. 31
      lib/controller/getEventProps.php
  7. 94
      lib/controller/getEventRecords.php
  8. 53
      lib/controller/getLocationNodeProps.php
  9. 2
      lib/controller/getNetwork.php
  10. 57
      lib/controller/getNetworkNodeProps.php
  11. 12
      lib/controller/getTimeLineGroups.php
  12. 149
      lib/controller/props/1_node_prop.js
  13. 224
      lib/controller/props/20_node_prop.js
  14. 149
      lib/controller/props/2_node_prop.js
  15. 149
      lib/controller/props/3_node_prop.js
  16. 149
      lib/controller/props/4_node_prop.js
  17. 189
      lib/controller/props/5_node_prop.js
  18. 58
      lib/controller/props/event_prop.js
  19. 7
      lib/controller/props/loc_prop.js
  20. 68
      lib/controller/removeNode.php
  21. 2
      lib/controller/updateLocation.php
  22. 24
      lib/controller/updateLrfSettings.php
  23. 26
      lib/controller/updateUartSettings.php
  24. 17
      lib/controller/updateUserSettings.php
  25. 142
      lib/javascript/jsapi_dynamic/rgoose_camera_editor.js
  26. 55
      lib/javascript/jsapi_dynamic/rgoose_location_editor.js
  27. 62
      lib/javascript/jsapi_dynamic/rgoose_main.js
  28. 96
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  29. 184
      lib/javascript/jsapi_dynamic/rgoose_timeline.js
  30. 14
      lib/javascript/jsapi_static/rgoose_general.js
  31. 21
      lib/php/ui/UI_functions.php
  32. BIN
      style/assets/1f9ed.png
  33. BIN
      style/assets/20_node.png
  34. BIN
      style/assets/argus.psd
  35. BIN
      style/assets/argus_logo.png
  36. BIN
      style/assets/argus_logo_text.png
  37. BIN
      style/assets/chch-1.png
  38. BIN
      style/assets/cube_bg.png
  39. BIN
      style/assets/cube_bg.psd

32
index.php

@ -8,25 +8,25 @@
UI_PageBottomExt();
} else {
UI_PageHeader();
if( $RTL_SITE ){
UI_Begin2Section();
} else {
UI_Begin2Section('120px');
UI_SideMenu();
UI_SectionDelimiter();
};
//if( $RTL_SITE ){
// UI_Begin2Section();
//} else {
// UI_Begin2Section('120px');
// UI_SideMenu();
// UI_SectionDelimiter();
//};
//Main Content
if( $CUser->Data[id] > 1 ){
UI_MainDashBoard();
} else {
//if( $CUser->Data[id] > 1 ){
// UI_MainDashBoard();
//} else {
UI_LoginForm();
};
//};
if( $RTL_SITE ){
UI_SectionDelimiter('120px');
UI_SideMenu();
}
UI_End2Section();
//if( $RTL_SITE ){
// UI_SectionDelimiter('120px');
// UI_SideMenu();
//}
// UI_End2Section();
UI_PageBottom();
};

18
lib/controller/addConnection.php

@ -33,14 +33,28 @@
// $QS="UPDATE media_streams SET binded=1, destination_id={$a1} WHERE id={$a2}";
//$DATABASE->Query( $QS, false );
$QS="INSERT INTO `media_server_streams` SET `site_id`={$SiteID}, `media_server_id`={$a1}, `media_stream_id`={$a2}";
$DATABASE->Query( $QS, false );
} else {
// 2 is Media Server
//$QS="UPDATE media_streams SET binded=1, destination_id={$a2} WHERE id={$a1}";
//$DATABASE->Query( $QS, false );
$QS="INSERT INTO `media_server_streams` SET `site_id`={$SiteID}, `media_server_id`={$a2}, `media_stream_id`={$a1}";
$DATABASE->Query( $QS, false );
};
$DATABASE->Query( $QS, false );
};
$QS="SELECT * FROM `nodes` WHERE `id`={$node1['node_id']}";
$RR=$DATABASE->Query( $QS, false );
$Z1=$RR[0];
$QS="SELECT * FROM `nodes` WHERE `id`={$node2['node_id']}";
$RR=$DATABASE->Query( $QS, false );
$Z2=$RR[0];
if( ( $Z1['type']==20 && $Z2['type']< 5 ) || ( $Z1['type'] < 5 && $Z2['type'] == 20 ) ){
// Bind LRF Sensor to Ethernet UART
if( $Z1['type'] == 20 ){
$QS = "UPDATE `lrf_sensors` SET `uart_id`={$a1} WHERE `id`={$a2}";
} else {
$QS = "UPDATE `lrf_sensors` SET `uart_id`={$a2} WHERE `id`={$a1}";
};
$DATABASE->Query( $QS, false );
};
if( $d1==0 ){
$QS="UPDATE `sockets` SET `binded`=1 WHERE id={$SSID}";

49
lib/controller/addNetworkNode.php

@ -3,31 +3,64 @@
if( $CUser->Data['id'] > 1 ){
$SiteID = intval($_POST['NID']);
$NodeType = intval($_POST['TYPE']);
$Data['success'] = false;
if( $NodeType ){
$QS = "INSERT INTO nodes SET type={$NodeType}, site_id={$SiteID}";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
if( $DevID ){
switch( $NodeType ){
case 1://Als
case 2://Lfs
case 3://Pls
case 4://pls
$QS = "INSERT INTO `lrf_sensors` SET `type_id`={$NodeType}, `site_id`={$SiteID}";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
$QS = "INSERT INTO `nodes` SET `type`={$NodeType}, `site_id`={$SiteID}, `aux_id`={$DevID}";
$DATABASE->Query( $QS, false );
$NODEID = $DATABASE->getLastInsertID();
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_IN . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Device Control Line'";
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_IN . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Device Control Line'";
$DATABASE->Query( $QS, false );
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_OUT . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Camera Control Line'";
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_OUT . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Camera Control Line'";
$DATABASE->Query( $QS, false );
$Data['success'] = true;
break;
case 5://3D
$QS = "INSERT INTO `lrf_sensors` SET `type_id`={$NodeType}, `site_id`={$SiteID}";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
$QS = "INSERT INTO `nodes` SET `type`={$NodeType}, `site_id`={$SiteID}, `aux_id`={$DevID}";
$DATABASE->Query( $QS, false );
$NODEID = $DATABASE->getLastInsertID();
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_TCP . ", binded=0, md5='{$MM}', `name`='Network Connection'";
$DATABASE->Query( $QS, false );
$Data['success'] = true;
break;
case 20://IpUart
$SPD = intval( $_POST['UART_SPEED'] );
$BITS = intval( $_POST['UART_BITS'] );
$STOP = floatval( $_POST['UART_STOP'] );
$PAR = strtoupper( substr($_POST['UART_PAR'],0,1) );
$MODE = intval( $_POST['UART_MODE'] );
$IP = $DATABASE->escape( $_POST['UART_IP'] );
$PORT = intval( $_POST['UART_PORT'] );
$QS = "INSERT INTO uart_settings SET `type`=2, `socket_id`=0, `mode`={$MODE}, `bit`={$BITS}, `parity`='{$PAR}', `stop_bit`={$STOP}, `port`={$PORT}, `path`='{$IP}'";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
$QS = "INSERT INTO nodes SET `type`={$NodeType}, `aux_id`={$DevID}, `site_id`={$SiteID}";
$DATABASE->Query( $QS, false );
$NODEID = $DATABASE->getLastInsertID();
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_TCP . ", binded=0, md5='{$MM}', `name`='Network Connection'";
$DATABASE->Query( $QS, false );
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_TCP . ", binded=0, md5='{$MM}', `name`='Network Connection'";
$QS = "INSERT INTO sockets SET node_id={$NODEID}, `aux_id`={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='UART Connection'";
$DATABASE->Query( $QS, false );
$Data['success'] = true;
break;
};
};
};
echo json_encode( $Data );
} else {
header('location: /');
};

11
lib/controller/clearEventCloud.php

@ -0,0 +1,11 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$QS = "INSERT INTO `events_archive` (`node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`range_digital`,`azimuth`,`elevation`,`range`,`area`,`lat`,`lon`,`alt`,`custom`) SELECT `node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`range_digital`,`azimuth`,`elevation`,`range`,`area`,`lat`,`lon`,`alt`,`custom` FROM `events_cloud`";
$DATABASE->Query( $QS, false );
$QS = "DELETE FROM events_cloud";
$DATABASE->Query( $QS, false );
} else {
header('location: /');
};
?>

2
lib/controller/getDashBoardItems.php

@ -82,7 +82,7 @@
};
$index++;
};
if( $i == 0 ) $TPL[] = '{ id: \'db_node_22311232\', frame: false, colspan: 2, width: 516, height: 200, border: true, title: \'PIZDA\', items:[{ html: \'<p>Server</p>\'}]}';
//if( $i == 0 ) $TPL[] = '{ id: \'db_node_22311232\', frame: false, colspan: 2, width: 516, height: 200, border: true, title: \'PIZDA\', items:[{ html: \'<p>Server</p>\'}]}';
$STOL[$i] = $P1 . implode( ',', $TPL ) . $P2;
};
$Data = '[' . implode( ',' , $STOL ) . ']';

31
lib/controller/getEventProps.php

@ -0,0 +1,31 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['EVENT'] );
$QS = "SELECT * FROM events_cloud WHERE id = {$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$Props = $Result[0];
$QS="SELECT * FROM nodes WHERE id={$Props['node_id']}";
$RR = $DATABASE->Query( $QS );
$CC = $RR[0];
$Type = intval( $Props['type'] );
$TName = 'props/event_prop.js';
$Data = file_get_contents( $TName );
$Data = str_replace('%%%NODEID%%%', $Props['node_id'], $Data );
$Data = str_replace('%%%TYPE%%%', $CC['type'], $Data );
$Data = str_replace('%%%NAME%%%', $CC['name'], $Data );
$Data = str_replace('%%%AZIMUTH%%%', sprintf( "%0.2f", $Props['azimuth']), $Data );
$Data = str_replace('%%%ELEVETION%%%', sprintf( "%0.2f", $Props['elevation']), $Data );
$Data = str_replace('%%%RANGE%%%', sprintf( "%0.2f", $Props['range']), $Data );
$Data = str_replace('%%%LON%%%', sprintf( "%0.8f", $Props['lon']), $Data );
$Data = str_replace('%%%LAT%%%', sprintf( "%0.8f", $Props['lat']), $Data );
$Data = str_replace('%%%ALT%%%', sprintf( "%0.1f", $Props['alt']), $Data );
echo $Data;
} else {
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
} else {
header('location: /');
};
?>

94
lib/controller/getEventRecords.php

@ -0,0 +1,94 @@
<?php
require_once('../ajax_asm.php');
function getNodeName( $NID ){
global $DATABASE;
$EID = intval( $NID );
if( $EID ){
$QS = "SELECT name FROM nodes WHERE id={$EID}";
$RV = $DATABASE->Query( $QS );
if( count( $RV ) ){
return $RV[0]['name'];
};
return '-NoName-';
} else {
return 'Argus Server';
};
};
if( $CUser->Data['id'] > 1 ){
$Data = array();
$GID = intval($_POST['NID']);
$QS = "SELECT * FROM events_cloud ORDER BY id DESC LIMIT 20";
$Result = $DATABASE->Query( $QS, false );
date_default_timezone_set('UTC');
//foreach( array_reverse ( $Result ) as $CD ){
foreach( $Result as $CD ){
$cnode['has_target'] = false;
$cnode['has_geo'] = false;
switch( intval( $CD['evt_type'] ) ){
case 0:// NoInit
case 1:// Ready
case 2:// Alarm
case 3:// Command
case 4:// Key
case 5:// Joystick
continue; break;
case 6:// STUDY
$cnode['event']='Device Enters Into Study Mode';
break;
case 7:// BUSY
$cnode['event']='Device Is BUSY';
break;
case 8:// FLIP
$cnode['event']='Flip Complete';
break;
case 9:// SCAN
$cnode['event']='Scan Complete';
break;
case 10:// Target 1D
case 11:// Target 3DW
case 12:// Target 3DB
case 13:// Target 2DW
case 14:// Target 2DB
$cnode['event']='Target';
$cnode['data'] = sprintf("AZ: %0.2f El: %0.2f R: %0.2f", floatval($CD['azimuth']), floatval($CD['elevation']), floatval($CD['range']));
$cnode['has_target'] = true;
$cnode['has_geo'] = true;
break;
case 15:// Capture Start
case 16:// Capture End
case 17:// Capture Done
case 18:// Mission Begin
case 19:// Cancel Action
case 20:// Fly To
case 21:// WayPoint
case 22:// Dest Reached
case 23:// Jaming Begin
case 24:// Jamer On
case 25:// Jamer Off
case 26:// Target Locked
case 27:// Intercept Begin
case 28:// Intercept OK
case 29:// Intercept NOK
case 20:// Mission End
case 31:// Landed
case 32:// FH Busy
case 33:// Camera DM
case 34:// Error
default:
continue;
break;
};
$cnode['id'] = intval( $CD['id'] );
$uts = intval($CD['ts']);
$cnode['date'] = date( "m.d.y", $uts );
$cnode['time'] = date( "H:m:s", $uts );
$cnode['device'] = getNodeName( $CD['node_id'] );
$Data[] = $cnode;
};
$RA['log']=$Data;
$RA['totalCount'] = count( $Data );
echo json_encode( $RA );
} else {
header('location: /');
};
?>

53
lib/controller/getLocationNodeProps.php

@ -12,19 +12,40 @@
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$Data = str_replace('%%%TYPE%%%', $Type, $Data );
switch( $Type ){
case 1:
case 2:
case 3:
case 4:
case ARGUS_3D_SENSOR:{
$QS = "SELECT * FROM lrf_sensors WHERE id={$Props['aux_id']}";
$RR = $DATABASE->Query( $QS );
$C = $RR[0];
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
$Data = str_replace('%%%NAME%%%', $Props['name'] , $Data );
//Loc
$LAT = floatval( $C['lat'] );
$LON = floatval( $C['lon'] );
$ALT = floatval( $C['alt'] );
$ROLL = floatval( $C['roll'] );
$PITCH = floatval( $C['pitch'] );
$YAW = floatval( $C['yaw'] );
$Data = str_replace( '%%%LAT%%%', $LAT, $Data );
$Data = str_replace( '%%%LON%%%', $LON, $Data );
$Data = str_replace( '%%%ALT%%%', $ALT, $Data );
$Data = str_replace( '%%%ROLL%%%', $ROLL, $Data );
$Data = str_replace( '%%%PITCH%%%', $PITCH, $Data );
$Data = str_replace( '%%%YAW%%%', $YAW, $Data );
//Info
$InfoData = '';
$InfoParts = array();
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ID">'.$Server['identity'].'</div>\'}';
switch( intval($Props['online']) ){
case 0: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}'; break;
case 1: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Handler Online</div>\'}'; break;
case 3: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Master Online</div>\'}'; break;
case 5: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Slave Online</div>\'}'; break;
case 7: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Device Online</div>\'}'; break;
case 0: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}'; break;
case 1: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Handler Online</div>\'}'; break;
case 3: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Master Online</div>\'}'; break;
case 5: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Slave Online</div>\'}'; break;
case 7: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Device Online</div>\'}'; break;
};
$InfoData = implode( ',', $InfoParts );
$Data = str_replace('%%%INFO%%%', $InfoData, $Data );
@ -34,16 +55,22 @@
$QS="SELECT * FROM cameras WHERE id={$Props['aux_id']}";
$RR = $DATABASE->Query( $QS );
$C = $RR[0];
$LAT = floatval( $C['lat'] );
$LON = floatval( $C['lon'] );
$ALT = floatval( $C['alt'] );
$ROLL = floatval( $C['roll'] );
$PITCH = floatval( $C['pitch'] );
$YAW = floatval( $C['yaw'] );
$Data = str_replace( '%%%LAT%%%', $LAT, $Data );
$Data = str_replace( '%%%LON%%%', $LON, $Data );
$Data = str_replace( '%%%ALT%%%', $ALT, $Data );
$Data = str_replace( '%%%ROLL%%%', $ROLL, $Data );
$Data = str_replace( '%%%PITCH%%%', $PITCH, $Data );
$Data = str_replace( '%%%YAW%%%', $YAW, $Data );
$Data = str_replace( '%%%NAME%%%', urldecode( $C['name'] ), $Data );
$Data = str_replace( '%%%LAT%%%', $C['lat'], $Data );
$Data = str_replace( '%%%LON%%%', $C['lon'], $Data );
$Data = str_replace( '%%%ALT%%%', $C['alt'], $Data );
$Data = str_replace( '%%%ROLL%%%', $C['roll'], $Data );
$Data = str_replace( '%%%PITCH%%%', $C['pitch'], $Data );
$Data = str_replace( '%%%YAW%%%', $C['yaw'], $Data );
break;
};
//default: $Data = '{}';
default: $Data = '{}';
};
echo $Data;
} else {

2
lib/controller/getNetwork.php

@ -76,7 +76,7 @@
break;
case ARGUS_IP_UART_GATEWAY:
$cnode['label'] = 'Serial2Ethernet';
$cnode['image'] = '/style/assets/videoServer.png';
$cnode['image'] = '/style/assets/20_node.png';
break;
case ARGUS_JAMER:
$cnode['label'] = 'RF Jammer';

57
lib/controller/getNetworkNodeProps.php

@ -10,22 +10,31 @@
$TName = 'props/'.$Type.'_node_prop.js';
$Data = file_get_contents( $TName );
switch( $Type ){
case 1:
case 2:
case 3:
case 4:{
$QS="SELECT * FROM lrf_sensors WHERE id={$Props['aux_id']}";
$RR = $DATABASE->Query( $QS );
$CC = $RR[0];
$Data = str_replace('%%%DEV_LABEL%%%', ''.$Props['name'], $Data );
$Data = str_replace('%%%LRF_ID%%%', ''.$Props['aux_id'], $Data );
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$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 );
break;
};
case ARGUS_3D_SENSOR:{
$QS="SELECT * FROM lrf_sensors WHERE id={$Props['aux_id']}";
$RR = $DATABASE->Query( $QS );
$CC = $RR[0];
$Data = str_replace('%%%DEV_LABEL%%%', ''.$Props['name'], $Data );
$Data = str_replace('%%%LRF_ID%%%', ''.$Props['aux_id'], $Data );
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
//Info
$InfoData = '';
$InfoParts = array();
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ID">'.$Server['identity'].'</div>\'}';
switch( intval($Props['online']) ){
case 0: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}'; break;
case 1: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Handler Online</div>\'}'; break;
case 3: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Master Online</div>\'}'; break;
case 5: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Slave Online</div>\'}'; break;
case 7: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Device Online</div>\'}'; break;
};
$InfoData = implode( ',', $InfoParts );
$Data = str_replace('%%%INFO%%%', $InfoData, $Data );
$Data = str_replace('%%%IP_ADDRESS%%%', $CC['ip_address'] , $Data );
$Data = str_replace('%%%IP_PORT%%%', $CC['port'] , $Data );
break;
};
case 13:{
@ -43,6 +52,28 @@
};
break;
};
case 20:{
// Net UART
$QS="SELECT * FROM uart_settings WHERE id={$Props['aux_id']}";
$RR=$DATABASE->Query( $QS );
$C=$RR[0];
$Data = str_replace( '%%%NODE_ID%%%',$Props['id'], $Data );
$Data = str_replace( '%%%UART_ID%%%',$C['id'], $Data );
$Data = str_replace( '%%%CONTYPE%%%',$C['mode'], $Data );
switch( $C['mode'] ){
case 0: $Data = str_replace( '%%%CON_TYPE%%%','UDP Client', $Data ); break;
case 1: $Data = str_replace( '%%%CON_TYPE%%%','TCP Client', $Data ); break;
case 2: $Data = str_replace( '%%%CON_TYPE%%%','UDP Server', $Data ); break;
case 3: $Data = str_replace( '%%%CON_TYPE%%%','TCP Server', $Data ); break;
};
$Data = str_replace( '%%%ADR_IP%%%',$C['path'], $Data );
$Data = str_replace( '%%%ADDR_PORT%%%',$C['port'], $Data );
$Data = str_replace( '%%%UART_SPEED%%%',$C['speed'], $Data );
$Data = str_replace( '%%%UART_BIT%%%',$C['bit'], $Data );
$Data = str_replace( '%%%UART_PARITY%%%',$C['parity'], $Data );
$Data = str_replace( '%%%UART_STOP%%%',$C['stop_bit'], $Data );
break;
};
default: $Data = '{}';
};
echo $Data;

12
lib/controller/getTimeLineGroups.php

@ -6,6 +6,7 @@
$QS = "SELECT * FROM nodes WHERE site_id ={$GID}";
$Result = $DATABASE->Query( $QS, false );
foreach( $Result as $CD ){
$NodeOK = false;
switch( $CD['type'] ){
case 0:
continue;
@ -15,27 +16,34 @@
case 1:
$cnode['content'] = 'ALS';
$cnode['image'] = '/style/assets/1_node.png';
$NodeOK = true;
break;
case 2:
$cnode['content'] = 'LFS';
$cnode['image'] = '/style/assets/2_node.png';
$NodeOK = true;
break;
case 3:
$cnode['content'] = 'PLS-200';
$cnode['image'] = '/style/assets/3_node.png';
$NodeOK = true;
break;
case 4:
$cnode['content'] = 'PLS-360';
$cnode['image'] = '/style/assets/4_node.png';
$NodeOK = true;
break;
case 5:
$cnode['content'] = '3DLRF';
$cnode['image'] = '/style/assets/5_node.png';
$NodeOK = true;
break;
default: continue;
};
$cnode['id'] = $CD['id'];
$Data[] = $cnode;
if( $NodeOK ){
$cnode['id'] = $CD['id'];
$Data[] = $cnode;
};
};
echo json_encode( $Data );
} else {

149
lib/controller/props/1_node_prop.js

@ -0,0 +1,149 @@
{
xtype: 'form',
labelWidth: 40, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/1_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Device',
autoHeight: true,
defaults: {
//width: 180
},
collapsed: false,
items :[{
xtype: 'hidden',
id: 'dev_name',
name: 'dev_name',
value: '%%%DEV_LABEL%%%'
},{
xtype: 'hidden',
id: 'max_range',
name: 'max_range',
value: %%%MAX_RANGE%%%
},{
xtype: 'hidden',
id: 'dev_id',
name: 'dev_id',
value: %%%DEVICE_ID%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</p>'
}]
},{
xtype: 'button',
text: 'Change Settings',
width: '100%',
handler: function(){
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
//height: 480,
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
fieldLabel: 'Device Name',
id: 'ued_name'
},{
fieldLabel: 'Device Address',
id: 'ued_address'
},{
fieldLabel: 'Maximal Range',
id: 'ued_range'
}]
}],
buttons:[{
text: 'Cancel',
handler: function(){
wAddSocket.close();
wAddSocket = null;
}
},{
text: 'Apply Settings',
handler: function(){
var val_name = Ext.getCmp('ued_name').getValue();
var val_addr = Ext.getCmp('ued_address').getValue();
var val_range = Ext.getCmp('ued_range').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateLrfSettings.php',
params: {
SENSOR: %%%LRF_ID%%%,
SADDR: val_addr,
SNAME: val_name,
SRANGE: val_range
},
success: function( response, opts ){
wAddSocket.close();
wAddSocket = null;
loadNodeProperties( %%%NODEID%%% );
},
failure: function( response, opts ) {
}
});
}
}]
});
wAddSocket.show();
Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_id').getValue());
Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue());
}
},{
xtype:'fieldset',
title: 'Master LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
},{
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>'
}]
}]
}

224
lib/controller/props/20_node_prop.js

@ -0,0 +1,224 @@
{
xtype: 'form',
labelWidth: 40, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/20_node.png"><br/>Ethernet2Serial<br/></p>'
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Network',
autoHeight: true,
defaults: {
//width: 180
},
collapsed: false,
items :[{
xtype: 'hidden',
id: 'uart_mode',
name: 'uart_mode',
value: '%%%CONTYPE%%%'
},{
xtype: 'hidden',
id: 'uart_ip',
name: 'uart_ip',
value: '%%%ADR_IP%%%'
},{
xtype: 'hidden',
id: 'uart_port',
name: 'uart_port',
value: %%%ADDR_PORT%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%CON_TYPE%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%ADR_IP%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%ADDR_PORT%%%</p>'
}]
},{
xtype:'fieldset',
title: 'UART',
collapsible: true,
autoHeight:true,
defaults: {
//width: 168
},
items :[{
xtype: 'hidden',
id: 'uart_speed',
name: 'uart_speed',
value: %%%UART_SPEED%%%
},{
xtype: 'hidden',
id: 'uart_bit',
name: 'uart_bit',
value: %%%UART_BIT%%%
},{
xtype: 'hidden',
id: 'uart_parity',
name: 'uart_parity',
value: '%%%UART_PARITY%%%'
},{
xtype: 'hidden',
id: 'uart_stops',
name: 'uart_stops',
value: %%%UART_STOP%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%UART_SPEED%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%UART_BIT%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%UART_PARITY%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">%%%UART_STOP%%%</p>'
}]
},{
xtype: 'button',
text: 'Change Settings',
width: '100%',
handler: function(){
var wAddSocket = new Ext.Window({
title: 'UART Settings',
width: 450,
//height: 480,
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
xtype: 'combo',
fieldLabel: 'Speed',
id: 'ued_speed',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['speed'],
data: [[19200], [115200]]
}),
valueField: 'speed',
displayField: 'speed'
},{
xtype: 'combo',
fieldLabel: 'Bits',
id: 'ued_bit',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['bits'],
data: [[5],[6],[7],[8],[9]]
}),
valueField: 'bits',
displayField: 'bits'
},{
xtype: 'combo',
fieldLabel: 'Stop Bit',
lazyRender:true,
id: 'ued_stops',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['stops'],
data: [[1],[1.5],[2]]
}),
valueField: 'stops',
displayField: 'stops'
},{
xtype: 'combo',
fieldLabel: 'Parity',
lazyRender:true,
id: 'ued_parity',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['parity'],
data: [['Odd'], ['Even'],['None']]
}),
valueField: 'parity',
displayField: 'parity'
},{
xtype: 'combo',
fieldLabel: 'Working Mode',
lazyRender: true,
id: 'ued_mode',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [[0,'UDP Client'], [1,'TCP Client'], [2,'UDP Server'], [3,'TCP Server']]
}),
valueField: 'mode',
displayField: 'mode_txt'
},{
fieldLabel: 'IP Address',
id: 'ued_ip'
},{
fieldLabel: 'IP Port',
id: 'ued_port'
}]
}],
buttons:[{
text: 'Cancel',
handler: function(){
wAddSocket.close();
wAddSocket = null;
}
},{
text: 'Apply Settings',
handler: function(){
var val_uart_speed = Ext.getCmp('ued_speed').getValue();
var val_uart_bit = Ext.getCmp('ued_bit').getValue();
var val_uart_stops = Ext.getCmp('ued_stops').getValue();
var val_uart_parity = Ext.getCmp('ued_parity').getValue();
var val_uart_ip = Ext.getCmp('ued_ip').getValue();
var val_uart_port = Ext.getCmp('ued_port').getValue();
var val_uart_mode = Ext.getCmp('ued_mode').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateUartSettings.php',
params: {
UART: %%%UART_ID%%%,
USPD: val_uart_speed,
UBIT: val_uart_bit,
USTP: val_uart_stops,
UPAR: val_uart_parity,
UADR: val_uart_ip,
UPOR: val_uart_port,
UMOD: val_uart_mode
},
success: function( response, opts ){
wAddSocket.close();
wAddSocket = null;
loadNodeProperties( %%%NODE_ID%%% );
},
failure: function( response, opts ) {
}
});
}
}]
});
wAddSocket.show();
Ext.getCmp('ued_speed').setValue( Ext.getCmp('uart_speed').getValue());
Ext.getCmp('ued_bit').setValue( Ext.getCmp('uart_bit').getValue());
Ext.getCmp('ued_stops').setValue( Ext.getCmp('uart_stops').getValue());
switch( Ext.getCmp('uart_parity').getValue() ){
case 'E': Ext.getCmp('ued_parity').setValue( 'Even' ); break;
case 'O': Ext.getCmp('ued_parity').setValue( 'Odd' ); break;
case 'N': Ext.getCmp('ued_parity').setValue( 'None' ); break;
};
Ext.getCmp('ued_ip').setValue( Ext.getCmp('uart_ip').getValue());
Ext.getCmp('ued_port').setValue( Ext.getCmp('uart_port').getValue());
Ext.getCmp('ued_mode').setValue( Ext.getCmp('uart_mode').getValue());
}
}]
}

149
lib/controller/props/2_node_prop.js

@ -0,0 +1,149 @@
{
xtype: 'form',
labelWidth: 40, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/2_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Device',
autoHeight: true,
defaults: {
//width: 180
},
collapsed: false,
items :[{
xtype: 'hidden',
id: 'dev_name',
name: 'dev_name',
value: '%%%DEV_LABEL%%%'
},{
xtype: 'hidden',
id: 'max_range',
name: 'max_range',
value: %%%MAX_RANGE%%%
},{
xtype: 'hidden',
id: 'dev_id',
name: 'dev_id',
value: %%%DEVICE_ID%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</p>'
}]
},{
xtype: 'button',
text: 'Change Settings',
width: '100%',
handler: function(){
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
//height: 480,
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
fieldLabel: 'Device Name',
id: 'ued_name'
},{
fieldLabel: 'Device Address',
id: 'ued_address'
},{
fieldLabel: 'Maximal Range',
id: 'ued_range'
}]
}],
buttons:[{
text: 'Cancel',
handler: function(){
wAddSocket.close();
wAddSocket = null;
}
},{
text: 'Apply Settings',
handler: function(){
var val_name = Ext.getCmp('ued_name').getValue();
var val_addr = Ext.getCmp('ued_address').getValue();
var val_range = Ext.getCmp('ued_range').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateLrfSettings.php',
params: {
SENSOR: %%%LRF_ID%%%,
SADDR: val_addr,
SNAME: val_name,
SRANGE: val_range
},
success: function( response, opts ){
wAddSocket.close();
wAddSocket = null;
loadNodeProperties( %%%NODEID%%% );
},
failure: function( response, opts ) {
}
});
}
}]
});
wAddSocket.show();
Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_id').getValue());
Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue());
}
},{
xtype:'fieldset',
title: 'Master LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
},{
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>'
}]
}]
}

149
lib/controller/props/3_node_prop.js

@ -0,0 +1,149 @@
{
xtype: 'form',
labelWidth: 40, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/3_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Device',
autoHeight: true,
defaults: {
//width: 180
},
collapsed: false,
items :[{
xtype: 'hidden',
id: 'dev_name',
name: 'dev_name',
value: '%%%DEV_LABEL%%%'
},{
xtype: 'hidden',
id: 'max_range',
name: 'max_range',
value: %%%MAX_RANGE%%%
},{
xtype: 'hidden',
id: 'dev_id',
name: 'dev_id',
value: %%%DEVICE_ID%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</p>'
}]
},{
xtype: 'button',
text: 'Change Settings',
width: '100%',
handler: function(){
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
//height: 480,
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
fieldLabel: 'Device Name',
id: 'ued_name'
},{
fieldLabel: 'Device Address',
id: 'ued_address'
},{
fieldLabel: 'Maximal Range',
id: 'ued_range'
}]
}],
buttons:[{
text: 'Cancel',
handler: function(){
wAddSocket.close();
wAddSocket = null;
}
},{
text: 'Apply Settings',
handler: function(){
var val_name = Ext.getCmp('ued_name').getValue();
var val_addr = Ext.getCmp('ued_address').getValue();
var val_range = Ext.getCmp('ued_range').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateLrfSettings.php',
params: {
SENSOR: %%%LRF_ID%%%,
SADDR: val_addr,
SNAME: val_name,
SRANGE: val_range
},
success: function( response, opts ){
wAddSocket.close();
wAddSocket = null;
loadNodeProperties( %%%NODEID%%% );
},
failure: function( response, opts ) {
}
});
}
}]
});
wAddSocket.show();
Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_id').getValue());
Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue());
}
},{
xtype:'fieldset',
title: 'Master LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
},{
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>'
}]
}]
}

149
lib/controller/props/4_node_prop.js

@ -0,0 +1,149 @@
{
xtype: 'form',
labelWidth: 40, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/4_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Device',
autoHeight: true,
defaults: {
//width: 180
},
collapsed: false,
items :[{
xtype: 'hidden',
id: 'dev_name',
name: 'dev_name',
value: '%%%DEV_LABEL%%%'
},{
xtype: 'hidden',
id: 'max_range',
name: 'max_range',
value: %%%MAX_RANGE%%%
},{
xtype: 'hidden',
id: 'dev_id',
name: 'dev_id',
value: %%%DEVICE_ID%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</p>'
}]
},{
xtype: 'button',
text: 'Change Settings',
width: '100%',
handler: function(){
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
//height: 480,
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
fieldLabel: 'Device Name',
id: 'ued_name'
},{
fieldLabel: 'Device Address',
id: 'ued_address'
},{
fieldLabel: 'Maximal Range',
id: 'ued_range'
}]
}],
buttons:[{
text: 'Cancel',
handler: function(){
wAddSocket.close();
wAddSocket = null;
}
},{
text: 'Apply Settings',
handler: function(){
var val_name = Ext.getCmp('ued_name').getValue();
var val_addr = Ext.getCmp('ued_address').getValue();
var val_range = Ext.getCmp('ued_range').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateLrfSettings.php',
params: {
SENSOR: %%%LRF_ID%%%,
SADDR: val_addr,
SNAME: val_name,
SRANGE: val_range
},
success: function( response, opts ){
wAddSocket.close();
wAddSocket = null;
loadNodeProperties( %%%NODEID%%% );
},
failure: function( response, opts ) {
}
});
}
}]
});
wAddSocket.show();
Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_id').getValue());
Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue());
}
},{
xtype:'fieldset',
title: 'Master LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
},{
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>'
}]
}]
}

189
lib/controller/props/5_node_prop.js

@ -1,54 +1,149 @@
{
xtype: 'form',
labelWidth: 75, // label settings here cascade unless overridden
labelWidth: 40, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
width: 190,
defaults: {
width: 190
},
defaultType: 'textfield',
items: [
{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/5_node.png"><br/>%%%NODENAME%%%<br/></p>'
},{
xtype:'fieldset',
title: 'Information',
collapsible: true,
autoHeight: true,
defaults: {
width: 168
},
items :[ %%%INFO%%% ]
},{
xtype:'fieldset',
title: 'Settings',
collapsible: true,
autoHeight:true,
defaults: {
width: 168
},
items :[{
xtype: 'button',
text: 'Master LRF',
handler: function(){
editSettingsLidar3D( 34,true );
}
},{
xtype: 'button',
text: 'Slave LRF',
handler: function() {
editSettingsLidar3D( 34,false );
}
}]
}
],
buttons: [{
text: 'Refresh',
handler: function(){
loadNodeProperties(%%%NODEID%%%);
}
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/5_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Device',
autoHeight: true,
defaults: {
//width: 180
},
collapsed: false,
items :[{
xtype: 'hidden',
id: 'dev_name',
name: 'dev_name',
value: '%%%DEV_LABEL%%%'
},{
xtype: 'hidden',
id: 'dev_ip',
name: 'dev_ip',
value: '%%%IP_ADDRESS%%%'
},{
xtype: 'hidden',
id: 'dev_port',
name: 'dev_port',
value: %%%IP_PORT%%%
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">IPv4: %%%IP_ADDRESS%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Port: %%%IP_PORT%%%</p>'
}]
},{
xtype: 'button',
text: 'Change Settings',
width: '100%',
handler: function(){
var wAddSocket = new Ext.Window({
title: 'Sensor Settings',
width: 450,
//height: 480,
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
fieldLabel: 'Label',
id: 'ued_name'
},{
fieldLabel: 'IP Address',
id: 'ued_address'
},{
fieldLabel: 'Port',
value: 2222,
readOnly: true,
id: 'ued_port'
}]
}],
buttons:[{
text: 'Cancel',
handler: function(){
wAddSocket.close();
wAddSocket = null;
}
},{
text: 'Apply Settings',
handler: function(){
var val_addr = Ext.getCmp('ued_address').getValue();
var val_name = Ext.getCmp('ued_name').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateLrfSettings.php',
params: {
SENSOR: %%%LRF_ID%%%,
SNAME: val_name,
SIPADDR: val_addr
},
success: function( response, opts ){
wAddSocket.close();
wAddSocket = null;
loadNodeProperties( %%%NODEID%%% );
},
failure: function( response, opts ) {
}
});
}
}]
});
wAddSocket.show();
Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_ip').getValue());
Ext.getCmp('ued_port').setValue( Ext.getCmp('dev_port').getValue());
}
},{
xtype:'fieldset',
title: 'Master LRF',
collapsible: true,
autoHeight: true,
defaults: {
//width: 168
},
items :[{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
},{
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>'
}]
}]
}

58
lib/controller/props/event_prop.js

@ -0,0 +1,58 @@
{
xtype: 'form',
labelWidth: 75, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items: [{
xtype: 'panel',
height: 100,
html: '<p align="center"><img src="/style/assets/%%%TYPE%%%_node.png"><br/>%%%NAME%%%<br/></p>'
},{
xtype: 'fieldset',
title: 'Event Data',
autoHeight: true,
items: [{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Azimuth: %%%AZIMUTH%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Elevation: %%%ELEVETION%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%RANGE%%%</p>'
}]
},{
xtype:'fieldset',
//checkboxToggle:true,
collapsible: true,
title: 'Location',
autoHeight: true,
defaults: {
//width: 180
},
defaultType: 'textfield',
collapsed: false,
items :[{
xtype: 'panel',
//html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;"><a href="https://www.google.com/maps/@%%%LAT%%%,%%%LON%%%,19z" target="-new">Goole Map</a></p>'
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;"><a href="https://www.google.com/maps/search/?api=1&query=%%%LAT%%%,%%%LON%%%" target="-new">Goole Map</a></p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Lat: %%%LAT%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Lon: %%%LON%%%</p>'
},{
xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Alt: %%%ALT%%%</p>'
}]
}],
/*
buttons: [{
text: 'Update',
width: '100%',
handler: updateLocationOrientation
}]
*/
}

7
lib/controller/props/loc_prop.js

@ -71,10 +71,9 @@
text: 'Edit Orientation',
handler: orientationEditor
}]
}],
buttons: [{
text: 'Update',
},{
xtype: 'button',
text: 'Update',
width: '100%',
handler: updateLocationOrientation
}]

68
lib/controller/removeNode.php

@ -0,0 +1,68 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$NID = intval($_POST['NID']);
$Data = array();
if( $NID ){
$QS = "SELECT * FROM nodes WHERE id={$NID}";
$result = $DATABASE->Query( $QS, false );
if( count( $result ) ){
$T = $result[0];
$AID = intval( $T['aux_id'] );
$TYP = intval( $T['type'] );
$QS = "DELETE FROM `sockets` WHERE `node_id`={$NID}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `connections` WHERE `from`={$NID} OR `to`={$NID}";
$DATABASE->Query( $QS );
switch( $TYP ){
case 1:
case 2:
case 3:
case 4:
case 5:{
// Sensor
$QS = "DELETE FROM `lrf_sensors` WHERE `id`={$AID}";
$DATABASE->Query( $QS );
break;
};
case 13:{
// Camera
$QS = "SELECT * FROM `media_streams` WHERE `source_id`={$AID}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
foreach( $RR as $R ){
$QS = "DELETE FROM `media_server_streams` WHERE `media_stream_id`={$R['id']}";
$DATABASE->Query( $QS );
};
$QS = "DELETE FROM `media_streams` WHERE `source_id`={$AID}";
$DATABASE->Query( $QS );
};
$QS = "UPDATE `cameras` SET `status`=0 WHERE `id`={$AID}";
$DATABASE->Query( $QS );
break;
};
case 20:{
// EthernetUART
$QS = "DELETE FROM `uart_settings` WHERE `id`={$AID}";
$DATABASE->Query( $QS );
$QS = "UPDATE `cameras` SET `uart_id`=0 WHERE `uart_id`={$AID}";
$DATABASE->Query( $QS );
$QS = "UPDATE `lrf_sensors` SET `uart_id`=0 WHERE `uart_id`={$AID}";
$DATABASE->Query( $QS );
break;
};
};
$QS = "DELETE FROM `nodes` WHERE `id`={$NID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
} else {
$Data['error'] = 'Unknown Node ID Provided!';
};
} else {
$Data['error'] = 'Unknown Node ID Provided!';
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>

2
lib/controller/updateLocation.php

@ -16,7 +16,7 @@
};
};
if( $TYP == 1 ){
$QS="UPDATE sites SET lat={$LAT}, lon={$LON}, alt={$ALT} WHERE id ={$SITE}";
$QS="UPDATE sites SET anchor_lat={$LAT}, anchor_lon={$LON}, anchor_alt={$ALT} WHERE id ={$SITE}";
} else {
$QS = "SELECT * FROM nodes WHERE id ={$NID}";
$Result = $DATABASE->Query( $QS, false );

24
lib/controller/updateLrfSettings.php

@ -0,0 +1,24 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['SENSOR'] ) ){
$S_ID = intval($_POST['SENSOR']);
if( $S_ID ){
$NAME = $DATABASE->escape($_POST['SNAME']);
if(isset($_POST['SADDR'])){
$ADDR = intval($_POST['SADDR']);
$RANGE = floatval($_POST['SRANGE']);
$QS="UPDATE `lrf_sensors` SET `device_id`={$ADDR}, `max_range`={$RANGE}, `label`='{$NAME}' WHERE id={$S_ID}";
$DATABASE->Query( $QS );
} else {
$IP= $DATABASE->escape($_POST['SIPADDR']);
$NAME = $DATABASE->escape($_POST['SNAME']);
$QS="UPDATE `lrf_sensors` SET `ip_address`='{$IP}', `label`='{$NAME}' WHERE id={$S_ID}";
$DATABASE->Query( $QS );
};
$QS="UPDATE `nodes` SET `name`='{$NAME}' WHERE `aux_id`={$S_ID}";
$DATABASE->Query( $QS );
};
};
};
?>

26
lib/controller/updateUartSettings.php

@ -0,0 +1,26 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['UART'] ) ){
$UART_ID = intval($_POST['UART']);
if( $UART_ID ){
$UART_SPEED = intval($_POST['USPD']);
$UART_BIT = intval($_POST['UBIT']);
$UART_STOP = floatval($_POST['USTP']);
switch( strtoupper( substr( $_POST['UPAR'], 1 ) ) ){
case 'E': $UART_PARITY = 'E'; break;
case 'O': $UART_PARITY = 'O'; break;
default:
$UART_PARITY = 'N';
};
$UART_IP = $DATABASE->escape( $_POST['UADR'] );
$UART_PORT = intval( $_POST['UPOR'] );
$UART_MODE = intval( $_POST['UMOD'] );
if( $UART_PORT > 0 ){
$QS="UPDATE `uart_settings` SET `speed`={$UART_SPEED}, `bit`={$UART_BIT}, `parity`='{$UART_PARITY}', `stop_bit`={$UART_STOP}, `port`={$UART_PORT}, `path`='{$UART_IP}', `mode`={$UART_MODE} WHERE id ={$UART_ID}";
$DATABASE->Query( $QS );
};
};
};
};
?>

17
lib/controller/updateUserSettings.php

@ -0,0 +1,17 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['SSS'] ) ){
$SETTING_ID = intval($_POST['SSS']);
switch( $SETTING_ID ){
case 15:{
$WIDTH = intval($_POST['WID']);
$HEIGHT = intval($_POST['HEI']);
$QS="UPDATE `users` SET `width`={$WIDTH}, `height`={$HEIGHT} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
};
};
};
?>

142
lib/javascript/jsapi_dynamic/rgoose_camera_editor.js

@ -481,24 +481,142 @@ function addEthernet2Uart(){
addE2UDialog = new Ext.Window({
modal: true,
title: 'Add Ethernet To Serial Adapter',
width: 800,
height: 600,
width: 400,
height: 300,
layout: 'fit',
closeAction: 'hide',
items:{
html: '<p>koko</p>',
bbar: [{
items:[{
xtype: 'form',
labelWidth: 120, // label settings here cascade unless overridden
frame: false,
bodyStyle:'padding:5px 5px 0',
defaultType: 'textfield',
items:[{
xtype: 'combo',
fieldLabel: 'Speed',
id: 'ued_speed',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['speed'],
data: [[19200], [115200]]
}),
valueField: 'speed',
displayField: 'speed'
},{
xtype: 'combo',
fieldLabel: 'Bits',
id: 'ued_bit',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['bits'],
data: [[5],[6],[7],[8],[9]]
}),
valueField: 'bits',
displayField: 'bits'
},{
xtype: 'combo',
fieldLabel: 'Stop Bit',
lazyRender:true,
id: 'ued_stops',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['stops'],
data: [[1],[1.5],[2]]
}),
valueField: 'stops',
displayField: 'stops'
},{
xtype: 'combo',
fieldLabel: 'Parity',
lazyRender:true,
id: 'ued_parity',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['parity'],
data: [['Odd'], ['Even'],['None']]
}),
valueField: 'parity',
displayField: 'parity'
},{
xtype: 'combo',
fieldLabel: 'Working Mode',
lazyRender: true,
id: 'ued_mode',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [[0,'UDP Client'], [1,'TCP Client'], [2,'UDP Server'], [3,'TCP Server']]
}),
valueField: 'mode',
displayField: 'mode_txt'
},{
fieldLabel: 'IP Address',
id: 'ued_ip'
},{
fieldLabel: 'IP Port',
id: 'ued_port'
}],
bbar: [{
text: 'Cancel',
handler: function(){//discoverOnvifSources
addDialog.hide();
addE2UDialog.hide();
}
},'->',{
},'->',{
id: 'con_to_src',
text: 'Connect To Selected',
disabled: ( SelectedCam == 0 ),
handler: connectToSeleced
}]
}
text: 'Add Adapter to Site',
disabled: false,
handler: function(){
var SPD = Ext.getCmp('ued_speed').getValue();
var BIT = Ext.getCmp('ued_bit').getValue();
var STP = Ext.getCmp('ued_stops').getValue();
var PAR = Ext.getCmp('ued_parity').getValue();
var MOD = Ext.getCmp('ued_mode').getValue();
var IP = Ext.getCmp('ued_ip').getValue();
var PORT= Ext.getCmp('ued_port').getValue();
Ext.Ajax.request({
url: '/lib/controller/addNetworkNode.php',
params: {
NID: <?=$SiteID;?>,
TYPE: 20,
UART_SPEED: SPD,
UART_BITS: BIT,
UART_STOP: STP,
UART_PAR: PAR,
UART_MODE: MOD,
UART_IP: IP,
UART_PORT: PORT,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.sucess == false ){
Ext.Msg.show({
title:'Request Failure!',
msg: data.error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else {
loadSystemEditor();
};
addE2UDialog.hide();
},
failure: function( response, opts ) {
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
addE2UDialog.hide();
}
});
}
}]
}]
});
};
addE2UDialog.show();

55
lib/javascript/jsapi_dynamic/rgoose_location_editor.js

@ -429,6 +429,7 @@ Cube.prototype.sideChange = function() {
}
Cube.prototype.set = function( A, B, C ) {
//C = C + 90.0;
this.viewport.setDirect( A, B, C );
}
@ -685,6 +686,7 @@ var bk_upd = false;
function setCubeOrientation( A, B, C ){
if( bk_upd ) return;
bk_upd = true;
curX = A;
curY = B;
@ -701,7 +703,7 @@ function setCubeOrientation( A, B, C ){
t.setValue( C );
t = Ext.getCmp('yaw');
t.setValue( C );
if( cube!= null ) cube.set( curX, curY, curZ );
if( cube != null ) cube.set( curX, curY, curZ );
bk_upd = false;
};
@ -730,13 +732,7 @@ function orientationEditor(){
value: 30.0029,
listeners:{
change: function( sl, nv, tt ){
if( bk_upd ) return;
bk_upd = true;
var t = Ext.getCmp('roll_sld');
t.setValue( nv );
curX = nv;
if( cube!= null ) cube.set( curX, curY, curZ );
bk_upd = false;
setCubeOrientation( nv / 1.0, curY, curZ );
}
}
},{
@ -748,13 +744,7 @@ function orientationEditor(){
maxValue: 180.0,
listeners:{
change: function( sl, nv, tt ){
if( bk_upd ) return;
bk_upd = true;
var t = Ext.getCmp('roll');
t.setValue( nv );
curX = nv;
if( cube!= null ) cube.set( curX, curY, curZ );
bk_upd = false;
setCubeOrientation( nv, curY, curZ );
}
}
},{
@ -766,13 +756,7 @@ function orientationEditor(){
value: 30.0029,
listeners:{
change: function( sl, nv, tt ){
if( bk_upd ) return;
bk_upd = true;
var t = Ext.getCmp('pitch_sld');
t.setValue( nv );
curY = nv;
if( cube!= null ) cube.set( curX, curY, curZ );
bk_upd = false;
setCubeOrientation( curX, nv / 1.0, curZ );
}
}
},{
@ -784,13 +768,7 @@ function orientationEditor(){
maxValue: 180.0,
listeners:{
change: function( sl, nv, tt ){
if( bk_upd ) return;
bk_upd = true;
var t = Ext.getCmp('pitch');
t.setValue( nv );
curY = nv;
if( cube!= null ) cube.set( curX, curY, curZ );
bk_upd = false;
setCubeOrientation( curX, nv, curZ );
}
}
},{
@ -802,13 +780,8 @@ function orientationEditor(){
value: 30.0029,
listeners:{
change: function( sl, nv, tt ){
if( bk_upd ) return;
bk_upd = true;
var t = Ext.getCmp('yaw_sld');
t.setValue( nv );
curZ = nv;
if( cube!= null ) cube.set( curX, curY, curZ );
bk_upd = false;
//alert( nv );
setCubeOrientation( curX, curY, nv / 1.0 );
}
}
},{
@ -820,13 +793,7 @@ function orientationEditor(){
maxValue: 180.0,
listeners:{
change: function( sl, nv, tt ){
if( bk_upd ) return;
bk_upd = true;
var t = Ext.getCmp('yaw');
t.setValue( nv );
curZ = nv;
if( cube!= null ) cube.set( curX, curY, curZ );
bk_upd = false;
setCubeOrientation( curX, curY, nv );
}
}
}]
@ -916,7 +883,7 @@ function loadLocationEditor(){
border: false,
items: [{
layout: 'fit',
height: 700,
height: PanelH-150,
flex: 1,
//border: true,
items:{

62
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -1,6 +1,68 @@
//<?php require_once('../../js_asm.php'); ?>
var winW = <?=0+$CUser->Data['width'];?>;
var winH = <?=0+$CUser->Data['height'];?>;
var PanelH = winH-90;
function Refresh(){
window.location="/?t="+123;
};
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
SAID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
WID: x,
HEI: y
},
success: function( response, opts ){
Refresh();
},
failure: function( response, opts ) {
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
}
});
};
function CheckWindowSize(delay){
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW2 = window.innerWidth;
winH2 = window.innerHeight;
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW2 = document.body.offsetWidth;
winH2 = document.body.offsetHeight;
if ( winH2<700 ) winH2=700;
};
};
//alert(winW2+':'+winW+' '+winH2+':'+winH);
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
};
};
Ext.onReady(function(){
//Check Screen Size
//alert( winW + 'x' + winH );
CheckWindowSize();
var viewport = new Ext.Viewport({
id: 'main_viewport',
layout:'border',

96
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js

@ -414,7 +414,6 @@ function loadServerProperties( NodeID ){
}*/
});
};
function loadSystemEditor(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
@ -437,7 +436,7 @@ function loadSystemEditor(){
//padding:'5',
//align:'middle'
},
height: 700,
height: PanelH-5,
flex: 1,
frame: false,
border: false,
@ -534,8 +533,29 @@ function loadSystemEditor(){
text: 'Add Connection',
enableToggle : undefined,
handler: function(){
Ext.getCmp('connectstarterbutton').toggle( true, true );
startCreateConnection(1);
if( InConnectEditMode ){
Ext.getCmp('connectstarterbutton').toggle( false, false );
InConnectEditMode = false;
stopCreateConnection();
} else {
Ext.getCmp('connectstarterbutton').toggle( true, true );
InConnectEditMode = true;
startCreateConnection();
};
}
},{
xtype: 'button',
id: 'deletecomponentbutton',
text: 'Remove Component',
enableToggle: true,
handler: function(){
if( InComponentRemoveMode ){
Ext.getCmp('deletecomponentbutton').toggle( false, false );
InComponentRemoveMode = false;
} else {
Ext.getCmp('deletecomponentbutton').toggle( true, true );
InComponentRemoveMode = true;
};
}
}]
}]
@ -572,6 +592,7 @@ function loadSystemEditor(){
networkObj = new vis.Network(container, netwodkData, networkOpts );
networkObj.on("click", function (params) {
//if(!connectionAddMode){
if( !InComponentRemoveMode ){
if( params.nodes.length > 0 ){
if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
loadServerProperties( params.nodes[0] );
@ -582,18 +603,80 @@ function loadSystemEditor(){
selectedConnection = netwodkData.edges.get(params.edges[0]);
loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
};
} else {
if( params.nodes.length > 0 ){
if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
Ext.Msg.show({
title:'Remove Server Component!',
msg: 'You can not remove Server component!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else {
Ext.Msg.show({
title:'Remove Component?',
msg: 'You are about to remove.<br/>Are you sure to do so?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function( result ){
if( result=='yes' ){
Ext.Ajax.request({
url: '/lib/controller/removeNode.php',
params: {
SAID: <?=$SiteID;?>,
NID: params.nodes[0],
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.sucess == false ){
Ext.Msg.show({
title:'Request Failure!',
msg: data.error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else {
stopCreateConnection();
InComponentRemoveMode = false;
loadSystemEditor();
};
},
failure: function( response, opts ) {
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
}
});
};
},
//animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
};
};
};
//};
});
/*
networkObj.on("doubleClick", function (params) {
//if(!connectionAddMode){
if( !InComponentRemoveMode ){
if( params.nodes.length > 0 ){
loadNodeProperties( params.nodes[0] );
} else if( params.edges.length > 0 ){
selectedConnection = netwodkData.edges.get(params.edges[0]);
loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
};
} else {
alert( 'Remove' );
};
//};
});
*/
/*
networkObj.on("dragStart", function (params) {
if( connectionAddMode ){
@ -624,9 +707,6 @@ function loadSystemEditor(){
},
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
}*/
}
});
};

184
lib/javascript/jsapi_dynamic/rgoose_timeline.js

@ -18,6 +18,113 @@ var tlLastTS = 0;
var tlInterval = null;
var tlMonitoring = false;
var eventsListStore = new Ext.data.JsonStore({
root: 'log',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'date',
type: 'string'
},{
name: 'time',
type: 'string'
},{
name: 'device',
type: 'string'
},{
name: 'event',
type: 'string'
},{
name: 'data',
type: 'string',
},{
name: 'has_target',
type: 'boolean'
},{
name: 'has_geo',
type: 'boolean'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/controller/getEventRecords.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
NID: 1
}
})
});
var SelectedEvent = 0;
var eventsListSelModel = new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
loadEventProperties( rec.data.id );
//SelectedEvent = rec.data.id;
//alert( SelectedEvent );
//var CB = Ext.getCmp('con_to_src');
//CB.enable();
}
}
});
function ModeRenderer(val){
var p1, p2, p3;
if( ( val & 1 ) == 1 ){
p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
} else {
p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
};
if( ( val & 2 ) == 2 ){
p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
} else {
p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
};
if( ( val & 4 ) == 4 ){
p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
} else {
p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
};
return p1+p2+p3;
};
function LocRenderer( val ){
if( val ){
return '<img src="/style/icons/icons/accept.png" alt="Location">';
};
return '<img src="/style/icons/icons/bullet_white.png" alt="NO Location">';
};
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: "", width: 20, sortable: false, dataIndex: 'has_geo', renderer: LocRenderer }
],
defaults: {
sortable: true,
menuDisabled: true,
width: 100
},
listeners: {
hiddenchange: function(cm, colIndex, hidden) {
//saveConfig(colIndex, hidden);
}
}
});
function loadTimeLineGroups( NID ){
Ext.Ajax.request({
url: '/lib/controller/getTimeLineGroups.php',
@ -72,14 +179,19 @@ function loadTimeLineItems( NID ){
timelineObj.setGroups( tlGroups );
timelineObj.setItems( tlItems );
timelineObj.on('select', function (properties) {
alert( properties.items[0] );
//alert( properties.items[0] );
loadEventProperties( properties.items[0] );
//logEvent('select', properties.items[0]);
});
} else {
timelineObj.redraw();
};
if( tlMonitoring ) timelineObj.moveTo( moment.utc() );
eventsListStore.reload();
tlLoadLocker = false;
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
@ -91,6 +203,34 @@ function loadTimeLineItems( NID ){
});
};
function loadEventProperties( EventID ){
//alert( 'Node: ' + NodeID );
Ext.Ajax.request({
url: '/lib/controller/getEventProps.php',
params: {
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
EVENT: EventID
},
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!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
});
};
function loadTimeLine(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
@ -158,14 +298,49 @@ function loadTimeLine(){
}]
}]
},{
title: 'Log',
frane: false,
height: 400
title: 'Event Log',
frame: false,
height: 400,
xtype: 'grid',
ds: eventsListStore,
cm: eventsListColModel,
sm: eventsListSelModel,
//listeners:{
// beforedestroy: function( t ){
// addDialog = null;
// return true;
// }
//},
viewConfig: {
//forceFit: true
},
bbar: [{
text: 'Clear',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/clearEventCloud.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
},
failure: function( response, opts ) {
}
});
}
}/*,'->',{
id: 'con_to_src',
text: 'Connect To Selected',
disabled: ( SelectedCam == 0 ),
handler: connectToSeleced
}*/]
}]
});
tPanel.add({
columnWidth: 0.17,
frame: false,
id: 'prop_content',
border: false,
items: [{
title: 'Event Information',
@ -176,6 +351,7 @@ function loadTimeLine(){
});
tPanel.doLayout();
loadTimeLineGroups( selectedSite );
eventsListStore.load({params:{start:0, limit:50}});
};

14
lib/javascript/jsapi_static/rgoose_general.js

@ -219,6 +219,8 @@ var socketListColModel = new Ext.grid.ColumnModel({
}
});
var InConnectEditMode = false;
var InComponentRemoveMode = false;
var networkOpts = {
interaction:{
@ -250,12 +252,16 @@ var networkOpts = {
};
function startCreateConnection(){
if( networkObj!= null ){
//if( networkObj!= null ){
networkObj.addEdgeMode();
};
//};
};
function stopCreateConnection(){
//if( networkObj!= null ){
networkObj.disableEditMode();
//};
};
function loadLinkProperties( EdgeID, From, To ){
alert( 'Edge: ' + EdgeID );
//alert( 'Edge: ' + EdgeID );
};

21
lib/php/ui/UI_functions.php

@ -248,13 +248,26 @@ function UI_PageBottom(){
function UI_LoginForm($target = 'login.php'){
global $Labels;
?>
<table width="100%" border="0" style="background: #202020;">
<tr><td align="center">
<table width="100%"><tr>
<td align="left" width="64px"><img height="64px" src="/style/img/logo-s.png"></td>
<td align="center"><img style="position: relative; left: -50px;" height="64px" src="/style/assets/argus_logo_text.png"></td>
</tr></table>
</td></tr>
<tr><td align="center">
<form method="Post" action="<?=$target;?>" enctype="multipart/form-data">
<table width="100%" >
<tr><td align="right"><?=$Labels->GetLabel('__LOGIN_ID__');?></td><td><input type="text" name="login"></td></tr>
<tr><td align="right"><?=$Labels->GetLabel('__PASSWORD__');?></td><td><input type="password" name="password"></td></tr>
<tr><td align="right"></td><td><input type="submit" value="<?=$Labels->GetLabel('__LOGIN__');?>"></td></tr>
<table width="500px" border="0" style="background-color: white;">
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
<tr><td align="right" width="40%"><b><?=$Labels->GetLabel('__LOGIN_ID__');?>:</b></td><td><input type="text" name="login"></td></tr>
<tr><td align="right"><b><?=$Labels->GetLabel('__PASSWORD__');?>:</b></td><td><input type="password" name="password"></td></tr>
<tr><td colspan=2 align="center"><input type="submit" value="<?=$Labels->GetLabel('__LOGIN__');?>"></td></tr>
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
</table>
</form>
</td>
</tr>
</table>
<?php
};

BIN
style/assets/1f9ed.png

Binary file not shown.

After

Width: 512  |  Height: 512  |  Size: 39 KiB

BIN
style/assets/20_node.png

Binary file not shown.

After

Width: 64  |  Height: 64  |  Size: 11 KiB

BIN
style/assets/argus.psd

Binary file not shown.

BIN
style/assets/argus_logo.png

Binary file not shown.

After

Width: 509  |  Height: 525  |  Size: 27 KiB

BIN
style/assets/argus_logo_text.png

Binary file not shown.

After

Width: 1833  |  Height: 525  |  Size: 55 KiB

BIN
style/assets/chch-1.png

Binary file not shown.

Before

Width: 1920  |  Height: 1040  |  Size: 61 KiB

BIN
style/assets/cube_bg.png

Binary file not shown.

Before

Width: 626  |  Height: 448  |  Size: 56 KiB

After

Width: 626  |  Height: 448  |  Size: 72 KiB

BIN
style/assets/cube_bg.psd

Binary file not shown.
Loading…
Cancel
Save