@fmsim/machine 2.0.0-beta.3 → 2.0.0-beta.30
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/carrier-manager.js +92 -0
- package/dist/carrier-manager.js.map +1 -0
- package/dist/carrier.js +51 -6
- package/dist/carrier.js.map +1 -1
- package/dist/conveyor-join.js +8 -2
- package/dist/conveyor-join.js.map +1 -1
- package/dist/conveyor.js +8 -0
- package/dist/conveyor.js.map +1 -1
- package/dist/factories/agv-3d.js +36 -8
- package/dist/factories/agv-3d.js.map +1 -1
- package/dist/factories/conveyor-3d.js +159 -69
- package/dist/factories/conveyor-3d.js.map +1 -1
- package/dist/factories/machine-3d.js +604 -82
- package/dist/factories/machine-3d.js.map +1 -1
- package/dist/factories/oht-3d.js +50 -24
- package/dist/factories/oht-3d.js.map +1 -1
- package/dist/factories/shuttle-3d.js +32 -6
- package/dist/factories/shuttle-3d.js.map +1 -1
- package/dist/index.js +50 -34
- package/dist/index.js.map +1 -1
- package/dist/mcs-carrier-holder.js +39 -22
- package/dist/mcs-carrier-holder.js.map +1 -1
- package/dist/node.js +1 -1
- package/dist/node.js.map +1 -1
- package/dist/scanner.js +30 -0
- package/dist/scanner.js.map +1 -0
- package/dist/scene/root-container-override.js +9 -0
- package/dist/scene/root-container-override.js.map +1 -1
- package/dist/templates/index.js +2 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/scanner.js +20 -0
- package/dist/templates/scanner.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jest.config.js +10 -0
- package/package.json +4 -3
- package/src/carrier-manager.ts +116 -0
- package/src/carrier.ts +50 -4
- package/src/conveyor-join.ts +5 -2
- package/src/conveyor.ts +8 -0
- package/src/factories/agv-3d.ts +36 -8
- package/src/factories/conveyor-3d.ts +161 -71
- package/src/factories/machine-3d.ts +708 -72
- package/src/factories/oht-3d.ts +48 -24
- package/src/factories/shuttle-3d.ts +30 -6
- package/src/index.ts +56 -34
- package/src/mcs-carrier-holder.ts +38 -34
- package/src/node.ts +1 -1
- package/src/scanner.ts +29 -0
- package/src/scene/root-container-override.ts +12 -0
- package/src/templates/index.ts +2 -0
- package/src/templates/scanner.ts +20 -0
- package/translations/en.json +2 -1
- package/translations/ja.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/ms.json +2 -1
- package/translations/zh.json +2 -1
package/src/factories/oht-3d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import * as THREE from 'three'
|
|
13
13
|
import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js'
|
|
14
14
|
import { RoundedBoxGeometry } from 'three/examples/jsm/geometries/RoundedBoxGeometry.js'
|
|
15
|
-
import { RealObjectGroup, registerRealObjectFactory } from '@hatiolab/things-scene'
|
|
15
|
+
import { RealObjectGroup, registerRealObjectFactory, disposeObject3D } from '@hatiolab/things-scene'
|
|
16
16
|
import type { Component } from '@hatiolab/things-scene'
|
|
17
17
|
import { TRANSPORT_SURFACE_HEIGHT } from './machine-3d.js'
|
|
18
18
|
|
|
@@ -24,6 +24,7 @@ const DEFAULT_BODY_COLOR = 0x6688cc
|
|
|
24
24
|
const OHT_RAIL_HEIGHT = 6 * TRANSPORT_SURFACE_HEIGHT
|
|
25
25
|
|
|
26
26
|
export class OHT3D extends RealObjectGroup {
|
|
27
|
+
private _ownMeshes: THREE.Mesh[] = []
|
|
27
28
|
get effectiveDepth(): number {
|
|
28
29
|
const { depth } = this.component.state
|
|
29
30
|
return depth || TRANSPORT_SURFACE_HEIGHT
|
|
@@ -82,36 +83,34 @@ export class OHT3D extends RealObjectGroup {
|
|
|
82
83
|
metalness: 0.4,
|
|
83
84
|
})
|
|
84
85
|
|
|
85
|
-
// ── 1. 하단 그리퍼 바 (캐리어를 집는 가로 바) ──
|
|
86
|
+
// ── 1. 하단 그리퍼 바 (캐리어를 집는 가로 바 — 이동 방향과 직교) ──
|
|
86
87
|
const gripperBarW = w * 0.7
|
|
87
88
|
const gripperBarD = h * 0.15
|
|
88
89
|
const gripperGeo = new THREE.BoxGeometry(gripperBarW, gripperBarH, gripperBarD)
|
|
89
90
|
const gripperMesh = new THREE.Mesh(gripperGeo, frameMat)
|
|
90
91
|
gripperMesh.position.y = gripperBarH / 2
|
|
91
92
|
gripperMesh.castShadow = true
|
|
92
|
-
this.object3d.add(gripperMesh)
|
|
93
93
|
|
|
94
|
-
// ── 2. 호이스트 암 (
|
|
94
|
+
// ── 2. 호이스트 암 (전후 수직 기둥 + 하단 연결 바) ──
|
|
95
95
|
const armBaseY = gripperBarH
|
|
96
96
|
const armGeometries: THREE.BufferGeometry[] = []
|
|
97
97
|
|
|
98
|
-
//
|
|
99
|
-
for (const
|
|
98
|
+
// 전후 수직 기둥 (레일 방향 = Z축)
|
|
99
|
+
for (const zSign of [-1, 1]) {
|
|
100
100
|
const pillar = new THREE.BoxGeometry(armThickness, armH, armThickness)
|
|
101
|
-
pillar.translate(
|
|
101
|
+
pillar.translate(0, armBaseY + armH / 2, zSign * (h * 0.3))
|
|
102
102
|
armGeometries.push(pillar)
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
// 하단
|
|
106
|
-
const
|
|
105
|
+
// 하단 연결 바 (레일 방향으로 연결)
|
|
106
|
+
const crossBarD = h * 0.6 + armThickness
|
|
107
107
|
const crossBarH = armThickness * 0.6
|
|
108
|
-
const crossBar = new THREE.BoxGeometry(
|
|
108
|
+
const crossBar = new THREE.BoxGeometry(armThickness, crossBarH, crossBarD)
|
|
109
109
|
crossBar.translate(0, armBaseY + crossBarH / 2, 0)
|
|
110
110
|
armGeometries.push(crossBar)
|
|
111
111
|
|
|
112
112
|
const armMesh = new THREE.Mesh(BufferGeometryUtils.mergeGeometries(armGeometries), frameMat)
|
|
113
113
|
armMesh.castShadow = true
|
|
114
|
-
this.object3d.add(armMesh)
|
|
115
114
|
|
|
116
115
|
// ── 3. 본체 하우징 (statusColor 적용) ──
|
|
117
116
|
const bodyBaseY = armBaseY + armH
|
|
@@ -126,12 +125,11 @@ export class OHT3D extends RealObjectGroup {
|
|
|
126
125
|
bodyMesh.position.y = bodyBaseY + bodyH / 2
|
|
127
126
|
bodyMesh.castShadow = true
|
|
128
127
|
bodyMesh.receiveShadow = true
|
|
129
|
-
this.object3d.add(bodyMesh)
|
|
130
128
|
|
|
131
|
-
// ── 4. 상단 트롤리 플레이트 (
|
|
129
|
+
// ── 4. 상단 트롤리 플레이트 (레일 방향으로 길게 — Z축) ──
|
|
132
130
|
const trolleyBaseY = bodyBaseY + bodyH + gap
|
|
133
|
-
const trolleyW = w *
|
|
134
|
-
const trolleyD = h *
|
|
131
|
+
const trolleyW = w * 0.6
|
|
132
|
+
const trolleyD = h * 1.15
|
|
135
133
|
const trolleyGeo = new THREE.BoxGeometry(trolleyW, trolleyH, trolleyD)
|
|
136
134
|
const trolleyMat = new THREE.MeshStandardMaterial({
|
|
137
135
|
color: TROLLEY_COLOR,
|
|
@@ -141,27 +139,53 @@ export class OHT3D extends RealObjectGroup {
|
|
|
141
139
|
const trolleyMesh = new THREE.Mesh(trolleyGeo, trolleyMat)
|
|
142
140
|
trolleyMesh.position.y = trolleyBaseY + trolleyH / 2
|
|
143
141
|
trolleyMesh.castShadow = true
|
|
144
|
-
this.object3d.add(trolleyMesh)
|
|
145
142
|
|
|
146
|
-
// ── 5.
|
|
143
|
+
// ── 5. 전후 바퀴 (트롤리 위, 레일 방향 = Z축) ──
|
|
147
144
|
const wheelBaseY = trolleyBaseY + trolleyH
|
|
148
145
|
const wheelRadius = wheelH / 2
|
|
149
|
-
const wheelDepth =
|
|
150
|
-
|
|
146
|
+
const wheelDepth = w * 0.2
|
|
147
|
+
const wheelMeshes: THREE.Mesh[] = []
|
|
148
|
+
for (const zSign of [-1, 1]) {
|
|
151
149
|
const wheelGeo = new THREE.CylinderGeometry(wheelRadius, wheelRadius, wheelDepth, 12)
|
|
152
|
-
wheelGeo.
|
|
150
|
+
wheelGeo.rotateZ(Math.PI / 2)
|
|
153
151
|
const wheelMesh = new THREE.Mesh(wheelGeo, trolleyMat)
|
|
154
|
-
wheelMesh.position.set(
|
|
152
|
+
wheelMesh.position.set(0, wheelBaseY + wheelRadius, zSign * (trolleyD * 0.35))
|
|
155
153
|
wheelMesh.castShadow = true
|
|
156
|
-
|
|
154
|
+
wheelMeshes.push(wheelMesh)
|
|
157
155
|
}
|
|
156
|
+
|
|
157
|
+
this._ownMeshes = [gripperMesh, armMesh, bodyMesh, trolleyMesh, ...wheelMeshes]
|
|
158
|
+
for (const m of this._ownMeshes) this.object3d.add(m)
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
updateDimension() {}
|
|
161
|
-
|
|
162
|
+
|
|
163
|
+
update() {
|
|
164
|
+
for (const m of this._ownMeshes) {
|
|
165
|
+
this.object3d.remove(m)
|
|
166
|
+
disposeObject3D(m)
|
|
167
|
+
}
|
|
168
|
+
this._ownMeshes = []
|
|
169
|
+
this.build()
|
|
170
|
+
this.updateTransform()
|
|
171
|
+
this.updateAlpha()
|
|
172
|
+
this.updateHidden()
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
updateAlpha() {
|
|
176
|
+
const { alpha = 1 } = this.component.state
|
|
177
|
+
for (const m of this._ownMeshes) {
|
|
178
|
+
const materials = Array.isArray(m.material) ? m.material : [m.material]
|
|
179
|
+
for (const mat of materials) {
|
|
180
|
+
;(mat as THREE.MeshStandardMaterial).opacity = alpha
|
|
181
|
+
;(mat as THREE.MeshStandardMaterial).transparent = alpha < 1
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
162
185
|
|
|
163
186
|
onchange(after: Record<string, unknown>, before: Record<string, unknown>) {
|
|
164
|
-
if ('width' in after || 'height' in after || 'depth' in after ||
|
|
187
|
+
if ('width' in after || 'height' in after || 'depth' in after ||
|
|
188
|
+
'fillStyle' in after || 'strokeStyle' in after || 'id' in after) {
|
|
165
189
|
this.update()
|
|
166
190
|
return
|
|
167
191
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import * as THREE from 'three'
|
|
14
14
|
import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js'
|
|
15
|
-
import { RealObjectGroup, registerRealObjectFactory } from '@hatiolab/things-scene'
|
|
15
|
+
import { RealObjectGroup, registerRealObjectFactory, disposeObject3D } from '@hatiolab/things-scene'
|
|
16
16
|
import type { Component } from '@hatiolab/things-scene'
|
|
17
17
|
import { TRANSPORT_SURFACE_HEIGHT } from './machine-3d.js'
|
|
18
18
|
|
|
@@ -21,6 +21,7 @@ const FORK_COLOR = 0x777777
|
|
|
21
21
|
const DEFAULT_BODY_COLOR = 0x6688cc
|
|
22
22
|
|
|
23
23
|
export class Shuttle3D extends RealObjectGroup {
|
|
24
|
+
private _ownMeshes: THREE.Mesh[] = []
|
|
24
25
|
get effectiveDepth(): number {
|
|
25
26
|
const { depth } = this.component.state
|
|
26
27
|
return depth || TRANSPORT_SURFACE_HEIGHT
|
|
@@ -80,7 +81,6 @@ export class Shuttle3D extends RealObjectGroup {
|
|
|
80
81
|
baseMesh.position.y = baseH / 2
|
|
81
82
|
baseMesh.castShadow = true
|
|
82
83
|
baseMesh.receiveShadow = true
|
|
83
|
-
this.object3d.add(baseMesh)
|
|
84
84
|
|
|
85
85
|
// ── 2. 좌우 마스트 기둥 (statusColor 적용) ──
|
|
86
86
|
const mastBaseY = baseH
|
|
@@ -109,7 +109,6 @@ export class Shuttle3D extends RealObjectGroup {
|
|
|
109
109
|
|
|
110
110
|
const mastMesh = new THREE.Mesh(BufferGeometryUtils.mergeGeometries(mastGeometries), mastMat)
|
|
111
111
|
mastMesh.castShadow = true
|
|
112
|
-
this.object3d.add(mastMesh)
|
|
113
112
|
|
|
114
113
|
// ── 3. 상단 포크 (2개의 평행 암 + 백 플레이트) ──
|
|
115
114
|
const forkBaseY = mastBaseY + mastH
|
|
@@ -141,14 +140,39 @@ export class Shuttle3D extends RealObjectGroup {
|
|
|
141
140
|
|
|
142
141
|
const forkMesh = new THREE.Mesh(BufferGeometryUtils.mergeGeometries(forkGeometries), forkMat)
|
|
143
142
|
forkMesh.castShadow = true
|
|
144
|
-
|
|
143
|
+
|
|
144
|
+
this._ownMeshes = [baseMesh, mastMesh, forkMesh]
|
|
145
|
+
for (const m of this._ownMeshes) this.object3d.add(m)
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
updateDimension() {}
|
|
148
|
-
|
|
149
|
+
|
|
150
|
+
update() {
|
|
151
|
+
for (const m of this._ownMeshes) {
|
|
152
|
+
this.object3d.remove(m)
|
|
153
|
+
disposeObject3D(m)
|
|
154
|
+
}
|
|
155
|
+
this._ownMeshes = []
|
|
156
|
+
this.build()
|
|
157
|
+
this.updateTransform()
|
|
158
|
+
this.updateAlpha()
|
|
159
|
+
this.updateHidden()
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
updateAlpha() {
|
|
163
|
+
const { alpha = 1 } = this.component.state
|
|
164
|
+
for (const m of this._ownMeshes) {
|
|
165
|
+
const materials = Array.isArray(m.material) ? m.material : [m.material]
|
|
166
|
+
for (const mat of materials) {
|
|
167
|
+
;(mat as THREE.MeshStandardMaterial).opacity = alpha
|
|
168
|
+
;(mat as THREE.MeshStandardMaterial).transparent = alpha < 1
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
149
172
|
|
|
150
173
|
onchange(after: Record<string, unknown>, before: Record<string, unknown>) {
|
|
151
|
-
if ('width' in after || 'height' in after || 'depth' in after ||
|
|
174
|
+
if ('width' in after || 'height' in after || 'depth' in after ||
|
|
175
|
+
'fillStyle' in after || 'strokeStyle' in after || 'id' in after) {
|
|
152
176
|
this.update()
|
|
153
177
|
return
|
|
154
178
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,55 +1,72 @@
|
|
|
1
1
|
// ── side-effect: scene override ──
|
|
2
|
-
import './scene/root-container-override
|
|
2
|
+
import './scene/root-container-override'
|
|
3
3
|
|
|
4
4
|
// ── side-effect: 3D factories ──
|
|
5
|
-
import './factories/machine-3d
|
|
6
|
-
import './factories/conveyor-3d
|
|
7
|
-
import './factories/agv-3d
|
|
8
|
-
import './factories/oht-3d
|
|
9
|
-
import './factories/shuttle-3d
|
|
10
|
-
import './factories/crane-3d
|
|
11
|
-
import './factories/crane-rail-3d
|
|
5
|
+
import './factories/machine-3d'
|
|
6
|
+
import './factories/conveyor-3d'
|
|
7
|
+
import './factories/agv-3d'
|
|
8
|
+
import './factories/oht-3d'
|
|
9
|
+
import './factories/shuttle-3d'
|
|
10
|
+
import './factories/crane-3d'
|
|
11
|
+
import './factories/crane-rail-3d'
|
|
12
12
|
|
|
13
13
|
// ── side-effect: @sceneComponent 등록 (tree-shaking 방지) ──
|
|
14
|
-
|
|
15
|
-
import './
|
|
16
|
-
import './stocker-
|
|
17
|
-
import './stocker-
|
|
18
|
-
import './
|
|
19
|
-
import './
|
|
20
|
-
import './buffer.js'
|
|
21
|
-
import './conveyor.js'
|
|
22
|
-
import './conveyor-join.js'
|
|
23
|
-
import './equipment.js'
|
|
24
|
-
import './oht-line.js'
|
|
25
|
-
import './stocker.js'
|
|
26
|
-
import './crane-rail.js'
|
|
27
|
-
import './agv.js'
|
|
28
|
-
import './oht.js'
|
|
29
|
-
import './shuttle.js'
|
|
30
|
-
import './port.js'
|
|
31
|
-
import './crane.js'
|
|
32
|
-
import './shelf.js'
|
|
33
|
-
import './carrier.js'
|
|
34
|
-
import './node.js'
|
|
35
|
-
import './node-path.js'
|
|
36
|
-
import './floating-container.js'
|
|
37
|
-
import './static-container.js'
|
|
38
|
-
import './clickable-popup.js'
|
|
14
|
+
// bars & overlays
|
|
15
|
+
import './zone-capacity-bar'
|
|
16
|
+
import './stocker-capacity-bar'
|
|
17
|
+
import './stocker-carrier-bar'
|
|
18
|
+
import './stocker-abnormal-bar'
|
|
19
|
+
import './port-flow'
|
|
39
20
|
|
|
21
|
+
// facilities
|
|
22
|
+
import './agv-line'
|
|
23
|
+
import './buffer'
|
|
24
|
+
import './conveyor'
|
|
25
|
+
import './conveyor-join'
|
|
26
|
+
import './equipment'
|
|
27
|
+
import './oht-line'
|
|
28
|
+
import './stocker'
|
|
29
|
+
import './crane-rail'
|
|
30
|
+
import './scanner'
|
|
31
|
+
|
|
32
|
+
// vehicles
|
|
33
|
+
import './agv'
|
|
34
|
+
import './oht'
|
|
35
|
+
import './shuttle'
|
|
36
|
+
|
|
37
|
+
// units
|
|
38
|
+
import './port'
|
|
39
|
+
import './crane'
|
|
40
|
+
import './shelf'
|
|
41
|
+
import './carrier'
|
|
42
|
+
|
|
43
|
+
// topology
|
|
44
|
+
import './node'
|
|
45
|
+
import './node-path'
|
|
46
|
+
|
|
47
|
+
// containers
|
|
48
|
+
import './floating-container'
|
|
49
|
+
import './static-container'
|
|
50
|
+
import './clickable-popup'
|
|
51
|
+
|
|
52
|
+
// ── groups ──
|
|
40
53
|
export { default as MachineGroups } from './groups'
|
|
41
54
|
|
|
55
|
+
// ── base classes ──
|
|
42
56
|
export { default as MCSMachine } from './mcs-machine'
|
|
43
57
|
export { default as MCSUnit } from './mcs-unit'
|
|
44
58
|
export { default as MCSCarrierHolder } from './mcs-carrier-holder'
|
|
45
59
|
export { default as MCSVehicle } from './mcs-vehicle'
|
|
46
60
|
export { default as MCSTransport } from './mcs-transport'
|
|
61
|
+
|
|
62
|
+
// ── bars & overlays ──
|
|
47
63
|
export { default as ZoneCapacityBar } from './zone-capacity-bar'
|
|
48
64
|
export { default as StockerCapacityBar } from './stocker-capacity-bar'
|
|
49
65
|
export { default as StockerCarrierBar } from './stocker-carrier-bar'
|
|
50
66
|
export { default as StockerAbnormalBar } from './stocker-abnormal-bar'
|
|
51
67
|
export { default as PortFlow } from './port-flow'
|
|
52
68
|
|
|
69
|
+
// ── facilities ──
|
|
53
70
|
export { default as AGVLine } from './agv-line'
|
|
54
71
|
export { default as Buffer } from './buffer'
|
|
55
72
|
export { default as Conveyor } from './conveyor'
|
|
@@ -58,19 +75,24 @@ export { default as Equipment } from './equipment'
|
|
|
58
75
|
export { default as OHTLine } from './oht-line'
|
|
59
76
|
export { default as Stocker } from './stocker'
|
|
60
77
|
export { default as CraneRail } from './crane-rail'
|
|
78
|
+
export { default as Scanner } from './scanner'
|
|
61
79
|
|
|
80
|
+
// ── vehicles ──
|
|
62
81
|
export { default as AGV } from './agv'
|
|
63
82
|
export { default as OHT } from './oht'
|
|
64
83
|
export { default as Shuttle } from './shuttle'
|
|
65
84
|
|
|
85
|
+
// ── units ──
|
|
66
86
|
export { default as Port } from './port'
|
|
67
87
|
export { default as Crane } from './crane'
|
|
68
88
|
export { default as Shelf } from './shelf'
|
|
69
89
|
export { default as Carrier } from './carrier'
|
|
70
90
|
|
|
91
|
+
// ── topology ──
|
|
71
92
|
export { default as Node } from './node'
|
|
72
93
|
export { default as NodePath } from './node-path'
|
|
73
94
|
|
|
95
|
+
// ── containers ──
|
|
74
96
|
export { default as FloatingContainer } from './floating-container'
|
|
75
|
-
export { default as StaticContainer } from './static-container
|
|
97
|
+
export { default as StaticContainer } from './static-container'
|
|
76
98
|
export { default as ClickablePopup } from './clickable-popup'
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Model, Properties } from '@hatiolab/things-scene'
|
|
2
1
|
import { themesColorMap, themesAnimationMap } from '@fmsim/api'
|
|
3
2
|
import MCSUnit from './mcs-unit.js'
|
|
4
|
-
import Carrier from './carrier.js'
|
|
5
3
|
|
|
6
4
|
export default class MCSCarrierHolder extends MCSUnit {
|
|
7
5
|
static get properties(): any {
|
|
@@ -31,50 +29,56 @@ export default class MCSCarrierHolder extends MCSUnit {
|
|
|
31
29
|
]
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
super.ready()
|
|
32
|
+
get showOverflow() {
|
|
33
|
+
return true
|
|
34
|
+
}
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
get hierarchy() {
|
|
37
|
+
return {
|
|
38
|
+
...super.hierarchy,
|
|
39
|
+
components: []
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
const { width, height } = this.state
|
|
44
|
-
|
|
45
|
-
this.carrier = Model.compile(
|
|
46
|
-
{
|
|
47
|
-
type: 'Carrier',
|
|
48
|
-
left: 0,
|
|
49
|
-
top: 0,
|
|
50
|
-
width,
|
|
51
|
-
height,
|
|
52
|
-
showText: this.getState('showCarrierText') || false
|
|
53
|
-
},
|
|
54
|
-
this.root.app
|
|
55
|
-
) as any
|
|
56
|
-
|
|
57
|
-
this.addComponent(this.carrier!)
|
|
58
|
-
|
|
59
|
-
this.carrier!.data = this.data
|
|
60
41
|
}
|
|
61
42
|
|
|
62
43
|
dispose(): void {
|
|
63
|
-
this.
|
|
64
|
-
|
|
44
|
+
;(this.root as any)?.carrierManager?.update(this, {}, this.data)
|
|
65
45
|
super.dispose()
|
|
66
46
|
}
|
|
67
47
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
48
|
+
async ready() {
|
|
49
|
+
super.ready()
|
|
50
|
+
|
|
51
|
+
const { CARRIERNAME, CARRIERTYPE = '', EMPTYTYPE, CARRIERSTATUS } = this.data || {}
|
|
52
|
+
|
|
53
|
+
if(CARRIERNAME) {
|
|
54
|
+
;(this.root as any).carrierManager.update(this, {
|
|
55
|
+
CARRIERNAME,
|
|
56
|
+
CARRIERTYPE,
|
|
57
|
+
EMPTYTYPE,
|
|
58
|
+
CARRIERSTATUS
|
|
59
|
+
}, undefined)
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
62
|
|
|
75
63
|
onchangeData(after: Record<string, any>, before: Record<string, any>): void {
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
// CARRIERNAME, CARRIERTYPE = '', EMPTYTYPE, CARRIERSTATUS 이 변경되었을 때만 캐리어 관리자에게 알린다.
|
|
65
|
+
const { CARRIERNAME, CARRIERTYPE = '', EMPTYTYPE, CARRIERSTATUS } = after.data || {}
|
|
66
|
+
const { CARRIERNAME: beforeCARRIERNAME, CARRIERTYPE: beforeCARRIERTYPE = '', EMPTYTYPE: beforeEMPTYTYPE, CARRIERSTATUS: beforeCARRIERSTATUS } = before.data || {}
|
|
67
|
+
if(CARRIERNAME !== beforeCARRIERNAME ||
|
|
68
|
+
CARRIERTYPE !== beforeCARRIERTYPE ||
|
|
69
|
+
EMPTYTYPE !== beforeEMPTYTYPE ||
|
|
70
|
+
CARRIERSTATUS !== beforeCARRIERSTATUS) {
|
|
71
|
+
;(this.root as any).carrierManager.update(this, {
|
|
72
|
+
CARRIERNAME,
|
|
73
|
+
CARRIERTYPE,
|
|
74
|
+
EMPTYTYPE,
|
|
75
|
+
CARRIERSTATUS
|
|
76
|
+
}, {
|
|
77
|
+
CARRIERNAME: beforeCARRIERNAME,
|
|
78
|
+
CARRIERTYPE: beforeCARRIERTYPE,
|
|
79
|
+
EMPTYTYPE: beforeEMPTYTYPE,
|
|
80
|
+
CARRIERSTATUS: beforeCARRIERSTATUS
|
|
81
|
+
})
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
super.onchangeData(after, before)
|
package/src/node.ts
CHANGED
package/src/scanner.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component, ComponentNature, Triangle, sceneComponent } from '@hatiolab/things-scene'
|
|
2
|
+
import { MCSStatusMixin } from './features/mcs-status-mixin'
|
|
3
|
+
|
|
4
|
+
const NATURE: ComponentNature = {
|
|
5
|
+
mutable: true,
|
|
6
|
+
resizable: false,
|
|
7
|
+
rotatable: true,
|
|
8
|
+
properties: [
|
|
9
|
+
{
|
|
10
|
+
type: 'number',
|
|
11
|
+
label: 'round',
|
|
12
|
+
name: 'round',
|
|
13
|
+
property: { min: 0, max: 100, step: 1 }
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@sceneComponent('Scanner')
|
|
19
|
+
export default class Scanner extends MCSStatusMixin(Triangle) {
|
|
20
|
+
static get nature() {
|
|
21
|
+
return NATURE
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
is3dish() {
|
|
25
|
+
return true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Component.memoize(Scanner.prototype, 'path', false)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, RootContainer } from '@hatiolab/things-scene'
|
|
2
2
|
import { themesColorMap, themesColorRange, themesAnimationMap } from '@fmsim/api'
|
|
3
3
|
import { Legend } from '../features/mcs-status-default'
|
|
4
|
+
import CarrierManager from '../carrier-manager'
|
|
4
5
|
|
|
5
6
|
// RootContainer 클래스 타입 확장
|
|
6
7
|
declare module '@hatiolab/things-scene' {
|
|
@@ -26,6 +27,8 @@ declare module '@hatiolab/things-scene' {
|
|
|
26
27
|
vehicleAnimation?: boolean
|
|
27
28
|
// 캐시 관련 속성 추가
|
|
28
29
|
_animationConfigCache?: Map<string, any>
|
|
30
|
+
_carrierManager?: CarrierManager
|
|
31
|
+
carrierManager: CarrierManager
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -326,3 +329,12 @@ Object.defineProperty(RootContainer.prototype, 'vehicleAnimation', {
|
|
|
326
329
|
return !!vehicleAnimation
|
|
327
330
|
}
|
|
328
331
|
})
|
|
332
|
+
|
|
333
|
+
Object.defineProperty(RootContainer.prototype, 'carrierManager', {
|
|
334
|
+
get: function () {
|
|
335
|
+
if (!this._carrierManager) {
|
|
336
|
+
this._carrierManager = new CarrierManager(this)
|
|
337
|
+
}
|
|
338
|
+
return this._carrierManager
|
|
339
|
+
}
|
|
340
|
+
})
|
package/src/templates/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import agvLine from './agv-line'
|
|
|
17
17
|
import ohtLine from './oht-line'
|
|
18
18
|
import conveyor from './conveyor'
|
|
19
19
|
|
|
20
|
+
import Scanner from './scanner'
|
|
20
21
|
import Node from './node'
|
|
21
22
|
import DataSubscription from './data-subscription'
|
|
22
23
|
import FloatingContainer from './floating-container'
|
|
@@ -41,6 +42,7 @@ export default [
|
|
|
41
42
|
Shelf,
|
|
42
43
|
Port,
|
|
43
44
|
|
|
45
|
+
Scanner,
|
|
44
46
|
Node,
|
|
45
47
|
FloatingContainer,
|
|
46
48
|
DataSubscription
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const icon = new URL('../../icons/equipment.png', import.meta.url).href
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
type: 'Scanner',
|
|
5
|
+
description: 'Fixed mount barcode/QR scanner',
|
|
6
|
+
group: ['etc'],
|
|
7
|
+
icon,
|
|
8
|
+
model: {
|
|
9
|
+
type: 'Scanner',
|
|
10
|
+
x1: 100,
|
|
11
|
+
y1: 100,
|
|
12
|
+
x2: 130,
|
|
13
|
+
y2: 110,
|
|
14
|
+
x3: 100,
|
|
15
|
+
y3: 120,
|
|
16
|
+
strokeStyle: '#333',
|
|
17
|
+
fillStyle: '#8899aa',
|
|
18
|
+
lineWidth: 1
|
|
19
|
+
}
|
|
20
|
+
}
|
package/translations/en.json
CHANGED
|
@@ -46,5 +46,6 @@
|
|
|
46
46
|
"label.node-machine": "node machine",
|
|
47
47
|
"label.nodes": "nodes",
|
|
48
48
|
"label.vehicle-animation": "vehicle animation",
|
|
49
|
-
"label.battery-rate-legend-name": "battery rate"
|
|
49
|
+
"label.battery-rate-legend-name": "battery rate",
|
|
50
|
+
"label.conveyor-orientation": "Transfer Direction"
|
|
50
51
|
}
|
package/translations/ja.json
CHANGED
|
@@ -48,5 +48,6 @@
|
|
|
48
48
|
"label.node-machine": "node machine",
|
|
49
49
|
"label.nodes": "nodes",
|
|
50
50
|
"label.vehicle-animation": "vehicle animation",
|
|
51
|
-
"label.battery-rate-legend-name": "battery rate"
|
|
51
|
+
"label.battery-rate-legend-name": "battery rate",
|
|
52
|
+
"label.conveyor-orientation": "搬送方向"
|
|
52
53
|
}
|
package/translations/ko.json
CHANGED
package/translations/ms.json
CHANGED
|
@@ -48,5 +48,6 @@
|
|
|
48
48
|
"label.node-machine": "node machine",
|
|
49
49
|
"label.nodes": "nodes",
|
|
50
50
|
"label.vehicle-animation": "vehicle animation",
|
|
51
|
-
"label.battery-rate-legend-name": "battery rate"
|
|
51
|
+
"label.battery-rate-legend-name": "battery rate",
|
|
52
|
+
"label.conveyor-orientation": "Transfer Direction"
|
|
52
53
|
}
|
package/translations/zh.json
CHANGED
|
@@ -48,5 +48,6 @@
|
|
|
48
48
|
"label.node-machine": "node machine",
|
|
49
49
|
"label.nodes": "nodes",
|
|
50
50
|
"label.vehicle-animation": "vehicle animation",
|
|
51
|
-
"label.battery-rate-legend-name": "battery rate"
|
|
51
|
+
"label.battery-rate-legend-name": "battery rate",
|
|
52
|
+
"label.conveyor-orientation": "输送方向"
|
|
52
53
|
}
|