@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 21.4 kB
JavaScript
function mxShapePidValve(e,t,a,l){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=a,this.strokewidth=null!=l?l:1}function mxShapePidIntBlockBleedValve(e,t,a,l){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=a,this.strokewidth=null!=l?l:1}function mxShapePidAutoRecircValve(e,t,a,l){mxShape.call(this),this.bounds=e,this.fill=t,this.stroke=a,this.strokewidth=null!=l?l:1}mxUtils.extend(mxShapePidValve,mxShape),mxShapePidValve.prototype.cst={SHAPE_VALVE:"mxgraph.pid2valves.valve",DEFAULT_STATE:"defState",CLOSED:"closed",OPEN:"open",ACTUATOR:"actuator",MANUAL:"man",DIAPHRAGM:"diaph",BALANCED_DIAPHRAGM:"balDiaph",MOTOR:"motor",NONE:"none",SPRING:"spring",PILOT:"pilot",POWERED:"powered",SOLENOID:"solenoid",SOLENOID_MANUAL_RESET:"solenoidManRes",SINGLE_ACTING:"singActing",DOUBLE_ACTING:"dblActing",PILOT_CYLINDER:"pilotCyl",DIGITAL:"digital",WEIGHT:"weight",KEY:"key",ELECTRO_HYDRAULIC:"elHyd",VALVE_TYPE:"valveType",BUTTERFLY:"butterfly",CHECK:"check",GATE:"gate",GLOBE:"globe",NEEDLE:"needle",PLUG:"plug",SELF_DRAINING:"selfDrain",ANGLE:"angle",ANGLE_GLOBE:"angleGlobe",THREE_WAY:"threeWay",ANGLE_BLOWDOWN:"angBlow",BALL:"ball"},mxShapePidValve.prototype.customProperties=[{name:"defState",dispName:"Default State",type:"enum",defVal:"open",enumList:[{val:"closed",dispName:"Closed"},{val:"open",dispName:"Open"}]},{name:"actuator",dispName:"Actuator",type:"enum",defVal:"man",enumList:[{val:"man",dispName:"Manual"},{val:"diaph",dispName:"Diphragm"},{val:"balDiaph",dispName:"Balanced Diaphragm"},{val:"motor",dispName:"Motor"},{val:"none",dispName:"None"},{val:"spring",dispName:"Spring"},{val:"pilot",dispName:"Pilot"},{val:"powered",dispName:"Powered"},{val:"solenoid",dispName:"Solenoid"},{val:"solenoidManRes",dispName:"Solenoid w/ Manual Reset"},{val:"singActing",dispName:"Single Acting"},{val:"dblActing",dispName:"Double Acting"},{val:"pilotCyl",dispName:"Pilot Cylinder"},{val:"digital",dispName:"Digital"},{val:"weight",dispName:"Weight"},{val:"key",dispName:"Key"},{val:"elHyd",dispName:"Electro-Hidraulic"}]},{name:"valveType",dispName:"Type",type:"enum",defVal:"gate",enumList:[{val:"butterfly",dispName:"Butterfly"},{val:"check",dispName:"check"},{val:"gate",dispName:"Gate"},{val:"globe",dispName:"Globe"},{val:"needle",dispName:"Needle"},{val:"plug",dispName:"Plug"},{val:"selfDrain",dispName:"Self Draining"},{val:"angle",dispName:"Angle"},{val:"angleGlobe",dispName:"Angle Globe"},{val:"threeWay",dispName:"Three Way"},{val:"ball",dispName:"Ball"}]}],mxShapePidValve.prototype.paintVertexShape=function(e,t,a,l,o){var i=mxUtils.getValue(this.style,mxShapePidValve.prototype.cst.VALVE_TYPE,"gate"),n=mxUtils.getValue(this.style,mxShapePidValve.prototype.cst.ACTUATOR,mxShapePidValve.prototype.cst.NONE),s=0;"none"!==n&&(s=this.isAngleVariant(i)?.3333*o:.4*o),e.translate(t,a),e.setLineJoin("round"),this.background(e,t,a,l,o,i,n,s),e.setShadow(!1),this.foreground(e,t,a,l,o,i,n,s)},mxShapePidValve.prototype.background=function(e,t,a,l,o,i,n,s){n!==mxShapePidValve.prototype.cst.NONE&&(this.isAngleVariant(i)?this.drawActuatorBg(e,t,a,l,o/1.2,n,s):this.drawActuatorBg(e,t,a,l,o,n,s)),this.isGateVariant(i)?this.drawGateVariantBg(e,0,0,l,o,i,n,s):this.isAngleVariant(i)?this.drawAngleVariantBg(e,0,0,l,o,i,n,s):i===mxShapePidValve.prototype.cst.BUTTERFLY?this.drawButterflyValve(e,0,0,l,o,n,s):i===mxShapePidValve.prototype.cst.CHECK&&this.drawCheckValve(e,0,0,l,o,n,s)},mxShapePidValve.prototype.foreground=function(e,t,a,l,o,i,n,s){i=mxUtils.getValue(this.style,mxShapePidValve.prototype.cst.VALVE_TYPE,"gate"),n!==mxShapePidValve.prototype.cst.NONE&&(this.isAngleVariant(i)?this.drawActuatorFg(e,t,a,l,o/1.2,n,s):this.drawActuatorFg(e,t,a,l,o,n,s)),this.isGateVariant(i)&&this.drawGateVariantFg(e,0,0,l,o,i,n,s),this.isAngleVariant(i)&&this.drawAngleVariantFg(e,0,0,l,o,i,n,s)},mxShapePidValve.prototype.drawActuatorBg=function(e,t,a,l,o,i){this.isSquareVariant(i)?(e.translate(.325*l,0),this.drawSquareAct(e,.35*l,.7*o,i),e.translate(.325*-l,0)):i===mxShapePidValve.prototype.cst.MANUAL?(e.translate(.25*l,.15*o),this.drawManAct(e,.5*l,.55*o),e.translate(.25*-l,.15*-o)):i===mxShapePidValve.prototype.cst.DIAPHRAGM?(e.translate(.25*l,.1*o),this.drawDiaphAct(e,.5*l,.6*o),e.translate(.25*-l,.1*-o)):i===mxShapePidValve.prototype.cst.BALANCED_DIAPHRAGM?(e.translate(.25*l,.1*o),this.drawBalDiaphActBg(e,.5*l,.6*o),e.translate(.25*-l,.1*-o)):i===mxShapePidValve.prototype.cst.MOTOR||i===mxShapePidValve.prototype.cst.ELECTRO_HYDRAULIC?(e.translate(.325*l,0),this.drawCircleAct(e,.35*l,.7*o,i),e.translate(.325*-l,0)):i===mxShapePidValve.prototype.cst.SPRING?(e.translate(.36*l,0),this.drawSpringAct(e,.28*l,.7*o),e.translate(.36*-l,0)):i===mxShapePidValve.prototype.cst.SOLENOID_MANUAL_RESET?(e.translate(.325*l,0),this.drawSolenoidManResetAct(e,.575*l,.7*o),e.translate(.325*-l,0)):i===mxShapePidValve.prototype.cst.SINGLE_ACTING?(e.translate(.35*l,0),this.drawSingActingActBg(e,.65*l,.7*o),e.translate(.35*-l,0)):i===mxShapePidValve.prototype.cst.DOUBLE_ACTING?(e.translate(.35*l,0),this.drawDblActingActBg(e,.65*l,.7*o),e.translate(.35*-l,0)):i===mxShapePidValve.prototype.cst.PILOT_CYLINDER?(e.translate(.35*l,0),this.drawPilotCylinderActBg(e,.65*l,.7*o),e.translate(.35*-l,0)):i===mxShapePidValve.prototype.cst.ANGLE_BLOWDOWN&&(e.translate(.5*l,.2*o),this.drawAngleBlowdownAct(e,.4*l,.5*o),e.translate(.5*-l,.2*-o))},mxShapePidValve.prototype.drawActuatorFg=function(e,t,a,l,o,i){i===mxShapePidValve.prototype.cst.BALANCED_DIAPHRAGM?(e.translate(.25*l,.1*o),this.drawBalDiaphActFg(e,.5*l,.6*o),e.translate(.25*-l,.1*-o)):i!==mxShapePidValve.prototype.cst.SINGLE_ACTING&&i!==mxShapePidValve.prototype.cst.DOUBLE_ACTING&&i!==mxShapePidValve.prototype.cst.PILOT_CYLINDER||(e.translate(.35*l,0),this.drawActingActFg(e,.65*l,.7*o),e.translate(.35*-l,0))},mxShapePidValve.prototype.drawManAct=function(e,t,a){e.begin(),e.moveTo(0,0),e.lineTo(t,0),e.moveTo(.5*t,0),e.lineTo(.5*t,a),e.stroke()},mxShapePidValve.prototype.drawDiaphAct=function(e,t,a){e.begin(),e.moveTo(.5*t,.2*a),e.lineTo(.5*t,a),e.stroke(),e.begin(),e.moveTo(0,.2*a),e.arcTo(.6*t,.4*a,0,0,1,t,.2*a),e.close(),e.fillAndStroke()},mxShapePidValve.prototype.drawBalDiaphActBg=function(e,t,a){e.ellipse(0,0,t,.3*a),e.fillAndStroke(),e.begin(),e.moveTo(.5*t,.3*a),e.lineTo(.5*t,a),e.stroke()},mxShapePidValve.prototype.drawBalDiaphActFg=function(e,t,a){e.begin(),e.moveTo(0,.15*a),e.lineTo(t,.15*a),e.stroke()},mxShapePidValve.prototype.drawCircleAct=function(e,t,a,l){e.ellipse(0,0,t,.5*a),e.fillAndStroke(),e.begin(),e.moveTo(.5*t,.5*a),e.lineTo(.5*t,a),e.stroke();var o="";l===mxShapePidValve.prototype.cst.MOTOR?o="M":l===mxShapePidValve.prototype.cst.ELECTRO_HYDRAULIC&&(o="E/H"),e.setFontStyle(1),e.setFontFamily("Helvetica"),e.setFontSize(.4*Math.min(t,a)),e.text(.5*t,.25*a,0,0,o,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxShapePidValve.prototype.drawSpringAct=function(e,t,a){e.begin(),e.moveTo(.5*t,0),e.lineTo(.5*t,a),e.moveTo(.32*t,.16*a),e.lineTo(.68*t,.08*a),e.moveTo(.21*t,.32*a),e.lineTo(.79*t,.2*a),e.moveTo(.1*t,.52*a),e.lineTo(.9*t,.36*a),e.moveTo(0,.72*a),e.lineTo(t,.5*a),e.stroke()},mxShapePidValve.prototype.drawSolenoidManResetAct=function(e,t,a){e.rect(0,0,.61*t,.46*a),e.fillAndStroke(),e.begin(),e.moveTo(.56*t,.6*a),e.lineTo(.78*t,.5*a),e.lineTo(t,.6*a),e.lineTo(.78*t,.7*a),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(.305*t,.46*a),e.lineTo(.305*t,a),e.moveTo(.305*t,.6*a),e.lineTo(.56*t,.6*a),e.stroke(),e.setFontStyle(1),e.setFontFamily("Helvetica"),e.setFontSize(.4*Math.min(t,a)),e.text(.305*t,.23*a,0,0,"S",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),e.setFontStyle(0),e.setFontSize(.15*Math.min(t,a)),e.text(.78*t,.6*a,0,0,"R",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxShapePidValve.prototype.drawSingActingActBg=function(e,t,a){e.rect(0,0,.46*t,.46*a),e.fillAndStroke(),e.begin(),e.moveTo(.23*t,.46*a),e.lineTo(.23*t,a),e.moveTo(.46*t,.23*a),e.lineTo(t,.23*a),e.moveTo(.77*t,.15*a),e.lineTo(.69*t,.31*a),e.moveTo(.82*t,.15*a),e.lineTo(.74*t,.31*a),e.stroke()},mxShapePidValve.prototype.drawActingActFg=function(e,t,a){e.begin(),e.moveTo(.23*t,.23*a),e.lineTo(.23*t,.46*a),e.moveTo(0,.23*a),e.lineTo(.46*t,.23*a),e.stroke()},mxShapePidValve.prototype.drawDblActingActBg=function(e,t,a){e.rect(0,0,.46*t,.46*a),e.fillAndStroke(),e.begin(),e.moveTo(.23*t,.46*a),e.lineTo(.23*t,a),e.moveTo(.46*t,.115*a),e.lineTo(t,.115*a),e.moveTo(.77*t,.035*a),e.lineTo(.69*t,.195*a),e.moveTo(.82*t,.035*a),e.lineTo(.74*t,.195*a),e.moveTo(.46*t,.345*a),e.lineTo(t,.345*a),e.moveTo(.77*t,.265*a),e.lineTo(.69*t,.425*a),e.moveTo(.82*t,.265*a),e.lineTo(.74*t,.425*a),e.stroke()},mxShapePidValve.prototype.drawPilotCylinderActBg=function(e,t,a){e.rect(0,0,.46*t,.46*a),e.fillAndStroke(),e.begin(),e.moveTo(.23*t,.46*a),e.lineTo(.23*t,a),e.moveTo(.46*t,.23*a),e.lineTo(.77*t,.23*a),e.stroke(),e.rect(.77*t,.115*a,.23*t,.23*a),e.fillAndStroke(),e.setFontStyle(0),e.setFontFamily("Helvetica"),e.setFontSize(.15*Math.min(t,a)),e.text(.885*t,.23*a,0,0,"P",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxShapePidValve.prototype.drawAngleBlowdownAct=function(e,t,a){e.begin(),e.moveTo(.34*t,0),e.lineTo(t,.405*a),e.moveTo(0,a),e.lineTo(.665*t,.205*a),e.stroke()},mxShapePidValve.prototype.drawSquareAct=function(e,t,a,l){e.rect(0,0,t,.5*a),e.fillAndStroke(),e.begin(),e.moveTo(.5*t,.5*a),e.lineTo(.5*t,a),e.stroke();var o="";l===mxShapePidValve.prototype.cst.PILOT?o="P":l===mxShapePidValve.prototype.cst.SOLENOID?o="S":l===mxShapePidValve.prototype.cst.DIGITAL?o="D":l===mxShapePidValve.prototype.cst.WEIGHT?o="W":l===mxShapePidValve.prototype.cst.KEY&&(o="K"),e.setFontStyle(1),e.setFontFamily("Helvetica"),e.setFontSize(.4*Math.min(t,a)),e.text(.5*t,.25*a,0,0,o,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxShapePidValve.prototype.drawGateVariantFg=function(e,t,a,l,o,i,n,s){mxUtils.getValue(this.style,mxShapePidValve.prototype.cst.DEFAULT_STATE,"open");var r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),p=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");i===mxShapePidValve.prototype.cst.BALL?(e.ellipse(t+.3*l,a+s+.18*(o-s),.4*l,.64*(o-s)),e.fillAndStroke()):i===mxShapePidValve.prototype.cst.GLOBE?(e.ellipse(t+.3*l,a+s+.18*(o-s),.4*l,.64*(o-s)),e.setFillColor(p),e.fillAndStroke(),e.setFillColor(r)):i===mxShapePidValve.prototype.cst.PLUG?this.drawPlug(e,t+.4*l,a+s+.25*(o-s),.2*l,.5*(o-s)):i===mxShapePidValve.prototype.cst.NEEDLE?this.drawNeedle(e,t+.45*l,a+s+.1*(o-s),.1*l,.9*(o-s)):i===mxShapePidValve.prototype.cst.SELF_DRAINING&&this.drawDrain(e,t+.48*l,a+s+.5*(o-s),.04*l,.49*(o-s))},mxShapePidValve.prototype.drawAngleVariantFg=function(e,t,a,l,o,i,n,s){mxUtils.getValue(this.style,mxShapePidValve.prototype.cst.DEFAULT_STATE,"open");var r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),p=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");i===mxShapePidValve.prototype.cst.ANGLE_GLOBE&&("none"===n?e.ellipse(.34*l,.175*o,.32*l,.4*o):e.ellipse(.34*l,.45*o,.32*l,.2667*o),e.setFillColor(p),e.fillAndStroke(),e.setFillColor(r))},mxShapePidValve.prototype.drawGateVariantBg=function(e,t,a,l,o,i,n,s){i===mxShapePidValve.prototype.cst.GATE?this.drawGateValve(e,t,a+s,l,o-s):i===mxShapePidValve.prototype.cst.BALL||i===mxShapePidValve.prototype.cst.GLOBE?(e.ellipse(t+.3*l,a+s+.18*(o-s),.4*l,.64*(o-s)),e.fillAndStroke(),this.drawGateValve(e,t,a+s,l,o-s)):i===mxShapePidValve.prototype.cst.PLUG?(this.drawPlug(e,t+.4*l,a+s+.25*(o-s),.2*l,.5*(o-s)),this.drawGateValve(e,t,a+s,l,o-s)):i===mxShapePidValve.prototype.cst.NEEDLE?(this.drawNeedle(e,t+.45*l,a+s+.1*(o-s),.1*l,.9*(o-s)),this.drawGateValve(e,t,a+s,l,o-s)):i===mxShapePidValve.prototype.cst.SELF_DRAINING&&(this.drawDrain(e,t+.48*l,a+s+.5*(o-s),.04*l,.49*(o-s)),this.drawGateValve(e,t,a+s,l,o-s))},mxShapePidValve.prototype.drawAngleVariantBg=function(e,t,a,l,o,i,n,s){i===mxShapePidValve.prototype.cst.ANGLE?this.drawAngleValve(e,.2*l,a+s,.8*l,o-s):i===mxShapePidValve.prototype.cst.ANGLE_GLOBE?this.drawAngleGlobeValveBg(e,.2*l,a+s,.8*l,o-s):i===mxShapePidValve.prototype.cst.THREE_WAY?this.drawThreeWayValve(e,0,a+s,l,o-s):i===mxShapePidValve.prototype.cst.ANGLE_BLOWDOWN&&this.drawAngleBlowdownValve(e,t,a+s,l,o-s)},mxShapePidValve.prototype.drawPlug=function(e,t,a,l,o){e.translate(t,a),e.begin(),e.moveTo(0,.5*o),e.lineTo(.5*l,0),e.lineTo(l,.5*o),e.lineTo(.5*l,o),e.close(),e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawNeedle=function(e,t,a,l,o){var i=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),n=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");e.translate(t,a),e.begin(),e.moveTo(0,0),e.lineTo(l,0),e.lineTo(.5*l,o),e.close(),e.setFillColor(n),e.fillAndStroke(),e.setFillColor(i),e.translate(-t,-a)},mxShapePidValve.prototype.drawDrain=function(e,t,a,l,o){var i=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),n=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");e.translate(t,a),e.begin(),e.moveTo(.5*l,0),e.lineTo(.5*l,.96*o),e.stroke(),e.begin(),e.moveTo(0,.9*o),e.lineTo(l,.9*o),e.lineTo(.5*l,o),e.close(),e.setFillColor(n),e.fillAndStroke(),e.setFillColor(i),e.translate(-t,-a)},mxShapePidValve.prototype.drawGateValve=function(e,t,a,l,o){var i=mxUtils.getValue(this.style,mxShapePidValve.prototype.cst.DEFAULT_STATE,"open"),n=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),s=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");e.translate(t,a),e.begin(),e.moveTo(0,0),e.lineTo(.5*l,.5*o),e.lineTo(0,o),e.close(),e.moveTo(l,0),e.lineTo(.5*l,.5*o),e.lineTo(l,o),e.close(),i===mxShapePidValve.prototype.cst.CLOSED?(e.setFillColor(s),e.fillAndStroke(),e.setFillColor(n)):e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawAngleValve=function(e,t,a,l,o){e.translate(t,a),e.begin(),e.moveTo(.375*l,.375*o),e.lineTo(l,0),e.lineTo(l,.75*o),e.close(),e.moveTo(.375*l,.375*o),e.lineTo(.75*l,o),e.lineTo(0,o),e.close(),e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawAngleGlobeValveBg=function(e,t,a,l,o){e.translate(t,a),e.ellipse(.175*l,.175*o,.4*l,.4*o),e.fillAndStroke(),e.begin(),e.moveTo(.375*l,.375*o),e.lineTo(l,0),e.lineTo(l,.75*o),e.close(),e.moveTo(.375*l,.375*o),e.lineTo(.75*l,o),e.lineTo(0,o),e.close(),e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawAngleGlobeValveFg=function(e,t,a,l,o){e.translate(t,a),e.ellipse(.275*l,.275*o,.2*l,.2*o),e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawThreeWayValve=function(e,t,a,l,o){e.translate(t,a),e.begin(),e.moveTo(0,0),e.lineTo(.5*l,.375*o),e.lineTo(0,.75*o),e.close(),e.moveTo(l,0),e.lineTo(.5*l,.375*o),e.lineTo(l,.75*o),e.close(),e.moveTo(.5*l,.375*o),e.lineTo(.8*l,o),e.lineTo(.2*l,o),e.close(),e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawAngleBlowdownValve=function(e,t,a,l,o){},mxShapePidValve.prototype.drawButterflyValve=function(e,t,a,l,o,i,n){mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");var s=a+n,r=o-n;e.translate(t,s),e.begin(),e.moveTo(0,0),e.lineTo(0,r),e.moveTo(l,0),e.lineTo(l,r),e.moveTo(.05*l,.05*r),e.lineTo(.95*l,.95*r),e.fillAndStroke(),e.ellipse(.4*l,.33*r,.2*l,.33*r),e.fillAndStroke(),e.translate(-t,-a)},mxShapePidValve.prototype.drawCheckValve=function(e,t,a,l,o,i,n){var s=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),r=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000"),p=a+n,d=o-n;e.translate(t,p),e.begin(),e.moveTo(0,0),e.lineTo(0,d),e.moveTo(l,0),e.lineTo(l,d),e.moveTo(.05*l,.05*d),e.lineTo(.95*l,.95*d),e.fillAndStroke(),e.begin(),e.moveTo(.8925*l,.815*d),e.lineTo(.957*l,.955*d),e.lineTo(.85*l,.928*d),e.close(),e.setFillColor(r),e.fillAndStroke(),e.setFillColor(s),e.translate(-t,-a)},mxShapePidValve.prototype.isGateVariant=function(e){return e===mxShapePidValve.prototype.cst.GATE||e===mxShapePidValve.prototype.cst.BALL||e===mxShapePidValve.prototype.cst.PLUG||e===mxShapePidValve.prototype.cst.NEEDLE||e===mxShapePidValve.prototype.cst.SELF_DRAINING||e===mxShapePidValve.prototype.cst.GLOBE},mxShapePidValve.prototype.isAngleVariant=function(e){return e===mxShapePidValve.prototype.cst.ANGLE||e===mxShapePidValve.prototype.cst.ANGLE_GLOBE||e===mxShapePidValve.prototype.cst.THREE_WAY||e===mxShapePidValve.prototype.cst.ANGLE_BLOWDOWN},mxShapePidValve.prototype.isSquareVariant=function(e){return e===mxShapePidValve.prototype.cst.PILOT||e===mxShapePidValve.prototype.cst.SOLENOID||e===mxShapePidValve.prototype.cst.POWERED||e===mxShapePidValve.prototype.cst.DIGITAL||e===mxShapePidValve.prototype.cst.WEIGHT||e===mxShapePidValve.prototype.cst.KEY},mxCellRenderer.registerShape(mxShapePidValve.prototype.cst.SHAPE_VALVE,mxShapePidValve),mxUtils.extend(mxShapePidIntBlockBleedValve,mxShapePidValve),mxShapePidIntBlockBleedValve.prototype.paintVertexShape=function(e,t,a,l,o){var i=mxUtils.getValue(this.style,mxShapePidIntBlockBleedValve.prototype.cst.ACTUATOR,mxShapePidIntBlockBleedValve.prototype.cst.NONE),n=0;"none"!==i&&(n=.2353*o),e.translate(t,a),e.setLineJoin("round"),this.background(e,t,a,l,o,i,n),e.setShadow(!1),this.foreground(e,t,a,l,o,i,n)},mxShapePidIntBlockBleedValve.prototype.background=function(e,t,a,l,o,i,n){i!==mxShapePidIntBlockBleedValve.prototype.cst.NONE&&this.drawActuatorBg(e,t,a,l,o,i),this.drawValveBg(e,0,n,l,o-n)},mxShapePidIntBlockBleedValve.prototype.foreground=function(e,t,a,l,o,i,n){i!==mxShapePidIntBlockBleedValve.prototype.cst.NONE&&this.drawActuatorFg(e,t,a,l,o,i)},mxShapePidIntBlockBleedValve.prototype.drawValveBg=function(e,t,a,l,o){var i=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),n=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");e.translate(t,a),e.begin(),e.moveTo(0,0),e.lineTo(.5*l,.23*o),e.lineTo(0,.46*o),e.close(),e.moveTo(.5*l,.23*o),e.lineTo(l,0),e.lineTo(l,.46*o),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(.5*l,.23*o),e.lineTo(.5*l,.5*o),e.stroke(),e.setFillColor(n),e.begin(),e.moveTo(.3*l,.5*o),e.lineTo(.7*l,.5*o),e.lineTo(.5*l,.75*o),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(.3*l,o),e.lineTo(.5*l,.75*o),e.lineTo(.7*l,o),e.fillAndStroke(),e.setFillColor(i),e.translate(-t,-a)},mxShapePidIntBlockBleedValve.prototype.drawActuatorBg=function(e,t,a,l,o,i){this.isSquareVariant(i)?(e.translate(.325*l,0),this.drawSquareAct(e,.35*l,.4112*o,i),e.translate(.325*-l,0)):i===mxShapePidIntBlockBleedValve.prototype.cst.MANUAL?(e.translate(.25*l,.0882*o),this.drawManAct(e,.5*l,.323*o),e.translate(.25*-l,.0882*-o)):i===mxShapePidIntBlockBleedValve.prototype.cst.DIAPHRAGM?(e.translate(.25*l,.0588*o),this.drawDiaphAct(e,.5*l,.3524*o),e.translate(.25*-l,.0588*-o)):i===mxShapePidIntBlockBleedValve.prototype.cst.BALANCED_DIAPHRAGM?(e.translate(.25*l,.0588*o),this.drawBalDiaphActBg(e,.5*l,.3524*o),e.translate(.25*-l,.0588*-o)):i===mxShapePidIntBlockBleedValve.prototype.cst.MOTOR||i===mxShapePidIntBlockBleedValve.prototype.cst.ELECTRO_HYDRAULIC?(e.translate(.325*l,0),this.drawCircleAct(e,.35*l,.4112*o,i),e.translate(.325*-l,0)):i===mxShapePidIntBlockBleedValve.prototype.cst.SPRING?(e.translate(.36*l,0),this.drawSpringAct(e,.28*l,.4112*o),e.translate(.36*-l,0)):i===mxShapePidIntBlockBleedValve.prototype.cst.SOLENOID_MANUAL_RESET?(e.translate(.325*l,0),this.drawSolenoidManResetAct(e,.575*l,.4112*o),e.translate(.325*-l,0)):i===mxShapePidIntBlockBleedValve.prototype.cst.SINGLE_ACTING?(e.translate(.35*l,0),this.drawSingActingActBg(e,.65*l,.4112*o),e.translate(.35*-l,0)):i===mxShapePidIntBlockBleedValve.prototype.cst.DOUBLE_ACTING?(e.translate(.35*l,0),this.drawDblActingActBg(e,.65*l,.4112*o),e.translate(.35*-l,0)):i===mxShapePidIntBlockBleedValve.prototype.cst.PILOT_CYLINDER&&(e.translate(.35*l,0),this.drawPilotCylinderActBg(e,.65*l,.4112*o),e.translate(.35*-l,0))},mxShapePidIntBlockBleedValve.prototype.drawActuatorFg=function(e,t,a,l,o,i){i===mxShapePidIntBlockBleedValve.prototype.cst.BALANCED_DIAPHRAGM?(e.translate(.25*l,.0588*o),this.drawBalDiaphActFg(e,.5*l,.3524*o),e.translate(.25*-l,.0588*-o)):i!==mxShapePidIntBlockBleedValve.prototype.cst.SINGLE_ACTING&&i!==mxShapePidIntBlockBleedValve.prototype.cst.DOUBLE_ACTING&&i!==mxShapePidIntBlockBleedValve.prototype.cst.PILOT_CYLINDER||(e.translate(.35*l,0),this.drawActingActFg(e,.65*l,.4112*o),e.translate(.35*-l,0))},mxCellRenderer.registerShape("mxgraph.pid2valves.blockBleedValve",mxShapePidIntBlockBleedValve),mxUtils.extend(mxShapePidAutoRecircValve,mxShape),mxShapePidAutoRecircValve.prototype.paintVertexShape=function(e,t,a,l,o){e.setLineJoin("round"),e.translate(t,a),e.rect(0,0,l,o),e.fillAndStroke(),e.setShadow(!1),e.begin(),e.moveTo(.08*l,.08*o),e.lineTo(.08*l,.92*o),e.moveTo(.92*l,.08*o),e.lineTo(.92*l,.92*o),e.moveTo(.12*l,.122*o),e.lineTo(.8738*l,.8837*o),e.moveTo(.5*l,0),e.lineTo(.55*l,.05*o),e.lineTo(.45*l,.15*o),e.lineTo(.55*l,.25*o),e.lineTo(.45*l,.35*o),e.lineTo(.55*l,.45*o),e.lineTo(.49*l,.5*o),e.stroke();var i=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff"),n=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#000000");e.begin(),e.moveTo(.8257*l,.7695*o),e.lineTo(.8797*l,.888*o),e.lineTo(.79*l,.8651*o),e.close(),e.setFillColor(n),e.fillAndStroke(),e.setFillColor(i)},mxCellRenderer.registerShape("mxgraph.pid2valves.autoRecircValve",mxShapePidAutoRecircValve);