@fmsim/machine 2.0.0-beta.70 → 2.0.0-beta.77

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.
Binary file
package/icons/decal.png CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fmsim/machine",
3
3
  "description": "Layout View를 구성하는 설비(machine)들과 유닛을 구현한 모듈입니다.",
4
4
  "author": "heartyoh",
5
- "version": "2.0.0-beta.70",
5
+ "version": "2.0.0-beta.77",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "things-scene": true,
@@ -26,7 +26,7 @@
26
26
  "migration": "things-factory-migration"
27
27
  },
28
28
  "dependencies": {
29
- "@fmsim/api": "^2.0.0-beta.70",
29
+ "@fmsim/api": "^2.0.0-beta.75",
30
30
  "@hatiolab/things-scene": "^10.0.0-beta.1"
31
31
  },
32
32
  "devDependencies": {
@@ -55,5 +55,5 @@
55
55
  "prettier --write"
56
56
  ]
57
57
  },
58
- "gitHead": "333bfecbee1ac6fd2f2c2d372912a9f62e3d0d4f"
58
+ "gitHead": "a733a8ec8d0ed643dc0079a68deaeb9913b39308"
59
59
  }
@@ -50,7 +50,7 @@ function pattern(component: any) {
50
50
  return component._pattern
51
51
  }
52
52
 
53
- export function ConveyorMixin<TBase extends Constructor<Component>>(Base: TBase) {
53
+ export function ConveyorMixin<TBase extends new (...args: any[]) => any>(Base: TBase): any {
54
54
  const A = class extends Base {
55
55
  _pattern
56
56
 
@@ -1,12 +1,13 @@
1
+ import { Component } from '@hatiolab/things-scene'
2
+ import { themesColorMap } from '@fmsim/api'
3
+ import { LEGEND_NULL } from './mcs-status-default'
4
+
1
5
  type Constructor<T = {}> = new (...args: any[]) => T
2
6
 
3
7
  interface Legend {
4
8
  [key: string]: string
5
9
  }
6
10
 
7
- import { themesColorMap } from '@fmsim/api'
8
- import { LEGEND_NULL } from './mcs-status-default'
9
-
10
11
  export const MCSStatusMixinProperties = [
11
12
  {
12
13
  type: 'select',
@@ -18,7 +19,7 @@ export const MCSStatusMixinProperties = [
18
19
  }
19
20
  ]
20
21
 
21
- export function MCSStatusMixin<TBase extends Constructor>(Base: TBase) {
22
+ export function MCSStatusMixin<TBase extends Constructor<Component>>(Base: TBase): any {
22
23
  return class extends Base {
23
24
  isLVComponent() {
24
25
  return true
@@ -10,7 +10,7 @@ export const MCSZoneMixinProperties = [
10
10
  }
11
11
  ]
12
12
 
13
- export function MCSZoneMixin<TBase extends Constructor<MCSUnit>>(Base: TBase) {
13
+ export function MCSZoneMixin<TBase extends Constructor<MCSUnit>>(Base: TBase): any {
14
14
  return class extends Base {
15
15
  get zone(): string | undefined {
16
16
  return
@@ -12,7 +12,7 @@ export const ParentObjectMixinProperties = [
12
12
  }
13
13
  ]
14
14
 
15
- export function ParentObjectMixin<TBase extends Constructor<Component>>(Base: TBase) {
15
+ export function ParentObjectMixin<TBase extends Constructor<Component>>(Base: TBase): any {
16
16
  return class extends Base {
17
17
  get parentObject(): MCSMachine | MCSUnit | undefined {
18
18
  const { id, parentObjectId } = this.state
@@ -42,6 +42,11 @@ const NATURE = {
42
42
  }
43
43
  @sceneComponent('FloatingContainer')
44
44
  export default class FloatingContainer extends Container {
45
+ // things-scene 의 `declare const Container_base` 패턴이 base 인스턴스 타입의 accessor
46
+ // 정보를 object-type property 로 평탄화하여 TS2611 발생. 동일 위치를 override 하는
47
+ // 케이스가 operato-scene 엔 없어 fmsim 만 영향. things-scene 측 mixin 타입 패턴이
48
+ // 개선되면 제거.
49
+ // @ts-expect-error TS2611
45
50
  get position() {
46
51
  return this.app?.isViewMode ? 'absolute' : 'static'
47
52
  }
package/src/mcs-unit.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Component, ContainerAbstract } from '@hatiolab/things-scene'
1
+ import { ContainerAbstract } from '@hatiolab/things-scene'
2
2
  import { getPopupData } from '@fmsim/api'
3
3
 
4
4
  import { MCSStatusMixin, MCSStatusMixinProperties } from './features/mcs-status-mixin'
@@ -197,6 +197,14 @@ Object.defineProperty(ModelLayer.prototype, 'nature', {
197
197
  property: {
198
198
  options: themesColorRange
199
199
  }
200
+ },
201
+ {
202
+ type: 'select',
203
+ label: 'light-preset',
204
+ name: 'lightPreset',
205
+ property: {
206
+ options: ['dark', 'medium', 'bright']
207
+ }
200
208
  }
201
209
  ],
202
210
  'value-property': 'text'
@@ -204,6 +212,35 @@ Object.defineProperty(ModelLayer.prototype, 'nature', {
204
212
  }
205
213
  })
206
214
 
215
+ /**
216
+ * 조명 프리셋 — 3 단계 밝기 토글.
217
+ *
218
+ * fmsim 은 디테일 조명 옵션 UI 를 노출하지 않으므로 단일 select 로 단순화.
219
+ * medium = things-scene 의 현재 default 값과 동일 (외관 변화 없음).
220
+ * 사용자가 select 변경 시 onchange 가 exposure + hemiIntensity + dirLightIntensity
221
+ * 를 일괄 set → three-capability 의 변경 감지 핸들러가 즉시 갱신.
222
+ */
223
+ const LIGHT_PRESETS: Record<string, { exposure: number; hemiIntensity: number; dirLightIntensity: number }> = {
224
+ dark: { exposure: 0.7, hemiIntensity: 2.0, dirLightIntensity: 1.0 },
225
+ medium: { exposure: 1.2, hemiIntensity: 4.0, dirLightIntensity: 2.0 },
226
+ bright: { exposure: 1.6, hemiIntensity: 6.0, dirLightIntensity: 3.0 }
227
+ }
228
+
229
+ const _origModelLayerOnchange = ModelLayer.prototype.onchange
230
+ ModelLayer.prototype.onchange = function (after: any) {
231
+ if (after && Object.prototype.hasOwnProperty.call(after, 'lightPreset')) {
232
+ const preset = LIGHT_PRESETS[after.lightPreset as string]
233
+ if (preset) {
234
+ this.set({
235
+ exposure: preset.exposure,
236
+ hemiIntensity: preset.hemiIntensity,
237
+ dirLightIntensity: preset.dirLightIntensity
238
+ })
239
+ }
240
+ }
241
+ return _origModelLayerOnchange.call(this, after)
242
+ }
243
+
207
244
  Object.defineProperty(RootContainer.prototype, 'equipmentLegendTheme', {
208
245
  get: function () {
209
246
  const { equipmentLegendName } = this.rootModel.state
@@ -13,6 +13,11 @@ const NATURE = {
13
13
 
14
14
  @sceneComponent('container')
15
15
  export default class StaticContainer extends Container {
16
+ // things-scene 의 `declare const Container_base` 패턴이 base 인스턴스 타입의 accessor
17
+ // 정보를 object-type property 로 평탄화하여 TS2611 발생. operato-scene 은 position
18
+ // override 케이스가 없어 미발현, fmsim 만 해당. things-scene 측 mixin 타입 패턴이
19
+ // 개선되면 제거.
20
+ // @ts-expect-error TS2611
16
21
  get position() {
17
22
  return 'static'
18
23
  }
@@ -50,6 +50,7 @@
50
50
  "label.conveyor-orientation": "Transfer Direction",
51
51
  "component.backdrop": "backdrop",
52
52
  "label.fit-to-board": "Fit to Board",
53
+ "label.see-through": "see-through",
53
54
  "label.east": "East",
54
55
  "label.west": "West",
55
56
  "label.north": "North",
@@ -61,5 +62,9 @@
61
62
  "label.rotation": "Rotation",
62
63
  "label.mirror": "Mirror",
63
64
  "label.copy-to-opposite": "Copy to opposite",
64
- "label.copy-to-walls": "Copy to all walls"
65
+ "label.copy-to-walls": "Copy to all walls",
66
+ "label.light-preset": "light preset",
67
+ "label.dark": "dark",
68
+ "label.medium": "medium",
69
+ "label.bright": "bright"
65
70
  }
@@ -52,6 +52,7 @@
52
52
  "label.conveyor-orientation": "搬送方向",
53
53
  "component.backdrop": "バックドロップ",
54
54
  "label.fit-to-board": "ボードに合わせる",
55
+ "label.see-through": "透過",
55
56
  "label.east": "東壁",
56
57
  "label.west": "西壁",
57
58
  "label.north": "北壁",
@@ -63,5 +64,9 @@
63
64
  "label.rotation": "回転",
64
65
  "label.mirror": "鏡像",
65
66
  "label.copy-to-opposite": "反対側にコピー",
66
- "label.copy-to-walls": "壁4面にコピー"
67
+ "label.copy-to-walls": "壁4面にコピー",
68
+ "label.light-preset": "照明プリセット",
69
+ "label.dark": "暗",
70
+ "label.medium": "中",
71
+ "label.bright": "明"
67
72
  }
@@ -53,6 +53,7 @@
53
53
  "label.conveyor-orientation": "이송방향",
54
54
  "component.backdrop": "배경",
55
55
  "label.fit-to-board": "보드에 맞춤",
56
+ "label.see-through": "투과",
56
57
  "label.east": "동측 벽",
57
58
  "label.west": "서측 벽",
58
59
  "label.north": "북측 벽",
@@ -64,5 +65,9 @@
64
65
  "label.rotation": "회전",
65
66
  "label.mirror": "거울상",
66
67
  "label.copy-to-opposite": "반대편에 복사",
67
- "label.copy-to-walls": "벽 4면에 복사"
68
+ "label.copy-to-walls": "벽 4면에 복사",
69
+ "label.light-preset": "조명 프리셋",
70
+ "label.dark": "어두움",
71
+ "label.medium": "중간",
72
+ "label.bright": "밝음"
68
73
  }
@@ -52,6 +52,7 @@
52
52
  "label.conveyor-orientation": "Transfer Direction",
53
53
  "component.backdrop": "Backdrop",
54
54
  "label.fit-to-board": "Muat Papan",
55
+ "label.see-through": "tembus pandang",
55
56
  "label.east": "Timur",
56
57
  "label.west": "Barat",
57
58
  "label.north": "Utara",
@@ -63,5 +64,9 @@
63
64
  "label.rotation": "Putaran",
64
65
  "label.mirror": "Cermin",
65
66
  "label.copy-to-opposite": "Salin ke bertentangan",
66
- "label.copy-to-walls": "Salin ke semua dinding"
67
+ "label.copy-to-walls": "Salin ke semua dinding",
68
+ "label.light-preset": "pratetapan cahaya",
69
+ "label.dark": "gelap",
70
+ "label.medium": "sederhana",
71
+ "label.bright": "cerah"
67
72
  }
@@ -52,6 +52,7 @@
52
52
  "label.conveyor-orientation": "输送方向",
53
53
  "component.backdrop": "背景",
54
54
  "label.fit-to-board": "适配画板",
55
+ "label.see-through": "透视",
55
56
  "label.east": "东墙",
56
57
  "label.west": "西墙",
57
58
  "label.north": "北墙",
@@ -63,5 +64,9 @@
63
64
  "label.rotation": "旋转",
64
65
  "label.mirror": "镜像",
65
66
  "label.copy-to-opposite": "复制到对面",
66
- "label.copy-to-walls": "复制到4面墙"
67
+ "label.copy-to-walls": "复制到4面墙",
68
+ "label.light-preset": "灯光预设",
69
+ "label.dark": "昏暗",
70
+ "label.medium": "适中",
71
+ "label.bright": "明亮"
67
72
  }