Skip to content

Commit

Permalink
Version 6.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Olsen committed Mar 20, 2019
1 parent 7816595 commit e01c670
Show file tree
Hide file tree
Showing 13 changed files with 477 additions and 1,314 deletions.
Binary file modified docs/oshmi_configuration_manual-en_us.odt
Binary file not shown.
4 changes: 3 additions & 1 deletion htdocs/annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@
{
$p_CONTENT = trim($p_CONTENT);

// Forward request to redendant HMI if exists
// Forward request to redundant HMI if exists
$otherhmiip="";
$port=51909;
// Parse with sections
$ini_array = parse_ini_file("../conf/hmi.ini", true);
if ( $ini_array["REDUNDANCY"]["OTHER_HMI_IP"] != "" )
$otherhmiip = $ini_array["REDUNDANCY"]["OTHER_HMI_IP"];
if ( $ini_array["REDUNDANCY"]["HTTP_PORT"] != "" )
$port = $ini_array["REDUNDANCY"]["HTTP_PORT"];
if ( $otherhmiip != "" )
if ( $_SERVER['REMOTE_ADDR'] != $otherhmiip )
{
Expand Down
4 changes: 3 additions & 1 deletion htdocs/annotation_readonly.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
{
$p_CONTENT = trim($p_CONTENT);

// Forward request to redendant HMI if exists
// Forward request to redundant HMI if exists
$otherhmiip="";
$port=51909;
// Parse with sections
$ini_array = parse_ini_file("../conf/hmi.ini", true);
if ( $ini_array["REDUNDANCY"]["OTHER_HMI_IP"] != "" )
$otherhmiip = $ini_array["REDUNDANCY"]["OTHER_HMI_IP"];
if ( $ini_array["REDUNDANCY"]["HTTP_PORT"] != "" )
$port = $ini_array["REDUNDANCY"]["HTTP_PORT"];
if ( $otherhmiip != "" )
if ( $_SERVER['REMOTE_ADDR'] != $otherhmiip )
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/eventserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
$nponto = 0;

$dbsde = new PDO( 'sqlite:../db/soe.sl3' );
$dbsde->setAttribute(PDO::ATTR_TIMEOUT, 3);
$dbsde->setAttribute(PDO::ATTR_TIMEOUT, 8);
$dbsde->exec ( "PRAGMA synchronous = NORMAL" );
$dbsde->exec ( "PRAGMA journal_mode = WAL" );
$dbsde->exec ( "PRAGMA locking_mode = NORMAL" );
Expand Down
2 changes: 1 addition & 1 deletion htdocs/screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<img id='IMGSEPAR1' align='middle' width='8' height='32' >
<img id='ANTETELAID' align='middle' width='16' height='16' style='cursor:pointer;'/>
<select style='font-family:consolas,courier,monospace;vertical-align:middle;text-shadow: 1px 1px 1px #909090;' name='SELTELA' id='SELTELA' size='1'>
<option id='SELTELA_OPC1' disabled='disabled'>?</option>
<option id='SELTELA_OPC1' selected disabled='disabled'>?</option>
</select>
<img id='PROXTELAID' align='middle' width='16' height='16' style='cursor:pointer;'/>
<img id='IMGSEPAR2' align='middle' width='8' height='32' />
Expand Down
198 changes: 175 additions & 23 deletions htdocs/tabular.html
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,97 @@
setTimeout( WebSAGE.mudaFiltro, 10 );
}

// Filters saved in localStorage
var almFilter={};
if (storageAvailable('localStorage'))
{
var storedData = localStorage.getItem("almFilter");
if (storedData) {
almFilter = JSON.parse(storedData);
}
}

// create missing substation filters inside a div
for (var se in Lista)
{
if (Lista[se] == "")
continue;
var ytop = 2;
if ( document.getElementById( "DIV_" + Lista[se] ) === null )
$( "#DIV_SUBSTALMFILT" ).prepend(
"<div id='DIV_" + Lista[se] + "' " +
" onclick='WebSAGE.g_alminfo[&quot;" + Lista[se] + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + Lista[se] + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
" style='position:relative;float:left;text-align:center;margin-bottom:7px;margin-left:3px;top:" + ytop + "px;" +
"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'>"+
Lista[se] +
"<br>" +
"<span id='SP_" + Lista[se] + "_ACK" +
"' 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;'>" +
"0</span>" +
"<span id='SP_" + Lista[se] + "_NACK" +
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
"0</span>" +
"</div>" );

if ( typeof( WebSAGE.g_alminfo[ Lista[se] ] ) === 'undefined' )
{
WebSAGE.g_alminfo[ Lista[se] ] = { countnack: 0,
countack: 0,
filterout: false,
minpriorack: 10,
minpriornack: 10,
is_subst: true };
}

if( WebSAGE.isAlarmsViewer() )
if ( Lista[se] in almFilter )
{
WebSAGE.g_alminfo[ Lista[se] ].filterout = almFilter[Lista[se]];
}
}

if ( WebSAGE.isAlarmsViewer() )
{
var xleft = 230;
var ytop = 5;
for ( var priority in [0,1,2,3,4,5,7,8,9] )
{
if ( document.getElementById( "DIV_" + priority ) === null && priority <= 3 )
{
$( "body" ).append(
"<div id='DIV_" + priority + "' " +
" onclick='WebSAGE.g_alminfo[&quot;" + priority + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + priority + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
" style='position:absolute;float:left;text-align:center;top:" + ytop + "px;" +
"left:" + ( xleft + priority * 58 ) + "px;" +
"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'>"+
priority +
"<br>" +
"<span id='SP_" + priority + "_ACK" +
"' 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;'>" +
"0</span>" +
"<span id='SP_" + priority + "_NACK" +
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
"0</span>" +
"</div>" );
}

if ( priority in almFilter )
{
WebSAGE.g_alminfo[ priority ].filterout = almFilter[priority];
}
}
WebSAGE.applyTableStyle();

// sort divs in name (id) order
var main = document.getElementById( 'DIV_SUBSTALMFILT' );
if (main !== null)
[].map.call( main.children, Object ).sort( function ( a, b ) {
return ((a.id > b.id)? 1 : -1);
}).forEach( function ( elem ) {
main.appendChild( elem );
});
}

// document.getElementById("SELSE").onChange=WebSAGE.mudaSE;
},

Expand Down Expand Up @@ -750,12 +841,16 @@

applyTableStyle: function()
{
var almFilter={};

// assemble the filterout list
WebSAGE.g_filterOutList = [];
for ( var substorpri in WebSAGE.g_alminfo )
{
if ( WebSAGE.g_alminfo.hasOwnProperty(substorpri) )
{
almFilter[substorpri] = WebSAGE.g_alminfo[substorpri].filterout;

if ( WebSAGE.isAlarmsViewer() )
{
if ( WebSAGE.g_alminfo[substorpri].filterout )
Expand All @@ -771,6 +866,9 @@
}
}

if (storageAvailable('localStorage'))
localStorage.setItem("almFilter", JSON.stringify(almFilter));

// reapply line styles
for( var i = 0; i < L.length; i++ )
{
Expand Down Expand Up @@ -931,20 +1029,62 @@
}

// container to put in per substation filters
if ( document.getElementById( "DIV_SUBSTALMFILT" ) === null )
$( "body" ).append("<div id='DIV_SUBSTALMFILT' style='overflow:auto;top:42px;left:0;width:100%;height:35px;position:absolute;text-align:center;'><div>");
if ( document.getElementById( "DIV_SUBSTALMFILT" ) === null ) {
$( "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;'>"+
"<div id='ZZABC1' style='clear:left;padding-top:5px;padding-bottom:2px;'>" +
"<input id='ZZCB_SELECTALL' type='button' value='Select All'>&nbsp;&nbsp;" +
"<input id='ZZCB_UNSELECTALL' type='button' value='Unselect All'>" +
"</div>" +
"</div>");
document.getElementById("ZZCB_SELECTALL").value = Msg.SelectAll;
document.getElementById("ZZCB_UNSELECTALL").value = Msg.UnselectAll;
document.getElementById("ZZCB_SELECTALL").
addEventListener("click",
function(event) {
for ( var sorp in WebSAGE.g_alminfo )
{
if (WebSAGE.g_alminfo[sorp].is_subst)
{
WebSAGE.g_alminfo[sorp].filterout=true;
}
}
WebSAGE.applyTableStyle();
});
document.getElementById("ZZCB_UNSELECTALL").
addEventListener("click",
function(event) {
for ( var sorp in WebSAGE.g_alminfo )
{
if (WebSAGE.g_alminfo[sorp].is_subst)
{
WebSAGE.g_alminfo[sorp].filterout=false;
}
}
WebSAGE.applyTableStyle();
});
document.getElementById("DIV_SUBSTALMFILT").
addEventListener("mouseover",
function(event) {
document.getElementById("DIV_SUBSTALMFILT").style.height="";
});
document.getElementById("DIV_SUBSTALMFILT").
addEventListener("mouseout",
function(event) {
document.getElementById("DIV_SUBSTALMFILT").style.height="35px";
});
}

if ( document.getElementById( "DIV_" + substorpri ) === null )
{ // create priority and substation alm boxes
if ( WebSAGE.g_alminfo[substorpri].is_subst )
{ // create substation filters inside a div
ytop=0;
$( "#DIV_SUBSTALMFILT" ).append(
ytop=2;
$( "#DIV_SUBSTALMFILT" ).prepend(
"<div id='DIV_" + substorpri + "' " +
" onclick='WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
" style='position:relative;float:left;text-align:center;margin-bottom:7px;margin-left:3px;top:" + ytop + "px;" +
// "left:" + ( xleft + ( WebSAGE.g_alminfo[substorpri].is_subst ? cntsb : cntpr ) * 58 ) + "px;" +
"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'>"+
"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'>"+
substorpri +
"<br>" +
"<span id='SP_" + substorpri + "_ACK" +
Expand All @@ -955,30 +1095,26 @@
"</span>" +
"</div>" );
}
else
{ // create priority filters directly over the body
else
{
ytop = 5;
$( "body" ).append(
"<div id='DIV_" + substorpri + "' " +
"<div id='DIV_" + substorpri + "' " +
" onclick='WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout = ! WebSAGE.g_alminfo[&quot;" + substorpri + "&quot;].filterout;WebSAGE.applyTableStyle();'" +
" style='position:absolute;float:left;text-align:center;top:" + ytop + "px;" +
"left:" + ( xleft + ( WebSAGE.g_alminfo[substorpri].is_subst ? cntsb : cntpr ) * 58 ) + "px;" +
"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'>"+
"left:" + ( xleft + substorpri * 58 ) + "px;" +
"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'>"+
substorpri +
"<br>" +
"<span id='SP_" + substorpri + "_ACK" +
"' style='float:right;-webkit-filter:contrast(.7);text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;'>" +
"</span>" +
"' 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;'>" +
"0</span>" +
"<span id='SP_" + substorpri + "_NACK" +
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;'>" +
"</span>" +
"</div>" );
"' style='float:right;text-align:center;font-size:12px;border-radius:15px;border:2px solid;margin:1px;background-color:silver;border-color:silver;'>" +
"0</span>" +
"</div>" );
}
}
else
{
if ( ! WebSAGE.g_alminfo[substorpri].is_subst ) // reposition priority alm boxes
document.getElementById( "DIV_" + substorpri ).style.left = ( xleft + cntpr * 58 ) + "px";
}

// update alarm boxes state/counts
$( '#DIV_' + substorpri ).css( 'opacity', WebSAGE.g_alminfo[substorpri].filterout ? '.25' : '1' );
Expand Down Expand Up @@ -1117,14 +1253,24 @@
if ( pri === 0 )
{
stl = 'color: ' + ColorOfPriority[ pri ] + ';';
stl += 'font-weight: bold;';
}
else
{
stl = 'color: ' + TabularViewer_AlmTxtColor + ';';
}
}

if ( pri === 0 )
{
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_DESCR].style.fontWeight = "bold";
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_EVENTO].style.fontWeight = "bold";
}
else
{
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_DESCR].style.fontWeight = "inherit";
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_EVENTO].style.fontWeight = "inherit";
}

if ( WebSAGE.g_tbl.cellsx( id, WebSAGE.g_COL_QUALIF ).indexOf("L") != -1 ||
WebSAGE.g_tbl.cellsx( id, WebSAGE.g_COL_QUALIF ).indexOf("P") != -1
)
Expand Down Expand Up @@ -1180,7 +1326,10 @@
}
*/
WebSAGE.g_tbl.setRowTextStyle( id, stl );


WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_DATA].style.fontSize = "smaller";
WebSAGE.g_tbl.rows[id+1].cells[WebSAGE.g_COL_QUALIF].style.fontSize = "smaller";

if ( WebSAGE.isAlarmsViewer() )
{
// differentiate the substation name
Expand Down Expand Up @@ -1292,7 +1441,10 @@
document.getElementById("OPC_CMDANORM").style.display = "none";
document.getElementById("OPC_FILTROS").style.display = "none";

document.getElementById("IMGTABULAR").style.display = "none";
// document.getElementById("IMGTABULAR").style.display = "none";
$('#IMGTABULAR').attr('src', Imgs["ANORM_ID"] );
$('#IMGTABULAR').attr('title', "" );

document.getElementById("imgReconheceTudo").style.display = "";
},

Expand Down
Loading

0 comments on commit e01c670

Please sign in to comment.