@fmsim/machine 2.0.0-beta.85 → 2.0.0-beta.86
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 +123 -37
- package/dist/carrier-manager.js.map +1 -1
- package/dist/carrier.js +16 -1
- package/dist/carrier.js.map +1 -1
- package/dist/factories/machine-3d.js +41 -2
- package/dist/factories/machine-3d.js.map +1 -1
- package/dist/features/mcs-status-default.js +2 -1
- package/dist/features/mcs-status-default.js.map +1 -1
- package/dist/mcs-carrier-holder.js +39 -26
- package/dist/mcs-carrier-holder.js.map +1 -1
- package/dist/scene/root-container-override.js +55 -100
- package/dist/scene/root-container-override.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/carrier-manager.ts +143 -41
- package/src/carrier.ts +18 -1
- package/src/factories/machine-3d.ts +39 -1
- package/src/features/mcs-status-default.ts +2 -1
- package/src/mcs-carrier-holder.ts +40 -27
- package/src/scene/root-container-override.ts +48 -113
|
@@ -214,108 +214,63 @@ ModelLayer.prototype.onchange = function (after) {
|
|
|
214
214
|
}
|
|
215
215
|
return _origModelLayerOnchange.call(this, after);
|
|
216
216
|
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
// === LegendTheme / AnimationTheme value resolve ===
|
|
218
|
+
//
|
|
219
|
+
// rootModel.state.style[name] 에 저장된 legend/animation 값은 보드 직렬화
|
|
220
|
+
// 형태에 따라 (a) 정상 object 또는 (b) JSON 문자열 둘 다로 나타난다 (2026-06-09
|
|
221
|
+
// 진단 — consumer 인 carrier.ts:animationPreset 이 같은 이유로 typeof string
|
|
222
|
+
// 분기 + JSON5.parse 처리하는 선례 존재). LegendTheme getter 들이 이 분기를
|
|
223
|
+
// 두지 않아 string 통과 → getValueOnRanges 매칭 실패 → 3D gauge 의 색상이
|
|
224
|
+
// fallback 으로만 결정되던 증상.
|
|
225
|
+
//
|
|
226
|
+
// fix 는 getter 한 곳에서 lazy parse. WeakMap<state, Map<rawString, parsed>>
|
|
227
|
+
// 으로 *raw string 자체를 key* — 보드 편집으로 raw 가 바뀌면 자연 무효화,
|
|
228
|
+
// 같은 raw 의 반복 lookup 은 O(1). root 가 GC 되면 cache 도 같이 GC.
|
|
229
|
+
const _legendParseCache = new WeakMap();
|
|
230
|
+
function parseLegendIfString(state, raw) {
|
|
231
|
+
if (typeof raw !== 'string')
|
|
232
|
+
return raw;
|
|
233
|
+
let cache = _legendParseCache.get(state);
|
|
234
|
+
if (!cache) {
|
|
235
|
+
cache = new Map();
|
|
236
|
+
_legendParseCache.set(state, cache);
|
|
221
237
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
238
|
+
if (cache.has(raw))
|
|
239
|
+
return cache.get(raw);
|
|
240
|
+
let parsed;
|
|
241
|
+
try {
|
|
242
|
+
parsed = JSON.parse(raw);
|
|
227
243
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
return
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
Object.defineProperty(RootContainer.prototype, '
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
});
|
|
247
|
-
Object.defineProperty(RootContainer.prototype, '
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
});
|
|
253
|
-
Object.defineProperty(RootContainer.prototype, '
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
});
|
|
259
|
-
Object.defineProperty(RootContainer.prototype, 'ohtLegendTheme', {
|
|
260
|
-
get: function () {
|
|
261
|
-
const { ohtLegendName } = this.rootModel.state;
|
|
262
|
-
return ohtLegendName && this.state.style[ohtLegendName];
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
Object.defineProperty(RootContainer.prototype, 'shuttleLegendTheme', {
|
|
266
|
-
get: function () {
|
|
267
|
-
const { shuttleLegendName } = this.rootModel.state;
|
|
268
|
-
return shuttleLegendName && this.state.style[shuttleLegendName];
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
Object.defineProperty(RootContainer.prototype, 'craneLegendTheme', {
|
|
272
|
-
get: function () {
|
|
273
|
-
const { craneLegendName } = this.rootModel.state;
|
|
274
|
-
return craneLegendName && this.state.style[craneLegendName];
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
Object.defineProperty(RootContainer.prototype, 'shelfLegendTheme', {
|
|
278
|
-
get: function () {
|
|
279
|
-
const { shelfLegendName } = this.rootModel.state;
|
|
280
|
-
return shelfLegendName && this.state.style[shelfLegendName];
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
Object.defineProperty(RootContainer.prototype, 'portLegendTheme', {
|
|
284
|
-
get: function () {
|
|
285
|
-
const { portLegendName } = this.rootModel.state;
|
|
286
|
-
return portLegendName && this.state.style[portLegendName];
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
Object.defineProperty(RootContainer.prototype, 'carrierLegendTheme', {
|
|
290
|
-
get: function () {
|
|
291
|
-
const { carrierLegendName } = this.rootModel.state;
|
|
292
|
-
return carrierLegendName && this.state.style[carrierLegendName];
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
Object.defineProperty(RootContainer.prototype, 'carrierAnimationTheme', {
|
|
296
|
-
get: function () {
|
|
297
|
-
const { carrierAnimationName } = this.rootModel.state;
|
|
298
|
-
return carrierAnimationName && this.state.style[carrierAnimationName];
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
Object.defineProperty(RootContainer.prototype, 'stockerCapacityLegendTheme', {
|
|
302
|
-
get: function () {
|
|
303
|
-
const { stockerCapacityLegendName } = this.rootModel.state;
|
|
304
|
-
return stockerCapacityLegendName && this.state.style[stockerCapacityLegendName];
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
Object.defineProperty(RootContainer.prototype, 'zoneCapacityLegendTheme', {
|
|
308
|
-
get: function () {
|
|
309
|
-
const { zoneCapacityLegendName } = this.rootModel.state;
|
|
310
|
-
return zoneCapacityLegendName && this.state.style[zoneCapacityLegendName];
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
Object.defineProperty(RootContainer.prototype, 'batteryRateLegendTheme', {
|
|
314
|
-
get: function () {
|
|
315
|
-
const { batteryRateLegendName } = this.rootModel.state;
|
|
316
|
-
return batteryRateLegendName && this.state.style[batteryRateLegendName];
|
|
317
|
-
}
|
|
318
|
-
});
|
|
244
|
+
catch (_a) {
|
|
245
|
+
parsed = raw;
|
|
246
|
+
} // parse 실패 시 raw 보존
|
|
247
|
+
cache.set(raw, parsed);
|
|
248
|
+
return parsed;
|
|
249
|
+
}
|
|
250
|
+
function legendThemeGetter(stateKey) {
|
|
251
|
+
return function () {
|
|
252
|
+
const name = this.rootModel.state[stateKey];
|
|
253
|
+
const raw = name && this.state.style[name];
|
|
254
|
+
return parseLegendIfString(this.state, raw);
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
Object.defineProperty(RootContainer.prototype, 'equipmentLegendTheme', { get: legendThemeGetter('equipmentLegendName') });
|
|
258
|
+
Object.defineProperty(RootContainer.prototype, 'bufferLegendTheme', { get: legendThemeGetter('bufferLegendName') });
|
|
259
|
+
Object.defineProperty(RootContainer.prototype, 'agvlineLegendTheme', { get: legendThemeGetter('agvlineLegendName') });
|
|
260
|
+
Object.defineProperty(RootContainer.prototype, 'ohtlineLegendTheme', { get: legendThemeGetter('ohtlineLegendName') });
|
|
261
|
+
Object.defineProperty(RootContainer.prototype, 'conveyorLegendTheme', { get: legendThemeGetter('conveyorLegendName') });
|
|
262
|
+
Object.defineProperty(RootContainer.prototype, 'stokerLegendTheme', { get: legendThemeGetter('stokerLegendName') });
|
|
263
|
+
Object.defineProperty(RootContainer.prototype, 'agvLegendTheme', { get: legendThemeGetter('agvLegendName') });
|
|
264
|
+
Object.defineProperty(RootContainer.prototype, 'ohtLegendTheme', { get: legendThemeGetter('ohtLegendName') });
|
|
265
|
+
Object.defineProperty(RootContainer.prototype, 'shuttleLegendTheme', { get: legendThemeGetter('shuttleLegendName') });
|
|
266
|
+
Object.defineProperty(RootContainer.prototype, 'craneLegendTheme', { get: legendThemeGetter('craneLegendName') });
|
|
267
|
+
Object.defineProperty(RootContainer.prototype, 'shelfLegendTheme', { get: legendThemeGetter('shelfLegendName') });
|
|
268
|
+
Object.defineProperty(RootContainer.prototype, 'portLegendTheme', { get: legendThemeGetter('portLegendName') });
|
|
269
|
+
Object.defineProperty(RootContainer.prototype, 'carrierLegendTheme', { get: legendThemeGetter('carrierLegendName') });
|
|
270
|
+
Object.defineProperty(RootContainer.prototype, 'carrierAnimationTheme', { get: legendThemeGetter('carrierAnimationName') });
|
|
271
|
+
Object.defineProperty(RootContainer.prototype, 'stockerCapacityLegendTheme', { get: legendThemeGetter('stockerCapacityLegendName') });
|
|
272
|
+
Object.defineProperty(RootContainer.prototype, 'zoneCapacityLegendTheme', { get: legendThemeGetter('zoneCapacityLegendName') });
|
|
273
|
+
Object.defineProperty(RootContainer.prototype, 'batteryRateLegendTheme', { get: legendThemeGetter('batteryRateLegendName') });
|
|
319
274
|
Object.defineProperty(RootContainer.prototype, 'vehicleAnimation', {
|
|
320
275
|
get: function () {
|
|
321
276
|
const { vehicleAnimation } = this.rootModel.state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-container-override.js","sourceRoot":"","sources":["../../src/scene/root-container-override.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEjF,OAAO,cAAc,MAAM,oBAAoB,CAAA;A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,CAAC,KAAK,CAAA;QACvD,OAAO,sBAAsB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;IAC3E,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,wBAAwB,EAAE;IACvE,GAAG,EAAE;QACH,MAAM,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QACtD,OAAO,qBAAqB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACzE,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,kBAAkB,EAAE;IACjE,GAAG,EAAE;QACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QACjD,OAAO,CAAC,CAAC,gBAAgB,CAAA;IAC3B,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,gBAAgB,EAAE;IAC/D,GAAG,EAAE;QACH,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { Component, RootContainer } from '@hatiolab/things-scene'\nimport { themesColorMap, themesColorRange, themesAnimationMap } from '@fmsim/api'\nimport { Legend } from '../features/mcs-status-default'\nimport CarrierManager from '../carrier-manager'\n\n// RootContainer 클래스 타입 확장\ndeclare module '@hatiolab/things-scene' {\n interface RootContainer {\n portLegendTheme?: any\n carrierLegendTheme?: any\n carrierAnimationTheme?: any\n stockerCapacityLegendTheme?: any\n zoneCapacityLegendTheme?: any\n batteryRateLegendTheme?: any\n bufferLegendTheme?: any\n agvlineLegendTheme?: any\n ohtlineLegendTheme?: any\n conveyorLegendTheme?: any\n stokerLegendTheme?: any\n agvLegendTheme?: any\n ohtLegendTheme?: any\n shuttleLegendTheme?: any\n craneLegendTheme?: any\n shelfLegendTheme?: any\n equipmentLegendTheme?: any\n style: any\n vehicleAnimation?: boolean\n // 캐시 관련 속성 추가\n _animationConfigCache?: Map<string, any>\n _carrierManager?: CarrierManager\n carrierManager: CarrierManager\n }\n}\n\nconst ModelLayer = (Component as any).register('model-layer') as any\n\nObject.defineProperty(ModelLayer.prototype, 'nature', {\n get: function () {\n return {\n mutable: false,\n rotatable: false,\n resizable: true,\n properties: [\n {\n type: 'boolean',\n label: 'vehicle-animation',\n name: 'vehicleAnimation'\n },\n {\n type: 'legend',\n label: '',\n name: 'LEGENDS',\n property: {\n label: 'LEGENDS'\n }\n },\n {\n type: 'select',\n label: 'equipment-legend-name',\n name: 'equipmentLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'buffer-legend-name',\n name: 'bufferLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'agvline-legend-name',\n name: 'agvlineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'ohtline-legend-name',\n name: 'ohtlineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'conveyor-legend-name',\n name: 'conveyorLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'stoker-legend-name',\n name: 'stokerLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'port-legend-name',\n name: 'portLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'agv-legend-name',\n name: 'agvLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'oht-legend-name',\n name: 'ohtLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'shuttle-legend-name',\n name: 'shuttleLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'crane-legend-name',\n name: 'craneLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'port-legend-name',\n name: 'portLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'shelf-legend-name',\n name: 'shelfLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-legend-name',\n name: 'carrierLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-animation-name',\n name: 'carrierAnimationName',\n property: {\n options: themesAnimationMap\n }\n },\n {\n type: 'select',\n label: 'stocker-capacity-legend-name',\n name: 'stockerCapacityLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'select',\n label: 'zone-capacity-legend-name',\n name: 'zoneCapacityLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'select',\n label: 'battery-rate-legend-name',\n name: 'batteryRateLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'legend',\n label: '',\n name: 'MOOD',\n property: {\n label: 'MOOD'\n }\n },\n {\n type: 'select',\n label: 'light-preset',\n name: 'lightPreset',\n property: {\n options: ['dark', 'medium', 'bright']\n }\n }\n ],\n 'value-property': 'text'\n }\n }\n})\n\n/**\n * 조명 프리셋 — 3 단계 밝기 토글.\n *\n * fmsim 은 디테일 조명 옵션 UI 를 노출하지 않으므로 단일 select 로 단순화.\n * medium = things-scene 의 현재 default 값과 동일 (외관 변화 없음).\n * 사용자가 select 변경 시 onchange 가 exposure + hemiIntensity + dirLightIntensity\n * 를 일괄 set → three-capability 의 변경 감지 핸들러가 즉시 갱신.\n */\nconst LIGHT_PRESETS: Record<string, { exposure: number; hemiIntensity: number; dirLightIntensity: number }> = {\n dark: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 0.6 },\n medium: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 2.0 },\n bright: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 5.0 }\n}\n\nconst _origModelLayerOnchange = ModelLayer.prototype.onchange\nModelLayer.prototype.onchange = function (after: any) {\n if (after && Object.prototype.hasOwnProperty.call(after, 'lightPreset')) {\n const preset = LIGHT_PRESETS[after.lightPreset as string]\n if (preset) {\n this.set({\n exposure: preset.exposure,\n hemiIntensity: preset.hemiIntensity,\n dirLightIntensity: preset.dirLightIntensity\n })\n }\n }\n return _origModelLayerOnchange.call(this, after)\n}\n\nObject.defineProperty(RootContainer.prototype, 'equipmentLegendTheme', {\n get: function () {\n const { equipmentLegendName } = this.rootModel.state\n return equipmentLegendName && this.state.style[equipmentLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'bufferLegendTheme', {\n get: function () {\n const { bufferLegendName } = this.rootModel.state\n return bufferLegendName && this.state.style[bufferLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'agvlineLegendTheme', {\n get: function () {\n const { agvlineLegendName } = this.rootModel.state\n return agvlineLegendName && this.state.style[agvlineLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'ohtlineLegendTheme', {\n get: function () {\n const { ohtlineLegendName } = this.rootModel.state\n return ohtlineLegendName && this.state.style[ohtlineLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'conveyorLegendTheme', {\n get: function () {\n const { conveyorLegendName } = this.rootModel.state\n return conveyorLegendName && this.state.style[conveyorLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'stokerLegendTheme', {\n get: function () {\n const { stokerLegendName } = this.rootModel.state\n return stokerLegendName && this.state.style[stokerLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'agvLegendTheme', {\n get: function () {\n const { agvLegendName } = this.rootModel.state\n return agvLegendName && this.state.style[agvLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'ohtLegendTheme', {\n get: function () {\n const { ohtLegendName } = this.rootModel.state\n return ohtLegendName && this.state.style[ohtLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'shuttleLegendTheme', {\n get: function () {\n const { shuttleLegendName } = this.rootModel.state\n return shuttleLegendName && this.state.style[shuttleLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'craneLegendTheme', {\n get: function () {\n const { craneLegendName } = this.rootModel.state\n return craneLegendName && this.state.style[craneLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'shelfLegendTheme', {\n get: function () {\n const { shelfLegendName } = this.rootModel.state\n return shelfLegendName && this.state.style[shelfLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'portLegendTheme', {\n get: function () {\n const { portLegendName } = this.rootModel.state\n return portLegendName && this.state.style[portLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierLegendTheme', {\n get: function () {\n const { carrierLegendName } = this.rootModel.state\n return carrierLegendName && this.state.style[carrierLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierAnimationTheme', {\n get: function () {\n const { carrierAnimationName } = this.rootModel.state\n return carrierAnimationName && this.state.style[carrierAnimationName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'stockerCapacityLegendTheme', {\n get: function () {\n const { stockerCapacityLegendName } = this.rootModel.state\n return stockerCapacityLegendName && this.state.style[stockerCapacityLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'zoneCapacityLegendTheme', {\n get: function () {\n const { zoneCapacityLegendName } = this.rootModel.state\n return zoneCapacityLegendName && this.state.style[zoneCapacityLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'batteryRateLegendTheme', {\n get: function () {\n const { batteryRateLegendName } = this.rootModel.state\n return batteryRateLegendName && this.state.style[batteryRateLegendName]\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'vehicleAnimation', {\n get: function () {\n const { vehicleAnimation } = this.rootModel.state\n return !!vehicleAnimation\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierManager', {\n get: function () {\n if (!this._carrierManager) {\n this._carrierManager = new CarrierManager(this)\n }\n return this._carrierManager\n }\n})\n"]}
|
|
1
|
+
{"version":3,"file":"root-container-override.js","sourceRoot":"","sources":["../../src/scene/root-container-override.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEjF,OAAO,cAAc,MAAM,oBAAoB,CAAA;AA+B/C,MAAM,UAAU,GAAI,SAAiB,CAAC,QAAQ,CAAC,aAAa,CAAQ,CAAA;AAEpE,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,EAAE;IACpD,GAAG,EAAE;QACH,OAAO;YACL,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,IAAI;YACf,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,mBAAmB;oBAC1B,IAAI,EAAE,kBAAkB;iBACzB;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE;wBACR,KAAK,EAAE,SAAS;qBACjB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,uBAAuB;oBAC9B,IAAI,EAAE,qBAAqB;oBAC3B,QAAQ,EAAE;wBACR,OAAO,EAAE,cAAc;qBACxB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,oBAAoB;oBAC3B,IAAI,EAAE,kBAAkB;oBACxB,QAAQ,EAAE;wBACR,OAAO,EAAE,cAAc;qBACxB;iBACF;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,qBAAqB;oBAC5B,IAAI,EAAE,mBAAmB;oBACzB,QAAQ,EAAE;wBACR,OAAO,EAAE,cAAc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AAe,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAA;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;CACF,CAAC,CAAA","sourcesContent":["import { Component, RootContainer } from '@hatiolab/things-scene'\nimport { themesColorMap, themesColorRange, themesAnimationMap } from '@fmsim/api'\nimport { Legend } from '../features/mcs-status-default'\nimport CarrierManager from '../carrier-manager'\n\n// RootContainer 클래스 타입 확장\ndeclare module '@hatiolab/things-scene' {\n interface RootContainer {\n portLegendTheme?: any\n carrierLegendTheme?: any\n carrierAnimationTheme?: any\n stockerCapacityLegendTheme?: any\n zoneCapacityLegendTheme?: any\n batteryRateLegendTheme?: any\n bufferLegendTheme?: any\n agvlineLegendTheme?: any\n ohtlineLegendTheme?: any\n conveyorLegendTheme?: any\n stokerLegendTheme?: any\n agvLegendTheme?: any\n ohtLegendTheme?: any\n shuttleLegendTheme?: any\n craneLegendTheme?: any\n shelfLegendTheme?: any\n equipmentLegendTheme?: any\n style: any\n vehicleAnimation?: boolean\n // 캐시 관련 속성 추가\n _animationConfigCache?: Map<string, any>\n _carrierManager?: CarrierManager\n carrierManager: CarrierManager\n }\n}\n\nconst ModelLayer = (Component as any).register('model-layer') as any\n\nObject.defineProperty(ModelLayer.prototype, 'nature', {\n get: function () {\n return {\n mutable: false,\n rotatable: false,\n resizable: true,\n properties: [\n {\n type: 'boolean',\n label: 'vehicle-animation',\n name: 'vehicleAnimation'\n },\n {\n type: 'legend',\n label: '',\n name: 'LEGENDS',\n property: {\n label: 'LEGENDS'\n }\n },\n {\n type: 'select',\n label: 'equipment-legend-name',\n name: 'equipmentLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'buffer-legend-name',\n name: 'bufferLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'agvline-legend-name',\n name: 'agvlineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'ohtline-legend-name',\n name: 'ohtlineLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'conveyor-legend-name',\n name: 'conveyorLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'stoker-legend-name',\n name: 'stokerLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'port-legend-name',\n name: 'portLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'agv-legend-name',\n name: 'agvLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'oht-legend-name',\n name: 'ohtLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'shuttle-legend-name',\n name: 'shuttleLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'crane-legend-name',\n name: 'craneLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'port-legend-name',\n name: 'portLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'shelf-legend-name',\n name: 'shelfLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-legend-name',\n name: 'carrierLegendName',\n property: {\n options: themesColorMap\n }\n },\n {\n type: 'select',\n label: 'carrier-animation-name',\n name: 'carrierAnimationName',\n property: {\n options: themesAnimationMap\n }\n },\n {\n type: 'select',\n label: 'stocker-capacity-legend-name',\n name: 'stockerCapacityLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'select',\n label: 'zone-capacity-legend-name',\n name: 'zoneCapacityLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'select',\n label: 'battery-rate-legend-name',\n name: 'batteryRateLegendName',\n property: {\n options: themesColorRange\n }\n },\n {\n type: 'legend',\n label: '',\n name: 'MOOD',\n property: {\n label: 'MOOD'\n }\n },\n {\n type: 'select',\n label: 'light-preset',\n name: 'lightPreset',\n property: {\n options: ['dark', 'medium', 'bright']\n }\n }\n ],\n 'value-property': 'text'\n }\n }\n})\n\n/**\n * 조명 프리셋 — 3 단계 밝기 토글.\n *\n * fmsim 은 디테일 조명 옵션 UI 를 노출하지 않으므로 단일 select 로 단순화.\n * medium = things-scene 의 현재 default 값과 동일 (외관 변화 없음).\n * 사용자가 select 변경 시 onchange 가 exposure + hemiIntensity + dirLightIntensity\n * 를 일괄 set → three-capability 의 변경 감지 핸들러가 즉시 갱신.\n */\nconst LIGHT_PRESETS: Record<string, { exposure: number; hemiIntensity: number; dirLightIntensity: number }> = {\n dark: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 0.6 },\n medium: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 2.0 },\n bright: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 5.0 }\n}\n\nconst _origModelLayerOnchange = ModelLayer.prototype.onchange\nModelLayer.prototype.onchange = function (after: any) {\n if (after && Object.prototype.hasOwnProperty.call(after, 'lightPreset')) {\n const preset = LIGHT_PRESETS[after.lightPreset as string]\n if (preset) {\n this.set({\n exposure: preset.exposure,\n hemiIntensity: preset.hemiIntensity,\n dirLightIntensity: preset.dirLightIntensity\n })\n }\n }\n return _origModelLayerOnchange.call(this, after)\n}\n\n// === LegendTheme / AnimationTheme value resolve ===\n//\n// rootModel.state.style[name] 에 저장된 legend/animation 값은 보드 직렬화\n// 형태에 따라 (a) 정상 object 또는 (b) JSON 문자열 둘 다로 나타난다 (2026-06-09\n// 진단 — consumer 인 carrier.ts:animationPreset 이 같은 이유로 typeof string\n// 분기 + JSON5.parse 처리하는 선례 존재). LegendTheme getter 들이 이 분기를\n// 두지 않아 string 통과 → getValueOnRanges 매칭 실패 → 3D gauge 의 색상이\n// fallback 으로만 결정되던 증상.\n//\n// fix 는 getter 한 곳에서 lazy parse. WeakMap<state, Map<rawString, parsed>>\n// 으로 *raw string 자체를 key* — 보드 편집으로 raw 가 바뀌면 자연 무효화,\n// 같은 raw 의 반복 lookup 은 O(1). root 가 GC 되면 cache 도 같이 GC.\nconst _legendParseCache = new WeakMap<object, Map<string, any>>()\n\nfunction parseLegendIfString(state: any, raw: any): any {\n if (typeof raw !== 'string') return raw\n let cache = _legendParseCache.get(state)\n if (!cache) {\n cache = new Map()\n _legendParseCache.set(state, cache)\n }\n if (cache.has(raw)) return cache.get(raw)\n let parsed: any\n try { parsed = JSON.parse(raw) } catch { parsed = raw } // parse 실패 시 raw 보존\n cache.set(raw, parsed)\n return parsed\n}\n\nfunction legendThemeGetter(stateKey: string) {\n return function (this: any) {\n const name = this.rootModel.state[stateKey]\n const raw = name && this.state.style[name]\n return parseLegendIfString(this.state, raw)\n }\n}\n\nObject.defineProperty(RootContainer.prototype, 'equipmentLegendTheme', { get: legendThemeGetter('equipmentLegendName') })\nObject.defineProperty(RootContainer.prototype, 'bufferLegendTheme', { get: legendThemeGetter('bufferLegendName') })\nObject.defineProperty(RootContainer.prototype, 'agvlineLegendTheme', { get: legendThemeGetter('agvlineLegendName') })\nObject.defineProperty(RootContainer.prototype, 'ohtlineLegendTheme', { get: legendThemeGetter('ohtlineLegendName') })\nObject.defineProperty(RootContainer.prototype, 'conveyorLegendTheme', { get: legendThemeGetter('conveyorLegendName') })\nObject.defineProperty(RootContainer.prototype, 'stokerLegendTheme', { get: legendThemeGetter('stokerLegendName') })\nObject.defineProperty(RootContainer.prototype, 'agvLegendTheme', { get: legendThemeGetter('agvLegendName') })\nObject.defineProperty(RootContainer.prototype, 'ohtLegendTheme', { get: legendThemeGetter('ohtLegendName') })\nObject.defineProperty(RootContainer.prototype, 'shuttleLegendTheme', { get: legendThemeGetter('shuttleLegendName') })\nObject.defineProperty(RootContainer.prototype, 'craneLegendTheme', { get: legendThemeGetter('craneLegendName') })\nObject.defineProperty(RootContainer.prototype, 'shelfLegendTheme', { get: legendThemeGetter('shelfLegendName') })\nObject.defineProperty(RootContainer.prototype, 'portLegendTheme', { get: legendThemeGetter('portLegendName') })\nObject.defineProperty(RootContainer.prototype, 'carrierLegendTheme', { get: legendThemeGetter('carrierLegendName') })\nObject.defineProperty(RootContainer.prototype, 'carrierAnimationTheme', { get: legendThemeGetter('carrierAnimationName') })\nObject.defineProperty(RootContainer.prototype, 'stockerCapacityLegendTheme', { get: legendThemeGetter('stockerCapacityLegendName') })\nObject.defineProperty(RootContainer.prototype, 'zoneCapacityLegendTheme', { get: legendThemeGetter('zoneCapacityLegendName') })\nObject.defineProperty(RootContainer.prototype, 'batteryRateLegendTheme', { get: legendThemeGetter('batteryRateLegendName') })\n\nObject.defineProperty(RootContainer.prototype, 'vehicleAnimation', {\n get: function () {\n const { vehicleAnimation } = this.rootModel.state\n return !!vehicleAnimation\n }\n})\n\nObject.defineProperty(RootContainer.prototype, 'carrierManager', {\n get: function () {\n if (!this._carrierManager) {\n this._carrierManager = new CarrierManager(this)\n }\n return this._carrierManager\n }\n})\n"]}
|