mxPidValves.js 30 KB

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