@fmsim/machine 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agv-line.js +3 -0
- package/dist/agv-line.js.map +1 -1
- package/dist/agv.js +3 -0
- package/dist/agv.js.map +1 -1
- package/dist/buffer.js +3 -0
- package/dist/buffer.js.map +1 -1
- package/dist/conveyor-join.js +3 -0
- package/dist/conveyor-join.js.map +1 -1
- package/dist/conveyor.js +3 -0
- package/dist/conveyor.js.map +1 -1
- package/dist/crane.js +1 -2
- package/dist/crane.js.map +1 -1
- package/dist/equipment.js +3 -0
- package/dist/equipment.js.map +1 -1
- package/dist/mcs-machine.js +1 -1
- package/dist/mcs-machine.js.map +1 -1
- package/dist/mcs-transport.js +1 -1
- package/dist/mcs-transport.js.map +1 -1
- package/dist/mcs-unit.js +1 -1
- package/dist/mcs-unit.js.map +1 -1
- package/dist/mcs-vehicle.js +1 -1
- package/dist/mcs-vehicle.js.map +1 -1
- package/dist/oht-line.js +3 -0
- package/dist/oht-line.js.map +1 -1
- package/dist/oht.js +3 -0
- package/dist/oht.js.map +1 -1
- package/dist/port-flow.js +10 -10
- package/dist/port-flow.js.map +1 -1
- package/dist/port.js +3 -0
- package/dist/port.js.map +1 -1
- package/dist/scene/root-container-override.js +166 -10
- package/dist/scene/root-container-override.js.map +1 -1
- package/dist/shelf.js +3 -0
- package/dist/shelf.js.map +1 -1
- package/dist/shuttle.js +3 -0
- package/dist/shuttle.js.map +1 -1
- package/dist/stocker.js +3 -0
- package/dist/stocker.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/agv-line.ts +4 -0
- package/src/agv.ts +4 -0
- package/src/buffer.ts +4 -0
- package/src/conveyor-join.ts +4 -0
- package/src/conveyor.ts +4 -0
- package/src/crane.ts +1 -1
- package/src/equipment.ts +4 -0
- package/src/mcs-machine.ts +1 -1
- package/src/mcs-transport.ts +1 -1
- package/src/mcs-unit.ts +1 -1
- package/src/mcs-vehicle.ts +1 -1
- package/src/oht-line.ts +4 -0
- package/src/oht.ts +4 -0
- package/src/port-flow.ts +10 -10
- package/src/port.ts +4 -0
- package/src/scene/root-container-override.ts +188 -12
- package/src/shelf.ts +4 -0
- package/src/shuttle.ts +4 -0
- package/src/stocker.ts +4 -0
- package/translations/en.json +14 -4
- package/translations/ja.json +16 -4
- package/translations/ko.json +16 -4
- package/translations/ms.json +16 -4
- package/translations/zh.json +16 -4
- package/dist/root-container-override.js +0 -2
- package/dist/root-container-override.js.map +0 -1
- package/src/root-container-override.ts +0 -1
package/dist/port-flow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port-flow.js","sourceRoot":"","sources":["../src/port-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,KAAK,EAAc,MAAM,wBAAwB,CAAA;AAChG,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAE/F,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,GAAG,2BAA2B;QAC9B;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,aAAa;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,CAAC;aAC9E;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,gBAAgB;YACvB,QAAQ,EAAE;gBACR,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;aAC5C;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;YAClB,QAAQ,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,YAAY,CAAC,KAAiB,EAAE,MAAkB;QAChD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAA;QAEhC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACvC,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature, RectPath, Shape, Properties } from '@hatiolab/things-scene'\nimport { ParentObjectMixin, ParentObjectMixinProperties } from './features/parent-object-mixin'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n ...ParentObjectMixinProperties,\n {\n type: 'select',\n name: 'orientation',\n label: 'orientation',\n property: {\n options: ['left to right', 'right to left', 'top to bottom', 'bottom to top']\n }\n },\n {\n type: 'select',\n name: 'labelPosition',\n label: 'label-position',\n property: {\n options: ['left', 'right', 'top', 'bottom']\n }\n },\n {\n type: 'select',\n name: 'direction',\n label: 'direction',\n property: {\n options: ['IN', 'OUT', 'BOTH']\n }\n },\n {\n type: 'checkbox',\n name: 'showText',\n label: 'show-text'\n }\n ]\n}\n\nexport default class PortFlow extends ParentObjectMixin(RectPath(Shape)) {\n static get nature() {\n return NATURE\n }\n\n get hasTextProperty() {\n return this.getState('showText') || false\n }\n\n get textBounds() {\n var { paddingTop, paddingLeft, paddingRight, paddingBottom, fontSize = 24 } = this.state\n\n paddingBottom ||= 0\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n var { left, top, width, height } = this.bounds\n var { labelPosition = 'top' } = this.state\n\n left += paddingLeft\n top += paddingTop\n width = Math.max(width - paddingLeft - paddingRight, 0)\n height = Math.max(height - paddingTop - paddingBottom, 0)\n\n switch (labelPosition) {\n case 'top':\n return {\n left,\n top: top - fontSize,\n width,\n height: fontSize\n }\n case 'bottom':\n return {\n left,\n top: top + height,\n width,\n height: fontSize\n }\n case 'left':\n return {\n left: left - fontSize * 4,\n top,\n width: fontSize * 4,\n height\n }\n case 'right':\n return {\n left: left + width,\n top,\n width: fontSize * 4,\n height\n }\n default:\n return {\n left,\n top: top - fontSize,\n width,\n height: fontSize\n }\n }\n }\n\n get text() {\n const { direction = 'IN' } = this.state\n\n return direction.toUpperCase()\n }\n\n render(ctx) {\n const { left, top, width, height } = this.bounds\n var { orientation = 'left to right', direction = 'BOTH' }: { orientation?: string; direction?: string } = this.state\n const { INOUTTYPE } = this.data || {}\n\n if (INOUTTYPE) {\n direction = INOUTTYPE /* IN | OUT | BOTH */\n }\n\n ctx.beginPath()\n\n const arrowSize = Math.min(width, height) * 0.5\n const bodyWidth = orientation === 'left to right' || orientation === 'right to left' ? height * 0.2 : width * 0.2\n const centerX = left + width / 2\n const centerY = top + height / 2\n\n let startX, startY, endX, endY\n let reverse = 1\n\n switch (orientation) {\n case 'left to right':\n startX = left\n endX = left + width\n startY = centerY\n endY = centerY\n break\n case 'right to left':\n startX = left + width\n endX = left\n startY = centerY\n endY = centerY\n reverse = -1\n break\n case 'top to bottom':\n startX = centerX\n endX = centerX\n startY = top\n endY = top + height\n break\n case 'bottom to top':\n startX = centerX\n endX = centerX\n startY = top + height\n endY = top\n reverse = -1\n break\n }\n\n ctx.lineTo(startX, startY)\n\n if (orientation.includes('left')) {\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX + arrowSize * reverse, startY - bodyWidth * reverse * 2)\n } else {\n ctx.lineTo(startX, startY - bodyWidth * reverse)\n }\n\n ctx.lineTo(startX + arrowSize * reverse, startY - bodyWidth * reverse)\n ctx.lineTo(endX - arrowSize * reverse, endY - bodyWidth * reverse)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX - arrowSize * reverse, endY - bodyWidth * 2 * reverse)\n } else {\n ctx.lineTo(endX, endY - bodyWidth * reverse)\n }\n\n ctx.lineTo(endX, endY)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX - arrowSize * reverse, endY + bodyWidth * 2 * reverse)\n } else {\n ctx.lineTo(endX, endY + bodyWidth * reverse)\n }\n\n ctx.lineTo(endX - arrowSize * reverse, endY + bodyWidth * reverse)\n ctx.lineTo(startX + arrowSize * reverse, startY + bodyWidth * reverse)\n\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX + arrowSize * reverse, startY + bodyWidth * 2 * reverse)\n } else {\n ctx.lineTo(startX, startY + bodyWidth * reverse)\n }\n } else {\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX - bodyWidth * reverse * 2, startY + arrowSize * reverse)\n } else {\n ctx.lineTo(startX - bodyWidth * reverse, startY)\n }\n\n ctx.lineTo(startX - bodyWidth * reverse, startY + arrowSize * reverse)\n ctx.lineTo(endX - bodyWidth * reverse, endY - arrowSize * reverse)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX - bodyWidth * 2 * reverse, endY - arrowSize * reverse)\n } else {\n ctx.lineTo(endX - bodyWidth * reverse, endY)\n }\n\n ctx.lineTo(endX, endY)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX + bodyWidth * 2 * reverse, endY - arrowSize * reverse)\n } else {\n ctx.lineTo(endX + bodyWidth * reverse, endY)\n }\n\n ctx.lineTo(endX + bodyWidth * reverse, endY - arrowSize * reverse)\n ctx.lineTo(startX + bodyWidth * reverse, startY + arrowSize * reverse)\n\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX + bodyWidth * 2 * reverse, startY + arrowSize * reverse)\n } else {\n ctx.lineTo(startX + bodyWidth * reverse, startY)\n }\n }\n\n ctx.closePath()\n\n this.drawStroke(ctx)\n }\n\n onchangeData(after: Properties, before: Properties): void {\n const { INOUTTYPE } = after.data\n\n this.setState('direction', INOUTTYPE)\n }\n}\n\nComponent.register('PortFlow', PortFlow)\n"]}
|
|
1
|
+
{"version":3,"file":"port-flow.js","sourceRoot":"","sources":["../src/port-flow.ts"],"names":[],"mappings":"AAAA,OAAO,E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C,MAAM,CAAC,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,IAAI,CAAC,CAAA;YAC9C,CAAC;YAED,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;YAClE,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;YAEtE,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;gBAChD,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;YAC5E,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,OAAO,EAAE,MAAM,CAAC,CAAA;YAClD,CAAC;QACH,CAAC;QAED,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;IAED,YAAY,CAAC,KAAiB,EAAE,MAAkB;QAChD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAA;QAEhC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACvC,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature, RectPath, Shape, Properties } from '@hatiolab/things-scene'\nimport { ParentObjectMixin, ParentObjectMixinProperties } from './features/parent-object-mixin'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n ...ParentObjectMixinProperties,\n {\n type: 'select',\n name: 'orientation',\n label: 'orientation',\n property: {\n options: ['left to right', 'right to left', 'top to bottom', 'bottom to top']\n }\n },\n {\n type: 'select',\n name: 'labelPosition',\n label: 'label-position',\n property: {\n options: ['left', 'right', 'top', 'bottom']\n }\n },\n {\n type: 'select',\n name: 'direction',\n label: 'direction',\n property: {\n options: ['IN', 'OUT', 'BOTH']\n }\n },\n {\n type: 'checkbox',\n name: 'showText',\n label: 'show-text'\n }\n ]\n}\n\nexport default class PortFlow extends ParentObjectMixin(RectPath(Shape)) {\n static get nature() {\n return NATURE\n }\n\n get hasTextProperty() {\n return this.getState('showText') || false\n }\n\n get textBounds() {\n var { paddingTop, paddingLeft, paddingRight, paddingBottom, fontSize = 24 } = this.state\n\n paddingBottom ||= 0\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n var { left, top, width, height } = this.bounds\n var { labelPosition = 'top' } = this.state\n\n left += paddingLeft\n top += paddingTop\n width = Math.max(width - paddingLeft - paddingRight, 0)\n height = Math.max(height - paddingTop - paddingBottom, 0)\n\n switch (labelPosition) {\n case 'top':\n return {\n left,\n top: top - fontSize,\n width,\n height: fontSize\n }\n case 'bottom':\n return {\n left,\n top: top + height,\n width,\n height: fontSize\n }\n case 'left':\n return {\n left: left - fontSize * 4,\n top,\n width: fontSize * 4,\n height\n }\n case 'right':\n return {\n left: left + width,\n top,\n width: fontSize * 4,\n height\n }\n default:\n return {\n left,\n top: top - fontSize,\n width,\n height: fontSize\n }\n }\n }\n\n get text() {\n const { direction = 'IN' } = this.state\n\n return direction.toUpperCase()\n }\n\n render(ctx) {\n const { left, top, width, height } = this.bounds\n var { orientation = 'left to right', direction = 'BOTH' }: { orientation?: string; direction?: string } = this.state\n const { INOUTTYPE } = this.data || {}\n\n if (INOUTTYPE) {\n direction = INOUTTYPE /* IN | OUT | BOTH */\n }\n\n ctx.beginPath()\n\n const arrowSize = Math.min(width, height) * 1\n const bodyWidth = orientation === 'left to right' || orientation === 'right to left' ? height * 0.1 : width * 0.1\n const centerX = left + width / 2\n const centerY = top + height / 2\n\n let startX, startY, endX, endY\n let reverse = 1\n\n switch (orientation) {\n case 'left to right':\n startX = left\n endX = left + width\n startY = centerY\n endY = centerY\n break\n case 'right to left':\n startX = left + width\n endX = left\n startY = centerY\n endY = centerY\n reverse = -1\n break\n case 'top to bottom':\n startX = centerX\n endX = centerX\n startY = top\n endY = top + height\n break\n case 'bottom to top':\n startX = centerX\n endX = centerX\n startY = top + height\n endY = top\n reverse = -1\n break\n }\n\n ctx.lineTo(startX, startY)\n\n if (orientation.includes('left')) {\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX + arrowSize * reverse, startY - bodyWidth * reverse * 8)\n } else {\n ctx.lineTo(startX, startY - bodyWidth * reverse)\n }\n\n ctx.lineTo(startX + arrowSize * reverse, startY - bodyWidth * reverse)\n ctx.lineTo(endX - arrowSize * reverse, endY - bodyWidth * reverse)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX - arrowSize * reverse, endY - bodyWidth * 8 * reverse)\n } else {\n ctx.lineTo(endX, endY - bodyWidth * reverse)\n }\n\n ctx.lineTo(endX, endY)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX - arrowSize * reverse, endY + bodyWidth * 8 * reverse)\n } else {\n ctx.lineTo(endX, endY + bodyWidth * reverse)\n }\n\n ctx.lineTo(endX - arrowSize * reverse, endY + bodyWidth * reverse)\n ctx.lineTo(startX + arrowSize * reverse, startY + bodyWidth * reverse)\n\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX + arrowSize * reverse, startY + bodyWidth * 8 * reverse)\n } else {\n ctx.lineTo(startX, startY + bodyWidth * reverse)\n }\n } else {\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX - bodyWidth * reverse * 8, startY + arrowSize * reverse)\n } else {\n ctx.lineTo(startX - bodyWidth * reverse, startY)\n }\n\n ctx.lineTo(startX - bodyWidth * reverse, startY + arrowSize * reverse)\n ctx.lineTo(endX - bodyWidth * reverse, endY - arrowSize * reverse)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX - bodyWidth * 8 * reverse, endY - arrowSize * reverse)\n } else {\n ctx.lineTo(endX - bodyWidth * reverse, endY)\n }\n\n ctx.lineTo(endX, endY)\n\n if (direction === 'IN' || direction === 'BOTH') {\n ctx.lineTo(endX + bodyWidth * 8 * reverse, endY - arrowSize * reverse)\n } else {\n ctx.lineTo(endX + bodyWidth * reverse, endY)\n }\n\n ctx.lineTo(endX + bodyWidth * reverse, endY - arrowSize * reverse)\n ctx.lineTo(startX + bodyWidth * reverse, startY + arrowSize * reverse)\n\n if (direction === 'OUT' || direction === 'BOTH') {\n ctx.lineTo(startX + bodyWidth * 8 * reverse, startY + arrowSize * reverse)\n } else {\n ctx.lineTo(startX + bodyWidth * reverse, startY)\n }\n }\n\n ctx.closePath()\n\n this.drawStroke(ctx)\n }\n\n onchangeData(after: Properties, before: Properties): void {\n const { INOUTTYPE } = after.data\n\n this.setState('direction', INOUTTYPE)\n }\n}\n\nComponent.register('PortFlow', PortFlow)\n"]}
|
package/dist/port.js
CHANGED
|
@@ -14,6 +14,9 @@ export default class Port extends MCSZoneMixin(MCSCarrierHolder) {
|
|
|
14
14
|
get auxColor() {
|
|
15
15
|
return 'black';
|
|
16
16
|
}
|
|
17
|
+
getLegendFallback() {
|
|
18
|
+
return this.root.portLegendTheme || super.getLegendFallback();
|
|
19
|
+
}
|
|
17
20
|
render(ctx) {
|
|
18
21
|
var { left, top, width, height } = this.bounds;
|
|
19
22
|
ctx.strokeStyle = this.auxColor;
|
package/dist/port.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port.js","sourceRoot":"","sources":["../src/port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AAEnD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,sBAAsB,EAAE,GAAG,gBAAgB,CAAC,UAAU,CAAC;CACxE,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IAC9D,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC/B,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,WAAY,CAAA;QACjC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;QACjB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;QACrB,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QAEnB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,oBAAoB;QACpB,2DAA2D;QAC3D,kDAAkD;QAClD,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAElC,GAAG,CAAC,IAAI,EAAE,CAAA;QACV,GAAG,CAAC,MAAM,EAAE,CAAA;IACd,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature } from '@hatiolab/things-scene'\nimport { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'\nimport MCSCarrierHolder from './mcs-carrier-holder'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSZoneMixinProperties, ...MCSCarrierHolder.properties]\n}\n\nexport default class Port extends MCSZoneMixin(MCSCarrierHolder) {\n static get nature() {\n return NATURE\n }\n\n get auxColor() {\n return 'black'\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.strokeStyle = this.auxColor\n ctx.fillStyle = this.statusColor!\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.setLineDash([])\n\n ctx.beginPath()\n\n // Performance aware\n // const radius = Math.round(Math.min(width, height) * 0.1)\n // ctx.roundRect(left, top, width, height, radius)\n ctx.rect(left, top, width, height)\n\n ctx.fill()\n ctx.stroke()\n }\n}\n\nComponent.register('Port', Port)\n"]}
|
|
1
|
+
{"version":3,"file":"port.js","sourceRoot":"","sources":["../src/port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AAEnD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,sBAAsB,EAAE,GAAG,gBAAgB,CAAC,UAAU,CAAC;CACxE,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IAC9D,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAA;IAC/D,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC/B,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,WAAY,CAAA;QACjC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;QACjB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;QACrB,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QAEnB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,oBAAoB;QACpB,2DAA2D;QAC3D,kDAAkD;QAClD,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAElC,GAAG,CAAC,IAAI,EAAE,CAAA;QACV,GAAG,CAAC,MAAM,EAAE,CAAA;IACd,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature } from '@hatiolab/things-scene'\nimport { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'\nimport MCSCarrierHolder from './mcs-carrier-holder'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSZoneMixinProperties, ...MCSCarrierHolder.properties]\n}\n\nexport default class Port extends MCSZoneMixin(MCSCarrierHolder) {\n static get nature() {\n return NATURE\n }\n\n get auxColor() {\n return 'black'\n }\n\n getLegendFallback() {\n return this.root.portLegendTheme || super.getLegendFallback()\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.strokeStyle = this.auxColor\n ctx.fillStyle = this.statusColor!\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.setLineDash([])\n\n ctx.beginPath()\n\n // Performance aware\n // const radius = Math.round(Math.min(width, height) * 0.1)\n // ctx.roundRect(left, top, width, height, radius)\n ctx.rect(left, top, width, height)\n\n ctx.fill()\n ctx.stroke()\n }\n}\n\nComponent.register('Port', Port)\n"]}
|
|
@@ -8,18 +8,114 @@ Object.defineProperty(ModelLayer.prototype, 'nature', {
|
|
|
8
8
|
rotatable: false,
|
|
9
9
|
resizable: true,
|
|
10
10
|
properties: [
|
|
11
|
+
{
|
|
12
|
+
type: 'legend',
|
|
13
|
+
label: '',
|
|
14
|
+
name: 'LEGENDS',
|
|
15
|
+
property: {
|
|
16
|
+
label: 'LEGENDS'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'select',
|
|
21
|
+
label: 'equipment-legend-name',
|
|
22
|
+
name: 'equipmentLegendName',
|
|
23
|
+
property: {
|
|
24
|
+
options: themesColorMap
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'select',
|
|
29
|
+
label: 'buffer-legend-name',
|
|
30
|
+
name: 'bufferLegendName',
|
|
31
|
+
property: {
|
|
32
|
+
options: themesColorMap
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: 'select',
|
|
37
|
+
label: 'agvline-legend-name',
|
|
38
|
+
name: 'agvlineLegendName',
|
|
39
|
+
property: {
|
|
40
|
+
options: themesColorMap
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'select',
|
|
45
|
+
label: 'ohtline-legend-name',
|
|
46
|
+
name: 'ohtlineLegendName',
|
|
47
|
+
property: {
|
|
48
|
+
options: themesColorMap
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: 'select',
|
|
53
|
+
label: 'conveyor-legend-name',
|
|
54
|
+
name: 'conveyorLegendName',
|
|
55
|
+
property: {
|
|
56
|
+
options: themesColorMap
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: 'select',
|
|
61
|
+
label: 'stoker-legend-name',
|
|
62
|
+
name: 'stokerLegendName',
|
|
63
|
+
property: {
|
|
64
|
+
options: themesColorMap
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'select',
|
|
69
|
+
label: 'port-legend-name',
|
|
70
|
+
name: 'portLegendName',
|
|
71
|
+
property: {
|
|
72
|
+
options: themesColorMap
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: 'select',
|
|
77
|
+
label: 'agv-legend-name',
|
|
78
|
+
name: 'agvLegendName',
|
|
79
|
+
property: {
|
|
80
|
+
options: themesColorMap
|
|
81
|
+
}
|
|
82
|
+
},
|
|
11
83
|
{
|
|
12
84
|
type: 'select',
|
|
13
|
-
label: '
|
|
14
|
-
name: '
|
|
85
|
+
label: 'oht-legend-name',
|
|
86
|
+
name: 'ohtLegendName',
|
|
15
87
|
property: {
|
|
16
88
|
options: themesColorMap
|
|
17
89
|
}
|
|
18
90
|
},
|
|
19
91
|
{
|
|
20
92
|
type: 'select',
|
|
21
|
-
label: '
|
|
22
|
-
name: '
|
|
93
|
+
label: 'shuttle-legend-name',
|
|
94
|
+
name: 'shuttleLegendName',
|
|
95
|
+
property: {
|
|
96
|
+
options: themesColorMap
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'select',
|
|
101
|
+
label: 'crane-legend-name',
|
|
102
|
+
name: 'craneLegendName',
|
|
103
|
+
property: {
|
|
104
|
+
options: themesColorMap
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'select',
|
|
109
|
+
label: 'port-legend-name',
|
|
110
|
+
name: 'portLegendName',
|
|
111
|
+
property: {
|
|
112
|
+
options: themesColorMap
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'select',
|
|
117
|
+
label: 'shelf-legend-name',
|
|
118
|
+
name: 'shelfLegendName',
|
|
23
119
|
property: {
|
|
24
120
|
options: themesColorMap
|
|
25
121
|
}
|
|
@@ -61,16 +157,76 @@ Object.defineProperty(ModelLayer.prototype, 'nature', {
|
|
|
61
157
|
};
|
|
62
158
|
}
|
|
63
159
|
});
|
|
64
|
-
Object.defineProperty(RootContainer.prototype, '
|
|
160
|
+
Object.defineProperty(RootContainer.prototype, 'equipmentLegendTheme', {
|
|
161
|
+
get: function () {
|
|
162
|
+
const { equipmentLegendName } = this.rootModel.state;
|
|
163
|
+
return equipmentLegendName && this.state.style[equipmentLegendName];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(RootContainer.prototype, 'bufferLegendTheme', {
|
|
167
|
+
get: function () {
|
|
168
|
+
const { bufferLegendName } = this.rootModel.state;
|
|
169
|
+
return bufferLegendName && this.state.style[bufferLegendName];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(RootContainer.prototype, 'agvlineLegendTheme', {
|
|
173
|
+
get: function () {
|
|
174
|
+
const { agvlineLegendName } = this.rootModel.state;
|
|
175
|
+
return agvlineLegendName && this.state.style[agvlineLegendName];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(RootContainer.prototype, 'ohtlineLegendTheme', {
|
|
179
|
+
get: function () {
|
|
180
|
+
const { ohtlineLegendName } = this.rootModel.state;
|
|
181
|
+
return ohtlineLegendName && this.state.style[ohtlineLegendName];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(RootContainer.prototype, 'conveyorLegendTheme', {
|
|
185
|
+
get: function () {
|
|
186
|
+
const { conveyorLegendName } = this.rootModel.state;
|
|
187
|
+
return conveyorLegendName && this.state.style[conveyorLegendName];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(RootContainer.prototype, 'stokerLegendTheme', {
|
|
191
|
+
get: function () {
|
|
192
|
+
const { stokerLegendName } = this.rootModel.state;
|
|
193
|
+
return stokerLegendName && this.state.style[stokerLegendName];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(RootContainer.prototype, 'agvLegendTheme', {
|
|
197
|
+
get: function () {
|
|
198
|
+
const { agvLegendName } = this.rootModel.state;
|
|
199
|
+
return agvLegendName && this.state.style[agvLegendName];
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(RootContainer.prototype, 'ohtLegendTheme', {
|
|
203
|
+
get: function () {
|
|
204
|
+
const { ohtLegendName } = this.rootModel.state;
|
|
205
|
+
return ohtLegendName && this.state.style[ohtLegendName];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(RootContainer.prototype, 'shuttleLegendTheme', {
|
|
209
|
+
get: function () {
|
|
210
|
+
const { shuttleLegendName } = this.rootModel.state;
|
|
211
|
+
return shuttleLegendName && this.state.style[shuttleLegendName];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(RootContainer.prototype, 'craneLegendTheme', {
|
|
215
|
+
get: function () {
|
|
216
|
+
const { craneLegendName } = this.rootModel.state;
|
|
217
|
+
return craneLegendName && this.state.style[craneLegendName];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(RootContainer.prototype, 'shelfLegendTheme', {
|
|
65
221
|
get: function () {
|
|
66
|
-
const {
|
|
67
|
-
return
|
|
222
|
+
const { shelfLegendName } = this.rootModel.state;
|
|
223
|
+
return shelfLegendName && this.state.style[shelfLegendName];
|
|
68
224
|
}
|
|
69
225
|
});
|
|
70
|
-
Object.defineProperty(RootContainer.prototype, '
|
|
226
|
+
Object.defineProperty(RootContainer.prototype, 'portLegendTheme', {
|
|
71
227
|
get: function () {
|
|
72
|
-
const {
|
|
73
|
-
return
|
|
228
|
+
const { portLegendName } = this.rootModel.state;
|
|
229
|
+
return portLegendName && this.state.style[portLegendName];
|
|
74
230
|
}
|
|
75
231
|
});
|
|
76
232
|
Object.defineProperty(RootContainer.prototype, 'carrierLegendTheme', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-container-override.js","sourceRoot":"","sources":["../../src/scene/root-container-override.ts"],"names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aAAa,CAAC,SAAS,EAAE,4BAA4B,EAAE;IAC3E,GAAG,EAAE;QACH,MAAM,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAC1D,OAAO,yBAAyB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;IACjF,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,yBAAyB,EAAE;IACxE,GAAG,EAAE;QACH,MAAM,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QACvD,OAAO,sBAAsB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;IAC3E,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { Component, RootContainer } from '@hatiolab/things-scene'\nimport { themesColorMap, themesColorRange, themesAnimationMap } from '@fmsim/api'\nimport { Legend } from '../features/mcs-status-default'\n\n// RootContainer 클래스 타입 확장\ndeclare module '@hatiolab/things-scene' {\n interface RootContainer {\n machineLegendTheme?: any\n unitLegendTheme?: any\n carrierLegendTheme?: any\n carrierAnimationTheme?: any\n stockerCapacityLegendTheme?: any\n zoneCapacityLegendTheme?: any\n style: { [key: string]: any | Legend }\n }\n}\n\nconst ModelLayer = Component.register('model-layer') as any\n\nObject.defineProperty(ModelLayer.prototype, 'nature', {\n get: function () {\n return {\n mutable: false,\n rotatable: false,\n resizable: true,\n properties: [\n {\n type: 'select',\n label: 'machine-legend-name',\n name: 'machineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'unit-legend-name',\n name: 'unitLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-legend-name',\n name: 'carrierLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-animation-name',\n name: 'carrierAnimationName',\n property: {\n options: themesAnimationMap\n }\n },\n {\n type: 'select',\n label: 'stocker-capacity-legend-name',\n name: 'stockerCapacityLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'select',\n label: 'zone-capacity-legend-name',\n name: 'zoneCapacityLegendName',\n property: {\n options: themesColorRange\n }\n }\n ],\n 'value-property': 'text'\n }\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'machineLegendTheme', {\n get: function () {\n const { machineLegendName } = this.rootModel.state\n return machineLegendName && this.state.style[machineLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'unitLegendTheme', {\n get: function () {\n const { unitLegendName } = this.rootModel.state\n return unitLegendName && this.state.style[unitLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierLegendTheme', {\n get: function () {\n const { carrierLegendName } = this.rootModel.state\n return carrierLegendName && this.state.style[carrierLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierAnimationTheme', {\n get: function () {\n const { carrierAnimationName } = this.rootModel.state\n return carrierAnimationName && this.state.style[carrierAnimationName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'stockerCapacityLegendTheme', {\n get: function () {\n const { stockerCapacityLegendName } = this.rootModel.state\n return stockerCapacityLegendName && this.state.style[stockerCapacityLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'zoneCapacityLegendTheme', {\n get: function () {\n const { zoneCapacityLegendName } = this.rootModel.state\n return zoneCapacityLegendName && this.state.style[zoneCapacityLegendName]\n }\n})\n"]}
|
|
1
|
+
{"version":3,"file":"root-container-override.js","sourceRoot":"","sources":["../../src/scene/root-container-override.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AA0BjF,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAQ,CAAA;AAE3D,MAAM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;QACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAClD,OAAO,iBAAiB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACjE,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,uBAAuB,EAAE;IACtE,GAAG,EAAE;QACH,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QACrD,OAAO,oBAAoB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IACvE,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,4BAA4B,EAAE;IAC3E,GAAG,EAAE;QACH,MAAM,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAC1D,OAAO,yBAAyB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;IACjF,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,yBAAyB,EAAE;IACxE,GAAG,EAAE;QACH,MAAM,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QACvD,OAAO,sBAAsB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;IAC3E,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { Component, RootContainer } from '@hatiolab/things-scene'\nimport { themesColorMap, themesColorRange, themesAnimationMap } from '@fmsim/api'\nimport { Legend } from '../features/mcs-status-default'\n\n// RootContainer 클래스 타입 확장\ndeclare module '@hatiolab/things-scene' {\n interface RootContainer {\n portLegendTheme?: any\n carrierLegendTheme?: any\n carrierAnimationTheme?: any\n stockerCapacityLegendTheme?: any\n zoneCapacityLegendTheme?: any\n bufferLegendTheme?: any\n agvlineLegendTheme?: any\n ohtlineLegendTheme?: any\n conveyorLegendTheme?: any\n stokerLegendTheme?: any\n agvLegendTheme?: any\n ohtLegendTheme?: any\n shuttleLegendTheme?: any\n craneLegendTheme?: any\n shelfLegendTheme?: any\n equipmentLegendTheme?: any\n style: { [key: string]: any | Legend }\n }\n}\n\nconst ModelLayer = Component.register('model-layer') as any\n\nObject.defineProperty(ModelLayer.prototype, 'nature', {\n get: function () {\n return {\n mutable: false,\n rotatable: false,\n resizable: true,\n properties: [\n {\n type: 'legend',\n label: '',\n name: 'LEGENDS',\n property: {\n label: 'LEGENDS'\n }\n },\n {\n type: 'select',\n label: 'equipment-legend-name',\n name: 'equipmentLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'buffer-legend-name',\n name: 'bufferLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'agvline-legend-name',\n name: 'agvlineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'ohtline-legend-name',\n name: 'ohtlineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'conveyor-legend-name',\n name: 'conveyorLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'stoker-legend-name',\n name: 'stokerLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'port-legend-name',\n name: 'portLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'agv-legend-name',\n name: 'agvLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'oht-legend-name',\n name: 'ohtLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'shuttle-legend-name',\n name: 'shuttleLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'crane-legend-name',\n name: 'craneLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'port-legend-name',\n name: 'portLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'shelf-legend-name',\n name: 'shelfLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-legend-name',\n name: 'carrierLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-animation-name',\n name: 'carrierAnimationName',\n property: {\n options: themesAnimationMap\n }\n },\n {\n type: 'select',\n label: 'stocker-capacity-legend-name',\n name: 'stockerCapacityLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'select',\n label: 'zone-capacity-legend-name',\n name: 'zoneCapacityLegendName',\n property: {\n options: themesColorRange\n }\n }\n ],\n 'value-property': 'text'\n }\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'equipmentLegendTheme', {\n get: function () {\n const { equipmentLegendName } = this.rootModel.state\n return equipmentLegendName && this.state.style[equipmentLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'bufferLegendTheme', {\n get: function () {\n const { bufferLegendName } = this.rootModel.state\n return bufferLegendName && this.state.style[bufferLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'agvlineLegendTheme', {\n get: function () {\n const { agvlineLegendName } = this.rootModel.state\n return agvlineLegendName && this.state.style[agvlineLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'ohtlineLegendTheme', {\n get: function () {\n const { ohtlineLegendName } = this.rootModel.state\n return ohtlineLegendName && this.state.style[ohtlineLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'conveyorLegendTheme', {\n get: function () {\n const { conveyorLegendName } = this.rootModel.state\n return conveyorLegendName && this.state.style[conveyorLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'stokerLegendTheme', {\n get: function () {\n const { stokerLegendName } = this.rootModel.state\n return stokerLegendName && this.state.style[stokerLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'agvLegendTheme', {\n get: function () {\n const { agvLegendName } = this.rootModel.state\n return agvLegendName && this.state.style[agvLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'ohtLegendTheme', {\n get: function () {\n const { ohtLegendName } = this.rootModel.state\n return ohtLegendName && this.state.style[ohtLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'shuttleLegendTheme', {\n get: function () {\n const { shuttleLegendName } = this.rootModel.state\n return shuttleLegendName && this.state.style[shuttleLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'craneLegendTheme', {\n get: function () {\n const { craneLegendName } = this.rootModel.state\n return craneLegendName && this.state.style[craneLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'shelfLegendTheme', {\n get: function () {\n const { shelfLegendName } = this.rootModel.state\n return shelfLegendName && this.state.style[shelfLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'portLegendTheme', {\n get: function () {\n const { portLegendName } = this.rootModel.state\n return portLegendName && this.state.style[portLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierLegendTheme', {\n get: function () {\n const { carrierLegendName } = this.rootModel.state\n return carrierLegendName && this.state.style[carrierLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierAnimationTheme', {\n get: function () {\n const { carrierAnimationName } = this.rootModel.state\n return carrierAnimationName && this.state.style[carrierAnimationName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'stockerCapacityLegendTheme', {\n get: function () {\n const { stockerCapacityLegendName } = this.rootModel.state\n return stockerCapacityLegendName && this.state.style[stockerCapacityLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'zoneCapacityLegendTheme', {\n get: function () {\n const { zoneCapacityLegendName } = this.rootModel.state\n return zoneCapacityLegendName && this.state.style[zoneCapacityLegendName]\n }\n})\n"]}
|
package/dist/shelf.js
CHANGED
|
@@ -14,6 +14,9 @@ export default class Shelf extends MCSZoneMixin(MCSCarrierHolder) {
|
|
|
14
14
|
get auxColor() {
|
|
15
15
|
return 'black';
|
|
16
16
|
}
|
|
17
|
+
getLegendFallback() {
|
|
18
|
+
return this.root.shelfLegendTheme || super.getLegendFallback();
|
|
19
|
+
}
|
|
17
20
|
render(ctx) {
|
|
18
21
|
var { left, top, width, height } = this.bounds;
|
|
19
22
|
ctx.save();
|
package/dist/shelf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shelf.js","sourceRoot":"","sources":["../src/shelf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAA;AACnE,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAEhF,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,sBAAsB,EAAE,GAAG,gBAAgB,CAAC,UAAU,CAAC;CACxE,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IAC/D,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,IAAI,EAAE,CAAA;QAEV,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACxB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC/B,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,WAAY,CAAA;QACjC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;QACjB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;QACrB,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QAEnB,oBAAoB;QACpB,2DAA2D;QAC3D,6CAA6C;QAC7C,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAE7B,GAAG,CAAC,IAAI,EAAE,CAAA;QAEV,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAChB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACzB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACrB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAEpB,GAAG,CAAC,IAAI,EAAE,CAAA;QACV,GAAG,CAAC,MAAM,EAAE,CAAA;QAEZ,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAC1B,GAAG,CAAC,OAAO,EAAE,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature } from '@hatiolab/things-scene'\nimport MCSCarrierHolder from './mcs-carrier-holder'\nimport { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSZoneMixinProperties, ...MCSCarrierHolder.properties]\n}\n\nexport default class Shelf extends MCSZoneMixin(MCSCarrierHolder) {\n static get nature() {\n return NATURE\n }\n\n get auxColor() {\n return 'black'\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.save()\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.strokeStyle = this.auxColor\n ctx.fillStyle = this.statusColor!\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.setLineDash([])\n\n // Performance aware\n // const radius = Math.round(Math.min(width, height) * 0.1)\n // ctx.roundRect(0, 0, width, height, radius)\n ctx.rect(0, 0, width, height)\n\n ctx.clip()\n\n ctx.moveTo(0, 0)\n ctx.lineTo(width, height)\n ctx.moveTo(0, height)\n ctx.lineTo(width, 0)\n\n ctx.fill()\n ctx.stroke()\n\n ctx.translate(-left, -top)\n ctx.restore()\n }\n}\n\nComponent.register('Shelf', Shelf)\n"]}
|
|
1
|
+
{"version":3,"file":"shelf.js","sourceRoot":"","sources":["../src/shelf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAA;AACnE,OAAO,gBAAgB,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAEhF,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,sBAAsB,EAAE,GAAG,gBAAgB,CAAC,UAAU,CAAC;CACxE,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IAC/D,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAA;IAChE,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,GAAG,CAAC,IAAI,EAAE,CAAA;QAEV,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACxB,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC/B,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,WAAY,CAAA;QACjC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;QACjB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;QACrB,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QAEnB,oBAAoB;QACpB,2DAA2D;QAC3D,6CAA6C;QAC7C,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAE7B,GAAG,CAAC,IAAI,EAAE,CAAA;QAEV,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAChB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACzB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACrB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAEpB,GAAG,CAAC,IAAI,EAAE,CAAA;QACV,GAAG,CAAC,MAAM,EAAE,CAAA;QAEZ,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAC1B,GAAG,CAAC,OAAO,EAAE,CAAA;IACf,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature } from '@hatiolab/things-scene'\nimport MCSCarrierHolder from './mcs-carrier-holder'\nimport { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSZoneMixinProperties, ...MCSCarrierHolder.properties]\n}\n\nexport default class Shelf extends MCSZoneMixin(MCSCarrierHolder) {\n static get nature() {\n return NATURE\n }\n\n get auxColor() {\n return 'black'\n }\n\n getLegendFallback() {\n return this.root.shelfLegendTheme || super.getLegendFallback()\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.save()\n\n ctx.translate(left, top)\n ctx.beginPath()\n\n ctx.strokeStyle = this.auxColor\n ctx.fillStyle = this.statusColor!\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.setLineDash([])\n\n // Performance aware\n // const radius = Math.round(Math.min(width, height) * 0.1)\n // ctx.roundRect(0, 0, width, height, radius)\n ctx.rect(0, 0, width, height)\n\n ctx.clip()\n\n ctx.moveTo(0, 0)\n ctx.lineTo(width, height)\n ctx.moveTo(0, height)\n ctx.lineTo(width, 0)\n\n ctx.fill()\n ctx.stroke()\n\n ctx.translate(-left, -top)\n ctx.restore()\n }\n}\n\nComponent.register('Shelf', Shelf)\n"]}
|
package/dist/shuttle.js
CHANGED
|
@@ -14,6 +14,9 @@ export default class Shuttle extends MCSVehicle {
|
|
|
14
14
|
get auxColor() {
|
|
15
15
|
return 'black';
|
|
16
16
|
}
|
|
17
|
+
getLegendFallback() {
|
|
18
|
+
return this.root.shuttleLegendTheme || super.getLegendFallback();
|
|
19
|
+
}
|
|
17
20
|
render(ctx) {
|
|
18
21
|
var { left, top, width, height } = this.bounds;
|
|
19
22
|
ctx.translate(left, top);
|
package/dist/shuttle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shuttle.js","sourceRoot":"","sources":["../src/shuttle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAA;AACnE,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,UAAU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,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;QAC7E,GAAG,CAAC,IAAI,EAAE,CAAA;QAEV,GAAG,CAAC,SAAS,EAAE,CAAA;QACf,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAA;QACxC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAA;QAErD,GAAG,CAAC,IAAI,EAAE,CAAA;QACV,GAAG,CAAC,MAAM,EAAE,CAAA;QAEZ,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,oBAAoB;QACpB,4BAA4B;IAC9B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature } from '@hatiolab/things-scene'\nimport MCSVehicle from './mcs-vehicle'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSVehicle.properties]\n}\n\nconst RAILWIDTH = 2\nexport default class Shuttle extends MCSVehicle {\n static get nature() {\n return NATURE\n }\n\n get auxColor() {\n return 'black'\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n\n // draw rail metapore\n ctx.beginPath()\n\n ctx.strokeStyle = 'black'\n ctx.lineWidth = RAILWIDTH * 2\n\n ctx.moveTo(0, 0)\n ctx.lineTo(0, height)\n ctx.moveTo(width, 0)\n ctx.lineTo(width, height)\n ctx.stroke()\n\n // draw body\n ctx.beginPath()\n\n ctx.strokeStyle = this.auxColor!\n ctx.fillStyle = this.statusColor!\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.setLineDash([])\n\n // Performance aware\n // const radius = Math.round(Math.min(width, height) * 0.1)\n\n // ctx.roundRect(RAILWIDTH / 2, RAILWIDTH / 2, width - RAILWIDTH, height - RAILWIDTH, radius)\n // ctx.fill()\n\n // ctx.beginPath()\n // ctx.roundRect(0, RAILWIDTH, width, RAILWIDTH, radius)\n // ctx.roundRect(0, height - RAILWIDTH * 2, width, RAILWIDTH, radius)\n\n ctx.rect(RAILWIDTH / 2, RAILWIDTH / 2, width - RAILWIDTH, height - RAILWIDTH)\n ctx.fill()\n\n ctx.beginPath()\n ctx.rect(0, RAILWIDTH, width, RAILWIDTH)\n ctx.rect(0, height - RAILWIDTH * 2, width, RAILWIDTH)\n\n ctx.fill()\n ctx.stroke()\n\n ctx.translate(-left, -top)\n\n // Performance aware\n // this.renderDirection(ctx)\n }\n}\n\nComponent.register('Shuttle', Shuttle)\n"]}
|
|
1
|
+
{"version":3,"file":"shuttle.js","sourceRoot":"","sources":["../src/shuttle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAA;AACnE,OAAO,UAAU,MAAM,eAAe,CAAA;AAEtC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC;CACvC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,CAAA;AACnB,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,UAAU;IAC7C,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAA;IAClE,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,EAAE,IAAI,EAAE,G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QACxC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAA;QAErD,GAAG,CAAC,IAAI,EAAE,CAAA;QACV,GAAG,CAAC,MAAM,EAAE,CAAA;QAEZ,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;QAE1B,oBAAoB;QACpB,4BAA4B;IAC9B,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature } from '@hatiolab/things-scene'\nimport MCSVehicle from './mcs-vehicle'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSVehicle.properties]\n}\n\nconst RAILWIDTH = 2\nexport default class Shuttle extends MCSVehicle {\n static get nature() {\n return NATURE\n }\n\n get auxColor() {\n return 'black'\n }\n\n getLegendFallback() {\n return this.root.shuttleLegendTheme || super.getLegendFallback()\n }\n\n render(ctx: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n ctx.translate(left, top)\n\n // draw rail metapore\n ctx.beginPath()\n\n ctx.strokeStyle = 'black'\n ctx.lineWidth = RAILWIDTH * 2\n\n ctx.moveTo(0, 0)\n ctx.lineTo(0, height)\n ctx.moveTo(width, 0)\n ctx.lineTo(width, height)\n ctx.stroke()\n\n // draw body\n ctx.beginPath()\n\n ctx.strokeStyle = this.auxColor!\n ctx.fillStyle = this.statusColor!\n ctx.lineWidth = 1\n ctx.lineCap = 'round'\n ctx.setLineDash([])\n\n // Performance aware\n // const radius = Math.round(Math.min(width, height) * 0.1)\n\n // ctx.roundRect(RAILWIDTH / 2, RAILWIDTH / 2, width - RAILWIDTH, height - RAILWIDTH, radius)\n // ctx.fill()\n\n // ctx.beginPath()\n // ctx.roundRect(0, RAILWIDTH, width, RAILWIDTH, radius)\n // ctx.roundRect(0, height - RAILWIDTH * 2, width, RAILWIDTH, radius)\n\n ctx.rect(RAILWIDTH / 2, RAILWIDTH / 2, width - RAILWIDTH, height - RAILWIDTH)\n ctx.fill()\n\n ctx.beginPath()\n ctx.rect(0, RAILWIDTH, width, RAILWIDTH)\n ctx.rect(0, height - RAILWIDTH * 2, width, RAILWIDTH)\n\n ctx.fill()\n ctx.stroke()\n\n ctx.translate(-left, -top)\n\n // Performance aware\n // this.renderDirection(ctx)\n }\n}\n\nComponent.register('Shuttle', Shuttle)\n"]}
|
package/dist/stocker.js
CHANGED
|
@@ -27,6 +27,9 @@ export default class Stocker extends MCSTransport {
|
|
|
27
27
|
static get nature() {
|
|
28
28
|
return NATURE;
|
|
29
29
|
}
|
|
30
|
+
getLegendFallback() {
|
|
31
|
+
return this.root.stokerLegendTheme || super.getLegendFallback();
|
|
32
|
+
}
|
|
30
33
|
containable(component) {
|
|
31
34
|
return (super.containable(component) ||
|
|
32
35
|
['Crane', 'Shelf', 'Port', 'MCSGaugeCapacityBar', 'StockerCapacityBar', 'ZoneCapacityBar'].includes(component.state.type));
|
package/dist/stocker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stocker.js","sourceRoot":"","sources":["../src/stocker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,wBAAwB,CAAA;AAC/E,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC;CACzC,CAAA;AAED,mEAAmE;AAEnE,wCAAwC;AACxC,oBAAoB;AACpB,wCAAwC;AACxC,cAAc;AACd,0CAA0C;AAC1C,sCAAsC;AACtC,6DAA6D;AAC7D,wBAAwB;AACxB,wGAAwG;AACxG,0EAA0E;AAC1E,QAAQ;AACR,8CAA8C;AAC9C,wBAAwB;AACxB,MAAM;AACN,uBAAuB;AACvB,IAAI;AAEJ,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,YAAY;IAC/C,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,WAAW,CAAC,SAAoB;QAC9B,OAAO,CACL,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC;YAC5B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,QAAQ,CACjG,SAAS,CAAC,KAAK,CAAC,IAAI,CACrB,CACF,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAiB,EAAE,MAAkB;QAChD,kEAAkE;QAClE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACrH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature, Properties } from '@hatiolab/things-scene'\nimport MCSTransport from './mcs-transport'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSTransport.properties]\n}\n\n// const capacity = { ko: 'Capacity', en: 'Capacity', zh_CN: '容量' }\n\n// export function getLocaleLanguage() {\n// let localeValue\n// let nameOfCookie = 'miipLang' + '='\n// let x = 0\n// while (x <= document.cookie.length) {\n// let y = x + nameOfCookie.length\n// if (document.cookie.substring(x, y) == nameOfCookie) {\n// let endOfCookie\n// if ((endOfCookie = document.cookie.indexOf(';', y)) == -1) endOfCookie = document.cookie.length\n// localeValue = unescape(document.cookie.substring(y, endOfCookie))\n// }\n// x = document.cookie.indexOf(' ', x) + 1\n// if (x == 0) break\n// }\n// return localeValue\n// }\n\nexport default class Stocker extends MCSTransport {\n static get nature() {\n return NATURE\n }\n\n containable(component: Component) {\n return (\n super.containable(component) ||\n ['Crane', 'Shelf', 'Port', 'MCSGaugeCapacityBar', 'StockerCapacityBar', 'ZoneCapacityBar'].includes(\n component.state.type\n )\n )\n }\n\n onchangeData(after: Properties, before: Properties): void {\n /* non-identifiable component 즉, StockerCapacityBar 에게 데이터를 전달함 */\n this.components.filter(component => !component.isIdentifiable()).forEach(component => (component.data = this.data))\n }\n}\n\nComponent.register('STOCKER', Stocker)\n"]}
|
|
1
|
+
{"version":3,"file":"stocker.js","sourceRoot":"","sources":["../src/stocker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,wBAAwB,CAAA;AAC/E,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC;CACzC,CAAA;AAED,mEAAmE;AAEnE,wCAAwC;AACxC,oBAAoB;AACpB,wCAAwC;AACxC,cAAc;AACd,0CAA0C;AAC1C,sCAAsC;AACtC,6DAA6D;AAC7D,wBAAwB;AACxB,wGAAwG;AACxG,0EAA0E;AAC1E,QAAQ;AACR,8CAA8C;AAC9C,wBAAwB;AACxB,MAAM;AACN,uBAAuB;AACvB,IAAI;AAEJ,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,YAAY;IAC/C,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAA;IACjE,CAAC;IAED,WAAW,CAAC,SAAoB;QAC9B,OAAO,CACL,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC;YAC5B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,QAAQ,CACjG,SAAS,CAAC,KAAK,CAAC,IAAI,CACrB,CACF,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAiB,EAAE,MAAkB;QAChD,kEAAkE;QAClE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACrH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature, Properties } from '@hatiolab/things-scene'\nimport MCSTransport from './mcs-transport'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [...MCSTransport.properties]\n}\n\n// const capacity = { ko: 'Capacity', en: 'Capacity', zh_CN: '容量' }\n\n// export function getLocaleLanguage() {\n// let localeValue\n// let nameOfCookie = 'miipLang' + '='\n// let x = 0\n// while (x <= document.cookie.length) {\n// let y = x + nameOfCookie.length\n// if (document.cookie.substring(x, y) == nameOfCookie) {\n// let endOfCookie\n// if ((endOfCookie = document.cookie.indexOf(';', y)) == -1) endOfCookie = document.cookie.length\n// localeValue = unescape(document.cookie.substring(y, endOfCookie))\n// }\n// x = document.cookie.indexOf(' ', x) + 1\n// if (x == 0) break\n// }\n// return localeValue\n// }\n\nexport default class Stocker extends MCSTransport {\n static get nature() {\n return NATURE\n }\n\n getLegendFallback() {\n return this.root.stokerLegendTheme || super.getLegendFallback()\n }\n\n containable(component: Component) {\n return (\n super.containable(component) ||\n ['Crane', 'Shelf', 'Port', 'MCSGaugeCapacityBar', 'StockerCapacityBar', 'ZoneCapacityBar'].includes(\n component.state.type\n )\n )\n }\n\n onchangeData(after: Properties, before: Properties): void {\n /* non-identifiable component 즉, StockerCapacityBar 에게 데이터를 전달함 */\n this.components.filter(component => !component.isIdentifiable()).forEach(component => (component.data = this.data))\n }\n}\n\nComponent.register('STOCKER', Stocker)\n"]}
|