Sidebar-Cabinet.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. (function()
  2. {
  3. // Adds Cabinets shapes
  4. Sidebar.prototype.addCabinetsPalette = function()
  5. {
  6. var s = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;dashed=0;shadow=0;strokeColor=#000000;fillColor=#ffffff;html=1;align=center;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_STROKEWIDTH + '=1;shape=mxgraph.cabinets.';
  7. var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=middle;dashed=0;shadow=0;strokeColor=#000000;fillColor=#ffffff;html=1;' + mxConstants.STYLE_STROKEWIDTH + '=1;shape=mxgraph.cabinets.';
  8. var w = 50;
  9. var h = 50;
  10. var gn = 'mxgraph.cabinets';
  11. var dt = 'cabinet ';
  12. var sb = this;
  13. var fns =
  14. [
  15. this.createVertexTemplateEntry(s + 'cabinet;hasStand=1',
  16. w * 5, h * 10, '', 'Cabinet', null, null, this.getTagsForStencil(gn, 'cabinet', dt).join(' ')),
  17. this.createVertexTemplateEntry(s2 + 'dimension;verticalAlign=top;align=center;',
  18. w * 5, 40, '100', 'Dimension', null, null, this.getTagsForStencil(gn, 'dimension', dt).join(' ')),
  19. this.createVertexTemplateEntry(s2 + 'dimensionBottom;verticalAlign=bottom;align=center;',
  20. w * 5, 40, '100', 'Dimension', null, null, this.getTagsForStencil(gn, 'dimensionBottom', dt).join(' ')),
  21. this.createVertexTemplateEntry(s + 'coverPlate',
  22. w * 4.4, h * 2.5, '', 'Cover Plate', null, null, this.getTagsForStencil(gn, 'coverPlate', dt).join(' ')),
  23. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;',
  24. w * 4.4, h * 0.25, '25x40', 'Panel Wiring System 25x40mm', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  25. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;',
  26. w * 4.4, h * 0.4, '40x40', 'Panel Wiring System 40x40mm', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  27. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;',
  28. w * 4.4, h * 0.6, '60x40', 'Panel Wiring System 60x40mm', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  29. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;',
  30. w * 4.4, h * 0.8, '80x40', 'Panel Wiring System 80x40mm', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  31. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;',
  32. w * 4.4, h, '100x40', 'Panel Wiring System 100x40mm', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  33. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;rotation=270',
  34. w * 7, h * 0.25, '25x40', 'Panel Wiring System 25x40mm (Vertical)', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  35. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;rotation=270',
  36. w * 7, h * 0.4, '40x40', 'Panel Wiring System 40x40mm (Vertical)', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  37. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;rotation=270',
  38. w * 7, h * 0.6, '60x40', 'Panel Wiring System 60x40mm (Vertical)', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  39. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;rotation=270',
  40. w * 7, h * 0.8, '80x40', 'Panel Wiring System 80x40mm (Vertical)', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  41. this.createVertexTemplateEntry('shape=rect;dashed=0;shadow=0;html=1;whiteSpace=wrap;rotation=270',
  42. w * 7, h, '100x40', 'Panel Wiring System 100x40mm (Vertical)', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
  43. this.createVertexTemplateEntry(s + 'cb_1p;',
  44. w * 0.18, h, '', 'Circuit Breaker (1P)', null, null, this.getTagsForStencil(gn, 'cb_1p', dt).join(' ')),
  45. this.addDataEntry(dt + 'circuit breaker row', w * 1.8, h, 'Circuit Breaker (1P x 10)',
  46. '7dhPb8IgFADwT8PVFLD+Oc66edmS3XZcaIuFSKVpmdZvv9eCOpOZbCRygqQJvNcH9P1uRTSr+03LGvGmS64QfUY0a7U2dlb3GVcKkUSWiK4RIQk8iLzcyeIxmzSs5XvzlwJiCw5MfXEbsYHOnJQLHHhrZMHUK8u5etedNFLvIZVrY3SN6KpkneDDfgksOsFKfTwvTKt3PNNKt+NeNBkHZLZSqR/x7TggLkwNPVhjmDIlq+GcAj6Fw3ur80WeXMLo5nLGhyyNcIVwhWa4e91XQ18nBcvlnptuUuSfeChx3wzb8f5u38aQa9qG65qb9gSvHN1BkF3aIsFlJVxRarudsM6uq0vh1QAmjuF3EhpJ/kfS33A8HmgagbyA8CKUUBqFvITIPJTQLAp5CdFZKKF5FPISmqahhBZRyEsonYYSWkYhL6EZDSWEk0jkRTQnwYhwJPIiWuAHEcHy+odizN38wPgG'),
  47. this.createVertexTemplateEntry(s + 'cb_2p;', w * 0.36, h, '', 'Circuit Breaker (2P)', null, null, this.getTagsForStencil(gn, 'cb_2p', dt).join(' ')),
  48. this.addDataEntry(dt + 'circuit breaker row', w * 3.6, h, 'Circuit Breaker (2P x 10)',
  49. '7ZhNb8MgDIZ/DdeKQD+Pa7r1skm77TiRxA1opESEtem/Hwm0XaVV2pDGCSQkbPMa8HOxQDRv+q1mLX9RFUhEHxHNtVLGrZo+BykRwaJCdIMIwXYi8nQnmo1R3DINe/MbAXGCA5Of4DzO0ZmT9I4DaCNKJp9ZAfJVdcIItbehQhmjGkTXFes4DPmwNTrOKnU8G0arD8iVVHrMRfE4bGQnpPzm343D+rlpbA02mV0yKerhnNI+Bey+9fkiDz5gVHs5401UhnuhvUI73L3p66Guk5IVYg+mm5TFOxkk/s02HfR36za6fNG2oBow+mS3HP1Bw46lU3EQNfeqmSs3Zp2z64vyCsEuPIefmdDE5G9M+lseERBNE6IgRHQeDdEsIQpCNJtGQzRPiIIQLUg0RIuEKAjRCkdDtEyIwtoFHK9fWCVGYYxIvIYhwwlSGKRpvJYhyxKkMEjzf2sarHn9sBhjN/8ZXw=='),
  50. this.createVertexTemplateEntry(s + 'cb_3p;', w * 0.54, h, '', 'Circuit Breaker (3P)', null, null, this.getTagsForStencil(gn, 'cb_3p', dt).join(' ')),
  51. this.addDataEntry(dt + 'circuit breaker row', w * 2.7, h, 'Circuit Breaker (3P x 5)',
  52. '7ZbBbsIwDIafJleUNrBxHWXjskm77TilrWmipbhKPShvP7cJMKQhbUjj1EiRYju/7fi7RKis7lZeN+YFS3BCPQqVeUQKp7rLwDmRSlsKtRRpKnmL9OlCNBmistEeNvQbQRoEW+0+IXiCo6W9i44teLKFds86B/eKrSWLGw7lSIS1UItStwb6fJKN1ugSdweDPH5Ahg79kEvJYXFkbZ375l8Pi/2Gap7BMuGjdrbq6xT8FOB7i0MjDzFA2BxrvNmSTBRyC03fe91V/Vwnhc7tBqidFPm76iXxzZwOuotzG1xxaCvAGsjv+couFupndx9UBmxlomoWxi11G+zqqDxB4EPk8DMTNTL5G5PunMcNEE1HRFchmk1vhmg2IroK0Ty5GaK7EdFViBI5/y9GbJ4+H0Ps7G/yBQ=='),
  53. this.createVertexTemplateEntry(s + 'cb_4p;', w * 0.72, h, '', 'Circuit Breaker (4P)', null, null, this.getTagsForStencil(gn, 'cb_4p', dt).join(' ')),
  54. this.addDataEntry(dt + 'circuit breaker row', w * 3.6, h, 'Circuit Breaker (4P x 5)',
  55. '7ZbBbsIwDIafJlcUmsJ2HWXjskm77TilrWmipbhKPShvP7cJMKQhbUjj1EiRYv/5ncTfJUJldbfyujEvWIIT6lGozCNSWNVdBs6JRNpSqKVIEslTJE8X1OmgykZ72NBvDEkwbLX7hJAJiZb2Lia24MkW2j3rHNwrtpYsbljKkQhroRalbg309SQHrdEl7g4BefyADB36oZaSw2BlbZ37ll8Pg/OGau7BcspL7WzVn1PwU4D3LQ4XeYgCYXM8482WZKKRr9D0d6+7qu/rpNC53QC1kyJ/T3tLfDOXg+5i34ZUbNoKsAbye96yiwexqubBZcBWJrpmod1StyGujs4TBF5EDj8zUSOTvzHpznncAFE6IroK0V1yM0SzEdFViKby/maM5iOj6xil6X8x4vD0+xi0s8/JFw=='),
  56. this.createVertexTemplateEntry(s + 'cb_auxiliary_contact;',
  57. w * 0.09, h, '', 'Auxiliary Contact (Circuit Breaker)', null, null, this.getTagsForStencil(gn, 'cb_auxiliary_contact', dt).join(' ')),
  58. this.createVertexTemplateEntry(s + 'contactor_1_32a;',
  59. w * 0.54, h * 0.86, '', 'Contactor (1-32A)', null, null, this.getTagsForStencil(gn, 'contactor_1_32a', dt).join(' ')),
  60. this.createVertexTemplateEntry(s + 'auxiliary_contact_contactor_1_32a;',
  61. w * 0.09, h * 0.86, '', 'Auxiliary Contact (Contactor 1-32A)', null, null, this.getTagsForStencil(gn, 'auxiliary_contact_contactor_1_32a', dt).join(' ')),
  62. this.createVertexTemplateEntry(s + 'contactor_32_125a;',
  63. w * 0.6, h, '', 'Contactor 32 to 125A', null, null, this.getTagsForStencil(gn, 'contactor_32_125a', dt).join(' ')),
  64. this.createVertexTemplateEntry(s + 'auxiliary_contact_contactor_32_125a;',
  65. w * 0.09, h, '', 'Auxiliary Contact (Contactor 32-125A)', null, null, this.getTagsForStencil(gn, 'auxiliary_contact_contactor_32_125a', dt).join(' ')),
  66. this.createVertexTemplateEntry(s + 'contactor_125_400a;',
  67. w * 1.1, h * 1.8, '', 'Contactor 125 to 400A', null, null, this.getTagsForStencil(gn, 'contactor_125_400a', dt).join(' ')),
  68. this.createVertexTemplateEntry(s + 'distribution_block_4p_125a_11_connections;',
  69. w * 2, h * 1.2, '', 'Distribution Block 4P 125A 11 Connections', null, null, this.getTagsForStencil(gn, 'distribution_block_4p_125a_11_connections', dt).join(' ')),
  70. this.createVertexTemplateEntry(s + 'distribution_block_4p_125a_11_connections_2;',
  71. w * 2, h, '', 'Distribution Block 4P 125A 11 Connections', null, null, this.getTagsForStencil(gn, 'distribution_block_4p_125a_11_connections_2', dt).join(' ')),
  72. this.createVertexTemplateEntry(s + 'mccb_25_63a_3p;',
  73. w * 1.2, h * 1.8, '', 'MCCB 25-63A 3P', null, null, this.getTagsForStencil(gn, 'mccb_25_63a_3p', dt).join(' ')),
  74. this.createVertexTemplateEntry(s + 'mccb_25_63a_4p;',
  75. w * 1.6, h * 1.8, '', 'MCCB 25-63A 4P', null, null, this.getTagsForStencil(gn, 'mccb_25_63a_4p', dt).join(' ')),
  76. this.createVertexTemplateEntry(s + 'mccb_63_250a_3p;',
  77. w * 1.4, h * 2.1, '', 'MCCB 63-250A 3P', null, null, this.getTagsForStencil(gn, 'mccb_63_250a_3p', dt).join(' ')),
  78. this.createVertexTemplateEntry(s + 'mccb_63_250a_4p;',
  79. w * 1.9, h * 2.1, '', 'MCCB 63-250A 4P', null, null, this.getTagsForStencil(gn, 'mccb_63_250a_4p', dt).join(' ')),
  80. this.createVertexTemplateEntry(s + 'motorized_switch_3p;',
  81. w * 1.7, h * 1.4, '', 'Motorized Switch 3P', null, null, this.getTagsForStencil(gn, 'motorized_switch_3p', dt).join(' ')),
  82. this.createVertexTemplateEntry(s + 'motorized_switch_4p;',
  83. w * 2, h * 1.4, '', 'Motorized Switch 4P', null, null, this.getTagsForStencil(gn, 'motorized_switch_4p', dt).join(' ')),
  84. this.createVertexTemplateEntry(s + 'motor_cb_1_32a;',
  85. w * 0.54, h * 0.86, '', 'Motor Circuit Breaker 1-32A', null, null, this.getTagsForStencil(gn, 'motor_cb_1_32a', dt).join(' ')),
  86. this.createVertexTemplateEntry(s + 'motor_cb_32_125a;',
  87. w * 0.6, h, '', 'Motor Circuit Breaker 32-125A', null, null, this.getTagsForStencil(gn, 'motor_cb_32_125a', dt).join(' ')),
  88. this.createVertexTemplateEntry(s + 'motor_cb_125_400a;',
  89. w * 1.1, h * 1.8, '', 'Motor Circuit Breaker 125-400A', null, null, this.getTagsForStencil(gn, 'motor_cb_125_400a', dt).join(' ')),
  90. this.createVertexTemplateEntry(s + 'motor_protection_cb;',
  91. w * 0.54, h, '', 'Motor Protection CB', null, null, this.getTagsForStencil(gn, 'motor_protection_cb', dt).join(' ')),
  92. this.createVertexTemplateEntry(s + 'motor_starter_1_32a;',
  93. w * 0.54, h * 0.86, '', 'Motor Circuit Breaker 1-32A', null, null, this.getTagsForStencil(gn, 'motor_starter_1_32a', dt).join(' ')),
  94. this.createVertexTemplateEntry(s + 'motor_starter_32_125a;',
  95. w * 0.6, h, '', 'Motor Circuit Breaker 32-125A', null, null, this.getTagsForStencil(gn, 'motor_starter_32_125a', dt).join(' ')),
  96. this.createVertexTemplateEntry(s + 'motor_starter_125_400a;',
  97. w * 1.1, h * 1.8, '', 'Motor Circuit Breaker 125-400A', null, null, this.getTagsForStencil(gn, 'motor_starter_125_400a', dt).join(' ')),
  98. this.createVertexTemplateEntry(s + 'overcurrent_relay_1_32a;',
  99. w * 0.54, h * 0.3, '', 'Overcurrent Relay 1-32A', null, null, this.getTagsForStencil(gn, 'overcurrent_relay_1_32a', dt).join(' ')),
  100. this.createVertexTemplateEntry(s + 'overcurrent_relay_32_125a;',
  101. w * 0.6, h * 0.33, '', 'Overcurrent Relay 32-125A', null, null, this.getTagsForStencil(gn, 'overcurrent_relay_32_125a', dt).join(' ')),
  102. this.createVertexTemplateEntry(s + 'overcurrent_relay_125_400a;',
  103. w * 1.1, h * 0.6, '', 'Overcurrent Relay 125-400A', null, null, this.getTagsForStencil(gn, 'overcurrent_relay_125_400a', dt).join(' ')),
  104. this.createVertexTemplateEntry(s + 'plugin_relay_1;',
  105. w * 0.06, h * 0.8, '', 'Plugin Relay', null, null, this.getTagsForStencil(gn, 'plugin_relay_1', dt).join(' ')),
  106. this.createVertexTemplateEntry(s + 'plugin_relay_2;',
  107. w * 0.24, h * 0.8, '', 'Plugin Relay', null, null, this.getTagsForStencil(gn, 'plugin_relay_2', dt).join(' ')),
  108. this.createVertexTemplateEntry(s + 'din_rail;',
  109. w * 10, h * 0.5, '', 'DIN Rail', null, null, this.getTagsForStencil(gn, 'din_rail', dt).join(' ')),
  110. this.createVertexTemplateEntry(s + 'residual_current_device_2p;',
  111. w * 0.36, h, '', 'Residual Current Device 2p', null, null, this.getTagsForStencil(gn, 'residual_current_device_2p', dt).join(' ')),
  112. this.createVertexTemplateEntry(s + 'residual_current_device_4p;',
  113. w * 0.72, h, '', 'Residual Current Device 4p', null, null, this.getTagsForStencil(gn, 'residual_current_device_4p', dt).join(' ')),
  114. this.createVertexTemplateEntry(s + 'surge_protection_1p;',
  115. w * 0.18, h, '', 'Surge Protection 1p', null, null, this.getTagsForStencil(gn, 'surge_protection_1p', dt).join(' ')),
  116. this.createVertexTemplateEntry(s + 'surge_protection_2p;',
  117. w * 0.36, h, '', 'Surge Protection 2p', null, null, this.getTagsForStencil(gn, 'surge_protection_2p', dt).join(' ')),
  118. this.createVertexTemplateEntry(s + 'surge_protection_3p;',
  119. w * 0.54, h, '', 'Surge Protection 3p', null, null, this.getTagsForStencil(gn, 'surge_protection_3p', dt).join(' ')),
  120. this.createVertexTemplateEntry(s + 'surge_protection_4p;',
  121. w * 0.72, h, '', 'Surge Protection 4p', null, null, this.getTagsForStencil(gn, 'surge_protection_4p', dt).join(' ')),
  122. this.createVertexTemplateEntry(s + 'terminal_4mm2;',
  123. w * 0.05, h * 0.5, '', 'Terminal 4mm2', null, null, this.getTagsForStencil(gn, 'terminal_4mm2', dt).join(' ')),
  124. this.createVertexTemplateEntry(s + 'terminal_4mm2_x10;',
  125. w * 0.5, h * 0.5, '', 'Terminal 4mm2 x10', null, null, this.getTagsForStencil(gn, 'terminal_4mm2_x10', dt).join(' ')),
  126. this.createVertexTemplateEntry(s + 'terminal_4_6mm2;',
  127. w * 0.05, h * 0.6, '', 'Terminal 4-6mm2', null, null, this.getTagsForStencil(gn, 'terminal_4_6mm2', dt).join(' ')),
  128. this.createVertexTemplateEntry(s + 'terminal_4_6mm2_x10;',
  129. w * 0.5, h * 0.6, '', 'Terminal 4-6mm2 x10', null, null, this.getTagsForStencil(gn, 'terminal_4_6mm2_x10', dt).join(' ')),
  130. this.createVertexTemplateEntry(s + 'terminal_6_25mm2;',
  131. w * 0.1, h * 0.75, '', 'Terminal 6-25mm2', null, null, this.getTagsForStencil(gn, 'terminal_6_25mm2', dt).join(' ')),
  132. this.createVertexTemplateEntry(s + 'terminal_6_25mm2_x10;',
  133. w, h * 0.75, '', 'Terminal 6-25mm2 x10', null, null, this.getTagsForStencil(gn, 'terminal_6_25mm2_x10', dt).join(' ')),
  134. this.createVertexTemplateEntry(s + 'terminal_40mm2;',
  135. w * 0.22, h, '', 'Terminal 40mm2', null, null, this.getTagsForStencil(gn, 'terminal_40mm2', dt).join(' ')),
  136. this.createVertexTemplateEntry(s + 'terminal_40mm2_x10;',
  137. w * 2.2, h, '', 'Terminal 40mm2 x10', null, null, this.getTagsForStencil(gn, 'terminal_40mm2_x10', dt).join(' ')),
  138. this.createVertexTemplateEntry(s + 'terminal_50mm2;',
  139. w * 0.25, h * 1.1, '', 'Terminal 50mm2', null, null, this.getTagsForStencil(gn, 'terminal_50mm2', dt).join(' ')),
  140. this.createVertexTemplateEntry(s + 'terminal_50mm2_x10;',
  141. w * 2.5, h * 1.1, '', 'Terminal 50mm2 x10', null, null, this.getTagsForStencil(gn, 'terminal_50mm2_x10', dt).join(' ')),
  142. this.createVertexTemplateEntry(s + 'terminal_75mm2;',
  143. w * 0.3, h * 1.4, '', 'Terminal 75mm2', null, null, this.getTagsForStencil(gn, 'terminal_75mm2', dt).join(' ')),
  144. this.createVertexTemplateEntry(s + 'terminal_75mm2_x10;',
  145. w * 3, h * 1.4, '', 'Terminal 75mm2 x10', null, null, this.getTagsForStencil(gn, 'terminal_75mm2_x10', dt).join(' '))
  146. ];
  147. this.addPalette('cabinets', mxResources.get('cabinets'), false, mxUtils.bind(this, function(content)
  148. {
  149. for (var i = 0; i < fns.length; i++)
  150. {
  151. content.appendChild(fns[i](content));
  152. }
  153. }));
  154. };
  155. })();