Skip to content

Commit e01c670

Browse files
author
Ricardo Olsen
committed
Version 6.2.
1 parent 7816595 commit e01c670

13 files changed

+477
-1314
lines changed
1.24 KB
Binary file not shown.

htdocs/annotation.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@
3737
{
3838
$p_CONTENT = trim($p_CONTENT);
3939

40-
// Forward request to redendant HMI if exists
40+
// Forward request to redundant HMI if exists
4141
$otherhmiip="";
4242
$port=51909;
4343
// Parse with sections
4444
$ini_array = parse_ini_file("../conf/hmi.ini", true);
4545
if ( $ini_array["REDUNDANCY"]["OTHER_HMI_IP"] != "" )
4646
$otherhmiip = $ini_array["REDUNDANCY"]["OTHER_HMI_IP"];
47+
if ( $ini_array["REDUNDANCY"]["HTTP_PORT"] != "" )
48+
$port = $ini_array["REDUNDANCY"]["HTTP_PORT"];
4749
if ( $otherhmiip != "" )
4850
if ( $_SERVER['REMOTE_ADDR'] != $otherhmiip )
4951
{

htdocs/annotation_readonly.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
{
3939
$p_CONTENT = trim($p_CONTENT);
4040

41-
// Forward request to redendant HMI if exists
41+
// Forward request to redundant HMI if exists
4242
$otherhmiip="";
4343
$port=51909;
4444
// Parse with sections
4545
$ini_array = parse_ini_file("../conf/hmi.ini", true);
4646
if ( $ini_array["REDUNDANCY"]["OTHER_HMI_IP"] != "" )
4747
$otherhmiip = $ini_array["REDUNDANCY"]["OTHER_HMI_IP"];
48+
if ( $ini_array["REDUNDANCY"]["HTTP_PORT"] != "" )
49+
$port = $ini_array["REDUNDANCY"]["HTTP_PORT"];
4850
if ( $otherhmiip != "" )
4951
if ( $_SERVER['REMOTE_ADDR'] != $otherhmiip )
5052
{

htdocs/eventserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
$nponto = 0;
136136

137137
$dbsde = new PDO( 'sqlite:../db/soe.sl3' );
138-
$dbsde->setAttribute(PDO::ATTR_TIMEOUT, 3);
138+
$dbsde->setAttribute(PDO::ATTR_TIMEOUT, 8);
139139
$dbsde->exec ( "PRAGMA synchronous = NORMAL" );
140140
$dbsde->exec ( "PRAGMA journal_mode = WAL" );
141141
$dbsde->exec ( "PRAGMA locking_mode = NORMAL" );

htdocs/screen.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<img id='IMGSEPAR1' align='middle' width='8' height='32' >
123123
<img id='ANTETELAID' align='middle' width='16' height='16' style='cursor:pointer;'/>
124124
<select style='font-family:consolas,courier,monospace;vertical-align:middle;text-shadow: 1px 1px 1px #909090;' name='SELTELA' id='SELTELA' size='1'>
125-
<option id='SELTELA_OPC1' disabled='disabled'>?</option>
125+
<option id='SELTELA_OPC1' selected disabled='disabled'>?</option>
126126
</select>
127127
<img id='PROXTELAID' align='middle' width='16' height='16' style='cursor:pointer;'/>
128128
<img id='IMGSEPAR2' align='middle' width='8' height='32' />

htdocs/tabular.html

Lines changed: 175 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,97 @@
638638
setTimeout( WebSAGE.mudaFiltro, 10 );
639639
}
640640

641+
// Filters saved in localStorage
642+
var almFilter={};
643+
if (storageAvailable('localStorage'))
644+
{
645+
var storedData = localStorage.getItem("almFilter");
646+
if (storedData) {
647+
almFilter = JSON.parse(storedData);
648+
}
649+
}
650+
651+
// create missing substation filters inside a div
652+
for (var se in Lista)
653+
{
654+
if (Lista[se] == "")
655+
continue;
656+
var ytop = 2;
657+
if ( document.getElementById( "DIV_" + Lista[se] ) === null )
658+
$( "#DIV_SUBSTALMFILT" ).prepend(
659+
"<div id='DIV_" + Lista[se] + "' " +
660+
" onclick='WebSAGE.g_alminfo[&quot;" + Lista[se] + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + Lista[se] + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
661+
" style='position:relative;float:left;text-align:center;margin-bottom:7px;margin-left:3px;top:" + ytop + "px;" +
662+
"cursor:pointer;box-shadow: 1px 1px 1px #666666;background-color:white;width:48px;height:20px;border-radius:4px;border:1px solid #777;padding-top:2px;padding-left:2px;padding-right:2px;line-height:80%;font-size:15px;font-family:trebuchet ms,tahoma,helvetica,arial'>"+
663+
Lista[se] +
664+
"<br>" +
665+
"<span id='SP_" + Lista[se] + "_ACK" +
666+
"' style='float:right;-webkit-filter:contrast(.7);text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
667+
"0</span>" +
668+
"<span id='SP_" + Lista[se] + "_NACK" +
669+
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
670+
"0</span>" +
671+
"</div>" );
672+
673+
if ( typeof( WebSAGE.g_alminfo[ Lista[se] ] ) === 'undefined' )
674+
{
675+
WebSAGE.g_alminfo[ Lista[se] ] = { countnack: 0,
676+
countack: 0,
677+
filterout: false,
678+
minpriorack: 10,
679+
minpriornack: 10,
680+
is_subst: true };
681+
}
682+
683+
if( WebSAGE.isAlarmsViewer() )
684+
if ( Lista[se] in almFilter )
685+
{
686+
WebSAGE.g_alminfo[ Lista[se] ].filterout = almFilter[Lista[se]];
687+
}
688+
}
689+
690+
if ( WebSAGE.isAlarmsViewer() )
691+
{
692+
var xleft = 230;
693+
var ytop = 5;
694+
for ( var priority in [0,1,2,3,4,5,7,8,9] )
695+
{
696+
if ( document.getElementById( "DIV_" + priority ) === null && priority <= 3 )
697+
{
698+
$( "body" ).append(
699+
"<div id='DIV_" + priority + "' " +
700+
" onclick='WebSAGE.g_alminfo[&quot;" + priority + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + priority + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
701+
" style='position:absolute;float:left;text-align:center;top:" + ytop + "px;" +
702+
"left:" + ( xleft + priority * 58 ) + "px;" +
703+
"cursor:pointer;box-shadow: 1px 1px 1px #666666;background-color:white;width:48px;height:20px;border-radius:4px;border:1px solid #777;padding-top:2px;padding-left:2px;padding-right:2px;line-height:80%;font-size:15px;font-family:trebuchet ms,tahoma,helvetica,arial'>"+
704+
priority +
705+
"<br>" +
706+
"<span id='SP_" + priority + "_ACK" +
707+
"' style='float:right;-webkit-filter:contrast(.7);text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
708+
"0</span>" +
709+
"<span id='SP_" + priority + "_NACK" +
710+
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
711+
"0</span>" +
712+
"</div>" );
713+
}
714+
715+
if ( priority in almFilter )
716+
{
717+
WebSAGE.g_alminfo[ priority ].filterout = almFilter[priority];
718+
}
719+
}
720+
WebSAGE.applyTableStyle();
721+
722+
// sort divs in name (id) order
723+
var main = document.getElementById( 'DIV_SUBSTALMFILT' );
724+
if (main !== null)
725+
[].map.call( main.children, Object ).sort( function ( a, b ) {
726+
return ((a.id > b.id)? 1 : -1);
727+
}).forEach( function ( elem ) {
728+
main.appendChild( elem );
729+
});
730+
}
731+
641732
// document.getElementById("SELSE").onChange=WebSAGE.mudaSE;
642733
},
643734

@@ -750,12 +841,16 @@
750841

751842
applyTableStyle: function()
752843
{
844+
var almFilter={};
845+
753846
// assemble the filterout list
754847
WebSAGE.g_filterOutList = [];
755848
for ( var substorpri in WebSAGE.g_alminfo )
756849
{
757850
if ( WebSAGE.g_alminfo.hasOwnProperty(substorpri) )
758851
{
852+
almFilter[substorpri] = WebSAGE.g_alminfo[substorpri].filterout;
853+
759854
if ( WebSAGE.isAlarmsViewer() )
760855
{
761856
if ( WebSAGE.g_alminfo[substorpri].filterout )
@@ -771,6 +866,9 @@
771866
}
772867
}
773868

869+
if (storageAvailable('localStorage'))
870+
localStorage.setItem("almFilter", JSON.stringify(almFilter));
871+
774872
// reapply line styles
775873
for( var i = 0; i < L.length; i++ )
776874
{
@@ -931,20 +1029,62 @@
9311029
}
9321030

9331031
// container to put in per substation filters
934-
if ( document.getElementById( "DIV_SUBSTALMFILT" ) === null )
935-
$( "body" ).append("<div id='DIV_SUBSTALMFILT' style='overflow:auto;top:42px;left:0;width:100%;height:35px;position:absolute;text-align:center;'><div>");
1032+
if ( document.getElementById( "DIV_SUBSTALMFILT" ) === null ) {
1033+
$( "body" ).append("<div id='DIV_SUBSTALMFILT' style='background-color:#bbb;overflow:auto;top:42px;left:0;width:100%;height:35px;position:absolute;text-align:center;'>"+
1034+
"<div id='ZZABC1' style='clear:left;padding-top:5px;padding-bottom:2px;'>" +
1035+
"<input id='ZZCB_SELECTALL' type='button' value='Select All'>&nbsp;&nbsp;" +
1036+
"<input id='ZZCB_UNSELECTALL' type='button' value='Unselect All'>" +
1037+
"</div>" +
1038+
"</div>");
1039+
document.getElementById("ZZCB_SELECTALL").value = Msg.SelectAll;
1040+
document.getElementById("ZZCB_UNSELECTALL").value = Msg.UnselectAll;
1041+
document.getElementById("ZZCB_SELECTALL").
1042+
addEventListener("click",
1043+
function(event) {
1044+
for ( var sorp in WebSAGE.g_alminfo )
1045+
{
1046+
if (WebSAGE.g_alminfo[sorp].is_subst)
1047+
{
1048+
WebSAGE.g_alminfo[sorp].filterout=true;
1049+
}
1050+
}
1051+
WebSAGE.applyTableStyle();
1052+
});
1053+
document.getElementById("ZZCB_UNSELECTALL").
1054+
addEventListener("click",
1055+
function(event) {
1056+
for ( var sorp in WebSAGE.g_alminfo )
1057+
{
1058+
if (WebSAGE.g_alminfo[sorp].is_subst)
1059+
{
1060+
WebSAGE.g_alminfo[sorp].filterout=false;
1061+
}
1062+
}
1063+
WebSAGE.applyTableStyle();
1064+
});
1065+
document.getElementById("DIV_SUBSTALMFILT").
1066+
addEventListener("mouseover",
1067+
function(event) {
1068+
document.getElementById("DIV_SUBSTALMFILT").style.height="";
1069+
});
1070+
document.getElementById("DIV_SUBSTALMFILT").
1071+
addEventListener("mouseout",
1072+
function(event) {
1073+
document.getElementById("DIV_SUBSTALMFILT").style.height="35px";
1074+
});
1075+
}
9361076

9371077
if ( document.getElementById( "DIV_" + substorpri ) === null )
9381078
{ // create priority and substation alm boxes
9391079
if ( WebSAGE.g_alminfo[substorpri].is_subst )
9401080
{ // create substation filters inside a div
941-
ytop=0;
942-
$( "#DIV_SUBSTALMFILT" ).append(
1081+
ytop=2;
1082+
$( "#DIV_SUBSTALMFILT" ).prepend(
9431083
"<div id='DIV_" + substorpri + "' " +
9441084
" onclick='WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
9451085
" style='position:relative;float:left;text-align:center;margin-bottom:7px;margin-left:3px;top:" + ytop + "px;" +
9461086
// "left:" + ( xleft + ( WebSAGE.g_alminfo[substorpri].is_subst ? cntsb : cntpr ) * 58 ) + "px;" +
947-
"cursor:pointer;box-shadow: 2px 2px 2px #666666;background-color:white;width:48px;height:20px;border-radius:4px;border:1px solid black;padding-top:2px;padding-left:2px;padding-right:2px;line-height:80%;font-size:15px;font-family:trebuchet ms,tahoma,helvetica,arial'>"+
1087+
"cursor:pointer;box-shadow: 1px 1px 1px #666666;background-color:white;width:48px;height:20px;border-radius:4px;border:1px solid #777;padding-top:2px;padding-left:2px;padding-right:2px;line-height:80%;font-size:15px;font-family:trebuchet ms,tahoma,helvetica,arial'>"+
9481088
substorpri +
9491089
"<br>" +
9501090
"<span id='SP_" + substorpri + "_ACK" +
@@ -955,30 +1095,26 @@
9551095
"</span>" +
9561096
"</div>" );
9571097
}
958-
else
959-
{ // create priority filters directly over the body
1098+
else
1099+
{
1100+
ytop = 5;
9601101
$( "body" ).append(
961-
"<div id='DIV_" + substorpri + "' " +
1102+
"<div id='DIV_" + substorpri + "' " +
9621103
" onclick='WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
9631104
" style='position:absolute;float:left;text-align:center;top:" + ytop + "px;" +
964-
"left:" + ( xleft + ( WebSAGE.g_alminfo[substorpri].is_subst ? cntsb : cntpr ) * 58 ) + "px;" +
965-
"cursor:pointer;box-shadow: 2px 2px 2px #666666;background-color:white;width:48px;height:20px;border-radius:4px;border:1px solid black;padding-top:2px;padding-left:2px;padding-right:2px;line-height:80%;font-size:15px;font-family:trebuchet ms,tahoma,helvetica,arial'>"+
1105+
"left:" + ( xleft + substorpri * 58 ) + "px;" +
1106+
"cursor:pointer;box-shadow: 1px 1px 1px #666666;background-color:white;width:48px;height:20px;border-radius:4px;border:1px solid #777;padding-top:2px;padding-left:2px;padding-right:2px;line-height:80%;font-size:15px;font-family:trebuchet ms,tahoma,helvetica,arial'>"+
9661107
substorpri +
9671108
"<br>" +
9681109
"<span id='SP_" + substorpri + "_ACK" +
969-
"' style='float:right;-webkit-filter:contrast(.7);text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;'>" +
970-
"</span>" +
1110+
"' style='float:right;-webkit-filter:contrast(.7);text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
1111+
"0</span>" +
9711112
"<span id='SP_" + substorpri + "_NACK" +
972-
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;'>" +
973-
"</span>" +
974-
"</div>" );
1113+
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
1114+
"0</span>" +
1115+
"</div>" );
9751116
}
9761117
}
977-
else
978-
{
979-
if ( ! WebSAGE.g_alminfo[substorpri].is_subst ) // reposition priority alm boxes
980-
document.getElementById( "DIV_" + substorpri ).style.left = ( xleft + cntpr * 58 ) + "px";
981-
}
9821118

9831119
// update alarm boxes state/counts
9841120
$( '#DIV_' + substorpri ).css( 'opacity', WebSAGE.g_alminfo[substorpri].filterout ? '.25' : '1' );
@@ -1117,14 +1253,24 @@
11171253
if ( pri === 0 )
11181254
{
11191255
stl = 'color: ' + ColorOfPriority[ pri ] + ';';
1120-
stl += 'font-weight: bold;';
11211256
}
11221257
else
11231258
{
11241259
stl = 'color: ' + TabularViewer_AlmTxtColor + ';';
11251260
}
11261261
}
11271262

1263+
if ( pri === 0 )
1264+
{
1265+
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_DESCR].style.fontWeight = "bold";
1266+
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_EVENTO].style.fontWeight = "bold";
1267+
}
1268+
else
1269+
{
1270+
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_DESCR].style.fontWeight = "inherit";
1271+
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_EVENTO].style.fontWeight = "inherit";
1272+
}
1273+
11281274
if ( WebSAGE.g_tbl.cellsx( id, WebSAGE.g_COL_QUALIF ).indexOf("L") != -1 ||
11291275
WebSAGE.g_tbl.cellsx( id, WebSAGE.g_COL_QUALIF ).indexOf("P") != -1
11301276
)
@@ -1180,7 +1326,10 @@
11801326
}
11811327
*/
11821328
WebSAGE.g_tbl.setRowTextStyle( id, stl );
1183-
1329+
1330+
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_DATA].style.fontSize = "smaller";
1331+
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_QUALIF].style.fontSize = "smaller";
1332+
11841333
if ( WebSAGE.isAlarmsViewer() )
11851334
{
11861335
// differentiate the substation name
@@ -1292,7 +1441,10 @@
12921441
document.getElementById("OPC_CMDANORM").style.display = "none";
12931442
document.getElementById("OPC_FILTROS").style.display = "none";
12941443

1295-
document.getElementById("IMGTABULAR").style.display = "none";
1444+
// document.getElementById("IMGTABULAR").style.display = "none";
1445+
$('#IMGTABULAR').attr('src', Imgs["ANORM_ID"] );
1446+
$('#IMGTABULAR').attr('title', "" );
1447+
12961448
document.getElementById("imgReconheceTudo").style.display = "";
12971449
},
12981450

0 commit comments

Comments
 (0)