@fmsim/machine 2.0.0-beta.104 → 2.0.0-beta.107

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.
@@ -0,0 +1,627 @@
1
+ import { Component, POSITION } from '@hatiolab/things-scene'
2
+ import { themesColorRange } from '@fmsim/api'
3
+ import { LEGEND_CAPACITY, Legend, resolveCarrierLegend } from './mcs-status-default'
4
+ import { safeRound } from '../utils/safe-round'
5
+ import { getValueOnRanges } from '../utils/get-value-on-ranges'
6
+ import { carrierSegments, abnormalSegments, carrierColorsFromLegend, pickSegmentAt, GaugeSegment } from '../utils/stocker-gauge'
7
+
8
+ type Constructor<T = {}> = new (...args: any[]) => T
9
+
10
+ /**
11
+ * 용량 게이지 (통합 로직).
12
+ *
13
+ * 하나의 컴포넌트가 mode 에 따라 3가지 게이지를 표현한다:
14
+ * - 'capacity' : 용량 사용률(usage%) 채움 게이지 + high/low watermark (기본)
15
+ * - 'carrier' : 캐리어 상태비율 세그먼트 (Full / Empty / EmptyEmpty)
16
+ * - 'abnormal' : 캐리어 정상/비정상 비율 세그먼트 (Normal / Abnormal)
17
+ *
18
+ * StockerCapacityBar(스토커 지붕 게이지)와 ZoneCapacityBar(존 게이지)가 이 로직을 공유한다.
19
+ * 두 컴포넌트는 base(스토커=Shape, 존=Container)·정체성(identifiable)·legend 폴백만 다르고,
20
+ * 게이지를 그리는 규칙은 완전히 동일하다 — 규칙을 이 믹스인 한 곳에 두어 drift 를 막는다.
21
+ *
22
+ * mode 소스: root.stockerGaugeMode (기본 'capacity'). RootContainer 의 런타임 전용
23
+ * transient 속성으로, 3D(machine-3d buildGauge)와도 동일 소스라 2D/3D 게이지가 항상 일치한다.
24
+ * (root-container-override.ts 정의. 모드가 바뀌면 _refreshStockerGauges 가 두 게이지를 갱신.)
25
+ *
26
+ * 데이터 필드(2D 기준, canonical):
27
+ * - capacity : CURRENTCAPACITY / MAXCAPACITY / HIGHWATERMARK / LOWWATERMARK / FULLUP
28
+ * - carrier : CARRIER_FULL / CARRIER_EMPTY / CARRIER_EMPTY_EMPTY
29
+ * - abnormal : CARRIER_NORMAL / CARRIER_ABNORMAL
30
+ */
31
+
32
+ /** 게이지 NATURE 속성 조각 (스토커/존 공통). 각 컴포넌트 NATURE 에 spread 로 합친다. */
33
+ export const CapacityGaugeMixinProperties = [
34
+ {
35
+ type: 'select',
36
+ label: 'legend-name',
37
+ name: 'legendName',
38
+ property: {
39
+ options: themesColorRange
40
+ }
41
+ },
42
+ {
43
+ type: 'number',
44
+ name: 'currentUsage',
45
+ label: 'current-usage'
46
+ },
47
+ {
48
+ type: 'number',
49
+ name: 'highWatermark',
50
+ label: 'high-watermark'
51
+ },
52
+ {
53
+ type: 'number',
54
+ name: 'lowWatermark',
55
+ label: 'low-watermark'
56
+ },
57
+ {
58
+ type: 'number',
59
+ name: 'maxCapacity',
60
+ label: 'max-capacity'
61
+ },
62
+ {
63
+ type: 'boolean',
64
+ name: 'fullup',
65
+ label: 'fullup'
66
+ },
67
+ {
68
+ type: 'number',
69
+ name: 'carrierFull',
70
+ label: 'carrier-full'
71
+ },
72
+ {
73
+ type: 'number',
74
+ name: 'carrierEmpty',
75
+ label: 'carrier-empty'
76
+ },
77
+ {
78
+ type: 'number',
79
+ name: 'carrierEmptyEmpty',
80
+ label: 'carrier-empty-empty'
81
+ },
82
+ {
83
+ type: 'number',
84
+ name: 'carrierNormal',
85
+ label: 'carrier-normal'
86
+ },
87
+ {
88
+ type: 'number',
89
+ name: 'carrierAbnormal',
90
+ label: 'carrier-abnormal'
91
+ },
92
+ {
93
+ type: 'number',
94
+ label: 'round',
95
+ name: 'round',
96
+ property: {
97
+ min: 0
98
+ }
99
+ },
100
+ {
101
+ type: 'hidden',
102
+ name: 'usage',
103
+ label: 'usage'
104
+ }
105
+ ]
106
+
107
+ const controlHandler = {
108
+ ondragmove: function (point: POSITION, index: number, component: Component) {
109
+ var { left, top, width, height } = (component as any).model
110
+
111
+ var transcoorded = (component as any).transcoordP2S(point.x, point.y)
112
+ var round = ((transcoorded.x - left) / (width / 2)) * 100
113
+
114
+ round = safeRound(round, width, height)
115
+
116
+ ;(component as any).set({
117
+ round
118
+ })
119
+ }
120
+ }
121
+
122
+ export function CapacityGaugeMixin<TBase extends Constructor<Component>>(Base: TBase): any {
123
+ return class extends Base {
124
+ /** 게이지 모드: RootContainer 런타임 transient 속성. 3D(machine-3d) 와 동일 소스. */
125
+ get gaugeMode(): string {
126
+ return (this as any).root?.stockerGaugeMode || 'capacity'
127
+ }
128
+
129
+ get controls() {
130
+ var { left, top, width, round, height } = (this as any).state
131
+ round = round == undefined ? 0 : safeRound(round, width, height)
132
+
133
+ return [
134
+ {
135
+ x: left + (width / 2) * (round / 100),
136
+ y: top,
137
+ handler: controlHandler
138
+ }
139
+ ]
140
+ }
141
+
142
+ getTheme() {
143
+ const { legendName } = (this as any).state
144
+
145
+ if (legendName) {
146
+ return (this as any).root?.style?.[legendName]
147
+ }
148
+ }
149
+
150
+ get legend(): Legend {
151
+ return this.getTheme() || this.getLegendFallback()
152
+ }
153
+
154
+ /** legend 미지정 시 폴백 테마. 컴포넌트별로 override (스토커/존 각자 전역 테마). */
155
+ getLegendFallback(): Legend {
156
+ return LEGEND_CAPACITY
157
+ }
158
+
159
+ get statusColor(): string | undefined {
160
+ const { fullup } = (this as any).state
161
+ return fullup ? 'red' : getValueOnRanges(this.usage, this.legend)
162
+ }
163
+
164
+ get text() {
165
+ // usage% 값은 capacity 모드에서만 표시. carrier/abnormal 은 세그먼트별 자체 라벨을 그리므로
166
+ // base 의 value 텍스트를 억제한다.
167
+ if (this.gaugeMode !== 'capacity') {
168
+ return ''
169
+ }
170
+ return this.usage + '%'
171
+ }
172
+
173
+ render(context: CanvasRenderingContext2D) {
174
+ const mode = this.gaugeMode
175
+
176
+ if (mode === 'carrier' || mode === 'abnormal') {
177
+ this.renderSegmentGauge(context, this.segments(mode))
178
+ return
179
+ }
180
+
181
+ // capacity (기본)
182
+ const { width, height } = (this as any).bounds
183
+ if (width >= height) {
184
+ this.renderLandscape(context)
185
+ } else {
186
+ this.renderPortrait(context)
187
+ }
188
+ }
189
+
190
+ /**
191
+ * carrier/abnormal mode 의 세그먼트 목록 (공유 유틸 = 3D 와 동일 계산).
192
+ * 배열 순서 = portrait 아래→위 / landscape 왼→오.
193
+ */
194
+ segments(mode: string): GaugeSegment[] {
195
+ if (mode === 'abnormal') {
196
+ const { carrierNormal = 0, carrierAbnormal = 0 } = (this as any).state
197
+ return abnormalSegments(carrierNormal, carrierAbnormal)
198
+ }
199
+ const { carrierFull = 0, carrierEmpty = 0, carrierEmptyEmpty = 0 } = (this as any).state
200
+ // 색상은 carrier 컴포넌트와 동일한 legend(테마)에서 취득 (carrierColorsFromLegend).
201
+ const colors = carrierColorsFromLegend(resolveCarrierLegend(this))
202
+ return carrierSegments(carrierFull, carrierEmpty, carrierEmptyEmpty, colors)
203
+ }
204
+
205
+ /**
206
+ * 클릭(또는 hover) 지점이 어떤 세그먼트에 속하는지 판정. carrier/abnormal 모드 전용 —
207
+ * capacity 모드·데이터 없음·좌표 변환 실패 시 null.
208
+ *
209
+ * renderSegmentGauge 와 동일한 배치 규칙으로 매핑한다: landscape(가로) 는 왼→오(누적 x),
210
+ * portrait(세로) 는 아래→위(바닥부터 누적). ratio 0 세그먼트는 화면에 없으므로 건너뛴다.
211
+ */
212
+ segmentAtEvent(event: MouseEvent): { mode: string; key: string; label: string; count: number } | null {
213
+ const mode = this.gaugeMode
214
+ if (mode !== 'carrier' && mode !== 'abnormal') return null
215
+
216
+ // 3D 게이지는 부모 STOCKER 의 real-object 가 그린다(이 컴포넌트가 아님) → 2D 세그먼트 판정 대상 아님.
217
+ if ((this as any).root?.is3dMode) return null
218
+
219
+ const ox = (event as any)?.offsetX
220
+ const oy = (event as any)?.offsetY
221
+ if (typeof ox !== 'number' || typeof oy !== 'number') return null
222
+
223
+ // 표면 픽셀(offsetX/offsetY) → 이 컴포넌트 로컬 프레임.
224
+ // 주의: transcoordP2S 는 '부모→로컬' 한 단계라 캔버스 픽셀로 단독 호출하면 안 된다.
225
+ // 엔진 capture() 와 동일하게 루트부터 전체 체인을 적용하는 helper 가 toLocal.
226
+ let local: { x: number; y: number } | undefined
227
+ try {
228
+ local = (this as any).toLocal(ox, oy)
229
+ } catch {
230
+ return null
231
+ }
232
+ if (!local) return null
233
+
234
+ const { left, top, width, height } = (this as any).bounds
235
+ if (!(width > 0) || !(height > 0)) return null
236
+
237
+ // 컴포넌트 로컬프레임 좌표 → bounds 기준 within-box. 경계 반올림 방어로 clamp.
238
+ const lx = Math.min(Math.max(local.x - left, 0), width)
239
+ const ly = Math.min(Math.max(local.y - top, 0), height)
240
+
241
+ const landscape = width >= height
242
+ const pos = landscape ? lx : height - ly // portrait 는 바닥 기준 거리
243
+ const span = landscape ? width : height
244
+
245
+ const picked = pickSegmentAt(this.segments(mode), pos, span)
246
+ if (!picked) return null
247
+
248
+ return { mode, key: picked.key, label: picked.label.replace(/\n/g, ''), count: picked.count }
249
+ }
250
+
251
+ /** 세그먼트 게이지 렌더 (carrier/abnormal 공통). bounds 방향으로 landscape/portrait 자동. */
252
+ renderSegmentGauge(context: CanvasRenderingContext2D, segments: GaugeSegment[]) {
253
+ const { left, top, width, height } = (this as any).bounds
254
+ const { lineWidth, strokeStyle, round, fillStyle = 'white' } = (this as any).state
255
+ const landscape = width >= height
256
+
257
+ context.save()
258
+ context.translate(left, top)
259
+
260
+ // background
261
+ context.beginPath()
262
+ context.fillStyle = fillStyle
263
+ context.roundRect(0, 0, width, height, round)
264
+ context.fill()
265
+ context.clip()
266
+
267
+ if (landscape) {
268
+ // 왼→오
269
+ let x = 0
270
+ for (const seg of segments) {
271
+ const segWidth = width * seg.ratio
272
+ if (segWidth <= 0) continue
273
+
274
+ context.beginPath()
275
+ context.fillStyle = seg.color
276
+ context.rect(x, 0, segWidth, height)
277
+ context.fill()
278
+
279
+ this._drawSegmentLabel(context, seg, x, 0, segWidth, height)
280
+ x += segWidth
281
+ }
282
+ } else {
283
+ // 아래→위 (배열 첫 세그먼트가 바닥)
284
+ let y = height
285
+ for (const seg of segments) {
286
+ const segHeight = height * seg.ratio
287
+ if (segHeight <= 0) continue
288
+
289
+ y -= segHeight
290
+
291
+ context.beginPath()
292
+ context.fillStyle = seg.color
293
+ context.rect(0, y, width, segHeight)
294
+ context.fill()
295
+
296
+ this._drawSegmentLabel(context, seg, 0, y, width, segHeight)
297
+ }
298
+ }
299
+
300
+ // outline
301
+ context.beginPath()
302
+ context.setLineDash([])
303
+ context.strokeStyle = strokeStyle
304
+ context.lineWidth = lineWidth
305
+ context.roundRect(0, 0, width, height, round)
306
+ context.stroke()
307
+
308
+ context.translate(-left, -top)
309
+ context.restore()
310
+ }
311
+
312
+ private _drawSegmentLabel(
313
+ context: CanvasRenderingContext2D,
314
+ seg: GaugeSegment,
315
+ x: number,
316
+ y: number,
317
+ w: number,
318
+ h: number
319
+ ) {
320
+ // 이름 라벨(Full/Empty/Abnormal…)은 그리지 않는다. 각 세그먼트 영역 중심에 숫자(%)만 표시.
321
+ // 컴포넌트의 폰트 설정(fontFamily/fontSize/bold/italic)을 그대로 적용 — this.font.
322
+ const fontSize = (this as any).state.fontSize || 15
323
+ context.font = (this as any).font
324
+
325
+ // 공간에 따라 단계적 축소: 넉넉하면 '값%', 좁으면 '%' 떼고 값만, 더 좁으면 생략.
326
+ const value = `${Math.round(seg.ratio * 100)}`
327
+ const fits = (t: string) => fontSize <= h && context.measureText(t).width <= w
328
+
329
+ let text: string | null = null
330
+ if (fits(`${value}%`)) {
331
+ text = `${value}%`
332
+ } else if (fits(value)) {
333
+ text = value
334
+ }
335
+ if (text === null) {
336
+ return
337
+ }
338
+
339
+ context.fillStyle = '#333'
340
+ context.textAlign = 'center'
341
+ context.textBaseline = 'middle'
342
+ context.fillText(text, x + w / 2, y + h / 2)
343
+ }
344
+
345
+ renderLandscape(context: CanvasRenderingContext2D) {
346
+ const { left, top, width, height } = (this as any).bounds
347
+ const { highWatermark, lowWatermark, lineWidth, strokeStyle, round, fillStyle = 'white' } = (this as any).state
348
+
349
+ context.save()
350
+ context.translate(left, top)
351
+
352
+ // gauge background
353
+ context.beginPath()
354
+
355
+ context.fillStyle = fillStyle
356
+ context.roundRect(0, 0, width, height, round)
357
+
358
+ context.fill()
359
+
360
+ context.clip()
361
+
362
+ // gauge foreground
363
+ context.beginPath()
364
+
365
+ context.fillStyle = this.statusColor!
366
+
367
+ context.rect(0, 0, (width / 100) * this.usage, height)
368
+ context.fill()
369
+
370
+ // high-watermark level
371
+
372
+ if (highWatermark && highWatermark > 0 && highWatermark < 100) {
373
+ context.beginPath()
374
+
375
+ context.strokeStyle = 'black'
376
+ context.lineWidth = 1
377
+ context.setLineDash([3])
378
+
379
+ const x = (width / 100) * highWatermark
380
+ context.moveTo(x, 0)
381
+ context.lineTo(x, height)
382
+
383
+ context.stroke()
384
+ }
385
+
386
+ // low-watermark level
387
+
388
+ if (lowWatermark && lowWatermark > 0 && lowWatermark < 100) {
389
+ context.beginPath()
390
+
391
+ context.strokeStyle = 'black'
392
+ context.lineWidth = 1
393
+ context.setLineDash([3])
394
+
395
+ const x = (width / 100) * lowWatermark
396
+ context.moveTo(x, 0)
397
+ context.lineTo(x, height)
398
+
399
+ context.stroke()
400
+ }
401
+
402
+ // gauge outline
403
+ context.beginPath()
404
+
405
+ context.setLineDash([])
406
+ context.strokeStyle = strokeStyle
407
+ context.lineWidth = lineWidth
408
+ context.roundRect(0, 0, width, height, round)
409
+ context.stroke()
410
+
411
+ context.beginPath()
412
+
413
+ context.translate(-left, -top)
414
+ context.restore()
415
+ }
416
+
417
+ renderPortrait(context: CanvasRenderingContext2D) {
418
+ const { left, top, width, height } = (this as any).bounds
419
+ const { highWatermark, lowWatermark, lineWidth, strokeStyle, round, fillStyle = 'white' } = (this as any).state
420
+
421
+ context.save()
422
+ context.translate(left, top)
423
+
424
+ // gauge background
425
+ context.beginPath()
426
+
427
+ context.fillStyle = fillStyle
428
+ context.roundRect(0, 0, width, height, round)
429
+
430
+ context.fill()
431
+
432
+ context.clip()
433
+
434
+ // gauge foreground
435
+ context.beginPath()
436
+
437
+ context.fillStyle = this.statusColor!
438
+
439
+ context.rect(0, height - (height / 100) * this.usage, width, (height / 100) * this.usage)
440
+ context.fill()
441
+
442
+ // high-watermark level
443
+
444
+ if (highWatermark && highWatermark > 0 && highWatermark < 100) {
445
+ context.beginPath()
446
+
447
+ context.strokeStyle = 'black'
448
+ context.lineWidth = 1
449
+ context.setLineDash([3])
450
+
451
+ const y = height - (height / 100) * highWatermark
452
+ context.moveTo(0, y)
453
+ context.lineTo(width, y)
454
+
455
+ context.stroke()
456
+ }
457
+
458
+ // low-watermark level
459
+
460
+ if (lowWatermark && lowWatermark > 0 && lowWatermark < 100) {
461
+ context.beginPath()
462
+
463
+ context.strokeStyle = 'black'
464
+ context.lineWidth = 1
465
+ context.setLineDash([3])
466
+
467
+ const y = height - (height / 100) * lowWatermark
468
+ context.moveTo(0, y)
469
+ context.lineTo(width, y)
470
+
471
+ context.stroke()
472
+ }
473
+
474
+ // gauge outline
475
+ context.beginPath()
476
+
477
+ context.setLineDash([])
478
+ context.strokeStyle = strokeStyle
479
+ context.lineWidth = lineWidth
480
+ context.roundRect(0, 0, width, height, round)
481
+ context.stroke()
482
+
483
+ context.beginPath()
484
+
485
+ context.translate(-left, -top)
486
+ context.restore()
487
+ }
488
+
489
+ get usage() {
490
+ const { currentUsage = 0, maxCapacity = 100 } = (this as any).state
491
+ return Math.round((currentUsage / maxCapacity) * 100)
492
+ }
493
+
494
+ set usage(usage: number) {
495
+ // intentionally have done nothing
496
+ }
497
+
498
+ onchangeData(after: Record<string, any>, before: Record<string, any>): void {
499
+ const data = (this as any).data && typeof (this as any).data == 'object' ? (this as any).data : {}
500
+ const {
501
+ CURRENTCAPACITY = 0,
502
+ MAXCAPACITY = 100,
503
+ HIGHWATERMARK = 100,
504
+ LOWWATERMARK = 0,
505
+ FULLUP = 'F',
506
+ CARRIER_FULL = 0,
507
+ CARRIER_EMPTY = 0,
508
+ CARRIER_EMPTY_EMPTY = 0,
509
+ CARRIER_NORMAL = 0,
510
+ CARRIER_ABNORMAL = 0
511
+ } = data
512
+
513
+ const currentUsage = Number(CURRENTCAPACITY) || 0
514
+ const maxCapacity = Number(MAXCAPACITY) || 100
515
+ const highWatermark = Number(HIGHWATERMARK) || 100
516
+ const lowWatermark = Number(LOWWATERMARK) || 0
517
+
518
+ ;(this as any).setState({
519
+ currentUsage,
520
+ maxCapacity,
521
+ highWatermark,
522
+ lowWatermark,
523
+ fullup: FULLUP == 'T',
524
+ usage: Math.round((currentUsage / maxCapacity) * 100),
525
+ carrierFull: Number(CARRIER_FULL) || 0,
526
+ carrierEmpty: Number(CARRIER_EMPTY) || 0,
527
+ carrierEmptyEmpty: Number(CARRIER_EMPTY_EMPTY) || 0,
528
+ carrierNormal: Number(CARRIER_NORMAL) || 0,
529
+ carrierAbnormal: Number(CARRIER_ABNORMAL) || 0
530
+ })
531
+ }
532
+
533
+ // ── hover 툴팁 (carrier/abnormal 모드 세그먼트별 수치) ───────────────────────────
534
+ // 색상만으로 타입 구분이 어려울 때, 마우스 hover 로 정확한 수치 확인. 뷰어 모드 전용
535
+ // (model-layer 가 편집 모드에선 hover dispatch 안 함).
536
+
537
+ async ready(): Promise<void> {
538
+ await super.ready()
539
+ // hover 이벤트 수신 opt-in: model-layer _onmouseenter_all guard(hasLegacyHover) 통과.
540
+ const ev = (this as any).model.event
541
+ if (!ev || !ev.hover) {
542
+ ;(this as any).model.event = { ...(ev || {}), hover: true }
543
+ }
544
+ }
545
+
546
+ onMouseEnter(): void {
547
+ // capacity 는 값이 한 개(usage%)라 툴팁 불필요. carrier/abnormal 만.
548
+ if (this.gaugeMode === 'capacity') return
549
+ this._showGaugeTooltip()
550
+ }
551
+
552
+ onMouseLeave(): void {
553
+ this._hideGaugeTooltip()
554
+ }
555
+
556
+ dispose(): void {
557
+ this._hideGaugeTooltip()
558
+ super.dispose()
559
+ }
560
+
561
+ private _tooltipEl?: HTMLDivElement
562
+ private _tooltipMove?: (e: MouseEvent) => void
563
+
564
+ private _showGaugeTooltip(): void {
565
+ if (typeof document === 'undefined') return
566
+ const segments = this.segments(this.gaugeMode).filter(s => s.count > 0)
567
+ if (!segments.length) return
568
+
569
+ this._hideGaugeTooltip()
570
+
571
+ const el = document.createElement('div')
572
+ el.style.cssText = [
573
+ 'position:fixed',
574
+ 'left:-9999px',
575
+ 'top:0',
576
+ 'z-index:2147483647',
577
+ 'pointer-events:none',
578
+ 'background:rgba(30,30,30,0.92)',
579
+ 'color:#fff',
580
+ 'padding:6px 9px',
581
+ 'border-radius:6px',
582
+ 'font:12px/1.5 sans-serif',
583
+ 'box-shadow:0 2px 10px rgba(0,0,0,0.35)',
584
+ 'white-space:nowrap'
585
+ ].join(';')
586
+
587
+ for (const seg of segments) {
588
+ const row = document.createElement('div')
589
+ row.style.cssText = 'display:flex;align-items:center;gap:6px'
590
+
591
+ const swatch = document.createElement('span')
592
+ swatch.style.cssText = `display:inline-block;width:10px;height:10px;border-radius:2px;background:${seg.color}`
593
+
594
+ const label = document.createElement('span')
595
+ label.textContent = seg.label.replace(/\n/g, ' ')
596
+ label.style.cssText = 'flex:1'
597
+
598
+ const value = document.createElement('span')
599
+ value.textContent = String(seg.count)
600
+ value.style.cssText = 'font-weight:700;margin-left:12px'
601
+
602
+ row.append(swatch, label, value)
603
+ el.appendChild(row)
604
+ }
605
+
606
+ document.body.appendChild(el)
607
+ this._tooltipEl = el
608
+
609
+ this._tooltipMove = (e: MouseEvent) => {
610
+ el.style.left = `${e.clientX + 14}px`
611
+ el.style.top = `${e.clientY + 14}px`
612
+ }
613
+ document.addEventListener('mousemove', this._tooltipMove, true)
614
+ }
615
+
616
+ private _hideGaugeTooltip(): void {
617
+ if (this._tooltipMove) {
618
+ document.removeEventListener('mousemove', this._tooltipMove, true)
619
+ this._tooltipMove = undefined
620
+ }
621
+ if (this._tooltipEl) {
622
+ this._tooltipEl.remove()
623
+ this._tooltipEl = undefined
624
+ }
625
+ }
626
+ }
627
+ }
@@ -369,8 +369,9 @@ RootContainer.prototype._refreshStockerGauges = function () {
369
369
  if (type === 'STOCKER') {
370
370
  // 3D 게이지는 스토커 자신의 real-object 가 그린다 → 재빌드 (2D 모드면 _realObject 없음)
371
371
  c._realObject?.update?.()
372
- } else if (type === 'StockerCapacityBar' || type === 'MCSGaugeCapacityBar') {
373
- // 2D 게이지는 자식 컴포넌트가 그린다 → 리드로우
372
+ } else if (type === 'StockerCapacityBar' || type === 'MCSGaugeCapacityBar' || type === 'ZoneCapacityBar') {
373
+ // 2D 게이지(스토커·존)는 자식 컴포넌트가 그린다 → 리드로우.
374
+ // 존 게이지도 스토커 게이지와 같은 stockerGaugeMode 스위치로 함께 전환된다.
374
375
  c.invalidate?.()
375
376
  }
376
377
  walk(c)