var _SCIntern=function(a){function h(a,f){this.element=null;this.name="";this.name=f;if(a)this.element=a.getElementById(f)}function g(a,f,c,d){this.eventId=a;this.cbFunction=f;this.cbArgument1=c;this.cbArgument2=d}a.drawRectShape=function(){var b=0,f=1,c="",f="",d=this.getOutlineWidth(),e=0;this.checkIfInterior()===!0&&(b=1);f=this.checkIfOutline()===!0?1:0;c="rgba("+this.getInteriorColor()+","+b+")";f="rgba("+this.getOutlineColor()+","+f+")";e=this.getOutlineStyle();if(this.frmElmnt!==null)a.removeSVG(this.frmElmnt),
this.frmElmnt=null;switch(e){case a.SOLID:this.frmElmnt=a.createSVGRect(this.svgDoc,this.getRepaintElement(this.frmGroup),this.x,this.y,this.w,this.h,c,f,d,this.getInnerFill());break;case a.DASHED:case a.DOTTED:this.frmElmnt=a.createSVGRectDashed(this.svgDoc,this.getRepaintElement(this.frmGroup),this.x,this.y,this.w,this.h,c,f,d,this.getInnerFill(),e);break;default:a.log_append_ln("Unknown outline style")}};a.InfoType=function(){this.textg=this.img=this.valuePrev=this.value=this.e=this.type=this.name=
null;this.h=this.w=this.y=this.x=0;this.fSz=this.fSt=this.fN=null};a.PainterType_MPainter=function(b){var f,c,d,e,n;function r(b,d,c,e,f,n,j){if(b.value!==null){var g=null,r=null,m=null,s=1,o=null,p=0,q=null,h=null,u=null,X=null,G={rValue:b.value.toString()};if(b.type!==a.INFO_T_FILE){if(c===!0&&(g=k.getTcrFormatSource(),g.value!==null)){if(typeof f!=="undefined"&&f!=null&&f==!0&&(m=k.getTcrGainSource())!=null&&m.value!=null&&!isNaN(m.value))s=m.value;if(typeof n!=="undefined"&&n!=null&&n==!0&&(o=
k.getTcrOffsetSource())!=null&&o.value!=null&&!isNaN(o.value))p=o.value;if(!isNaN(G.rValue))G.rValue=parseFloat(G.rValue)*parseFloat(s)+parseFloat(p);if(typeof e!=="undefined"&&e!=null&&e==!0){if((q=k.getTcrMinValueSource())!=null&&q.value!=null&&!isNaN(q.value))h=parseFloat(q.value);if((u=k.getTcrMaxValueSource())!=null&&u.value!=null&&!isNaN(u.value))X=parseFloat(u.value);if(h!==null&&G.rValueX)a.MsgBoxErrorFlag=
!0,a.err_append_ln("Invalid entry: "+G.rValue+" > "+X+"!")}a.TCR_convertToValueFormat(g.value,G)}if(d===!0&&(r=k.getTcrUnitSource())!=null&&r.value!=null&&r.value!=void 0)G.rValue=G.rValue+" "+r.value;if(d===!0){c=0;c=e=null;d=k.getFormatSource().value;if(d!==null){if(G.rValue.length===0)G.rValue=a.getTimestamp_ms()/1E3;d.indexOf("%t")!==-1?(c=G.rValue*1E3,e=new Date(0),d.indexOf("%tu")!==-1?(e.setTime(c),c=e,e=new Date(0),e.setMilliseconds(c.getUTCMilliseconds()),e.setSeconds(c.getUTCSeconds()),
e.setMinutes(c.getUTCMinutes()),e.setHours(c.getUTCHours()),e.setDate(c.getUTCDate()),e.setMonth(c.getUTCMonth()),e.setFullYear(c.getUTCFullYear()),c=e,d=d.replace("%tu",""),G.rValue=c.strftime(d)):(e.setTime(c),d=d.replace("%t",""),G.rValue=e.strftime(d))):G.rValue=a.sprintf(d,G.rValue)}if((b.type===a.INFO_T_PPO||b.type===a.INFO_T_PASSWORDPPO)&&j!==void 0&&j.ppo!==null&&j.ppo.unit.length>0)G.rValue=G.rValue+" "+j.ppo.unit}b.value=G.rValue}}}function j(b,d,c){b.type=d.type;b.name=d.name;if(b.type===
a.INFO_T_FILE){d.value=d.name;c=d.value.indexOf("|");if(c!=-1)d.value=d.value.substring(0,c);b.value=a.rl_resolveInfoName(d.value)}else b.value=a.RW_readSource(d.type,d.name,c)}var k=this;this.objId=0;this.objStr="";this.h=this.w=this.y=this.x=this.hOrg=this.wOrg=this.yOrg=this.xOrg=this.ptId=0;this.instanceValidUpAction=this.instanceValidDownAction=this.instanceDisabled=this.instanceDraw=this.painterGroupElement=this.shpElmnt=this.svgDoc=null;this.repaintElements=[];this.externEventListener=[];this.editModeFlag=
this.mouseInFlag=!1;this.editSource=new a.InfoType;this.paintSource=new a.InfoType;this.pressedSource=new a.InfoType;this.disabledSource=new a.InfoType;this.formatSource=new a.InfoType;this.tcrFormatSource=new a.InfoType;this.tcrUnitSource=new a.InfoType;this.tcrGainSource=new a.InfoType;this.tcrOffsetSource=new a.InfoType;this.tcrMinValueSource=new a.InfoType;this.tcrMaxValueSource=new a.InfoType;this.drawCellTxtOnXLinesSource=new a.InfoType;this.reloadFilePeriode=new a.InfoType;this.blendSources=
[];this.blendSourcesPrevString=[];this.onLostActionFunc=this.onDrawActionFunc=this.onGainActionFunc=this.executeActionMouseUp=this.executeActionMouseDown=null;this.isDisabledPrev=this.isDisabled=!1;this.isVisible=!0;this.notify=function(b,d){var c=0;switch(b){case a.VIEW_GAIN_FOCUS:if(this.instanceDisabled()===!1&&this.onGainActionFunc)this.onGainActionFunc();break;case a.VIEW_LOST_FOCUS:if(this.instanceDisabled()===!1&&this.onLostActionFunc)this.onLostActionFunc();break;case a.DRAW_OBJECT:this.instanceDraw&&
this.instanceDraw();if(k.instanceDisabled&&(k.isDisabled=k.instanceDisabled(),k.isDisabled!==k.isDisabledPrev))k.isDisabledPrev=k.isDisabled,k.scheduleFullRedrawPainter();this.genericDraw();if(this.instanceDisabled()===!1&&this.onDrawActionFunc)this.onDrawActionFunc();break;case a.MOUSE_DOWN:if(a.OB_checkMouseCoordinates(this,d)===!0)if(this.instanceDisabled()===!1){var e=this.anyMouseDownExternalEventListener(),f=this.anyMouseUpExternalEventListener(),n=this.instanceValidDownAction(),j=this.instanceValidUpAction();
if(n===!0||j===!0||e===!0||f===!0){this.isPressed=!0;d.consumedFlag=!0;d.consumedPainter=this;this.scheduleFullRedrawPainter();if(n===!0)this.executeActionMouseDown(),d.actionExecutedFlag=!0;if(e===!0)this.callExternalListener(b,d),d.actionExecutedFlag=!0;c=1}}else c=0;else c=0;break;case a.MOUSE_UP:if(a.g_MouseDownEventInfo.consumedFlag===!0&&a.g_MouseDownEventInfo.consumedPainter!==null)a.OB_checkMouseCoordinates(this,a.g_MouseDownEventInfo)===!0||a.g_MouseDownEventInfo.consumedPainter===this?this.instanceDisabled()===
!1?(this.executeActionMouseUp&&this.executeActionMouseUp(),this.anyMouseUpExternalEventListener()&&this.callExternalListener(b,d)):a.getDebugLevel()>=2&&a.log_append_ln("hmi_mpainter Disabled while down case"):a.getDebugLevel()>=2&&a.log_append_ln("hmi-mpainter Undo case"),this.isPressed=!1,this.scheduleFullRedrawPainter();break;case a.MOUSE_MOVE:if(a.OB_checkMouseCoordinates(this,d)===!0){if(this.instanceDisabled()===!1&&this.mouseInFlag===!1)this.mouseInFlag=!0,d.type=a.MOUSE_OVER,d.typeStr=a.MOUSE_OVER_STR,
this.getNumExternEventListener()&&this.callExternalListener(a.MOUSE_OVER,d)}else if(this.mouseInFlag===!0)this.mouseInFlag=!1,d.type=a.MOUSE_OUT,d.typeStr=a.MOUSE_OUT_STR,this.getNumExternEventListener()&&(c=this.callExternalListener(a.MOUSE_OUT,d))}return c};this.dragImpl=function(b,d){var c=0,e=0,f=0,n=0,j=0,k=0,n=!1,g=0,r=0,m=0,c=c=0,k=Date.now(),s=Date.now(),s=k-b.lastWriteTSmS;a.getDebugLevel()>=3&&a.log_append_ln("dragImpl(..., "+d+" ) dragInfoPtr.lastWriteTSmS "+b.lastWriteTSmS+" timeNowMs "+
k+" dragInfoPtr.previousToWriteValue "+b.previousToWriteValue+" deltaMs "+s);c=b.lastWriteTSmS<=0||b.destType!==a.INFO_T_PPO?a.RW_readSource(b.destType,b.destName):b.previousToWriteValue;isNaN(c)===!0&&(a.log_append_ln("WARNING this.dragImpl destPrevious value ["+c+"] is NaN so force to 0 "),c=0);a.toFixed(c,4);e=a.RW_readSource_parseFloat(b.typeValueMin,b.nameValueMin,1);f=a.RW_readSource_parseFloat(b.typeValueMax,b.nameValueMax,1);n=a.RW_readSource_parseInt(b.typeOptionFlag,b.nameOptionFlag);c=
e;j=f;n=(n&2)==2;g=a.RW_readSource_parseFloat(b.typePxMin,b.namePxMin,1);r=a.RW_readSource_parseFloat(b.typePxMax,b.namePxMax,1);isNaN(d)===!0&&(a.log_append_ln("WARNING this.dragImpl offset value ["+d+"] is NaN so force to 0 "),d=0);if(r!=g){m=0;r!=g?m=(j-c)*(d-g)/(r-g)+c:a.log_append_ln("ERROR in dragWritePPOFromDrag iOffsetMax == iOffsetMin = "+g);c=a.MIN(e,f);j=a.MAX(e,f);mj&&(m=j);isNaN(m)===!0&&(a.log_append_ln("WARNING this.dragImpl destNow value ["+m+"] is NaN so force to 0 "),
m=0);n==!0?(c=a.toFixed(m,0),a.getDebugLevel()>=3&&a.log_append_ln("this.dragImpl dragInfoPtr.sliderOptionInteger active so rounds to int before write value= "+m+" destRounded = "+c)):c=a.toFixed(m,4);if(b.destType===a.INFO_T_PPO){if((b.lastWriteTSmS<=0||s>=a.DRAGINFO_WRITE_MIN_MS)&&b.previousToWriteValue!=c)a.getDebugLevel()>=3&&a.log_append_ln("dragImpl( "+d+" ) WRITE PPO destRounded: "+c+" dragInfoPtr.destName "+b.destName+" deltaMs "+s),a.writePPO(b.destName,c,!0),b.lastWriteTSmS=k}else if(b.previousToWriteValue!=
c)a.RW_writeSource(b.destType,b.destName,c),a.getDebugLevel()>=3&&a.log_append_ln("dragImpl( "+d+" ) WRITE CO destRounded: "+c+" dragInfoPtr.destName "+b.destName+" deltaMs "+s),b.lastWriteTSmS=k;b.previousToWriteValue=c;a.scheduleRepaint()}else n?(c=a.toFixed(m,0),a.getDebugLevel()>=3&&a.log_append_ln("this.dragImpl dragInfoPtr.sliderOptionInteger active so rounds to int before write value= "+m+" destRounded = "+c)):c=a.toFixed(m,4);return c};this.onDrag=function(){var b=this.getOffsetStruct();this.dragXInfo!==
null&&(this.dragImpl(this.dragXInfo,a.g_MouseMoveEventInfo.x-this.xOrg-b.xOff-this.dragXInfo.relDownPos),a.getDebugLevel()>=3&&(a.log_append_ln("this.onDrag"),a.log_append_ln("sc.g_MouseMoveEventInfo.x: "+a.g_MouseMoveEventInfo.x),a.log_append_ln("this.xOrg: "+this.xOrg),a.log_append_ln("offset.xOff: "+b.xOff),a.log_append_ln("this.dragXInfo.relDownPos: "+this.dragXInfo.relDownPos)));this.dragYInfo!==null&&(this.dragImpl(this.dragYInfo,a.g_MouseMoveEventInfo.y-this.yOrg-b.yOff-this.dragYInfo.relDownPos),
a.getDebugLevel()>=3&&(a.log_append_ln("this.onDrag"),a.log_append_ln("sc.g_MouseMoveEventInfo.y: "+a.g_MouseMoveEventInfo.y),a.log_append_ln("this.yOrg: "+this.yOrg),a.log_append_ln("offset.yOff: "+b.yOff),a.log_append_ln("this.dragYInfo.relDownPos: "+this.dragYInfo.relDownPos)));this.setOffset(b)};this.getDragXOffset=function(){var b=0;this.dragXInfo!==null&&(b=this.getDragOffset(this.dragXInfo));a.getDebugLevel()>=3&&a.log_append_ln("this.getDragXOffset: "+b);isNaN(b)===!0&&(a.log_append_ln("WARNING this.getDragXOffset dOffset value ["+
b+"] is NaN so force to 0 "),b=0);return b};this.getDragYOffset=function(){var b=0;this.dragYInfo!==null&&(b=this.getDragOffset(this.dragYInfo));isNaN(b)===!0&&(a.log_append_ln("WARNING this.getDragYOffset dOffset value ["+b+"] is NaN so force to 0 "),b=0);return b};this.getDragOffset=function(b){var c=0,d=0,e=c=0,f=e=0,n=0,c=0;b!==null&&(n=b.lastWriteTSmS<=0||b.destType!==a.INFO_T_PPO?a.RW_readSource(b.destType,b.destName):b.previousToWriteValue,isNaN(n)===!0&&(a.log_append_ln("WARNING this.getDragOffset destNow value ["+
n+"] is NaN so force to 0 for "+b.destName),n=0));c=parseFloat(a.RW_readSource(b.typeValueMin,b.nameValueMin));d=e=parseFloat(a.RW_readSource(b.typeValueMax,b.nameValueMax));e=parseFloat(a.RW_readSource(b.typePxMin,b.namePxMin));f=parseFloat(a.RW_readSource(b.typePxMax,b.namePxMax));b=0;d!=c?b=(n-c)*(f-e)/(d-c)+e:a.log_append_ln("ERROR in dragGetOffsetFromPPO iMaxPPO == iMinPPO = "+c);c=b;isNaN(c)===!0&&(a.log_append_ln("WARNING this.getDragOffset dOffset value ["+c+"] is NaN so force to 0 "),c=0);
cf&&(c=f);return c};this.dragYInfo=this.dragXInfo=null;var o="0, 0, 0",u=!0,p="0, 0, 0",s=!1,q=!1,m=!0,t=null,v=1,x=0,w=10,y="",z=0,I=10,D="",A=0,F=!1,H=!1,N=!1,L=0,J=0,M=!1,B={xOff:0,yOff:0,wOff:0,hOff:0},C=0,E=0;f=0;d=0;n=0;c="";e="";this.getOffsetStruct=function(){return B};this.hasAnyOffset=function(){var a=!1;if(B.xOff!=0||B.yOff!=0||B.wOff!=0||B.hOff!=0||C!=0||E!=0)a=!0;return a};this.scheduleFullRedrawPainter=function(){F=!0};this.isFullPainterRedrawRequired=function(){var b=!1;
return b=a.getDebugLevel()>=4?!0:F};this.resetFullRedrawFlag=function(){F=!1};this.genericDraw=function(){if(this.isFullPainterRedrawRequired()===!0){k.getShapeElement()&&(k.getShapeElement().setAttribute("stroke","rgb("+k.getOutlineColor()+")"),k.checkIfOutline()===!0?k.getShapeElement().setAttribute("stroke-width",k.getOutlineWidth()):k.getShapeElement().setAttribute("stroke-width","0"),k.ptId!==a.PT_NAME_BARGRAPH_ID&&(k.getShapeElement().setAttribute("fill","rgb("+k.getInteriorColor()+")"),k.checkIfInterior()===
!0?k.getShapeElement().setAttribute("fill-opacity","1"):k.getShapeElement().setAttribute("fill-opacity","0")));var b="",j=0,g=0,r=0;f>0?(j=0,j-=Math.abs(f)):f<0&&(j=Math.abs(f));j!==0&&(g=c===""||isNaN(c)===!0?k.x+k.w/2+d:c,r=e===""||isNaN(e)===!0?k.y+k.h/2+n:e,b="rotate("+j+","+g+","+r+")");j=k.getMainGroupElement();g=null;j!==null?(b.length>0&&j.setAttributeNS(null,"transform",b),b.length===0&&(g=j.getAttributeNS(null,"transform"),g!==null&&g.length>0&&j.setAttributeNS(null,"transform",""))):a.log_append_ln("getMainGroupElement returned null!")}this.typeDraw!==
null&&this.typeDraw();this.resetFullRedrawFlag()};this.typeDraw=null;this.setTextHPos=function(a){L!=a&&(L=a,this.scheduleFullRedrawPainter())};this.getTextHPos=function(){return L};this.setTextVPos=function(a){J!=a&&(J=a,this.scheduleFullRedrawPainter())};this.getTextVPos=function(){return J};this.setMultiline=function(a){H!=a&&(H=a,this.scheduleFullRedrawPainter())};this.getIsMultiline=function(){return H};this.setAutoAdjust=function(a){N!=a&&(N=a,this.scheduleFullRedrawPainter())};this.getIsAutoAjust=
function(){return N};this.setTextColor=function(a){t!=a&&(t=a,this.scheduleFullRedrawPainter())};this.setOutlineColor=function(a){p!=a&&(p=a,this.scheduleFullRedrawPainter())};this.setInnerFill=function(a){s!=a&&(s=a,this.scheduleFullRedrawPainter())};this.setU3d=function(a){q!=a&&(q=a,this.scheduleFullRedrawPainter())};this.setInteriorColor=function(a){o!=a&&(o=a,this.scheduleFullRedrawPainter())};this.setHasOutline=function(a){m!=a&&(m=a,this.scheduleFullRedrawPainter())};this.setHasInterior=function(a){u!=
a&&(u=a,this.scheduleFullRedrawPainter())};this.setPressedFlag=function(a){M!=a&&(M=a,this.scheduleFullRedrawPainter())};this.setUseFont=function(b){var c={ppo:null},d="",e=0,d=0,f="",e="";if(b.type===null){if(w!=I&&(w!=I||y!=D||z!=A))w=I,y=D,z=A,this.scheduleFullRedrawPainter()}else if(b.type==a.INFO_T_FONT){if(w!=b.fSz||y!=b.fN||z!=b.fSt)w=b.fSz,y=b.fN,z=b.fSt,this.scheduleFullRedrawPainter()}else if(d=a.RW_readSource(b.type,b.name,c),e=d.split(","),e.length==3&&(f=e[0],d=parseInt(e[1],10),e=parseInt(e[2],
10),!(isNaN(e)===!0||isNaN(d)===!0||e<=0||d<0||d>=5)))if(w!=e||y!=f||z!=d)w=e,y=f,z=d,this.scheduleFullRedrawPainter()};this.getPressedFlag=function(){return M};this.getColorFromString=function(b){var c="",c=-1,b=b.toString(),c=b.indexOf("#");if(c!=-1)return b=parseInt(b.slice(1,b.length),16),c=a.getRValue(b)+","+a.getGValue(b)+","+a.getBValue(b);c=b.indexOf(",");return c!=-1?b:c=a.getRValue(b)+","+a.getGValue(b)+","+a.getBValue(b)};this.getInteriorColor=function(){return this.getColorFromString(o)};
this.getOutlineColor=function(){return this.getColorFromString(p)};this.getTextColor=function(){var a="0,0,0,";return a=t!==null?this.getColorFromString(t):this.getOutlineColor()};this.getOutlineStyle=function(){return x};this.getOutlineWidth=function(){return v};this.getInnerFill=function(){return s};this.getU3d=function(){return q};this.checkIfInterior=function(){return u};this.checkIfOutline=function(){return m};this.getFontSize=function(){return w};this.getFontName=function(){return y};this.getFontStyle=
function(){return z};this.getSvgFontStyle=function(){var a="normal";switch(this.getFontStyle()){case 0:a="normal";break;case 1:a="normal";break;case 2:a="italic";break;case 3:a="italic";break;default:a="normal"}return a};this.getSvgFontWeight=function(){var a="lighter";switch(this.getFontStyle()){case 0:a="lighter";break;case 1:a="bold";break;case 2:a="lighter";break;case 3:a="bold";break;default:a="lighter"}return a};this._getRepaintElement=function(a){for(var b=0,c=!1,d=0,e=null,b=0;b=3&&a.log_append_ln("getRepaintElement: "+
b+" not found!");return c};this.getShapeElement=function(){return this.shpElmnt};this.getMainGroupElement=function(){var a=null;return a=this.svgDoc.getElementById(this.objStr)};this.getNumRepaints=function(){return this.repaintElements.length};this.changeRepaintVisibility=function(a,b){b?this.showRepaint(a):this.hideRepaint(a)};this.hideRepaint=function(b){var c=this.getRepaintElement(b);c===null?a.log_append_ln(b+" is null (hideRepaint)"):c.setAttributeNS(null,"visibility","hidden")};this.showRepaint=
function(b){var c=this.getRepaintElement(b);c===null?a.log_append_ln(b+" is null (showRepaint)"):c.setAttributeNS(null,"visibility","")};this.setVisibility=function(a){this.isVisible=a;var b=this.getMainGroupElement();b==null?console.log("setVisibility() domElmnt == null"):a?b.setAttributeNS(null,"visibility","visible"):b.setAttributeNS(null,"visibility","hidden")};this.setOffset=function(b){var c=this.getDragXOffset(),d=this.getDragYOffset();isNaN(c)===!0&&(a.log_append_ln("WARNING this.setOffset offsetDragx value ["+
c+"] is NaN so force to 0 "),c=0);isNaN(d)===!0&&(a.log_append_ln("WARNING this.setOffset offsetDragy value ["+d+"] is NaN so force to 0 "),d=0);if(isNaN(b.xOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStruct.xOff value ["+b.xOff+"] is NaN so force to 0 "),b.xOff=0;if(isNaN(b.yOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStruct.yOff value ["+b.yOff+"] is NaN so force to 0 "),b.yOff=0;if(isNaN(b.wOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStruct.wOff value ["+b.wOff+
"] is NaN so force to 0 "),b.wOff=0;if(isNaN(b.hOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStruct.hOff value ["+b.hOff+"] is NaN so force to 0 "),b.hOff=0;if(isNaN(B.xOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStructPrev.xOff value ["+B.xOff+"] is NaN so force to 0 "),B.xOff=0;if(isNaN(B.yOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStructPrev.yOff value ["+B.yOff+"] is NaN so force to 0 "),B.yOff=0;if(isNaN(B.wOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStructPrev.wOff value ["+
B.wOff+"] is NaN so force to 0 "),B.wOff=0;if(isNaN(B.hOff)===!0)a.log_append_ln("WARNING this.setOffset offsetStructPrev.hOff value ["+B.hOff+"] is NaN so force to 0 "),B.hOff=0;isNaN(C)===!0&&(a.log_append_ln("WARNING this.setOffset offsetDragStructPrev.dragXOff value ["+C+"] is NaN so force to 0 "),C=0);isNaN(E)===!0&&(a.log_append_ln("WARNING this.setOffset offsetDragStructPrev.dragYOff value ["+E+"] is NaN so force to 0 "),E=0);if(B.xOff!==b.xOff||B.yOff!==b.yOff||B.wOff!==b.wOff||B.hOff!==b.hOff||
C!==c||E!==d){this.x=this.xOrg+b.xOff+c;if(isNaN(this.x)===!0)a.log_append_ln("WARNING this.setOffset this.x value ["+this.x+"] is NaN so force to 0 "),this.x=0;this.y=this.yOrg+b.yOff+d;if(isNaN(this.y)===!0)a.log_append_ln("WARNING this.setOffset this.y value ["+this.y+"] is NaN so force to 0 "),this.y=0;this.w=this.wOrg+b.wOff;if(isNaN(this.w)===!0)a.log_append_ln("WARNING this.setOffset this.w value ["+this.w+"] is NaN so force to 0 "),this.w=0;this.h=this.hOrg+b.hOff;if(isNaN(this.h)===!0)a.log_append_ln("WARNING this.setOffset this.h value ["+
this.h+"] is NaN so force to 0 "),this.h=0;if(this.w<0){this.x+=this.w;if(this.x<0)this.x=0;this.w=-this.w}if(this.h<0){this.y+=this.h;if(this.y<0)this.y=0;this.h=-this.h}a.getDebugLevel>=2&&a.log_append_ln("this.setOffset \nthis.x = "+this.x+" \nthis.y = "+this.y+" \nthis.w = "+this.w+" \nthis.h = "+this.h);B.xOff=b.xOff;B.yOff=b.yOff;B.wOff=b.wOff;B.hOff=b.hOff;C=c;E=d;this.scheduleFullRedrawPainter()}};this.setRotate=function(a){if(c!==a.cxAbs||e!==a.cyAbs||f!==a.angle||d!==a.cxOff||n!==a.cyOff)c=
a.cxAbs,e=a.cyAbs,d=a.cxOff,n=a.cyOff,f=a.angle,this.scheduleFullRedrawPainter()};this.addExternListener=function(b,c,d,e){typeof c==="function"?((b===a.MOUSE_OVER||b===a.MOUSE_OUT)&&a.g_MouseMoveNotificationList.push(this),this.externEventListener.push(new g(b,c,d,e))):a.log_append_ln("addExternListener error: Invalid callback function (painter x:"+this.x+" y:"+this.y+" w:"+this.w+" h:"+this.h+")")};this.getNumExternEventListener=function(){return this.externEventListener.length};this.anyMouseDownExternalEventListener=
function(){for(var b=0,b=0;b=3&&(a.log_append_ln("hmi_mpainter activateEditMode editSource fSizeOrg: "+c),a.log_append_ln("hmi_mpainter activateEditMode editSource value: "+d));var f=e=0,f=a.getLeftPos(a.g_MouseDownEventInfo.ViewItem.ClickableDiv.handle);e=a.getTopPos(a.g_MouseDownEventInfo.ViewItem.ClickableDiv.handle);var b=a.getScreenCrds(this.x,this.y,this.w,
this.h),n=null;lUpperLeft=a.ME_teq2screenCoord(b.x+f,b.y+e);n=a.ME_teq2screenCoord(b.x+f+b.w,b.y+e+b.h);e=lUpperLeft.y+"px";var f=lUpperLeft.x+"px",j=n.x-lUpperLeft.x+"px",n=n.y-lUpperLeft.y+"px";this.ptId===a.PT_NAME_FILEVIEWER_ID?($(a.g_HTMLControlTextareaElmnt).css("position","absolute"),$(a.g_HTMLControlTextareaElmnt).css("top",e),$(a.g_HTMLControlTextareaElmnt).css("left",f),$(a.g_HTMLControlTextareaElmnt).css("width",j),$(a.g_HTMLControlTextareaElmnt).css("height",n),b=b.scaleFactor*c,$(a.g_HTMLControlTextareaElmnt).css("font-size",
b+"px"),$(a.g_HTMLControlTextareaElmnt).css("font-family",this.getFontName()),$(a.g_HTMLControlTextareaElmnt).css("font-style",this.getSvgFontStyle()),$(a.g_HTMLControlTextareaElmnt).css("font-weight",this.getSvgFontWeight()),$(a.g_HTMLControlTextareaElmnt).val(d),$(a.g_HTMLControlTextareaElmnt).css("display","block"),$(a.g_HTMLControlTextareaElmnt).focus()):((e=this.svgDoc.getElementById(this.objStr))&&e.setAttribute("visibility","hidden"),n=this.editSource.type===a.INFO_T_PASSWORDPPO||this.editSource.type===
a.INFO_T_PASSWORDCONTAINER?a.g_HTMLControlPwInputElement:a.g_HTMLControlInputElmnt,e=e.getBoundingClientRect(),$(n).css("position","absolute"),$(n).css("top",e.top.toString()+"px"),$(n).css("left",e.left.toString()+"px"),$(n).css("width",(e.width-2).toString()+"px"),$(n).css("height",(e.height-4).toString()+"px"),b=b.scaleFactor*c,$(n).css("font-size",b+"px"),$(n).css("font-family",this.getFontName()),$(n).css("font-style",this.getSvgFontStyle()),$(n).css("font-weight",this.getSvgFontWeight()),$(n).val(d),
$(n).css("color","black"),$(n).css("border-color","black"),$(n).css("border-width","1px"),$(n).css("outline","0"),$(n).css("box-shadow","inset 0 0px 0px rgb(0, 0, 0), 0 0 0px rgb(0, 0, 0)"),$(n).css("display","block"),$(n).focus(),$(n).select(),n.setSelectionRange(0,9999));this.editModeFlag=!0}};a.hideInputField=function(b){b===a.PT_NAME_FILEVIEWER_ID?$(a.g_HTMLControlTextareaElmnt).css("display","none").css("top","0px").css("left","0px").css("width","0px").css("height","0px").val(""):($(a.g_HTMLControlPwInputElement).css("display",
"none").css("top","0px").css("left","0px").css("width","0px").css("height","0px").val(""),$(a.g_HTMLControlInputElmnt).css("display","none").css("top","0px").css("left","0px").css("width","0px").css("height","0px").val(""))};this.leaveEditMode=function(b){var c=this.svgDoc.getElementById(this.objStr);a.getDebugLevel>=3&&a.log_append_ln("hmi_mpainter leaveEditMode");if(this.editModeFlag===!0){if(b)if(b=this.getEditSource(),b!==null){b.value=this.editSource.type===a.INFO_T_PASSWORDPPO||this.editSource.type===
a.INFO_T_PASSWORDCONTAINER?a.g_HTMLControlPwInputElement.value:a.g_HTMLControlInputElmnt.value;var d=null,e={rValue:b.value},d=k.getTcrFormatSource();d.value!==null&&a.TCR_convertToRawValueByFormat(d.value,e);b.value=e.rValue;this.ptId===a.PT_NAME_FILEVIEWER_ID?(d=a.g_HTMLControlTextareaElmnt.value,d=d.replace(/\n/gi,a.FVLINESEPTOKEN2),d=d.replace(/\t/gi,a.FVCOLSEPTOKEN2),a.getDebugLevel()>=2&&a.log_append_ln(d),a.RW_writeSource(b.type,b.name,d)):b.type===a.INFO_T_PPO?a.writePPO(b.name,b.value,!0):
a.RW_writeSource(b.type,b.name,b.value)}else a.log_append_ln("hmi_mpainter Leave edit mode error");a.hideInputField(this.ptId);this.editModeFlag=!1;c&&c.setAttribute("visibility","visible")}};if(b){if(b.cbDis)this.instanceDisabled=b.cbDis;if(b.cbHasDown)this.instanceValidDownAction=b.cbHasDown;if(b.cbHasUp)this.instanceValidUpAction=b.cbHasUp;if(b.cbD)this.instanceDraw=b.cbD;if(b.cbADown)this.executeActionMouseDown=b.cbADown;if(b.cbAUp)this.executeActionMouseUp=b.cbAUp;if(b.cbAGain)this.onGainActionFunc=
b.cbAGain;if(b.cbADraw)this.onDrawActionFunc=b.cbADraw;if(b.cbALost)this.onLostActionFunc=b.cbALost;if(b.dragX)this.dragXInfo=b.dragX,this.dragXInfo.relDownPos=0,this.dragXInfo.lastWriteTSmS=0;if(b.dragY)this.dragYInfo=b.dragY,this.dragYInfo.relDownPos=0,this.dragYInfo.lastWriteTSmS=0;this.objId=b.oId;this.objStr="sc_obj_"+this.objId;this.shpStr=this.objStr+"_shp";this.frmGroup="sc_obj_"+this.objId+"_frm";this.frmOuterGroup=this.frmGroup+"_outer";this.frmInnerGroup=this.frmGroup+"_inner";this.olnGroup=
"sc_obj_"+this.objId+"_oln";this.bgElmnt=this.frm3dElmnt=this.frmElmnt=null;this.ptId=b.ptId;this.ptStr="sc_pty_"+this.ptId;this.xOrg=this.x=b.x;this.yOrg=this.y=b.y;this.wOrg=this.w=b.w;this.hOrg=this.h=b.h;o=b.iC;u=b.hI?!0:!1;p=b.oC;m=b.hO?!0:!1;v=b.oW;x=b.oS;y=b.fN;w=b.fSz;z=b.fSt;D=y;I=w;A=z;if(b.sDc)this.shpElmnt=(this.svgDoc=b.sDc)?this.svgDoc.getElementById(this.shpStr):null,this.painterGroupElement=this.svgDoc?this.svgDoc.getElementById(this.objStr):null}this.scheduleFullRedrawPainter()};
return a}(_SCIntern||{});_SCIntern=function(a){a.PainterType_Button=function(h){this.base=a.PainterType_MPainter;this.base(h);this.isPressed=!1;this.updateImage=a.updateImage;this.hideImages=a.hideImages;this.clearText=a.clearText;this.drawSourceText=a.drawSourceText;this.paintSrcNOCACHEElmt=0;this.updateButtonSourceElement=function(g,b){var f=0;this.getU3d()===!0&&(f+=1);g.type!==a.INFO_T_FILE&&(f=this.getOutlineWidth());g.x=this.x+f;g.y=this.y+f;g.w=this.w-2*f;g.h=this.h-2*f;a.setSvgAttrC(g.e,"x",g.x);a.setSvgAttrC(g.e,
"y",g.y);a.setSvgAttrC(g.e,"width",g.w);a.setSvgAttrC(g.e,"height",g.h);g.type===a.INFO_T_FILE?(this.clearText(g),this.updateImage(g,b)):(this.hideImages(g),this.clearText(g),this.drawSourceText(g))};this.drawBackGroundShape=function(){var g=0,b=g="",f=this.getOutlineWidth(),c=this.getRepaintElement(this.frmOuterGroup),d=this.getRepaintElement(this.frmInnerGroup);if(this.checkIfInterior()===!0){for(g=1;c!=null&&c.hasChildNodes();)c.removeChild(c.firstChild);for(;d!=null&&d.hasChildNodes();)d.removeChild(d.firstChild);
g="rgba("+this.getInteriorColor()+","+g+")";b="rgba("+this.getOutlineColor()+",0)";this.bgElmnt=a.createSVGInOutRect(this.svgDoc,d,c,this.x,this.y,this.w,this.h,g,b,f,this.getInnerFill())}};this.drawOutLineShape=function(){for(var g=0,b="",g="",f=this.getOutlineWidth(),c=0,d=this.getRepaintElement(this.olnGroup),g=this.checkIfOutline()===!0?1:0;d!=null&&d.hasChildNodes();)d.removeChild(d.firstChild);b="rgba("+this.getInteriorColor()+",0)";g="rgba("+this.getOutlineColor()+","+g+")";c=this.getOutlineStyle();
switch(c){case a.SOLID:this.frmElmnt=a.createSVGOlnRect(this.svgDoc,d,this.x,this.y,this.w,this.h,b,g,f,this.getInnerFill());break;case a.DASHED:case a.DOTTED:this.frmElmnt=a.createSVGOlnRectDashed(this.svgDoc,d,this.x,this.y,this.w,this.h,b,g,f,this.getInnerFill(),c);break;default:a.log_append_ln("Unknown outline style")}};this.typeDraw=function(){var g=null,b=null,f=null,c=null,d=0,g=b=0;if(this.isFullPainterRedrawRequired()===!0||this.paintSrcNOCACHEElmt>0){this.paintSrcNOCACHEElmt=0;this.drawBackGroundShape();
if(this.frm3dElmnt!==null)a.removeSVG(this.frm3dElmnt),this.frm3dElmnt=null;if(this.getU3d()===!0)g=this.getOutlineWidth(),this.frm3dElmnt=this.isPressed===!1&&this.getPressedFlag()===!1?a.createSVGRect_3dFrame(this.svgDoc,this.getRepaintElement(this.frmGroup),this.x,this.y,this.w,this.h,g):a.createSVGRect(this.svgDoc,this.getRepaintElement(this.frmGroup),this.x+g,this.y+g,this.w-2*g,this.h-2*g,"rgba(0,0,0,0.0)","rgba(0,0,0,1.0)",1);g=this.getPaintSource();b=this.getPressedSource();f=this.getDisabledSource();
c=this.getBlendSources();d=c.length;if(this.isDisabled===!0&&f.name!==null)g.type=f.type,g.name=f.name,g.value=f.value,g.valuePrev=f.valuePrev;else if((this.isPressed===!0||this.getPressedFlag()===!0)&&b.name!==null)g.type=b.type,g.name=b.name,g.value=b.value,g.valuePrev=b.valuePrev;g.name!==null?(this.updateButtonSourceElement(g,b),g.name.indexOf("NOCACHE")===0&&g.type===a.INFO_T_FILE&&this.paintSrcNOCACHEElmt++):(this.hideImages(g),this.clearText(g));for(b=0;b',c='
Please load all files with *.teq (Views) extension on the server/PLC! Then refresh this page.
Bitte laden Sie alle Dateien mit *.teq (Views) Erweiterung auf den Server/SPS! Dann diese Seite neu laden.";
if(document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")===!1)return a.showCriticalErrorScreen(2,"Your browser does not support SVG! Ihr Browser unterstuetzt kein SVG! \t\t\t \t\t\t Browser Compatibility Browser Kompatibilitaet\t\t\t \t\t\t - Microsoft Internet Explorer 11 and above \t\t\t - Chrome \t\t\t - Firefox \t\t\t - Safari "),!1;return a.isFirstLoadViewCall===!0&&a.loadTEQFileBlocking(c)===
!1?(window.console&&window.console.log&&window.console.log(b),a.showCriticalErrorScreen(1,b),!1):!0};a.isDefinedInJS=function(a){var b=!1;a!==void 0&&(b=!0);return b};a.checkWebserverSVGZSupport=function(){return"success"};a.CheckSpiderLoadView=function(b){var c="success",d=!1;if(b.length!==0){if(a.isFirstLoadViewCall===!0&&a.checkIfBrowserIsSupportedAndTEQOnServer(b)===!0)(c=a.checkWebserverSVGZSupport(b))==="success"?(a.isFirstLoadViewCall=!1,d=!0):c==="no_html5"?a.showCriticalErrorScreen(200,"Webserver does not support HTML5! Couldn't load view: "+
b+"_teq."+Q):c==="no_file"?a.showCriticalErrorScreen(201,"View doen't exist! View: "+b+"_teq."+Q):a.showCriticalErrorScreen(202,"CheckSpiderLoadView error 202 for view! View: "+b+"_teq."+Q);a.isFirstLoadViewCall===!1&&a.checkIfBrowserIsSupportedAndTEQOnServer(b)===!0&&(d=!0)}return d};a.LoadView=function(b,c,d,e){if(c.length!==0)if(a.CheckSpiderLoadView(c,d,e)===!0)if($("#destId")===null&&a.log_append_ln("sc.LoadView Error Destination Div Id Not Found!"),b===null)a.log_append_ln("sc.LoadView() destId is undefined");
else{var n=c;a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC&&(n="archivereader?"+c);f(b,n,d,e)}else a.log_append_ln("ERROR sc.LoadView check failed for "+c)};a.UnloadView=function(b){a.getDebugLevel()>=3&&a.log_append_ln("SpiderControl.UnloadView()");b===null?a.log_append_ln("SpiderControl.UnloadView() destId is undefined"):s(b)};a.EnableWebConsole=function(){u()};a.ReadPPO=function(b){a.getDebugLevel()>=4&&a.log_append_ln("SpiderControl.ReadPPO()");return c(b)};a.WritePPO=function(b,c){a.getDebugLevel()>=
4&&a.log_append_ln("SpiderControl.WritePPO()");a.writePPO(b,c,!1)};a.getDebugLevel=function(){return R};a.ReadContainer=function(b){a.getDebugLevel()>=4&&a.log_append_ln("SpiderControl.ReadContainer()");return d(b)};a.ScheduleViewJump=function(){a.getDebugLevel()>=3&&a.log_append_ln("SpiderControl.ScheduleViewJump()")};a.checkContainerRange=function(b,c,d,e){for(var f="",n=0,f=a.MIN(d,e),d=a.MAX(d,e),n=f;n<=d;n++)if(f=c+n,b===f)return!0;return!1};a.checkSessionContainerName=function(b){return a.checkContainerRange(b,
a.SpecialCO.NOINITSESSCO.name,0,a.SpecialCO.NOINITSESSCO.value)};a.checkPersistanContainer=function(b){return a.checkContainerRange(b,a.SpecialCO.MB_PERCO.name,0,a.SpecialCO.NOINITSESSCO.value)};a.writeSessionContainer=function(b,c){var d=!1;a.checkSessionContainerName(b)===!0&&(d=a.writeSessionStorage(b,c));return d};a.readSessionContainer=function(b){var c=!1;a.checkSessionContainerName(b)===!0&&(c=a.readSessionStorage(b));return c};a.writePersistentContainer=function(b,c){var d=!1;a.checkPersistanContainer(b)===
!0&&(d=a.writeLocalStorage(b,c));return d};a.readPersistentContainer=function(b){var c=!1;a.checkPersistanContainer(b)===!0&&(c=a.readLocalStorage(b));return c};a.writeSessionStorage=function(b,c){var d=!1;a.checkStorage()!==!1&&(sessionStorage.setItem(b,c),d=!0);return d};a.readSessionStorage=function(b){var c=!1;a.checkStorage()!==!1&&(c=sessionStorage.getItem(b),c===null&&(c=""));return c};a.writeLocalStorage=function(b,c){var d=!1;a.checkStorage()!==!1&&(localStorage.setItem(b,c),d=!0);return d};
a.readLocalStorage=function(b){var c=!1;a.checkStorage()!==!1&&(c=localStorage.getItem(b),c===null&&(c=""));return c};a.checkStorage=function(){var a=!1;Storage!==void 0&&(a=!0);return a};a.directReadContainer=function(b){return U[b]?U[b].mValue:a.CONTAINER_INITIAL_VALUE};a.directWriteContainer=function(b,c){if(c===void 0)a.getDebugLevel()>=2&&a.log_append_ln("directWriteContainer called with 'undefined' value (co name: '"+b+"'"),c=a.CONTAINER_INITIAL_VALUE;b===void 0&&a.getDebugLevel()>=2&&a.log_append_ln("directWriteContainer called with 'undefined' name");
U[b]={mName:b,mValue:c};a.updateUserLevelTimestamp()};a.SetRefresh=function(b){a.getDebugLevel()>=3&&a.log_append_ln("SpiderControl.SetRefreshRate()");x(b)};a.WriteContainer=function(b,c){a.getDebugLevel()>=3&&a.log_append_ln("sc.WriteContainer name = "+b+" , value = "+c);a.RW_writeSource(a.INFO_T_CONTAINER,b,c)};a.readDateTimeFormat=function(){return y("PM_AM")};a.localRefreshPPO=function(){a.LocalPPORefresh.cbUpdate!==null?(a.LocalPPORefresh.PPOList={},a.LocalPPORefresh.PPOSize=a.prepareLPRList(a.LocalPPORefresh.PPOList),
a.LocalPPORefresh.PPOSize&&(a.LocalPPORefresh.cbUpdate(a.LocalPPORefresh)?a.updateInternalPPOList(a.LocalPPORefresh.PPOList):a.getDebugLevel()>=2&&a.log_append_ln("sc.LocalPPORefresh.cbUpdate returned not true"))):a.getDebugLevel()>=2&&a.log_append_ln("LocalPPORefresh.cbUpdate not set")};a.VM_doRepaint=function(){var b=!1,c=K,d=0,d=a.getTimestamp_ms(),e=!1,f=0,n=null,j=!1;if(a.g_WriteValWorkerPendingWriteValsListSize>=a.WRITEVALWORKERMAXPENDINGWRITEVAL)a.getDebugLevel()>=2&&a.log_append_ln("sc.VM_doRepaint too many pending writeVals [ "+
a.g_WriteValWorkerPendingWriteValsListSize+" ] in worker Thread so skips repaint for 5ms"),window.setTimeout(_SCIntern.VM_doRepaint,5);else if(I()===!0&&a.g_WriteValWorkerPendingWriteValsListSize>0)a.getDebugLevel()>=2&&a.log_append_ln("sc.VM_doRepaint should make a view jump but pending writeVals [ "+a.g_WriteValWorkerPendingWriteValsListSize+" ] in worker Thread so skips repaint for 5ms"),window.setTimeout(_SCIntern.VM_doRepaint,5);else{for(f=0;f=da||aa===!0){aa=!1;da=d;a.SpecialCO.blink.value=a.SpecialCO.blink.value=="1"?"0":"1";v(a.SpecialCO.blink.name,a.SpecialCO.blink.value,!1);if(a.SpecialCO.autoincr.value>=a.SpecialCO.autoincr.value.MAX_VALUE)a.SpecialCO.autoincr.value=
0;a.SpecialCO.autoincr.value++;a.getDebugLevel()>=2&&$("#SC_RefreshCnt").html(a.SpecialCO.autoincr.value);L===!0?a.localRefreshPPO():a.SL_refreshPPO()}a.checkUserLevelTimestamp()===!1?a.WriteContainer(a.SpecialCO.userLevel.name,0):a.updateUserLevelTimestamp();if(ba){ba=!1;c=0;f=a.g_OnlineTrendEmitter.length;for(c=0;c=2)Dbg_RepaintStart_ms=a.getTimestamp_ms(),a.CntReadPPOSource=0;a.ViewList.doViewRepaints();
a.getDebugLevel()>=3&&(Dbg_RepaintStop_ms=a.getTimestamp_ms(),Dbg_RepaintDuration_ms=Dbg_RepaintStop_ms-Dbg_RepaintStart_ms,a.log_append_ln("RpnDur_ms: "+Dbg_RepaintDuration_ms+" (nPPO:"+a.CntReadPPOSource+")"))}a.isMsgBoxScheduled()===!0&&(a.resetMsgBoxScheduled(),a.openMsgBox());if(I()===!0){a.getDebugLevel()>=2&&a.log_append_ln("vm_isViewJumpRequested() === true");e=a.g_MouseDownEventInfo.ViewItem.ViewJumpScheduledName;if(e!==""&&(j="",j=e.lastIndexOf(".teq"),j=j!=-1?e.substr(0,j):e,j!==""))if(a.TARGET_TYPE_NR===
a.TARGET_TYPE_PANASONIC&&j.lastIndexOf("archivereader?")<0&&(j="archivereader?"+j),j+="_teq."+Q,c=encodeURIComponent(a.g_MouseDownEventInfo.ViewItem.DestinationDiv.id),a.loadSvgzFileBlocking(j)===!0){if(a.g_MouseDownEventInfo.ViewItem.Embed.handle.src!=j+"#"+c)p(a.g_MouseDownEventInfo.ViewItem),a.g_MouseDownEventInfo.ViewItem.Embed.handle.src=j+"#"+c,a.getDebugLevel()>=2&&a.log_append_ln("iframe: '"+a.g_MouseDownEventInfo.ViewItem.Embed.handle.src+"'");a.getDebugLevel()>=2&&$("#SC_CurrentPage").html(e);
b=!0}else a.err_append_ln("Page: "+j+" doesn't exist!");a.SpecialCO.lastPage.value=a.SpecialCO.currentPage.value;a.SpecialCO.currentPage.value=e;v(a.SpecialCO.lastPage.name,a.SpecialCO.lastPage.value,!1);v(a.SpecialCO.currentPage.name,a.SpecialCO.currentPage.value,!1);a.getDebugLevel()>=2&&a.log_append_ln("vm_viewJumpRequestDone()");a.g_MouseDownEventInfo.ViewItem.ViewJumpScheduledFlag=!1;a.scheduleRefresh()}ca++;a.getDebugLevel()>=2&&$("#SC_RepaintCnt").html(ca)}a.previousDrawDateTimeFormat=a.readDateTimeFormat();
a.previousMBTmzEn=a.SpecialCO.mbTmzEn.value;d=a.getTimestamp_ms()-d;b?(a.getDebugLevel()>=2&&a.log_append_ln("viewJmpFlag so restarts repaint immediately"),window.setTimeout(_SCIntern.VM_doRepaint,0)):d>O?window.setTimeout(_SCIntern.VM_doRepaint,5):(O-d>=1E4&&a.log_append_ln("VM_doRepaint makes sleeps for more then 10s! (HMI_Repaint - rpntDuration) = "+(O-d)+" rpntDuration = "+d),window.setTimeout(_SCIntern.VM_doRepaint,O-d))}};a.getRefreshPeriod=function(){return K};a.getViewDOMHandles=function(a){a.ClickableDiv.handle=
$(a.ClickableDiv.id)[0];a.ClickableDiv.jQHan=$(a.ClickableDiv.id);a.Embed.handle=$(a.Embed.id)[0];a.Embed.jQHan=$(a.Embed.id)};a.CMP=function(b,c,d){var e=0,f=0,e=0;if(c!==null&&d!==null&&b!==null)switch(b){case a.COND.UNDEFINED:return 1;case a.COND.EQUAL:return a.isEqual(c,d);case a.COND.NO_CONDITION:return 1;case a.COND.NOT_EQUAL:return a.isNotEqual(c,d);case a.COND.GREATER:return a.isGreater(c,d);case a.COND.GREATER_EQUAL:return a.isGreaterOrEqual(c,d);case a.COND.LESSER:return a.isLesser(c,d);
case a.COND.LESSER_EQUAL:return a.isLesserOrEqual(c,d);case a.COND.AND_EQUAL:return e=a.parseNumber(c),f=a.parseNumber(d),e=(e&f)===f===!0?1:0,a.getDebugLevel()>=3&&a.log_append_ln("sc.COND.AND_EQUAL: res:"+e),e;case a.COND.AND_EQUAL0:return e=a.parseNumber(c),f=a.parseNumber(d),(e&f)===0;case a.COND.AND_NOTEQUAL0:return e=a.parseNumber(c),f=a.parseNumber(d),(e&f)!==0;case a.COND.IS_INT:return a.isInt(c);case a.COND.IS_FLOAT:return a.isFloat(c);case a.COND.EQUAL_IGNORECASE:return a.isEqualIgnoreCase(c,
d);case a.COND.NOT_EQUAL_IGNORECASE:return a.isNotEqualIgnoreCase(c,d);case a.COND.OR_EQUAL0:return a.isOrEqual0(c,d);case a.COND.OR_NOT_EQUAL0:return a.isOrNotEqual0(c,d);default:return!1}else return 0};a.isDecimalStr=function(a,b){var c=0,d="";if(a!==null&&a!==void 0&&(d=String(a).trim(),d.length>0)){c=d.match(/e/gi);if(c!==null&&c.length>1)return 0;c=c!==null&&c.length==1?d.match(/[+-]/g):d.match(/[+-]/g);if(c!==null&&c.length>2)return 0;c=d.match(/[.,]/g);if(c!==null&&c.length>1)return 0;c=d.match(/^[-+][0-9]+\.[0-9]+[eE][-+]?[0-9]+$/g);
if(c!==null&&c.length>0)return 0;c=1;b===1&&(c=0,d=Number(d),isNaN(d)||d%1==0&&(c=1))}return c};a.isEqual=function(b,c){var d=0,e=parseFloat(b),f=parseFloat(c);if(a.isDecimalStr(b,0)==0||a.isDecimalStr(c,0)==0||isNaN(f)||isNaN(e))return String(b)==String(c)&&(d=1),d;e==f&&(d=1);return d};a.isNotEqual=function(b,c){var d=0,e=parseFloat(b),f=parseFloat(c);if(a.isDecimalStr(b,0)==0||a.isDecimalStr(c,0)==0||isNaN(f)||isNaN(e))return String(b)!=String(c)&&(d=1),d;e!=f&&(d=1);return d};a.isGreater=function(a,
b){var c=0,d=parseFloat(a),e=parseFloat(b);isNaN(d)&&(d=0);isNaN(e)&&(e=0);d>e&&(c=1);return c};a.isGreaterOrEqual=function(a,b){var c=0,d=parseFloat(a),e=parseFloat(b);isNaN(d)&&(d=0);isNaN(e)&&(e=0);d>=e&&(c=1);return c};a.isLesser=function(a,b){var c=0,d=parseFloat(a),e=parseFloat(b);isNaN(d)&&(d=0);isNaN(e)&&(e=0);d=lUpperLeft.x&&c.y>=lUpperLeft.y&&c.x<=lLowerRight.x&&c.y<=lLowerRight.y&&(d=!0)}else a.log_append_ln("OB_checkMouseCoordinates error");return d};a.writePPO=function(b,c,d){b=a.g_PPOList[b];b.resolved=a.rl_resolveInfoName(b.address);var e=
{writeEnabled:!1,rValue:c};a.TCR_writeFormatedPPOValue(b,e);if(e.writeEnabled===!0){if(d===!0)b.value=c;L===!0?a.LocalPPORefresh.cbWrite!==null?a.LocalPPORefresh.cbWrite(b.resolved,e.rValue):a.log_append_ln("LocalPPORefresh.cbWrite not set"):a.sl_writeValue(b.resolved,e.rValue)}};a.getContainerList=function(){return U};a.RW_readSource=function(b,c,d){var e=c;b==a.INFO_T_PPO||b==a.INFO_T_PASSWORDPPO?(a.CntReadPPOSource++,e=A(c,d)):b==a.INFO_T_CONTAINER||b==a.INFO_T_PASSWORDCONTAINER?e=F(c):b==a.INFO_T_HTMLTAG?
e=y(c):b==a.INFO_T_FILE&&(e="File Not Found",b=a.loadFileSource(c),b!==null&&(e=b));return e};a.RW_readSource_parseFloat=function(b,c,d){var e=c,f=0;b==a.INFO_T_PPO||b==a.INFO_T_PASSWORDPPO?e=A(c):b==a.INFO_T_CONTAINER||b==a.INFO_T_PASSWORDCONTAINER?e=F(c):b==a.INFO_T_HTMLTAG?e=y(c):b==a.INFO_T_STRING&&(e=c);d===1?isNaN(parseFloat(e,10))!==!0?f=parseFloat(e,10):a.getDebugLevel()>=1&&a.log_append_ln("WARNING sc.RW_readSource_parseFloat("+b+", "+c+") ! value ["+e+"] is NaN so returns 0 "):f=parseFloat(e,
10);return f};a.RW_readSource_parseInt=function(b,c){var d=c,e=0;b==a.INFO_T_PPO||b==a.INFO_T_PASSWORDPPO?d=A(c):b==a.INFO_T_CONTAINER||b==a.INFO_T_PASSWORDCONTAINER?d=F(c):b==a.INFO_T_HTMLTAG?d=y(c):b==a.INFO_T_STRING&&(d=c);isNaN(parseInt(d,10))!==!0?e=parseInt(d,10):a.getDebugLevel()>=1&&a.log_append_ln("WARNING sc.RW_readSource_parseInt("+b+", "+c+") ! value ["+d+"] is NaN so returns 0 ");return e};a.RW_writeSource=function(b,c,d){a.getDebugLevel()>=2&&a.log_append_ln("sc.RW_writeSource("+b+" , "+
c+" , "+d+")");if(b==a.INFO_T_CONTAINER||b==a.INFO_T_PASSWORDCONTAINER)v(c,d,!1);else if(b==a.INFO_T_PPO||b==a.INFO_T_PASSWORDPPO)a.writePPO(c,d,!1);else if(b==a.INFO_T_TEQINDEX){if(b=c,b!==null)if(c=b=a.rl_resolveInfoName(b),d=b.lastIndexOf(".teq"),d!=-1&&(c=b.substr(0,d)),a.CheckSpiderLoadView(c,0,0)===!0)if(a.stringcmp(c,a.MsgBox)===!0)a.MsgBox.length>0&&a.openMsgBox();else{if(a.stringcmp(a.g_MouseDownEventInfo.ViewItem.ViewName,c)!==!0)a.g_MouseDownEventInfo.ViewItem.ViewJumpScheduledFlag=!0,
a.g_MouseDownEventInfo.ViewItem.ViewJumpScheduledName=b}else a.log_append_ln("ERROR vm_scheduleSVGPicture check failed for "+b)}else b==a.INFO_T_URL?window.open(d,c):b===a.INFO_T_CGI&&a.userCGIAction(d)};a.sl_isPPOScheduled=function(b){var c=!1;a.g_PPOList[b]&&(c=a.g_PPOList[b].regView>0||a.g_PPOList[b].regHMI===!0);return c};a.sl_getPPOWriteAddress=function(b){var c="",d="";for(d in a.g_PPOList)if(a.g_PPOList[d].address==b)c=a.g_PPOList[d].writeAddr;return c};a.prepareLPRList=function(b){var c=0,
d=0;if(a.g_PPOList){B=M;M="";for(d in a.g_PPOList)if(a.sl_isPPOScheduled(d))a.g_PPOList[d].resolved=a.rl_resolveInfoName(a.g_PPOList[d].address),b[a.g_PPOList[d].resolved]=new a.LPRItemType(a.g_PPOList[d].resolved,a.g_PPOList[d].value),M+=a.g_PPOList[d].resolved,c++;a.LocalPPORefresh.ListChanged=!1;if(M!==B)a.LocalPPORefresh.ListChanged=!0}return c};a.getPPOValueBylprList=function(a,b){for(var c=0,c=0;c=2)a.Dbg_RpnSchedule_ms=a.getTimestamp_ms()};a.scheduleRefresh=function(){aa=!0};a.scheduleOnlineTrendRefresh=function(){ba=!0};a.getTimestamp_s=function(){var a=(new Date).getTime();
a/=1E3;return a=Math.round(a)};a.getTimestamp_ms=function(){return(new Date).getTime()};a.sl_updatePPOListByName=function(b,c){var d="",e=!1;if(a.g_PPOList)for(d in a.g_PPOList)if(a.g_PPOList[d].name==b&&a.g_PPOList[d].value!==c)a.g_PPOList[d].value=c,e=!0;return e};a.sl_updatePPOList=function(b,c){var d="",e=!1;if(a.g_PPOList){for(d in a.g_PPOList)if(a.g_PPOList[d].resolved==b&&a.g_PPOList[d].value!==c)a.g_PPOList[d].value=c,e=!0;return e}};a.dg_append_ln=function(b){a.getDebugLevel()>0&&(a.SilentDebugStr!=
null&&b!=null&&a.SilentDebugStr.length+b.length<=a.SILENTDEBUGSTR_MAX?a.SilentDebugStr+=b+"\n":a.SilentDebugStr!=null&&b!=null&&a.SilentDebugStr.length+b.length>=a.SILENTDEBUGSTR_MAX&&(a.SilentDebugStr+="MAX MSG LENGTH REACHED SO STOPS SILENT MSG! \n"))};a.log_append_ln=function(b){if(a.getDebugLevel()>0){if(P){var c=b+" ";a.getDebugLevel()>0&&P&&$("#SC_WebConsoleContents").prepend(c)}window.console&&window.console.log(b)}};a.GetBrowserInfos=function(){var a=navigator.userAgent,b=navigator.appName,
c=parseFloat(navigator.appVersion).toString(),d=parseInt(navigator.appVersion,10),e;if((e=a.indexOf("Opera"))!=-1){if(b="Opera",c=a.substring(e+6),(e=a.indexOf("Version"))!=-1)c=a.substring(e+8)}else if((e=a.indexOf("MSIE"))!=-1)b="Microsoft Internet Explorer",c=a.substring(e+5);else if(a.indexOf("Trident")!=-1&&(e=a.indexOf("rv:"))!=-1)b="Microsoft Internet Explorer",c=a.substring(e+3);else if(a.indexOf("Edge")!=-1&&(e=a.indexOf("Edge"))!=-1)b="Edge",c=a.substring(e+5);else if((e=a.indexOf("Chrome"))!=
-1)b="Chrome",c=a.substring(e+7);else if((e=a.indexOf("Safari"))!=-1){if(b="Safari",c=a.substring(e+7),(e=a.indexOf("Version"))!=-1)c=a.substring(e+8)}else if((e=a.indexOf("Firefox"))!=-1)b="Firefox",c=a.substring(e+8);else if((d=a.lastIndexOf(" ")+1)<(e=a.lastIndexOf("/")))if(b=a.substring(d,e),c=a.substring(e+1),b.toLowerCase()==b.toUpperCase())b=navigator.appName;if((a=c.indexOf(";"))!=-1)c=c.substring(0,a);if((a=c.indexOf(" "))!=-1)c=c.substring(0,a);c.indexOf(")")!=-1&&c.indexOf("(")==-1&&(c=
c.replace(")",""));d=parseInt(c,10);isNaN(d)&&(c=parseFloat(navigator.appVersion).toString(),d=parseInt(navigator.appVersion,10));return{name:b,version:d,fullVersion:c}};a.destroyMouseMoveNotifyList=function(){a.g_MouseMoveNotificationList=[]};a.getOnlineTrendEmitterInstance=function(b){for(var c=0,d=a.g_OnlineTrendEmitter.length,c=0;c=2&&a.log_append_ln("registerOnlineTrendEmitter "+b.trendIndex)};a.registerOfflineTrendEmitter=function(a){V.push(a)};a.registerSavedTrendEmitter=function(a){W.push(a)};a.updateUserLevelTimestamp=function(){var b=a.getTimestamp_s();
a.writeLocalStorage(a.SpecialCO.userLevel.name,b)};a.checkUserLevelTimestamp=function(){var b=!1,c=0,d=0,c=0,e=a.SpecialCO.userLevel.value;if(a.checkStorage()===!1)return!0;c=a.readLocalStorage(a.SpecialCO.userLevel.name);if(c===!1)return b;c=parseInt(c,10);d=a.getTimestamp_s();d-c>16};a.getGValue=function(a){return isNaN(a)===!0?0:(a&65280)>>8};a.getBValue=
function(a){return isNaN(a)===!0?0:a&255};a.Sleep=function(a){var f=(new Date).getTime(),c=0;do c=(new Date).getTime();while(c-ff[c];c++}while(c0?c.rValue.substring(0,a)+f+c.rValue.substring(a,c.rValue.length):f+c.rValue};
a.calculateMyTextWidth=function(b,f,c,d,e,n){var g=-1;try{var j=a.createSVGTextExt(document,d,0,0,"0,0,0","start",c,f,b,e,n);if(j!==null)j.textContent=b,g=j.getComputedTextLength();d.removeChild(j)}catch(k){a.log_append_ln("sc.calculateMyTextWidth exception= "+k)}finally{a.getDebugLevel()>=2&&a.log_append_ln("sc.calculateMyTextWidth( "+b+" , "+f+" , "+c+" ) = "+g)}return g};a.parseContentsAsMultiArray=function(b,f){for(var c=0,d=0,e=0,b=b.replace(/\n/gi,a.FVLINESEPTOKEN2),b=b.replace(/\t/gi,a.FVCOLSEPTOKEN2),
n=b.split(/\\n/),d=null,g=[],c=f.maxCol=0;c0&&g[g.length-1]&&g[g.length-1][0]===""&&g.pop();if(g.length>0&&f!==null&&f.autowrap===!0&&f.hasColLayout===!1&&f.maxCol===1&&f.width>0&&f.innerSVGElmnt!==null&&f.svgFontStyle!==
null&&f.svgFontWeight!==null)for(var j=-1,c=0;cf.width&&(d=n.split(" "),d.length>0))){for(var e=0,k=d[0],n="",o=k,j=a.calculateMyTextWidth(o,f.fontSize,f.fontFamily,f.innerSVGElmnt,f.svgFontStyle,f.svgFontWeight);j0&&(n+=" "),n+=j;g[c][0]=k;g[g.length]=g[g.length-1][0].split(/\\t/);for(d=g.length-2;d>c;d--)g[d+1][0]=g[d][0];g[c+1][0]=n}return g};a.parseTwoColCSVContent=function(b){for(var f=0,c={},d=0,b=b.split("\n"),e,d=b.length,f=0;f=3&&(e=b[f].split(";"),e.length==2?c[e[0]]=e[1]:a.getDebugLevel()>=2&&a.log_append_ln("ERROR parseCSVContent item parse error"));return c};a.parseCSV=function(b){return a.parseCGI_CSV_Content(b)};
a.parseCGI_CSV_Content=function(a){var f=0,c=[],d=0;a.length>0&&a.lastIndexOf("\n",a.length-1)!=a.length-1&&(a+="\n");a=a.split("\n").filter(h);d=a.length;for(f=0;f0){a[f].lastIndexOf(";",a[f].length-1)!=a[f].length-1&&(a[f]+=";");var e=a[f].replace(/;;/g,"; ;");c.push(e.split(";").filter(h))}return c};a.parse_CSV_Content=function(a){for(var f=0,c=[],d=0,a=a.split("\n").filter(h),d=a.length,f=0;f=3&&c.push(a[f].split(";").filter(h));return c};a.noop=function(){};
a.setSVGCordAttr=function(b,f,c){c=Math.round(c);c>1&&(c-=0.5);c<0.5&&(c=0.5);a.setSVGAttr(b,f,c)};a.createSVGElement=function(b,f){var c=b.createElementNS(a.SvgNs,f);c===null&&a.log_append_ln("ERROR sc.createSVGElement failed for name "+f);return c};a.setSVGAttr=function(a,f,c){a.setAttributeNS(null,f,c)};a.removeSVG=function(b){b===null||b.parentNode===null?a.noop():b.parentNode.removeChild(b)};a.createInnerSVG=function(b,f,c,d,e,n){b=a.createSVGElement(b,"svg");b!==null&&(a.setSVGAttr(b,"x",c),
a.setSVGAttr(b,"y",d),a.setSVGAttr(b,"width",e),a.setSVGAttr(b,"height",n),a.setSVGAttr(b,"viewBox","0 0 "+e+" "+n),a.setSVGAttr(b,"version","1.1"),f.appendChild(b));return b};a.createTriangle=function(b,f,c,d,e,n,g,j,k){b=b.createElementNS(a.SvgNs,"polygon");b.setAttributeNS(null,"points",c+","+d+" "+e+","+n+" "+g+","+j);b.setAttributeNS(null,"fill",k);return f.appendChild(b)};a.createHorizontalLine=function(a,f,c,d,e,n){var r=null;c==e?r=g(a,f,c,d-f,1,n):f==d&&(r=g(a,f,c,1,e-c,n));return r};a.createSVGSimpleRect=
function(a,f,c,d,e,n){return g(a,f,c,d,e,n)};a.createSVGTSpan=function(b,f,c,d,e){b=b.createElementNS(a.SvgNs,"tspan");c!==null&&b.setAttributeNS(null,"dx",c);d!==null&&b.setAttributeNS(null,"dy",d);if(e!==null)b.textContent=e;f.appendChild(b);return b};a.createClipRect=function(b,f,c,d,e,n,g){var j=b.createElementNS(a.SvgNs,"clipPath");j.setAttributeNS(null,"id",g);f.appendChild(j);e<0&&(e=0);b=b.createElementNS(a.SvgNs,"rect");b.setAttributeNS(null,"x",c);b.setAttributeNS(null,"y",d);b.setAttributeNS(null,
"width",e);b.setAttributeNS(null,"height",n);j.appendChild(b);return j};a.createSVGText=function(b,f,c,d,e,n,g,j,k,o){b=b.createElementNS(a.SvgNs,"text");b.setAttributeNS(a.XmlNs,"xml:space","preserve");b.setAttributeNS(null,"text-anchor",n);b.setAttributeNS(null,"x",c);b.setAttributeNS(null,"y",d);b.setAttributeNS(null,"fill",e);b.setAttributeNS(null,"font-size",j);b.setAttributeNS(null,"font-family",g);b.setAttributeNS(null,"font-weight",o);b.setAttributeNS(null,"font-style",k);f.appendChild(b);
return b};a.createSVGTextExt=function(b,f,c,d,e,n,g,j,k,o,h){var p=b.createElementNS(a.SvgNs,"text");p.setAttributeNS(a.XmlNs,"xml:space","preserve");p.setAttributeNS(null,"text-anchor",n);p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",d);p.setAttributeNS(null,"fill","rgb("+e+")");p.setAttributeNS(null,"font-size",j);p.setAttributeNS(null,"font-family",g);p.setAttributeNS(null,"font-weight",h);p.setAttributeNS(null,"font-style",o);f.appendChild(p);b=b.createTextNode(k);p.appendChild(b);return p};
a.createSVGRectDashed=function(b,f,c,d,e,n,r,j,k,o,h){var p=null,p=null,s=0,q=0,m=0,t=0,v=0,x=v=0,k=parseInt(k,10),w=1,y=null;isNaN(k)===!0&&(k=0);if(b===null||f===null)return null;y=a.createSVGElement(b,"g");if(y!==null){r!==null&&(p=o===!0?g(b,c+k,d+k,e-k*2,n-k*2,r):g(b,c,d,e,n,r),y.appendChild(p));if(k>0){h===a.DOTTED?w=1:h===a.DASHED&&(w=4);s=k*w;q=k;v=c+e;t=d;for(m=c+1,x=0,x=0;m+s0){h===a.DOTTED?v=1:h===a.DASHED&&(v=4);o=k*v;p=k;m=c+e;q=d;for(s=c+1,t=0,t=0;s+o0&&(h=g(b,c,d,e,p,j),k.appendChild(h),h=g(b,c,d+n-p,e,p,j),k.appendChild(h),h=g(b,c,d,p,n,j),k.appendChild(h),p=g(b,c+e-p,d,p,n,j),k.appendChild(p)),f.appendChild(k));return k};a.createSVGInOutRect=function(b,f,c,d,e,n,r,j,k,o,h){var p=null,s=p=p=null,p=null,s=parseInt(o,10);isNaN(s)===!0&&(s=
0);if(b===null||f===null)return null;o=a.createSVGElement(b,"g");o!==null&&(j!==null&&(p=h===!0?g(b,d+s,e+s,n-s*2,r-s*2,j):g(b,d,e,n,r,j),o.appendChild(p)),f.appendChild(o));if(b===null||c===null)return null;o=a.createSVGElement(b,"g");o!==null&&(s>0&&(p=g(b,d,e,n,s,k),o.appendChild(p),p=g(b,d,e+r-s,n,s,k),o.appendChild(p),p=g(b,d,e,s,r,k),o.appendChild(p),s=g(b,d+n-s,e,s,r,k),o.appendChild(s)),c.appendChild(o));return o};a.createSVGOlnRect=function(b,f,c,d,e,n,r,j,k){var o=null,r=o=o=null,r=parseInt(k,
10);isNaN(r)===!0&&(r=0);if(b===null||f===null)return null;k=a.createSVGElement(b,"g");k!==null&&(r>0&&(o=g(b,c,d,e,r,j),k.appendChild(o),o=g(b,c,d+n-r,e,r,j),k.appendChild(o),o=g(b,c,d,r,n,j),k.appendChild(o),r=g(b,c+e-r,d,r,n,j),k.appendChild(r)),f.appendChild(k));return k};a.createSVGLine=function(b,f,c,d,e,n,g,j){if(b===null||f===null)return null;b=a.createSVGElement(b,"line");a.setSVGAttr(b,"x1",c);a.setSVGAttr(b,"y1",d);a.setSVGAttr(b,"x2",e);a.setSVGAttr(b,"y2",n);a.setSVGAttr(b,"stroke",g);
a.setSVGAttr(b,"stroke-width",j);f.appendChild(b);return b};a.createSVGEllipseExt=function(b,f,c,d,e,n,g,j,k,o){if(b===null||f===null)return null;b=a.createSVGElement(b,"ellipse");o===!0&&(c+=k,d+=k,e-=k*2,n-=k*2);a.setSvgAttrC(b,"cx",c+e/2);a.setSvgAttrC(b,"cy",d+n/2);a.setSvgAttrC(b,"rx",e/2);a.setSvgAttrC(b,"ry",n/2);a.setSVGAttr(b,"fill",g);k>0&&j!==null&&(a.setSVGAttr(b,"stroke",j),a.setSVGAttr(b,"stroke-width",k));f.appendChild(b);return b};a.createSVGEllipse=function(b,f,c,d,e,n,g,j,k){if(b===
null||f===null)return null;b=a.createSVGElement(b,"ellipse");a.setSVGAttr(b,"cx",c);a.setSVGAttr(b,"cy",d);a.setSVGAttr(b,"rx",e);a.setSVGAttr(b,"ry",n);k===null&&(k="none");a.setSVGAttr(b,"fill",k);j>0&&g!==null&&(a.setSVGAttr(b,"stroke",g),a.setSVGAttr(b,"stroke-width",j));f.appendChild(b);return b};a.createSVGPolygon=function(b,f,c,d,e,n,g){if(b===null||f===null)return null;for(var b=a.createSVGElement(b,"polygon"),j=c.length,k=0,o="",k=0;k0&&e!==null&&(a.setSVGAttr(b,"stroke",e),a.setSVGAttr(b,"stroke-width",n));f.appendChild(b);return b};a.createSVGPolyline=function(b,f,c,d,e,n,g,j){if(b===null||f===null)return null;for(var b=a.createSVGElement(b,"polyline"),k="",o=0,o=0;o0&&g!==null&&(a.setSVGAttr(b,"stroke",g),
a.setSVGAttr(b,"stroke-width",j));f.appendChild(b);return b};a.createSVGPie=function(b,f,c,d,e,n,g,j,k,o,h,p){if(b===null||f===null)return null;var b=a.createSVGElement(b,"path"),s=0,q=1;if(k)for(s=1;j>g;)j-=360;else for(;j0&&o!==null&&(a.setSVGAttr(b,"stroke",o),a.setSVGAttr(b,"stroke-width",h));f.appendChild(b);return b};a.toFixed=function(a,f){var c="",c=Math.pow(10,f||0);return c=c!=0?String(Math.round(a*c)/c):String(Math.round(a))};a.toFixedInt=function(a,f){var c="",c=Math.pow(10,f||0);return c=c!=0?Math.round(a*c)/c:Math.round(a)};a.toFixedNotRound=function(a,f){var c="",c=1,c=a.toString(),d=c.indexOf("."),e=a,c=d!==-1?c.substr(0,1+d+f):c,c=parseFloat(c);isNaN(c)===!1&&(e=c.toString());return e};
a.stringcmp=function(a,f){var c=!1;if(a===void 0||f===void 0)return c;if(a===null||f===null)return c;var d=f.toString();a.toString().toLowerCase()===d.toLowerCase()&&(c=!0);return c};a.prefixcmp=function(a,f){var c=!1;if(a===void 0||f===void 0)return c;if(a===null||f===null)return c;f.substring(0,a.length)===a&&(c=!0);return c};a.prefixicmp=function(a,f){var c=!1;if(a===void 0||f===void 0||a===null||f===null)return c;var d=a.toLowerCase();f.toLowerCase().substring(0,d.length)===d&&(c=!0);return c};
a.atoi=function(a){return parseInt(a,10)};a.BIT_clearBit=function(a,f){a&=~f;return a};a.BIT_setBit=function(a,f){a|=f;return a};a.parseNumber=function(b){var f=0,f=0,f=b.indexOf("0x");return f=f!==-1?a.ahextoi(b):a.atoi(b)};a.ahextoi=function(a){return parseInt(a,16)};a.atof=function(a){return parseFloat(a)};a.strstr=function(a,f){var c=a.indexOf(f,0);return c===-1?null:a.slice(c,a.length)};a.strlen=function(a){var f=0;if(a!==null&&a.length!==null)f=a.length;return f};a.MAX=function(a,f){return Math.max(a,
f)};a.MIN=function(a,f){return Math.min(a,f)};a.StrEndWith=function(a,f){return a.indexOf(f,a.length-f.length)!==-1};a.CircularBuffer=function(b){b=b.toFixed(0);this.pTail=this.pHeader=-1;this.size=b;this.newestTS=this.lastAddedIndex=this.level=0;this.yetAddedTSPints={};this.bufferArr=[];this.clear=function(){var a;this.pTail=this.pHeader=-1;this.newestTS=this.lastAddedIndex=this.level=0;if(this.bufferArr!==null)for(;this.bufferArr.length>0;)this.bufferArr.pop();if(this.yetAddedTSPints!==null)for(a in this.yetAddedTSPints)delete this.yetAddedTSPints[a]};
this.add=function(b){var c=-1,d=-1,e=0;this.size<0&&b!==null&&this.yetAddedTSPints[b.t_s]!=void 0&&(c=this.yetAddedTSPints[b.t_s]);if(c>=0)a.getDebugLevel()>=2&&a.log_append_ln("Trend Buffer yet contains a Point with the to add point's timestamp so no new add made! for TS "+b.t_s+" \n");else{if(this.pTail==-1&&this.pHeader==-1)d=this.pTail=this.pHeader=0,this.bufferArr[d]=b,this.lastAddedIndex=this.yetAddedTSPints[b.t_s]=d,this.newestTS=b.t_s;else{if(this.size<0){if(this.pTail++,d=this.pTail,this.newestTS>
b.t_s)if(b.t_s=this.bufferArr.length&&(e=0),b.t_s0&&c===0;e--)b.t_s=this.bufferArr[e-1].t_s&&(c=1,d=e);else if(b.t_s>this.bufferArr[e].t_s)for(c=0;ethis.bufferArr[e].t_s&&b.t_s<=this.bufferArr[e+1].t_s&&(c=1,d=e+1)}else if(this.pHeader===0&&this.pTail===0)this.pTail++,d=this.pTail;else if(this.pHeaderthis.pTail&&this.pHeaderthis.pTail&&this.pHeader==this.size-1)this.pTail++,this.pHeader=0,d=this.pTail;if(this.size<0&&d!==this.bufferArr.length)for(e=this.bufferArr.length-1;e>=d;e--)this.bufferArr[e+1]=this.bufferArr[e],this.yetAddedTSPints[this.bufferArr[e+1].t_s]=e+1;this.bufferArr[d]=b;this.lastAddedIndex=
this.yetAddedTSPints[b.t_s]=d;if(this.newestTS0&&a>=0?this.pHeader==-1&&this.pTail==-1?b=null:this.pHeader+a<=this.pTail?b=this.bufferArr[this.pHeader+a]:this.pHeader>this.pTail?this.pHeader+a<=this.size-1?b=this.bufferArr[this.pHeader+a]:this.pHeader+a>this.size-1&&(b=this.bufferArr[this.pHeader+a-this.size]):b=null:b=null;return b}};a.str_ascii2byte=function(a,
f){var c="",d=c=0,d=d=0;if(a!==null&&f!==null){if(f.buffer!==null){d=a.length;if(d+1>>1!=d>>1)return-1;for(d=0;d>2,c=(c&3)<<4|d>>4,g=(d&15)<<2|e>>
6,j=e&63,isNaN(d)?g=j=64:isNaN(e)&&(j=64),f=f+this._keyStr.charAt(n)+this._keyStr.charAt(c)+this._keyStr.charAt(g)+this._keyStr.charAt(j);return f},decode:function(b){for(var f="",c,d,e,n,g,j=0,b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");j>4,d=(d&15)<<4|n>>2,e=(n&3)<<6|g,f+=String.fromCharCode(c),n!=64&&(f+=String.fromCharCode(d)),g!=
64&&(f+=String.fromCharCode(e));return f=a.Base64._utf8_decode(f)},_utf8_encode:function(a){for(var f=0,a=a.replace(/\r\n/g,"\n"),c="",f=0;f127&&d<2048?c+=String.fromCharCode(d>>6|192):(c+=String.fromCharCode(d>>12|224),c+=String.fromCharCode(d>>6&63|128)),c+=String.fromCharCode(d&63|128))}return c},_utf8_decode:function(a){for(var f="",c=0,d=0,e=0,n=0;c191&&
d<224?(e=a.charCodeAt(c+1),f+=String.fromCharCode((d&31)<<6|e&63),c+=2):(e=a.charCodeAt(c+1),n=a.charCodeAt(c+2),f+=String.fromCharCode((d&15)<<12|(e&63)<<6|n&63),c+=3);return f}};a.requestFullScreen=function(a){var f=a.requestFullScreen||a.webkitRequestFullScreen||a.mozRequestFullScreen||a.msRequestFullScreen;f&&f.call(a)};return a}(_SCIntern||{});_SCIntern=function(a){a.AlarmSrvConfigType=function(){this.response="";this.asynchUpdateCb=function(h){a.AlarmSrvConfig.response=h}};a.AlarmSrvConfig=new a.AlarmSrvConfigType;a.getAlarmDateTimeByIntMSecUTC=function(h){return a.getAlarmDateTimeByIntMSec_Flag(h,!1)};a.getAlarmDateTimeByIntMSec=function(h){return a.getAlarmDateTimeByIntMSec_Flag(h,!a.SpecialCO.mbTmzEn.value)};a.getAlarmDateTimeByIntMSec_Flag=function(h,g){var b=parseInt(h,10),f=0;isNaN(b)===!1&&(b<=0?f="---":(b=new Date(b),f=a.DateTime_ReadDT(a.readDateTimeFormat(),
a.SpecialCO.dateTimeLocalNow.name,g,b,null,!0)));return f};a.HisLineType=function(h,g,b){var f=!1,c=parseInt(b.Version.value,10);isNaN(c)===!0&&(c=1);var d=parseInt(b.ColorMode.value,10);isNaN(d)===!0&&(d=0);this.setStateColor=function(b){if(b===void 0||b.length<=0)b="255,255,255";this.color=a.FVCOLUMNBACKGROUNDCOLORSPECSTARTSTR+b+"#"};this.setStateColor(b.StateNoStateColor.value);this.itemId=parseInt(h[0],10);if(isNaN(this.itemId)===!0)this.itemId=h[0];this.typeId=parseInt(h[1],10);if(isNaN(this.typeId)===
!0)this.typeId=h[1];this.TID_HtmlTag=g+"_"+this.typeId;if(c>=20&&a.Link.SrvInfo_ALR2Activ){this.Grp1=parseInt(h[2],10);if(isNaN(this.Grp1)===!0)this.Grp1=h[2];this.Grp1_HtmlTag=g+"_GRP1_"+this.Grp1;this.Grp2=parseInt(h[3],10);if(isNaN(this.Grp2)===!0)this.Grp2=h[3];this.Grp2_HtmlTag=g+"_GRP2_"+this.Grp2;this.Grp3=parseInt(h[4],10);if(isNaN(this.Grp3)===!0)this.Grp3=h[4];this.Grp3_HtmlTag=g+"_GRP3_"+this.Grp3;this.Prio=parseInt(h[5],10);if(isNaN(this.Prio)===!0)this.Prio=h[5];this.Prio_HtmlTag=g+"_PRIO_"+
this.Prio;var e=parseInt(h[6],16);isNaN(e)===!0&&(e=0);var n=parseInt(h[7],16);isNaN(n)===!0&&(n=0);this.on=1E3*e+n;e=parseInt(h[8],16);isNaN(e)===!0&&(e=0);n=parseInt(h[9],16);isNaN(n)===!0&&(n=0);this.off=1E3*e+n;this.on>0&&this.off<=0&&(f=!0);this.state=parseInt(h[10],10);if(isNaN(this.state))this.state=h[10];if(this.state===0)this.state="NAK",d===0&&(f===!0?this.setStateColor(b.StateOnNackedColor.value):this.setStateColor(b.StateOffNackedColor.value));else if(this.state==1)this.state="ACK",d===
0&&(f===!0?this.setStateColor(b.StateOnAckedColor.value):this.setStateColor(b.StateOffAckedColor.value));if(c>=22&&a.Link.SrvInfo_ALR2Activ&&a.Link.SrvInfo_ALR2Version>=2.01){this.Grp4=parseInt(h[11],10);if(isNaN(this.Grp4)===!0)this.Grp4=h[11];this.Grp4_HtmlTag=g+"_GRP4_"+this.Grp4;this.Grp5=parseInt(h[12],10);if(isNaN(this.Grp5)===!0)this.Grp5=h[12];this.Grp5_HtmlTag=g+"_GRP5_"+this.Grp5;this.Grp6=parseInt(h[13],10);if(isNaN(this.Grp6)===!0)this.Grp6=h[13];this.Grp6_HtmlTag=g+"_GRP6_"+this.Grp6;
this.Grp7=parseInt(h[14],10);if(isNaN(this.Grp7)===!0)this.Grp7=h[14];this.Grp7_HtmlTag=g+"_GRP7_"+this.Grp7;this.Grp8=parseInt(h[15],10);if(isNaN(this.Grp8)===!0)this.Grp8=h[15];this.Grp8_HtmlTag=g+"_GRP8_"+this.Grp8;this.Grp9=parseInt(h[16],10);if(isNaN(this.Grp9)===!0)this.Grp9=h[16];this.Grp9_HtmlTag=g+"_GRP9_"+this.Grp9;this.Grp10=parseInt(h[17],10);if(isNaN(this.Grp10)===!0)this.Grp10=h[17];this.Grp10_HtmlTag=g+"_GRP10_"+this.Grp10;this.AlrTxt=h[18]}h="";d==1&&this.Grp1>=0?(h=b.AlrCoPrefix.name+
"Grp1Color["+this.Grp1+"]."+b.AlrCoIndex.name,this.setStateColor(a.RW_readSource(a.INFO_T_CONTAINER,h))):d==2&&this.Grp2>=0?(h=b.AlrCoPrefix.name+"Grp2Color["+this.Grp2+"]."+b.AlrCoIndex.name,this.setStateColor(a.RW_readSource(a.INFO_T_CONTAINER,h))):d==3&&this.Grp3>=0?(h=b.AlrCoPrefix.name+"Grp3Color["+this.Grp3+"]."+b.AlrCoIndex.name,this.setStateColor(a.RW_readSource(a.INFO_T_CONTAINER,h))):d==4&&this.Prio>=0&&(h=b.AlrCoPrefix.name+"PrioColor["+this.Prio+"]."+b.AlrCoIndex.name,this.setStateColor(a.RW_readSource(a.INFO_T_CONTAINER,
h)))}else{this.on=parseInt(h[2],16);this.off=parseInt(h[3],16);this.on!==0&&this.off===0&&(f=!0);this.state=parseInt(h[4],10);if(isNaN(this.state))this.state=h[4];if(this.state===0)this.state="NAK",f===!0?this.setStateColor(b.StateOnNackedColor.value):this.setStateColor(b.StateOffNackedColor.value);else if(this.state==1)this.state="ACK",f===!0?this.setStateColor(b.StateOnAckedColor.value):this.setStateColor(b.StateOffAckedColor.value)}};a.DefLineType=function(h,g,b){var f=!1;this.setStateColor=function(b){this.color=
a.FVCOLUMNBACKGROUNDCOLORSPECSTARTSTR+b+"#"};this.setStateColor(b.StateNoStateColor.value);this.typeId=parseInt(h[0],10);if(isNaN(this.typeId)===!0)this.typeId=h[0];this.TID_HtmlTag=g+"_"+this.typeId;this.counter=parseInt(h[1],10);if(isNaN(this.counter)===!0)this.counter=h[1];this.on=parseInt(h[2],16);this.off=parseInt(h[3],16);this.on!==0&&this.off===0&&(f=!0);this.state=parseInt(h[4],10);if(isNaN(this.state))this.state=h[4];if(this.counter===0)this.setStateColor(b.StateNoStateColor.value),this.state=
"--";else if(this.state===0)this.state="NAK",f===!0?this.setStateColor(b.StateOnNackedColor.value):this.setStateColor(b.StateOffNackedColor.value);else if(this.state==1)this.state="ACK",f===!0?this.setStateColor(b.StateOnAckedColor.value):this.setStateColor(b.StateOffAckedColor.value)};a.AlarmBase=function(h,g,b,f){this.index=h;this.coPrefix=g;this.nRow=b;this.specific_update=null;this.previousConfigResponse="";this.fileViewer=f;this.rArrayOverview=this.rArrayHistory=null;this.sta=0;this.BACnet=null;
this.isBACnet=function(){var a=!1;this.BACnet!==null&&(a=!0);return a};this.getDisplayedNumRow=function(){var a=this.nRow;this.fileViewer!==null&&this.fileViewer.getNrOfRowDisplayed!==null&&(a=this.fileViewer.getNrOfRowDisplayed());return a};this.getMaxFilteredPage=this.getMaxPage=null;this.loadHistoryCGI_psc=function(b,d){var e=0,f="",e="";a.getDebugLevel()>=2&&a.log_append_ln("loadHistoryCGI_psc() called; startLine = "+b+"; endline = "+d);this.co.LoadAlrsRemoteMode.value==="1"?this.co.LoadAlrsRemoteFile.value.length>
0?(a.loadData("plc?"+this.co.LoadAlrsRemoteFile.value+"cfg",a.AlarmSrvConfig.asynchUpdateCb,!1),e=a.loadGeneralCGI("plc?"+this.co.LoadAlrsRemoteFile.value+"Alr")):(a.getDebugLevel()>=2&&a.log_append_ln("Warning during loadHistoryCGI_psc() from Panasonic Alarming , LoadAlrsRemoteFile not right configured : ["+this.co.LoadAlrsRemoteFile.value+"]"),e=a.loadGeneralCGI("plc?alarm1Alr")):(a.getDebugLevel()>=2&&a.log_append_ln("Warning during loadHistoryCGI_psc() from Panasonic Alarming , LoadAlrsRemoteMode not right configured : ["+
this.co.LoadAlrsRemoteMode.value+"]"),e=a.loadGeneralCGI("plc?alarm1Alr"));if(e!=void 0&&e.length>0)for(var g=e.split("\n"),e=0;e=20&&a.Link.SrvInfo_ALR2Activ?(e="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,
e+="&action=lhis&startLine="+b,e+="&endLine="+d,this.co.FilterTIDs.value.length>0&&this.co.FilterTIDs.value!="0"&&(e+="&TID="+this.co.FilterTIDs.value),this.co.FilterGrp1s.value.length>0&&this.co.FilterGrp1s.value!="0"&&(e+="&grp1="+this.co.FilterGrp1s.value),this.co.FilterGrp2s.value.length>0&&this.co.FilterGrp2s.value!="0"&&(e+="&grp2="+this.co.FilterGrp2s.value),this.co.FilterGrp3s.value.length>0&&this.co.FilterGrp3s.value!="0"&&(e+="&grp3="+this.co.FilterGrp3s.value),this.co.FilterPrios.value.length>
0&&this.co.FilterPrios.value!="0"&&(e+="&prio="+this.co.FilterPrios.value),this.co.SortMode.value.length>0&&this.co.SortMode.value!="0"&&(e+="&sortTON="+this.co.SortMode.value),this.co.FilterMode.value.length>0&&this.co.FilterMode.value!="0"&&(e+="&filterON="+this.co.FilterMode.value),this.co.FilterAckMode.value.length>0&&this.co.FilterAckMode.value!="0"&&(e+="&filterACK="+this.co.FilterAckMode.value)):(e="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value,e+="&action=loadHistory&startLine="+
b,e+="&endLine="+d,this.co.SortMode.value.length>0&&this.co.SortMode.value!="0"&&(e+="&sortTON="+this.co.SortMode.value),this.co.FilterMode.value.length>0&&this.co.FilterMode.value!="0"&&(e+="&filterON="+this.co.FilterMode.value),this.co.FilterAckMode.value.length>0&&this.co.FilterAckMode.value!="0"&&(e+="&filterACK="+this.co.FilterAckMode.value),this.co.FilterTIDs.value.length>0&&this.co.FilterTIDs.value!="-1"&&(e+="&TID="+this.co.FilterTIDs.value)),e=a.loadGeneralCGI(e));return e};this.loadHistoryAlarmBlock=
function(b,d){var e=this.loadHistoryCGI(b,d);return a.parseCGI_CSV_Content(e)};this.updateIndices=function(a,b){var e={start:0,stop:0,start:-1,end:-1};e.end=(a+1)*this.getDisplayedNumRow()-1;if(e.end>=b)e.end=b-1;if(e.end<0)e.end=0;e.start=a*this.getDisplayedNumRow();if(e.start<0)e.start=0;return e};this.update_co=function(b){var d=!1;if(b){if(b=a.ReadContainer(this.name),b!=this.value)this.value=b,d=!0}else a.WriteContainer(this.name,this.value),d=!0;return d};this.config={version:0,overViewSize:0,
maxHistorySize:0,actualHistorySize:0,blockSize:0,stateIndex:0,actualFilteredSize:0};this.exec_deleteByType=function(){var b="",d=parseInt(this.co.Version.value,10);isNaN(d)===!0&&(d=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?typeId!==void 0&&typeId!=="0"&&typeId!==""&&typeId!=="-1"?(d>=20&&a.Link.SrvInfo_ALR2Activ?a.log_append_ln("exec_deleteByType Not implemented for Alarming2 Macros !"):b="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=delete&type="+typeId,b.length>0&&a.loadGeneralCGI(b)):
a.log_append_ln("Error in exec_deleteByType :typeId Not OK!"):a.log_append_ln("exec_deleteByType Not implemented on Panasonic Server !")};this.exec_deleteByItem=function(b){var d="",e=parseInt(this.co.Version.value,10);isNaN(e)===!0&&(e=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(e>=20&&a.Link.SrvInfo_ALR2Activ?a.log_append_ln("exec_deleteByItem Not implemented for Alarming2 Macros !"):d="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=delete&item="+
b,d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_deleteByItem :itemId Not OK!"):a.log_append_ln("exec_deleteByItem Not implemented on Panasonic Server !")};this.exec_deleteList=function(){var b="",d=parseInt(this.co.Version.value,10);isNaN(d)===!0&&(d=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?(d>=20&&a.Link.SrvInfo_ALR2Activ?a.log_append_ln("exec_deleteList Not implemented for Alarming2 Macros !"):b="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=delete&completList=1",
b.length>0&&a.loadGeneralCGI(b)):a.log_append_ln("exec_deleteList Not implemented on Panasonic Server !")};this.exec_acknowledgeByType=function(b){var d="",d=parseInt(this.co.Version.value,10);isNaN(d)===!0&&(d=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(d>=20&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&TID="+b):d="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=acknowledge&type="+
b,d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByType :typeId Not OK!"):a.log_append_ln("exec_acknowledgeByType Not implemented on Panasonic Server !")};this.exec_acknowledgeByItem=function(b){var d="",d=parseInt(this.co.Version.value,10);isNaN(d)===!0&&(d=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(d>=20&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&item="+
b):d="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=acknowledge&item="+b,d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByItem :itemId Not OK!"):a.log_append_ln("exec_acknowledgeByItem Not implemented on Panasonic Server !")};this.exec_acknowledgeByGrp1=function(b){var d="",e=parseInt(this.co.Version.value,10);isNaN(e)===!0&&(e=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(e>=20&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+
a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&grp1="+b):a.log_append_ln("exec_acknowledgeByGrp1 Not implemented before Alarming2 Macros !"),d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByGrp1 :grp1 Not OK!"):a.log_append_ln("exec_acknowledgeByGrp1 Not implemented on Panasonic Server !")};this.exec_acknowledgeByGrp2=function(b){var d="",e=parseInt(this.co.Version.value,10);isNaN(e)===!0&&(e=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?
b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(e>=20&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&grp2="+b):a.log_append_ln("exec_acknowledgeByGrp2 Not implemented before Alarming2 Macros !"),d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByGrp2 :grp2 Not OK!"):a.log_append_ln("exec_acknowledgeByGrp2 Not implemented on Panasonic Server !")};this.exec_acknowledgeByGrp3=function(b){var d="",e=parseInt(this.co.Version.value,
10);isNaN(e)===!0&&(e=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(e>=20&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&grp3="+b):a.log_append_ln("exec_acknowledgeByGrp3 Not implemented before Alarming2 Macros !"),d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByGrp3 :grp3 Not OK!"):a.log_append_ln("exec_acknowledgeByGrp3 Not implemented on Panasonic Server !")};
this.exec_acknowledgeByGrp4=function(b){var d="",e=parseInt(this.co.Version.value,10);isNaN(e)===!0&&(e=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(e>=22&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&grp4="+b):a.log_append_ln("exec_acknowledgeByGrp4 Not implemented before Alarming2 Macros version 22 !"),d.length>0&&a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByGrp4 :grp4 Not OK!"):
a.log_append_ln("exec_acknowledgeByGrp4 Not implemented on Panasonic Server !")};this.exec_acknowledgeByPrio=function(b){var d="",e=parseInt(this.co.Version.value,10);isNaN(e)===!0&&(e=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?b!==void 0&&b!=="0"&&b!==""&&b!=="-1"?(e>=20&&a.Link.SrvInfo_ALR2Activ?(d="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,d+="&action=ack",d+="&prio="+b):a.log_append_ln("exec_acknowledgeByPrio Not implemented before Alarming2 Macros !"),d.length>0&&
a.loadGeneralCGI(d)):a.log_append_ln("Error in exec_acknowledgeByPrio :prio Not OK!"):a.log_append_ln("exec_acknowledgeByPrio Not implemented on Panasonic Server !")};this.exec_acknowledgeList=function(){var b="",b=parseInt(this.co.Version.value,10);isNaN(b)===!0&&(b=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?(b>=20&&a.Link.SrvInfo_ALR2Activ?(b="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,b+="&action=ack"):b="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=acknowledge&completList=1",
b.length>0&&a.loadGeneralCGI(b)):a.log_append_ln("exec_acknowledgeList Not implemented on Panasonic Server !")};this.exec_acknowledgeListAdv=function(){var b="",d=parseInt(this.co.Version.value,10);isNaN(d)===!0&&(d=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?(d>=20&&a.Link.SrvInfo_ALR2Activ?(b="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,b+="&action=ack",this.co.ACKItems.value.length>0&&this.co.ACKItems.value!=="0"&&this.co.ACKItems.value!=="-1"&&(b+="&item="+this.co.ACKItems.value),
this.co.ACKTIDs.value.length>0&&this.co.ACKTIDs.value!=="0"&&this.co.ACKTIDs.value!=="-1"&&(b+="&TID="+this.co.ACKTIDs.value),this.co.ACKGrp1s.value.length>0&&this.co.ACKGrp1s.value!=="0"&&this.co.ACKGrp1s.value!=="-1"&&(b+="&grp1="+this.co.ACKGrp1s.value),this.co.ACKGrp2s.value.length>0&&this.co.ACKGrp2s.value!=="0"&&this.co.ACKGrp2s.value!=="-1"&&(b+="&grp2="+this.co.ACKGrp2s.value),this.co.ACKGrp3s.value.length>0&&this.co.ACKGrp3s.value!=="0"&&this.co.ACKGrp3s.value!=="-1"&&(b+="&grp3="+this.co.ACKGrp3s.value),
this.co.ACKPrios.value.length>0&&this.co.ACKPrios.value!=="0"&&this.co.ACKPrios.value!=="-1"&&(b+="&prio="+this.co.ACKPrios.value),d>=22&&this.co.ACKGrp4s.value.length>0&&this.co.ACKGrp4s.value!=="0"&&this.co.ACKGrp4s.value!=="-1"&&(b+="&grp4="+this.co.ACKGrp4s.value)):a.log_append_ln("exec_acknowledgeListAdv Not implemented before Alarming2 Macros !"),b.length>0&&a.loadGeneralCGI(b)):a.log_append_ln("exec_acknowledgeListAdv Not implemented on Panasonic Server !")};this.exec_restartAlarmServer=function(){var b=
"",b=parseInt(this.co.Version.value,10);isNaN(b)===!0&&(b=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?(b>=20&&a.Link.SrvInfo_ALR2Activ?(b="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,b+="&action=reinitAlarming"):b="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=reinitAlarming",b.length>0&&a.loadGeneralCGI(b)):a.log_append_ln("exec_restartAlarmServer Not implemented on Panasonic Server !")};this.exec_clearAlarmServer=function(){var b="",b=parseInt(this.co.Version.value,
10);isNaN(b)===!0&&(b=1);a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC?(b>=20&&a.Link.SrvInfo_ALR2Activ?(b="alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value,b+="&action=clearLogFiles"):b="alarm"+a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=clearLogFiles",b.length>0&&a.loadGeneralCGI(b)):a.log_append_ln("exec_clearAlarmServer Not implemented on Panasonic Server !")};this.readAllSpecialAlarmContainers=function(){var a=this.co,b=[];Object.keys(a).forEach(function(e){a[e].update!==
null&&a[e].update(!0)===!0&&b.push(a[e])});return b};this.loadAndParseSrvCfg=function(){var b=!1,d=parseInt(this.co.Version.value,10);isNaN(d)===!0&&(d=1);a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC?this.co.LoadAlrsRemoteMode.value==="1"?this.co.LoadAlrsRemoteFile.value.length>0?a.loadData("plc?"+this.co.LoadAlrsRemoteFile.value+"cfg",a.AlarmSrvConfig.asynchUpdateCb,!1):(a.getDebugLevel()>=2&&a.log_append_ln("Warning during load cfg from Panasonic Alarming , LoadAlrsRemoteFile not right configured : ["+
this.co.LoadAlrsRemoteFile.value+"]"),a.loadData("plc?alarm1cfg",a.AlarmSrvConfig.asynchUpdateCb,!1)):(a.getDebugLevel()>=2&&a.log_append_ln("Warning during load cfg from Panasonic Alarming , LoadAlrsRemoteMode not right configured : ["+this.co.LoadAlrsRemoteMode.value+"]"),a.loadData("plc?alarm1cfg",a.AlarmSrvConfig.asynchUpdateCb,!1)):d>=20&&a.Link.SrvInfo_ALR2Activ?a.loadData("alarm2"+a.getSrvExt()+"?cgiVer=2&list="+this.co.AlarmsListNr.value+"&action=sta",a.AlarmSrvConfig.asynchUpdateCb,!1):a.loadData("alarm"+
a.getSrvExt()+"?list="+this.co.AlarmsListNr.value+"&action=configNSta",a.AlarmSrvConfig.asynchUpdateCb,!1);if(a.AlarmSrvConfig.response.length>0&&a.stringcmp(a.AlarmSrvConfig.response,this.previousConfigResponse)===!1&&(b=!0,this.previousConfigResponse=a.AlarmSrvConfig.response,this.parseAlarmSrvConfig()===!0)){if(this.getMaxPage!==null)this.co.MaxPageNr.value=this.getMaxPage(),this.co.MaxPageNr.update(!1);if(d>=20&&a.Link.SrvInfo_ALR2Activ&&this.getMaxPage!==null)this.co.MaxFilteredPageNr.value=
this.getMaxPage(),this.co.MaxFilteredPageNr.update(!1)}if(a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC&&d>=20&&a.Link.SrvInfo_ALR2Activ&&this.getMaxFilteredPage!==null&&this.co.MaxFilteredPageNr.value!==this.getMaxFilteredPage())b=!0,this.co.MaxFilteredPageNr.value=this.getMaxFilteredPage(),this.co.MaxFilteredPageNr.update(!1);return b};this.update=function(){var b=0,d=0,e=d=0,f=1;this.fileViewer.getDrawCellTxtOnXLinesSource&&(b=this.fileViewer.getDrawCellTxtOnXLinesSource(),b!==null&&b.value!==null&&
b.value!==void 0&&b.value.length>0&&b.value!="0"&&(f=parseInt(b.value,10)));isNaN(f)&&(f=1);f<=0&&(f=1);var g=this.readAllSpecialAlarmContainers();if(this.co.AlarmsListNr.value==="")this.co.AlarmsListNr.value="ALRLIST0";var j=parseInt(this.co.Version.value,10);isNaN(j)===!0&&(j=1);var k=4,o=6,h=8,p=-1,s=10;j>=22&&a.Link.SrvInfo_ALR2Activ&&(k=5,o=7,h=9,p=11,s=19);var q=this.loadAndParseSrvCfg();if(g.length>0||q===!0||a.previousDrawDateTimeFormat!==a.readDateTimeFormat()||a.previousMBTmzEn!==a.SpecialCO.mbTmzEn.value){for(b=
0;b=20&&a.Link.SrvInfo_ALR2Activ)a.log_append_ln("Error in update Alarming , ACKALRSDEFTYPES no more supported in alarming2");else if(this.fileViewer.checkIfMultiSelect()===!0)for(e=0;e=20&&a.Link.SrvInfo_ALR2Activ)if(this.fileViewer.checkIfMultiSelect()===!0)for(e=0;e=20&&a.Link.SrvInfo_ALR2Activ)if(this.fileViewer.checkIfMultiSelect()===!0)for(e=0;e=20&&a.Link.SrvInfo_ALR2Activ)if(this.fileViewer.checkIfMultiSelect()===
!0)for(e=0;e=22&&a.Link.SrvInfo_ALR2Activ)if(this.fileViewer.checkIfMultiSelect()===!0)for(e=0;e=20&&a.Link.SrvInfo_ALR2Activ)if(this.fileViewer.checkIfMultiSelect()===!0)for(e=0;e=20&&a.Link.SrvInfo_ALR2Activ?
a.log_append_ln("Error in update Alarming , ACKALRSDEFLIST no more supported in alarming2"):this.exec_acknowledgeList():a.stringcmp("ACKALRSHISLIST",g[b].value)===!0?this.exec_acknowledgeList():a.stringcmp("ACKALRSHISADV",g[b].value)===!0?j>=20&&a.Link.SrvInfo_ALR2Activ?this.exec_acknowledgeListAdv():a.log_append_ln("Error in update Alarming , ACKALRSHISADV only supported s\ufffdnce alarming2"):a.stringcmp("DELALRSHISLIST",g[b].value)===!0?this.exec_deleteList():a.stringcmp("RESTARTTRGTALARMING",
g[b].value)===!0?this.exec_restartAlarmServer():a.stringcmp("CLEARTRGTLOGFILES",g[b].value)===!0&&this.exec_clearAlarmServer()}else if(a.stringcmp(this.co.SelectMode.name,g[b].name)===!0)a.getDebugLevel()>=2&&a.log_append_ln(g[b].value),a.stringcmp("STOM",g[b].value)===!0?this.fileViewer.changeSelection(-1):a.stringcmp("MTOS",g[b].value)===!0&&this.fileViewer.changeSelection(-1);else if(a.stringcmp(this.co.AlarmMacroType.name,g[b].name)===!0&&(a.getDebugLevel()>=2&&a.log_append_ln(g[b].value),a.stringcmp("20",
g[b].value)===!0)){if(this.BACnet===null)this.BACnet=new a.BACnet_Alarming(this);a.getDebugLevel()>=2&&a.log_append_ln("this is a BACnet alarming macro")}if(q&&a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC&&(a.getDebugLevel()>=2&&a.log_append_ln(" Panasonic forces that alarm his reload since the alarmcfg request changed this.co.LoadAlrsAction.name = "+this.co.LoadAlrsAction.name+" this.co.LoadAlrsAction.value = "+this.co.LoadAlrsAction.value),this.co.LoadAlrsAction.value!=="STARTLOADDATAS"))this.co.LoadAlrsAction.value=
"STARTLOADDATAS",this.co.LoadAlrsAction.update(!1),g.push(this.co.LoadAlrsAction);this.specific_update(g);this.fileViewer.removeSelection()}};this.specific_update=a.noop;this.parseAlarmSrvConfig=function(){var b=a.AlarmSrvConfig.response,d=null,e=!1,f=0,g=1,j=parseInt(this.co.Version.value,10);isNaN(j)===!0&&(j=1);a.getDebugLevel()>=3&&b!==null&&a.log_append_ln("Alarming , parseAlarmSrvConfig contents : ["+b+"]");b!==null?d=a.parseCGI_CSV_Content(b):a.log_append_ln("Alarming ERROR: Failed to parseCGI_CSV_Content! ");
j>=20&&a.Link.SrvInfo_ALR2Activ?(f=1,d[0]!==null&&d[0][0]!==null&&isNaN(parseFloat(d[0][0],10))!==!0&&(g=parseFloat(d[0][0],10))):g=0;g!==0&&a.log_append_ln("Alarming parseAlarmSrvConfig ERROR: error code not Ok "+g);if(g===0&&d!==null&&d[f]!==null){if(d[f][0]!==null&&isNaN(parseFloat(d[f][0],10))!==!0)this.config.version=parseFloat(d[f][0],10);if(d[f][1]!==null&&(this.config.overViewSize=0,isNaN(parseInt(d[f][1],10))!==!0))this.config.overViewSize=parseInt(d[f][1],10);if(d[f][2]!==null&&(this.config.maxHistorySize=
0,isNaN(parseInt(d[f][2],10))!==!0))this.config.maxHistorySize=parseInt(d[f][2],10);if(d[f][3]!==null&&(this.config.actualHistorySize=0,isNaN(parseInt(d[f][3],10))!==!0))this.config.actualHistorySize=parseInt(d[f][3],10);if(d[f][4]!==null&&(this.config.blockSize=0,isNaN(parseInt(d[f][4],10))!==!0))this.config.blockSize=parseInt(d[f][4],10);if(d[f][5]!==null&&(this.config.stateIndex=0,isNaN(parseInt(d[f][5],10))!==!0))this.config.stateIndex=parseInt(d[f][5],10),e=!0}return e};this.co={Language:{name:"@LANGUAGE",
value:"0",update:this.update_co},AlrCoPrefix:{name:g,value:g,update:null},AlrCoIndex:{name:h,value:h,update:null},AlarmList:{name:g+"AlarmsList."+h,value:"0",update:this.update_co},AlarmsListNr:{name:g+"AlarmsListNr."+h,value:"ALRLIST0",update:this.update_co},LoadAlrsRemoteMode:{name:g+"LoadAlrsRemoteMode."+h,value:"1",update:this.update_co},LoadAlrsRemoteFile:{name:g+"LoadAlrsRemoteFile."+h,value:"",update:this.update_co},SelectMode:{name:g+"SelectMode."+h,value:"0",update:this.update_co},AlarmsListSize:{name:g+
"AlarmsListSize."+h,value:"0",update:this.update_co},PageNr:{name:g+"PageNr."+h,value:"0",update:this.update_co},MaxPageNr:{name:g+"MaxPageNr."+h,value:"0",update:this.update_co},MaxFilteredPageNr:{name:g+"MaxFilteredPageNr."+h,value:"0",update:this.update_co},SelAlrsTypesAct:{name:g+"SelAlrsTypesAct."+h,value:"0",update:this.update_co},AlarmsListHeaderSP:{name:g+"AlarmsListHeaderSP."+h,value:"0",update:this.update_co},FilterMode:{name:g+"FilterMode."+h,value:"0",update:this.update_co},SortMode:{name:g+
"SortMode."+h,value:"0",update:this.update_co},FilterAckMode:{name:g+"FilterAckMode."+h,value:"0",update:this.update_co},FilterTIDs:{name:g+"FilterTIDs."+h,value:"0",update:this.update_co},AlarmsTxtFromCSV:{name:g+"AlarmsTxtFromCSV."+h,value:"0",update:this.update_co},AlarmListSizeCSV:{name:g+"AlarmListSizeCSV."+h,value:"0",update:this.update_co},StateNoStateColor:{name:g+"StateNoStateColor."+h,value:"0",update:this.update_co},StateOnNackedColor:{name:g+"StateOnNackedColor."+h,value:"0",update:this.update_co},
StateOnAckedColor:{name:g+"StateOnAckedColor."+h,value:"0",update:this.update_co},StateOffNackedColor:{name:g+"StateOffNackedColor."+h,value:"0",update:this.update_co},StateOffAckedColor:{name:g+"StateOffAckedColor."+h,value:"0",update:this.update_co},LoadAlrsAction:{name:g+"LoadAlrsAction."+h,value:"0",update:this.update_co},LoadAlrsBargVal:{name:g+"LoadAlrsBargVal."+h,value:"0",update:this.update_co},SaveAlrsAction:{name:g+"SaveAlrsAction."+h,value:"0",update:this.update_co},SortAlrsColAction:{name:g+
"SortAlrsColAction."+h,value:"0",update:this.update_co},SortAlrsColNr:{name:g+"SortAlrsColNr."+h,value:"0",update:this.update_co},AlarmMacroType:{name:g+"AlarmMacroType."+h,value:"0",update:this.update_co},AlarmTextExtraParam10:{name:g+"AlarmTextExtraParam1On."+h,value:"0",update:this.update_co},AlarmTextExtraParam20:{name:g+"AlarmTextExtraParam2On."+h,value:"0",update:this.update_co},AlarmTextExtraParam30:{name:g+"AlarmTextExtraParam3On."+h,value:"0",update:this.update_co},AlarmTextExtraParam40:{name:g+
"AlarmTextExtraParam4On."+h,value:"0",update:this.update_co},AlarmTextExtraParam50:{name:g+"AlarmTextExtraParam4On."+h,value:"0",update:this.update_co},Version:{name:g+"Version."+h,value:"0",update:this.update_co},FilterGrp1s:{name:g+"FilterGrp1s."+h,value:"0",update:this.update_co},FilterGrp2s:{name:g+"FilterGrp2s."+h,value:"0",update:this.update_co},FilterGrp3s:{name:g+"FilterGrp3s."+h,value:"0",update:this.update_co},FilterPrios:{name:g+"FilterPrios."+h,value:"0",update:this.update_co},ACKTIDs:{name:g+
"ACKTIDs."+h,value:"0",update:this.update_co},ACKItems:{name:g+"ACKItems."+h,value:"0",update:this.update_co},ACKGrp1s:{name:g+"ACKGrp1s."+h,value:"0",update:this.update_co},ACKGrp2s:{name:g+"ACKGrp2s."+h,value:"0",update:this.update_co},ACKGrp3s:{name:g+"ACKGrp3s."+h,value:"0",update:this.update_co},ACKPrios:{name:g+"ACKPrios."+h,value:"0",update:this.update_co},ColorMode:{name:g+"ColorMode."+h,value:"0",update:this.update_co}};this.generateHistoryAlarmContainerValue=function(){var b=0,d="",e=parseInt(this.co.Version.value,
10);isNaN(e)===!0&&(e=1);if(this.rArrayHistory===null)return"";for(b=0;b=22&&a.Link.SrvInfo_ALR2Activ&&(d+=this.rArrayHistory[b].AlrTxt,d+=a.FVCOLSEPTOKEN2),e>=20&&a.Link.SrvInfo_ALR2Activ&&(d+=this.rArrayHistory[b].Grp1,d+=
a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp1_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=this.rArrayHistory[b].Grp2,d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp2_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=this.rArrayHistory[b].Grp3,d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp3_HtmlTag),d+=a.FVCOLSEPTOKEN2),e>=22&&a.Link.SrvInfo_ALR2Activ&&(d+=this.rArrayHistory[b].Grp4,d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,
this.rArrayHistory[b].Grp4_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp5_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp6_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp7_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp8_HtmlTag),d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp9_HtmlTag),d+=a.FVCOLSEPTOKEN2,
d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Grp10_HtmlTag),d+=a.FVCOLSEPTOKEN2),e>=20&&a.Link.SrvInfo_ALR2Activ&&(d+=this.rArrayHistory[b].Prio,d+=a.FVCOLSEPTOKEN2,d+=a.RW_readSource(a.INFO_T_HTMLTAG,this.rArrayHistory[b].Prio_HtmlTag),d+=a.FVCOLSEPTOKEN2),d+=e>=20&&a.Link.SrvInfo_ALR2Activ?a.getAlarmDateTimeByIntMSec(this.rArrayHistory[b].on):a.getAlarmDateTimeByIntMSec(1E3*this.rArrayHistory[b].on),d+=a.FVCOLSEPTOKEN2,d+=e>=20&&a.Link.SrvInfo_ALR2Activ?a.getAlarmDateTimeByIntMSec(this.rArrayHistory[b].off):
a.getAlarmDateTimeByIntMSec(1E3*this.rArrayHistory[b].off),d+=a.FVCOLSEPTOKEN2,d+=this.rArrayHistory[b].state,d+=a.FVLINESEPTOKEN2;return d};this.addPartialResponseToHistory=function(b,d){var e=0,f=b.length,g=null,e=0,j=parseInt(this.co.Version.value,10);isNaN(j)===!0&&(j=1);if(j>=20&&a.Link.SrvInfo_ALR2Activ){if(e=1,f>=2&&(b[0][0]!==null&&isNaN(parseFloat(b[0][0],10))!==!0&&(e=parseFloat(b[0][0],10)),b[1][1]!==null))isNaN(parseFloat(b[1][1],10))!==!0?this.config.actualFilteredSize=parseFloat(b[1][1],
10):a.log_append_ln("Alarming addPartialResponseToHistory ERROR in parsing actualFilteredSize : "+b[1][1])}else e=0;if(e!==0)a.log_append_ln("Alarming addPartialResponseToHistory ERROR: error code not Ok "+e);else{d.rInt=-1;e=0;for(j>=20&&a.Link.SrvInfo_ALR2Activ&&(e=2);e=2&&j<22||!a.Link.SrvInfo_ALR2Activ)&&b[e].length>=5&&this.isBACnet()===!0&&a.Link.SrvInfo_ALRActiv===!0&&a.Link.SrvInfo_ALRVersion>=
1.11)b[e][5]==="20"?(g=new a.BACnet_HisLineType(b[e],this.co.AlarmsListNr.value,this.co),d.rArray.push(g),d.rInt=1):(a.log_append_ln("Alarming addPartialResponseToHistory ERROR: EXTRAPARAMSTYPE should be beckhoff one is not for "+b[5]),d.rInt=-1);else if(b[e].length>=5)g=new a.HisLineType(b[e],this.co.AlarmsListNr.value,this.co),d.rArray.push(g),d.rInt=1;else{d.rInt=-1;break}}};this.co.AlarmsListNr.update(!0);if(this.co.AlarmsListNr.value.length===0)this.co.AlarmsListNr.value="ALRLIST0"};a.AlarmDefOnlineType=
function(h,g,b){this.base=a.AlarmBase;this.base(h,"@MACROALRDEFON",g,b);this.specific_update=function(){this.rArrayOverview=null;var a=parseInt(this.co.PageNr.value,10);isNaN(a)===!0&&(a=0);this.rArrayOverview=this.loadOverviewByIndices(this.updateIndices(a,this.config.overViewSize),a,this.config.overViewSize);this.co.SelAlrsTypesAct.value="0";this.co.SelAlrsTypesAct.update(!1);this.co.AlarmList.value=this.co.AlarmsListHeaderSP.value+this.generateOverviewAlarmContainerValue();this.co.AlarmList.update(!1);
this.co.AlarmsListSize.value=this.config.overViewSize;this.co.AlarmsListSize.update(!1)};this.getMaxPage=function(){var a=0;this.config.overViewSize>0&&this.getDisplayedNumRow()>0&&(a=Math.ceil(this.config.overViewSize/this.getDisplayedNumRow()-1));return a};this.generateOverviewAlarmContainerValue=function(){for(var b=0,c=this.rArrayOverview.length,d="",b=0;b=0&&a.end>=0){e.rInt=1;if(a.end+1>=d)a.end=d-1;if(b>=0)for(;e.rInt>0&&e.rArray.length=2&&b<22||!a.Link.SrvInfo_ALR2Activ)&&this.isBACnet()===!0&&a.Link.SrvInfo_ALRActiv===!0&&a.Link.SrvInfo_ALRVersion>=1.11?a.BACnet_generateHistoryAlarmContainerValue(this,this.BACnet.TextFlags):this.generateHistoryAlarmContainerValue();this.co.AlarmList.update(!1);this.co.AlarmsListSize.value=this.config.actualHistorySize;this.co.AlarmsListSize.update(!1)};this.getMaxPage=function(){var a=0;this.config.actualHistorySize>0&&this.getDisplayedNumRow()>
0&&(a=Math.ceil(this.config.actualHistorySize/this.getDisplayedNumRow()-1));return a};this.getMaxFilteredPage=function(){var a=0;this.config.actualFilteredSize>=0&&this.getDisplayedNumRow()>1?(a=Math.ceil(this.config.actualFilteredSize/this.getDisplayedNumRow()-1),a<0&&(a=0)):this.config.actualHistorySize>0&&this.getDisplayedNumRow()>0&&(a=Math.ceil(this.config.actualHistorySize/this.getDisplayedNumRow()-1));return a};this.loadHistoryByIndices=function(a,b,e){var f={rArray:[],rInt:0},g=[],j=g=0;if(a.start>=
0&&a.end>=0){f.rInt=1;if(a.end+1>=e)a.end=e-1;if(b>=0)for(;f.rInt>0&&f.rArray.length0&&a.rArray.length=this.config.actualHistorySize&&(d=this.config.actualHistorySize-1);return a.rArray};this.compareAlarms=function(b,c,d){var e=!1,g=parseInt(this.co.Version.value,10);isNaN(g)===
!0&&(g=1);if(d>0)switch(d){case 1:e=b.itemId=20&&a.Link.SrvInfo_ALR2Activ?b.Grp1=22&&a.Link.SrvInfo_ALR2Activ?b.Grp1=20&&a.Link.SrvInfo_ALR2Activ?a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp1_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp1_HtmlTag)):b.off=22&&a.Link.SrvInfo_ALR2Activ?a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp1_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp1_HtmlTag)):g>=20&&a.Link.SrvInfo_ALR2Activ?b.Grp2=22&&a.Link.SrvInfo_ALR2Activ){e=b.Grp2=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp2_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp2_HtmlTag));break}break;case 8:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=
a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp2_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp2_HtmlTag));break}else if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.Grp3=22&&a.Link.SrvInfo_ALR2Activ){e=b.Grp3=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp3_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp3_HtmlTag));break}break;case 10:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,
b.Grp3_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp3_HtmlTag));break}else if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.Prio=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Prio_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Prio_HtmlTag));break}break;case 12:if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.on=20&&a.Link.SrvInfo_ALR2Activ){e=b.off=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isLesser(b.state,
c.state);break}break;case 19:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=b.Prio=22&&a.Link.SrvInfo_ALR2Activ){e=a.str_isLesser(a.RW_readSource(a.INFO_T_HTMLTAG,b.Prio_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Prio_HtmlTag));break}break;case 21:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=b.on=22&&a.Link.SrvInfo_ALR2Activ){e=b.off=22&&a.Link.SrvInfo_ALR2Activ&&(e=a.str_isLesser(b.state,c.state))}else switch(d){case -1:e=
b.itemId>c.itemId;break;case -2:e=b.typeId>c.typeId;break;case -3:e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.TID_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.TID_HtmlTag));break;case -4:e=g>=20&&a.Link.SrvInfo_ALR2Activ?b.Grp1>c.Grp1:b.on>c.on;break;case -5:e=g>=22&&a.Link.SrvInfo_ALR2Activ?b.Grp1>c.Grp1:g>=20&&a.Link.SrvInfo_ALR2Activ?a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp1_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp1_HtmlTag)):b.off>c.off;break;case -6:e=g>=22&&a.Link.SrvInfo_ALR2Activ?
a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp1_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp1_HtmlTag)):g>=20&&a.Link.SrvInfo_ALR2Activ?b.Grp2>c.Grp2:a.str_isGreater(b.state,c.state);break;case -7:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=b.Grp2>c.Grp2;break}else if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp2_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp2_HtmlTag));break}break;case -8:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,
b.Grp2_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp2_HtmlTag));break}else if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.Grp3>c.Grp3;break}break;case -9:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=b.Grp3>c.Grp3;break}else if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp3_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Grp3_HtmlTag));break}break;case -10:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Grp3_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,
c.Grp3_HtmlTag));break}else if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.Prio>c.Prio;break}break;case -11:if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Prio_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Prio_HtmlTag));break}break;case -12:if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.on>c.on;break}break;case -13:if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=b.off>c.off;break}break;case -14:if(g>=20&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(b.state,c.state);break}break;case -19:if(g>=
22&&a.Link.SrvInfo_ALR2Activ){e=b.Prio>c.Prio;break}break;case -20:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=a.str_isGreater(a.RW_readSource(a.INFO_T_HTMLTAG,b.Prio_HtmlTag),a.RW_readSource(a.INFO_T_HTMLTAG,c.Prio_HtmlTag));break}break;case -21:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=b.on>c.on;break}break;case -22:if(g>=22&&a.Link.SrvInfo_ALR2Activ){e=b.off>c.off;break}break;case -23:g>=22&&a.Link.SrvInfo_ALR2Activ&&(e=a.str_isGreater(b.state,c.state))}return e};this.sortHisByNr=function(a){var b=!1;if(this.rArrayHistory){if(this.rArrayHistory.length>
1)for(var d=!1,e=!0,g=0,r=this.rArrayHistory.length;e===!0;){e=!1;for(g=0;g+1=2&&a.log_append_ln(b[c].value);else if(a.stringcmp(this.co.SortAlrsColAction.name,b[c].name)===!0){if(a.stringcmp("SORTHISSOFFALARMS",b[c].value)===!0){var d=parseInt(this.co.SortAlrsColNr.value,10);isNaN(d)===!1&&(this.sortHisByNr(d),this.fileViewer.resetScrollIndex())}}else a.stringcmp(this.co.SaveAlrsAction.name,b[c].name)===!0&&a.stringcmp("SAVEDATASTOFILE",b[c].value)===!0&&a.err_append_ln(a.SaveFileError);
this.co.AlarmList.value=this.co.AlarmsListHeaderSP.value+this.generateHistoryAlarmContainerValue();this.co.AlarmList.update(!1);this.co.AlarmsListSize.value=this.rArrayHistory!==null?this.rArrayHistory.length+" / "+this.config.actualHistorySize:"0 / "+this.config.actualHistorySize;this.co.AlarmsListSize.update(!1);this.co.SortAlrsColAction.value="0";this.co.SortAlrsColAction.update(!1);this.co.LoadAlrsAction.value="0";this.co.LoadAlrsAction.update(!1);this.co.SaveAlrsAction.value="0";this.co.SaveAlrsAction.update(!1)}};
a.AlarmHisOfflineType.prototype=new a.AlarmBase;return a}(_SCIntern||{});_SCIntern=function(a){function h(){var a=0;$("#SC_HTMLControlDropDown option:selected").each(function(){a=$(this).val()});return a}function g(){var a=0;$("#SC_HTMLControlDropDown option:selected").each(function(){a=$(this).text()});return a}a.PainterType_DropDown=function(b){this.base=a.PainterType_MPainter;this.base(b);var f=this;this.table=null;this.listInfoType=function(){this.srcType=0;this.srcPrevValue=this.srcValue=this.srcName=""};this.listInfoArray=[];this.prevListNamesText=this.prevListText=
"";this.lastListFilesloadIndex=-1;this.editModeActionFlag=!1;this.frmElmntOut=this.frmElmntInt=this.initDDLFunc=null;this.numRows=0;this.arrowSvg=null;var c=0;this.getTotalNrOfRows=function(){return this.numRows};a.DropDownMaxSize=15;this.activateEditMode=function(){a.registerModalPainter(this);if(this.listInfoArray[0].srcName){var b=0;f.table=f.getListTable();for(b=c=0;b=3&&(a.log_append_ln("hmi-dropdown editSource_getFontSize(): "+r),a.log_append_ln("hmi-dropdown editSource_getValue(): "+j));var k=0,o=0,o=a.getLeftPos(a.g_MouseDownEventInfo.ViewItem.ClickableDiv.handle),k=a.getTopPos(a.g_MouseDownEventInfo.ViewItem.ClickableDiv.handle),g=a.getScreenCrds(f.x,f.y,f.w,f.h),k=g.h+g.y+k+"px",o=g.x+o+"px",h=g.w+"px";$(a.g_HTMLControlDropDownElmnt).css("position","absolute");$(a.g_HTMLControlDropDownElmnt).css("top",
k);$(a.g_HTMLControlDropDownElmnt).css("left",o);$(a.g_HTMLControlDropDownElmnt).css("width",h);g=g.scaleFactor*r;$(a.g_HTMLControlDropDownElmnt).css("background-color",b);$(a.g_HTMLControlDropDownElmnt).css("color",e);$(a.g_HTMLControlDropDownElmnt).css("font-size",g+"px");$(a.g_HTMLControlDropDownElmnt).css("font-family",f.getFontName());$(a.g_HTMLControlDropDownElmnt).css("font-style",f.getSvgFontStyle());$(a.g_HTMLControlDropDownElmnt).css("font-weight",f.getSvgFontWeight());$(a.g_HTMLControlDropDownElmnt).css("display",
"block");$(a.g_HTMLControlDropDownElmnt).val(j);b=null;b=e=0;$(a.g_HTMLControlDropDownElmnt).empty();f.editSource_getValue_parseInt_DropDown();for(e=0;e'+f.table[e]+""),b.appendTo(a.g_HTMLControlDropDownElmnt));b=f.numRows>a.DDL_MAX_LN?a.DDL_MAX_LN:f.numRows;b==1&&(b=2);e=b;if(b>a.DropDownMaxSize)e=a.DropDownMaxSize;$(a.g_HTMLControlDropDownElmnt).attr("size",e);this.editModeFlag=!0}};this.leaveEditMode=function(){a.removeModalPainter();
if(this.editModeFlag===!0)$(a.g_HTMLControlDropDownElmnt).css("display","none"),$(a.g_HTMLControlDropDownElmnt).css("top","0px"),$(a.g_HTMLControlDropDownElmnt).css("left","0px"),this.editModeFlag=!1};this.execDropDownAction=function(b,c,f,r,j){if(b!==void 0)if(this.editModeFlag===!1)switch(b){case 8:this.activateEditMode(),a.getDebugLevel()>=2&&a.log_append_ln("hmi-dropdown this.editModeFlag")}else if(this.editModeActionFlag===!0&&this.editModeFlag===!0)switch(b){case 6:a.RW_writeSource(r,j,h());
break;case 7:a.RW_writeSource(r,j,g())}};this.execScrollerAction=function(){};this.execDDLAct=function(b,c,f,g,j){if(this.execDDLAct.onlyonce===void 0)a.SL_refreshPPO(),this.execDDLAct.onlyonce=!1;this.execDropDownAction(b,c,f,g,j)};this.addDDLInfo=function(a,b){var c=new this.listInfoType;c.srcType=a;c.srcName=b;this.listInfoArray.push(c);this.checkIfListChanged()};this.checkIfListChanged=function(){var b="",c=0,f=0,g=1,c=this.getReloadFilePeriode();if(c!=null&&c.value!=null&&!isNaN(c.value))g=c.value;
for(c=0;c=0&&(f=0):g>1&&a.SpecialCO.autoincr.value%g!==0&&(f=0);c!==0&&(b+="\n");if(this.listInfoArray[c].srcType!==a.INFO_T_FILE||f===1)this.listInfoArray[c].srcValue=a.RW_readSource(this.listInfoArray[c].srcType,this.listInfoArray[c].srcName);b+=this.listInfoArray[c].srcValue}if(f===
1)this.lastListFilesloadIndex=a.SpecialCO.autoincr.value;if(b!==this.prevListText)this.prevListText=b,this.scheduleFullRedrawPainter()};this.getTableRow=function(a){var b="";this.table.length>0&&(b=this.table[a]);b===void 0&&(b="");return b};this.getListTable=function(){for(var b="",c=0,c=0;c=2&&a.log_append_ln("hmi-dropdown Undo case"),this.scheduleFullRedrawPainter());break;case a.REMOVE_SELECTION:case a.VIEW_LOST_FOCUS:this.editModeFlag&&(this.leaveEditMode(!1),f=1);break;case a.CHANGE_DDL_VALUE:this.editModeActionFlag=!0,this.executeActionMouseDown(),this.leaveEditMode(!0),this.editModeActionFlag=
!1,f=1}return f};if(b.initDDL)this.initDDLFunc=b.initDDL};a.PainterType_DropDown.prototype=new a.PainterType_MPainter;return a}(_SCIntern||{});_SCIntern=function(a){function h(){this.x=0;this.v=!1;this.index=this.p=this.w=0;this.clipId=""}a.DEFAULT_SCROLLER_WIDTH=20;a.DEFAULT_SCROLLER_WIDTH_TOUCH=50;a.FVCOMMENTLINESTARTSTR="#!";a.FVLINESPECLINESTARTSTR="#sp;";a.FVCOLUMNFOREGROUNDCOLORSPECSTARTSTR="#sfc;";a.FVCOLUMNBACKGROUNDCOLORSPECSTARTSTR="#sbc;";a.FVCOLUMNCOLORSPECENDSTR="#";a.FVCOLUMNCOLORSPECRGBTOKENSEPSTR=",";a.FVLINESEPTOKEN="\u00a2";a.FVLINESEPTOKEN2="\\n";a.FVLINESEPTOKENCHAR="\u00a2";a.FVCOLSEPTOKEN="\u00a7";a.FVCOLSEPTOKEN2=
"\\t";a.FVCOLSEPTOKENCHAR="\u00a7";a.FVINDEXESSEPTOKEN="+";a.FVINDEXESSEPCHAR="+";a.FVMUTLILINESTRSEPTOKEN="\\l";a.PainterType_FileViewer=function(g){function b(b,c,d,e,f,g,j,k,n){b=b.createElementNS(a.SvgNs,"polygon");b.setAttributeNS(null,"points",d+","+e+" "+f+","+g+" "+j+","+k);b.setAttributeNS(null,"fill",n);return c.appendChild(b)}function f(a,c,d,e){var f="rgb(0, 0, 0)";d===!0?(F+1>q.getTotalNrOfRows()-2&&(f="rgb(162, 162, 162)"),b(a,c,e,e+q.h-A,A-e,e+q.h-A,A/2,q.h-e,f)):(F-1<0&&(f="rgb(162, 162, 162)"),
b(a,c,e,A-e,A-e,A-e,A/2,e,f))}function c(){var b=document.createElementNS(a.SvgNs,"svg");b!==null&&(a.setSvgAttrC(b,"x",q.x+q.w-A),a.setSvgAttrC(b,"y",q.y),a.setSvgAttrC(b,"width",A),a.setSvgAttrC(b,"height",q.h),A<0&&(A=0),q.h<0&&a.log_append_ln("that.h < 0"),b.setAttributeNS(null,"viewBox","0 0 "+A+" "+q.h),b.setAttributeNS(null,"version","1.1"),a.createSVGRect(document,b,0,0,A,q.h,"rgb(255,255,255)","rgb(0,0,0)",1),a.createSVGRect(document,b,0,0,A,A,"rgb(192,192,192)","rgb(0,0,0)",1),a.createSVGRect(document,
b,0,q.h-A,A,A,"rgb(192,192,192)","rgb(0,0,0)",1),f(document,b,!1,4),f(document,b,!0,4),q.getMainGroupElement().appendChild(b));return b}function d(b){var c=null,d=c=null,c=b.substring(5);c!==null&&(c=c.split(","),c.length>2&&(c[2]=c[2].substr(0,c[2].length-1)),c.length>0&&isNaN(c[0])===!0&&(c[0]=0,a.log_append_ln("invalid #sbc;/#scf color syntax (column 1)")),c.length>1&&isNaN(c[1])===!0&&(c[1]=0,a.log_append_ln("invalid #sbc;/#scf color syntax (column 2)")),c.length>0&&isNaN(c[0])===!0&&(c[2]=0,
a.log_append_ln("invalid #sbc;/#scf color syntax (column 3)")),d=c);return d}function e(b){var c=null;a.prefixicmp(a.FVCOLUMNBACKGROUNDCOLORSPECSTARTSTR,b)===!0&&(c=d(b));return c}function n(b){var c=null;a.prefixicmp(a.FVCOLUMNFOREGROUNDCOLORSPECSTARTSTR,b)===!0&&(c=d(b));return c}function r(){for(var a=0,b=0,c=100,d=q.w-q.getScrollerWidth(),a=0;a0&&z>=a*c+d&&z<=a*c+(c-1)+d&&z!=-1&&(b=!0);return b}function u(b,c,d,f){var g=null,h=null,p="",r="",u=null,g=0,t="",v=k(),c=function(c,d,e,f){var g=[],j=0,k="";if(!(d[c].w<=0)){var n=Math.floor(d[c].w-q.getOutlineWidth()*2),o=0;f==!0&&d[c].w>0&&(f=document.createElementNS(a.SvgNs,"rect"),f.setAttributeNS(null,"x",d[c].x),f.setAttributeNS(null,"y",s()*e),f.setAttributeNS(null,"height",v*s()),f.setAttributeNS(null,"width",Math.floor(d[c].w)),
f.setAttributeNS(null,"fill","rgb(0,0,0)"),m.appendChild(f));if(typeof(t=x[b][c])==="undefined"||t==void 0||t==null)t="";g=v>1?t.split(" "):t.split("");for(j=0;j1?k+" "+g[j]:k+g[j],u.getComputedTextLength()1?" "+g[j]:g[j];
else if(u.textContent=k,o0&&o2&&a.log_append_ln("hmi-fileviewer isSelected: "+f)):(r=h!==null&&h.length===3?"rgb("+h[0]+","+h[1]+","+h[2]+")":"rgb("+q.getInteriorColor()+")",q.checkIfInterior()===!0&&h!==null&&h.length===3&&j(f,r),p=g!==null&&g.length===3?String(g[0])+","+g[1]+","+g[2]:q.getTextColor());if(y===0)t=x[b]===void 0?"":x[b],u=a.createSVGTextExt(document,m,3,s()*(f+1)-3,
p,"start",q.getFontName(),q.getFontSize(),x[b],q.getSvgFontStyle(),q.getSvgFontWeight()),aClmnArray[aColumn].p<100&&u!==null&&u.setAttribute("clip-path","url(#"+aClmnArray[aColumn].clipId+")");else for(g=0;g=
this.x+(this.w-this.getScrollerWidth())?this.execScrollerAction():this.executeActionMouseDown&&this.executeActionMouseDown(),c.actionExecutedFlag=!0}d=0}break;case a.MOUSE_UP:c.consumedFlag===!0&&(a.OB_checkMouseCoordinates(this,a.g_MouseDownEventInfo)===!0?this.instanceDisabled()===!1?a.g_MouseDownEventInfo.x=2&&a.log_append_ln("hmi-fileviewer Disabled while down case"):a.getDebugLevel()>=
2&&a.log_append_ln("hmi-fileviewer Undo case"),this.scheduleFullRedrawPainter());break;case a.ENTER:d=0;break;case a.ESCAPE:this.editModeFlag&&(this.leaveEditMode(!1),d=1);break;case a.REMOVE_SELECTION:this.editModeFlag&&(this.leaveEditMode(!0),d=1)}return d};this.resetScrollIndex=function(){F=0};this.execScrollerAction=function(){this.scheduleFullRedrawPainter();if(a.g_MouseDownEventInfo.y-this.y>this.h/2){var b=F;b++;b>q.getTotalNrOfRows()-2&&(b=q.getTotalNrOfRows()-2)}else b=F,b--,b<0&&(b=0);F=
b};this.getTableCell=function(a,b){return x[a][b]};this.showFile=function(b,d){var e=null,f=e=1,g=this.getReloadFilePeriode();if(!(b===void 0||d===void 0||b===null||d===null)){if(g!=null&&g.value!=null&&!isNaN(g.value))f=g.value;f<0?this.lastListFilesloadIndex>=0&&(e=0):f>1&&a.SpecialCO.autoincr.value%f!==0&&(e=0);f="INDEX";if(b===a.INFO_T_CONTAINER&&a.prefixicmp("@MACROALRDEFONAlarmsList.",d)===!0){if(q.alarmObj===null)f=d.substring(25),q.alarmObj=new a.AlarmDefOnlineType(f,q.getNrOfRowDisplayed(),
q);q.alarmObj.update()}else if(b===a.INFO_T_CONTAINER&&a.prefixicmp("@MACROALRHISONAlarmsList.",d)===!0){if(q.alarmObj===null)f=d.substring(25),q.alarmObj=new a.AlarmHisOnlineType(f,q.getNrOfRowDisplayed(),q);q.alarmObj.update()}else if(b===a.INFO_T_CONTAINER&&a.prefixicmp("@MACROALRHISOFFAlarmsList.",d)===!0){if(q.alarmObj===null)f=d.substring(26),q.alarmObj=new a.AlarmHisOfflineType(f,q.getNrOfRowDisplayed(),q);q.alarmObj.update()}if(b!==a.INFO_T_FILE||e===1){if(e=a.RW_readSource(b,d),b===a.INFO_T_FILE)this.lastListFilesloadContent=
e,this.lastListFilesloadIndex=a.SpecialCO.autoincr.value}else e=this.lastListFilesloadContent;if(this.isFullPainterRedrawRequired()||e!=N)if(N=e,e.length>0){if(m!==null&&m.parentNode.removeChild(m),t!==null&&t.parentNode.removeChild(t),m=p(),m!==null){var f=e,e=0,e={hasColLayout:!1,containsColumns:!1,autowrap:!1,height:0,width:0,fontFamily:"Arial",fontSize:10,innerSVGElmnt:null,svgFontStyle:null,svgFontWeight:null},j=g=0,n=0;e.width=q.w-(q.getScrollerWidth()+q.getOutlineWidth()*2);e.height=q.h-q.getOutlineWidth()*
2;e.fontSize=q.getFontSize();e.fontFamily=q.getFontName();e.innerSVGElmnt=m;e.autowrap=q.getIsAutoAjust();e.svgFontStyle=q.getSvgFontStyle();e.svgFontWeight=q.getSvgFontWeight();x=L(f,e);w=x.length;C=[];if(x[0]!==void 0){if(e.hasColLayout===!0){y=x[0].length;f=0;g=null;for(f=0;f0){y=e.maxCol;var e=0,f=null,g=1,j=0,n=q.w-q.getScrollerWidth(),o=parseInt(n,10);y!=0&&(g=parseInt(100/y,10),o=parseInt(n/y,10));for(e=0;e0)for(e=e=0;eq.getNrOfRowDisplayed()&&(e=q.getNrOfRowDisplayed());n=B+F;for(j=
0,g=n;g-n1&&J===!0)for(e=0;e1&&M===!0&&q.getTotalNrOfRows()>1)for(e=0;eg&&(m=-1)):m=-1):d!=0?(m=c/d-c/d%1,m+=F*h,m>g*h&&(m=-1)):m=-1;g=m;q.changeSelection(g);b:{c=
a.g_MouseDownEventInfo.x-q.x;if(!(C.length<=0))for(d=0;d<=C.length;d++)if(!(C[d].w<=0)&&c>C[d].x&&c0)){o=x[b][0];for(g=1;g0&&c.value!="0"&&(c=parseInt(c.value,10),isNaN(c)===!1&&c>0&&(b=Math.trunc(b/c)))}return b};this.getTotalNrOfRows=function(){return w};this.geNrOfColumns=function(){return y};this.showVScrollerM=function(b){this.useVScrollerM=b;A=a.DEFAULT_SCROLLER_WIDTH};this.showVScrollerT=function(b){this.useVScrollerT=b;A=a.DEFAULT_SCROLLER_WIDTH_TOUCH};this.getScrollerWidth=function(){return A}};a.PainterType_FileViewer.prototype=new a.PainterType_MPainter;return a}(_SCIntern||
{});_SCIntern=function(a){function h(a){a=a.replace("e","E");return a.indexOf("E")!==-1?!0:!1}a.TrendValueType=function(){this.t_s=this.y=0};a.TREND_LABEL_WIDTH=36;a.TREND_LABEL_HEIGHT=26;a.trendBaseInitSvgHandlesIfRequired=function(){if(this.TrendControl_eGroup===null)this.TrendControl_eGroup=this.getRepaintElement("sc_obj_trend_control_"+this.objId+"_group");if(this.TrendCurves_eGroup===null)this.TrendCurves_eGroup=this.getRepaintElement("trend_"+this.objId+"_curves_group");if(this.TrendCurves_eSvg===
null)this.TrendCurves_eSvg=this.getRepaintElement("trend_"+this.objId+"_curves_svg");if(this.TrendControl_eSvg===null)this.TrendControl_eSvg=this.getRepaintElement("trend_"+this.objId+"_control_svg");this.TrendControl_eGroup===null&&a.err_append_ln("ERROR: Failed to create Online Trend's TrendControl_eGroup!");this.TrendControl_eSvg===null&&a.err_append_ln("ERROR: Failed to create Online Trend's TrendControl_eSvg!");this.TrendCurves_eGroup===null&&a.err_append_ln("ERROR: Failed to create Online Trend's TrendCurves_eGroup!")};
a.trendBaseRectangle=function(){var g=0,b=0,f="",c="",d=0,e=0;this.checkIfInterior()===!0&&(g=1);this.checkIfOutline()===!0&&(b=1);this.getOutlineWidth();f="rgba("+this.getInteriorColor()+","+g+")";c="rgba("+this.getOutlineColor()+","+b+")";d=this.checkIfOutline()===!0?this.getOutlineWidth():this.getInnerFill()===!0?this.getOutlineWidth():0;e=this.getOutlineStyle();if(this.frmElmnt!==null)a.removeSVG(this.frmElmnt),this.frmElmnt=null;switch(e){case a.SOLID:this.frmElmnt=a.createSVGRect(this.svgDoc,
this.getRepaintElement(this.frmGroup),this.x,this.y,this.w,this.h,f,c,d);break;case a.DASHED:case a.DOTTED:this.frmElmnt=a.createSVGRectDashed(this.svgDoc,this.getRepaintElement(this.frmGroup),this.x,this.y,this.w,this.h,f,c,d,this.getInnerFill(),e);break;default:a.log_append_ln("ERROR sc.trendBaseRectangle Unknown outline style")}};a.trendBaseParseActiveTrends=function(){var g=0,g=0,b=null,f=null,c=null,d=0,e=!1,g=f=0,f=a.ReadContainer(this.macroPrefix+"ActiveTrends."+this.trendIndex);if(a.stringcmp(this.activePrevious,
f)===!1){e=!0;for(g=0;g0)this.FileViewerColumns=b[0];if(b.length>1){for(g=1;g=5){var n=this.getActiveTrendCurve(c[1]),n=this.updateActiveList(n,c);d++;if(n!==null&&n!==void 0)n.activeFlag=!0}d=this.trendCurveListActive.length;for(g=1;g=5)if(c=
this.getActiveTrendCurveIndex(c[1]),c!=null)if(n0&&(b+=a.TREND_LABEL_WIDTH);e0&&(e=1+this.relPosSvg.rX+this.relPosSvg.rW+(b-1)*a.TREND_LABEL_WIDTH);c=k;d=0;n=String(f);r=[];r=n.split("e");r.length>0&&(n=
r[0]);r=n.split(".");if(r.length>1&&r[1])d=r[1].length;c.numDec=d;c=this.trendCurveListActive[b].yMax;k.isExponential=h(this.trendCurveListActive[b].yMin)||h(c)?!0:!1;for(c=0;c<11;c++)d=this.trendCurveListActive[b].yMax-f*c,k.isExponential===!0?(d=d.toExponential(k.numDec),d=d.replace("e","E"),d=d.replace("+","")):d=d.toFixed(k.numDec),n=a.TREND_LABEL_HEIGHT/2-this.getFontSize()/2+this.getFontSize()+j*c,r=this.trendCurveListActive[b].colorRGB,a.createSVGTextExt(document,this.trendCurveListActive[b].label_e,
e,n,r,"start",this.getFontName(),this.getFontSize(),d,this.getSvgFontStyle(),this.getSvgFontWeight())}};a.trendBaseDrawGrid=function(g){var b=null,f=0;this.gridYSpacing=this.relPosSvg.rH/10;this.gridXSpacing=this.relPosSvg.rW/10;this.eGrpGrid!==null&&a.removeSVG(this.eGrpGrid);this.eGrpGrid=null;if(g===!0&&this.eGrpGrid===null)if(this.eGrpGrid=document.createElementNS(a.SvgNs,"g"),this.eGrpGrid!==null){this.eGrpGrid.setAttribute("visibility","visible");this.TrendControl_eSvg.appendChild(this.eGrpGrid);
this.eGrpGrid.setAttributeNS(null,"id","grid_"+this.trendIndex);for(f=0;f<=10;f++)b=a.createSVGSimpleRect(document,this.relPosSvg.rX,this.relPosSvg.rY+this.gridYSpacing*f,this.relPosSvg.rW,1,"rgb("+this.getOutlineColor()+")"),this.eGrpGrid.appendChild(b);for(f=0;f<=10;f++)b=a.createSVGSimpleRect(document,this.relPosSvg.rX+this.gridXSpacing*f,this.relPosSvg.rY,1,this.relPosSvg.rH,"rgb("+this.getOutlineColor()+")"),this.eGrpGrid.appendChild(b)}else a.log_append_ln("ERROR drawGrid(), this.eGrpGrid === null");
else g===!0&&this.eGrpGrid!==null?this.eGrpGrid.setAttributeNS(null,"visibility",""):g===!1&&this.eGrpGrid!==null&&this.eGrpGrid.setAttributeNS(null,"visibility","hidden")};a.trendBaseDrawAllActiveCurves=function(){var g=0,b=0,f=0,c=this.trendCurveListActive.length,d=null,e="M 0 0",d=null,n=0,h=!1;if(this.emitter.stopLog===!1)for(g=0;g=2&&a.log_append_ln("this.config.FirstAutoSrollDraw: "+this.config.FirstAutoSrollDraw),h=!0,this.config.FirstAutoSrollDraw=!1;for(b=0;bthis.xMaxTime_s&&(this.config.xAutoScroll===!0&&b===f-1||h===!0)){var j=d.t_s-this.xMaxTime_s;this.setXTimeRange(this.xMinTime_s+
j,this.xMaxTime_s+j)}}d=this.computePointsInRange(this.trendCurveListActive[g].yMax,this.trendCurveListActive[g].yMin,this.trendCurveListActive[g].yProportionalityFactor,d.t_s,d.y);d.xPx<=this.relPosSvg.rX+this.relPosSvg.rW&&d.yPx<=this.relPosSvg.rY+this.relPosSvg.rH&&this.relPosSvg.rX<=d.xPx&&this.relPosSvg.rY<=d.yPx&&(n===0&&(e="M"+d.xPx+" "+d.yPx+" "),e+="L"+d.xPx+" "+d.yPx+" ",n++)}n===0&&(e="M0 0 ",e+="L0 0 ")}this.trendCurveListActive[g].activeFlag===!1?this.remove_ePath(g):(this.trendCurveListActive[g].curve_ePath===
null&&this.initialise_ePath(g),this.trendCurveListActive[g].curve_ePath!==null&&(this.trendCurveListActive[g].curve_ePath.setAttributeNS(null,"stroke","rgb("+this.trendCurveListActive[g].colorRGB+")"),this.trendCurveListActive[g].curve_ePath.setAttributeNS(null,"stroke-width",this.getOutlineWidth()),this.trendCurveListActive[g].curve_ePath.setAttributeNS(null,"fill","none")),this.trendCurveListActive[g].curve_ePath!==null&&this.trendCurveListActive[g].curve_ePath.setAttributeNS(null,"d",e))}};a.trendBaseUpdateScrollAction=
function(){var a=0,b=this.config.scroll;Math.abs(b)>0&&Math.abs(b)<=100&&this.displayedTime_s>0&&(a=this.displayedTime_s<1E4?this.displayedTime_s*b/100:this.displayedTime_s/100*b,a===0&&(a=b>0?1:-1),this.xMaxTime_s+a<0?a-=this.xMaxTime_s:this.xMaxTime_s+a>2147483647&&(a=2147483647-this.xMaxTime_s),a!==0&&this.setXTimeRange(this.xMinTime_s+a,this.xMaxTime_s+a));this.config.scroll=0};a.trendBaseUpdateZoomAction=function(){var g=0,g=0,g=this.config.zoom;if(Math.abs(g)>0&&Math.abs(g)<=100)this.displayedTime_s>
0&&(g=this.displayedTime_s<1E4?this.displayedTime_s*g/200:this.displayedTime_s/200*g,g>0?this.displayedTime_s-2*g<10&&(a.MAX(0,(this.displayedTime_s-10)/2),g=2147483647-this.displayedTime_s,g/=2,g=a.MIN(0,-g)):g<0&&this.displayedTime>=2147483647+2*g&&(g=2147483647-this.displayedTime_s,g/=2,g=a.MIN(0,-g)),g!==0&&(this.xMinTime_s+g<0?this.setXTimeRange(this.xMaxTime_s-g):this.xMaxTime_s-g>2147483647?this.setXTimeRange(this.xMinTime_s+g,2147483647):this.setXTimeRange(this.xMinTime_s+g,this.xMaxTime_s-
g))),this.config.zoom=0};a.trendBaseSetXTimeRange=function(a,b){if(b>a){this.xMinTime_s=a;this.xMaxTime_s=b;this.displayedTime_s=this.xMaxTime_s-this.xMinTime_s;this.xRange=this.xMaxTime_s-this.xMinTime_s;if(this.xRange!==0)this.xProportionalityFactor=this.relPosSvg.rW/this.xRange;if(this.xProportionalityFactor!=0)this.xPxRate=1/this.xProportionalityFactor;this.xStep_s=this.xRange/10;this.updateXTimeLabels()}};a.trendBaseUpdateYProp_AllCurves=function(){for(var a=0,a=0;aa?0:d>=0?a-d:n+b-d)*f);e.yPx+=this.relPosSvg.rY;
e.xPx+=this.relPosSvg.rX;return e};a.trendBaseClear=function(){var g=0;this.clearActiveCurveRingBuffersOffline();for(var b=this.trendCurveListActive.length,g=0;g0){f=this.trendCurveListActive[g].valuesCBuffer.level;for(e=0;eb)break;d=c}a.getDebugLevel()>=2&&(a.log_append_ln("Trend get mouse click value point for click ts["+
b+"]= "+a.getAlarmDateTimeByIntMSec(1E3*b)+" "+a.FVLINESEPTOKEN2),d!==null&&a.log_append_ln("Trend get mouse click value point found nearestPoint ts["+d.t_s+"]= "+a.getAlarmDateTimeByIntMSec(1E3*d.t_s)+" "+a.FVLINESEPTOKEN2))}return d};a.trendBaseGetRgb=function(a){return this.trendCurveListActive[a].colorRGB};a.trendBaseGetFViewerClicked=function(){var g="",b=0,f=null,b=this.mouseDownHeader.split(a.FVLINESEPTOKEN2),c=this.trendCurveListActive.length;b.length>0&&(g+=b[0]);g+=a.FVLINESEPTOKEN2;g+=
a.FVCOLUMNFOREGROUNDCOLORSPECSTARTSTR+"0,204,0#\\t";if(this.sClicked>=0){g+=this.ptId===a.JS_PT_ONLINE_TREND?a.getAlarmDateTimeByIntMSecUTC(1E3*this.sClicked):a.getAlarmDateTimeByIntMSec(1E3*this.sClicked);g+=a.FVCOLSEPTOKEN2;g+="USER !";g+=a.FVLINESEPTOKEN2;for(b=0;b4)g.PPOName=b[1],g.yMin=b[2],g.yMax=b[3],g.colorRGB=b[4];f=this.emitter.getAvailableCurve(g.PPOName)}else if(this.ptId===a.JS_PT_OFFLINE_TREND){if(g===null)g=new a.TrendOfflineCurveType,g.curveNr="0",
g.colorRGB="0,0,0",g.yMin=0,g.yMax=0,g.firstPoint=0,g.lastPoint=0,g.beginDate="1970.01.01",g.beginTime="00:00:00 AM",g.endDate="1970.01.01",g.endTime="00:00:00 AM",this.trendCurveListActive.push(g);if(g!==null&&b!==null&&b.length>10)g.curveNr=b[1],g.yMin=b[2],g.yMax=b[3],g.colorRGB=b[4],g.firstPoint=b[5],g.lastPoint=b[6],g.beginDate=b[7],g.beginTime=b[8],g.endDate=b[9],g.endTime=b[10];f=this.emitter.getAvailableCurve(g.curveNr)}else if(this.ptId===a.JS_PT_SAVED_TREND){if(g===null)g=new a.TrendSavedCurveType,
g.curveNr="0",g.colorRGB="0,0,0",g.yMin=0,g.yMax=0,g.firstPoint=0,g.lastPoint=0,g.beginDate="1970.01.01",g.beginTime="00:00:00 AM",g.endDate="1970.01.01",g.endTime="00:00:00 AM",this.trendCurveListActive.push(g);if(g!==null&&b!==null&&b.length>4)g.curveNr=b[1],g.yMin=b[2],g.yMax=b[3],g.colorRGB=b[4];f=this.emitter.getAvailableCurve(g.curveNr)}if(f!==null&&g!==null)g.valuesCBuffer=f.valuesCBuffer;if(g!==null)g.activeFlag=!0;return g};a.trendBaseDrawVerticalClicked=function(){if(a.stringcmp(this.mouseDownAction,
"DISABLE")===!1&&this.sClicked>=0)this.eClicked!==null&&a.removeSVG(this.eClicked),this.xClicked=(this.sClicked-this.xMinTime_s)*this.xProportionalityFactor+this.relPosSvg.rX,this.eClicked=a.createSVGSimpleRect(document,this.xClicked,0,this.getOutlineWidth(),this.h,"rgb(0, 204, 0)"),this.TrendCurves_eGroup!==null&&this.TrendCurves_eGroup.appendChild(this.eClicked)};a.trendBaseMouseDownActionFunc=function(){a.stringcmp(this.mouseDownAction,"DISABLE")===!1&&this.xProportionalityFactor!=0?(this.sClicked=
Math.round((a.g_MouseDownEventInfo.x-this.x-this.relPosSvg.rX)/this.xProportionalityFactor),this.sClicked+=this.xMinTime_s):this.sClicked=-1};a.trendBaseNotify=function(g,b){var f=0;switch(g){case a.DRAW_OBJECT:this.instanceDraw&&this.instanceDraw();break;case a.MOUSE_DOWN:a.OB_checkMouseCoordinates(this,b)===!0?(this.trendMouseDown(),f=1):f=0;break;case a.MOUSE_UP:a.OB_checkMouseCoordinates(this,a.g_MouseDownEventInfo)===!0?(f=1,this.isPressed=!1):f=0}return f};a.trendBaseUpdateXTimeLabels=function(){var g=
0,b="04.03.2013",b=0,f=this.macroPrefix,c=!0,d=new Date(0);if(d){c=this.ptId===a.JS_PT_ONLINE_TREND?!1:!a.SpecialCO.mbTmzEn.value;f=this.macroPrefix;d=new Date(0);d.setUTCSeconds(this.xMinTime_s);b=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.dateLocalNow.name,c,d,null,!0);a.RW_writeSource(a.INFO_T_CONTAINER,f+"XMinDate."+this.trendIndex,b);d=new Date(0);d.setUTCSeconds(this.xMaxTime_s);b=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.dateLocalNow.name,c,d,null,!0);a.RW_writeSource(a.INFO_T_CONTAINER,
f+"XMaxDate."+this.trendIndex,b);d=new Date(0);d.setUTCSeconds(this.xMinTime_s);b=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,c,d,null,!0);a.RW_writeSource(a.INFO_T_CONTAINER,f+"XMinTime."+this.trendIndex,b);d=new Date(0);d.setUTCSeconds(this.xMaxTime_s);b=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,c,d,null,!0);a.RW_writeSource(a.INFO_T_CONTAINER,f+"XMaxTime."+this.trendIndex,b);this.ptId===a.JS_PT_ONLINE_TREND&&(f="@MACROONT");for(g=0;g<10;g++)b=
g*(this.xMaxTime_s-this.xMinTime_s)/10,d=new Date(0),d.setUTCSeconds(this.xMinTime_s+b),b=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.dateLocalNow.name,c,d,null,!0),a.RW_writeSource(a.INFO_T_CONTAINER,f+"XDate["+g+"]."+this.trendIndex,b);for(g=0;g<10;g++)b=g*(this.xMaxTime_s-this.xMinTime_s)/10,d=new Date(0),d.setUTCSeconds(this.xMinTime_s+b),b=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,c,d,null,!0),a.RW_writeSource(a.INFO_T_CONTAINER,f+"XTime["+g+"]."+this.trendIndex,
b)}};return a}(_SCIntern||{});_SCIntern=function(a){a.OnlineTrendEmitterType=function(h){this.trendIndex=h;this.lastLogged_s=0;this.trendCurveListAvailable=[];this.stopLog=!1;this.getAvailableCurve=function(a){for(var b=0,f=this.trendCurveListAvailable.length,b=0;b=2&&a.log_append_ln("this.config.FirstAutoSrollDraw: "+this.config.FirstAutoSrollDraw),a.WriteContainer("@MACROXAutoUpdate."+this.trendIndex,"1");b=="SETAUTO"||b=="1"?this.config.xAutoScroll=!0:b.length===0?this.config.xAutoScroll=!0:(this.config.xAutoScroll=!1,b=
0,b=a.ReadContainer("@MACROXMinTime."+this.trendIndex),b=a.ReadContainer("@MACROXMinDate."+this.trendIndex)+" "+b,b=parseInt(a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,!1,null,b,!0),10),isNaN(b)===!1&&this.setXTimeRange(b,b+this.displayedTime_s));this.config.AutoyAxisLegend=parseInt(a.ReadContainer(this.macroPrefix+"AutoYAxeDescr."+this.trendIndex),10);this.config.action=a.ReadContainer("@MACROAvailableTrendsAction."+this.trendIndex);if(this.config.action=="CLEARNSTOPLOGS")this.emitter.stopLog=
!0,this.clear(),this.config.action="LOGSWAITING";else if(this.config.action=="STARTLOGGING")this.timeWindowInitialised=!1,this.emitter.stopLog=!1,this.config.action="0";else if(this.config.action=="SAVELOGSTOFILE")a.err_append_ln(a.SaveFileError),this.config.action="0";else if(this.config.action=="CLEARLOGS")this.clear(),this.config.action="0";a.WriteContainer("@MACROAvailableTrendsAction."+this.trendIndex,this.config.action);this.config.scroll=a.ReadContainer("@MACROScroll."+this.trendIndex);this.updateScrollAction();
a.WriteContainer("@MACROScroll."+this.trendIndex,this.config.scroll);this.config.zoom=parseInt(a.ReadContainer("@MACROZoom."+this.trendIndex),10);isNaN(this.config.zoom)?this.config.zoom=0:this.updateZoomAction();a.WriteContainer("@MACROZoom."+this.trendIndex,this.config.zoom);this.config.trendArrayUpdate=a.ReadContainer("@MACROActiveTrends[][]Update."+this.trendIndex);if(this.config.trendArrayUpdate=="UPDATE")this.readActiveTrendsContainerArray(),this.config.trendArrayUpdate="0",a.WriteContainer("@MACROActiveTrends[][]Update."+
this.trendIndex,this.config.trendArrayUpdate)};this.writeActiveTrendsContainerArray=function(){for(var b=0,f=this.trendCurveListActive.length,b=1;b<=f;b++)a.WriteContainer("@MACROActiveTrends["+b+"][0]."+this.trendIndex,this.trendCurveListActive[b-1].colorRGB),a.WriteContainer("@MACROActiveTrends["+b+"][1]."+this.trendIndex,this.trendCurveListActive[b-1].PPOName),a.WriteContainer("@MACROActiveTrends["+b+"][2]."+this.trendIndex,this.trendCurveListActive[b-1].yMin),a.WriteContainer("@MACROActiveTrends["+
b+"][3]."+this.trendIndex,this.trendCurveListActive[b-1].yMax),a.WriteContainer("@MACROActiveTrends["+b+"][4]."+this.trendIndex,this.trendCurveListActive[b-1].colorRGB)};this.readActiveTrendsContainerArray=function(){for(var b=0,f=this.trendCurveListActive.length,b=1;b<=f;b++)this.trendCurveListActive[b-1].colorRGB=a.ReadContainer("@MACROActiveTrends["+b+"][0]."+this.trendIndex),this.trendCurveListActive[b-1].curveNr=a.ReadContainer("@MACROActiveTrends["+b+"][1]."+this.trendIndex),this.trendCurveListActive[b-
1].yMin=a.ReadContainer("@MACROActiveTrends["+b+"][2]."+this.trendIndex),this.trendCurveListActive[b-1].yMax=a.ReadContainer("@MACROActiveTrends["+b+"][3]."+this.trendIndex),this.trendCurveListActive[b-1].colorRGB=a.ReadContainer("@MACROActiveTrends["+b+"][4]."+this.trendIndex)};this.calculateMaxPoints=function(){var b=(a.getRefreshPeriod()+999)/1E3,b=a.toFixedNotRound(b,0);b===0&&(b=1);this.maxPoints=1+this.config.storedTime_s/b;a.getDebugLevel()>=2&&(a.log_append_ln("OT getRefreshPeriod: "+a.getRefreshPeriod()),
a.log_append_ln("OT storedTime_s: "+this.config.storedTime_s),a.log_append_ln("OT Max Points: "+this.maxPoints))};this.parseAvailableTrends=function(){var b=0,f=null,c=b=null,b=a.ReadContainer("@MACROAvailableTrends."+this.trendIndex),f=b.split(a.FVLINESEPTOKEN2);if(f.length>1)for(b=0;b3&&(d.PPOName=c[0],e=this.emitter.getAvailableCurve(d.PPOName),e===null))a.registerHMI_PPO(d.PPOName),
d.yMin=c[1],d.yMax=c[2],d.colorRGB=c[3],d.valuesCBuffer=new a.CircularBuffer(this.maxPoints),this.emitter.trendCurveListAvailable.push(d)}}};a.PainterType_OnlineTrend.prototype=new a.PainterType_MPainter;return a}(_SCIntern||{});_SCIntern=function(a){a.OfflineTrendEmitterType=function(a){this.trendIndex=a||0;this.lastLogged_s=0;this.trendCurveListAvailable=[];this.stopLog=!1;this.getAvailableCurve=function(a){for(var b=0,f=this.trendCurveListAvailable.length,b=0;b=2&&a.log_append_ln("LOADINFONSTARTDATA/activePts: "+b),a.WriteContainer("@MACROOFTActiveTrendsTotalSamples."+this.trendIndex,b),this.loadActiveCurveData(),this.config.action="0";a.WriteContainer("@MACROOFTActiveTrendsLoadInfos."+this.trendIndex,this.config.action);this.clearBusyFlag();this.config.trendArrayUpdate=a.ReadContainer("@MACROOFTActiveTrends[][]Update."+this.trendIndex);
if(this.config.trendArrayUpdate=="UPDATE")this.readActiveTrendsContainerArray(),this.config.trendArrayUpdate="0",a.WriteContainer("@MACROOFTActiveTrends[][]Update."+this.trendIndex,this.config.trendArrayUpdate)};this.clearBusyFlag=function(){a.WriteContainer("_TREND_BUSY","0")};this.parseAvailableTrends=function(){var b=0,c=null,f=b=null,b=a.ReadContainer("@MACROOFTAvailableTrendsColored."+this.trendIndex),c=b.split(a.FVLINESEPTOKEN2);if(c.length>1)for(b=0;b10&&(g.curveNr=f[1],j=this.emitter.getAvailableCurve(g.curveNr),j===null))g.curveNr=f[1],g.yMin=f[2],g.yMax=f[3],g.colorRGB=f[4],g.firstPoint=f[5],g.lastPoint=f[6],g.beginDate=f[7],g.beginTime=f[8],g.endDate=f[9],g.endTime=f[10],g.valuesCBuffer=new a.CircularBuffer(-1),this.emitter.trendCurveListAvailable.push(g)}};
this.writeActiveTrendsContainerArray=function(){for(var b=0,c=this.trendCurveListActive.length,b=1;b<=c;b++)a.WriteContainer("@MACROOFTActiveTrends["+b+"][0]."+this.trendIndex,this.trendCurveListActive[b-1].colorRGB),a.WriteContainer("@MACROOFTActiveTrends["+b+"][1]."+this.trendIndex,this.trendCurveListActive[b-1].curveNr),a.WriteContainer("@MACROOFTActiveTrends["+b+"][2]."+this.trendIndex,this.trendCurveListActive[b-1].yMin),a.WriteContainer("@MACROOFTActiveTrends["+b+"][3]."+this.trendIndex,this.trendCurveListActive[b-
1].yMax),a.WriteContainer("@MACROOFTActiveTrends["+b+"][4]."+this.trendIndex,this.trendCurveListActive[b-1].colorRGB),a.WriteContainer("@MACROOFTActiveTrends["+b+"][5]."+this.trendIndex,this.trendCurveListActive[b-1].firstPoint),a.WriteContainer("@MACROOFTActiveTrends["+b+"][6]."+this.trendIndex,this.trendCurveListActive[b-1].lastPoint),a.WriteContainer("@MACROOFTActiveTrends["+b+"][7]."+this.trendIndex,this.trendCurveListActive[b-1].beginDate),a.WriteContainer("@MACROOFTActiveTrends["+b+"][8]."+
this.trendIndex,this.trendCurveListActive[b-1].beginTime),a.WriteContainer("@MACROOFTActiveTrends["+b+"][9]."+this.trendIndex,this.trendCurveListActive[b-1].endDate),a.WriteContainer("@MACROOFTActiveTrends["+b+"][10]."+this.trendIndex,this.trendCurveListActive[b-1].endTime),a.WriteContainer("@MACROOFTActiveTrends["+b+"][11]."+this.trendIndex,this.trendCurveListActive[b-1].numPoints)};this.readActiveTrendsContainerArray=function(){for(var b=0,c=this.trendCurveListActive.length,b=1;b<=c;b++){this.trendCurveListActive[b-
1].colorRGB=a.ReadContainer("@MACROOFTActiveTrends["+b+"][0]."+this.trendIndex);this.trendCurveListActive[b-1].curveNr=a.ReadContainer("@MACROOFTActiveTrends["+b+"][1]."+this.trendIndex);this.trendCurveListActive[b-1].yMin=a.ReadContainer("@MACROOFTActiveTrends["+b+"][2]."+this.trendIndex);this.trendCurveListActive[b-1].yMax=a.ReadContainer("@MACROOFTActiveTrends["+b+"][3]."+this.trendIndex);this.trendCurveListActive[b-1].colorRGB=a.ReadContainer("@MACROOFTActiveTrends["+b+"][4]."+this.trendIndex);
this.trendCurveListActive[b-1].firstPoint=a.ReadContainer("@MACROOFTActiveTrends["+b+"][5]."+this.trendIndex);this.trendCurveListActive[b-1].lastPoint=a.ReadContainer("@MACROOFTActiveTrends["+b+"][6]."+this.trendIndex);this.trendCurveListActive[b-1].beginDate=a.ReadContainer("@MACROOFTActiveTrends["+b+"][7]."+this.trendIndex);this.trendCurveListActive[b-1].beginTime=a.ReadContainer("@MACROOFTActiveTrends["+b+"][8]."+this.trendIndex);this.trendCurveListActive[b-1].endDate=a.ReadContainer("@MACROOFTActiveTrends["+
b+"][9]."+this.trendIndex);this.trendCurveListActive[b-1].endTime=a.ReadContainer("@MACROOFTActiveTrends["+b+"][10]."+this.trendIndex);var f=this.trendCurveListActive[b-1].beginDate+" "+this.trendCurveListActive[b-1].beginTime;this.trendCurveListActive[b-1].beginTs_ms=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,!a.SpecialCO.mbTmzEn.value,null,f,!0);this.trendCurveListActive[b-1].beginTs_ms*=1E3;f=this.trendCurveListActive[b-1].endDate+" "+this.trendCurveListActive[b-1].endTime;
this.trendCurveListActive[b-1].endTs_ms=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,!a.SpecialCO.mbTmzEn.value,null,f,!0);this.trendCurveListActive[b-1].endTs_ms*=1E3}};this.loadTrendSrvConfig=function(){var b=a.loadGeneralCGI("trend"+a.getSrvExt()+"?trendsList=TrendsListName&action=config"),c=null,f=!1;b!==null?c=a.parseCGI_CSV_Content(b):a.log_append_ln("ERROR Offline Trend : Failed to load trend info from server!");if(c!==null&&c[0]!==null){if(c[0][0]!==null)this.config.version=
c[0][0];if(c[0][1]!==null)this.config.listName=c[0][1];if(c[0][2]!==null)this.config.maxBlockSize=c[0][2];c[0][3]!==null?(this.config.numCurves=a.atoi(this.config.numCurves),isNaN(this.config.numCurves)===!1?f=!0:(a.log_append_ln("ERROR Offline Trend : Failed to parse trend info from server (syntax error: Number of curves)!"),this.config.numCurves=0)):a.log_append_ln("ERROR Offline Trend : Failed to parse trend info from server (syntax error)!")}return f};this.loadCurveInfos=function(){for(var b=
0,c=this.trendCurveListActive.length,f="",f=0,f=null,g=0,j=0,k=0,o=0,b=0;bo)o=this.trendCurveListActive[b].endTs_ms}}}else a.log_append_ln("Offline Trend Error: Failed to load trend info from server!");k/=1E3;o/=1E3;this.setXTimeRange(k,o);return g};this.parseTrendData=function(b,c,f){var g=0,j=0,k=0,o=null,h=!1;c.cnt=0;c.newesTs_s=0;c.oldesTs_s=
0;c.doneFlag=!1;var p=c.endFlag=!1;if(b.length>0){if(c!==null){o=a.parseCGI_CSV_Content(b);for(g=0;o[g]!==null&&o[g]!==void 0&&c.endFlag!==!0&&c.doneFlag!==!0;)if(a.prefixicmp("End",o[g][0])===!1&&a.prefixicmp("Done",o[g][0])===!1){var b=new a.TrendValueType,s=parseInt(o[g][0],16);if(isNaN(s)===!1&&(b.t_s=s,s=parseFloat(o[g][1],10),isNaN(s)===!1)){b.y=s;this.trendCurveListActive[f].valuesCBuffer.add(b);if(k===0||k>b.t_s)k=b.t_s;if(j=2&&a.log_append_ln("End");else if(a.prefixicmp("Done",o[g][0])===!0)c.doneFlag=!0,a.getDebugLevel()>=2&&a.log_append_ln("Done")}else a.log_append_ln("EROOR parseTrendData byRef === null"),h=!0;c.cnt=g;c.newesTs_s=j;c.oldesTs_s=k}else a.log_append_ln("ERROR Offline Trend parseTrendData error: no data"),h=!0;h!==!0&&(p=!0);return p};this.loadTrendData=function(b,c,f,g,j){return a.loadGeneralCGI("trend"+a.getSrvExt()+"?trendNr="+b+"&action=loadTrend&loadType=0&startTimestamp="+
c+"&endTimestamp="+f+"&nbrOfPoints="+this.config.maxBlockSize+"&lastLoadedTimestamp="+g,j)};this.loadActiveCurveData=function(){for(var b=0,c=this.trendCurveListActive.length,f="",g=0,j=!1,k=0,o=0,h={cnt:0,oldesTs_s:0,newesTs_s:0,doneFlag:!1,endFlag:!1},p=0,s=0,q=0,m=0,f=f=f=0,q=a.ReadContainer("@MACROOFTLoadStartTimestampSet."+this.trendIndex),m=a.ReadContainer("@MACROOFTLoadEndTimestampSet."+this.trendIndex),b=0;b=2&&(a.log_append_ln(k),a.log_append_ln(o),a.log_append_ln("Diff.: "+
(o-k)/60));if(this.trendCurveListActive[b].valuesCBuffer===null)this.trendCurveListActive[b].valuesCBuffer=new a.CircularBuffer(-1);if(this.trendCurveListActive[b].numPoints!==0)for(;h.endFlag===!1&&j===!1;)if(f=this.loadTrendData(g,k.toString(16),o.toString(16),h.newesTs_s.toString(16)),f!==null){this.parseTrendData(f,h,b);a.getDebugLevel()>=2&&a.log_append_ln("byRef.cnt: "+h.cnt);if(h.oldesTs_s
s)s=h.newesTs_s}else j=!0,a.err_append_ln("ERROR Offline Trend : Failed to load trend data from server!")}this.setXTimeRange(p,
s);a.getDebugLevel()>=2&&(a.log_append_ln("loadActiveCurveData activeSize: "+c),a.log_append_ln("loadActiveCurveData cnt (total): "+h.cnt))}};a.PainterType_OfflineTrend.prototype=new a.PainterType_MPainter;return a}(_SCIntern||{});_SCIntern=function(a){a.SavedTrendEmitterType=function(a){this.trendIndex=a||0;this.lastLogged_s=0;this.trendCurveListAvailable=[];this.stopLog=!1;this.getAvailableCurve=function(a){for(var b=0,f=this.trendCurveListAvailable.length,b=0;b0&&(b=this.config.availableTrendsHeaderStr.split(a.FVLINESEPTOKEN2),b.length>0))this.config.availableTrendsHeaderStr=b[0],!a.StrEndWith(this.config.availableTrendsHeaderStr,a.FVLINESEPTOKEN)&&!a.StrEndWith(this.config.availableTrendsHeaderStr,a.FVLINESEPTOKEN2)&&(this.config.availableTrendsHeaderStr+=
a.FVLINESEPTOKEN2);if(this.config.activeTrendsHeaderStr.length<=0||!a.prefixicmp(a.FVLINESPECLINESTARTSTR,this.config.activeTrendsHeaderStr))this.config.activeTrendsHeaderStr="#sp;120,0,120,120,120,120,120"+a.FVLINESEPTOKEN2;if(this.config.availableTrendsHeaderStr.length<=0||!a.prefixicmp(a.FVLINESPECLINESTARTSTR,this.config.availableTrendsHeaderStr))this.config.activeTrendsHeaderStr="#sp;0,120,120,120,120"+a.FVLINESEPTOKEN2;this.config.loadDataState=a.ReadContainer(this.macroPrefix+"ActiveTrendsLoadDatas."+
this.trendIndex);if(this.config.loadDataState=="STARTLOADDATAS")this.config.loadIsRemote="",this.config.remoteFileName="",this.config.loadIsRemote=a.ReadContainer(this.macroPrefix+"ActiveTrendsLoadRemoteMode."+this.trendIndex),this.config.remoteFileName=a.ReadContainer(this.macroPrefix+"ActiveTrendsLoadRemoteFile."+this.trendIndex),this.config.loadIsRemote==="1"&&this.config.remoteFileName.length>0?(this.config.loadDataState="LOADINGDATAS",this.loadActiveCurvesDataNUpdateInfos(),this.config.loadDataState=
"0",this.clearBusyFlag()):a.err_append_ln(a.LoadFileError),action="0",a.WriteContainer(this.macroPrefix+"ActiveTrendsLoadDatas."+this.trendIndex,"0");this.mouseDownAction=a.ReadContainer(this.macroPrefix+"ActiveTrendsMouseDownAction."+this.trendIndex);this.valuePickerName=this.macroPrefix+"ActiveTrendsMouseDownVal."+this.trendIndex;this.mouseDownHeader=a.ReadContainer(this.macroPrefix+"ActiveTrendsMouseDownHeader."+this.trendIndex);this.config.gridFlag=parseInt(a.ReadContainer(this.macroPrefix+"ShowGrid."+
this.trendIndex),10);this.config.displayedTime_s=parseInt(a.ReadContainer(this.macroPrefix+"DisplayedTime."+this.trendIndex),10);this.config.storedTime_s=parseInt(a.ReadContainer(this.macroPrefix+"MaxStoreTime."+this.trendIndex),10);b=a.ReadContainer(this.macroPrefix+"XAutoUpdate."+this.trendIndex);b=="SETAUTO"&&a.WriteContainer(this.macroPrefix+"XAutoUpdate."+this.trendIndex,"1");b=="SETAUTO"||b=="1"?this.config.xAutoScroll=!0:b.length===0?this.config.xAutoScroll=!0:(this.config.xAutoScroll=!1,b=
0,b=a.ReadContainer(this.macroPrefix+"XMinTime."+this.trendIndex),b=a.ReadContainer(this.macroPrefix+"XMinDate."+this.trendIndex)+" "+b,b=parseInt(a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,!a.SpecialCO.mbTmzEn.value,null,b,!0),10),this.setXTimeRange(b,b+this.displayedTime_s));this.config.AutoyAxisLegend=parseInt(a.ReadContainer(this.macroPrefix+"AutoYAxeDescr."+this.trendIndex),10);this.config.action=a.ReadContainer(this.macroPrefix+"AvailableTrendsAction."+this.trendIndex);
if(this.config.action=="SAVELOGSTOFILE")a.err_append_ln(a.SaveFileError),this.config.action="0";else if(this.config.action=="CLEARLOGS")this.clear(),this.config.action="0";else if(this.config.action!=void 0&&this.config.action.length>0&&this.config.action!=="0")a.err_append_ln("offline Saved Trend Action ["+this.config.action+"] not supported in the HTML5 client !"),this.config.action="0";a.WriteContainer(this.macroPrefix+"AvailableTrendsAction."+this.trendIndex,this.config.action);this.config.scroll=
a.ReadContainer(this.macroPrefix+"Scroll."+this.trendIndex);this.updateScrollAction();a.WriteContainer(this.macroPrefix+"Scroll."+this.trendIndex,this.config.scroll);this.config.zoom=parseInt(a.ReadContainer(this.macroPrefix+"Zoom."+this.trendIndex),10);isNaN(this.config.zoom)?this.config.zoom=0:this.updateZoomAction();a.WriteContainer(this.macroPrefix+"Zoom."+this.trendIndex,this.config.zoom);this.config.trendArrayUpdate=a.ReadContainer(this.macroPrefix+"ActiveTrends[][]Update."+this.trendIndex);
if(this.config.trendArrayUpdate=="UPDATE")this.readActiveTrendsContainerArray(),this.config.trendArrayUpdate="0",a.WriteContainer(this.macroPrefix+"ActiveTrends[][]Update."+this.trendIndex,this.config.trendArrayUpdate)};this.loadActiveCurvesDataNUpdateInfos=function(){for(var b="",f=0,c=0,d=0,e=d=f=0,g=0,h=0,j="",k="",f=0;f0)){var o=this.trendCurveListActive[f].valuesCBuffer.get(0);
if(o!==null){if(h===0||h>o.t_s)h=o.t_s;if(go.t_s)h=o.t_s;if(g0){a.getDebugLevel()>=2&&a.log_append_ln("SavedTrend loadActiveCurvesDataNUpdateInfos for file "+this.config.remoteFileName);b=a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC?a.loadFileSource("plc?"+this.config.remoteFileName):a.loadFileSource(this.config.remoteFileName);
if(b!==null&&b.length>0&&b!==""){a.getDebugLevel()>=2&&a.log_append_ln("SavedTrend loadActiveCurvesDataNUpdateInfos for file "+this.config.remoteFileName+" returned "+b);for(var u=b.split("\n"),c=f=0;c0&&(d=parseInt(d[0],10),isNaN(d)===!1&&(e=d)));if(f==1&&e>0){if(e!=this.emitter.trendCurveListAvailable.length){if(this.emitter.trendCurveListAvailable.length>0)for(a.log_append_ln("while parsing header part of SavedTrend file "+
this.config.remoteFileName+" nbrOfCurves = "+e+" is defferent from this.trendCurveListAvailable.length [ "+this.emitter.trendCurveListAvailable.length+" ] so clear the trendCurveListAvailable current list and updates with file's one ");this.emitter.trendCurveListAvailable.length>0;)this.emitter.trendCurveListAvailable.pop();if(this.trendCurveListActive.length>0)for(a.log_append_ln("while parsing header part of SavedTrend file "+this.config.remoteFileName+" nbrOfCurves = "+e+" is defferent from this.trendCurveListAvailable.length [ "+
this.emitter.trendCurveListAvailable.length+" ] so clear the trendCurveListActive current list and updates with file's one ");this.trendCurveListActive.length>0;)this.trendCurveListActive.pop()}else{for(d=f=k=0;c+d0&&
(p=p[0].split("\t"),p.length>0&&(s=p[0],s.length>0?(q=this.emitter.trendCurveListAvailable[d],q===null||q.curveNr!==s?(a.log_append_ln("ERROR while parsing header part of SavedTrend file "+this.config.remoteFileName+" could not find the available curve from list for curveNrStr "+s+" at the right index "+d),f=1):k++):f=1))}if(k!=e){if(this.emitter.trendCurveListAvailable.length>0)for(a.log_append_ln("while parsing header part of SavedTrend file "+this.config.remoteFileName+" foundAvailableCurves = "+
k+" is different nbrOfCurves to find [ "+e+" ] so clear the trendCurveListAvailable current list and updates with file's one ");this.emitter.trendCurveListAvailable.length>0;)this.emitter.trendCurveListAvailable.pop();if(this.trendCurveListActive.length>0)for(a.log_append_ln("while parsing header part of SavedTrend file "+this.config.remoteFileName+" foundAvailableCurves = "+k+" is different nbrOfCurves to find [ "+e+" ] so clear the trendCurveListActive current list and updates with file's one ");this.trendCurveListActive.length>
0;)this.trendCurveListActive.pop()}}for(d=f=0;c+d0&&(p=p[0].split("\t"),p.length>3&&(s=p[0],k=p[1],o=p[2],m=p[3],s.length>0))){q=this.emitter.getAvailableCurve(s);if(q===null)q=new a.TrendSavedCurveType,q.curveNr=s,
q.yMin=0,q.yMax=0,q.colorRGB="0,0,0",q.firstPoint=0,q.lastPoint=0,q.beginDate="1970.01.01",q.beginTime="00:00:00 AM",q.endDate="1970.01.01",q.endTime="00:00:00 AM",q.valuesCBuffer=new a.CircularBuffer(-1),this.emitter.trendCurveListAvailable.push(q);q=this.emitter.getAvailableCurve(s);if(q!==null)q.curveNr=s,q.yMin=k,q.yMax=o,q.colorRGB=m}}k="";for(l=0;l0&&p.yMin.length>0&&p.yMax.length>
0&&p.colorRGB.length>0&&(k+=a.FVCOLUMNFOREGROUNDCOLORSPECSTARTSTR+p.colorRGB+a.FVCOLUMNCOLORSPECENDSTR+a.FVCOLSEPTOKEN2+p.curveNr+a.FVCOLSEPTOKEN2+p.yMin+a.FVCOLSEPTOKEN2+p.yMax+a.FVCOLSEPTOKEN2+p.colorRGB+a.FVLINESEPTOKEN2);a.WriteContainer(this.macroPrefix+"ActiveTrends."+this.trendIndex,this.config.activeTrendsHeaderStr+k);k="";for(this.parseActiveTrends();c+d=2&&a.log_append_ln("skips comment line while parsing curves points part of SavedTrend file "+
this.config.remoteFileName);else if(a.prefixicmp("End",u[c+d])===!1&&a.prefixicmp("Done",u[c+d])===!1&&u[c+d].length>0)if(p=u[c+d].split(";"),m=-1,p.length>3)if(m=parseInt(p[0],10),isNaN(m)===!1&&m>=0)for(f=0;f0&&(q=this.getActiveTrendCurve(s),q!==null&&q.valuesCBuffer.add(o));if(h===0||h>
o.t_s)h=o.t_s;if(g0&&p.yMin.length>0&&p.yMax.length>0&&p.colorRGB.length>0&&(j+=p.curveNr+a.FVCOLSEPTOKEN2+p.yMin+a.FVCOLSEPTOKEN2+p.yMax+a.FVCOLSEPTOKEN2+p.colorRGB+a.FVLINESEPTOKEN2,k+=a.FVCOLUMNFOREGROUNDCOLORSPECSTARTSTR+p.colorRGB+a.FVCOLUMNCOLORSPECENDSTR+a.FVCOLSEPTOKEN2+p.curveNr+a.FVCOLSEPTOKEN2+p.yMin+a.FVCOLSEPTOKEN2+p.yMax+a.FVCOLSEPTOKEN2+p.colorRGB+a.FVLINESEPTOKEN2);a.WriteContainer(this.macroPrefix+"AvailableTrends."+this.trendIndex,j);a.WriteContainer(this.macroPrefix+"AvailableTrendsHeadered."+
this.trendIndex,this.config.availableTrendsHeaderStr+j);a.WriteContainer(this.macroPrefix+"ActiveTrends."+this.trendIndex,this.config.activeTrendsHeaderStr+k)}this.setXTimeRange(h,g);a.getDebugLevel()>=2&&a.log_append_ln("SavedTrend loadActiveCurvesDataNUpdateInfos nbrOfCurves: "+e)};this.clearBusyFlag=function(){a.WriteContainer("_TREND_BUSY","0")};this.writeActiveTrendsContainerArray=function(){for(var b=0,f=this.trendCurveListActive.length,b=1;b<=f;b++)a.WriteContainer(this.macroPrefix+"ActiveTrends["+
b+"][0]."+this.trendIndex,this.trendCurveListActive[b-1].colorRGB),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][1]."+this.trendIndex,this.trendCurveListActive[b-1].curveNr),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][2]."+this.trendIndex,this.trendCurveListActive[b-1].yMin),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][3]."+this.trendIndex,this.trendCurveListActive[b-1].yMax),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][4]."+this.trendIndex,this.trendCurveListActive[b-
1].colorRGB),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][5]."+this.trendIndex,this.trendCurveListActive[b-1].firstPoint),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][6]."+this.trendIndex,this.trendCurveListActive[b-1].lastPoint),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][7]."+this.trendIndex,this.trendCurveListActive[b-1].beginDate),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][8]."+this.trendIndex,this.trendCurveListActive[b-1].beginTime),a.WriteContainer(this.macroPrefix+
"ActiveTrends["+b+"][9]."+this.trendIndex,this.trendCurveListActive[b-1].endDate),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][10]."+this.trendIndex,this.trendCurveListActive[b-1].endTime),a.WriteContainer(this.macroPrefix+"ActiveTrends["+b+"][11]."+this.trendIndex,this.trendCurveListActive[b-1].numPoints)};this.readActiveTrendsContainerArray=function(){for(var b=0,f=this.trendCurveListActive.length,c="",b=1;b<=f;b++){this.trendCurveListActive[b-1].colorRGB=a.ReadContainer(this.macroPrefix+
"ActiveTrends["+b+"][0]."+this.trendIndex);this.trendCurveListActive[b-1].curveNr=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][1]."+this.trendIndex);this.trendCurveListActive[b-1].yMin=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][2]."+this.trendIndex);this.trendCurveListActive[b-1].yMax=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][3]."+this.trendIndex);this.trendCurveListActive[b-1].colorRGB=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][4]."+this.trendIndex);this.trendCurveListActive[b-
1].firstPoint=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][5]."+this.trendIndex);this.trendCurveListActive[b-1].lastPoint=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][6]."+this.trendIndex);this.trendCurveListActive[b-1].beginDate=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][7]."+this.trendIndex);this.trendCurveListActive[b-1].beginTime=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][8]."+this.trendIndex);this.trendCurveListActive[b-1].endDate=a.ReadContainer(this.macroPrefix+
"ActiveTrends["+b+"][9]."+this.trendIndex);this.trendCurveListActive[b-1].endTime=a.ReadContainer(this.macroPrefix+"ActiveTrends["+b+"][10]."+this.trendIndex);var d=this.trendCurveListActive[b-1].beginDate+" "+this.trendCurveListActive[b-1].beginTime;this.trendCurveListActive[b-1].beginTs_ms=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,!a.SpecialCO.mbTmzEn.value,null,d,!0);this.trendCurveListActive[b-1].beginTs_ms*=1E3;d=this.trendCurveListActive[b-1].endDate+" "+this.trendCurveListActive[b-
1].endTime;this.trendCurveListActive[b-1].endTs_ms=a.DateTime_ReadDT(a.readDateTimeFormat(),a.SpecialCO.timeLocalNow.name,!a.SpecialCO.mbTmzEn.value,null,d,!0);this.trendCurveListActive[b-1].endTs_ms*=1E3;c+=a.FVCOLUMNFOREGROUNDCOLORSPECSTARTSTR+this.trendCurveListActive[b-1].colorRGB+a.FVCOLUMNCOLORSPECENDSTR+a.FVCOLSEPTOKEN2+this.trendCurveListActive[b-1].curveNr+a.FVCOLSEPTOKEN2+this.trendCurveListActive[b-1].yMin+a.FVCOLSEPTOKEN2+this.trendCurveListActive[b-1].yMax+a.FVCOLSEPTOKEN2+this.trendCurveListActive[b-
1].colorRGB+a.FVLINESEPTOKEN2}a.WriteContainer(this.macroPrefix+"ActiveTrends."+this.trendIndex,this.config.activeTrendsHeaderStr+c)}};a.PainterType_SavedTrend.prototype=new a.PainterType_MPainter;return a}(_SCIntern||{});_SCIntern=function(a){function h(a,b,c,d,e){var f=-1,g=-1;e.content="";b=a.indexOf(c,b);if(b==-1)return-1;f=b+c.length;if(f>=a.length)return-1;g=a.indexOf(d,f);if(g==-1)return-1;e.content=a.substring(f,g);g+=d.length;return g>=a.length?-1:g}function g(b){a.getDebugLevel()>=3&&(n=a.getTimestamp_ms(),r=n-e,a.log_append_ln("ILRStop: "+r));if(b!==a.PreviousILR||a.FullRedraw===!0){var c={content:""},d="",f=0,g="",d="";do if(f=h(b,f,"","",c),c.content!==""&&(d=c.content,h(d,0,"","",c),c.content!==
""))g=c.content,h(d,0,"","",c),d=c.content,a.sl_updatePPOList(g,d);while(f!==-1);a.scheduleRepaint();a.scheduleOnlineTrendRefresh()}a.ViewList.doViewGainIfRequired();a.PreviousILR=b;a.RefreshCGIPending=!1;a.Link.cgiFailConsecutive=0}function b(b){var d="cgi-bin/ILRReadValues"+a.getSrvExt();a.cgiHost.length>0&&(d=a.cgiHost+"cgi-bin/ILRReadValues"+a.getSrvExt());a.RefreshCGIPending=!0;a.getDebugLevel()>=2&&a.log_append_ln(" send_AsynchILRReadValues url = "+d);$.ajax({url:d,beforeSend:function(b){a.Link.SrvInfo_UTF8Activ?
b.overrideMimeType("text/csv;charset="+a.UNICODEFILE_UTF8_ENCODINGSTR):a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},global:!1,cache:!1,type:"POST",contentType:"text/xml",data:b,dataType:"text",timeout:a.AjaxTimeout,async:!0,complete:f,success:g,error:c})}function f(){a.RefreshCGIPending=!1}function c(){a.scheduleRepaint();a.Link.cgiFailConsecutive++;if(a.Link.cgiFailConsecutive>=a.Link.cgiFailMax)a.err_append_ln("ERROR Failed to update PPOs!"),a.Link.cgiFailConsecutive=
0;a.RefreshCGIPending=!1}function d(b){var c="",d="",e=0,f=0,g=0;if(b.length>0){for(var n=b.split("\n"),g=0;g-1&&(c=n[g].substring(c,n[g].length).split(" = "),c.length>1&&(c=parseInt(c[1],10),!isNaN(c)&&c!==void 0&&(e=c)));else if(d=n[g].split("="),d.length==2&&(c=d[0],d=d[1].trim(),c!==""||d!==void 0))(a.sl_updatePPOListByName(c,d)||a.FullRedraw===!0)&&a.scheduleRepaint(),f++;(b!==a.PreviousILR||a.FullRedraw===!0)&&a.scheduleOnlineTrendRefresh()}e!=
f&&a.err_append_ln("Shoud have "+e+" PPO's on server but found "+f+"!");a.ViewList.doViewGainIfRequired();a.PreviousILR=b}a.GETSRVINFO_CGISTR="cgi-bin/GetSrvInfo.exe";a.LSWEBSERVERINFONAMESTARTSTR="Server:";a.LSWEBSERVERINFOLSSRVACTIVSTARTSTR="LSWEBSERVER=1";a.LSWEBSERVERINFOCGIACTIVSTARTSTR="CGI=1";a.LSWEBSERVERINFOILRACTIVSTARTSTR="ILR=1";a.LSWEBSERVERINFOTRDACTIVSTARTSTR="TRD=1";a.LSWEBSERVERINFOALRACTIVSTARTSTR="ALR=1";a.LSWEBSERVERINFOALR2ACTIVSTARTSTR="ALR2=1";a.LSWEBSERVERINFOTRD2ACTIVSTARTSTR=
"TRD2=1";a.LSWEBSERVERINFOSEPSTR=",";a.LSWEBSERVERINFOVERSIONSTARTSTR="V.";a.LSWEBSERVERINFOILR2ACTIVSTARTSTR="ILR2=1";a.LSWEBSERVERINFOILR3ACTIVSTARTSTR="ILR3=1";a.LSWEBSERVERINFOUTF8ACTIVSTARTSTR="charset=utf-8";a.RefreshCGIPending=!1;a.AjaxTimeout=1E4;a.PreviousILR=null;a.Link={xmlsrvinfo:!1,SrvInfo_Name:"",SrvInfo_LSSrvActiv:!1,SrvInfo_LSSrvVersion:0,SrvInfo_UTF8Activ:!1,SrvInfo_CGIActiv:!0,SrvInfo_CGIVersion:1,SrvInfo_ILRActiv:!1,SrvInfo_ILRVersion:0,SrvInfo_ILR2Activ:!1,SrvInfo_ILR2Version:0,
SrvInfo_ILR3Activ:!1,SrvInfo_ILR3Version:0,SrvInfo_TRDActiv:!1,SrvInfo_TRDVersion:0,SrvInfo_ALRActiv:!1,SrvInfo_ALRVersion:0,SrvInfo_ALR2Activ:!1,SrvInfo_ALR2Version:0,SrvInfo_TRD2Activ:!1,SrvInfo_TRD2Version:0,cgibinsrvinfo:!1,cgiArr:null,cgiFailMax:1,cgiFailConsecutive:0,cgiOverrideMimetypeFlag:!0,cgiOverrideMimeTypeFunction:function(a){a.overrideMimeType("text/csv;charset=ISO-8859-1")}};var e=0,n=0,r=0;a.getSrvExt=function(){var b=".exe";a.Link.SrvInfo_ILR3Activ===!0&&(b=".cgi");return b};a.loadSrvXML=
function(){$.ajax({type:"GET",global:!1,async:!1,cache:!0,beforeSend:function(b){a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},url:"getsrvinfo.xml",dataType:"xml",timeout:a.AjaxTimeout,complete:function(){},success:function(b){a.Link.cgibinsrvinfo=!0;$(b).find("websrv > servicelist > service").each(function(){a.log_append_ln($(this).attr("name"));$(this).find("url").each(function(){a.log_append_ln($(this).text())})})},error:function(){a.Link.cgibinsrvinfo=!0}});return a.Link.xmlsrvinfo};
a.dontNeedEncoding=function(a){a=parseInt(a,10);return"a".charCodeAt(0)<=a&&a<="z".charCodeAt(0)?!0:"A".charCodeAt(0)<=a&&a<="Z".charCodeAt(0)?!0:"0".charCodeAt(0)<=a&&a<="9".charCodeAt(0)?!0:"-".charCodeAt(0)==a?!0:"_".charCodeAt(0)==a?!0:".".charCodeAt(0)==a?!0:"*".charCodeAt(0)==a?!0:!1};a.encode=function(b){var c="",b=String(b);a.Link.SrvInfo_UTF8Activ&&(b=unescape(encodeURIComponent(b)));return c=a.urlEncode(b)};a.urlEncode=function(b){for(var c="",d=0,e=0,f=!0,b=String(b),d=0;d0&&(e=a.cgiHost+b)):(e="cgi-bin/"+b,a.cgiHost.length>0&&(e=a.cgiHost+"cgi-bin/"+b));b!==null&&(a.getDebugLevel()>=2&&a.log_append_ln(" sc.loadData cgi call url = "+e),$.ajax({type:"GET",global:!1,beforeSend:function(b){a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},
async:d,cache:!0,url:e,dataType:"text",timeout:a.AjaxTimeout,complete:function(){},success:function(a){c!==void 0&&c!==null&&c(a)},error:function(c,d,e){a.err_append_ln("HTTP CGI error (loadData, "+b+"): "+c.status+" "+d+" "+e)}}))};a.userCGIAction=function(b){var c=null,d=b;a.cgiHost.length>0&&(d=a.cgiHost+b);b!==null&&(a.getDebugLevel()>=2&&a.log_append_ln(" sc.userCGIAction cgi call url = "+d),$.ajax({type:"GET",global:!1,beforeSend:function(b){a.Link.SrvInfo_UTF8Activ?b.overrideMimeType("text/csv;charset="+
a.UNICODEFILE_UTF8_ENCODINGSTR):a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},async:!1,cache:!0,url:d,dataType:"text",timeout:a.AjaxTimeout,complete:function(){},success:function(a){c=a},error:function(d,e,f){a.err_append_ln("HTTP CGI error (loadGeneralCGI, "+b+"): "+d.status+" "+e+" "+f);c=null}}));return c};a.loadGeneralCGI=function(b){var c="";a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC?(c=b,a.cgiHost.length>0&&(c=a.cgiHost+b)):(c="cgi-bin/"+b,a.cgiHost.length>0&&(c=
a.cgiHost+"cgi-bin/"+b));var d=null;b!==null&&(a.getDebugLevel()>=2&&a.log_append_ln(" sc.loadGeneralCGI cgi call url = "+c),$.ajax({type:"GET",global:!1,beforeSend:function(b){a.Link.SrvInfo_UTF8Activ?b.overrideMimeType("text/csv;charset="+a.UNICODEFILE_UTF8_ENCODINGSTR):a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},async:!1,cache:!0,url:c,dataType:"text",timeout:a.AjaxTimeout,complete:function(){},success:function(a){d=a},error:function(c,e,f){a.err_append_ln("HTTP CGI error (loadGeneralCGI, "+
b+"): "+c.status+" "+e+" "+f);d=null}}));return d};a.loadFileSource=function(b){var c=null;b!==null&&$.ajax({type:"GET",global:!1,beforeSend:function(b){a.Link.SrvInfo_UTF8Activ?b.overrideMimeType("text/csv;charset="+a.UNICODEFILE_UTF8_ENCODINGSTR):a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},async:!1,cache:!0,url:b,dataType:"text",timeout:a.AjaxTimeout,complete:function(){},success:function(a){c=a},error:function(d){a.err_append_ln("File Not Found! '"+b+"' (HTTP Status Code: '"+
d.status+"')");c=null}});return c};a.loadSrvInfoCGI=function(){try{var b=a.GETSRVINFO_CGISTR;a.cgiHost.length>0&&(b=a.cgiHost+a.GETSRVINFO_CGISTR);a.getDebugLevel()>=2&&a.log_append_ln("sc.loadSrvInfoCGI cgi call url = "+b);$.ajax({type:"GET",global:!1,beforeSend:function(b){a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},async:!1,cache:!0,url:b,dataType:"text",timeout:a.AjaxTimeout,complete:function(){},success:function(b){a.getDebugLevel()>=2&&a.log_append_ln("loadSrvInfoCGI() GetSrvInfo cgi returned = "+
b);a.Link.cgiArr=a.parseCGI_CSV_Content(b);var c=b=0,d="",e=0,f="";try{if(a.Link.cgiArr!==null){c=a.Link.cgiArr.length;for(b=0;b=0)try{a.Link.SrvInfo_Name=d.substring(a.LSWEBSERVERINFONAMESTARTSTR.length),a.Link.SrvInfo_Name=a.Link.SrvInfo_Name.trim()}catch(g){a.log_append_ln("Error in parseGetSrvInfo() while gets Server name Info : "+g)}else if(d.indexOf(a.LSWEBSERVERINFOLSSRVACTIVSTARTSTR)>=0){a.Link.SrvInfo_LSSrvActiv=
!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,a.LSWEBSERVERINFOLSSRVACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_LSSrvVersion=parseFloat(f),isNaN(a.Link.SrvInfo_LSSrvVersion))))a.Link.SrvInfo_LSSrvVersion=0}catch(j){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_LSSrvVersion Info : "+j)}}else if(d.indexOf(a.LSWEBSERVERINFOCGIACTIVSTARTSTR)>=0){a.Link.SrvInfo_CGIActiv=!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,
a.LSWEBSERVERINFOCGIACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_CGIVersion=parseFloat(f),isNaN(a.Link.SrvInfo_CGIVersion))))a.Link.SrvInfo_CGIVersion=0}catch(k){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_CGIVersion Info : "+k)}}else if(d.indexOf(a.LSWEBSERVERINFOILRACTIVSTARTSTR)>=0){a.Link.SrvInfo_ILRActiv=!0;if(d.indexOf(a.LSWEBSERVERINFOUTF8ACTIVSTARTSTR)>0)a.Link.SrvInfo_UTF8Activ=!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,
a.LSWEBSERVERINFOILRACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_ILRVersion=parseFloat(f),isNaN(a.Link.SrvInfo_ILRVersion))))a.Link.SrvInfo_ILRVersion=0}catch(n){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_ILRVersion Info : "+n)}}else if(d.indexOf(a.LSWEBSERVERINFOILR2ACTIVSTARTSTR)>=0){a.Link.SrvInfo_ILR2Activ=!0;if(d.indexOf(a.LSWEBSERVERINFOUTF8ACTIVSTARTSTR)>0)a.Link.SrvInfo_UTF8Activ=!0;try{if(e=
d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,a.LSWEBSERVERINFOILR2ACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_ILR2Version=parseFloat(f),isNaN(a.Link.SrvInfo_ILR2Version))))a.Link.SrvInfo_ILR2Version=0}catch(h){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_ILR2Version Info : "+h)}}else if(d.indexOf(a.LSWEBSERVERINFOILR3ACTIVSTARTSTR)>=0){a.Link.SrvInfo_ILR3Activ=!0;if(d.indexOf(a.LSWEBSERVERINFOUTF8ACTIVSTARTSTR)>
0)a.Link.SrvInfo_UTF8Activ=!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,a.LSWEBSERVERINFOILR3ACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_ILR3Version=parseFloat(f),isNaN(a.Link.SrvInfo_ILR3Version))))a.Link.SrvInfo_ILR3Version=0}catch(r){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_ILR3Version Info : "+r)}}else if(d.indexOf(a.LSWEBSERVERINFOALRACTIVSTARTSTR)>=0){a.Link.SrvInfo_ALRActiv=!0;try{if(e=
d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,a.LSWEBSERVERINFOALRACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_ALRVersion=parseFloat(f),isNaN(a.Link.SrvInfo_ALRVersion))))a.Link.SrvInfo_ALRVersion=0}catch(z){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_ALRVersion Info : "+z)}}else if(d.indexOf(a.LSWEBSERVERINFOALR2ACTIVSTARTSTR)>=0){a.Link.SrvInfo_ALR2Activ=!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,
a.LSWEBSERVERINFOALR2ACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_ALR2Version=parseFloat(f),isNaN(a.Link.SrvInfo_ALR2Version))))a.Link.SrvInfo_ALR2Version=0}catch(I){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_ALR2Version Info : "+I)}}else if(d.indexOf(a.LSWEBSERVERINFOTRDACTIVSTARTSTR)>=0){a.Link.SrvInfo_TRDActiv=!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,a.LSWEBSERVERINFOTRDACTIVSTARTSTR.length),
e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),f=f.trim(),f.length>0&&(a.Link.SrvInfo_TRDVersion=parseFloat(f),isNaN(a.Link.SrvInfo_TRDVersion))))a.Link.SrvInfo_TRDVersion=0}catch(D){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_TRDVersion Info : "+D)}}else if(d.indexOf(a.LSWEBSERVERINFOTRD2ACTIVSTARTSTR)>=0){a.Link.SrvInfo_TRD2Activ=!0;try{if(e=d.indexOf(a.LSWEBSERVERINFOVERSIONSTARTSTR,a.LSWEBSERVERINFOTRD2ACTIVSTARTSTR.length),e>0&&(f=d.substring(e+a.LSWEBSERVERINFOVERSIONSTARTSTR.length),
f=f.trim(),f.length>0&&(a.Link.SrvInfo_TRD2Version=parseFloat(f),isNaN(a.Link.SrvInfo_TRD2Version))))a.Link.SrvInfo_TRD2Version=0}catch(A){a.log_append_ln("Error in parseGetSrvInfo() while gets SrvInfo_TRD2Version Info : "+A)}}}}catch(F){a.log_append_ln("Error in parseGetSrvInfo() : "+F)}a.Link.cgibinsrvinfo=!0},error:function(){a.Link.cgibinsrvinfo=!1}})}catch(c){a.log_append_ln("Error in loadSrvInfoCGI(): "+c)}a.getDebugLevel()>=2&&(a.log_append_ln("After loadSrvInfoCGI(): sc.Link.xmlsrvinfo = "+
a.Link.xmlsrvinfo),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.cgibinsrvinfo = "+a.Link.cgibinsrvinfo),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_Name = "+a.Link.SrvInfo_Name),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_LSSrvActiv = "+a.Link.SrvInfo_LSSrvActiv),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_LSSrvVersion = "+a.Link.SrvInfo_LSSrvVersion),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_UTF8Activ = "+a.Link.SrvInfo_UTF8Activ),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_CGIActiv = "+
a.Link.SrvInfo_CGIActiv),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_CGIVersion = "+a.Link.SrvInfo_CGIVersion),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ILRActiv = "+a.Link.SrvInfo_ILRActiv),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ILRVersion = "+a.Link.SrvInfo_ILRVersion),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ILR2Activ = "+a.Link.SrvInfo_ILR2Activ),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ILR2Version = "+a.Link.SrvInfo_ILR2Version),
a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ILR3Activ = "+a.Link.SrvInfo_ILR3Activ),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ILR3Version = "+a.Link.SrvInfo_ILR3Version),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_TRDActiv = "+a.Link.SrvInfo_TRDActiv),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_TRDVersion = "+a.Link.SrvInfo_TRDVersion),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ALRActiv = "+a.Link.SrvInfo_ALRActiv),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ALRVersion = "+
a.Link.SrvInfo_ALRVersion),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ALR2Activ = "+a.Link.SrvInfo_ALR2Activ),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_ALR2Version = "+a.Link.SrvInfo_ALR2Version),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_TRD2Activ = "+a.Link.SrvInfo_TRD2Activ),a.log_append_ln("After loadSrvInfoCGI(): sc.Link.SrvInfo_TRD2Version = "+a.Link.SrvInfo_TRD2Version));return a.Link.cgibinsrvinfo};a.getServerInfo=function(){a.TARGET_TYPE_NR!==a.TARGET_TYPE_PANASONIC&&
(a.Link.xmlsrvinfo===!1?(a.loadSrvInfoCGI(),a.Link.cgibinsrvinfo===!1?a.log_append_ln("ERROR getServerInfo CGI failed."):a.log_append_ln("getServerInfo CGI made.")):a.log_append_ln("getServerInfo XML OK."))};a.initSpiderLink=function(){var b="",c="",d=-1,e=-1;location?(a.host=location.origin,b=location.pathname):a.log_append_ln(" location urlOrigin is not supported by this browser.");c=b;a.cgiHost=a.host;d=c.lastIndexOf("/");c=d>0?c.substring(0,d):"";a.host+=c;a.TARGET_TYPE_NR===a.TARGET_TYPE_WAGO||
a.TARGET_TYPE_NR===a.TARGET_TYPE_SAIA||a.HMI_CGI_RELATIVTOROOT===a.CGI_RELATIVTOROOT_DOCBASE?a.cgiHost=a.host:(c=b,d=c.indexOf("/remote/",0),d>=0&&(d=c.indexOf("/",d+8)),e=d>0?c.indexOf("relay/",d):c.indexOf("relay/",0),e>0&&(e=c.indexOf("/",e+6)),e>d?a.cgiHost+=c.substring(0,e):d>0?a.cgiHost+=c.substring(0,d):e>0&&(a.cgiHost+=c.substring(0,e)));a.HMI_CGI_RELATIVTOROOT&&a.HMI_CGI_RELATIVTOROOT!=void 0&&a.HMI_CGI_RELATIVTOROOT.length>0&&a.HMI_CGI_RELATIVTOROOT!=a.CGI_RELATIVTOROOT_WEBROOT&&a.HMI_CGI_RELATIVTOROOT!=
a.CGI_RELATIVTOROOT_DOCBASE&&a.HMI_CGI_RELATIVTOROOT!=a.CGI_RELATIVTOROOT_WEBROOT&&(a.cgiHost.lastIndexOf("/",a.cgiHost.length-1)!=a.cgiHost.length-1&&a.cgiHost.lastIndexOf("\\",a.cgiHost.length-1)!=a.cgiHost.length-1&&(a.cgiHost+="/"),a.cgiHost+=a.HMI_CGI_RELATIVTOROOT);a.cgiHost.lastIndexOf("/",a.cgiHost.length-1)!=a.cgiHost.length-1&&a.cgiHost.lastIndexOf("\\",a.cgiHost.length-1)!=a.cgiHost.length-1&&(a.cgiHost+="/");a.getDebugLevel()>=2&&(a.log_append_ln("sc.initSpiderLink docBaseFile = "+b),
a.log_append_ln("sc.initSpiderLink sc.HMI_CGI_RELATIVTOROOT = "+a.HMI_CGI_RELATIVTOROOT),a.log_append_ln("sc.initSpiderLink sc.cgiHost = "+a.cgiHost));a.getServerInfo();if(a.g_WriteValWorker===null&&typeof Worker!=="undefined")b=new XMLHttpRequest,c="hmi_worker.js",a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC&&(c="archivereader?hmi_worker.js"),b.open("HEAD",c,!1),b.send(),b.status!=404?a.g_WriteValWorker=new Worker(c):a.log_append_ln(" sc.g_WriteValWorker null since hmi_worker.js not found ");a.g_WriteValWorker!==
null&&a.g_WriteValWorker!==void 0?(a.g_WriteValWorker.onerror=function(b){a.log_append_ln(" sc.g_WriteValWorker on error in ["+b.filename+"] line ["+b.lineno+"] error: [ "+b.message+" ]")},a.g_WriteValWorker.onmessage=function(b){b=b.data;if(b.cmd==="isInit"){var c=b.value,c=parseInt(c,10);if(isNaN(c)===!1)a.g_WriteValWorkerIsInit=c}if(b.cmd==="writeVal")c=b.ret,c.indexOf("Done")>=0&&a.g_WriteValWorkerPendingWriteValsListSize>0&&a.g_WriteValWorkerPendingWriteValsListSize--;a.getDebugLevel()>=2&&a.log_append_ln(" sc.g_WriteValWorker onmessage [ "+
b.cmd+" , "+b.value+" ] sc.g_WriteValWorkerPendingWriteValsListSize = ["+a.g_WriteValWorkerPendingWriteValsListSize+"]")},a.getDebugLevel()>=2&&a.log_append_ln("sc.initSpiderLink sc.g_WriteValWorker = "+a.g_WriteValWorker)):a.log_append_ln(" Browser does not supports the Worker api so the write val requests will be done in a Blocking way in GUI thread ")};a.sl_psc_writeValue=function(b,c){var d=a.sl_getPPOWriteAddress(b),e=-1,e=0,e="",e=d.indexOf("_4109_%s");if(e>=-1)e=c.length,d=d.replace("_4109_%s",
"_"+(4096+e)+"_%s");$.ajax({type:"POST",url:"plcpost",contentType:"text/xml",dataType:"text/xml",data:d+"="+c})};a.sl_writeValue=function(b,c){var d="",f="";a.getDebugLevel()>=2&&(e=a.getTimestamp_ms());if(a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC)a.sl_psc_writeValue(b,c);else if(a.Link.SrvInfo_ILR3Activ===!0?(d="cgi-bin/writeVal.cgi?"+a.encode(b)+"="+a.encode(c),a.cgiHost.length>0&&(d=a.cgiHost+"cgi-bin/writeVal.cgi?"+a.encode(b)+"="+a.encode(c))):(d="cgi-bin/writeVal.exe?"+a.encode(b)+"+"+a.encode(c),
a.cgiHost.length>0&&(d=a.cgiHost+"cgi-bin/writeVal.exe?"+a.encode(b)+"+"+a.encode(c))),a.Link.SrvInfo_UTF8Activ&&(f="text/csv;charset="+a.UNICODEFILE_UTF8_ENCODINGSTR),a.getDebugLevel()>=2&&a.log_append_ln("sc.sl_writeValue( "+b+" , "+c+" ) \nrequestURLWriteVal = "+d),a.g_WriteValWorker!==null)try{a.g_WriteValWorkerIsInit!==1&&(a.g_WriteValWorker.postMessage({cmd:"init",ajaxTimeout:a.AjaxTimeout.toString()}),a.g_WriteValWorker.postMessage({cmd:"isInit"})),a.g_WriteValWorker.postMessage({cmd:"writeVal",
requestURLWriteVal:d}),a.g_WriteValWorkerPendingWriteValsListSize++}catch(g){a.log_append_ln("Exception in sc.sl_writeValue( "+b+" , "+c+" ) \nerr = "+g)}else a.getDebugLevel()>=2&&a.log_append_ln(" sc.g_WriteValWorker null so the write val requests will be done in a Blocking way in GUI thread "),$.ajax({type:"GET",global:!1,beforeSend:function(b){a.Link.SrvInfo_UTF8Activ?b.overrideMimeType(f):a.Link.cgiOverrideMimetypeFlag===!0&&a.Link.cgiOverrideMimeTypeFunction(b)},async:!1,timeout:a.AjaxTimeout,
cache:!0,url:d,dataType:"text",complete:function(){},success:function(d){a.getDebugLevel()>=2&&a.log_append_ln("Ajax succes for sc.sl_writeValue( "+b+" , "+c+" ) \ncgi returned = "+d)},error:function(){a.log_append_ln("Ajax Error for sc.sl_writeValue( "+b+" , "+c+" ) ")}})};a.SL_refreshPPO=function(){var e=0,e="";if(a.co_readSkipRefreshCO()===1||a.RefreshCGIPending===!0)a.FullRedraw===!0&&a.scheduleRepaint();else if(a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC){var g=!1;a.RefreshCGIPending=!0;for(e=
0;e0&&a.stringcmp(a.ViewList.getViewByIndex(e).ViewName,a.MsgBox)===!1){var g=a.ViewList.getViewByIndex(e).ViewName,n="/plc?"+g;a.TARGET_TYPE_NR===a.TARGET_TYPE_PANASONIC&&a.cgiHost.length>0&&(n=a.cgiHost+"plc?"+g);$.ajax({url:n,type:"GET",cache:!0,global:!1,contentType:"text",dataType:"text",timeout:a.AjaxTimeout,async:!0,complete:f,success:d,error:c});g=!0}if(!g)a.RefreshCGIPending=!1,
a.FullRedraw===!0&&a.scheduleRepaint()}else{var h=g=e="",g="