@fmsim/machine 2.0.0-beta.7 → 2.0.0-beta.75

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 (119) hide show
  1. package/dist/agv.js +2 -2
  2. package/dist/agv.js.map +1 -1
  3. package/dist/carrier-manager.js +93 -0
  4. package/dist/carrier-manager.js.map +1 -0
  5. package/dist/carrier.js +81 -5
  6. package/dist/carrier.js.map +1 -1
  7. package/dist/conveyor-join.js +8 -2
  8. package/dist/conveyor-join.js.map +1 -1
  9. package/dist/conveyor.js +8 -0
  10. package/dist/conveyor.js.map +1 -1
  11. package/dist/crane.js.map +1 -1
  12. package/dist/factories/agv-3d.js +8 -9
  13. package/dist/factories/agv-3d.js.map +1 -1
  14. package/dist/factories/conveyor-3d.js +166 -81
  15. package/dist/factories/conveyor-3d.js.map +1 -1
  16. package/dist/factories/crane-3d.js +5 -7
  17. package/dist/factories/crane-3d.js.map +1 -1
  18. package/dist/factories/crane-rail-3d.js +4 -6
  19. package/dist/factories/crane-rail-3d.js.map +1 -1
  20. package/dist/factories/machine-3d.js +384 -133
  21. package/dist/factories/machine-3d.js.map +1 -1
  22. package/dist/factories/oht-3d.js +20 -20
  23. package/dist/factories/oht-3d.js.map +1 -1
  24. package/dist/factories/shuttle-3d.js +2 -5
  25. package/dist/factories/shuttle-3d.js.map +1 -1
  26. package/dist/features/conveyor-mixin.js.map +1 -1
  27. package/dist/features/mcs-status-mixin.js +22 -0
  28. package/dist/features/mcs-status-mixin.js.map +1 -1
  29. package/dist/features/mcs-zone-mixin.js.map +1 -1
  30. package/dist/features/parent-object-mixin.js.map +1 -1
  31. package/dist/floating-container.js +5 -0
  32. package/dist/floating-container.js.map +1 -1
  33. package/dist/index.js +50 -34
  34. package/dist/index.js.map +1 -1
  35. package/dist/mcs-carrier-holder.js +39 -22
  36. package/dist/mcs-carrier-holder.js.map +1 -1
  37. package/dist/mcs-machine.js +28 -0
  38. package/dist/mcs-machine.js.map +1 -1
  39. package/dist/mcs-unit.js +10 -0
  40. package/dist/mcs-unit.js.map +1 -1
  41. package/dist/mcs-vehicle.js +8 -3
  42. package/dist/mcs-vehicle.js.map +1 -1
  43. package/dist/node.js +1 -1
  44. package/dist/node.js.map +1 -1
  45. package/dist/oht.js.map +1 -1
  46. package/dist/scanner.js +30 -0
  47. package/dist/scanner.js.map +1 -0
  48. package/dist/scene/root-container-override.js +9 -0
  49. package/dist/scene/root-container-override.js.map +1 -1
  50. package/dist/static-container.js +5 -0
  51. package/dist/static-container.js.map +1 -1
  52. package/dist/stocker-abnormal-bar.js +1 -1
  53. package/dist/stocker-abnormal-bar.js.map +1 -1
  54. package/dist/stocker-capacity-bar.js +3 -3
  55. package/dist/stocker-capacity-bar.js.map +1 -1
  56. package/dist/stocker-carrier-bar.js +1 -1
  57. package/dist/stocker-carrier-bar.js.map +1 -1
  58. package/dist/stocker.js +6 -0
  59. package/dist/stocker.js.map +1 -1
  60. package/dist/templates/backdrop.js +30 -0
  61. package/dist/templates/backdrop.js.map +1 -0
  62. package/dist/templates/decal.js +21 -0
  63. package/dist/templates/decal.js.map +1 -0
  64. package/dist/templates/index.js +7 -1
  65. package/dist/templates/index.js.map +1 -1
  66. package/dist/templates/scanner.js +20 -0
  67. package/dist/templates/scanner.js.map +1 -0
  68. package/dist/tsconfig.tsbuildinfo +1 -1
  69. package/dist/utils/get-value-on-ranges.js +2 -4
  70. package/dist/utils/get-value-on-ranges.js.map +1 -1
  71. package/dist/zone-capacity-bar.js +3 -3
  72. package/dist/zone-capacity-bar.js.map +1 -1
  73. package/icons/backdrop.png +0 -0
  74. package/icons/decal.png +0 -0
  75. package/jest.config.js +10 -0
  76. package/package.json +4 -3
  77. package/src/agv.ts +2 -2
  78. package/src/carrier-manager.ts +117 -0
  79. package/src/carrier.ts +80 -3
  80. package/src/conveyor-join.ts +5 -2
  81. package/src/conveyor.ts +8 -0
  82. package/src/crane.ts +1 -1
  83. package/src/factories/agv-3d.ts +9 -10
  84. package/src/factories/conveyor-3d.ts +168 -84
  85. package/src/factories/crane-3d.ts +6 -8
  86. package/src/factories/crane-rail-3d.ts +5 -7
  87. package/src/factories/machine-3d.ts +452 -145
  88. package/src/factories/oht-3d.ts +20 -20
  89. package/src/factories/shuttle-3d.ts +2 -6
  90. package/src/features/conveyor-mixin.ts +1 -1
  91. package/src/features/mcs-status-mixin.ts +26 -4
  92. package/src/features/mcs-zone-mixin.ts +1 -1
  93. package/src/features/parent-object-mixin.ts +1 -1
  94. package/src/floating-container.ts +5 -0
  95. package/src/index.ts +56 -34
  96. package/src/mcs-carrier-holder.ts +38 -34
  97. package/src/mcs-machine.ts +29 -0
  98. package/src/mcs-unit.ts +12 -1
  99. package/src/mcs-vehicle.ts +9 -6
  100. package/src/node.ts +1 -1
  101. package/src/oht.ts +1 -1
  102. package/src/scanner.ts +29 -0
  103. package/src/scene/root-container-override.ts +12 -0
  104. package/src/static-container.ts +5 -0
  105. package/src/stocker-abnormal-bar.ts +1 -1
  106. package/src/stocker-capacity-bar.ts +3 -3
  107. package/src/stocker-carrier-bar.ts +1 -1
  108. package/src/stocker.ts +7 -0
  109. package/src/templates/backdrop.ts +30 -0
  110. package/src/templates/decal.ts +21 -0
  111. package/src/templates/index.ts +7 -1
  112. package/src/templates/scanner.ts +20 -0
  113. package/src/utils/get-value-on-ranges.ts +2 -4
  114. package/src/zone-capacity-bar.ts +3 -3
  115. package/translations/en.json +16 -1
  116. package/translations/ja.json +16 -1
  117. package/translations/ko.json +16 -1
  118. package/translations/ms.json +16 -1
  119. package/translations/zh.json +16 -1
@@ -11,7 +11,7 @@ import { themesColorRange } from '@fmsim/api'
11
11
  import { MCSStatusMixin } from './features/mcs-status-mixin'
12
12
  import { LEGEND_CAPACITY, Legend } from './features/mcs-status-default'
13
13
  import { safeRound } from './utils/safe-round'
14
- import { getVaueOnRanges } from './utils/get-value-on-ranges'
14
+ import { getValueOnRanges } from './utils/get-value-on-ranges'
15
15
  import { ParentObjectMixin, ParentObjectMixinProperties } from './features/parent-object-mixin'
16
16
 
17
17
  const NATURE: ComponentNature = {
@@ -127,7 +127,7 @@ export default class StockerCapacityBar extends ParentObjectMixin(MCSStatusMixin
127
127
 
128
128
  get statusColor() {
129
129
  const { fullup } = this.state
130
- return fullup ? 'red' : getVaueOnRanges(this.usage, this.legend)
130
+ return fullup ? 'red' : getValueOnRanges(this.usage, this.legend)
131
131
  }
132
132
 
133
133
  get text() {
@@ -304,7 +304,7 @@ export default class StockerCapacityBar extends ParentObjectMixin(MCSStatusMixin
304
304
  HIGHWATERMARK = 100,
305
305
  LOWWATERMARK = 0,
306
306
  FULLUP = 'F'
307
- } = typeof this.data == 'object' ? this.data : {}
307
+ } = this.data && typeof this.data == 'object' ? this.data : {}
308
308
 
309
309
  const currentUsage = Number(CURRENTCAPACITY) || 0
310
310
  const maxCapacity = Number(MAXCAPACITY) || 100
@@ -246,7 +246,7 @@ export default class StockerCarrierBar extends ParentObjectMixin(RectPath(Shape)
246
246
  CARRIER_FULL = 0,
247
247
  CARRIER_EMPTY = 0,
248
248
  CARRIER_EMPTY_EMPTY = 0
249
- } = typeof this.data == 'object' ? this.data : {}
249
+ } = this.data && typeof this.data == 'object' ? this.data : {}
250
250
 
251
251
  this.setState({
252
252
  carrierFull: Number(CARRIER_FULL) || 0,
package/src/stocker.ts CHANGED
@@ -47,6 +47,13 @@ export default class Stocker extends MCSTransport {
47
47
  }
48
48
 
49
49
  onchangeData(after: Record<string, any>, before: Record<string, any>): void {
50
+ /* MCSStatusMixin.onchangeData 의 statusColor → state.fillStyle 동기화 로직을
51
+ * 호출. 3D 경로에서는 mesh material 의 color 가 build 시점 한 번 결정되므로
52
+ * 데이터 변경 시 fillStyle 이 갱신되어야 MCSRealObject3D.onchange 의
53
+ * 'fillStyle in after' 분기를 타고 mesh rebuild 가 발생한다.
54
+ * (2D 는 render() 가 매 프레임 statusColor getter 를 직접 사용하므로 영향 없음.) */
55
+ super.onchangeData(after, before)
56
+
50
57
  /* non-identifiable component 즉, StockerCapacityBar 에게 데이터를 전달함 */
51
58
  this.components.filter(component => !component.isIdentifiable()).forEach(component => (component.data = this.data))
52
59
  }
@@ -0,0 +1,30 @@
1
+ const icon = new URL('../../icons/backdrop.png', import.meta.url).href
2
+
3
+ export default {
4
+ type: 'backdrop',
5
+ description: '3D scene backdrop — 6-sided envelope (4 walls + floor + ceiling)',
6
+ group: ['etc'],
7
+ icon,
8
+ model: {
9
+ type: 'backdrop',
10
+ top: 0,
11
+ left: 0,
12
+ width: 3000,
13
+ height: 2400,
14
+ // depth seeded on creation as min(width, height) by Backdrop's
15
+ // `_syncFromRoot(seedDepth=true)`. Editable via property panel
16
+ // afterward — board-resize syncs won't override it.
17
+ fitToBoard: true,
18
+ alpha: 1,
19
+ // 6면 합성 상태. 비어있으면 backdrop 컴포넌트의 default 가 적용됨
20
+ // (벽 4면 = #dde2e8/0.35, 바닥 = #9c9c9c/1.0, 천장 = #e8e8ec/1.0).
21
+ faces: {
22
+ east: { fillStyle: '#dde2e8', visible: true, alpha: 0.35 },
23
+ west: { fillStyle: '#dde2e8', visible: true, alpha: 0.35 },
24
+ north: { fillStyle: '#dde2e8', visible: true, alpha: 0.35 },
25
+ south: { fillStyle: '#dde2e8', visible: true, alpha: 0.35 },
26
+ floor: { fillStyle: '#9c9c9c', visible: true, alpha: 1.0 },
27
+ ceiling: { fillStyle: '#e8e8ec', visible: true, alpha: 1.0 }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,21 @@
1
+ const icon = new URL('../../icons/decal.png', import.meta.url).href
2
+
3
+ export default {
4
+ type: 'decal',
5
+ description: 'flat surface decal (3D-only) — floor zone paint, path lanes, signage',
6
+ group: ['etc'],
7
+ icon,
8
+ model: {
9
+ type: 'decal',
10
+ top: 100,
11
+ left: 100,
12
+ width: 200,
13
+ height: 200,
14
+ zPos: 0,
15
+ depth: 0,
16
+ fillStyle: '#cccccc',
17
+ strokeStyle: '#999999',
18
+ lineWidth: 1,
19
+ alpha: 1
20
+ }
21
+ }
@@ -17,9 +17,12 @@ 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'
24
+ import Decal from './decal'
25
+ import Backdrop from './backdrop'
23
26
 
24
27
  export default [
25
28
  StockerCapacityBar,
@@ -41,7 +44,10 @@ export default [
41
44
  Shelf,
42
45
  Port,
43
46
 
47
+ Scanner,
44
48
  Node,
45
49
  FloatingContainer,
46
- DataSubscription
50
+ DataSubscription,
51
+ Decal,
52
+ Backdrop
47
53
  ]
@@ -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: 'red',
18
+ lineWidth: 1
19
+ }
20
+ }
@@ -1,4 +1,4 @@
1
- export function getVaueOnRanges(value, param): any {
1
+ export function getValueOnRanges(value, param): any {
2
2
  for (let range in param) {
3
3
  let [from, to]: (number | string)[] = range.split('~')
4
4
  let from_defined = !!from
@@ -8,14 +8,12 @@ export function getVaueOnRanges(value, param): any {
8
8
  to = parseFloat(to)
9
9
  value = Number(value) || 0
10
10
 
11
- // from이나 to 둘 중 하나만 있는 경우 먼저 계산
12
11
  if (from_defined && !to_defined && value >= from) {
13
12
  return param[range]
14
- } else if (!from_defined && to_defined && value < from) {
13
+ } else if (!from_defined && to_defined && value < to) {
15
14
  return param[range]
16
15
  }
17
16
 
18
- // 소수점이 있으므로 from <= value < to 가 되야함
19
17
  if (value >= from && value < to) {
20
18
  return param[range]
21
19
  }
@@ -2,7 +2,7 @@ import { Component, ComponentNature, POSITION, Properties, sceneComponent } from
2
2
  import { themesColorRange } from '@fmsim/api'
3
3
  import { LEGEND_CAPACITY } from './features/mcs-status-default'
4
4
  import { safeRound } from './utils/safe-round'
5
- import { getVaueOnRanges } from './utils/get-value-on-ranges'
5
+ import { getValueOnRanges } from './utils/get-value-on-ranges'
6
6
  import { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin'
7
7
  import { ParentObjectMixinProperties } from './features/parent-object-mixin'
8
8
  import MCSUnit from './mcs-unit'
@@ -104,7 +104,7 @@ export default class ZoneCapacityBar extends MCSZoneMixin(MCSUnit) {
104
104
 
105
105
  get statusColor() {
106
106
  const { fullup } = this.state
107
- return fullup ? 'red' : getVaueOnRanges(this.usage, this.legend)
107
+ return fullup ? 'red' : getValueOnRanges(this.usage, this.legend)
108
108
  }
109
109
 
110
110
  get text() {
@@ -282,7 +282,7 @@ export default class ZoneCapacityBar extends MCSZoneMixin(MCSUnit) {
282
282
  HIGHWATERMARK = 100,
283
283
  LOWWATERMARK = 0,
284
284
  FULLUP = 'F'
285
- } = typeof this.data == 'object' ? this.data : {}
285
+ } = this.data && typeof this.data == 'object' ? this.data : {}
286
286
 
287
287
  const currentUsage = Number(CURRENTCAPACITY) || 0
288
288
  const maxCapacity = Number(MAXCAPACITY) || 100
@@ -46,5 +46,20 @@
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",
51
+ "component.backdrop": "backdrop",
52
+ "label.fit-to-board": "Fit to Board",
53
+ "label.east": "East",
54
+ "label.west": "West",
55
+ "label.north": "North",
56
+ "label.south": "South",
57
+ "label.floor": "Floor",
58
+ "label.ceiling": "Ceiling",
59
+ "label.visible": "Visible",
60
+ "label.alpha": "Alpha",
61
+ "label.rotation": "Rotation",
62
+ "label.mirror": "Mirror",
63
+ "label.copy-to-opposite": "Copy to opposite",
64
+ "label.copy-to-walls": "Copy to all walls"
50
65
  }
@@ -48,5 +48,20 @@
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": "搬送方向",
53
+ "component.backdrop": "バックドロップ",
54
+ "label.fit-to-board": "ボードに合わせる",
55
+ "label.east": "東壁",
56
+ "label.west": "西壁",
57
+ "label.north": "北壁",
58
+ "label.south": "南壁",
59
+ "label.floor": "床",
60
+ "label.ceiling": "天井",
61
+ "label.visible": "表示",
62
+ "label.alpha": "透明度",
63
+ "label.rotation": "回転",
64
+ "label.mirror": "鏡像",
65
+ "label.copy-to-opposite": "反対側にコピー",
66
+ "label.copy-to-walls": "壁4面にコピー"
52
67
  }
@@ -49,5 +49,20 @@
49
49
  "label.node-machine": "node machine",
50
50
  "label.nodes": "nodes",
51
51
  "label.vehicle-animation": "vehicle animation",
52
- "label.battery-rate-legend-name": "배터리 잔량"
52
+ "label.battery-rate-legend-name": "배터리 잔량",
53
+ "label.conveyor-orientation": "이송방향",
54
+ "component.backdrop": "배경",
55
+ "label.fit-to-board": "보드에 맞춤",
56
+ "label.east": "동측 벽",
57
+ "label.west": "서측 벽",
58
+ "label.north": "북측 벽",
59
+ "label.south": "남측 벽",
60
+ "label.floor": "바닥",
61
+ "label.ceiling": "천장",
62
+ "label.visible": "표시",
63
+ "label.alpha": "투명도",
64
+ "label.rotation": "회전",
65
+ "label.mirror": "거울상",
66
+ "label.copy-to-opposite": "반대편에 복사",
67
+ "label.copy-to-walls": "벽 4면에 복사"
53
68
  }
@@ -48,5 +48,20 @@
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",
53
+ "component.backdrop": "Backdrop",
54
+ "label.fit-to-board": "Muat Papan",
55
+ "label.east": "Timur",
56
+ "label.west": "Barat",
57
+ "label.north": "Utara",
58
+ "label.south": "Selatan",
59
+ "label.floor": "Lantai",
60
+ "label.ceiling": "Siling",
61
+ "label.visible": "Kelihatan",
62
+ "label.alpha": "Alfa",
63
+ "label.rotation": "Putaran",
64
+ "label.mirror": "Cermin",
65
+ "label.copy-to-opposite": "Salin ke bertentangan",
66
+ "label.copy-to-walls": "Salin ke semua dinding"
52
67
  }
@@ -48,5 +48,20 @@
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": "输送方向",
53
+ "component.backdrop": "背景",
54
+ "label.fit-to-board": "适配画板",
55
+ "label.east": "东墙",
56
+ "label.west": "西墙",
57
+ "label.north": "北墙",
58
+ "label.south": "南墙",
59
+ "label.floor": "地板",
60
+ "label.ceiling": "天花板",
61
+ "label.visible": "显示",
62
+ "label.alpha": "透明度",
63
+ "label.rotation": "旋转",
64
+ "label.mirror": "镜像",
65
+ "label.copy-to-opposite": "复制到对面",
66
+ "label.copy-to-walls": "复制到4面墙"
52
67
  }