|
63 | 63 | var NUM_VAR_ANT = 0; // estado anterior da variável NUM_VAR |
64 | 64 | var GROUP1_LIST = []; // list of possible group1 values |
65 | 65 | var ALARMBEEP = 0; // alarm beep status |
| 66 | +var ALARMBEEP_TYPE = 0; // alarm beep type |
66 | 67 | var BEEP_POINTKEY = -1; |
67 | 68 | var CNTUPDATES_POINTKEY = -2; |
68 | 69 |
|
|
1610 | 1611 |
|
1611 | 1612 | prop = element._Properties; |
1612 | 1613 | var pointKey = prop._id; |
1613 | | - |
| 1614 | + |
1614 | 1615 | var dateAlarm = ""; |
1615 | 1616 | if (prop.alarmed && prop.timeTagAlarm!==null) |
1616 | 1617 | if ((new Date(prop.timeTagAlarm)).getFullYear()>1980){ |
|
1838 | 1839 | prop = element._Properties; |
1839 | 1840 | var pointKey = prop._id; |
1840 | 1841 |
|
| 1842 | + if ( pointKey === BEEP_POINTKEY && "beepType" in prop ) |
| 1843 | + ALARMBEEP_TYPE = prop.beepType; |
| 1844 | + |
1841 | 1845 | if (element.Value.Type === OpcValueTypes.Boolean) { |
1842 | 1846 | V[pointKey] = element.Value.Body?0:1; |
1843 | 1847 | F[pointKey] = (element.Value.Body ? 0x02 : 0x01); |
|
2990 | 2994 |
|
2991 | 2995 | // desabilita o botão direito |
2992 | 2996 | document.oncontextmenu = function() { return false; }; |
| 2997 | + |
| 2998 | + // alarm beep sound |
| 2999 | + if (WebSAGE.isAlarmsViewer()) |
| 3000 | + document.getElementById('btSound').style.display=''; |
| 3001 | + document.getElementById('btSound').addEventListener("click", function () { |
| 3002 | + if (document.getElementById('btSound').value === '🔊'){ |
| 3003 | + document.getElementById('btSound').value = '🔈'; |
| 3004 | + clearInterval(window.sndIntervalHandle); |
| 3005 | + } else { |
| 3006 | + document.getElementById('nonCriticalSound').play(); |
| 3007 | + document.getElementById('btSound').value = '🔊'; |
| 3008 | + window.sndIntervalHandle = setInterval( function(){ |
| 3009 | + if (window.WebSAGE.getValue(BEEP_POINTKEY)) |
| 3010 | + switch (ALARMBEEP_TYPE) { |
| 3011 | + default: |
| 3012 | + document.getElementById('nonCriticalSound').play(); |
| 3013 | + break; |
| 3014 | + case 2: |
| 3015 | + document.getElementById('criticalSound').play(); |
| 3016 | + break; |
| 3017 | + } |
| 3018 | + }, 1000); |
| 3019 | + } |
| 3020 | + }); |
2993 | 3021 | } |
2994 | 3022 | }; |
2995 | 3023 | Core.start(WebSAGE); |
|
3007 | 3035 | <img id="imgFontSizeDown" alt='' src='' align='middle' width="27" height="27" onclick='WebSAGE.fontSize(0)' style='cursor:pointer;' /> |
3008 | 3036 | <img id='imgReconheceTudo' alt='' src='' align='middle' width="32" height="32" onclick='WebSAGE.ackAllAlarms(0);' style='cursor:pointer;display:none' /> |
3009 | 3037 | <img id='imgClipboard' alt='' src='' onclick='CopyClipboard("TBLEVE")' align='middle' border='0' width='32' height='32' style='cursor:pointer;' /> |
| 3038 | +<input id="btSound" title="Beep ON/OFF" style="display:none;cursor:pointer;vertical-align:middle;background:none;border:0px;font-size:20px;transform: translateY(3px);" type="button" value="🔈" /> |
| 3039 | +<audio id="criticalSound"><source src="sounds/critical.wav" muted type="audio/wav"></audio> |
| 3040 | +<audio id="nonCriticalSound"><source src="sounds/nonCritical.wav" muted type="audio/wav"></audio> |
3010 | 3041 | <img id='SILENCIA_ID' alt='' src='' align='middle' width="32" height="32" onclick='document.getElementById("SILENCIA_ID").style.display="none";WebSAGE.doSilenceBeep();' style='display:none; cursor:pointer;' /> |
3011 | 3042 | |
3012 | 3043 | <div id='OPC_CMDANORM' style='display:none' > |
|
0 commit comments