Browse Source

Just regular commit

master
Evgeny Gagua 1 year ago
parent
commit
a84f25e5cd
  1. 4
      .gitignore
  2. 6
      index.php
  3. 2
      lib/1.json
  4. 3
      lib/assembler.php
  5. 60
      lib/controller/doApplicationOperation.php
  6. 38
      lib/controller/doDatabaseOperation.php
  7. 57
      lib/controller/doModuleOperations.php
  8. 223
      lib/controller/doPlatformOperations.php
  9. 69
      lib/controller/doSessionOperations.php
  10. 17
      lib/controller/getAddModuleWindow.php
  11. 202
      lib/controller/getApplicationSettings.php
  12. 32
      lib/controller/getHelpTopic.php
  13. 2
      lib/controller/getHistorySessionView.php
  14. 126
      lib/controller/getHistorySettings.php
  15. 12
      lib/controller/getLineEditor.php
  16. 2
      lib/controller/getMediaSettings.php
  17. 7
      lib/controller/getModuleEditor.php
  18. 60
      lib/controller/getMonitoringPlatformView.php
  19. 34
      lib/controller/getMonitoringSessionView.php
  20. 31
      lib/controller/getMonitoringStationView.php
  21. 36
      lib/controller/getMonitoringTrackView.php
  22. 340
      lib/controller/getPlatformEditor.php
  23. 869
      lib/controller/getSensorEditor.php
  24. 57
      lib/controller/getServerSettings.php
  25. 28
      lib/controller/getStationEditor.php
  26. 116
      lib/controller/getStatus.php
  27. 324
      lib/controller/importMojoReport.php
  28. 10
      lib/controller/listAccessLog.php
  29. 5
      lib/controller/listServerLog.php
  30. 124
      lib/controller/updateUser.php
  31. 17
      lib/defines.php
  32. 3
      lib/javascript/jsapi_dynamic/argus_logs.js
  33. 228
      lib/javascript/jsapi_dynamic/argus_monitoring.js
  34. 64
      lib/javascript/jsapi_dynamic/argus_reports.js
  35. 1191
      lib/javascript/jsapi_dynamic/argus_settings.js
  36. 346
      lib/javascript/jsapi_dynamic/loaders.html
  37. 993
      lib/javascript/jsapi_dynamic/mastbaum.js
  38. 1973
      lib/javascript/jsapi_dynamic/mojo_dashboard.js
  39. 269
      lib/javascript/jsapi_dynamic/mojo_logs.js
  40. 2561
      lib/javascript/jsapi_dynamic/mojo_map.js
  41. 94
      lib/javascript/jsapi_dynamic/mojo_metro.js
  42. 1593
      lib/javascript/jsapi_dynamic/mojo_reports.js
  43. 1664
      lib/javascript/jsapi_dynamic/rgoose_cameras.js
  44. 1299
      lib/javascript/jsapi_dynamic/rgoose_dashboard.js
  45. 2515
      lib/javascript/jsapi_dynamic/rgoose_devices.js
  46. 2370
      lib/javascript/jsapi_dynamic/rgoose_devices_.js
  47. 1255
      lib/javascript/jsapi_dynamic/rgoose_location_editor.js
  48. 479
      lib/javascript/jsapi_dynamic/rgoose_main.js
  49. 0
      lib/javascript/jsapi_dynamic/rgoose_map.js
  50. 575
      lib/javascript/jsapi_dynamic/rgoose_modules.js
  51. 1237
      lib/javascript/jsapi_dynamic/rgoose_reports.js
  52. 111
      lib/javascript/jsapi_dynamic/rgoose_single_ipi.js
  53. 569
      lib/javascript/jsapi_dynamic/rgoose_swupgrade.js
  54. 1170
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  55. 29
      lib/javascript/jsapi_dynamic/testus.js
  56. 56
      lib/php/argus/server.php
  57. 30
      lib/php/argus/templates.php
  58. 9
      lib/php/db/user_class.php
  59. 2
      lib/version.var
  60. BIN
      style/assets/bul_green_rst.png
  61. 44
      style/style.css

4
.gitignore

@ -1 +1,3 @@
lib/controller/data/*
lib/controller/data/*
lib/javascript/jsapi_dynamic/buba
lib/javascript/jsapi_dynamic/buba/*

6
index.php

@ -8,11 +8,10 @@
array(
'argus_global_vars.js',
'argus_monitoring.js',
'argus_events.js',
'argus_media.js',
'argus_reports.js',
'argus_settings.js',
'argus_users.js',
'argus_logs.js',
'argus_main.js'
)
);
@ -22,11 +21,10 @@
array(
'argus_global_vars.js',
'argus_monitoring.js',
'argus_events.js',
'argus_media.js',
'argus_reports.js',
'argus_settings.js',
'argus_users.js',
'argus_logs.js',
'argus_main.js'
)
);

2
lib/1.json
File diff suppressed because it is too large
View File

3
lib/assembler.php

@ -40,8 +40,7 @@ require_once('php/auth/web.php');
require_once('php/db/language_json_class.php');
require_once('php/ui/UI_functions.php');
$UserLang = 1;
if( $UserID < 2 ) $UserLang = 1;
if( isset($_GET['Lang']) ){
$UCL=intval( $_GET['Lang'] );

60
lib/controller/doApplicationOperation.php

@ -0,0 +1,60 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 && $CUser->Data['access'] > 5 ){
$Data = array();
$Data['success'] = false;
if( isset( $_POST['OPID'] ) ){
$CMD = intval( $_POST['OPID'] );
} else {
$CMD = 0;
};
if( $CMD > 0 ){
switch( $CMD ){
case 1:{
$QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`,`param`) VALUES(250,0,'')";
$DATABASE->Query( $QS );
};
case 41:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `use_db_logging`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 42:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `encoder_limit`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 43:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `modbus_auto_rise`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 44:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `modbus_hazard_level`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
case 45:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `modbus_health_level`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
};
} else {
$Data['msg']='Wrong Parameters!';
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>

38
lib/controller/doDatabaseOperation.php

@ -0,0 +1,38 @@
<?php
require_once('../ajax_asm.php');
function verbose( $ok=1,$info=""){
// failure to upload throws 400 error
if( $ok==0 ){
http_response_code(400);
};
die(json_encode(["ok"=>$ok, "info"=>$info]));
};
if( $CUser->Data['id'] > 1 ){
if( empty( $_FILES ) || $_FILES['db_file']['error'] ){
verbose( 0, "Failed to move uploaded file.[" . $_FILES['db_file']['error'] . "]" );
};
$filePath = $SYSPath . 'lib/controller/data';
if( !file_exists( $filePath ) ){
if( !mkdir($filePath, 0777, true ) ){
verbose( 0, "Failed to create $filePath" );
};
};
if( file_exists( $_FILES['db_file']['tmp_name'] ) ){
$MD5 = md5_file( $_FILES['db_file']['tmp_name'] );
$TArr = explode( '.', $_FILES['db_file']['name'] );
$EXT = 'db';
$FNAME = $MD5 . '.' . $EXT;
copy( $_FILES['db_file']['tmp_name'], $filePath . '/' . $FNAME );
@unlink( $_FILES['db_file']['tmp_name'] );
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$PARAM = $MD5;
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES(1,129,0,'{$PARAM}')";
$RBASE->Query( $QS, false );
verbose( 1, "ALL IS OK" );
};
} else {
verbose( 0, 'Access Denied!' );
};
?>

57
lib/controller/doModuleOperations.php

@ -61,7 +61,7 @@
};
case 5:{ // Edit IDENTITY
$EIP = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_modules` SET `IP4`='{$EIP}' WHERE `id`={$ModuleID}";
$QS = "UPDATE `metro_modules` SET `identity`='{$EIP}' WHERE `id`={$ModuleID}";
$DATABASE->Query( $QS );
exit();
};
@ -164,6 +164,61 @@
} else {
//Check if need to add module
if( $CMD == 300 ){
$NAME = $DATABASE->escape( $_POST['NAM'] );
$IP4 = $DATABASE->escape( $_POST['I4P'] );
$PID = intval( $_POST['PID'] );
$IDENT = $DATABASE->escape( $_POST['IDT'] );
$LOC = $_POST['LOC'];
$PLOC = substr( $LOC, 0,1 );
$TLOC = substr( $LOC, 1,1 );
$QS = "SELECT `layout` FROM `metro_platforms` WHERE `id`={$PID}";
$RR = $DATABASE->Query( $QS );
$DATA = array();
if( count( $RR ) ){
$PLO = $RR[0]['layout'];
$QS = "SELECT `id` FROM `metro_tracks` WHERE `platform_id`={$PID} AND `side`='{$PLOC}'";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$DATA['status']='ok';
$TID = intval( $RR[0]['id'] );
if( $PLO == 'C' ){//Regular Island
if( $PLOC == 'B' ){//Bottom Track
if( $TLOC == 'R' ){//Right
$QS = "INSERT INTO `metro_modules` SET `track_id`={$TID}, `side`='F', `status`='D', `name`='$NAME', `IP4`='$IP4', `identity`='{$IDENT}'";
$DATABASE->Query( $QS );
$MID = $DATABASE->getLastInsertID();
$QS = "UPDATE `metro_tracks` SET `far_module_id`={$MID} WHERE `id`={$TID}";
$DATABASE->Query( $QS );
} else {
$QS = "INSERT INTO `metro_modules` SET `track_id`={$TID}, `side`='N', `status`='D', `name`='$NAME', `IP4`='$IP4', `identity`='{$IDENT}'";
$DATABASE->Query( $QS );
$MID = $DATABASE->getLastInsertID();
$QS = "UPDATE `metro_tracks` SET `near_module_id`={$MID} WHERE `id`={$TID}";
$DATABASE->Query( $QS );
};
} else {
if( $TLOC == 'L' ){//Left
$QS = "INSERT INTO `metro_modules` SET `track_id`={$TID}, `side`='F', `status`='D', `name`='$NAME', `IP4`='$IP4', `identity`='{$IDENT}'";
$DATABASE->Query( $QS );
$MID = $DATABASE->getLastInsertID();
$QS = "UPDATE `metro_tracks` SET `far_module_id`={$MID} WHERE `id`={$TID}";
$DATABASE->Query( $QS );
} else {
$QS = "INSERT INTO `metro_modules` SET `track_id`={$TID}, `side`='N', `status`='D', `name`='$NAME', `IP4`='$IP4', `identity`='{$IDENT}'";
$DATABASE->Query( $QS );
$MID = $DATABASE->getLastInsertID();
$QS = "UPDATE `metro_tracks` SET `near_module_id`={$MID} WHERE `id`={$TID}";
$DATABASE->Query( $QS );
};
};
};
} else {
$DATA['msg']='Wrong Track ID Provided!';
};
} else {
$DATA['msg']='Wrong Platform ID Provided!';
};
echo json_encode( $DATA );
exit();
};
};

223
lib/controller/doPlatformOperations.php

@ -16,16 +16,34 @@
if( $CMD > 0 ){
switch( $CMD ){
case 1:{//Add Platform
if( strlen( $_POST['OPCODE'] ) ){
if( strlen( $_POST['OPCODE'] ) && $OID ){
$GOGA = json_decode( $_POST['OPCODE'], true );
$NAME = $DATABASE->escape( $GOGA['NAME'] );
$SHORT = $DATABASE->escape( $GOGA['SHORT'] );
$COLOR = str_ireplace( '#', '', $DATABASE->escape( $GOGA['COLOR'] ) );
$TYPE = intval($GOGA['TYPE']);
$QS = "INSERT INTO `metro_lines`(`color`,`status`,`name`,`short`,`type`) VALUES('{$COLOR}','D','{$NAME}','{$SHORT}',{$type})";
$NAME = $DATABASE->escape( $GOGA['name'] );
$SHORT = $DATABASE->escape( $GOGA['level'] );
$LAY = $DATABASE->escape( $GOGA['layout'] ) ;
$UP_TRN = $DATABASE->escape( $GOGA['up_trn'] );
$BT_TRN = $DATABASE->escape( $GOGA['bt_trn'] );
$UP_TRA = $DATABASE->escape( $GOGA['up_tra'] );
$BT_TRA = $DATABASE->escape( $GOGA['bt_tra'] );
$IDX = 11;
$QS = "INSERT INTO `metro_platforms`(`station_id`,`layout`,`name`,`level`,`index`) VALUES({$OID},'{$LAY}','{$NAME}','{$SHORT}',{$IDX})";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
$PID = $DATABASE->getLastInsertID();
if( $PID ){
if( $LAY == 'A' || $LAY == 'B' ){
$QS = "INSERT INTO `metro_tracks`(`platform_id`,`name`,`short`) VALUES({$PID},{$UP_TRN},{$UP_TRA})";
$DATABASE->Query( $QS );
} else {
$QS = "INSERT INTO `metro_tracks`(`platform_id`,`side`,`name`,`short`) VALUES({$PID},'U','{$UP_TRN}','{$UP_TRA}')";
$DATABASE->Query( $QS );
$QS = "INSERT INTO `metro_tracks`(`platform_id`,`side`,`name`,`short`) VALUES({$PID},'B','{$BT_TRN}','{$BT_TRA}')";
$DATABASE->Query( $QS );
};
$QS="INSERT INTO `modbus_modules` SET `platform_id`={$PID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
};
} else {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
@ -33,34 +51,26 @@
};
break;
};
case 2:{//Delete Platform
case 2:{//Enable/Disable Platform
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$PARAM = intval( $_POST['OPCODE'] );
if( $PARAM ){
$QS = "SELECT `id` FROM `metro_lines` WHERE `id`={$PARAM}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$QS = "DELETE FROM `metro_stations_2_lines` WHERE `line_id`={$PARAM}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `metro_platforms_2_lines` WHERE `line_id`={$PARAM}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `metro_lines` WHERE `id`={$PARAM}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
if( isset( $_POST['OPCODE'] ) ){
$LID = intval( $_POST['OPCODE'] );
if( $LID ){
$QS="UPDATE `metro_platforms` SET `status`='E' WHERE `id`={$OID}";
} else {
// No Such Line
$QS="UPDATE `metro_platforms` SET `status`='D' WHERE `id`={$OID}";
};
} else {
// No Line ID
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
};
break;
};
case 3:{//Bind Station to a Line
case 3:{//Bind Platform to a Line
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
@ -69,12 +79,7 @@
if( isset( $_POST['OPCODE'] ) ){
$LID = intval( $_POST['OPCODE'] );
if( $LID ){
$QS="SELECT count(`station_id`) `cnt` FROM `metro_stations_2_lines` WHERE `line_id`={$LID}";
$Result = $DATABASE->Query( $QS );
if( count( $Result ) ) {
$IDX = intval( $Result[0]['cnt'] )+1;
} else $IDX = 1;
$QS = "INSERT INTO `metro_stations_2_lines`(`station_id`,`line_id`,`index`) VALUES({$OID},{$LID},{$IDX})";
$QS = "INSERT INTO `metro_platforms_2_lines`(`platform_id`,`line_id`) VALUES({$OID},{$LID}) ON DUPLICATE KEY UPDATE `line_id`=`line_id`";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
@ -90,7 +95,7 @@
};
break;
};
case 4:{//Unbind Station from Line
case 4:{//Unbind Platform from Line
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
@ -99,16 +104,8 @@
if( isset( $_POST['OPCODE'] ) ){
$LID = intval( $_POST['OPCODE'] );
if( $LID ){
$QS="DELETE FROM `metro_stations_2_lines` WHERE `line_id`={$LID} AND `station_id`={$OID}";
$QS="DELETE FROM `metro_platforms_2_lines` WHERE `line_id`={$LID} AND `platform_id`={$OID}";
$DATABASE->Query( $QS );
$QS = "SELECT `station_id`, `index` FROM `metro_stations_2_lines` WHERE `line_id`={$LID} ORDER BY `index`";
$LL = $DATABASE->Query( $QS );
$IDX = 1;
foreach( $LL as $L ){
$QS="UPDATE `metro_stations_2_lines` SET `index`={$IDX} WHERE `line_id`={$LID} AND `station_id`={$L['station_id']}";
$DATABASE->Query( $QS );
$IDX++;
};
$Data['success'] = true;
$LOG->reg_op( $_POST );
} else {
@ -123,7 +120,7 @@
};
break;
};
case 5:{//Move Station On Line Z.
case 5:{//Move Platform On Station (up/down).
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
@ -179,94 +176,154 @@
break;
};
case 6:{//Update Name
if( $LID == 0 ) {
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
if( strlen( $_POST['OPCODE'] ) ){
$NAME = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_lines` SET `name`='{$NAME}' WHERE `id`={$LID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
} else {
$NAME = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_platforms` SET `name`='{$NAME}' WHERE `id`={$OID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 7:{//Update Short
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$SHORT = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_platforms` SET `level`='{$SHORT}' WHERE `id`={$OID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 7:{//Update Short
if( $LID == 0 ) {
case 8:{//Update Upper Track Name
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
if( strlen( $_POST['OPCODE'] ) ){
$SHORT = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_lines` SET `short`='{$SHORT}' WHERE `id`={$LID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
} else {
$NAME = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_tracks` SET `name`='{$NAME}' WHERE `platform_id`={$OID} AND `side`='U'";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 9:{//Update Upper Track Short
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$SHORT = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_tracks` SET `short`='{$SHORT}' WHERE `platform_id`={$OID} AND `side`='U'";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 8:{//Update Color
if( $LID == 0 ) {
case 10:{//Update Bottom Track Name
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
if( strlen( $_POST['OPCODE'] ) ){
$COLOR = str_ireplace( '#', '', $DATABASE->escape( $_POST['OPCODE'] ) );
$QS = "UPDATE `metro_lines` SET `color`='{$COLOR}' WHERE `id`={$LID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
} else {
$NAME = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_tracks` SET `name`='{$NAME}' WHERE `platform_id`={$OID} AND `side`='B'";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 11:{//Update Bottom Track Short
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$SHORT = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_tracks` SET `short`='{$SHORT}' WHERE `platform_id`={$OID} AND `side`='B'";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 9:{//Update type
if( $LID == 0 ) {
case 12:{//Enable/Disable Scada
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$PARAM = intval( $_POST['OPCODE'] );
if( $PARAM ){
$QS = "UPDATE `metro_lines` SET `type`={$PARAM} WHERE `id`={$LID}";
$DATABASE->Query( $QS );
} else {
if( isset( $_POST['OPCODE'] ) ){
$LID = intval( $_POST['OPCODE'] );
if( $LID ){
// To enable Must be Set IP
$QS="SELECT * FROM `modbus_modules` WHERE `platform_id`={$OID}";
$JJ = $DATABASE->Query( $QS );
if( count( $JJ ) ){
if( strlen($JJ[0]['ip4']) > 6 ){
$QS="UPDATE `modbus_modules` SET `wm`='E' WHERE `platform_id`={$OID}";
$DATABASE->Query( $QS );
};
};
} else {
$QS="UPDATE `modbus_modules` SET `wm`='D' WHERE `platform_id`={$OID}";
$DATABASE->Query( $QS );
};
$Data['success'] = true;
$LOG->reg_op( $_POST );
};
break;
};
case 13:{//Update IP Scada
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$IP = $DATABASE->escape( $_POST['OPCODE'] );
if( strlen( $IP ) > 6 ){
$QS = "UPDATE `modbus_modules` SET `ip4`='{$IP}' WHERE `platform_id`={$OID}";
} else {
// Erased IP ---> Disabled Module
$QS = "UPDATE `modbus_modules` SET `ip4`='{$IP}', `wm`='D' WHERE `platform_id`={$OID}";
};
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 10:{//Update ena/dis
if( $LID == 0 ) {
case 14:{//Update Port Scada
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
if( isset( $_POST['OPCODE'] ) ){
$PARAM = intval( $_POST['OPCODE'] );
$QS = ($PARAM)?"UPDATE `metro_lines` SET `status`='E' WHERE `id`={$LID}":"UPDATE `metro_lines` SET `status`='D' WHERE `id`={$LID}";
};
$PORT = intval( $_POST['OPCODE'] );
if( $PORT ){
$QS = "UPDATE `modbus_modules` SET `port`={$PORT} WHERE `platform_id`={$OID}";
$DATABASE->Query( $QS );
} else {
};
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 15:{//Test Scada
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$VALUE = intval( $_POST['OPCODE'] );
$QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`,`param`) VALUES(248,{$OID},'{$VALUE}')";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
};

69
lib/controller/doSessionOperations.php

@ -19,7 +19,8 @@
if( $CMD > 0 && $OID > 0 ){
switch( $CMD ){
case 1:{
if( $ACCESS > 2 ){
if( $ACCESS > 2 ){// Erase Session .... Direct
/*
$QS = "SELECT * FROM `sessions` WHERE `id`={$OID}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
@ -44,40 +45,52 @@
};
} else {
$Data['msg']='Session is already Deleted!';
};
};*/
//Via Kernel
$QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`) VALUES(246,{$OID})";
$DATABASE->Query( $QS );
$Data['status'] = 'ok';
} else {
$Data['msg']='Wrong Access Level!';
};
};
case 2:{ // Set Session Status
$ST = intval( $_POST['OPAR'] );
if( $ST ){
if( $ST == 6 ) $ST = 4;
$QS = "UPDATE `sessions` SET `status`={$ST} WHERE `id`={$OID}";
$DATABASE->Query( $QS );
};
// Get SetStatus UI
$QS = "SELECT `status`, `final` FROM `sessions` WHERE `id`={$OID}";
$SR = $DATABASE->Query( $QS );
$CS = $SR[0];
if( $CS['final']=='Y' ){
$QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS}";
} else {
$QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS} AND `special`=''";
};
$SR = $DATABASE->Query( $QS );
$TDS = '';
$PPP = 100.0 / count($SR);
foreach( $SR as $S ){
$FUNC = ($S['special']!='')?$S['special']:'setSessionStatus';
if( $CS['status'] >= $S['lvl'] ){
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
case 2:{ // Set Session Status ---- Direct
$QS = "SELECT `status`, `track_id`, `final` FROM `sessions` WHERE `id`={$OID}";
$R = $DATABASE->Query( $QS );
if( count( $R ) ){
$CS = $R[0];
$ST = intval( $_POST['OPAR'] );
if( $ST ){
if( $ST == 6 ) $ST = 4;
$QS = "UPDATE `sessions` SET `status`={$ST} WHERE `id`={$OID}";
$DATABASE->Query( $QS );
if( $CS['final'] != 'Y' ){
// Ongoing Session --->> Sinal to Kernel
$QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`,`param`) VALUES(247,{$CS['track_id']},'{$ST}')";
$DATABASE->Query( $QS );
};
$CS['status'] = $ST;
};
if( $CS['final']=='Y' ){
$QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS}";
} else {
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$OID},{$S['lvl']});\" >{$S['label']}</span></td>";
$QS = "SELECT * FROM `session_statuses` WHERE `min_access`<={$ACCESS} AND `special`=''";
};
$SR = $DATABASE->Query( $QS );
$TDS = '';
$PPP = 100.0 / count($SR);
foreach( $SR as $S ){
$FUNC = ($S['special']!='')?$S['special']:'setSessionStatus';
if( $CS['status'] >= $S['lvl'] ){
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item passive_gray\">{$S['label']}</span></td>";
} else {
$TDS .= "<td align=\"center\" width=\"{$PPP}%\"><span class=\"sideInfo_item {$S['class']}\" onclick=\"{$FUNC}({$OID},{$S['lvl']});\" >{$S['label']}</span></td>";
};
};
$Data['content']="{ id: 'sets_ui', frame: true, html: '<table width=\"100%\" border=0><tr>{$TDS}</tr></table>'}";
$Data['status'] = 'ok';
};
$Data['content']="{ id: 'sets_ui', frame: true, html: '<table width=\"100%\" border=0><tr>{$TDS}</tr></table>'}";
$Data['status'] = 'ok';
break;
};
};
} else {

17
lib/controller/getAddModuleWindow.php

@ -121,12 +121,19 @@
},{
text: '{$Labels->GetLabel( '_ADD_' )}',
handler: function(){
var mtyp = Ext.getCmp('mod_type').getValue();
var name = Ext.getCmp('mod_name').getValue();
var addr = Ext.getCmp('mod_ip').getValue();
var iden = Ext.getCmp('mod_id').getValue();
var loca = Ext.getCmp('mod_loc').getValue();
Ext.Ajax.request({
url: '/lib/controller/addModule.php',
url: '/lib/controller/doModuleOperations.php',
params: {
SERVID: 1,
TYPE: mtyp,
OPID: 300,
NAM: name,
I4P: addr,
PID: {$PID},
IDT: iden,
LOC: loca,
UID: {$UserID},
SID: '{$Session}'
},
@ -139,7 +146,7 @@
} else {
Ext.Msg.show({
title: "{$Labels->GetLabel("_INFO_MSG_")}",
msg: data.message,
msg: data.msg,
buttons: Ext.Msg.OK,//YESNOCANCEL,
fn: function(){
//SettingsLidar3D.hide();

202
lib/controller/getApplicationSettings.php

@ -0,0 +1,202 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data['status'] = 'error';
if( $CUser->Data['access'] > 5 ){
$QS = "SELECT * FROM `system_props` WHERE `id`=1";
$Result = $DATABASE->Query( $QS );
$CS = $Result[0];
$SKEL=<<<DATABOUNDARY
{
xtype: 'panel',
border: false,
frame: false,
items:[{
xtype: 'form',
labelAlign: 'right',
labelWidth: 180,
//height: PanelH - 30,
items:[{
xtype:'panel',
border: false,
frame: false,
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="appis_logo_img"></div></td><td valign="middle">Application Settings</td></tr><tr><td colspan=2></td></tr></table><br/>'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
id: 'db_loging',
fieldLabel: '{$Labels->GetLabel('_DB_LOGGING_')}',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [['0',"Disabled"], ['1',"Enabled"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 32 );
},
select: function( t, r, i ){
//alert('buba');
doApplicationOperation( 41, r.data.cid );
}
},
value: '{$CS['use_db_logging']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
id: 'ses_window',
fieldLabel: '{$Labels->GetLabel('_APP_SESS_WND_')}',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [['1',"1 Minute"], ['2',"2 Minutes"], ['3',"3 Minutes"], ['4',"4 Minutes"],['5',"5 Minutes"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 33 );
},
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
}
},
value: 1//'{$CS['menc_container']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
id: 'menc_cnt',
fieldLabel: '{$Labels->GetLabel('_APP_MENC_COUNT_')}',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [['1',"1"], ['2',"2"], ['3',"3"], ['4',"4"],['5',"5"],['6',"6"],['7',"7"],['8',"8"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 34 );
},
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
}
},
value: '{$CS['encoder_limit']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'numberfield',
fieldLabel: 'SCADA Auto Time',
editable: true,
width: 250,
value: '{$CS['modbus_auto_rise']}',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 35 );
},
change: function( t, r, i ){
//alert('buba');
doApplicationOperation( 43, r );
}
}
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
fieldLabel: 'SCADA Manual Activation',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [['0',"Disabled"], ['3',"Alert"], ['4',"Hazard"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 36 );
},
select: function( t, r, i ){
//alert('buba');
doApplicationOperation( 44, r.data.cid, true );
}
},
value: '{$CS['modbus_hazard_level']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
fieldLabel: 'SCADA Health Level',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [['0',"Disabled"],['1',"Camera Failure"],['2',"LRF Failure"],['3',"Sensor Communication"],['4',"Module SW Failure"],['5',"Module Network Failure"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 37 );
},
select: function( t, r, i ){
//alert('buba');
doApplicationOperation( 45, r.data.cid, true );
}
},
value: '{$CS['modbus_health_level']}'
},{
xtype: 'spacer',
height: 10
}]
}]
}
DATABOUNDARY;
$Data['status']= 'ok';
$Data['content']=$SKEL;
} else {
$Data['msg']='Access Denied!';
};
echo json_encode( $Data );
} else {
header('location: /');
};
?>

32
lib/controller/getHelpTopic.php

@ -5,6 +5,38 @@
$Data['status'] = 'error';
$HID = intval( $_POST['HID'] );
switch( $HID ){
case 32:{
$TOPIC = 'Database Logging';
$INFO_BREEF = 'Log all Application messages trought Database';
$HELP_FULL = 'Enabling this option will give ability to read messages prduced by businesslogic engine via web user interface';
break;
};
case 33:{
$TOPIC = 'Session Timeout';
$INFO_BREEF = 'Set the Session ending timeout';
$HELP_FULL = 'This parameter is to set time window in which if arises any alarm from the same track it will continue the ongoing session<br/>On the other side, if there no alarms came from same track during selected value of time after last arised alarm then the session will be closed and placed into history';
break;
};
case 34:{
$TOPIC = 'Media Encoder Count';
$INFO_BREEF = 'Set the Maximal count of Media Encoder instances to work simultaniously on Server';
$HELP_FULL = 'The Media Encoder is used to reencode media that came from the Station Module.<br/> When there is an alarm on the track. The station module transfers recorded vide to the server and server makes re-encoding by Media Encoder instance. The Recorded Media file consist 1 minute of recording and re-encoding of that Media file usually tooks about 30 seconds.';
break;
};
case 35:{
$TOPIC = 'SCADA Alarm Time';
$INFO_BREEF = 'Set the time out to emmit SCADA ALARM signal After Session Start';
$HELP_FULL = 'The parameter is a SECONDS<br/>0 - will disable SCADA Alarm signals<br/><b>Note: The Session Close will mitigate the SCADA Signal</b>';
break;
};
case 312:{
$TOPIC = 'Video Container';

2
lib/controller/getHistorySessionView.php

@ -172,7 +172,7 @@
xtype: 'spacer',
width: 5
},{
html: '<div id="hpl_time_mon"></div>'
html: '<div id="hpl_time_mon">ФИФИФ</div>'
}]
},{
id: 'sets_ui',

126
lib/controller/getHistorySettings.php

@ -0,0 +1,126 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data['status'] = 'error';
if( $CUser->Data['access'] > 5 ){
$QS = "SELECT * FROM `system_props` WHERE `id`=1";
$Result = $DATABASE->Query( $QS );
$CS = $Result[0];
$QS = "SELECT * FROM `session_statuses`";
$Result = $DATABASE->Query( $QS );
$JUJA = array( "['0','Disabled']", "['1','Unset']" ); //776497
foreach( $Result as $R ){
};
$SKEL=<<<DATABOUNDARY
{
xtype: 'panel',
border: false,
frame: false,
items:[{
xtype: 'form',
labelAlign: 'right',
labelWidth: 250,
//height: PanelH - 30,
items:[{
xtype:'panel',
border: false,
frame: false,
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="appis_logo_img"></div></td><td valign="middle">Reports/History Settings</td></tr><tr><td colspan=2></td></tr></table><br/>'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
id: 'hs_days',
fieldLabel: '{$Labels->GetLabel('_HAR_LEVEL_')}',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['cid', 'cnam'],
data: [['0',"Disabled"],['1',"Dissmised"],['2',"Alerts"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'history_op_small', 32 );
},
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
}
},
value: '{$CS['histo_limit']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'numberfield',
id: 'hs_window',
fieldLabel: '{$Labels->GetLabel('_HAR_DAYS_')}',
listeners:{
focus: function( t ){
loadHelpTopic( 'history_op_small', 33 );
},
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
}
},
value: '{$CS['histo_days']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'numberfield',
id: 'hs_perc',
fieldLabel: '{$Labels->GetLabel('_HAR_FREE_PERC_')}',
listeners:{
focus: function( t ){
loadHelpTopic( 'history_op_small', 33 );
},
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
}
},
value: '{$CS['histo_perc']}'
},{
xtype: 'spacer',
height: 10
},{
xtype: 'numberfield',
id: 'hs_megs',
fieldLabel: '{$Labels->GetLabel('_HAR_FREE_MEGS_')}',
listeners:{
focus: function( t ){
loadHelpTopic( 'history_op_small', 33 );
},
select: function( t, r, i ){
//alert('buba');
//doApplicationOperation( 1, i );
}
},
value: '{$CS['histo_megs']}'
},{
xtype: 'spacer',
height: 10
}]
}]
}
DATABOUNDARY;
$Data['status']= 'ok';
$Data['content']=$SKEL;
} else {
$Data['msg']='Access Denied!';
};
echo json_encode( $Data );
} else {
header('location: /');
};
?>

12
lib/controller/getLineEditor.php

@ -17,18 +17,18 @@
text: "{$Labels->GetLabel( '_SMM_DEL_LINE_' )}",
handler: function(){
Ext.Msg.show({
title: "{$Labels->GetLabel('_SETTINGS_CHANGED_')}",
msg: "{$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_')}",
title:'{$Labels->GetLabel('_REMOVE_LINE_')}',
msg: '{$Labels->GetLabel('_REMOVE_LINE_QUES_')}',
buttons: Ext.Msg.YESNO,
icon: Ext.MessageBox.WARNING,
fn: function(btn, text){
fn: function(btn){
if( btn == 'yes' ){
SelectedLine = 0;
doLineOperation( {$CR['id']}, 2, {$CR['id']}, true );
};
}
},
icon: Ext.MessageBox.QUESTION
});
}
}
}],
items:[%%%ITEMS%%%]
}

2
lib/controller/getMediaSettings.php

@ -21,7 +21,7 @@
xtype:'panel',
border: false,
frame: false,
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="libav_logo_img"></div></td><td valign="middle">Encoder Settings</td></tr><tr><td colspan=2>INFO</td></tr></table><br/>'
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="libav_logo_img"></div></td><td valign="middle">Encoder Settings</td></tr><tr><td colspan=2></td></tr></table><br/>'
},{
xtype: 'spacer',
height: 10

7
lib/controller/getModuleEditor.php

@ -17,16 +17,15 @@
text: '{$Labels->GetLabel('_SMM_DEL_MODULE_')}',
handler: function(){
Ext.Msg.show({
title:'{$Labels->GetLabel('_REMOVE_MODULE_')}?',
msg: '{$Labels->GetLabel('_REMOVE_MODU_QUES_')}?',
buttons: Ext.Msg.YESNOCANCEL,
title:'{$Labels->GetLabel('_REMOVE_MODULE_')}',
msg: '{$Labels->GetLabel('_REMOVE_MODU_QUES_')}',
buttons: Ext.Msg.YESNO,
fn: function(btn){
if( btn == 'yes' ){
SelectedModule = 0;
doModuleOperation( {$CR['id']}, 200, '', true );
};
},
animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
}

60
lib/controller/getMonitoringPlatformView.php

@ -96,11 +96,14 @@
$ITEM = str_ireplace( '%%%PLATFORM%ID%%%', $CID , $ITEM );
$QS = "SELECT * FROM `metro_tracks` WHERE `platform_id`={$CID}";
$TRES = $DATABASE->Query( $QS );
$POLKAN = array( "UF"=>false,"UN"=>false,"BF"=>false,"BN"=>false);
$SCA_UT_TTL = 'Upper Track';
$SCA_BT_TTL = 'Upper Track';
if( count( $TRES ) ){
$vcount = 1;
foreach( $TRES as $CTRK ){
if( $CTRK['side'] == 'U' ){
$QS = "SELECT * FROM `metro_modules` WHERE `track_id`={$CTRK['id']} ORDER BY `side`";
$SCA_UT_TTL = $CTRK['short'];
$QS = "SELECT * FROM `metro_modules` WHERE `status`='E' AND `track_id`={$CTRK['id']} ORDER BY `side`";
$MRES = $DATABASE->Query( $QS );
foreach( $MRES as $MM ){
$TTL = "{$CTRK['short']}:{$MM['name']}";
@ -108,16 +111,13 @@
$MDT['id'] = $MM['id'];
$MDT['name'] = $TTL;
$MDT['status'] = 0;
$POLKAN[$CTRK['side'].$MM['side']] = true;
if( $MM['side']=='F'){
$MDD[0] = $MDT;
} else {
$MDD[1] = $MDT;
};
//if( $MM['cam_stream'] != 0 ){
// $URL = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
//} else {
$URL = '/style/assets/no-signal_h.png';
//};
$URL = '/style/assets/no-signal_h.png';
$CVTPL = str_ireplace( '%%%PLATFORM%ID%%%', $CID, $SIMPLE_VIDEO_CTX );
$CVTPL = str_ireplace( '%%MID%%', $MM['id'], $CVTPL );
$CVTPL = str_ireplace( '%%TRACK%ID%%',$CTRK['id'], $CVTPL );
@ -125,12 +125,12 @@
$CVTPL = str_ireplace( '%%%STATUS%CLASS%%', 'aaBB', $CVTPL );
$CVTPL = str_ireplace( '%%%IMG%URL%%%', $URL, $CVTPL );
$CVTPL = str_ireplace( '%%%STATUS%%%', 'Status', $CVTPL );
$ITEM = str_ireplace( '%%%VIDEO'.$vcount.'%%%', $CVTPL, $ITEM );
$ITEM = str_ireplace( '%%%VIDEO'.$CTRK['side'].$MM['side'].'%%%', $CVTPL, $ITEM );
$MODU_IDS[] = $MM['id'];
$vcount++;
};
} else {
$QS = "SELECT * FROM `metro_modules` WHERE `track_id`={$CTRK['id']} ORDER BY `side` DESC ";
$SCA_BT_TTL = $CTRK['short'];
$QS = "SELECT * FROM `metro_modules` WHERE `status`='E' AND `track_id`={$CTRK['id']} ORDER BY `side` DESC ";
$MRES = $DATABASE->Query( $QS );
foreach( $MRES as $MM ){
$TTL = "{$CTRK['short']}:{$MM['name']}";
@ -138,17 +138,13 @@
$MDT['id'] = $MM['id'];
$MDT['name'] = $TTL;
$MDT['status'] = 0;
$POLKAN[$CTRK['side'].$MM['side']] = true;
if( $MM['side']=='F'){
$MDD[3] = $MDT;
} else {
$MDD[2] = $MDT;
} else {
$MDD[3] = $MDT;
};
//if( $MM['cam_stream'] != 0 ){
//$URL = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
// $URL = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
//} else {
$URL = '/style/assets/no-signal_h.png';
//};
$URL = '/style/assets/no-signal_h.png';
$CVTPL = str_ireplace( '%%%PLATFORM%ID%%%', $CID, $SIMPLE_VIDEO_CTX );
$CVTPL = str_ireplace( '%%MID%%', $MM['id'], $CVTPL );
$CVTPL = str_ireplace( '%%TRACK%ID%%', $CTRK['id'], $CVTPL );
@ -156,29 +152,21 @@
$CVTPL = str_ireplace( '%%%STATUS%CLASS%%', 'aaBB', $CVTPL );
$CVTPL = str_ireplace( '%%%IMG%URL%%%', $URL, $CVTPL );
$CVTPL = str_ireplace( '%%%STATUS%%%', 'Status', $CVTPL );
$ITEM = str_ireplace( '%%%VIDEO'.$vcount.'%%%', $CVTPL, $ITEM );
$ITEM = str_ireplace( '%%%VIDEO'.$CTRK['side'].$MM['side'].'%%%', $CVTPL, $ITEM );
$MODU_IDS[] = $MM['id'];
$vcount++;
};
};
};
if( $vcount < 5 ){
for( ;$vcount < 5; $vcount++ ){
$CVTPL = str_ireplace( '%%%PLATFORM%ID%%%', $CID, $EMPTY_VIDEO_CTX );
$CVTPL = str_ireplace( '%%MID%%', 'A'.$vcount, $CVTPL );
$ITEM = str_ireplace( '%%%VIDEO'.$vcount.'%%%', $CVTPL, $ITEM );
$MODU_IDS[] = $vcount;
};
};
} else {
for( $i = 1; $i < 5; $i++ ){
$CVTPL = str_ireplace( '%%%PLATFORM%ID%%%', $CID, $EMPTY_VIDEO_CTX );
$CVTPL = str_ireplace( '%%MID%%', 'A'.$i, $CVTPL );
$ITEM = str_ireplace( '%%%VIDEO'.$i.'%%%', $CVTPL, $ITEM );
$MODU_IDS[] = $i;
};
};
$SCADA = "<td class=\"mon_scada_passive_panel\"><b>SCADA Status</b><hr/><table width=\"100%\"><tr><td>Module Status:</td><td colspan=4><div class=\"mon_scada_status_tag_na\">Not Assigned</div></td></tr><tr><td>&nbsp</td><td class=\"mon_scada_head\">Track1:ALRM</td><td class=\"mon_scada_head\">Track2:ALRM</td><td class=\"mon_scada_head\">Helth</td><td class=\"mon_scada_head\">AUX</td></tr><tr><td>&nbsp;</td><td></td><td></td><td></td><td></td></tr></table></td>";
$vcount = 0;
foreach( $POLKAN as $Key=>$Value ) if( !$Value ){
$CVTPL = str_ireplace( '%%%PLATFORM%ID%%%', $CID, $EMPTY_NO_AC_VIDEO_CTX );
$CVTPL = str_ireplace( '%%MID%%', 'A'.$vcount, $CVTPL );
$ITEM = str_ireplace( '%%%VIDEO'.$Key.'%%%', $CVTPL, $ITEM );
$MODU_IDS[] = 0;
$vcount++;
};
$SCADA = "<td class=\"mon_scada_passive_panel\"><b>".$Labels->GetLabel('_SCADA_STATUS_')."</b><hr/><table width=\"100%\"><tr><td>".$Labels->GetLabel('_MOD_STATUS_').":</td><td colspan=4><div id=\"scada_status\" class=\"mon_scada_status_tag_na\">".$Labels->GetLabel('_NOT_ASSIGNED_')."</div></td></tr><tr><td>&nbsp</td><td id=\"scada_a\" class=\"mon_scada_head\">{$SCA_UT_TTL}</td><td id=\"scada_b\" class=\"mon_scada_head\">{$SCA_BT_TTL}</td><td id=\"scada_c\" class=\"mon_scada_head\">".$Labels->GetLabel('_HEALTH_')."</td><td id=\"scada_d\" class=\"mon_scada_head\">AUX</td></tr><tr><td>&nbsp;</td><td></td><td></td><td></td><td></td></tr></table></td>";
$ITEM_X="<table border=0 width=\"100%\" id=\"plat_table_{$CID}\"><tr>{$TOP}</tr><tr><td width=\"100%\">".createPlatformBackground( $CR['layout'], $CID, array()/*$MDD*/ )."</td></tr><tr>{$BOTTOM}</tr><tr>{$SCADA}</tr></table>";

34
lib/controller/getMonitoringSessionView.php

@ -51,12 +51,17 @@
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$LMID}";
$DD = $DATABASE->Query( $QS, false );
$MD = $DD[0];
$URL = '/style/assets/no-signal_h.png';
$LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX );
$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
$LTitle = $MD['name'];
$LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
$LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
if( $MD['status'] == 'E' ){
$URL = '/style/assets/no-signal_h.png';
$LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX );
$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
$LTitle = $MD['name'];
$LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
$LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
} else {
$LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
$LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
};
} else {
$LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
$LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
@ -65,12 +70,17 @@
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$RMID}";
$DD = $DATABASE->Query( $QS, false );
$MD = $DD[0];
$URL = '/style/assets/no-signal_h.png';
$RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX );
$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
$RTitle = $MD['name'];
$RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
$RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
if( $MD['status'] == 'E' ){
$URL = '/style/assets/no-signal_h.png';
$RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX );
$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
$RTitle = $MD['name'];
$RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
$RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
} else {
$RVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
$RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );
};
} else {
$RVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
$RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );

31
lib/controller/getMonitoringStationView.php

@ -62,8 +62,35 @@
} else {
$LINES=$Labels->GetLabel('_NOBI_LINE_');
};
//$PLAT_PARTS[] = '{ xtype:\'spacer\', height: 10 }';
$PLAT_PARTS[] = createChopLabel( $CR['name'], $CTITLE, $LINES, '','active_green', "loadPlatformView({$PID})" );
$QS ="SELECT * FROM `metro_tracks` WHERE `platform_id`={$PID}";
$GG = $DATABASE->Query( $QS );
$CAMS = array();
foreach( $GG as $CP ){
if( $CP['side'] == 'U' ){
if( $CP['far_module_id'] > 0 ){
$CAMS[0] = '<div id="mod_vp_'.$CP['far_module_id'].'" style="height: 80px; width: 142px; display: block; background-image: url(/style/assets/no-signal_h.png); text-align: left; v-align: top; padding: 10px; background-size: 100% 100%;"><img width="16px" src="/style/assets/ms_ul.png"></div>';
} else {
$CAMS[0] = '<div style="height: 80px; width: 142px; display: block; background-color: gray; text-align: center; v-align: middle; padding: 10px; color: black; font-size: 14px;">No Module</div>';
};
if( $CP['near_module_id'] > 0 ){
$CAMS[1] = '<div id="mod_vp_'.$CP['near_module_id'].'" style="height: 80px; width: 142px; display: block; background-image: url(/style/assets/no-signal_h.png); text-align: right; v-align: top; padding: 10px; background-size: 100% 100%;"><img width="16px" src="/style/assets/ms_ur.png"></div>';
} else {
$CAMS[1] = '<div style="height: 80px; width: 142px; display: block; background-color: gray; text-align: center; v-align: middle; padding: 10px; color: black; font-size: 14px;">No Module</div>';
};
} else {
if( $CP['near_module_id'] > 0 ){
$CAMS[2] = '<div id="mod_vp_'.$CP['near_module_id'].'" style="height: 80px; width: 142px; display: block; background-image: url(/style/assets/no-signal_h.png); text-align: left; v-align: bottom; padding: 10px; background-size: 100% 100%;"><img width="16px" src="/style/assets/ms_bl.png"></div>';
} else {
$CAMS[2] = '<div style="height: 80px; width: 142px; display: block; background-color: gray; text-align: center; v-align: middle; padding: 10px; color: black; font-size: 14px;">No Module</div>';
};
if( $CP['far_module_id'] > 0 ){
$CAMS[3] = '<div id="mod_vp_'.$CP['far_module_id'].'" style="height: 80px; width: 142px; display: block; background-image: url(/style/assets/no-signal_h.png); text-align: right; v-align: bottom; padding: 10px; background-size: 100% 100%;"><img width="16px" src="/style/assets/ms_br.png"></div>';
} else {
$CAMS[3] = '<div style="height: 80px; width: 142px; display: block; background-color: gray; text-align: center; v-align: middle; padding: 10px; color: black; font-size: 14px;">No Module</div>';
};
};
};
$PLAT_PARTS[] = createChopLabel( $CR['name'], $CTITLE, $LINES, '','active_green', "loadPlatformView({$PID})", $CAMS, 'id="plat_table_'.$PID.'"' );
};
//$TIPTOP = str_ireplace('%%%PLATFORM_IDS%%%', implode( ',',$PLAT_IDS ), $TIPTOP );
$TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 2 },",$PLAT_PARTS ), $MAIN_TPL );

36
lib/controller/getMonitoringTrackView.php

@ -59,12 +59,18 @@
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$LMID}";
$DD = $DATABASE->Query( $QS, false );
$MD = $DD[0];
$URL = '/style/assets/no-signal_h.png';
$LVID = str_ireplace( '%%MID%%', $LMID, $EXT_VIDEO_CTX );
$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
$LTitle = $MD['name'];
$LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
$LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
if( $MD['status'] == 'E' ){
$URL = '/style/assets/no-signal_h.png';
$LVID = str_ireplace( '%%MID%%', $LMID, $EXT_VIDEO_CTX );
$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
$LTitle = $MD['name'];
$LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
$LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
} else {
$LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
$LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
$LMID = 0;
}
} else {
$LVID = str_ireplace( '%%MID%%', '0', $EMPTY_VIDEO_CTX );
$LVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $LVID );
@ -73,12 +79,18 @@
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$RMID}";
$DD = $DATABASE->Query( $QS, false );
$MD = $DD[0];
$URL = '/style/assets/no-signal_h.png';
$RVID = str_ireplace( '%%MID%%', $RMID, $EXT_VIDEO_CTX );
$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
$RTitle = $MD['name'];
$RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
$RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
if( $MD['status'] == 'E' ){
$URL = '/style/assets/no-signal_h.png';
$RVID = str_ireplace( '%%MID%%', $RMID, $EXT_VIDEO_CTX );
$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
$RTitle = $MD['name'];
$RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
$RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
} else {
$RVID = str_ireplace( '%%MID%%', '1', $EMPTY_VIDEO_CTX );
$RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );
$RMID = 0;
};
} else {
$RVID = str_ireplace( '%%MID%%', '1', $EMPTY_VIDEO_CTX );
$RVID = str_ireplace( '%%PLATFORM%ID%%', $CPID, $RVID );

340
lib/controller/getPlatformEditor.php

@ -15,7 +15,20 @@
tbar:[{
id: 'btn_del_station',
text: '{$Labels->GetLabel('_SMM_DEL_PLATFORM_')}',
handler: function(){}
handler: function(){
Ext.Msg.show({
title:'{$Labels->GetLabel('_REMOVE_MODULE_')}?',
msg: '{$Labels->GetLabel('_REMOVE_MODU_QUES_')}?',
buttons: Ext.Msg.OKCANCEL,
fn: function(btn){
if( btn == 'ok' ){
SelectedModule = 0;
doModuleOperation( {$CR['id']}, 200, '', true );
};
},
icon: Ext.MessageBox.QUESTION
});
}
}],
items:[%%%ITEMS%%%]
}
@ -34,12 +47,12 @@ JOJOKA;
$COS = count( $PINFO['PREV'] );
if( $COS ) $COS = "rowspan={$COS} "; else $COS="";
$TRU = "<td width=\"120px\" {$COS} class=\"_infoPanel\" style=\"color:#fff; font-weight: bold; background-color:#000; text-align: center;\">{$TI[0]['short']}</td>";
$TRACKS = "{ xtype: 'form', border: false, frame: false, labelAlign:'right', items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',html: '".$Labels->GetLabel('_UPPR_TRACK_')."'},{ xtype: 'textfield', fieldLabel:'Name', value: '{$TI[0]['name']}'},{ xtype: 'textfield', fieldLabel:'Abbreviation', labelAlign:'right', value: '{$TI[0]['short']}'}]}";
$TRACKS = "{ xtype: 'form', border: false, frame: false, labelWidth: 150,labelAlign: 'right',margins: {top:10, right:10, bottom:10, left:10},padding:8,labelAlign:'right', items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',html: '".$Labels->GetLabel('_UPPR_TRACK_')."'},{ xtype: 'textfield', fieldLabel:'Name', value: '{$TI[0]['name']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 8, c, true );}}},{ xtype: 'textfield', fieldLabel:'Abbreviation', value: '{$TI[0]['short']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 9, c, true );}}}]}";
if( count( $TI ) > 1 ){
$COS = count( $PINFO['NEXT'] );
if( $COS ) $COS = "rowspan={$COS} "; else $COS="";
$TRB = "<td width=\"120px\" {$COS} class=\"_infoPanel\" style=\"color:#fff; font-weight: bold; background-color:#000; text-align: center;\">{$TI[1]['short']}</td>";
$TRACKS .= ",{ xtype: 'form', border: false, frame: false, labelAlign:'right', items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',html: '".$Labels->GetLabel('_BTOM_TRACK_')."'},{ xtype: 'textfield', fieldLabel:'Name', value: '{$TI[1]['name']}'},{ xtype: 'textfield', fieldLabel:'Abbreviation', labelAlign:'right', value: '{$TI[1]['short']}'}]}";
$TRACKS .= ",{ xtype: 'form', border: false, frame: false, labelWidth: 150,labelAlign: 'right',margins: {top:10, right:10, bottom:10, left:10},padding:8, labelAlign:'right', items:[{ xtype: 'panel', bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',html: '".$Labels->GetLabel('_BTOM_TRACK_')."'},{ xtype: 'textfield', fieldLabel:'Name', value: '{$TI[1]['name']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 10, c, true );}}},{ xtype: 'textfield', fieldLabel:'Abbreviation', value: '{$TI[1]['short']}',listeners:{change: function( a, c, b ){doPlatformOperation( {$CR['id']}, 11, c, true );}}}]}";
};
} else {
$COS = count( $PINFO['PREV'] );
@ -75,7 +88,7 @@ JOJOKA;
};
};
//
$ROUTING .=",{xtype:'panel',width:70, height:60,border:false,frame:false,style:{float:'right'},html: '<div style=\"border-radius:16px;width:32px;height:32px;background-color:#{$Z['color']};color:#fff;font-size:16px;padding-left:10px;padding-top:6px;\">{$Z['short']}</div>'},{ xtype: 'button',enableToggle:true,pressed:{$AS},text:'{$Labels->GetLabel('_ACTIVE_')}'}";
$ROUTING .=",{xtype:'panel',width:70, height:60,border:false,frame:false,style:{float:'right'},html: '<div style=\"border-radius:16px;width:32px;height:32px;background-color:#{$Z['color']};color:#fff;font-size:16px;padding-left:10px;padding-top:6px;\">{$Z['short']}</div>'},{ xtype: 'button',enableToggle:true,pressed:{$AS},text:'{$Labels->GetLabel('_ACTIVE_')}',handler:function(b,e){if(b.pressed){ doPlatformOperation({$CR['id']},3,{$Z['line_id']},true);}else{doPlatformOperation({$CR['id']},4,{$Z['line_id']},true);};}}";
};
$ROUTING .= "]}";
} else {
@ -107,7 +120,272 @@ JOJOKA;
};
};
$BOTTOM .="</table></td></tr></table></td>";
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table border=0 width=\"100%\" class=\"setEd_infoPanel\" id=\"SENSOR_N\"><tr><td valign=\"middle\" width=\"100%\" align=\"left\" colspan=3 style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td></tr><tr><td colspan=3>{$INFO}</td></tr><tr><td></td>{$TOP}<td></td></tr><tr><td>&nbsp;</td><td width=\"100%\">".createPlatformAnimation( $CR['layout'], array(), $LINE_COLORS )."</td><td>&nbsp;</td></tr><tr><td></td>{$BOTTOM}<td></td></tr></table>'}";
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table border=0 width=\"100%\" class=\"setEd_infoPanel\" id=\"SENSOR_N\"><tr><td valign=\"middle\" width=\"100%\" align=\"left\" colspan=3 style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td></tr><tr><td colspan=3>{$INFO}</td></tr><tr><td></td>{$TOP}<td></td></tr><tr><td>&nbsp;</td><td width=\"100%\">".createPlatformAnimation( $CR['layout'], array(), $LINE_COLORS )."</td><td>&nbsp;</td></tr><tr><td></td>{$BOTTOM}<td></td></tr></table>'}";
$QS="SELECT * FROM `modbus_modules` WHERE `platform_id`={$CR['id']}";
$JG=$DATABASE->Query( $QS );
if( count( $JG ) ){
$SC=$JG[0];
$CCCV = intval( $SC['values'] );
if( ( $CCCV & 0x01 ) == 0x01 ) $P1 = 'true'; else $P1 = 'false';
if( ( $CCCV & 0x02 ) == 0x02 ) $P2 = 'true'; else $P2 = 'false';
if( ( $CCCV & 0x04 ) == 0x04 ) $P3 = 'true'; else $P3 = 'false';
if( ( $CCCV & 0x08 ) == 0x08 ) $P4 = 'true'; else $P4 = 'false';
$MODBUS=<<<DATA_BOUNDARY
{
xtype: 'combo',
id: 'sca_ena',
fieldLabel: "{$Labels->GetLabel('_STATUS_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
['D','{$Labels->GetLabel('__DISABLED__')}'],
['E','{$Labels->GetLabel('___ENABLED__')}']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$SC['wm']}',
width: 200,
listeners:{
select: function( a, c, b ){
doPlatformOperation( {$CR['id']}, 12, b, true );
}
}
},{
xtype: 'textfield',
id: 'sca_ip',
fieldLabel: '{$Labels->GetLabel('_DEVICE_IP_')}',
maxlength: 64,
value: '{$SC['ip4']}',
listeners:{
change: function( a, c, b ){
doPlatformOperation( {$CR['id']}, 13, c, true );
}
}
},{
xtype: 'textfield',
id: 'sca_port',
fieldLabel: '{$Labels->GetLabel('_DEVICE_PORT_')}',
maxlength: 2,
value: '{$SC['port']}',
listeners:{
change: function( a, c, b ){
doPlatformOperation( {$CR['id']}, 14, c, true );
}
}
},{
xtype: 'panel',
layout: 'table',
border: false,
frame: false,
labelWidth: 150,
labelAlign: 'right',
width: '100%',
defaults: {
// applied to each contained panel
bodyStyle:'padding:10px; text-align: center;'
},
layoutConfig: {
// The total column count must be specified here
columns: 4
},
items:[{
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
html: 'Upper Track'
},{
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
html: 'Bottom Track'
},{
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
html: 'Health Signal'
},{
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
html: 'AUX Signal'
},{
xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[-1,'{$Labels->GetLabel('__DISABLED__')}'],
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$SC['crossbar_a']}',
width: 200,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$CR['id']}, 12, b, true );
}
}
},{
xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[-1,'{$Labels->GetLabel('__DISABLED__')}'],
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$SC['crossbar_b']}',
width: 200,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$CR['id']}, 12, b, true );
}
}
},{
xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[-1,'{$Labels->GetLabel('__DISABLED__')}'],
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$SC['crossbar_c']}',
width: 200,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$CR['id']}, 12, b, true );
}
}
},{
xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[-1,'{$Labels->GetLabel('__DISABLED__')}'],
[0,'Coil D1'],[1,'Coil D2'],[2,'Coil D3'],[3,'Coil D4']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$SC['crossbar_d']}',
width: 200,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$CR['id']}, 12, b, true );
}
}
},{
xtype: 'spacer',
height: 10,
colspan: 4
},{
xtype: 'panel',
colspan: 4,
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
html: 'TEST MODBUS MODULE COILS'
},{
xtype: 'spacer',
height: 5,
colspan: 4
},{
xtype: 'button',
enableToggle: true,
allowDepress: true,
width: '80%',
text: 'Test D1',
pressed: {$P1},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 1 ), true );
} else {
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~1 ) ), true );
};
}
},{
xtype: 'button',
width: '80%',
enableToggle: true,
allowDepress: true,
text: 'Test D2',
pressed: {$P2},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 2 ), true );
} else {
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~2 ) ), true );
};
}
},{
xtype: 'button',
enableToggle: true,
allowDepress: true,
width: '80%',
text: 'Test D3',
pressed: {$P3},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 4 ), true );
} else {
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~4 ) ), true );
};
}
},{
xtype: 'button',
enableToggle: true,
allowDepress: true,
width: '80%',
text: 'Test D4',
pressed: {$P4},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} | 8 ), true );
} else {
doPlatformOperation( {$CR['id']}, 15, ({$CCCV} & ( ~8 ) ), true );
};
}
}]
}
DATA_BOUNDARY;
} else {
$MODBUS='';
};
$ED =<<<kokakskhkajhskr
{
xtype: 'tabpanel',
@ -126,23 +404,71 @@ JOJOKA;
margins: {top:10, right:10, bottom:10, left:10},
padding:8,
items: [{
xtype: 'combo',
id: 'sens_se',
fieldLabel: "{$Labels->GetLabel('_STATUS_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
['D','{$Labels->GetLabel('__DISABLED__')}'],
['E','{$Labels->GetLabel('___ENABLED__')}']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$CR['status']}',
width: 200,
listeners:{
select: function( a, c, b ){
doPlatformOperation( {$CR['id']}, 2, b, true );
}
}
},{
xtype: 'textfield',
id: 'plt_name',
fieldLabel: '{$Labels->GetLabel('_SMM_PAT_NAME_')}',
maxlength: 64,
value: '{$CR['name']}'
value: '{$CR['name']}',
listeners:{
change: function( a, c, b ){
doPlatformOperation( {$CR['id']}, 6, c, true );
}
}
},{
xtype: 'textfield',
id: 'plt_lvl',
fieldLabel: '{$Labels->GetLabel('_SMM_PAT_LEVEL_')}',
maxlength: 2,
value: '{$CR['level']}'
value: '{$CR['level']}',
listeners:{
change: function( a, c, b ){
doPlatformOperation( {$CR['id']}, 7, c, true );
}
}
},{$ROUTING}]
}]
},{
xtype: 'panel',
title: '{$Labels->GetLabel('_LBL_TRACKS_')}',
items: [{$TRACKS}]
},{
xtype: 'panel',
title: '{$Labels->GetLabel('_LBL_SCADA_')}',
items: [{
xtype: 'form',
height: PanelH - 283,
labelWidth: 150,
labelAlign: 'right',
margins: {top:10, right:10, bottom:10, left:10},
padding:8,
items: [{$MODBUS}]
}]
}],
}
kokakskhkajhskr;

869
lib/controller/getSensorEditor.php

@ -1,869 +0,0 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['CID'] );
$QS = "SELECT `sen`.*, `no`.`enable`, `no`.`name`, `no`.`id` as `node_id` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`) WHERE `sen`.`id`={$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$CR = $Result[0];
$CR['ack_mask_type'] = intval( $CR['ack_mask_type'] );
$CR['ack_mask_size'] = intval( $CR['ack_mask_size'] );
$TTPL=<<<JOJOKA
{
xtype: 'panel',
border: false,
frame: false,
items:[%%%ITEMS%%%]
}
JOJOKA;
$ITEMS = array();
switch( $CR['type'] ){
case 1: $NAME = '<b>'.$CR['name'].'</b><br/>ALS ' . $Labels->getLabel('SENSOR'); break;
case 2: $NAME = '<b>'.$CR['name'].'</b><br/>LFS ' . $Labels->getLabel('SENSOR'); break;
case 3: $NAME = '<b>'.$CR['name'].'</b><br/>PLS200 ' . $Labels->getLabel('SENSOR'); break;
case 4: $NAME = '<b>'.$CR['name'].'</b><br/>PLS360 ' . $Labels->getLabel('SENSOR'); break;
default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor';
};
$NAME .='<br/>communication errors per minute: '.$CR['com_epm'];
$INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_SERIAL_').':</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>';
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['enable']==1)?'A':'N')."\"><tr><td width=\"200px\"><div class=\"node_".$CR['type']."_img_sset\"></div></td><td valign=\"middle\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}";
$QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
$RR=$DATABASE->Query( $QS );
if( count( $RR ) ){
$RE=array();
foreach( $RR as $R ){
$RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
};
$UARTS = implode( ',', $RE );
} else {
$UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
};
$QS = "SELECT * FROM `lrf_ini_settings` WHERE `sensor_id`={$EID}";
$RRR = $DATABASE->Query( $QS );
if( count( $RRR ) ){
$INI_S = $RRR[0];
} else {
$INI_S = array();
$INI_S['AUTORESET_ENABLE'] = 0;
$INI_S['AUTORESET_INTERLEAVE'] = 2000;
$INI_S['AUTORESET_TIMEOUT'] = 60000;
$INI_S['BOARD_TEMPERATURE'] = 1;
$INI_S['BOARD_ZEROSHIFT'] = 0;
$INI_S['BOARD_SPEED'] = 4;
$INI_S['RUN_DIR'] = 2;
$INI_S['NO_BLACK_TARGETS'] = 1;
$INI_S['JUST_MOVING_TARGETS'] = 0;
$INI_S['JUST_MOVING_RADIAL'] = 0;
$INI_S['JUST_MOVING_DISTANCE'] = 0;
if( stripos( $CR['version'], 'FF' )!== false ) {
$INI_S['FREEZ_FIRST_TH'] = 1;
$INI_S['SAVE_FIRST_TH'] = 1;
} else if( stripos( $CR['version'], 'FS' )!== false ){
$INI_S['FREEZ_FIRST_TH'] = 1;
$INI_S['SAVE_FIRST_TH'] = 1;
} else if( stripos( $CR['version'], 'FD' )!== false ){
$INI_S['FREEZ_FIRST_TH'] = 0;
$INI_S['SAVE_FIRST_TH'] = 0;
} else {
$INI_S['FREEZ_FIRST_TH'] = 0;
$INI_S['SAVE_FIRST_TH'] = 0;
};
$QS = "INSERT INTO `lrf_ini_settings`(`sensor_id`,`AUTORESET_ENABLE`,`AUTORESET_INTERLEAVE`,`AUTORESET_TIMEOUT`,`BOARD_TEMPERATURE`,`BOARD_ZEROSHIFT`,`BOARD_SPEED`,`RUN_DIR`,`NO_BLACK_TARGETS`,`JUST_MOVING_TARGETS`,`JUST_MOVING_RADIAL`,`JUST_MOVING_DISTANCE`,`FREEZ_FIRST_TH`,`SAVE_FIRST_TH`) VALUES({$EID},0,0,0,0,0,4,2,0,0,0,0,{$INI_S['FREEZ_FIRST_TH']},{$INI_S['SAVE_FIRST_TH']})";
$DATABASE->Query( $QS );
};
if( ( stripos( $CR['version'], 'FD' )!== false ) || ( stripos( $CR['version'], 'FS' )!== false ) || ( stripos( $CR['version'], 'FF' )!== false ) ){
//Frozen TH
if( stripos( $CR['version'], 'FD' )!== false ){
$THF_OPERATION = ",{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_ENA_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_ble',
scale: 'large',
handler: function(){
doSensorOperation( {$CR['id']}, 21, 0, true );
}
}";
} else {
if( stripos( $CR['version'], 'FS' )!== false ){
$THF_OPERATION = ",{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_FIN_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_study',
scale: 'large',
handler: function(){
doSensorOperation( {$CR['id']}, 24, 0, true );
}
}";
};
if( stripos( $CR['version'], 'FF' )!== false ){
$THF_OPERATION = ",{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_DEL_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_frozen',
scale: 'large',
handler: function(){
doSensorOperation( {$CR['id']}, 23, 0, true );
}
}";
};
$THF_OPERATION .= ",{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_DIS_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_ble',
scale: 'large',
handler: function(){
doSensorOperation( {$CR['id']}, 22, 0, true );
}
}";
};
} else {
$THF_OPERATION = '';
}
$ED =<<<kokakskhkajhskr
{
xtype: 'tabpanel',
activeTab: 0,
items:[{
xtype: 'form',
title: '{$Labels->GetLabel('_GENERAL_')}',
labelWidth: 200,
border: false,
frame: false,
labelAlign: 'right',
height: PanelH - 283,
items:[{
xtype: 'combo',
id: 'sens_se',
fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$Labels->GetLabel('___ENABLED__')}']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: {$CR['enable']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 1, b, true );
}
}
},{
xtype: 'combo',
id: 'sens_range',
fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['range','range_txt'],
data: [
[15,'15 {$Labels->GetLabel('_METERS_')}'],
[35,'35 {$Labels->GetLabel('_METERS_')}'],
[45,'45 {$Labels->GetLabel('_METERS_')}'],
[65,'65 {$Labels->GetLabel('_METERS_')}'],
[75,'75 {$Labels->GetLabel('_METERS_')}'],
[150,'150 {$Labels->GetLabel('_METERS_')}'],
[200,'200 {$Labels->GetLabel('_METERS_')}'],
[300,'300 {$Labels->GetLabel('_METERS_')}'],
[350,'350 {$Labels->GetLabel('_METERS_')}']
]
}),
valueField: 'range',
displayField: 'range_txt',
value: {$CR['max_range']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 2, b, true );
}
}
},{
xtype: 'numberfield',
id: 'sens_id',
fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}',
width: 200,
value: {$CR['device_id']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 3, c, true );
}
}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
lazyRender: true,
id: 'uart_id',
mode: 'local',
disabled: false,
forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['uart','uart_txt'],
data: [{$UARTS}]
}),
valueField: 'uart',
displayField: 'uart_txt',
value: {$CR['uart_id']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 4, c.data.uart, true );
}
}
},{
xtype: 'combo',
id: 'ad_se',
fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['ad','ad_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[10,'Each 10 Flips'],
[20,'Each 20 Flips'],
[30,'Each 30 Flips'],
[40,'Each 40 Flips'],
[50,'Each 50 Flips'],
[100,'Each 100 Flips'],
[200,'Each 200 Flips']
]
}),
valueField: 'ad',
displayField: 'ad_txt',
value: {$CR['auto_draw']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 5, b, true );
}
}
},{
xtype: 'numberfield',
id: 'basesh_id',
fieldLabel: 'Background {$Labels->GetLabel('__ZERO_SHIFT__')}',
width: 200,
value: {$CR['base_shift']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 6, c, true );
}
}
},{
xtype: 'combo',
id: 'sens_at',
fieldLabel: "{$Labels->GetLabel('_SENS_ACKT_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('_MA_ROUND_')}'],
[1,'{$Labels->GetLabel('_MA_CIRCLE__')}']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: {$CR['ack_mask_type']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 25, b, true );
}
}
},{
xtype: 'combo',
id: 'sens_as',
fieldLabel: "{$Labels->GetLabel('_SENS_ACKS_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['size','size_txt'],
data: [
[10,'10 {$Labels->GetLabel('_METERS_')}'],
[20,'20 {$Labels->GetLabel('_METERS_')}'],
[30,'30 {$Labels->GetLabel('_METERS_')}'],
[40,'40 {$Labels->GetLabel('_METERS_')}'],
[50,'50 {$Labels->GetLabel('_METERS_')}'],
[60,'60 {$Labels->GetLabel('_METERS_')}'],
[70,'70 {$Labels->GetLabel('_METERS_')}']
]
}),
valueField: 'size',
displayField: 'size_txt',
value: {$CR['ack_mask_size']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 26, b, true );
}
}
}]
},{
xtype: 'form',
title: '{$Labels->GetLabel('_HARDWARE_')}',
labelWidth: 200,
border: false,
frame: false,
labelAlign: 'right',
height: PanelH - 283,
items:[{
xtype: 'checkbox',
id: 'autores_ena',
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_ENA_')}',
width: 200,
checked: {$INI_S['AUTORESET_ENABLE']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 7, 1, false );
} else {
doSensorOperation( {$CR['id']}, 7, 0, false );
};
}
}
},{
xtype: 'numberfield',
id: 'autores_il',
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_INTER_')}',
width: 200,
value: {$INI_S['AUTORESET_INTERLEAVE']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 8, c, false );
}
}
},{
xtype: 'numberfield',
id: 'autores_to',
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_TO_')}',
width: 200,
value: {$INI_S['AUTORESET_TIMEOUT']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 9, c, false );
}
}
},{
xtype: 'numberfield',
id: 'board_zsh',
fieldLabel: '{$Labels->GetLabel('_SENS_BZSHIFT_')}',
width: 200,
value: {$INI_S['BOARD_ZEROSHIFT']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 10, c, false );
}
}
},{
xtype: 'numberfield',
id: 'board_temp',
fieldLabel: '{$Labels->GetLabel('_SENS_HTEMP_')}',
width: 200,
value: {$INI_S['BOARD_TEMPERATURE']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 11, c, false );
}
}
},{
xtype: 'combo',
id: 'board_spd',
fieldLabel: "{$Labels->GetLabel('_SENS_SCANSPEED_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['sd','sd_txt'],
data: [
[2,'2 Scans per second'],
[4,'4 Scans per second'],
[6,'6 Scans per second'],
[8,'8 Scans per second'],
[10,'10 Scans per second'],
[12,'12 Scans per second']
]
}),
valueField: 'sd',
displayField: 'sd_txt',
value: {$INI_S['BOARD_SPEED']},
width: 200,
listeners:{
select: function( a, c, b ){
doSensorOperation( {$CR['id']}, 12, b, false );
}
}
},{
xtype: 'checkbox',
id: 'nbt_ena',
fieldLabel: '{$Labels->GetLabel('_SENS_NOBLA_')}',
width: 200,
checked: {$INI_S['NO_BLACK_TARGETS']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 13, 1, false );
} else {
doSensorOperation( {$CR['id']}, 13, 0, false );
};
}
}
},{
xtype: 'checkbox',
id: 'jmt_ena',
fieldLabel: '{$Labels->GetLabel('_SENS_JUMOTA_')}',
width: 200,
checked: {$INI_S['JUST_MOVING_TARGETS']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 14, 1, false );
} else {
doSensorOperation( {$CR['id']}, 14, 0, false );
};
}
}
},{
xtype: 'checkbox',
id: 'jmt_rad',
fieldLabel: '{$Labels->GetLabel('_SENS_JUMORA_')}',
width: 200,
checked: {$INI_S['JUST_MOVING_RADIAL']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 15, 1, false );
} else {
doSensorOperation( {$CR['id']}, 15, 0, false );
};
}
}
},{
xtype: 'checkbox',
id: 'jmt_range',
fieldLabel: '{$Labels->GetLabel('_SENS_JUMODI_')}',
width: 200,
checked: {$INI_S['JUST_MOVING_DISTANCE']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 16, 1, false );
} else {
doSensorOperation( {$CR['id']}, 16, 0, false );
};
}
}
},{
xtype: 'checkbox',
id: 'fth_freeze',
fieldLabel: '{$Labels->GetLabel('_SENS_FFTH_')}',
width: 200,
checked: {$INI_S['FREEZ_FIRST_TH']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 17, 1, false );
} else {
doSensorOperation( {$CR['id']}, 17, 0, false );
};
}
}
},{
xtype: 'checkbox',
id: 'fth_save',
fieldLabel: '{$Labels->GetLabel('_SENS_SFTH_')}',
width: 200,
checked: {$INI_S['SAVE_FIRST_TH']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$CR['id']}, 18, 1, false );
} else {
doSensorOperation( {$CR['id']}, 18, 0, false );
};
}
}
},{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_APPLY_RES_')}',
width: '100%',
iconCls: 'srv_op_download',
scale: 'large',
handler: function(){
doSensorOperation( {$CR['id']}, 20, 0, true );
}
}]
},{
xtype: 'panel',
title: '{$Labels->GetLabel('_POSITION_')}',
height: PanelH - 283,
items:[{
xtype: 'panel',
id: 'sens_posrot',
height: PanelH - 283,
layout: 'table',
frame: false,
border: false,
layoutConfig: {
columns: 3
},
defaults: {
frame: false,
bodyStyle: 'padding:10px',
border: false
},
items:[{
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['x_rot']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 30, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['y_rot']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 31, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['z_rot']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 32, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['x']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 33, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['y']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 34, c );
}
}
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
value: {$CR['z']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$CR['id']}, 35, c );
}
}
},{
html: '&nbsp;'
}]
}]
},{
xtype: 'panel',
title: '{$Labels->GetLabel('_MAINTENENCE_')}',
height: PanelH - 283,
items:[{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_DO_FULLR_')}',
width: '100%',
iconCls: 'srv_op_restart',
scale: 'large',
handler: function(){
doDeviceOperation( {$CR['node_id']}, 1,'', true );
}
},{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_DO_READALL_')}',
width: '100%',
iconCls: 'srv_op_upload',
scale: 'large',
handler: function(){
doDeviceOperation( {$CR['node_id']}, 128,'', true );
}
},{
xtype: 'button',
text: '{$Labels->GetLabel('_SENS_DO_SAVEALL_')}',
width: '100%',
iconCls: 'srv_op_download',
scale: 'large',
handler: function(){
doDeviceOperation( {$CR['node_id']}, 129,'', true );
}
}{$THF_OPERATION}]
},{
xtype: 'panel',
title: '{$Labels->getLabel('_SND_FILES2_DEV__')}',
height: PanelH - 283,
items:[{
title: '{$Labels->getLabel('_UPLOAD_PACKAGE_')}',
xtype: 'panel',
//height: 300,
//flex: 1,
frame: true,
border: false,
//layout: 'vbox',
items:[{
xtype:'button',
id: 'pickfiles_3',
width: '100%',
text: '{$Labels->GetLabel('_CHOOSEF_')}',
listeners:{
afterrender: function(){
muploader = new plupload.Uploader({
runtimes : 'html5,html4',
browse_button : Ext.getDom('pickfiles_3'),
max_file_size : '1000mb',
chunk_size: '200kb',
max_retries: 3,
multi_selection: false,
max_file_count: 1,
url: '/lib/controller/uploadToDevice.php?DID={$EID}',
init: {
PostInit: function() {
},
FilesAdded: function( up, files ) {
Ext.getCmp('upload_files_btn').enable();
Ext.getCmp('uploads_clr_btn').enable();
plupload.each( files, function(file) {
uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
uploads_store_id++;
Ext.getCmp('upload_grid').doLayout();
});
},
UploadProgress: function(up, file) {
var pb = Ext.getCmp( 'progress_'+file.id );
if( file.percent < 100 ){
pb.updateProgress( file.percent / 100, file.percent + '%', false );
} else {
pb.updateProgress( 1.0, 'Uploaded', false );
uploads_store.removeAll();
loadModuleFiles( {$EID} );
};
},
Error: function(up, err) {
Ext.Msg.show({
title:'Upload Status',
msg: "Error #" + err.code + ": " + err.message,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
}
});
muploader.init();
//Ext.getCmp('uploaded_grid').hide();
//Ext.getCmp('upload_progres_panel').show();
devUploadID = {$CR['id']};
fetchDeviceUploadStatus();
//loadModuleFiles( {$EID} );
}
}
},{
height: 200,
xtype: 'grid',
id: 'upload_grid',
border: false,
frame: false,
mode: 'local',
lazyRender: true,
width: '100%',
autoScroll: true,
ds: uploads_store,
cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
viewConfig: {
forceFit: true
},
bbar: [{
text: '{$Labels->GetLabel('_CLEAR_')}',
id: 'uploads_clr_btn',
disabled: true,
handler: function(){
muploader.splice();
uploads_store.removeAll();
uploads_store_id = 0;
Ext.getCmp('uploads_clr_btn').disable();
Ext.getCmp('upload_files_btn').disable();
}
},{
xtype:'button',
id: 'upload_files_btn',
disabled: true,
text: '{$Labels->GetLabel('_UPLOA2MODULE_')}',
handler: function(){
if( muploader!= null ){
muploader.start();
Ext.getCmp('upload_files_btn').disable();
};
}
}]
},{
xtype: 'panel',
height: 20
},{
title: '{$Labels->GetLabel('_FISONMODULE_')}',
height: 200,
xtype: 'grid',
id: 'uploaded_grid',
border: false,
hidden: true,
frame: false,
mode: 'local',
lazyRender: true,
width: '100%',
autoScroll: true,
ds: uploaded_store,
cm: new Ext.grid.ColumnModel( fileModuleColModel_ops ),
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
viewConfig: {
forceFit: true
},
bbar: [{
text: '{$Labels->GetLabel('_CLEAR_')}',
id: 'oploaded_clr_btn',
disabled: false,
handler: function(){
//muploader.splice();
uploaded_store.removeAll();
uploaded_store_id = 0;
}
},{
text: '{$Labels->GetLabel('_RESETSTATUS_')}',
id: 'oploaded_rst_btn',
disabled: true,
handler: function(){
//muploader.splice();
//uploaded_store.removeAll();
//uploaded_store_id = 0;
}
},{
text: '{$Labels->GetLabel('_ISSURES_')}',
id: 'oploaded_sres_btn',
disabled: true,
handler: function(){
//muploader.splice();
//uploaded_store.removeAll();
//uploaded_store_id = 0;
}
},{
xtype:'button',
//disabled: true,
id: 'oploaded_snd_btn',
text: '{$Labels->GetLabel('_SENDTOSENS_')}',
handler: function(){
doDeviceOperation( {$CR['node_id']}, 120,'', true );
Ext.getCmp('uploaded_grid').hide();
Ext.getCmp('upload_progres_panel').show();
devUploadID = {$CR['id']};
fetchDeviceUploadStatus();
}
}]
},{
xtype: 'panel',
id: 'upload_progres_panel',
hidden: false,
items:[{
id: 'upp_ttext',
html: 'Sending 3 file(s) to the device'
},{
id: 'upp_ctext_',
html: '<table width="100%" height="50" border=0><tr><td width="100">&nbsp;</td><td width="50" align="right" height="50"><svg version="1.1" id="L3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"><circle fill="none" stroke="#fff" stroke-width="4" cx="50" cy="50" r="44" style="opacity:0.5;"/><circle fill="#fff" stroke="#e74c3c" stroke-width="3" cx="8" cy="54" r="6" ><animateTransform attributeName="transform" dur="2s" type="rotate" from="0 50 48" to="360 50 52" repeatCount="indefinite" /></circle></svg></td><td align="left" id="upp_ctext"></td></tr></table>'
},{
xtype: 'progress',
id: 'upp_pbar',
width: '100%',
value: 0.0
}]
}]
}]
}],
bbar:[{
text: '{$Labels->GetLabel('_REMOVE_SENSOR_')}',
handler: function(){
doSensorOperation( {$CR['id']}, 255,'', true );
}
}]
}
kokakskhkajhskr;
$ITEMS[1] = $ED;
$CONTENT = implode(',',$ITEMS);
$TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
echo $TTPL;
} else {
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
} else {
header('location: /');
};
?>

57
lib/controller/getServerSettings.php

@ -61,26 +61,23 @@
tabchange: function( tp, t ){
switch( t.getId() ){
case 'gi_tab': {
content_lvl3=0;
contentView.l[3] = {v:0,p:''};
serverStatusUpdater();
break;
};
case 'res_tab': {
//content_lvl3=1;
case 'media_settings_tab': {
stopStatusUpdater();
//loadRessources();
loadMediaSettings();
break;
};
case 'mod_tab':{
//content_lvl3=2;
case 'application_settings_tab':{
stopStatusUpdater();
//loadModules();
loadApplicationSettings();
break;
};
case 'flt_tab':{
//content_lvl3=3;
case 'history_settings_tab':{
stopStatusUpdater();
//loadFilters();
loadHistorySettings();
break;
};
};
@ -125,7 +122,7 @@ DATA_BOUNDARY;
fn: function(btn, text){
if( btn == 'yes' ){
disableServOps();
doDeviceOperation( 1, 250,'', true );
doApplicationOperation( 1, 250,'', true );
};
}
});
@ -254,23 +251,19 @@ DATA_BOUNDARY;
$TAB_CTX=<<<DATA_BOUNDARY
,{
xtype: 'panel',
title: "{$Labels->GetLabel( '_RESOURCES_' )}",
id: 'res_tab',
id: 'media_settings_tab',
title: "{$Labels->GetLabel( '_LBL_MEDIA_SETTINGS_' )}",
layout: 'hbox',
items:[{
xtype: 'panel',
id: 'resources_container',
id: 'media_settings_container',
flex: 1,
height: PanelH-15,
autoScroll: 'auto',
tbar:[{
text: "{$Labels->GetLabel( '_ADD_REMOTE_UART_' )}",
handler: function(){} //addEthernet2Uart
}],
autoScroll: 'auto',
items:[]
},{
xtype: 'panel',
id: 'res_ed_small',
id: 'encoder_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
@ -280,23 +273,19 @@ DATA_BOUNDARY;
}]
},{
xtype: 'panel',
title: "{$Labels->GetLabel( '_SERVER_MODULES_' )}",
id: 'mod_tab',
title: "{$Labels->GetLabel( '_APPLICA_MNGMNT_' )}",
id: 'application_settings_tab',
layout: 'hbox',
items:[{
xtype: 'panel',
id: 'modules_container',
id: 'application_settings_container',
flex: 1,
height: PanelH-15,
autoScroll: 'auto',
tbar:[{
text: "{$Labels->GetLabel( '_ADD_MODULE_' )}",
handler: addModule
}],
items:[]
},{
xtype: 'panel',
id: 'mod_ed_small',
id: 'application_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
@ -306,23 +295,19 @@ DATA_BOUNDARY;
}]
},{
xtype: 'panel',
title: "{$Labels->GetLabel( '_TARGET_FILTERS_' )}",
id: 'flt_tab',
title: "{$Labels->GetLabel( '_REPORT_STORAGE_' )}",
id: 'history_settings_tab',
layout: 'hbox',
items:[{
xtype: 'panel',
id: 'filters_container',
id: 'history_settings_container',
flex: 1,
height: PanelH-15,
autoScroll: 'auto',
tbar:[{
text: "{$Labels->GetLabel( '_ADD_FILTER_' )}",
handler: addFilter
}],
items:[]
},{
xtype: 'panel',
id: 'flt_ed_small',
id: 'history_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',

28
lib/controller/getStationEditor.php

@ -16,12 +16,36 @@
id: 'btn_unb_station',
text: '{$Labels->GetLabel('_SMM_UNB_STATION_')}',
handler: function(){
doStationOperation( {$EID}, 4, SelectedLine, true );
Ext.Msg.show({
title:'{$Labels->GetLabel('_UNBIND_STATION_')}?',
msg: '{$Labels->GetLabel('_UNBIND_STATION_QUES_')}?',
buttons: Ext.Msg.YESNO,
fn: function(btn){
if( btn == 'yes' ){
SelectedModule = 0;
doStationOperation( {$EID}, 4, SelectedLine, true );
};
},
icon: Ext.MessageBox.QUESTION
});
}
},{
id: 'btn_del_station',
text: '{$Labels->GetLabel('_SMM_DEL_STATION_')}',
handler: function(){}
handler: function(){
Ext.Msg.show({
title:'{$Labels->GetLabel('_REMOVE_STATION_')}?',
msg: '{$Labels->GetLabel('_REMOVE_STATION_QUES_')}?',
buttons: Ext.Msg.YESNO,
fn: function(btn){
if( btn == 'yes' ){
SelectedModule = 0;
doStationOperation( {$EID}, 4, SelectedLine, true );
};
},
icon: Ext.MessageBox.QUESTION
});
}
}],
items:[%%%ITEMS%%%]
}

116
lib/controller/getStatus.php

@ -8,6 +8,7 @@
$Data = array();
$Data['VLVL'] = intval( $_POST['VLVL'] );
$Data['LTS'] = intval( $_POST['LTS'] );
$Data['active_session_id'] = 0;
$LID = intval( $_POST['LID'] );
if( $Data['LTS'] == 0 ) $Data['LTS'] = floor(microtime(true) * 1000);//time();
$ALRM_STATIONS = array();
@ -15,20 +16,24 @@
$QS = "SELECT * FROM `sessions` WHERE `final`='N' ORDER BY (`ts`*1000)+`ts_ms` DESC LIMIT 32";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
if( $Data['active_session_id']==0 ) $Data['active_session_id'] = intval( $RR[0]['id'] );
$Data['actual'] = array();
foreach( $RR as $R ){
$CA = array();
$CA['id']=intval($R['id'] );
$CA['track']=intval( $R['track_id'] );
$QS = "SELECT `st`.`id` AS `s_id`, `st`.`name` AS `s_name`, `pt`.`name` AS `p_name`, `tr`.`short` FROM `metro_tracks` `tr` LEFT JOIN `metro_platforms` `pt` ON (`tr`.`platform_id`=`pt`.`id`) LEFT JOIN `metro_stations` `st` ON (`pt`.`station_id`=`st`.`id`) WHERE `tr`.`id`={$CA['track']}";
$QS = "SELECT `st`.`id` AS `s_id`, `st`.`name` AS `s_name`, `pt`.`id` AS `p_id`, `pt`.`name` AS `p_name`, `tr`.`short` FROM `metro_tracks` `tr` LEFT JOIN `metro_platforms` `pt` ON (`tr`.`platform_id`=`pt`.`id`) LEFT JOIN `metro_stations` `st` ON (`pt`.`station_id`=`st`.`id`) WHERE `tr`.`id`={$CA['track']}";
$GG = $DATABASE->Query( $QS );
$CA['station_name']=$GG[0]['s_name'];
$CA['platform_name']=$GG[0]['p_name'];
$CA['station']=intval( $GG[0]['s_id'] );
$CA['platform_name']=date( "H:i:s", $R['ts']);//$GG[0]['p_name'];
$CA['platform']=intval( $GG[0]['p_id'] );
$CA['track_tag']=$GG[0]['short'];
$CA['status']=0;
$Data['actual'][] = $CA;
$ALRM_STATIONS[$GG[0]['s_id']] = 4;
};
$Data['actual'] = array_reverse( $Data['actual'] );
};
$QS = "SELECT * FROM `sessions` WHERE `final`='Y' AND `status`=0 ORDER BY (`ts`*1000)+`ts_ms` DESC LIMIT 32";
$RR = $DATABASE->Query( $QS );
@ -41,12 +46,13 @@
$QS = "SELECT `st`.`id` AS `s_id`, `st`.`name` AS `s_name`, `pt`.`name` AS `p_name`, `tr`.`short` FROM `metro_tracks` `tr` LEFT JOIN `metro_platforms` `pt` ON (`tr`.`platform_id`=`pt`.`id`) LEFT JOIN `metro_stations` `st` ON (`pt`.`station_id`=`st`.`id`) WHERE `tr`.`id`={$CA['track']}";
$GG = $DATABASE->Query( $QS );
$CA['station_name']=$GG[0]['s_name'];
$CA['platform_name']=$GG[0]['p_name'];
$CA['platform_name']=date( "H:i:s", $R['ts']);//$GG[0]['p_name'];
$CA['track_tag']=$GG[0]['short'];
$CA['status']=1;
$Data['expired'][] = $CA;
if( !isset($ALRM_STATIONS[$GG[0]['s_id']] ) ) $ALRM_STATIONS[$GG[0]['s_id']] = 3;
};
$Data['expired'] = array_reverse( $Data['expired'] );
};
switch( $Data['VLVL'] ){
@ -86,6 +92,85 @@
$Data['station_status'] = $SS;
break;
};
case 1:{ // Station View
$SSID = intval( $_POST['SSID'] );
$Data['platforms'] = array();
if( $SSID ){
$QS = "SELECT * FROM `metro_platforms` WHERE `station_id`={$SSID}";
$PL = $DATABASE->Query( $QS );
foreach( $PL as $P ){
$CP = array();
$CP['id'] = intval( $P['id'] );
$CP['status'] = 0;
foreach( $Data['actual'] as $CC ) if( $CC['station'] == $SSID ) if( $CP['id'] == $CC['platform'] ) {
$CP['status'] = 1;
break;
};
$PID = $CP['id'];
$QS = "SELECT * FROM `metro_tracks` WHERE `platform_id`={$PID}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$Modules = array();
foreach( $RR as $CT ){
$CM = intval( $CT['near_module_id'] );
$LD = array();
if( $CM ){
$LD['id']=$CM;
if( getOnlineStatus( $CM ) ){
$LD['status'] = 2;
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM}";
$RZ = $DATABASE->Query( $QS );
$MM = $RZ[0];
//$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
$LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `status`=0";
$RZ = $DATABASE->Query( $QS );
if( count( $RZ ) ){
$LD['status'] = 3;
$LD['session'] = intval( $RZ[0]['id'] );
};
} else {
$LD['status'] = 1;
$LD['img'] = '/style/assets/no-signal_h.png';
};
} else {
$LD['status'] = 0;
};
$Modules[] = $LD;
$CM = $CT['far_module_id'];
$LD = array();
if( $CM ){
$LD['id']=$CM;
if( getOnlineStatus( $CM ) ){
$LD['status'] = 2;
$QS = "SELECT * FROM `metro_modules` WHERE `id`={$CM}";
$RZ = $DATABASE->Query( $QS );
$MM = $RZ[0];
//$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
$LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `status`=0";
$RZ = $DATABASE->Query( $QS );
if( count( $RZ ) ){
$LD['status'] = 3;
$LD['session'] = intval( $RZ[0]['id'] );
};
} else {
$LD['status'] = 1;
$LD['img'] = '/style/assets/no-signal_h.png';
};
} else {
$LD['status'] = 0;
};
$Modules[] = $LD;
};
$CP['modules'] = $Modules;
};
$Data['platforms'][] = $CP;
};
};
break;
};
case 2:{ //Platform View
$PID = intval( $_POST['PID'] );
if( $PID ){
@ -105,7 +190,7 @@
$MM = $RZ[0];
//$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
$LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `status`=0";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `final`='N'";
$RZ = $DATABASE->Query( $QS );
if( count( $RZ ) ){
$LD['status'] = 3;
@ -130,7 +215,7 @@
$MM = $RZ[0];
//$LD['img'] = "http://{$MM['IP4']}/video_feed/stream?id={$MM['cam_stream']}";
$LD['img'] = "http://{$MM['IP4']}/video_feed/preview?id={$MM['cam_stream']}";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `status`=0";
$QS = "SELECT `id` FROM `sessions` WHERE `track_id`={$CT['id']} AND `final`='N'";
$RZ = $DATABASE->Query( $QS );
if( count( $RZ ) ){
$LD['status'] = 3;
@ -146,6 +231,27 @@
$Modules[] = $LD;
};
$Data['modules'] = $Modules;
$QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$PID}";
$RR = $DATABASE->Query( $QS );
$Data['scada'] = array();
if( count($RR) == 0 ) {
$Data['scada']['status']=0;
} else {
$SM = $RR[0];
if( $SM['wm'] == 'D' ){
$Data['scada']['status']=1;
} else {
$SM['status'] = intval($SM['status']);
$Data['scada']['status']=$SM['status']+2;
if( $SM['status'] > 0 ){
$CV = intval($SM['values']);
$Data['scada']['A']= $CV & 0x01;
$Data['scada']['B']= $CV & 0x02;
$Data['scada']['C']= $CV & 0x04;
$Data['scada']['D']= $CV & 0x08;
};
};
};
};
};
break;

324
lib/controller/importMojoReport.php

@ -0,0 +1,324 @@
<?php
error_reporting( E_ALL );
require_once('../settings.php');
require_once('../defines.php');
require_once('../php/argus/server.php');
$DATAPATH = $SYSPath . 'lib/controller/data/reports/';
function generateUUIDv4(): string
{
// Generate 16 random bytes
$data = random_bytes(16);
// Set the version to 4 (0100 in binary)
// The 6th byte (index 5 in a 0-indexed array) contains the version information.
// We clear the top 4 bits and then set the version bits to 0100 (4).
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
// Set the variant to 2 (10 in binary, RFC 4122)
// The 8th byte (index 7 in a 0-indexed array) contains the variant information.
// We clear the top 2 bits and then set the variant bits to 10 (2).
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
// Format the byte string into a UUID string with hyphens
// vsprintf is used with a format string to insert the hexadecimal representation
// of the byte chunks into the correct positions.
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
function createSession( $TID, $STS, $ETS ){
global $DATABASE;
$STSS = intval( $STS / 1000 );
$STSM = $STS % 1000;
$ETSS = intval( $ETS / 1000 );
$UUID = generateUUIDv4();
$QS = "INSERT INTO `sessions` SET `ts`={$STSS}, `ts_ms`={$STSM}, `lts`={$ETSS}, `uuid`='{$UUID}', `track_id`={$TID}, `status`=5, `final`='Y'";
$DATABASE->Query( $QS );
return $DATABASE->getLastInsertID();
};
function makeSureSessionDirIsOk( $TID, $TS ){
global $DATAPATH;
$status = true;
$Y = date( 'Y', $TS );
$M = date( 'm', $TS );
$D = date( 'd', $TS );
$CP = $DATAPATH . $TID;
if( !file_exists( $CP ) ) {
$status = mkdir( $CP );
chown( $CP, 'www-data' );
chgrp( $CP, 'www-data' );
chmod( $CP, 0765 );
};
$CP .= '/'.$Y;
if( $status ) if( !file_exists( $CP ) ) {
$status = mkdir( $CP );
chown( $CP, 'www-data' );
chgrp( $CP, 'www-data' );
chmod( $CP, 0765 );
};
$CP .= '/'.$M;
if( $status ) if( !file_exists( $CP ) ) {
$status = mkdir( $CP );
chown( $CP, 'www-data' );
chgrp( $CP, 'www-data' );
chmod( $CP, 0765 );
};
$CP .= '/'.$D;
if( $status ) if( !file_exists( $CP ) ) {
$status = mkdir( $CP );
chown( $CP, 'www-data' );
chgrp( $CP, 'www-data' );
chmod( $CP, 0765 );
};
if( $status ) return $CP . '/';
return false;
};
function getSessionBasePath( $SID ){
global $DATABASE, $DATAPATH;
$OO = intval( $SID );
if( $OO ){
$QS = "SELECT `ts`,`track_id` FROM `sessions` WHERE `id`={$OO}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$CTRC = intval( $RR[0]['track_id'] );
$CSTS = intval( $RR[0]['ts'] );
return makeSureSessionDirIsOk( $CTRC, $CSTS );
};
};
return false;
};
function updateSessionStatEvt( $SID ){
global $DATABASE;
$QS = "UPDATE `sessions` SET `evt_cnt`=`evt_cnt`+1 WHERE `id`={$SID}";
$DATABASE->Query( $QS );
};
function updateSessionStatVid( $SID ){
global $DATABASE;
$QS = "UPDATE `sessions` SET `vid_cnt`=`vid_cnt`+1 WHERE `id`={$SID}";
$DATABASE->Query( $QS );
};
function addVideoFileToMediaConvertion( $FN, $W, $H, $FPS, $FMT, $STS, $MID, $SID ){
global $DATABASE;
if( !intval( $SID ) ) return false;
if( !file_exists( $FN ) ) return false;
if( ( $BD = getSessionBasePath( $SID ) ) === false ) return false;
$UUID = generateUUIDv4();
$DST = $BD . $UUID . '.'. $FMT;
if( copy( $FN, $DST ) ){
//unlink( $FN );
$STSS = intval( $STS / 1000 );
$STSM = $STS % 1000;
$QS = "INSERT INTO `media_queue` SET `module_id`={$MID}, `session_id`={$SID}, `ts`={$STSS}, `tsms`={$STSM}, `uuid`='{$UUID}', `width`={$W}, `height`={$H}, `fps`={$FPS}, `fmt`='$FMT', `status`=1";
echo $QS . "\n";
$DATABASE->Query( $QS );
return true;
};
return false;
};
function copyEventsToReport( $SID, $MID, $STS, $ETS, $RecTypes = array(10,11,12,13,14,36)){
global $RBASE;
$STSS = intval( $STS / 1000 );
$STSM = $STS % 1000;
$ETSS = intval( $STS / 1000 );
$ETSM = $ETS % 1000;
if( ( $BD = getSessionBasePath( $SID ) ) === false ) return false;
if( !file_exists( $BD.'report.db' ) ){
$LBASE = new SQLite_DB( $BD.'report.db' );
chown( $BD.'report.db', 'www-data' );
chgrp( $BD.'report.db', 'www-data' );
chmod( $BD.'report.db', 0670 );
$LBASE->Query("CREATE TABLE IF NOT EXISTS \"events\" ( \"id\" INTEGER NOT NULL, \"session_id\" INTEGER NOT NULL, \"module_id\" INTEGER NOT NULL, \"ts\" INTEGER NOT NULL, \"ts_ms\" INTEGER NOT NULL, \"evt_type\" INTEGER NOT NULL, \"azimuth\" REAL, \"elevation\" REAL, \"range\" REAL, \"area\" REAL, PRIMARY KEY(\"id\" AUTOINCREMENT) )");
$LBASE->Query("CREATE TABLE IF NOT EXISTS \"videos\" ( \"id\" INTEGER NOT NULL, \"session_id\" INTEGER NOT NULL, \"module_id\" INTEGER NOT NULL, \"uuid\" TEXT NOT NULL UNIQUE, \"ts\" INTEGER NOT NULL, \"ts_ms\" INTEGER NOT NULL, \"ext\" TEXT NOT NULL, \"fps\" INTEGER NOT NULL, PRIMARY KEY(\"id\" AUTOINCREMENT) )");
} else {
$LBASE = new SQLite_DB( $BD.'report.db' );
};
$QS = "SELECT * FROM `events` WHERE `evt_type` IN( 10,11,12,13,14,36) AND (`ts`*1000+`ts_ms`)<={$ETS} AND (`ts`*1000+`ts_ms`)>={$STS} ORDER BY (`ts`*1000+`ts_ms`)";
$Data = $RBASE->Query( $QS );
foreach( $Data as $Datum ){
$QS="INSERT INTO `events`( `session_id`,`module_id`,`ts`,`ts_ms`,`evt_type`,`azimuth`,`elevation`,`range`,`area` ) VALUES({$SID},{$MID},{$Datum['ts']},{$Datum['ts_ms']},{$Datum['evt_type']},{$Datum['azimuth']},{$Datum['elevation']},{$Datum['range']},{$Datum['area']})";
echo $QS . "\n";
$LBASE->Query( $QS );
updateSessionStatEvt($SID);
};
unset( $LBASE );
};
$MODE = 1; // targets
$MODE = 2; // ROI
$MODE = 3; // ALL
// SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION );
if( $TT_123[0] == '4' ){
require_once( '../php/db/MySQL_class.php' );
$DATABASE = new MySQL_DB($DBHost, $DBName, $DBUser, $DBPassword);
} elseif( $TT_123[0] > '4' ){
require_once( '../php/db/MySQLi_class.php' );
$DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword);
} else {
exit();
};
require_once( '../php/db/internal.php' );
require_once( '../php/db/SQLite_Class.php');
if( count( $argv ) < 2 ){
echo "No Parameters are set!\n\tThe Right Usage is:\n\n\t{$argv[0]} <module_id> <report_folder>\n\n";
$QS = "SELECT `mm`.`id`, `mm`.`name`, `mt`.`platform_id`, `mt`.`short` FROM `metro_modules` `mm` LEFT JOIN `metro_tracks` `mt` ON ( `mm`.`track_id` = `mt`.`id`) ORDER BY `mm`.`id`";
$Res = $DATABASE->Query( $QS );
if( count( $Res ) ){
echo "\tAvealable Modules are:\n";
foreach( $Res as $R ){
$MID = intval( $R['id'] );
$PID = intval( $R['platform_id'] );
$QS = "SELECT `st`.`name`, `pl`.`name` as `pl_name` FROM `metro_platforms` `pl` LEFT JOIN `metro_stations` `st` ON( `pl`.`station_id`=`st`.`id`) WHERE `pl`.`id`={$PID}";
$JJ = $DATABASE->Query( $QS );
echo "\t\t{$MID}\t[{$JJ[0]['name']}]:[{$JJ[0]['pl_name']}]:[{$R['short']}]:[{$R['name']}]\n";
};
} else {
echo "However No Modules are existed!!!\n";
};
} elseif( count( $argv ) < 3 ) {
$SMID = intval( $argv[1] );
if($SMID){
echo "Insuffision Parameters are set!\n\tThe Right Usage is:\n\n\t{$argv[0]} {$argv[1]} <report_folder>\n\n";
} else {
echo "Wrong Parameter is set!\n\tThe Right Usage is:\n\n\t{$argv[0]} <module_id> <report_folder>\n\n";
exit();
};
$QS = "SELECT `mm`.`id`, `mm`.`name`, `mt`.`platform_id`, `mt`.`short` FROM `metro_modules` `mm` LEFT JOIN `metro_tracks` `mt` ON ( `mm`.`track_id` = `mt`.`id`) WHERE `mm`.`id`={$SMID}";
$Res = $DATABASE->Query( $QS );
if( count( $Res ) ){
echo "\tSelected Module is:\n\n";
$R = $Res[0];
$MID = intval( $R['id'] );
$PID = intval( $R['platform_id'] );
$QS = "SELECT `st`.`name`, `pl`.`name` as `pl_name` FROM `metro_platforms` `pl` LEFT JOIN `metro_stations` `st` ON( `pl`.`station_id`=`st`.`id`) WHERE `pl`.`id`={$PID}";
$JJ = $DATABASE->Query( $QS );
echo "\t\t{$MID}\t[{$JJ[0]['name']}]:[{$JJ[0]['pl_name']}]:[{$R['short']}]:[{$R['name']}]\n\n";
} else {
echo "\tThe Module ID is also WRONG!!!\n";
};
} else {
$SMID = intval( $argv[1] );
$FID = $argv[2];
$EX = 0;
if( !file_exists( $FID ) ){
echo "Insuffision Parameters are set!\n\tThe Right Usage is:\n\n\t{$argv[0]} {$argv[1]} <report_folder>\n\n";
} else {
if( !file_exists( $FID . '/report.db' ) ){
} else {
$EX = 1;
}
};
$QS = "SELECT `mm`.`id`, `mm`.`track_id`, `mm`.`name`, `mt`.`platform_id`, `mt`.`short` FROM `metro_modules` `mm` LEFT JOIN `metro_tracks` `mt` ON ( `mm`.`track_id` = `mt`.`id`) WHERE `mm`.`id`={$SMID}";
$Res = $DATABASE->Query( $QS );
if( count( $Res ) ){
echo "\tSelected Module is:\n\n";
$R = $Res[0];
$MID = intval( $R['id'] );
$TID = intval( $R['track_id'] );
$PID = intval( $R['platform_id'] );
$QS = "SELECT `st`.`name`, `pl`.`name` as `pl_name` FROM `metro_platforms` `pl` LEFT JOIN `metro_stations` `st` ON( `pl`.`station_id`=`st`.`id`) WHERE `pl`.`id`={$PID}";
$JJ = $DATABASE->Query( $QS );
echo "\t\t{$MID}\t[{$JJ[0]['name']}]:[{$JJ[0]['pl_name']}]:[{$R['short']}]:[{$R['name']}]\n\n";
} else {
$EX = 0;
echo "\tThe Module ID is also WRONG!!!\n";
};
if( $EX ){
$RBASE = new SQLite_DB( $FID . '/report.db' );
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `events`";
$R = $RBASE->Query( $QS );
if( count( $R ) ){
echo "\t{$R[0]['cnt']} Tottal Events in Database!\n";
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `events` WHERE `evt_type` IN( 10,11,12,13,14 )";
$R = $RBASE->Query( $QS );
$RTC = intval( $R[0]['cnt'] );
echo "\t{$RTC} Real Target Events in Database!\n";
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `events` WHERE `evt_type`=36";
$R = $RBASE->Query( $QS );
$ITC = intval( $R[0]['cnt'] );
echo "\t{$ITC} ROI Events in Database!\n";
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `videos`";
$R = $RBASE->Query( $QS );
$VC = intval( $R[0]['cnt'] );
echo "\t{$VC} Videos in Database!\n";
///////////////////////////////////////////////
echo "\tWORKING .... \n";
$QS = "SELECT `vv`.`id`, `vv`.`md5`, `vv`.`uts`, `vv`.`uts_ms`,`vv`.`ext`,`vv`.`fps` FROM `videos` `vv`";
$Data = $RBASE->Query( $QS );
$SES_START = 0;
$SES_END = 0;
$SESS_ID = 0;
$SESS_VC = 0;
$CVIDEOS = array();
if( count( $Data ) ){
foreach( $Data as $Datum ){
$VNAM = $FID . '/' . $Datum['md5'] . '.'. $Datum['ext'];
$Datum['FN'] = $VNAM;
if( file_exists( $VNAM ) ){
$FSIZ = filesize( $VNAM );
$VID = intval( $Datum['id'] );
$VTS = intval( $Datum['uts'] ) * 1000 + intval( $Datum['uts_ms'] );
$Datum['STS'] = $VTS;
$CVIDEOS[] = $Datum;
if( $SES_START == 0 ){
$SES_START = $VTS;
$SES_END = $VTS+60000;
$SESS_VC = 1;
} else {
if( $VTS < $SES_END ){
if( $VTS < $SES_START ){
$SES_START = $VTS;
} else {
if( ( $VTS+60000 ) > $SES_END ) $SES_END = $VTS+60000;
};
$SESS_VC++;
} else {
// Close Old Session and Start New One
//Add session
$CSID = createSession( $TID, $SES_START, $SES_END );
if( $CSID ){
echo "Session [{$SESS_ID}] Created as [{$CSID}]\n";
foreach( $CVIDEOS as $V ){
addVideoFileToMediaConvertion( $V['FN'], 1280, 720, $V['fps'], $V['ext'], $V['STS'], $MID, $CSID );
updateSessionStatVid( $CSID );
};
copyEventsToReport( $CSID, $MID, $SES_START, $SES_END );
$CVIDEOS = array();
};
$SESS_ID++;
$SES_START = $VTS;
$SES_END = $VTS+60000;
$SESS_VC = 1;
};
};
};
};
// Last Session
$CSID = createSession( $TID, $SES_START, $SES_END );
if( $CSID ){
echo "Session [{$SESS_ID}] Created as [{$CSID}]\n";
foreach( $CVIDEOS as $V ){
addVideoFileToMediaConvertion( $V['FN'], 1280, 720, $V['fps'], $V['ext'], $V['STS'], $MID, $CSID );
updateSessionStatVid( $CSID );
};
copyEventsToReport( $CSID, $MID, $SES_START, $SES_END );
$CVIDEOS = array();
};
};
} else {
echo "\tNo Events in Database!!!\n";
}
};
};
//$REPORT = new SQLite_DB( '/srv/www/web/lib/controller/data/mysqlitedb.db');
function analyseReportDB( $DBF ){
};
?>

10
lib/controller/listAccessLog.php

@ -1,13 +1,15 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php');
//require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){
$Data = array();
if( $CUser->Data['access'] > 5 ){
$QS = "SELECT al.*, ur.login FROM access_log al LEFT JOIN users ur ON (al.user_id = ur.id ) ORDER BY id DESC";
$Result = $DATABASE->Query($QS,false);
$Data['records'] = array();
$QS = "SELECT al.*, ur.login_id FROM access_log al LEFT JOIN users ur ON (al.user_id = ur.id ) ORDER BY id DESC LIMIT 64";
$Result = $DATABASE->Query( $QS,false );
foreach( $Result as $CD ){
$cnode['id'] = intval( $CD['id'] );
$cnode['user'] = $CD['login'];
$cnode['user'] = $CD['login_id'];
$cnode['ts']= $CD['ts'];
$cnode['cmd'] = intval( $CD['cmd'] );
$cnode['data_line'] = $CD['dataset'];

5
lib/controller/listServerLog.php

@ -2,8 +2,9 @@
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
$Records = array();
$Records = array();
if( $CUser->Data['access'] > 5 ){
$Records['records'] = array();
$QS = "SELECT * FROM `server_log_messages` ORDER BY `ts` DESC, `id` DESC LIMIT 64";
$DATA = $DATABASE->Query( $QS );
$LID = 0;

124
lib/controller/updateUser.php

@ -0,0 +1,124 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$DATA = array();
$DATA['success'] = false;
if( $CUser->Data['access'] > 4 ){
$COP = intval( $_POST['OP'] );
switch( $COP ){
case 0:{
//add new
$NLO = $DATABASE->escape( $_POST['NLO'] );
$PWD = $_POST['PW1'];
$RWD = $_POST['PW2'];
$ACC = intval($_POST['ACC']);
if( $PWD == '' ){
$DATA['msg'] = 'No Password defined!';
} else {
if( $_POST['NLO'] == '' ){
$DATA['msg'] = 'No Login defined!';
} else {
if( $PWD == $RWD ){
$M5 = md5( $PWD );
$CTS = time();
$QS="INSERT INTO `users`(`create_ts`,`login_id`,`pwd_hash`,`status`,`access`) VALUES ( {$CTS},'{$NLO}','{$M5}','A',{$ACC})";
$DATABASE->Query( $QS );
$DATA['success'] = true;
} else {
$DATA['msg'] = 'Passwords does not match!';
};
};
};
break;
};
case 1:{
//change old
$UID = intval($_POST['SUID']);
if( $UID ){
$OLO = $DATABASE->escape( $_POST['OLO'] );
$NLO = $DATABASE->escape( $_POST['NLO'] );
$PWD = $_POST['PW1'];
$RWD = $_POST['PW2'];
$ACC = intval($_POST['ACC']);
if( $PWD == '' ){
$QS="UPDATE `users` SET `login_id`='{$NLO}', `access`={$ACC} WHERE id={$UID}";
$DATABASE->Query( $QS );
$DATA['success'] = true;
} else {
if( $PWD == $RWD ){
$M5 = md5( $PWD );
$QS="UPDATE `users` SET `login_id`='{$NLO}', `pwdMD5`='{$M5}', `access`={$ACC} WHERE id={$UID}";
$DATABASE->Query( $QS );
$DATA['success'] = true;
} else {
$DATA['msg'] = 'Passwords does not match!';
};
};
} else {
$DATA['msg'] = 'Wrong User ID!';
};
break;
};
case 2:{
$UID = intval($_POST['SUID']);
if( $UID ){
if( $UID != $CUser->Data['id'] ){
if( $UID > 1 ){
$QS="UPDATE `users` SET `status`='D' WHERE id={$UID}";
$DATABASE->Query( $QS );
$DATA['success'] = true;
} else {
$DATA['msg'] = 'You Can not change Guest account!';
};
} else {
$DATA['msg'] = 'You Can not block yoreself account!';
};
} else {
$DATA['msg'] = 'Wrong User ID!';
};
break;
};
case 3:{
$UID = intval($_POST['SUID']);
if( $UID ){
if( $UID > 1 ){
$QS="UPDATE `users` SET `status`='A' WHERE id={$UID}";
$DATABASE->Query( $QS );
$DATA['success'] = true;
} else {
$DATA['msg'] = 'You Can not change Guest account!';
};
} else {
$DATA['msg'] = 'Wrong User ID!';
};
break;
};
case 4:{
$UID = intval($_POST['SUID']);
if( $UID ){
if( $UID != $CUser->Data['id'] ){
if( $UID > 1 ){
$QS="DELETE FROM `users` WHERE id={$UID}";
$DATABASE->Query( $QS );
$DATA['success'] = true;
} else {
$DATA['msg'] = 'You Can not remove Guest account!';
};
} else {
$DATA['msg'] = 'You Can not remove yoreself account!';
};
} else {
$DATA['msg'] = 'Wrong User ID!';
};
break;
};
default: $DATA['msg'] = 'Wrong Operation!'; break;
};
} else {
$DATA['msg'] = 'Access Permition Denied!';
};
echo json_encode( $DATA );
exit();
};
header('location: /');
?>

17
lib/defines.php

@ -3,15 +3,16 @@
$ARGUS_WEB_VERSION = trim( file_get_contents( '/srv/www/srv/lib/version.var' ) );
$SSL_INSTALLLED = false;
if( $_SERVER['SERVER_PORT'] != 443 ){
$WEBPath='http://' . $_SERVER['HTTP_HOST'] . '/';//$_SERVER['SERVER_NAME'] . '/';
if( $SSL_INSTALLLED ){
header( 'location: https://'.$_SERVER['SERVER_ADDR'].'/'.$_SERVER['QUERY_STRING'] );
exit();
if( isset( $_SERVER['SERVER_PORT'] ) ){
if( $_SERVER['SERVER_PORT'] != 443 ){
$WEBPath='http://' . $_SERVER['HTTP_HOST'] . '/';//$_SERVER['SERVER_NAME'] . '/';
if( $SSL_INSTALLLED ){
header( 'location: https://'.$_SERVER['SERVER_ADDR'].'/'.$_SERVER['QUERY_STRING'] );
exit();
};
} else {
$WEBPath='https://' . $_SERVER['HTTP_HOST'] . '/';//$_SERVER['SERVER_NAME'] . '/';
};
} else {
$WEBPath='https://' . $_SERVER['HTTP_HOST'] . '/';//$_SERVER['SERVER_NAME'] . '/';
};
$SYSPath = '/srv/www/srv/';

3
lib/javascript/jsapi_dynamic/argus_logs.js

@ -103,7 +103,8 @@ var um_access_log_store = new Ext.data.JsonStore({
function um_action_renderer( val ){
switch( val ){
case 1: return "<?=$Labels->GetLabel("_LOGIN_");?>";
case 2: return "<?=$Labels->GetLabel("_LOGOUT_");?>";
case 3: return "<?=$Labels->GetLabel("_LOGIN_");?>";
case 13: return "<?=$Labels->GetLabel("_ACCESS_DENIED_");?>";
case 145: return "<?=$Labels->GetLabel("_SCREEN_RESIZE_");?>";
};

228
lib/javascript/jsapi_dynamic/argus_monitoring.js

@ -22,9 +22,9 @@ function createEventTagContent( a ){
gif='red_2.gif';
};
if( mon_selectedEventId == a.id ){
return '<div id="event_tag_'+a.id+'"class="evt_side_tag_selected" onclick="selectEvent('+a.id+add+');"><table width="100%" border=0><tr><td colspan=2><div class="evt_side_stname">'+a.station_name+'</div></td><td width="18px"><img src="/style/assets/'+gif+'"></td></tr><tr><td><div class="evt_side_plname">'+a.id+' '+a.platform_name+'</div></td><td colspan=2><div class="level_label_title">'+a.track_tag+'</div></td></tr></div>';
return '<div id="event_tag_'+a.id+'"class="evt_side_tag_selected" onclick="selectEvent('+a.id+add+');"><table width="100%" border=0><tr><td colspan=2><div class="evt_side_stname">'+a.station_name+'</div></td><td width="18px"><img src="/style/assets/'+gif+'"></td></tr><tr><td><div class="evt_side_plname">'+a.platform_name+'</div></td><td colspan=2><div class="level_label_title">'+a.track_tag+'</div></td></tr></div>';
};
return '<div id="event_tag_'+a.id+'"class="evt_side_tag" onclick="selectEvent('+a.id+add+');"><table width="100%" border=0><tr><td colspan=2><div class="evt_side_stname">'+a.station_name+'</div></td><td width="18px"><img src="/style/assets/'+gif+'"></td></tr><tr><td><div class="evt_side_plname">'+a.id+' '+a.platform_name+'</div></td><td colspan=2><div class="level_label_title">'+a.track_tag+'</div></td></tr></div>';
return '<div id="event_tag_'+a.id+'"class="evt_side_tag" onclick="selectEvent('+a.id+add+');"><table width="100%" border=0><tr><td colspan=2><div class="evt_side_stname">'+a.station_name+'</div></td><td width="18px"><img src="/style/assets/'+gif+'"></td></tr><tr><td><div class="evt_side_plname">'+a.platform_name+'</div></td><td colspan=2><div class="level_label_title">'+a.track_tag+'</div></td></tr></div>';
};
var GREEN_Icon = L.icon({
@ -36,6 +36,15 @@ var GREEN_Icon = L.icon({
//shadowSize: [50, 64], // size of the shadow
//shadowAnchor: [4, 62], // the same for the shadow
});
var BLUE_Icon = L.icon({
iconUrl: '/style/assets/irs.png',
iconSize: [44, 44],
iconAnchor: [22, 22],
popupAnchor: [0, -22]
//shadowUrl: 'leaf-shadow.png',
//shadowSize: [50, 64], // size of the shadow
//shadowAnchor: [4, 62], // the same for the shadow
});
var RED_Icon = L.icon({
iconUrl: '/style/assets/ira.png',
iconSize: [44, 44],
@ -168,13 +177,14 @@ function loadStationView( STT, buba ){
autoRiseEvent = buba;
};
if( mon_selectedEventId ) unselectEvent();
changeContent( 1, 1, STT );
mon_selectedStation = STT;
changeContent( 1, 1, mon_selectedStation );
updateUserContent();
Ext.Ajax.request({
url: '/lib/controller/getMonitoringStationView.php',
params: {
STT: STT,
STT: mon_selectedStation,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
@ -729,6 +739,18 @@ function fetchStatus(){
if( data.status == 'ok' ){
if( monitoringViewLevel == data.VLVL ){
statusLTS = data.LTS;
if( autoRiseEvent ){
if( data.active_session_id != undefined ){
if( data.active_session_id > 0 ){
if( ssIsActive ) ssHideSS();
if( data.active_session_id != mon_selectedEventId ){
playSound( 1 );
selectEvent( data.active_session_id, false );
return;
};
};
};
};
//debugger;
switch( monitoringViewLevel ){
case 0:{
@ -739,11 +761,11 @@ function fetchStatus(){
break;
};
case 1: {
if( stationMarkers[data.station_ids[i]].options.icon != GREEN_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREEN_Icon );
if( stationMarkers[data.station_ids[i]].options.icon != BLUE_Icon ) stationMarkers[data.station_ids[i]].setIcon( BLUE_Icon );
break;
};
case 2: {
if( stationMarkers[data.station_ids[i]].options.icon != GREY_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREY_Icon );
if( stationMarkers[data.station_ids[i]].options.icon != GREEN_Icon ) stationMarkers[data.station_ids[i]].setIcon( GREEN_Icon );
break;
};
case 3: {
@ -762,23 +784,163 @@ function fetchStatus(){
};
break;
};
case 1:{
if( data.platforms != undefined ){
for( i=0; i< data.platforms.length; i++ ){
var tt = document.getElementById( 'plat_table_'+data.platforms[i].id );
if( data.platforms[i].status == 1 ){
if( tt.classList.contains('active_green') ){
tt.classList.remove('active_green');
tt.classList.add('active_red');
};
} else {
if( tt.classList.contains('active_red') ){
tt.classList.remove('active_red');
tt.classList.add('active_green');
};
};
if( data.platforms[i].modules != undefined ){
for( j=0; j<data.platforms[i].modules.length; j++ ){
if( data.platforms[i].modules[j].status ){
var zz = document.getElementById('mod_vp_'+data.platforms[i].modules[j].id );
if( zz.style.backgroundImage != 'url("'+data.platforms[i].modules[j].img+'")' ){
zz.style.backgroundImage = 'url("'+data.platforms[i].modules[j].img+'")';
};
};
};
};
};
};
break;
};
case 2:{
if( data.modules != undefined ){
for( var i=0; i< data.modules.length; i++){
if( data.modules[i].status > 0 ){
var tt = document.getElementById('plat_video_'+mon_selectedPlatform+'_'+data.modules[i].id );
if( tt.src != data.modules[i].img ) tt.src = data.modules[i].img;
if( tt != undefined ){
if( tt.src != data.modules[i].img ) tt.src = data.modules[i].img;
};
tt = document.getElementById('plat_status_'+mon_selectedPlatform+'_'+data.modules[i].id );
switch( data.modules[i].status ){
case 1: tt.innerHTML='<img src="/style/assets/bul_gray.png">'; break;
case 2: tt.innerHTML='<img src="/style/assets/bul_green.png">'; break;
case 3: tt.innerHTML='<img src="/style/assets/bul_green_rst.png">'; break;
if( tt != undefined ){
switch( data.modules[i].status ){
case 1: tt.innerHTML='<img src="/style/assets/bul_gray.png">'; break;
case 2: tt.innerHTML='<img src="/style/assets/bul_green.png">'; break;
case 3: tt.innerHTML='<img src="/style/assets/bul_green_rst.png">'; break;
};
};
};
};
};
if( data.scada != undefined ){
var tt = document.getElementById('scada_status');
switch( data.scada.status ){
case 0:{
tt.innerHTML='<?=$Labels->GetLabel('_NOT_ASSIGNED_');?>';
tt.setAttribute('class', 'mon_scada_status_tag_na');
tt = document.getElementById('scada_a');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_b');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_c');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_d');
tt.setAttribute('class', 'mon_scada_head');
break;
};
case 1:{
tt.innerHTML='<?=$Labels->GetLabel('__DISABLED__');?>';
tt.setAttribute('class', 'mon_scada_status_tag_na');
tt = document.getElementById('scada_a');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_b');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_c');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_d');
tt.setAttribute('class', 'mon_scada_head');
break;
};
case 2:{//offline
tt.innerHTML='<?=$Labels->GetLabel('__OFFLINE__');?>';
tt.setAttribute('class', 'mon_scada_status_tag_na');
tt = document.getElementById('scada_a');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_b');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_c');
tt.setAttribute('class', 'mon_scada_head');
tt = document.getElementById('scada_d');
tt.setAttribute('class', 'mon_scada_head');
break;
};
case 3:{//online
tt.innerHTML='<?=$Labels->GetLabel('__ONLINE__');?>';
tt.setAttribute('class', 'mon_scada_status_tag_ok');
tt = document.getElementById('scada_a');
if( data.scada.A ){
tt.setAttribute('class', 'mon_scada_head_active');
} else {
tt.setAttribute('class', 'mon_scada_head_ok');
};
tt = document.getElementById('scada_b');
if( data.scada.B ){
tt.setAttribute('class', 'mon_scada_head_active');
} else {
tt.setAttribute('class', 'mon_scada_head_ok');
};
tt = document.getElementById('scada_c');
if( data.scada.C ){
tt.setAttribute('class', 'mon_scada_head_active');
} else {
tt.setAttribute('class', 'mon_scada_head_ok');
};
tt = document.getElementById('scada_d');
if( data.scada.D ){
tt.setAttribute('class', 'mon_scada_head_active');
} else {
tt.setAttribute('class', 'mon_scada_head_ok');
};
break;
};
};
};
if( data.events != undefined ){
var sid = data.events.length - 1;
if( sid > -1 ){
for( var i=0; i< max_grad_levels; i++ ){
var cid = sid-i;
var csize = getSize( i );
//debugger;
if( typeof mSvgElements[i] === 'undefined') {
if( cid > -1 ){
var svgns = "http://www.w3.org/2000/svg";
mSvgElements[i] = document.createElementNS(svgns, 'rect');
mSvgElements[i].setAttribute('x', data.events[cid].x+'%');
mSvgElements[i].setAttribute('y', ''+(50+(100-csize)/2) );
mSvgElements[i].setAttribute('height', ''+csize);
mSvgElements[i].setAttribute('width', ''+csize);
mSvgElements[i].setAttribute('fill', '#FF0000'+getTransperecy(i));
var tt = document.getElementById('svgTrackMap');
var zz = document.getElementById('scheme_anch');
tt.insertBefore( mSvgElements[i], zz );
//document.getElementById('svgTrackMap').appendChild(this.mSvgElements[i]);
};
} else {
if( cid > -1 ){
mSvgElements[i].setAttribute('x', data.events[cid].x+'%');
mSvgElements[i].setAttribute('y', ''+(50+(100-csize)/2) );
mSvgElements[i].setAttribute('height', ''+csize);
mSvgElements[i].setAttribute('width', ''+csize);
mSvgElements[i].setAttribute('fill', '#FF0000'+getTransperecy(i) );
} else {
mSvgElements[i].setAttribute('fill', '#FF000000');
};
};
};
} else
for( var i=0; i< max_grad_levels; i++ )
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000');
};
if( data.scada != undefined ){
@ -787,33 +949,39 @@ function fetchStatus(){
};
case 3:{
if( data.active_session_id != undefined ){
if( mon_selectedEventId != data.active_session_id ){
mon_selectedEventId = data.active_session_id;
for( var zz=0; zz< activeEvents.length; zz++ ){
var tP = document.getElementById('event_tag_'+activeEvents[zz].id );
if( tP != undefined ){
tP.className ='';
if( activeEvents[zz].id == mon_selectedEventId ){
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
if( data.active_session_id > 0 ){
if( mon_selectedEventId != data.active_session_id ){
mon_selectedEventId = data.active_session_id;
for( var zz=0; zz< activeEvents.length; zz++ ){
var tP = document.getElementById('event_tag_'+activeEvents[zz].id );
if( tP != undefined ){
tP.className ='';
if( activeEvents[zz].id == mon_selectedEventId ){
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
};
};
};
addSetSessionUI( mon_selectedEventId );
};
addSetSessionUI( mon_selectedEventId );
};
};
if( data.modules != undefined ){
for( var i=0; i< data.modules.length; i++){
if( data.modules[i].status > 0 ){
var tt = document.getElementById('plat_video_img_'+data.modules[i].id );
if( tt.src != data.modules[i].img ) tt.src = data.modules[i].img;
tt = document.getElementById('plat_status_'+mon_selectedPlatform+'_'+data.modules[i].id );
var tt = document.getElementById('cam_ctrl_'+data.modules[i].id );
if( data.modules[i].status > 1 ) {
if( tt.style.display != 'block' )tt.style.display = 'block';
} else {
if( tt.style.display != 'none' )tt.style.display = 'none';
if( tt != undefined ){
if( tt.src != data.modules[i].img ) tt.src = data.modules[i].img;
};
//tt = document.getElementById('plat_status_'+mon_selectedPlatform+'_'+data.modules[i].id );
tt = document.getElementById('cam_ctrl_'+data.modules[i].id );
if( tt != undefined ){
if( data.modules[i].status > 1 ) {
if( tt.style.display != 'block' )tt.style.display = 'block';
} else {
if( tt.style.display != 'none' )tt.style.display = 'none';
};
};
};
};

64
lib/javascript/jsapi_dynamic/argus_reports.js

@ -1297,9 +1297,14 @@ class argusSessionPlayer{
mSesPlay.mMapID = document.getElementById( 'plat_map_'+data.track_id );
//debugger;
if( data.data_ok ){
mSesPlay.rVideoJS_id = 'video_player_'+data.r_module_id;
mSesPlay.rVideoJS = videojs( mSesPlay.rVideoJS_id );
//mSesPlay.rVideoJS.poster( window.location.origin + '/style/assets/no-signal_h.png' );
if( data.r_module_id ){
mSesPlay.rVideoJS_id = 'video_player_'+data.r_module_id;
mSesPlay.rVideoJS = videojs( mSesPlay.rVideoJS_id );
//mSesPlay.rVideoJS.poster( window.location.origin + '/style/assets/no-signal_h.png' );
mSesPlay.rVideoJS.on("click", function(){ mSesPlay.play(); });
mSesPlay.rVideoJS.on("dblclick", function(){ fullScreen( mSesPlay.rVideoJS_id );});
};
mSesPlay.startTime = data.start_ts;
mSesPlay.endTime = data.start_ts + data.length;
mSesPlay.basePath = window.location.origin + data.basepath +'/';
@ -1313,7 +1318,7 @@ class argusSessionPlayer{
var tt = Ext.getCmp('hpl_slider');
tt.setMinValue( 0 );
tt.setMaxValue( data.length / 1000 );
drawEventsOnSlider( mSesPlay.startTime/1000, mSesPlay.endTime/1000, data.events );
//player.on('ended', function() {
// this.dispose();
//});
@ -1327,26 +1332,33 @@ class argusSessionPlayer{
//mSesPlay.rVideoJS.on("timeupdate", function(){
// method will be calledd each 250 msecs
//});
mSesPlay.lVideoJS_id = 'video_player_'+data.l_module_id;
mSesPlay.lVideoJS = videojs( mSesPlay.lVideoJS_id );
//mSesPlay.lVideoJS.poster( window.location.origin + '/style/assets/no-signal_h.png' );
//mSesPlay.lVideoJS.src({type: 'video/mp4', src: window.location.origin + data.basepath +'/'+data.videos[0].name });
//mSesPlay.lVideoJS.ready(function() {
//mSesPlay.rVideoJS.play();
//var howLoudIsIt = player.volume();
// mSesPlay.lVideoJS.volume( 0.0 ); // Set volume to half
//});
mSesPlay.lVideoJS.on("click", function(){ mSesPlay.play(); });
mSesPlay.lVideoJS.on("dblclick", function(){ fullScreen( mSesPlay.lVideoJS_id );});
if( data.l_module_id ){
mSesPlay.lVideoJS_id = 'video_player_'+data.l_module_id;
mSesPlay.lVideoJS = videojs( mSesPlay.lVideoJS_id );
//mSesPlay.lVideoJS.poster( window.location.origin + '/style/assets/no-signal_h.png' );
//mSesPlay.lVideoJS.src({type: 'video/mp4', src: window.location.origin + data.basepath +'/'+data.videos[0].name });
//mSesPlay.lVideoJS.ready(function() {
//mSesPlay.rVideoJS.play();
//var howLoudIsIt = player.volume();
// mSesPlay.lVideoJS.volume( 0.0 ); // Set volume to half
//});
mSesPlay.lVideoJS.on("click", function(){ mSesPlay.play(); });
mSesPlay.lVideoJS.on("dblclick", function(){ fullScreen( mSesPlay.lVideoJS_id );});
};
mSesPlay.rVideoJS.on("click", function(){ mSesPlay.play(); });
mSesPlay.rVideoJS.on("dblclick", function(){ fullScreen( mSesPlay.rVideoJS_id );});
//mSesPlay.lVideoJS.on("timeupdate", function(){
// // method will be calledd each 250 msecs
//});
drawEventsOnSlider( mSesPlay.startTime/1000, mSesPlay.endTime/1000, data.events );
mSesPlay.setPosition( 0 );
};
} else {
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_SESSION_DATA_');?>',
msg: '<?=$Labels->GetLabel('_SESS_DATA_NOTF_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
};
},
failure: failureAJAXFunction
@ -1357,8 +1369,9 @@ class argusSessionPlayer{
if( this.currentTime == 0 ) this.currentTime = this.startTime;
var zz = document.getElementById('hpl_time_mon');
//debugger;
zz.innerHTML = ts2dts( this.currentTime );
if( zz != undefined ){
zz.innerHTML = ts2dts( this.currentTime );
};
//Check videos
if( this.rVideos.length ){
var fid = -1;
@ -1444,10 +1457,11 @@ class argusSessionPlayer{
if( typeof this.mSvgElements[i] !== 'undefined') this.mSvgElements[i].setAttribute('fill', '#FF000000');
};
var tt = Ext.getCmp('hpl_slider');
tt.suspendEvents();
tt.setValue( ( this.currentTime - this.startTime ) / 1000, true );
tt.resumeEvents();
if( tt!= undefined ){
tt.suspendEvents();
tt.setValue( ( this.currentTime - this.startTime ) / 1000, true );
tt.resumeEvents();
};
this.currentTime += 250;
if( this.currentTime > this.endTime ) if( this.mLooping ){
this.currentTime = 0;

1191
lib/javascript/jsapi_dynamic/argus_settings.js
File diff suppressed because it is too large
View File

346
lib/javascript/jsapi_dynamic/loaders.html

@ -1,346 +0,0 @@
<!-- Loader1 -->
<svg version="1.1" id="L1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<circle fill="none" stroke="#fff" stroke-width="6" stroke-miterlimit="15" stroke-dasharray="14.2472,14.2472" cx="50" cy="50" r="47" >
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="5s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</circle>
<circle fill="none" stroke="#fff" stroke-width="1" stroke-miterlimit="10" stroke-dasharray="10,10" cx="50" cy="50" r="39">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="5s"
from="0 50 50"
to="-360 50 50"
repeatCount="indefinite" />
</circle>
<g fill="#fff">
<rect x="30" y="35" width="5" height="30">
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 5 ; 0 -5; 0 5"
repeatCount="indefinite"
begin="0.1"/>
</rect>
<rect x="40" y="35" width="5" height="30" >
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 5 ; 0 -5; 0 5"
repeatCount="indefinite"
begin="0.2"/>
</rect>
<rect x="50" y="35" width="5" height="30" >
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 5 ; 0 -5; 0 5"
repeatCount="indefinite"
begin="0.3"/>
</rect>
<rect x="60" y="35" width="5" height="30" >
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 5 ; 0 -5; 0 5"
repeatCount="indefinite"
begin="0.4"/>
</rect>
<rect x="70" y="35" width="5" height="30" >
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 5 ; 0 -5; 0 5"
repeatCount="indefinite"
begin="0.5"/>
</rect>
</g>
</svg>
<!-- Loader 2 -->
<svg version="1.1" id="L2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<circle fill="none" stroke="#fff" stroke-width="4" stroke-miterlimit="10" cx="50" cy="50" r="48"/>
<line fill="none" stroke-linecap="round" stroke="#fff" stroke-width="4" stroke-miterlimit="10" x1="50" y1="50" x2="85" y2="50.5">
<animateTransform
attributeName="transform"
dur="2s"
type="rotate"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</line>
<line fill="none" stroke-linecap="round" stroke="#fff" stroke-width="4" stroke-miterlimit="10" x1="50" y1="50" x2="49.5" y2="74">
<animateTransform
attributeName="transform"
dur="15s"
type="rotate"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</line>
</svg>
<!-- Loader 3 -->
<svg version="1.1" id="L3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
<circle fill="none" stroke="#fff" stroke-width="4" cx="50" cy="50" r="44" style="opacity:0.5;"/>
<circle fill="#fff" stroke="#e74c3c" stroke-width="3" cx="8" cy="54" r="6" >
<animateTransform
attributeName="transform"
dur="2s"
type="rotate"
from="0 50 48"
to="360 50 52"
repeatCount="indefinite" />
</circle>
</svg>
<!-- Loader 4 -->
<svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
<circle fill="#fff" stroke="none" cx="6" cy="50" r="6">
<animate
attributeName="opacity"
dur="1s"
values="0;1;0"
repeatCount="indefinite"
begin="0.1"/>
</circle>
<circle fill="#fff" stroke="none" cx="26" cy="50" r="6">
<animate
attributeName="opacity"
dur="1s"
values="0;1;0"
repeatCount="indefinite"
begin="0.2"/>
</circle>
<circle fill="#fff" stroke="none" cx="46" cy="50" r="6">
<animate
attributeName="opacity"
dur="1s"
values="0;1;0"
repeatCount="indefinite"
begin="0.3"/>
</circle>
</svg>
<!-- Loader 5 -->
<svg version="1.1" id="L5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
<circle fill="#fff" stroke="none" cx="6" cy="50" r="6">
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 15 ; 0 -15; 0 15"
repeatCount="indefinite"
begin="0.1"/>
</circle>
<circle fill="#fff" stroke="none" cx="30" cy="50" r="6">
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 10 ; 0 -10; 0 10"
repeatCount="indefinite"
begin="0.2"/>
</circle>
<circle fill="#fff" stroke="none" cx="54" cy="50" r="6">
<animateTransform
attributeName="transform"
dur="1s"
type="translate"
values="0 5 ; 0 -5; 0 5"
repeatCount="indefinite"
begin="0.3"/>
</circle>
</svg>
<!-- Loader 6 -->
<svg version="1.1" id="L6" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<rect fill="none" stroke="#fff" stroke-width="4" x="25" y="25" width="50" height="50">
<animateTransform
attributeName="transform"
dur="0.5s"
from="0 50 50"
to="180 50 50"
type="rotate"
id="strokeBox"
attributeType="XML"
begin="rectBox.end"/>
</rect>
<rect x="27" y="27" fill="#fff" width="46" height="50">
<animate
attributeName="height"
dur="1.3s"
attributeType="XML"
from="50"
to="0"
id="rectBox"
fill="freeze"
begin="0s;strokeBox.end"/>
</rect>
</svg>
<!-- Loader 7 -->
<svg version="1.1" id="L7" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<path fill="#fff" d="M31.6,3.5C5.9,13.6-6.6,42.7,3.5,68.4c10.1,25.7,39.2,38.3,64.9,28.1l-3.1-7.9c-21.3,8.4-45.4-2-53.8-23.3
c-8.4-21.3,2-45.4,23.3-53.8L31.6,3.5z">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="2s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</path>
<path fill="#fff" d="M42.3,39.6c5.7-4.3,13.9-3.1,18.1,2.7c4.3,5.7,3.1,13.9-2.7,18.1l4.1,5.5c8.8-6.5,10.6-19,4.1-27.7
c-6.5-8.8-19-10.6-27.7-4.1L42.3,39.6z">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="1s"
from="0 50 50"
to="-360 50 50"
repeatCount="indefinite" />
</path>
<path fill="#fff" d="M82,35.7C74.1,18,53.4,10.1,35.7,18S10.1,46.6,18,64.3l7.6-3.4c-6-13.5,0-29.3,13.5-35.3s29.3,0,35.3,13.5
L82,35.7z">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="2s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</path>
</svg>
<!-- Loader 8 -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<rect fill="#fff" width="3" height="100" transform="translate(0) rotate(180 3 50)">
<animate
attributeName="height"
attributeType="XML"
dur="1s"
values="30; 100; 30"
repeatCount="indefinite"/>
</rect>
<rect x="17" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 20 50)">
<animate
attributeName="height"
attributeType="XML"
dur="1s"
values="30; 100; 30"
repeatCount="indefinite"
begin="0.1s"/>
</rect>
<rect x="40" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 40 50)">
<animate
attributeName="height"
attributeType="XML"
dur="1s"
values="30; 100; 30"
repeatCount="indefinite"
begin="0.3s"/>
</rect>
<rect x="60" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 58 50)">
<animate
attributeName="height"
attributeType="XML"
dur="1s"
values="30; 100; 30"
repeatCount="indefinite"
begin="0.5s"/>
</rect>
<rect x="80" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 76 50)">
<animate
attributeName="height"
attributeType="XML"
dur="1s"
values="30; 100; 30"
repeatCount="indefinite"
begin="0.1s"/>
</rect>
</svg>
<!-- Loader 9 -->
<svg version="1.1" id="L9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
<rect x="20" y="50" width="4" height="10" fill="#fff">
<animateTransform attributeType="xml"
attributeName="transform" type="translate"
values="0 0; 0 20; 0 0"
begin="0" dur="0.6s" repeatCount="indefinite" />
</rect>
<rect x="30" y="50" width="4" height="10" fill="#fff">
<animateTransform attributeType="xml"
attributeName="transform" type="translate"
values="0 0; 0 20; 0 0"
begin="0.2s" dur="0.6s" repeatCount="indefinite" />
</rect>
<rect x="40" y="50" width="4" height="10" fill="#fff">
<animateTransform attributeType="xml"
attributeName="transform" type="translate"
values="0 0; 0 20; 0 0"
begin="0.4s" dur="0.6s" repeatCount="indefinite" />
</rect>
</svg>
<!-- Loader 10 -->
<svg version="1.1" id="L9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
<path fill="#fff" d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
dur="1s"
from="0 50 50"
to="360 50 50"
repeatCount="indefinite" />
</path>
</svg>
<!-- follow me template -->
<div class="made-with-love">
Made with
<i>?</i> by
<a target="_blank" href="https://codepen.io/nikhil8krishnan">Nikhil Krishnan</a>
</div>

993
lib/javascript/jsapi_dynamic/mastbaum.js

@ -1,993 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
function getWidth() {
return Math.max(
document.body.scrollWidth,
document.documentElement.scrollWidth,
document.body.offsetWidth,
document.documentElement.offsetWidth,
document.documentElement.clientWidth
);
}
function getHeight() {
return Math.max(
document.body.scrollHeight,
document.documentElement.scrollHeight,
document.body.offsetHeight,
document.documentElement.offsetHeight,
document.documentElement.clientHeight
);
}
function trace( message ){
//if( console ){
console.log( message );
//};
}
//https://www.pornhub.com/view_video.php?viewkey=ph5a8a095f04fc7
function makeFullScreen() {
var divObj = document.getElementById("theImage");
//Use the specification method before using prefixed versions
if (divObj.requestFullscreen) {
divObj.requestFullscreen();
} else if (divObj.msRequestFullscreen) {
divObj.msRequestFullscreen();
} else if (divObj.mozRequestFullScreen) {
divObj.mozRequestFullScreen();
} else if (divObj.webkitRequestFullscreen) {
divObj.webkitRequestFullscreen();
} else {
console.log("Fullscreen API is not supported");
};
}
var ScreanWidth = getWidth();
trace('Width: ' + getWidth() );
trace('Height: ' + getHeight() );
var panelWidth = ScreanWidth*0.9;
var iW = <?=getPictureWidth();?>;
var iH = <?=getPictureHeight();?>;
var imgWidth = panelWidth - 16;
var imgHeight = ( imgWidth / iW ) * iH;
var GEWindow = null;
var VCWindow = null;
var DCWindow = null;
var DBWindow = null;
var BG_Array = null;
var VideoWindow = null;
var VideoPlayer = null;
var VideoIsPlaying = false;
var VideoIsLooped = false;
var VideoFlash = null;
//https://www.w3schools.com/graphics/canvas_drawing.asp
var updateInterval;
var lastId = -1;
var DetectorEnabled = false;
var SelectedEvent = null;
var VideoPosInterval = null;
var Settings_SST = 1212;
var Settings_OFFSET = 1212;
var Settings_MAXRANGE = 1212;
var Settings_L2L = 1212;
var Settings_MINSPEED = 1212;
var EvtGroupRecord = Ext.data.Record.create([
'id',
'ts',
'type',
'cnt',
'has_image',
'video'
]);
var EvtListRecord = Ext.data.Record.create([
'id',
'ts',
'type',
'range',
'speed',
'f_lrf',
's_lrf'
]);
var EvtListDataStore = new Ext.data.Store({
reader: new Ext.data.JsonReader({
// The metadata property, with configuration options:
//totalProperty: "results", // the property which contains the total dataset size (optional)
root: "rows", // the property which contains an Array of row objects
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
},
EvtListRecord // Ext.data.Record constructor that provides mapping for JSON object
)
});
var EvtGroupDataStore = new Ext.data.Store({
reader: new Ext.data.JsonReader({
// The metadata property, with configuration options:
//totalProperty: "results", // the property which contains the total dataset size (optional)
root: "rows", // the property which contains an Array of row objects
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
},
EvtGroupRecord // Ext.data.Record constructor that provides mapping for JSON object
)
});
function smooth(ctx, points){
if(points == undefined || points.length == 0)
{
return true;
}
if(points.length == 1)
{
ctx.moveTo(points[0].x, points[0].y);
ctx.lineTo(points[0].x, points[0].y);
return true;
}
if(points.length == 2)
{
ctx.moveTo(points[0].x, points[0].y);
ctx.lineTo(points[1].x, points[1].y);
return true;
}
ctx.moveTo(points[0].x, points[0].y);
for (var i = 1; i < points.length - 2; i ++)
{
var xc = (points[i].x + points[i + 1].x) / 2;
var yc = (points[i].y + points[i + 1].y) / 2;
ctx.quadraticCurveTo(points[i].x, points[i].y, xc, yc);
}
ctx.quadraticCurveTo(points[i].x, points[i].y, points[i+1].x, points[i+1].y);
}
function drawCurve(points, tension) {
ctx.beginPath();
ctx.moveTo(points[0].x, points[0].y);
var t = (tension != null) ? tension : 1;
for (var i = 0; i < points.length - 1; i++) {
var p0 = (i > 0) ? points[i - 1] : points[0];
var p1 = points[i];
var p2 = points[i + 1];
var p3 = (i != points.length - 2) ? points[i + 2] : p2;
var cp1x = p1.x + (p2.x - p0.x) / 6 * t;
var cp1y = p1.y + (p2.y - p0.y) / 6 * t;
var cp2x = p2.x - (p3.x - p1.x) / 6 * t;
var cp2y = p2.y - (p3.y - p1.y) / 6 * t;
ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, p2.x, p2.y);
}
ctx.stroke();
}
function clearLiveBip(){
var canvas = document.getElementById("StatusCanvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(5, 5, 10, 10);
}
function drawStatus(){
var canvas = document.getElementById("StatusCanvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#00FF00";
ctx.fillRect(5, 5, 10, 10);
}
function drawBackgrounds(){
if( !DBWindow ) return;
var canvas = document.getElementById("RangeBGCanvas");
if( canvas ){
var ctx = canvas.getContext("2d");
var x = canvas.width;
var y = canvas.height;
if( ctx ){
if( !BG_Array ){
// No Data!
ctx.font = "30px Arial";
ctx.fillStyle = "#F0F0F0";
ctx.fillRect(0, 0, x, y);
ctx.strokeStyle = "#E0E0E0";
ctx.lineWidth = 2;
ctx.strokeRect(2, 2, x-4, y-4);
ctx.beginPath();
ctx.moveTo(2, 2);
ctx.lineTo(x-2, y-2);
ctx.moveTo(2, y-2);
ctx.lineTo(x-2, 2);
ctx.stroke();
ctx.fillStyle = "#000000";
ctx.fillText("No DATA!", ( x - ctx.measureText("No DATA!").width )>>> 1, y >>> 1 );
} else {
ctx.fillStyle = "#F0F0F0";
ctx.fillRect(0, 0, x, y);
var grd = ctx.createLinearGradient(0, 0, 0, y-20);
grd.addColorStop(0, "#00FF00");
grd.addColorStop(1, "#0000FF");
ctx.fillStyle = grd;
var bw = ( x - 27 ) / 9;
var mx = y - 20;
ctx.font = "10px Arial";
ctx.strokeStyle = "#000000";
for( i = 0; i < 9; i++ ){
var cy = ( BG_Array[i] * mx ) / 1024;
ctx.fillRect( 13 + i*bw, 10, bw-3, cy );
ctx.strokeText((i+1)+":"+BG_Array[i], 13 + bw / 5 + i*bw, cy >>> 1 );
};
};
};
};
}
function ChangeHandler( me, nv, ov ){
if( nv != ov ){
//alert( 'Changes:' + me.name + ' ' + nv + ' '+ ov );
Ext.Ajax.request({
url: '/lib/controller/setVideoSourceParam.php',
params: {
param: me.name,
oval: ov,
nval: nv
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
//var obj = Ext.decode(response.responseText);
//Ext.fly('some_div').update('Success!');
},
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 showDetectionConfigWindow(){
if( DCWindow == null ){
DCWindow = new Ext.Window({
title: 'Detection Parameters',
width: 600,
height: 220,
closeAction: 'hide',
y: 120,
modal: true,
items:[{
xtype: 'form',
labelAlign: 'right',
labelWidth: 250,
items: [{
xtype: 'numberfield',
id: 'sst_data',
fieldLabel: 'Detection SST',
emptyText: 'No Data'
},{
xtype: 'numberfield',
id: 'offset_data',
fieldLabel: 'Detection Offset',
emptyText: 'No Data'
},{
xtype: 'numberfield',
id: 'max_data',
fieldLabel: 'Maximal Range',
emptyText: 'No Data'
},{
xtype: 'numberfield',
id: 'l2l_data',
fieldLabel: 'Distance beetween Layers',
emptyText: 'No Data',
disabled: true
},{
xtype: 'numberfield',
id: 'minspeed_data',
fieldLabel: 'Minimal Speed',
emptyText: 'No Data',
disabled: true
}],
buttons:[{
text: 'Submit',
tooltip:'Set Detection Settings to Device',
iconCls:'silk-tick',
handler: function(){
Settings_SST = Ext.getCmp('sst_data').getValue();
Settings_OFFSET = Ext.getCmp('offset_data').getValue();
Settings_MAXRANGE = Ext.getCmp('max_data').getValue();
Settings_L2L = Ext.getCmp('l2l_data').getValue();
Settings_MINSPEED = Ext.getCmp('minspeed_data').getValue();
Ext.Ajax.request({
url: '/lib/controller/setDetectorParam.php',
params: {
data_sst: Settings_SST,
data_offset: Settings_OFFSET,
data_maxrange: Settings_MAXRANGE,
data_l2l: Settings_L2L,
data_minspeed: Settings_MINSPEED,
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
//var obj = Ext.decode(response.responseText);
//Ext.fly('some_div').update('Success!');
DCWindow.hide();
},
failure: function( response, opts ) {
DCWindow.hide();
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00221');
}
});
}
},{
text: 'Cancel',
tooltip:'Do Not Change Anything!',
iconCls:'silk-cancel',
handler: function(){
DCWindow.hide();
}
}]
}]
});
};
DCWindow.show();
Ext.getCmp('sst_data').setValue( Settings_SST );
Ext.getCmp('offset_data').setValue( Settings_OFFSET );
Ext.getCmp('max_data').setValue( Settings_MAXRANGE );
Ext.getCmp('l2l_data').setValue( Settings_L2L );
Ext.getCmp('minspeed_data').setValue( Settings_MINSPEED );
};
function showDetectionBackgroundWindow(){
if( DBWindow == null ){
DBWindow = new Ext.Window({
title: 'Detection Background Ranges',
width: 614,
height: 514,
y: 120,
modal: true,
closeAction: 'hide',
html: '<canvas id="RangeBGCanvas" width="600px" height="480px"></canvas>'
});
};
DBWindow.show();
drawBackgrounds();
};
function videoPositionUpdater(){
if(!VideoPlayer) return;
var cPos = VideoPlayer.currentTime;
};
function setVideoToPlay( src ){
if( VideoPlayer != null ){
delete VideoPlayer;
};
if( VideoFlash != null ){
swfobject.removeSWF( "vidflash" );
Ext.getCmp('video-panel').removeAll( true );
Ext.getCmp('video-panel').add({ html:'<div id="divvidflash" style="background: black;"></div>'});
Ext.getCmp('video-panel').update();
};
var att = { data: "/lib/flash/player_flv_html5.swf?4", width: iW, height: iH, id: "vidflash", name: "vidflash"};
var params = { flashvars: "listener=VideoPlayer&src="+src, swliveconnect: "true"};
VideoFlash = swfobject.createSWF( att, params, "divvidflash" );
VideoPlayer = new FlashFLVPlayer( VideoFlash );
// Events
VideoPlayer.addEventListener("loadstart", function(event) {
trace("[event] loadstart");
});
VideoPlayer.addEventListener("load", function(event) {
trace("[event] load");
});
VideoPlayer.addEventListener("play", function(event) {
trace("[event] play");
});
VideoPlayer.addEventListener("ended", function(event) {
if( VideoIsLooped ) VideoPlayer.currentTime = 0;
});
VideoPlayer.addEventListener("pause", function(event) {
trace("[event] pause");
});
VideoPlayer.addEventListener("playing", function(event) {
trace("[event] playing");
});
VideoPlayer.addEventListener("seeked", function(event) {
trace("[event] seeked");
});
VideoPlayer.addEventListener("loadedmetadata", function(event) {
trace("[event] loadedmetadata");
//$('#videoWidth').text(VideoPlayer.videoWidth);
//$('#videoHeight').text(VideoPlayer.videoHeight);
});
VideoPlayer.addEventListener("durationchange", function(event) {
trace("[event] durationchange : " + VideoPlayer.duration);
//$('#duration').text(VideoPlayer.duration);
});
VideoPlayer.addEventListener("timeupdate", function(event) {
trace("[event] timeupdate : " + video.currentTime);
});
VideoPlayer.addEventListener("error", function(event) {
trace("[event] error : " + VideoPlayer.networkState);
});
VideoPlayer.addEventListener("canplay", function(event) {
trace("[event] canplay");
});
VideoPlayer.addEventListener("canplaythrough", function(event) {
trace("[event] canplaythrough");
});
VideoPlayer.addEventListener("volumechange", function(event) {
trace("[event] volumechange : " + VideoPlayer.volume);
});
// VideoPosition
VideoPosInterval = window.setInterval( videoPositionUpdater, 100 );
}
function showVideoConfigWindow(){
if( VCWindow == null ){
VCWindow = new Ext.Window({
title: 'Video Configuration',
width: 500,
height: 600,
y: 120,
modal: true,
closeAction: 'hide',
items: new Ext.TabPanel({
activeTab: 0,
enableTabScroll: true,
autoScroll: true,
items: [
<?php
$CC = getVideoSourcesCount();
if( $CC ){
$DD = array();
//$CC++;
for( $index = 0; $index < $CC; $index++ ){
$ID = getVideoSourceID( $index );
$DD[] = buildExtJSForm( getDeviceCtrl( $ID ), $ID );
};
$KU = implode( ',', $DD );
echo $KU;
};
?>
]
})
});
};
VCWindow.show();
}
function GetEventsLog( gid ){
//clearLiveBip();
Ext.Ajax.request({
url: '/lib/controller/listEvents.php',
success: function( response, opts ){
var obj = Ext.decode( response.responseText );
EvtListDataStore.removeAll();
if( obj.empty != true ){
EvtListDataStore.loadData( obj );
};
},
failure: function( response, opts ){
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00225');
},
headers: {
'author': 'gagua'
},
params: { id: gid }
});
};
function GetGroupedEvents( gid ){
Ext.Ajax.request({
url: '/lib/controller/listEventGroups.php',
success: function( response, opts ){
var obj = Ext.decode( response.responseText );
if( obj.SW_OK ){
Ext.getCmp('rec-test').enable();
Ext.getCmp('lrf-rst').enable();
Ext.getCmp('ena-dis').enable();
if( obj.MODE ) {
DetectorEnabled = true;
Ext.getCmp('ena-dis').setText('Disable Detection');
Ext.getCmp('ena-dis').setIconClass('silk-cancel');
} else {
DetectorEnabled = false;
Ext.getCmp('ena-dis').setText('Enable Detection');
Ext.getCmp('ena-dis').setIconClass('silk-accept');
};
} else {
Ext.getCmp('rec-test').disable();
};
Settings_SST = obj.LRF_SST;
Settings_OFFSET = obj.LRF_OFFSET;
Settings_MAXRANGE = obj.LRF_MAX;
Settings_L2L = obj.LRF_DISTANCE;
Settings_MINSPEED = obj.LRF_SPEED;
BG_Array = obj.LRF_BG;
drawBackgrounds();
drawStatus();
if( obj.empty == true ){
if( lastId != 0 ){
lastId = 0;
EvtGroupDataStore.removeAll();
//EvtListDataStore.sync();
};
} else {
if( lastId != obj.rows[0].id ){
lastId = obj.rows[0].id;
//todo: Optimise to add just new arived items
EvtGroupDataStore.loadData( obj );
//EvtListDataStore.sync();
};
};
},
failure: function( response, opts ){
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00225');
},
headers: {
'author': 'gagua'
},
params: { last_id: lastId }
});
};
function makeAlarm(){
Ext.Ajax.request({
url: '/lib/controller/postAlarm.php',
success: function( response, opts ){
},
failure: function( response, opts ){
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00213');
},
headers: {
'my-header': 'foo'
},
params: { last_id: lastId }
});
}
function resetDetector(){
Ext.Ajax.request({
url: '/lib/controller/resetDetector.php',
success: function( response, opts ){
},
failure: function( response, opts ){
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00213');
},
headers: {
'my-header': 'foo'
},
params: { last_id: lastId }
});
}
function detectionEnable(){
if( DetectorEnabled ){
chucha = '/lib/controller/disableDetector.php';
} else {
chucha = '/lib/controller/enableDetector.php';
};
Ext.Ajax.request({
url: chucha,
success: function( response, opts ){
},
failure: function( response, opts ){
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00213');
},
headers: {
'my-header': 'foo'
},
params: { last_id: lastId }
});
}
function IconRenderer( type ){
switch( type ){
case 255:
return '<img width="16px" src="/style/icons/icons/information.png"/>';
case 251:
return '<img width="16px" src="/style/icons/icons/arrow_refresh.png"/>';
case 250:
return '<img width="16px" src="/style/icons/icons/information.png"/>';
case 0:
return '<img width="16px" src="/style/icons/icons/tick.png"/>';
case 1:
return '<img width="16px" src="/style/icons/icons/house.png"/>';
case 2:
return '<img width="16px" src="/style/icons/icons/house_link.png"/>';
case 3:
return '<img width="16px" src="/style/icons/icons/shield_delete.png"/>';
case 4:
return '<img width="16px" src="/style/icons/icons/shield_add.png"/>';
case 5:
return '<img width="16px" src="/style/icons/icons/asterisk_yellow.png"/>';
case 6:
return '<img width="16px" src="/style/icons/icons/asterisk_orange.png"/>';
case 7:
return '<img width="16px" src="/style/icons/icons/information.png"/>';
case 8:
return '<img width="16px" src="/style/icons/icons/information.png"/>';
default:
return '<img width="16px" src="/style/icons/icons/help.png"/>';
};
};
function TypeRenderer( type ){
switch( type ){
case 255: return 'System Shutted Down';
case 251: return 'Sensor Reset issued by Operator';
case 250: return 'Log Cleared by Operator';
case 0: return 'System Started';
case 1: return 'System Started Disarmed';
case 2: return 'System Started Armed';
case 3: return 'Disarmed by Operator';
case 4: return 'Armed by Operator';
case 5: return 'Alarm';
case 6: return 'Alarm Test by Operator';
case 7: return 'Parameters Changed by Operator';
case 8: return 'Log Cleared by Operator';
default: return 'Unusual Event';
};
};
function LrfRenderer( value, metadata, record, rowIndex, colIndex, store ){
var R = value / 1;
if( R > 0 ){
var RV = '<svg width="120" height="16">';
if( R == 1024 ){
for( i=0; i < 9; i++ ){
RV = RV + '<circle cx="'+( 120 - ( ( i + 1 ) * 12 + 5 ) )+'" cy="8" r="5" stroke="black" stroke-width="2" fill="darkgrey" />';
};
} else {
R--;
for( i=0; i < 9; i++ ){
if( ( R & ( 1 << i ) ) == 0 ){
RV = RV + '<circle cx="'+( 120 - ( ( i + 1 ) * 12 + 5 ) )+'" cy="8" r="5" stroke="green" stroke-width="2" fill="grey" />';
} else {
RV = RV + '<circle cx="'+( 120 - ( ( i + 1 ) * 12 + 5 ) )+'" cy="8" r="5" stroke="red" stroke-width="2" fill="yellow" />';
};
};
};
return RV + '</svg>';
};
return '';
};
function VideoRenderer( value, metadata, record, rowIndex, colIndex, store ){
if( value ){
//return '<a href="#" onclick="ViewVideoPreview(\'' + record.data.video + '\');"><img width="16px" src="/style/icons/icons/film.png" alt="' + record.data.video + '" /></a>';
return '<a href="#" onclick="showEventGroupWindow(\'' + record.data.video + '\','+record.data.id+');"><img width="16px" src="/style/icons/icons/film.png" alt="' + record.data.video + '" /></a>';
};
return '';
};
var EvtGroupColModel = new Ext.grid.ColumnModel([
/*{header: "", width: 38, sortable: false, locked: true, menuDisabled: true, fixed: true, align: 'left', renderer: IconRenderer, dataIndex: 'icon'},
{header: "Device ID", width: 120, sortable: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'device_id'},
{header: "Vehicle ID", width: 120, sortable: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'name'},
{header: "Status", width: 95, sortable: true, align: 'center', css: 'vertical-align: middle;', renderer: DevStatusRenderer, dataIndex: 'status'},
{header: "SMS", width: 36, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: SMSRenderer, dataIndex: 'sms'},
{header: "Active Since", width: 85, sortable: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'created'},
{header: "Last Activity", width: 85, sortable: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'last_access'}*/
{header: "", width: 24, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: IconRenderer, dataIndex: 'type' },
{header: "Time Stamp", width: 160, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('d-m-Y H:i:s'), dataIndex: 'ts' },
{header: "Event Description", width: 200, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: TypeRenderer, dataIndex: 'type' },
{header: "Grouped Events", width: 60, sortable: false, menuDisabled: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'cnt' },
/*{header: "Range", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'range' },
{header: "LVL 0", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 'f_lrf' },
{header: "LVL 1", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 's_lrf' },
{header: "Speed", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'lrf_id' },
*/
{header: "Video", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: VideoRenderer, dataIndex: 'has_image' }
]);
var EvtGroupSelModel = new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
if (!SelectedEvent){
SelectedEvent = rec;
SelectedEvent.sm = sm;
SelectedEvent.rowId = row;
} else {
SelectedEvent = rec;
SelectedEvent.sm = sm;
SelectedEvent.rowId = row;
};
}
}
});
var EvtListColModel = new Ext.grid.ColumnModel([
{header: "", width: 24, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: IconRenderer, dataIndex: 'type' },
{header: "Time Stamp", width: 160, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('d-m-Y H:i:s'), dataIndex: 'ts' },
{header: "Event Description", sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: TypeRenderer, dataIndex: 'type' },
{header: "Range", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'range' },
{header: "LVL 0", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 'f_lrf' },
{header: "LVL 1", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 's_lrf' },
{header: "Speed", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'speed' }
]);
var EvtListSelModel = new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
if (!SelectedEvent){
SelectedEvent = rec;
SelectedEvent.sm = sm;
SelectedEvent.rowId = row;
} else {
SelectedEvent = rec;
SelectedEvent.sm = sm;
SelectedEvent.rowId = row;
};
}
}
});
function showEventGroupWindow( vsrc, gid ){
if( GEWindow == null ){
GEWindow = new Ext.Window({
title: 'Event Viewer',
width: iW+20,
height: iH+300,
modal: true,
y: 120,
resizable: false,
closeAction: 'hide',
items: [{
xtype: 'panel',
id: 'video-panel',
html: '<div id="divvidflash" style="background: black; width: '+iW+'px; height: '+iH+'px;"></div>',
bbar: [{
iconCls: 'silk-start',
handler: function(){
if( VideoPlayer ){
VideoPlayer.currentTime = 0;
};
}
},{
text: 'Play',
iconCls: 'silk-play',
handler: function(){
if( VideoPlayer ){
if( VideoIsPlaying ){
VideoPlayer.pause();
VideoIsPlaying = false;
} else {
VideoPlayer.play();
VideoIsPlaying = true;
};
};
}
},{
iconCls: 'silk-replay',
enableToggle: true,
handler: function(){
if( VideoPlayer ){
VideoIsLooped = !VideoIsLooped;
};
}
}]
},{
xtype: 'grid',
title: 'Events Log',
frame: false,
id: 'grp_grid',
forceFit: true,
ds: EvtListDataStore,
cm: EvtListColModel,
sm: EvtListSelModel,
//autoExpandColumn: 'login',
height: 235,
width: '100%',
border: false,
listeners: {
render: function(g) {
//g.getSelectionModel().selectRow(0);
},
delay: 10 // Allow rows to be rendered.
},
viewConfig: {
forceFit:true
},
}],
listeners: {
beforehide : function(component) {
if( VideoFlash != null ){
if(VideoPosInterval) clearInterval( VideoPosInterval );
VideoPosInterval = null;
swfobject.removeSWF( "vidflash" );
Ext.getCmp('video-panel').removeAll( true );
Ext.getCmp('video-panel').add({ html:'<div id="divvidflash"></div>'});
VideoFlash = null;
VideoIsPlaying = false;
};
}
}
});
};
GEWindow.show();
setVideoToPlay( vsrc );
GetEventsLog( gid );
}
Ext.onReady(function() {
var panel = new Ext.Panel({
renderTo: 'content',
width: panelWidth,
items:[ {
xtype: 'panel',
id: '121',
title:'Video',
frame: true,
html:'<img id="theImage" border=0 src="/cgi-bin/nph-video" width="'+panelWidth+'px" rel="shadowbox" onClick="makeFullScreen();">',
width: imgWidth+12,
height: imgHeight+75,
anchor:'right 50%',
fbar: [{
text: 'Force Alarm',
id: 'rec-test',
disabled: true,
iconCls: 'silk-belladd',
handler: function(){
Ext.Msg.show({
title:'Test Record Frames?',
msg: 'You are about to record 240 frames. Would you like to do so?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function(btn, text){
if( btn == 'yes' ) makeAlarm();
},
animEl: '121',
icon: Ext.MessageBox.QUESTION
});
}
},{
iconCls: 'silk-cog',
text: 'Video Config',
handler: showVideoConfigWindow
}]
},{
title: 'Detector Settings',
xtype: 'form',
layout: 'form',
layoutConfig: {
type: 'hbox',
padding: '5',
align: 'center'
},
//html: '<table width="100%" border=0><tr><td>Offset:</td><td><?=20;?></td><td>Max Distance:</td><td>3.00</td><td>Layer Distance:</td><td>0.5</td></tr></table>',
width: panelWidth,
buttons:[{
xtype: 'panel',
html: '<canvas id="StatusCanvas" width="120px" height="20px"></canvas>'
},{
text: 'Show Detection Backgrounds',
iconCls: 'silk-chart',
handler: showDetectionBackgroundWindow
},{
text: 'Change Detection Settings',
iconCls: 'silk-cog',
handler: showDetectionConfigWindow
},{
text: 'Reset Sensor',
id: 'lrf-rst',
disabled: true,
iconCls: 'silk-arrow-refresh',
handler: function(){
Ext.Msg.show({
title:'Reset Detector?',
msg: 'You are about to reset detector. The system will be blind for 1 second. Would you like to do so?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function(btn, text){
if( btn == 'yes' ) resetDetector();
},
animEl: '121',
icon: Ext.MessageBox.WARNING
});
}
},{
text: 'Enable Detection',
disabled: true,
id: 'ena-dis',
iconCls: 'silk-accept',
handler: detectionEnable
}]
},{
xtype: 'grid',
title: 'Events Log',
frame: true,
id: 'mygrid',
forceFit: true,
ds: EvtGroupDataStore,
cm: EvtGroupColModel,
sm: EvtGroupSelModel,
//autoExpandColumn: 'login',
height: 350,
width: '100%',
border: false,
listeners: {
render: function(g) {
g.getSelectionModel().selectRow(0);
},
delay: 10 // Allow rows to be rendered.
},
viewConfig: {
forceFit:true
},
bbar: [{
tooltip:'Clear Log Messages',
id: 'clrList',
text: 'Clear',
iconCls:'silk-cross',
handler: function(){
Ext.Msg.show({
title:'Clear Log Messages?',
msg: 'You are about to clear log. All data and pictures will be deleted. Would you like to do so?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function(btn, text){
if( btn == 'yes' ){
Ext.Ajax.request({
url: '/lib/controller/clearLOG.php',
success: function( response, opts ){
var obj = Ext.decode( response.responseText );
},
failure: function( response, opts ){
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00215');
},
headers: {
'my-header': 'foo'
},
params: { last_id: lastId }
});
};
},
animEl: 'mygrid',
icon: Ext.MessageBox.WARNING
});
},
disabled: false
}]
}]
});
Ext.ux.SliderTip = Ext.extend(Ext.Tip, {
minWidth: 10,
offsets : [0, -10],
init : function(slider){
slider.on('dragstart', this.onSlide, this);
slider.on('drag', this.onSlide, this);
slider.on('dragend', this.hide, this);
slider.on('destroy', this.destroy, this);
},
onSlide : function(slider){
this.show();
this.body.update(this.getText(slider));
this.doAutoWidth();
this.el.alignTo(slider.thumb, 'b-t?', this.offsets);
},
getText : function(slider){
return String(slider.getValue());
}
});
STip = new Ext.ux.SliderTip({
getText: function(slider){
return String.format('<b>More Than {0} '+SPEED_TYPE+'</b>', slider.getValue());
}
});
Ext.QuickTips.init();
// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'under';
updateInterval = setInterval( GetGroupedEvents, 1000 );
});

1973
lib/javascript/jsapi_dynamic/mojo_dashboard.js
File diff suppressed because it is too large
View File

269
lib/javascript/jsapi_dynamic/mojo_logs.js

@ -1,269 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
var um_selected_log_id = 0;
var um_server_log_store = new Ext.data.JsonStore({
root: 'records',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'type',
type: 'string'
},{
name: 'ts',
type: 'string'
},{
name: 'ptr',
type: 'string'
},{
name: 'module',
type: 'string'
},{
name: 'msg',
type: 'string'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/controller/listServerLog.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
}
})
});
var um_server_log_col_model_opt = {
columns: [
{header: "<?=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel("_POINTER_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'ptr' },
{header: "<?=$Labels->GetLabel("_MODULE_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'module' },
{header: "<?=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'msg' }
],
defaults: {
sortable: false,
menuDisabled: true,
width: 100
}
};
var um_log_sel_model_opt = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
um_selected_log_id = rec.data.id;
}
}
};
var um_access_log_store = new Ext.data.JsonStore({
root: 'records',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'user',
type: 'string'
},{
name: 'ts',
type: 'string'
},{
name: 'cmd',
type: 'int'
},{
name: 'data_line',
type: 'string'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/controller/listAccessLog.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
}
})
});
function um_action_renderer( val ){
switch( val ){
case 1: return "<?=$Labels->GetLabel("_LOGIN_");?>";
case 13: return "<?=$Labels->GetLabel("_ACCESS_DENIED_");?>";
case 145: return "<?=$Labels->GetLabel("_SCREEN_RESIZE_");?>";
};
return "unknown action";
};
var um_access_log_col_model_opt = {
columns: [
{header: "<?=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_USER_");?>",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'user' },
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, renderer: unix_ts_renderer, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel("_ACTION_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: um_action_renderer, dataIndex: 'cmd' },
{header: "<?=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, dataindex: 'data_line' }
],
defaults: {
sortable: false,
menuDisabled: true,
width: 100
}
};
var um_access_log_sel_model_opt = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
um_selected_log_id = rec.data.id;
}
}
};
function loadAccessLog(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_ACC_LOG_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
border: false,
items: [{
xtype: 'panel',
layout: 'fit',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
height: PanelH-5,
flex: 1,
frame: false,
border: false,
items:{
frame: false,
height: PanelH-5,
xtype: 'grid',
forceFit: true,
viewConfig: {
forceFit: true,
getRowClass: function( record, rowIndex, rowParams, store){
switch( record.get('cmd') ){
case 1: return 'row-level01';
case 2: return 'row-level02';
case 3: return 'row-level03';
case 4: return 'row-level04';
case 145: return 'row-level05';
};
return '';
}
},
ds: um_access_log_store,
cm: new Ext.grid.ColumnModel( um_access_log_col_model_opt ),
sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt )
},tbar: [{
xtype: 'button',
id: 'um_access_reload_btn',
text: '<?=$Labels->GetLabel("_RELOAD_");?>',
handler: function(){
um_access_log_store.reload();
}
}]
}]
});
tPanel.doLayout();
um_selected_log_id = 0;
um_access_log_store.reload();
};
function loadServerLog(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_SERV_LOG_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
border: false,
items: [{
xtype: 'panel',
layout: 'fit',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
height: PanelH-5,
flex: 1,
frame: false,
border: false,
items:{
frame: false,
height: PanelH-5,
xtype: 'grid',
forceFit: true,
viewConfig: {
forceFit: true,
getRowClass: function( record, rowIndex, rowParams, store){
switch( record.get('type') ){
case '01': return 'row-level01';
case '02': return 'row-level02';
case '03': return 'row-level03';
case '04': return 'row-level04';
case '05': return 'row-level05';
};
return '';
}
},
ds: um_server_log_store,
cm: new Ext.grid.ColumnModel( um_server_log_col_model_opt ),
sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt )
},tbar: [{
xtype: 'button',
id: 'um_server_reload_btn',
text: '<?=$Labels->GetLabel("_RELOAD_");?>',
handler: function(){
um_server_log_store.reload();
}
},{
xtype: 'button',
id: 'um_server_clean_btn',
text: '<?=$Labels->GetLabel("_CLEAR_");?>',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/clearServerLog.php',
params: {
NID: NID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
um_server_log_store.reload();
}
});
}
}]
}]
});
tPanel.doLayout();
um_selected_log_id = 0;
um_server_log_store.reload();
tlInterval = window.setInterval( um_server_log_store.reload, 333, 0 );
};

2561
lib/javascript/jsapi_dynamic/mojo_map.js
File diff suppressed because it is too large
View File

94
lib/javascript/jsapi_dynamic/mojo_metro.js

@ -1,94 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
function loadMetroControlUpper(){
Ext.Ajax.request({
url: '/lib/controller/getMetroUpperSensorEditor.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var tComp = Ext.getCmp('main_content');
if( data.status == 'ok' ){
if( tComp!= null ){
var content = Ext.decode( data.content );
tComp.removeAll( true );
tComp.add( content );
tComp.doLayout();
};
} else {
if( tComp!= null ){
tComp.removeAll( true );
tComp.add( data );
tComp.doLayout();
};
};
},
failure: function(){
}
});
};
function loadMetroControlBottom(){
Ext.Ajax.request({
url: '/lib/controller/getMetroBottomSensorEditor.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var tComp = Ext.getCmp('main_content');
if( data.status == 'ok' ){
if( tComp!= null ){
var content = Ext.decode( data.content );
tComp.removeAll( true );
tComp.add( content );
tComp.doLayout();
};
} else {
if( tComp!= null ){
tComp.removeAll( true );
tComp.add( data );
tComp.doLayout();
};
};
},
failure: function(){
}
});
};
function loadMetroControlFusion(){
Ext.Ajax.request({
url: '/lib/controller/getMetroFusionEditor.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var tComp = Ext.getCmp('main_content');
if( data.status == 'ok' ){
if( tComp!= null ){
var content = Ext.decode( data.content );
tComp.removeAll( true );
tComp.add( content );
tComp.doLayout();
};
} else {
if( tComp!= null ){
tComp.removeAll( true );
tComp.add( data );
tComp.doLayout();
};
};
},
failure: function(){
}
});
};

1593
lib/javascript/jsapi_dynamic/mojo_reports.js
File diff suppressed because it is too large
View File

1664
lib/javascript/jsapi_dynamic/rgoose_cameras.js
File diff suppressed because it is too large
View File

1299
lib/javascript/jsapi_dynamic/rgoose_dashboard.js
File diff suppressed because it is too large
View File

2515
lib/javascript/jsapi_dynamic/rgoose_devices.js
File diff suppressed because it is too large
View File

2370
lib/javascript/jsapi_dynamic/rgoose_devices_.js
File diff suppressed because it is too large
View File

1255
lib/javascript/jsapi_dynamic/rgoose_location_editor.js
File diff suppressed because it is too large
View File

479
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -1,479 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
function ssShowSS() {
ssStopTimer();
document.removeEventListener( "mousemove", ssResetTimer );
document.removeEventListener( "mousedown", ssResetTimer );
document.removeEventListener( "keypress", ssResetTimer );
document.removeEventListener( "touchmove", ssResetTimer );
document.addEventListener( "mousemove", ssHideSS, false );
document.addEventListener( "mousedown", ssHideSS, false );
document.addEventListener( "keypress", ssHideSS, false );
document.addEventListener( "touchmove", ssHideSS, false );
document.getElementById('ss_bg').className='ss_bg_overlay';
document.getElementById('ss_content').className='ss_overlay';
ssShowTime();
if( ssInterval == null ){
ssInterval = window.setInterval( ssShowTime, 333 );
};
ssIsActive = true;
};
function ssShowTime(){
document.getElementById('ss_content').style.fontSize = '240px';
var currentdate = new Date();
var cTime = (( currentdate.getHours()<10 )? '0'+currentdate.getHours(): currentdate.getHours() ) + ":" + (( currentdate.getMinutes()<10 )? '0'+currentdate.getMinutes(): currentdate.getMinutes() ) + ":" + (( currentdate.getSeconds()<10 )? '0'+currentdate.getSeconds(): currentdate.getSeconds() );
document.getElementById('ss_content').innerHTML= cTime;
};
function ssResetTimer() {
ssStopTimer();
ssStartTimer();
};
function ssStartTimer() {
if( ssTimer == null ){
ssTimer = window.setTimeout( ssShowSS, ssTimeOut );
};
};
function ssStopTimer() {
if( ssTimer ){
window.clearTimeout( ssTimer );
ssTimer = null;
};
};
function ssSetupTimer() {
document.addEventListener( "mousemove", ssResetTimer, false);
document.addEventListener( "mousedown", ssResetTimer, false);
document.addEventListener( "keypress", ssResetTimer, false);
document.addEventListener( "touchmove", ssResetTimer, false);
ssStartTimer();
};
function ssHideSS(){
document.getElementById('ss_bg').className='ss_hidden';
document.getElementById('ss_content').className='ss_hidden';
document.removeEventListener( "mousemove", ssHideSS );
document.removeEventListener( "mousedown", ssHideSS );
document.removeEventListener( "keypress", ssHideSS );
document.removeEventListener( "touchmove", ssHideSS );
if( ssInterval != null ){
window.clearInterval( ssInterval );
ssInterval = null;
};
ssSetupTimer();
ssIsActive = false;
};
var sndBeep = new Howl({
src: [
'/style/assets/audio/beep-07a.mp3',
'/style/assets/audio/beep-07a.wav'
],
loop: false,
volume: 0.99,
onend: function() {
//console.log('Finished!');
}
});
var sndExcl = new Howl({
src: [
'/style/assets/audio/button-42.mp3',
'/style/assets/audio/button-42.wav'
],
loop: false,
volume: 0.99
});
function playSound( t ){
if( SoundEnable ){
switch( t ){
case 1:{
sndBeep.play();
break;
};
default:{
sndExcl.play();
};
};
};
};
function doRefresh(){
window.location="/?t="+123;
};
function doLogout(){
window.location = '/login.php?UID=1';
};
function stopStatusUpdater(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
};
};
function failureAJAXFunction( responce, opts ){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
};
playSound();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
doLogout();
};
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
WID: x,
HEI: y
},
success: function( response, opts ){
doRefresh();
},
failure: failureAJAXFunction
});
};
function setUserContent( c_id ){
initView = c_id;
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 26,
CID: initView
},
failure: failureAJAXFunction
});
};
function updateUserContent(){
cid = content_lvl3 + content_lvl2 * 10 + content_lvl1*100 + content_lvl0*1000;
if( initView != cid ) setUserContent( cid );
};
var gSessionValidatorInterval = null;
function sessionValidator(){
Ext.Ajax.request({
url: '/lib/controller/validateUserSession.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( !data.sessionIsValid ){
playSound();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
doLogout();
};
},
failure: failureAJAXFunction
});
};
function doCheckWindowSize(){
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW2 = window.innerWidth;
winH2 = window.innerHeight;
if ( winH2<700 ) winH2=700;
};
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW2 = document.body.offsetWidth;
winH2 = document.body.offsetHeight;
if ( winH2<700 ) winH2=700;
};
};
if ( winW2 != winW || winH2!=winH ){
updateUserScreenResolution( winW2, winH2 );
};
};
var NotificationStack = null;
function tryKeepScreenAlive(minutes) {
navigator.wakeLock.request("screen").then(lock => {
setTimeout(() => lock.release(), minutes * 60 * 1000);
});
}
function showContent( cid ){
if( cid != initView ) setUserContent( cid );
var lvl0 = Math.floor( initView / 1000 );
var lvl1 = Math.floor( ( initView % 1000 )/ 100 );
var lvl2 = Math.floor( ( initView % 100 )/ 10 );
var lvl3 = initView % 10;
if( lvl3 != content_lvl3 ){ content_lvl3 = lvl3; };
if( lvl2 != content_lvl2 ){ content_lvl2 = lvl2; };
if( lvl1 != content_lvl1 ){ content_lvl1 = lvl1; };
if( lvl0 != content_lvl0 ){
content_lvl0 = lvl0;
switch( lvl0 ){
case 0:{
var tt = Ext.getCmp('tbtn_0');
tt.toggle( true, false );
var tP = Ext.getCmp('left_side_menu');
if( tP.isVisible() ) tP.setVisible( false );
initMonitoring();
Ext.getCmp('main_viewport').doLayout();
break;
};
case 1:{
var tt = Ext.getCmp('tbtn_1');
tt.toggle( true, false );
var tP = Ext.getCmp('left_side_menu');
tP.setVisible( true );
Ext.getCmp('main_viewport').doLayout();
break;
};
case 2:{
var tt = Ext.getCmp('tbtn_2');
tt.toggle( true, false );
var tP = Ext.getCmp('left_side_menu');
if( !tP.isVisible() ) tP.setVisible( true );
var tZ = Ext.getCmp('right_side_menu');
if( tZ.isVisible() ) tZ.setVisible( false );
initSettingsView();
Ext.getCmp('main_viewport').doLayout();
break;
};
};
};
};
Ext.onReady(function(){
if ('wakeLock' in navigator) {
// Screen Wake Lock API supported
tryKeepScreenAlive(10);
};
doCheckWindowSize();
gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
//window.onresize = doCheckWindowSize;
Ext.QuickTips.init();
if( ssEnabled ){
ssSetupTimer();
$(window).focus(function() {
ssResetTimer();
});
$(window).blur(function() {
ssStopTimer();
});
};
var viewport = new Ext.Viewport({
id: 'main_viewport',
layout:'border',
frame: false,
border: false,
items: [{
xtype: 'panel',
region: 'north',
baseCls: 'x-plain',
height: 60,
//layout: 'fit',
layout: 'hbox',
frame: false,
border: false,
items:[{
xtype: 'panel',
width: '100%',
layout: 'table',
baseCls: 'x-plain',
layoutConfig: {
columns: 11
},
frame: false,
border: true,
margins: {top:10, right:10, bottom:10, left:10},
items:[{
xtype: 'panel',
baseCls: 'x-plain',
frame: false,
border: false,
margins: {top:5, right:20, bottom:0, left:20},
html: '<img src="/style/assets/argus_logo_text.png" height="42px">'
},{
xtype: 'spacer',
width: 10
},{
xtype: 'button',
text: '<?=$Labels->GetLabel('_MONITORING_');?>',
id: 'tbtn_0',
iconCls: 'mon',
scale: 'large',
enableToggle: true,
//pressed: (Math.floor(initView/100)==0),
allowDepress: false,
toggleGroup: 'gopa_gopa',
toggleHandler: function( bt, state ){
if( state ) showContent( 0 );
}
},{
xtype: 'spacer',
width: 10
},{
xtype: 'button',
text: '<?=$Labels->GetLabel('_REPO_HISTORY_');?>',
id: 'tbtn_1',
iconCls: 'rep',
scale: 'large',
enableToggle: true,
//pressed: (Math.floor(initView/100)==1),
allowDepress: false,
toggleGroup: 'gopa_gopa',
toggleHandler: function( bt, state ){
if( state ) {
content_lvl0 = 2000;
updateUserContent();
};
}
},{
xtype: 'spacer',
width: 10
},{
xtype: 'button',
text: '<?=$Labels->GetLabel('_SETTINGS_');?>',
id: 'tbtn_2',
iconCls: 'cog',
scale: 'large',
enableToggle: true,
allowDepress: false,
toggleGroup: 'gopa_gopa',
toggleHandler: function( bt, state ){
if( state ) showContent( 2000 );
}
},{
xtype: 'spacer',
width: 10
},{
xtype: 'panel',
baseCls: 'x-plain',
frame: false,
border: false,
margins: {top:5, right:0, bottom:0, left:0},
width: PanelW-700,
html: '<p style="font-family: \'Ubuntu\';font-size: 24px;">'+ap_title+'</p>'
},{
xtype: 'spacer',
width: 10
},<?php
if( $AP_DATA['type'] == 1 ){
?>{
xtype: 'button',
id: 'logout_btn',
text: 'Logout',
iconCls: 'lout',
scale: 'large',
style:'text-align: right;',
handler: doLogout
}<?php
} else {
?>{
xtype: 'button',
id: 'snd_mode_btn',
text: 'Sound',
iconCls: 'snd'+SoundMode,
scale: 'large',
style:'text-align: right;',
handler: function(){
if( SoundMode == 0 ){
SoundMode = 3;
} else {
SoundMode --;
};
Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode );
}
}<?php
};
?>
]
}]
},{
xtype: 'panel',
id:'left_side_menu',
region:'west',
bsaseCls:'x-plain',
//title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
collapsible: true,
split:true,
width:180,
minWidth: 180,
maxWidth: 180,
hidden: (Math.floor(initView/100)==0),
layout:'accordion',
margins: '5 0 5 5',
cmargins:'5 5 5 5',
layoutConfig:{
animate: true//,
//activeOnTop: true
},
items: []
},{
xtype: 'panel',
region:'center',
margins: '5 5 5 0',
id: 'main_content',
//title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
items:[{
xtype: 'portal',
id: 'main_portal',
frame: false,
border: false,
items:{
html: ''
}//,
//listeners:{
// drop: function( a ){
// updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
// }
//}
}]
},{
xtype: 'panel',
region:'east',
id:'right_side_menu',
//title: '',
margins: '5 5 5 0',
//id: 'help_content',
frame: false,
border: false,
collapsible: false,
split:true,
width:200,
minWidth: 150,
maxWidth: 200,
items:[]
}]
});
showContent( initView );
});

0
lib/javascript/jsapi_dynamic/rgoose_map.js

575
lib/javascript/jsapi_dynamic/rgoose_modules.js

@ -1,575 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
var addMediaServerDialog = null;
function addMediaServer(){
if( addMediaServerDialog == null ){
addMediaServerDialog = new Ext.Window({
modal: true,
title: '<?=$Labels->GetLabel("_ADD_MEDIA_SERVER_");?>',
width: 800,
height: 600,
layout: 'fit',
closeAction: 'hide',
items:{
xtype: 'panel',
html: 'KOKO'
},bbar: [{
text: '<?=$Labels->GetLabel("_CANCEL_");?>',
handler: function(){
addMediaServerDialog.hide();
}
},{
id: 'con_to_src',
text: '<?=$Labels->GetLabel("_ADD_");?>',
disabled: false,
handler: connectToSeleced
}]
});
};
addMediaServerDialog.show();
};
var embedVideoEncoderId = 0;
function updateFramePreview(){
var canvas = document.getElementById("eve_frame_preview");
if( canvas != null ){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.fillStyle = "#eeeeee";
ctx.rect( 0, 0, 760, 400 );
ctx.fill();
ctx.closePath();
var f_w = 320;
var f_h = 240;
var f_p = 0;
var fsid = Ext.getCmp('FRM_SIZE').getValue();
switch( fsid ){
case 1: f_w = 640; f_h = 480; f_p = 0; break;
case 2: f_w = 800; f_h = 600; f_p = 0; break;
case 3: f_w = 1280; f_h = 720; f_p = 1; break;
case 4: f_w = 1024; f_h = 768; f_p = 0; break;
case 5: f_w = 1920; f_h = 1080; f_p = 1; break;
};
ctx.beginPath();
ctx.fillStyle = "#000000";
ctx.font = "20px Arial";
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.fillText( f_w+'x'+f_h, 380, 10 );
ctx.fill();
ctx.fillStyle = "#0000FF";
if( f_p ){
var t_w = 16 * ( 360 / 9 );
ctx.rect( (760-t_w)/2, 20, t_w, 360 );
} else {
var t_w = 4 * ( 360 / 3 );
ctx.rect( (760-t_w)/2, 20, t_w, 360 );
};
ctx.fill();
ctx.closePath();
if( Ext.getCmp('eve_show_logo').getValue() ){
var image = document.getElementById('eve_logo_img');
if( image.complete && image.naturalHeight !== 0 ){
var i_w = Ext.getCmp('LOGO_WIDTH').getValue();
var i_h = Ext.getCmp('LOGO_HEIGHT').getValue();
ctx.drawImage( image, 120, 120, i_w, i_h );
};
};
};
};
async function uploadFile() {
let formData = new FormData();
formData.append("file", fileupload.files[0]);
await fetch( '/upload.php', {
method: "POST",
body: formData
});
alert('The file has been uploaded successfully.');
}
function uploadEveLogo(){
if( embedVideoEncoderId > -1 ){
var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."});
llMask.show();
var formData = new FormData();
var img_upload = document.getElementById('eve_logo_upload');
formData.append("file", img_upload.files[0]);
formData.append("type", 'eve_logo');
formData.append("id", embedVideoEncoderId );
$.ajax({
type: 'POST',
url: '/lib/controller/uploadAsset.php',
data: formData,
cache: false,
contentType: false,
processData: false,
success: function( data ){
llMask.hide();
console.log("success");
console.log( data );
},
error: function( data ){
llMask.hide();
console.log("error");
console.log(data);
}
});
/*
Ext.Ajax.request({
url: SITE_URL+'upload/',
headers: {'Content-type':'multipart/form-data'},
form: filefield.up('form').getForm(),
isUpload: true,
success: function(response, options) { console.log(arguments); },
failure: function(response, options) { console.log(arguments); }
});
*/
};
};
var moduleSettingsEditorWindow = null;
function showModuleSettingsEditor( ModuleID ){
if( moduleSettingsEditorWindow == null ){
moduleSettingsEditorWindow = new Ext.Window({
modal: true,
id: 'mo_se_ed_wi',
title: '',
width: 792,
height: 700,
layout: 'fit',
closeAction: 'hide',
resizable: false,
items:[],
buttons: [{
text: "<?=$Labels->GetLabel('_CANCEL_');?>",
handler: function(){
moduleSettingsEditorWindow.hide();
}
},{
id: 'con_to_src',
text: "<?=$Labels->GetLabel('_OK_');?>",
disabled: false,
handler: function(){
Ext.getCmp('mod_set_content').saveSettings();
}
}]
});
};
moduleSettingsEditorWindow.show();
Ext.Ajax.request({
url: '/lib/controller/getModuleSettings.php',
params: {
MID: ModuleID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
if( data.status = 'ok' ){
moduleSettingsEditorWindow.setTitle( data.wTitle );
moduleSettingsEditorWindow.removeAll( true );
moduleSettingsEditorWindow.add( data );
moduleSettingsEditorWindow.doLayout();
} else {
moduleSettingsEditorWindow.close();
moduleSettingsEditorWindow = null;
Ext.Msg.show({
title: "<?=$Labels->GetLabel('_ERROR_MSG_');?>",
msg: data.msg,
buttons: Ext.Msg.OK,
fn: function(){
//SettingsLidar3D.hide();
},
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
};
/*
function embedVideoEncoderSettings( ModuleID ){
if( embedVideoEncoderSettingsWindow == null ){
embedVideoEncoderSettingsWindow = new Ext.Window({
modal: true,
title: '<?=$Labels->GetLabel('_EMBED_VIDEO_ENCODER_');?>',
width: 792,
height: 700,
layout: 'fit',
closeAction: 'hide',
resizable: false,
items:[{
layout: 'table',
border: false,
frame: false,
autoScroll: true,
defaults: {
bodyStyle:'padding: 0px',
border: false,
},
layoutConfig: {
columns: 4
},
items:[{
id: 'eve_frm_prev',
html: '<canvas id="eve_frame_preview" width="760" height="400" style="background: #eeeeee; display: block; margin: 0 auto;"></canvas>',
height: 400,
width: 760,
border: true,
colspan: 4
},{
html: '<p><?=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:</p>'
},{
xtype: 'combo',
id: 'FRM_SIZE',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, '320x240'],
[1, '640x480'],
[2, '800x600'],
[3, '1280x720'],
[4, '1024x768'],
[5, '1920x1080']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0,
listeners:{
beforeselect: updateFramePreview,
//blur: updateFramePreview,
change: updateFramePreview
}
},{
html: '<p><?=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:</p>'
},{
xtype: 'slider',
id: 'COMP_QUAL',
width: 120,
minValue: 0,
maxValue: 100,
value: 70
},{
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_TS_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_show_ts',
value: 0,
handler: updateFramePreview
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_POSX_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_POSY_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_transp_ts',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_FONT_TS_');?>:</p>'
},{
xtype: 'combo',
id: 'TS_FONT',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'SIMPLEX'],
[1, 'PLAIN'],
[2, 'DUPLEX'],
[3, 'COMPLEX'],
[4, 'TRIPLEX'],
[5, 'COMPLEX_SMALL'],
[6, 'SCRIPT_SIMPLEX'],
[7, 'SCRIPT_COMPLEX']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_FSCALE',
width: 120,
minValue: 0.0,
maxValue: 4.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_FTHICK',
width: 120,
minValue: 1,
maxValue: 8.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:</p>'
},{
xtype: 'combo',
id: 'TS_LINET',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'THIN'],
[1, 'ANTIALIAZED'],
[2, 'THICK']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_show_lbl',
value: 0,
handler: updateFramePreview
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSX_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSY_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_transp_lbl',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_FONT_LBL_');?>:</p>'
},{
xtype: 'combo',
id: 'LBL_FONT',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'SIMPLEX'],
[1, 'PLAIN'],
[2, 'DUPLEX'],
[3, 'COMPLEX'],
[4, 'TRIPLEX'],
[5, 'COMPLEX_SMALL'],
[6, 'SCRIPT_SIMPLEX'],
[7, 'SCRIPT_COMPLEX']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_FSCALE',
width: 120,
minValue: 0.0,
maxValue: 4.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_FTHICK',
width: 120,
minValue: 1,
maxValue: 8.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:</p>'
},{
xtype: 'combo',
id: 'LBL_LINET',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'THIN'],
[1, 'ANTIALIAZED'],
[2, 'THICK']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_show_logo',
value: 0,
handler: updateFramePreview
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:</p>'
},{
xtype: 'slider',
id: 'LOGO_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:</p>'
},{
xtype: 'slider',
id: 'LOGO_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:</p>'
},{
xtype: 'numberfield',
id: 'LOGO_WIDTH',
width: 120,
minValue: 0,
maxValue: 256,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:</p>'
},{
xtype: 'numberfield',
id: 'LOGO_HEIGHT',
width: 120,
minValue: 0,
maxValue: 256,
value: 1.0
},{
id: 'eve_logo_ph',
html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>'
},{
html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>'
},{
html: '<p><?=$Labels->GetLabel('_EVE_PORT_');?>:</p>'
},{
xtype: 'numberfield',
id: 'WA_PORT',
width: 120,
minValue: 1000,
maxValue: 65535,
value: 8080
}]
}],
bbar: [{
text: '<?=$Labels->GetLabel("_CANCEL_");?>',
handler: function(){
embedVideoEncoderSettingsWindow.hide();
}
},{
id: 'con_to_src',
text: '<?=$Labels->GetLabel("_OK_");?>',
disabled: false,
handler: function(){
}
}]
});
};
embedVideoEncoderSettingsWindow.show();
updateFramePreview();
/*
Ext.Ajax.request({
url: '/lib/controller/getModuleSettings.php',
params: {
MID: ModuleID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
if( data.error = false ){
embedVideoEncoderSettingsWindow.show();
Ext.getCmp('setting_master_ip').setValue( data.ip_address );
Ext.getCmp('setting_master_port').setValue( data.port );
Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
Ext.getCmp('setting_slave_port').setValue( data.aux_port );
Ext.getCmp('setting_lat').setValue( data.lat );
Ext.getCmp('setting_lon').setValue( data.lon );
Ext.getCmp('setting_alt').setValue( data.alt );
Ext.getCmp('setting_roll').setValue( data.roll );
Ext.getCmp('setting_pitch').setValue( data.pitch );
Ext.getCmp('setting_yaw').setValue( data.yaw );
} else {
Ext.Msg.show({
title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
msg: data.error_message,
buttons: Ext.Msg.OK,
fn: function(){
//SettingsLidar3D.hide();
},
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
* /
};*/

1237
lib/javascript/jsapi_dynamic/rgoose_reports.js
File diff suppressed because it is too large
View File

111
lib/javascript/jsapi_dynamic/rgoose_single_ipi.js

@ -1,111 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
function loadSingleIPI(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
setUserContent( 11 );
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( 'Single IPI Monitoring' );
tPanel.add({
columnWidth: 1,//0.83
frame: false,
border: false,
items: [{
title: '<?=$Labels->getLabel('_VIDEO_MONITORING_');?>',
<?php
$QS = "SELECT * FROM `nodes` WHERE `type` IN (10,11,12,13)";
$RetVal = $DATABASE->Query( $QS );
?>
frame: false,
border: false,
collapsible: false,
draggable: false,
layout: 'vbox',
layoutConfig: {
align : 'stretch',
pack : 'start',
},
height: PanelH-300,
items:[{
height: PanelH-325,
flex: 1,
frame: false,
border: false,
layout: 'fit',
items:{
id: 'event_map',
html:
<?php
if( count( $RetVal ) == 1 ){
$CN = $RetVal[0];
$NODEID = intval( $CN['id'] );
$CAMID = intval( $CN['aux_id'] );
$STREAMID = intval( $CN['aux_parameter'] );
$QS="SELECT * FROM `module_embed_video_settings` WHERE `id`=1";
$S=$DATABASE->Query( $QS );
$MODULE_DATA = $S[0];
$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $STREAMID;
echo "'<img onmouseover=\"ptzCtrl(\'img-{$NODEID}\');\" ondblclick=\"fullScreen(\'img-{$NODEID}\');\" style=\"cursor: zoom-in\" id=\"img-{$NODEID}\" src=\"{$FU}\" widtsh=\"%%%WIDTH%%%\" height=\"100%\"/>'";
} else if( count( $RetVal ) ){
echo "'&nbsp;Too Many Cameras are Defined For this Site'";
} else {
echo "'&nbsp;No Cameras Defined On the Site!'";
};
?>
}
}]
},{
frame: false,
border: true,
collapsible: false,
draggable: false,
layout: 'hbox',
items:[{
title: 'Event Log',
height: 303,
xtype: 'grid',
border: false,
frame: false,
collapsible: false,
draggable: false,
ds: eventsListStore,
cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
bbar: [{
text: 'Clear',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/clearEventCloud.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
},
failure: function( response, opts ) {
}
});
}
}]
}]
}]
});
//tPanel.add({
// columnWidth: 0.17,
// title: 'Event Information',
// frame: true,
// id: 'prop_content',
// border: false,
// items: [{
// html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
// }]
//});
tPanel.doLayout();
};

569
lib/javascript/jsapi_dynamic/rgoose_swupgrade.js

@ -1,569 +0,0 @@
//<?php require_once('../../js_asm.php'); ?>
var muploader = null;
var uploads_store_id = 0;
var uploads_store = new Ext.data.ArrayStore({
autoDestroy: false,
storeId: 'up_store',
idIndex: 0,
fields: [
{name: 'id', type: 'int' },
{name: 'file_name', type: 'string'},
{name: 'file_id', type: 'string'},
{name: 'size', type: 'string'},
{name: 'progress', type: 'int'},
{name: 'status', type: 'string' }
]
});
var uploaded_store_id = 0;
var uploaded_store = new Ext.data.ArrayStore({
autoDestroy: false,
storeId: 'mod_store',
idIndex: 0,
fields: [
{name: 'id', type: 'int' },
{name: 'file_name', type: 'string'},
{name: 'size', type: 'int'},
{name: 'status', type: 'int'},
{name: 'ts', type: 'string' },
{name: 'memo', type: 'string' }
]
});
function progressRenderer( value, meta, record ){
Ext.defer( function( id ){
var p = new Ext.ProgressBar({
id: 'progress_'+id,
renderTo: 'div_'+id,
animate: false,
width: '100%',
value: 0,
text: 'Upload Pending',
});
}, 50, undefined, [ record.data.file_id ] );
return '<div id="div_' + record.data.file_id + '"></div>';
};
var fileUploadsColModel_ops = {
columns: [
{header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "File Name", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
{header: "Progress", width: 150, renderer: progressRenderer, dataIndex: 'progress' },
{header: " ", width: 50, dataIndex: 'status3' }
],
defaults: {
sortable: false,
fixed: true,
menuDisabled: true,
width: 100
}
};
function loadModuleFiles( sensorID ){
Ext.Ajax.request({
url: '/lib/controller/getDeviceFiles.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
DID: sensorID
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
uploaded_store.removeAll();
uploaded_store.loadData( data.files );
},
failure: failureAJAXFunction
});
};
function onModuleFileRenderer( value, meta, record ){
if( value == 0 ){
rv = '<img title="Ready to Upload" alt="Ready to Upload" src="/style/assets/bul_green.png">';
} else {
if( value < 101 ){
rv = '<img title="Uploading" alt="Uploading" src="/style/assets/bul_gray.png">';
} else {
rv = '<img title="Already Uploaded" alt="Already Uploaded" src="/style/assets/bul_blue.png">';
};
};
return rv;
};
var fileModuleColModel_ops = {
columns: [
{header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "File Name", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "Size", width: 80, renderer: plupload.formatSize, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
{header: "Time", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "Status", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' },
{header: "Memo", dataIndex: 'memo' }
],
defaults: {
sortable: false,
fixed: true,
menuDisabled: true,
width: 100
}
};
var fileUploadsSelModel_ops = {
singleSelect: true
};
function archiveTypeRenderer( value, meta, record ){
var alt_txt = '';
var img_src = '';
if( record.data.bk_type == 3 ){
alt_txt = 'Full System Snapeshot';
img_src = '/style/icons/icons/rosette.png';
} else {
alt_txt = 'Database Backup';
img_src = '/style/icons/icons/database.png';
};
return '<div><img alt="'+alt_txt+'" src="'+img_src+'"></div>';
};
var taskIsArmed = false;
var archives_store = new Ext.data.JsonStore({
root: 'backups',
totalProperty: 'totalCount',
idProperty: 'id',
//remoteSort: true,
autoLoad: true,
//url: '/lib/php/setup_toolkit/list_vault.php',
storeId: 'a_store',
fields: [{
name: 'id',
type: 'int'
},{
name: 'bk_type',
type: 'int'
},{
name: 'file_name',
type: 'string'
},{
name: 'base_version',
type: 'string'
},{
name: 'ts',
type: 'string'
},{
name: 'size',
type: 'string'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/php/setup_toolkit/list_vault.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
}
})
});
var archivesColModel_ops = {
columns: [
{header: "Type", width: 50, align: 'center', css: 'vertical-align: middle;', renderer: archiveTypeRenderer, dataIndex: 'bk_type' },
{header: "Version", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'base_version' },
{header: "Name", width: 280, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "Date", width: 120, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' }
],
defaults: {
sortable: false,
fixed: true,
menuDisabled: true,
width: 100
}
};
var selectedArchiveRecord = null;
var archivesSelModel_ops = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec ) {
//loadEventProperties( rec.data );
//SelectedEvent = rec.data.id;
//alert( SelectedEvent );
//var CB = Ext.getCmp('con_to_src');
//CB.enable();
selectedArchiveRecord = rec;
if( rec.data.bk_type!=3 ){
} else {
};
}
}
};
var initial_md5 = '';
function updateTaskStatus(){
Ext.Ajax.request({
url: '/lib/php/setup_toolkit/getTaskStatus.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
IMD: initial_md5
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
switch( data.status ){
case 0:{
Ext.getCmp('ch_ta_btn').disable();
if( taskIsArmed ){
taskIsArmed = false;
archives_store.reload();
};
break;
};
case 1:{
Ext.getCmp('ch_ta_btn').enable();
taskIsArmed = true;
break;
};
case 2:{
Ext.getCmp('ch_ta_btn').disable();
break;
};
};
Ext.getCmp('ctask_status').update( '<p>'+data.msg +': ' + data.status_desc+'</p>' );
if( initial_md5 != data.log_md5 ){
initial_md5 = data.log_md5;
Ext.getCmp('task_log').setRawValue( data.status_log );
};
},
failure: failureAJAXFunction
});
};
function createNewTask( task_id, param = '' ){
Ext.Ajax.request({
url: '/lib/php/setup_toolkit/createNewTask.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
TID: task_id,
PRM: param
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.status == 0 ){
Ext.Msg.show({
title:'Error',
msg: data.error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
};
function deleteNewTask(){
Ext.Ajax.request({
url: '/lib/php/setup_toolkit/cleanNewTask.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.status == 0 ){
Ext.Msg.show({
title:'Error',
msg: data.error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
};
function loadUpgradeManagmenet(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
setUserContent( 5 );
initial_md5 = '';
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_SWU_DASHBOARD_');?>' );
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll(true);
tPanel.add({
columnWidth: 1.0,
frame: false,
border: false,
items: [{
frame: false,
border: false,
collapsible: false,
draggable: false,
layout: 'vbox',
//layoutConfig: {
// align : 'stretch',
// pack : 'start',
//},
height: PanelH,
items:[{
title: '<?=$Labels->getLabel('_MAP_MONITORING_');?>',
xtype: 'panel',
height: PanelH-300,
//flex: 1,
frame: true,
width: '100%',
border: false,
layout: {
type: 'table',
columns: 2,
tableAttrs: {
valign: 'top',
style: 'valign:top;width:100%;'
}
},
defaults: {
frame: true,
border: false,
height: ( PanelH-400 ) / 2,
style: 'margin: 5px;width:400px;display:block;'
},
items:[{
title: 'Current System Info',
width: '100%',
//flex: 1,
html: '<p>Current Web Version:&nbsp;<b><?=$ARGUS_WEB_VERSION;?></b></p>'
},{
title: 'Tasks',
//width: 400,
layout: 'vbox',
items:[{
xtype: 'button',
width: '100%',
text: 'Create Database Backup',
handler: function(){
createNewTask( 2 );
}
},{
xtype: 'button',
width: '100%',
text: 'Create Full Snapeshot',
handler: function(){
createNewTask( 255 );
}
}]
},{
title: 'Archives',
height: 250,
width: '100%',
tbar:[{
text: 'Restore',
id: 'ar_restore_btn',
handler: function(){
createNewTask(1, selectedArchiveRecord.data.file_name );
}
},{
text: 'Download',
id: 'ar_download_btn',
handler: function(){
if( selectedArchiveRecord!= null ){
window.open( '/lib/php/setup_toolkit/vault/'+selectedArchiveRecord.data.base_version + '/'+ selectedArchiveRecord.data.file_name );
};
}
},{
text: 'Delete',
id: 'ar_delete_btn',
handler: function(){
createNewTask(100, selectedArchiveRecord.data.file_name );
}
}],
items:[{
xtype: 'grid',
id: 'archives_grid',
border: false,
frame: false,
autoScroll: true,
//width: '100%',
lazyRender: true,
height: 210,
ds: archives_store,
cm: new Ext.grid.ColumnModel( archivesColModel_ops ),
sm: new Ext.grid.RowSelectionModel( archivesSelModel_ops ),
viewConfig: {
// forceFit: true
}
}]
},{
title: 'Task Status',
height: 250,
//flex: 1,
items:[{
xtype: 'spacer',
height: 4
},{
id: 'ctask_status',
border: true,
html: ''
},{
xtype: 'spacer',
height: 4
},{
xtype: 'textarea',
id: 'task_log',
height: ( PanelH-320 ) / 2 - 120,
style: 'font-size:9px;width:100%;margin-bottom:4px;',
readOnly: true,
autoScroll: true,
value: ''
},{
xtype: 'progress',
id: 'task_progress',
value: 1.0,
text: 'idle',
disabled: true
}],
tbar:[{
text: 'Cancel Task',
id: 'ch_ta_btn',
disabled: true,
handler: deleteNewTask
}]
}]
},{
title: '<?=$Labels->getLabel('_UPLOAD_PACKAGE_');?>',
xtype: 'panel',
height: 300,
//flex: 1,
frame: true,
border: false,
//layout: 'vbox',
items:[{
xtype:'button',
id: 'pickfiles',
width: '100%',
text: 'Choose File'
},{
height: 200,
xtype: 'grid',
id: 'upload_grid',
border: false,
frame: false,
mode: 'local',
lazyRender: true,
width: '100%',
autoScroll: true,
ds: uploads_store,
cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
viewConfig: {
forceFit: true
},
bbar: [{
text: 'Clear',
width: '100%',
handler: function(){
muploader.splice();
uploads_store.removeAll();
}
}]
},{
xtype:'button',
id: 'umpalumpa',
width: '100%',
disabled: true,
text: 'Upload',
handler: function(){
if( muploader!= null ){
muploader.start();
};
}
}],
listeners:{
afterrender: function(){
muploader = new plupload.Uploader({
runtimes : 'html5,html4',
browse_button : Ext.getDom('pickfiles'), // you can pass in id...
//container: document.getElementById('upupu'), // ... or DOM Element itself
max_file_size : '1000mb',
chunk_size: '200kb',
max_retries: 3,
multi_selection: false,
max_file_count: 1,
// Fake server response here
url: '/lib/php/setup_toolkit/upload.php',
//url: "/echo/json",
//flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',
//silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap',
filters : [
//{title : "Image files", extensions : "jpg,gif,png"},
{title : "Archive files", extensions : "rar,zip,gz,bz2"}
],
init: {
PostInit: function() {
//$('filelist').innerHTML = '';
//$('uploadfiles').onclick = function() {
// uploader.start();
// return false;
//};
},
FilesAdded: function( up, files ) {
Ext.getCmp('umpalumpa').enable();
plupload.each( files, function(file) {
uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
uploads_store_id++;
Ext.getCmp('upload_grid').doLayout();
});
},
UploadProgress: function(up, file) {
var pb = Ext.getCmp( 'progress_'+file.id );
if( file.percent < 100 ){
pb.updateProgress( file.percent / 100, file.percent + '%', false );
} else {
pb.updateProgress( 1.0, 'Uploaded', false );
};
},
Error: function(up, err) {
Ext.Msg.show({
title:'Upload Status',
msg: "Error #" + err.code + ": " + err.message,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
}
});
muploader.init();
}
}
}]
}]
});
muploader = null;
uploads_store.removeAll();
tPanel.doLayout();
archives_store.load();//{params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
updateTaskStatus();
tlInterval = window.setInterval( updateTaskStatus, 333 );
};

1170
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
File diff suppressed because it is too large
View File

29
lib/javascript/jsapi_dynamic/testus.js

@ -1,29 +0,0 @@
http://192.168.1.82:9989/onvif…..;subtype=0
subtype=
0 for Main Stream
1 for Extra Stream ;)
<img alt=”” src=”camera1.jpg” width=”800″ height=”450″ border=”1″ name=”refresh” ></a>
<script language=”JavaScript” type=”text/javascript”>
var t = 60 // interval in seconds
image = “camera1.jpg” //name of the image
function Start() {
var tester=new Image(image);
tester.onload
{
tmp = new Date();
tmp = “?”+tmp.getTime()
document.images[“refresh”].src = image+tmp
}
setTimeout(“Start()”, t*1000)
}
Start();
</script>

56
lib/php/argus/server.php

@ -188,7 +188,7 @@ $SVG['C']['U']=<<<DATA_BIUNDARY
<rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
<rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
</pattern>
<pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
<pattern id="stripe" x="0" y="5" width="30" height="15" patternUnits="userSpaceOnUse">
<rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
<polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
</pattern>
@ -209,8 +209,8 @@ $SVG['C']['U']=<<<DATA_BIUNDARY
<rect x="0" y="0" width="100%" height="100%" fill="#808080" />
<rect x="0" y="155" width="100%" height="45" fill="#404040"/>
<rect x="0" y="0" width="100%" height="45" fill="#404040" />
<rect x="25%" y="155" width="50%" height="45" fill="#C0C0C0" />
<rect x="25%" y="165" width="50%" height="15" fill="url(#stripe)"/>
<rect x="25%" y="0" width="50%" height="45" fill="#C0C0C0" />
<rect x="25%" y="20" width="50%" height="15" fill="url(#stripe)"/>
<rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
@ -220,10 +220,10 @@ $SVG['C']['U']=<<<DATA_BIUNDARY
<text class=\"track_area_text\" x=\"85%\" y=\"50%\">{$RTitle}</text>
</svg>
DATA_BIUNDARY;
$SVG['C'][1]=<<<DATA_BIUNDARY
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
$SVG['C']['B']=<<<DATA_BIUNDARY
<svg id="svgTrackMap" viewBox="0 0 1920 200" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
<pattern id="railway" x="0" y="50" width="50" height="100" patternUnits="userSpaceOnUse">
<rect x="20" y="5" width="10" height="90" fill="#000000" />
<rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
<rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
@ -233,7 +233,7 @@ $SVG['C'][1]=<<<DATA_BIUNDARY
<rect x="0" y="15" width="50" height="10" fill="#f0f0f0" />
<rect x="0" y="75" width="50" height="10" fill="#f0f0f0" />
</pattern>
<pattern id="stripe" x="0" y="0" width="30" height="15" patternUnits="userSpaceOnUse">
<pattern id="stripe" x="0" y="5" width="30" height="15" patternUnits="userSpaceOnUse">
<rect x="0" y="0" width="30" height="15" style="fill:rgb(255, 240, 85);" />
<polygon points="0,0 15,15 30,15 15,0" fill="#000000" />
</pattern>
@ -251,18 +251,21 @@ $SVG['C'][1]=<<<DATA_BIUNDARY
</linearGradient>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="#808080" />
<rect x="0" y="410" width="50%" height="290" fill="#C0C0C0" />
<rect x="0" y="0" width="100%" height="290" fill="#404040" />
<rect x="0" y="450" width="50%" height="15" fill="url(#stripe)"/>
<rect x="0" y="0" width="100%" height="100%" fill="#808080" />
<rect x="0" y="155" width="100%" height="45" fill="#404040"/>
<rect x="0" y="0" width="100%" height="45" fill="#404040" />
<rect x="25%" y="0" width="50%" height="45" fill="#C0C0C0" />
<rect x="25%" y="20" width="50%" height="15" fill="url(#stripe)"/>
<rect x="0" y="300" width="100%" height="100" fill="url(#railway)" />
<rect x="50%" y="410" width="50%" height="290" fill="#404040"/>
<rect x="50%" y="0" width="50%" height="100%" fill="url(#right_wall)"/>
<text class=\"passive_area_text\" x=\"75%\" y=\"25%\">{$Title}</text>
<rect x="0" y="50" width="100%" height="100" fill="url(#railway)" />
<rect x="0" y="0" width="25%" height="100%" fill="url(#left_wall)"/>
<rect x="75%" y="0" width="25%" height="100%" fill="url(#right_wall)"/>
<text id="scheme_anch" class=\"track_area_text\" x=\"15%\" y=\"50%\">{$LTitle}</text>
<text class=\"track_area_text\" x=\"85%\" y=\"50%\">{$RTitle}</text>
</svg>
DATA_BIUNDARY;
$SVG['C'][2]=<<<DATA_BIUNDARY
$SVG['E']['U']=<<<DATA_BIUNDARY
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
@ -304,7 +307,7 @@ $SVG['C'][2]=<<<DATA_BIUNDARY
<text class=\"passive_area_text\" x=\"75%\" y=\"25%\">{$Title}</text>
</svg>
DATA_BIUNDARY;
$SVG['C'][3]=<<<DATA_BIUNDARY
$SVG['E']['B']=<<<DATA_BIUNDARY
<svg viewBox="0 0 1920 700" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="railway" x="0" y="0" width="50" height="100" patternUnits="userSpaceOnUse">
@ -895,7 +898,8 @@ function getPlatformName( $id ){
function getOnlineStatus( $mid ){
global $DATABASE;
if( $mid ){
$QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10";
$CTS = time() - 3; // 3 seconds lag
$QS = "SELECT `status` FROM `mem_online_cloud` WHERE `object_id` = {$mid} AND `object_type`=10 AND `ts`>={$CTS}";
$RV = $DATABASE->Query( $QS, false );
return ( count( $RV ) > 0 );
};
@ -926,7 +930,7 @@ DATA_BOUNDARY;
return "{ xtype:'panel', border: false, frame: false, html: '". str_ireplace( "\n",'', $AA )."'}";
};
function createChopLabel( $line1, $line2, $Lines, $Track="", $color_class="", $oncli="" ){
function createChopLabel( $line1, $line2, $Lines, $Track="", $color_class="", $oncli="", $atds="", $id ='' ){
if( $Track!=''){
$TR_INS=<<<DATA_BOUNDARY
<td rowspan=3 valign="middle" align="center" style="width: 200px; border-radius: 5px; font-size: 44px; font-weight: bold; color: white; background-color: black;">{$Track}</td>
@ -934,15 +938,25 @@ DATA_BOUNDARY;
} else {
$TR_INS = '';
};
if( $atds!= "" ){
if( is_array( $atds ) ){
$ADDTD='<td rowspan=3 width="150px">&nbsp;</td>';
foreach( $atds as $A ) $ADDTD.='<td rowspan=3>'.$A.'</td>';
} else {
$ADDTD='<td rowspan=3 width="150px">&nbsp;</td><td rowspan=3>'.$atds.'</td>';
};
} else {
$ADDTD='';
};
if( $oncli!=''){
$ACTION ='onclick="'.$oncli.';"';
} else {
$ACTION ='';
};
$AA=<<<DATA_BOUNDARY
<table border=0 width="100%" class="sideInfo_item {$color_class}" {$ACTION}>
<table {$id} border=0 width="100%" class="sideInfo_item {$color_class}" {$ACTION}>
<tr>
<td valign="middle" align="left" style="max-width: 20em; padding-left:30px;font-size: 16px; font-weight: bold;">{$line1}</td>{$TR_INS}
<td valign="middle" align="left" style="max-width: 20em; padding-left:30px;font-size: 16px; font-weight: bold;">{$line1}</td>{$TR_INS}{$ADDTD}
</tr>
<tr>
<td valign="middle" align="left" style="padding-left:30px;font-size: 12px; font-weight: bold;">{$line2}</td>

30
lib/php/argus/templates.php

@ -340,7 +340,7 @@ $PLATFORM_PLATFORM_CTX=<<<DATA_BOUNDARY
},
//title: '%%%PLATFORM%TITLE%%%',
id: 'plat_panel_%%%PLATFORM%ID%%%',
items:[%%%VIDEO1%%%,{
items:[%%%VIDEOUF%%%,{
frame: true,
id: 'plat_schematics_%%%PLATFORM%ID%%%',
items:[{
@ -352,7 +352,7 @@ $PLATFORM_PLATFORM_CTX=<<<DATA_BOUNDARY
}],
colspan: 2,
rowspan: 2
},%%%VIDEO2%%%,%%%VIDEO3%%%,%%%VIDEO4%%%]
},%%%VIDEOUN%%%,%%%VIDEOBN%%%,%%%VIDEOBF%%%]
}
DATA_BOUNDARY;
@ -390,6 +390,32 @@ $MODULE_CTX=<<<DATA_BOUNDARY
DATA_BOUNDARY;
$EMPTY_VIDEO_CTX=<<<DATA_BOUNDARY
{
xtype: 'panel',
frame: true,
custom: '%%MID%%',
items:[{
html:'<div id="plat_video_%%%PLATFORM%ID%%%_%%MID%%" style="display: block;">&nbsp;</div><div style="display: block; height: 42px;">&nbsp;</div>'
}],
listeners:{
afterrender: function( p ){
var zz = p.findParentByType('panel');
var xx = zz.getInnerWidth() * 450 / 1600;
var yy = xx * 1600 / 900;
p.setWidth( yy );
p.setHeight( xx + 32 );
//var z = Ext.getCmp('j_video_%%MID%%');
//z.setHeight( xx );
//z.setWidth( yy );
//var jv = document.getElementById('video_player_%%MID%%');
//jv.setAttribute('height', ''+xx);
//jv.setAttribute('width', ''+yy);
}
}
}
DATA_BOUNDARY;
$EMPTY_NO_AC_VIDEO_CTX=<<<DATA_BOUNDARY
{
xtype: 'panel',
frame: true,

9
lib/php/db/user_class.php

@ -63,9 +63,12 @@ class User{
if ( $PWD == '7251414b5a880b140de7d2c0b402d168' ){
$DATABASE->Query( "UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ", false );
} else {
$CTS = time();
//$DATABASE->Query( "UPDATE users SET login_ts={$CTS}, SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
$DATABASE->Query( "UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
if( $this->Data['id'] > 2 ){
$CTS = time();
$DATABASE->Query( "UPDATE users SET login_ts={$CTS}, SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
} else {
$DATABASE->Query( "UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
};
};
$LOG->login();
return true;

2
lib/version.var

@ -1 +1 @@
20241231
20251012

BIN
style/assets/bul_green_rst.png

Binary file not shown.

Before

Width: 32  |  Height: 12  |  Size: 582 B

After

Width: 32  |  Height: 12  |  Size: 555 B

44
style/style.css

@ -1091,6 +1091,17 @@ A.CalendarDS:hover {
background-position: 10px 10px;
background-size: 110px 110px;
}
.appis_logo_img{
display: block;
border-radius: 64px;
width: 128px;
height: 128px;
background-color: #4169e1;
background-image: url('wicons/025.png');
background-repeat: no-repeat;
background-position: 10px 10px;
background-size: 110px 110px;
}
.server_img_set{
display: block;
border-radius: 128px;
@ -2030,6 +2041,36 @@ input[type="range"]:focus::-moz-range-thumb {
color: silver;
background-color: #232d38;
}
.mon_scada_status_tag_ok{
display: block;
border-radius: 5px;
font: bold 9px arial;
width: 120px;
padding: 5px;
text-align: center;
margin-top: 3px;
margin-bottom: 3px;
color: yellow;
background-color: darkgreen;
}
.mon_scada_head_ok{
font-size: 9px!important;
font-weight: bold!important;
text-align: center;
width: 70px;
border-radius: 5px;
color: yellow;
background-color: darkgreen;
}
.mon_scada_head_active{
font-size: 9px!important;
font-weight: bold!important;
text-align: center;
width: 70px;
border-radius: 5px;
color: white;
background-color: red;
}
.mon_module_btn{
border-radius: 5px;
cursor: pointer;
@ -2145,4 +2186,7 @@ input[type="range"]:focus::-moz-range-thumb {
width: 135px;
overflow: hidden;
}
.aaBB{
height: 12px;
}
Loading…
Cancel
Save