@fmsim/machine 1.0.63 → 1.0.65
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 +8 -4
- package/dist/agv-line.js.map +1 -1
- package/dist/agv.js +59 -30
- package/dist/agv.js.map +1 -1
- package/dist/buffer.js +8 -4
- package/dist/buffer.js.map +1 -1
- package/dist/carrier.js +8 -4
- package/dist/carrier.js.map +1 -1
- package/dist/conveyor-join.js +8 -4
- package/dist/conveyor-join.js.map +1 -1
- package/dist/conveyor.js +8 -4
- package/dist/conveyor.js.map +1 -1
- package/dist/crane.js +8 -4
- package/dist/crane.js.map +1 -1
- package/dist/equipment.js +8 -4
- package/dist/equipment.js.map +1 -1
- package/dist/floating-container.js +16 -0
- package/dist/floating-container.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/node-path.js +8 -4
- package/dist/node-path.js.map +1 -1
- package/dist/node.js +19 -15
- package/dist/node.js.map +1 -1
- package/dist/oht-line.js +8 -4
- package/dist/oht-line.js.map +1 -1
- package/dist/oht.js +8 -4
- package/dist/oht.js.map +1 -1
- package/dist/port-flow.js +8 -4
- package/dist/port-flow.js.map +1 -1
- package/dist/port.js +8 -4
- package/dist/port.js.map +1 -1
- package/dist/shelf.js +8 -4
- package/dist/shelf.js.map +1 -1
- package/dist/shuttle.js +8 -4
- package/dist/shuttle.js.map +1 -1
- package/dist/stocker-capacity-bar.js +9 -5
- package/dist/stocker-capacity-bar.js.map +1 -1
- package/dist/stocker.js +8 -4
- package/dist/stocker.js.map +1 -1
- package/dist/templates/floating-container.js +18 -0
- package/dist/templates/floating-container.js.map +1 -0
- package/dist/templates/index.js +2 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/zone-capacity-bar.js +8 -4
- package/dist/zone-capacity-bar.js.map +1 -1
- package/icons/floating-container.png +0 -0
- package/package.json +2 -2
- package/src/agv-line.ts +2 -3
- package/src/agv.ts +64 -32
- package/src/buffer.ts +2 -3
- package/src/carrier.ts +2 -3
- package/src/conveyor-join.ts +2 -3
- package/src/conveyor.ts +2 -3
- package/src/crane.ts +2 -3
- package/src/equipment.ts +2 -3
- package/src/floating-container.ts +12 -0
- package/src/index.ts +2 -0
- package/src/node-path.ts +2 -3
- package/src/node.ts +2 -3
- package/src/oht-line.ts +2 -3
- package/src/oht.ts +2 -3
- package/src/port-flow.ts +2 -3
- package/src/port.ts +2 -3
- package/src/shelf.ts +2 -3
- package/src/shuttle.ts +2 -3
- package/src/stocker-capacity-bar.ts +11 -4
- package/src/stocker.ts +2 -3
- package/src/templates/floating-container.ts +18 -0
- package/src/templates/index.ts +2 -0
- package/src/zone-capacity-bar.ts +2 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { sceneComponent } from '@hatiolab/things-scene';
|
|
2
3
|
import { themesColorRange } from '@fmsim/api';
|
|
3
4
|
import { LEGEND_CAPACITY } from './features/mcs-status-default';
|
|
4
5
|
import { safeRound } from './utils/safe-round';
|
|
@@ -73,7 +74,7 @@ var controlHandler = {
|
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
+
let ZoneCapacityBar = class ZoneCapacityBar extends MCSZoneMixin(MCSUnit) {
|
|
77
78
|
static get nature() {
|
|
78
79
|
return NATURE;
|
|
79
80
|
}
|
|
@@ -228,6 +229,9 @@ export default class ZoneCapacityBar extends MCSZoneMixin(MCSUnit) {
|
|
|
228
229
|
usage: Math.round((currentUsage / maxCapacity) * 100)
|
|
229
230
|
});
|
|
230
231
|
}
|
|
231
|
-
}
|
|
232
|
-
|
|
232
|
+
};
|
|
233
|
+
ZoneCapacityBar = __decorate([
|
|
234
|
+
sceneComponent('ZoneCapacityBar')
|
|
235
|
+
], ZoneCapacityBar);
|
|
236
|
+
export default ZoneCapacityBar;
|
|
233
237
|
//# sourceMappingURL=zone-capacity-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zone-capacity-bar.js","sourceRoot":"","sources":["../src/zone-capacity-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyC,MAAM,wBAAwB,CAAA;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,OAAO,MAAM,YAAY,CAAA;AAEhC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,GAAG,sBAAsB;QACzB,GAAG,2BAA2B;QAC9B;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE;gBACR,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,eAAe;SACvB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,gBAAgB;SACxB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,eAAe;SACvB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,cAAc;SACtB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,KA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GAAG,EACjB,aAAa,GAAG,GAAG,EACnB,YAAY,GAAG,CAAC,EAChB,MAAM,GAAG,GAAG,EACb,GAAG,OAAO,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;QAEjD,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;QACjD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG,CAAA;QAC9C,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,GAAG,CAAA;QAClD,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QAE9C,IAAI,CAAC,QAAQ,CAAC;YACZ,YAAY;YACZ,WAAW;YACX,aAAa;YACb,YAAY;YACZ,MAAM,EAAE,MAAM,IAAI,GAAG;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC;SACtD,CAAC,CAAA;IACJ,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAA","sourcesContent":["import { Component, ComponentNature, POSITION, Properties } from '@hatiolab/things-scene'\nimport { themesColorRange } from '@fmsim/api'\nimport { LEGEND_CAPACITY } from './features/mcs-status-default'\nimport { safeRound } from './utils/safe-round'\nimport { getVaueOnRanges } from './utils/get-value-on-ranges'\nimport { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'\nimport { ParentObjectMixinProperties } from './features/parent-object-mixin'\nimport MCSUnit from './mcs-unit'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n ...MCSZoneMixinProperties,\n ...ParentObjectMixinProperties,\n {\n type: 'select',\n label: 'legend-name',\n name: 'legendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'number',\n name: 'currentUsage',\n label: 'current-usage'\n },\n {\n type: 'number',\n name: 'highWatermark',\n label: 'high-watermark'\n },\n {\n type: 'number',\n name: 'lowWatermark',\n label: 'low-watermark'\n },\n {\n type: 'number',\n name: 'maxCapacity',\n label: 'max-capacity'\n },\n {\n type: 'boolean',\n name: 'fullup',\n label: 'fullup'\n },\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0\n }\n },\n {\n type: 'hidden',\n name: 'usage',\n label: 'usage'\n }\n ],\n 'value-property': 'usage'\n}\n\nvar controlHandler = {\n ondragmove: function (point: POSITION, index: number, component: Component) {\n var { left, top, width, height } = component.model\n\n var transcoorded = component.transcoordP2S(point.x, point.y)\n var round = ((transcoorded.x - left) / (width / 2)) * 100\n\n round = safeRound(round, width, height)\n\n component.set({\n round\n })\n }\n}\n\nexport default class ZoneCapacityBar extends MCSZoneMixin(MCSUnit) {\n static get nature() {\n return NATURE\n }\n\n get controls() {\n var { left, top, width, round, height } = this.state\n round = round == undefined ? 0 : safeRound(round, width, height)\n\n return [\n {\n x: left + (width / 2) * (round / 100),\n y: top,\n handler: controlHandler\n }\n ]\n }\n\n getLegendFallback() {\n return this.root.zoneCapacityLegendTheme || LEGEND_CAPACITY\n }\n\n get statusColor() {\n const { fullup } = this.state\n return fullup ? 'red' : getVaueOnRanges(this.usage, this.legend)\n }\n\n get text() {\n return this.usage + '%'\n }\n\n render(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n\n if (width >= height) {\n this.renderLandscape(context)\n } else {\n this.renderPortrait(context)\n }\n }\n\n renderLandscape(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { highWatermark, lowWatermark, lineWidth, strokeStyle, round, fillStyle = 'white' } = this.state\n\n context.save()\n context.translate(left, top)\n\n // gauge background\n context.beginPath()\n\n context.fillStyle = fillStyle\n context.roundRect(0, 0, width, height, round)\n\n context.fill()\n context.stroke()\n\n context.clip()\n\n // gauge foreground\n context.beginPath()\n\n context.fillStyle = this.statusColor!\n\n context.rect(0, 0, (width / 100) * this.usage, height)\n context.fill()\n\n // high-watermark level\n\n if (highWatermark && highWatermark > 0 && highWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const x = (width / 100) * highWatermark\n context.moveTo(x, 0)\n context.lineTo(x, height)\n\n context.stroke()\n }\n\n // low-watermark level\n\n if (lowWatermark && lowWatermark > 0 && lowWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const x = (width / 100) * lowWatermark\n context.moveTo(x, 0)\n context.lineTo(x, height)\n\n context.stroke()\n }\n\n // gauge outline\n context.beginPath()\n\n context.setLineDash([])\n context.strokeStyle = strokeStyle\n context.lineWidth = lineWidth\n context.roundRect(0, 0, width, height, round)\n context.stroke()\n\n context.beginPath()\n\n context.translate(-left, -top)\n context.restore()\n }\n\n renderPortrait(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { highWatermark, lowWatermark, lineWidth, strokeStyle, round, fillStyle = 'white' } = this.state\n\n context.save()\n context.translate(left, top)\n\n // gauge background\n context.beginPath()\n\n context.fillStyle = fillStyle\n context.roundRect(0, 0, width, height, round)\n\n context.fill()\n\n context.clip()\n\n // gauge foreground\n context.beginPath()\n\n context.fillStyle = this.statusColor!\n\n context.rect(0, height - (height / 100) * this.usage, width, (height / 100) * this.usage)\n context.fill()\n\n // high-watermark level\n\n if (highWatermark && highWatermark > 0 && highWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const y = height - (height / 100) * highWatermark\n context.moveTo(0, y)\n context.lineTo(width, y)\n\n context.stroke()\n }\n\n // low-watermark level\n\n if (lowWatermark && lowWatermark > 0 && lowWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const y = height - (height / 100) * lowWatermark\n context.moveTo(0, y)\n context.lineTo(width, y)\n\n context.stroke()\n }\n\n // gauge outline\n context.beginPath()\n\n context.setLineDash([])\n context.strokeStyle = strokeStyle\n context.lineWidth = lineWidth\n context.roundRect(0, 0, width, height, round)\n context.stroke()\n\n context.beginPath()\n\n context.translate(-left, -top)\n context.restore()\n }\n\n get usage() {\n const { currentUsage = 0, maxCapacity = 100 } = this.state\n return Math.round((currentUsage / maxCapacity) * 100)\n }\n\n set usage(usage: number) {\n // intentionally have done nothing\n }\n\n onchangeData(after: Properties, before: Properties): void {\n const {\n CURRENTCAPACITY = 0,\n MAXCAPACITY = 100,\n HIGHWATERMARK = 100,\n LOWWATERMARK = 0,\n FULLUP = 'F'\n } = typeof this.data == 'object' ? this.data : {}\n\n const currentUsage = Number(CURRENTCAPACITY) || 0\n const maxCapacity = Number(MAXCAPACITY) || 100\n const highWatermark = Number(HIGHWATERMARK) || 100\n const lowWatermark = Number(LOWWATERMARK) || 0\n\n this.setState({\n currentUsage,\n maxCapacity,\n highWatermark,\n lowWatermark,\n fullup: FULLUP == 'T',\n usage: Math.round((currentUsage / maxCapacity) * 100)\n })\n }\n}\n\nComponent.register('ZoneCapacityBar', ZoneCapacityBar)\n"]}
|
|
1
|
+
{"version":3,"file":"zone-capacity-bar.js","sourceRoot":"","sources":["../src/zone-capacity-bar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAoD,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,OAA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YAAY;YACZ,MAAM,EAAE,MAAM,IAAI,GAAG;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC;SACtD,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA1NoB,eAAe;IADnC,cAAc,CAAC,iBAAiB,CAAC;GACb,eAAe,CA0NnC;eA1NoB,eAAe","sourcesContent":["import { Component, ComponentNature, POSITION, Properties, sceneComponent } from '@hatiolab/things-scene'\nimport { themesColorRange } from '@fmsim/api'\nimport { LEGEND_CAPACITY } from './features/mcs-status-default'\nimport { safeRound } from './utils/safe-round'\nimport { getVaueOnRanges } from './utils/get-value-on-ranges'\nimport { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'\nimport { ParentObjectMixinProperties } from './features/parent-object-mixin'\nimport MCSUnit from './mcs-unit'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n ...MCSZoneMixinProperties,\n ...ParentObjectMixinProperties,\n {\n type: 'select',\n label: 'legend-name',\n name: 'legendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'number',\n name: 'currentUsage',\n label: 'current-usage'\n },\n {\n type: 'number',\n name: 'highWatermark',\n label: 'high-watermark'\n },\n {\n type: 'number',\n name: 'lowWatermark',\n label: 'low-watermark'\n },\n {\n type: 'number',\n name: 'maxCapacity',\n label: 'max-capacity'\n },\n {\n type: 'boolean',\n name: 'fullup',\n label: 'fullup'\n },\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0\n }\n },\n {\n type: 'hidden',\n name: 'usage',\n label: 'usage'\n }\n ],\n 'value-property': 'usage'\n}\n\nvar controlHandler = {\n ondragmove: function (point: POSITION, index: number, component: Component) {\n var { left, top, width, height } = component.model\n\n var transcoorded = component.transcoordP2S(point.x, point.y)\n var round = ((transcoorded.x - left) / (width / 2)) * 100\n\n round = safeRound(round, width, height)\n\n component.set({\n round\n })\n }\n}\n\n@sceneComponent('ZoneCapacityBar')\nexport default class ZoneCapacityBar extends MCSZoneMixin(MCSUnit) {\n static get nature() {\n return NATURE\n }\n\n get controls() {\n var { left, top, width, round, height } = this.state\n round = round == undefined ? 0 : safeRound(round, width, height)\n\n return [\n {\n x: left + (width / 2) * (round / 100),\n y: top,\n handler: controlHandler\n }\n ]\n }\n\n getLegendFallback() {\n return this.root.zoneCapacityLegendTheme || LEGEND_CAPACITY\n }\n\n get statusColor() {\n const { fullup } = this.state\n return fullup ? 'red' : getVaueOnRanges(this.usage, this.legend)\n }\n\n get text() {\n return this.usage + '%'\n }\n\n render(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n\n if (width >= height) {\n this.renderLandscape(context)\n } else {\n this.renderPortrait(context)\n }\n }\n\n renderLandscape(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { highWatermark, lowWatermark, lineWidth, strokeStyle, round, fillStyle = 'white' } = this.state\n\n context.save()\n context.translate(left, top)\n\n // gauge background\n context.beginPath()\n\n context.fillStyle = fillStyle\n context.roundRect(0, 0, width, height, round)\n\n context.fill()\n context.stroke()\n\n context.clip()\n\n // gauge foreground\n context.beginPath()\n\n context.fillStyle = this.statusColor!\n\n context.rect(0, 0, (width / 100) * this.usage, height)\n context.fill()\n\n // high-watermark level\n\n if (highWatermark && highWatermark > 0 && highWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const x = (width / 100) * highWatermark\n context.moveTo(x, 0)\n context.lineTo(x, height)\n\n context.stroke()\n }\n\n // low-watermark level\n\n if (lowWatermark && lowWatermark > 0 && lowWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const x = (width / 100) * lowWatermark\n context.moveTo(x, 0)\n context.lineTo(x, height)\n\n context.stroke()\n }\n\n // gauge outline\n context.beginPath()\n\n context.setLineDash([])\n context.strokeStyle = strokeStyle\n context.lineWidth = lineWidth\n context.roundRect(0, 0, width, height, round)\n context.stroke()\n\n context.beginPath()\n\n context.translate(-left, -top)\n context.restore()\n }\n\n renderPortrait(context: CanvasRenderingContext2D) {\n const { left, top, width, height } = this.bounds\n const { highWatermark, lowWatermark, lineWidth, strokeStyle, round, fillStyle = 'white' } = this.state\n\n context.save()\n context.translate(left, top)\n\n // gauge background\n context.beginPath()\n\n context.fillStyle = fillStyle\n context.roundRect(0, 0, width, height, round)\n\n context.fill()\n\n context.clip()\n\n // gauge foreground\n context.beginPath()\n\n context.fillStyle = this.statusColor!\n\n context.rect(0, height - (height / 100) * this.usage, width, (height / 100) * this.usage)\n context.fill()\n\n // high-watermark level\n\n if (highWatermark && highWatermark > 0 && highWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const y = height - (height / 100) * highWatermark\n context.moveTo(0, y)\n context.lineTo(width, y)\n\n context.stroke()\n }\n\n // low-watermark level\n\n if (lowWatermark && lowWatermark > 0 && lowWatermark < 100) {\n context.beginPath()\n\n context.strokeStyle = 'black'\n context.lineWidth = 1\n context.setLineDash([3])\n\n const y = height - (height / 100) * lowWatermark\n context.moveTo(0, y)\n context.lineTo(width, y)\n\n context.stroke()\n }\n\n // gauge outline\n context.beginPath()\n\n context.setLineDash([])\n context.strokeStyle = strokeStyle\n context.lineWidth = lineWidth\n context.roundRect(0, 0, width, height, round)\n context.stroke()\n\n context.beginPath()\n\n context.translate(-left, -top)\n context.restore()\n }\n\n get usage() {\n const { currentUsage = 0, maxCapacity = 100 } = this.state\n return Math.round((currentUsage / maxCapacity) * 100)\n }\n\n set usage(usage: number) {\n // intentionally have done nothing\n }\n\n onchangeData(after: Properties, before: Properties): void {\n const {\n CURRENTCAPACITY = 0,\n MAXCAPACITY = 100,\n HIGHWATERMARK = 100,\n LOWWATERMARK = 0,\n FULLUP = 'F'\n } = typeof this.data == 'object' ? this.data : {}\n\n const currentUsage = Number(CURRENTCAPACITY) || 0\n const maxCapacity = Number(MAXCAPACITY) || 100\n const highWatermark = Number(HIGHWATERMARK) || 100\n const lowWatermark = Number(LOWWATERMARK) || 0\n\n this.setState({\n currentUsage,\n maxCapacity,\n highWatermark,\n lowWatermark,\n fullup: FULLUP == 'T',\n usage: Math.round((currentUsage / maxCapacity) * 100)\n })\n }\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fmsim/machine",
|
|
3
3
|
"description": "Layout View를 구성하는 설비(machine)들과 유닛을 구현한 모듈입니다.",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.65",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"things-scene": true,
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"prettier --write"
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "603baf8b49c5c474aa6bf838d02bce10caa41370"
|
|
58
58
|
}
|
package/src/agv-line.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSTransport from './mcs-transport'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -8,6 +8,7 @@ const NATURE: ComponentNature = {
|
|
|
8
8
|
properties: [...MCSTransport.properties]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
@sceneComponent('AGVLine')
|
|
11
12
|
export default class AGVLine extends MCSTransport {
|
|
12
13
|
static get nature() {
|
|
13
14
|
return NATURE
|
|
@@ -59,5 +60,3 @@ export default class AGVLine extends MCSTransport {
|
|
|
59
60
|
context.translate(-left, -top)
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
Component.register('AGVLine', AGVLine)
|
package/src/agv.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import { themesColorRange } from '@fmsim/api'
|
|
3
3
|
import MCSVehicle from './mcs-vehicle'
|
|
4
4
|
import { getVaueOnRanges } from './utils/get-value-on-ranges'
|
|
@@ -22,6 +22,8 @@ const NATURE: ComponentNature = {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const GAP = 2
|
|
25
|
+
|
|
26
|
+
@sceneComponent('AGV')
|
|
25
27
|
export default class AGV extends MCSVehicle {
|
|
26
28
|
static get nature() {
|
|
27
29
|
return NATURE
|
|
@@ -92,15 +94,12 @@ export default class AGV extends MCSVehicle {
|
|
|
92
94
|
|
|
93
95
|
// 사선 패턴을 그리는 함수
|
|
94
96
|
drawHatchPattern(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number) {
|
|
95
|
-
//
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
// 선 두께 계산 (작은 크기에서도 보이도록)
|
|
102
|
-
const minLineWidth = 0.35
|
|
103
|
-
const scaleFactor = Math.min(width, height) / 130
|
|
97
|
+
// 6개의 빗금을 그리기 위한 간격 계산
|
|
98
|
+
const spacing = (width + height) / 6
|
|
99
|
+
|
|
100
|
+
// 선 두께 계산 (크기에 비례)
|
|
101
|
+
const minLineWidth = 0.5
|
|
102
|
+
const scaleFactor = Math.min(width, height) / 20 // 130에서 50으로 변경하여 더 두껍게
|
|
104
103
|
const lineWidth = Math.max(minLineWidth, scaleFactor)
|
|
105
104
|
|
|
106
105
|
ctx.beginPath()
|
|
@@ -112,10 +111,11 @@ export default class AGV extends MCSVehicle {
|
|
|
112
111
|
ctx.rect(x, y, width, height)
|
|
113
112
|
ctx.clip()
|
|
114
113
|
|
|
115
|
-
// 사선 패턴 그리기
|
|
116
|
-
for (let i =
|
|
117
|
-
|
|
118
|
-
ctx.
|
|
114
|
+
// 6개의 사선 패턴 그리기
|
|
115
|
+
for (let i = 0; i < 6; i++) {
|
|
116
|
+
const startX = x + i * spacing
|
|
117
|
+
ctx.moveTo(startX, y)
|
|
118
|
+
ctx.lineTo(startX - height, y + height)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
ctx.stroke()
|
|
@@ -171,32 +171,64 @@ export default class AGV extends MCSVehicle {
|
|
|
171
171
|
ctx.strokeRect(batteryX, batteryY, batteryWidth, batteryHeight)
|
|
172
172
|
|
|
173
173
|
// 배터리 잔량 텍스트 표시
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
// const textBgX = batteryX + (batteryWidth - textWidth) / 2
|
|
177
|
-
// const textBgY = batteryY + (batteryHeight - textHeight) / 2
|
|
178
|
-
|
|
179
|
-
// ctx.fillStyle = 'white'
|
|
180
|
-
// ctx.fillRect(textBgX, textBgY, textWidth, textHeight)
|
|
181
|
-
|
|
182
|
-
// 텍스트 그리기
|
|
183
|
-
ctx.font = `4px Roboto, Arial, sans-serif`
|
|
174
|
+
const fontSize = batteryHeight * 0.8
|
|
175
|
+
ctx.font = `${fontSize}px Roboto, Arial, sans-serif`
|
|
184
176
|
ctx.fillStyle = 'black'
|
|
185
177
|
ctx.textAlign = 'center'
|
|
186
178
|
ctx.textBaseline = 'middle'
|
|
187
179
|
|
|
188
|
-
//
|
|
189
|
-
const
|
|
180
|
+
// 실제 렌더링될 텍스트 크기 계산
|
|
181
|
+
const transform = ctx.getTransform()
|
|
182
|
+
const scaleX = Math.sqrt(transform.m11 * transform.m11 + transform.m21 * transform.m21)
|
|
183
|
+
const actualFontSize = fontSize * (scaleX || 1)
|
|
184
|
+
|
|
185
|
+
// 실제 텍스트 크기가 16px 이상일 때만 텍스트 표시
|
|
186
|
+
if (actualFontSize >= 16) {
|
|
187
|
+
// 배터리 잔량 텍스트 (정수 + % 포함)
|
|
188
|
+
const text = `${Math.round(BATTERYRATE)}%`
|
|
189
|
+
|
|
190
|
+
// 텍스트 크기 측정
|
|
191
|
+
const textMetrics = ctx.measureText(text)
|
|
192
|
+
const textWidth = textMetrics.width * 1.1 // 여백을 위해 10% 추가
|
|
193
|
+
const textHeight = fontSize * 1.1 // 여백을 위해 10% 추가
|
|
194
|
+
|
|
195
|
+
// 배터리 중심점 계산
|
|
196
|
+
const batteryCenterX = batteryX + batteryWidth / 2
|
|
197
|
+
const batteryCenterY = batteryY + batteryHeight / 2
|
|
190
198
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const textY = height // batteryY + batteryHeight // / 2
|
|
199
|
+
// 현재 변환 상태 저장
|
|
200
|
+
ctx.save()
|
|
194
201
|
|
|
195
|
-
|
|
202
|
+
// 배터리 중심점으로 이동
|
|
203
|
+
ctx.translate(batteryCenterX, batteryCenterY)
|
|
204
|
+
|
|
205
|
+
// 순수한 회전 각도 계산 (라디안)
|
|
206
|
+
const normalizedM11 = transform.m11 / scaleX
|
|
207
|
+
const normalizedM21 = transform.m21 / scaleX
|
|
208
|
+
let angle = Math.atan2(normalizedM21, normalizedM11)
|
|
209
|
+
|
|
210
|
+
// 회전 보정 (같은 방향으로 회전)
|
|
211
|
+
ctx.rotate(angle)
|
|
212
|
+
|
|
213
|
+
// 텍스트 배경 위치 계산 (중심점 기준)
|
|
214
|
+
const textBgX = -textWidth / 2
|
|
215
|
+
const textBgY = -textHeight / 2
|
|
216
|
+
|
|
217
|
+
// 텍스트 배경 그리기
|
|
218
|
+
ctx.fillStyle = 'white'
|
|
219
|
+
ctx.fillRect(textBgX, textBgY, textWidth, textHeight)
|
|
220
|
+
|
|
221
|
+
// 텍스트 그리기
|
|
222
|
+
ctx.fillStyle = 'black'
|
|
223
|
+
ctx.textAlign = 'center'
|
|
224
|
+
ctx.textBaseline = 'middle'
|
|
225
|
+
ctx.fillText(text, 0, textHeight * 0.1) // 텍스트를 약간 아래로 이동
|
|
226
|
+
|
|
227
|
+
// 변환 상태 복원
|
|
228
|
+
ctx.restore()
|
|
229
|
+
}
|
|
196
230
|
|
|
197
231
|
ctx.translate(-left, -top)
|
|
198
232
|
}
|
|
199
233
|
}
|
|
200
234
|
}
|
|
201
|
-
|
|
202
|
-
Component.register('AGV', AGV)
|
package/src/buffer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSMachine from './mcs-machine'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -8,6 +8,7 @@ const NATURE: ComponentNature = {
|
|
|
8
8
|
properties: [...MCSMachine.properties]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
@sceneComponent('Buffer')
|
|
11
12
|
export default class Buffer extends MCSMachine {
|
|
12
13
|
static get nature() {
|
|
13
14
|
return NATURE
|
|
@@ -50,5 +51,3 @@ export default class Buffer extends MCSMachine {
|
|
|
50
51
|
ctx.stroke()
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
-
Component.register('Buffer', Buffer)
|
package/src/carrier.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import JSON5 from 'json5'
|
|
2
2
|
import { getPopupData } from '@fmsim/api'
|
|
3
3
|
|
|
4
|
-
import { BOUNDS, Component, ComponentNature, Properties, Shape } from '@hatiolab/things-scene'
|
|
4
|
+
import { BOUNDS, Component, ComponentNature, Properties, Shape, sceneComponent } from '@hatiolab/things-scene'
|
|
5
5
|
import { ANIMATION_DEFAULT, AnimationPreset, AnimationConfig } from './features/animation-default.js'
|
|
6
6
|
import { ParentObjectMixin } from './features/parent-object-mixin.js'
|
|
7
7
|
import { LEGEND_CARRIER, Legend } from './features/mcs-status-default.js'
|
|
@@ -13,6 +13,7 @@ const NATURE: ComponentNature = {
|
|
|
13
13
|
rotatable: false
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
@sceneComponent('Carrier')
|
|
16
17
|
export default class Carrier extends MCSStatusMixin(ParentObjectMixin(Shape)) {
|
|
17
18
|
static get nature() {
|
|
18
19
|
return NATURE
|
|
@@ -236,5 +237,3 @@ export default class Carrier extends MCSStatusMixin(ParentObjectMixin(Shape)) {
|
|
|
236
237
|
return await getPopupData(type, id)
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
|
|
240
|
-
Component.register('Carrier', Carrier)
|
package/src/conveyor-join.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature, Control, POSITION } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, Control, POSITION, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSTransport from './mcs-transport'
|
|
3
3
|
import { ConveyorMixin } from './features/conveyor-mixin'
|
|
4
4
|
import { normalizeAngle } from './utils/normalize-angle'
|
|
@@ -92,6 +92,7 @@ var clockwiseControlHandler = {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
@sceneComponent('ConveyorJoin')
|
|
95
96
|
export default class ConveyorJoin extends ConveyorMixin(MCSTransport) {
|
|
96
97
|
get nature() {
|
|
97
98
|
return NATURE
|
|
@@ -208,5 +209,3 @@ export default class ConveyorJoin extends ConveyorMixin(MCSTransport) {
|
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
Component.memoize(ConveyorJoin.prototype, 'controls', false)
|
|
211
|
-
|
|
212
|
-
Component.register('ConveyorJoin', ConveyorJoin as any)
|
package/src/conveyor.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSTransport from './mcs-transport'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -18,6 +18,7 @@ const NATURE: ComponentNature = {
|
|
|
18
18
|
]
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
@sceneComponent('Conveyor')
|
|
21
22
|
export default class Conveyor extends MCSTransport {
|
|
22
23
|
static get nature() {
|
|
23
24
|
return NATURE
|
|
@@ -100,5 +101,3 @@ export default class Conveyor extends MCSTransport {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
-
Component.register('Conveyor', Conveyor)
|
package/src/crane.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature, Properties } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, Properties, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSVehicle from './mcs-vehicle'
|
|
3
3
|
import { LEGEND_CRANE } from './features/mcs-status-default'
|
|
4
4
|
|
|
@@ -11,6 +11,7 @@ const NATURE: ComponentNature = {
|
|
|
11
11
|
|
|
12
12
|
const GAP = 2
|
|
13
13
|
|
|
14
|
+
@sceneComponent('Crane')
|
|
14
15
|
export default class Crane extends MCSVehicle {
|
|
15
16
|
static get nature() {
|
|
16
17
|
return NATURE
|
|
@@ -73,5 +74,3 @@ export default class Crane extends MCSVehicle {
|
|
|
73
74
|
ctx.translate(-left, -top)
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
Component.register('Crane', Crane)
|
package/src/equipment.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSMachine from './mcs-machine'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -8,6 +8,7 @@ const NATURE: ComponentNature = {
|
|
|
8
8
|
properties: [...MCSMachine.properties]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
@sceneComponent('Equipment')
|
|
11
12
|
export default class Equipment extends MCSMachine {
|
|
12
13
|
static get nature() {
|
|
13
14
|
return NATURE
|
|
@@ -21,5 +22,3 @@ export default class Equipment extends MCSMachine {
|
|
|
21
22
|
return super.containable(component) || ['Port'].includes(component.state.type)
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
Component.register('Equipment', Equipment)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Component, Container, sceneComponent } from '@hatiolab/things-scene'
|
|
6
|
+
|
|
7
|
+
@sceneComponent('FloatingContainer')
|
|
8
|
+
export default class FloatingContainer extends Container {
|
|
9
|
+
get position() {
|
|
10
|
+
return this.app?.isViewMode ? 'absolute' : 'static'
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/index.ts
CHANGED
package/src/node-path.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Line, Control, sceneComponent } from '@hatiolab/things-scene'
|
|
6
6
|
import { Node, Position } from './types'
|
|
7
7
|
|
|
8
8
|
var controlHandler = {
|
|
@@ -70,6 +70,7 @@ const NATURE = {
|
|
|
70
70
|
help: 'scene/component/node-path'
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
@sceneComponent('NodePath')
|
|
73
74
|
export default class NodePath extends Line {
|
|
74
75
|
static get nature() {
|
|
75
76
|
return NATURE
|
|
@@ -292,5 +293,3 @@ export default class NodePath extends Line {
|
|
|
292
293
|
return controls
|
|
293
294
|
}
|
|
294
295
|
}
|
|
295
|
-
|
|
296
|
-
Component.register('NodePath', NodePath)
|
package/src/node.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { Component, Shape } from '@hatiolab/things-scene'
|
|
5
|
+
import { Component, Shape, sceneComponent } from '@hatiolab/things-scene'
|
|
6
6
|
import MCSMachine from './mcs-machine'
|
|
7
7
|
|
|
8
8
|
const NATURE = {
|
|
@@ -23,6 +23,7 @@ const NATURE = {
|
|
|
23
23
|
]
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
@sceneComponent('Node')
|
|
26
27
|
export default class Node extends Shape {
|
|
27
28
|
static RADIUS = 8
|
|
28
29
|
|
|
@@ -110,5 +111,3 @@ export default class Node extends Shape {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
Component.memoize(Node.prototype, 'path', false)
|
|
113
|
-
|
|
114
|
-
Component.register('Node', Node)
|
package/src/oht-line.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSTransport from './mcs-transport'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -8,6 +8,7 @@ const NATURE: ComponentNature = {
|
|
|
8
8
|
properties: [...MCSTransport.properties]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
@sceneComponent('OHTLine')
|
|
11
12
|
export default class OHTLine extends MCSTransport {
|
|
12
13
|
static get nature() {
|
|
13
14
|
return NATURE
|
|
@@ -43,5 +44,3 @@ export default class OHTLine extends MCSTransport {
|
|
|
43
44
|
context.translate(-left, -top)
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
Component.register('OHTLine', OHTLine)
|
package/src/oht.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature, Properties } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, Properties, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSVehicle from './mcs-vehicle'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -10,6 +10,7 @@ const NATURE: ComponentNature = {
|
|
|
10
10
|
|
|
11
11
|
const GAP = 2
|
|
12
12
|
|
|
13
|
+
@sceneComponent('OHT')
|
|
13
14
|
export default class OHT extends MCSVehicle {
|
|
14
15
|
static get nature() {
|
|
15
16
|
return NATURE
|
|
@@ -58,5 +59,3 @@ export default class OHT extends MCSVehicle {
|
|
|
58
59
|
ctx.translate(-left, -top)
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
Component.register('OHT', OHT)
|
package/src/port-flow.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature, RectPath, Shape, Properties } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, RectPath, Shape, Properties, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import { ParentObjectMixin, ParentObjectMixinProperties } from './features/parent-object-mixin'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -39,6 +39,7 @@ const NATURE: ComponentNature = {
|
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
@sceneComponent('PortFlow')
|
|
42
43
|
export default class PortFlow extends ParentObjectMixin(RectPath(Shape)) {
|
|
43
44
|
static get nature() {
|
|
44
45
|
return NATURE
|
|
@@ -236,5 +237,3 @@ export default class PortFlow extends ParentObjectMixin(RectPath(Shape)) {
|
|
|
236
237
|
this.setState('direction', INOUTTYPE)
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
|
|
240
|
-
Component.register('PortFlow', PortFlow)
|
package/src/port.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'
|
|
3
3
|
import MCSCarrierHolder from './mcs-carrier-holder'
|
|
4
4
|
|
|
@@ -9,6 +9,7 @@ const NATURE: ComponentNature = {
|
|
|
9
9
|
properties: [...MCSZoneMixinProperties, ...MCSCarrierHolder.properties]
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
@sceneComponent('Port')
|
|
12
13
|
export default class Port extends MCSZoneMixin(MCSCarrierHolder) {
|
|
13
14
|
static get nature() {
|
|
14
15
|
return NATURE
|
|
@@ -42,5 +43,3 @@ export default class Port extends MCSZoneMixin(MCSCarrierHolder) {
|
|
|
42
43
|
ctx.stroke()
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
Component.register('Port', Port)
|
package/src/shelf.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSCarrierHolder from './mcs-carrier-holder'
|
|
3
3
|
import { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'
|
|
4
4
|
|
|
@@ -9,6 +9,7 @@ const NATURE: ComponentNature = {
|
|
|
9
9
|
properties: [...MCSZoneMixinProperties, ...MCSCarrierHolder.properties]
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
@sceneComponent('Shelf')
|
|
12
13
|
export default class Shelf extends MCSZoneMixin(MCSCarrierHolder) {
|
|
13
14
|
static get nature() {
|
|
14
15
|
return NATURE
|
|
@@ -55,5 +56,3 @@ export default class Shelf extends MCSZoneMixin(MCSCarrierHolder) {
|
|
|
55
56
|
ctx.restore()
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
Component.register('Shelf', Shelf)
|
package/src/shuttle.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSVehicle from './mcs-vehicle'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -9,6 +9,7 @@ const NATURE: ComponentNature = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const RAILWIDTH = 2
|
|
12
|
+
@sceneComponent('Shuttle')
|
|
12
13
|
export default class Shuttle extends MCSVehicle {
|
|
13
14
|
static get nature() {
|
|
14
15
|
return NATURE
|
|
@@ -74,5 +75,3 @@ export default class Shuttle extends MCSVehicle {
|
|
|
74
75
|
// this.renderDirection(ctx)
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
Component.register('Shuttle', Shuttle)
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ComponentNature,
|
|
4
|
+
POSITION,
|
|
5
|
+
Properties,
|
|
6
|
+
RectPath,
|
|
7
|
+
Shape,
|
|
8
|
+
sceneComponent
|
|
9
|
+
} from '@hatiolab/things-scene'
|
|
2
10
|
import { themesColorRange } from '@fmsim/api'
|
|
3
11
|
import { MCSStatusMixin } from './features/mcs-status-mixin'
|
|
4
12
|
import { LEGEND_CAPACITY, Legend } from './features/mcs-status-default'
|
|
@@ -77,6 +85,8 @@ var controlHandler = {
|
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
87
|
|
|
88
|
+
@sceneComponent('StockerCapacityBar')
|
|
89
|
+
@sceneComponent('MCSGaugeCapacityBar')
|
|
80
90
|
export default class StockerCapacityBar extends ParentObjectMixin(MCSStatusMixin(RectPath(Shape))) {
|
|
81
91
|
static get nature() {
|
|
82
92
|
return NATURE
|
|
@@ -311,6 +321,3 @@ export default class StockerCapacityBar extends ParentObjectMixin(MCSStatusMixin
|
|
|
311
321
|
})
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
|
-
|
|
315
|
-
Component.register('StockerCapacityBar', StockerCapacityBar)
|
|
316
|
-
Component.register('MCSGaugeCapacityBar', StockerCapacityBar)
|
package/src/stocker.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentNature, Properties } from '@hatiolab/things-scene'
|
|
1
|
+
import { Component, ComponentNature, Properties, sceneComponent } from '@hatiolab/things-scene'
|
|
2
2
|
import MCSTransport from './mcs-transport'
|
|
3
3
|
|
|
4
4
|
const NATURE: ComponentNature = {
|
|
@@ -27,6 +27,7 @@ const NATURE: ComponentNature = {
|
|
|
27
27
|
// return localeValue
|
|
28
28
|
// }
|
|
29
29
|
|
|
30
|
+
@sceneComponent('Stocker')
|
|
30
31
|
export default class Stocker extends MCSTransport {
|
|
31
32
|
static get nature() {
|
|
32
33
|
return NATURE
|
|
@@ -50,5 +51,3 @@ export default class Stocker extends MCSTransport {
|
|
|
50
51
|
this.components.filter(component => !component.isIdentifiable()).forEach(component => (component.data = this.data))
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
-
Component.register('STOCKER', Stocker)
|