Browse Source

Transfering to Steph

master
Evgeny Gagua 5 months ago
parent
commit
69af996a5c
  1. 2
      lib/1.json
  2. 98
      lib/controller/doPlatformOperations.php
  3. 13
      lib/controller/doStationOperations.php
  4. 20
      lib/controller/getHistorySessionView.php
  5. 305
      lib/controller/getPlatformEditor.php
  6. 306
      lib/controller/getScadaEditor.php
  7. 23
      lib/controller/getScadaModules.php
  8. 13
      lib/controller/getSessionData.php
  9. 39
      lib/controller/getStationEditor.php
  10. 18
      lib/controller/getStatus.php
  11. 196
      lib/controller/getVideoComposerSettings.php
  12. 24
      lib/javascript/jsapi_dynamic/argus_main.js
  13. 395
      lib/javascript/jsapi_dynamic/argus_monitoring.js
  14. 20
      lib/javascript/jsapi_dynamic/argus_reports.js
  15. 163
      lib/javascript/jsapi_dynamic/argus_settings.js
  16. 4
      lib/php/argus/templates.php
  17. 4
      lib/php/ui/UI_functions.php
  18. 2
      lib/settings.php
  19. 44
      lib/upgrade_database.php
  20. 2
      lib/version.var
  21. 66
      style/style.css

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

98
lib/controller/doPlatformOperations.php

@ -253,34 +253,51 @@
$LOG->reg_op( $_POST ); $LOG->reg_op( $_POST );
break; break;
}; };
case 12:{//Enable/Disable Scada
case 12:{//Add SCADA Module
if( $OID == 0 ) { if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!'; $Data['msg']='Wrong Parameters!';
echo json_encode( $Data ); echo json_encode( $Data );
exit(); exit();
}; };
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 );
};
$MNM = $DATABASE->escape( $_POST['MNA'] );
$MIP = $DATABASE->escape( $_POST['MIP'] );
if( strlen( $MIP ) < 6 || strlen( $MIP ) > 15 ){
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$MPO = intval( $_POST['MPO'] );
if( $MPO == 0 ){
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$QS = "INSERT INTO `modbus_modules`(`platform_id`,`ip4`,`port`,`label`) VALUES({$OID},'{$MIP}',{$MPO},'{$MNM}')";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
};
case 13:{//Remove SCADA Module
break; break;
}; };
case 13:{//Update IP Scada
case 14:{//Edit SCADA Module Name
$SCA = intval( $_POST['SCA'] );
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
$NAME = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `modbus_modules` SET `label`='{$NAME}' WHERE `platform_id`={$OID} AND `id`={$SCA}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
break;
break;
};
case 15:{//Edit SCADA Module IP
$SCA = intval( $_POST['SCA'] );
if( $OID == 0 ) { if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!'; $Data['msg']='Wrong Parameters!';
echo json_encode( $Data ); echo json_encode( $Data );
@ -288,17 +305,18 @@
}; };
$IP = $DATABASE->escape( $_POST['OPCODE'] ); $IP = $DATABASE->escape( $_POST['OPCODE'] );
if( strlen( $IP ) > 6 ){ if( strlen( $IP ) > 6 ){
$QS = "UPDATE `modbus_modules` SET `ip4`='{$IP}' WHERE `platform_id`={$OID}";
$QS = "UPDATE `modbus_modules` SET `ip4`='{$IP}' WHERE `platform_id`={$OID} AND `id`={$SCA}";
} else { } else {
// Erased IP ---> Disabled Module // Erased IP ---> Disabled Module
$QS = "UPDATE `modbus_modules` SET `ip4`='{$IP}', `wm`='D' WHERE `platform_id`={$OID}";
$QS = "UPDATE `modbus_modules` SET `ip4`='{$IP}', `wm`='D' WHERE `platform_id`={$OID} AND `id`={$SCA}";
}; };
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
$Data['success'] = true; $Data['success'] = true;
$LOG->reg_op( $_POST ); $LOG->reg_op( $_POST );
break; break;
}; };
case 14:{//Update Port Scada
case 16:{//Edit SCADA Module Port
$SCA = intval( $_POST['SCA'] );
if( $OID == 0 ) { if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!'; $Data['msg']='Wrong Parameters!';
echo json_encode( $Data ); echo json_encode( $Data );
@ -306,14 +324,42 @@
}; };
$PORT = intval( $_POST['OPCODE'] ); $PORT = intval( $_POST['OPCODE'] );
if( $PORT ){ if( $PORT ){
$QS = "UPDATE `modbus_modules` SET `port`={$PORT} WHERE `platform_id`={$OID}";
$QS = "UPDATE `modbus_modules` SET `port`={$PORT} WHERE `platform_id`={$OID} AND `id`={$SCA}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
}; };
$Data['success'] = true; $Data['success'] = true;
$LOG->reg_op( $_POST ); $LOG->reg_op( $_POST );
break; break;
}; };
case 15:{//Test Scada
case 17:{//Enable/Disable Scada
$SCA = intval( $_POST['SCA'] );
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!';
echo json_encode( $Data );
exit();
};
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} AND `id`={$SCA}";
$JJ = $DATABASE->Query( $QS );
if( count( $JJ ) ){
if( strlen($JJ[0]['ip4']) > 6 ){
$QS="UPDATE `modbus_modules` SET `wm`='E' WHERE `platform_id`={$OID} AND `id`={$SCA}";
$DATABASE->Query( $QS );
};
};
} else {
$QS="UPDATE `modbus_modules` SET `wm`='D' WHERE `platform_id`={$OID} AND `id`={$SCA}";
$DATABASE->Query( $QS );
};
$Data['success'] = true;
$LOG->reg_op( $_POST );
};
break;
};
case 18:{//Test Scada
if( $OID == 0 ) { if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!'; $Data['msg']='Wrong Parameters!';
echo json_encode( $Data ); echo json_encode( $Data );

13
lib/controller/doStationOperations.php

@ -13,6 +13,11 @@
} else { } else {
$OID = 0; $OID = 0;
}; };
if( isset( $_POST['ID'] ) ){
$OID = intval( $_POST['ID'] );
} else {
$OID = 0;
};
if( $CMD > 0 ){ if( $CMD > 0 ){
switch( $CMD ){ switch( $CMD ){
case 1:{//Add Station case 1:{//Add Station
@ -179,14 +184,14 @@
break; break;
}; };
case 6:{//Update Name case 6:{//Update Name
if( $LID == 0 ) {
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!'; $Data['msg']='Wrong Parameters!';
echo json_encode( $Data ); echo json_encode( $Data );
exit(); exit();
}; };
if( strlen( $_POST['OPCODE'] ) ){ if( strlen( $_POST['OPCODE'] ) ){
$NAME = $DATABASE->escape( $_POST['OPCODE'] ); $NAME = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_lines` SET `name`='{$NAME}' WHERE `id`={$LID}";
$QS = "UPDATE `metro_stations` SET `name`='{$NAME}' WHERE `id`={$OID}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
$Data['success'] = true; $Data['success'] = true;
$LOG->reg_op( $_POST ); $LOG->reg_op( $_POST );
@ -198,14 +203,14 @@
break; break;
}; };
case 7:{//Update Short case 7:{//Update Short
if( $LID == 0 ) {
if( $OID == 0 ) {
$Data['msg']='Wrong Parameters!'; $Data['msg']='Wrong Parameters!';
echo json_encode( $Data ); echo json_encode( $Data );
exit(); exit();
}; };
if( strlen( $_POST['OPCODE'] ) ){ if( strlen( $_POST['OPCODE'] ) ){
$SHORT = $DATABASE->escape( $_POST['OPCODE'] ); $SHORT = $DATABASE->escape( $_POST['OPCODE'] );
$QS = "UPDATE `metro_lines` SET `short`='{$SHORT}' WHERE `id`={$LID}";
$QS = "UPDATE `metro_stations` SET `short`='{$SHORT}' WHERE `id`={$OID}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
$Data['success'] = true; $Data['success'] = true;
$LOG->reg_op( $_POST ); $LOG->reg_op( $_POST );

20
lib/controller/getHistorySessionView.php

@ -53,7 +53,7 @@
$MD = $DD[0]; $MD = $DD[0];
$URL = '/style/assets/no-signal_h.png'; $URL = '/style/assets/no-signal_h.png';
$LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX ); $LVID = str_ireplace( '%%MID%%', $LMID, $VIDEOJS_CTX );
$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
//$LVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $LVID );
$LTitle = $MD['name']; $LTitle = $MD['name'];
$LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID ); $LVID = str_ireplace( '%%%SELURL%%%', $URL, $LVID );
$LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID ); $LVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $LVID );
@ -67,7 +67,7 @@
$MD = $DD[0]; $MD = $DD[0];
$URL = '/style/assets/no-signal_h.png'; $URL = '/style/assets/no-signal_h.png';
$RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX ); $RVID = str_ireplace( '%%MID%%', $RMID, $VIDEOJS_CTX );
$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
//$RVID = str_ireplace( '%%%TITLE%%%', $MD['name'], $RVID );
$RTitle = $MD['name']; $RTitle = $MD['name'];
$RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID ); $RVID = str_ireplace( '%%%SELURL%%%', $URL, $RVID );
$RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID ); $RVID = str_ireplace( '%%%HBTN%%%','&nbsp;', $RVID );
@ -172,7 +172,21 @@
xtype: 'spacer', xtype: 'spacer',
width: 5 width: 5
},{ },{
html: '<div id="hpl_time_mon">ФИФИФ</div>'
width: 140,
html: '<div id="hpl_time_mon">[timestamp]</div>'
},{
xtype: 'spacer',
width: 5
},{
xtype: 'button',
text: 'List All Videos',
iconCls: 'plr_op_videos',
enableToggle: false,
width: 60,
scale: 'small',
handler: function(){
showEventsVideos();
}
}] }]
},{ },{
id: 'sets_ui', id: 'sets_ui',

305
lib/controller/getPlatformEditor.php

@ -120,272 +120,7 @@ JOJOKA;
}; };
}; };
$BOTTOM .="</table></td></tr></table></td>"; $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>'}";
$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='';
};
$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>'}";
$ED =<<<kokakskhkajhskr $ED =<<<kokakskhkajhskr
{ {
xtype: 'tabpanel', xtype: 'tabpanel',
@ -393,6 +128,16 @@ DATA_BOUNDARY;
frame: false, frame: false,
height: PanelH - 283, height: PanelH - 283,
activeTab: 0, activeTab: 0,
listeners:{
tabchange: function( tp, t ){
switch( t.getId() ){
case 'scada_tab': {
loadSCADAModules( SelectedPlatform );
break;
};
};
}
},
items:[{ items:[{
xtype: 'panel', xtype: 'panel',
title: '{$Labels->GetLabel('_GENERAL_')}', title: '{$Labels->GetLabel('_GENERAL_')}',
@ -459,15 +204,29 @@ DATA_BOUNDARY;
items: [{$TRACKS}] items: [{$TRACKS}]
},{ },{
xtype: 'panel', xtype: 'panel',
id: 'scada_tab',
title: '{$Labels->GetLabel('_LBL_SCADA_')}', title: '{$Labels->GetLabel('_LBL_SCADA_')}',
layout: 'hbox',
items: [{ items: [{
xtype: 'form',
height: PanelH - 283,
labelWidth: 150,
labelAlign: 'right',
margins: {top:10, right:10, bottom:10, left:10},
padding:8,
items: [{$MODBUS}]
xtype: 'panel',
id: 'scada_container',
tbar:[{
text: "{$Labels->GetLabel( '_ADD_' )}",
handler: addScadaModule
}],
flex: 1,
height: PanelH-15,
autoScroll: 'auto',
items:[]
},{
xtype: 'panel',
id: 'scada_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
items:[{
html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
}]
}] }]
}], }],
} }

306
lib/controller/getScadaEditor.php

@ -0,0 +1,306 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/argus/server.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['MID'] );
$QS = "SELECT * FROM `modbus_modules` WHERE `id`={$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$SC = $Result[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: 'form',
labelWidth: 150,
labelAlign: 'right',
width: '100%',
items:[{
xtype: 'panel',
border: false,
frame: false,
html: '<table width="100%" border=0><tr><td class="small_prop_logo" id="adam">&nbsp;</td><td class="small_prop_title" align="center">{$Labels->GetLabel('_MODBUS_RTU_')}:{$SC['label']}</td></tr></table>'
},{
xtype: 'textfield',
id: 'sca_label',
fieldLabel: '{$Labels->GetLabel('_NAME_LABEL_')}',
maxlength: 64,
value: '{$SC['label']}',
listeners:{
change: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 14, c, true );
}
}
},{
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']}',
fwidth: 200,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 17, b, true );
}
}
},{
xtype: 'textfield',
id: 'sca_ip',
fieldLabel: '{$Labels->GetLabel('_DEVICE_IP_')}',
maxlength: 64,
value: '{$SC['ip4']}',
listeners:{
change: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 15, c, true );
}
}
},{
xtype: 'textfield',
id: 'sca_port',
fieldLabel: '{$Labels->GetLabel('_DEVICE_PORT_')}',
maxlength: 2,
value: '{$SC['port']}',
listeners:{
change: function( a, c, b ){
doPlatformOperation( {$SC['platform_id']}, 16, c, true );
}
}
},{
xtype: 'panel',
layout: 'table',
border: false,
frame: false,
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: 100,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$SC['platform_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: 100,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$SC['platform_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: 100,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$SC['platform_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: 100,
listeners:{
select: function( a, c, b ){
//doPlatformOperation( {$SC['platform_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( {$SC['platform_id']}, 18, ({$CCCV} | 1 ), true );
} else {
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~1 ) ), true );
};
}
},{
xtype: 'button',
width: '80%',
enableToggle: true,
allowDepress: true,
text: 'Test D2',
pressed: {$P2},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 2 ), true );
} else {
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~2 ) ), true );
};
}
},{
xtype: 'button',
enableToggle: true,
allowDepress: true,
width: '80%',
text: 'Test D3',
pressed: {$P3},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 4 ), true );
} else {
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~4 ) ), true );
};
}
},{
xtype: 'button',
enableToggle: true,
allowDepress: true,
width: '80%',
text: 'Test D4',
pressed: {$P4},
handler: function( b, e ){
if( b.pressed ){
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 8 ), true );
} else {
doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~8 ) ), true );
};
}
}]
},{
xtype: 'spacer',
height: 5,
colspan: 4
},{
xtype: 'button',
text: 'Remove this Scada Module',
width: '100%',
handler: function(){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 13, 'true', true );
}
}]
}
DATA_BOUNDARY;
echo $MODBUS;
} else {
echo '{ xtype: \'panel\', html: \'Node '.$_POST['EID'].' Loadded\'}';
};
} else {
header('location: /');
};
?>

23
lib/controller/getScadaModules.php

@ -0,0 +1,23 @@
<?php
require_once('../ajax_asm.php');
ob_start();
if( $CUser->Data['id'] > 1 ){
$Data['status'] = 'na';
$EID = intval( $_POST['PID'] );
$QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$SenPart = array();
foreach( $Result as $R ){
$AA = ($R['wm']=='E')?'active_green':'active_gray';
$SenPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item '.$AA.'" onclick="editScadaModule('.$R['id'].');">'.$R['ip4'].' '.urldecode($R['label']).'</a>\'}';
};
$Data['status']='ok';
$Data['modules'] = '['.implode( ',', $SenPart ) .']';
};
$Data['messages'] = ob_get_clean();
echo json_encode( $Data );
} else {
header('location: /');
};
?>

13
lib/controller/getSessionData.php

@ -33,9 +33,14 @@
$Data['events']= array(); $Data['events']= array();
$Data['videos']= array(); $Data['videos']= array();
$Data['data_ok'] = true; $Data['data_ok'] = true;
echo $SYSPath . $Data['basepath'] .'/reports.db';
$RBASE = new SQLite_DB( $SYSPath . $Data['basepath'] .'/report.db' );
$QS = "SELECT * FROM `events` WHERE `session_id`={$SESID} AND `evt_type` IN(13,14,36) ORDER BY `ts`*1000+`ts_ms` ASC";
$DBN = $SYSPath . $Data['basepath'] .'/report.db';
//echo $DBN;
//if( !file_exists( $DBN )) echo "Not Exist!!";
$RBASE = new SQLite_DB( $DBN );
//$QS = "SELECT COUNT(`id`) FROM `events`";
//$RR = $RBASE->Query( $QS );
//print_r( $RR );
$QS = "SELECT * FROM `events` WHERE `session_id`={$SESID} AND `evt_type` IN(13,14,36) ORDER BY (`ts`*1000+`ts_ms`) ASC";
$RR = $RBASE->Query( $QS ); $RR = $RBASE->Query( $QS );
foreach( $RR as $CR ){ foreach( $RR as $CR ){
$CE = array(); $CE = array();
@ -65,7 +70,7 @@
foreach( $RR as $CR ){ foreach( $RR as $CR ){
$CV = array(); $CV = array();
$CV['id']=intval($CR['id']); $CV['id']=intval($CR['id']);
$CV['sts']=intval($CR['ts'])*1000+intval($CR['ts_ms'])+7000;
$CV['sts']=intval($CR['ts'])*1000+intval($CR['ts_ms']);
if( $Data['start_ts'] > $CV['sts'] ) $Data['start_ts'] = $CV['sts']; if( $Data['start_ts'] > $CV['sts'] ) $Data['start_ts'] = $CV['sts'];
$CV['ets'] = $CV['sts']+60000; $CV['ets'] = $CV['sts']+60000;
//Check if Session was ended before Video Ends //Check if Session was ended before Video Ends

39
lib/controller/getStationEditor.php

@ -80,6 +80,45 @@ JOJOKA;
height: PanelH - 190, height: PanelH - 190,
activeTab: 0, activeTab: 0,
items:[{ items:[{
xtype: 'panel',
title: '{$Labels->GetLabel('_GENERAL_')}',
items: [{
xtype: 'form',
id: 'st_general_map',
height: PanelH - 190,
labelWidth: 200,
labelAlign: 'right',
width: '100%',
items:[{
xtype: 'textfield',
width: '70%',
fieldLabel: '{$Labels->GetLabel('_STATION_NAME_')}',
id: 'st_long_name',
value: '{$CR['name']}',
listeners:{
change: function( a, c, b ){
doStationOperation( {$CR['id']}, 6, c, true );
}
}
},{
xtype: 'textfield',
width: '70%',
fieldLabel: '{$Labels->GetLabel('_STATION_NAME_SHORT_')}',
id: 'st_short_name',
value: '{$CR['short']}',
listeners:{
change: function( a, c, b ){
doStationOperation( {$CR['id']}, 7, c, true );
}
}
}],
listeners:{
afterrender: function(){
// inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
}
}
}]
},{
xtype: 'panel', xtype: 'panel',
title: '{$Labels->GetLabel('_SMM_SCH_LOCATION_')}', title: '{$Labels->GetLabel('_SMM_SCH_LOCATION_')}',
items: [{ items: [{

18
lib/controller/getStatus.php

@ -13,7 +13,10 @@
if( $Data['LTS'] == 0 ) $Data['LTS'] = floor(microtime(true) * 1000);//time(); if( $Data['LTS'] == 0 ) $Data['LTS'] = floor(microtime(true) * 1000);//time();
$ALRM_STATIONS = array(); $ALRM_STATIONS = array();
//Data for Side Panel //Data for Side Panel
$QS = "SELECT * FROM `sessions` WHERE `final`='N' ORDER BY (`ts`*1000)+`ts_ms` DESC LIMIT 32";
$QS = "SELECT count( `id` ) AS `cnt` FROM `sessions` WHERE `final`='N'";
$RR = $DATABASE->Query( $QS );
$Data['actual_count'] =intval($RR[0]['cnt']);
$QS = "SELECT * FROM `sessions` WHERE `final`='N' ORDER BY (`ts`*1000+`ts_ms`) DESC LIMIT 32";
$RR = $DATABASE->Query( $QS ); $RR = $DATABASE->Query( $QS );
if( count( $RR ) ){ if( count( $RR ) ){
if( $Data['active_session_id']==0 ) $Data['active_session_id'] = intval( $RR[0]['id'] ); if( $Data['active_session_id']==0 ) $Data['active_session_id'] = intval( $RR[0]['id'] );
@ -22,11 +25,11 @@
$CA = array(); $CA = array();
$CA['id']=intval($R['id'] ); $CA['id']=intval($R['id'] );
$CA['track']=intval( $R['track_id'] ); $CA['track']=intval( $R['track_id'] );
$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']}";
$QS = "SELECT `st`.`id` AS `s_id`, `st`.`short` 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 ); $GG = $DATABASE->Query( $QS );
$CA['station_name']=$GG[0]['s_name']; $CA['station_name']=$GG[0]['s_name'];
$CA['station']=intval( $GG[0]['s_id'] ); $CA['station']=intval( $GG[0]['s_id'] );
$CA['platform_name']=date( "H:i:s", $R['ts']);//$GG[0]['p_name'];
$CA['platform_name']=date( "M d H:i:s", $R['ts']);//$GG[0]['p_name'];
$CA['platform']=intval( $GG[0]['p_id'] ); $CA['platform']=intval( $GG[0]['p_id'] );
$CA['track_tag']=$GG[0]['short']; $CA['track_tag']=$GG[0]['short'];
$CA['status']=0; $CA['status']=0;
@ -35,7 +38,10 @@
}; };
$Data['actual'] = array_reverse( $Data['actual'] ); $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";
$QS = "SELECT count( `id` ) AS `cnt` FROM `sessions` WHERE `final`='Y' AND `status`=0";
$RR = $DATABASE->Query( $QS );
$Data['expired_count']=intval($RR[0]['cnt']);
$QS = "SELECT * FROM `sessions` WHERE `final`='Y' AND `status`=0 ORDER BY (`ts`*1000+`ts_ms`) DESC LIMIT 32";
$RR = $DATABASE->Query( $QS ); $RR = $DATABASE->Query( $QS );
if( count( $RR ) ){ if( count( $RR ) ){
$Data['expired'] = array(); $Data['expired'] = array();
@ -43,10 +49,10 @@
$CA = array(); $CA = array();
$CA['id']=intval($R['id'] ); $CA['id']=intval($R['id'] );
$CA['track']=intval( $R['track_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`.`short` 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 ); $GG = $DATABASE->Query( $QS );
$CA['station_name']=$GG[0]['s_name']; $CA['station_name']=$GG[0]['s_name'];
$CA['platform_name']=date( "H:i:s", $R['ts']);//$GG[0]['p_name'];
$CA['platform_name']=date( "M d H:i:s", $R['ts']);//$GG[0]['p_name'];
$CA['track_tag']=$GG[0]['short']; $CA['track_tag']=$GG[0]['short'];
$CA['status']=1; $CA['status']=1;
$Data['expired'][] = $CA; $Data['expired'][] = $CA;

196
lib/controller/getVideoComposerSettings.php

@ -0,0 +1,196 @@
<?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: 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">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 ){
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',"30 Seconds"],['2',"1 Minute"], ['3',"2 Minutes"], ['4',"3 Minutes"], ['5',"4 Minutes"],['6',"5 Minutes"]]
}),
valueField: 'cid',
displayField: 'cnam',
listeners:{
focus: function( t ){
loadHelpTopic( 'application_op_small', 33 );
},
select: function( t, r, i ){
doApplicationOperation( 6, r.data.cid );
}
},
value: '{$CS['session_end']}'
},{
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 ){
doApplicationOperation( 7, r.data.cid );
}
},
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 ){
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 ){
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 ){
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: /');
};
?>

24
lib/javascript/jsapi_dynamic/argus_main.js

@ -143,18 +143,18 @@ function stopStatusUpdater(){
}; };
function failureAJAXFunction( responce, opts ){ 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();
//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 doUserOperation( OPId, Param, reload ){ function doUserOperation( OPId, Param, reload ){

395
lib/javascript/jsapi_dynamic/argus_monitoring.js

@ -8,7 +8,6 @@ var mon_selectedPlatform = 0;
var mon_selectedStation = 0; var mon_selectedStation = 0;
var mon_selectedTrack = 0; var mon_selectedTrack = 0;
var mon_selectedModule = 0; var mon_selectedModule = 0;
var mon_platform_train = 0;
var autoRiseEvent = true; var autoRiseEvent = true;
var activeEvents = []; var activeEvents = [];
var expiredEvents = []; var expiredEvents = [];
@ -318,8 +317,6 @@ function loadPlatformView( pid, buba ){
autoRiseEvent = buba; autoRiseEvent = buba;
}; };
if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); if( mon_selectedEventId ) unselectEvent( mon_selectedEventId );
mon_platform_train = 0;
mTrainSvgElements = [];
mon_selectedPlatform = pid; mon_selectedPlatform = pid;
changeContent( 1, 2, pid ); changeContent( 1, 2, pid );
updateUserContent(); updateUserContent();
@ -446,8 +443,6 @@ function loadModuleView( pid, mid ){
}; };
function loadMapView(){ function loadMapView(){
changeContent( 0, 0, 0 );
updateUserContent();
autoRiseEvent = false; autoRiseEvent = false;
if( mon_selectedEventId ) unselectEvent( mon_selectedEventId ); if( mon_selectedEventId ) unselectEvent( mon_selectedEventId );
Ext.Ajax.request({ Ext.Ajax.request({
@ -535,27 +530,52 @@ function initMonitoring( x, y ){
border: false, border: false,
items:[{ items:[{
width: "100%", width: "100%",
html: '<div class="mon_side_tag">Active Alerts</div>'
height: 42,
html: '<div id="a_title" class="mon_side_tag">Active Alerts</div>'
},{ },{
id: 'sme_inner', id: 'sme_inner',
layout:'vbox',
width: '100%',
height: PanelH/2,
autoScroll: true ,
//layout:'vbox',
width: "100%",
height: PanelH/2-24,
frame: false, frame: false,
border: false, border: false,
items:[]
autoScroll: true,
cls: 'thin-scrollbar',//'hide-scrollbar', // Apply the CSS class
items:[],
listeners: {
render: function(p) {
p.body.on('scroll', function(e, t) {
if (t.scrollTop + t.clientHeight >= t.scrollHeight) {
console.log('A Scrolled to end!');
// Handle reaching the bottom here
};
});
}
}
},{ },{
width: "100%", width: "100%",
html: '<div class="mon_side_tag">Expired Alerts</div>'
height: 42,
html: '<div id="e_title" class="mon_side_tag">Expired Alerts</div>'
},{ },{
id: 'sme_outer', id: 'sme_outer',
layout:'vbox',
width: '100%',
height: 1000,//PanelH/2,
//layout:'vbox',
width: "100%",
height: PanelH/2-24,
frame: false, frame: false,
border: false,
items:[]
border: true,
autoScroll: true,
cls: 'thin-scrollbar',//'hide-scrollbar', // Apply the CSS class
items:[],
listeners: {
render: function(p) {
p.body.on('scroll', function(e, t) {
if (t.scrollTop + t.clientHeight >= t.scrollHeight) {
console.log('E Scrolled to end!');
// Handle reaching the bottom here
};
});
}
}
}] }]
}); });
tP.doLayout(); tP.doLayout();
@ -563,11 +583,6 @@ function initMonitoring( x, y ){
switch( monitoringViewLevel ){ switch( monitoringViewLevel ){
case 0:{ case 0:{
loadMapView(); loadMapView();
autoRiseEvent = true;
var tt = Ext.getCmp('aer_button');
if( tt != undefined ){
tt.toggle( true, true );
}
break; break;
}; };
case 1:{ case 1:{
@ -632,11 +647,10 @@ function manageSideTags( tag_area, buba ){
}; };
}; };
if( !f ){ if( !f ){
var ichu = createEventTagContent( buba[zz] );
tP.insert( 0,{ tP.insert( 0,{
id: 'tag_panel_'+buba[zz].id, id: 'tag_panel_'+buba[zz].id,
width: '100%',
html: ichu
width: "100%",
html: createEventTagContent( buba[zz] )
}); });
tt++; tt++;
}; };
@ -675,192 +689,12 @@ function manageSideTags( tag_area, buba ){
}; };
}; };
tP.doLayout(); tP.doLayout();
}; };
}; };
var mSvgElements = []; var mSvgElements = [];
var mTrainSvgElements=[];
function animateTrainOnPlatform( _in, _out ){
if( ( _out & 3 ) > 0 ){
if( typeof mTrainSvgElements[0] === 'undefined') {
switch( _out & 3 ) {
case 1:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[0].setAttribute('x', '1550');
mTrainSvgElements[0].setAttribute('y', '50' );
mTrainSvgElements[0].setAttribute('rx','5' );
mTrainSvgElements[0].setAttribute('height', ''+100);
mTrainSvgElements[0].setAttribute('width', ''+540);
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '2000' );
anim1.setAttribute('to', '1100' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[0].appendChild( anim1 );
mTrainSvgElements[0].appendChild( anim2 );
break;
};
case 2:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[0].setAttribute('x', '-550');
mTrainSvgElements[0].setAttribute('y', '50' );
mTrainSvgElements[0].setAttribute('rx','5' );
mTrainSvgElements[0].setAttribute('height', ''+100);
mTrainSvgElements[0].setAttribute('width', ''+540);
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '-550' );
anim1.setAttribute('to', '300' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[0].appendChild( anim1 );
mTrainSvgElements[0].appendChild( anim2 );
break;
};
case 3:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[0] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[0].setAttribute('x', '700');
mTrainSvgElements[0].setAttribute('y', '50' );
mTrainSvgElements[0].setAttribute('rx','5' );
mTrainSvgElements[0].setAttribute('height', ''+100);
mTrainSvgElements[0].setAttribute('width', ''+540);
mTrainSvgElements[0].setAttribute('fill', '#FF0000FF');
var anim = document.createElementNS(svgns, 'animate');
anim.setAttribute('dur', '3s' );
anim.setAttribute('attributeName', 'opacity' );
anim.setAttribute('from', '0' );
anim.setAttribute('to', '1' );
anim.setAttribute('calcMode','linear' );
anim.setAttribute('fill', 'freeze' );
mTrainSvgElements[0].appendChild( anim );
};
};
var tt = document.getElementById('svgTrackMap');
tt.appendChild( mTrainSvgElements[0] );
} else {
};
} else {
if( typeof mTrainSvgElements[0] != 'undefined') {
var tt = document.getElementById('svgTrackMap');
tt.removeChild( mTrainSvgElements[0] );
mTrainSvgElements[0] = null;
};
};
if( ( _out & 12 ) > 0 ){
if( typeof mTrainSvgElements[1] === 'undefined') {
switch( ( _out >> 2 ) ) {
case 2:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[1].setAttribute('x', '1550');
mTrainSvgElements[1].setAttribute('y', '550' );
mTrainSvgElements[1].setAttribute('rx','5' );
mTrainSvgElements[1].setAttribute('height', ''+100);
mTrainSvgElements[1].setAttribute('width', ''+540);
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '2000' );
anim1.setAttribute('to', '1100' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[1].appendChild( anim1 );
mTrainSvgElements[1].appendChild( anim2 );
break;
};
case 1:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[1].setAttribute('x', '-550');
mTrainSvgElements[1].setAttribute('y', '550' );
mTrainSvgElements[1].setAttribute('rx','5' );
mTrainSvgElements[1].setAttribute('height', ''+100);
mTrainSvgElements[1].setAttribute('width', ''+540);
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF');
var anim1 = document.createElementNS(svgns, 'animate');
anim1.setAttribute('dur', '3s' );
anim1.setAttribute('attributeName', 'x' );
anim1.setAttribute('from', '-550' );
anim1.setAttribute('to', '300' );
anim1.setAttribute('calcMode', 'linear' );
anim1.setAttribute('fill', 'freeze' );
var anim2 = document.createElementNS(svgns, 'animate');
anim2.setAttribute('dur', '3s' );
anim2.setAttribute('attributeName', 'opacity' );
anim2.setAttribute('from', '0' );
anim2.setAttribute('to', '1' );
anim2.setAttribute('calcMode','linear' );
anim2.setAttribute('fill', 'freeze' );
mTrainSvgElements[1].appendChild( anim1 );
mTrainSvgElements[1].appendChild( anim2 );
break;
};
case 3:{
var svgns = "http://www.w3.org/2000/svg";
mTrainSvgElements[1] = document.createElementNS(svgns, 'rect');
mTrainSvgElements[1].setAttribute('x', '700');
mTrainSvgElements[1].setAttribute('y', '550' );
mTrainSvgElements[1].setAttribute('rx','5' );
mTrainSvgElements[1].setAttribute('height', ''+100);
mTrainSvgElements[1].setAttribute('width', ''+540);
mTrainSvgElements[1].setAttribute('fill', '#FF0000FF');
var anim = document.createElementNS(svgns, 'animate');
anim.setAttribute('dur', '3s' );
anim.setAttribute('attributeName', 'opacity' );
anim.setAttribute('from', '0' );
anim.setAttribute('to', '1' );
anim.setAttribute('calcMode','linear' );
anim.setAttribute('fill', 'freeze' );
mTrainSvgElements[1].appendChild( anim );
};
};
var tt = document.getElementById('svgTrackMap');
tt.appendChild( mTrainSvgElements[1] );
} else {
};
} else {
if( typeof mTrainSvgElements[1] != 'undefined') {
var tt = document.getElementById('svgTrackMap');
tt.removeChild( mTrainSvgElements[1] );
mTrainSvgElements[1] = null;
};
};
};
function fetchStatus(){ function fetchStatus(){
if( tlInterval!= null ){ if( tlInterval!= null ){
window.clearTimeout( tlInterval ); window.clearTimeout( tlInterval );
@ -1149,18 +983,15 @@ function fetchStatus(){
for( var i=0; i< max_grad_levels; i++ ) for( var i=0; i< max_grad_levels; i++ )
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000'); if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000');
}; };
if( data.train != undefined ){
if( mon_platform_train != data.train.status ){
animateTrainOnPlatform( mon_platform_train, data.train.status );
mon_platform_train = data.train.status;
};
if( data.scada != undefined ){
}; };
break; break;
}; };
case 3:{ // Track case 3:{ // Track
if( data.active_session_id != undefined ){ if( data.active_session_id != undefined ){
if( data.active_session_id > 0 ){ if( data.active_session_id > 0 ){
if( mon_selectedEventId != data.active_session_id ){
if( mon_selectedEventId != data.active_session_id ){
mon_selectedEventId = data.active_session_id; mon_selectedEventId = data.active_session_id;
monitoringActiveSession = true; monitoringActiveSession = true;
for( var zz=0; zz< activeEvents.length; zz++ ){ for( var zz=0; zz< activeEvents.length; zz++ ){
@ -1186,36 +1017,16 @@ function fetchStatus(){
}; };
} else { } else {
if( mon_selectedEventId ){ if( mon_selectedEventId ){
var d = true;
for( var zz=activeEvents.length-1; zz> -1; zz-- ){
if( activeEvents[zz].id != mon_selectedEventId ){
selectEvent( activeEvents[zz].id, false );
d = false;
break;
};
};
if( d ){
mon_selectedEventId = 0;
monitoringActiveSession = false;
tt=document.getElementById('trx_status_txt');
tt.classList.remove('blinking_status_text');
tt.classList.add('static_status_text');
tt.innerText = 'LIVE VEW';
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.remove('top_status_red_lbl');
tt.classList.add('top_status_green_lbl');
var tv = Ext.getCmp('trx_view');
if( tv != undefined ){
var tt = Ext.getCmp('sets_ui');
if( tt != undefined ){
tv.remove( tt );
};
tv.doLayout();
};
for( var i=0; i< max_grad_levels; i++ )
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000');
};
mon_selectedEventId = 0;
monitoringActiveSession = false;
tt=document.getElementById('trx_status_txt');
tt.classList.remove('blinking_status_text');
tt.classList.add('static_status_text');
tt.innerText = 'LIVE VEW';
tt=document.getElementById('trx_status_cell');
tt.classList.remove('top_status_hidden');
tt.classList.remove('top_status_red_lbl');
tt.classList.add('top_status_green_lbl');
}; };
}; };
}; };
@ -1281,8 +1092,24 @@ function fetchStatus(){
break; break;
}; };
}; };
manageSideTags('sme_inner', data.actual );
manageSideTags('sme_outer', data.expired );
var tt = document.getElementById('a_title');
if( tt != null ){
if( data.actual_count > 0 ){
tt.innerHTML = 'Active Alerts<br/>['+data.actual_count+']';
} else {
tt.innerHTML = 'Active Alerts';
};
manageSideTags('sme_inner', data.actual );
};
if( tt != null ){
tt = document.getElementById('e_title');
if( data.expired_count > 0 ){
tt.innerHTML = 'Expired Alerts<br/>['+data.expired_count+']';
} else {
tt.innerHTML = 'Expired Alerts';
};
manageSideTags('sme_outer', data.expired );
};
}; };
}; };
tlInterval = window.setTimeout( fetchStatus, 333, selectedSite ); tlInterval = window.setTimeout( fetchStatus, 333, selectedSite );
@ -1297,38 +1124,39 @@ function selectEvent( ii, bb ){
window.clearTimeout( tlInterval ); window.clearTimeout( tlInterval );
tlInterval = null; tlInterval = null;
}; };
if( bb ){
for( var zz=0; zz< expiredEvents.length; zz++ ){
var tP = document.getElementById('event_tag_'+expiredEvents[zz].id );
if( tP != undefined ){
tP.className ='';
if( expiredEvents[zz].id == mon_selectedEventId ){
monitoringActiveSession = false;
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
};
for( var zz=0; zz< expiredEvents.length; zz++ ){
var tP = document.getElementById('event_tag_'+expiredEvents[zz].id );
if( tP != undefined ){
tP.className ='';
if( expiredEvents[zz].id == mon_selectedEventId ){
monitoringActiveSession = false;
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
}; };
}; };
loadMonitoringSessionView( ii );
} else {
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 ){
monitoringActiveSession = true;
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
};
};
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 ){
monitoringActiveSession = true;
tP.classList.add("evt_side_tag_selected");
} else {
tP.classList.add("evt_side_tag");
}; };
}; };
};
if( bb ){
loadMonitoringSessionView( ii );
} else {
loadTrackViewBySession( ii ); loadTrackViewBySession( ii );
}; };
}; };
function setSessionStatus( a , b, autoremove ){ function setSessionStatus( a , b, autoremove ){
if( autoremove ) alert( 'Autoremove' );
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/doSessionOperations.php', url: '/lib/controller/doSessionOperations.php',
params: { params: {
@ -1341,33 +1169,14 @@ function setSessionStatus( a , b, autoremove ){
success: function( response, opts ){ success: function( response, opts ){
var data = Ext.decode(response.responseText); var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){ if( data.status == 'ok' ){
if( autoremove ){
//On Expired
var d = true;
for( var zz=expiredEvents.length-1; zz> -1; zz-- ){
if( expiredEvents[zz].id != mon_selectedEventId ){
selectEvent( expiredEvents[zz].id, true );
d = false;
break;
};
};
if( d ){
loadMapView();
autoRiseEvent = true;
var tt = Ext.getCmp('aer_button');
if( tt != undefined ) tt.toggle( true, true );
};
} else {
// On LiveSession
var tv = Ext.getCmp('trx_view');
if( tv != undefined ){
var tt = Ext.getCmp('sets_ui');
if( tt != undefined ){
tv.remove( tt );
};
tv.add( Ext.decode( data.content ) );
tv.doLayout();
var tv = Ext.getCmp('trx_view');
if( tv != undefined ){
var tt = Ext.getCmp('sets_ui');
if( tt != undefined ){
tv.remove( tt );
}; };
tv.add( Ext.decode( data.content ) );
tv.doLayout();
}; };
}; };
}, },

20
lib/javascript/jsapi_dynamic/argus_reports.js

@ -1216,7 +1216,7 @@ function ts2dts( b ){
return date + ' ' + month + ' ' + year + ' ' + hour + ':' + min.substr(-2) + ':' + sec.substr(-2) ; return date + ' ' + month + ' ' + year + ' ' + hour + ':' + min.substr(-2) + ':' + sec.substr(-2) ;
}; };
function drawEventsOnSlider( a, b , z ){
function drawSessionDataOnSlider( a, b , z, v ){
var cel = Ext.getCmp("hpl_slider").getEl(); var cel = Ext.getCmp("hpl_slider").getEl();
var c = document.createElement('canvas'); var c = document.createElement('canvas');
var ctx = c.getContext('2d'); var ctx = c.getContext('2d');
@ -1227,11 +1227,18 @@ function drawEventsOnSlider( a, b , z ){
ctx.fillStyle='#00000000'; ctx.fillStyle='#00000000';
//ctx.fillStyle='#00FF00'; //ctx.fillStyle='#00FF00';
ctx.fillRect( 7, 0,cel.getWidth(),cel.getHeight());
ctx.fillRect( 7, 0, cel.getWidth(), cel.getHeight() );
ctx.fillStyle='#FF0000'; ctx.fillStyle='#FF0000';
for( var i=0; i< z.length; i++ ){ for( var i=0; i< z.length; i++ ){
var cX = 7 + Math.round( tK * ( z[i].ts /1000 - a ) ); var cX = 7 + Math.round( tK * ( z[i].ts /1000 - a ) );
ctx.fillRect( cX, 0, rib, 25 );
ctx.fillRect( cX, 0, rib, 12 );//25
};
ctx.fillStyle='#0000FF';
for( var i=0; i< v.length; i++ ){
var cX = 7 + Math.round( tK * ( v[i].sts /1000 - a ) );
var cD = 7 + Math.round( tK * ( v[i].ets /1000 - a ) );
var cW = cD - cX;
ctx.fillRect( cX, 13, cW, 25 );
}; };
cel.setStyle('background','url(' + c.toDataURL() + ')'); cel.setStyle('background','url(' + c.toDataURL() + ')');
}; };
@ -1270,7 +1277,7 @@ class argusSessionPlayer{
mTimer = null; mTimer = null;
mPaused = true; mPaused = true;
mLooping = true; mLooping = true;
mSvgElements;
mSvgElements;//076.png
constructor( session_id ) { constructor( session_id ) {
this.sessionId = session_id; this.sessionId = session_id;
this.currentTime = 0; this.currentTime = 0;
@ -1318,7 +1325,8 @@ class argusSessionPlayer{
var tt = Ext.getCmp('hpl_slider'); var tt = Ext.getCmp('hpl_slider');
tt.setMinValue( 0 ); tt.setMinValue( 0 );
tt.setMaxValue( data.length / 1000 ); tt.setMaxValue( data.length / 1000 );
drawEventsOnSlider( mSesPlay.startTime/1000, mSesPlay.endTime/1000, data.events );
drawSessionDataOnSlider( mSesPlay.startTime/1000, mSesPlay.endTime/1000, data.events, data.videos );
//player.on('ended', function() { //player.on('ended', function() {
// this.dispose(); // this.dispose();
//}); //});
@ -1835,7 +1843,7 @@ function initReportsView(){
frame: true, frame: true,
border: false, border: false,
items: [{ items: [{
html: '<div class="setEd_infoPanel" id="NANA"><?=$Labels->GetLabel('_PLS_SEL_STA_ONMAP_');?></div>',
html: '<div class="setEd_infoPanel" id="NANA"><?=$Labels->GetLabel("_PLS_SEL_STA_ONMAP_");?></div>',
height: PanelH - 30 height: PanelH - 30
}] }]
}] }]

163
lib/javascript/jsapi_dynamic/argus_settings.js

@ -1016,6 +1016,22 @@ function doPlatformOperation( PlatformID, operation, param, reload ){
}); });
}; };
function doScadaOperation( PlatformID, ScadaID, operation, param, reload ){
Ext.Ajax.request({
url: '/lib/controller/doPlatformOperations.php',
params: {
ID: PlatformID,
SCA: ScadaID,
OPID: operation,
OPCODE: param,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function(){
if( reload ) loadSCADAModules( SelectedPlatform, SelectedScadaModule );
}
});
};
function removeModule( ID ){ function removeModule( ID ){
Ext.Msg.show({ Ext.Msg.show({
@ -1257,6 +1273,92 @@ function addModule(){
failure: failureAJAXFunction failure: failureAJAXFunction
}); });
}; };
var addScadaModuleWindow = null;
function addScadaModule(){
if( addScadaModuleWindow == null ){
addScadaModuleWindow = new Ext.Window({
title: "<?=$Labels->GetLabel( '_ADD_SCADA_MODULE_' );?>",
modal: true,
width: 400,
height: 148,
closeAction: 'hide',
resizable: false,
items:[{
xtype: 'form',
labelAlign: 'right',
border: false,
frame: false,
items: [{
id: 'scm_dev_name',
xtype: 'textfield',
fieldLabel: "<?=$Labels->GetLabel( '_NAME_LABEL_' );?>",
value: ''
},{
id: 'scm_dev_ip',
xtype: 'textfield',
minLength: 7,
maxLength: 15,
fieldLabel: "<?=$Labels->GetLabel( '_DEVICE_IP_' );?>",
value: ''
},{
xtype: 'numberfield',
id: 'scm_dev_port',
maxValue: 65535,
minValue: 27,
fieldLabel: "<?=$Labels->GetLabel( '_DEVICE_PORT_' );?>",
value: '502'
}]
}],
bbar:['->',{
text: '<?=$Labels->GetLabel( '_CANCEL_' );?>',
handler: function(){
addScadaModuleWindow.hide();
}
},{
text: '<?=$Labels->GetLabel( '__ADD__' );?>',
handler: function(){
var mod_name = Ext.getCmp('scm_dev_name').getValue();
var mod_ip = Ext.getCmp('scm_dev_ip').getValue();
var mod_port = Ext.getCmp('scm_dev_port').getValue();
Ext.Ajax.request({
url: '/lib/controller/doPlatformOperations.php',
params: {
OPID: 12,
ID: SelectedPlatform,
MIP: mod_ip,
MPO: mod_port,
MNA: mod_name,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.success ){
addScadaModuleWindow.close();
loadSCADAModules();
} else {
Ext.Msg.show({
title: "<?=$Labels->GetLabel("_ERROR_MSG_");?>",
msg: data.msg,
buttons: Ext.Msg.OK,//YESNOCANCEL,
fn: function(){
//SettingsLidar3D.hide();
},
icon: Ext.MessageBox.ERROR //QUESTION
});
};
}
});
}
}]
});
};
Ext.getCmp('scm_dev_name').setValue( '' );
Ext.getCmp('scm_dev_ip').setValue( '' );
Ext.getCmp('scm_dev_port').setValue( 502 );
addScadaModuleWindow.show();
};
function addFilter(){ function addFilter(){
var addFilterWindow = new Ext.Window({ var addFilterWindow = new Ext.Window({
@ -2150,6 +2252,67 @@ function showSettingsUpgrade(){
updateTaskStatus(); updateTaskStatus();
tlInterval = window.setInterval( updateTaskStatus, 333 ); tlInterval = window.setInterval( updateTaskStatus, 333 );
}; };
var SelectedScadaModule = 0;
function loadSCADAModules( platform_id, suse ){
if( suse == undefined ){
suse = 0;
};
Ext.Ajax.request({
url: '/lib/controller/getScadaModules.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
PID: platform_id
},
success: function( response, opts ){
var tData = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('scada_container');
if( tData.status == 'ok' ){
tPanel.removeAll( true );
var res = Ext.decode( tData.modules );
tPanel.add( res );
tPanel.doLayout();
if( suse == 0 ){
var zPanel = Ext.getCmp('scada_op_small');
zPanel.removeAll( true );
zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
zPanel.doLayout();
} else {
editScadaModule( suse );
};
} else {
tPanel.removeAll( true );
tPanel.doLayout();
var zPanel = Ext.getCmp('scada_op_small');
zPanel.removeAll( true );
zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
zPanel.doLayout();
};
},
failure: failureAJAXFunction
});
};
function editScadaModule( smid ){
SelectedScadaModule = smid;
Ext.Ajax.request({
url: '/lib/controller/getScadaEditor.php',
params: {
MID: SelectedScadaModule,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var tComp = Ext.getCmp('scada_op_small');
if( tComp!= null ){
tComp.removeAll( true );
tComp.add( data );
tComp.doLayout();
};
}
});
};
function loadSensorDetectionSettings( sensid ){ function loadSensorDetectionSettings( sensid ){

4
lib/php/argus/templates.php

@ -490,7 +490,7 @@ DATA_BOUNDARY;
$VIDEOJS_CTX=<<<DATA_BOUNDARY $VIDEOJS_CTX=<<<DATA_BOUNDARY
{ {
xtype: 'panel', xtype: 'panel',
title: '%%%TITLE%%%',
//title: '%%%TITLE%%%',
headerStyle: 'text-align:center', headerStyle: 'text-align:center',
items:[{ items:[{
id: 'j_video_%%MID%%', id: 'j_video_%%MID%%',
@ -504,7 +504,7 @@ $VIDEOJS_CTX=<<<DATA_BOUNDARY
var xx = zz.getInnerWidth() * 450 / 1600; var xx = zz.getInnerWidth() * 450 / 1600;
var yy = xx * 1600 / 900; var yy = xx * 1600 / 900;
p.setWidth( yy ); p.setWidth( yy );
p.setHeight( xx + 32 );
p.setHeight( xx );//+32
var z = Ext.getCmp('j_video_%%MID%%'); var z = Ext.getCmp('j_video_%%MID%%');
z.setHeight( xx ); z.setHeight( xx );
z.setWidth( yy ); z.setWidth( yy );

4
lib/php/ui/UI_functions.php

@ -88,7 +88,7 @@ function UI_PageHeader(){
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title><?=$Labels->GetLabel('_SITE_TITLE_');?></title> <title><?=$Labels->GetLabel('_SITE_TITLE_');?></title>
<meta name="description" CONTENT="<?=$Labels->GetLabel('_SITE_DESCRIPT_');?>"> <meta name="description" CONTENT="<?=$Labels->GetLabel('_SITE_DESCRIPT_');?>">
<base href="<?=$WEBPath;?>">
<!--base href="<?=$WEBPath;?>"-->
<meta name="robots" content="index, follow"/> <meta name="robots" content="index, follow"/>
<meta name="keywords" content=""/> <meta name="keywords" content=""/>
<link rel="stylesheet" type="text/css" href="style/style.css"/> <link rel="stylesheet" type="text/css" href="style/style.css"/>
@ -171,7 +171,7 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
<title><?=$Labels->GetLabel('_SITE_TITLE_');?></title> <title><?=$Labels->GetLabel('_SITE_TITLE_');?></title>
<meta name="description" CONTENT="<?=$Labels->GetLabel('_SITE_DESCRIPT_');?>"> <meta name="description" CONTENT="<?=$Labels->GetLabel('_SITE_DESCRIPT_');?>">
<!--meta http-equiv="refresh" content="600"--> <!--meta http-equiv="refresh" content="600"-->
<base href="<?=$WEBPath;?>">
<!--base href="<?=$WEBPath;?>"-->
<meta name="robots" content="index, follow"/> <meta name="robots" content="index, follow"/>
<meta name="keywords" content=""/> <meta name="keywords" content=""/>

2
lib/settings.php

@ -3,7 +3,7 @@
$DBName="argus"; $DBName="argus";
$DBUser="argus"; $DBUser="argus";
$DBPassword="Jc8zYWEhqGAGGYJRum92tm"; $DBPassword="Jc8zYWEhqGAGGYJRum92tm";
$SYSPath="/srv/www/srv";
$SYSPath="/srv/www/web";
$WEBUser="www-data"; $WEBUser="www-data";
$WEBGroup="www-data"; $WEBGroup="www-data";

44
lib/upgrade_database.php

@ -0,0 +1,44 @@
<?php
error_reporting( E_ALL );
require_once('settings.php');
require_once('defines.php');
$UPGRADE = false;
$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 {
echo "CANNOT DETERMINE DATABASE ENGINE!!!!!!!\n\n";
exit();
};
$QS="SHOW INDEX FROM `modbus_modules` WHERE Column_name='platform_id'";
$R = $DATABASE->Query( $QS );
if( count( $R ) ){
$QS = "ALTER TABLE `modbus_modules` DROP INDEX `{$R[0]['Key_name']}`";
$UPGRADE = true;
$DATABASE->Query( $QS );
};
$QS = "SHOW COLUMNS FROM `modbus_modules` LIKE 'label'";
$R = $DATABASE->Query( $QS );
if( count( $R ) == 0 ){
$QS = "ALTER TABLE `modbus_modules` ADD `label` CHAR(32) DEFAULT ''";
$UPGRADE = true;
$DATABASE->Query( $QS );
};
$QS = "SHOW COLUMNS FROM `metro_stations` LIKE 'short'";
$R = $DATABASE->Query( $QS );
if( count( $R ) == 0 ){
$QS = "ALTER TABLE `metro_stations` ADD `short` CHAR(32) DEFAULT ''";
$UPGRADE = true;
$DATABASE->Query( $QS );
};
if( $UPGRADE ){
echo "Upgrade Done!\n\n";
} else {
echo "No Upgrade Needed!\n\n";
};
?>

2
lib/version.var

@ -1 +1 @@
20251012
20260304

66
style/style.css

@ -13,6 +13,47 @@ $baseColor : #e74c3c;
$fontColor : #fff; $fontColor : #fff;
*/ */
.hide-scrollbar .x-panel-body {
overflow: auto; /* Allows scrolling */
}
.hide-scrollbar .x-panel-body::-webkit-scrollbar {
display: none; /* Hides scrollbar */
}
/* For Firefox */
.hide-scrollbar .x-panel-body {
scrollbar-width: none;
}
.thin-scrollbar .x-panel-body {
overflow: auto; /* Allows scrolling */
}
/* For Chrome, Safari, and Opera */
.thin-scrollbar .x-panel-body::-webkit-scrollbar {
width: 8px; /* Width for vertical scrollbar */
height: 8px; /* Height for horizontal scrollbar */
}
.thin-scrollbar .x-panel-body::-webkit-scrollbar-track {
background: #f1f1f1; /* Color of the tracking area */
border-radius: 10px; /* Optional: roundness of the track */
}
.thin-scrollbar .x-panel-body::-webkit-scrollbar-thumb {
background-color: #888; /* Color of the scroll thumb */
border-radius: 10px; /* Optional: roundness of the scroll thumb */
}
/* Optional: Add hover effect to the thumb */
.thin-scrollbar .x-panel-body::-webkit-scrollbar-thumb:hover {
background-color: #555;
}
.thin-scrollbar .x-panel-body {
scrollbar-width: thin; /* */
scrollbar-color: #888 #f1f1f1; /* thumb color and track color */
}
.chart-text { .chart-text {
/*font: 16px/1.4em "Montserrat", Arial, sans-serif;*/ /*font: 16px/1.4em "Montserrat", Arial, sans-serif;*/
font: 16px/1.4em "Montserrat", Arial, sans-serif; font: 16px/1.4em "Montserrat", Arial, sans-serif;
@ -1445,6 +1486,13 @@ A.CalendarDS:hover {
text-align: left !important; text-align: left !important;
} }
.plr_op_videos{
background-image: url(wicons/076.png) !important;
background-size: 16px 16px;
width: 100% !important;
text-align: left !important;
}
.plr_op_pause{ .plr_op_pause{
background-image: url(wicons/063.png) !important; background-image: url(wicons/063.png) !important;
background-size: 16px 16px; background-size: 16px 16px;
@ -2083,6 +2131,7 @@ input[type="range"]:focus::-moz-range-thumb {
.mon_side_tag{ .mon_side_tag{
display: block; display: block;
width: 100%; width: 100%;
height: 42px;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
@ -2237,5 +2286,22 @@ input[type="range"]:focus::-moz-range-thumb {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: black; color: black;
}
.small_prop_logo{
width: 64px;
height: 64px;
border-radius: 32px;
}
.small_prop_title{
text-align: center;
font-size: 12px;
font-weight: bold;
}
.small_prop_logo#adam{
background-color: orange; background-color: orange;
background-repeat: no-repeat;
background-position: 8px 8px;
background-size: 48px 48px;
background-image: url("assets/adam-1.png")!important;
} }
Loading…
Cancel
Save