@fmsim/machine 1.0.88 → 2.0.0-beta.100

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.
Files changed (165) hide show
  1. package/dist/agv-line.js.map +1 -1
  2. package/dist/agv.js +6 -2
  3. package/dist/agv.js.map +1 -1
  4. package/dist/buffer.js.map +1 -1
  5. package/dist/carrier-manager.js +183 -0
  6. package/dist/carrier-manager.js.map +1 -0
  7. package/dist/carrier.js +105 -14
  8. package/dist/carrier.js.map +1 -1
  9. package/dist/conveyor-join.js +8 -2
  10. package/dist/conveyor-join.js.map +1 -1
  11. package/dist/conveyor.js +9 -1
  12. package/dist/conveyor.js.map +1 -1
  13. package/dist/crane-rail.js +53 -0
  14. package/dist/crane-rail.js.map +1 -0
  15. package/dist/crane.js +144 -1
  16. package/dist/crane.js.map +1 -1
  17. package/dist/equipment.js.map +1 -1
  18. package/dist/factories/agv-3d.js +147 -0
  19. package/dist/factories/agv-3d.js.map +1 -0
  20. package/dist/factories/conveyor-3d.js +345 -0
  21. package/dist/factories/conveyor-3d.js.map +1 -0
  22. package/dist/factories/crane-3d.js +186 -0
  23. package/dist/factories/crane-3d.js.map +1 -0
  24. package/dist/factories/crane-rail-3d.js +95 -0
  25. package/dist/factories/crane-rail-3d.js.map +1 -0
  26. package/dist/factories/machine-3d.js +973 -0
  27. package/dist/factories/machine-3d.js.map +1 -0
  28. package/dist/factories/oht-3d.js +177 -0
  29. package/dist/factories/oht-3d.js.map +1 -0
  30. package/dist/factories/shuttle-3d.js +159 -0
  31. package/dist/factories/shuttle-3d.js.map +1 -0
  32. package/dist/factories/z-priority-defaults.js +33 -0
  33. package/dist/factories/z-priority-defaults.js.map +1 -0
  34. package/dist/factories/z-priority.js +54 -0
  35. package/dist/factories/z-priority.js.map +1 -0
  36. package/dist/features/conveyor-mixin.js.map +1 -1
  37. package/dist/features/mcs-status-default.js +15 -1
  38. package/dist/features/mcs-status-default.js.map +1 -1
  39. package/dist/features/mcs-status-mixin.js +22 -0
  40. package/dist/features/mcs-status-mixin.js.map +1 -1
  41. package/dist/features/mcs-zone-mixin.js.map +1 -1
  42. package/dist/features/parent-object-mixin.js +15 -7
  43. package/dist/features/parent-object-mixin.js.map +1 -1
  44. package/dist/floating-container.js +5 -0
  45. package/dist/floating-container.js.map +1 -1
  46. package/dist/index.js +58 -2
  47. package/dist/index.js.map +1 -1
  48. package/dist/mcs-carrier-holder.js +56 -17
  49. package/dist/mcs-carrier-holder.js.map +1 -1
  50. package/dist/mcs-machine.js +39 -0
  51. package/dist/mcs-machine.js.map +1 -1
  52. package/dist/mcs-unit.js +20 -0
  53. package/dist/mcs-unit.js.map +1 -1
  54. package/dist/mcs-vehicle.js +10 -4
  55. package/dist/mcs-vehicle.js.map +1 -1
  56. package/dist/node.js +10 -3
  57. package/dist/node.js.map +1 -1
  58. package/dist/oht-line.js.map +1 -1
  59. package/dist/oht.js +4 -0
  60. package/dist/oht.js.map +1 -1
  61. package/dist/port-flow.js +4 -0
  62. package/dist/port-flow.js.map +1 -1
  63. package/dist/port.js +4 -0
  64. package/dist/port.js.map +1 -1
  65. package/dist/scanner.js +30 -0
  66. package/dist/scanner.js.map +1 -0
  67. package/dist/scene/root-container-override.js +160 -96
  68. package/dist/scene/root-container-override.js.map +1 -1
  69. package/dist/shelf.js +4 -0
  70. package/dist/shelf.js.map +1 -1
  71. package/dist/shuttle.js.map +1 -1
  72. package/dist/static-container.js +5 -0
  73. package/dist/static-container.js.map +1 -1
  74. package/dist/stocker-abnormal-bar.js +184 -0
  75. package/dist/stocker-abnormal-bar.js.map +1 -0
  76. package/dist/stocker-capacity-bar.js +253 -6
  77. package/dist/stocker-capacity-bar.js.map +1 -1
  78. package/dist/stocker-carrier-bar.js +198 -0
  79. package/dist/stocker-carrier-bar.js.map +1 -0
  80. package/dist/stocker.js +7 -1
  81. package/dist/stocker.js.map +1 -1
  82. package/dist/templates/backdrop.js +30 -0
  83. package/dist/templates/backdrop.js.map +1 -0
  84. package/dist/templates/decal.js +21 -0
  85. package/dist/templates/decal.js.map +1 -0
  86. package/dist/templates/index.js +7 -1
  87. package/dist/templates/index.js.map +1 -1
  88. package/dist/templates/scanner.js +20 -0
  89. package/dist/templates/scanner.js.map +1 -0
  90. package/dist/tsconfig.tsbuildinfo +1 -1
  91. package/dist/utils/crane-position.js +83 -0
  92. package/dist/utils/crane-position.js.map +1 -0
  93. package/dist/utils/data-value.js +21 -0
  94. package/dist/utils/data-value.js.map +1 -0
  95. package/dist/utils/fit-gauge-scale.js +28 -0
  96. package/dist/utils/fit-gauge-scale.js.map +1 -0
  97. package/dist/utils/get-value-on-ranges.js +2 -4
  98. package/dist/utils/get-value-on-ranges.js.map +1 -1
  99. package/dist/utils/stocker-gauge.js +78 -0
  100. package/dist/utils/stocker-gauge.js.map +1 -0
  101. package/dist/zone-capacity-bar.js +3 -3
  102. package/dist/zone-capacity-bar.js.map +1 -1
  103. package/icons/backdrop.png +0 -0
  104. package/icons/decal.png +0 -0
  105. package/jest.config.js +10 -0
  106. package/package.json +7 -6
  107. package/src/agv-line.ts +1 -1
  108. package/src/agv.ts +10 -5
  109. package/src/buffer.ts +1 -1
  110. package/src/carrier-manager.ts +223 -0
  111. package/src/carrier.ts +111 -18
  112. package/src/conveyor-join.ts +6 -3
  113. package/src/conveyor.ts +10 -2
  114. package/src/crane-rail.ts +58 -0
  115. package/src/crane.ts +182 -2
  116. package/src/equipment.ts +1 -1
  117. package/src/factories/agv-3d.ts +160 -0
  118. package/src/factories/conveyor-3d.ts +398 -0
  119. package/src/factories/crane-3d.ts +217 -0
  120. package/src/factories/crane-rail-3d.ts +115 -0
  121. package/src/factories/machine-3d.ts +1192 -0
  122. package/src/factories/oht-3d.ts +196 -0
  123. package/src/factories/shuttle-3d.ts +179 -0
  124. package/src/factories/z-priority-defaults.ts +38 -0
  125. package/src/factories/z-priority.ts +60 -0
  126. package/src/features/conveyor-mixin.ts +1 -1
  127. package/src/features/mcs-status-default.ts +15 -1
  128. package/src/features/mcs-status-mixin.ts +26 -4
  129. package/src/features/mcs-zone-mixin.ts +1 -1
  130. package/src/features/parent-object-mixin.ts +17 -8
  131. package/src/floating-container.ts +5 -0
  132. package/src/index.ts +66 -2
  133. package/src/mcs-carrier-holder.ts +58 -29
  134. package/src/mcs-machine.ts +43 -1
  135. package/src/mcs-unit.ts +25 -2
  136. package/src/mcs-vehicle.ts +12 -9
  137. package/src/node.ts +9 -3
  138. package/src/oht-line.ts +1 -1
  139. package/src/oht.ts +7 -2
  140. package/src/port-flow.ts +6 -1
  141. package/src/port.ts +6 -1
  142. package/src/scanner.ts +29 -0
  143. package/src/scene/root-container-override.ts +156 -105
  144. package/src/shelf.ts +6 -1
  145. package/src/shuttle.ts +1 -1
  146. package/src/static-container.ts +5 -0
  147. package/src/stocker-abnormal-bar.ts +247 -0
  148. package/src/stocker-capacity-bar.ts +301 -10
  149. package/src/stocker-carrier-bar.ts +262 -0
  150. package/src/stocker.ts +10 -3
  151. package/src/templates/backdrop.ts +30 -0
  152. package/src/templates/decal.ts +21 -0
  153. package/src/templates/index.ts +7 -1
  154. package/src/templates/scanner.ts +20 -0
  155. package/src/utils/crane-position.ts +105 -0
  156. package/src/utils/data-value.ts +19 -0
  157. package/src/utils/fit-gauge-scale.ts +35 -0
  158. package/src/utils/get-value-on-ranges.ts +2 -4
  159. package/src/utils/stocker-gauge.ts +111 -0
  160. package/src/zone-capacity-bar.ts +5 -5
  161. package/translations/en.json +26 -1
  162. package/translations/ja.json +26 -1
  163. package/translations/ko.json +26 -1
  164. package/translations/ms.json +26 -1
  165. package/translations/zh.json +26 -1
@@ -0,0 +1,115 @@
1
+ /**
2
+ * CraneRail 3D Factory
3
+ *
4
+ * 스토커 내부 스태커 크레인의 주행 레일.
5
+ * 바닥 레일 + 천장 가이드 레일로 크레인의 2축 이동(수평 주행 + 수직 승강)을 지원.
6
+ *
7
+ * 구조 (바닥 원점, y=0~depth):
8
+ * - 바닥 레일: 2개의 평행 트랙 (크레인 바퀴 주행)
9
+ * - 천장 가이드 레일: 2개의 평행 트랙 (마스트 상단 안내)
10
+ * - 수직 지지대: 양 끝단 기둥 (바닥~천장 연결)
11
+ */
12
+
13
+ import * as THREE from 'three'
14
+ import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js'
15
+ import { RealObjectGroup, registerRealObjectFactory } from '@hatiolab/things-scene'
16
+ import type { Component } from '@hatiolab/things-scene'
17
+ import { TRANSPORT_SURFACE_HEIGHT } from './machine-3d.js'
18
+ import { Z_FMSIM } from './z-priority'
19
+
20
+ const RAIL_COLOR = 0x666677
21
+ const SUPPORT_COLOR = 0x555566
22
+
23
+ /** 크레인 레일 기본 높이: 스토커와 동일 */
24
+ const DEFAULT_RAIL_DEPTH = 5 * TRANSPORT_SURFACE_HEIGHT
25
+
26
+ export class CraneRail3D extends RealObjectGroup {
27
+ get zPriority(): number { return Z_FMSIM.CRANE_RAIL }
28
+
29
+ get effectiveDepth(): number {
30
+ const { depth } = this.component.state
31
+ return depth || DEFAULT_RAIL_DEPTH
32
+ }
33
+
34
+ build() {
35
+ super.build()
36
+
37
+ const { width = 10, height = 10 } = this.component.state
38
+ const w = Math.abs(width)
39
+ const h = Math.abs(height)
40
+ const d = this.effectiveDepth
41
+ if (!w || !h) return
42
+
43
+ const inner = this.components3D
44
+
45
+ const railH = Math.max(d * 0.02, 2) // 레일 높이 (얇은 트랙)
46
+ const railW = Math.max(h * 0.06, 2) // 레일 폭
47
+ const supportThick = Math.max(Math.min(w, h) * 0.05, 2)
48
+
49
+ const railMat = new THREE.MeshStandardMaterial({
50
+ color: RAIL_COLOR,
51
+ roughness: 0.3,
52
+ metalness: 0.7,
53
+ })
54
+
55
+ const supportMat = new THREE.MeshStandardMaterial({
56
+ color: SUPPORT_COLOR,
57
+ roughness: 0.5,
58
+ metalness: 0.5,
59
+ })
60
+
61
+ // ── 바닥 레일 (2개 평행 트랙) ──
62
+ const bottomGeometries: THREE.BufferGeometry[] = []
63
+ for (const zSign of [-1, 1]) {
64
+ const rail = new THREE.BoxGeometry(w, railH, railW)
65
+ rail.translate(0, railH / 2, zSign * (h / 2 - railW / 2))
66
+ bottomGeometries.push(rail)
67
+ }
68
+ const bottomMesh = new THREE.Mesh(BufferGeometryUtils.mergeGeometries(bottomGeometries), railMat)
69
+ bottomMesh.castShadow = true
70
+ bottomMesh.receiveShadow = true
71
+ inner.add(bottomMesh)
72
+
73
+ // ── 천장 가이드 레일 (2개 평행 트랙) ──
74
+ const topGeometries: THREE.BufferGeometry[] = []
75
+ for (const zSign of [-1, 1]) {
76
+ const rail = new THREE.BoxGeometry(w, railH, railW)
77
+ rail.translate(0, d - railH / 2, zSign * (h / 2 - railW / 2))
78
+ topGeometries.push(rail)
79
+ }
80
+ const topMesh = new THREE.Mesh(BufferGeometryUtils.mergeGeometries(topGeometries), railMat)
81
+ topMesh.castShadow = true
82
+ inner.add(topMesh)
83
+
84
+ // ── 양 끝단 수직 지지대 (바닥~천장 연결) ──
85
+ const supportH = d - railH * 2
86
+ const supportGeometries: THREE.BufferGeometry[] = []
87
+ for (const xSign of [-1, 1]) {
88
+ for (const zSign of [-1, 1]) {
89
+ const support = new THREE.BoxGeometry(supportThick, supportH, supportThick)
90
+ support.translate(
91
+ xSign * (w / 2 - supportThick / 2),
92
+ railH + supportH / 2,
93
+ zSign * (h / 2 - railW / 2)
94
+ )
95
+ supportGeometries.push(support)
96
+ }
97
+ }
98
+ const supportMesh = new THREE.Mesh(BufferGeometryUtils.mergeGeometries(supportGeometries), supportMat)
99
+ supportMesh.castShadow = true
100
+ inner.add(supportMesh)
101
+ }
102
+
103
+ updateDimension() {}
104
+ updateAlpha() {}
105
+
106
+ onchange(after: Record<string, unknown>, before: Record<string, unknown>) {
107
+ if ('width' in after || 'height' in after || 'depth' in after || 'fillStyle' in after || 'strokeStyle' in after) {
108
+ this.update()
109
+ return
110
+ }
111
+ super.onchange(after, before)
112
+ }
113
+ }
114
+
115
+ registerRealObjectFactory('CraneRail', (component: Component) => new CraneRail3D(component))