@@ -3,24 +3,19 @@ import { observable, makeObservable } from "mobx";
3
3
4
4
import { humanize } from "eez-studio-shared/string" ;
5
5
import { Rect } from "eez-studio-shared/geometry" ;
6
+ import { isArray , objectClone } from "eez-studio-shared/util" ;
6
7
7
8
import type { IDashboardComponentContext } from "eez-studio-types" ;
8
9
9
- import {
10
+ import type { IResizeHandler } from "project-editor/flow/flow-interfaces" ;
11
+ import type { ValueType } from "project-editor/features/variable/value-type" ;
12
+ import type { Project } from "project-editor/project/project" ;
13
+ import type {
10
14
ProjectStore ,
11
15
IContextMenuContext ,
12
- getClassInfo ,
13
16
EezValueObject
14
17
} from "project-editor/store" ;
15
18
16
- import type { IResizeHandler } from "project-editor/flow/flow-interfaces" ;
17
-
18
- import type { ValueType } from "project-editor/features/variable/value-type" ;
19
- import type { Project } from "project-editor/project/project" ;
20
-
21
- import { isArray , objectClone } from "eez-studio-shared/util" ;
22
- import { LVGLParts } from "project-editor/lvgl/lvgl-constants" ;
23
-
24
19
////////////////////////////////////////////////////////////////////////////////
25
20
26
21
export const enum PropertyType {
@@ -323,6 +318,8 @@ export interface SerializedData {
323
318
objectsParentPath ?: string [ ] ;
324
319
}
325
320
321
+ export type LVGLParts = string ;
322
+
326
323
interface LVGLClassInfoProperties {
327
324
parts : LVGLParts [ ] | ( ( object : IEezObject ) => LVGLParts [ ] ) ;
328
325
defaultFlags : string ;
@@ -643,6 +640,18 @@ export function isEezObject(object: any): object is IEezObject {
643
640
644
641
////////////////////////////////////////////////////////////////////////////////
645
642
643
+ export function getClass ( object : IEezObject ) {
644
+ if ( isArray ( object ) ) {
645
+ return getPropertyInfo ( object ) . typeClass ! ;
646
+ } else {
647
+ return object . constructor as EezClass ;
648
+ }
649
+ }
650
+
651
+ export function getClassInfo ( object : IEezObject ) : ClassInfo {
652
+ return getClass ( object ) . classInfo ;
653
+ }
654
+
646
655
export function findClass ( className : string ) {
647
656
return classNameToEezClassMap . get ( className ) ;
648
657
}
0 commit comments