Browse Source

SCADA Dismiss/Snooze functionality

master
Evgeny Gagua 1 month ago
parent
commit
56de4600cd
  1. 5
      files.list
  2. 2
      lib/1.json
  3. 7
      lib/controller/doApplicationOperation.php
  4. 21
      lib/controller/doPlatformOperations.php
  5. 27
      lib/controller/getApplicationSettings.php
  6. 8
      lib/controller/getHelpTopic.php
  7. 166
      lib/controller/getScadaEditor.php
  8. 88
      lib/controller/getStatus.php
  9. 82
      lib/javascript/jsapi_dynamic/argus_monitoring.js
  10. 23
      lib/upgrade_database.php
  11. 2
      style/style.css

5
files.list

@ -3320,6 +3320,11 @@
./style/wicons/018.png
./style/wicons/035.png
./style/wicons/rotate-axis-x-512.png
./style/wicons/net_icon.png
./style/wicons/soft_icon.png
./style/wicons/cam_icon.png
./style/wicons/sensor_icon.png
./style/wicons/strobe-1.png
./style/assets
./style/assets/RCA-Connector-Plug-icon.png
./style/assets/map-map-marker-icon.png

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

7
lib/controller/doApplicationOperation.php

@ -92,6 +92,13 @@
$Data['success'] = true;
break;
};
case 46:{
$P = intval( $_POST['OPCODE'] );
$QS = "UPDATE `system_props` SET `modbus_auto_supress`={$P}";
$DATABASE->Query( $QS );
$Data['success'] = true;
break;
};
};
} else {
$Data['msg']='Wrong Parameters!';

21
lib/controller/doPlatformOperations.php

@ -561,6 +561,27 @@
$LOG->reg_op( $_POST );
break;
};
// All SCADA Msg working via Server Software
case 31:{ // Snooze SCADA Msg
$MSGID = intval( $_POST['OPCODE'] );
if( $MSGID ){
$QS = "INSERT INTO `mem_web_queue` SET `module_id`=0, `cmd`=230, `aux_id`={$MSGID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
};
break;
};
case 32:{ // Dismiss SCADA Msg
$MSGID = intval( $_POST['OPCODE'] );
if( $MSGID ){
$QS = "INSERT INTO `mem_web_queue` SET `module_id`=0, `cmd`=231, `aux_id`={$MSGID}";
$DATABASE->Query( $QS );
$Data['success'] = true;
$LOG->reg_op( $_POST );
};
break;
};
case 200:{ //Remove Platform
if( $OID ){
$QS = "SELECT `id` FROM `metro_tracks` WHERE `platform_id`={$OID}";

27
lib/controller/getApplicationSettings.php

@ -180,6 +180,33 @@
},{
xtype: 'spacer',
height: 10
},{
xtype: 'combo',
fieldLabel: 'SCADA Auto Supression',
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', 38 );
},
select: function( t, r, i ){
doApplicationOperation( 46, r.data.cid, true );
}
},
value: '{$CS['modbus_auto_supress']}'
},{
xtype: 'spacer',
height: 10
}]
}]
}

8
lib/controller/getHelpTopic.php

@ -37,6 +37,14 @@
$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 38:{
$TOPIC = 'SCADA Auto Supression';
$INFO_BREEF = 'Enable or Disable SCADA signal mitigation by Session expiration';
$HELP_FULL = 'This parameter does not affects on Manual Session Rating by Operator or TCC room signal';
break;
};
case 312:{
$TOPIC = 'Video Container';

166
lib/controller/getScadaEditor.php

@ -112,9 +112,13 @@ DATA_BOUNDARY;
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'DI 1 <img id="sce_in_2_img" width="8px" src="/style/assets/sm_ico_gw.png">'
},{
xtype: 'spacer'
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'DI 2 <img id="sce_in_3_img" width="8px" src="/style/assets/sm_ico_gw.png">'
},{
xtype: 'spacer'
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'DI 3a <img id="sce_in_4_img" width="8px" src="/style/assets/sm_ico_gw.png">'
},{
xtype: 'spacer',
height: 5,
@ -131,8 +135,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
@ -141,7 +144,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, a.getValue(), false );
}
}
},{
@ -156,8 +159,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
@ -166,13 +168,57 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, a.getValue(), false );
}
}
},{
xtype: 'spacer'
xtype: 'combo',
id: 'sce_cb_i_3',
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__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$CBIV_C}',
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, a.getValue(), false );
}
}
},{
xtype: 'spacer'
xtype: 'combo',
id: 'sce_cb_i_4',
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__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$CBIV_D}',
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, a.getValue(), false );
}
}
}]
}
DATA_BOUNDARY;
@ -263,11 +309,13 @@ DATA_BOUNDARY;
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'DI 1 <img id="sce_in_2_img" width="8px" src="/style/assets/sm_ico_gw.png">'
},{
xtype: 'spacer',
width: 120
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'DI 2 <img id="sce_in_3_img" width="8px" src="/style/assets/sm_ico_gw.png">'
},{
xtype: 'spacer',
width: 120
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'DI 3 <img id="sce_in_4_img" width="8px" src="/style/assets/sm_ico_gw.png">'
},{
xtype: 'spacer',
height: 5,
@ -284,8 +332,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
@ -294,7 +341,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, a.getValue(), false );
}
}
},{
@ -309,8 +356,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
@ -319,15 +365,57 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, a.getValue(), false );
}
}
},{
xtype: 'spacer',
width: 120
xtype: 'combo',
id: 'sce_cb_i_3',
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__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$CBIV_C}',
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, a.getValue(), false );
}
}
},{
xtype: 'spacer',
width: 120
xtype: 'combo',
id: 'sce_cb_i_4',
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__')}'],[4,'Strobe Light']
]
}),
valueField: 'mode',
displayField: 'mode_txt',
value: '{$CBIV_D}',
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, a.getValue(), false );
}
}
}]
}
DATA_BOUNDARY;
@ -351,7 +439,7 @@ DATA_BOUNDARY;
},{
xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'AUX Signal'
html: 'Strobe Light'
},{
xtype: 'combo',
id: 'sce_cb_o_1',
@ -487,8 +575,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[1,'Dismiss Alarms Only'],[2,'Dismiss ALL Platform']
]
}),
valueField: 'mode',
@ -497,7 +584,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, a.getValue(), false );
}
}
},{
@ -512,8 +599,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[1,'Dismiss Alarms Only'],[2,'Dismiss ALL Platform']
]
}),
valueField: 'mode',
@ -522,7 +608,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, a.getValue(), false );
}
}
},{
@ -537,8 +623,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[1,'Dismiss Alarms Only'],[2,'Dismiss ALL Platform']
]
}),
valueField: 'mode',
@ -547,7 +632,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, a.getValue(), false );
}
}
},{
@ -562,8 +647,7 @@ DATA_BOUNDARY;
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[0,'{$Labels->GetLabel('__DISABLED__')}'],
[1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX']
[0,'{$Labels->GetLabel('__DISABLED__')}'],[1,'Dismiss Alarms Only'],[2,'Dismiss ALL Platform']
]
}),
valueField: 'mode',
@ -572,7 +656,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, a.getValue(), false );
}
}
}]
@ -744,7 +828,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, a.getValue(), false );
}
}
},{
@ -769,7 +853,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, a.getValue(), false );
}
}
},{
@ -794,7 +878,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, a.getValue(), false );
}
}
},{
@ -819,7 +903,7 @@ DATA_BOUNDARY;
width: 120,
listeners:{
select: function( a, c, b ){
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, b, false );
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, a.getValue(), false );
}
}
}]

88
lib/controller/getStatus.php

@ -178,8 +178,15 @@
break;
};
case 2:{ //Platform View
$PID = intval( $_POST['PID'] );
$PID = intval( $_POST['PID'] );
if( $PID ){
$MODULENAMES = array();
$QS = "SELECT `left_side`, `right_side` FROM `metro_platforms` WHERE `id`={$PID}";
$RR = $DATABASE->Query( $QS );
$SIDES = $RR[0];
$QS = "SELECT `modbus_health_level` FROM `system_props` LIMIT 1";
$RR = $DATABASE->Query( $QS );
$MBHL = intval( $RR[0]['modbus_health_level'] );
$QS = "SELECT * FROM `metro_tracks` WHERE `platform_id`={$PID}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
@ -215,6 +222,12 @@
$LD['status'] = 1;
$LD['img'] = '/style/assets/no-signal_h.png';
};
// Names
if( $CT['side'] == 'U' ){
$MODULENAMES[$CM]= $CT['short'] . ":" . $SIDES['right_side'];
} else {
$MODULENAMES[$CM]= $CT['short'] . ":" . $SIDES['left_side'];
};
} else {
$LD['status'] = 0;
};
@ -248,12 +261,19 @@
$LD['status'] = 1;
$LD['img'] = '/style/assets/no-signal_h.png';
};
// Names
if( $CT['side'] == 'U' ){
$MODULENAMES[$CM]= $CT['short'] . ":" . $SIDES['left_side'];
} else {
$MODULENAMES[$CM]= $CT['short'] . ":" . $SIDES['right_side'];
};
} else {
$LD['status'] = 0;
};
$Modules[] = $LD;
};
$Data['modules'] = $Modules;
//Select only TCC module
$QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$PID} AND `func`=3";
$RR = $DATABASE->Query( $QS );
$Data['scada'] = array();
@ -277,7 +297,7 @@
};
$Data['train']=array( 'status'=>$TrainPos );
};
$QS = "SELECT * FROM `metro_platforms_mboxes` WHERE `platform_id`={$PID}";
$QS = "SELECT * FROM `metro_platforms_mboxes` WHERE `platform_id`={$PID} ORDER BY `ts`";
$RR = $DATABASE->Query( $QS, false );
$Data['poster'] = array();
if( count( $RR ) ){
@ -285,9 +305,71 @@
$CR = array();
$CR['id'] = intval( $M['id'] );
$CR['status'] = intval( $M['status'] );
$CR['msg'] = $Labels->GetLabel( $M['msg'] );
$DD = Date( "M j, Y, g:i a", intval( $M['ts'] ) );
switch( $M['type'] ){
case 1: $CONTENT = "<table wodth=\"100%\"><tr><td valign=\"top\"><img width=\"64px\" src=\"/style/wicons/cam_icon.png\"></td><td valign=\"top\">" . $Labels->GetLabel('__ON__')." {$DD} ". $Labels->GetLabel('_W_REGISTERED_')." ".$Labels->GetLabel('_HEALTH_1_MSG_')." <b>".$MODULENAMES[$M['src']]."</b> ".$Labels->GetLabel('___MODULE__')."</td></tr></table>";
$BGC = '#00002f';
break;
case 2: $CONTENT = "<table wodth=\"100%\"><tr><td valign=\"top\"><img width=\"64px\" src=\"/style/wicons/sensor_icon.png\"></td><td valign=\"top\">" . $Labels->GetLabel('__ON__')." {$DD} ". $Labels->GetLabel('_W_REGISTERED_')." ".$Labels->GetLabel('_HEALTH_2_MSG_')." <b>".$MODULENAMES[$M['src']]."</b> ".$Labels->GetLabel('___MODULE__')."</td></tr></table>";
$BGC = '#002f00';
break;
case 3: $CONTENT = "<table wodth=\"100%\"><tr><td valign=\"top\"><img width=\"64px\" src=\"/style/wicons/sensor_icon.png\"></td><td valign=\"top\">" . $Labels->GetLabel('__ON__')." {$DD} ". $Labels->GetLabel('_W_REGISTERED_')." ".$Labels->GetLabel('_HEALTH_3_MSG_')." <b>".$MODULENAMES[$M['src']]."</b> ".$Labels->GetLabel('___MODULE__')."</td></tr></table>";
$BGC = '#002f2f';
break;
case 4: $CONTENT = "<table wodth=\"100%\"><tr><td valign=\"top\"><img width=\"64px\" src=\"/style/wicons/soft_icon.png\"></td><td valign=\"top\">" . $Labels->GetLabel('__ON__')." {$DD} ". $Labels->GetLabel('_W_REGISTERED_')." ".$Labels->GetLabel('_HEALTH_4_MSG_')." <b>".$MODULENAMES[$M['src']]."</b> ".$Labels->GetLabel('___MODULE__')."</td></tr></table>";
$BGC = '#2f2f00';
break;
case 5: $CONTENT = "<table wodth=\"100%\"><tr><td valign=\"top\"><img width=\"64px\" src=\"/style/wicons/net_icon.png\"></td><td valign=\"top\">" . $Labels->GetLabel('__ON__')." {$DD} ". $Labels->GetLabel('_W_REGISTERED_')." ".$Labels->GetLabel('_HEALTH_5_MSG_')." <b>".$MODULENAMES[$M['src']]."</b> ".$Labels->GetLabel('___MODULE__')."</td></tr></table>";
$BGC = '#2f002f';
break;
case 6:
$CONTENT = "<table wodth=\"100%\"><tr><td valign=\"top\"><img width=\"64px\" src=\"/style/wicons/strobe-1.png\"></td><td valign=\"top\">" . $Labels->GetLabel('__ON__')." {$DD} ". $Labels->GetLabel('_W_REGISTERED_')." ".$Labels->GetLabel('_HEALTH_6_MSG_')." <b>".$MODULENAMES[$M['src']]."</b> ".$Labels->GetLabel('___SIDE__')."</td></tr></table>";
$BGC = '#002f00';
break;
}
if( $CR['status'] ){
$DBE = 'true';
$DBBT = $Labels->GetLabel('_SNOOZED_');
} else {
$DBE = 'false';
$DBBT = $Labels->GetLabel('_SNOOZE_');
};
if( $MBHL ){
if( $M['type'] >= $MBHL ){
$SNOOZEBTN="{ text: '{$DBBT}', disabled: {$DBE}, handler: function(){ doPlatformOperation( {$PID}, 31, {$M['id']},false); } },";
};
} else {
if( $M['type'] == 6 ){
$SNOOZEBTN="{ text: '{$DBBT}', disabled: {$DBE}, handler: function(){ doPlatformOperation( {$PID}, 31, {$M['id']},false); } },";
};
};
$CR['content'] =<<<DATA_BOUNDARY
{
xtype: 'panel',
frame: true,
width: 300,
border: false,
frame: false,
id: 'mbox_post_panel_{$M['id']}',
html: '{$CONTENT}',
bodyStyle: 'background-color: {$BGC};',
style: 'border: 2px solid {$BGC}; border-radius: 5px;',
bbar:[{$SNOOZEBTN}{
text: '{$Labels->GetLabel('_DISSMISS_')}',
handler: function(){
doPlatformOperation( {$PID}, 32, {$M['id']}, false);
}
}]
}
DATA_BOUNDARY;
$Data['poster'][] = $CR;
};
$TT = '';
foreach( $Data['poster'] as $P ) $TT .= $P['content'];
$Data['poster_md5'] = md5( $TT );
if( isset( $_POST['SCM'] ) ){
if( $_POST['SCM'] == $Data['poster_md5'] ) $Data['poster'] = array();
};
} else {
};

82
lib/javascript/jsapi_dynamic/argus_monitoring.js

@ -245,25 +245,61 @@ function correctPlatformView( id ){
tt.style.width = 16 * pawi +'px';
tt.style.height = 9 * pawi +'px';
};
var O = new Ext.Panel({
renderTo: 'scada_postbox_'+id,
width: '100%',
height: 150,
layout: 'hbox',
layoutConfig: {
align: 'stretch', // Options: 'top', 'middle', 'stretch', 'stretchmax'
pack: 'start' // Options: 'start', 'center', 'end'
},
defaults: {
flex: 1, // Automatically distributes equal width among items
bodyStyle: 'padding:10px'
id: 'scada_postbox_scr_'+id,
height: 170,
width: 36.5 * pawi,
autoScroll: true,
frame: false,
border: false,
bodyStyle: {
'background-color': '#808080'
},
items: [{
title: 'Column 1',
html: 'Content for the first column'
xtype: 'panel',
id: 'scada_postbox_ctx_'+id,
height: 150,
layout: 'hbox',
layoutConfig: {
align: 'stretch', // Options: 'top', 'middle', 'stretch', 'stretchmax'
pack: 'start', // Options: 'start', 'center', 'end'
padding: '5 5 5 5'
},
defaults: {
flex: 1,
bodyStyle: 'padding:10px',
//margins: '0 5 0 5'
},
items: []
}]
});
last_poster_md5 = '';
/*
var O = new Ext.Panel({
renderTo: 'scada_postbox_'+id,
width: 500,
height: 150,
autoScroll: true, // This enables the scrollbar on the wrapper
items: [{
xtype: 'panel',
layout: 'hbox',
// Important: Set a fixed or calculated wide width so the parent scrolls
width: 1000,
border: false,
layoutConfig: {
pack: 'start',
align: 'stretch'
},
items: [
{ title: 'Panel 1', width: 300, html: 'Content 1' },
{ title: 'Panel 2', width: 300, html: 'Content 2' },
{ title: 'Panel 3', width: 400, html: 'Content 3' }
]
}]
});
*/
O.doLayout();
};
function correctModuleView( id ){
@ -714,7 +750,7 @@ function manageSideTags( tag_area, buba ){
};
var mSvgElements = [];
var last_poster_md5 = '';
function fetchStatus(){
if( tlInterval!= null ){
window.clearTimeout( tlInterval );
@ -753,6 +789,7 @@ function fetchStatus(){
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
PID: mon_selectedPlatform,
SCM: last_poster_md5,
LTS: statusLTS,
LID: statusLID
};
@ -1003,8 +1040,21 @@ function fetchStatus(){
for( var i=0; i< max_grad_levels; i++ )
if( typeof mSvgElements[i] !== 'undefined') mSvgElements[i].setAttribute('fill', '#FF000000');
};
if( data.scada != undefined ){
if( data.poster != undefined ){
if( last_poster_md5 != data.poster_md5 ){
last_poster_md5 = data.poster_md5;
var jj = Ext.getCmp( 'scada_postbox_ctx_'+mon_selectedPlatform );
if( jj != undefined ){
jj.removeAll();
for( i = 0; i < data.poster.length; i++){
var nc = Ext.decode( data.poster[i].content );
jj.add( nc );
}
jj.setWidth( data.poster.length * 301 );
jj = Ext.getCmp( 'scada_postbox_scr_'+mon_selectedPlatform );
if( jj != undefined ) jj.doLayout();
};
};
};
break;
};

23
lib/upgrade_database.php

@ -108,16 +108,37 @@ CREATE TABLE `metro_platforms_mboxes` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`platform_id` int(10) UNSIGNED NOT NULL,
`type` tinyint(3) NOT NULL,
`src` int(10) UNSIGNED DEFAULT 0,
`ts` int(10) UNSIGNED NOT NULL,
`status` tinyint(3) UNSIGNED NULL DEFAULT 0,
`value` char(32) CHARACTER SET ascii COLLATE ascii_bin NULL DEFAULT '0',
`msg` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uniq`(`platform_id`, `type`) USING BTREE
UNIQUE INDEX `uniq`(`platform_id`, `type`, `src`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Fixed;
DATA_BOUNDARY;
$UPGRADE = true;
$DATABASE->Query( $QS );
} else {
$QS = "SHOW COLUMNS FROM `metro_platforms_mboxes` LIKE 'src'";
$R = $DATABASE->Query( $QS );
if( count( $R ) == 0 ){
$UPGRADE = true;
$QS = "ALTER TABLE `metro_platforms_mboxes` ADD `src` INT(10) UNSIGNED DEFAULT 0";
$DATABASE->Query( $QS );
$QS = "ALTER TABLE `metro_platforms_mboxes` DROP INDEX `uniq`";
$DATABASE->Query( $QS );
$QS = "ALTER TABLE `metro_platforms_mboxes` ADD UNIQUE INDEX `uniq`(`platform_id`, `type`, `src`) USING BTREE";
$DATABASE->Query( $QS );
};
};
$QS = "SHOW COLUMNS FROM `system_props` LIKE 'modbus_auto_supress'";
$R = $DATABASE->Query( $QS );
if( count( $R ) == 0 ){
$QS = "ALTER TABLE `system_props` ADD `modbus_auto_supress` TINYINT(3) UNSIGNED DEFAULT 0";
$DATABASE->Query( $QS );
$UPGRADE = true;
};
if( $UPGRADE ){

2
style/style.css

@ -2368,4 +2368,4 @@ input[type="range"]:focus::-moz-range-thumb {
}
.x-table-layout-cell-top-align td.x-table-layout-cell {
vertical-align: top !important;
}
}
Loading…
Cancel
Save