mxPidValves.js 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. /**
  2. * Copyright (c) 2006-2013, JGraph Holdings Ltd
  3. */
  4. //**********************************************************************************************************************************************************
  5. //Valve
  6. //**********************************************************************************************************************************************************
  7. /**
  8. * Extends mxShape.
  9. */
  10. function mxShapePidValve(bounds, fill, stroke, strokewidth)
  11. {
  12. mxShape.call(this);
  13. this.bounds = bounds;
  14. this.fill = fill;
  15. this.stroke = stroke;
  16. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  17. };
  18. /**
  19. * Extends mxShape.
  20. */
  21. mxUtils.extend(mxShapePidValve, mxShape);
  22. mxShapePidValve.prototype.cst = {
  23. SHAPE_VALVE : 'mxgraph.pid2valves.valve',
  24. //states
  25. DEFAULT_STATE : 'defState',
  26. CLOSED : 'closed',
  27. OPEN : 'open',
  28. //actuators
  29. ACTUATOR : 'actuator',
  30. MANUAL : 'man',
  31. DIAPHRAGM : 'diaph',
  32. BALANCED_DIAPHRAGM : 'balDiaph',
  33. MOTOR : 'motor',
  34. NONE : 'none',
  35. SPRING : 'spring',
  36. PILOT : 'pilot',
  37. POWERED: 'powered',
  38. SOLENOID : 'solenoid',
  39. SOLENOID_MANUAL_RESET : 'solenoidManRes',
  40. SINGLE_ACTING : 'singActing',
  41. DOUBLE_ACTING : 'dblActing',
  42. PILOT_CYLINDER : 'pilotCyl',
  43. DIGITAL : 'digital',
  44. WEIGHT : 'weight',
  45. KEY : 'key',
  46. ELECTRO_HYDRAULIC : 'elHyd',
  47. //types
  48. VALVE_TYPE : 'valveType',
  49. BUTTERFLY : 'butterfly',
  50. CHECK : 'check',
  51. GATE : 'gate',
  52. GLOBE : 'globe',
  53. NEEDLE : 'needle',
  54. PLUG : 'plug',
  55. SELF_DRAINING : 'selfDrain',
  56. ANGLE : 'angle',
  57. ANGLE_GLOBE : 'angleGlobe',
  58. THREE_WAY : 'threeWay',
  59. ANGLE_BLOWDOWN : 'angBlow',
  60. BALL : 'ball'
  61. };
  62. mxShapePidValve.prototype.customProperties = [
  63. {name: 'defState', dispName: 'Default State', type: 'enum', defVal:'open',
  64. enumList: [
  65. {val:'closed', dispName:'Closed'},
  66. {val:'open', dispName:'Open'}
  67. ]},
  68. {name: 'actuator', dispName: 'Actuator', type: 'enum', defVal:'man',
  69. enumList: [
  70. {val:'man', dispName:'Manual'},
  71. {val:'diaph', dispName:'Diphragm'},
  72. {val:'balDiaph', dispName:'Balanced Diaphragm'},
  73. {val:'motor', dispName:'Motor'},
  74. {val:'none', dispName:'None'},
  75. {val:'spring', dispName:'Spring'},
  76. {val:'pilot', dispName:'Pilot'},
  77. {val:'powered', dispName:'Powered'},
  78. {val:'solenoid', dispName:'Solenoid'},
  79. {val:'solenoidManRes', dispName:'Solenoid w/ Manual Reset'},
  80. {val:'singActing', dispName:'Single Acting'},
  81. {val:'dblActing', dispName:'Double Acting'},
  82. {val:'pilotCyl', dispName:'Pilot Cylinder'},
  83. {val:'digital', dispName:'Digital'},
  84. {val:'weight', dispName:'Weight'},
  85. {val:'key', dispName:'Key'},
  86. {val:'elHyd', dispName:'Electro-Hidraulic'}
  87. ]},
  88. {name: 'valveType', dispName: 'Type', type: 'enum', defVal:'gate',
  89. enumList: [
  90. {val:'butterfly', dispName:'Butterfly'},
  91. {val:'check', dispName:'check'},
  92. {val:'gate', dispName:'Gate'},
  93. {val:'globe', dispName:'Globe'},
  94. {val:'needle', dispName:'Needle'},
  95. {val:'plug', dispName:'Plug'},
  96. {val:'selfDrain', dispName:'Self Draining'},
  97. {val:'angle', dispName:'Angle'},
  98. {val:'angleGlobe', dispName:'Angle Globe'},
  99. {val:'threeWay', dispName:'Three Way'},
  100. // {val:'angBlow', dispName:'Angle Blowdown'},
  101. {val:'ball', dispName:'Ball'}
  102. ]},
  103. ];
  104. /**
  105. * Function: paintVertexShape
  106. *
  107. * Paints the vertex shape.
  108. */
  109. mxShapePidValve.prototype.paintVertexShape = function(c, x, y, w, h)
  110. {
  111. var valveType = mxUtils.getValue(this.style, mxShapePidValve.prototype.cst.VALVE_TYPE, 'gate');
  112. var actuator = mxUtils.getValue(this.style, mxShapePidValve.prototype.cst.ACTUATOR, mxShapePidValve.prototype.cst.NONE);
  113. var actH = 0;
  114. if (actuator !== 'none')
  115. {
  116. if (this.isAngleVariant(valveType))
  117. {
  118. actH = h * 0.3333;
  119. }
  120. else
  121. {
  122. actH = h * 0.4;
  123. }
  124. }
  125. c.translate(x, y);
  126. c.setLineJoin('round');
  127. this.background(c, x, y, w, h, valveType, actuator, actH);
  128. c.setShadow(false);
  129. this.foreground(c, x, y, w, h, valveType, actuator, actH);
  130. };
  131. mxShapePidValve.prototype.background = function(c, x, y, w, h, valveType, actuator, actH)
  132. {
  133. //draw the actuator
  134. if (actuator !== mxShapePidValve.prototype.cst.NONE)
  135. {
  136. if (this.isAngleVariant(valveType))
  137. {
  138. this.drawActuatorBg(c, x, y, w, h / 1.2, actuator, actH);
  139. }
  140. else
  141. {
  142. this.drawActuatorBg(c, x, y, w, h, actuator, actH);
  143. }
  144. }
  145. //draw the valve body
  146. if (this.isGateVariant(valveType))
  147. {
  148. this.drawGateVariantBg(c, 0, 0, w, h, valveType, actuator, actH);
  149. }
  150. else if (this.isAngleVariant(valveType))
  151. {
  152. this.drawAngleVariantBg(c, 0, 0, w, h, valveType, actuator, actH);
  153. }
  154. else if (valveType === mxShapePidValve.prototype.cst.BUTTERFLY)
  155. {
  156. this.drawButterflyValve(c, 0, 0, w, h, actuator, actH);
  157. }
  158. else if (valveType === mxShapePidValve.prototype.cst.CHECK)
  159. {
  160. this.drawCheckValve(c, 0, 0, w, h, actuator, actH);
  161. }
  162. };
  163. mxShapePidValve.prototype.foreground = function(c, x, y, w, h, valveType, actuator, actH)
  164. {
  165. var valveType = mxUtils.getValue(this.style, mxShapePidValve.prototype.cst.VALVE_TYPE, 'gate');
  166. //draw the actuator
  167. if (actuator !== mxShapePidValve.prototype.cst.NONE)
  168. {
  169. if (this.isAngleVariant(valveType))
  170. {
  171. this.drawActuatorFg(c, x, y, w, h / 1.2, actuator, actH);
  172. }
  173. else
  174. {
  175. this.drawActuatorFg(c, x, y, w, h, actuator, actH);
  176. }
  177. }
  178. if (this.isGateVariant(valveType))
  179. {
  180. this.drawGateVariantFg(c, 0, 0, w, h, valveType, actuator, actH);
  181. }
  182. if (this.isAngleVariant(valveType))
  183. {
  184. this.drawAngleVariantFg(c, 0, 0, w, h, valveType, actuator, actH);
  185. }
  186. };
  187. mxShapePidValve.prototype.drawActuatorBg = function(c, x, y, w, h, actuator)
  188. {
  189. if (this.isSquareVariant(actuator))
  190. {
  191. c.translate(w * 0.325, 0);
  192. this.drawSquareAct(c, w * 0.35, h * 0.7, actuator);
  193. c.translate(- w * 0.325, 0);
  194. }
  195. else if (actuator === mxShapePidValve.prototype.cst.MANUAL)
  196. {
  197. c.translate(w * 0.25, h * 0.15);
  198. this.drawManAct(c, w * 0.5, h * 0.55);
  199. c.translate(- w * 0.25, - h * 0.15);
  200. }
  201. else if (actuator === mxShapePidValve.prototype.cst.DIAPHRAGM)
  202. {
  203. c.translate(w * 0.25, h * 0.1);
  204. this.drawDiaphAct(c, w * 0.5, h * 0.6);
  205. c.translate(- w * 0.25, - h * 0.1);
  206. }
  207. else if (actuator === mxShapePidValve.prototype.cst.BALANCED_DIAPHRAGM)
  208. {
  209. c.translate(w * 0.25, h * 0.1);
  210. this.drawBalDiaphActBg(c, w * 0.5, h * 0.6);
  211. c.translate(- w * 0.25, - h * 0.1);
  212. }
  213. else if (actuator === mxShapePidValve.prototype.cst.MOTOR || actuator === mxShapePidValve.prototype.cst.ELECTRO_HYDRAULIC)
  214. {
  215. c.translate(w * 0.325, 0);
  216. this.drawCircleAct(c, w * 0.35, h * 0.7, actuator);
  217. c.translate(- w * 0.325, 0);
  218. }
  219. else if (actuator === mxShapePidValve.prototype.cst.SPRING)
  220. {
  221. c.translate(w * 0.36, 0);
  222. this.drawSpringAct(c, w * 0.28, h * 0.7);
  223. c.translate(- w * 0.36, 0);
  224. }
  225. else if (actuator === mxShapePidValve.prototype.cst.SOLENOID_MANUAL_RESET)
  226. {
  227. c.translate(w * 0.325, 0);
  228. this.drawSolenoidManResetAct(c, w * 0.575, h * 0.7);
  229. c.translate(- w * 0.325, 0);
  230. }
  231. else if (actuator === mxShapePidValve.prototype.cst.SINGLE_ACTING)
  232. {
  233. c.translate(w * 0.35, 0);
  234. this.drawSingActingActBg(c, w * 0.65, h * 0.7);
  235. c.translate(- w * 0.35, 0);
  236. }
  237. else if (actuator === mxShapePidValve.prototype.cst.DOUBLE_ACTING)
  238. {
  239. c.translate(w * 0.35, 0);
  240. this.drawDblActingActBg(c, w * 0.65, h * 0.7);
  241. c.translate(- w * 0.35, 0);
  242. }
  243. else if (actuator === mxShapePidValve.prototype.cst.PILOT_CYLINDER)
  244. {
  245. c.translate(w * 0.35, 0);
  246. this.drawPilotCylinderActBg(c, w * 0.65, h * 0.7);
  247. c.translate(- w * 0.35, 0);
  248. }
  249. else if (actuator === mxShapePidValve.prototype.cst.ANGLE_BLOWDOWN)
  250. {
  251. c.translate(w * 0.5, h * 0.2);
  252. this.drawAngleBlowdownAct(c, w * 0.4, h * 0.5);
  253. c.translate(- w * 0.5, - h * 0.2);
  254. }
  255. };
  256. mxShapePidValve.prototype.drawActuatorFg = function(c, x, y, w, h, actuator)
  257. {
  258. if (actuator === mxShapePidValve.prototype.cst.BALANCED_DIAPHRAGM)
  259. {
  260. c.translate(w * 0.25, h * 0.1);
  261. this.drawBalDiaphActFg(c, w * 0.5, h * 0.6);
  262. c.translate(- w * 0.25, - h * 0.1);
  263. }
  264. else if (actuator === mxShapePidValve.prototype.cst.SINGLE_ACTING ||
  265. actuator === mxShapePidValve.prototype.cst.DOUBLE_ACTING ||
  266. actuator === mxShapePidValve.prototype.cst.PILOT_CYLINDER)
  267. {
  268. c.translate(w * 0.35, 0);
  269. this.drawActingActFg(c, w * 0.65, h * 0.7);
  270. c.translate(- w * 0.35, 0);
  271. }
  272. };
  273. mxShapePidValve.prototype.drawManAct = function(c, w, h)
  274. {
  275. c.begin();
  276. c.moveTo(0, 0);
  277. c.lineTo(w, 0);
  278. c.moveTo(w * 0.5, 0);
  279. c.lineTo(w * 0.5, h);
  280. c.stroke();
  281. };
  282. mxShapePidValve.prototype.drawDiaphAct = function(c, w, h)
  283. {
  284. c.begin();
  285. c.moveTo(w * 0.5, h * 0.2);
  286. c.lineTo(w * 0.5, h);
  287. c.stroke();
  288. c.begin();
  289. c.moveTo(0, h * 0.2);
  290. c.arcTo(w * 0.6, h * 0.4, 0, 0, 1, w, h * 0.2);
  291. c.close();
  292. c.fillAndStroke();
  293. };
  294. mxShapePidValve.prototype.drawBalDiaphActBg = function(c, w, h)
  295. {
  296. c.ellipse(0, 0, w, h * 0.3);
  297. c.fillAndStroke();
  298. c.begin();
  299. c.moveTo(w * 0.5, h * 0.3);
  300. c.lineTo(w * 0.5, h);
  301. c.stroke();
  302. };
  303. mxShapePidValve.prototype.drawBalDiaphActFg = function(c, w, h)
  304. {
  305. c.begin();
  306. c.moveTo(0, h * 0.15);
  307. c.lineTo(w, h * 0.15);
  308. c.stroke();
  309. };
  310. mxShapePidValve.prototype.drawCircleAct = function(c, w, h, actuator)
  311. {
  312. c.ellipse(0, 0, w, h * 0.5);
  313. c.fillAndStroke();
  314. c.begin();
  315. c.moveTo(w * 0.5, h * 0.5);
  316. c.lineTo(w * 0.5, h);
  317. c.stroke();
  318. var m = '';
  319. if (actuator === mxShapePidValve.prototype.cst.MOTOR)
  320. {
  321. m = 'M';
  322. }
  323. else if (actuator === mxShapePidValve.prototype.cst.ELECTRO_HYDRAULIC)
  324. {
  325. m = 'E/H';
  326. }
  327. c.setFontStyle(1);
  328. c.setFontFamily('Helvetica');
  329. c.setFontSize(Math.min(w, h) * 0.4);
  330. c.text(w * 0.5, h * 0.25, 0, 0, m, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  331. };
  332. mxShapePidValve.prototype.drawSpringAct = function(c, w, h)
  333. {
  334. c.begin();
  335. c.moveTo(w * 0.5, 0);
  336. c.lineTo(w * 0.5, h);
  337. c.moveTo(w * 0.32, h * 0.16);
  338. c.lineTo(w * 0.68, h * 0.08);
  339. c.moveTo(w * 0.21, h * 0.32);
  340. c.lineTo(w * 0.79, h * 0.20);
  341. c.moveTo(w * 0.1, h * 0.52);
  342. c.lineTo(w * 0.9, h * 0.36);
  343. c.moveTo(0, h * 0.72);
  344. c.lineTo(w, h * 0.5);
  345. c.stroke();
  346. };
  347. mxShapePidValve.prototype.drawSolenoidManResetAct = function(c, w, h)
  348. {
  349. c.rect(0, 0, w * 0.61, h * 0.46);
  350. c.fillAndStroke();
  351. c.begin();
  352. c.moveTo(w * 0.56, h * 0.6);
  353. c.lineTo(w * 0.78, h * 0.5);
  354. c.lineTo(w, h * 0.6);
  355. c.lineTo(w * 0.78, h * 0.7);
  356. c.close();
  357. c.fillAndStroke();
  358. c.begin();
  359. c.moveTo(w * 0.305, h * 0.46);
  360. c.lineTo(w * 0.305, h);
  361. c.moveTo(w * 0.305, h * 0.6);
  362. c.lineTo(w * 0.56, h * 0.6);
  363. c.stroke();
  364. c.setFontStyle(1);
  365. c.setFontFamily('Helvetica');
  366. c.setFontSize(Math.min(w, h) * 0.4);
  367. c.text(w * 0.305, h * 0.23, 0, 0, 'S', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  368. c.setFontStyle(0);
  369. c.setFontSize(Math.min(w, h) * 0.15);
  370. c.text(w * 0.78, h * 0.6, 0, 0, 'R', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  371. };
  372. mxShapePidValve.prototype.drawSingActingActBg = function(c, w, h)
  373. {
  374. c.rect(0, 0, w * 0.46, h * 0.46);
  375. c.fillAndStroke();
  376. c.begin();
  377. c.moveTo(w * 0.23, h * 0.46);
  378. c.lineTo(w * 0.23, h);
  379. c.moveTo(w * 0.46, h * 0.23);
  380. c.lineTo(w, h * 0.23);
  381. c.moveTo(w * 0.77, h * 0.15);
  382. c.lineTo(w * 0.69, h * 0.31);
  383. c.moveTo(w * 0.82, h * 0.15);
  384. c.lineTo(w * 0.74, h * 0.31);
  385. c.stroke();
  386. };
  387. mxShapePidValve.prototype.drawActingActFg = function(c, w, h)
  388. {
  389. c.begin();
  390. c.moveTo(w * 0.23, h * 0.23);
  391. c.lineTo(w * 0.23, h * 0.46);
  392. c.moveTo(0, h * 0.23);
  393. c.lineTo(w * 0.46, h * 0.23);
  394. c.stroke();
  395. };
  396. mxShapePidValve.prototype.drawDblActingActBg = function(c, w, h)
  397. {
  398. c.rect(0, 0, w * 0.46, h * 0.46);
  399. c.fillAndStroke();
  400. c.begin();
  401. c.moveTo(w * 0.23, h * 0.46);
  402. c.lineTo(w * 0.23, h);
  403. c.moveTo(w * 0.46, h * 0.115);
  404. c.lineTo(w, h * 0.115);
  405. c.moveTo(w * 0.77, h * 0.035);
  406. c.lineTo(w * 0.69, h * 0.195);
  407. c.moveTo(w * 0.82, h * 0.035);
  408. c.lineTo(w * 0.74, h * 0.195);
  409. c.moveTo(w * 0.46, h * 0.345);
  410. c.lineTo(w, h * 0.345);
  411. c.moveTo(w * 0.77, h * 0.265);
  412. c.lineTo(w * 0.69, h * 0.425);
  413. c.moveTo(w * 0.82, h * 0.265);
  414. c.lineTo(w * 0.74, h * 0.425);
  415. c.stroke();
  416. };
  417. mxShapePidValve.prototype.drawPilotCylinderActBg = function(c, w, h)
  418. {
  419. c.rect(0, 0, w * 0.46, h * 0.46);
  420. c.fillAndStroke();
  421. c.begin();
  422. c.moveTo(w * 0.23, h * 0.46);
  423. c.lineTo(w * 0.23, h);
  424. c.moveTo(w * 0.46, h * 0.23);
  425. c.lineTo(w * 0.77, h * 0.23);
  426. c.stroke();
  427. c.rect(w * 0.77, h * 0.115, w * 0.23, h * 0.23);
  428. c.fillAndStroke();
  429. c.setFontStyle(0);
  430. c.setFontFamily('Helvetica');
  431. c.setFontSize(Math.min(w, h) * 0.15);
  432. c.text(w * 0.885, h * 0.23, 0, 0, 'P', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  433. };
  434. mxShapePidValve.prototype.drawAngleBlowdownAct = function(c, w, h)
  435. {
  436. c.begin();
  437. c.moveTo(w * 0.34, 0);
  438. c.lineTo(w, h * 0.405);
  439. c.moveTo(0, h);
  440. c.lineTo(w * 0.665, h * 0.205);
  441. c.stroke();
  442. };
  443. mxShapePidValve.prototype.drawSquareAct = function(c, w, h, actuator)
  444. {
  445. c.rect(0, 0, w, h * 0.5);
  446. c.fillAndStroke();
  447. c.begin();
  448. c.moveTo(w * 0.5, h * 0.5);
  449. c.lineTo(w * 0.5, h);
  450. c.stroke();
  451. var m = '';
  452. if (actuator === mxShapePidValve.prototype.cst.PILOT)
  453. {
  454. m = 'P';
  455. }
  456. else if (actuator === mxShapePidValve.prototype.cst.SOLENOID)
  457. {
  458. m = 'S';
  459. }
  460. else if (actuator === mxShapePidValve.prototype.cst.DIGITAL)
  461. {
  462. m = 'D';
  463. }
  464. else if (actuator === mxShapePidValve.prototype.cst.WEIGHT)
  465. {
  466. m = 'W';
  467. }
  468. else if (actuator === mxShapePidValve.prototype.cst.KEY)
  469. {
  470. m = 'K';
  471. }
  472. c.setFontStyle(1);
  473. c.setFontFamily('Helvetica');
  474. c.setFontSize(Math.min(w, h) * 0.4);
  475. c.text(w * 0.5, h * 0.25, 0, 0, m, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);
  476. };
  477. mxShapePidValve.prototype.drawGateVariantFg = function(c, x, y, w, h, valveType, actuator, actH)
  478. {
  479. var defState = mxUtils.getValue(this.style, mxShapePidValve.prototype.cst.DEFAULT_STATE, 'open');
  480. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  481. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  482. if (valveType === mxShapePidValve.prototype.cst.BALL)
  483. {
  484. c.ellipse(x + w * 0.3, y + actH + (h - actH) * 0.18, w * 0.4, (h - actH) * 0.64);
  485. c.fillAndStroke();
  486. }
  487. else if (valveType === mxShapePidValve.prototype.cst.GLOBE)
  488. {
  489. c.ellipse(x + w * 0.3, y + actH + (h - actH) * 0.18, w * 0.4, (h - actH) * 0.64);
  490. c.setFillColor(strokeColor);
  491. c.fillAndStroke();
  492. c.setFillColor(fillColor);
  493. }
  494. else if (valveType === mxShapePidValve.prototype.cst.PLUG)
  495. {
  496. this.drawPlug(c, x + w * 0.4, y + actH + (h - actH) * 0.25, w * 0.2, (h - actH) * 0.5);
  497. }
  498. else if (valveType === mxShapePidValve.prototype.cst.NEEDLE)
  499. {
  500. this.drawNeedle(c, x + w * 0.45, y + actH + (h - actH) * 0.1, w * 0.1, (h - actH) * 0.9);
  501. }
  502. else if (valveType === mxShapePidValve.prototype.cst.SELF_DRAINING)
  503. {
  504. this.drawDrain(c, x + w * 0.48, y + actH + (h - actH) * 0.5, w * 0.04, (h - actH) * 0.49);
  505. }
  506. };
  507. mxShapePidValve.prototype.drawAngleVariantFg = function(c, x, y, w, h, valveType, actuator, actH)
  508. {
  509. var defState = mxUtils.getValue(this.style, mxShapePidValve.prototype.cst.DEFAULT_STATE, 'open');
  510. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  511. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  512. if (valveType === mxShapePidValve.prototype.cst.ANGLE_GLOBE)
  513. {
  514. if (actuator === 'none')
  515. {
  516. c.ellipse(w * 0.34, h * 0.175, w * 0.32, h * 0.4);
  517. }
  518. else
  519. {
  520. c.ellipse(w * 0.34, h * 0.45, w * 0.32, h * 0.2667);
  521. }
  522. c.setFillColor(strokeColor);
  523. c.fillAndStroke();
  524. c.setFillColor(fillColor);
  525. }
  526. };
  527. mxShapePidValve.prototype.drawGateVariantBg = function(c, x, y, w, h, valveType, actuator, actH)
  528. {
  529. if (valveType === mxShapePidValve.prototype.cst.GATE)
  530. {
  531. this.drawGateValve(c, x, y + actH, w, h - actH);
  532. }
  533. else if (valveType === mxShapePidValve.prototype.cst.BALL || valveType === mxShapePidValve.prototype.cst.GLOBE)
  534. {
  535. c.ellipse(x + w * 0.3, y + actH + (h - actH) * 0.18, w * 0.4, (h - actH) * 0.64);
  536. c.fillAndStroke();
  537. this.drawGateValve(c, x, y + actH, w, h - actH);
  538. }
  539. else if (valveType === mxShapePidValve.prototype.cst.PLUG)
  540. {
  541. this.drawPlug(c, x + w * 0.4, y + actH + (h - actH) * 0.25, w * 0.2, (h - actH) * 0.5);
  542. this.drawGateValve(c, x, y + actH, w, h - actH);
  543. }
  544. else if (valveType === mxShapePidValve.prototype.cst.NEEDLE)
  545. {
  546. this.drawNeedle(c, x + w * 0.45, y + actH + (h - actH) * 0.1, w * 0.1, (h - actH) * 0.9);
  547. this.drawGateValve(c, x, y + actH, w, h - actH);
  548. }
  549. else if (valveType === mxShapePidValve.prototype.cst.SELF_DRAINING)
  550. {
  551. this.drawDrain(c, x + w * 0.48, y + actH + (h - actH) * 0.5, w * 0.04, (h - actH) * 0.49);
  552. this.drawGateValve(c, x, y + actH, w, h - actH);
  553. }
  554. };
  555. mxShapePidValve.prototype.drawAngleVariantBg = function(c, x, y, w, h, valveType, actuator, actH)
  556. {
  557. if (valveType === mxShapePidValve.prototype.cst.ANGLE)
  558. {
  559. this.drawAngleValve(c, w * 0.2, y + actH, w * 0.8, h - actH);
  560. }
  561. else if (valveType === mxShapePidValve.prototype.cst.ANGLE_GLOBE)
  562. {
  563. this.drawAngleGlobeValveBg(c, w * 0.2, y + actH, w * 0.8, h - actH);
  564. }
  565. else if (valveType === mxShapePidValve.prototype.cst.THREE_WAY)
  566. {
  567. this.drawThreeWayValve(c, 0, y + actH, w, h - actH);
  568. }
  569. else if (valveType === mxShapePidValve.prototype.cst.ANGLE_BLOWDOWN)
  570. {
  571. this.drawAngleBlowdownValve(c, x, y + actH, w, h - actH);
  572. }
  573. };
  574. mxShapePidValve.prototype.drawPlug = function(c, x, y, w, h)
  575. {
  576. c.translate(x, y);
  577. c.begin();
  578. c.moveTo(0, h * 0.5);
  579. c.lineTo(w * 0.5, 0);
  580. c.lineTo(w, h * 0.5);
  581. c.lineTo(w * 0.5, h);
  582. c.close();
  583. c.fillAndStroke();
  584. c.translate(-x, -y);
  585. };
  586. mxShapePidValve.prototype.drawNeedle = function(c, x, y, w, h)
  587. {
  588. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  589. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  590. c.translate(x, y);
  591. c.begin();
  592. c.moveTo(0, 0);
  593. c.lineTo(w, 0);
  594. c.lineTo(w * 0.5, h);
  595. c.close();
  596. c.setFillColor(strokeColor);
  597. c.fillAndStroke();
  598. c.setFillColor(fillColor);
  599. c.translate(-x, -y);
  600. };
  601. mxShapePidValve.prototype.drawDrain = function(c, x, y, w, h)
  602. {
  603. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  604. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  605. c.translate(x, y);
  606. c.begin();
  607. c.moveTo(w * 0.5, 0);
  608. c.lineTo(w * 0.5, h * 0.96);
  609. c.stroke();
  610. c.begin();
  611. c.moveTo(0, h * 0.9);
  612. c.lineTo(w, h * 0.9);
  613. c.lineTo(w * 0.5, h);
  614. c.close();
  615. c.setFillColor(strokeColor);
  616. c.fillAndStroke();
  617. c.setFillColor(fillColor);
  618. c.translate(-x, -y);
  619. };
  620. mxShapePidValve.prototype.drawGateValve = function(c, x, y, w, h)
  621. {
  622. var defState = mxUtils.getValue(this.style, mxShapePidValve.prototype.cst.DEFAULT_STATE, 'open');
  623. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  624. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  625. c.translate(x, y);
  626. c.begin();
  627. c.moveTo(0, 0);
  628. c.lineTo(w * 0.5, h * 0.5);
  629. c.lineTo(0, h);
  630. c.close();
  631. c.moveTo(w, 0);
  632. c.lineTo(w * 0.5, h * 0.5);
  633. c.lineTo(w, h);
  634. c.close();
  635. if (defState === mxShapePidValve.prototype.cst.CLOSED)
  636. {
  637. c.setFillColor(strokeColor);
  638. c.fillAndStroke();
  639. c.setFillColor(fillColor);
  640. }
  641. else
  642. {
  643. c.fillAndStroke();
  644. }
  645. c.translate(-x, -y);
  646. };
  647. mxShapePidValve.prototype.drawAngleValve = function(c, x, y, w, h)
  648. {
  649. c.translate(x, y);
  650. c.begin();
  651. c.moveTo(w * 0.375, h * 0.375);
  652. c.lineTo(w, 0);
  653. c.lineTo(w, h * 0.75);
  654. c.close();
  655. c.moveTo(w * 0.375, h * 0.375);
  656. c.lineTo(w * 0.75, h);
  657. c.lineTo(0, h);
  658. c.close();
  659. c.fillAndStroke();
  660. c.translate(-x, -y);
  661. };
  662. mxShapePidValve.prototype.drawAngleGlobeValveBg = function(c, x, y, w, h)
  663. {
  664. c.translate(x, y);
  665. c.ellipse(w * 0.175, h * 0.175, w * 0.4, h * 0.4);
  666. c.fillAndStroke();
  667. c.begin();
  668. c.moveTo(w * 0.375, h * 0.375);
  669. c.lineTo(w, 0);
  670. c.lineTo(w, h * 0.75);
  671. c.close();
  672. c.moveTo(w * 0.375, h * 0.375);
  673. c.lineTo(w * 0.75, h);
  674. c.lineTo(0, h);
  675. c.close();
  676. c.fillAndStroke();
  677. c.translate(-x, -y);
  678. };
  679. mxShapePidValve.prototype.drawAngleGlobeValveFg = function(c, x, y, w, h)
  680. {
  681. c.translate(x, y);
  682. c.ellipse(w * 0.275, h * 0.275, w * 0.2, h * 0.2);
  683. c.fillAndStroke();
  684. c.translate(-x, -y);
  685. };
  686. mxShapePidValve.prototype.drawThreeWayValve = function(c, x, y, w, h)
  687. {
  688. c.translate(x, y);
  689. c.begin();
  690. c.moveTo(0, 0);
  691. c.lineTo(w * 0.5, h * 0.375);
  692. c.lineTo(0, h * 0.75);
  693. c.close();
  694. c.moveTo(w, 0);
  695. c.lineTo(w * 0.5, h * 0.375);
  696. c.lineTo(w, h * 0.75);
  697. c.close();
  698. c.moveTo(w * 0.5, h * 0.375);
  699. c.lineTo(w * 0.8, h);
  700. c.lineTo(w * 0.2, h);
  701. c.close();
  702. c.fillAndStroke();
  703. c.translate(-x, -y);
  704. };
  705. mxShapePidValve.prototype.drawAngleBlowdownValve = function(c, x, y, w, h)
  706. {
  707. };
  708. mxShapePidValve.prototype.drawButterflyValve = function(c, x, y, w, h, actuator, actH)
  709. {
  710. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  711. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  712. var yv = y + actH;
  713. var hv = h - actH;
  714. c.translate(x, yv);
  715. c.begin();
  716. c.moveTo(0, 0);
  717. c.lineTo(0, hv);
  718. c.moveTo(w, 0);
  719. c.lineTo(w, hv);
  720. c.moveTo(w * 0.05, hv * 0.05);
  721. c.lineTo(w * 0.95, hv * 0.95);
  722. c.fillAndStroke();
  723. c.ellipse(w * 0.4, hv * 0.33, w * 0.2, hv * 0.33);
  724. c.fillAndStroke();
  725. c.translate(-x, -y);
  726. };
  727. mxShapePidValve.prototype.drawCheckValve = function(c, x, y, w, h, actuator, actH)
  728. {
  729. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  730. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  731. var yv = y + actH;
  732. var hv = h - actH;
  733. c.translate(x, yv);
  734. c.begin();
  735. c.moveTo(0, 0);
  736. c.lineTo(0, hv);
  737. c.moveTo(w, 0);
  738. c.lineTo(w, hv);
  739. c.moveTo(w * 0.05, hv * 0.05);
  740. c.lineTo(w * 0.95, hv * 0.95);
  741. c.fillAndStroke();
  742. c.begin();
  743. c.moveTo(w * 0.8925, hv * 0.815);
  744. c.lineTo(w * 0.957, hv * 0.955);
  745. c.lineTo(w * 0.85, hv * 0.928);
  746. c.close();
  747. c.setFillColor(strokeColor);
  748. c.fillAndStroke();
  749. c.setFillColor(fillColor);
  750. c.translate(-x, -y);
  751. };
  752. mxShapePidValve.prototype.isGateVariant = function(valveType)
  753. {
  754. if (valveType === mxShapePidValve.prototype.cst.GATE ||
  755. valveType === mxShapePidValve.prototype.cst.BALL ||
  756. valveType === mxShapePidValve.prototype.cst.PLUG ||
  757. valveType === mxShapePidValve.prototype.cst.NEEDLE ||
  758. valveType === mxShapePidValve.prototype.cst.SELF_DRAINING ||
  759. valveType === mxShapePidValve.prototype.cst.GLOBE)
  760. {
  761. return true;
  762. }
  763. else
  764. {
  765. return false;
  766. }
  767. };
  768. mxShapePidValve.prototype.isAngleVariant = function(valveType)
  769. {
  770. if (valveType === mxShapePidValve.prototype.cst.ANGLE ||
  771. valveType === mxShapePidValve.prototype.cst.ANGLE_GLOBE ||
  772. valveType === mxShapePidValve.prototype.cst.THREE_WAY ||
  773. valveType === mxShapePidValve.prototype.cst.ANGLE_BLOWDOWN)
  774. {
  775. return true;
  776. }
  777. else
  778. {
  779. return false;
  780. }
  781. };
  782. mxShapePidValve.prototype.isSquareVariant = function(actType)
  783. {
  784. if (actType === mxShapePidValve.prototype.cst.PILOT ||
  785. actType === mxShapePidValve.prototype.cst.SOLENOID ||
  786. actType === mxShapePidValve.prototype.cst.POWERED ||
  787. actType === mxShapePidValve.prototype.cst.DIGITAL ||
  788. actType === mxShapePidValve.prototype.cst.WEIGHT ||
  789. actType === mxShapePidValve.prototype.cst.KEY)
  790. {
  791. return true;
  792. }
  793. else
  794. {
  795. return false;
  796. }
  797. };
  798. mxCellRenderer.registerShape(mxShapePidValve.prototype.cst.SHAPE_VALVE, mxShapePidValve);
  799. //**********************************************************************************************************************************************************
  800. //Integrated Block And Bleed Valve
  801. //**********************************************************************************************************************************************************
  802. /**
  803. * Extends mxShape.
  804. */
  805. function mxShapePidIntBlockBleedValve(bounds, fill, stroke, strokewidth)
  806. {
  807. mxShape.call(this);
  808. this.bounds = bounds;
  809. this.fill = fill;
  810. this.stroke = stroke;
  811. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  812. };
  813. /**
  814. * Extends mxShapePidValve.
  815. */
  816. mxUtils.extend(mxShapePidIntBlockBleedValve, mxShapePidValve);
  817. /**
  818. * Function: paintVertexShape
  819. *
  820. * Paints the vertex shape.
  821. */
  822. mxShapePidIntBlockBleedValve.prototype.paintVertexShape = function(c, x, y, w, h)
  823. {
  824. var actuator = mxUtils.getValue(this.style, mxShapePidIntBlockBleedValve.prototype.cst.ACTUATOR, mxShapePidIntBlockBleedValve.prototype.cst.NONE);
  825. var actH = 0;
  826. if (actuator !== 'none')
  827. {
  828. actH = h * 0.2353;
  829. }
  830. c.translate(x, y);
  831. c.setLineJoin('round');
  832. this.background(c, x, y, w, h, actuator, actH);
  833. c.setShadow(false);
  834. this.foreground(c, x, y, w, h, actuator, actH);
  835. };
  836. mxShapePidIntBlockBleedValve.prototype.background = function(c, x, y, w, h, actuator, actH)
  837. {
  838. //draw the actuator
  839. if (actuator !== mxShapePidIntBlockBleedValve.prototype.cst.NONE)
  840. {
  841. this.drawActuatorBg(c, x, y, w, h, actuator);
  842. }
  843. //draw the valve body
  844. this.drawValveBg(c, 0, actH, w, h - actH);
  845. };
  846. mxShapePidIntBlockBleedValve.prototype.foreground = function(c, x, y, w, h, actuator, actH)
  847. {
  848. //draw the actuator
  849. if (actuator !== mxShapePidIntBlockBleedValve.prototype.cst.NONE)
  850. {
  851. this.drawActuatorFg(c, x, y, w, h, actuator);
  852. }
  853. };
  854. mxShapePidIntBlockBleedValve.prototype.drawValveBg = function(c, x, y, w, h)
  855. {
  856. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  857. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  858. c.translate(x, y);
  859. c.begin();
  860. c.moveTo(0, 0);
  861. c.lineTo(w * 0.5, h * 0.23);
  862. c.lineTo(0, h * 0.46);
  863. c.close();
  864. c.moveTo(w * 0.5, h * 0.23);
  865. c.lineTo(w, 0);
  866. c.lineTo(w, h * 0.46);
  867. c.close();
  868. c.fillAndStroke();
  869. c.begin();
  870. c.moveTo(w * 0.5, h * 0.23);
  871. c.lineTo(w * 0.5, h * 0.5);
  872. c.stroke();
  873. c.setFillColor(strokeColor);
  874. c.begin();
  875. c.moveTo(w * 0.3, h * 0.5);
  876. c.lineTo(w * 0.7, h * 0.5);
  877. c.lineTo(w * 0.5, h * 0.75);
  878. c.close();
  879. c.fillAndStroke();
  880. c.begin();
  881. c.moveTo(w * 0.3, h);
  882. c.lineTo(w * 0.5, h * 0.75);
  883. c.lineTo(w * 0.7, h);
  884. c.fillAndStroke();
  885. c.setFillColor(fillColor);
  886. c.translate(-x, -y);
  887. };
  888. mxShapePidIntBlockBleedValve.prototype.drawActuatorBg = function(c, x, y, w, h, actuator)
  889. {
  890. if (this.isSquareVariant(actuator))
  891. {
  892. c.translate(w * 0.325, 0);
  893. this.drawSquareAct(c, w * 0.35, h * 0.4112, actuator);
  894. c.translate(- w * 0.325, 0);
  895. }
  896. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.MANUAL)
  897. {
  898. c.translate(w * 0.25, h * 0.0882);
  899. this.drawManAct(c, w * 0.5, h * 0.323);
  900. c.translate(- w * 0.25, - h * 0.0882);
  901. }
  902. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.DIAPHRAGM)
  903. {
  904. c.translate(w * 0.25, h * 0.0588);
  905. this.drawDiaphAct(c, w * 0.5, h * 0.3524);
  906. c.translate(- w * 0.25, - h * 0.0588);
  907. }
  908. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.BALANCED_DIAPHRAGM)
  909. {
  910. c.translate(w * 0.25, h * 0.0588);
  911. this.drawBalDiaphActBg(c, w * 0.5, h * 0.3524);
  912. c.translate(- w * 0.25, - h * 0.0588);
  913. }
  914. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.MOTOR || actuator === mxShapePidIntBlockBleedValve.prototype.cst.ELECTRO_HYDRAULIC)
  915. {
  916. c.translate(w * 0.325, 0);
  917. this.drawCircleAct(c, w * 0.35, h * 0.4112, actuator);
  918. c.translate(- w * 0.325, 0);
  919. }
  920. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.SPRING)
  921. {
  922. c.translate(w * 0.36, 0);
  923. this.drawSpringAct(c, w * 0.28, h * 0.4112);
  924. c.translate(- w * 0.36, 0);
  925. }
  926. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.SOLENOID_MANUAL_RESET)
  927. {
  928. c.translate(w * 0.325, 0);
  929. this.drawSolenoidManResetAct(c, w * 0.575, h * 0.4112);
  930. c.translate(- w * 0.325, 0);
  931. }
  932. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.SINGLE_ACTING)
  933. {
  934. c.translate(w * 0.35, 0);
  935. this.drawSingActingActBg(c, w * 0.65, h * 0.4112);
  936. c.translate(- w * 0.35, 0);
  937. }
  938. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.DOUBLE_ACTING)
  939. {
  940. c.translate(w * 0.35, 0);
  941. this.drawDblActingActBg(c, w * 0.65, h * 0.4112);
  942. c.translate(- w * 0.35, 0);
  943. }
  944. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.PILOT_CYLINDER)
  945. {
  946. c.translate(w * 0.35, 0);
  947. this.drawPilotCylinderActBg(c, w * 0.65, h * 0.4112);
  948. c.translate(- w * 0.35, 0);
  949. }
  950. };
  951. mxShapePidIntBlockBleedValve.prototype.drawActuatorFg = function(c, x, y, w, h, actuator)
  952. {
  953. if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.BALANCED_DIAPHRAGM)
  954. {
  955. c.translate(w * 0.25, h * 0.0588);
  956. this.drawBalDiaphActFg(c, w * 0.5, h * 0.3524);
  957. c.translate(- w * 0.25, - h * 0.0588);
  958. }
  959. else if (actuator === mxShapePidIntBlockBleedValve.prototype.cst.SINGLE_ACTING ||
  960. actuator === mxShapePidIntBlockBleedValve.prototype.cst.DOUBLE_ACTING ||
  961. actuator === mxShapePidIntBlockBleedValve.prototype.cst.PILOT_CYLINDER)
  962. {
  963. c.translate(w * 0.35, 0);
  964. this.drawActingActFg(c, w * 0.65, h * 0.4112);
  965. c.translate(- w * 0.35, 0);
  966. }
  967. };
  968. mxCellRenderer.registerShape('mxgraph.pid2valves.blockBleedValve', mxShapePidIntBlockBleedValve);
  969. //**********************************************************************************************************************************************************
  970. //Auto Recirculation Valve
  971. //**********************************************************************************************************************************************************
  972. /**
  973. * Extends mxShape.
  974. */
  975. function mxShapePidAutoRecircValve(bounds, fill, stroke, strokewidth)
  976. {
  977. mxShape.call(this);
  978. this.bounds = bounds;
  979. this.fill = fill;
  980. this.stroke = stroke;
  981. this.strokewidth = (strokewidth != null) ? strokewidth : 1;
  982. };
  983. /**
  984. * Extends mxShape.
  985. */
  986. mxUtils.extend(mxShapePidAutoRecircValve, mxShape);
  987. /**
  988. * Function: paintVertexShape
  989. *
  990. * Paints the vertex shape.
  991. */
  992. mxShapePidAutoRecircValve.prototype.paintVertexShape = function(c, x, y, w, h)
  993. {
  994. c.setLineJoin('round');
  995. c.translate(x, y);
  996. //background
  997. c.rect(0, 0, w, h);
  998. c.fillAndStroke();
  999. c.setShadow(false);
  1000. //foreground
  1001. c.begin();
  1002. c.moveTo(w * 0.08, h * 0.08);
  1003. c.lineTo(w * 0.08, h * 0.92);
  1004. c.moveTo(w * 0.92, h * 0.08);
  1005. c.lineTo(w * 0.92, h * 0.92);
  1006. c.moveTo(w * 0.12, h * 0.122);
  1007. c.lineTo(w * 0.8738, h * 0.8837);
  1008. c.moveTo(w * 0.5, 0);
  1009. c.lineTo(w * 0.55, h * 0.05);
  1010. c.lineTo(w * 0.45, h * 0.15);
  1011. c.lineTo(w * 0.55, h * 0.25);
  1012. c.lineTo(w * 0.45, h * 0.35);
  1013. c.lineTo(w * 0.55, h * 0.45);
  1014. c.lineTo(w * 0.49, h * 0.5);
  1015. c.stroke();
  1016. var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');
  1017. var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');
  1018. c.begin();
  1019. c.moveTo(w * 0.8257, h * 0.7695);
  1020. c.lineTo(w * 0.8797, h * 0.888);
  1021. c.lineTo(w * 0.79, h * 0.8651);
  1022. c.close();
  1023. c.setFillColor(strokeColor);
  1024. c.fillAndStroke();
  1025. c.setFillColor(fillColor);
  1026. };
  1027. mxCellRenderer.registerShape('mxgraph.pid2valves.autoRecircValve', mxShapePidAutoRecircValve);