@jnrs/lingshu-smart 2.2.46 → 3.0.0

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.
Files changed (65) hide show
  1. package/AGENTS.md +281 -348
  2. package/dist/components/debug/DataLogPanel.vue.d.ts +29 -3
  3. package/dist/components/debug/PerformanceStats.vue.d.ts +1 -1
  4. package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +1 -2
  5. package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +4 -2
  6. package/dist/components/debug/ScriptRunner/index.vue.d.ts +11 -0
  7. package/dist/components/debug/ScriptRunner/script.d.ts +140 -41
  8. package/dist/components/debug/ScriptRunner/scriptFile.d.ts +92 -0
  9. package/dist/components/debug/WsProxy/index.vue.d.ts +10 -8
  10. package/dist/components/debug/WsProxy/proxy.d.ts +114 -53
  11. package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +18 -2
  12. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +2 -2
  13. package/dist/components/editor/ControlBar/PersistDialog.vue.d.ts +9 -0
  14. package/dist/components/index.js +8419 -6045
  15. package/dist/components/preview/index.vue.d.ts +6852 -4876
  16. package/dist/controller/AppController.d.ts +75 -4
  17. package/dist/controller/SocketDispatcher.d.ts +59 -0
  18. package/dist/fullscreen-BA3oea8O.js +53 -0
  19. package/dist/index-C6Liz-8o.js +1238 -0
  20. package/dist/index.js +36 -27
  21. package/dist/lingshu-smart/cases.json +5890 -14828
  22. package/dist/lingshu-smart/mockSocket.json +263 -0
  23. package/dist/lingshu-smart/wsProxyConfig.json +343 -720
  24. package/dist/playground/ViewPageDemo.vue.d.ts +14412 -10438
  25. package/dist/stores/index.js +1 -1
  26. package/dist/stores/useAppStore.d.ts +20570 -14641
  27. package/dist/stores/useDataStore.d.ts +21139 -14587
  28. package/dist/stores/useDebugStore.d.ts +14 -2
  29. package/dist/stores/useEditorStore.d.ts +3 -3
  30. package/dist/types/app.types.d.ts +1 -1
  31. package/dist/types/components/config.types.d.ts +16 -0
  32. package/dist/types/components/operating.types.d.ts +28 -19
  33. package/dist/types/enums.d.ts +22 -2
  34. package/dist/types/guards.d.ts +4 -1
  35. package/dist/types/index.d.ts +1 -0
  36. package/dist/types/models/config.types.d.ts +41 -9
  37. package/dist/types/models/operating.types.d.ts +64 -74
  38. package/dist/types/socket.types.d.ts +275 -0
  39. package/dist/ui/abstract/ModelAbs.d.ts +42 -2
  40. package/dist/ui/components/Resource.d.ts +0 -1
  41. package/dist/ui/components/StationSlot.d.ts +8 -2
  42. package/dist/ui/components/StationSlotGroup.d.ts +28 -3
  43. package/dist/ui/models/DoubleJointRobot.d.ts +16 -4
  44. package/dist/ui/models/MachineTool.d.ts +6 -2
  45. package/dist/ui/models/MaterialTrack.d.ts +14 -2
  46. package/dist/ui/models/Pallet.d.ts +29 -9
  47. package/dist/ui/models/Rail.d.ts +9 -2
  48. package/dist/ui/models/ResourceOperationWindow.d.ts +2 -1
  49. package/dist/ui/models/ResourceStore.d.ts +7 -5
  50. package/dist/ui/models/Rgv.d.ts +6 -6
  51. package/dist/ui/models/ShuttleStation.d.ts +14 -4
  52. package/dist/ui/models/SingleJointRobot.d.ts +14 -4
  53. package/dist/ui/utils/resolveStationSlotLayers.d.ts +20 -0
  54. package/dist/ui/utils/resolveTypeStyle.d.ts +13 -0
  55. package/dist/useAppStore-DASwAOBy.js +7223 -0
  56. package/dist/utils/fullscreen.d.ts +9 -0
  57. package/dist/utils/index.d.ts +1 -0
  58. package/dist/vite.d.ts +15 -0
  59. package/dist/vite.js +39 -0
  60. package/package.json +6 -2
  61. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupBoth.vue.d.ts +0 -2
  62. package/dist/guards-aLOXCeCF.js +0 -35
  63. package/dist/index-Dsgrnpn0.js +0 -1186
  64. package/dist/useAppStore-CVyLAMtL.js +0 -6125
  65. /package/dist/components/editor/OptionCard/Equipment/{stationSlot/StationSlotGroup.vue.d.ts → models/ResourceStore.vue.d.ts} +0 -0
@@ -13,6 +13,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
13
13
  debugPanelVisible: import('vue').Ref<boolean, boolean>;
14
14
  scriptSteps: import('vue').WritableComputedRef<ScriptStep[], ScriptStep[]>;
15
15
  setScriptSteps: (list: ScriptStep[]) => void;
16
+ scriptLooping: import('vue').WritableComputedRef<boolean, boolean>;
17
+ scriptCaseId: import('vue').ComputedRef<string>;
18
+ scriptCaseName: import('vue').ComputedRef<string>;
19
+ ensureScriptCase: () => import('../components/debug/ScriptRunner/script').ScriptCaseData;
16
20
  activeCaseId: import('vue').WritableComputedRef<string, string>;
17
21
  setWsProxyActiveCaseId: (caseId: string) => void;
18
22
  wsProxyManualModified: import('vue').WritableComputedRef<boolean, boolean>;
@@ -40,6 +44,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
40
44
  debugPanelVisible: import('vue').Ref<boolean, boolean>;
41
45
  scriptSteps: import('vue').WritableComputedRef<ScriptStep[], ScriptStep[]>;
42
46
  setScriptSteps: (list: ScriptStep[]) => void;
47
+ scriptLooping: import('vue').WritableComputedRef<boolean, boolean>;
48
+ scriptCaseId: import('vue').ComputedRef<string>;
49
+ scriptCaseName: import('vue').ComputedRef<string>;
50
+ ensureScriptCase: () => import('../components/debug/ScriptRunner/script').ScriptCaseData;
43
51
  activeCaseId: import('vue').WritableComputedRef<string, string>;
44
52
  setWsProxyActiveCaseId: (caseId: string) => void;
45
53
  wsProxyManualModified: import('vue').WritableComputedRef<boolean, boolean>;
@@ -56,7 +64,7 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
56
64
  toggleTheme: () => void;
57
65
  showDebugPanel: () => void;
58
66
  hideDebugPanel: () => void;
59
- }, "logLevel" | "shadowsEnabled" | "animationsEnabled" | "fpsMode" | "interactionsDisabled" | "locale" | "theme" | "wsProxyManualModified" | "perfStatsCollapsed" | "scriptSteps" | "activeCaseId">, Pick<{
67
+ }, "logLevel" | "shadowsEnabled" | "animationsEnabled" | "fpsMode" | "interactionsDisabled" | "locale" | "theme" | "wsProxyManualModified" | "perfStatsCollapsed" | "scriptSteps" | "scriptLooping" | "scriptCaseId" | "scriptCaseName" | "activeCaseId">, Pick<{
60
68
  logLevel: import('vue').WritableComputedRef<LogLevel, LogLevel>;
61
69
  shadowsEnabled: import('vue').WritableComputedRef<boolean, boolean>;
62
70
  animationsEnabled: import('vue').WritableComputedRef<boolean, boolean>;
@@ -67,6 +75,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
67
75
  debugPanelVisible: import('vue').Ref<boolean, boolean>;
68
76
  scriptSteps: import('vue').WritableComputedRef<ScriptStep[], ScriptStep[]>;
69
77
  setScriptSteps: (list: ScriptStep[]) => void;
78
+ scriptLooping: import('vue').WritableComputedRef<boolean, boolean>;
79
+ scriptCaseId: import('vue').ComputedRef<string>;
80
+ scriptCaseName: import('vue').ComputedRef<string>;
81
+ ensureScriptCase: () => import('../components/debug/ScriptRunner/script').ScriptCaseData;
70
82
  activeCaseId: import('vue').WritableComputedRef<string, string>;
71
83
  setWsProxyActiveCaseId: (caseId: string) => void;
72
84
  wsProxyManualModified: import('vue').WritableComputedRef<boolean, boolean>;
@@ -83,4 +95,4 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
83
95
  toggleTheme: () => void;
84
96
  showDebugPanel: () => void;
85
97
  hideDebugPanel: () => void;
86
- }, "setScriptSteps" | "setWsProxyActiveCaseId" | "setWsProxyManualModified" | "setPerfStatsCollapsed" | "setLogLevel" | "setShadowsEnabled" | "setAnimationsEnabled" | "setFpsMode" | "setInteractionsDisabled" | "setLocale" | "setTheme" | "toggleTheme" | "showDebugPanel" | "hideDebugPanel">>;
98
+ }, "ensureScriptCase" | "setScriptSteps" | "setWsProxyActiveCaseId" | "setWsProxyManualModified" | "setPerfStatsCollapsed" | "setLogLevel" | "setShadowsEnabled" | "setAnimationsEnabled" | "setFpsMode" | "setInteractionsDisabled" | "setLocale" | "setTheme" | "toggleTheme" | "showDebugPanel" | "hideDebugPanel">>;
@@ -11,7 +11,7 @@ export declare const useEditorStore: import('pinia').StoreDefinition<"@jnrs/ling
11
11
  updateScene: import('@jnrs/shared/lodash').DebouncedFunc<() => void>;
12
12
  addLayer: (layer: ILayer) => void;
13
13
  addLayerAtPosition: (layer: ILayer, worldX: number, worldY: number) => void;
14
- selectLayer: (uuid?: string) => void;
14
+ selectLayer: (id?: string) => void;
15
15
  updateLayer: (layer: ILayer) => void;
16
16
  renderLayers: import('@jnrs/shared/lodash').DebouncedFunc<() => void>;
17
17
  }, never>, Pick<{
@@ -26,7 +26,7 @@ export declare const useEditorStore: import('pinia').StoreDefinition<"@jnrs/ling
26
26
  updateScene: import('@jnrs/shared/lodash').DebouncedFunc<() => void>;
27
27
  addLayer: (layer: ILayer) => void;
28
28
  addLayerAtPosition: (layer: ILayer, worldX: number, worldY: number) => void;
29
- selectLayer: (uuid?: string) => void;
29
+ selectLayer: (id?: string) => void;
30
30
  updateLayer: (layer: ILayer) => void;
31
31
  renderLayers: import('@jnrs/shared/lodash').DebouncedFunc<() => void>;
32
32
  }, "scene" | "layers" | "currentCase" | "currentLayer">, Pick<{
@@ -41,7 +41,7 @@ export declare const useEditorStore: import('pinia').StoreDefinition<"@jnrs/ling
41
41
  updateScene: import('@jnrs/shared/lodash').DebouncedFunc<() => void>;
42
42
  addLayer: (layer: ILayer) => void;
43
43
  addLayerAtPosition: (layer: ILayer, worldX: number, worldY: number) => void;
44
- selectLayer: (uuid?: string) => void;
44
+ selectLayer: (id?: string) => void;
45
45
  updateLayer: (layer: ILayer) => void;
46
46
  renderLayers: import('@jnrs/shared/lodash').DebouncedFunc<() => void>;
47
47
  }, "initContainer" | "resizeContainer" | "destroyContainer" | "initEditor" | "updateScene" | "addLayer" | "addLayerAtPosition" | "selectLayer" | "updateLayer" | "renderLayers">>;
@@ -29,7 +29,7 @@ export interface IScene {
29
29
  * 方案
30
30
  */
31
31
  export interface ICase {
32
- uuid: string;
32
+ id: string;
33
33
  isActive: boolean;
34
34
  title: string;
35
35
  scene: IScene;
@@ -31,6 +31,8 @@ export interface IStationSlotConfig extends IBaseConfig, IInteractiveState {
31
31
  showShadow?: boolean;
32
32
  showText?: boolean;
33
33
  inFlow?: boolean;
34
+ /** 工位可放置的资源数量上限(默认 5):超出上限时按放置顺序移除最早的资源(保留最近 N 个,先进先出淘汰) */
35
+ maxResources?: number;
34
36
  /** 当前工位放置的资源摘要(运行时注入:资源增删时由 StationSlot 同步回写,不参与持久化) */
35
37
  resources?: ISlotResourceSnapshot[];
36
38
  /** 最近一次 operating 接收到的原始数据(运行时注入,供点击回调 data 读取) */
@@ -60,6 +62,20 @@ export interface IStationSlotGroupConfig extends Omit<IBaseConfig, 'width' | 'he
60
62
  flowOptions: IFlowConfig;
61
63
  hideBounds?: boolean;
62
64
  }
65
+ /**
66
+ * 工位层配置(通用:一层=一个工位组)
67
+ * 统一「工位配置(层级)」数据模型:各类设备均以 stationSlotGroups 数组承载工位层。
68
+ */
69
+ export interface IStationSlotLayerConfig {
70
+ /** 层索引(从 1 开始) */
71
+ index: number;
72
+ /** 工位组配置 */
73
+ stationSlotGroup: IStationSlotGroupConfig;
74
+ /** 层状态灯颜色(默认 '#666' 灰色,运行时由 layerLightColor 驱动) */
75
+ lightColor?: string;
76
+ /** 是否显示层状态灯(默认 true) */
77
+ lightEnabled?: boolean;
78
+ }
63
79
  /**
64
80
  * 资源
65
81
  */
@@ -1,43 +1,52 @@
1
1
  import { IRowData } from '../base.types';
2
2
  import { EnumResourceType } from '../enums';
3
3
  /**
4
- * 资源操作
5
- * handleType: 'add' | 'remove'
4
+ * 资源操作(对齐 socket-operating-api.md 资源模型字段)
5
+ * handle_type: 'add' | 'remove'
6
6
  */
7
7
  export interface IResourceOperating {
8
- resourceType: EnumResourceType;
9
- resourceId?: string;
8
+ resource_type: EnumResourceType;
9
+ resource_id?: string;
10
10
  name?: string;
11
- color?: string;
12
- index: number;
13
- /** 层索引(1-based):多层设备(接驳站/料道等)用于定位资源所在层;缺省时按工位序号在所有层中匹配 */
14
- layer?: number;
15
- handleType: 'add' | 'remove';
16
- rawData: IRowData;
11
+ resource_color?: string;
12
+ /** 设备工位序号:资源在工位槽中的索引(1-based) */
13
+ device_station: number;
14
+ /** 设备层索引(1-based):多层设备(接驳站/料道等)用于定位资源所在层;缺省时按工位序号在所有层中匹配 */
15
+ device_layer?: number;
16
+ handle_type: 'add' | 'remove';
17
+ raw_data: IRowData;
17
18
  }
18
19
  /**
19
- * 状态灯操作
20
+ * 状态灯操作(字段缺失即跳过,保持当前状态)
20
21
  */
21
22
  export interface ILightOperating {
22
- color: string;
23
+ color?: string;
23
24
  blinking?: boolean;
24
25
  rotating?: boolean;
25
26
  }
26
27
  /**
27
- * 进度条操作
28
+ * 进度条操作(字段缺失即跳过,保持当前状态)
28
29
  */
29
30
  export interface IProgressOperating {
30
- percent: number;
31
- textContent: string;
31
+ percent?: number;
32
+ text?: string;
33
+ }
34
+ /**
35
+ * 出入口通道操作(协议层 passage,字段缺失即跳过,保持当前状态)
36
+ */
37
+ export interface IPassageOperating {
38
+ in?: boolean;
39
+ out?: boolean;
32
40
  }
33
41
  /**
34
- * 出入口操作
42
+ * 出入口组件内部操作(isIn / isOut)
43
+ * 内部渲染组件 Entrance 的入参,与协议层 passage 语义一致,由设备模型将 passage 转换后传入
35
44
  */
36
45
  export interface IEntranceOperating {
37
- isIn: boolean;
38
- isOut: boolean;
46
+ isIn?: boolean;
47
+ isOut?: boolean;
39
48
  }
40
49
  /**
41
50
  * 子组件运转状态的联合类型
42
51
  */
43
- export type IComponentOperating = IResourceOperating | ILightOperating | IProgressOperating | IEntranceOperating;
52
+ export type IComponentOperating = IResourceOperating | ILightOperating | IProgressOperating | IPassageOperating | IEntranceOperating;
@@ -25,12 +25,32 @@ export declare enum EnumModel {
25
25
  PALLET = "Pallet",
26
26
  RESOURCE_OPERATION_WINDOW = "ResourceOperationWindow"
27
27
  }
28
+ export declare enum EnumDeviceType {
29
+ MACHINE_TOOL = "machine_tool",
30
+ LOADING_STATION = "loading_station",
31
+ SHUTTLE_STATION = "shuttle_station",
32
+ MATERIAL_TRACK = "material_track",
33
+ MARKING_MACHINE = "marking_machine",
34
+ CLEANING_MACHINE = "cleaning_machine",
35
+ SINGLE_JOINT_ROBOT = "single_joint_robot",
36
+ DOUBLE_JOINT_ROBOT = "double_joint_robot",
37
+ RGV = "rgv",
38
+ RESOURCE_STORE = "resource_store",
39
+ PALLET = "pallet",
40
+ RESOURCE_OPERATION_WINDOW = "resource_operation_window"
41
+ }
28
42
  export declare enum EnumComponent {
29
43
  STATION_SLOT = "StationSlot",
30
44
  RESOURCE = "Resource"
31
45
  }
32
46
  export declare enum EnumResourceType {
33
- PALLET = "Pallet",
34
- TOOL = "Tool"
47
+ WORKPIECE = "workpiece",
48
+ TOOL = "tool",
49
+ AUXILIARY = "auxiliary"
50
+ }
51
+ export declare enum EnumPalletType {
52
+ WORKPIECE_PALLET = "workpiece_pallet",
53
+ TOOL_PALLET = "tool_pallet",
54
+ AUXILIARY_PALLET = "auxiliary_pallet"
35
55
  }
36
56
  export type EnumInteractiveUi = EnumModel | EnumComponent;
@@ -3,13 +3,16 @@ export declare function isMachineTool(layer: ILayer | null): layer is import('./
3
3
  export declare function hasStationSlotGroup(layer: ILayer | null): layer is Extract<ILayer, {
4
4
  stationSlotGroup?: any;
5
5
  }>;
6
- export declare function isStationSlotGroupBoth(layer: ILayer | null): layer is Extract<ILayer, {
6
+ export declare function isStationSlotGroupBoth(layer: ILayer | null): layer is Exclude<Extract<ILayer, {
7
7
  stationSlotGroupPallet?: any;
8
8
  stationSlotGroupTool?: any;
9
+ }>, {
10
+ className: EnumModel.PALLET;
9
11
  }>;
10
12
  export declare function hasStationSlotLayers(layer: ILayer | null): layer is Extract<ILayer, {
11
13
  stationSlotGroups?: any[];
12
14
  }>;
15
+ export declare function isResourceStore(layer: ILayer | null): layer is import('./index').IResourceStoreConfig;
13
16
  export declare function hasFixtureChange(layer: ILayer | null): layer is import('./index').ISingleJointRobotConfig | import('./index').IDoubleJointRobotConfig;
14
17
  export declare function isRail(layer: ILayer | null): layer is import('./index').IRailConfig;
15
18
  export declare function isShuttleStation(layer: ILayer | null): layer is import('./index').IShuttleStationConfig;
@@ -7,6 +7,7 @@ export * from './models/config.types';
7
7
  export * from './models/operating.types';
8
8
  export * from './components/config.types';
9
9
  export * from './components/operating.types';
10
+ export * from './socket.types';
10
11
  export * from './guards';
11
12
  /**
12
13
  * 可交互设备类型
@@ -1,16 +1,17 @@
1
1
  import { EnumModel, EnumTag, EnumResourceType } from '../enums';
2
2
  import { IRowData, IBaseConfig, IEventState } from '../base.types';
3
- import { IStationSlotGroupConfig, IFlowConfig } from '../components/config.types';
3
+ import { IStationSlotGroupConfig, IFlowConfig, IStationSlotLayerConfig } from '../components/config.types';
4
4
  import { ILayerOperating } from './operating.types';
5
5
  /**
6
6
  * 设备模型基类
7
7
  */
8
8
  export interface IModel extends IBaseConfig, IEventState {
9
- uuid: string;
9
+ id: string;
10
10
  equipmentName: string;
11
11
  nameplate?: string;
12
12
  lightEnabled?: boolean;
13
13
  nameplateEnabled?: boolean;
14
+ progressEnabled?: boolean;
14
15
  model?: string;
15
16
  manufacturer?: string;
16
17
  group?: string;
@@ -37,6 +38,7 @@ export interface IMachineToolConfig extends IModel {
37
38
  className: EnumModel.MACHINE_TOOL;
38
39
  stationContainerDirection?: 'horizontal' | 'vertical';
39
40
  stationSlotGroup?: IStationSlotGroupConfig;
41
+ stationSlotGroups?: IStationSlotLayerConfig[];
40
42
  }
41
43
  /**
42
44
  * 装载站
@@ -45,6 +47,7 @@ export interface ILoadingStationConfig extends IModel {
45
47
  className: EnumModel.LOADING_STATION;
46
48
  stationContainerDirection?: 'horizontal' | 'vertical';
47
49
  stationSlotGroup?: IStationSlotGroupConfig;
50
+ stationSlotGroups?: IStationSlotLayerConfig[];
48
51
  }
49
52
  /**
50
53
  * 接驳站工位层配置
@@ -90,6 +93,7 @@ export interface IMaterialTrackConfig extends IModel {
90
93
  export interface IMarkingMachineConfig extends IModel {
91
94
  className: EnumModel.MARKING_MACHINE;
92
95
  stationSlotGroup?: IStationSlotGroupConfig;
96
+ stationSlotGroups?: IStationSlotLayerConfig[];
93
97
  }
94
98
  /**
95
99
  * 清洗机
@@ -97,30 +101,37 @@ export interface IMarkingMachineConfig extends IModel {
97
101
  export interface ICleaningMachineConfig extends IModel {
98
102
  className: EnumModel.CLEANING_MACHINE;
99
103
  stationSlotGroup?: IStationSlotGroupConfig;
104
+ stationSlotGroups?: IStationSlotLayerConfig[];
100
105
  }
101
106
  /**
102
107
  * 单关节机器人
103
108
  */
104
109
  export interface ISingleJointRobotConfig extends IModel {
105
110
  className: EnumModel.SINGLE_JOINT_ROBOT;
106
- currentFixture: EnumResourceType;
111
+ currentFixture: EnumResourceType | 'none';
112
+ /** 夹具绑定工位层(多对多):fixture → 绑定的层 index 列表;未绑定的夹具显示全部层。仅影响画布显隐与资源层索引,不影响协议消息 */
113
+ fixtureLayerBindings?: Partial<Record<EnumResourceType, number[]>>;
107
114
  linkRailId?: string;
108
115
  linkTrailerId?: string;
109
116
  flowOptions?: IFlowConfig;
110
117
  stationSlotGroupPallet?: IStationSlotGroupConfig;
111
118
  stationSlotGroupTool?: IStationSlotGroupConfig;
119
+ stationSlotGroups?: IStationSlotLayerConfig[];
112
120
  }
113
121
  /**
114
122
  * 双关节机器人
115
123
  */
116
124
  export interface IDoubleJointRobotConfig extends IModel {
117
125
  className: EnumModel.DOUBLE_JOINT_ROBOT;
118
- currentFixture: EnumResourceType;
126
+ currentFixture: EnumResourceType | 'none';
127
+ /** 夹具绑定工位层(多对多):fixture → 绑定的层 index 列表;未绑定的夹具显示全部层。仅影响画布显隐与资源层索引,不影响协议消息 */
128
+ fixtureLayerBindings?: Partial<Record<EnumResourceType, number[]>>;
119
129
  linkRailId?: string;
120
130
  linkTrailerId?: string;
121
131
  flowOptions?: IFlowConfig;
122
132
  stationSlotGroupPallet?: IStationSlotGroupConfig;
123
133
  stationSlotGroupTool?: IStationSlotGroupConfig;
134
+ stationSlotGroups?: IStationSlotLayerConfig[];
124
135
  }
125
136
  /**
126
137
  * RGV
@@ -131,6 +142,7 @@ export interface IRGVConfig extends IModel {
131
142
  flowOptions?: IFlowConfig;
132
143
  stationSlotGroupPallet?: IStationSlotGroupConfig;
133
144
  stationSlotGroupTool?: IStationSlotGroupConfig;
145
+ stationSlotGroups?: IStationSlotLayerConfig[];
134
146
  }
135
147
  /**
136
148
  * 轨道
@@ -145,23 +157,42 @@ export interface IRailConfig extends IModel {
145
157
  */
146
158
  export interface IResourceStoreConfig extends IModel {
147
159
  className: EnumModel.RESOURCE_STORE;
160
+ /** 外层容器布局配置:Flow 对所有工位层整体排布(方向 flow / 换行 flowWrap / 间距 gap / 容器宽高) */
148
161
  flowOptions?: IFlowConfig;
162
+ /** 是否隐藏外层容器边界(默认 true 隐藏;false 时显示容器轮廓) */
163
+ hideBounds?: boolean;
149
164
  stationSlotGroupPallet?: IStationSlotGroupConfig;
150
165
  stationSlotGroupTool?: IStationSlotGroupConfig;
166
+ stationSlotGroups?: IStationSlotLayerConfig[];
151
167
  }
152
168
  /**
153
- * 托盘(独立设备)
154
- * 参考 ResourceStore:带铭牌、状态灯;主体背景色可配置(默认 #3C3C3C)
155
- * 支持托盘/刀具两个独立工位组
169
+ * 通用托盘工位层配置
170
+ */
171
+ export interface IPalletLayerConfig {
172
+ /** 层索引(从 1 开始) */
173
+ index: number;
174
+ /** 工位组配置(层内工位 resourceType 可任意配置,托盘或刀具) */
175
+ stationSlotGroup: IStationSlotGroupConfig;
176
+ }
177
+ /**
178
+ * 通用托盘(独立设备)
179
+ * 参考接驳站:支持多层工位组(每层一个工位组,可任意放置若干层);
180
+ * 层内工位 resourceType 可任意配置(托盘/刀具),替代原刀盘功能;
181
+ * 主体背景色可配置(默认 #3C3C3C),带铭牌、状态灯。
156
182
  */
157
183
  export interface IPalletConfig extends IModel {
158
184
  className: EnumModel.PALLET;
159
185
  /** 主体背景色(默认 '#3C3C3C') */
160
186
  backgroundColor?: string;
161
- flowOptions?: IFlowConfig;
187
+ /** 多工位层配置数组(一层=一个工位组) */
188
+ stationSlotGroups?: IPalletLayerConfig[];
189
+ /** 兼容旧配置:托盘工位组(无 stationSlotGroups 时迁移为第 1 层) */
162
190
  stationSlotGroupPallet?: IStationSlotGroupConfig;
191
+ /** 兼容旧配置:刀具工位组(无 stationSlotGroups 时迁移为第 2 层) */
163
192
  stationSlotGroupTool?: IStationSlotGroupConfig;
164
193
  linkEquipId?: string;
194
+ /** 扩展工位宿主设备 ID(业务 rawData.id):绑定后本托盘工位并入宿主设备的工位编号空间(合并编号),资源寻址宿主越界时顺延落到本托盘;与宿主共用 device_id 时资源增删寻址逻辑合并(视觉上仍独立) */
195
+ extendHostId?: string;
165
196
  }
166
197
  /**
167
198
  * 资源操作窗口(独立设备)
@@ -174,8 +205,9 @@ export interface IResourceOperationWindowConfig extends IModel {
174
205
  backgroundColor?: string;
175
206
  /** 环状矩形边框厚度(默认 10) */
176
207
  ringThickness?: number;
177
- /** 单一工位组配置(框内托盘,槽位 resourceType 可为 Pallet / Tool */
208
+ /** 兼容旧配置:单一工位组配置(框内托盘,槽位 resourceType 可为 Pallet / Tool;无 stationSlotGroups 时迁移为第 1 层) */
178
209
  stationSlotGroup?: IStationSlotGroupConfig;
210
+ stationSlotGroups?: IStationSlotLayerConfig[];
179
211
  }
180
212
  /**
181
213
  * 设备层联合类型
@@ -1,16 +1,33 @@
1
1
  import { EnumModel, EnumResourceType } from '../enums';
2
2
  import { IRowData } from '../base.types';
3
- import { ILightOperating, IProgressOperating, IEntranceOperating, IResourceOperating } from '../components/operating.types';
3
+ import { ILightOperating, IProgressOperating, IPassageOperating, IResourceOperating } from '../components/operating.types';
4
4
  /** 操作类型:model 画布模型操作;resource 全局资源操作;resetAll 全部复位操作 */
5
5
  export type EnumOperatingType = 'model' | 'resource' | 'resetAll';
6
6
  /**
7
- * 设备运转基类
7
+ * 设备空间状态(内部 operating 表示:位移字段为画布像素值,角度字段为度;均直接赋值)
8
+ * 协议层(socket position,比例值)经代理器/分发器换算后写入本对象
9
+ */
10
+ export interface IPositionOperating {
11
+ x?: number;
12
+ y?: number;
13
+ z?: number;
14
+ j1?: number;
15
+ j2?: number;
16
+ fork_xy?: number;
17
+ fork_z?: number;
18
+ }
19
+ /**
20
+ * 设备运转基类(业务字段均为「缺失即跳过」语义:未携带的字段不设置,保持模型当前状态)
8
21
  */
9
22
  export interface IModelOperating {
10
23
  operatingType?: 'model';
11
24
  id: string;
12
25
  className: EnumModel;
13
- rawData: IRowData;
26
+ /** 设备工位序号:同 id 多实例(同设备多工位 UI)时的目标实例消歧;缺省时回退 resource.device_station */
27
+ device_station?: number;
28
+ /** 设备状态(协议 device_state 状态码;画布默认不做任何处理,由使用方按需在代理器自行配置映射) */
29
+ device_state?: number;
30
+ raw_data: IRowData;
14
31
  resource?: IResourceOperating;
15
32
  }
16
33
  /**
@@ -21,14 +38,14 @@ export interface IGlobalResourceOperating {
21
38
  handleType: 'batchRemove';
22
39
  resourceType?: EnumResourceType;
23
40
  resourceIds: string[];
24
- rawData: IRowData;
41
+ raw_data: IRowData;
25
42
  }
26
43
  /**
27
44
  * 全部复位操作(不绑定具体设备,画布所有模型按初始配置重建,与「一键复位画布」一致)
28
45
  */
29
46
  export interface IResetAllOperating {
30
47
  operatingType: 'resetAll';
31
- rawData?: IRowData;
48
+ raw_data?: IRowData;
32
49
  }
33
50
  /**
34
51
  * 机床运转状态
@@ -37,10 +54,11 @@ export interface IMachineToolOperating extends IModelOperating {
37
54
  className: EnumModel.MACHINE_TOOL;
38
55
  light?: ILightOperating;
39
56
  progress?: IProgressOperating;
40
- entrance?: IEntranceOperating;
41
- stationRotatable?: boolean;
57
+ passage?: IPassageOperating;
58
+ /** 工位旋转增量(度):叠加在机床配置的工位容器方向角之上 */
59
+ station_rotation?: number;
42
60
  /** 是否工作中:为 true 时工位容器玻璃背景呼吸闪动(默认 false) */
43
- isWorking?: boolean;
61
+ is_working?: boolean;
44
62
  }
45
63
  /**
46
64
  * 装载站运转状态
@@ -49,8 +67,7 @@ export interface ILoadingStationOperating extends IModelOperating {
49
67
  className: EnumModel.LOADING_STATION;
50
68
  light?: Omit<ILightOperating, 'rotating'>;
51
69
  progress?: IProgressOperating;
52
- entrance?: IEntranceOperating;
53
- stationRotatable?: boolean;
70
+ passage?: IPassageOperating;
54
71
  }
55
72
  /**
56
73
  * 接驳站运转状态
@@ -58,21 +75,15 @@ export interface ILoadingStationOperating extends IModelOperating {
58
75
  export interface IShuttleStationOperating extends IModelOperating {
59
76
  className: EnumModel.SHUTTLE_STATION;
60
77
  light?: Omit<ILightOperating, 'rotating'>;
61
- /** 各层工位组状态灯颜色,键为层索引(1-based),值为状态码或颜色字符串
62
- * 代理器 dictColorMap / objDict 转换后值为颜色字符串;未转换时值为状态数字码
63
- * 如 { 1: 'red', 2: 100, 3: 'green' }
64
- */
65
- layerLightColor?: Record<number, number | string>;
66
- /**
67
- * 各层工位组状态灯闪烁,键为层索引(1-based),值为是否闪烁(配合 layerLightColor 状态灯使用)
68
- * 如 { 1: false, 2: true, 3: true }
69
- */
70
- layerLightBlinking?: Record<number, boolean>;
71
- /**
72
- * 各层工位组显示状态,键为层索引(1-based),值为是否可见(通过工位组 visible 属性显隐)
73
- * 如 { 1: true, 2: false, 3: true }
74
- */
75
- layerVisible?: Record<number, boolean>;
78
+ /** 各层工位组状态灯颜色,键为层索引(1-based),值为颜色字符串或字典值
79
+ * { 1: '#FF4444', 2: '#00FF7F' } */
80
+ layer_light_colors?: Record<number, string>;
81
+ /** 各层工位组状态灯闪烁,键为层索引(1-based)
82
+ * 如 { 1: false, 2: true, 3: true } */
83
+ layer_light_blinking?: Record<number, boolean>;
84
+ /** 各层工位组显示状态,键为层索引(1-based),值为是否可见
85
+ * 如 { 1: true, 2: false, 3: true } */
86
+ layer_visible?: Record<number, boolean>;
76
87
  }
77
88
  /**
78
89
  * 料道运转状态
@@ -80,15 +91,8 @@ export interface IShuttleStationOperating extends IModelOperating {
80
91
  export interface IMaterialTrackOperating extends IModelOperating {
81
92
  className: EnumModel.MATERIAL_TRACK;
82
93
  light?: Omit<ILightOperating, 'rotating'>;
83
- /** 各层工位组显示状态,键为层索引(1-based),值为是否可见(通过工位组 visible 属性显隐) */
84
- layerVisible?: Record<number, boolean>;
85
- }
86
- /**
87
- * 打标机站点状态
88
- */
89
- export interface ILaserSiteState {
90
- site: number;
91
- active: boolean;
94
+ /** 各层工位组显示状态,键为层索引(1-based),值为是否可见 */
95
+ layer_visible?: Record<number, boolean>;
92
96
  }
93
97
  /**
94
98
  * 打标机运转状态
@@ -97,8 +101,10 @@ export interface IMarkingMachineOperating extends IModelOperating {
97
101
  className: EnumModel.MARKING_MACHINE;
98
102
  light?: Omit<ILightOperating, 'rotating'>;
99
103
  progress?: IProgressOperating;
100
- entrance?: IEntranceOperating;
101
- laserSiteNumberArray?: ILaserSiteState[];
104
+ passage?: IPassageOperating;
105
+ /** 各激光工位是否打标中,键为工位序号(1-based),值为是否激活
106
+ * 如 { 1: true, 2: false } */
107
+ marking_sites?: Record<number, boolean>;
102
108
  }
103
109
  /**
104
110
  * 清洗机运转状态
@@ -107,9 +113,9 @@ export interface ICleaningMachineOperating extends IModelOperating {
107
113
  className: EnumModel.CLEANING_MACHINE;
108
114
  light?: Omit<ILightOperating, 'rotating'>;
109
115
  progress?: IProgressOperating;
110
- entrance?: IEntranceOperating;
116
+ passage?: IPassageOperating;
111
117
  /** 是否工作中:为 true 时显示工位容器内的波浪流动效果(默认 false) */
112
- isWorking?: boolean;
118
+ is_working?: boolean;
113
119
  }
114
120
  /**
115
121
  * 单关节机器人运转状态
@@ -117,10 +123,10 @@ export interface ICleaningMachineOperating extends IModelOperating {
117
123
  export interface ISingleJointRobotOperating extends IModelOperating {
118
124
  className: EnumModel.SINGLE_JOINT_ROBOT;
119
125
  light?: ILightOperating;
120
- x?: number;
121
- y?: number;
122
- j1?: number;
123
- currentFixture?: EnumResourceType;
126
+ /** 空间状态(位移 + 关节,见 IPositionOperating) */
127
+ position?: IPositionOperating;
128
+ /** 当前夹持资源类型(none = 空夹具) */
129
+ current_fixture?: EnumResourceType | 'none';
124
130
  }
125
131
  /**
126
132
  * 双关节机器人运转状态
@@ -128,11 +134,10 @@ export interface ISingleJointRobotOperating extends IModelOperating {
128
134
  export interface IDoubleJointRobotOperating extends IModelOperating {
129
135
  className: EnumModel.DOUBLE_JOINT_ROBOT;
130
136
  light?: ILightOperating;
131
- x?: number;
132
- y?: number;
133
- j1?: number;
134
- j2?: number;
135
- currentFixture?: EnumResourceType;
137
+ /** 空间状态(位移 + j1/j2 关节,见 IPositionOperating) */
138
+ position?: IPositionOperating;
139
+ /** 当前夹持资源类型(none = 空夹具) */
140
+ current_fixture?: EnumResourceType | 'none';
136
141
  }
137
142
  /**
138
143
  * RGV运转状态
@@ -140,45 +145,34 @@ export interface IDoubleJointRobotOperating extends IModelOperating {
140
145
  export interface IRGVOperating extends IModelOperating {
141
146
  className: EnumModel.RGV;
142
147
  light?: ILightOperating;
143
- x?: number;
144
- j1?: number;
145
- forkXY?: number;
146
- forkZ?: number;
148
+ /** 空间状态(沿轨道位移 + 车体角度 + 货叉,见 IPositionOperating) */
149
+ position?: IPositionOperating;
147
150
  }
148
151
  /**
149
- * 轨道运转状态
152
+ * 轨道运转状态(已移除:拖链定位由画布内部联动驱动——设备移动时逐帧跟随,
153
+ * 不再提供 socket 消息驱动的入口,避免消息侧携带其他设备 id(botId)实现联动)
150
154
  */
151
- export interface IRailOperating extends IModelOperating {
152
- className: EnumModel.RAIL;
153
- x?: number;
154
- botId?: string;
155
- }
156
155
  /**
157
156
  * 资源库运转状态
158
157
  */
159
158
  export interface IResourceStoreOperating extends IModelOperating {
160
159
  className: EnumModel.RESOURCE_STORE;
161
160
  light?: ILightOperating;
162
- x?: number;
161
+ /** 空间状态(沿轨道位移,见 IPositionOperating) */
162
+ position?: IPositionOperating;
163
163
  resource?: IResourceOperating;
164
- /** 各工位背景颜色,键为工位序号 index(1-based),值为状态码或颜色字符串
165
- * 代理器转换后值为颜色字符串;未转换时值为状态数字码(内部映射为颜色)
166
- * 如 { 1: 'red', 2: 100, 3: '#66DC7A' } */
167
- stationColor?: Record<number, number | string>;
168
164
  }
169
165
  /**
170
- * 托盘运转状态
166
+ * 通用托盘运转状态
167
+ * resource 支持多层工位组:通过 resource.device_layer(1-based)定位到指定层;
168
+ * 未传入 layer 时默认识别为第一层。
171
169
  */
172
170
  export interface IPalletOperating extends IModelOperating {
173
171
  className: EnumModel.PALLET;
174
172
  light?: ILightOperating;
175
- x?: number;
176
- y?: number;
173
+ /** 空间状态(沿 X/Y 轴位移,见 IPositionOperating) */
174
+ position?: IPositionOperating;
177
175
  resource?: IResourceOperating;
178
- /** 各工位背景颜色,键为工位序号 index(1-based),值为状态码或颜色字符串
179
- * 代理器转换后值为颜色字符串;未转换时值为状态数字码(内部映射为颜色)
180
- * 如 { 1: 'red', 2: 100, 3: '#66DC7A' } */
181
- stationColor?: Record<number, number | string>;
182
176
  }
183
177
  /**
184
178
  * 资源操作窗口运转状态
@@ -187,12 +181,8 @@ export interface IResourceOperationWindowOperating extends IModelOperating {
187
181
  className: EnumModel.RESOURCE_OPERATION_WINDOW;
188
182
  light?: Omit<ILightOperating, 'rotating'>;
189
183
  resource?: IResourceOperating;
190
- /** 各工位背景颜色,键为工位序号 index(1-based),值为状态码或颜色字符串
191
- * 代理器转换后值为颜色字符串;未转换时值为状态数字码(内部映射为颜色)
192
- * 如 { 1: 'red', 2: 100, 3: '#66DC7A' } */
193
- stationColor?: Record<number, number | string>;
194
184
  }
195
185
  /**
196
186
  * 设备层运转状态的联合类型
197
187
  */
198
- export type ILayerOperating = IMachineToolOperating | ILoadingStationOperating | IShuttleStationOperating | IMaterialTrackOperating | IMarkingMachineOperating | ICleaningMachineOperating | ISingleJointRobotOperating | IDoubleJointRobotOperating | IRGVOperating | IRailOperating | IResourceStoreOperating | IPalletOperating | IResourceOperationWindowOperating | IGlobalResourceOperating | IResetAllOperating;
188
+ export type ILayerOperating = IMachineToolOperating | ILoadingStationOperating | IShuttleStationOperating | IMaterialTrackOperating | IMarkingMachineOperating | ICleaningMachineOperating | ISingleJointRobotOperating | IDoubleJointRobotOperating | IRGVOperating | IResourceStoreOperating | IPalletOperating | IResourceOperationWindowOperating | IGlobalResourceOperating | IResetAllOperating;