@jnrs/lingshu-smart 2.2.40 → 2.2.42

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 CHANGED
@@ -489,19 +489,19 @@ type ILayerOperating =
489
489
 
490
490
  ### 子类型一览
491
491
 
492
- | 类型 | className | 特有属性 | 子组件能力 | 典型 payload.type |
493
- | ---------------------------- | -------------------- | -------------------------------------------------------------------- | -------------------------------------------------- | ------------------ |
494
- | `IMachineToolOperating` | `MACHINE_TOOL` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(含旋转)、进度条、出入口、工位槽 | `MachineTool` |
495
- | `ILoadingStationOperating` | `LOADING_STATION` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(无旋转)、进度条、出入口、工位槽 | `LoadingStation` |
496
- | `IShuttleStationOperating` | `SHUTTLE_STATION` | `light?`, `layerLightColor?`, `layerLightBlinking?`, `layerVisible?` | 状态灯、多工位层状态灯/显隐 | `ShuttleStation` |
497
- | `IMarkingMachineOperating` | `MARKING_MACHINE` | `light?`, `progress?`, `entrance?`, `laserSiteNumberArray?` | 状态灯、进度条、出入口、工位槽、激光工位指示 | `MarkingMachine` |
498
- | `ICleaningMachineOperating` | `CLEANING_MACHINE` | `light?`, `progress?`, `entrance?` | 状态灯、进度条、出入口、工位槽 | `CleaningMachine` |
499
- | `ISingleJointRobotOperating` | `SINGLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、关节旋转、夹具切换、双工位槽 | `SingleJointRobot` |
500
- | `IDoubleJointRobotOperating` | `DOUBLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `j2?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、双关节旋转、夹具切换、双工位槽 | `DoubleJointRobot` |
501
- | `IRGVOperating` | `RGV` | `light?`, `x?`, `j1?`, `forkXY?`, `forkZ?`, `resource?` | 双状态灯、轨道位移、旋转、货叉 XY/Z、双工位槽 | `Rgv` |
502
- | `IRailOperating` | `RAIL` | `x?`, `botId?` | 拖链动画(关联 botId 的设备移动时拖链跟随) | `Rail` |
503
- | `IResourceStoreOperating` | `RESOURCE_STORE` | `light?`, `x?`, `resource?` | 状态灯、轨道位移、托盘/刀具工位槽 | `ResourceStore` |
504
- | `IPalletOperating` | `PALLET` | `light?`, `x?`, `y?`, `resource?` | 状态灯、X/Y 位移、托盘/刀具工位槽 | `Pallet` |
492
+ | 类型 | className | 特有属性 | 子组件能力 | 典型 payload.type |
493
+ | ---------------------------- | -------------------- | -------------------------------------------------------------------- | --------------------------------------------------- | ------------------ |
494
+ | `IMachineToolOperating` | `MACHINE_TOOL` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(含旋转)、进度条、出入口、工位槽 | `MachineTool` |
495
+ | `ILoadingStationOperating` | `LOADING_STATION` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(无旋转)、进度条、出入口、工位槽 | `LoadingStation` |
496
+ | `IShuttleStationOperating` | `SHUTTLE_STATION` | `light?`, `layerLightColor?`, `layerLightBlinking?`, `layerVisible?` | 状态灯、多工位层状态灯/显隐 | `ShuttleStation` |
497
+ | `IMarkingMachineOperating` | `MARKING_MACHINE` | `light?`, `progress?`, `entrance?`, `laserSiteNumberArray?` | 状态灯、进度条、出入口、工位槽、激光工位指示 | `MarkingMachine` |
498
+ | `ICleaningMachineOperating` | `CLEANING_MACHINE` | `light?`, `progress?`, `entrance?` | 状态灯、进度条、出入口、工位槽 | `CleaningMachine` |
499
+ | `ISingleJointRobotOperating` | `SINGLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、关节旋转、夹具切换、双工位槽 | `SingleJointRobot` |
500
+ | `IDoubleJointRobotOperating` | `DOUBLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `j2?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、双关节旋转、夹具切换、双工位槽 | `DoubleJointRobot` |
501
+ | `IRGVOperating` | `RGV` | `light?`, `x?`, `j1?`, `forkXY?`, `forkZ?`, `resource?` | 双状态灯、轨道位移、旋转、货叉 XY/Z、双工位槽 | `Rgv` |
502
+ | `IRailOperating` | `RAIL` | `x?`, `botId?` | 拖链动画(关联 botId 的设备移动时拖链跟随) | `Rail` |
503
+ | `IResourceStoreOperating` | `RESOURCE_STORE` | `light?`, `x?`, `resource?`, `stationColor?` | 状态灯、轨道位移、托盘/刀具工位槽、按工位序改背景色 | `ResourceStore` |
504
+ | `IPalletOperating` | `PALLET` | `light?`, `x?`, `y?`, `resource?`, `stationColor?` | 状态灯、X/Y 位移、托盘/刀具工位槽、按工位序改背景色 | `Pallet` |
505
505
 
506
506
  ### 子类型字段详情
507
507
 
@@ -605,20 +605,22 @@ type ILayerOperating =
605
605
 
606
606
  #### IResourceStoreOperating
607
607
 
608
- | 属性 | 类型 | 说明 |
609
- | ---------- | -------------------- | ------------------------------ |
610
- | `light` | `ILightOperating` | 状态灯 |
611
- | `x` | `number` | 沿轨道位移(像素,随行托场景) |
612
- | `resource` | `IResourceOperating` | 托盘/刀具工位槽增删 |
608
+ | 属性 | 类型 | 说明 |
609
+ | -------------- | ---------------------------------- | --------------------------------------------------------------------- |
610
+ | `light` | `ILightOperating` | 状态灯 |
611
+ | `x` | `number` | 沿轨道位移(像素,随行托场景) |
612
+ | `resource` | `IResourceOperating` | 托盘/刀具工位槽增删 |
613
+ | `stationColor` | `Record<number, number \| string>` | 各工位背景颜色:键为工位序号 index(1-based),值为状态码或颜色字符串 |
613
614
 
614
615
  #### IPalletOperating
615
616
 
616
- | 属性 | 类型 | 说明 |
617
- | ---------- | -------------------- | ----------------------- |
618
- | `light` | `ILightOperating` | 状态灯 |
619
- | `x` | `number` | 沿 X 轴移动位置(像素) |
620
- | `y` | `number` | 沿 Y 轴移动位置(像素) |
621
- | `resource` | `IResourceOperating` | 托盘/刀具工位槽资源增删 |
617
+ | 属性 | 类型 | 说明 |
618
+ | -------------- | ---------------------------------- | --------------------------------------------------------------------- |
619
+ | `light` | `ILightOperating` | 状态灯 |
620
+ | `x` | `number` | 沿 X 轴移动位置(像素) |
621
+ | `y` | `number` | 沿 Y 轴移动位置(像素) |
622
+ | `resource` | `IResourceOperating` | 托盘/刀具工位槽资源增删 |
623
+ | `stationColor` | `Record<number, number \| string>` | 各工位背景颜色:键为工位序号 index(1-based),值为状态码或颜色字符串 |
622
624
 
623
625
  ### 子组件运转类型(IComponentOperating)
624
626
 
@@ -6,7 +6,11 @@
6
6
  export interface ScriptFieldConfig {
7
7
  key: string;
8
8
  label: string;
9
- type: 'input' | 'select' | 'switch' | 'number' | 'color';
9
+ /**
10
+ * 字段类型。json:对象/数组类型业务字段(如 stationColor、layerStationStatus、laserSiteNumberArray),
11
+ * 以 JSON 文本字符串形式编辑与存储,生成消息/预览时经 parseJsonFieldValues 解析为对象/数组
12
+ */
13
+ type: 'input' | 'select' | 'switch' | 'number' | 'color' | 'json';
10
14
  options?: {
11
15
  label: string;
12
16
  value: string | number;
@@ -96,5 +100,9 @@ export declare const deviceFieldConfigs: Record<string, ScriptFieldConfig[]>;
96
100
  export declare const scriptTemplates: ScriptTemplate[];
97
101
  /** 获取设备类型中文标签 */
98
102
  export declare function getDeviceLabel(deviceType: string): string;
103
+ /** 深拷贝字段默认值:对象/数组类型默认值不可跨步骤共享引用 */
104
+ export declare function cloneDefault(value: any): any;
105
+ /** 将 payload 中 json 类型字段的字符串值解析为对象/数组(供消息生成与预览使用;字段 key 参考 deviceFieldConfigs) */
106
+ export declare function parseJsonFieldValues(deviceType: string, payload: Record<string, any>): void;
99
107
  /** 为指定设备类型创建默认参数 */
100
108
  export declare function createDefaultParams(deviceType: string): Record<string, any>;
@@ -92,6 +92,8 @@ export interface WsProxyConfig {
92
92
  * direct 模式:完整 ws/wss 地址(如 ws://host:port/path)
93
93
  * proxy 模式:仅路径(如 ws/monitor?page=ctsMonitor),运行时拼接当前页面协议+主机 */
94
94
  wsUrl?: string;
95
+ /** 是否在连接请求时携带 Token(作为 WebSocket 子协议);默认 false;紧随 wsUrl 之后 */
96
+ carryToken?: boolean;
95
97
  /** 请求模式:direct 直接请求 / proxy 代理请求(仅填 path,通过 vite/nginx 代理);默认 direct */
96
98
  requestMode?: WsProxyRequestMode;
97
99
  /** 是否在组件挂载且 wsUrl 有效时自动连接 WebSocket(默认 true) */
@@ -102,8 +104,6 @@ export interface WsProxyConfig {
102
104
  sourceTypeField?: string;
103
105
  /** 心跳检测间隔(秒):0=关闭;>0=开启,定期发送心跳消息检测连接活性 */
104
106
  heartbeatInterval?: number;
105
- /** 是否在连接请求时携带 Token(作为 WebSocket 子协议);默认 false */
106
- carryToken?: boolean;
107
107
  /** 模型映射表:源业务数据值 → 画布模型 className(如 { '1': 'MachineTool' })
108
108
  * 供字段映射的「模型映射表」特殊处理引用,将源值转换为对应模型的 className */
109
109
  modelMap?: Record<string, string>;