@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.
- package/AGENTS.md +281 -348
- package/dist/components/debug/DataLogPanel.vue.d.ts +29 -3
- package/dist/components/debug/PerformanceStats.vue.d.ts +1 -1
- package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +1 -2
- package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +4 -2
- package/dist/components/debug/ScriptRunner/index.vue.d.ts +11 -0
- package/dist/components/debug/ScriptRunner/script.d.ts +140 -41
- package/dist/components/debug/ScriptRunner/scriptFile.d.ts +92 -0
- package/dist/components/debug/WsProxy/index.vue.d.ts +10 -8
- package/dist/components/debug/WsProxy/proxy.d.ts +114 -53
- package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +18 -2
- package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +2 -2
- package/dist/components/editor/ControlBar/PersistDialog.vue.d.ts +9 -0
- package/dist/components/index.js +8419 -6045
- package/dist/components/preview/index.vue.d.ts +6852 -4876
- package/dist/controller/AppController.d.ts +75 -4
- package/dist/controller/SocketDispatcher.d.ts +59 -0
- package/dist/fullscreen-BA3oea8O.js +53 -0
- package/dist/index-C6Liz-8o.js +1238 -0
- package/dist/index.js +36 -27
- package/dist/lingshu-smart/cases.json +5890 -14828
- package/dist/lingshu-smart/mockSocket.json +263 -0
- package/dist/lingshu-smart/wsProxyConfig.json +343 -720
- package/dist/playground/ViewPageDemo.vue.d.ts +14412 -10438
- package/dist/stores/index.js +1 -1
- package/dist/stores/useAppStore.d.ts +20570 -14641
- package/dist/stores/useDataStore.d.ts +21139 -14587
- package/dist/stores/useDebugStore.d.ts +14 -2
- package/dist/stores/useEditorStore.d.ts +3 -3
- package/dist/types/app.types.d.ts +1 -1
- package/dist/types/components/config.types.d.ts +16 -0
- package/dist/types/components/operating.types.d.ts +28 -19
- package/dist/types/enums.d.ts +22 -2
- package/dist/types/guards.d.ts +4 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/config.types.d.ts +41 -9
- package/dist/types/models/operating.types.d.ts +64 -74
- package/dist/types/socket.types.d.ts +275 -0
- package/dist/ui/abstract/ModelAbs.d.ts +42 -2
- package/dist/ui/components/Resource.d.ts +0 -1
- package/dist/ui/components/StationSlot.d.ts +8 -2
- package/dist/ui/components/StationSlotGroup.d.ts +28 -3
- package/dist/ui/models/DoubleJointRobot.d.ts +16 -4
- package/dist/ui/models/MachineTool.d.ts +6 -2
- package/dist/ui/models/MaterialTrack.d.ts +14 -2
- package/dist/ui/models/Pallet.d.ts +29 -9
- package/dist/ui/models/Rail.d.ts +9 -2
- package/dist/ui/models/ResourceOperationWindow.d.ts +2 -1
- package/dist/ui/models/ResourceStore.d.ts +7 -5
- package/dist/ui/models/Rgv.d.ts +6 -6
- package/dist/ui/models/ShuttleStation.d.ts +14 -4
- package/dist/ui/models/SingleJointRobot.d.ts +14 -4
- package/dist/ui/utils/resolveStationSlotLayers.d.ts +20 -0
- package/dist/ui/utils/resolveTypeStyle.d.ts +13 -0
- package/dist/useAppStore-DASwAOBy.js +7223 -0
- package/dist/utils/fullscreen.d.ts +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vite.d.ts +15 -0
- package/dist/vite.js +39 -0
- package/package.json +6 -2
- package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupBoth.vue.d.ts +0 -2
- package/dist/guards-aLOXCeCF.js +0 -35
- package/dist/index-Dsgrnpn0.js +0 -1186
- package/dist/useAppStore-CVyLAMtL.js +0 -6125
- /package/dist/components/editor/OptionCard/Equipment/{stationSlot/StationSlotGroup.vue.d.ts → models/ResourceStore.vue.d.ts} +0 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { EnumDeviceType, EnumResourceType } from './enums';
|
|
2
|
+
/** 消息类型(envelope.type 固定值) */
|
|
3
|
+
export declare enum EnvelopeType {
|
|
4
|
+
DeviceInit = "device_init",
|
|
5
|
+
DeviceCommand = "device_command",
|
|
6
|
+
ResourceCommand = "resource_command",
|
|
7
|
+
AlarmPush = "alarm_push",
|
|
8
|
+
RuntimeStatusPush = "runtime_status_push",
|
|
9
|
+
SceneReset = "scene_reset",
|
|
10
|
+
CommandAck = "command_ack"
|
|
11
|
+
}
|
|
12
|
+
/** 消息信封 */
|
|
13
|
+
export interface MessageEnvelope {
|
|
14
|
+
/** 消息唯一 ID,画布按此去重 */
|
|
15
|
+
id: string;
|
|
16
|
+
/** 消息类型,必填、无缺省值 */
|
|
17
|
+
type: EnvelopeType;
|
|
18
|
+
/** ISO 8601 时间戳,用于排序与防乱序 */
|
|
19
|
+
timestamp: string;
|
|
20
|
+
/** 场景 ID:区分不同场地下的孪生场景 */
|
|
21
|
+
case_id?: string;
|
|
22
|
+
}
|
|
23
|
+
/** 业务消息 = 信封 + 数据体 */
|
|
24
|
+
export interface SocketMessage<T extends object = object> {
|
|
25
|
+
envelope: MessageEnvelope;
|
|
26
|
+
payload: T;
|
|
27
|
+
}
|
|
28
|
+
/** 状态灯 */
|
|
29
|
+
export interface SocketLight {
|
|
30
|
+
/** 颜色字符串或字典值(见文档第十五章);缺失时沿用当前颜色 */
|
|
31
|
+
color?: string;
|
|
32
|
+
/** 闪烁;仅 === true 视为开启 */
|
|
33
|
+
blinking?: boolean;
|
|
34
|
+
/** 旋转;仅机器人 / RGV / 资源库 / 托盘支持 */
|
|
35
|
+
rotating?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** 进度条 */
|
|
38
|
+
export interface SocketProgress {
|
|
39
|
+
/** 进度比例 0 ~ 1(非百分数) */
|
|
40
|
+
percent?: number;
|
|
41
|
+
/** 进度文本 */
|
|
42
|
+
text?: string;
|
|
43
|
+
}
|
|
44
|
+
/** 出入口通道 */
|
|
45
|
+
export interface SocketPassage {
|
|
46
|
+
in?: boolean;
|
|
47
|
+
out?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** 设备空间状态(位移 + 关节 + 货叉统一收敛,均可独立下发)
|
|
50
|
+
* 位移字段为比例值 [0,1],角度字段单位为度(°) */
|
|
51
|
+
export interface Position {
|
|
52
|
+
/** X 轴位移比例 [0, 1] */
|
|
53
|
+
x?: number;
|
|
54
|
+
/** Y 轴位移比例 [0, 1] */
|
|
55
|
+
y?: number;
|
|
56
|
+
/** Z 轴位移比例 [0, 1](按设备类型可选支持) */
|
|
57
|
+
z?: number;
|
|
58
|
+
/** 一级关节 / 车体旋转角度(度):机器人 / RGV */
|
|
59
|
+
j1?: number;
|
|
60
|
+
/** 二级关节角度(度):双关节机器人 */
|
|
61
|
+
j2?: number;
|
|
62
|
+
/** 货叉横向移动比例 [0, 1]:RGV */
|
|
63
|
+
fork_xy?: number;
|
|
64
|
+
/** 货叉上下移动比例 [0, 1]:RGV */
|
|
65
|
+
fork_z?: number;
|
|
66
|
+
}
|
|
67
|
+
/** 资源类型(resource_type) */
|
|
68
|
+
export { EnumResourceType as ResourceType };
|
|
69
|
+
/** 资源位置(三级坐标:设备 → 层 → 工位) */
|
|
70
|
+
export interface ResourceLocation {
|
|
71
|
+
/** 设备类型(校验用) */
|
|
72
|
+
device_type?: EnumDeviceType;
|
|
73
|
+
/** 所在设备 ID */
|
|
74
|
+
device_id: string;
|
|
75
|
+
/** 设备层索引(1-based),多层设备定位层;缺省第 1 层 */
|
|
76
|
+
device_layer?: number;
|
|
77
|
+
/** 设备工位序号(1-based),缺省该设备第一个可用工位 */
|
|
78
|
+
device_station?: number;
|
|
79
|
+
}
|
|
80
|
+
/** 资源实体(画布侧由对象资源池统一管理) */
|
|
81
|
+
export interface ResourceEntity {
|
|
82
|
+
resource_id: string;
|
|
83
|
+
resource_type: EnumResourceType;
|
|
84
|
+
resource_name?: string;
|
|
85
|
+
resource_state?: number;
|
|
86
|
+
/** 显示颜色:服务端可显式下发时使用;未下发时不预设(前端不做 resource_state → 颜色映射,如需映射请在代理器手动配置) */
|
|
87
|
+
resource_color?: string;
|
|
88
|
+
location: ResourceLocation | null;
|
|
89
|
+
}
|
|
90
|
+
/** 资源生命周期操作 */
|
|
91
|
+
export declare enum ResourceOperation {
|
|
92
|
+
Add = "add",
|
|
93
|
+
BatchAdd = "batch_add",
|
|
94
|
+
Transfer = "transfer",
|
|
95
|
+
Remove = "remove",
|
|
96
|
+
BatchRemove = "batch_remove"
|
|
97
|
+
}
|
|
98
|
+
/** batch_add 的资源项 */
|
|
99
|
+
export interface ResourceAddItem {
|
|
100
|
+
resource_id: string;
|
|
101
|
+
resource_type: EnumResourceType;
|
|
102
|
+
resource_name?: string;
|
|
103
|
+
resource_state?: number;
|
|
104
|
+
/** 显示颜色(可选):显式下发时优先;未下发时按 resource_state 字典映射 */
|
|
105
|
+
resource_color?: string;
|
|
106
|
+
to: ResourceLocation;
|
|
107
|
+
}
|
|
108
|
+
/** 机床业务字段 */
|
|
109
|
+
export interface MachineToolFields {
|
|
110
|
+
/** 工位旋转增量(度):叠加在机床配置的工位容器方向角之上 */
|
|
111
|
+
station_rotation?: number;
|
|
112
|
+
/** 工作中(工位玻璃背景呼吸闪动) */
|
|
113
|
+
is_working?: boolean;
|
|
114
|
+
}
|
|
115
|
+
/** 接驳站业务字段 */
|
|
116
|
+
export interface ShuttleStationFields {
|
|
117
|
+
/** 各层状态灯颜色,键为层索引(1-based),值为颜色字符串或字典值 */
|
|
118
|
+
layer_light_colors?: Record<number, string>;
|
|
119
|
+
/** 各层状态灯闪烁,键为层索引(1-based) */
|
|
120
|
+
layer_light_blinking?: Record<number, boolean>;
|
|
121
|
+
/** 各层显隐,键为层索引(1-based) */
|
|
122
|
+
layer_visible?: Record<number, boolean>;
|
|
123
|
+
}
|
|
124
|
+
/** 打标机业务字段 */
|
|
125
|
+
export interface MarkingMachineFields {
|
|
126
|
+
/** 各激光工位是否打标中,键为工位序号(1-based) */
|
|
127
|
+
marking_sites?: Record<number, boolean>;
|
|
128
|
+
}
|
|
129
|
+
/** device_command payload 公共字段 */
|
|
130
|
+
export interface DeviceCommandPayload {
|
|
131
|
+
device_type: EnumDeviceType;
|
|
132
|
+
device_id: string;
|
|
133
|
+
/** 同设备多实例(多工位 UI)时指定目标实例;缺省广播至全部实例 */
|
|
134
|
+
device_station?: number;
|
|
135
|
+
/** 原始业务数据(透传,供点击回调读取) */
|
|
136
|
+
raw_data?: object;
|
|
137
|
+
/** 设备状态(状态码);画布默认不做处理,由使用方按需在代理器自行配置映射 */
|
|
138
|
+
device_state?: number;
|
|
139
|
+
light?: SocketLight;
|
|
140
|
+
progress?: SocketProgress;
|
|
141
|
+
passage?: SocketPassage;
|
|
142
|
+
position?: Position;
|
|
143
|
+
/** 机床:工位旋转增量(度),叠加在机床配置的工位容器方向角之上 */
|
|
144
|
+
station_rotation?: number;
|
|
145
|
+
/** 机床 / 清洗机:工作中 */
|
|
146
|
+
is_working?: boolean;
|
|
147
|
+
/** 接驳站:层状态 */
|
|
148
|
+
layer_light_colors?: Record<number, string>;
|
|
149
|
+
layer_light_blinking?: Record<number, boolean>;
|
|
150
|
+
layer_visible?: Record<number, boolean>;
|
|
151
|
+
/** 料道:层显隐 */
|
|
152
|
+
/** 打标机:激光工位 */
|
|
153
|
+
marking_sites?: Record<number, boolean>;
|
|
154
|
+
/** 机器人:当前夹持资源类型(none = 空夹具) */
|
|
155
|
+
current_fixture?: EnumResourceType | 'none';
|
|
156
|
+
}
|
|
157
|
+
/** resource_command payload(按 operation 判别联合) */
|
|
158
|
+
export type ResourceCommandPayload = {
|
|
159
|
+
operation: ResourceOperation.Add;
|
|
160
|
+
resource_id: string;
|
|
161
|
+
resource_type: EnumResourceType;
|
|
162
|
+
to: ResourceLocation;
|
|
163
|
+
resource_name?: string;
|
|
164
|
+
resource_state?: number;
|
|
165
|
+
/** 显示颜色(可选):显式下发时优先;未下发时按 resource_state 字典映射 */
|
|
166
|
+
resource_color?: string;
|
|
167
|
+
} | {
|
|
168
|
+
operation: ResourceOperation.BatchAdd;
|
|
169
|
+
resources: ResourceAddItem[];
|
|
170
|
+
} | {
|
|
171
|
+
operation: ResourceOperation.Transfer;
|
|
172
|
+
resource_id: string;
|
|
173
|
+
resource_type: EnumResourceType;
|
|
174
|
+
from?: ResourceLocation;
|
|
175
|
+
to: ResourceLocation;
|
|
176
|
+
/** 资源名称/状态:资源池实体缺登记时作为前端兜底来源(可选,见文档 8.2) */
|
|
177
|
+
resource_name?: string;
|
|
178
|
+
resource_state?: number;
|
|
179
|
+
/** 显示颜色(可选):显式下发时优先;未下发时按 resource_state 字典映射 */
|
|
180
|
+
resource_color?: string;
|
|
181
|
+
} | {
|
|
182
|
+
operation: ResourceOperation.Remove;
|
|
183
|
+
resource_id: string;
|
|
184
|
+
resource_type?: EnumResourceType;
|
|
185
|
+
} | {
|
|
186
|
+
operation: ResourceOperation.BatchRemove;
|
|
187
|
+
resource_ids: string[];
|
|
188
|
+
resource_type?: EnumResourceType;
|
|
189
|
+
};
|
|
190
|
+
/** 初始化资源项(隐含 add 语义) */
|
|
191
|
+
export interface ResourceInitItem {
|
|
192
|
+
resource_type: EnumResourceType;
|
|
193
|
+
resource_id: string;
|
|
194
|
+
/** 设备层索引(1-based),缺省第 1 层 */
|
|
195
|
+
device_layer?: number;
|
|
196
|
+
/** 设备工位序号(1-based),缺省该设备第一个可用工位 */
|
|
197
|
+
device_station?: number;
|
|
198
|
+
resource_name?: string;
|
|
199
|
+
resource_state?: number;
|
|
200
|
+
/** 显示颜色(可选):显式下发时优先;未下发时按 resource_state 字典映射 */
|
|
201
|
+
resource_color?: string;
|
|
202
|
+
}
|
|
203
|
+
/** 初始化设备项:结构同 device_command 各设备 payload + resources */
|
|
204
|
+
export interface DeviceInitItem {
|
|
205
|
+
device_type: EnumDeviceType;
|
|
206
|
+
device_id: string;
|
|
207
|
+
/** 同设备多实例时指定目标实例;缺省初始化该设备全部实例 */
|
|
208
|
+
device_station?: number;
|
|
209
|
+
/** 设备状态(状态码);画布默认不做处理,由使用方按需在代理器自行配置映射 */
|
|
210
|
+
device_state?: number;
|
|
211
|
+
light?: SocketLight;
|
|
212
|
+
progress?: SocketProgress;
|
|
213
|
+
passage?: SocketPassage;
|
|
214
|
+
position?: Position;
|
|
215
|
+
/** 机床:工位旋转增量(度),叠加在机床配置的工位容器方向角之上 */
|
|
216
|
+
station_rotation?: number;
|
|
217
|
+
is_working?: boolean;
|
|
218
|
+
layer_light_colors?: Record<number, string>;
|
|
219
|
+
layer_light_blinking?: Record<number, boolean>;
|
|
220
|
+
layer_visible?: Record<number, boolean>;
|
|
221
|
+
marking_sites?: Record<number, boolean>;
|
|
222
|
+
current_fixture?: EnumResourceType | 'none';
|
|
223
|
+
/** 初始资源实体列表 */
|
|
224
|
+
resources?: ResourceInitItem[];
|
|
225
|
+
}
|
|
226
|
+
/** device_init payload */
|
|
227
|
+
export interface DeviceInitPayload {
|
|
228
|
+
devices: DeviceInitItem[];
|
|
229
|
+
}
|
|
230
|
+
/** 告警推送 */
|
|
231
|
+
export interface AlarmPushPayload {
|
|
232
|
+
alarm_id: string;
|
|
233
|
+
device_type?: EnumDeviceType;
|
|
234
|
+
device_id?: string;
|
|
235
|
+
device_name?: string;
|
|
236
|
+
alarm_level: 'critical' | 'warning' | 'info';
|
|
237
|
+
alarm_type: string;
|
|
238
|
+
alarm_message: string;
|
|
239
|
+
current_value?: number;
|
|
240
|
+
threshold_value?: number;
|
|
241
|
+
status?: 'pending' | 'acknowledged' | 'resolved';
|
|
242
|
+
create_time: number;
|
|
243
|
+
ack_time?: number | null;
|
|
244
|
+
resolve_time?: number | null;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* 运行状态推送
|
|
248
|
+
* 说明:本 payload 的字段**全部由后端自定**——确定推送哪些字段、何时推送(状态变化时推送或后端自定周期)由后端决定;
|
|
249
|
+
* 画布不做强校验、不轮询,也**不直接消费**:经 WsProxy「全局操作类 → 全局运行状态推送」规则手动映射后
|
|
250
|
+
* (映射产物不进入画布)交给页面全局状态信息 bar 消费。
|
|
251
|
+
* 下列字段仅为示例:`current_task` 演示普通(标量)字段传递,`device_stats` 演示嵌套(对象)字段传递
|
|
252
|
+
*/
|
|
253
|
+
export interface RuntimeStatusPushPayload {
|
|
254
|
+
/** 当前任务播报(面向人的一句话描述,如「单抓机器人 搬运 工件2 至 机床1 中…」)——普通字段传递示例 */
|
|
255
|
+
current_task?: string;
|
|
256
|
+
/** 设备统计(对象)——嵌套字段传递示例,层级与字段名由后端自定 */
|
|
257
|
+
device_stats?: Record<string, unknown>;
|
|
258
|
+
/** 其余业务字段原样透传(后端可自由增减) */
|
|
259
|
+
[key: string]: unknown;
|
|
260
|
+
}
|
|
261
|
+
/** 场景复位 payload(空) */
|
|
262
|
+
export interface SceneResetPayload {
|
|
263
|
+
}
|
|
264
|
+
/** 指令处理回执(画布 → 后端) */
|
|
265
|
+
export interface CommandAckPayload {
|
|
266
|
+
/** 被回执的原消息 envelope.id */
|
|
267
|
+
envelope_id: string;
|
|
268
|
+
/** 处理结果码:0 成功 / 400 参数错误 / 404 未匹配 / 409 类型不匹配 / 500 异常 */
|
|
269
|
+
code: number;
|
|
270
|
+
message?: string;
|
|
271
|
+
}
|
|
272
|
+
/** device_type (snake_case) → 内部画布模型 className(EnumModel PascalCase) */
|
|
273
|
+
export declare const DEVICE_TYPE_TO_MODEL: Record<EnumDeviceType, string>;
|
|
274
|
+
/** 内部画布模型 className(EnumModel PascalCase)→ device_type(snake_case) */
|
|
275
|
+
export declare const MODEL_TO_DEVICE_TYPE: Record<string, EnumDeviceType>;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import { ILayer, IEventHandler, ILayerOperating } from '../../types';
|
|
1
|
+
import { ILayer, InteractiveUi, IEventHandler, ILayerOperating, EnumResourceType } from '../../types';
|
|
2
2
|
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
3
|
+
import { AppController } from '../../controller/AppController';
|
|
3
4
|
import { BaseAbs } from './BaseAbs';
|
|
4
5
|
export declare abstract class ModelAbs<T extends ILayer = ILayer> extends BaseAbs<T> {
|
|
5
|
-
|
|
6
|
+
protected eventHandler: IEventHandler | null;
|
|
7
|
+
/**
|
|
8
|
+
* 画布控制器引用(AppController.addModel 时注入,早于 init)
|
|
9
|
+
* 供子类反查画布全局信息(如扩展工位宿主设备),模型间不直接互相引用
|
|
10
|
+
*/
|
|
11
|
+
appController: AppController | null;
|
|
6
12
|
protected abstract operating(data: ILayerOperating): void;
|
|
13
|
+
/**
|
|
14
|
+
* 设备沿 x 移动的动画时长(秒)
|
|
15
|
+
* 托盘跟随等联动使用该值保持动画同步;子类可覆盖(如双关节机器人 0.5s)
|
|
16
|
+
*/
|
|
17
|
+
get moveDuration(): number;
|
|
7
18
|
handleOperation: (data: ILayerOperating) => void;
|
|
8
19
|
/**
|
|
9
20
|
* 将最近一次 operating 接收到的原始数据写入模型 config 及整棵 UI 树的 data 属性,
|
|
@@ -12,6 +23,11 @@ export declare abstract class ModelAbs<T extends ILayer = ILayer> extends BaseAb
|
|
|
12
23
|
private writeOperatingData;
|
|
13
24
|
private shouldHandleInteraction;
|
|
14
25
|
private tapCallback;
|
|
26
|
+
/**
|
|
27
|
+
* 点击回调分发(子类可覆盖以改写 layer / data,如扩展工位绑定模式下托盘点击需替换为宿主设备)
|
|
28
|
+
* 默认:layer 为模型自身 config,data 为实际命中元素的 data 属性
|
|
29
|
+
*/
|
|
30
|
+
protected emitTap(data: InteractiveUi): void;
|
|
15
31
|
private menuTapCallback;
|
|
16
32
|
private dragCallback;
|
|
17
33
|
setEventHandler(handler: IEventHandler): void;
|
|
@@ -24,6 +40,30 @@ export declare abstract class ModelAbs<T extends ILayer = ILayer> extends BaseAb
|
|
|
24
40
|
* 收集模型下所有工位槽组实例(子类覆盖;默认无)
|
|
25
41
|
*/
|
|
26
42
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
43
|
+
/**
|
|
44
|
+
* 判断模型是否存在指定序号的工位(任一工位组;多层设备按 device_layer 定位层,覆盖于子类)
|
|
45
|
+
*/
|
|
46
|
+
hasStationIndex(stationIndex: number, _deviceLayer?: number): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 判断指定工位是否可放置该资源类型(运行期资源类型强校验,见 socket-operating-api.md 4.3)
|
|
49
|
+
* 多工位组设备(如资源库的托盘组/刀具组)存在同序号工位时,任一组声明可放置即通过(与模型资源路由一致)
|
|
50
|
+
*/
|
|
51
|
+
acceptsResourceType(stationIndex: number, resourceType: EnumResourceType, _deviceLayer?: number): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 查找第一个可放置指定资源类型的工位序号(device_station 缺省时定位「第一个可用工位」,见文档 3.3)
|
|
54
|
+
*/
|
|
55
|
+
findFirstStationIndex(resourceType: EnumResourceType): number | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* 获取模型工位总数(扩展工位合并编号的偏移量计算用)
|
|
58
|
+
*/
|
|
59
|
+
getStationSlotCount(): number;
|
|
60
|
+
/**
|
|
61
|
+
* 获取指定工位槽中心的场景坐标(treeBox 本地坐标系,供 transfer 搬运动画规划路径)
|
|
62
|
+
*/
|
|
63
|
+
getStationSlotPoint(stationIndex: number, _deviceLayer?: number): {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
} | undefined;
|
|
27
67
|
/**
|
|
28
68
|
* 按 resourceId 移除模型下匹配的资源(供全局批量移除调用)
|
|
29
69
|
* @returns 是否至少移除了一个资源
|
|
@@ -22,12 +22,18 @@ export declare class StationSlot extends ComponentAbs<IStationSlotConfig> {
|
|
|
22
22
|
private syncResources;
|
|
23
23
|
protected createUi(): Box;
|
|
24
24
|
private get autoFixRotation();
|
|
25
|
-
private get autoCornerRadius();
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
26
|
+
* 添加工位资源
|
|
28
27
|
* @param d
|
|
29
28
|
*/
|
|
30
29
|
addPallet(d: IResourceOperating): void;
|
|
30
|
+
/**
|
|
31
|
+
* 资源数量门控:children 超过 maxResources(默认 5)时,
|
|
32
|
+
* 按放置顺序移除最早的资源(先进先出淘汰,保留最近 N 个),移除时播放退场动画
|
|
33
|
+
*/
|
|
34
|
+
private enforceMaxResources;
|
|
35
|
+
/** 播放资源退场动画,动画结束后销毁资源对象(供移除/裁剪共用) */
|
|
36
|
+
private animateOut;
|
|
31
37
|
/**
|
|
32
38
|
* 移除托盘:先播放退场动画,动画结束后再销毁资源对象
|
|
33
39
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Flow } from 'leafer';
|
|
2
|
-
import { IResourceOperating, IStationSlotGroupConfig } from '../../types';
|
|
2
|
+
import { IResourceOperating, IStationSlotGroupConfig, EnumResourceType } from '../../types';
|
|
3
3
|
import { ComponentAbs } from '../abstract/ComponentAbs';
|
|
4
4
|
/**
|
|
5
5
|
* 工位槽位组容器
|
|
@@ -32,11 +32,36 @@ export declare class StationSlotGroup extends ComponentAbs<IStationSlotGroupConf
|
|
|
32
32
|
/**
|
|
33
33
|
* 按工位序号修改工位填充颜色
|
|
34
34
|
* @param index 工位序号(IStationSlotConfig.index)
|
|
35
|
-
* @param color
|
|
35
|
+
* @param color 目标颜色字符串(状态码→颜色由消息侧完成);缺省时使用工位默认背景色
|
|
36
36
|
*/
|
|
37
|
-
setSiteWorkingColor(index: number, color?: string
|
|
37
|
+
setSiteWorkingColor(index: number, color?: string): void;
|
|
38
38
|
/**
|
|
39
39
|
* 判断本组是否包含指定工位序号
|
|
40
40
|
*/
|
|
41
41
|
hasStationIndex(index: number): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 获取本组工位总数(扩展工位合并编号的偏移量计算用)
|
|
44
|
+
*/
|
|
45
|
+
getStationCount(): number;
|
|
46
|
+
/**
|
|
47
|
+
* 查询指定工位声明的可放置资源类型(强校验用,见 socket-operating-api.md 4.3)
|
|
48
|
+
* @returns 工位存在时返回其 resourceType;工位不存在返回 undefined
|
|
49
|
+
*/
|
|
50
|
+
getStationResourceType(index: number): EnumResourceType | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* 判断指定工位是否可放置该资源类型(强校验用,见 socket-operating-api.md 4.3)
|
|
53
|
+
* 多工位组设备(如资源库的托盘组/刀具组)存在同序号工位时,任一组声明可放置即通过
|
|
54
|
+
*/
|
|
55
|
+
acceptsResourceType(index: number, resourceType: EnumResourceType): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 查找第一个可放置指定资源类型的工位序号(device_station 缺省时定位「第一个可用工位」,见文档 3.3)
|
|
58
|
+
*/
|
|
59
|
+
findFirstStationIndex(resourceType: EnumResourceType): number | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* 获取指定工位槽中心的场景坐标(treeBox 本地坐标系,供 transfer 搬运动画规划路径)
|
|
62
|
+
*/
|
|
63
|
+
getStationSlotPoint(index: number): {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
} | undefined;
|
|
42
67
|
}
|
|
@@ -12,16 +12,28 @@ export declare class DoubleJointRobot extends ModelAbs<IDoubleJointRobotConfig>
|
|
|
12
12
|
private light1;
|
|
13
13
|
private light2;
|
|
14
14
|
private defaultLightColor;
|
|
15
|
-
|
|
16
|
-
private
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/** 全部工位层工位组(一层=一组),挂载于唯一容器 #slotLayers,与夹具无关 */
|
|
16
|
+
private slotGroups;
|
|
17
|
+
/** 与 slotGroups 平行的层 index(1-based),用于夹具绑定层的显隐与资源层索引映射 */
|
|
18
|
+
private slotLayerIndexes;
|
|
19
|
+
get currentFixture(): EnumResourceType | 'none';
|
|
20
|
+
set currentFixture(type: EnumResourceType | 'none');
|
|
21
|
+
/** 移动动画时长:与 moveX 默认 0.5s 一致,供托盘跟随等联动同步 */
|
|
22
|
+
get moveDuration(): number;
|
|
19
23
|
protected createUi(): Box;
|
|
20
24
|
protected operating(data: IDoubleJointRobotOperating): void;
|
|
25
|
+
/** 资源路由(与夹具装饰无关):device_layer 层号优先(当前夹具绑定了层时以绑定层为索引基准),其次工位号(优先类型匹配),最后首个工位组 */
|
|
26
|
+
private findGroupForResource;
|
|
27
|
+
/** 层索引解析:当前夹具绑定了工位层时,以绑定层(按层号升序)为索引基准(device_layer=1 → 第一个绑定层);未绑定或越界时回退原始层号 */
|
|
28
|
+
private resolveBoundLayerIndex;
|
|
29
|
+
/** 应用夹具绑定的工位层显隐:绑定了层的夹具仅显示绑定层(保留各组 Display 配置),未绑定时显示全部层 */
|
|
30
|
+
private applyFixtureBindingVisibility;
|
|
21
31
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
22
32
|
private handleRotateR1;
|
|
23
33
|
private handleRotateR2;
|
|
24
34
|
private moveX;
|
|
25
35
|
private switchFork;
|
|
36
|
+
/** 设置托盘夹具状态:辅料夹具沿用工件夹具造型,压扁 + 直角 + 描边补偿,并补偿 y 使垂直中心对齐手抓关节 */
|
|
37
|
+
private setPalletFixture;
|
|
26
38
|
handleLoadResource(handleType: 'add' | 'remove'): void;
|
|
27
39
|
}
|
|
@@ -15,11 +15,15 @@ export declare class MachineTool extends ModelAbs<IMachineToolConfig> {
|
|
|
15
15
|
/** 工位容器玻璃背景(isWorking 时呼吸闪动) */
|
|
16
16
|
private glass;
|
|
17
17
|
private stationContainerBaseRotation;
|
|
18
|
-
|
|
18
|
+
/** 工位旋转增量(度):叠加在机床配置的工位容器方向角之上 */
|
|
19
|
+
private stationRotation;
|
|
19
20
|
protected createUi(): Box;
|
|
20
21
|
protected operating(data: IMachineToolOperating): void;
|
|
22
|
+
/**
|
|
23
|
+
* 工位旋转 = 机床配置的工位容器方向角 + station_rotation 增量(带 0.2s 过渡动画;动画关闭时直接赋值)
|
|
24
|
+
*/
|
|
25
|
+
private applyStationRotation;
|
|
21
26
|
/** 玻璃背景呼吸效果:工作中开启动画(明暗往复),结束恢复常亮 */
|
|
22
27
|
private setWorking;
|
|
23
28
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
24
|
-
private rotateStationContainerWithAnimation;
|
|
25
29
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { IMaterialTrackConfig, IMaterialTrackOperating } from '../../types';
|
|
1
|
+
import { IMaterialTrackConfig, IMaterialTrackOperating, EnumResourceType } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 料道(MaterialTrack)
|
|
6
7
|
* 参考接驳站的 U 型多层结构,主体为淡蓝色;
|
|
@@ -26,6 +27,17 @@ export declare class MaterialTrack extends ModelAbs<IMaterialTrackConfig> {
|
|
|
26
27
|
private buildLayers;
|
|
27
28
|
protected createUi(): Box;
|
|
28
29
|
protected operating(data: IMaterialTrackOperating): void;
|
|
29
|
-
/** 资源增删:data.resource 提供
|
|
30
|
+
/** 资源增删:data.resource 提供 device_layer(>0) 时定位到该层;缺省时仅当唯一一层包含该工位序号才操作 */
|
|
30
31
|
private handleResourceOperating;
|
|
32
|
+
/** 收集全部层工位槽组(供全局资源移除 / 工位查询遍历) */
|
|
33
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
34
|
+
/** 层感知工位存在性判断(覆盖通用实现:按 device_layer 定位层,缺省取第一层) */
|
|
35
|
+
hasStationIndex(stationIndex: number, deviceLayer?: number): boolean;
|
|
36
|
+
/** 层感知工位类型强校验(覆盖通用实现:按 device_layer 定位层,缺省取第一层) */
|
|
37
|
+
acceptsResourceType(stationIndex: number, resourceType: EnumResourceType, deviceLayer?: number): boolean;
|
|
38
|
+
/** 层感知工位坐标查询(覆盖通用实现:按 device_layer 定位层,缺省取第一层) */
|
|
39
|
+
getStationSlotPoint(stationIndex: number, deviceLayer?: number): {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
} | undefined;
|
|
31
43
|
}
|
|
@@ -1,28 +1,48 @@
|
|
|
1
|
-
import { IPalletConfig, IPalletOperating } from '../../types';
|
|
1
|
+
import { IPalletConfig, IPalletOperating, InteractiveUi, EnumResourceType } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
4
|
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* operating 支持:light /
|
|
6
|
+
* 通用托盘(独立设备)
|
|
7
|
+
* 参考接驳站的多层工位组结构:可任意放置若干层,每层 = 一个工位组容器(层内工位 resourceType 可托盘或刀具),
|
|
8
|
+
* 替代原刀盘功能;主体样式保留原托盘(内嵌纹理、溢出隐藏),支持修改背景色,带铭牌、状态灯。
|
|
9
|
+
* operating 支持:light / position / resource(按层定位,layer 缺省默认识别为第一层)
|
|
10
10
|
*/
|
|
11
11
|
export declare class Pallet extends ModelAbs<IPalletConfig> {
|
|
12
12
|
private static readonly CORNER_RADIUS;
|
|
13
|
+
private static readonly LAYER_PADDING;
|
|
14
|
+
private static readonly LAYER_GAP;
|
|
13
15
|
private light;
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
+
private layerGroups;
|
|
17
|
+
private resolveLayers;
|
|
18
|
+
private buildLayers;
|
|
16
19
|
protected createUi(): Box;
|
|
17
20
|
private moveX;
|
|
18
21
|
private moveY;
|
|
19
22
|
protected operating(data: IPalletOperating): void;
|
|
20
|
-
/**
|
|
21
|
-
private
|
|
23
|
+
/** 资源增删:data.resource 提供 device_layer(>0) 时定位到该层;缺省时默认识别为第一层 */
|
|
24
|
+
private handleResourceOperating;
|
|
22
25
|
/**
|
|
23
26
|
* 判断本托盘是否包含指定工位号
|
|
24
27
|
* 用于同一 id 的 Pallet 被拆分为多个 UI 时的三级匹配
|
|
25
28
|
*/
|
|
26
29
|
containsStationIndex(index: number): boolean;
|
|
27
30
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
31
|
+
/** 层感知工位存在性判断(覆盖通用实现:按 device_layer 定位层,缺省取第一层) */
|
|
32
|
+
hasStationIndex(stationIndex: number, deviceLayer?: number): boolean;
|
|
33
|
+
/** 层感知工位类型强校验(覆盖通用实现:按 device_layer 定位层,缺省取第一层) */
|
|
34
|
+
acceptsResourceType(stationIndex: number, resourceType: EnumResourceType, deviceLayer?: number): boolean;
|
|
35
|
+
/** 层感知工位坐标查询(覆盖通用实现:按 device_layer 定位层,缺省取第一层) */
|
|
36
|
+
getStationSlotPoint(stationIndex: number, deviceLayer?: number): {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
} | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* 扩展工位点击视图改写(覆盖 emitTap):
|
|
42
|
+
* 本托盘绑定 extendHostId 且点击的是工位槽时,layer 替换为宿主设备 config(该工位逻辑上属于宿主工位编号空间),
|
|
43
|
+
* data 克隆并改写 index 为合并编号(宿主工位总数 + 前序扩展托盘工位总数 + 本托盘局部序号),
|
|
44
|
+
* 同时保留 extensionOf(宿主业务 id)/ localIndex(托盘局部序号)两个溯源字段;
|
|
45
|
+
* 未绑定宿主或点击非工位区域时保持默认行为(layer 为托盘自身 config)
|
|
46
|
+
*/
|
|
47
|
+
protected emitTap(data: InteractiveUi): void;
|
|
28
48
|
}
|
package/dist/ui/models/Rail.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRailConfig,
|
|
1
|
+
import { IRailConfig, ILayerOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
4
|
/**
|
|
@@ -8,7 +8,14 @@ export declare class Rail extends ModelAbs<IRailConfig> {
|
|
|
8
8
|
private static readonly DEFAULT_HEIGHT;
|
|
9
9
|
private chains;
|
|
10
10
|
protected createUi(): Box;
|
|
11
|
-
|
|
11
|
+
/** 拖链不消费 socket operating:定位由画布内部联动驱动
|
|
12
|
+
* (设备移动时 AppController 逐帧调用 followChain,保证拖链与设备相对静止) */
|
|
13
|
+
protected operating(_data: ILayerOperating): void;
|
|
14
|
+
/**
|
|
15
|
+
* 逐帧跟随(AppController 托盘/拖链联动调用):
|
|
16
|
+
* 以设备实时位置直接驱动拖链,保证拖链与设备移动时相对静止
|
|
17
|
+
*/
|
|
18
|
+
followChain(botId: string, x: number): void;
|
|
12
19
|
private initChains;
|
|
13
20
|
private createChain;
|
|
14
21
|
private moveChain;
|
|
@@ -14,6 +14,8 @@ import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
|
14
14
|
export declare class ResourceOperationWindow extends ModelAbs<IResourceOperationWindowConfig> {
|
|
15
15
|
private static readonly DEFAULT_RING_THICKNESS;
|
|
16
16
|
private static readonly LIGHT_Y_OFFSET;
|
|
17
|
+
/** 状态灯固定宽度(与资源库状态灯一致) */
|
|
18
|
+
private static readonly LIGHT_WIDTH;
|
|
17
19
|
private static readonly NAME_PLATE_Y_OFFSET;
|
|
18
20
|
private static readonly LIGHT_CORNER_RADIUS;
|
|
19
21
|
/** 环状矩形外壁填充色 */
|
|
@@ -28,7 +30,6 @@ export declare class ResourceOperationWindow extends ModelAbs<IResourceOperation
|
|
|
28
30
|
private buildOutlinePath;
|
|
29
31
|
protected createUi(): Box;
|
|
30
32
|
protected operating(data: IResourceOperationWindowOperating): void;
|
|
31
|
-
private applyStationColor;
|
|
32
33
|
/**
|
|
33
34
|
* 判断本窗口是否包含指定工位号
|
|
34
35
|
*/
|
|
@@ -4,22 +4,24 @@ import { ModelAbs } from '../abstract/ModelAbs';
|
|
|
4
4
|
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
5
5
|
/**
|
|
6
6
|
* 资源库
|
|
7
|
-
* operating 支持:light /
|
|
7
|
+
* operating 支持:light / position / resource(工件、刀具、辅料增删)
|
|
8
|
+
* 统一「工位配置(层级)」模型:stationSlotGroups[] 每层一个工位组,
|
|
9
|
+
* 外层容器按设备级 flowOptions 对全部工位层整体排布(方向/换行/间距/宽高),hideBounds 控制容器边界显示。
|
|
8
10
|
*/
|
|
9
11
|
export declare class ResourceStore extends ModelAbs<IResourceStoreConfig> {
|
|
10
12
|
private static readonly CORNER_RADIUS;
|
|
11
13
|
private light;
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
+
/** 按层顺序保存的工位组实例(下标对应层序) */
|
|
15
|
+
private stationSlotGroups;
|
|
14
16
|
protected createUi(): Box;
|
|
15
17
|
/**
|
|
16
18
|
* 判断本资源库是否包含指定工位号
|
|
17
19
|
* 用于同一 id 的 ResourceStore 被拆分为多个 UI 时的三级匹配
|
|
18
20
|
*/
|
|
19
21
|
containsStationIndex(index: number): boolean;
|
|
22
|
+
/** 定位资源所在的工位组:优先按 device_layer 层号,其次按工位序号在工作位组中匹配,缺省回退资源类型 */
|
|
23
|
+
private findGroupForResource;
|
|
20
24
|
private moveX;
|
|
21
25
|
protected operating(data: IResourceStoreOperating): void;
|
|
22
|
-
/** 按工位序号修改工位背景颜色:在托盘/刀具工位组中查找包含该序号的工位槽并改色 */
|
|
23
|
-
private applyStationColor;
|
|
24
26
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
25
27
|
}
|
package/dist/ui/models/Rgv.d.ts
CHANGED
|
@@ -12,23 +12,23 @@ export declare class Rgv extends ModelAbs<IRGVConfig> {
|
|
|
12
12
|
private light1;
|
|
13
13
|
private light2;
|
|
14
14
|
private defaultLightColor;
|
|
15
|
-
|
|
16
|
-
private
|
|
15
|
+
/** 全部工位层工位组(一层=一组),挂载于唯一容器 #slotLayers,不区分托盘/刀具工位组 */
|
|
16
|
+
private slotGroups;
|
|
17
17
|
protected createUi(): Box;
|
|
18
18
|
protected operating(data: IRGVOperating): void;
|
|
19
|
+
/** 资源路由:device_layer 层号优先,其次工位号(优先类型匹配),最后首个工位组 */
|
|
20
|
+
private findGroupForResource;
|
|
19
21
|
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
20
22
|
private handleRotate;
|
|
21
23
|
private moveX;
|
|
22
24
|
/**
|
|
23
|
-
* forks
|
|
25
|
+
* forks 前后移动(直接赋值,高频移动不走动画)
|
|
24
26
|
* @param percent 移动比例,[-1,1]
|
|
25
|
-
* @param duration 动画持续时间
|
|
26
27
|
*/
|
|
27
28
|
private handleForkMove;
|
|
28
29
|
/**
|
|
29
|
-
* forks
|
|
30
|
+
* forks 上下移动(直接赋值,高频移动不走动画)
|
|
30
31
|
* @param percent 移动比例,[0,1]
|
|
31
|
-
* @param duration 动画持续时间
|
|
32
32
|
*/
|
|
33
33
|
private handleForkMoveUpDown;
|
|
34
34
|
}
|