@fmsim/machine 2.0.0-beta.26 → 2.0.0-beta.28
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 +1 -1
- package/dist/carrier-manager.js.map +1 -1
- package/dist/factories/machine-3d.js +15 -5
- package/dist/factories/machine-3d.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/scanner.js +30 -0
- package/dist/scanner.js.map +1 -0
- 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/package.json +2 -2
- package/src/carrier-manager.ts +1 -1
- package/src/factories/machine-3d.ts +26 -6
- package/src/index.ts +2 -0
- package/src/scanner.ts +29 -0
- package/src/templates/index.ts +2 -0
- package/src/templates/scanner.ts +20 -0
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": "2.0.0-beta.
|
|
5
|
+
"version": "2.0.0-beta.28",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"things-scene": true,
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"prettier --write"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "d707acf52f4d81773f7594b83dddfc6ea465214f"
|
|
59
59
|
}
|
package/src/carrier-manager.ts
CHANGED
|
@@ -57,7 +57,7 @@ export default class CarrierManager {
|
|
|
57
57
|
) as unknown as Carrier
|
|
58
58
|
|
|
59
59
|
this.carriers.set(afterName, carrier)
|
|
60
|
-
holder.addComponent(carrier, true)
|
|
60
|
+
holder.addComponent(carrier, { silent: true })
|
|
61
61
|
} else if (carrier.parent !== holder && (!beforeName && afterName)) {
|
|
62
62
|
// CARRIERNAME이 새로 나타남 (이전엔 없었음) → 다른 holder로 이동
|
|
63
63
|
;(holder as any).reparent(carrier, { animated: true, duration: 2000, ease: 'inout' })
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import * as THREE from 'three'
|
|
12
12
|
import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js'
|
|
13
|
-
import { RealObjectGroup, registerRealObjectFactory, disposeObject3D } from '@hatiolab/things-scene'
|
|
13
|
+
import { RealObjectGroup, registerRealObjectFactory, disposeObject3D, TriangleExtrude } from '@hatiolab/things-scene'
|
|
14
14
|
import type { Component } from '@hatiolab/things-scene'
|
|
15
15
|
import { LEGEND_CAPACITY } from '../features/mcs-status-default'
|
|
16
16
|
import { getVaueOnRanges } from '../utils/get-value-on-ranges'
|
|
@@ -91,6 +91,9 @@ class MCSRealObject3D extends RealObjectGroup {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
protected get syncZPosOffset(): number {
|
|
94
|
+
// zPos가 명시되면 그 값을 절대 높이로 사용 (다른 컴포넌트와 동일한 의미)
|
|
95
|
+
if (this.component.state.zPos != null) return 0
|
|
96
|
+
|
|
94
97
|
// zPosOverride: 고정 높이 (OHTLine 등)
|
|
95
98
|
if (this._config.zPosOverride != null) {
|
|
96
99
|
return this._config.zPosOverride
|
|
@@ -99,10 +102,14 @@ class MCSRealObject3D extends RealObjectGroup {
|
|
|
99
102
|
if (this._config.defaultZPosFromParent) {
|
|
100
103
|
return TRANSPORT_SURFACE_HEIGHT
|
|
101
104
|
}
|
|
102
|
-
// Carrier:
|
|
105
|
+
// Carrier: 부모 유형에 따라 배치 위치 결정
|
|
103
106
|
if (this._config.sizeRatio && this._config.sizeRatio < 1) {
|
|
104
107
|
const parentType = this.component.parent?.state?.type
|
|
105
|
-
|
|
108
|
+
// OHT: 그리퍼 아래에 매달림 (캐리어 상단이 OHT 하단에 붙음)
|
|
109
|
+
if (parentType === 'OHT') {
|
|
110
|
+
return -this.effectiveDepth
|
|
111
|
+
}
|
|
112
|
+
if (parentType === 'Port' || parentType === 'Shelf' || parentType === 'Shuttle') {
|
|
106
113
|
return 0
|
|
107
114
|
}
|
|
108
115
|
return TRANSPORT_SURFACE_HEIGHT
|
|
@@ -395,9 +402,9 @@ class MCSRealObject3D extends RealObjectGroup {
|
|
|
395
402
|
updateDimension() {}
|
|
396
403
|
|
|
397
404
|
updateAlpha() {
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
const effective =
|
|
405
|
+
const state = this.component.state
|
|
406
|
+
// alpha가 명시적으로 설정되어 있으면 그 값을 사용, 없으면 config 기본값 적용
|
|
407
|
+
const effective = ('alpha' in state) ? (state.alpha as number) : this._config.opacity
|
|
401
408
|
|
|
402
409
|
this.object3d.traverse((o: any) => {
|
|
403
410
|
if (!o.material) return
|
|
@@ -978,3 +985,16 @@ class NodeRealObject3D extends RealObjectGroup {
|
|
|
978
985
|
}
|
|
979
986
|
|
|
980
987
|
registerRealObjectFactory('Node', (component: Component) => new NodeRealObject3D(component))
|
|
988
|
+
|
|
989
|
+
// Scanner — 이송 표면 높이의 기둥 형태
|
|
990
|
+
const SCANNER_CONFIG: MCS3DConfig = {
|
|
991
|
+
...DEFAULTS,
|
|
992
|
+
defaultDepth: TRANSPORT_SURFACE_HEIGHT * 0.2,
|
|
993
|
+
defaultZPosFromParent: true,
|
|
994
|
+
opacity: 1,
|
|
995
|
+
metalness: 0.3,
|
|
996
|
+
roughness: 0.7,
|
|
997
|
+
defaultColor: 0x888888,
|
|
998
|
+
shape: 'box',
|
|
999
|
+
}
|
|
1000
|
+
registerRealObjectFactory('Scanner', (component: Component) => new MCSRealObject3D(component, SCANNER_CONFIG))
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ import './equipment'
|
|
|
27
27
|
import './oht-line'
|
|
28
28
|
import './stocker'
|
|
29
29
|
import './crane-rail'
|
|
30
|
+
import './scanner'
|
|
30
31
|
|
|
31
32
|
// vehicles
|
|
32
33
|
import './agv'
|
|
@@ -74,6 +75,7 @@ export { default as Equipment } from './equipment'
|
|
|
74
75
|
export { default as OHTLine } from './oht-line'
|
|
75
76
|
export { default as Stocker } from './stocker'
|
|
76
77
|
export { default as CraneRail } from './crane-rail'
|
|
78
|
+
export { default as Scanner } from './scanner'
|
|
77
79
|
|
|
78
80
|
// ── vehicles ──
|
|
79
81
|
export { default as AGV } from './agv'
|
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)
|
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
|
+
}
|