Commit 88aaad7a authored by Christoffer Ackelman's avatar Christoffer Ackelman

Web: Updated minified JS files.

parent 26dac13e
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,47 +6,7 @@
</head>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button">
<img src="toolbar_ack.png"/>....
</div>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_navigator.png"/>
</div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_plc.png"/>....
</div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_graph.png"/>
</div>
<div id="toolitem5" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_objectgraph.png"/>
</div>
<div id="toolitem6" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_navigator.png"/>
</div>
<div id="toolitem7" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_plc.png"/>
</div>
<div id="toolitem8" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_history.png"/>
</div>
<div id="toolitem9" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_object.png"/>
</div>
<div id="toolitem10" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_crossref.png"/>
</div>
<div id="toolitem11" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_help.png"/>
</div>
<div id="toolitem12" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_classhelp.png"/>
</div>
</div>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=ev.js></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
<canvas id="canvas" width="1200" height="800"></canvas>
<script src="ev.bundle.js"></script>
</body>
</html>
"use strict";function PwrtStatus(t){this.sts=t,this.evenSts=function(){return t%2==0},this.oddSts=function(){return t%2==1},this.getSts=function(){return t}}var Pwr={eType_Boolean:98305,eType_Float32:98306,eType_Float64:98307,eType_Char:98308,eType_Int8:98309,eType_Int16:98310,eType_Int32:98311,eType_UInt8:98312,eType_UInt16:98313,eType_UInt32:98314,eType_Objid:98315,eType_Buffer:98316,eType_String:98317,eType_Enum:98318,eType_Struct:98319,eType_Mask:98320,eType_Array:98321,eType_Time:98322,eType_Text:98323,eType_AttrRef:98324,eType_UInt64:98325,eType_Int64:98326,eType_ClassId:98327,eType_TypeId:98328,eType_VolumeId:98329,eType_ObjectIx:98330,eType_RefId:98331,eType_DeltaTime:98332,eType_Status:98333,eType_NetStatus:98334,eType_CastId:98335,eType_ProString:98336,eType_DisableAttr:98337,eType_DataRef:98338,mPrv_RtRead:1,mPrv_RtWrite:2,mPrv_System:4,mPrv_Maintenance:8,mPrv_Process:16,mPrv_Instrument:32,mPrv_Operator1:64,mPrv_Operator2:128,mPrv_Operator3:256,mPrv_Operator4:512,mPrv_Operator5:1024,mPrv_Operator6:2048,mPrv_Operator7:4096,mPrv_Operator8:8192,mPrv_Operator9:16384,mPrv_Operator10:32768,mPrv_RtEventsAck:1<<18,mPrv_RtPlc:1<<19,mPrv_RtNavigator:1<<20,mPrv_DevRead:1<<21,mPrv_DevPlc:1<<22,mPrv_DevConfig:1<<23,mPrv_DevClass:1<<24,mPrv_RtEventsBlock:1<<25,mPrv_Administrator:1<<26,mPrv_SevRead:1<<27,mPrv_SevAdmin:1<<28,mAccess_RtRead:1,mAccess_RtWrite:2,mAccess_System:4,mAccess_Maintenance:8,mAccess_Process:16,mAccess_Instrument:32,mAccess_RtEventsBlock:1<<25,mAccess_RtEventsAck:1<<18,mAccess_RtPlc:1<<19,mAccess_RtNavigator:1<<20,mAccess_AllRt:35454975,mAccess_AllOperators:65472,mAccess_AllPwr:-1,mAdef_pointer:1,mAdef_array:2,mAdef_backup:4,mAdef_changelog:8,mAdef_state:16,mAdef_const:32,mAdef_rtvirtual:64,mAdef_devbodyref:128,mAdef_dynamic:256,mAdef_publicwrite:512,mAdef_noedit:1024,mAdef_invisible:2048,mAdef_refdirect:4096,mAdef_noinvert:8192,mAdef_noremove:16384,mAdef_rtdbref:32768,mAdef_private:65536,mAdef_class:131072,mAdef_superclass:262144,mAdef_buffer:524288,mAdef_nowbl:1048576,mAdef_alwayswbl:2097152,mAdef_disableattr:4194304,mAdef_rthide:8388608},Pwrb={mXttMethodsFlagsMask_IsConfigured:1,mXttOpMethodsMask_OpenGraph:1,mXttOpMethodsMask_OpenObjectGraph:2,mXttOpMethodsMask_OpenTrend:4,mXttOpMethodsMask_OpenHistory:8,mXttOpMethodsMask_OpenFast:16,mXttOpMethodsMask_Camera:32,mXttOpMethodsMask_HistEvent:64,mXttOpMethodsMask_BlockEvents:128,mXttOpMethodsMask_Help:256,mXttOpMethodsMask_Photo:512,mXttOpMethodsMask_Note:1024,mXttOpMethodsMask_ParentObjectGraph:2048,mXttMntMethodsMask_OpenObject:1,mXttMntMethodsMask_OpenTrace:2,mXttMntMethodsMask_RtNavigator:4,mXttMntMethodsMask_OpenCrossref:8,mXttMntMethodsMask_HelpClass:16,mXttMntMethodsMask_DataSheet:32,mXttMntMethodsMask_CircuitDiagram:64,mXttMntMethodsMask_Simulate:1<<31};function PwrtObjid(t,e){this.oix=e,this.vid=t}function PwrtAttrRef(){this.objid,this.offset,this.body,this.size,this.flags}function CdhrNumber(t,e){this.value=t,this.sts=e,this.evenSts=function(){return e%2==0},this.oddSts=function(){return e%2==1},this.getSts=function(){return e}}var CdhC={cUserVolMin:65793,cUserVolMax:16711422};function UserdataCbReturn(){this.userdata,this.row}function CliTable(t,e){this.command=t,this.qualifier=e}var CliC={SUCCESS:1,SYNTAX_ERROR:2,UNKNOWN_COMMAND:4,QUALNOTFOUND:6,VERB_VECT_SIZE:5,STATE_INIT:0,STATE_VERB:1,STATE_QUAL:2,STATE_QUALVALUE:3,STATE_SPACE:4,STATE_EQUAL:5,STATE_ERROR:6,STATE_QUOTE_VERB:7,STATE_QUOTE_QUALVALUE:8,STATE_QUALVALUE_EXACT:9,STATE_VERB_EXACT:10,TAB:"\t",SPACE:" "},MhC={eEvent_Ack:1,eEvent_Block:2,eEvent_Cancel:3,eEvent_CancelBlock:4,eEvent_Missing:5,eEvent_Reblock:6,eEvent_Return:7,eEvent_Unblock:8,eEvent_InfoSuccess:32,eEvent_Alarm:64,eEvent_MaintenanceAlarm:128,eEvent_SystemAlarm:256,eEvent_UserAlarm1:512,eEvent_UserAlarm2:1024,eEvent_UserAlarm3:2048,eEvent_UserAlarm4:4096,eEvent_Info:8192,eEventPrio_A:67,eEventPrio_B:66,eEventPrio_C:65,eEventPrio_D:64,mEventStatus_NotRet:1,mEventStatus_NotAck:2,mEventStatus_Block:4};function MhEventId(){this.nix,this.idx,this.birthTime}function MhEvent(){this.eventTime,this.eventText,this.eventName,this.eventFlags,this.eventStatus,this.eventId,this.targetId,this.eventType,this.object,this.supObject,this.eventMoreText,this.syncIdx}function Sub(){this.sts,this.refid,this.type,this.elements,this.name,this.value}function ObjectInfo(){this.objid,this.cid,this.has_children,this.name,this.description,this.classname,this.full_name,this.param1}function AttributeInfo(){this.name,this.type,this.size,this.flags,this.element,this.objid,this.full_name,this.classname}function MenuButton(){this.type,this.text,this.name,this.url}function OpwindMenuInfo(){this.title,this.text,this.enable_language,this.enable_login,this.enable_alarmlist,this.enable_eventlog,this.enable_navigator,this.disable_help,this.disable_proview,this.language,this.buttons=[]}function CrrInfo(){this.type,this.objid,this.name,this.classname}function GlowPieInfo(){this.sector_num,this.min_val,this.max_val}function GlowBarChartInfo(){this.bars,this.barsegments,this.min_value,this.max_value}function GlowTableInfo(){this.columns,this.rows,this.column_size=new Array(Glow.TABLE_MAX_COL)}function PendingData(t,e){this.func_cb=t,this.data=e}var GdhOp={GET_OP_SELF:1,GET_OP_METHOD_PLC:2,GET_OP_METHOD_OBJECTGRAPH:3,GET_OP_METHOD_GRAPH:4,GET_OP_METHOD_HELPCLASS:5};function Gdh(){var I=1,M=2,B=3,T=4,R=5,j=6,G=7,N=9,Q=10,D=15,V=25,L=26,Y=29,K=36,z=39,F=42,W=50,J=57,X=63,H=64,q=65,Z=66,$=67,tt=68;this.debug=!1,this.pending=[],this.sub=[],this.PORT=4448,this.ws=null,this.open_cb=null,this.close_cb=null,this.return_cb=null,this.next_id=1234,this.subscriptionCount=1,this.listSend=!1,this.init=function(){""===window.location.hostname?this.ws=new WebSocket("ws:127.0.0.1:4448"):this.ws=new WebSocket("ws://"+window.location.hostname+":4448"),this.ws.binaryType="arraybuffer",(this.ws.gdh=this).ws.onopen=function(t){null!==this.gdh.open_cb&&this.gdh.open_cb()},this.ws.onclose=function(){this.debug&&console.log("Socket closed"),null!==this.gdh.close_cb&&this.gdh.close_cb()},this.ws.onmessage=function(t){if("string"==typeof t.data)console.log("String message received",t,t.data);else if(t.data instanceof ArrayBuffer){var e=new DataView(t.data),n=e.getUint8(0),i=e.getUint32(1),s=e.getUint32(5);switch(n){case R:this.gdh.debug&&console.log("GetObjectInfoBoolean received");var a=e.getUint8(9);(0,this.gdh.pending[i].func_cb)(i,s,a),delete this.gdh.pending[i];break;case G:this.gdh.debug&&console.log("GetObjectInfoInt received");a=e.getUint32(9);(P=this.gdh.pending[i]).func_cb(i,P.data,s,a),delete this.gdh.pending[i];break;case j:this.gdh.debug&&console.log("GetObjectInfoFloat received");a=e.getFloat32(9);(P=this.gdh.pending[i]).func_cb(i,P.data,s,a),delete this.gdh.pending[i];break;case J:this.gdh.debug&&console.log("GetObjectInfoFloatArray received");var o=e.getInt32(9);a=new Array(o);d=13;for(var l=0;l<o;l++)a[l]=e.getFloat32(d),d+=4;(P=this.gdh.pending[i]).func_cb(i,P.data,s,a),delete this.gdh.pending[i];break;case I:this.gdh.debug&&console.log("SetObjectInfoBoolean received",i,s);break;case B:this.gdh.debug&&console.log("SetObjectInfoInt received",i,s);break;case M:this.gdh.debug&&console.log("SetObjectInfoFloat received",i,s);break;case T:this.gdh.debug&&console.log("SetObjectInfoString received",i,s);break;case N:this.gdh.debug&&console.log("ToggleObjectInfo received",i,s);break;case Q:this.gdh.debug&&console.log("RefObjectInfo received",i,s),delete this.gdh.pending[i];break;case D:this.gdh.debug&&console.log("UnrefObjectInfo received",i,s),delete this.gdh.pending[i];break;case L:this.gdh.debug&&console.log("RefObjectInfoList received",i,s),(0,this.gdh.pending[i].func_cb)(i,s),delete this.gdh.pending[i];break;case V:var h=9,r=e.getUint32(h);this.gdh.debug&&console.log("GetObjectRefInfoAll received",i,r),h+=4;for(l=0;l<r;l++){var A=e.getUint32(h);h+=4;var c=e.getUint32(h);h+=4;var g=this.gdh.sub[A];if(void 0===g)h+=c;else{switch(g.type){case Pwr.eType_Boolean:if(g.elements<=1)a=e.getUint8(h),h+=1;else{(f=c)!=g.elements&&console.log("Subscription size error",f,g.elements,A),a=new Array(f);for(var d=0;d<f;d++)a[d]=e.getUint8(h),h+=1}break;case Pwr.eType_Float32:if(g.elements<=1)a=e.getFloat32(h),h+=4;else{(f=c/4)!=g.elements&&console.log("Subscription size error",f,g.elements,A),a=new Array(f);for(d=0;d<f;d++)a[d]=e.getFloat32(h),h+=4}break;case Pwr.eType_Int8:case Pwr.eType_Int16:case Pwr.eType_Int32:case Pwr.eType_UInt8:case Pwr.eType_UInt16:case Pwr.eType_UInt32:case Pwr.eType_Status:case Pwr.eType_NetStatus:case Pwr.eType_Mask:case Pwr.eType_Enum:case GraphIfc.eType_Bit:if(g.elements<=1)a=e.getInt32(h),h+=4;else{(f=c/4)!=g.elements&&console.log("Subscription size error",f,g.elements,A),a=new Array(f);for(d=0;d<f;d++)a[d]=e.getInt32(h),h+=4}break;case Pwr.eType_String:case Pwr.eType_Time:case Pwr.eType_DeltaTime:case Pwr.eType_AttrRef:case Pwr.eType_Objid:if(g.elements<=1){var _=e.getInt16(h);h+=2;var u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);a=String.fromCharCode.apply(null,u)}else{var f;(f=g.elements)!=g.elements&&console.log("Subscription size error",f,g.elements,A),a=new Array(f);for(var v=0;v<f;v++){_=e.getInt16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);a[v]=String.fromCharCode.apply(null,u)}}}this.gdh.sub[A].value=a}}if(void 0===this.gdh.pending[i]){console.log("** GetObjectRefInfoAll received removed",i);break}(0,this.gdh.pending[i].func_cb)(i,s),delete this.gdh.pending[i];break;case z:var m=[];h=9,r=e.getUint32(h);this.gdh.debug&&console.log("GetAllXttChildren received",i,r),console.log("GetAllXttChildren received",s,i,r),h+=4;for(l=0;l<r;l++){(b=new ObjectInfo).objid=new PwrtObjid,b.objid.vid=e.getUint32(h),h+=4,b.objid.oix=e.getUint32(h),h+=4,b.cid=e.getUint32(h),h+=4,b.has_children=0!==e.getUint16(h),h+=2;_=e.getUint16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);b.name=String.fromCharCode.apply(null,u);var w=e.getUint16(h);h+=2,u=new Uint8Array(w);for(d=0;d<w;d++)u[d]=e.getUint8(h++);b.description=String.fromCharCode.apply(null,u);var p=e.getUint16(h);h+=2,u=new Uint8Array(p);for(d=0;d<p;d++)u[d]=e.getUint8(h++);b.classname=String.fromCharCode.apply(null,u),m.push(b)}(P=this.gdh.pending[i]).func_cb(i,P.data,s,m),delete this.gdh.pending[i];break;case K:m=[],h=9,r=e.getUint32(h);this.gdh.debug&&console.log("GetAllClassAttributes received",i,r),h+=4;for(l=0;l<r;l++){(b=new AttributeInfo).type=e.getUint32(h),h+=4,b.flags=e.getUint32(h),h+=4,b.size=e.getUint16(h),h+=2,b.elements=e.getUint16(h),h+=2;_=e.getUint16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);b.name=String.fromCharCode.apply(null,u),_=e.getUint16(h),h+=2,u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);b.classname=String.fromCharCode.apply(null,u),m.push(b)}(P=this.gdh.pending[i]).func_cb(i,P.data,s,m),delete this.gdh.pending[i];break;case X:case tt:case q:this.gdh.debug&&console.log("GetObject received",i,s);var b=null;if(0!=(1&s)){h=9;(b=new ObjectInfo).objid=new PwrtObjid,b.objid.vid=e.getUint32(h),h+=4,b.objid.oix=e.getUint32(h),h+=4,b.cid=e.getUint32(h),h+=4,b.has_children=0!==e.getUint16(h),h+=2;_=e.getUint16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);b.name=String.fromCharCode.apply(null,u),_=e.getUint16(h),h+=2,u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);b.fullname=String.fromCharCode.apply(null,u);p=e.getUint16(h);h+=2,u=new Uint8Array(p);for(d=0;d<p;d++)u[d]=e.getUint8(h++);b.classname=String.fromCharCode.apply(null,u);w=e.getUint16(h);h+=2,u=new Uint8Array(w);for(d=0;d<w;d++)u[d]=e.getUint8(h++);b.description=String.fromCharCode.apply(null,u);var E=e.getUint16(h);h+=2,u=new Uint8Array(E);for(d=0;d<E;d++)u[d]=e.getUint8(h++);b.param1=String.fromCharCode.apply(null,u)}(P=this.gdh.pending[i]).func_cb(i,P.data,s,b),delete this.gdh.pending[i];break;case F:if(0!=(1&s)){h=9,m=[],r=e.getUint16(h);h+=2,this.gdh.debug&&console.log("CrrSignal received",i,r);for(l=0;l<r;l++){(b=new CrrInfo).type=e.getUint16(h),h+=2,b.objid=new PwrtObjid,b.objid.vid=e.getUint32(h),h+=4,b.objid.oix=e.getUint32(h),h+=4;_=e.getUint16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);b.name=String.fromCharCode.apply(null,u);p=e.getUint16(h);h+=2,u=new Uint8Array(p);for(d=0;d<p;d++)u[d]=e.getUint8(h++);b.classname=String.fromCharCode.apply(null,u),m.push(b)}}(P=this.gdh.pending[i]).func_cb(i,P.data,s,m),delete this.gdh.pending[i];break;case H:m=new OpwindMenuInfo,h=9;if(this.gdh.debug&&console.log("GetOpwindMenu received",i,r),console.log("GetOpwindMenu received",s,i),1&s){_=e.getUint16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);m.title=String.fromCharCode.apply(null,u),_=e.getUint16(h),h+=2,u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);m.text=String.fromCharCode.apply(null,u),m.enable_language=e.getUint32(h),h+=4,m.enable_login=e.getUint32(h),h+=4,m.enable_alarmlist=e.getUint32(h),h+=4,m.enable_eventlog=e.getUint32(h),h+=4,m.enable_navigator=e.getUint32(h),h+=4,m.disable_help=e.getUint32(h),h+=4,m.disable_proview=e.getUint32(h),h+=4,m.language=e.getUint32(h),h+=4;var x=e.getUint16(h);h+=2;for(l=0;l<x;l++){var C=new MenuButton;C.type=e.getUint32(h),h+=4,_=e.getUint16(h),h+=2,u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);C.text=String.fromCharCode.apply(null,u),_=e.getUint16(h),h+=2,u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);C.name=String.fromCharCode.apply(null,u),_=e.getUint16(h),h+=2,u=new Uint8Array(_);for(d=0;d<_;d++)u[d]=e.getUint8(h++);C.url=String.fromCharCode.apply(null,u),m.buttons.push(C)}}(P=this.gdh.pending[i]).func_cb(i,P.data,s,m),delete this.gdh.pending[i];break;case Y:h=9;this.gdh.debug&&console.log("Check user received",i,r),console.log("Check user received",s,i);var y=0;1&s&&(y=e.getUint32(h),h+=4),(P=this.gdh.pending[i]).func_cb(i,P.data,s,y),delete this.gdh.pending[i];break;case W:if(1&s){h=9,_=e.getUint16(h);h+=2;for(u=new Uint8Array(_),d=0;d<_;d++)u[d]=e.getUint8(h++);var O=String.fromCharCode.apply(null,u)}(P=this.gdh.pending[i]).func_cb(i,P.data,s,O),delete this.gdh.pending[i];break;case Z:m=[],h=9,r=e.getUint32(h);this.gdh.debug&&console.log("MhSync received",i,r),h+=4;for(l=0;l<r;l++){t=new MhEvent;var U=e.getUint16(h);h+=2;for(u=new Uint8Array(U),d=0;d<U;d++)u[d]=e.getUint8(h++);t.eventTime=String.fromCharCode.apply(null,u),U=e.getUint16(h),h+=2,u=new Uint8Array(U);for(d=0;d<U;d++)u[d]=e.getUint8(h++);t.eventText=String.fromCharCode.apply(null,u),U=e.getUint16(h),h+=2,u=new Uint8Array(U);for(d=0;d<U;d++)u[d]=e.getUint8(h++);t.eventName=String.fromCharCode.apply(null,u),t.eventFlags=e.getUint32(h),h+=4,t.eventStatus=e.getUint32(h),h+=4,t.eventPrio=e.getUint32(h),h+=4,t.eventId=new MhEventId,t.eventId.nix=e.getUint32(h),h+=4,t.eventId.idx=e.getUint32(h),h+=4,U=e.getUint16(h),h+=2,u=new Uint8Array(U);for(d=0;d<U;d++)u[d]=e.getUint8(h++);t.eventId.birthTime=String.fromCharCode.apply(null,u),t.targetId=new MhEventId,t.targetId.nix=e.getUint32(h),h+=4,t.targetId.idx=e.getUint32(h),h+=4,U=e.getUint16(h),h+=2,u=new Uint8Array(U);for(d=0;d<U;d++)u[d]=e.getUint8(h++);t.targetId.birthTime=String.fromCharCode.apply(null,u),t.eventType=e.getUint32(h),h+=4;var S=new PwrtObjid(0,0);S.vid=e.getUint32(h),h+=4,S.oix=e.getUint32(h),h+=4,t.object=new PwrtAttrRef,t.object.objid=S,t.object.offset=e.getUint32(h),h+=4,t.object.body=e.getUint32(h),h+=4,t.object.size=e.getUint32(h),h+=4,t.object.flags=e.getUint32(h),h+=4;var k=new PwrtObjid(0,0);k.vid=e.getUint32(h),h+=4,k.oix=e.getUint32(h),h+=4,t.supObject=new PwrtAttrRef,t.supObject.objid=k,t.supObject.offset=e.getUint32(h),h+=4,t.supObject.body=e.getUint32(h),h+=4,t.supObject.size=e.getUint32(h),h+=4,t.supObject.flags=e.getUint32(h),h+=4,U=e.getUint16(h),h+=2,u=new Uint8Array(U);for(d=0;d<U;d++)u[d]=e.getUint8(h++);t.eventMoreText=String.fromCharCode.apply(null,u),t.syncIdx=e.getUint32(h),h+=4,m.push(t)}(P=this.gdh.pending[i]).func_cb(i,P.data,s,m),delete this.gdh.pending[i];break;case $:var P;(P=this.gdh.pending[i]).func_cb(i,P.data,s),delete this.gdh.pending[i];break;default:console.log("Unknown message type")}}}},this.getObjectInfoBoolean=function(t,e){this.return_cb=e;var n=new Uint8Array(t.length+6);n[0]=R,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;for(var i=0;i<t.length;i++)n[i+6]=t.charCodeAt(i);this.pending[this.next_id]=new PendingData(e,null),this.ws.send(n),this.next_id++},this.getObjectInfoInt=function(t,e,n){this.return_cb=e;var i=new Uint8Array(t.length+6);i[0]=G,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var s=0;s<t.length;s++)i[s+6]=t.charCodeAt(s);this.pending[this.next_id]=new PendingData(e,n),this.ws.send(i),this.next_id++},this.getObjectInfoFloat=function(t,e,n){this.return_cb=e;var i=new Uint8Array(t.length+6);i[0]=j,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var s=0;s<t.length;s++)i[s+6]=t.charCodeAt(s);this.pending[this.next_id]=new PendingData(e,n),this.ws.send(i),this.next_id++},this.getObjectInfoFloatArray=function(t,e,n,i){this.return_cb=n;var s=new Uint8Array(t.length+10);s[0]=J,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=e>>16&255,s[9]=e>>24&255;for(var a=0;a<t.length;a++)s[a+10]=t.charCodeAt(a);this.pending[this.next_id]=new PendingData(n,i),this.ws.send(s),this.next_id++},this.refObjectInfo=function(t,e,n){var i=new Sub;if(i.name=t,i.refid=this.subscriptionCount,i.type=e,i.elements=n,this.sub[this.subscriptionCount]=i,this.subscriptionCount++,this.listSent){var s;s=12+i.name.length;var a=new Uint8Array(s+10);a[0]=Q,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,this.debug&&console.log("RefObjectInfo: ",i.refid);var o=6;a[o++]=255&i.refid,a[o++]=i.refid>>8&255,a[o++]=i.refid>>16&255,a[o++]=i.refid>>24&255,a[o++]=255&i.elements,a[o++]=i.elements>>8&255,a[o++]=i.elements>>16&255,a[o++]=i.elements>>24&255,a[o++]=255&i.name.length,a[o++]=i.name.length>>8&255,a[o++]=i.name.length>>16&255,a[o++]=i.name.length>>24&255;for(var l=0;l<i.name.length;l++)a[o++]=i.name.charCodeAt(l);return this.pending[this.next_id]=new PendingData(this.refObjectInfoReply,null),this.debug&&console.log("Sending RefObjectInfo",this.next_id,s,o),this.ws.send(a),this.next_id++,i.refid}return i.refid},this.refObjectInfoReply=function(t,e){this.debug&&console.log("refObjectInfoReply",t,e)},this.unrefObjectInfo=function(t){var e=new Uint8Array(14);e[0]=D,e[2]=255&this.next_id,e[3]=this.next_id>>8&255,e[4]=this.next_id>>16&255,e[5]=this.next_id>>24&255,this.debug&&console.log("UnrefObjectInfo: ",t);var n=6;e[n++]=255&t,e[n++]=t>>8&255,e[n++]=t>>16&255,e[n++]=t>>24&255,this.pending[this.next_id]=new PendingData(this.unrefObjectInfoReply,null),this.debug&&console.log("Sending UnrefObjectInfo",this.next_id,4,10,t),this.ws.send(e),this.next_id++,delete this.sub[t]},this.refObjectInfoList=function(t){var e=0,n=0;for(var i in this.return_cb=t,this.sub)e+=12+this.sub[i].name.length,n++;var s=new Uint8Array(e+10);s[0]=L,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&n,s[7]=n>>8&255,s[8]=n>>16&255,s[9]=n>>24&255;var a=10;for(var i in this.sub)if(0!==i){this.debug&&console.log("RefObjectInfoList: ",this.sub[i].refid),s[a++]=255&this.sub[i].refid,s[a++]=this.sub[i].refid>>8&255,s[a++]=this.sub[i].refid>>16&255,s[a++]=this.sub[i].refid>>24&255,s[a++]=255&this.sub[i].elements,s[a++]=this.sub[i].elements>>8&255,s[a++]=this.sub[i].elements>>16&255,s[a++]=this.sub[i].elements>>24&255,s[a++]=255&this.sub[i].name.length,s[a++]=this.sub[i].name.length>>8&255,s[a++]=this.sub[i].name.length>>16&255,s[a++]=this.sub[i].name.length>>24&255;for(var o=0;o<this.sub[i].name.length;o++)s[a++]=this.sub[i].name.charCodeAt(o)}this.pending[this.next_id]=new PendingData(t,null),this.debug&&console.log("Sending RefObjectInfoList",this.next_id,e,a,this.next_id),this.ws.send(s),this.next_id++,this.listSent=!0},this.refObjectInfoListReply=function(t,e){this.debug&&console.log("refObjectInfoListReply",t,e)},this.getRefObjectInfoAll=function(t){var e=new Uint8Array(6);e[0]=V,e[2]=255&this.next_id,e[3]=this.next_id>>8&255,e[4]=this.next_id>>16&255,e[5]=this.next_id>>24&255,this.pending[this.next_id]=new PendingData(t,null),this.debug&&console.log("Sending getRefObjectInfoAll",this.next_id),this.ws.send(e),this.next_id++},this.getRefObjectInfoAllReply=function(t,e){this.debug&&console.log("getRefObjectInfoAllReply",t,e)},this.getObjectRefInfo=function(t){return this.debug&&console.log("getObjectRefInfo",t,this.sub[t].value),this.sub[t].value},this.setObjectInfoBoolean=function(t,e){var n=new Uint8Array(12+t.length);n[0]=I,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&e,n[7]=e>>8&255,n[8]=e>>16&255,n[9]=e>>24&255,n[10]=255&t.length,n[11]=t.length>>8&255;for(var i=12,s=0;s<t.length;s++)n[i++]=t.charCodeAt(s);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoBoolean",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.setObjectInfoInt=function(t,e){var n=new Uint8Array(12+t.length);n[0]=B,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&e,n[7]=e>>8&255,n[8]=e>>16&255,n[9]=e>>24&255,n[10]=255&t.length,n[11]=t.length>>8&255;for(var i=12,s=0;s<t.length;s++)n[i++]=t.charCodeAt(s);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoInt",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.setObjectInfoFloat=function(t,e){var n=new Uint8Array(12+t.length);n[0]=M,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;var i=new ArrayBuffer(4);new Float32Array(i)[0]=e;var s=new Uint8Array(i);n[6]=s[0],n[7]=s[1],n[8]=s[2],n[9]=s[3],n[10]=255&t.length,n[11]=t.length>>8&255;for(var a=12,o=0;o<t.length;o++)n[a++]=t.charCodeAt(o);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoFloat",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.setObjectInfoString=function(t,e){var n,i=new Uint8Array(10+e.length+t.length);i[0]=T,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.length,i[7]=e.length>>8&255;var s=8;for(n=0;n<e.length;n++)i[s++]=e.charCodeAt(n);for(i[s++]=255&t.length,i[s++]=t.length>>8&255,n=0;n<t.length;n++)i[s++]=t.charCodeAt(n);return this.ws.send(i),this.debug&&console.log("Sending setObjectInfoString",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.toggleObjectInfo=function(t){var e=new Uint8Array(8+t.length);e[0]=N,e[2]=255&this.next_id,e[3]=this.next_id>>8&255,e[4]=this.next_id>>16&255,e[5]=this.next_id>>24&255,e[6]=255&t.length,e[7]=t.length>>8&255;for(var n=8,i=0;i<t.length;i++)e[n++]=t.charCodeAt(i);return this.ws.send(e),this.debug&&console.log("Sending toggleObjectInfoBoolean",this.next_id,t,value),this.next_id++,new PwrtStatus(1)},this.getAllXttChildren=function(t,e,n){var i=new Uint8Array(14);i[0]=z,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t.vid,i[7]=t.vid>>8&255,i[8]=t.vid>>16&255,i[9]=t.vid>>24&255,i[10]=255&t.oix,i[11]=t.oix>>8&255,i[12]=t.oix>>16&255,i[13]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(e,n),this.debug&&console.log("Sending getAllXttChildren",this.next_id),this.ws.send(i),this.next_id++},this.getAllClassAttributes=function(t,e,n,i){var s=new Uint8Array(18);s[0]=K,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&t,s[7]=t>>8&255,s[8]=t>>16&255,s[9]=t>>24&255,s[10]=255&e.vid,s[11]=e.vid>>8&255,s[12]=e.vid>>16&255,s[13]=e.vid>>24&255,s[14]=255&e.oix,s[15]=e.oix>>8&255,s[16]=e.oix>>16&255,s[17]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getAllClassAttributes",this.next_id,t,e.vid,e.oix),this.ws.send(s),this.next_id++},this.getObject=function(t,e,n,i){var s=new Uint8Array(16);s[0]=X,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=255&t.vid,s[9]=t.vid>>8&255,s[10]=t.vid>>16&255,s[11]=t.vid>>24&255,s[12]=255&t.oix,s[13]=t.oix>>8&255,s[14]=t.oix>>16&255,s[15]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObject",this.next_id,t.vid,t.oix),this.ws.send(s),this.next_id++},this.getObjectFromAref=function(t,e,n,i){var s=new Uint8Array(32);s[0]=tt,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=255&t.objid.vid,s[9]=t.objid.vid>>8&255,s[10]=t.objid.vid>>16&255,s[11]=t.objid.vid>>24&255,s[12]=255&t.objid.oix,s[13]=t.objid.oix>>8&255,s[14]=t.objid.oix>>16&255,s[15]=t.objid.oix>>24&255,s[16]=255&t.offset,s[17]=t.offset>>8&255,s[18]=t.offset>>16&255,s[19]=t.offset>>24&255,s[20]=255&t.body,s[21]=t.body>>8&255,s[22]=t.body>>16&255,s[23]=t.body>>24&255,s[24]=255&t.size,s[25]=t.size>>8&255,s[26]=t.size>>16&255,s[27]=t.size>>24&255,s[28]=255&t.flags,s[29]=t.flags>>8&255,s[30]=t.flags>>16&255,s[31]=t.flags>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObject",this.next_id,oid.vid,oid.oix),this.ws.send(s),this.next_id++},this.getObjectFromName=function(t,e,n,i){var s=new Uint8Array(10+t.length);s[0]=q,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=255&t.length,s[9]=t.length>>8&255;for(var a=10,o=0;o<t.length;o++)s[a++]=t.charCodeAt(o);this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObjectFromName",this.next_id,t),this.ws.send(s),this.next_id++},this.crrSignal=function(t,e,n){var i=new Uint8Array(14);i[0]=F,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t.vid,i[7]=t.vid>>8&255,i[8]=t.vid>>16&255,i[9]=t.vid>>24&255,i[10]=255&t.oix,i[11]=t.oix>>8&255,i[12]=t.oix>>16&255,i[13]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(e,n),this.debug&&console.log("Sending crrObject",this.next_id,t.vid,t.oix),this.ws.send(i),this.next_id++},this.getOpwindMenu=function(t,e,n){t.length;var i=new Uint8Array(8+t.length);i[0]=H,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t.length,i[7]=t.length>>8&255;for(var s=8,a=0;a<t.length;a++)i[s++]=t.charCodeAt(a);this.pending[this.next_id]=new PendingData(e,n),this.debug&&console.log("Sending getOpwindMenu",this.next_id),this.ws.send(i),this.next_id++},this.login=function(t,e,n,i){var s=new Uint8Array(8+t.length+2+e.length);s[0]=Y,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255;var a=6;s[a]=255&t.length,s[a+1]=t.length>>8&255,a+=2;for(var o=0;o<t.length;o++)s[a++]=t.charCodeAt(o);s[a]=255&e.length,s[a+1]=e.length>>8&255,a+=2;for(o=0;o<e.length;o++)s[a++]=e.charCodeAt(o);this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending login",this.next_id),this.ws.send(s),this.next_id++},this.getMsg=function(t,e,n){var i=new Uint8Array(10);i[0]=W,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t,i[7]=t>>8&255,i[8]=t>>16&255,i[9]=t>>24&255,this.pending[this.next_id]=new PendingData(e,n),this.ws.send(i),this.debug&&console.log("Sending getMsg",this.next_id,t),this.next_id++},this.mhSync=function(t,e,n){var i=new Uint8Array(10);i[0]=Z,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t,i[7]=t>>8&255,i[8]=t>>16&255,i[9]=t>>24&255,this.pending[this.next_id]=new PendingData(e,n),this.debug&&console.log("Sending mhSync",this.next_id),this.ws.send(i),this.next_id++},this.mhAcknowledge=function(t,e,n){var i=new Uint8Array(16+t.birthTime.length);i[0]=$,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t.nix,i[7]=t.nix>>8&255,i[8]=t.nix>>16&255,i[9]=t.nix>>24&255,i[10]=255&t.idx,i[11]=t.idx>>8&255,i[12]=t.idx>>16&255,i[13]=t.idx>>24&255;var s=14;i[s]=255&t.birthTime.length,i[s+1]=t.birthTime.length>>8&255,s+=2;for(var a=0;a<t.birthTime.length;a++)i[s++]=t.birthTime.charCodeAt(a);this.pending[this.next_id]=new PendingData(e,n),this.debug&&console.log("Sending mhAcknowledge",this.next_id),console.log("Sending mhAcknowledge",this.next_id),this.ws.send(i),this.next_id++}}var Bitmaps={leaf:0,map:2,openmap:4,object:6,attrenum:8,attrarra:10,attrarel:12,attr:14,crrwrite:16,crrread:18,ack:20,alarm:22,eventacked:24,eventalarm:26,eventreturn:28,info:30,system:32,maintenance:34,blockl:36,blockr:38,img:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],pending:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],images:["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAASElEQVQokWP4jwMwMDBgYBR5XBpwGYZVIzYNGDZB+QyEFOBiM+CyCacGBI0hgEGjsxkYGCiwkSI/4tKMz0DqxCM2A4hOOcQCAObFEQyI2PpKAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAQUlEQVQokWNgYGD4jw1jA2hqsGvAZRhWjdg0oIsh8QkqwMXGbhMuDXAxdAFsNDobyifTRor8SFGoUhSPFKUcYjEAMsMz2y6w8kgAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAKElEQVQokWP4DwUMDAwYGB9gwKUQm0FoGL/JOGwb1TgINZKFSbYOCgD1JxQJG0vK9AAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAK0lEQVQokWNgYGD4z8DA8B8bgMlhxbgUEgIMBE3Ggkc1Dk6N5AAGUm2DYQAkYTDe0vu7CAAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAQklEQVQokaXOwQ4AIAgCUP7/p+nUlpMSzY2bDwWHA5IEkFJCtaiKxE7dvsue8HZNJEPneoAuSq+OYAf9wy4K0Mk5C+d++RWimsw3AAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAPUlEQVQokaXRQQoAQAgCQP//6brKZmSt0M2hIACI4yBURqiKXQp0ThuhGwmt7Vy00XvqCa7QN1wjhtYLCCYyCkvDVnkJOQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAH0lEQVQokWP4TyJgYGBg+E8iZiDFdHrZMKqBGA2kYAD8gaJsjwzf9wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIklEQVQokWNgYGD4TxL+TyJg+P//P9GmwzXQ3oZRDdSOBwAGOSrkrXppgQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAPklEQVQokWP4////fwYGBgxMCDBgU4jNICyYsOlYbENoJNIW7BqJsYm2NuJyBVE2EqWRfjbiUoQ3oAgpwgUANLqccvbgec0AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAPElEQVQokWNgYGD4jw0wMDDgx9gUEgMYiDIdDaNoJBZg1UiUTTS1EZcriLKRKI30sxGXIgKBhF8RrqgBAOTOqGZ5aiCnAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAMElEQVQokWP4////fwYGBgxMCDBgU4jNICwYv+nY5InWOGojXW0khLEahtc6PDYCAB9hxkjBPICvAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAALUlEQVQokWNgYGD4jw0wMDDgx9gUEgMYCJmOTZ5ojaM20tVGQgCHK/AnLVwAAPonfpBwU5f4AAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIklEQVQokWP4////fwYGBpwYHTDANGADeDWM2jAEbSAFAADB26JsIjYj1AAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIElEQVQokWNgYGD4jw8wMDCgYwZcEvg1jNowBG0gBQMAQN8q5COZl1cAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIUlEQVQokWP4TyJgGIQaGBgY/pOIibcEroEkTLIfhoEGADzs8B5gcUg/AAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAJUlEQVQokWNgYGD4TyIedBr+kwgY/v//T7TpcA0k2TAIQ4nmGgDFzt0jExR7hgAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAN0lEQVQokaWNQQoAMAjD8v9P633WVWhBkJIotQQoYPYbrHYrqC9D+MG54OBMuMC54GApuPBed9OxiMNLGke1JwAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAANElEQVQokWNgYGD4jw3DABY57IqxsQlqwGELSYop1ECEYgo0EKmYQg1EKMbUQEAxRAMpAABRMgoFjbTzXgAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWNgYGD4j4yRATY5BmyKkGks4qgS2BSj2UYFDdgAdW2gvpOwhDW6ItwaCGI8JuHWgMOtWD0PACufaaWhXDFDAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWP4jwYYGBjgGKscNkXINLo4hgZsipFto44GbJi6NlDfSehhjUxjyGMVxQMYcJmEVwPB5ICEAdcbY6vf9TVAAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAS0lEQVQokZ2Q2w4AIAhCz///ND11M3RVmxuDUBRAtw8QHRyC4SSJSDjDht1Yhxdudks+bFNxYsX9G6rz2qVHxqRspGi2Wpoji/dqaLh22DbO2VuXAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAASklEQVQokWP4////fwYGBqIwVC2cgSKBTQzKxhDA0ICmGau12BRCMLJp2BQgy8H9gM9ELGJkasAXvFg9TQjgDCVc8YBXAwFMmgYASkT1C9E5Ya0AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAARklEQVQokZ2QQQoAMAjD+v9Pu9PA1ThQQRBtoFUBJSkk0SlwOwKykCAEcn+BK8hih/aAe++y7IDuhWgXfcKHCuBBfX6ASR3Vn8ZINQzCrQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAQ0lEQVQokWNgYGD4j45hAJscA8UakBXi0ITddDy2YJqOrBiLJjI1oLsdj1/I0IAnCLFpwtSALYQwNKB7FJ2NooEUDAAtGwcI+Svs4gAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAL0lEQVQokWP4TyJgGCkaGBgQyhhwSeASw9CAYho2A3CZiE0xVg34FOPUgA+QrAEA1FYi+tWeG/cAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAMElEQVQokWNgYGD4TyIeGRr+//+PXQOaBC4xVElkBdgMwHASTBEOxdj9gEcxHYIVAC5kqlZXl5JMAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAJ0lEQVQokWP4jwMwMDBgF8elGIZHNeDSANOEVRyXBpwGUcUGqvoBAK+H8xt0qXFWAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAJ0lEQVQokWNgYGD4jw3///8fqzgDLsUwMKoBlwaSg5UAHoiIw2cDAFMz2iY65DAoAAAAAElFTkSuQmC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAASUlEQVQokZ2RUQoAIAjFdv9L11dhskeUEIQ2mcYIAXjeisA+EahFA9ad/siAA0wqSUsnu87wDZh3VEodO6Rr1c51rc8fd9OoMQHLk7dXak3qLwAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAR0lEQVQokZ2S2woAIAhD9/8/vV6tjgMNhLxMN1SSTGYb46JkfS2gJglQ/ncRAZ5JTCXQYsFRwxpAvFtKoeMvmoqDv1jc5DQONycV+bfOetgAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAOUlEQVQokWNgYGD4///////E0AwMDP8hPDQAk8QhjlMCuzg2G3AB6tlAez8MglAiCZNiw/////8DACmmtFrq9aGNAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAN0lEQVQokWP4////fwYGhv/E0FA2w390jCSJIc6ASwKnBmw24MLUs4H2fhgEoUQKIMkGBgaG/wDZFBj2pVi3HgAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAN0lEQVQokWNgYGD4TyJm+E8sgGugig3YxHFqwGcIQQ3obAwN6G7GawMuhVg1EFKMUwM+QJ+IAwDD1Gyi1EZc6gAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAO0lEQVQokWP4TyJg+P///38GBgaiMFwDVWzAJo5TA15DCGnAYKNrwHAzPhtwKcSqgZBinBqIigeaRhwAPuZgrlZXy70AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAP0lEQVQokZWPQQoAMAzC8v9Pu8soDOxaBS82QkWNgPKTJ/BYsLekAOxfquwHWyfws6ED7OgtfNk9bAuTSGBJOufqnHIsmYkzAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAQUlEQVQokZWPQQ4AMAQE5/+f1kuTCkuROGAmADCVPsJsBfdCsX0u3N7sJFfXsAqW8BMaID+9gE3SJayEFo7CFwY7GtAw3ouVj50AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAQElEQVQokZ2QQQ4AMAjC+v9Pu9MWl5AJ42a0IlKBgCIadgGgQ8imqo9D3zDBvJoyR+zwlWHS9SUHaOf4QOywtQCQGucn0g2dEQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAOklEQVQokWNgYGD4Tyz+////fwZSFBOtAaoQQsM46JLY+HAbUEwgrJmwyZTZQJYfSAolmsQDWTENwwByoOYaWbAqegAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWP4jwMwMDBgF8enAZsmvBqw2cSARQBDIQqbGEUoaggpQBcj3Qay/IAN4AwlfBrIigeiNeACADpU5yeYXn+XAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWNgYGD4jw3///8fqzgDPg04NOG3AUMTugA2hWhqiFKEzCeoAF2MRBvI8gNJoUT1eCBaAy4MAMhm5hr5iTaWAAAAAElFTkSuQmCC"]},Plow={DRAWOFFSET:2,DEST_INTOLAST:0,DEST_INTOFIRST:1,DEST_AFTER:2,DEST_BEFORE:3,TREE_INDENTATION:1,OPEN_ATTRIBUTES:1,OPEN_CHILDREN:2,OPEN_CROSSREFERENCES:4,OPEN_ALL:7,COLOR_BLACK:1,COLOR_RED:2,COLOR_GRAY:3,COLOR_DARKGRAY:4,COLOR_LIGHTGRAY:5,COLOR_WHITE:6,COLOR_YELLOW:7,COLOR_GREEN:8,COLOR_LIGHTBLUE:9,COLOR_BLUE:10,COLOR_VIOLET:11,eEvent_MB1Click:0,eEvent_MB1ClickShift:1,eEvent_Key_Up:2,eEvent_Key_Down:3,eEvent_Key_Right:4,eEvent_Key_Left:5,eEvent_Key_ShiftRight:6,eEvent_Key_CtrlR:7,eEvent_Key_CtrlL:8,eEvent_Key_CtrlG:9,eEvent_ObjectDeleted:10,RELATIVE_POSITION:1,NEXT_RELATIVE_POSITION:2};function PlowGeometry(){this.ll_x=0,this.ll_y=0,this.ur_x=0,this.ur_y=0}function PlowNodeClass(t){this.a=new PlowArray(t),this.ctx=t,this.nc_name="",this.group=0,this.node_open=0,this.draw=function(t,e,n,i){this.a.draw(t,e,n,i)},this.insert=function(t){this.a.add(t)}}function PlowArray(a){this.a=[],this.ctx=a,this.add=function(t){this.a.push(t)},this.insertNode=function(t,e,n){var i=this.find(t);if(-1==i)if(null==e)switch(n){case Plow.DEST_INTOLAST:case Plow.DEST_AFTER:this.a.push(t),t.level=0;break;default:t.level=0,this.a.unshift(t)}else{var s=this.find(e);if(-1==s)return;switch(n){case Plow.DEST_INTOFIRST:s==this.a.length-1?this.a.push(t):this.a.splice(s+1,0,t),t.level=e.level+1;break;case Plow.DEST_INTOLAST:if(s==this.a.length-1)this.a.push(t);else{i=this.a.length;for(var a=s+1;a<this.a.length;a++)if(this.a[a].level<=e.level){i=a;break}i==this.a.length?this.a.push(t):this.a.splice(i,0,t)}t.level=e.level+1;break;case Plow.DEST_AFTER:if(s==this.a.length-1)this.a.push(t);else{for(a=i;a<this.a.length&&!(this.a[a].level<e.level);a++);this.a.splice(a,0,t)}t.level=e.level;break;case Plow.DEST_BEFORE:0<i&&i--,this.a.splice(i,0,t),t.level=e.level}}},this.remove=function(t){var e=this.find(t);-1!=e&&(this.ctx.event_cb(Plow.eEvent_ObjectDeleted,this.a[e+1],0,0),this.a.splice(e,1))},this.size=function(){return this.a.length},this.get=function(t){return this.a[t]},this.draw=function(t,e,n,i){for(var s=0;s<this.a.length;s++)this.a[s].draw(t,e,n,i)},this.set_borders=function(t){for(var e=0;e<this.a.length;e++)this.a[e].set_borders(t)},this.configure=function(){for(var t=0;t<this.a.length;t++)this.a[t].pos.x=1*this.a[t].level,this.a[t].pos.y=1*t},this.close_node=function(t){var e=this.find(t);if(-1!=e){var n,i=t.level;for(n=e+1;n<this.a.length&&!(this.a[n].level<=i);n++);var s=n;if(s!=e+1)for(n=e+1;n<s;n++)a.select_object==this.a[e+1]&&(a.select_object=null),this.ctx.event_cb(Plow.eEvent_ObjectDeleted,this.a[e+1],0,0),this.a.splice(e+1,1)}},this.get_parent_object=function(t){var e=this.find(t);if(-1==e)return null;for(var n=e;0<=n;n--)if(this.a[n].level<t.level)return this.a[n];return null},this.get_first_child=function(t){var e=this.find(t);return-1==e?null:this.a.length==e-1?null:this.a[e+1].level>t.level?this.a[e+1]:null},this.get_next_sibling=function(t){for(var e=!1,n=0;n<this.a.length;n++)if(this.a[n]!=t){if(e){if(this.a[n].level==t.level)return this.a[n];if(this.a[n].level<t.level)return null}}else e=!0;return null},this.get_next_object=function(t){for(var e=0;e<this.a.length;e++)if(this.a[e]==t)return e==this.a.length-1?null:this.a[e+1];return null},this.get_previous_object=function(t){for(var e=0;e<this.a.length;e++)if(this.a[e]==t)return 0==e?null:this.a[e-1];return null},this.get_first_object=function(){return 0==this.a.length?null:this.a[0]},this.get_last_object=function(){return 0==this.a.length?null:this.a[this.a.length-1]},this.find=function(t){for(var e=0;e<this.a.length;e++)if(this.a[e]==t)return e;return-1}}function PlowNode(i,t,e){this.ctx=i,this.userdata=null,this.OFFSET=2,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.nc=t,this.pos=new PlowPoint(i,0,0),this.n_name="",this.annotv=[],this.annotsize=[],this.pixmapv=[],this.trace_object="",this.trace_attribute="",this.trace_attr_type=0,this.highlight=!1,this.select=!1,this.invert=!1,this.level=e,this.node_open=!1,this.fill_color=0,this.p=0,this.old_value=0,this.first_scan=!0,this.relative_position=0,this.set_annotation=function(t,e){10<=t||(this.annotv[t]=e)},this.set_annotation_pixmap=function(t,e){10<=t||(this.pixmapv[t]=e)},this.draw_object=function(){this.draw(this.ctx.gdraw.gctx,null,null,!1)},this.draw=function(t,e,n,i){var s=this.x_left*this.ctx.zoom_factor,a=this.y_low*this.ctx.zoom_factor-1,o=(this.x_right-this.x_left)*this.ctx.zoom_factor,l=(this.y_high-this.y_low)*this.ctx.zoom_factor+2;t.fillStyle="white",this.select&&(t.fillStyle="lightblue"),t.fillRect(s,a,o,l),this.nc.draw(t,this.pos,this,this.highlight)},this.connect=function(){if(""!=this.trace_object&&""!=this.trace_attribute){var t=this.trace_attribute.indexOf("#");-1!=t&&(this.trace_attribute=this.trace_attribute.substring(0,t));var e=this.trace_object+"."+this.trace_attribute;this.p=i.gdh.refObjectInfo(e,this.trace_attr_type),console.log("connecting",e,this.p)}},this.scan=function(){if(0!=this.p){var t=i.gdh.getRefObjectInfo(this.p);if(this.first_scan)this.first_scan=!1;else if(t==this.old_value)return;this.highlight=!!t,this.old_value=t,this.draw_object()}},this.set_borders=function(){this.x_left=1e37,this.x_right=-1e37,this.y_low=1e37,this.y_high=-1e37,t.a.set_borders(this)},this.event_handler=function(t,e,n){return(e-this.ctx.offset_x)/this.ctx.zoom_factor>=this.x_left&&(e-this.ctx.offset_x)/this.ctx.zoom_factor<=this.x_right&&(n-this.ctx.offset_y)/this.ctx.zoom_factor>=this.y_low&&(n-this.ctx.offset_y)/this.ctx.zoom_factor<=this.y_high?(i.event_object=this,1):0},this.set_select=function(t){t?(this.select=!0,this.ctx.select_object=this):(this.select=!1,this.ctx.select_object==this&&(this.ctx.select_object=null)),t!=this.select&&this.draw_object()},this.set_invert=function(t){this.invert=t,this.draw_object()},this.set_userdata=function(t){this.userdata=t},this.get_userdata=function(){return this.userdata},this.in_icon=function(t,e){return t>=this.x_left*this.ctx.zoom_factor&&t<=(this.x_left+1.75)*this.ctx.zoom_factor},this.measure=function(){var t=new PlowGeometry;return t.ll_x=this.x_left*this.ctx.zoom_factor,t.ll_y=this.y_low*this.ctx.zoom_factor,t.ur_x=this.x_right*this.ctx.zoom_factor,t.ur_y=this.y_high*this.ctx.zoom_factor,t}}function PlowPoint(t,e,n){this.x=e,this.y=n,this.ctx=t}function PlowAnnot(t,e,n,i,s,a,o){this.RELATIVE_OFFSET=1,this.p=new PlowPoint(t,e,n),this.draw_type=s,this.text_size=i,this.annot_type=a,this.number=o,this.ctx=t,this.draw=function(t,e,n,i){if(null!=n&&null!=n.annotv[this.number]){var s=0,a=this.ctx.zoom_factor/this.ctx.base_zoom_factor*(this.text_size+4)-4;if(!(a<0)){switch(a){case 0:s=8;break;case 1:s=10;break;case 2:s=12;break;case 3:case 4:s=14;break;case 5:case 6:case 7:s=18;break;default:s=3*a}t.font=s+"px Arial",n.invert?t.fillStyle="white":t.fillStyle="black",i&&(t.fillStyle="red"),t.lineWidth=.5;var o=(this.p.x+e.x)*this.ctx.zoom_factor,l=(this.p.y+e.y)*this.ctx.zoom_factor-s/4;if(0!=(this.annot_type&Plow.RELATIVE_POSITION)){var h=(e.x+n.relative_position+this.RELATIVE_OFFSET)*this.ctx.zoom_factor;o<h&&(o=h)}for(var r=n.annotv[this.number].split("\n"),A=0;A<r.length;A++)t.fillText(r[A],o,l),l+=1.4*s;0==(this.annot_type&Plow.NEXT_RELATIVE_POSITION)&&0==(this.annot_type&Plow.RELATIVE_POSITION)||(n.relative_position=(o+t.measureText(n.annotv[this.number]).width)/this.ctx.zoom_factor-e.x)}}},this.set_borders=function(t){}}function PlowAnnotPixmap(t,e,n,i){this.p=new PlowPoint(t,e,n),this.number=i,this.ctx=t,this.draw=function(e,t,n,i){var s,a=(this.p.x+t.x)*this.ctx.zoom_factor,o=(this.p.y+t.y)*this.ctx.zoom_factor,l=n.pixmapv[this.number];null!=l&&(n.invert&&l++,null==(s=Bitmaps.img[l])?((s=new Image).src=Bitmaps.images[l],Bitmaps.img[l]=s,Bitmaps.pending[l]=[],Bitmaps.pending[l].push(new PlowPoint(this.ctx,a,o)),s.onload=function(){for(var t=0;t<Bitmaps.pending[l].length;t++)e.drawImage(s,Bitmaps.pending[l][t].x,Bitmaps.pending[l][t].y);Bitmaps.pending[l]=null}):s.complete?e.drawImage(s,a,o):Bitmaps.pending[l].push(new PlowPoint(this.ctx,a,o)))},this.set_borders=function(t){}}function PlowRect(t,e,n,i,s,a,o,l,h){this.ll=new PlowPoint(t,e,n),this.ur=new PlowPoint(t,e+i,n+s),this.border_color=o,this.fill_color=a,this.fill=l,this.fix_color=h,this.ctx=t,this.draw=function(t,e,n,i){var s=(this.ll.x+e.x)*this.ctx.zoom_factor,a=(this.ll.y+e.y)*this.ctx.zoom_factor,o=(this.ur.x-this.ll.x)*this.ctx.zoom_factor,l=(this.ur.y-this.ll.y)*this.ctx.zoom_factor;switch(t.lineWidth=1,this.border_color){case Plow.COLOR_GRAY:t.strokeStyle="grey";break;case Plow.COLOR_RED:t.strokeStyle="red";break;case Plow.COLOR_WHITE:t.strokeStyle="white";break;default:t.strokeStyle="black"}if(i&&(t.strokeStyle="red"),t.strokeRect(s,a,o,l),this.fill){switch(this.fill_color){case Plow.COLOR_GRAY:t.fillStyle="grey";break;case Plow.COLOR_RED:t.fillStyle="red";break;case Plow.COLOR_YELLOW:t.fillStyle="yellow";break;case Plow.COLOR_GREEN:t.fillStyle="lightgreen";break;case Plow.COLOR_WHITE:n.invert?t.fillStyle="black":t.fillStyle="white";break;default:n.invert?t.fillStyle="white":t.fillStyle="black"}t.fillRect(s,a,o,l)}},this.set_borders=function(t){this.ll.x+t.pos.x<t.x_left&&(t.x_left=this.ll.x+t.pos.x),this.ur.x+t.pos.x>t.x_right&&(t.x_right=this.ur.x+t.pos.x),this.ll.y+t.pos.y<t.y_low&&(t.y_low=this.ll.y+t.pos.y),this.ur.y+t.pos.y>t.y_high&&(t.y_high=this.ur.y+t.pos.y)}}function GDraw(t){this.ctx=t,this.canvas=document.querySelector("canvas"),this.gctx=this.canvas.getContext("2d"),this.offset_top=this.canvas.offsetTop}function PlowCtx(){this.gdh=0,this.debug=!1,this.nodraw=0,this.zoom_factor=20,this.base_zoom_factor=20,this.offset_x=0,this.offset_y=0,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.a=new PlowArray(this),this.a_nc=new PlowArray(this),this.name="Claes context",this.gdraw=new GDraw(this),this.selct_object=null,this.event_cb=null,this.event_object=null,this.draw=function(){0<this.nodraw||(this.gdraw.gctx.fillStyle="white",this.gdraw.gctx.fillRect(0,0,this.gdraw.canvas.width,this.gdraw.canvas.height),this.a.draw(this.gdraw.gctx,null,null,!1))},this.connect=function(){for(var t=0;t<this.a.size();t++)this.a.get(t).connect()},this.scan=function(){console.log("ctx scan",this.a.size());for(var t=0;t<this.a.size();t++)this.a.get(t).scan()},this.set_nodraw=function(){this.nodraw++},this.reset_nodraw=function(){this.nodraw--},this.size=function(){return this.a.size()},this.event_handler=function(t,e,n){var i=0;switch(t){case Plow.eEvent_MB1Click:case Plow.eEvent_MB1ClickShift:for(var s=0;s<this.a.size()&&!(this.a.get(s)instanceof PlowNode&&1==(i=this.a.get(s).event_handler(t,e,n)));s++);1==i&&(this.event_cb(t,this.event_object,e,n),this.draw());break;case Plow.eEvent_Key_Up:case Plow.eEvent_Key_Down:case Plow.eEvent_Key_Left:case Plow.eEvent_Key_Right:case Plow.eEvent_Key_ShiftRight:case Plow.eEvent_Key_CtrlR:case Plow.eEvent_Key_CtrlL:case Plow.eEvent_Key_CtrlG:this.event_cb(t,null,0,0)}},this.set_select=function(t){for(var e=0;e<this.a.size();e++)this.a.get(e)instanceof PlowNode&&this.a.get(e).set_select(t)},this.set_invert=function(t){for(var e=0;e<this.a.size();e++)this.a.get(e)instanceof PlowNode&&this.a.get(e).set_invert(t)},this.get_select=function(){return this.select_object},this.insert=function(t,e){this.a.add(t)},this.insertNode=function(t,e,n){this.a.insertNode(t,e,n)},this.remove=function(t){this.select_object==t&&(this.select_object=null),this.a.remove(t)},this.insert_nc=function(t){this.a_nc.add(t)},this.configure=function(){this.a.configure(),this.a.set_borders();var t=1*this.a.a.length*this.zoom_factor;this.gdraw.canvas.height=t},this.get_parent_object=function(t){return this.a.get_parent_object(t)},this.get_next_object=function(t){return this.a.get_next_object(t)},this.get_last_object=function(){return this.a.get_last_object()},this.get_first_object=function(){return this.a.get_first_object()},this.get_previous_object=function(t){return this.a.get_previous_object(t)},this.close_node=function(t){this.a.close_node(t)},this.is_visible=function(t){return t.y_high*this.zoom_factor<=window.pageYOffset+window.innerHeight-this.gdraw.offset_top&&t.y_low*this.zoom_factor>=window.pageYOffset-this.gdraw.offset_top},this.scroll=function(t,e){window.scrollTo(window.scrollX,t*this.zoom_factor-window.innerHeight*e+this.gdraw.offset_top)}}function EvOpenChildrenData(t,e){this.node=t,this.open_next=e}var EvC={eType_AlarmList:0,eType_EventList:1,eType_BlockList:2};function Ev(){this.ctx=null,this.ncAlarmA=null,this.ncAlarmB=null,this.ncAlarm=null,this.ncInfo=null,this.ncSuccess=null,this.scan_update,this.priv=0,this.mhSyncIdx=0,this.type=EvC.eType_AlarmList,this.ala=null,this.maxEve=30,this.maxAla=30;var h=this;this.init=function(){switch(this.type=this.get_type(),this.type){case EvC.eType_EventList:document.title="Event List"}this.priv=sessionStorage.getItem("pwr_privilege"),console.log("pwr_privilege",this.priv),this.methods_init(),this.ctx=new PlowCtx,this.ctx.event_cb=this.plow_event,this.createNodeClasses(),this.ctx.gdh=new Gdh,this.ctx.gdh.open_cb=this.gdh_init_cb,this.ctx.gdh.init(),this.ctx.gdraw.canvas.addEventListener("click",function(t){var e=t.pageY-h.ctx.gdraw.offset_top,n=t.pageX;t.shiftKey?ev.ctx.event_handler(Plow.eEvent_MB1ClickShift,n,e):ev.ctx.event_handler(Plow.eEvent_MB1Click,n,e)}),document.addEventListener("keydown",function(t){40==t.keyCode?(h.ctx.event_handler(Plow.eEvent_Key_Down),t.preventDefault()):39==t.keyCode?(t.shiftKey?h.ctx.event_handler(Plow.eEvent_Key_ShiftRight):h.ctx.event_handler(Plow.eEvent_Key_Right),t.preventDefault()):37==t.keyCode?(h.ctx.event_handler(Plow.eEvent_Key_Left),t.preventDefault()):38==t.keyCode?(h.ctx.event_handler(Plow.eEvent_Key_Up),t.preventDefault()):82==t.keyCode?(t.ctrlKey&&h.ctx.event_handler(Plow.eEvent_Key_CtrlR),t.preventDefault()):76==t.keyCode?(t.ctrlKey&&h.ctx.event_handler(Plow.eEvent_Key_CtrlL),t.preventDefault()):71==t.keyCode&&(t.ctrlKey&&h.ctx.event_handler(Plow.eEvent_Key_CtrlG),t.preventDefault())}),document.getElementById("toolitem1").addEventListener("click",function(t){console.log("Ack"),h.ack()}),document.getElementById("toolitem2").addEventListener("click",function(t){var e=h.ctx.get_select();null!=e&&(console.log("toolitem2",e.userdata.e.supObject.vid,e.userdata.e.supObject.oix),h.ctx.gdh.getObjectFromAref(e.userdata.e.supObject,GdhOp.GET_OP_SELF,h.open_navigator_cb,null),console.log("toolitem2 event"))}),document.getElementById("toolitem3").addEventListener("click",function(t){console.log("toolitem5 event");var e=h.ctx.get_select();if(null!==e){var n=window.open("","_blank");h.ctx.gdh.getObjectFromAref(e.userdata.e.supObject,GdhOp.GET_OP_METHOD_PLC,h.open_plc_cb,n)}}),document.getElementById("toolitem4").addEventListener("click",function(t){var e=h.ctx.get_select();if(e.userdata instanceof EvItemAlarm){var n=window.open("","_blank");h.ctx.gdh.getObjectFromName(e.userdata.e.eventName,GdhOp.GET_OP_METHOD_GRAPH,h.open_graph_cb,n)}}),document.getElementById("toolitem5").addEventListener("click",function(t){var e=h.ctx.get_select();if(e.userdata instanceof EvItemAlarm){var n=window.open("","_blank");h.ctx.gdh.getObjectFromName(e.userdata.e.eventName,GdhOp.GET_OP_METHOD_OBJECTGRAPH,h.open_graph_cb,n)}}),document.getElementById("toolitem6").addEventListener("click",function(t){var e=h.ctx.get_select();console.log("storage",localStorage.getItem("XttMethodNavigator")),localStorage.setItem("XttMethodNavigator",e.userdata.e.eventName),console.log("storage",localStorage.getItem("XttMethodNavigator")),console.log("toolitem6 event window",window.opener),window.opener.focus()}),document.getElementById("toolitem7").addEventListener("click",function(t){var e=h.ctx.get_select();if(null!==e){var n=window.open("","_blank");h.ctx.gdh.getObjectFromName(e.userdata.e.eventName,GdhOp.GET_OP_METHOD_PLC,h.open_plc_cb,n),console.log("toolitem7 event")}}),document.getElementById("toolitem8").addEventListener("click",function(t){console.log("toolitem8 event")}),document.getElementById("toolitem9").addEventListener("click",function(t){console.log("toolitem9 event");var e=h.ctx.get_select();null!==e&&e.userdata.open_attributes(h)}),document.getElementById("toolitem10").addEventListener("click",function(t){var e=h.ctx.get_select();null!==e&&(h.ctx.gdh.crrSignal(e.userdata.e.eventName,h.open_crr_cb,e),console.log("toolitem10 event"))}),document.getElementById("toolitem11").addEventListener("click",function(t){console.log("toolitem11 event")}),document.getElementById("toolitem12").addEventListener("click",function(t){console.log("toolitem12 event");var e=h.ctx.get_select();if(null!=e&&e.userdata instanceof EvItemAlarm){var n=window.open("","_blank");h.ctx.gdh.getObjectFromName(e.userdata.e.eventName,GdhOp.GET_OP_METHOD_HELPCLASS,h.open_helpclass_cb,n)}})},this.is_authorized=function(t){return!!(this.priv&t)},this.gdh_init_cb=function(){null==h.priv&&h.ctx.gdh.login("","",h.login_cb,h),h.ctx.gdh.listSent=!0,h.trace_cyclic()},this.login_cb=function(t,e,n,i){console.log("Login:",n,i),h.priv=1&n?i:0},this.sync_cb=function(t,e,n,i){if(1&n&&0!==i.length)if(h.type==EvC.eType_AlarmList){h.ctx.set_nodraw();for(var s=i.length-1;0<=s;s--){switch((l=i[s]).eventType){case MhC.eEvent_Alarm:case MhC.eEvent_MaintenanceAlarm:case MhC.eEvent_SystemAlarm:case MhC.eEvent_UserAlarm1:case MhC.eEvent_UserAlarm2:case MhC.eEvent_UserAlarm3:case MhC.eEvent_UserAlarm4:case MhC.eEvent_Info:case MhC.eEvent_InfoSuccess:if(h.ctx.size()>=h.maxEve){var a=h.ctx.get_last_object();h.ctx.remove(a)}new EvItemAlarm(h,l,null,Plow.DEST_BEFORE);break;case MhC.eEvent_Ack:null!==(o=h.find_event(l.targetId))&&(o.e.eventStatus&MhC.mEventStatus_NotRet?(o.e.eventStatus&=~MhC.mEventStatus_NotAck,o.update()):h.ctx.remove(o.node));break;case MhC.eEvent_Return:var o;null!==(o=h.find_event(l.targetId))&&(o.e.eventStatus&MhC.mEventStatus_NotAck?(o.e.eventStatus&=~MhC.mEventStatus_NotRet,o.update()):h.ctx.remove(o.node))}h.mhSyncIdx<i[s].syncIdx&&(h.mhSyncIdx=i[s].syncIdx)}h.ctx.configure(),h.ctx.reset_nodraw(),h.ctx.draw()}else if(h.type==EvC.eType_EventList){h.ctx.set_nodraw();for(s=i.length-1;0<=s;s--){var l=i[s];if(h.ctx.size()>=h.maxEve){a=h.ctx.get_last_object();h.ctx.remove(a)}new EvItemAlarm(h,l,null,Plow.DEST_BEFORE),h.mhSyncIdx<i[s].syncIdx&&(h.mhSyncIdx=i[s].syncIdx)}h.ctx.configure(),h.ctx.reset_nodraw(),h.ctx.draw()}},this.find_event=function(t){for(var e=this.ctx.get_first_object();null!==e;e=this.ctx.get_next_object(e)){var n=e.get_userdata();if(n.e.eventId.nix==t.nix&&n.e.eventId.idx==t.idx)return n}return null},this.is_authorized=function(t){return!!(this.priv&t)},this.ack=function(){if(this.is_authorized(Pwr.mAccess_RtEventsAck)){var t=this.ctx.get_first_object();if(null!==t){var e=t.get_userdata();console.log("Ack",e.e.eventText),this.ctx.gdh.mhAcknowledge(e.e.eventId,this.ack_cb,this),e.e.eventStatus&MhC.mEventStatus_NotRet?(e.e.eventStatus&=~MhC.mEventStatus_NotAck,e.update()):this.ctx.remove(e.node),this.ctx.configure(),this.ctx.draw()}}else window.alert("Not authorzed for this operation")},this.ack_cb=function(t,e,n){console.log("ack sts",n)},this.open_objectgraph_cb=function(t,e,n,i){0!=(1&n)?(e.location.href="ge.html?graph="+i.param1+"&instance="+i.fullname,e.document.title=i.fullname):e.document.write("Error status "+n)},this.open_graph_cb=function(t,e,n,i){if(0!=(1&n)){var s=i.param1.indexOf(".");-1!=s&&(i.param1=i.param1.substring(0,s));var a="";""!==i.fullname&&(a="&instance="+i.fullname),e.location.href="ge.html?graph="+i.param1+a,e.document.title=i.param1}else e.document.write("Error status "+n)},this.open_plc_cb=function(t,e,n,i){var s;0!=(1&n)?(s=""!==i.param1?"&obj="+i.param1:"",console.log("flow.html?vid="+i.objid.vid+"&oix="+i.objid.oix+s),e.location.href="flow.html?vid="+i.objid.vid+"&oix="+i.objid.oix+s,e.document.title="Trace "+i.fullname):e.document.write("Error status "+n)},this.open_navigator_cb=function(t,e,n,i){console.log("Open navigator",n),0!=(1&n)?(localStorage.setItem("XttMethodNavigator",i.fullname),console.log("storage",localStorage.getItem("XttMethodNavigator"))):console.log("Error status "+n)},this.open_objectgraph_cb=function(t,e,n,i){if(0!=(1&n)){var s=i.classname.toLowerCase();"$"==s.substring(0,1)&&(s=s.substring(1));var a="pwr_c_"+s;e.location.href="ge.html?graph="+a+"&instance="+i.fullname,e.document.title=a+" "+i.fullname}else e.document.write("Error status "+n)},this.open_helpclass_cb=function(t,e,n,i){if(0!=(1&n)){console.log("open_helpclass",i.param1);var s=location.protocol+"//"+location.host+i.param1;e.location.href=s}else e.document.write("Error status "+n)},this.methods_init=function(){localStorage.setItem("EvMethodNavigator","")},this.collapse=function(){this.ctx.set_nodraw();for(var t=0;t<this.ctx.a.size();t++){var e=this.ctx.a.get(t);0==e.level&&e.userdata.close(this)}this.ctx.reset_nodraw(),this.ctx.draw()},this.trace_cyclic=function(){h.ctx.gdh.mhSync(h.mhSyncIdx,h.sync_cb,h),h.timer=setTimeout(h.trace_cyclic,1e3)},this.trace_scan=function(t,e){h.scan_update=!1,h.scan_update&&h.ctx.draw()},this.createNodeClasses=function(){var t=new PlowRect(this.ctx,0,0,50,1,Plow.COLOR_WHITE,Plow.COLOR_WHITE,!0,!1),e=new PlowRect(this.ctx,.1,.15,.7,.7,Plow.COLOR_RED,Plow.COLOR_BLACK,!0,!1),n=new PlowRect(this.ctx,.1,.15,.7,.7,Plow.COLOR_YELLOW,Plow.COLOR_BLACK,!0,!1),i=new PlowRect(this.ctx,.1,.15,.7,.7,Plow.COLOR_WHITE,Plow.COLOR_BLACK,!0,!1),s=new PlowRect(this.ctx,.1,.15,.7,.7,Plow.COLOR_GREEN,Plow.COLOR_BLACK,!0,!1),a=new PlowAnnot(this.ctx,1,.9,4,Plow.COLOR_BLACK,0,0),o=new PlowAnnotPixmap(this.ctx,1.8,.2,0),l=new PlowAnnotPixmap(this.ctx,2.4,.2,1),h=new PlowAnnotPixmap(this.ctx,3.2,.2,2),r=new PlowAnnotPixmap(this.ctx,4,.2,3),A=new PlowAnnot(this.ctx,4.8,.9,4,Plow.COLOR_BLACK,0,1),c=new PlowAnnot(this.ctx,11.5,.9,4,Plow.COLOR_BLACK,Plow.NEXT_RELATIVE_POSITION,2),g=new PlowAnnot(this.ctx,22.5,.9,4,Plow.COLOR_BLACK,Plow.RELATIVE_POSITION,3);this.ncAlarmA=new PlowNodeClass(this.ctx),this.ncAlarmA.insert(t),this.ncAlarmA.insert(e),this.ncAlarmA.insert(a),this.ncAlarmA.insert(o),this.ncAlarmA.insert(l),this.ncAlarmA.insert(h),this.ncAlarmA.insert(r),this.ncAlarmA.insert(A),this.ncAlarmA.insert(c),this.ncAlarmA.insert(g),this.ctx.insert_nc(this.ncAlarmA),this.ncAlarmB=new PlowNodeClass(this.ctx),this.ncAlarmB.insert(t),this.ncAlarmB.insert(n),this.ncAlarmB.insert(a),this.ncAlarmB.insert(o),this.ncAlarmB.insert(l),this.ncAlarmB.insert(h),this.ncAlarmB.insert(r),this.ncAlarmB.insert(A),this.ncAlarmB.insert(c),this.ncAlarmB.insert(g),this.ctx.insert_nc(this.ncAlarmB),this.ncAlarm=new PlowNodeClass(this.ctx),this.ncAlarm.insert(t),this.ncAlarm.insert(a),this.ncAlarm.insert(o),this.ncAlarm.insert(l),this.ncAlarm.insert(h),this.ncAlarm.insert(r),this.ncAlarm.insert(A),this.ncAlarm.insert(c),this.ncAlarm.insert(g),this.ctx.insert_nc(this.ncAlarm),this.ncInfo=new PlowNodeClass(this.ctx),this.ncInfo.insert(t),this.ncInfo.insert(i),this.ncInfo.insert(a),this.ncInfo.insert(o),this.ncInfo.insert(l),this.ncInfo.insert(h),this.ncInfo.insert(r),this.ncInfo.insert(A),this.ncInfo.insert(c),this.ncInfo.insert(g),this.ctx.insert_nc(this.ncInfo),this.ncSuccess=new PlowNodeClass(this.ctx),this.ncSuccess.insert(t),this.ncSuccess.insert(s),this.ncSuccess.insert(a),this.ncSuccess.insert(o),this.ncSuccess.insert(l),this.ncSuccess.insert(h),this.ncSuccess.insert(r),this.ncSuccess.insert(A),this.ncSuccess.insert(c),this.ncSuccess.insert(g),this.ctx.insert_nc(this.ncSuccess)},this.plow_event=function(t,e,n,i){var s=null;switch(null!=e&&(s=e.get_userdata()),t){case Plow.eEvent_ObjectDeleted:break;case Plow.eEvent_MB1Click:null!=s&&""!==s.e.eventMoreText&&n>=e.measure().ll_x+70&&n<=e.measure().ll_x+90?window.alert(s.e.eventMoreText):e.select?(e.set_select(!1),e.set_invert(!1)):(h.ctx.set_select(!1),e.set_select(!0),h.ctx.set_invert(!1),e.set_invert(!0),h.ctx.draw());break;case Plow.eEvent_MB1ClickShift:break;case Plow.eEvent_Key_Down:if(null!=(l=h.ctx.get_select()))null!=(a=h.ctx.get_next_object(l))&&(l.set_select(!1),l.set_invert(!1),a.set_select(!0),a.set_invert(!0),h.ctx.is_visible(a)||h.ctx.scroll(a.y_low,.1));else(l=h.ctx.a.a[0]).set_select(!0),l.set_invert(!0);break;case Plow.eEvent_Key_Up:var a;if(null!=(l=h.ctx.get_select()))null!=(a=h.ctx.get_previous_object(l))&&(l.set_select(!1),l.set_invert(!1),a.set_select(!0),a.set_invert(!0),l.draw(h.ctx.gdraw.gctx,null,null,0),a.draw(h.ctx.gdraw.gctx,null,null,0),h.ctx.is_visible(a)||h.ctx.scroll(a.y_low,.9));break;case Plow.eEvent_Key_Right:case Plow.eEvent_Key_Left:case Plow.eEvent_Key_ShiftRight:case Plow.eEvent_Key_CtrlR:break;case Plow.eEvent_Key_CtrlL:if((l=h.ctx.get_select()).userdata instanceof EvItemAlarm){var o=window.open("","_blank");h.ctx.gdh.getObject(l.userdata.objid,GdhOp.GET_OP_METHOD_PLC,h.open_plc_cb,o)}break;case Plow.eEvent_Key_CtrlG:var l;if((l=h.ctx.get_select()).userdata instanceof EvItemAlarm){o=window.open("","_blank");h.ctx.gdh.getObject(l.userdata.objid,GdhOp.GET_OP_METHOD_PLC,h.open_objectgraph_cb,o)}}},this.get_type=function(){var t=window.location.search.substring(1);if(""===t)return EvC.eType_AlarmList;var e=t.split("&")[0].substring(5);return"event"==e?EvC.eType_EventList:"block"==e?EvC.eType_BlockList:EvC.eType_AlarmList}}function EvItemAlarm(t,e,n,i){this.node,this.e=e;var s=t.ncAlarm;switch(this.e.eventType){case MhC.eEvent_Alarm:case MhC.eEvent_MaintenanceAlarm:case MhC.eEvent_SystemAlarm:case MhC.eEvent_UserAlarm1:case MhC.eEvent_UserAlarm2:case MhC.eEvent_UserAlarm3:case MhC.eEvent_UserAlarm4:case MhC.eEvent_Block:case MhC.eEvent_Reblock:case MhC.eEvent_CancelBlock:case MhC.eEvent_Unblock:switch(this.e.eventPrio){case MhC.eEventPrio_A:s=t.ncAlarmA;break;case MhC.eEventPrio_B:s=t.ncAlarmB;break;case MhC.eEventPrio_C:case MhC.eEventPrio_D:s=t.ncAlarm}break;case MhC.eEvent_Info:s=t.ncInfo;break;case MhC.eEvent_InfoSuccess:s=t.ncSuccess}switch(this.node=new PlowNode(t.ctx,s,0),t.ctx.insertNode(this.node,n,i),this.node.set_userdata(this),this.e.eventType){case MhC.eEvent_Alarm:case MhC.eEvent_MaintenanceAlarm:case MhC.eEvent_SystemAlarm:case MhC.eEvent_UserAlarm1:case MhC.eEvent_UserAlarm2:case MhC.eEvent_UserAlarm3:case MhC.eEvent_UserAlarm4:case MhC.eEvent_Block:case MhC.eEvent_Reblock:case MhC.eEvent_CancelBlock:case MhC.eEvent_Unblock:switch(this.e.eventPrio){case MhC.eEventPrio_A:this.node.set_annotation(0,"A");break;case MhC.eEventPrio_B:this.node.set_annotation(0,"B");break;case MhC.eEventPrio_C:this.node.set_annotation(0,"C");break;case MhC.eEventPrio_D:this.node.set_annotation(0,"D")}}switch(this.e.eventType){case MhC.eEvent_MaintenanceAlarm:this.node.set_annotation_pixmap(3,Bitmaps.maintenance);break;case MhC.eEvent_SystemAlarm:this.node.set_annotation_pixmap(3,Bitmaps.system);break;case MhC.eEvent_Block:this.e.eventText="Blocked";break;case MhC.eEvent_Reblock:this.e.eventText="Reblocked";break;case MhC.eEvent_CancelBlock:this.e.eventText="Block canceled";break;case MhC.eEvent_Unblock:this.e.eventText="Unblocked"}switch(this.node.set_annotation(1,this.e.eventTime.substring(0,17)),this.node.set_annotation(2,this.e.eventText),this.node.set_annotation(3,this.e.eventName),t.type){case EvC.eType_EventList:switch(this.e.eventType){case MhC.eEvent_Alarm:case MhC.eEvent_MaintenanceAlarm:case MhC.eEvent_SystemAlarm:case MhC.eEvent_UserAlarm1:case MhC.eEvent_UserAlarm2:case MhC.eEvent_UserAlarm3:case MhC.eEvent_UserAlarm4:case MhC.eEvent_Info:case MhC.eEvent_InfoSuccess:this.node.set_annotation_pixmap(0,Bitmaps.eventalarm);break;case MhC.eEvent_Ack:this.node.set_annotation_pixmap(0,Bitmaps.eventacked);break;case MhC.eEvent_Return:this.node.set_annotation_pixmap(0,Bitmaps.eventreturn);break;case MhC.eEvent_Block:case MhC.eEvent_Reblock:this.node.set_annotation_pixmap(0,Bitmaps.blockl);break;case MhC.eEvent_CancelBlock:case MhC.eEvent_Unblock:this.node.set_annotation_pixmap(0,Bitmaps.blockr)}break;case EvC.eType_AlarmList:this.e.eventStatus&MhC.mEventStatus_NotRet&&this.node.set_annotation_pixmap(1,Bitmaps.alarm),this.e.eventStatus&MhC.mEventStatus_NotAck&&this.node.set_annotation_pixmap(0,Bitmaps.ack),""!==this.e.eventMoreText&&this.node.set_annotation_pixmap(2,Bitmaps.info)}this.update=function(){this.e.eventStatus&MhC.mEventStatus_NotRet?this.node.set_annotation_pixmap(1,Bitmaps.alarm):this.node.set_annotation_pixmap(1,null),this.e.eventStatus&MhC.mEventStatus_NotAck?this.node.set_annotation_pixmap(0,Bitmaps.ack):this.node.set_annotation_pixmap(0,null)}}var ev=new Ev;ev.init();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Trace</title>
......@@ -6,23 +6,7 @@
</head>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button">
<img src="toolbar_graph.png"/>
</div>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_navigator.png"/>
</div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_history.png"/>
</div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_object.png"/>
</div>
</div>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=flow.js></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
<canvas id="canvas" width="1200" height="800"></canvas>
<script src="flow.bundle.js"></script>
</body>
</html>
"use strict";function PwrtStatus(e){this.sts=e,this.evenSts=function(){return e%2==0},this.oddSts=function(){return e%2==1},this.getSts=function(){return e}}var Pwr={eType_Boolean:98305,eType_Float32:98306,eType_Float64:98307,eType_Char:98308,eType_Int8:98309,eType_Int16:98310,eType_Int32:98311,eType_UInt8:98312,eType_UInt16:98313,eType_UInt32:98314,eType_Objid:98315,eType_Buffer:98316,eType_String:98317,eType_Enum:98318,eType_Struct:98319,eType_Mask:98320,eType_Array:98321,eType_Time:98322,eType_Text:98323,eType_AttrRef:98324,eType_UInt64:98325,eType_Int64:98326,eType_ClassId:98327,eType_TypeId:98328,eType_VolumeId:98329,eType_ObjectIx:98330,eType_RefId:98331,eType_DeltaTime:98332,eType_Status:98333,eType_NetStatus:98334,eType_CastId:98335,eType_ProString:98336,eType_DisableAttr:98337,eType_DataRef:98338,mPrv_RtRead:1,mPrv_RtWrite:2,mPrv_System:4,mPrv_Maintenance:8,mPrv_Process:16,mPrv_Instrument:32,mPrv_Operator1:64,mPrv_Operator2:128,mPrv_Operator3:256,mPrv_Operator4:512,mPrv_Operator5:1024,mPrv_Operator6:2048,mPrv_Operator7:4096,mPrv_Operator8:8192,mPrv_Operator9:16384,mPrv_Operator10:32768,mPrv_RtEventsAck:1<<18,mPrv_RtPlc:1<<19,mPrv_RtNavigator:1<<20,mPrv_DevRead:1<<21,mPrv_DevPlc:1<<22,mPrv_DevConfig:1<<23,mPrv_DevClass:1<<24,mPrv_RtEventsBlock:1<<25,mPrv_Administrator:1<<26,mPrv_SevRead:1<<27,mPrv_SevAdmin:1<<28,mAccess_RtRead:1,mAccess_RtWrite:2,mAccess_System:4,mAccess_Maintenance:8,mAccess_Process:16,mAccess_Instrument:32,mAccess_RtEventsBlock:1<<25,mAccess_RtEventsAck:1<<18,mAccess_RtPlc:1<<19,mAccess_RtNavigator:1<<20,mAccess_AllRt:35454975,mAccess_AllOperators:65472,mAccess_AllPwr:-1,mAdef_pointer:1,mAdef_array:2,mAdef_backup:4,mAdef_changelog:8,mAdef_state:16,mAdef_const:32,mAdef_rtvirtual:64,mAdef_devbodyref:128,mAdef_dynamic:256,mAdef_publicwrite:512,mAdef_noedit:1024,mAdef_invisible:2048,mAdef_refdirect:4096,mAdef_noinvert:8192,mAdef_noremove:16384,mAdef_rtdbref:32768,mAdef_private:65536,mAdef_class:131072,mAdef_superclass:262144,mAdef_buffer:524288,mAdef_nowbl:1048576,mAdef_alwayswbl:2097152,mAdef_disableattr:4194304,mAdef_rthide:8388608},Pwrb={mXttMethodsFlagsMask_IsConfigured:1,mXttOpMethodsMask_OpenGraph:1,mXttOpMethodsMask_OpenObjectGraph:2,mXttOpMethodsMask_OpenTrend:4,mXttOpMethodsMask_OpenHistory:8,mXttOpMethodsMask_OpenFast:16,mXttOpMethodsMask_Camera:32,mXttOpMethodsMask_HistEvent:64,mXttOpMethodsMask_BlockEvents:128,mXttOpMethodsMask_Help:256,mXttOpMethodsMask_Photo:512,mXttOpMethodsMask_Note:1024,mXttOpMethodsMask_ParentObjectGraph:2048,mXttMntMethodsMask_OpenObject:1,mXttMntMethodsMask_OpenTrace:2,mXttMntMethodsMask_RtNavigator:4,mXttMntMethodsMask_OpenCrossref:8,mXttMntMethodsMask_HelpClass:16,mXttMntMethodsMask_DataSheet:32,mXttMntMethodsMask_CircuitDiagram:64,mXttMntMethodsMask_Simulate:1<<31};function PwrtObjid(e,t){this.oix=t,this.vid=e}function PwrtAttrRef(){this.objid,this.offset,this.body,this.size,this.flags}function CdhrNumber(e,t){this.value=e,this.sts=t,this.evenSts=function(){return t%2==0},this.oddSts=function(){return t%2==1},this.getSts=function(){return t}}var CdhC={cUserVolMin:65793,cUserVolMax:16711422};function UserdataCbReturn(){this.userdata,this.row}function Sub(){this.sts,this.refid,this.type,this.elements,this.name,this.value}function ObjectInfo(){this.objid,this.cid,this.has_children,this.name,this.description,this.classname,this.full_name,this.param1}function AttributeInfo(){this.name,this.type,this.size,this.flags,this.element,this.objid,this.full_name,this.classname}function MenuButton(){this.type,this.text,this.name,this.url}function OpwindMenuInfo(){this.title,this.text,this.enable_language,this.enable_login,this.enable_alarmlist,this.enable_eventlog,this.enable_navigator,this.disable_help,this.disable_proview,this.language,this.buttons=[]}function CrrInfo(){this.type,this.objid,this.name,this.classname}function GlowPieInfo(){this.sector_num,this.min_val,this.max_val}function GlowBarChartInfo(){this.bars,this.barsegments,this.min_value,this.max_value}function GlowTableInfo(){this.columns,this.rows,this.column_size=new Array(Glow.TABLE_MAX_COL)}function PendingData(e,t){this.func_cb=e,this.data=t}var GdhOp={GET_OP_SELF:1,GET_OP_METHOD_PLC:2,GET_OP_METHOD_OBJECTGRAPH:3,GET_OP_METHOD_GRAPH:4,GET_OP_METHOD_HELPCLASS:5};function Gdh(){var P=1,j=2,O=3,z=4,D=5,R=6,M=7,N=9,L=10,E=15,G=25,B=26,X=29,W=36,H=39,V=42,q=50,Y=57,J=63,K=64,Q=65,Z=66,$=67,ee=68;this.debug=!1,this.pending=[],this.sub=[],this.PORT=4448,this.ws=null,this.open_cb=null,this.close_cb=null,this.return_cb=null,this.next_id=1234,this.subscriptionCount=1,this.listSend=!1,this.init=function(){""===window.location.hostname?this.ws=new WebSocket("ws:127.0.0.1:4448"):this.ws=new WebSocket("ws://"+window.location.hostname+":4448"),this.ws.binaryType="arraybuffer",(this.ws.gdh=this).ws.onopen=function(e){null!==this.gdh.open_cb&&this.gdh.open_cb()},this.ws.onclose=function(){this.debug&&console.log("Socket closed"),null!==this.gdh.close_cb&&this.gdh.close_cb()},this.ws.onmessage=function(e){if("string"==typeof e.data)console.log("String message received",e,e.data);else if(e.data instanceof ArrayBuffer){var t=new DataView(e.data),n=t.getUint8(0),i=t.getUint32(1),a=t.getUint32(5);switch(n){case D:this.gdh.debug&&console.log("GetObjectInfoBoolean received");var o=t.getUint8(9);(0,this.gdh.pending[i].func_cb)(i,a,o),delete this.gdh.pending[i];break;case M:this.gdh.debug&&console.log("GetObjectInfoInt received");o=t.getUint32(9);(U=this.gdh.pending[i]).func_cb(i,U.data,a,o),delete this.gdh.pending[i];break;case R:this.gdh.debug&&console.log("GetObjectInfoFloat received");o=t.getFloat32(9);(U=this.gdh.pending[i]).func_cb(i,U.data,a,o),delete this.gdh.pending[i];break;case Y:this.gdh.debug&&console.log("GetObjectInfoFloatArray received");var s=t.getInt32(9);o=new Array(s);g=13;for(var r=0;r<s;r++)o[r]=t.getFloat32(g),g+=4;(U=this.gdh.pending[i]).func_cb(i,U.data,a,o),delete this.gdh.pending[i];break;case P:this.gdh.debug&&console.log("SetObjectInfoBoolean received",i,a);break;case O:this.gdh.debug&&console.log("SetObjectInfoInt received",i,a);break;case j:this.gdh.debug&&console.log("SetObjectInfoFloat received",i,a);break;case z:this.gdh.debug&&console.log("SetObjectInfoString received",i,a);break;case N:this.gdh.debug&&console.log("ToggleObjectInfo received",i,a);break;case L:this.gdh.debug&&console.log("RefObjectInfo received",i,a),delete this.gdh.pending[i];break;case E:this.gdh.debug&&console.log("UnrefObjectInfo received",i,a),delete this.gdh.pending[i];break;case B:this.gdh.debug&&console.log("RefObjectInfoList received",i,a),(0,this.gdh.pending[i].func_cb)(i,a),delete this.gdh.pending[i];break;case G:var _=9,l=t.getUint32(_);this.gdh.debug&&console.log("GetObjectRefInfoAll received",i,l),_+=4;for(r=0;r<l;r++){var h=t.getUint32(_);_+=4;var c=t.getUint32(_);_+=4;var d=this.gdh.sub[h];if(void 0===d)_+=c;else{switch(d.type){case Pwr.eType_Boolean:if(d.elements<=1)o=t.getUint8(_),_+=1;else{(v=c)!=d.elements&&console.log("Subscription size error",v,d.elements,h),o=new Array(v);for(var g=0;g<v;g++)o[g]=t.getUint8(_),_+=1}break;case Pwr.eType_Float32:if(d.elements<=1)o=t.getFloat32(_),_+=4;else{(v=c/4)!=d.elements&&console.log("Subscription size error",v,d.elements,h),o=new Array(v);for(g=0;g<v;g++)o[g]=t.getFloat32(_),_+=4}break;case Pwr.eType_Int8:case Pwr.eType_Int16:case Pwr.eType_Int32:case Pwr.eType_UInt8:case Pwr.eType_UInt16:case Pwr.eType_UInt32:case Pwr.eType_Status:case Pwr.eType_NetStatus:case Pwr.eType_Mask:case Pwr.eType_Enum:case GraphIfc.eType_Bit:if(d.elements<=1)o=t.getInt32(_),_+=4;else{(v=c/4)!=d.elements&&console.log("Subscription size error",v,d.elements,h),o=new Array(v);for(g=0;g<v;g++)o[g]=t.getInt32(_),_+=4}break;case Pwr.eType_String:case Pwr.eType_Time:case Pwr.eType_DeltaTime:case Pwr.eType_AttrRef:case Pwr.eType_Objid:if(d.elements<=1){var w=t.getInt16(_);_+=2;var f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);o=String.fromCharCode.apply(null,f)}else{var v;(v=d.elements)!=d.elements&&console.log("Subscription size error",v,d.elements,h),o=new Array(v);for(var p=0;p<v;p++){w=t.getInt16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);o[p]=String.fromCharCode.apply(null,f)}}}this.gdh.sub[h].value=o}}if(void 0===this.gdh.pending[i]){console.log("** GetObjectRefInfoAll received removed",i);break}(0,this.gdh.pending[i].func_cb)(i,a),delete this.gdh.pending[i];break;case H:var u=[];_=9,l=t.getUint32(_);this.gdh.debug&&console.log("GetAllXttChildren received",i,l),console.log("GetAllXttChildren received",a,i,l),_+=4;for(r=0;r<l;r++){(y=new ObjectInfo).objid=new PwrtObjid,y.objid.vid=t.getUint32(_),_+=4,y.objid.oix=t.getUint32(_),_+=4,y.cid=t.getUint32(_),_+=4,y.has_children=0!==t.getUint16(_),_+=2;w=t.getUint16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);y.name=String.fromCharCode.apply(null,f);var b=t.getUint16(_);_+=2,f=new Uint8Array(b);for(g=0;g<b;g++)f[g]=t.getUint8(_++);y.description=String.fromCharCode.apply(null,f);var x=t.getUint16(_);_+=2,f=new Uint8Array(x);for(g=0;g<x;g++)f[g]=t.getUint8(_++);y.classname=String.fromCharCode.apply(null,f),u.push(y)}(U=this.gdh.pending[i]).func_cb(i,U.data,a,u),delete this.gdh.pending[i];break;case W:u=[],_=9,l=t.getUint32(_);this.gdh.debug&&console.log("GetAllClassAttributes received",i,l),_+=4;for(r=0;r<l;r++){(y=new AttributeInfo).type=t.getUint32(_),_+=4,y.flags=t.getUint32(_),_+=4,y.size=t.getUint16(_),_+=2,y.elements=t.getUint16(_),_+=2;w=t.getUint16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);y.name=String.fromCharCode.apply(null,f),w=t.getUint16(_),_+=2,f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);y.classname=String.fromCharCode.apply(null,f),u.push(y)}(U=this.gdh.pending[i]).func_cb(i,U.data,a,u),delete this.gdh.pending[i];break;case J:case ee:case Q:this.gdh.debug&&console.log("GetObject received",i,a);var y=null;if(0!=(1&a)){_=9;(y=new ObjectInfo).objid=new PwrtObjid,y.objid.vid=t.getUint32(_),_+=4,y.objid.oix=t.getUint32(_),_+=4,y.cid=t.getUint32(_),_+=4,y.has_children=0!==t.getUint16(_),_+=2;w=t.getUint16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);y.name=String.fromCharCode.apply(null,f),w=t.getUint16(_),_+=2,f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);y.fullname=String.fromCharCode.apply(null,f);x=t.getUint16(_);_+=2,f=new Uint8Array(x);for(g=0;g<x;g++)f[g]=t.getUint8(_++);y.classname=String.fromCharCode.apply(null,f);b=t.getUint16(_);_+=2,f=new Uint8Array(b);for(g=0;g<b;g++)f[g]=t.getUint8(_++);y.description=String.fromCharCode.apply(null,f);var S=t.getUint16(_);_+=2,f=new Uint8Array(S);for(g=0;g<S;g++)f[g]=t.getUint8(_++);y.param1=String.fromCharCode.apply(null,f)}(U=this.gdh.pending[i]).func_cb(i,U.data,a,y),delete this.gdh.pending[i];break;case V:if(0!=(1&a)){_=9,u=[],l=t.getUint16(_);_+=2,this.gdh.debug&&console.log("CrrSignal received",i,l);for(r=0;r<l;r++){(y=new CrrInfo).type=t.getUint16(_),_+=2,y.objid=new PwrtObjid,y.objid.vid=t.getUint32(_),_+=4,y.objid.oix=t.getUint32(_),_+=4;w=t.getUint16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);y.name=String.fromCharCode.apply(null,f);x=t.getUint16(_);_+=2,f=new Uint8Array(x);for(g=0;g<x;g++)f[g]=t.getUint8(_++);y.classname=String.fromCharCode.apply(null,f),u.push(y)}}(U=this.gdh.pending[i]).func_cb(i,U.data,a,u),delete this.gdh.pending[i];break;case K:u=new OpwindMenuInfo,_=9;if(this.gdh.debug&&console.log("GetOpwindMenu received",i,l),console.log("GetOpwindMenu received",a,i),1&a){w=t.getUint16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);u.title=String.fromCharCode.apply(null,f),w=t.getUint16(_),_+=2,f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);u.text=String.fromCharCode.apply(null,f),u.enable_language=t.getUint32(_),_+=4,u.enable_login=t.getUint32(_),_+=4,u.enable_alarmlist=t.getUint32(_),_+=4,u.enable_eventlog=t.getUint32(_),_+=4,u.enable_navigator=t.getUint32(_),_+=4,u.disable_help=t.getUint32(_),_+=4,u.disable_proview=t.getUint32(_),_+=4,u.language=t.getUint32(_),_+=4;var m=t.getUint16(_);_+=2;for(r=0;r<m;r++){var C=new MenuButton;C.type=t.getUint32(_),_+=4,w=t.getUint16(_),_+=2,f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);C.text=String.fromCharCode.apply(null,f),w=t.getUint16(_),_+=2,f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);C.name=String.fromCharCode.apply(null,f),w=t.getUint16(_),_+=2,f=new Uint8Array(w);for(g=0;g<w;g++)f[g]=t.getUint8(_++);C.url=String.fromCharCode.apply(null,f),u.buttons.push(C)}}(U=this.gdh.pending[i]).func_cb(i,U.data,a,u),delete this.gdh.pending[i];break;case X:_=9;this.gdh.debug&&console.log("Check user received",i,l),console.log("Check user received",a,i);var F=0;1&a&&(F=t.getUint32(_),_+=4),(U=this.gdh.pending[i]).func_cb(i,U.data,a,F),delete this.gdh.pending[i];break;case q:if(1&a){_=9,w=t.getUint16(_);_+=2;for(f=new Uint8Array(w),g=0;g<w;g++)f[g]=t.getUint8(_++);var k=String.fromCharCode.apply(null,f)}(U=this.gdh.pending[i]).func_cb(i,U.data,a,k),delete this.gdh.pending[i];break;case Z:u=[],_=9,l=t.getUint32(_);this.gdh.debug&&console.log("MhSync received",i,l),_+=4;for(r=0;r<l;r++){e=new MhEvent;var A=t.getUint16(_);_+=2;for(f=new Uint8Array(A),g=0;g<A;g++)f[g]=t.getUint8(_++);e.eventTime=String.fromCharCode.apply(null,f),A=t.getUint16(_),_+=2,f=new Uint8Array(A);for(g=0;g<A;g++)f[g]=t.getUint8(_++);e.eventText=String.fromCharCode.apply(null,f),A=t.getUint16(_),_+=2,f=new Uint8Array(A);for(g=0;g<A;g++)f[g]=t.getUint8(_++);e.eventName=String.fromCharCode.apply(null,f),e.eventFlags=t.getUint32(_),_+=4,e.eventStatus=t.getUint32(_),_+=4,e.eventPrio=t.getUint32(_),_+=4,e.eventId=new MhEventId,e.eventId.nix=t.getUint32(_),_+=4,e.eventId.idx=t.getUint32(_),_+=4,A=t.getUint16(_),_+=2,f=new Uint8Array(A);for(g=0;g<A;g++)f[g]=t.getUint8(_++);e.eventId.birthTime=String.fromCharCode.apply(null,f),e.targetId=new MhEventId,e.targetId.nix=t.getUint32(_),_+=4,e.targetId.idx=t.getUint32(_),_+=4,A=t.getUint16(_),_+=2,f=new Uint8Array(A);for(g=0;g<A;g++)f[g]=t.getUint8(_++);e.targetId.birthTime=String.fromCharCode.apply(null,f),e.eventType=t.getUint32(_),_+=4;var T=new PwrtObjid(0,0);T.vid=t.getUint32(_),_+=4,T.oix=t.getUint32(_),_+=4,e.object=new PwrtAttrRef,e.object.objid=T,e.object.offset=t.getUint32(_),_+=4,e.object.body=t.getUint32(_),_+=4,e.object.size=t.getUint32(_),_+=4,e.object.flags=t.getUint32(_),_+=4;var I=new PwrtObjid(0,0);I.vid=t.getUint32(_),_+=4,I.oix=t.getUint32(_),_+=4,e.supObject=new PwrtAttrRef,e.supObject.objid=I,e.supObject.offset=t.getUint32(_),_+=4,e.supObject.body=t.getUint32(_),_+=4,e.supObject.size=t.getUint32(_),_+=4,e.supObject.flags=t.getUint32(_),_+=4,A=t.getUint16(_),_+=2,f=new Uint8Array(A);for(g=0;g<A;g++)f[g]=t.getUint8(_++);e.eventMoreText=String.fromCharCode.apply(null,f),e.syncIdx=t.getUint32(_),_+=4,u.push(e)}(U=this.gdh.pending[i]).func_cb(i,U.data,a,u),delete this.gdh.pending[i];break;case $:var U;(U=this.gdh.pending[i]).func_cb(i,U.data,a),delete this.gdh.pending[i];break;default:console.log("Unknown message type")}}}},this.getObjectInfoBoolean=function(e,t){this.return_cb=t;var n=new Uint8Array(e.length+6);n[0]=D,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;for(var i=0;i<e.length;i++)n[i+6]=e.charCodeAt(i);this.pending[this.next_id]=new PendingData(t,null),this.ws.send(n),this.next_id++},this.getObjectInfoInt=function(e,t,n){this.return_cb=t;var i=new Uint8Array(e.length+6);i[0]=M,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var a=0;a<e.length;a++)i[a+6]=e.charCodeAt(a);this.pending[this.next_id]=new PendingData(t,n),this.ws.send(i),this.next_id++},this.getObjectInfoFloat=function(e,t,n){this.return_cb=t;var i=new Uint8Array(e.length+6);i[0]=R,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var a=0;a<e.length;a++)i[a+6]=e.charCodeAt(a);this.pending[this.next_id]=new PendingData(t,n),this.ws.send(i),this.next_id++},this.getObjectInfoFloatArray=function(e,t,n,i){this.return_cb=n;var a=new Uint8Array(e.length+10);a[0]=Y,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,a[6]=255&t,a[7]=t>>8&255,a[8]=t>>16&255,a[9]=t>>24&255;for(var o=0;o<e.length;o++)a[o+10]=e.charCodeAt(o);this.pending[this.next_id]=new PendingData(n,i),this.ws.send(a),this.next_id++},this.refObjectInfo=function(e,t,n){var i=new Sub;if(i.name=e,i.refid=this.subscriptionCount,i.type=t,i.elements=n,this.sub[this.subscriptionCount]=i,this.subscriptionCount++,this.listSent){var a;a=12+i.name.length;var o=new Uint8Array(a+10);o[0]=L,o[2]=255&this.next_id,o[3]=this.next_id>>8&255,o[4]=this.next_id>>16&255,o[5]=this.next_id>>24&255,this.debug&&console.log("RefObjectInfo: ",i.refid);var s=6;o[s++]=255&i.refid,o[s++]=i.refid>>8&255,o[s++]=i.refid>>16&255,o[s++]=i.refid>>24&255,o[s++]=255&i.elements,o[s++]=i.elements>>8&255,o[s++]=i.elements>>16&255,o[s++]=i.elements>>24&255,o[s++]=255&i.name.length,o[s++]=i.name.length>>8&255,o[s++]=i.name.length>>16&255,o[s++]=i.name.length>>24&255;for(var r=0;r<i.name.length;r++)o[s++]=i.name.charCodeAt(r);return this.pending[this.next_id]=new PendingData(this.refObjectInfoReply,null),this.debug&&console.log("Sending RefObjectInfo",this.next_id,a,s),this.ws.send(o),this.next_id++,i.refid}return i.refid},this.refObjectInfoReply=function(e,t){this.debug&&console.log("refObjectInfoReply",e,t)},this.unrefObjectInfo=function(e){var t=new Uint8Array(14);t[0]=E,t[2]=255&this.next_id,t[3]=this.next_id>>8&255,t[4]=this.next_id>>16&255,t[5]=this.next_id>>24&255,this.debug&&console.log("UnrefObjectInfo: ",e);var n=6;t[n++]=255&e,t[n++]=e>>8&255,t[n++]=e>>16&255,t[n++]=e>>24&255,this.pending[this.next_id]=new PendingData(this.unrefObjectInfoReply,null),this.debug&&console.log("Sending UnrefObjectInfo",this.next_id,4,10,e),this.ws.send(t),this.next_id++,delete this.sub[e]},this.refObjectInfoList=function(e){var t=0,n=0;for(var i in this.return_cb=e,this.sub)t+=12+this.sub[i].name.length,n++;var a=new Uint8Array(t+10);a[0]=B,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,a[6]=255&n,a[7]=n>>8&255,a[8]=n>>16&255,a[9]=n>>24&255;var o=10;for(var i in this.sub)if(0!==i){this.debug&&console.log("RefObjectInfoList: ",this.sub[i].refid),a[o++]=255&this.sub[i].refid,a[o++]=this.sub[i].refid>>8&255,a[o++]=this.sub[i].refid>>16&255,a[o++]=this.sub[i].refid>>24&255,a[o++]=255&this.sub[i].elements,a[o++]=this.sub[i].elements>>8&255,a[o++]=this.sub[i].elements>>16&255,a[o++]=this.sub[i].elements>>24&255,a[o++]=255&this.sub[i].name.length,a[o++]=this.sub[i].name.length>>8&255,a[o++]=this.sub[i].name.length>>16&255,a[o++]=this.sub[i].name.length>>24&255;for(var s=0;s<this.sub[i].name.length;s++)a[o++]=this.sub[i].name.charCodeAt(s)}this.pending[this.next_id]=new PendingData(e,null),this.debug&&console.log("Sending RefObjectInfoList",this.next_id,t,o,this.next_id),this.ws.send(a),this.next_id++,this.listSent=!0},this.refObjectInfoListReply=function(e,t){this.debug&&console.log("refObjectInfoListReply",e,t)},this.getRefObjectInfoAll=function(e){var t=new Uint8Array(6);t[0]=G,t[2]=255&this.next_id,t[3]=this.next_id>>8&255,t[4]=this.next_id>>16&255,t[5]=this.next_id>>24&255,this.pending[this.next_id]=new PendingData(e,null),this.debug&&console.log("Sending getRefObjectInfoAll",this.next_id),this.ws.send(t),this.next_id++},this.getRefObjectInfoAllReply=function(e,t){this.debug&&console.log("getRefObjectInfoAllReply",e,t)},this.getObjectRefInfo=function(e){return this.debug&&console.log("getObjectRefInfo",e,this.sub[e].value),this.sub[e].value},this.setObjectInfoBoolean=function(e,t){var n=new Uint8Array(12+e.length);n[0]=P,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t,n[7]=t>>8&255,n[8]=t>>16&255,n[9]=t>>24&255,n[10]=255&e.length,n[11]=e.length>>8&255;for(var i=12,a=0;a<e.length;a++)n[i++]=e.charCodeAt(a);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoBoolean",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.setObjectInfoInt=function(e,t){var n=new Uint8Array(12+e.length);n[0]=O,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t,n[7]=t>>8&255,n[8]=t>>16&255,n[9]=t>>24&255,n[10]=255&e.length,n[11]=e.length>>8&255;for(var i=12,a=0;a<e.length;a++)n[i++]=e.charCodeAt(a);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoInt",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.setObjectInfoFloat=function(e,t){var n=new Uint8Array(12+e.length);n[0]=j,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;var i=new ArrayBuffer(4);new Float32Array(i)[0]=t;var a=new Uint8Array(i);n[6]=a[0],n[7]=a[1],n[8]=a[2],n[9]=a[3],n[10]=255&e.length,n[11]=e.length>>8&255;for(var o=12,s=0;s<e.length;s++)n[o++]=e.charCodeAt(s);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoFloat",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.setObjectInfoString=function(e,t){var n,i=new Uint8Array(10+t.length+e.length);i[0]=z,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t.length,i[7]=t.length>>8&255;var a=8;for(n=0;n<t.length;n++)i[a++]=t.charCodeAt(n);for(i[a++]=255&e.length,i[a++]=e.length>>8&255,n=0;n<e.length;n++)i[a++]=e.charCodeAt(n);return this.ws.send(i),this.debug&&console.log("Sending setObjectInfoString",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.toggleObjectInfo=function(e){var t=new Uint8Array(8+e.length);t[0]=N,t[2]=255&this.next_id,t[3]=this.next_id>>8&255,t[4]=this.next_id>>16&255,t[5]=this.next_id>>24&255,t[6]=255&e.length,t[7]=e.length>>8&255;for(var n=8,i=0;i<e.length;i++)t[n++]=e.charCodeAt(i);return this.ws.send(t),this.debug&&console.log("Sending toggleObjectInfoBoolean",this.next_id,e,value),this.next_id++,new PwrtStatus(1)},this.getAllXttChildren=function(e,t,n){var i=new Uint8Array(14);i[0]=H,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.vid,i[7]=e.vid>>8&255,i[8]=e.vid>>16&255,i[9]=e.vid>>24&255,i[10]=255&e.oix,i[11]=e.oix>>8&255,i[12]=e.oix>>16&255,i[13]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending getAllXttChildren",this.next_id),this.ws.send(i),this.next_id++},this.getAllClassAttributes=function(e,t,n,i){var a=new Uint8Array(18);a[0]=W,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,a[6]=255&e,a[7]=e>>8&255,a[8]=e>>16&255,a[9]=e>>24&255,a[10]=255&t.vid,a[11]=t.vid>>8&255,a[12]=t.vid>>16&255,a[13]=t.vid>>24&255,a[14]=255&t.oix,a[15]=t.oix>>8&255,a[16]=t.oix>>16&255,a[17]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getAllClassAttributes",this.next_id,e,t.vid,t.oix),this.ws.send(a),this.next_id++},this.getObject=function(e,t,n,i){var a=new Uint8Array(16);a[0]=J,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,a[6]=255&t,a[7]=t>>8&255,a[8]=255&e.vid,a[9]=e.vid>>8&255,a[10]=e.vid>>16&255,a[11]=e.vid>>24&255,a[12]=255&e.oix,a[13]=e.oix>>8&255,a[14]=e.oix>>16&255,a[15]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObject",this.next_id,e.vid,e.oix),this.ws.send(a),this.next_id++},this.getObjectFromAref=function(e,t,n,i){var a=new Uint8Array(32);a[0]=ee,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,a[6]=255&t,a[7]=t>>8&255,a[8]=255&e.objid.vid,a[9]=e.objid.vid>>8&255,a[10]=e.objid.vid>>16&255,a[11]=e.objid.vid>>24&255,a[12]=255&e.objid.oix,a[13]=e.objid.oix>>8&255,a[14]=e.objid.oix>>16&255,a[15]=e.objid.oix>>24&255,a[16]=255&e.offset,a[17]=e.offset>>8&255,a[18]=e.offset>>16&255,a[19]=e.offset>>24&255,a[20]=255&e.body,a[21]=e.body>>8&255,a[22]=e.body>>16&255,a[23]=e.body>>24&255,a[24]=255&e.size,a[25]=e.size>>8&255,a[26]=e.size>>16&255,a[27]=e.size>>24&255,a[28]=255&e.flags,a[29]=e.flags>>8&255,a[30]=e.flags>>16&255,a[31]=e.flags>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObject",this.next_id,oid.vid,oid.oix),this.ws.send(a),this.next_id++},this.getObjectFromName=function(e,t,n,i){var a=new Uint8Array(10+e.length);a[0]=Q,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255,a[6]=255&t,a[7]=t>>8&255,a[8]=255&e.length,a[9]=e.length>>8&255;for(var o=10,s=0;s<e.length;s++)a[o++]=e.charCodeAt(s);this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObjectFromName",this.next_id,e),this.ws.send(a),this.next_id++},this.crrSignal=function(e,t,n){var i=new Uint8Array(14);i[0]=V,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.vid,i[7]=e.vid>>8&255,i[8]=e.vid>>16&255,i[9]=e.vid>>24&255,i[10]=255&e.oix,i[11]=e.oix>>8&255,i[12]=e.oix>>16&255,i[13]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending crrObject",this.next_id,e.vid,e.oix),this.ws.send(i),this.next_id++},this.getOpwindMenu=function(e,t,n){e.length;var i=new Uint8Array(8+e.length);i[0]=K,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.length,i[7]=e.length>>8&255;for(var a=8,o=0;o<e.length;o++)i[a++]=e.charCodeAt(o);this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending getOpwindMenu",this.next_id),this.ws.send(i),this.next_id++},this.login=function(e,t,n,i){var a=new Uint8Array(8+e.length+2+t.length);a[0]=X,a[2]=255&this.next_id,a[3]=this.next_id>>8&255,a[4]=this.next_id>>16&255,a[5]=this.next_id>>24&255;var o=6;a[o]=255&e.length,a[o+1]=e.length>>8&255,o+=2;for(var s=0;s<e.length;s++)a[o++]=e.charCodeAt(s);a[o]=255&t.length,a[o+1]=t.length>>8&255,o+=2;for(s=0;s<t.length;s++)a[o++]=t.charCodeAt(s);this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending login",this.next_id),this.ws.send(a),this.next_id++},this.getMsg=function(e,t,n){var i=new Uint8Array(10);i[0]=q,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e,i[7]=e>>8&255,i[8]=e>>16&255,i[9]=e>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.ws.send(i),this.debug&&console.log("Sending getMsg",this.next_id,e),this.next_id++},this.mhSync=function(e,t,n){var i=new Uint8Array(10);i[0]=Z,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e,i[7]=e>>8&255,i[8]=e>>16&255,i[9]=e>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending mhSync",this.next_id),this.ws.send(i),this.next_id++},this.mhAcknowledge=function(e,t,n){var i=new Uint8Array(16+e.birthTime.length);i[0]=$,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.nix,i[7]=e.nix>>8&255,i[8]=e.nix>>16&255,i[9]=e.nix>>24&255,i[10]=255&e.idx,i[11]=e.idx>>8&255,i[12]=e.idx>>16&255,i[13]=e.idx>>24&255;var a=14;i[a]=255&e.birthTime.length,i[a+1]=e.birthTime.length>>8&255,a+=2;for(var o=0;o<e.birthTime.length;o++)i[a++]=e.birthTime.charCodeAt(o);this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending mhAcknowledge",this.next_id),console.log("Sending mhAcknowledge",this.next_id),this.ws.send(i),this.next_id++}}var Flow={DRAWOFFSET:2,eConType_Straight:0,eConType_Fixed:1,eConType_AllFixed:2,eConType_Routed:3,eConType_StepDiv:4,eConType_StepConv:5,eConType_TransDiv:6,eConType_TransConv:7,eConType_StraightOneArrow:8,eConType_Reference:9,eDrawType_Line:0,eDrawType_LineRed:1,eDrawType_LineGray:2,eDrawType_LineErase:3,eDrawType_LineDashed:4,eDrawType_LineDashedRed:5,eDrawType_TextHelvetica:6,eDrawType_TextHelveticaBold:7,eDrawType_TextHelveticaErase:8,eDrawType_TextHelveticaEraseBold:9,eDrawType_:10,eDrawType_Green:11,eDrawType_Yellow:12,eDrawType_DarkGray:13,eDrawType_Inherit:9999,mDisplayLevel_1:1,mDisplayLevel_2:4,mDisplayLevel_3:8,mDisplayLevel_4:16,mDisplayLevel_5:32,mDisplayLevel_6:64,eNodeGroup_Common:0,eNodeGroup_Document:1,eNodeGroup_Trace:2,eTraceType_Boolean:0,eTraceType_Int32:1,eTraceType_Float32:2,eTraceType_User:3,eSave_Ctx:1,eSave_Array:2,eSave_NodeClass:3,eSave_ConClass:4,eSave_Rect:5,eSave_Line:6,eSave_Point:7,eSave_Arc:8,eSave_Text:9,eSave_Node:10,eSave_Con:11,eSave_ConPoint:12,eSave_Annot:13,eSave_Arrow:14,eSave_Pixmap:15,eSave_AnnotPixmap:16,eSave_Radiobutton:17,eSave_Frame:18,eSave_AnnotPixmapButton:19,eSave_Triangle:20,eSave_End:99,eSave_Ctx_zoom_factor:100,eSave_Ctx_base_zoom_factor:101,eSave_Ctx_offset_x:102,eSave_Ctx_offset_y:103,eSave_Ctx_nav_zoom_factor:104,eSave_Ctx_print_zoom_factor:105,eSave_Ctx_nav_offset_x:106,eSave_Ctx_nav_offset_y:107,eSave_Ctx_x_right:108,eSave_Ctx_x_left:109,eSave_Ctx_y_high:110,eSave_Ctx_y_low:111,eSave_Ctx_window_width:112,eSave_Ctx_window_height:113,eSave_Ctx_nav_window_width:114,eSave_Ctx_nav_window_height:115,eSave_Ctx_nav_rect_ll_x:116,eSave_Ctx_nav_rect_ll_y:117,eSave_Ctx_nav_rect_ur_x:118,eSave_Ctx_nav_rect_ur_y:119,eSave_Ctx_nav_rect_hot:120,eSave_Ctx_name:121,eSave_Ctx_user_highlight:122,eSave_Ctx_a_nc:123,eSave_Ctx_a_cc:124,eSave_Ctx_a:125,eSave_Ctx_grid_size_x:126,eSave_Ctx_grid_size_y:127,eSave_Ctx_grid_on:128,eSave_Ctx_draw_delta:129,eSave_Ctx_refcon_width:130,eSave_Ctx_refcon_height:131,eSave_Ctx_refcon_textsize:132,eSave_Ctx_refcon_linewidth:133,eSave_Ctx_user_version:134,eSave_Array_a:200,eSave_NodeClass_nc_name:300,eSave_NodeClass_a:301,eSave_NodeClass_group:302,eSave_NodeClass_no_con_obstacle:303,eSave_ConClass_cc_name:400,eSave_ConClass_con_type:401,eSave_ConClass_corner:402,eSave_ConClass_draw_type:403,eSave_ConClass_line_width:404,eSave_ConClass_arrow_width:405,eSave_ConClass_arrow_length:406,eSave_ConClass_round_corner_amount:407,eSave_ConClass_group:408,eSave_Rect_draw_type:500,eSave_Rect_line_width:501,eSave_Rect_ll:502,eSave_Rect_ur:503,eSave_Rect_display_level:504,eSave_Rect_fill:505,eSave_Line_draw_type:600,eSave_Line_line_width:601,eSave_Line_p1:602,eSave_Line_p2:603,eSave_Point_x:700,eSave_Point_y:701,eSave_Arc_angel1:800,eSave_Arc_angel2:801,eSave_Arc_draw_type:802,eSave_Arc_line_width:803,eSave_Arc_ll:804,eSave_Arc_ur:805,eSave_Text_text_size:900,eSave_Text_draw_type:901,eSave_Text_text:902,eSave_Text_p:903,eSave_Node_nc:1e3,eSave_Node_pos:1001,eSave_Node_n_name:1002,eSave_Node_annotsize:1003,eSave_Node_annotv:1004,eSave_Node_refcon_cnt:1005,eSave_Node_x_right:1006,eSave_Node_x_left:1007,eSave_Node_y_high:1008,eSave_Node_y_low:1009,eSave_Node_trace_object:1010,eSave_Node_trace_attribute:1011,eSave_Node_trace_attr_type:1012,eSave_Node_obst_x_right:1013,eSave_Node_obst_x_left:1014,eSave_Node_obst_y_high:1015,eSave_Node_obst_y_low:1016,eSave_Node_trace_inverted:1017,eSave_Con_x_right:1100,eSave_Con_x_left:1101,eSave_Con_y_high:1102,eSave_Con_y_low:1103,eSave_Con_cc:1104,eSave_Con_dest_node:1105,eSave_Con_source_node:1106,eSave_Con_dest_conpoint:1107,eSave_Con_source_conpoint:1108,eSave_Con_dest_direction:1109,eSave_Con_source_direction:1110,eSave_Con_line_a:1111,eSave_Con_arc_a:1112,eSave_Con_arrow_a:1113,eSave_Con_ref_a:1114,eSave_Con_p_num:1115,eSave_Con_l_num:1116,eSave_Con_a_num:1117,eSave_Con_arrow_num:1118,eSave_Con_ref_num:1119,eSave_Con_point_x:1120,eSave_Con_point_y:1121,eSave_Con_source_ref_cnt:1122,eSave_Con_dest_ref_cnt:1123,eSave_Con_c_name:1124,eSave_Con_trace_object:1125,eSave_Con_trace_attribute:1126,eSave_Con_trace_attr_type:1127,eSave_Con_temporary_ref:1128,eSave_ConPoint_number:1200,eSave_ConPoint_direction:1201,eSave_ConPoint_p:1202,eSave_ConPoint_trace_attribute:1203,eSave_ConPoint_trace_attr_type:1204,eSave_Annot_number:1300,eSave_Annot_draw_type:1301,eSave_Annot_text_size:1302,eSave_Annot_p:1303,eSave_Annot_annot_type:1304,eSave_Annot_display_level:1305,eSave_Arrow_arrow_width:1400,eSave_Arrow_arrow_length:1401,eSave_Arrow_draw_type:1402,eSave_Arrow_line_width:1403,eSave_Arrow_p_dest:1404,eSave_Arrow_p1:1405,eSave_Arrow_p2:1406,eSave_Triangle_rect_part:2e3};function GDraw(e){this.ctx=e,this.canvas=document.querySelector("canvas"),this.gctx=this.canvas.getContext("2d"),this.offset_top=this.canvas.offsetTop,this.offset_left=this.canvas.offsetTop,console.log("offset_top",this.offset_top,"offset_left",this.offset_left),this.rect=function(e,t,n,i){this.gctx.strokeRect(e,t,n,i)},this.line=function(e,t,n,i){this.gctx.beginPath(),this.gctx.moveTo(e,t),this.gctx.lineTo(n,i),this.gctx.stroke()}}function FlowArray(b){this.a=[],this.ctx=b,this.add=function(e){this.a.push(e)},this.size=function(){return this.a.length},this.get=function(e){return this.a[e]},this.open=function(e,t){var n,i=!1;for(n=t;n<e.length;n++){var a=e[n].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("array : "+e[n]),o){case Flow.eSave_Array:break;case Flow.eSave_NodeClass:var s=new FlowNodeClass(b);n=s.open(e,n+1),this.a.push(s);break;case Flow.eSave_ConClass:var r=new FlowConClass(b);n=r.open(e,n+1),this.a.push(r);break;case Flow.eSave_Node:var _=new FlowNode(b);n=_.open(e,n+1),this.a.push(_);break;case Flow.eSave_Con:var l=new FlowCon(b);n=l.open(e,n+1),this.a.push(l);break;case Flow.eSave_Rect:var h=new FlowRect(b);n=h.open(e,n+1),this.a.push(h);break;case Flow.eSave_Line:var c=new FlowLine(b);n=c.open(e,n+1),this.a.push(c);break;case Flow.eSave_Triangle:var d=new FlowTriangle(b);n=d.open(e,n+1),this.a.push(d);break;case Flow.eSave_Arc:var g=new FlowArc(b);n=g.open(e,n+1),this.a.push(g);break;case Flow.eSave_Text:var w=new FlowText(b);n=w.open(e,n+1),this.a.push(w);break;case Flow.eSave_ConPoint:var f=new FlowConPoint(b);n=f.open(e,n+1),this.a.push(f);break;case Flow.eSave_Annot:var v=new FlowAnnot(b);n=v.open(e,n+1),this.a.push(v);break;case Flow.eSave_Arrow:var p=new FlowArrow(b);n=p.open(e,n+1),this.a.push(p);break;case Flow.eSave_Point:var u=new FlowPoint(b);n=u.open(e,n+1),this.a.push(u);break;case Flow.eSave_End:i=!0;break;default:console.log("Syntax error in FlowArray",o)}if(i)break}return n},this.draw=function(e,t,n,i){for(var a=0;a<this.a.length;a++)this.a[a].draw(e,t,n,i)},this.search_by_name=function(e){for(var t=e.toUpperCase(),n=0;n<this.a.length;n++)if(this.a[n]instanceof FlowNode&&(console.log("Search",this.a[n].n_name,e),this.a[n].n_name.toUpperCase()==t))return this.a[n];return null}}function FlowNodeClass(e){this.a=new FlowArray(e),this.ctx=e,this.nc_name="",this.group=0,this.draw=function(e,t,n,i){this.a.draw(e,t,n,i)},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("nodeclass : "+e[i]),o){case Flow.eSave_NodeClass_nc_name:this.nc_name=a[1];break;case Flow.eSave_NodeClass_a:i=this.a.open(e,i+1);break;case Flow.eSave_NodeClass_group:this.group=parseInt(a[1]);break;case Flow.eSave_NodeClass_no_con_obstacle:break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowNodeClass")}if(n)break}return i},this.event_handler=function(e,t){return 0}}function FlowConClass(e){this.cc_name="",this.con_type=0,this.corner=0,this.draw_type=0,this.line_width=0,this.arrow_width=0,this.arrow_length=0,this.round_corner_amount=0,this.group=0,this.ctx=e,this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("conclass : "+e[i]),o){case Flow.eSave_ConClass:break;case Flow.eSave_ConClass_cc_name:this.cc_name=a[1];break;case Flow.eSave_ConClass_con_type:this.con_type=parseInt(a[1]);break;case Flow.eSave_ConClass_corner:this.corner=parseInt(a[1]);break;case Flow.eSave_ConClass_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_ConClass_line_width:this.line_width=parseInt(a[1]);break;case Flow.eSave_ConClass_arrow_width:this.arrow_width=parseFloat(a[1]);break;case Flow.eSave_ConClass_arrow_length:this.arrow_length=parseFloat(a[1]);break;case Flow.eSave_ConClass_round_corner_amount:this.round_corner_amount=parseFloat(a[1]);break;case Flow.eSave_ConClass_group:this.group=parseInt(a[1]);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowConClass")}if(n)break}return i}}function FlowPoint(e){this.x=0,this.y=0,this.ctx=e,this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("point : "+e[i]),o){case Flow.eSave_Point:break;case Flow.eSave_Point_x:this.x=parseFloat(a[1]);break;case Flow.eSave_Point_y:this.y=parseFloat(a[1]);break;case Flow.eSave_End:n=!0;break;default:System.out.println("Syntax error in FlowPoint")}if(n)break}return i}}function FlowLine(e){this.p1=new FlowPoint(e),this.p2=new FlowPoint(e),this.draw_type=0,this.line_width=0,this.ctx=e,this.draw=function(e,t,n,i){var a=(this.p1.x+t.x)*this.ctx.zoom_factor,o=(this.p1.y+t.y)*this.ctx.zoom_factor,s=(this.p2.x+t.x)*this.ctx.zoom_factor,r=(this.p2.y+t.y)*this.ctx.zoom_factor;switch(e.lineWidth=this.ctx.zoom_factor/this.ctx.base_zoom_factor*this.line_width,e.lineWidth<1&&(e.lineWidth=1),this.draw_type){case Flow.eDrawType_LineDashed:case Flow.eDrawType_LineDashedRed:e.setLineDash([8,8])}switch(this.draw_type){case Flow.eDrawType_LineGray:e.strokeStyle="lightgray";break;case Flow.eDrawType_LineRed:case Flow.eDrawType_LineDashedRed:e.strokeStyle="red";break;case Flow.eDrawType_LineErase:return;default:e.strokeStyle="black"}switch(i&&(e.strokeStyle="red"),e.beginPath(),e.moveTo(a,o),e.lineTo(s,r),e.stroke(),this.draw_type){case Flow.eDrawType_LineDashed:case Flow.eDrawType_LineDashedRed:e.setLineDash([])}},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("line : "+e[i]),o){case Flow.eSave_Line:break;case Flow.eSave_Line_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_Line_line_width:this.line_width=parseInt(a[1]);break;case Flow.eSave_Line_p1:i=this.p1.open(e,i+1);break;case Flow.eSave_Line_p2:i=this.p2.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowLine")}if(n)break}return i}}function FlowRect(e){this.ll=new FlowPoint(e),this.ur=new FlowPoint(e),this.draw_type=0,this.line_width=0,this.display_level=0,this.fill=0,this.ctx=e,this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("rect : "+e[i]),o){case Flow.eSave_Rect:break;case Flow.eSave_Rect_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_Rect_line_width:this.line_width=parseInt(a[1]);break;case Flow.eSave_Rect_display_level:this.display_level=parseInt(a[1]);break;case Flow.eSave_Rect_fill:this.fill=parseInt(a[1]);break;case Flow.eSave_Rect_ll:i=this.ll.open(e,i+1);break;case Flow.eSave_Rect_ur:i=this.ur.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowRect")}if(n)break}return i},this.draw=function(e,t,n,i){if(0!=(this.display_level&this.ctx.display_level)){var a=(this.ll.x+t.x)*this.ctx.zoom_factor,o=(this.ll.y+t.y)*this.ctx.zoom_factor,s=(this.ur.x-this.ll.x)*this.ctx.zoom_factor,r=(this.ur.y-this.ll.y)*this.ctx.zoom_factor;switch(e.lineWidth=this.ctx.zoom_factor/this.ctx.base_zoom_factor*this.line_width,e.lineWidth<1&&(e.lineWidth=1),this.draw_type){case Flow.eDrawType_LineGray:e.strokeStyle="grey";break;case Flow.eDrawType_LineRed:case Flow.eDrawType_LineDashedRed:e.strokeStyle="red";break;case Flow.eDrawType_LineErase:return;default:e.strokeStyle="black"}i&&(e.strokeStyle="red"),e.strokeRect(a,o,s,r)}}}function FlowArc(e){this.ll=new FlowPoint(e),this.ur=new FlowPoint(e),this.angel1=0,this.angel2=0,this.draw_type=0,this.line_width=0,this.ctx=e,this.draw=function(e,t,n,i){var a=(this.ur.x-this.ll.x)/2*this.ctx.zoom_factor,o=(this.ll.x+t.x)*this.ctx.zoom_factor+a,s=(this.ll.y+t.y)*this.ctx.zoom_factor+a;if(90==this.angel1||270==this.angel1)var r=(this.angel1+90)/180*Math.PI;else r=(this.angel1-90)/180*Math.PI;var _=r+this.angel2/180*Math.PI;e.lineWidth=this.ctx.zoom_factor/this.ctx.base_zoom_factor*this.line_width,e.lineWidth<1&&(e.lineWidth=1),e.strokeStyle="black",i&&(e.strokeStyle="red"),e.beginPath(),e.arc(o,s,a,r,_,!1),e.stroke()},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("arc : "+e[i]),o){case Flow.eSave_Arc:break;case Flow.eSave_Arc_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_Arc_line_width:this.line_width=parseInt(a[1]);break;case Flow.eSave_Arc_angel1:this.angel1=parseFloat(a[1]);break;case Flow.eSave_Arc_angel2:this.angel2=parseFloat(a[1]);break;case Flow.eSave_Arc_ll:i=this.ll.open(e,i+1);break;case Flow.eSave_Arc_ur:i=this.ur.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowArc")}if(n)break}return i}}function FlowText(e){this.p=new FlowPoint(e),this.draw_type=0,this.text_size=0,this.text="",this.ctx=e,this.draw=function(e,t,n,i){var a=0,o=this.ctx.zoom_factor/this.ctx.base_zoom_factor*(this.text_size+4)-4;if(!(o<0)){var s=(this.p.x+t.x)*this.ctx.zoom_factor,r=(this.p.y+t.y)*this.ctx.zoom_factor;switch(o){case 0:a=8;break;case 1:a=10;break;case 2:a=12;break;case 3:case 4:a=14;break;case 5:a=8;break;case 6:case 7:a=18;break;default:a=3*o}e.font=a+"px Arial",e.lineWidth=.5,e.fillStyle="black",i&&(e.fillStyle="red"),e.fillText(this.text,s,r)}},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("text : "+e[i]),o){case Flow.eSave_Text:break;case Flow.eSave_Text_text_size:this.text_size=parseInt(a[1]);break;case Flow.eSave_Text_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_Text_text:this.text=a[1];break;case Flow.eSave_Text_p:i=this.p.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowText")}if(n)break}return i}}function FlowArrow(e){this.p1=new FlowPoint(e),this.p2=new FlowPoint(e),this.p_dest=new FlowPoint(e),this.arrow_width=0,this.arrow_length=0,this.draw_type=0,this.line_width=0,this.ctx=e,this.draw=function(e,t,n,i){var a=(this.p1.x+t.x)*this.ctx.zoom_factor,o=(this.p2.x+t.x)*this.ctx.zoom_factor,s=(this.p_dest.x+t.x)*this.ctx.zoom_factor,r=(this.p1.y+t.y)*this.ctx.zoom_factor,_=(this.p2.y+t.y)*this.ctx.zoom_factor,l=(this.p_dest.y+t.y)*this.ctx.zoom_factor;switch(this.draw_type){case Flow.eDrawType_LineGray:e.fillStyle="lightgray";break;case Flow.eDrawType_LineRed:case Flow.eDrawType_LineDashedRed:e.fillStyle="red";break;case Flow.eDrawType_LineErase:return;default:e.fillStyle="black"}i&&(e.fillStyle="red"),e.beginPath(),e.moveTo(a,r),e.lineTo(o,_),e.lineTo(s,l),e.lineTo(a,r),e.fill()},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("arrow : "+e[i]),o){case Flow.eSave_Arrow:break;case Flow.eSave_Arrow_arrow_width:this.arrow_width=parseFloat(a[1]);break;case Flow.eSave_Arrow_arrow_length:this.arrow_length=parseFloat(a[1]);break;case Flow.eSave_Arrow_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_Arrow_line_width:this.line_width=parseInt(a[1]);break;case Flow.eSave_Arrow_p_dest:i=this.p_dest.open(e,i+1);break;case Flow.eSave_Arrow_p1:i=this.p1.open(e,i+1);break;case Flow.eSave_Arrow_p2:i=this.p2.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowArrow")}if(n)break}}}function FlowTriangle(e){this.prototype=new FlowRect(e),this.draw=function(e,t,n,i){var a=(this.prototype.ll.x+t.x)*this.prototype.ctx.zoom_factor,o=(this.prototype.ll.y+t.y)*this.prototype.ctx.zoom_factor,s=(this.prototype.ur.x+t.x)*this.prototype.ctx.zoom_factor,r=(this.prototype.ur.y+t.y)*this.prototype.ctx.zoom_factor;e.lineWidth=this.prototype.ctx.zoom_factor/this.prototype.ctx.base_zoom_factor*this.prototype.line_width,e.lineWidth<1&&(e.lineWidth=1);var _=this.prototype.draw_type;if(_==Flow.eDrawType_Inherit&&null!=n&&(_=n.fill_color),1==this.prototype.fill){switch(_){case Flow.eDrawType_LineRed:e.fillStyle="red";break;case Flow.eDrawType_Green:e.fillStyle="green";break;case Flow.eDrawType_Yellow:e.fillStyle="yellow";break;default:e.fillStyle="gray"}e.beginPath(),e.moveTo(a,r),e.lineTo((a+s)/2,o),e.lineTo(s,r),e.lineTo(a,r),e.fill()}else e.strokeStyle="black",e.beginPath(),e.moveTo(a,r),e.lineTo((a+s)/2,o),e.lineTo(s,r),e.lineTo(a,r),e.stroke()},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.prototype.ctx.debug&&console.log("triangle : "+e[i]),o){case Flow.eSave_Triangle_rect_part:i=this.prototype.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowTriangle")}if(n)break}return i}}function FlowConPoint(s){this.p=new FlowPoint(s),this.number=0,this.direction=0,this.trace_attribute="",this.trace_attr_type=0,this.ctx=s,this.draw=function(e,t,n,i){},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(s.debug&&console.log("conpoint : "+e[i]),o){case Flow.eSave_ConPoint:break;case Flow.eSave_ConPoint_number:this.number=parseInt(a[1]);break;case Flow.eSave_ConPoint_direction:this.direction=parseInt(a[1]);break;case Flow.eSave_ConPoint_p:i=this.p.open(e,i+1);break;case Flow.eSave_ConPoint_trace_attribute:this.trace_attribute=a[1];break;case Flow.eSave_ConPoint_trace_attr_type:this.trace_attr_type=parseInt(a[1]);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowConPoint")}if(n)break}return i}}function FlowAnnot(e){this.p=new FlowPoint(e),this.draw_type=0,this.text_size=0,this.display_level=0,this.annot_type=0,this.number=0,this.ctx=e,this.draw=function(e,t,n,i){if(null!=n&&null!=n.annotv[this.number]&&0!=(this.display_level&this.ctx.display_level)){var a=0,o=this.ctx.zoom_factor/this.ctx.base_zoom_factor*(this.text_size+4)-4;if(!(o<0)){switch(o){case 0:a=8;break;case 1:a=10;break;case 2:a=12;break;case 3:case 4:a=14;break;case 5:case 6:case 7:a=18;break;default:a=3*o}switch(this.draw_type){case Flow.eDrawType_TextHelveticaBold:e.font="bold "+a+"px Arial";break;default:e.font=a+"px Arial"}e.fillStyle="black",i&&(e.fillStyle="red"),e.lineWidth=.5;for(var s=(this.p.x+t.x)*this.ctx.zoom_factor,r=(this.p.y+t.y)*this.ctx.zoom_factor-a/4,_=n.annotv[this.number].split("\n"),l=0;l<_.length;l++)e.fillText(_[l],s,r),r+=1.4*a}}},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("annot : "+e[i]),o){case Flow.eSave_Annot:break;case Flow.eSave_Annot_number:this.number=parseInt(a[1]);break;case Flow.eSave_Annot_draw_type:this.draw_type=parseInt(a[1]);break;case Flow.eSave_Annot_text_size:this.text_size=parseInt(a[1]);break;case Flow.eSave_Annot_display_level:this.display_level=parseInt(a[1]);break;case Flow.eSave_Annot_p:i=this.p.open(e,i+1);break;case Flow.eSave_Annot_annot_type:this.annot_type=parseInt(a[1]);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowAnnot")}if(n)break}return i}}function FlowCon(o){this.ctx=o,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.cc=null,this.p_num=0,this.l_num=0,this.a_num=0,this.arrow_num=0,this.ref_num=0,this.point_x=new FlowArray(o),this.point_y=new FlowArray(o),this.line_a=new FlowArray(o),this.arc_a=new FlowArray(o),this.arrow_a=new FlowArray(o),this.ref_a=new FlowArray(o),this.c_name="",this.trace_object="",this.trace_attribute="",this.trace_attr_type=0,this.temporary_ref=0,this.highlight=!1,this.redraw=!0,this.draw=function(e,t,n,i){if(this.redraw){var a=new FlowPoint(o);a.x=0,(a.y=0)!=this.temporary_ref||this.cc.con_type==Flow.eConType_Reference?this.ref_a.draw(e,a,null,i):(this.line_a.draw(e,a,null,i),this.arc_a.draw(e,a,null,i),this.arrow_a.draw(e,a,null,i)),this.redraw=!1}},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("con : "+e[i]),o){case Flow.eSave_Con:break;case Flow.eSave_Con_cc:for(var s=a[1],r=!1,_=0;_<this.ctx.a_cc.size();_++)if(this.ctx.a_cc.get(_).cc_name===s){this.cc=this.ctx.a_cc.get(_),r=!0;break}r||console.log("FlowCon: ConClass not found: "+s);break;case Flow.eSave_Con_c_name:null!=a[1]&&(this.c_name=a[1]);break;case Flow.eSave_Con_x_right:this.x_right=parseFloat(a[1]);break;case Flow.eSave_Con_x_left:this.x_left=parseFloat(a[1]);break;case Flow.eSave_Con_y_high:this.y_high=parseFloat(a[1]);break;case Flow.eSave_Con_y_low:this.y_low=parseFloat(a[1]);break;case Flow.eSave_Con_dest_node:case Flow.eSave_Con_source_node:i++;break;case Flow.eSave_Con_dest_conpoint:case Flow.eSave_Con_source_conpoint:case Flow.eSave_Con_dest_direction:case Flow.eSave_Con_source_direction:break;case Flow.eSave_Con_line_a:i=this.line_a.open(e,i+1);break;case Flow.eSave_Con_arc_a:i=this.arc_a.open(e,i+1);break;case Flow.eSave_Con_arrow_a:i=this.arrow_a.open(e,i+1);break;case Flow.eSave_Con_ref_a:i=this.ref_a.open(e,i+1);break;case Flow.eSave_Con_p_num:this.p_num=parseInt(a[1]);break;case Flow.eSave_Con_l_num:this.l_num=parseInt(a[1]);break;case Flow.eSave_Con_a_num:this.a_num=parseInt(a[1]);break;case Flow.eSave_Con_arrow_num:this.arrow_num=parseInt(a[1]);break;case Flow.eSave_Con_ref_num:this.ref_num=parseInt(a[1]);break;case Flow.eSave_Con_point_x:for(_=0;_<this.p_num;_++)i++,this.point_x[_]=parseFloat(e[i]);break;case Flow.eSave_Con_point_y:for(_=0;_<this.p_num;_++)i++,this.point_y[_]=parseFloat(e[i]);break;case Flow.eSave_Con_source_ref_cnt:case Flow.eSave_Con_dest_ref_cnt:break;case Flow.eSave_Con_trace_object:null!=a[1]&&(this.trace_object=a[1]);break;case Flow.eSave_Con_trace_attribute:null!=a[1]&&(this.trace_attribute=a[1]);break;case Flow.eSave_Con_trace_attr_type:this.trace_attr_type=parseInt(a[1]);break;case Flow.eSave_Con_temporary_ref:this.temporary_ref=parseInt(a[1]);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowCon")}if(n)break}return i},this.connect=function(){},this.scan=function(){}}function FlowNode(a){this.ctx=a,this.OFFSET=2,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.nc=null,this.pos=new FlowPoint(a),this.n_name="",this.annotv=[],this.annotsize=[],this.trace_object="",this.trace_attribute="",this.trace_attr_type=0,this.highlight=!1,this.select=!1,this.fill_color=0,this.p=0,this.old_value=0,this.first_scan=!0,this.redraw=!0,this.draw=function(e,t,n,i){if(this.redraw){if(this.nc.group!=Flow.eNodeGroup_Document){var a=this.x_left*this.ctx.zoom_factor,o=this.y_low*this.ctx.zoom_factor-1,s=(this.x_right-this.x_left)*this.ctx.zoom_factor,r=(this.y_high-this.y_low)*this.ctx.zoom_factor+2;e.fillStyle="white",this.select&&(e.fillStyle="lightblue"),e.fillRect(a,o,s,r)}this.nc.draw(e,this.pos,this,this.highlight),this.redraw=!1}},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.ctx.debug&&console.log("node : "+e[i]),o){case Flow.eSave_Node_nc:for(var s=a[1],r=!1,_=0;_<this.ctx.a_nc.size();_++)if(this.ctx.a_nc.get(_).nc_name===s){this.nc=this.ctx.a_nc.get(_),r=!0;break}r||console.log("FlowNode: NodeClass not found: "+s);break;case Flow.eSave_Node_n_name:null!=a[1]&&(this.n_name=a[1]);break;case Flow.eSave_Node_refcon_cnt:i+=32;break;case Flow.eSave_Node_x_right:this.x_right=parseFloat(a[1]);break;case Flow.eSave_Node_x_left:this.x_left=parseFloat(a[1]);break;case Flow.eSave_Node_y_high:this.y_high=parseFloat(a[1]);break;case Flow.eSave_Node_y_low:this.y_low=parseFloat(a[1]);break;case Flow.eSave_Node_annotsize:for(_=0;_<10;_++)i++,this.annotsize[_]=parseInt(e[i]);break;case Flow.eSave_Node_annotv:for(_=0;_<10;_++)if(0<this.annotsize[_]){for(var l,h=[],c=0,d=!1,g=!0;;)if(null!=e[++i]){for(var w=0;w<e[i].length;w++)if(l=c,c=e[i].charAt(w),g)g=!1;else if('"'!==c||"\\"!==l){if('"'===c){d=!0;break}h.push(c),w==e[i].length-1&&h.push("\n")}else h[h.length-1]=null;if(d)break}else h.push("\n");this.annotv[_]=h.join("")}break;case Flow.eSave_Node_pos:i=this.pos.open(e,i+1);break;case Flow.eSave_Node_trace_object:null!=a[1]&&(this.trace_object=a[1]);break;case Flow.eSave_Node_trace_attribute:null!=a[1]&&(this.trace_attribute=a[1]);break;case Flow.eSave_Node_trace_attr_type:this.trace_attr_type=parseInt(a[1]);break;case Flow.eSave_Node_obst_x_right:case Flow.eSave_Node_obst_x_left:case Flow.eSave_Node_obst_y_high:case Flow.eSave_Node_obst_y_low:case Flow.eSave_Node_trace_inverted:break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowNode")}if(n)break}return console.log("Node",this.trace_attr_type,this.n_name),i},this.connect=function(){if(""!=this.trace_object&&""!=this.trace_attribute&&this.trace_attr_type!=Flow.eTraceType_User){var e=this.trace_attribute.indexOf("#");-1!=e&&(this.trace_attribute=this.trace_attribute.substring(0,e));var t,n=this.trace_object+"."+this.trace_attribute;switch(this.trace_attr_type){case Flow.eTraceType_Boolean:t=Pwr.eType_Boolean;break;case Flow.eTraceType_Int32:t=Pwr.eType_Int32;break;case Flow.eTraceType_Float32:t=Pwr.eType_Float32;break;case Flow.eTraceType_User:return}this.p=this.ctx.gdh.refObjectInfo(n,t,1),console.log("connecting",n,this.p)}},this.scan=function(){if(0!=this.p){var e=this.ctx.gdh.getObjectRefInfo(this.p);if(this.first_scan)this.first_scan=!1;else if(e==this.old_value)return;this.highlight=!!e,this.old_value=e,this.redraw=!0}},this.event_handler=function(e,t){var n=e/this.ctx.zoom_factor+a.x_left,i=t/this.ctx.zoom_factor+a.y_low;return n>=this.x_left&&n<=this.x_right&&i>=this.y_low&&i<=this.y_high?(console.log("Hit in node"),this.select?(this.select=!1,this.redraw=!0):(this.ctx.set_select(!1),this.set_select(!0)),console.log("Hit in",this.n_name),1):0},this.set_select=function(e){e!=this.select&&(this.select=e,this.redraw=!0,this.select?this.ctx.select_object=this:this.ctx.select_object=null)}}function FlowCtx(){this.display_level=Flow.mDisplayLevel_1,this.gdh=0,this.debug=!1,this.zoom_factor=20,this.base_zoom_factor=20,this.offset_x=0,this.offset_y=0,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.a=new FlowArray(this),this.a_nc=new FlowArray(this),this.a_cc=new FlowArray(this),this.name="Claes context",this.gdraw=new GDraw(this),this.select_object=null,this.draw=function(){this.a.draw(this.gdraw.gctx,null,null,!1)},this.open=function(e,t){for(var n=!1,i=t;i<e.length;i++){var a=e[i].split(" "),o=parseInt(a[0]);switch(this.debug&&console.log("ctx : "+e[i]),o){case Flow.eSave_Ctx:break;case Flow.eSave_Ctx_zoom_factor:this.zoom_factor=parseFloat(a[1]);break;case Flow.eSave_Ctx_base_zoom_factor:this.base_zoom_factor=parseFloat(a[1]);break;case Flow.eSave_Ctx_offset_x:this.offset_x=parseInt(a[1]);break;case Flow.eSave_Ctx_offset_y:this.offset_y=parseInt(a[1]);break;case Flow.eSave_Ctx_nav_zoom_factor:case Flow.eSave_Ctx_print_zoom_factor:case Flow.eSave_Ctx_nav_offset_x:case Flow.eSave_Ctx_nav_offset_y:break;case Flow.eSave_Ctx_x_right:this.x_right=parseFloat(a[1]);break;case Flow.eSave_Ctx_x_left:this.x_left=parseFloat(a[1]);break;case Flow.eSave_Ctx_y_high:this.y_high=parseFloat(a[1]);break;case Flow.eSave_Ctx_y_low:this.y_low=parseFloat(a[1]);break;case Flow.eSave_Ctx_nav_rect_ll_x:case Flow.eSave_Ctx_nav_rect_ll_y:case Flow.eSave_Ctx_nav_rect_ur_x:case Flow.eSave_Ctx_nav_rect_ur_y:case Flow.eSave_Ctx_nav_rect_hot:break;case Flow.eSave_Ctx_name:this.name=a[1];break;case Flow.eSave_Ctx_user_highlight:case Flow.eSave_Ctx_grid_size_x:case Flow.eSave_Ctx_grid_size_y:case Flow.eSave_Ctx_grid_on:case Flow.eSave_Ctx_draw_delta:case Flow.eSave_Ctx_refcon_width:case Flow.eSave_Ctx_refcon_height:case Flow.eSave_Ctx_refcon_textsize:case Flow.eSave_Ctx_refcon_linewidth:case Flow.eSave_Ctx_user_version:break;case Flow.eSave_Ctx_a_nc:i=this.a_nc.open(e,i+1);break;case Flow.eSave_Ctx_a_cc:i=this.a_cc.open(e,i+1);break;case Flow.eSave_Ctx_a:i=this.a.open(e,i+1);break;case Flow.eSave_End:n=!0;break;default:console.log("Syntax error in FlowCtx",o)}if(n)break}return i},this.connect=function(){console.log("ctx connect",this.a.size());for(var e=0;e<this.a.size();e++)this.a.get(e).connect()},this.scan=function(){for(var e=0;e<this.a.size();e++)this.a.get(e).scan()},this.event_handler=function(e,t){for(var n=0,i=0;i<this.a.size()&&!(this.a.get(i)instanceof FlowNode&&1==(n=this.a.get(i).event_handler(e,t)));i++);1==n&&this.draw()},this.set_select=function(e){for(var t=0;t<this.a.size();t++)this.a.get(t)instanceof FlowNode&&this.a.get(t).set_select(e)},this.search_object=function(e){console.log("Searching for ",e);var t=this.a.search_by_name(e);return null!=t&&console.log("Found",e),t},this.center_object=function(e){console.log("center_object",e.pos.x*this.zoom_factor+this.offset_x,window.innerWidth,e.pos.x*this.zoom_factor+this.offset_x-window.innerWidth/2),console.log("center_object",e.pos.y*this.zoom_factor+this.offset_y,window.innerHeight,e.pos.y*this.zoom_factor+this.offset_y-window.innerHeight/2),window.scrollTo(e.pos.x*this.zoom_factor+this.offset_x-window.innerWidth/2,e.pos.y*this.zoom_factor+this.offset_y-window.innerHeight/2+this.gdraw.offset_top)}}function FlowFrame(){var i=this;this.ctx=new FlowCtx,this.timer=null,console.log("ctx: ",this.ctx),this.vars_object=null,this.readFlowWeb=function(e,t){var n=window.location.href.lastIndexOf("/"),i=window.location.href.substring(0,n+1);i+=e,console.log("Target: ",i);var a=new XMLHttpRequest;a.read_cb=t,a.open("GET",i,!0),a.addEventListener("load",function(){console.log("Done:",a.status);var e=a.responseText.split("\n");a.read_cb(e,0)}),a.send(null)},this.read_func=function(e,t){if(console.log("this.ctx:",i.ctx),i.ctx.open(e,t),i.ctx.gdraw.canvas.addEventListener("click",function(e){var t=e.pageY-i.ctx.gdraw.offset_top,n=e.pageX-10;console.log("Click",n,t),i.ctx.event_handler(n,t)}),document.getElementById("toolitem1").addEventListener("click",function(e){console.log("toolitem3 event")}),document.getElementById("toolitem2").addEventListener("click",function(e){console.log("toolitem1 event, storage"),console.log("storage",localStorage.getItem("XttMethodNavigator")),null!=i.ctx.select_object&&localStorage.setItem("XttMethodNavigator",i.ctx.select_object.trace_object),console.log("storage",localStorage.getItem("XttMethodNavigator")),console.log("toolitem2 event window",window.opener),window.opener.focus()}),document.getElementById("toolitem3").addEventListener("click",function(e){}),document.getElementById("toolitem4").addEventListener("click",function(e){}),i.ctx.gdraw.canvas.width=(i.ctx.x_right-i.ctx.x_left)*i.ctx.zoom_factor,i.ctx.gdraw.canvas.height=(i.ctx.y_high-i.ctx.y_low)*i.ctx.zoom_factor,i.ctx.gdraw.gctx.translate(-i.ctx.x_left*i.ctx.zoom_factor,-i.ctx.y_low*i.ctx.zoom_factor),i.ctx.offset_x-=i.ctx.x_left*i.ctx.zoom_factor,i.ctx.offset_y-=i.ctx.y_low*i.ctx.zoom_factor,i.ctx.draw(),console.log("New Gdh"),i.ctx.gdh=new Gdh(i.flow_open),i.ctx.gdh.open_cb=i.flow_open,i.ctx.gdh.close_cb=i.flow_close,console.log("ctx.gdh",i.ctx.gdh),i.ctx.gdh.init(),null!=i.vars_object){var n=i.ctx.search_object(i.vars_object);null!=n&&(i.ctx.center_object(n),i.ctx.set_select(!1),n.set_select(!0))}},this.flow_open=function(){console.log("flow_open"),console.log("ctx.gdh",i.ctx.gdh),i.ctx.connect(),i.ctx.gdh.refObjectInfoList(i.ctx.gdh.refObjectInfoListReply),i.timer=setTimeout(i.flow_cyclic,1e3)},this.flow_scan=function(){i.ctx.scan()},this.flow_cyclic=function(){i.ctx.gdh.getRefObjectInfoAll(i.flow_scan),i.ctx.draw(),i.timer=setTimeout(i.flow_cyclic,1e3)},this.flow_close=function(){for(var e in console.log("Close function",i.timer),clearTimeout(i.timer),i.ctx.gdh.pending)delete i.ctx.gdh.pending[e]},this.get_filename=function(){var e=window.location.search.substring(1);console.log("query",e);var t=e.split("&");console.log("vars",t.length,t[0].substring(4),t[1].substring(4));var n=parseInt(t[0].substring(4)),i=parseInt(t[1].substring(4)),a=[],o=[];a[0]=255&n,a[1]=n>>8&255,a[2]=n>>16&255,a[3]=n>>24&255;for(var s=0;s<4;s++){o[s]=a[s].toString();for(var r=0;r<3;r++)o[s].length<3&&(o[s]="0"+o[s])}var _=i.toString(16);for(r=0;r<8;r++)_.length<8&&(_="0"+_);var l="pwr_"+o[3]+"_"+o[2]+"_"+o[1]+"_"+o[0]+"_"+_+".flw";return console.log(l),2<t.length&&(this.vars_object=t[2].substring(4),console.log("vars object: ",this.vars_object)),l}}var frame=new FlowFrame;frame.readFlowWeb(frame.get_filename(),frame.read_func),console.log("eSave",Flow.eSave_Ctx);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,9 +6,7 @@
</head>
<body>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=ge.js></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
<canvas id="canvas" width="1200" height="800"></canvas>
<script src="ge.bundle.js"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=29)}({0:function(t,e,n){"use strict";function i(t){return t%2==0}function s(t){return t%2==1}function r(t,e,n){return t>n?n:t<e?e:t}var a,o,l,c,u,_,d,T,O,f,h;n.d(e,"o",function(){return i}),n.d(e,"p",function(){return s}),n.d(e,"n",function(){return r}),n.d(e,"j",function(){return a}),n.d(e,"a",function(){return l}),n.d(e,"b",function(){return c}),n.d(e,"k",function(){return u}),n.d(e,"m",function(){return _}),n.d(e,"l",function(){return d}),n.d(e,"h",function(){return g}),n.d(e,"g",function(){return E}),n.d(e,"c",function(){return p}),n.d(e,"e",function(){return O}),n.d(e,"d",function(){return f}),n.d(e,"f",function(){return b}),n.d(e,"i",function(){return R}),function(t){t[t.Bit=32769]="Bit",t[t.Boolean=98305]="Boolean",t[t.Float32=98306]="Float32",t[t.Float64=98307]="Float64",t[t.Char=98308]="Char",t[t.Int8=98309]="Int8",t[t.Int16=98310]="Int16",t[t.Int32=98311]="Int32",t[t.UInt8=98312]="UInt8",t[t.UInt16=98313]="UInt16",t[t.UInt32=98314]="UInt32",t[t.Objid=98315]="Objid",t[t.Buffer=98316]="Buffer",t[t.String=98317]="String",t[t.Enum=98318]="Enum",t[t.Struct=98319]="Struct",t[t.Mask=98320]="Mask",t[t.Array=98321]="Array",t[t.Time=98322]="Time",t[t.Text=98323]="Text",t[t.AttrRef=98324]="AttrRef",t[t.UInt64=98325]="UInt64",t[t.Int64=98326]="Int64",t[t.ClassId=98327]="ClassId",t[t.TypeId=98328]="TypeId",t[t.VolumeId=98329]="VolumeId",t[t.ObjectIx=98330]="ObjectIx",t[t.RefId=98331]="RefId",t[t.DeltaTime=98332]="DeltaTime",t[t.Status=98333]="Status",t[t.NetStatus=98334]="NetStatus",t[t.CastId=98335]="CastId",t[t.ProString=98336]="ProString",t[t.DisableAttr=98337]="DisableAttr",t[t.DataRef=98338]="DataRef"}(a||(a={})),function(t){t[t.RtRead=1]="RtRead",t[t.RtWrite=2]="RtWrite",t[t.System=4]="System",t[t.Maintenance=8]="Maintenance",t[t.Process=16]="Process",t[t.Instrument=32]="Instrument",t[t.Operator1=64]="Operator1",t[t.Operator2=128]="Operator2",t[t.Operator3=256]="Operator3",t[t.Operator4=512]="Operator4",t[t.Operator5=1024]="Operator5",t[t.Operator6=2048]="Operator6",t[t.Operator7=4096]="Operator7",t[t.Operator8=8192]="Operator8",t[t.Operator9=16384]="Operator9",t[t.Operator10=32768]="Operator10",t[t.RtEventsAck=262144]="RtEventsAck",t[t.RtPlc=524288]="RtPlc",t[t.RtNavigator=1048576]="RtNavigator",t[t.DevRead=2097152]="DevRead",t[t.DevPlc=4194304]="DevPlc",t[t.DevConfig=8388608]="DevConfig",t[t.DevClass=16777216]="DevClass",t[t.RtEventsBlock=33554432]="RtEventsBlock",t[t.Administrator=67108864]="Administrator",t[t.SevRead=134217728]="SevRead",t[t.SevAdmin=268435456]="SevAdmin"}(o||(o={})),function(t){t[t.RtRead=1]="RtRead",t[t.RtWrite=2]="RtWrite",t[t.System=4]="System",t[t.Maintenance=8]="Maintenance",t[t.Process=16]="Process",t[t.Instrument=32]="Instrument",t[t.RtEventsBlock=33554432]="RtEventsBlock",t[t.RtEventsAck=262144]="RtEventsAck",t[t.RtPlc=524288]="RtPlc",t[t.RtNavigator=1048576]="RtNavigator",t[t.AllRt=35454975]="AllRt",t[t.AllOperators=65472]="AllOperators",t[t.AllPwr=-1]="AllPwr"}(l||(l={})),function(t){t[t.Pointer=1]="Pointer",t[t.Array=2]="Array",t[t.Backup=4]="Backup",t[t.Changelog=8]="Changelog",t[t.State=16]="State",t[t.Const=32]="Const",t[t.Rtvirtual=64]="Rtvirtual",t[t.Devbodyref=128]="Devbodyref",t[t.Dynamic=256]="Dynamic",t[t.Publicwrite=512]="Publicwrite",t[t.Noedit=1024]="Noedit",t[t.Invisible=2048]="Invisible",t[t.Refdirect=4096]="Refdirect",t[t.Noinvert=8192]="Noinvert",t[t.Noremove=16384]="Noremove",t[t.Rtdbref=32768]="Rtdbref",t[t.Private=65536]="Private",t[t.Class=131072]="Class",t[t.Superclass=262144]="Superclass",t[t.Buffer=524288]="Buffer",t[t.Nowbl=1048576]="Nowbl",t[t.Alwayswbl=2097152]="Alwayswbl",t[t.Disableattr=4194304]="Disableattr",t[t.Rthide=8388608]="Rthide"}(c||(c={})),function(t){t[t.IsConfigured=1]="IsConfigured"}(u||(u={})),function(t){t[t.OpenGraph=1]="OpenGraph",t[t.OpenObjectGraph=2]="OpenObjectGraph",t[t.OpenTrend=4]="OpenTrend",t[t.OpenHistory=8]="OpenHistory",t[t.OpenFast=16]="OpenFast",t[t.Camera=32]="Camera",t[t.HistEvent=64]="HistEvent",t[t.BlockEvents=128]="BlockEvents",t[t.Help=256]="Help",t[t.Photo=512]="Photo",t[t.Note=1024]="Note",t[t.ParentObjectGraph=2048]="ParentObjectGraph"}(_||(_={})),function(t){t[t.OpenObject=1]="OpenObject",t[t.OpenTrace=2]="OpenTrace",t[t.RtNavigator=4]="RtNavigator",t[t.OpenCrossref=8]="OpenCrossref",t[t.HelpClass=16]="HelpClass",t[t.DataSheet=32]="DataSheet",t[t.CircuitDiagram=64]="CircuitDiagram",t[t.Simulate=-2147483648]="Simulate"}(d||(d={}));class g{constructor(t,e){this.oix=e,this.vid=t}}class E{}class p{constructor(t,e){this.value=t,this.sts=e}}!function(t){t[t.Min=65793]="Min",t[t.Max=16711422]="Max"}(T||(T={}));!function(t){t[t.Solid=0]="Solid",t[t.Dashed1=1]="Dashed1",t[t.Dashed2=2]="Dashed2",t[t.Dashed3=3]="Dashed3",t[t.Dotted=4]="Dotted",t[t.DotDashed1=5]="DotDashed1",t[t.DotDashed2=6]="DotDashed2"}(O||(O={})),function(t){t[t.No=0]="No",t[t.HorizontalUp=1]="HorizontalUp",t[t.HorizontalDown=2]="HorizontalDown",t[t.HorizontalTube1=3]="HorizontalTube1",t[t.HorizontalTube2=4]="HorizontalTube2",t[t.VerticalLeft=5]="VerticalLeft",t[t.VerticalRight=6]="VerticalRight",t[t.VerticalTube1=7]="VerticalTube1",t[t.VerticalTube2=8]="VerticalTube2",t[t.DiagonalUpperLeft=9]="DiagonalUpperLeft",t[t.DiagonalLowerLeft=10]="DiagonalLowerLeft",t[t.DiagonalUpperRight=11]="DiagonalUpperRight",t[t.DiagonalLowerRight=12]="DiagonalLowerRight",t[t.DiagonalUpTube=13]="DiagonalUpTube",t[t.DiagonalDownTube=14]="DiagonalDownTube",t[t.Globe=15]="Globe",t[t.RadialCenter=16]="RadialCenter",t[t.RadialUpperLeft=17]="RadialUpperLeft",t[t.RadialLowerLeft=18]="RadialLowerLeft",t[t.RadialUpperRight=19]="RadialUpperRight",t[t.RadialLowerRight=20]="RadialLowerRight"}(f||(f={}));!function(t){t[t._=0]="_",t[t.UserDefined=1]="UserDefined",t[t.OneSecond=2]="OneSecond",t[t.TenSeconds=3]="TenSeconds",t[t.OneMinute=4]="OneMinute",t[t.TenMinutes=5]="TenMinutes",t[t.OneHour=6]="OneHour",t[t.OneDay=7]="OneDay",t[t.OneWeek=8]="OneWeek",t[t.OneMonth=9]="OneMonth",t[t.OneYear=10]="OneYear",t[t.LastSecond=11]="LastSecond",t[t.LastTenSeconds=12]="LastTenSeconds",t[t.LastMinute=13]="LastMinute",t[t.LastTenMinutes=14]="LastTenMinutes",t[t.LastHour=15]="LastHour",t[t.Today=16]="Today",t[t.Yesterday=17]="Yesterday",t[t.ThisWeek=18]="ThisWeek",t[t.LastWeek=19]="LastWeek",t[t.ThisMonth=20]="ThisMonth",t[t.LastMonth=21]="LastMonth",t[t.ThisYear=22]="ThisYear",t[t.AllTime=23]="AllTime",t[t.__=24]="__"}(h||(h={}));class b{constructor(t,e){this.x=0,this.y=0,this.x=t||0,this.y=e||0}set(t){this.x=t.x,this.y=t.y}static add(t,e){return new b(t.x+e.x,t.y+e.y)}}class R{constructor(t=0,e=0,n=0,i=0){this.ll=new b(t,e),this.ur=new b(n,i)}set(t){this.ll.x=t.ll.x,this.ll.y=t.ll.y,this.ur.x=t.ur.x,this.ur.y=t.ur.y}width(){return this.ur.x-this.ll.x}height(){return this.ur.y-this.ll.y}static hit(t,e){return e.x>=t.ll.x&&e.x<=t.ur.x&&e.y>=t.ll.y&&e.y<=t.ur.y}static union(t,e){return new R(Math.min(t.ll.x,e.ll.x),Math.min(t.ll.y,e.ll.y),Math.max(t.ur.x,e.ur.x),Math.max(t.ur.y,e.ur.y))}}},29:function(t,e,n){"use strict";n.r(e);var i=n(6),s=n(0),r=n(5),a=n(9),o=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){t.done?s(t.value):new n(function(e){e(t.value)}).then(a,o)}l((i=i.apply(t,e||[])).next())})};new class{constructor(){this.host=window.location.hostname||"localhost",a.a.fetchFromStore(),this.render()}get_opplace(){return window.location.search.substring(1).split("&")[0].substring(8)}init_cb(){let t=this;return r.d.getOpwindMenu(this.get_opplace()).then(e=>{t.info=e.value})}add_menu_button(t,e){let n=Object(i.a)("input",{type:"button",value:e,style:{width:"100%"}});n.addEventListener("click",this.button_cb.bind(this)),Object(i.b)(t,n),Object(i.b)(t,Object(i.a)("br"))}render(){return o(this,void 0,void 0,function*(){if(!a.a.priv)return void new a.a(this.render.bind(this));yield r.d.init(),yield this.init_cb();let t=Object(i.a)("div",{style:{cssFloat:"left",width:"20%"}}),e="http://"+localStorage.getItem("HOST")+"/xtt_help_index.html",n=Object(i.a)("iframe",{src:e,style:{cssFloat:"left",width:"79%",height:"100%",border:"none"}}),s=Object(i.a)("div",{style:{display:"flow-root"}});Object(i.b)(s,Object(i.d)(a.a.user+" on "+this.host));let o=Object(i.a)("input",{type:"button",value:"Logout",style:{cssFloat:"right"}});o.addEventListener("click",()=>{r.d.login("","").then(a.a.logout_cb).then(this.render.bind(this))}),Object(i.b)(s,o),Object(i.b)(t,s),Object(i.b)(t,Object(i.a)("hr")),this.info.enable_language&&this.add_menu_button(t,"Language"),this.info.enable_alarmlist&&(this.add_menu_button(t,"AlarmList"),this.add_menu_button(t,"EventList")),this.info.enable_eventlog&&this.add_menu_button(t,"EventLog"),this.info.enable_navigator&&this.add_menu_button(t,"Navigator"),this.info.disable_help||this.add_menu_button(t,"Help"),this.info.disable_proview||this.add_menu_button(t,"ProviewR");for(let e=0;e<this.info.buttons.length;e++)this.add_menu_button(t,this.info.buttons[e].text);Object(i.c)(document.body,[t,n])})}button_cb(t){let e=t.target.value;if(this.info.enable_language&&"Language"===e)console.log("Language activated");else if(this.info.enable_alarmlist&&"AlarmList"===e)console.log("AlarmList activated"),a.a.is_authorized(s.a.RtRead|s.a.RtWrite|s.a.AllOperators|s.a.System|s.a.Maintenance|s.a.Process|s.a.Instrument)&&window.open("ev.html?list=alarm","_blank");else if(this.info.enable_alarmlist&&"EventList"===e)console.log("EventList activated"),a.a.is_authorized(s.a.RtRead|s.a.RtWrite|s.a.AllOperators|s.a.System|s.a.Maintenance|s.a.Process|s.a.Instrument)&&window.open("ev.html?list=event","_blank");else if(this.info.enable_eventlog&&"EventLog"===e)console.log("EventLog activated"),a.a.is_authorized(s.a.RtRead|s.a.RtWrite|s.a.AllOperators|s.a.System|s.a.Maintenance|s.a.Process|s.a.Instrument)&&window.alert("Not yet implemented");else if(this.info.enable_navigator&&"Navigator"===e)console.log("Navigator activated"),a.a.is_authorized(s.a.RtNavigator|s.a.System|s.a.Maintenance|s.a.Process|s.a.Instrument)&&window.open("xtt.html","_blank");else if(this.info.disable_help||"Help"!==e)if(this.info.disable_proview||"ProviewR"!==e){if(a.a.is_authorized(s.a.RtRead|s.a.RtWrite|s.a.AllOperators|s.a.System|s.a.Maintenance|s.a.Process|s.a.Instrument)){let t=this.info.buttons.find(t=>t.text===e);if(t){console.log("Found",t.text);let e=t.name,n=e.indexOf(".pwg");-1!==n&&(e=e.substring(0,n));let i="ge.html?graph="+e;console.log("url",i),window.open(i,"_blank")}}}else console.log("ProviewR activated"),window.open("http://www.proview.se","_blank");else console.log("Help activated"),window.open("http://"+localStorage.getItem("HOST")+"/xtt_help_index.html","_blank")}}},5:function(t,e,n){"use strict";var i,s,r,a,o,l=n(0);class c{constructor(t){this.offset=0,this.dv=new DataView(t),this.tag=this.getUint8(),this.id=this.getUint32(),this.sts=this.getUint32()}getUint8(){return this.offset+=1,this.dv.getUint8(this.offset-1)}getUint16(){return this.offset+=2,this.dv.getUint16(this.offset-2)}getInt32(){return this.offset+=4,this.dv.getInt32(this.offset-4)}getUint32(){return this.offset+=4,this.dv.getUint32(this.offset-4)}getFloat32(){return this.offset+=4,this.dv.getFloat32(this.offset-4)}getString(){let t=this.getUint16(),e=new Uint8Array(t);for(let n=0;n<t;n++)e[n]=this.getUint8();return String.fromCharCode.apply(null,e)}}class u{constructor(t,e,n=null,i=null){this.ws=null,this.pending=[],this.pack8Bit=t=>this.reqData.push(255&t),this.ws=new WebSocket("ws://"+t+":"+String(e)),this.ws.binaryType="arraybuffer";let s=this;this.ws.onmessage=function(t){let e=new DataView(t.data).getUint32(1);(0,s.pending[e])(new c(t.data)),delete s.pending[e]},this.ws.onopen=function(){null!==n&&n()},this.ws.onclose=function(){s.reset()},this.ws.onerror=function(t){console.error("WebSocket error observed:",t),null!==i&&i()}}sendRequest(){let t=this;return new Promise((e,n)=>{t.pending[u.next_id]=e,u.next_id++,t.ws.send(Uint8Array.from(t.reqData))})}beginRequest(t){this.reqData=[t,0],this.pack32Bit(u.next_id)}reset(){this.pending=[]}pack16Bit(t){this.reqData.push(255&t),this.reqData.push(t>>8&255)}pack32Bit(t){this.reqData.push(255&t),this.reqData.push(t>>8&255),this.reqData.push(t>>16&255),this.reqData.push(t>>24&255)}packString(t){this.pack16Bit(t.length);for(let e=0;e<t.length;e++)this.reqData.push(t.charCodeAt(e))}}u.next_id=1234,n.d(e,"e",function(){return i}),n.d(e,"b",function(){return s}),n.d(e,"c",function(){return r}),n.d(e,"a",function(){return f}),n.d(e,"f",function(){return a}),n.d(e,"d",function(){return p}),function(t){t[t.Ack=1]="Ack",t[t.Block=2]="Block",t[t.Cancel=3]="Cancel",t[t.CancelBlock=4]="CancelBlock",t[t.Missing=5]="Missing",t[t.Reblock=6]="Reblock",t[t.Return=7]="Return",t[t.Unblock=8]="Unblock",t[t.InfoSuccess=32]="InfoSuccess",t[t.Alarm=64]="Alarm",t[t.MaintenanceAlarm=128]="MaintenanceAlarm",t[t.SystemAlarm=256]="SystemAlarm",t[t.UserAlarm1=512]="UserAlarm1",t[t.UserAlarm2=1024]="UserAlarm2",t[t.UserAlarm3=2048]="UserAlarm3",t[t.UserAlarm4=4096]="UserAlarm4",t[t.Info=8192]="Info"}(i||(i={})),function(t){t[t.D=64]="D",t[t.C=65]="C",t[t.B=66]="B",t[t.A=67]="A"}(s||(s={})),function(t){t[t.NotRet=1]="NotRet",t[t.NotAck=2]="NotAck",t[t.Block=4]="Block"}(r||(r={}));class _{}class d{}class T{}class O{}class f{}class h{}class g{constructor(){this.buttons=[]}}class E{}!function(t){t[t.GET_OP_SELF=1]="GET_OP_SELF",t[t.GET_OP_METHOD_PLC=2]="GET_OP_METHOD_PLC",t[t.GET_OP_METHOD_OBJECTGRAPH=3]="GET_OP_METHOD_OBJECTGRAPH",t[t.GET_OP_METHOD_GRAPH=4]="GET_OP_METHOD_GRAPH",t[t.GET_OP_METHOD_HELPCLASS=5]="GET_OP_METHOD_HELPCLASS"}(a||(a={})),function(t){t[t.SET_OBJECT_INFO_BOOLEAN=1]="SET_OBJECT_INFO_BOOLEAN",t[t.SET_OBJECT_INFO_FLOAT=2]="SET_OBJECT_INFO_FLOAT",t[t.SET_OBJECT_INFO_INT=3]="SET_OBJECT_INFO_INT",t[t.SET_OBJECT_INFO_STRING=4]="SET_OBJECT_INFO_STRING",t[t.GET_OBJECT_INFO_BOOLEAN=5]="GET_OBJECT_INFO_BOOLEAN",t[t.GET_OBJECT_INFO_FLOAT=6]="GET_OBJECT_INFO_FLOAT",t[t.GET_OBJECT_INFO_INT=7]="GET_OBJECT_INFO_INT",t[t.GET_OBJECT_INFO_STRING=8]="GET_OBJECT_INFO_STRING",t[t.TOGGLE_OBJECT_INFO=9]="TOGGLE_OBJECT_INFO",t[t.REF_OBJECT_INFO=10]="REF_OBJECT_INFO",t[t.GET_OBJECT_REF_INFO_BOOLEAN=11]="GET_OBJECT_REF_INFO_BOOLEAN",t[t.GET_OBJECT_REF_INFO_FLOAT=12]="GET_OBJECT_REF_INFO_FLOAT",t[t.GET_OBJECT_REF_INFO_INT=13]="GET_OBJECT_REF_INFO_INT",t[t.GET_OBJECT_REF_INFO_STRING=14]="GET_OBJECT_REF_INFO_STRING",t[t.UNREF_OBJECT_INFO=15]="UNREF_OBJECT_INFO",t[t.NAME_TO_OBJID=16]="NAME_TO_OBJID",t[t.OBJID_TO_NAME=17]="OBJID_TO_NAME",t[t.GET_ROOT_LIST=18]="GET_ROOT_LIST",t[t.GET_NEXT_OBJECT=19]="GET_NEXT_OBJECT",t[t.GET_CHILD=20]="GET_CHILD",t[t.GET_NEXT_SIBLING=21]="GET_NEXT_SIBLING",t[t.GET_OBJECT_CLASS=22]="GET_OBJECT_CLASS",t[t.GET_CLASS_LIST=23]="GET_CLASS_LIST",t[t.CLASS_ID_TO_OBJID=24]="CLASS_ID_TO_OBJID",t[t.GET_OBJECT_REF_INFO_ALL=25]="GET_OBJECT_REF_INFO_ALL",t[t.REF_OBJECT_INFO_LIST=26]="REF_OBJECT_INFO_LIST",t[t.POLL=27]="POLL",t[t.STATISTICS=28]="STATISTICS",t[t.CHECK_USER=29]="CHECK_USER",t[t.GET_NODE_OBJECT=30]="GET_NODE_OBJECT",t[t.LOG_STRING=31]="LOG_STRING",t[t.UNREF_OBJECT_INFO_ALL=32]="UNREF_OBJECT_INFO_ALL",t[t.CREATE_INSTANCE_FILE=33]="CREATE_INSTANCE_FILE",t[t.GET_ATTRIBUTE_CHAR=34]="GET_ATTRIBUTE_CHAR",t[t.GET_CLASS_ATTRIBUTE=35]="GET_CLASS_ATTRIBUTE",t[t.GET_ALL_CLASS_ATTRIBUTES=36]="GET_ALL_CLASS_ATTRIBUTES",t[t.GET_ALL_SIBLINGS=37]="GET_ALL_SIBLINGS",t[t.GET_ALL_XTT_SIBLINGS=38]="GET_ALL_XTT_SIBLINGS",t[t.GET_ALL_XTT_CHILDREN=39]="GET_ALL_XTT_CHILDREN",t[t.REF_OBJECT_INFO_VECTOR=40]="REF_OBJECT_INFO_VECTOR",t[t.GET_SUBSCRIPTIONS=41]="GET_SUBSCRIPTIONS",t[t.CRR_SIGNAL=42]="CRR_SIGNAL",t[t.CRR_OBJECT=43]="CRR_OBJECT",t[t.GET_PARENT=44]="GET_PARENT",t[t.GET_OBJECT_INFO_OBJID=45]="GET_OBJECT_INFO_OBJID",t[t.GET_OBJECT_REF_INFO_BOOLEAN_ARRAY=46]="GET_OBJECT_REF_INFO_BOOLEAN_ARRAY",t[t.GET_OBJECT_REF_INFO_FLOAT_ARRAY=47]="GET_OBJECT_REF_INFO_FLOAT_ARRAY",t[t.GET_OBJECT_REF_INFO_INT_ARRAY=48]="GET_OBJECT_REF_INFO_INT_ARRAY",t[t.GET_OBJECT_REF_INFO_STRING_ARRAY=49]="GET_OBJECT_REF_INFO_STRING_ARRAY",t[t.GET_MSG=50]="GET_MSG",t[t.GET_MSG_TEXT=51]="GET_MSG_TEXT",t[t.NAME_TO_ATTRREF=52]="NAME_TO_ATTRREF",t[t.ATTRREF_TO_NAME=53]="ATTRREF_TO_NAME",t[t.GET_ATTRREF_TID=54]="GET_ATTRREF_TID",t[t.GET_SUPER_CLASS=55]="GET_SUPER_CLASS",t[t.GET_ALL_CLASS_ATTRIBUTES_STRING=56]="GET_ALL_CLASS_ATTRIBUTES_STRING",t[t.GET_OBJECT_INFO_FLOAT_ARRAY=57]="GET_OBJECT_INFO_FLOAT_ARRAY",t[t.GET_OBJECT_INFO_INT_ARRAY=58]="GET_OBJECT_INFO_INT_ARRAY",t[t.GET_CIRCBUFF_INFO=59]="GET_CIRCBUFF_INFO",t[t.UPDATE_CIRCBUFF_INFO=60]="UPDATE_CIRCBUFF_INFO",t[t.GET_ATTRIBUTE_FLAGS=61]="GET_ATTRIBUTE_FLAGS",t[t.CLASSNAME_TO_ID=62]="CLASSNAME_TO_ID",t[t.GET_OBJECT=63]="GET_OBJECT",t[t.GET_OPWIND_MENU=64]="GET_OPWIND_MENU",t[t.GET_OBJECT_FROM_NAME=65]="GET_OBJECT_FROM_NAME",t[t.MH_SYNC=66]="MH_SYNC",t[t.MH_ACK=67]="MH_ACK",t[t.GET_OBJECT_FROM_AREF=68]="GET_OBJECT_FROM_AREF"}(o||(o={}));class p{static init(){return new Promise((t,e)=>{p.ws=new u(localStorage.getItem("HOST"),p.PORT,()=>{t()})})}static getObjectInfoBoolean(t){return p.ws.beginRequest(o.GET_OBJECT_INFO_BOOLEAN),p.ws.packString(t),p.ws.sendRequest().then(function(t){let e=t.getUint8();return{sts:t.sts,value:e}})}static getObjectInfoInt(t){return p.ws.beginRequest(o.GET_OBJECT_INFO_INT),p.ws.packString(t),p.ws.sendRequest().then(function(t){let e=t.getUint32();return{sts:t.sts,value:e}})}static getObjectInfoIntArray(t,e){return p.ws.beginRequest(o.GET_OBJECT_INFO_INT_ARRAY),p.ws.pack32Bit(e),p.ws.packString(t),p.ws.sendRequest().then(function(t){let e=t.getInt32();for(let n=0;n<e;n++)(void 0).push(t.getUint32());return{sts:t.sts,value:void 0}})}static getObjectInfoFloat(t){return p.ws.beginRequest(o.GET_OBJECT_INFO_FLOAT),p.ws.packString(t),p.ws.sendRequest().then(function(t){let e=t.getFloat32();return{sts:t.sts,value:e}})}static getObjectInfoFloatArray(t,e){return p.ws.beginRequest(o.GET_OBJECT_INFO_FLOAT_ARRAY),p.ws.pack32Bit(e),p.ws.packString(t),p.ws.sendRequest().then(function(t){let e=t.getInt32();for(let n=0;n<e;n++)(void 0).push(t.getFloat32());return{sts:t.sts,value:void 0}})}static refObjectInfo(t,e,n){let i=new T;return i.name=t,i.refid=p.subscriptionCount,i.type=e,i.elements=n,p.sub[p.subscriptionCount]=i,p.subscriptionCount++,p.ws.beginRequest(o.REF_OBJECT_INFO),p.ws.pack32Bit(i.refid),p.ws.pack32Bit(i.elements),p.ws.packString(i.name),p.ws.sendRequest(),i.refid}static unrefObjectInfo(t){p.ws.beginRequest(o.UNREF_OBJECT_INFO),p.ws.pack32Bit(t),delete p.sub[t],p.ws.sendRequest()}static getRefObjectInfoAll(t){p.ws.beginRequest(o.GET_OBJECT_REF_INFO_ALL),p.ws.sendRequest().then(function(e){let n=e.getUint32();for(let t=0;t<n;t++){let t=e.getUint32(),n=e.getUint32(),i=p.sub[t];if(void 0!==i){let s;switch(i.type){case l.j.Boolean:if(i.elements<=1)s=e.getUint8();else{let r=n;r!==i.elements&&console.log("Subscription size error",r,i.elements,t),s=new Array(r);for(let t=0;t<r;t++)s[t]=e.getUint8()}break;case l.j.Float32:if(i.elements<=1)s=e.getFloat32();else{let r=n/4;r!==i.elements&&console.log("Subscription size error",r,i.elements,t),s=new Array(r);for(let t=0;t<r;t++)s[t]=e.getFloat32()}break;case l.j.Int8:case l.j.Int16:case l.j.Int32:case l.j.UInt8:case l.j.UInt16:case l.j.UInt32:case l.j.Status:case l.j.NetStatus:case l.j.Mask:case l.j.Enum:case l.j.Bit:if(i.elements<=1)s=e.getInt32();else{let r=n/4;r!==i.elements&&console.log("Subscription size error",r,i.elements,t),s=new Array(r);for(let t=0;t<r;t++)s[t]=e.getInt32()}break;case l.j.String:case l.j.Time:case l.j.DeltaTime:case l.j.AttrRef:case l.j.Objid:if(i.elements<=1)s=e.getString();else{let n=i.elements;n!==i.elements&&console.log("Subscription size error",n,i.elements,t),s=new Array(n);for(let t=0;t<n;t++)s[t]=e.getString()}}p.sub[t].value=s}}t()})}static getObjectRefInfo(t){return p.sub[t].value}static setObjectInfoBoolean(t,e){p.ws.beginRequest(o.SET_OBJECT_INFO_BOOLEAN),p.ws.pack32Bit(e),p.ws.packString(t),p.ws.sendRequest()}static setObjectInfoInt(t,e){p.ws.beginRequest(o.SET_OBJECT_INFO_INT),p.ws.pack32Bit(e),p.ws.packString(t),p.ws.sendRequest()}static setObjectInfoFloat(t,e){p.ws.beginRequest(o.SET_OBJECT_INFO_FLOAT);let n=new ArrayBuffer(4);new Float32Array(n)[0]=e;let i=new Uint8Array(n);p.ws.reqData.push(i[0]),p.ws.reqData.push(i[1]),p.ws.reqData.push(i[2]),p.ws.reqData.push(i[3]),p.ws.packString(t),p.ws.sendRequest()}static setObjectInfoString(t,e){p.ws.beginRequest(o.SET_OBJECT_INFO_STRING),p.ws.packString(e),p.ws.packString(t),p.ws.sendRequest()}static setObjectInfo(t,e,n){n===l.j.Boolean?p.setObjectInfoBoolean(t,e):n===l.j.Float32||n===l.j.Float64?p.setObjectInfoFloat(t,e):n===l.j.String?p.setObjectInfoString(t,e):p.setObjectInfoInt(t,e)}static toggleObjectInfo(t){p.ws.beginRequest(o.TOGGLE_OBJECT_INFO),p.ws.packString(t),p.ws.sendRequest()}static getAllXttChildren(t){return p.ws.beginRequest(o.GET_ALL_XTT_CHILDREN),p.ws.pack32Bit(t.vid),p.ws.pack32Bit(t.oix),p.ws.sendRequest().then(function(t){let e=[],n=t.getUint32();for(let i=0;i<n;i++){let n=new O,i=t.getUint32(),s=t.getUint32();n.objid=new l.h(i,s),n.cid=t.getUint32(),n.has_children=0!==t.getUint16(),n.name=t.getString(),n.description=t.getString(),n.classname=t.getString(),e.push(n)}return{sts:t.sts,value:e}})}static getAllClassAttributes(t,e){return p.ws.beginRequest(o.GET_ALL_CLASS_ATTRIBUTES),p.ws.pack32Bit(t),p.ws.pack32Bit(e.vid),p.ws.pack32Bit(e.oix),p.ws.sendRequest().then(function(t){let e=[],n=t.getUint32();for(let i=0;i<n;i++){let n=new f;n.type=t.getUint32(),n.flags=t.getUint32(),n.size=t.getUint16(),n.elements=t.getUint16(),n.name=t.getString(),n.classname=t.getString(),e.push(n)}return{sts:t.sts,value:e}})}static unpackGetObject(t){let e=null;if(Object(l.p)(t.sts)){e=new O;let n=t.getUint32(),i=t.getUint32();e.objid=new l.h(n,i),e.cid=t.getUint32(),e.has_children=0!==t.getUint16(),e.name=t.getString(),e.fullname=t.getString(),e.classname=t.getString(),e.description=t.getString(),e.param1=t.getString()}return{sts:t.sts,value:e}}static getObject(t,e){return p.ws.beginRequest(o.GET_OBJECT),p.ws.pack16Bit(e),p.ws.pack32Bit(t.vid),p.ws.pack32Bit(t.oix),p.ws.sendRequest().then(p.unpackGetObject)}static getObjectFromAref(t,e){return p.ws.beginRequest(o.GET_OBJECT_FROM_AREF),p.ws.pack16Bit(e),p.ws.pack32Bit(t.objid.vid),p.ws.pack32Bit(t.objid.oix),p.ws.pack32Bit(t.offset),p.ws.pack32Bit(t.body),p.ws.pack32Bit(t.size),p.ws.pack32Bit(t.flags),p.ws.sendRequest().then(p.unpackGetObject)}static getObjectFromName(t,e){return p.ws.beginRequest(o.GET_OBJECT_FROM_NAME),p.ws.pack16Bit(e),p.ws.packString(t),p.ws.sendRequest().then(p.unpackGetObject)}static crrSignal(t){return p.ws.beginRequest(o.CRR_SIGNAL),p.ws.pack32Bit(t.vid),p.ws.pack32Bit(t.oix),p.ws.sendRequest().then(function(t){let e=[];if(Object(l.p)(t.sts)){let n=t.getUint16();for(let i=0;i<n;i++){let n=new E;n.type=t.getUint16();let i=t.getUint32(),s=t.getUint32();n.objid=new l.h(i,s),n.name=t.getString(),n.classname=t.getString(),e.push(n)}}return{sts:t.sts,value:e}})}static getOpwindMenu(t){return p.ws.beginRequest(o.GET_OPWIND_MENU),p.ws.packString(t),p.ws.sendRequest().then(function(t){let e=new g;if(Object(l.p)(t.sts)){e.title=t.getString(),e.text=t.getString(),e.enable_language=t.getUint32(),e.enable_login=t.getUint32(),e.enable_alarmlist=t.getUint32(),e.enable_eventlog=t.getUint32(),e.enable_navigator=t.getUint32(),e.disable_help=t.getUint32(),e.disable_proview=t.getUint32(),e.language=t.getUint32();let n=t.getUint16();for(let i=0;i<n;i++){let n=new h;n.type=t.getUint32(),n.text=t.getString(),n.name=t.getString(),n.url=t.getString(),e.buttons.push(n)}}return{sts:t.sts,value:e}})}static login(t,e){return p.ws.beginRequest(o.CHECK_USER),p.ws.packString(t),p.ws.packString(e),p.ws.sendRequest().then(function(t){let e=Object(l.p)(t.sts)?t.getUint32():0;return{sts:t.sts,value:e}})}static getMsg(t){return p.ws.beginRequest(o.GET_MSG),p.ws.pack32Bit(t),p.ws.sendRequest().then(function(t){let e=Object(l.p)(t.sts)?t.getString():"";return{sts:t.sts,value:e}})}static mhSync(t){return p.ws.beginRequest(o.MH_SYNC),p.ws.pack32Bit(t),p.ws.sendRequest().then(function(t){let e=[],n=t.getUint32();for(let i=0;i<n;i++){let n=new d;n.eventTime=t.getString(),n.eventText=t.getString(),n.eventName=t.getString(),n.eventFlags=t.getUint32(),n.eventStatus=t.getUint32(),n.eventPrio=t.getUint32(),n.eventId=new _,n.eventId.nix=t.getUint32(),n.eventId.idx=t.getUint32(),n.eventId.birthTime=t.getString(),n.targetId=new _,n.targetId.nix=t.getUint32(),n.targetId.idx=t.getUint32(),n.targetId.birthTime=t.getString(),n.eventType=t.getUint32();let i=new l.h(0,0);i.vid=t.getUint32(),i.oix=t.getUint32(),n.object=new l.g,n.object.objid=i,n.object.offset=t.getUint32(),n.object.body=t.getUint32(),n.object.size=t.getUint32(),n.object.flags=t.getUint32();let s=new l.h(0,0);s.vid=t.getUint32(),s.oix=t.getUint32(),n.supObject=new l.g,n.supObject.objid=s,n.supObject.offset=t.getUint32(),n.supObject.body=t.getUint32(),n.supObject.size=t.getUint32(),n.supObject.flags=t.getUint32(),n.eventMoreText=t.getString(),n.syncIdx=t.getUint32(),e.push(n)}return{sts:t.sts,value:e}})}static mhAcknowledge(t){return p.ws.beginRequest(o.MH_ACK),p.ws.pack32Bit(t.nix),p.ws.pack32Bit(t.idx),p.ws.packString(t.birthTime),p.ws.sendRequest().then(t=>t.sts)}}p.sub=[],p.PORT=4448,p.subscriptionCount=1},6:function(t,e,n){"use strict";function i(t,e){var n=function(t){for(var e=!1,n=!1,i="",s="",r="",a=0;a<t.length;a++){var o=t[a];"."===o?(n=!0,e=!1,r.length>0&&(r+=" ")):"#"===o?(e=!0,n=!1):e?s+=o:n?r+=o:i+=o}return{tag:i||"div",id:s,className:r}}(t),i=n.tag,s=n.id,r=n.className,a=e?document.createElementNS(e,i):document.createElement(i);return s&&(a.id=s),r&&(e?a.setAttribute("class",r):a.className=r),a}function s(t,e){var n=g(t),i=g(e);return e===i&&i.__redom_view&&(e=i.__redom_view),i.parentNode&&(r(e,i,n),n.removeChild(i)),e}function r(t,e,n){var i=e.__redom_lifecycle;if(a(i))e.__redom_lifecycle={};else{var s=n;for(e.__redom_mounted&&u(e,"onunmount");s;){var r=s.__redom_lifecycle||{};for(var o in i)r[o]&&(r[o]-=i[o]);a(r)&&(s.__redom_lifecycle=null),s=s.parentNode}}}function a(t){if(null==t)return!0;for(var e in t)if(t[e])return!1;return!0}n.d(e,"a",function(){return R}),n.d(e,"b",function(){return c}),n.d(e,"c",function(){return w}),n.d(e,"d",function(){return O});var o=["onmount","onremount","onunmount"],l="undefined"!=typeof window&&"ShadowRoot"in window;function c(t,e,n,i){var s=g(t),a=g(e);e===a&&a.__redom_view&&(e=a.__redom_view),e!==a&&(a.__redom_view=e);var c=a.__redom_mounted,_=a.parentNode;return c&&_!==s&&r(0,a,_),null!=n?i?s.replaceChild(a,g(n)):s.insertBefore(a,g(n)):s.appendChild(a),function(t,e,n,i){for(var s=e.__redom_lifecycle||(e.__redom_lifecycle={}),r=n===i,a=!1,c=0,_=o;c<_.length;c+=1){var d=_[c];r||t!==e&&d in t&&(s[d]=(s[d]||0)+1),s[d]&&(a=!0)}if(!a)return void(e.__redom_lifecycle={});var T=n,O=!1;(r||T&&T.__redom_mounted)&&(u(e,r?"onremount":"onmount"),O=!0);for(;T;){var f=T.parentNode,h=T.__redom_lifecycle||(T.__redom_lifecycle={});for(var g in s)h[g]=(h[g]||0)+s[g];if(O)break;(T.nodeType===Node.DOCUMENT_NODE||l&&T instanceof ShadowRoot||f&&f.__redom_mounted)&&(u(T,r?"onremount":"onmount"),O=!0),T=f}}(e,a,s,_),e}function u(t,e){"onmount"===e||"onremount"===e?t.__redom_mounted=!0:"onunmount"===e&&(t.__redom_mounted=!1);var n=t.__redom_lifecycle;if(n){var i=t.__redom_view,s=0;for(var r in i&&i[e]&&i[e](),n)r&&s++;if(s)for(var a=t.firstChild;a;){var o=a.nextSibling;u(a,e),a=o}}}function _(t,e,n){t.style[e]=null==n?"":n}var d="http://www.w3.org/1999/xlink";function T(t,e,n,i){var s=g(t);if("object"==typeof e)for(var r in e)T(s,r,e[r],i);else{var a=s instanceof SVGElement,o="function"==typeof n;if("style"===e&&"object"==typeof n)!function(t,e,n){var i=g(t);if("object"==typeof e)for(var s in e)_(i,s,e[s]);else _(i,e,n)}(s,n);else if(a&&o)s[e]=n;else if("dataset"===e)!function t(e,n,i){if("object"==typeof n)for(var s in n)t(e,s,n[s]);else null!=i?e.dataset[n]=i:delete e.dataset[n]}(s,n);else if(!a&&(e in s||o)&&"list"!==e)s[e]=n;else{if(a&&"xlink"===e)return void function t(e,n,i){if("object"==typeof n)for(var s in n)t(e,s,n[s]);else null!=i?e.setAttributeNS(d,n,i):e.removeAttributeNS(d,n,i)}(s,n);i&&"class"===e&&(n=s.className+" "+n),null==n?s.removeAttribute(e):s.setAttribute(e,n)}}}function O(t){return document.createTextNode(null!=t?t:"")}function f(t,e,n){for(var i=0,s=e;i<s.length;i+=1){var r=s[i];if(0===r||r){var a=typeof r;"function"===a?r(t):"string"===a||"number"===a?t.appendChild(O(r)):E(g(r))?c(t,r):r.length?f(t,r,n):"object"===a&&T(t,r,null,n)}}}function h(t){return"string"==typeof t?b(t):g(t)}function g(t){return t.nodeType&&t||!t.el&&t||g(t.el)}function E(t){return t&&t.nodeType}var p={};function b(t){for(var e,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var s=typeof t;if("string"===s)e=v(t).cloneNode(!1);else if(E(t))e=t.cloneNode(!1);else{if("function"!==s)throw new Error("At least one argument required");var r=t;e=new(Function.prototype.bind.apply(r,[null].concat(n)))}return f(g(e),n,!0),e}var R=b;function v(t){return p[t]||(p[t]=i(t))}function w(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var i=function t(e,n,i){var s=i;var r=new Array(n.length);for(var a=0;a<n.length;a++)r[a]=n[a]&&g(n[a]);for(var o=0;o<n.length;o++){var l=n[o];if(l){var u=r[o];if(u!==s)if(E(u)){var _=s&&s.nextSibling,d=null!=l.__redom_index,T=d&&_===r[o+1];c(e,l,s,T),T&&(s=_)}else null!=l.length&&(s=t(e,l,s));else s=s.nextSibling}}return s}(t,e,g(t).firstChild);i;){var r=i.nextSibling;s(t,i),i=r}}b.extend=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var i=v(t);return b.bind.apply(b,[this,i].concat(e))};var S=function(t,e,n){this.View=t,this.initData=n,this.oldLookup={},this.lookup={},this.oldViews=[],this.views=[],null!=e&&(this.key="function"==typeof e?e:function(t){return function(e){return e[t]}}(e))};S.prototype.update=function(t,e){for(var n=this.View,i=this.key,s=this.initData,r=null!=i,a=this.lookup,o={},l=new Array(t.length),c=this.views,u=0;u<t.length;u++){var _=t[u],d=void 0;if(r){var T=i(_);d=a[T]||new n(s,_,u,t),o[T]=d,d.__redom_id=T}else d=c[u]||new n(s,_,u,t);d.update&&d.update(_,u,t,e),g(d.el).__redom_view=d,l[u]=d}this.oldViews=c,this.views=l,this.oldLookup=a,this.lookup=o};var I=function(t,e,n,i){this.__redom_list=!0,this.View=e,this.initData=i,this.views=[],this.pool=new S(e,n,i),this.el=h(t),this.keySet=null!=n};I.prototype.update=function(t,e){void 0===t&&(t=[]);var n=this.keySet,i=this.views;this.pool.update(t,e);var r=this.pool,a=r.views,o=r.lookup;if(n)for(var l=0;l<i.length;l++){var c=i[l];null==o[c.__redom_id]&&(c.__redom_index=null,s(this,c))}for(var u=0;u<a.length;u++){a[u].__redom_index=u}w(this,a),n&&(this.lookup=o),this.views=a},I.extend=function(t,e,n,i){return I.bind(I,t,e,n,i)},I.extend;var A=function(t,e){this.el=O(""),this.visible=!1,this.view=null,this._placeholder=this.el,t instanceof Node?this._el=t:t.el instanceof Node?(this._el=t,this.view=t):this._View=t,this._initData=e};A.prototype.update=function(t,e){var n=this._placeholder,i=this.el.parentNode;if(t){if(!this.visible)if(this._el)c(i,this._el,n),s(i,n),this.el=g(this._el),this.visible=t;else{var r=new(0,this._View)(this._initData);this.el=g(r),this.view=r,c(i,r,n),s(i,n)}this.view&&this.view.update&&this.view.update(e)}else if(this.visible){if(this._el)return c(i,n,this._el),s(i,this._el),this.el=n,void(this.visible=t);c(i,n,this.view),s(i,this.view),this.el=n,this.view=null}this.visible=t};var m=function(t,e,n){this.el=h(t),this.Views=e,this.initData=n};m.prototype.update=function(t,e){if(t!==this.route){var n=this.Views[t];this.route=t,n&&(n instanceof Node||n.el instanceof Node)?this.view=n:this.view=n&&new n(this.initData,e),w(this.el,[this.view])}this.view&&this.view.update&&this.view.update(e,t)};var N="http://www.w3.org/2000/svg",C={};function B(t){for(var e,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var s=typeof t;if("string"===s)e=F(t).cloneNode(!1);else if(E(t))e=t.cloneNode(!1);else{if("function"!==s)throw new Error("At least one argument required");var r=t;e=new(Function.prototype.bind.apply(r,[null].concat(n)))}return f(g(e),n,!0),e}function F(t){return C[t]||(C[t]=i(t,N))}B.extend=function(t){var e=F(t);return B.bind(this,e)},B.ns=N},9:function(t,e,n){"use strict";var i=n(6);class s{static byteToUnsigned(t){let e=Math.floor(t);return e>=0?e:e+256}static fourBytesToInt(t,e){let n=s.byteToUnsigned(t[e++]);return n|=s.byteToUnsigned(t[e++])<<8,n|=s.byteToUnsigned(t[e++])<<16,n|=s.byteToUnsigned(t[e])<<24}static intToFourBytes(t,e){e.push(255&t),e.push(t>>>8&255),e.push(t>>>16&255),e.push(t>>>24&255)}static PERM_OP(t,e,n,i){let s=(t>>>n^e)&i;return[t^=s<<n,e^=s]}static HPERM_OP(t,e,n){let i=(t<<16-e^t)&n;return t^i^i>>>16-e}static des_set_key(t){let e=new Array(2*s.ITERATIONS),n=s.fourBytesToInt(t,0),i=s.fourBytesToInt(t,4);[i,n]=s.PERM_OP(i,n,4,252645135),n=s.HPERM_OP(n,-2,3435921408),i=s.HPERM_OP(i,-2,3435921408),[i,n]=s.PERM_OP(i,n,1,1431655765),[n,i]=s.PERM_OP(n,i,8,16711935),[i,n]=s.PERM_OP(i,n,1,1431655765),i=(255&i)<<16|65280&i|(16711680&i)>>>16|(4026531840&n)>>>4,n&=268435455;let r=0;for(let t=0;t<s.ITERATIONS;t++){s.shifts2[t]?(n=n>>>2|n<<26,i=i>>>2|i<<26):(n=n>>>1|n<<27,i=i>>>1|i<<27),n&=268435455,i&=268435455;let a=s.skb[0][63&n]|s.skb[1][n>>>6&3|n>>>7&60]|s.skb[2][n>>>13&15|n>>>14&48]|s.skb[3][n>>>20&1|n>>>21&6|n>>>22&56],o=s.skb[4][63&i]|s.skb[5][i>>>7&3|i>>>8&60]|s.skb[6][i>>>15&63]|s.skb[7][i>>>21&15|i>>>22&48];e[r++]=4294967295&(o<<16|65535&a),a=(a=a>>>16|4294901760&o)<<4|a>>>28,e[r++]=4294967295&a}return e}static D_ENCRYPT(t,e,n,i,r,a){let o,l,c;return l=(c=e^e>>>16)&i,c&=r,l=l^l<<16^e^a[n],o=(o=c^c<<16^e^a[n+1])>>>4|o<<28,t^=s.SPtrans[1][63&o]|s.SPtrans[3][o>>>8&63]|s.SPtrans[5][o>>>16&63]|s.SPtrans[7][o>>>24&63]|s.SPtrans[0][63&l]|s.SPtrans[2][l>>>8&63]|s.SPtrans[4][l>>>16&63]|s.SPtrans[6][l>>>24&63]}static body(t,e,n){let i=0,r=0,a=0;for(let o=0;o<25;o++){for(let a=0;a<2*s.ITERATIONS;a+=4)i=s.D_ENCRYPT(i,r,a,e,n,t),r=s.D_ENCRYPT(r,i,a+2,e,n,t);a=i,i=r,r=a}return a=r,r=i>>>1|i<<31,i=a>>>1|a<<31,i&=4294967295,r&=4294967295,[r,i]=s.PERM_OP(r,i,1,1431655765),[i,r]=s.PERM_OP(i,r,8,16711935),[r,i]=s.PERM_OP(r,i,2,858993459),[i,r]=s.PERM_OP(i,r,16,65535),[r,i]=s.PERM_OP(r,i,4,252645135),[i,r]}static crypt(t,e){for(;t.length<2;)t+="A";let n,i=t.charAt(0)+"",r=t.charAt(1)+"",a=i.charCodeAt(0),o=r.charCodeAt(0);n=i+r+" ";let l=s.con_salt[a],c=s.con_salt[o]<<4,u=[0,0,0,0,0,0,0,0];for(let t=0;t<u.length&&t<e.length;t++){let n=e.charCodeAt(t);u[t]=n<<1}let _=s.des_set_key(u),d=s.body(_,l,c),T=new Array(9);s.intToFourBytes(d[0],T),s.intToFourBytes(d[1],T),T.push(0);let O=0;for(let t=2,e=128;t<13;t++)for(let i=0,r=0;i<6;i++)r<<=1,0!=(T[O]&e)&&(r|=1),0===(e>>>=1)&&(O++,e=128),n=n.substring(0,t)+String.fromCharCode(s.cov_2char[r])+n.substring(t+1,n.length);return n}}s.ITERATIONS=16,s.con_salt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,0],s.shifts2=[!1,!1,!0,!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0,!1],s.skb=[[0,16,536870912,536870928,65536,65552,536936448,536936464,2048,2064,536872960,536872976,67584,67600,536938496,536938512,32,48,536870944,536870960,65568,65584,536936480,536936496,2080,2096,536872992,536873008,67616,67632,536938528,536938544,524288,524304,537395200,537395216,589824,589840,537460736,537460752,526336,526352,537397248,537397264,591872,591888,537462784,537462800,524320,524336,537395232,537395248,589856,589872,537460768,537460784,526368,526384,537397280,537397296,591904,591920,537462816,537462832],[0,33554432,8192,33562624,2097152,35651584,2105344,35659776,4,33554436,8196,33562628,2097156,35651588,2105348,35659780,1024,33555456,9216,33563648,2098176,35652608,2106368,35660800,1028,33555460,9220,33563652,2098180,35652612,2106372,35660804,268435456,301989888,268443648,301998080,270532608,304087040,270540800,304095232,268435460,301989892,268443652,301998084,270532612,304087044,270540804,304095236,268436480,301990912,268444672,301999104,270533632,304088064,270541824,304096256,268436484,301990916,268444676,301999108,270533636,304088068,270541828,304096260],[0,1,262144,262145,16777216,16777217,17039360,17039361,2,3,262146,262147,16777218,16777219,17039362,17039363,512,513,262656,262657,16777728,16777729,17039872,17039873,514,515,262658,262659,16777730,16777731,17039874,17039875,134217728,134217729,134479872,134479873,150994944,150994945,151257088,151257089,134217730,134217731,134479874,134479875,150994946,150994947,151257090,151257091,134218240,134218241,134480384,134480385,150995456,150995457,151257600,151257601,134218242,134218243,134480386,134480387,150995458,150995459,151257602,151257603],[0,1048576,256,1048832,8,1048584,264,1048840,4096,1052672,4352,1052928,4104,1052680,4360,1052936,67108864,68157440,67109120,68157696,67108872,68157448,67109128,68157704,67112960,68161536,67113216,68161792,67112968,68161544,67113224,68161800,131072,1179648,131328,1179904,131080,1179656,131336,1179912,135168,1183744,135424,1184e3,135176,1183752,135432,1184008,67239936,68288512,67240192,68288768,67239944,68288520,67240200,68288776,67244032,68292608,67244288,68292864,67244040,68292616,67244296,68292872],[0,268435456,65536,268500992,4,268435460,65540,268500996,536870912,805306368,536936448,805371904,536870916,805306372,536936452,805371908,1048576,269484032,1114112,269549568,1048580,269484036,1114116,269549572,537919488,806354944,537985024,806420480,537919492,806354948,537985028,806420484,4096,268439552,69632,268505088,4100,268439556,69636,268505092,536875008,805310464,536940544,805376e3,536875012,805310468,536940548,805376004,1052672,269488128,1118208,269553664,1052676,269488132,1118212,269553668,537923584,806359040,537989120,806424576,537923588,806359044,537989124,806424580],[0,134217728,8,134217736,1024,134218752,1032,134218760,131072,134348800,131080,134348808,132096,134349824,132104,134349832,1,134217729,9,134217737,1025,134218753,1033,134218761,131073,134348801,131081,134348809,132097,134349825,132105,134349833,33554432,167772160,33554440,167772168,33555456,167773184,33555464,167773192,33685504,167903232,33685512,167903240,33686528,167904256,33686536,167904264,33554433,167772161,33554441,167772169,33555457,167773185,33555465,167773193,33685505,167903233,33685513,167903241,33686529,167904257,33686537,167904265],[0,256,524288,524544,16777216,16777472,17301504,17301760,16,272,524304,524560,16777232,16777488,17301520,17301776,2097152,2097408,2621440,2621696,18874368,18874624,19398656,19398912,2097168,2097424,2621456,2621712,18874384,18874640,19398672,19398928,512,768,524800,525056,16777728,16777984,17302016,17302272,528,784,524816,525072,16777744,16778e3,17302032,17302288,2097664,2097920,2621952,2622208,18874880,18875136,19399168,19399424,2097680,2097936,2621968,2622224,18874896,18875152,19399184,19399440],[0,67108864,262144,67371008,2,67108866,262146,67371010,8192,67117056,270336,67379200,8194,67117058,270338,67379202,32,67108896,262176,67371040,34,67108898,262178,67371042,8224,67117088,270368,67379232,8226,67117090,270370,67379234,2048,67110912,264192,67373056,2050,67110914,264194,67373058,10240,67119104,272384,67381248,10242,67119106,272386,67381250,2080,67110944,264224,67373088,2082,67110946,264226,67373090,10272,67119136,272416,67381280,10274,67119138,272418,67381282]],s.SPtrans=[[8520192,131072,2155872256,2156003840,8388608,2147615232,2147614720,2155872256,2147615232,8520192,8519680,2147484160,2155872768,8388608,0,2147614720,131072,2147483648,8389120,131584,2156003840,8519680,2147484160,8389120,2147483648,512,131584,2156003328,512,2155872768,2156003328,0,0,2156003840,8389120,2147614720,8520192,131072,2147484160,8389120,2156003328,512,131584,2155872256,2147615232,2147483648,2155872256,8519680,2156003840,131584,8519680,2155872768,8388608,2147484160,2147614720,0,131072,8388608,2155872768,8520192,2147483648,2156003328,512,2147615232],[268705796,0,270336,268697600,268435460,8196,268443648,270336,8192,268697604,4,268443648,262148,268705792,268697600,4,262144,268443652,268697604,8192,270340,268435456,0,262148,268443652,270340,268705792,268435460,268435456,262144,8196,268705796,262148,268705792,268443648,270340,268705796,262148,268435460,0,268435456,8196,262144,268697604,8192,268435456,270340,268443652,268705792,8192,0,268435460,4,268705796,270336,268697600,268697604,262144,8196,268443648,268443652,4,268697600,270336],[1090519040,16842816,64,1090519104,1073807360,16777216,1090519104,65600,16777280,65536,16842752,1073741824,1090584640,1073741888,1073741824,1090584576,0,1073807360,16842816,64,1073741888,1090584640,65536,1090519040,1090584576,16777280,1073807424,16842752,65600,0,16777216,1073807424,16842816,64,1073741824,65536,1073741888,1073807360,16842752,1090519104,0,16842816,65600,1090584576,1073807360,16777216,1090584640,1073741824,1073807424,1090519040,16777216,1090584640,65536,16777280,1090519104,65600,16777280,0,1090584576,1073741888,1090519040,1073807424,64,16842752],[1049602,67109888,2,68158466,0,68157440,67109890,1048578,68158464,67108866,67108864,1026,67108866,1049602,1048576,67108864,68157442,1049600,1024,2,1049600,67109890,68157440,1024,1026,0,1048578,68158464,67109888,68157442,68158466,1048576,68157442,1026,1048576,67108866,1049600,67109888,2,68157440,67109890,0,1024,1048578,0,68157442,68158464,1024,67108864,68158466,1049602,1048576,68158466,2,67109888,1049602,1048578,1049600,68157440,67109890,1026,67108864,67108866,68158464],[33554432,16384,256,33571080,33570824,33554688,16648,33570816,16384,8,33554440,16640,33554696,33570824,33571072,0,16640,33554432,16392,264,33554688,16648,0,33554440,8,33554696,33571080,16392,33570816,256,264,33571072,33571072,33554696,16392,33570816,16384,8,33554440,33554688,33554432,16640,33571080,0,16648,33554432,256,16392,33554696,256,0,33571080,33570824,33571072,264,16384,16640,33570824,33554688,264,8,16648,33570816,33554440],[536870928,524304,0,537397248,524304,2048,536872976,524288,2064,537397264,526336,536870912,536872960,536870928,537395200,526352,524288,536872976,537395216,0,2048,16,537397248,537395216,537397264,537395200,536870912,2064,16,526336,526352,536872960,2064,536870912,536872960,526352,537397248,524304,0,536872960,536870912,2048,537395216,524288,524304,537397264,526336,16,537397264,526336,524288,536872976,536870928,537395200,526352,0,2048,536870928,536872976,537397248,537395200,2064,16,537395216],[4096,128,4194432,4194305,4198529,4097,4224,0,4194304,4194433,129,4198400,1,4198528,4198400,129,4194433,4096,4097,4198529,0,4194432,4194305,4224,4198401,4225,4198528,1,4225,4198401,128,4194304,4225,4198400,4198401,129,4096,128,4194304,4198401,4194433,4225,4224,0,128,4194305,1,4194432,0,4194433,4194432,4224,129,4096,4198529,4194304,4198528,1,4097,4198529,4194305,4198528,4198400,4097],[136314912,136347648,32800,0,134250496,2097184,136314880,136347680,32,134217728,2129920,32800,2129952,134250528,134217760,136314880,32768,2129952,2097184,134250496,136347680,134217760,0,2129920,134217728,2097152,134250528,136314912,2097152,32768,136347648,32,2097152,32768,134217760,136347680,32800,134217728,0,2129920,136314912,134250528,134250496,2097184,136347648,32,2097184,134250496,136347680,2097152,136314880,134217760,2129920,32800,134250528,136314880,32,136347648,2129952,0,134217728,136314912,32768,2129952]],s.cov_2char=[46,47,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122];var r=n(5);n.d(e,"a",function(){return a});class a{constructor(t=(()=>{}),e=(()=>{})){this.bc_success=t,this.bc_cancel=e,this.render()}static is_authorized(t,e=!1){return a.priv&t||e||window.alert("Not authorized for this operation"),!!(a.priv&t)}static fetchFromStore(){a.priv=Number(localStorage.getItem("pwr_privilege")),a.user=localStorage.getItem("pwr_user")}login_cb(t){1&t.sts?(a.priv=t.value,localStorage.setItem("pwr_privilege",String(a.priv)),document.title=a.user+" on "+window.location.hostname||"localhost",console.log("Login",a.user,"Priv",a.priv),this.bc_success&&this.bc_success()):(a.logout_cb(),console.log("Login failure","Priv",a.priv))}static logout_cb(){a.priv=0,a.user="",localStorage.setItem("pwr_privilege",String(a.priv)),document.title=window.location.hostname||"localhost"}render(){let t=Object(i.a)("div",{style:{backgroundColor:"#ddeeff",padding:"10px",display:"block",overflow:"hidden",margin:"auto",width:"max-content"}});Object(i.b)(t,Object(i.d)("Host")),Object(i.b)(t,Object(i.a)("br"));let e=localStorage.getItem("HOST")||"localhost",n=Object(i.a)("input",{value:e});Object(i.b)(t,n),Object(i.b)(t,Object(i.a)("br")),Object(i.b)(t,Object(i.d)("Username")),Object(i.b)(t,Object(i.a)("br"));let o=Object(i.a)("input",{autofocus:!0});Object(i.b)(t,o),Object(i.b)(t,Object(i.a)("br")),Object(i.b)(t,Object(i.d)("Password")),Object(i.b)(t,Object(i.a)("br"));let l=Object(i.a)("input",{type:"password"});Object(i.b)(t,l),Object(i.b)(t,Object(i.a)("br"));let c=Object(i.a)("input",{type:"button",value:"Apply"});Object(i.b)(t,c);let u=Object(i.a)("input",{type:"button",value:"Cancel",style:{cssFloat:"right"}});Object(i.b)(t,u),Object(i.c)(document.body,t);let _=this;c.addEventListener("click",()=>{let t=o.value,e=l.value;e=s.crypt("aa",e),a.user=t,localStorage.setItem("HOST",n.value),r.d.init().then(()=>{r.d.login(t,e).then(_.login_cb.bind(_))})}),u.addEventListener("click",this.bc_cancel)}static reduce_privilege(t){this.priv&=~t,localStorage.setItem("pwr_privilege",String(a.priv))}}a.priv=0,a.user=""}});
\ No newline at end of file
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Operator window</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
<style>
.menu {
float: left;
width: 20%;
height: 100%;
}
.main {
float: left;
width: 79%;
height: 100%;
}
</style>
</head>
<body>
<iframe class="menu" src="opwind_menu.html"></iframe>
<iframe class="main" src="xtt_help_index.html"></iframe>
<script src="opwind.bundle.js"></script>
</body>
</html>
"use strict";function JopCrypt(){this.ITERATIONS=16,this.con_salt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,0],this.shifts2=[!1,!1,!0,!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!0,!1],this.skb=[[0,16,536870912,536870928,65536,65552,536936448,536936464,2048,2064,536872960,536872976,67584,67600,536938496,536938512,32,48,536870944,536870960,65568,65584,536936480,536936496,2080,2096,536872992,536873008,67616,67632,536938528,536938544,524288,524304,537395200,537395216,589824,589840,537460736,537460752,526336,526352,537397248,537397264,591872,591888,537462784,537462800,524320,524336,537395232,537395248,589856,589872,537460768,537460784,526368,526384,537397280,537397296,591904,591920,537462816,537462832],[0,33554432,8192,33562624,2097152,35651584,2105344,35659776,4,33554436,8196,33562628,2097156,35651588,2105348,35659780,1024,33555456,9216,33563648,2098176,35652608,2106368,35660800,1028,33555460,9220,33563652,2098180,35652612,2106372,35660804,268435456,301989888,268443648,301998080,270532608,304087040,270540800,304095232,268435460,301989892,268443652,301998084,270532612,304087044,270540804,304095236,268436480,301990912,268444672,301999104,270533632,304088064,270541824,304096256,268436484,301990916,268444676,301999108,270533636,304088068,270541828,304096260],[0,1,262144,262145,16777216,16777217,17039360,17039361,2,3,262146,262147,16777218,16777219,17039362,17039363,512,513,262656,262657,16777728,16777729,17039872,17039873,514,515,262658,262659,16777730,16777731,17039874,17039875,134217728,134217729,134479872,134479873,150994944,150994945,151257088,151257089,134217730,134217731,134479874,134479875,150994946,150994947,151257090,151257091,134218240,134218241,134480384,134480385,150995456,150995457,151257600,151257601,134218242,134218243,134480386,134480387,150995458,150995459,151257602,151257603],[0,1048576,256,1048832,8,1048584,264,1048840,4096,1052672,4352,1052928,4104,1052680,4360,1052936,67108864,68157440,67109120,68157696,67108872,68157448,67109128,68157704,67112960,68161536,67113216,68161792,67112968,68161544,67113224,68161800,131072,1179648,131328,1179904,131080,1179656,131336,1179912,135168,1183744,135424,1184e3,135176,1183752,135432,1184008,67239936,68288512,67240192,68288768,67239944,68288520,67240200,68288776,67244032,68292608,67244288,68292864,67244040,68292616,67244296,68292872],[0,268435456,65536,268500992,4,268435460,65540,268500996,536870912,805306368,536936448,805371904,536870916,805306372,536936452,805371908,1048576,269484032,1114112,269549568,1048580,269484036,1114116,269549572,537919488,806354944,537985024,806420480,537919492,806354948,537985028,806420484,4096,268439552,69632,268505088,4100,268439556,69636,268505092,536875008,805310464,536940544,805376e3,536875012,805310468,536940548,805376004,1052672,269488128,1118208,269553664,1052676,269488132,1118212,269553668,537923584,806359040,537989120,806424576,537923588,806359044,537989124,806424580],[0,134217728,8,134217736,1024,134218752,1032,134218760,131072,134348800,131080,134348808,132096,134349824,132104,134349832,1,134217729,9,134217737,1025,134218753,1033,134218761,131073,134348801,131081,134348809,132097,134349825,132105,134349833,33554432,167772160,33554440,167772168,33555456,167773184,33555464,167773192,33685504,167903232,33685512,167903240,33686528,167904256,33686536,167904264,33554433,167772161,33554441,167772169,33555457,167773185,33555465,167773193,33685505,167903233,33685513,167903241,33686529,167904257,33686537,167904265],[0,256,524288,524544,16777216,16777472,17301504,17301760,16,272,524304,524560,16777232,16777488,17301520,17301776,2097152,2097408,2621440,2621696,18874368,18874624,19398656,19398912,2097168,2097424,2621456,2621712,18874384,18874640,19398672,19398928,512,768,524800,525056,16777728,16777984,17302016,17302272,528,784,524816,525072,16777744,16778e3,17302032,17302288,2097664,2097920,2621952,2622208,18874880,18875136,19399168,19399424,2097680,2097936,2621968,2622224,18874896,18875152,19399184,19399440],[0,67108864,262144,67371008,2,67108866,262146,67371010,8192,67117056,270336,67379200,8194,67117058,270338,67379202,32,67108896,262176,67371040,34,67108898,262178,67371042,8224,67117088,270368,67379232,8226,67117090,270370,67379234,2048,67110912,264192,67373056,2050,67110914,264194,67373058,10240,67119104,272384,67381248,10242,67119106,272386,67381250,2080,67110944,264224,67373088,2082,67110946,264226,67373090,10272,67119136,272416,67381280,10274,67119138,272418,67381282]],this.SPtrans=[[8520192,131072,2155872256,2156003840,8388608,2147615232,2147614720,2155872256,2147615232,8520192,8519680,2147484160,2155872768,8388608,0,2147614720,131072,2147483648,8389120,131584,2156003840,8519680,2147484160,8389120,2147483648,512,131584,2156003328,512,2155872768,2156003328,0,0,2156003840,8389120,2147614720,8520192,131072,2147484160,8389120,2156003328,512,131584,2155872256,2147615232,2147483648,2155872256,8519680,2156003840,131584,8519680,2155872768,8388608,2147484160,2147614720,0,131072,8388608,2155872768,8520192,2147483648,2156003328,512,2147615232],[268705796,0,270336,268697600,268435460,8196,268443648,270336,8192,268697604,4,268443648,262148,268705792,268697600,4,262144,268443652,268697604,8192,270340,268435456,0,262148,268443652,270340,268705792,268435460,268435456,262144,8196,268705796,262148,268705792,268443648,270340,268705796,262148,268435460,0,268435456,8196,262144,268697604,8192,268435456,270340,268443652,268705792,8192,0,268435460,4,268705796,270336,268697600,268697604,262144,8196,268443648,268443652,4,268697600,270336],[1090519040,16842816,64,1090519104,1073807360,16777216,1090519104,65600,16777280,65536,16842752,1073741824,1090584640,1073741888,1073741824,1090584576,0,1073807360,16842816,64,1073741888,1090584640,65536,1090519040,1090584576,16777280,1073807424,16842752,65600,0,16777216,1073807424,16842816,64,1073741824,65536,1073741888,1073807360,16842752,1090519104,0,16842816,65600,1090584576,1073807360,16777216,1090584640,1073741824,1073807424,1090519040,16777216,1090584640,65536,16777280,1090519104,65600,16777280,0,1090584576,1073741888,1090519040,1073807424,64,16842752],[1049602,67109888,2,68158466,0,68157440,67109890,1048578,68158464,67108866,67108864,1026,67108866,1049602,1048576,67108864,68157442,1049600,1024,2,1049600,67109890,68157440,1024,1026,0,1048578,68158464,67109888,68157442,68158466,1048576,68157442,1026,1048576,67108866,1049600,67109888,2,68157440,67109890,0,1024,1048578,0,68157442,68158464,1024,67108864,68158466,1049602,1048576,68158466,2,67109888,1049602,1048578,1049600,68157440,67109890,1026,67108864,67108866,68158464],[33554432,16384,256,33571080,33570824,33554688,16648,33570816,16384,8,33554440,16640,33554696,33570824,33571072,0,16640,33554432,16392,264,33554688,16648,0,33554440,8,33554696,33571080,16392,33570816,256,264,33571072,33571072,33554696,16392,33570816,16384,8,33554440,33554688,33554432,16640,33571080,0,16648,33554432,256,16392,33554696,256,0,33571080,33570824,33571072,264,16384,16640,33570824,33554688,264,8,16648,33570816,33554440],[536870928,524304,0,537397248,524304,2048,536872976,524288,2064,537397264,526336,536870912,536872960,536870928,537395200,526352,524288,536872976,537395216,0,2048,16,537397248,537395216,537397264,537395200,536870912,2064,16,526336,526352,536872960,2064,536870912,536872960,526352,537397248,524304,0,536872960,536870912,2048,537395216,524288,524304,537397264,526336,16,537397264,526336,524288,536872976,536870928,537395200,526352,0,2048,536870928,536872976,537397248,537395200,2064,16,537395216],[4096,128,4194432,4194305,4198529,4097,4224,0,4194304,4194433,129,4198400,1,4198528,4198400,129,4194433,4096,4097,4198529,0,4194432,4194305,4224,4198401,4225,4198528,1,4225,4198401,128,4194304,4225,4198400,4198401,129,4096,128,4194304,4198401,4194433,4225,4224,0,128,4194305,1,4194432,0,4194433,4194432,4224,129,4096,4198529,4194304,4198528,1,4097,4198529,4194305,4198528,4198400,4097],[136314912,136347648,32800,0,134250496,2097184,136314880,136347680,32,134217728,2129920,32800,2129952,134250528,134217760,136314880,32768,2129952,2097184,134250496,136347680,134217760,0,2129920,134217728,2097152,134250528,136314912,2097152,32768,136347648,32,2097152,32768,134217760,136347680,32800,134217728,0,2129920,136314912,134250528,134250496,2097184,136347648,32,2097184,134250496,136347680,2097152,136314880,134217760,2129920,32800,134250528,136314880,32,136347648,2129952,0,134217728,136314912,32768,2129952]],this.cov_2char=[46,47,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122],this.byteToUnsigned=function(e){var t=Math.floor(e);return 0<=t?t:t+256},this.fourBytesToInt=function(e,t){var n;return n=this.byteToUnsigned(e[t++]),n|=this.byteToUnsigned(e[t++])<<8,n|=this.byteToUnsigned(e[t++])<<16,n|=this.byteToUnsigned(e[t++])<<24},this.intToFourBytes=function(e,t,n){t[n++]=255&e,t[n++]=e>>>8&255,t[n++]=e>>>16&255,t[n++]=e>>>24&255},this.PERM_OP=function(e,t,n,i,s){var o;e^=(o=(e>>>n^t)&i)<<n,t^=o,s[0]=e,s[1]=t},this.HPERM_OP=function(e,t,n){var i;return e=e^(i=(e<<16-t^e)&n)^i>>>16-t},this.des_set_key=function(e){var t,n,i=new Array(2*this.ITERATIONS),s=this.fourBytesToInt(e,0),o=this.fourBytesToInt(e,4),r=new Array(2);this.PERM_OP(o,s,4,252645135,r),o=r[0],s=r[1],s=this.HPERM_OP(s,-2,3435921408),o=this.HPERM_OP(o,-2,3435921408),this.PERM_OP(o,s,1,1431655765,r),o=r[0],s=r[1],this.PERM_OP(s,o,8,16711935,r),s=r[0],o=r[1],this.PERM_OP(o,s,1,1431655765,r),o=(255&(o=r[0]))<<16|65280&o|(16711680&o)>>>16|(4026531840&(s=r[1]))>>>4,s&=268435455;for(var d=0,h=0;h<this.ITERATIONS;h++)o=this.shifts2[h]?(s=s>>>2|s<<26,o>>>2|o<<26):(s=s>>>1|s<<27,o>>>1|o<<27),s&=268435455,o&=268435455,t=this.skb[0][63&s]|this.skb[1][s>>>6&3|s>>>7&60]|this.skb[2][s>>>13&15|s>>>14&48]|this.skb[3][s>>>20&1|s>>>21&6|s>>>22&56],n=this.skb[4][63&o]|this.skb[5][o>>>7&3|o>>>8&60]|this.skb[6][o>>>15&63]|this.skb[7][o>>>21&15|o>>>22&48],i[d++]=4294967295&(n<<16|65535&t),t=(t=t>>>16|4294901760&n)<<4|t>>>28,i[d++]=4294967295&t;return i},this.D_ENCRYPT=function(e,t,n,i,s,o){var r,d,h;return d=(h=t^t>>>16)&i,h&=s,d=d^d<<16^t^o[n],r=(r=h^h<<16^t^o[n+1])>>>4|r<<28,e^=this.SPtrans[1][63&r]|this.SPtrans[3][r>>>8&63]|this.SPtrans[5][r>>>16&63]|this.SPtrans[7][r>>>24&63]|this.SPtrans[0][63&d]|this.SPtrans[2][d>>>8&63]|this.SPtrans[4][d>>>16&63]|this.SPtrans[6][d>>>24&63]},this.body=function(e,t,n){for(var i=0,s=0,o=0,r=0;r<25;r++){for(var d=0;d<2*this.ITERATIONS;d+=4)i=this.D_ENCRYPT(i,s,d,t,n,e),s=this.D_ENCRYPT(s,i,d+2,t,n,e);o=i,i=s,s=o}o=s,s=i>>>1|i<<31,i=o>>>1|o<<31,i&=4294967295,s&=4294967295;var h=new Array(2);this.PERM_OP(s,i,1,1431655765,h),s=h[0],i=h[1],this.PERM_OP(i,s,8,16711935,h),i=h[0],s=h[1],this.PERM_OP(s,i,2,858993459,h),s=h[0],i=h[1],this.PERM_OP(i,s,16,65535,h),i=h[0],s=h[1],this.PERM_OP(s,i,4,252645135,h),s=h[0],i=h[1];var a=new Array(2);return a[0]=i,a[1]=s,a},this.crypt=function(e,t){for(;e.length<2;)e+="A";var n,i=e.charAt(0)+"",s=e.charAt(1)+"",o=i.charCodeAt(0),r=s.charCodeAt(0);console.log("charZero",i,"charOne",s),n=i+s+" ",console.log('buffer "'+n+'"');for(var d=this.con_salt[o],h=this.con_salt[r]<<4,a=new Array(0,0,0,0,0,0,0,0),l=0;l<a.length&&l<t.length;l++){var g=t.charCodeAt(l);a[l]=g<<1}var c=this.des_set_key(a),_=this.body(c,d,h),u=new Array(9);this.intToFourBytes(_[0],u,0),this.intToFourBytes(_[1],u,4);l=2;for(var f=u[8]=0,b=128;l<13;l++)for(var m=0,p=0;m<6;m++)p<<=1,0!=(u[f]&b)&&(p|=1),0==(b>>>=1)&&(f++,b=128),n=n.substring(0,l)+String.fromCharCode(this.cov_2char[p])+n.substring(l+1,n.length);return n}}function PwrtStatus(e){this.sts=e,this.evenSts=function(){return e%2==0},this.oddSts=function(){return e%2==1},this.getSts=function(){return e}}var Pwr={eType_Boolean:98305,eType_Float32:98306,eType_Float64:98307,eType_Char:98308,eType_Int8:98309,eType_Int16:98310,eType_Int32:98311,eType_UInt8:98312,eType_UInt16:98313,eType_UInt32:98314,eType_Objid:98315,eType_Buffer:98316,eType_String:98317,eType_Enum:98318,eType_Struct:98319,eType_Mask:98320,eType_Array:98321,eType_Time:98322,eType_Text:98323,eType_AttrRef:98324,eType_UInt64:98325,eType_Int64:98326,eType_ClassId:98327,eType_TypeId:98328,eType_VolumeId:98329,eType_ObjectIx:98330,eType_RefId:98331,eType_DeltaTime:98332,eType_Status:98333,eType_NetStatus:98334,eType_CastId:98335,eType_ProString:98336,eType_DisableAttr:98337,eType_DataRef:98338,mPrv_RtRead:1,mPrv_RtWrite:2,mPrv_System:4,mPrv_Maintenance:8,mPrv_Process:16,mPrv_Instrument:32,mPrv_Operator1:64,mPrv_Operator2:128,mPrv_Operator3:256,mPrv_Operator4:512,mPrv_Operator5:1024,mPrv_Operator6:2048,mPrv_Operator7:4096,mPrv_Operator8:8192,mPrv_Operator9:16384,mPrv_Operator10:32768,mPrv_RtEventsAck:1<<18,mPrv_RtPlc:1<<19,mPrv_RtNavigator:1<<20,mPrv_DevRead:1<<21,mPrv_DevPlc:1<<22,mPrv_DevConfig:1<<23,mPrv_DevClass:1<<24,mPrv_RtEventsBlock:1<<25,mPrv_Administrator:1<<26,mPrv_SevRead:1<<27,mPrv_SevAdmin:1<<28,mAccess_RtRead:1,mAccess_RtWrite:2,mAccess_System:4,mAccess_Maintenance:8,mAccess_Process:16,mAccess_Instrument:32,mAccess_RtEventsBlock:1<<25,mAccess_RtEventsAck:1<<18,mAccess_RtPlc:1<<19,mAccess_RtNavigator:1<<20,mAccess_AllRt:35454975,mAccess_AllOperators:65472,mAccess_AllPwr:-1,mAdef_pointer:1,mAdef_array:2,mAdef_backup:4,mAdef_changelog:8,mAdef_state:16,mAdef_const:32,mAdef_rtvirtual:64,mAdef_devbodyref:128,mAdef_dynamic:256,mAdef_publicwrite:512,mAdef_noedit:1024,mAdef_invisible:2048,mAdef_refdirect:4096,mAdef_noinvert:8192,mAdef_noremove:16384,mAdef_rtdbref:32768,mAdef_private:65536,mAdef_class:131072,mAdef_superclass:262144,mAdef_buffer:524288,mAdef_nowbl:1048576,mAdef_alwayswbl:2097152,mAdef_disableattr:4194304,mAdef_rthide:8388608},Pwrb={mXttMethodsFlagsMask_IsConfigured:1,mXttOpMethodsMask_OpenGraph:1,mXttOpMethodsMask_OpenObjectGraph:2,mXttOpMethodsMask_OpenTrend:4,mXttOpMethodsMask_OpenHistory:8,mXttOpMethodsMask_OpenFast:16,mXttOpMethodsMask_Camera:32,mXttOpMethodsMask_HistEvent:64,mXttOpMethodsMask_BlockEvents:128,mXttOpMethodsMask_Help:256,mXttOpMethodsMask_Photo:512,mXttOpMethodsMask_Note:1024,mXttOpMethodsMask_ParentObjectGraph:2048,mXttMntMethodsMask_OpenObject:1,mXttMntMethodsMask_OpenTrace:2,mXttMntMethodsMask_RtNavigator:4,mXttMntMethodsMask_OpenCrossref:8,mXttMntMethodsMask_HelpClass:16,mXttMntMethodsMask_DataSheet:32,mXttMntMethodsMask_CircuitDiagram:64,mXttMntMethodsMask_Simulate:1<<31};function PwrtObjid(e,t){this.oix=t,this.vid=e}function PwrtAttrRef(){this.objid,this.offset,this.body,this.size,this.flags}function CdhrNumber(e,t){this.value=e,this.sts=t,this.evenSts=function(){return t%2==0},this.oddSts=function(){return t%2==1},this.getSts=function(){return t}}var CdhC={cUserVolMin:65793,cUserVolMax:16711422};function UserdataCbReturn(){this.userdata,this.row}function Sub(){this.sts,this.refid,this.type,this.elements,this.name,this.value}function ObjectInfo(){this.objid,this.cid,this.has_children,this.name,this.description,this.classname,this.full_name,this.param1}function AttributeInfo(){this.name,this.type,this.size,this.flags,this.element,this.objid,this.full_name,this.classname}function MenuButton(){this.type,this.text,this.name,this.url}function OpwindMenuInfo(){this.title,this.text,this.enable_language,this.enable_login,this.enable_alarmlist,this.enable_eventlog,this.enable_navigator,this.disable_help,this.disable_proview,this.language,this.buttons=[]}function CrrInfo(){this.type,this.objid,this.name,this.classname}function GlowPieInfo(){this.sector_num,this.min_val,this.max_val}function GlowBarChartInfo(){this.bars,this.barsegments,this.min_value,this.max_value}function GlowTableInfo(){this.columns,this.rows,this.column_size=new Array(Glow.TABLE_MAX_COL)}function PendingData(e,t){this.func_cb=e,this.data=t}var GdhOp={GET_OP_SELF:1,GET_OP_METHOD_PLC:2,GET_OP_METHOD_OBJECTGRAPH:3,GET_OP_METHOD_GRAPH:4,GET_OP_METHOD_HELPCLASS:5};function Gdh(){var j=1,M=2,E=3,k=4,R=5,B=6,D=7,L=9,G=10,N=15,F=25,X=26,z=29,H=36,W=39,V=42,J=50,Y=57,q=63,Z=64,K=65,Q=66,$=67,ee=68;this.debug=!1,this.pending=[],this.sub=[],this.PORT=4448,this.ws=null,this.open_cb=null,this.close_cb=null,this.return_cb=null,this.next_id=1234,this.subscriptionCount=1,this.listSend=!1,this.init=function(){""===window.location.hostname?this.ws=new WebSocket("ws:127.0.0.1:4448"):this.ws=new WebSocket("ws://"+window.location.hostname+":4448"),this.ws.binaryType="arraybuffer",(this.ws.gdh=this).ws.onopen=function(e){null!==this.gdh.open_cb&&this.gdh.open_cb()},this.ws.onclose=function(){this.debug&&console.log("Socket closed"),null!==this.gdh.close_cb&&this.gdh.close_cb()},this.ws.onmessage=function(e){if("string"==typeof e.data)console.log("String message received",e,e.data);else if(e.data instanceof ArrayBuffer){var t=new DataView(e.data),n=t.getUint8(0),i=t.getUint32(1),s=t.getUint32(5);switch(n){case R:this.gdh.debug&&console.log("GetObjectInfoBoolean received");var o=t.getUint8(9);(0,this.gdh.pending[i].func_cb)(i,s,o),delete this.gdh.pending[i];break;case D:this.gdh.debug&&console.log("GetObjectInfoInt received");o=t.getUint32(9);(T=this.gdh.pending[i]).func_cb(i,T.data,s,o),delete this.gdh.pending[i];break;case B:this.gdh.debug&&console.log("GetObjectInfoFloat received");o=t.getFloat32(9);(T=this.gdh.pending[i]).func_cb(i,T.data,s,o),delete this.gdh.pending[i];break;case Y:this.gdh.debug&&console.log("GetObjectInfoFloatArray received");var r=t.getInt32(9);o=new Array(r);_=13;for(var d=0;d<r;d++)o[d]=t.getFloat32(_),_+=4;(T=this.gdh.pending[i]).func_cb(i,T.data,s,o),delete this.gdh.pending[i];break;case j:this.gdh.debug&&console.log("SetObjectInfoBoolean received",i,s);break;case E:this.gdh.debug&&console.log("SetObjectInfoInt received",i,s);break;case M:this.gdh.debug&&console.log("SetObjectInfoFloat received",i,s);break;case k:this.gdh.debug&&console.log("SetObjectInfoString received",i,s);break;case L:this.gdh.debug&&console.log("ToggleObjectInfo received",i,s);break;case G:this.gdh.debug&&console.log("RefObjectInfo received",i,s),delete this.gdh.pending[i];break;case N:this.gdh.debug&&console.log("UnrefObjectInfo received",i,s),delete this.gdh.pending[i];break;case X:this.gdh.debug&&console.log("RefObjectInfoList received",i,s),(0,this.gdh.pending[i].func_cb)(i,s),delete this.gdh.pending[i];break;case F:var h=9,a=t.getUint32(h);this.gdh.debug&&console.log("GetObjectRefInfoAll received",i,a),h+=4;for(d=0;d<a;d++){var l=t.getUint32(h);h+=4;var g=t.getUint32(h);h+=4;var c=this.gdh.sub[l];if(void 0===c)h+=g;else{switch(c.type){case Pwr.eType_Boolean:if(c.elements<=1)o=t.getUint8(h),h+=1;else{(b=g)!=c.elements&&console.log("Subscription size error",b,c.elements,l),o=new Array(b);for(var _=0;_<b;_++)o[_]=t.getUint8(h),h+=1}break;case Pwr.eType_Float32:if(c.elements<=1)o=t.getFloat32(h),h+=4;else{(b=g/4)!=c.elements&&console.log("Subscription size error",b,c.elements,l),o=new Array(b);for(_=0;_<b;_++)o[_]=t.getFloat32(h),h+=4}break;case Pwr.eType_Int8:case Pwr.eType_Int16:case Pwr.eType_Int32:case Pwr.eType_UInt8:case Pwr.eType_UInt16:case Pwr.eType_UInt32:case Pwr.eType_Status:case Pwr.eType_NetStatus:case Pwr.eType_Mask:case Pwr.eType_Enum:case GraphIfc.eType_Bit:if(c.elements<=1)o=t.getInt32(h),h+=4;else{(b=g/4)!=c.elements&&console.log("Subscription size error",b,c.elements,l),o=new Array(b);for(_=0;_<b;_++)o[_]=t.getInt32(h),h+=4}break;case Pwr.eType_String:case Pwr.eType_Time:case Pwr.eType_DeltaTime:case Pwr.eType_AttrRef:case Pwr.eType_Objid:if(c.elements<=1){var u=t.getInt16(h);h+=2;var f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);o=String.fromCharCode.apply(null,f)}else{var b;(b=c.elements)!=c.elements&&console.log("Subscription size error",b,c.elements,l),o=new Array(b);for(var m=0;m<b;m++){u=t.getInt16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);o[m]=String.fromCharCode.apply(null,f)}}}this.gdh.sub[l].value=o}}if(void 0===this.gdh.pending[i]){console.log("** GetObjectRefInfoAll received removed",i);break}(0,this.gdh.pending[i].func_cb)(i,s),delete this.gdh.pending[i];break;case W:var p=[];h=9,a=t.getUint32(h);this.gdh.debug&&console.log("GetAllXttChildren received",i,a),console.log("GetAllXttChildren received",s,i,a),h+=4;for(d=0;d<a;d++){(y=new ObjectInfo).objid=new PwrtObjid,y.objid.vid=t.getUint32(h),h+=4,y.objid.oix=t.getUint32(h),h+=4,y.cid=t.getUint32(h),h+=4,y.has_children=0!==t.getUint16(h),h+=2;u=t.getUint16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);y.name=String.fromCharCode.apply(null,f);var v=t.getUint16(h);h+=2,f=new Uint8Array(v);for(_=0;_<v;_++)f[_]=t.getUint8(h++);y.description=String.fromCharCode.apply(null,f);var w=t.getUint16(h);h+=2,f=new Uint8Array(w);for(_=0;_<w;_++)f[_]=t.getUint8(h++);y.classname=String.fromCharCode.apply(null,f),p.push(y)}(T=this.gdh.pending[i]).func_cb(i,T.data,s,p),delete this.gdh.pending[i];break;case H:p=[],h=9,a=t.getUint32(h);this.gdh.debug&&console.log("GetAllClassAttributes received",i,a),h+=4;for(d=0;d<a;d++){(y=new AttributeInfo).type=t.getUint32(h),h+=4,y.flags=t.getUint32(h),h+=4,y.size=t.getUint16(h),h+=2,y.elements=t.getUint16(h),h+=2;u=t.getUint16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);y.name=String.fromCharCode.apply(null,f),u=t.getUint16(h),h+=2,f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);y.classname=String.fromCharCode.apply(null,f),p.push(y)}(T=this.gdh.pending[i]).func_cb(i,T.data,s,p),delete this.gdh.pending[i];break;case q:case ee:case K:this.gdh.debug&&console.log("GetObject received",i,s);var y=null;if(0!=(1&s)){h=9;(y=new ObjectInfo).objid=new PwrtObjid,y.objid.vid=t.getUint32(h),h+=4,y.objid.oix=t.getUint32(h),h+=4,y.cid=t.getUint32(h),h+=4,y.has_children=0!==t.getUint16(h),h+=2;u=t.getUint16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);y.name=String.fromCharCode.apply(null,f),u=t.getUint16(h),h+=2,f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);y.fullname=String.fromCharCode.apply(null,f);w=t.getUint16(h);h+=2,f=new Uint8Array(w);for(_=0;_<w;_++)f[_]=t.getUint8(h++);y.classname=String.fromCharCode.apply(null,f);v=t.getUint16(h);h+=2,f=new Uint8Array(v);for(_=0;_<v;_++)f[_]=t.getUint8(h++);y.description=String.fromCharCode.apply(null,f);var x=t.getUint16(h);h+=2,f=new Uint8Array(x);for(_=0;_<x;_++)f[_]=t.getUint8(h++);y.param1=String.fromCharCode.apply(null,f)}(T=this.gdh.pending[i]).func_cb(i,T.data,s,y),delete this.gdh.pending[i];break;case V:if(0!=(1&s)){h=9,p=[],a=t.getUint16(h);h+=2,this.gdh.debug&&console.log("CrrSignal received",i,a);for(d=0;d<a;d++){(y=new CrrInfo).type=t.getUint16(h),h+=2,y.objid=new PwrtObjid,y.objid.vid=t.getUint32(h),h+=4,y.objid.oix=t.getUint32(h),h+=4;u=t.getUint16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);y.name=String.fromCharCode.apply(null,f);w=t.getUint16(h);h+=2,f=new Uint8Array(w);for(_=0;_<w;_++)f[_]=t.getUint8(h++);y.classname=String.fromCharCode.apply(null,f),p.push(y)}}(T=this.gdh.pending[i]).func_cb(i,T.data,s,p),delete this.gdh.pending[i];break;case Z:p=new OpwindMenuInfo,h=9;if(this.gdh.debug&&console.log("GetOpwindMenu received",i,a),console.log("GetOpwindMenu received",s,i),1&s){u=t.getUint16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);p.title=String.fromCharCode.apply(null,f),u=t.getUint16(h),h+=2,f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);p.text=String.fromCharCode.apply(null,f),p.enable_language=t.getUint32(h),h+=4,p.enable_login=t.getUint32(h),h+=4,p.enable_alarmlist=t.getUint32(h),h+=4,p.enable_eventlog=t.getUint32(h),h+=4,p.enable_navigator=t.getUint32(h),h+=4,p.disable_help=t.getUint32(h),h+=4,p.disable_proview=t.getUint32(h),h+=4,p.language=t.getUint32(h),h+=4;var A=t.getUint16(h);h+=2;for(d=0;d<A;d++){var P=new MenuButton;P.type=t.getUint32(h),h+=4,u=t.getUint16(h),h+=2,f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);P.text=String.fromCharCode.apply(null,f),u=t.getUint16(h),h+=2,f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);P.name=String.fromCharCode.apply(null,f),u=t.getUint16(h),h+=2,f=new Uint8Array(u);for(_=0;_<u;_++)f[_]=t.getUint8(h++);P.url=String.fromCharCode.apply(null,f),p.buttons.push(P)}}(T=this.gdh.pending[i]).func_cb(i,T.data,s,p),delete this.gdh.pending[i];break;case z:h=9;this.gdh.debug&&console.log("Check user received",i,a),console.log("Check user received",s,i);var U=0;1&s&&(U=t.getUint32(h),h+=4),(T=this.gdh.pending[i]).func_cb(i,T.data,s,U),delete this.gdh.pending[i];break;case J:if(1&s){h=9,u=t.getUint16(h);h+=2;for(f=new Uint8Array(u),_=0;_<u;_++)f[_]=t.getUint8(h++);var O=String.fromCharCode.apply(null,f)}(T=this.gdh.pending[i]).func_cb(i,T.data,s,O),delete this.gdh.pending[i];break;case Q:p=[],h=9,a=t.getUint32(h);this.gdh.debug&&console.log("MhSync received",i,a),h+=4;for(d=0;d<a;d++){e=new MhEvent;var I=t.getUint16(h);h+=2;for(f=new Uint8Array(I),_=0;_<I;_++)f[_]=t.getUint8(h++);e.eventTime=String.fromCharCode.apply(null,f),I=t.getUint16(h),h+=2,f=new Uint8Array(I);for(_=0;_<I;_++)f[_]=t.getUint8(h++);e.eventText=String.fromCharCode.apply(null,f),I=t.getUint16(h),h+=2,f=new Uint8Array(I);for(_=0;_<I;_++)f[_]=t.getUint8(h++);e.eventName=String.fromCharCode.apply(null,f),e.eventFlags=t.getUint32(h),h+=4,e.eventStatus=t.getUint32(h),h+=4,e.eventPrio=t.getUint32(h),h+=4,e.eventId=new MhEventId,e.eventId.nix=t.getUint32(h),h+=4,e.eventId.idx=t.getUint32(h),h+=4,I=t.getUint16(h),h+=2,f=new Uint8Array(I);for(_=0;_<I;_++)f[_]=t.getUint8(h++);e.eventId.birthTime=String.fromCharCode.apply(null,f),e.targetId=new MhEventId,e.targetId.nix=t.getUint32(h),h+=4,e.targetId.idx=t.getUint32(h),h+=4,I=t.getUint16(h),h+=2,f=new Uint8Array(I);for(_=0;_<I;_++)f[_]=t.getUint8(h++);e.targetId.birthTime=String.fromCharCode.apply(null,f),e.eventType=t.getUint32(h),h+=4;var S=new PwrtObjid(0,0);S.vid=t.getUint32(h),h+=4,S.oix=t.getUint32(h),h+=4,e.object=new PwrtAttrRef,e.object.objid=S,e.object.offset=t.getUint32(h),h+=4,e.object.body=t.getUint32(h),h+=4,e.object.size=t.getUint32(h),h+=4,e.object.flags=t.getUint32(h),h+=4;var C=new PwrtObjid(0,0);C.vid=t.getUint32(h),h+=4,C.oix=t.getUint32(h),h+=4,e.supObject=new PwrtAttrRef,e.supObject.objid=C,e.supObject.offset=t.getUint32(h),h+=4,e.supObject.body=t.getUint32(h),h+=4,e.supObject.size=t.getUint32(h),h+=4,e.supObject.flags=t.getUint32(h),h+=4,I=t.getUint16(h),h+=2,f=new Uint8Array(I);for(_=0;_<I;_++)f[_]=t.getUint8(h++);e.eventMoreText=String.fromCharCode.apply(null,f),e.syncIdx=t.getUint32(h),h+=4,p.push(e)}(T=this.gdh.pending[i]).func_cb(i,T.data,s,p),delete this.gdh.pending[i];break;case $:var T;(T=this.gdh.pending[i]).func_cb(i,T.data,s),delete this.gdh.pending[i];break;default:console.log("Unknown message type")}}}},this.getObjectInfoBoolean=function(e,t){this.return_cb=t;var n=new Uint8Array(e.length+6);n[0]=R,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;for(var i=0;i<e.length;i++)n[i+6]=e.charCodeAt(i);this.pending[this.next_id]=new PendingData(t,null),this.ws.send(n),this.next_id++},this.getObjectInfoInt=function(e,t,n){this.return_cb=t;var i=new Uint8Array(e.length+6);i[0]=D,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var s=0;s<e.length;s++)i[s+6]=e.charCodeAt(s);this.pending[this.next_id]=new PendingData(t,n),this.ws.send(i),this.next_id++},this.getObjectInfoFloat=function(e,t,n){this.return_cb=t;var i=new Uint8Array(e.length+6);i[0]=B,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var s=0;s<e.length;s++)i[s+6]=e.charCodeAt(s);this.pending[this.next_id]=new PendingData(t,n),this.ws.send(i),this.next_id++},this.getObjectInfoFloatArray=function(e,t,n,i){this.return_cb=n;var s=new Uint8Array(e.length+10);s[0]=Y,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&t,s[7]=t>>8&255,s[8]=t>>16&255,s[9]=t>>24&255;for(var o=0;o<e.length;o++)s[o+10]=e.charCodeAt(o);this.pending[this.next_id]=new PendingData(n,i),this.ws.send(s),this.next_id++},this.refObjectInfo=function(e,t,n){var i=new Sub;if(i.name=e,i.refid=this.subscriptionCount,i.type=t,i.elements=n,this.sub[this.subscriptionCount]=i,this.subscriptionCount++,this.listSent){var s;s=12+i.name.length;var o=new Uint8Array(s+10);o[0]=G,o[2]=255&this.next_id,o[3]=this.next_id>>8&255,o[4]=this.next_id>>16&255,o[5]=this.next_id>>24&255,this.debug&&console.log("RefObjectInfo: ",i.refid);var r=6;o[r++]=255&i.refid,o[r++]=i.refid>>8&255,o[r++]=i.refid>>16&255,o[r++]=i.refid>>24&255,o[r++]=255&i.elements,o[r++]=i.elements>>8&255,o[r++]=i.elements>>16&255,o[r++]=i.elements>>24&255,o[r++]=255&i.name.length,o[r++]=i.name.length>>8&255,o[r++]=i.name.length>>16&255,o[r++]=i.name.length>>24&255;for(var d=0;d<i.name.length;d++)o[r++]=i.name.charCodeAt(d);return this.pending[this.next_id]=new PendingData(this.refObjectInfoReply,null),this.debug&&console.log("Sending RefObjectInfo",this.next_id,s,r),this.ws.send(o),this.next_id++,i.refid}return i.refid},this.refObjectInfoReply=function(e,t){this.debug&&console.log("refObjectInfoReply",e,t)},this.unrefObjectInfo=function(e){var t=new Uint8Array(14);t[0]=N,t[2]=255&this.next_id,t[3]=this.next_id>>8&255,t[4]=this.next_id>>16&255,t[5]=this.next_id>>24&255,this.debug&&console.log("UnrefObjectInfo: ",e);var n=6;t[n++]=255&e,t[n++]=e>>8&255,t[n++]=e>>16&255,t[n++]=e>>24&255,this.pending[this.next_id]=new PendingData(this.unrefObjectInfoReply,null),this.debug&&console.log("Sending UnrefObjectInfo",this.next_id,4,10,e),this.ws.send(t),this.next_id++,delete this.sub[e]},this.refObjectInfoList=function(e){var t=0,n=0;for(var i in this.return_cb=e,this.sub)t+=12+this.sub[i].name.length,n++;var s=new Uint8Array(t+10);s[0]=X,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&n,s[7]=n>>8&255,s[8]=n>>16&255,s[9]=n>>24&255;var o=10;for(var i in this.sub)if(0!==i){this.debug&&console.log("RefObjectInfoList: ",this.sub[i].refid),s[o++]=255&this.sub[i].refid,s[o++]=this.sub[i].refid>>8&255,s[o++]=this.sub[i].refid>>16&255,s[o++]=this.sub[i].refid>>24&255,s[o++]=255&this.sub[i].elements,s[o++]=this.sub[i].elements>>8&255,s[o++]=this.sub[i].elements>>16&255,s[o++]=this.sub[i].elements>>24&255,s[o++]=255&this.sub[i].name.length,s[o++]=this.sub[i].name.length>>8&255,s[o++]=this.sub[i].name.length>>16&255,s[o++]=this.sub[i].name.length>>24&255;for(var r=0;r<this.sub[i].name.length;r++)s[o++]=this.sub[i].name.charCodeAt(r)}this.pending[this.next_id]=new PendingData(e,null),this.debug&&console.log("Sending RefObjectInfoList",this.next_id,t,o,this.next_id),this.ws.send(s),this.next_id++,this.listSent=!0},this.refObjectInfoListReply=function(e,t){this.debug&&console.log("refObjectInfoListReply",e,t)},this.getRefObjectInfoAll=function(e){var t=new Uint8Array(6);t[0]=F,t[2]=255&this.next_id,t[3]=this.next_id>>8&255,t[4]=this.next_id>>16&255,t[5]=this.next_id>>24&255,this.pending[this.next_id]=new PendingData(e,null),this.debug&&console.log("Sending getRefObjectInfoAll",this.next_id),this.ws.send(t),this.next_id++},this.getRefObjectInfoAllReply=function(e,t){this.debug&&console.log("getRefObjectInfoAllReply",e,t)},this.getObjectRefInfo=function(e){return this.debug&&console.log("getObjectRefInfo",e,this.sub[e].value),this.sub[e].value},this.setObjectInfoBoolean=function(e,t){var n=new Uint8Array(12+e.length);n[0]=j,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t,n[7]=t>>8&255,n[8]=t>>16&255,n[9]=t>>24&255,n[10]=255&e.length,n[11]=e.length>>8&255;for(var i=12,s=0;s<e.length;s++)n[i++]=e.charCodeAt(s);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoBoolean",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.setObjectInfoInt=function(e,t){var n=new Uint8Array(12+e.length);n[0]=E,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t,n[7]=t>>8&255,n[8]=t>>16&255,n[9]=t>>24&255,n[10]=255&e.length,n[11]=e.length>>8&255;for(var i=12,s=0;s<e.length;s++)n[i++]=e.charCodeAt(s);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoInt",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.setObjectInfoFloat=function(e,t){var n=new Uint8Array(12+e.length);n[0]=M,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;var i=new ArrayBuffer(4);new Float32Array(i)[0]=t;var s=new Uint8Array(i);n[6]=s[0],n[7]=s[1],n[8]=s[2],n[9]=s[3],n[10]=255&e.length,n[11]=e.length>>8&255;for(var o=12,r=0;r<e.length;r++)n[o++]=e.charCodeAt(r);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoFloat",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.setObjectInfoString=function(e,t){var n,i=new Uint8Array(10+t.length+e.length);i[0]=k,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&t.length,i[7]=t.length>>8&255;var s=8;for(n=0;n<t.length;n++)i[s++]=t.charCodeAt(n);for(i[s++]=255&e.length,i[s++]=e.length>>8&255,n=0;n<e.length;n++)i[s++]=e.charCodeAt(n);return this.ws.send(i),this.debug&&console.log("Sending setObjectInfoString",this.next_id,e,t),this.next_id++,new PwrtStatus(1)},this.toggleObjectInfo=function(e){var t=new Uint8Array(8+e.length);t[0]=L,t[2]=255&this.next_id,t[3]=this.next_id>>8&255,t[4]=this.next_id>>16&255,t[5]=this.next_id>>24&255,t[6]=255&e.length,t[7]=e.length>>8&255;for(var n=8,i=0;i<e.length;i++)t[n++]=e.charCodeAt(i);return this.ws.send(t),this.debug&&console.log("Sending toggleObjectInfoBoolean",this.next_id,e,value),this.next_id++,new PwrtStatus(1)},this.getAllXttChildren=function(e,t,n){var i=new Uint8Array(14);i[0]=W,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.vid,i[7]=e.vid>>8&255,i[8]=e.vid>>16&255,i[9]=e.vid>>24&255,i[10]=255&e.oix,i[11]=e.oix>>8&255,i[12]=e.oix>>16&255,i[13]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending getAllXttChildren",this.next_id),this.ws.send(i),this.next_id++},this.getAllClassAttributes=function(e,t,n,i){var s=new Uint8Array(18);s[0]=H,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=e>>16&255,s[9]=e>>24&255,s[10]=255&t.vid,s[11]=t.vid>>8&255,s[12]=t.vid>>16&255,s[13]=t.vid>>24&255,s[14]=255&t.oix,s[15]=t.oix>>8&255,s[16]=t.oix>>16&255,s[17]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getAllClassAttributes",this.next_id,e,t.vid,t.oix),this.ws.send(s),this.next_id++},this.getObject=function(e,t,n,i){var s=new Uint8Array(16);s[0]=q,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&t,s[7]=t>>8&255,s[8]=255&e.vid,s[9]=e.vid>>8&255,s[10]=e.vid>>16&255,s[11]=e.vid>>24&255,s[12]=255&e.oix,s[13]=e.oix>>8&255,s[14]=e.oix>>16&255,s[15]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObject",this.next_id,e.vid,e.oix),this.ws.send(s),this.next_id++},this.getObjectFromAref=function(e,t,n,i){var s=new Uint8Array(32);s[0]=ee,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&t,s[7]=t>>8&255,s[8]=255&e.objid.vid,s[9]=e.objid.vid>>8&255,s[10]=e.objid.vid>>16&255,s[11]=e.objid.vid>>24&255,s[12]=255&e.objid.oix,s[13]=e.objid.oix>>8&255,s[14]=e.objid.oix>>16&255,s[15]=e.objid.oix>>24&255,s[16]=255&e.offset,s[17]=e.offset>>8&255,s[18]=e.offset>>16&255,s[19]=e.offset>>24&255,s[20]=255&e.body,s[21]=e.body>>8&255,s[22]=e.body>>16&255,s[23]=e.body>>24&255,s[24]=255&e.size,s[25]=e.size>>8&255,s[26]=e.size>>16&255,s[27]=e.size>>24&255,s[28]=255&e.flags,s[29]=e.flags>>8&255,s[30]=e.flags>>16&255,s[31]=e.flags>>24&255,this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObject",this.next_id,oid.vid,oid.oix),this.ws.send(s),this.next_id++},this.getObjectFromName=function(e,t,n,i){var s=new Uint8Array(10+e.length);s[0]=K,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&t,s[7]=t>>8&255,s[8]=255&e.length,s[9]=e.length>>8&255;for(var o=10,r=0;r<e.length;r++)s[o++]=e.charCodeAt(r);this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending getObjectFromName",this.next_id,e),this.ws.send(s),this.next_id++},this.crrSignal=function(e,t,n){var i=new Uint8Array(14);i[0]=V,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.vid,i[7]=e.vid>>8&255,i[8]=e.vid>>16&255,i[9]=e.vid>>24&255,i[10]=255&e.oix,i[11]=e.oix>>8&255,i[12]=e.oix>>16&255,i[13]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending crrObject",this.next_id,e.vid,e.oix),this.ws.send(i),this.next_id++},this.getOpwindMenu=function(e,t,n){e.length;var i=new Uint8Array(8+e.length);i[0]=Z,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.length,i[7]=e.length>>8&255;for(var s=8,o=0;o<e.length;o++)i[s++]=e.charCodeAt(o);this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending getOpwindMenu",this.next_id),this.ws.send(i),this.next_id++},this.login=function(e,t,n,i){var s=new Uint8Array(8+e.length+2+t.length);s[0]=z,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255;var o=6;s[o]=255&e.length,s[o+1]=e.length>>8&255,o+=2;for(var r=0;r<e.length;r++)s[o++]=e.charCodeAt(r);s[o]=255&t.length,s[o+1]=t.length>>8&255,o+=2;for(r=0;r<t.length;r++)s[o++]=t.charCodeAt(r);this.pending[this.next_id]=new PendingData(n,i),this.debug&&console.log("Sending login",this.next_id),this.ws.send(s),this.next_id++},this.getMsg=function(e,t,n){var i=new Uint8Array(10);i[0]=J,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e,i[7]=e>>8&255,i[8]=e>>16&255,i[9]=e>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.ws.send(i),this.debug&&console.log("Sending getMsg",this.next_id,e),this.next_id++},this.mhSync=function(e,t,n){var i=new Uint8Array(10);i[0]=Q,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e,i[7]=e>>8&255,i[8]=e>>16&255,i[9]=e>>24&255,this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending mhSync",this.next_id),this.ws.send(i),this.next_id++},this.mhAcknowledge=function(e,t,n){var i=new Uint8Array(16+e.birthTime.length);i[0]=$,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e.nix,i[7]=e.nix>>8&255,i[8]=e.nix>>16&255,i[9]=e.nix>>24&255,i[10]=255&e.idx,i[11]=e.idx>>8&255,i[12]=e.idx>>16&255,i[13]=e.idx>>24&255;var s=14;i[s]=255&e.birthTime.length,i[s+1]=e.birthTime.length>>8&255,s+=2;for(var o=0;o<e.birthTime.length;o++)i[s++]=e.birthTime.charCodeAt(o);this.pending[this.next_id]=new PendingData(t,n),this.debug&&console.log("Sending mhAcknowledge",this.next_id),console.log("Sending mhAcknowledge",this.next_id),this.ws.send(i),this.next_id++}}function OpWindMenu(){this.gdh=0,this.buttons=null,this.priv=0,this.user="",this.user_text=null,this.host;var r=this;this.init=function(){this.host=window.location.hostname,""==this.host&&(this.host="localhost"),this.gdh=new Gdh,this.gdh.open_cb=this.gdh_init_cb,this.gdh.init()},this.is_authorized=function(e){return!!(this.priv&e)},this.get_opplace=function(){var e=window.location.search.substring(1);console.log("query",e);var t=e.split("&");return console.log("vars",t.length,t[0].substring(8)),t[0].substring(8)},this.gdh_init_cb=function(){new PwrtObjid(0,0);r.user="Default",r.gdh.login("","",r.login_cb,r),r.gdh.getOpwindMenu(r.get_opplace(),r.get_menu_cb,999)},this.add_menu_button=function(e,t){var n=document.createElement("input");return n.type="button",n.className="leftmenu-button",n.value=t,n.addEventListener("click",new Function('menu.button_cb("'+n.value+'")')),e.appendChild(n),e.appendChild(document.createElement("br")),n},this.get_menu_cb=function(e,t,n,i){r.info=i,console.log("Menu received",n,t,i.buttons.length);var s=document.getElementById("opwindmenu");document.getElementById("opwind_title").innerHTML=i.title,document.getElementById("opwind_text").innerHTML=i.text,i.enable_login?(r.user_text=document.createTextNode(r.user+" on "+r.host),s.appendChild(r.user_text),s.appendChild(document.createElement("hr")),document.getElementById("login_button").addEventListener("click",function(e){"hidden"==document.getElementById("login_frame").style.visibility?(document.getElementById("login_user").value="",document.getElementById("login_passw").value="",document.getElementById("login_frame").style.visibility="visible",document.getElementById("login_frame").style.height="120px",document.getElementById("login_user").focus()):(document.getElementById("login_frame").style.visibility="hidden",document.getElementById("login_frame").style.height="0px")}),document.getElementById("apply_button").addEventListener("click",function(e){var t=document.getElementById("login_user").value,n=document.getElementById("login_passw").value;""!=t.trim()&&(document.getElementById("login_frame").style.visibility="hidden",document.getElementById("login_frame").style.height="0px",n=(new JopCrypt).crypt("aa",n),r.user=t,r.gdh.login(t,n,r.login_cb,r))}),document.getElementById("cancel_button").addEventListener("click",function(e){document.getElementById("login_frame").style.visibility="hidden",document.getElementById("login_frame").style.height="0px"}),document.getElementById("logout_button").addEventListener("click",function(e){document.getElementById("login_frame").style.visibility="hidden",document.getElementById("login_frame").style.height="0px",r.priv=0,r.user="Default",r.gdh.login("","",r.login_cb,r)}),document.getElementById("login_user").value="",document.getElementById("login_passw").value="",document.getElementById("login_frame").style.visibility="hidden",document.getElementById("login_frame").style.height="0px"):(document.getElementById("login_button").remove(),document.getElementById("login_frame").remove()),i.enable_language&&r.add_menu_button(s,"Language"),i.enable_alarmlist&&(r.add_menu_button(s,"AlarmList"),r.add_menu_button(s,"EventList")),i.enable_eventlog&&r.add_menu_button(s,"EventLog"),i.enable_navigator&&r.add_menu_button(s,"Navigator"),i.disable_help||r.add_menu_button(s,"Help"),i.disable_proview||r.add_menu_button(s,"ProviewR"),s.appendChild(document.createElement("hr"));for(var o=0;o<i.buttons.length;o++)r.add_menu_button(s,i.buttons[o].text)},this.button_cb=function(e){if(r.info.enable_language&&"Language"==e)console.log("Language activated");else if(r.info.enable_alarmlist&&"AlarmList"==e)console.log("AlarmList activated"),r.is_authorized(Pwr.mAccess_RtRead|Pwr.mAccess_RtWrite|Pwr.mAccess_AllOperators|Pwr.mAccess_System|Pwr.mAccess_Maintenance|Pwr.mAccess_Process|Pwr.mAccess_Instrument)?window.open("ev.html?list=alarm","_blank"):window.alert("Not authorized for this operation");else if(r.info.enable_alarmlist&&"EventList"==e)console.log("EventList activated"),r.is_authorized(Pwr.mAccess_RtRead|Pwr.mAccess_RtWrite|Pwr.mAccess_AllOperators|Pwr.mAccess_System|Pwr.mAccess_Maintenance|Pwr.mAccess_Process|Pwr.mAccess_Instrument)?window.open("ev.html?list=event","_blank"):window.alert("Not authorized for this operation");else if(r.info.enable_eventlog&&"EventLog"==e)console.log("EventLog activated"),r.is_authorized(Pwr.mAccess_RtRead|Pwr.mAccess_RtWrite|Pwr.mAccess_AllOperators|Pwr.mAccess_System|Pwr.mAccess_Maintenance|Pwr.mAccess_Process|Pwr.mAccess_Instrument)?window.alert("Not yet implemented"):window.alert("Not authorized for this operation");else if(r.info.enable_navigator&&"Navigator"==e)console.log("Navigator activated"),r.is_authorized(Pwr.mAccess_RtNavigator|Pwr.mAccess_System|Pwr.mAccess_Maintenance|Pwr.mAccess_Process|Pwr.mAccess_Instrument)?window.open("xtt.html","_blank"):window.alert("Not authorized for this operation");else if(r.info.disable_help||"Help"!=e)if(r.info.disable_proview||"ProviewR"!=e)if(r.is_authorized(Pwr.mAccess_RtRead|Pwr.mAccess_RtWrite|Pwr.mAccess_AllOperators|Pwr.mAccess_System|Pwr.mAccess_Maintenance|Pwr.mAccess_Process|Pwr.mAccess_Instrument)){for(var t=0;t<r.info.buttons.length;t++)if(r.info.buttons[t].text==e){console.log("Found",r.info.buttons[t].text);var n=r.info.buttons[t].name,i=n.indexOf(".pwg");-1!=i&&(n=n.substring(0,i));var s="ge.html?graph="+n;console.log("url",s),window.open(s,"_blank");break}}else window.alert("Not authorized for this operation");else console.log("ProviewR activated"),window.open("http://www.proview.se","_blank");else console.log("Help activated"),window.open("xtt_help_index.html","_blank")},this.login_cb=function(e,t,n,i){console.log("Login:",n,i),1&n?(r.priv=i,sessionStorage.setItem("pwr_privilege",r.priv),null!=r.user_text&&(r.user_text.textContent=r.user+" on "+r.host),console.log("Login",r.user,"Priv",r.priv)):(r.priv=0,r.user="none",sessionStorage.setItem("pwr_privilege",r.priv),null!=r.user_text&&(r.user_text.textContent="None on "+r.host),console.log("Login failure","Priv",r.priv))}}var menu=new OpWindMenu;menu.init();
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Operator Menu</title>
<link rel="stylesheet" type="text/css" href="toolbar.css">
</head>
<body>
<div id="opwindmenu" width="120" height="800">
<h1 id="opwind_title"></h1>
<p id="opwind_text"></p>
<hr>
<button id="login_button" type="button" class="leftmenu-button">Login</button>
<div id="login_frame" class="login-frame">
Username
<br>
<input id="login_user" name="username" class="login-field" />
<br>
Password
<br>
<input id="login_passw" name="password" type="password" class="login-field" />
<br>
<button id="apply_button" type="button" style="flex-grow:1">Apply</button>
<button id="cancel_button" type="button" style="float:right">Cancel</button>
<br>
<button id="logout_button" type="button" class="leftmenu-button">Logout</button>
</div>
</div>
<script src=opwind.js></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body>
</html>
.annotate {
color: #366ED4;
font-style: italic;
color: #366ED4;
font-style: italic;
}
.toolbar {
border-left: 1px solid #aaa;
margin-top: 10px;
margin: 0 0 0 0;
font-size: 0;
border-left: 1px solid #aaa;
margin-top: 10px;
margin: 0 0 0 0;
font-size: 0;
}
.toolbar-item {
display: inline-block;
padding: 0.0em 0.0em;
padding: 0.0em 0.0em;
background: #fff;
margin: 0 0 0 0;
border: 0px solid #aaa;
border-left: none;
color: blue;
font-size: 16px;
line-height: 1.5em;
vertical-align: top;
border-left: none;
color: blue;
font-size: 16px;
line-height: 1.5em;
vertical-align: top;
}
.toolbar-item.selected {
background-color: #ccc;
color: black;
font-weight: bold;
background-color: #ccc;
color: black;
font-weight: bold;
}
.menu-wrapper {
display: inline-block;
font-size: 16px;
display: inline-block;
font-size: 16px;
}
.menu-button {
padding-right: 2.5em;
position: relative;
padding-right: 2.5em;
position: relative;
}
.menu-button::after {
content: " ";
border-left: 0.4em solid transparent;
border-right: 0.4em solid transparent;
border-top: 0.4em solid black;
position: absolute;
right: 1em;
top: 1.1em;
content: " ";
border-left: 0.4em solid transparent;
border-right: 0.4em solid transparent;
border-top: 0.4em solid black;
position: absolute;
right: 1em;
top: 1.1em;
}
.leftmenu-button {
width:100%;
.nav {
margin: 0;
padding: 0;
overflow: hidden;
background-color: cornflowerblue;
width: 1200px;
}
.login-frame {
background-color: #ddeeff;
padding: 10px;
display: block;
overflow: hidden;
li a, .dropbtn {
display: inline-block;
color: white;
padding: 14px 16px;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: coral;
}
.login-field {
width:100%;
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
display: block;
text-align: left;
}
.dropdown-content a:hover {background-color: #f1f1f1;}
.dropdown:hover .dropdown-content {
display: block;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,35 +6,7 @@
</head>
<body>
<div class="toolbar" role="toolbar">
<div id="toolitem1" tabindex="0" class="toolbar-item" role="button">
<img src="toolbar_graph.png"/>
</div>
<div id="toolitem2" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_objectgraph.png"/>
</div>
<div id="toolitem3" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_plc.png"/>
</div>
<div id="toolitem4" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_history.png"/>
</div>
<div id="toolitem5" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_object.png"/>
</div>
<div id="toolitem6" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_crossref.png"/>
</div>
<div id="toolitem7" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_help.png"/>
</div>
<div id="toolitem8" tabindex="-1" class="toolbar-item" role="button">
<img src="toolbar_classhelp.png"/>
</div>
</div>
<canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src=xtt.js></script>
<hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address>
<canvas id="canvas" width="1200" height="800"></canvas>
<script src="xtt.bundle.js"></script>
</body>
</html>
"use strict";function PwrtStatus(t){this.sts=t,this.evenSts=function(){return t%2==0},this.oddSts=function(){return t%2==1},this.getSts=function(){return t}}var Pwr={eType_Boolean:98305,eType_Float32:98306,eType_Float64:98307,eType_Char:98308,eType_Int8:98309,eType_Int16:98310,eType_Int32:98311,eType_UInt8:98312,eType_UInt16:98313,eType_UInt32:98314,eType_Objid:98315,eType_Buffer:98316,eType_String:98317,eType_Enum:98318,eType_Struct:98319,eType_Mask:98320,eType_Array:98321,eType_Time:98322,eType_Text:98323,eType_AttrRef:98324,eType_UInt64:98325,eType_Int64:98326,eType_ClassId:98327,eType_TypeId:98328,eType_VolumeId:98329,eType_ObjectIx:98330,eType_RefId:98331,eType_DeltaTime:98332,eType_Status:98333,eType_NetStatus:98334,eType_CastId:98335,eType_ProString:98336,eType_DisableAttr:98337,eType_DataRef:98338,mPrv_RtRead:1,mPrv_RtWrite:2,mPrv_System:4,mPrv_Maintenance:8,mPrv_Process:16,mPrv_Instrument:32,mPrv_Operator1:64,mPrv_Operator2:128,mPrv_Operator3:256,mPrv_Operator4:512,mPrv_Operator5:1024,mPrv_Operator6:2048,mPrv_Operator7:4096,mPrv_Operator8:8192,mPrv_Operator9:16384,mPrv_Operator10:32768,mPrv_RtEventsAck:1<<18,mPrv_RtPlc:1<<19,mPrv_RtNavigator:1<<20,mPrv_DevRead:1<<21,mPrv_DevPlc:1<<22,mPrv_DevConfig:1<<23,mPrv_DevClass:1<<24,mPrv_RtEventsBlock:1<<25,mPrv_Administrator:1<<26,mPrv_SevRead:1<<27,mPrv_SevAdmin:1<<28,mAccess_RtRead:1,mAccess_RtWrite:2,mAccess_System:4,mAccess_Maintenance:8,mAccess_Process:16,mAccess_Instrument:32,mAccess_RtEventsBlock:1<<25,mAccess_RtEventsAck:1<<18,mAccess_RtPlc:1<<19,mAccess_RtNavigator:1<<20,mAccess_AllRt:35454975,mAccess_AllOperators:65472,mAccess_AllPwr:-1,mAdef_pointer:1,mAdef_array:2,mAdef_backup:4,mAdef_changelog:8,mAdef_state:16,mAdef_const:32,mAdef_rtvirtual:64,mAdef_devbodyref:128,mAdef_dynamic:256,mAdef_publicwrite:512,mAdef_noedit:1024,mAdef_invisible:2048,mAdef_refdirect:4096,mAdef_noinvert:8192,mAdef_noremove:16384,mAdef_rtdbref:32768,mAdef_private:65536,mAdef_class:131072,mAdef_superclass:262144,mAdef_buffer:524288,mAdef_nowbl:1048576,mAdef_alwayswbl:2097152,mAdef_disableattr:4194304,mAdef_rthide:8388608},Pwrb={mXttMethodsFlagsMask_IsConfigured:1,mXttOpMethodsMask_OpenGraph:1,mXttOpMethodsMask_OpenObjectGraph:2,mXttOpMethodsMask_OpenTrend:4,mXttOpMethodsMask_OpenHistory:8,mXttOpMethodsMask_OpenFast:16,mXttOpMethodsMask_Camera:32,mXttOpMethodsMask_HistEvent:64,mXttOpMethodsMask_BlockEvents:128,mXttOpMethodsMask_Help:256,mXttOpMethodsMask_Photo:512,mXttOpMethodsMask_Note:1024,mXttOpMethodsMask_ParentObjectGraph:2048,mXttMntMethodsMask_OpenObject:1,mXttMntMethodsMask_OpenTrace:2,mXttMntMethodsMask_RtNavigator:4,mXttMntMethodsMask_OpenCrossref:8,mXttMntMethodsMask_HelpClass:16,mXttMntMethodsMask_DataSheet:32,mXttMntMethodsMask_CircuitDiagram:64,mXttMntMethodsMask_Simulate:1<<31};function PwrtObjid(t,e){this.oix=e,this.vid=t}function PwrtAttrRef(){this.objid,this.offset,this.body,this.size,this.flags}function CdhrNumber(t,e){this.value=t,this.sts=e,this.evenSts=function(){return e%2==0},this.oddSts=function(){return e%2==1},this.getSts=function(){return e}}var CdhC={cUserVolMin:65793,cUserVolMax:16711422};function UserdataCbReturn(){this.userdata,this.row}function CliTable(t,e){this.command=t,this.qualifier=e}var CliC={SUCCESS:1,SYNTAX_ERROR:2,UNKNOWN_COMMAND:4,QUALNOTFOUND:6,VERB_VECT_SIZE:5,STATE_INIT:0,STATE_VERB:1,STATE_QUAL:2,STATE_QUALVALUE:3,STATE_SPACE:4,STATE_EQUAL:5,STATE_ERROR:6,STATE_QUOTE_VERB:7,STATE_QUOTE_QUALVALUE:8,STATE_QUALVALUE_EXACT:9,STATE_VERB_EXACT:10,TAB:"\t",SPACE:" "};function Cli(t){this.verb=new Array(CliC.VERB_VECT_SIZE),this.verbCount=0,this.qualifier=new Array(30),this.qualValue=new Array(30),this.qualifierCount=0,this.status,this.cliTableIndex,this.cliQualifierIndex=new Array(30),this.configuredVerbs,this.cliTable=t,this.getStsString=function(){switch(this.status){case CliC.SUCCESS:return"Success";case CliC.SYNTAX_ERROR:return"Syntax error";case CliC.UNKNOWN_COMMAND:return"Unknown command verb";case CliC.QUALNOTFOUND:return"Unknown qualifier";default:return"Unknown command interpreter error"}},this.evenSts=function(){return this.status%2==0},this.oddSts=function(){return this.status%2!=0},this.parse=function(t){var e,i=CliC.STATE_INIT,n=0;for(this.status=CliC.SUCCESS,this.verbCount=0,e=this.qualifierCount=0;e<t.length;e++){var s=t.charAt(e);switch(i){case CliC.STATE_INIT:if(s==CliC.SPACE||s==CliC.TAB)break;i=CliC.STATE_VERB,n=e;break;case CliC.STATE_SPACE:if(s==CliC.SPACE||s==CliC.TAB)break;if("/"==s)i=CliC.STATE_QUAL,n=e;else if("="==s){if(0===this.qualifierCount){i=CliC.STATE_ERROR,this.status=CliC.SYNTAX_ERROR;break}i=CliC.STATE_EQUAL}else{if('"'==s){i=CliC.STATE_QUOTE_VERB;break}i=CliC.STATE_VERB,n=e}break;case CliC.STATE_VERB:if(s==CliC.SPACE||s==CliC.TAB){if(this.verbCount==CliC.VERB_VECT_SIZE){i=CliC.STATE_ERROR;break}0===this.verbCount?this.verb[this.verbCount++]=t.substring(n,e).toUpperCase():this.verb[this.verbCount++]=t.substring(n,e),i=CliC.STATE_SPACE}else if("/"==s){if(this.verbCount==CliC.VERB_VECT_SIZE){i=CliC.STATE_ERROR;break}this.verb[this.verbCount++]=t.substring(n,e).toUpperCase(),i=CliC.STATE_QUAL,n=e}break;case CliC.STATE_VERB_EXACT:if('"'==s){if(this.verbCount==CliC.VERB_VECT_SIZE){i=CliC.STATE_ERROR;break}this.verb[this.verbCount++]=t.substring(n,e),i=CliC.STATE_SPACE}break;case CliC.STATE_QUAL:s==CliC.SPACE||s==CliC.TAB?(this.qualifier[this.qualifierCount++]=t.substring(n,e).toUpperCase(),i=CliC.STATE_SPACE):"="==s?(this.qualifier[this.qualifierCount++]=t.substring(n,e).toUpperCase(),i=CliC.STATE_EQUAL):"/"==s&&(this.qualifier[this.qualifierCount++]=t.substring(n,e).toUpperCase(),i=CliC.STATE_QUAL,n=e);break;case CliC.STATE_QUALVALUE:s==CliC.SPACE||s==CliC.TAB?(this.qualValue[this.qualifierCount-1]=t.substring(n,e),i=CliC.STATE_SPACE):"/"==s&&(this.qualValue[this.qualifierCount-1]=t.substring(n,e),i=CliC.STATE_QUAL,n=e);break;case CliC.STATE_QUALVALUE_EXACT:'"'==s&&(this.qualValue[this.qualifierCount-1]=t.substring(n,e),i=CliC.STATE_SPACE);break;case CliC.STATE_QUOTE_VERB:i=CliC.STATE_VERB_EXACT,n=e;break;case CliC.STATE_QUOTE_QUALVALUE:i=CliC.STATE_QUALVALUE_EXACT,n=e;break;case CliC.STATE_EQUAL:if(s==CliC.SPACE||s==CliC.TAB)break;'"'==s?i=CliC.STATE_QUOTE_QUALVALUE:(i=CliC.STATE_QUALVALUE,n=e)}if(i==CliC.STATE_ERROR)break}switch(i){case CliC.STATE_INIT:case CliC.STATE_ERROR:return"";case CliC.STATE_VERB:if(this.verbCount==CliC.VERB_VECT_SIZE){i=CliC.STATE_ERROR;break}0===this.verbCount?this.verb[this.verbCount++]=t.substring(n,e).toUpperCase():this.verb[this.verbCount++]=t.substring(n,e);break;case CliC.STATE_VERB_EXACT:if(this.verbCount==CliC.VERB_VECT_SIZE){i=CliC.STATE_ERROR;break}this.verb[this.verbCount++]=t.substring(n,e);break;case CliC.STATE_QUAL:this.qualifier[this.qualifierCount++]=t.substring(n,e).toUpperCase();break;case CliC.STATE_QUALVALUE:case CliC.STATE_QUALVALUE_EXACT:this.qualValue[this.qualifierCount-1]=t.substring(n,e);break;case CliC.STATE_QUOTE_VERB:case CliC.STATE_QUOTE_QUALVALUE:case CliC.STATE_EQUAL:return this.status=CliC.SYNTAX_ERROR,""}if(0===this.verbCount)return this.status=CliC.SYNTAX_ERROR,"";var o=!1;for(e=0;e<this.cliTable.length;e++)if(!(this.verb[0].length>this.cliTable[e].command.length)&&this.verb[0]==this.cliTable[e].command.substring(0,this.verb[0].length)){this.verb[0]=this.cliTable[e].command,o=!0;break}if(!o)return this.status=CliC.UNKNOWN_COMMAND,"";if(this.cliTableIndex=e,this.configuredVerbs=0,null!==this.cliTable[this.cliTableIndex].qualifier){for(e=0;e<this.cliTable[this.cliTableIndex].qualifier.length&&null!==this.cliTable[this.cliTableIndex].qualifier[e];e++)"cli_arg1"==this.cliTable[this.cliTableIndex].qualifier[e]&&this.configuredVerbs++,"cli_arg2"==this.cliTable[this.cliTableIndex].qualifier[e]&&this.configuredVerbs++,"cli_arg3"==this.cliTable[this.cliTableIndex].qualifier[e]&&this.configuredVerbs++,"cli_arg4"==this.cliTable[this.cliTableIndex].qualifier[e]&&this.configuredVerbs++,"cli_arg5"==this.cliTable[this.cliTableIndex].qualifier[e]&&this.configuredVerbs++;for(var a=0;a<this.qualifierCount;a++){for(o=!1,e=0;e<this.cliTable[this.cliTableIndex].qualifier.length&&null!==this.cliTable[this.cliTableIndex].qualifier[e];e++)this.qualifier[a].length>this.cliTable[this.cliTableIndex].qualifier[e].length||this.qualifier[a]==this.cliTable[this.cliTableIndex].qualifier[e].substring(0,this.qualifier[a].length)&&(this.cliQualifierIndex[a]=e,o=!0,this.qualifier[a]=this.cliTable[this.cliTableIndex].qualifier[e]);if(!o)return this.status=CliC.QUALNOTFOUND,""}}else if(0<this.qualifierCount)return this.status=CliC.QUALNOTFOUND,"";return this.verb[0]},this.qualifierFound=function(t){if("cli_arg1"==t)return!(this.verbCount<2||this.configuredVerbs<1);if("cli_arg2"==t)return!(this.verbCount<3||this.configuredVerbs<2);if("cli_arg3"==t)return!(this.verbCount<4||this.configuredVerbs<3);if("cli_arg4"==t)return!(this.verbCount<5||this.configuredVerbs<4);for(var e=0;e<this.qualifierCount;e++)if(t==this.qualifier[e])return!0;return!1},this.getQualValue=function(t){if("cli_arg1"==t)return this.verbCount<2||this.configuredVerbs<1?"":this.verb[1];if("cli_arg2"==t)return this.verbCount<3||this.configuredVerbs<2?"":this.verb[2];if("cli_arg3"==t&&(this.verbCount<4||this.configuredVerbs<3))return this.verb[3];if("cli_arg4"==t)return this.verbCount<5||this.configuredVerbs<4?"":this.verb[4];for(var e=0;e<this.qualifierCount;e++)if(t==this.qualifier[e])return null===this.qualValue[e]?"":this.qualValue[e];return""}}var GraphIfc={eType_Bit:32769};function Sub(){this.sts,this.refid,this.type,this.elements,this.name,this.value}function ObjectInfo(){this.objid,this.cid,this.has_children,this.name,this.description,this.classname,this.full_name,this.param1}function AttributeInfo(){this.name,this.type,this.size,this.flags,this.element,this.objid,this.full_name,this.classname}function MenuButton(){this.type,this.text,this.name,this.url}function OpwindMenuInfo(){this.title,this.text,this.enable_language,this.enable_login,this.enable_alarmlist,this.enable_eventlog,this.enable_navigator,this.disable_help,this.disable_proview,this.language,this.buttons=[]}function CrrInfo(){this.type,this.objid,this.name,this.classname}function GlowPieInfo(){this.sector_num,this.min_val,this.max_val}function GlowBarChartInfo(){this.bars,this.barsegments,this.min_value,this.max_value}function GlowTableInfo(){this.columns,this.rows,this.column_size=new Array(Glow.TABLE_MAX_COL)}function PendingData(t,e){this.func_cb=t,this.data=e}var GdhOp={GET_OP_SELF:1,GET_OP_METHOD_PLC:2,GET_OP_METHOD_OBJECTGRAPH:3,GET_OP_METHOD_GRAPH:4,GET_OP_METHOD_HELPCLASS:5};function Gdh(){var I=1,R=2,k=3,j=4,B=5,V=6,N=7,Q=9,M=10,D=15,G=25,L=26,Y=29,z=36,K=39,F=42,X=50,W=57,q=63,J=64,H=65,Z=66,$=67,tt=68;this.debug=!1,this.pending=[],this.sub=[],this.PORT=4448,this.ws=null,this.open_cb=null,this.close_cb=null,this.return_cb=null,this.next_id=1234,this.subscriptionCount=1,this.listSend=!1,this.init=function(){""===window.location.hostname?this.ws=new WebSocket("ws:127.0.0.1:4448"):this.ws=new WebSocket("ws://"+window.location.hostname+":4448"),this.ws.binaryType="arraybuffer",(this.ws.gdh=this).ws.onopen=function(t){null!==this.gdh.open_cb&&this.gdh.open_cb()},this.ws.onclose=function(){this.debug&&console.log("Socket closed"),null!==this.gdh.close_cb&&this.gdh.close_cb()},this.ws.onmessage=function(t){if("string"==typeof t.data)console.log("String message received",t,t.data);else if(t.data instanceof ArrayBuffer){var e=new DataView(t.data),i=e.getUint8(0),n=e.getUint32(1),s=e.getUint32(5);switch(i){case B:this.gdh.debug&&console.log("GetObjectInfoBoolean received");var o=e.getUint8(9);(0,this.gdh.pending[n].func_cb)(n,s,o),delete this.gdh.pending[n];break;case N:this.gdh.debug&&console.log("GetObjectInfoInt received");o=e.getUint32(9);(P=this.gdh.pending[n]).func_cb(n,P.data,s,o),delete this.gdh.pending[n];break;case V:this.gdh.debug&&console.log("GetObjectInfoFloat received");o=e.getFloat32(9);(P=this.gdh.pending[n]).func_cb(n,P.data,s,o),delete this.gdh.pending[n];break;case W:this.gdh.debug&&console.log("GetObjectInfoFloatArray received");var a=e.getInt32(9);o=new Array(a);g=13;for(var l=0;l<a;l++)o[l]=e.getFloat32(g),g+=4;(P=this.gdh.pending[n]).func_cb(n,P.data,s,o),delete this.gdh.pending[n];break;case I:this.gdh.debug&&console.log("SetObjectInfoBoolean received",n,s);break;case k:this.gdh.debug&&console.log("SetObjectInfoInt received",n,s);break;case R:this.gdh.debug&&console.log("SetObjectInfoFloat received",n,s);break;case j:this.gdh.debug&&console.log("SetObjectInfoString received",n,s);break;case Q:this.gdh.debug&&console.log("ToggleObjectInfo received",n,s);break;case M:this.gdh.debug&&console.log("RefObjectInfo received",n,s),delete this.gdh.pending[n];break;case D:this.gdh.debug&&console.log("UnrefObjectInfo received",n,s),delete this.gdh.pending[n];break;case L:this.gdh.debug&&console.log("RefObjectInfoList received",n,s),(0,this.gdh.pending[n].func_cb)(n,s),delete this.gdh.pending[n];break;case G:var r=9,h=e.getUint32(r);this.gdh.debug&&console.log("GetObjectRefInfoAll received",n,h),r+=4;for(l=0;l<h;l++){var A=e.getUint32(r);r+=4;var c=e.getUint32(r);r+=4;var d=this.gdh.sub[A];if(void 0===d)r+=c;else{switch(d.type){case Pwr.eType_Boolean:if(d.elements<=1)o=e.getUint8(r),r+=1;else{(f=c)!=d.elements&&console.log("Subscription size error",f,d.elements,A),o=new Array(f);for(var g=0;g<f;g++)o[g]=e.getUint8(r),r+=1}break;case Pwr.eType_Float32:if(d.elements<=1)o=e.getFloat32(r),r+=4;else{(f=c/4)!=d.elements&&console.log("Subscription size error",f,d.elements,A),o=new Array(f);for(g=0;g<f;g++)o[g]=e.getFloat32(r),r+=4}break;case Pwr.eType_Int8:case Pwr.eType_Int16:case Pwr.eType_Int32:case Pwr.eType_UInt8:case Pwr.eType_UInt16:case Pwr.eType_UInt32:case Pwr.eType_Status:case Pwr.eType_NetStatus:case Pwr.eType_Mask:case Pwr.eType_Enum:case GraphIfc.eType_Bit:if(d.elements<=1)o=e.getInt32(r),r+=4;else{(f=c/4)!=d.elements&&console.log("Subscription size error",f,d.elements,A),o=new Array(f);for(g=0;g<f;g++)o[g]=e.getInt32(r),r+=4}break;case Pwr.eType_String:case Pwr.eType_Time:case Pwr.eType_DeltaTime:case Pwr.eType_AttrRef:case Pwr.eType_Objid:if(d.elements<=1){var _=e.getInt16(r);r+=2;var u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);o=String.fromCharCode.apply(null,u)}else{var f;(f=d.elements)!=d.elements&&console.log("Subscription size error",f,d.elements,A),o=new Array(f);for(var b=0;b<f;b++){_=e.getInt16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);o[b]=String.fromCharCode.apply(null,u)}}}this.gdh.sub[A].value=o}}if(void 0===this.gdh.pending[n]){console.log("** GetObjectRefInfoAll received removed",n);break}(0,this.gdh.pending[n].func_cb)(n,s),delete this.gdh.pending[n];break;case K:var w=[];r=9,h=e.getUint32(r);this.gdh.debug&&console.log("GetAllXttChildren received",n,h),console.log("GetAllXttChildren received",s,n,h),r+=4;for(l=0;l<h;l++){(m=new ObjectInfo).objid=new PwrtObjid,m.objid.vid=e.getUint32(r),r+=4,m.objid.oix=e.getUint32(r),r+=4,m.cid=e.getUint32(r),r+=4,m.has_children=0!==e.getUint16(r),r+=2;_=e.getUint16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);m.name=String.fromCharCode.apply(null,u);var p=e.getUint16(r);r+=2,u=new Uint8Array(p);for(g=0;g<p;g++)u[g]=e.getUint8(r++);m.description=String.fromCharCode.apply(null,u);var v=e.getUint16(r);r+=2,u=new Uint8Array(v);for(g=0;g<v;g++)u[g]=e.getUint8(r++);m.classname=String.fromCharCode.apply(null,u),w.push(m)}(P=this.gdh.pending[n]).func_cb(n,P.data,s,w),delete this.gdh.pending[n];break;case z:w=[],r=9,h=e.getUint32(r);this.gdh.debug&&console.log("GetAllClassAttributes received",n,h),r+=4;for(l=0;l<h;l++){(m=new AttributeInfo).type=e.getUint32(r),r+=4,m.flags=e.getUint32(r),r+=4,m.size=e.getUint16(r),r+=2,m.elements=e.getUint16(r),r+=2;_=e.getUint16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);m.name=String.fromCharCode.apply(null,u),_=e.getUint16(r),r+=2,u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);m.classname=String.fromCharCode.apply(null,u),w.push(m)}(P=this.gdh.pending[n]).func_cb(n,P.data,s,w),delete this.gdh.pending[n];break;case q:case tt:case H:this.gdh.debug&&console.log("GetObject received",n,s);var m=null;if(0!=(1&s)){r=9;(m=new ObjectInfo).objid=new PwrtObjid,m.objid.vid=e.getUint32(r),r+=4,m.objid.oix=e.getUint32(r),r+=4,m.cid=e.getUint32(r),r+=4,m.has_children=0!==e.getUint16(r),r+=2;_=e.getUint16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);m.name=String.fromCharCode.apply(null,u),_=e.getUint16(r),r+=2,u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);m.fullname=String.fromCharCode.apply(null,u);v=e.getUint16(r);r+=2,u=new Uint8Array(v);for(g=0;g<v;g++)u[g]=e.getUint8(r++);m.classname=String.fromCharCode.apply(null,u);p=e.getUint16(r);r+=2,u=new Uint8Array(p);for(g=0;g<p;g++)u[g]=e.getUint8(r++);m.description=String.fromCharCode.apply(null,u);var C=e.getUint16(r);r+=2,u=new Uint8Array(C);for(g=0;g<C;g++)u[g]=e.getUint8(r++);m.param1=String.fromCharCode.apply(null,u)}(P=this.gdh.pending[n]).func_cb(n,P.data,s,m),delete this.gdh.pending[n];break;case F:if(0!=(1&s)){r=9,w=[],h=e.getUint16(r);r+=2,this.gdh.debug&&console.log("CrrSignal received",n,h);for(l=0;l<h;l++){(m=new CrrInfo).type=e.getUint16(r),r+=2,m.objid=new PwrtObjid,m.objid.vid=e.getUint32(r),r+=4,m.objid.oix=e.getUint32(r),r+=4;_=e.getUint16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);m.name=String.fromCharCode.apply(null,u);v=e.getUint16(r);r+=2,u=new Uint8Array(v);for(g=0;g<v;g++)u[g]=e.getUint8(r++);m.classname=String.fromCharCode.apply(null,u),w.push(m)}}(P=this.gdh.pending[n]).func_cb(n,P.data,s,w),delete this.gdh.pending[n];break;case J:w=new OpwindMenuInfo,r=9;if(this.gdh.debug&&console.log("GetOpwindMenu received",n,h),console.log("GetOpwindMenu received",s,n),1&s){_=e.getUint16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);w.title=String.fromCharCode.apply(null,u),_=e.getUint16(r),r+=2,u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);w.text=String.fromCharCode.apply(null,u),w.enable_language=e.getUint32(r),r+=4,w.enable_login=e.getUint32(r),r+=4,w.enable_alarmlist=e.getUint32(r),r+=4,w.enable_eventlog=e.getUint32(r),r+=4,w.enable_navigator=e.getUint32(r),r+=4,w.disable_help=e.getUint32(r),r+=4,w.disable_proview=e.getUint32(r),r+=4,w.language=e.getUint32(r),r+=4;var x=e.getUint16(r);r+=2;for(l=0;l<x;l++){var E=new MenuButton;E.type=e.getUint32(r),r+=4,_=e.getUint16(r),r+=2,u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);E.text=String.fromCharCode.apply(null,u),_=e.getUint16(r),r+=2,u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);E.name=String.fromCharCode.apply(null,u),_=e.getUint16(r),r+=2,u=new Uint8Array(_);for(g=0;g<_;g++)u[g]=e.getUint8(r++);E.url=String.fromCharCode.apply(null,u),w.buttons.push(E)}}(P=this.gdh.pending[n]).func_cb(n,P.data,s,w),delete this.gdh.pending[n];break;case Y:r=9;this.gdh.debug&&console.log("Check user received",n,h),console.log("Check user received",s,n);var T=0;1&s&&(T=e.getUint32(r),r+=4),(P=this.gdh.pending[n]).func_cb(n,P.data,s,T),delete this.gdh.pending[n];break;case X:if(1&s){r=9,_=e.getUint16(r);r+=2;for(u=new Uint8Array(_),g=0;g<_;g++)u[g]=e.getUint8(r++);var O=String.fromCharCode.apply(null,u)}(P=this.gdh.pending[n]).func_cb(n,P.data,s,O),delete this.gdh.pending[n];break;case Z:w=[],r=9,h=e.getUint32(r);this.gdh.debug&&console.log("MhSync received",n,h),r+=4;for(l=0;l<h;l++){t=new MhEvent;var S=e.getUint16(r);r+=2;for(u=new Uint8Array(S),g=0;g<S;g++)u[g]=e.getUint8(r++);t.eventTime=String.fromCharCode.apply(null,u),S=e.getUint16(r),r+=2,u=new Uint8Array(S);for(g=0;g<S;g++)u[g]=e.getUint8(r++);t.eventText=String.fromCharCode.apply(null,u),S=e.getUint16(r),r+=2,u=new Uint8Array(S);for(g=0;g<S;g++)u[g]=e.getUint8(r++);t.eventName=String.fromCharCode.apply(null,u),t.eventFlags=e.getUint32(r),r+=4,t.eventStatus=e.getUint32(r),r+=4,t.eventPrio=e.getUint32(r),r+=4,t.eventId=new MhEventId,t.eventId.nix=e.getUint32(r),r+=4,t.eventId.idx=e.getUint32(r),r+=4,S=e.getUint16(r),r+=2,u=new Uint8Array(S);for(g=0;g<S;g++)u[g]=e.getUint8(r++);t.eventId.birthTime=String.fromCharCode.apply(null,u),t.targetId=new MhEventId,t.targetId.nix=e.getUint32(r),r+=4,t.targetId.idx=e.getUint32(r),r+=4,S=e.getUint16(r),r+=2,u=new Uint8Array(S);for(g=0;g<S;g++)u[g]=e.getUint8(r++);t.targetId.birthTime=String.fromCharCode.apply(null,u),t.eventType=e.getUint32(r),r+=4;var y=new PwrtObjid(0,0);y.vid=e.getUint32(r),r+=4,y.oix=e.getUint32(r),r+=4,t.object=new PwrtAttrRef,t.object.objid=y,t.object.offset=e.getUint32(r),r+=4,t.object.body=e.getUint32(r),r+=4,t.object.size=e.getUint32(r),r+=4,t.object.flags=e.getUint32(r),r+=4;var U=new PwrtObjid(0,0);U.vid=e.getUint32(r),r+=4,U.oix=e.getUint32(r),r+=4,t.supObject=new PwrtAttrRef,t.supObject.objid=U,t.supObject.offset=e.getUint32(r),r+=4,t.supObject.body=e.getUint32(r),r+=4,t.supObject.size=e.getUint32(r),r+=4,t.supObject.flags=e.getUint32(r),r+=4,S=e.getUint16(r),r+=2,u=new Uint8Array(S);for(g=0;g<S;g++)u[g]=e.getUint8(r++);t.eventMoreText=String.fromCharCode.apply(null,u),t.syncIdx=e.getUint32(r),r+=4,w.push(t)}(P=this.gdh.pending[n]).func_cb(n,P.data,s,w),delete this.gdh.pending[n];break;case $:var P;(P=this.gdh.pending[n]).func_cb(n,P.data,s),delete this.gdh.pending[n];break;default:console.log("Unknown message type")}}}},this.getObjectInfoBoolean=function(t,e){this.return_cb=e;var i=new Uint8Array(t.length+6);i[0]=B,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;for(var n=0;n<t.length;n++)i[n+6]=t.charCodeAt(n);this.pending[this.next_id]=new PendingData(e,null),this.ws.send(i),this.next_id++},this.getObjectInfoInt=function(t,e,i){this.return_cb=e;var n=new Uint8Array(t.length+6);n[0]=N,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;for(var s=0;s<t.length;s++)n[s+6]=t.charCodeAt(s);this.pending[this.next_id]=new PendingData(e,i),this.ws.send(n),this.next_id++},this.getObjectInfoFloat=function(t,e,i){this.return_cb=e;var n=new Uint8Array(t.length+6);n[0]=V,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255;for(var s=0;s<t.length;s++)n[s+6]=t.charCodeAt(s);this.pending[this.next_id]=new PendingData(e,i),this.ws.send(n),this.next_id++},this.getObjectInfoFloatArray=function(t,e,i,n){this.return_cb=i;var s=new Uint8Array(t.length+10);s[0]=W,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=e>>16&255,s[9]=e>>24&255;for(var o=0;o<t.length;o++)s[o+10]=t.charCodeAt(o);this.pending[this.next_id]=new PendingData(i,n),this.ws.send(s),this.next_id++},this.refObjectInfo=function(t,e,i){var n=new Sub;if(n.name=t,n.refid=this.subscriptionCount,n.type=e,n.elements=i,this.sub[this.subscriptionCount]=n,this.subscriptionCount++,this.listSent){var s;s=12+n.name.length;var o=new Uint8Array(s+10);o[0]=M,o[2]=255&this.next_id,o[3]=this.next_id>>8&255,o[4]=this.next_id>>16&255,o[5]=this.next_id>>24&255,this.debug&&console.log("RefObjectInfo: ",n.refid);var a=6;o[a++]=255&n.refid,o[a++]=n.refid>>8&255,o[a++]=n.refid>>16&255,o[a++]=n.refid>>24&255,o[a++]=255&n.elements,o[a++]=n.elements>>8&255,o[a++]=n.elements>>16&255,o[a++]=n.elements>>24&255,o[a++]=255&n.name.length,o[a++]=n.name.length>>8&255,o[a++]=n.name.length>>16&255,o[a++]=n.name.length>>24&255;for(var l=0;l<n.name.length;l++)o[a++]=n.name.charCodeAt(l);return this.pending[this.next_id]=new PendingData(this.refObjectInfoReply,null),this.debug&&console.log("Sending RefObjectInfo",this.next_id,s,a),this.ws.send(o),this.next_id++,n.refid}return n.refid},this.refObjectInfoReply=function(t,e){this.debug&&console.log("refObjectInfoReply",t,e)},this.unrefObjectInfo=function(t){var e=new Uint8Array(14);e[0]=D,e[2]=255&this.next_id,e[3]=this.next_id>>8&255,e[4]=this.next_id>>16&255,e[5]=this.next_id>>24&255,this.debug&&console.log("UnrefObjectInfo: ",t);var i=6;e[i++]=255&t,e[i++]=t>>8&255,e[i++]=t>>16&255,e[i++]=t>>24&255,this.pending[this.next_id]=new PendingData(this.unrefObjectInfoReply,null),this.debug&&console.log("Sending UnrefObjectInfo",this.next_id,4,10,t),this.ws.send(e),this.next_id++,delete this.sub[t]},this.refObjectInfoList=function(t){var e=0,i=0;for(var n in this.return_cb=t,this.sub)e+=12+this.sub[n].name.length,i++;var s=new Uint8Array(e+10);s[0]=L,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&i,s[7]=i>>8&255,s[8]=i>>16&255,s[9]=i>>24&255;var o=10;for(var n in this.sub)if(0!==n){this.debug&&console.log("RefObjectInfoList: ",this.sub[n].refid),s[o++]=255&this.sub[n].refid,s[o++]=this.sub[n].refid>>8&255,s[o++]=this.sub[n].refid>>16&255,s[o++]=this.sub[n].refid>>24&255,s[o++]=255&this.sub[n].elements,s[o++]=this.sub[n].elements>>8&255,s[o++]=this.sub[n].elements>>16&255,s[o++]=this.sub[n].elements>>24&255,s[o++]=255&this.sub[n].name.length,s[o++]=this.sub[n].name.length>>8&255,s[o++]=this.sub[n].name.length>>16&255,s[o++]=this.sub[n].name.length>>24&255;for(var a=0;a<this.sub[n].name.length;a++)s[o++]=this.sub[n].name.charCodeAt(a)}this.pending[this.next_id]=new PendingData(t,null),this.debug&&console.log("Sending RefObjectInfoList",this.next_id,e,o,this.next_id),this.ws.send(s),this.next_id++,this.listSent=!0},this.refObjectInfoListReply=function(t,e){this.debug&&console.log("refObjectInfoListReply",t,e)},this.getRefObjectInfoAll=function(t){var e=new Uint8Array(6);e[0]=G,e[2]=255&this.next_id,e[3]=this.next_id>>8&255,e[4]=this.next_id>>16&255,e[5]=this.next_id>>24&255,this.pending[this.next_id]=new PendingData(t,null),this.debug&&console.log("Sending getRefObjectInfoAll",this.next_id),this.ws.send(e),this.next_id++},this.getRefObjectInfoAllReply=function(t,e){this.debug&&console.log("getRefObjectInfoAllReply",t,e)},this.getObjectRefInfo=function(t){return this.debug&&console.log("getObjectRefInfo",t,this.sub[t].value),this.sub[t].value},this.setObjectInfoBoolean=function(t,e){var i=new Uint8Array(12+t.length);i[0]=I,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e,i[7]=e>>8&255,i[8]=e>>16&255,i[9]=e>>24&255,i[10]=255&t.length,i[11]=t.length>>8&255;for(var n=12,s=0;s<t.length;s++)i[n++]=t.charCodeAt(s);return this.ws.send(i),this.debug&&console.log("Sending setObjectInfoBoolean",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.setObjectInfoInt=function(t,e){var i=new Uint8Array(12+t.length);i[0]=k,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255,i[6]=255&e,i[7]=e>>8&255,i[8]=e>>16&255,i[9]=e>>24&255,i[10]=255&t.length,i[11]=t.length>>8&255;for(var n=12,s=0;s<t.length;s++)i[n++]=t.charCodeAt(s);return this.ws.send(i),this.debug&&console.log("Sending setObjectInfoInt",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.setObjectInfoFloat=function(t,e){var i=new Uint8Array(12+t.length);i[0]=R,i[2]=255&this.next_id,i[3]=this.next_id>>8&255,i[4]=this.next_id>>16&255,i[5]=this.next_id>>24&255;var n=new ArrayBuffer(4);new Float32Array(n)[0]=e;var s=new Uint8Array(n);i[6]=s[0],i[7]=s[1],i[8]=s[2],i[9]=s[3],i[10]=255&t.length,i[11]=t.length>>8&255;for(var o=12,a=0;a<t.length;a++)i[o++]=t.charCodeAt(a);return this.ws.send(i),this.debug&&console.log("Sending setObjectInfoFloat",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.setObjectInfoString=function(t,e){var i,n=new Uint8Array(10+e.length+t.length);n[0]=j,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&e.length,n[7]=e.length>>8&255;var s=8;for(i=0;i<e.length;i++)n[s++]=e.charCodeAt(i);for(n[s++]=255&t.length,n[s++]=t.length>>8&255,i=0;i<t.length;i++)n[s++]=t.charCodeAt(i);return this.ws.send(n),this.debug&&console.log("Sending setObjectInfoString",this.next_id,t,e),this.next_id++,new PwrtStatus(1)},this.toggleObjectInfo=function(t){var e=new Uint8Array(8+t.length);e[0]=Q,e[2]=255&this.next_id,e[3]=this.next_id>>8&255,e[4]=this.next_id>>16&255,e[5]=this.next_id>>24&255,e[6]=255&t.length,e[7]=t.length>>8&255;for(var i=8,n=0;n<t.length;n++)e[i++]=t.charCodeAt(n);return this.ws.send(e),this.debug&&console.log("Sending toggleObjectInfoBoolean",this.next_id,t,value),this.next_id++,new PwrtStatus(1)},this.getAllXttChildren=function(t,e,i){var n=new Uint8Array(14);n[0]=K,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t.vid,n[7]=t.vid>>8&255,n[8]=t.vid>>16&255,n[9]=t.vid>>24&255,n[10]=255&t.oix,n[11]=t.oix>>8&255,n[12]=t.oix>>16&255,n[13]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(e,i),this.debug&&console.log("Sending getAllXttChildren",this.next_id),this.ws.send(n),this.next_id++},this.getAllClassAttributes=function(t,e,i,n){var s=new Uint8Array(18);s[0]=z,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&t,s[7]=t>>8&255,s[8]=t>>16&255,s[9]=t>>24&255,s[10]=255&e.vid,s[11]=e.vid>>8&255,s[12]=e.vid>>16&255,s[13]=e.vid>>24&255,s[14]=255&e.oix,s[15]=e.oix>>8&255,s[16]=e.oix>>16&255,s[17]=e.oix>>24&255,this.pending[this.next_id]=new PendingData(i,n),this.debug&&console.log("Sending getAllClassAttributes",this.next_id,t,e.vid,e.oix),this.ws.send(s),this.next_id++},this.getObject=function(t,e,i,n){var s=new Uint8Array(16);s[0]=q,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=255&t.vid,s[9]=t.vid>>8&255,s[10]=t.vid>>16&255,s[11]=t.vid>>24&255,s[12]=255&t.oix,s[13]=t.oix>>8&255,s[14]=t.oix>>16&255,s[15]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(i,n),this.debug&&console.log("Sending getObject",this.next_id,t.vid,t.oix),this.ws.send(s),this.next_id++},this.getObjectFromAref=function(t,e,i,n){var s=new Uint8Array(32);s[0]=tt,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=255&t.objid.vid,s[9]=t.objid.vid>>8&255,s[10]=t.objid.vid>>16&255,s[11]=t.objid.vid>>24&255,s[12]=255&t.objid.oix,s[13]=t.objid.oix>>8&255,s[14]=t.objid.oix>>16&255,s[15]=t.objid.oix>>24&255,s[16]=255&t.offset,s[17]=t.offset>>8&255,s[18]=t.offset>>16&255,s[19]=t.offset>>24&255,s[20]=255&t.body,s[21]=t.body>>8&255,s[22]=t.body>>16&255,s[23]=t.body>>24&255,s[24]=255&t.size,s[25]=t.size>>8&255,s[26]=t.size>>16&255,s[27]=t.size>>24&255,s[28]=255&t.flags,s[29]=t.flags>>8&255,s[30]=t.flags>>16&255,s[31]=t.flags>>24&255,this.pending[this.next_id]=new PendingData(i,n),this.debug&&console.log("Sending getObject",this.next_id,oid.vid,oid.oix),this.ws.send(s),this.next_id++},this.getObjectFromName=function(t,e,i,n){var s=new Uint8Array(10+t.length);s[0]=H,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255,s[6]=255&e,s[7]=e>>8&255,s[8]=255&t.length,s[9]=t.length>>8&255;for(var o=10,a=0;a<t.length;a++)s[o++]=t.charCodeAt(a);this.pending[this.next_id]=new PendingData(i,n),this.debug&&console.log("Sending getObjectFromName",this.next_id,t),this.ws.send(s),this.next_id++},this.crrSignal=function(t,e,i){var n=new Uint8Array(14);n[0]=F,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t.vid,n[7]=t.vid>>8&255,n[8]=t.vid>>16&255,n[9]=t.vid>>24&255,n[10]=255&t.oix,n[11]=t.oix>>8&255,n[12]=t.oix>>16&255,n[13]=t.oix>>24&255,this.pending[this.next_id]=new PendingData(e,i),this.debug&&console.log("Sending crrObject",this.next_id,t.vid,t.oix),this.ws.send(n),this.next_id++},this.getOpwindMenu=function(t,e,i){t.length;var n=new Uint8Array(8+t.length);n[0]=J,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t.length,n[7]=t.length>>8&255;for(var s=8,o=0;o<t.length;o++)n[s++]=t.charCodeAt(o);this.pending[this.next_id]=new PendingData(e,i),this.debug&&console.log("Sending getOpwindMenu",this.next_id),this.ws.send(n),this.next_id++},this.login=function(t,e,i,n){var s=new Uint8Array(8+t.length+2+e.length);s[0]=Y,s[2]=255&this.next_id,s[3]=this.next_id>>8&255,s[4]=this.next_id>>16&255,s[5]=this.next_id>>24&255;var o=6;s[o]=255&t.length,s[o+1]=t.length>>8&255,o+=2;for(var a=0;a<t.length;a++)s[o++]=t.charCodeAt(a);s[o]=255&e.length,s[o+1]=e.length>>8&255,o+=2;for(a=0;a<e.length;a++)s[o++]=e.charCodeAt(a);this.pending[this.next_id]=new PendingData(i,n),this.debug&&console.log("Sending login",this.next_id),this.ws.send(s),this.next_id++},this.getMsg=function(t,e,i){var n=new Uint8Array(10);n[0]=X,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t,n[7]=t>>8&255,n[8]=t>>16&255,n[9]=t>>24&255,this.pending[this.next_id]=new PendingData(e,i),this.ws.send(n),this.debug&&console.log("Sending getMsg",this.next_id,t),this.next_id++},this.mhSync=function(t,e,i){var n=new Uint8Array(10);n[0]=Z,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t,n[7]=t>>8&255,n[8]=t>>16&255,n[9]=t>>24&255,this.pending[this.next_id]=new PendingData(e,i),this.debug&&console.log("Sending mhSync",this.next_id),this.ws.send(n),this.next_id++},this.mhAcknowledge=function(t,e,i){var n=new Uint8Array(16+t.birthTime.length);n[0]=$,n[2]=255&this.next_id,n[3]=this.next_id>>8&255,n[4]=this.next_id>>16&255,n[5]=this.next_id>>24&255,n[6]=255&t.nix,n[7]=t.nix>>8&255,n[8]=t.nix>>16&255,n[9]=t.nix>>24&255,n[10]=255&t.idx,n[11]=t.idx>>8&255,n[12]=t.idx>>16&255,n[13]=t.idx>>24&255;var s=14;n[s]=255&t.birthTime.length,n[s+1]=t.birthTime.length>>8&255,s+=2;for(var o=0;o<t.birthTime.length;o++)n[s++]=t.birthTime.charCodeAt(o);this.pending[this.next_id]=new PendingData(e,i),this.debug&&console.log("Sending mhAcknowledge",this.next_id),console.log("Sending mhAcknowledge",this.next_id),this.ws.send(n),this.next_id++}}var Bitmaps={leaf:0,map:2,openmap:4,object:6,attrenum:8,attrarra:10,attrarel:12,attr:14,crrwrite:16,crrread:18,ack:20,alarm:22,eventacked:24,eventalarm:26,eventreturn:28,info:30,system:32,maintenance:34,blockl:36,blockr:38,img:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],pending:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],images:["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAASElEQVQokWP4jwMwMDBgYBR5XBpwGYZVIzYNGDZB+QyEFOBiM+CyCacGBI0hgEGjsxkYGCiwkSI/4tKMz0DqxCM2A4hOOcQCAObFEQyI2PpKAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAQUlEQVQokWNgYGD4jw1jA2hqsGvAZRhWjdg0oIsh8QkqwMXGbhMuDXAxdAFsNDobyifTRor8SFGoUhSPFKUcYjEAMsMz2y6w8kgAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAKElEQVQokWP4DwUMDAwYGB9gwKUQm0FoGL/JOGwb1TgINZKFSbYOCgD1JxQJG0vK9AAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAK0lEQVQokWNgYGD4z8DA8B8bgMlhxbgUEgIMBE3Ggkc1Dk6N5AAGUm2DYQAkYTDe0vu7CAAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAQklEQVQokaXOwQ4AIAgCUP7/p+nUlpMSzY2bDwWHA5IEkFJCtaiKxE7dvsue8HZNJEPneoAuSq+OYAf9wy4K0Mk5C+d++RWimsw3AAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAPUlEQVQokaXRQQoAQAgCQP//6brKZmSt0M2hIACI4yBURqiKXQp0ThuhGwmt7Vy00XvqCa7QN1wjhtYLCCYyCkvDVnkJOQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAH0lEQVQokWP4TyJgYGBg+E8iZiDFdHrZMKqBGA2kYAD8gaJsjwzf9wAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIklEQVQokWNgYGD4TxL+TyJg+P//P9GmwzXQ3oZRDdSOBwAGOSrkrXppgQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAPklEQVQokWP4////fwYGBgxMCDBgU4jNICyYsOlYbENoJNIW7BqJsYm2NuJyBVE2EqWRfjbiUoQ3oAgpwgUANLqccvbgec0AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAPElEQVQokWNgYGD4jw0wMDDgx9gUEgMYiDIdDaNoJBZg1UiUTTS1EZcriLKRKI30sxGXIgKBhF8RrqgBAOTOqGZ5aiCnAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAMElEQVQokWP4////fwYGBgxMCDBgU4jNICwYv+nY5InWOGojXW0khLEahtc6PDYCAB9hxkjBPICvAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAALUlEQVQokWNgYGD4jw0wMDDgx9gUEgMYCJmOTZ5ojaM20tVGQgCHK/AnLVwAAPonfpBwU5f4AAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIklEQVQokWP4////fwYGBpwYHTDANGADeDWM2jAEbSAFAADB26JsIjYj1AAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIElEQVQokWNgYGD4jw8wMDCgYwZcEvg1jNowBG0gBQMAQN8q5COZl1cAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAIUlEQVQokWP4TyJgGIQaGBgY/pOIibcEroEkTLIfhoEGADzs8B5gcUg/AAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAJUlEQVQokWNgYGD4TyIedBr+kwgY/v//T7TpcA0k2TAIQ4nmGgDFzt0jExR7hgAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAN0lEQVQokaWNQQoAMAjD8v9P633WVWhBkJIotQQoYPYbrHYrqC9D+MG54OBMuMC54GApuPBed9OxiMNLGke1JwAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAANElEQVQokWNgYGD4jw3DABY57IqxsQlqwGELSYop1ECEYgo0EKmYQg1EKMbUQEAxRAMpAABRMgoFjbTzXgAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWNgYGD4j4yRATY5BmyKkGks4qgS2BSj2UYFDdgAdW2gvpOwhDW6ItwaCGI8JuHWgMOtWD0PACufaaWhXDFDAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWP4jwYYGBjgGKscNkXINLo4hgZsipFto44GbJi6NlDfSehhjUxjyGMVxQMYcJmEVwPB5ICEAdcbY6vf9TVAAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAS0lEQVQokZ2Q2w4AIAhCz///ND11M3RVmxuDUBRAtw8QHRyC4SSJSDjDht1Yhxdudks+bFNxYsX9G6rz2qVHxqRspGi2Wpoji/dqaLh22DbO2VuXAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAASklEQVQokWP4////fwYGBqIwVC2cgSKBTQzKxhDA0ICmGau12BRCMLJp2BQgy8H9gM9ELGJkasAXvFg9TQjgDCVc8YBXAwFMmgYASkT1C9E5Ya0AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAARklEQVQokZ2QQQoAMAjD+v9Pu9PA1ThQQRBtoFUBJSkk0SlwOwKykCAEcn+BK8hih/aAe++y7IDuhWgXfcKHCuBBfX6ASR3Vn8ZINQzCrQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAQ0lEQVQokWNgYGD4j45hAJscA8UakBXi0ITddDy2YJqOrBiLJjI1oLsdj1/I0IAnCLFpwtSALYQwNKB7FJ2NooEUDAAtGwcI+Svs4gAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAL0lEQVQokWP4TyJgGCkaGBgQyhhwSeASw9CAYho2A3CZiE0xVg34FOPUgA+QrAEA1FYi+tWeG/cAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAMElEQVQokWNgYGD4TyIeGRr+//+PXQOaBC4xVElkBdgMwHASTBEOxdj9gEcxHYIVAC5kqlZXl5JMAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAJ0lEQVQokWP4jwMwMDBgF8elGIZHNeDSANOEVRyXBpwGUcUGqvoBAK+H8xt0qXFWAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAJ0lEQVQokWNgYGD4jw3///8fqzgDLsUwMKoBlwaSg5UAHoiIw2cDAFMz2iY65DAoAAAAAElFTkSuQmC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAASUlEQVQokZ2RUQoAIAjFdv9L11dhskeUEIQ2mcYIAXjeisA+EahFA9ad/siAA0wqSUsnu87wDZh3VEodO6Rr1c51rc8fd9OoMQHLk7dXak3qLwAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAR0lEQVQokZ2S2woAIAhD9/8/vV6tjgMNhLxMN1SSTGYb46JkfS2gJglQ/ncRAZ5JTCXQYsFRwxpAvFtKoeMvmoqDv1jc5DQONycV+bfOetgAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAOUlEQVQokWNgYGD4///////E0AwMDP8hPDQAk8QhjlMCuzg2G3AB6tlAez8MglAiCZNiw/////8DACmmtFrq9aGNAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAN0lEQVQokWP4////fwYGhv/E0FA2w390jCSJIc6ASwKnBmw24MLUs4H2fhgEoUQKIMkGBgaG/wDZFBj2pVi3HgAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAN0lEQVQokWNgYGD4TyJm+E8sgGugig3YxHFqwGcIQQ3obAwN6G7GawMuhVg1EFKMUwM+QJ+IAwDD1Gyi1EZc6gAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAO0lEQVQokWP4TyJg+P///38GBgaiMFwDVWzAJo5TA15DCGnAYKNrwHAzPhtwKcSqgZBinBqIigeaRhwAPuZgrlZXy70AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAP0lEQVQokZWPQQoAMAzC8v9Pu8soDOxaBS82QkWNgPKTJ/BYsLekAOxfquwHWyfws6ED7OgtfNk9bAuTSGBJOufqnHIsmYkzAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAQUlEQVQokZWPQQ4AMAQE5/+f1kuTCkuROGAmADCVPsJsBfdCsX0u3N7sJFfXsAqW8BMaID+9gE3SJayEFo7CFwY7GtAw3ouVj50AAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAQElEQVQokZ2QQQ4AMAjC+v9Pu9MWl5AJ42a0IlKBgCIadgGgQ8imqo9D3zDBvJoyR+zwlWHS9SUHaOf4QOywtQCQGucn0g2dEQAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAOklEQVQokWNgYGD4Tyz+////fwZSFBOtAaoQQsM46JLY+HAbUEwgrJmwyZTZQJYfSAolmsQDWTENwwByoOYaWbAqegAAAABJRU5ErkJggg==","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWP4jwMwMDBgF8enAZsmvBqw2cSARQBDIQqbGEUoaggpQBcj3Qay/IAN4AwlfBrIigeiNeACADpU5yeYXn+XAAAAAElFTkSuQmCC","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAPElEQVQokWNgYGD4jw3///8fqzgDPg04NOG3AUMTugA2hWhqiFKEzCeoAF2MRBvI8gNJoUT1eCBaAy4MAMhm5hr5iTaWAAAAAElFTkSuQmCC"]},Plow={DRAWOFFSET:2,DEST_INTOLAST:0,DEST_INTOFIRST:1,DEST_AFTER:2,DEST_BEFORE:3,TREE_INDENTATION:1,OPEN_ATTRIBUTES:1,OPEN_CHILDREN:2,OPEN_CROSSREFERENCES:4,OPEN_ALL:7,COLOR_BLACK:1,COLOR_RED:2,COLOR_GRAY:3,COLOR_DARKGRAY:4,COLOR_LIGHTGRAY:5,COLOR_WHITE:6,COLOR_YELLOW:7,COLOR_GREEN:8,COLOR_LIGHTBLUE:9,COLOR_BLUE:10,COLOR_VIOLET:11,eEvent_MB1Click:0,eEvent_MB1ClickShift:1,eEvent_Key_Up:2,eEvent_Key_Down:3,eEvent_Key_Right:4,eEvent_Key_Left:5,eEvent_Key_ShiftRight:6,eEvent_Key_CtrlR:7,eEvent_Key_CtrlL:8,eEvent_Key_CtrlG:9,eEvent_ObjectDeleted:10,RELATIVE_POSITION:1,NEXT_RELATIVE_POSITION:2};function PlowGeometry(){this.ll_x=0,this.ll_y=0,this.ur_x=0,this.ur_y=0}function PlowNodeClass(t){this.a=new PlowArray(t),this.ctx=t,this.nc_name="",this.group=0,this.node_open=0,this.draw=function(t,e,i,n){this.a.draw(t,e,i,n)},this.insert=function(t){this.a.add(t)}}function PlowArray(o){this.a=[],this.ctx=o,this.add=function(t){this.a.push(t)},this.insertNode=function(t,e,i){var n=this.find(t);if(-1==n)if(null==e)switch(i){case Plow.DEST_INTOLAST:case Plow.DEST_AFTER:this.a.push(t),t.level=0;break;default:t.level=0,this.a.unshift(t)}else{var s=this.find(e);if(-1==s)return;switch(i){case Plow.DEST_INTOFIRST:s==this.a.length-1?this.a.push(t):this.a.splice(s+1,0,t),t.level=e.level+1;break;case Plow.DEST_INTOLAST:if(s==this.a.length-1)this.a.push(t);else{n=this.a.length;for(var o=s+1;o<this.a.length;o++)if(this.a[o].level<=e.level){n=o;break}n==this.a.length?this.a.push(t):this.a.splice(n,0,t)}t.level=e.level+1;break;case Plow.DEST_AFTER:if(s==this.a.length-1)this.a.push(t);else{for(o=n;o<this.a.length&&!(this.a[o].level<e.level);o++);this.a.splice(o,0,t)}t.level=e.level;break;case Plow.DEST_BEFORE:0<n&&n--,this.a.splice(n,0,t),t.level=e.level}}},this.remove=function(t){var e=this.find(t);-1!=e&&(this.ctx.event_cb(Plow.eEvent_ObjectDeleted,this.a[e+1],0,0),this.a.splice(e,1))},this.size=function(){return this.a.length},this.get=function(t){return this.a[t]},this.draw=function(t,e,i,n){for(var s=0;s<this.a.length;s++)this.a[s].draw(t,e,i,n)},this.set_borders=function(t){for(var e=0;e<this.a.length;e++)this.a[e].set_borders(t)},this.configure=function(){for(var t=0;t<this.a.length;t++)this.a[t].pos.x=1*this.a[t].level,this.a[t].pos.y=1*t},this.close_node=function(t){var e=this.find(t);if(-1!=e){var i,n=t.level;for(i=e+1;i<this.a.length&&!(this.a[i].level<=n);i++);var s=i;if(s!=e+1)for(i=e+1;i<s;i++)o.select_object==this.a[e+1]&&(o.select_object=null),this.ctx.event_cb(Plow.eEvent_ObjectDeleted,this.a[e+1],0,0),this.a.splice(e+1,1)}},this.get_parent_object=function(t){var e=this.find(t);if(-1==e)return null;for(var i=e;0<=i;i--)if(this.a[i].level<t.level)return this.a[i];return null},this.get_first_child=function(t){var e=this.find(t);return-1==e?null:this.a.length==e-1?null:this.a[e+1].level>t.level?this.a[e+1]:null},this.get_next_sibling=function(t){for(var e=!1,i=0;i<this.a.length;i++)if(this.a[i]!=t){if(e){if(this.a[i].level==t.level)return this.a[i];if(this.a[i].level<t.level)return null}}else e=!0;return null},this.get_next_object=function(t){for(var e=0;e<this.a.length;e++)if(this.a[e]==t)return e==this.a.length-1?null:this.a[e+1];return null},this.get_previous_object=function(t){for(var e=0;e<this.a.length;e++)if(this.a[e]==t)return 0==e?null:this.a[e-1];return null},this.get_first_object=function(){return 0==this.a.length?null:this.a[0]},this.get_last_object=function(){return 0==this.a.length?null:this.a[this.a.length-1]},this.find=function(t){for(var e=0;e<this.a.length;e++)if(this.a[e]==t)return e;return-1}}function PlowNode(n,t,e){this.ctx=n,this.userdata=null,this.OFFSET=2,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.nc=t,this.pos=new PlowPoint(n,0,0),this.n_name="",this.annotv=[],this.annotsize=[],this.pixmapv=[],this.trace_object="",this.trace_attribute="",this.trace_attr_type=0,this.highlight=!1,this.select=!1,this.invert=!1,this.level=e,this.node_open=!1,this.fill_color=0,this.p=0,this.old_value=0,this.first_scan=!0,this.relative_position=0,this.set_annotation=function(t,e){10<=t||(this.annotv[t]=e)},this.set_annotation_pixmap=function(t,e){10<=t||(this.pixmapv[t]=e)},this.draw_object=function(){this.draw(this.ctx.gdraw.gctx,null,null,!1)},this.draw=function(t,e,i,n){var s=this.x_left*this.ctx.zoom_factor,o=this.y_low*this.ctx.zoom_factor-1,a=(this.x_right-this.x_left)*this.ctx.zoom_factor,l=(this.y_high-this.y_low)*this.ctx.zoom_factor+2;t.fillStyle="white",this.select&&(t.fillStyle="lightblue"),t.fillRect(s,o,a,l),this.nc.draw(t,this.pos,this,this.highlight)},this.connect=function(){if(""!=this.trace_object&&""!=this.trace_attribute){var t=this.trace_attribute.indexOf("#");-1!=t&&(this.trace_attribute=this.trace_attribute.substring(0,t));var e=this.trace_object+"."+this.trace_attribute;this.p=n.gdh.refObjectInfo(e,this.trace_attr_type),console.log("connecting",e,this.p)}},this.scan=function(){if(0!=this.p){var t=n.gdh.getRefObjectInfo(this.p);if(this.first_scan)this.first_scan=!1;else if(t==this.old_value)return;this.highlight=!!t,this.old_value=t,this.draw_object()}},this.set_borders=function(){this.x_left=1e37,this.x_right=-1e37,this.y_low=1e37,this.y_high=-1e37,t.a.set_borders(this)},this.event_handler=function(t,e,i){return(e-this.ctx.offset_x)/this.ctx.zoom_factor>=this.x_left&&(e-this.ctx.offset_x)/this.ctx.zoom_factor<=this.x_right&&(i-this.ctx.offset_y)/this.ctx.zoom_factor>=this.y_low&&(i-this.ctx.offset_y)/this.ctx.zoom_factor<=this.y_high?(n.event_object=this,1):0},this.set_select=function(t){t?(this.select=!0,this.ctx.select_object=this):(this.select=!1,this.ctx.select_object==this&&(this.ctx.select_object=null)),t!=this.select&&this.draw_object()},this.set_invert=function(t){this.invert=t,this.draw_object()},this.set_userdata=function(t){this.userdata=t},this.get_userdata=function(){return this.userdata},this.in_icon=function(t,e){return t>=this.x_left*this.ctx.zoom_factor&&t<=(this.x_left+1.75)*this.ctx.zoom_factor},this.measure=function(){var t=new PlowGeometry;return t.ll_x=this.x_left*this.ctx.zoom_factor,t.ll_y=this.y_low*this.ctx.zoom_factor,t.ur_x=this.x_right*this.ctx.zoom_factor,t.ur_y=this.y_high*this.ctx.zoom_factor,t}}function PlowPoint(t,e,i){this.x=e,this.y=i,this.ctx=t}function PlowAnnot(t,e,i,n,s,o,a){this.RELATIVE_OFFSET=1,this.p=new PlowPoint(t,e,i),this.draw_type=s,this.text_size=n,this.annot_type=o,this.number=a,this.ctx=t,this.draw=function(t,e,i,n){if(null!=i&&null!=i.annotv[this.number]){var s=0,o=this.ctx.zoom_factor/this.ctx.base_zoom_factor*(this.text_size+4)-4;if(!(o<0)){switch(o){case 0:s=8;break;case 1:s=10;break;case 2:s=12;break;case 3:case 4:s=14;break;case 5:case 6:case 7:s=18;break;default:s=3*o}t.font=s+"px Arial",i.invert?t.fillStyle="white":t.fillStyle="black",n&&(t.fillStyle="red"),t.lineWidth=.5;var a=(this.p.x+e.x)*this.ctx.zoom_factor,l=(this.p.y+e.y)*this.ctx.zoom_factor-s/4;if(0!=(this.annot_type&Plow.RELATIVE_POSITION)){var r=(e.x+i.relative_position+this.RELATIVE_OFFSET)*this.ctx.zoom_factor;a<r&&(a=r)}for(var h=i.annotv[this.number].split("\n"),A=0;A<h.length;A++)t.fillText(h[A],a,l),l+=1.4*s;0==(this.annot_type&Plow.NEXT_RELATIVE_POSITION)&&0==(this.annot_type&Plow.RELATIVE_POSITION)||(i.relative_position=(a+t.measureText(i.annotv[this.number]).width)/this.ctx.zoom_factor-e.x)}}},this.set_borders=function(t){}}function PlowAnnotPixmap(t,e,i,n){this.p=new PlowPoint(t,e,i),this.number=n,this.ctx=t,this.draw=function(e,t,i,n){var s,o=(this.p.x+t.x)*this.ctx.zoom_factor,a=(this.p.y+t.y)*this.ctx.zoom_factor,l=i.pixmapv[this.number];null!=l&&(i.invert&&l++,null==(s=Bitmaps.img[l])?((s=new Image).src=Bitmaps.images[l],Bitmaps.img[l]=s,Bitmaps.pending[l]=[],Bitmaps.pending[l].push(new PlowPoint(this.ctx,o,a)),s.onload=function(){for(var t=0;t<Bitmaps.pending[l].length;t++)e.drawImage(s,Bitmaps.pending[l][t].x,Bitmaps.pending[l][t].y);Bitmaps.pending[l]=null}):s.complete?e.drawImage(s,o,a):Bitmaps.pending[l].push(new PlowPoint(this.ctx,o,a)))},this.set_borders=function(t){}}function PlowRect(t,e,i,n,s,o,a,l,r){this.ll=new PlowPoint(t,e,i),this.ur=new PlowPoint(t,e+n,i+s),this.border_color=a,this.fill_color=o,this.fill=l,this.fix_color=r,this.ctx=t,this.draw=function(t,e,i,n){var s=(this.ll.x+e.x)*this.ctx.zoom_factor,o=(this.ll.y+e.y)*this.ctx.zoom_factor,a=(this.ur.x-this.ll.x)*this.ctx.zoom_factor,l=(this.ur.y-this.ll.y)*this.ctx.zoom_factor;switch(t.lineWidth=1,this.border_color){case Plow.COLOR_GRAY:t.strokeStyle="grey";break;case Plow.COLOR_RED:t.strokeStyle="red";break;case Plow.COLOR_WHITE:t.strokeStyle="white";break;default:t.strokeStyle="black"}if(n&&(t.strokeStyle="red"),t.strokeRect(s,o,a,l),this.fill){switch(this.fill_color){case Plow.COLOR_GRAY:t.fillStyle="grey";break;case Plow.COLOR_RED:t.fillStyle="red";break;case Plow.COLOR_YELLOW:t.fillStyle="yellow";break;case Plow.COLOR_GREEN:t.fillStyle="lightgreen";break;case Plow.COLOR_WHITE:i.invert?t.fillStyle="black":t.fillStyle="white";break;default:i.invert?t.fillStyle="white":t.fillStyle="black"}t.fillRect(s,o,a,l)}},this.set_borders=function(t){this.ll.x+t.pos.x<t.x_left&&(t.x_left=this.ll.x+t.pos.x),this.ur.x+t.pos.x>t.x_right&&(t.x_right=this.ur.x+t.pos.x),this.ll.y+t.pos.y<t.y_low&&(t.y_low=this.ll.y+t.pos.y),this.ur.y+t.pos.y>t.y_high&&(t.y_high=this.ur.y+t.pos.y)}}function GDraw(t){this.ctx=t,this.canvas=document.querySelector("canvas"),this.gctx=this.canvas.getContext("2d"),this.offset_top=this.canvas.offsetTop}function PlowCtx(){this.gdh=0,this.debug=!1,this.nodraw=0,this.zoom_factor=20,this.base_zoom_factor=20,this.offset_x=0,this.offset_y=0,this.x_right=0,this.x_left=0,this.y_high=0,this.y_low=0,this.a=new PlowArray(this),this.a_nc=new PlowArray(this),this.name="Claes context",this.gdraw=new GDraw(this),this.selct_object=null,this.event_cb=null,this.event_object=null,this.draw=function(){0<this.nodraw||(this.gdraw.gctx.fillStyle="white",this.gdraw.gctx.fillRect(0,0,this.gdraw.canvas.width,this.gdraw.canvas.height),this.a.draw(this.gdraw.gctx,null,null,!1))},this.connect=function(){for(var t=0;t<this.a.size();t++)this.a.get(t).connect()},this.scan=function(){console.log("ctx scan",this.a.size());for(var t=0;t<this.a.size();t++)this.a.get(t).scan()},this.set_nodraw=function(){this.nodraw++},this.reset_nodraw=function(){this.nodraw--},this.size=function(){return this.a.size()},this.event_handler=function(t,e,i){var n=0;switch(t){case Plow.eEvent_MB1Click:case Plow.eEvent_MB1ClickShift:for(var s=0;s<this.a.size()&&!(this.a.get(s)instanceof PlowNode&&1==(n=this.a.get(s).event_handler(t,e,i)));s++);1==n&&(this.event_cb(t,this.event_object,e,i),this.draw());break;case Plow.eEvent_Key_Up:case Plow.eEvent_Key_Down:case Plow.eEvent_Key_Left:case Plow.eEvent_Key_Right:case Plow.eEvent_Key_ShiftRight:case Plow.eEvent_Key_CtrlR:case Plow.eEvent_Key_CtrlL:case Plow.eEvent_Key_CtrlG:this.event_cb(t,null,0,0)}},this.set_select=function(t){for(var e=0;e<this.a.size();e++)this.a.get(e)instanceof PlowNode&&this.a.get(e).set_select(t)},this.set_invert=function(t){for(var e=0;e<this.a.size();e++)this.a.get(e)instanceof PlowNode&&this.a.get(e).set_invert(t)},this.get_select=function(){return this.select_object},this.insert=function(t,e){this.a.add(t)},this.insertNode=function(t,e,i){this.a.insertNode(t,e,i)},this.remove=function(t){this.select_object==t&&(this.select_object=null),this.a.remove(t)},this.insert_nc=function(t){this.a_nc.add(t)},this.configure=function(){this.a.configure(),this.a.set_borders();var t=1*this.a.a.length*this.zoom_factor;this.gdraw.canvas.height=t},this.get_parent_object=function(t){return this.a.get_parent_object(t)},this.get_next_object=function(t){return this.a.get_next_object(t)},this.get_last_object=function(){return this.a.get_last_object()},this.get_first_object=function(){return this.a.get_first_object()},this.get_previous_object=function(t){return this.a.get_previous_object(t)},this.close_node=function(t){this.a.close_node(t)},this.is_visible=function(t){return t.y_high*this.zoom_factor<=window.pageYOffset+window.innerHeight-this.gdraw.offset_top&&t.y_low*this.zoom_factor>=window.pageYOffset-this.gdraw.offset_top},this.scroll=function(t,e){window.scrollTo(window.scrollX,t*this.zoom_factor-window.innerHeight*e+this.gdraw.offset_top)}}function XttOpenChildrenData(t,e){this.node=t,this.open_next=e}function Xtt(){this.ctx=null,this.ncObject=null,this.scan_update,this.priv=0;var A=this;this.init=function(){this.priv=sessionStorage.getItem("pwr_privilege"),console.log("pwr_privilege",this.priv),this.methods_init(),this.ctx=new PlowCtx,this.ctx.event_cb=this.plow_event,this.createNodeClasses(),this.ctx.gdh=new Gdh,this.ctx.gdh.open_cb=this.gdh_init_cb,this.ctx.gdh.init(),this.ctx.gdraw.canvas.addEventListener("click",function(t){var e=t.pageY-A.ctx.gdraw.offset_top,i=t.pageX;t.shiftKey?xtt.ctx.event_handler(Plow.eEvent_MB1ClickShift,i,e):xtt.ctx.event_handler(Plow.eEvent_MB1Click,i,e)}),document.addEventListener("keydown",function(t){40==t.keyCode?(A.ctx.event_handler(Plow.eEvent_Key_Down),t.preventDefault()):39==t.keyCode?(t.shiftKey?A.ctx.event_handler(Plow.eEvent_Key_ShiftRight):A.ctx.event_handler(Plow.eEvent_Key_Right),t.preventDefault()):37==t.keyCode?(A.ctx.event_handler(Plow.eEvent_Key_Left),t.preventDefault()):38==t.keyCode?(A.ctx.event_handler(Plow.eEvent_Key_Up),t.preventDefault()):82==t.keyCode?(t.ctrlKey&&A.ctx.event_handler(Plow.eEvent_Key_CtrlR),t.preventDefault()):76==t.keyCode?(t.ctrlKey&&A.ctx.event_handler(Plow.eEvent_Key_CtrlL),t.preventDefault()):71==t.keyCode&&(t.ctrlKey&&A.ctx.event_handler(Plow.eEvent_Key_CtrlG),t.preventDefault())}),document.getElementById("toolitem1").addEventListener("click",function(t){var e=A.ctx.get_select();if(e.userdata instanceof XttItemObject){var i=window.open("","_blank");A.ctx.gdh.getObject(e.userdata.objid,GdhOp.GET_OP_METHOD_GRAPH,A.open_graph_cb,i)}console.log("toolitem1 event")}),document.getElementById("toolitem2").addEventListener("click",function(t){var e=A.ctx.get_select();if(e.userdata instanceof XttItemObject){var i=window.open("","_blank");A.ctx.gdh.getObject(e.userdata.objid,GdhOp.GET_OP_METHOD_OBJECTGRAPH,A.open_objectgraph_cb,i)}console.log("toolitem2 event")}),document.getElementById("toolitem3").addEventListener("click",function(t){console.log("toolitem1 event");var e=A.ctx.get_select();if(e.userdata instanceof XttItemObject){var i=window.open("","_blank");A.ctx.gdh.getObject(e.userdata.objid,GdhOp.GET_OP_METHOD_PLC,A.open_plc_cb,i)}else if(e.userdata instanceof XttItemCrr){var n=e.userdata.name.lastIndexOf("-"),s="";-1!=n&&(s="&obj="+e.userdata.name.substring(n+1)),console.log("flow.html?vid="+e.userdata.objid.vid+"&oix="+e.userdata.objid.oix+s),window.open("flow.html?vid="+e.userdata.objid.vid+"&oix="+e.userdata.objid.oix+s)}console.log("toolitem3 event")}),document.getElementById("toolitem4").addEventListener("click",function(t){console.log("toolitem4 event")}),document.getElementById("toolitem5").addEventListener("click",function(t){console.log("toolitem5 event");var e=A.ctx.get_select();null!=e&&e.userdata.open_attributes(A)}),document.getElementById("toolitem6").addEventListener("click",function(t){var e=A.ctx.get_select();A.ctx.gdh.crrSignal(e.userdata.objid,A.open_crr_cb,e),console.log("toolitem6 event")}),document.getElementById("toolitem7").addEventListener("click",function(t){console.log("toolitem7 event")}),document.getElementById("toolitem8").addEventListener("click",function(t){console.log("toolitem8 event");var e=A.ctx.get_select();if(null!=e&&e.userdata instanceof XttItemObject){var i=window.open("","_blank");A.ctx.gdh.getObject(e.userdata.objid,GdhOp.GET_OP_METHOD_HELPCLASS,A.open_helpclass_cb,i)}}),window.addEventListener("storage",function(t){""!=t.newValue&&(localStorage.setItem("XttMethodNavigator",""),A.display_object(t.newValue))})},this.is_authorized=function(t){return!!(this.priv&t)},this.gdh_init_cb=function(){null==A.priv&&A.ctx.gdh.login("","",A.login_cb,A);var t=new PwrtObjid(0,0);A.ctx.gdh.getAllXttChildren(t,A.open_children_cb,new XttOpenChildrenData(null,null)),A.ctx.gdh.listSent=!0,A.trace_cyclic()},this.login_cb=function(t,e,i,n){console.log("Login:",i,n),A.priv=1&i?n:0},this.open_children_cb=function(t,e,i,n){A.ctx.set_nodraw();for(var s=0;s<n.length;s++)null==e.node?(n[s].full_name=n[s].name,new XttItemObject(A,n[s],null,Plow.DEST_AFTER)):(n[s].full_name=e.node.userdata.full_name+"-"+n[s].name,new XttItemObject(A,n[s],e.node,Plow.DEST_INTOLAST));if(A.ctx.configure(),null!=e.open_next){if(0==e.open_next.length)return void A.ctx.reset_nodraw();for(var o=A.ctx.a.get_first_child(e.node);null!=o;){if(o.userdata.name==e.open_next[0]){1==e.open_next.length?(o.set_select(!0),o.set_invert(!0),A.ctx.is_visible(o)||A.ctx.scroll(o.y_low,.5),window.focus()):(e.open_next.splice(0,1),"."==e.open_next[0]?(e.open_next.splice(0,1),o.userdata.open_attributes(A,e.open_next)):o.userdata.open_children(A,e.open_next));break}o=A.ctx.a.get_next_sibling(o)}}A.ctx.reset_nodraw(),A.ctx.draw()},this.open_attributes_cb=function(t,e,i,n){A.ctx.set_nodraw();for(var s=0;s<n.length;s++)n[s].objid=e.node.userdata.objid,n[s].full_name=e.node.userdata.full_name+"."+n[s].name,0!=(n[s].flags&Pwr.mAdef_array)?new XttItemAttrArray(A,n[s],e.node,Plow.DEST_INTOLAST):0!=(n[s].flags&Pwr.mAdef_class)?new XttItemAttrObject(A,n[s],e.node,Plow.DEST_INTOLAST):new XttItemAttr(A,n[s],e.node,Plow.DEST_INTOLAST);if(A.ctx.configure(),null!=e.open_next){if(0==e.open_next.length)return void A.ctx.reset_nodraw();for(var o=A.ctx.a.get_first_child(e.node);null!=o;){if(o.userdata.name==e.open_next[0]){1==e.open_next.length?(o.set_select(!0),o.set_invert(!0),A.ctx.is_visible(o)||A.ctx.scroll(o.y_low,.5),window.focus()):(e.open_next.splice(0,1),o.userdata.open_attributes(A,e.open_next));break}o=A.ctx.a.get_next_sibling(o)}}A.ctx.reset_nodraw(),A.ctx.draw()},this.open_plc_cb=function(t,e,i,n){var s;0!=(1&i)?(s=""!==n.param1?"&obj="+n.param1:"",console.log("flow.html?vid="+n.objid.vid+"&oix="+n.objid.oix+s),e.location.href="flow.html?vid="+n.objid.vid+"&oix="+n.objid.oix+s,e.document.title="Trace "+n.fullname):e.document.write("Error status "+i)},this.open_objectgraph_cb=function(t,e,i,n){0!=(1&i)?(e.location.href="ge.html?graph="+n.param1+"&instance="+n.fullname,e.document.title=n.fullname):e.document.write("Error status "+i)},this.open_graph_cb=function(t,e,i,n){if(0!=(1&i)){var s=n.param1.indexOf(".");-1!=s&&(n.param1=n.param1.substring(0,s));var o="";""!==n.fullname&&(o="&instance="+n.fullname),e.location.href="ge.html?graph="+n.param1+o,e.document.title=n.param1}else e.document.write("Error status "+i)},this.open_crr_cb=function(t,e,i,n){0!=(1&i)&&e.userdata.open_crossreferences(A,n)},this.open_helpclass_cb=function(t,e,i,n){if(0!=(1&i)){console.log("open_helpclass",n.param1);var s=location.protocol+"//"+location.host+n.param1;e.location.href=s}else e.document.write("Error status "+i)},this.plow_event=function(t,e,i,n){var s=null;switch(null!=e&&(s=e.get_userdata()),t){case Plow.eEvent_ObjectDeleted:e.userdata instanceof XttItemAttr&&e.userdata.scan_close(A);break;case Plow.eEvent_MB1Click:e.in_icon(i,n)?s.open_children(A,null):e.select?(e.set_select(!1),e.set_invert(!1)):(A.ctx.set_select(!1),e.set_select(!0),A.ctx.set_invert(!1),e.set_invert(!0),A.ctx.draw());break;case Plow.eEvent_MB1ClickShift:e.in_icon(i,n)&&s.open_attributes(A,null);break;case Plow.eEvent_Key_Down:if(null!=(h=A.ctx.get_select()))null!=(o=A.ctx.get_next_object(h))&&(h.set_select(!1),h.set_invert(!1),o.set_select(!0),o.set_invert(!0),A.ctx.is_visible(o)||A.ctx.scroll(o.y_low,.1));else(h=A.ctx.a.a[0]).set_select(!0),h.set_invert(!0);break;case Plow.eEvent_Key_Up:var o;if(null!=(h=A.ctx.get_select()))null!=(o=A.ctx.get_previous_object(h))&&(h.set_select(!1),h.set_invert(!1),o.set_select(!0),o.set_invert(!0),h.draw(A.ctx.gdraw.gctx,null,null,0),o.draw(A.ctx.gdraw.gctx,null,null,0),A.ctx.is_visible(o)||A.ctx.scroll(o.y_low,.9));break;case Plow.eEvent_Key_Right:null!=(h=A.ctx.get_select())&&(s=h.userdata).open_children(A,null);break;case Plow.eEvent_Key_Left:null!=(h=A.ctx.get_select())&&(s=h.userdata).close(A);break;case Plow.eEvent_Key_ShiftRight:null!=(h=A.ctx.get_select())&&(s=h.userdata).open_attributes(A,null);break;case Plow.eEvent_Key_CtrlR:null!=(h=A.ctx.get_select())&&A.ctx.gdh.crrSignal(h.userdata.objid,A.open_crr_cb,h);break;case Plow.eEvent_Key_CtrlL:if((h=A.ctx.get_select()).userdata instanceof XttItemObject){var a=window.open("","_blank");A.ctx.gdh.getObject(h.userdata.objid,GdhOp.GET_OP_METHOD_PLC,A.open_plc_cb,a)}else if(h.userdata instanceof XttItemCrr){var l=h.userdata.name.lastIndexOf("-"),r="";-1!=l&&(r="&obj="+h.userdata.name.substring(l+1)),window.open("flow.html?vid="+h.userdata.objid.vid+"&oix="+h.userdata.objid.oix+r)}break;case Plow.eEvent_Key_CtrlG:var h;if((h=A.ctx.get_select()).userdata instanceof XttItemObject){console.log("CtrlG",h.userdata.objid.vid,h.userdata.objid.oix);a=window.open("","_blank");A.ctx.gdh.getObject(h.userdata.objid,GdhOp.GET_OP_METHOD_OBJECTGRAPH,A.open_objectgraph_cb,a)}}},this.createNodeClasses=function(){var t=new PlowRect(this.ctx,0,0,50,1,Plow.COLOR_WHITE,Plow.COLOR_WHITE,!0,!1),e=new PlowAnnot(this.ctx,3,.9,4,Plow.COLOR_BLACK,Plow.NEXT_RELATIVE_POSITION,0),i=new PlowAnnot(this.ctx,7.5,.9,4,Plow.COLOR_BLACK,Plow.RELATIVE_POSITION,1),n=new PlowAnnot(this.ctx,12,.9,4,Plow.COLOR_BLACK,Plow.RELATIVE_POSITION,2),s=new PlowAnnotPixmap(this.ctx,.4,.2,0);this.ncObject=new PlowNodeClass(this.ctx),this.ncObject.insert(t),this.ncObject.insert(e),this.ncObject.insert(i),this.ncObject.insert(n),this.ncObject.insert(s),this.ctx.insert_nc(this.ncObject)},this.methods_init=function(){localStorage.setItem("XttMethodNavigator","")},this.collapse=function(){this.ctx.set_nodraw();for(var t=0;t<this.ctx.a.size();t++){var e=this.ctx.a.get(t);0==e.level&&e.userdata.close(this)}this.ctx.reset_nodraw(),this.ctx.draw()},this.display_object=function(t){var e,i=t.indexOf("."),n=null;if(-1!=i){n=t.substring(i+1);var s=(t=t.substring(0,i)).split("-"),o=n.split(".");for(e=new Array(s.length+o.length+1),a=0;a<s.length;a++)e[a]=s[a];for(e[s.length]=".",a=0;a<o.length;a++)e[a+s.length+1]=o[a]}else e=t.split("-");this.collapse();for(var a=0;a<this.ctx.a.size();a++)if(this.ctx.a.get(a).userdata.name==e[0]){if(a==this.ctx.a.size()-1){var l=this.ctx.a.get(a);l.set_select(!0),l.set_invert(!0),this.ctx.is_visible(l)||this.ctx.scroll(l.y_low,.5),window.focus()}else e.splice(0,1),this.ctx.a.get(a).userdata.open_children(this,e);break}},this.trace_cyclic=function(){A.ctx.gdh.getRefObjectInfoAll(A.trace_scan)},this.trace_scan=function(t,e){A.scan_update=!1;for(var i=0;i<A.ctx.a.size();i++){var n=A.ctx.a.get(i).userdata;n instanceof XttItemAttr&&n.scan(A)}A.scan_update&&A.ctx.draw(),A.timer=setTimeout(A.trace_cyclic,1e3)},this.openValueInputDialog=function(t,e){if(console.log("priv acc",this.priv,Pwr.mAccess_RtWrite|Pwr.mAccess_System),this.is_authorized(Pwr.mAccess_RtWrite|Pwr.mAccess_System)){var i=prompt(e,"");null!==i&&t.set_value(this,i)}else alert("Not authorized for this operation")}}function XttItemObject(t,e,i,n){this.objid=e.objid,this.cid=e.cid,this.name=e.name,this.full_name=e.full_name,this.has_children=e.has_children,this.node=new PlowNode(t.ctx,t.ncObject,0),this.node.set_userdata(this),this.node.set_annotation(0,e.name),this.node.set_annotation(1,e.classname),this.node.set_annotation(2,e.description),this.node.set_annotation_pixmap(0,Bitmaps.map),t.ctx.insertNode(this.node,i,n),e.has_children?this.node.set_annotation_pixmap(0,Bitmaps.map):this.node.set_annotation_pixmap(0,Bitmaps.leaf),this.open_children=function(t,e){0!=this.node.node_open?this.close(t):this.has_children?(t.ctx.gdh.getAllXttChildren(this.objid,t.open_children_cb,new XttOpenChildrenData(this.node,e)),this.node.node_open|=Plow.OPEN_CHILDREN,this.node.set_annotation_pixmap(0,Bitmaps.openmap)):this.open_attributes(t,null)},this.open_attributes=function(t,e){0!=this.node.node_open?this.close(t):(t.ctx.gdh.getAllClassAttributes(this.cid,this.objid,t.open_attributes_cb,new XttOpenChildrenData(this.node,e)),this.node.node_open|=Plow.OPEN_ATTRIBUTES,t.ctx.configure(),t.ctx.draw())},this.open_crossreferences=function(t,e){if(0!=this.node.node_open)this.close(t);else{for(var i=0;i<e.length;i++)new XttItemCrr(t,e[i],this.node,Plow.DEST_INTOLAST);this.node.node_open|=Plow.OPEN_CROSSREFERENCES,t.ctx.configure(),t.ctx.draw()}},this.close=function(t){if(this.node.node_open&Plow.OPEN_CHILDREN)t.ctx.close_node(this.node),this.node.node_open&=~Plow.OPEN_CHILDREN,this.node.set_annotation_pixmap(0,Bitmaps.map),t.ctx.configure(),t.ctx.draw();else if(this.node.node_open&Plow.OPEN_ATTRIBUTES)t.ctx.close_node(this.node),this.node.node_open&=~Plow.OPEN_ATTRIBUTES,t.ctx.configure(),t.ctx.draw();else if(this.node.node_open&Plow.OPEN_CROSSREFERENCES)t.ctx.close_node(this.node),this.node.node_open&=~Plow.OPEN_CROSSREFERENCES,t.ctx.configure(),t.ctx.draw();else{var e=t.ctx.get_parent_object(this.node);null!=e&&(e.userdata.close(t),e.set_select(!0),e.set_invert(!0))}}}function XttItemAttr(t,e,i,n){this.name=e.name,this.objid=e.objid,this.full_name=e.full_name,this.type=e.type,this.flags=e.flags,this.size=e.size,this.refid,this.firstScan=!0,this.old_value,this.node=new PlowNode(t.ctx,t.ncObject,0),this.node.set_userdata(this),this.node.set_annotation(0,this.name),this.node.set_annotation_pixmap(0,Bitmaps.attr),t.ctx.insertNode(this.node,i,n),this.refid=t.ctx.gdh.refObjectInfo(this.full_name,e.type,1),this.open_children=function(t,e){t.openValueInputDialog(this,"Enter value")},this.set_value=function(t,e){switch(this.type){case Pwr.eType_Float32:var i=parseFloat(e.trim());t.ctx.gdh.setObjectInfoFloat(this.full_name,i);break;case Pwr.eType_Int8:case Pwr.eType_Int16:case Pwr.eType_Int32:case Pwr.eType_UInt8:case Pwr.eType_UInt16:case Pwr.eType_UInt32:case Pwr.eType_Status:case Pwr.eType_Mask:case Pwr.eType_Enum:case Pwr.eType_Boolean:i=parseInt(e.trim(),10);t.ctx.gdh.setObjectInfoInt(this.full_name,i);break;case Pwr.eType_String:case Pwr.eType_Time:case Pwr.eType_DeltaTime:case Pwr.eType_AttrRef:case Pwr.eType_Objid:t.ctx.gdh.setObjectInfoString(this.full_name,e)}},this.open_attributes=function(t,e){},this.close=function(t){var e=t.ctx.get_parent_object(this.node);null!=e&&(e.userdata.close(t),e.set_select(!0),e.set_invert(!0))},this.scan=function(t){if(this.refid){var e=t.ctx.gdh.getObjectRefInfo(this.refid);if(this.firstScan||e!=this.old_value){var i;switch(this.type){case Pwr.eType_Float32:i=""+e;break;case Pwr.eType_Boolean:i=e?"1":"0";break;case Pwr.eType_Int32:case Pwr.eType_Int16:case Pwr.eType_Int8:case Pwr.eType_UInt32:case Pwr.eType_UInt16:case Pwr.eType_UInt8:i=""+e;break;case Pwr.eType_String:case Pwr.eType_AttrRef:case Pwr.eType_Objid:i=e;break;default:i=""+e}this.old_value=e,this.node.set_annotation(1,i),t.scan_update=!0}this.firstScan=!1}},this.scan_close=function(t){t.ctx.gdh.unrefObjectInfo(this.refid)}}function XttItemAttrArray(t,e,i,n){this.name=e.name,this.objid=e.objid,this.full_name=e.full_name,this.type=e.type,this.flags=e.flags,this.size=e.size,this.elements=e.elements,this.node=new PlowNode(t.ctx,t.ncObject,0),this.node.set_userdata(this),this.node.set_annotation(0,this.name),this.node.set_annotation_pixmap(0,Bitmaps.attrarra),t.ctx.insertNode(this.node,i,n),this.open_children=function(t,e){this.open_attributes(t,e)},this.open_attributes=function(t,e){var i=new AttributeInfo;i.objid=this.objid,i.type=this.type,i.flags=this.flags&~Pwr.mAdef_array,i.size=this.size/this.elements,i.elements=1,i.name="",i.full_name="",i.classname="",t.ctx.set_nodraw();for(var n=0;n<this.elements;n++)i.name=this.name+"["+n+"]",i.full_name=this.full_name+"["+n+"]",0!=(i.flags&Pwr.mAdef_array)?new XttItemAttrArray(t,i,this.node,Plow.DEST_INTOLAST):0!=(i.flags&Pwr.mAdef_class)?new XttItemAttrObject(t,i,this.node,Plow.DEST_INTOLAST):new XttItemAttr(t,i,this.node,Plow.DEST_INTOLAST);this.node.node_open|=Plow.OPEN_ATTRIBUTES,t.ctx.configure(),t.ctx.reset_nodraw(),t.ctx.draw()},this.close=function(t){if(this.node.node_open&Plow.OPEN_ATTRIBUTES)t.ctx.close_node(this.node),this.node.node_open&=~Plow.OPEN_ATTRIBUTES,t.ctx.configure(),t.ctx.draw();else{var e=t.ctx.get_parent_object(this.node);null!=e&&(e.userdata.close(t),e.set_select(!0),e.set_invert(!0))}}}function XttItemAttrObject(t,e,i,n){this.name=e.name,this.classname=e.classname,this.objid=e.objid,this.full_name=e.full_name,this.cid=e.type,this.flags=e.flags,this.size=e.size,this.node=new PlowNode(t.ctx,t.ncObject,0),this.node.set_userdata(this),this.node.set_annotation(0,this.name),this.node.set_annotation(1,this.classname),this.node.set_annotation_pixmap(0,Bitmaps.object),t.ctx.insertNode(this.node,i,n),this.open_children=function(t,e){this.open_attributes(t,null)},this.open_attributes=function(t,e){0!=this.node.node_open?this.close(t):(t.ctx.gdh.getAllClassAttributes(this.cid,this.objid,t.open_attributes_cb,new XttOpenChildrenData(this.node,e)),this.node.node_open|=Plow.OPEN_ATTRIBUTES)},this.close=function(t){if(this.node.node_open&Plow.OPEN_ATTRIBUTES)t.ctx.close_node(this.node),this.node.node_open&=~Plow.OPEN_ATTRIBUTES,t.ctx.configure(),t.ctx.draw();else if(this.node.node_open&Plow.OPEN_CROSSREFERENCES)t.ctx.close_node(this.node),this.node.node_open&=~Plow.OPEN_CROSSREFERENCES,t.ctx.configure(),t.ctx.draw();else{var e=t.ctx.get_parent_object(this.node);null!=e&&(e.userdata.close(t),e.set_select(!0),e.set_invert(!0))}}}function XttItemCrr(t,e,i,n){switch(this.name=e.name,this.classname=e.classname,this.objid=e.objid,this.type=e.type,this.node=new PlowNode(t.ctx,t.ncObject,0),this.node.set_userdata(this),this.node.set_annotation(0,this.name),this.node.set_annotation(1,this.classname),this.type){case 0:this.node.set_annotation_pixmap(0,Bitmaps.crrread);break;case 1:case 2:this.node.set_annotation_pixmap(0,Bitmaps.crrwrite)}t.ctx.insertNode(this.node,i,n),this.close=function(t){var e=t.ctx.get_parent_object(this.node);null!=e&&(e.userdata.close(t),e.set_select(!0),e.set_invert(!0))}}var xtt=new Xtt;xtt.init();
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment