import { ComponentNature, sceneComponent } from '@hatiolab/things-scene' import { LEGEND_CAPACITY, Legend } from './features/mcs-status-default' import { MCSZoneMixin, MCSZoneMixinProperties } from './features/mcs-zone-mixin' import { ParentObjectMixinProperties } from './features/parent-object-mixin' import { CapacityGaugeMixin, CapacityGaugeMixinProperties } from './features/capacity-gauge-mixin' import MCSUnit from './mcs-unit' /** * 존(zone) 게이지. * * mode 에 따라 capacity / carrier / abnormal 3가지 게이지를 표현한다 — 그리는 규칙은 * StockerCapacityBar 와 동일하며 CapacityGaugeMixin 에서 공유한다(단일 소스). * 스토커 게이지와 달리 존 게이지는 자체 id 로 데이터를 받는 Unit(identifiable) 이며, * legend 폴백만 zone 전역 테마(zoneCapacityLegendTheme)로 다르다. * * mode 소스: root.stockerGaugeMode — 스토커 게이지와 같은 런타임 스위치로 함께 전환된다. */ const NATURE: ComponentNature = { mutable: false, resizable: true, rotatable: true, properties: [...MCSZoneMixinProperties, ...ParentObjectMixinProperties, ...CapacityGaugeMixinProperties], 'value-property': 'usage' } @sceneComponent('ZoneCapacityBar') export default class ZoneCapacityBar extends CapacityGaugeMixin(MCSZoneMixin(MCSUnit)) { static get nature() { return NATURE } getLegendFallback(): Legend { return (this.root as any).zoneCapacityLegendTheme || LEGEND_CAPACITY } }