|
638 | 638 | setTimeout( WebSAGE.mudaFiltro, 10 ); |
639 | 639 | } |
640 | 640 |
|
| 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["" + Lista[se] + ""].filterout = ! WebSAGE.g_alminfo["" + Lista[se] + ""].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["" + priority + ""].filterout = ! WebSAGE.g_alminfo["" + priority + ""].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 | + |
641 | 732 | // document.getElementById("SELSE").onChange=WebSAGE.mudaSE; |
642 | 733 | }, |
643 | 734 |
|
|
750 | 841 |
|
751 | 842 | applyTableStyle: function() |
752 | 843 | { |
| 844 | +var almFilter={}; |
| 845 | + |
753 | 846 | // assemble the filterout list |
754 | 847 | WebSAGE.g_filterOutList = []; |
755 | 848 | for ( var substorpri in WebSAGE.g_alminfo ) |
756 | 849 | { |
757 | 850 | if ( WebSAGE.g_alminfo.hasOwnProperty(substorpri) ) |
758 | 851 | { |
| 852 | + almFilter[substorpri] = WebSAGE.g_alminfo[substorpri].filterout; |
| 853 | + |
759 | 854 | if ( WebSAGE.isAlarmsViewer() ) |
760 | 855 | { |
761 | 856 | if ( WebSAGE.g_alminfo[substorpri].filterout ) |
|
771 | 866 | } |
772 | 867 | } |
773 | 868 |
|
| 869 | +if (storageAvailable('localStorage')) |
| 870 | + localStorage.setItem("almFilter", JSON.stringify(almFilter)); |
| 871 | + |
774 | 872 | // reapply line styles |
775 | 873 | for( var i = 0; i < L.length; i++ ) |
776 | 874 | { |
|
931 | 1029 | } |
932 | 1030 |
|
933 | 1031 | // 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'> " + |
| 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 | + } |
936 | 1076 |
|
937 | 1077 | if ( document.getElementById( "DIV_" + substorpri ) === null ) |
938 | 1078 | { // create priority and substation alm boxes |
939 | 1079 | if ( WebSAGE.g_alminfo[substorpri].is_subst ) |
940 | 1080 | { // create substation filters inside a div |
941 | | - ytop=0; |
942 | | - $( "#DIV_SUBSTALMFILT" ).append( |
| 1081 | + ytop=2; |
| 1082 | + $( "#DIV_SUBSTALMFILT" ).prepend( |
943 | 1083 | "<div id='DIV_" + substorpri + "' " + |
944 | 1084 | " onclick='WebSAGE.g_alminfo["" + substorpri + ""].filterout = ! WebSAGE.g_alminfo["" + substorpri + ""].filterout;WebSAGE.applyTableStyle();'" + |
945 | 1085 | " style='position:relative;float:left;text-align:center;margin-bottom:7px;margin-left:3px;top:" + ytop + "px;" + |
946 | 1086 | // "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'>"+ |
948 | 1088 | substorpri + |
949 | 1089 | "<br>" + |
950 | 1090 | "<span id='SP_" + substorpri + "_ACK" + |
|
955 | 1095 | "</span>" + |
956 | 1096 | "</div>" ); |
957 | 1097 | } |
958 | | - else |
959 | | - { // create priority filters directly over the body |
| 1098 | + else |
| 1099 | + { |
| 1100 | + ytop = 5; |
960 | 1101 | $( "body" ).append( |
961 | | - "<div id='DIV_" + substorpri + "' " + |
| 1102 | + "<div id='DIV_" + substorpri + "' " + |
962 | 1103 | " onclick='WebSAGE.g_alminfo["" + substorpri + ""].filterout = ! WebSAGE.g_alminfo["" + substorpri + ""].filterout;WebSAGE.applyTableStyle();'" + |
963 | 1104 | " 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'>"+ |
966 | 1107 | substorpri + |
967 | 1108 | "<br>" + |
968 | 1109 | "<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>" + |
971 | 1112 | "<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>" ); |
975 | 1116 | } |
976 | 1117 | } |
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 | | - } |
982 | 1118 |
|
983 | 1119 | // update alarm boxes state/counts |
984 | 1120 | $( '#DIV_' + substorpri ).css( 'opacity', WebSAGE.g_alminfo[substorpri].filterout ? '.25' : '1' ); |
|
1117 | 1253 | if ( pri === 0 ) |
1118 | 1254 | { |
1119 | 1255 | stl = 'color: ' + ColorOfPriority[ pri ] + ';'; |
1120 | | - stl += 'font-weight: bold;'; |
1121 | 1256 | } |
1122 | 1257 | else |
1123 | 1258 | { |
1124 | 1259 | stl = 'color: ' + TabularViewer_AlmTxtColor + ';'; |
1125 | 1260 | } |
1126 | 1261 | } |
1127 | 1262 |
|
| 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 | + |
1128 | 1274 | if ( WebSAGE.g_tbl.cellsx( id, WebSAGE.g_COL_QUALIF ).indexOf("L") != -1 || |
1129 | 1275 | WebSAGE.g_tbl.cellsx( id, WebSAGE.g_COL_QUALIF ).indexOf("P") != -1 |
1130 | 1276 | ) |
|
1180 | 1326 | } |
1181 | 1327 | */ |
1182 | 1328 | 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 | + |
1184 | 1333 | if ( WebSAGE.isAlarmsViewer() ) |
1185 | 1334 | { |
1186 | 1335 | // differentiate the substation name |
|
1292 | 1441 | document.getElementById("OPC_CMDANORM").style.display = "none"; |
1293 | 1442 | document.getElementById("OPC_FILTROS").style.display = "none"; |
1294 | 1443 |
|
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 | + |
1296 | 1448 | document.getElementById("imgReconheceTudo").style.display = ""; |
1297 | 1449 | }, |
1298 | 1450 |
|
|
0 commit comments