@jnrs/lingshu-smart 2.2.44 → 2.2.45

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
@@ -487,15 +487,17 @@ type ILayerOperating =
487
487
  | IPalletOperating
488
488
  ```
489
489
 
490
+ > 除上述设备模型类型外,联合类型还包含全局操作类:`IGlobalResourceOperating`(`operatingType: 'resource'`,按 resourceIds 批量资源操作)与 `IResetAllOperating`(`operatingType: 'resetAll'`,不绑定具体设备,画布所有模型按初始配置重建,与「一键复位画布」一致)。`resetAll` 可由 WebSocket 消息触发:WsProxy 的 ResetAll 规则(源类型值 `resetAll`)接收后直接生成 `{ operatingType: 'resetAll' }`。
491
+
490
492
  ### 子类型一览
491
493
 
492
494
  | 类型 | className | 特有属性 | 子组件能力 | 典型 payload.type |
493
495
  | ---------------------------- | -------------------- | -------------------------------------------------------------------- | --------------------------------------------------- | ------------------ |
494
- | `IMachineToolOperating` | `MACHINE_TOOL` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(含旋转)、进度条、出入口、工位槽 | `MachineTool` |
496
+ | `IMachineToolOperating` | `MACHINE_TOOL` | `light?`, `progress?`, `entrance?`, `stationRotatable?`, `isWorking?` | 状态灯(含旋转)、进度条、出入口、工位槽、工作状态(玻璃呼吸) | `MachineTool` |
495
497
  | `ILoadingStationOperating` | `LOADING_STATION` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(无旋转)、进度条、出入口、工位槽 | `LoadingStation` |
496
498
  | `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
+ | `IMarkingMachineOperating` | `MARKING_MACHINE` | `light?`, `progress?`, `entrance?`, `laserSiteNumberArray?` | 状态灯、进度条、出入口、工位槽、激光工位(电报节奏闪动) | `MarkingMachine` |
500
+ | `ICleaningMachineOperating` | `CLEANING_MACHINE` | `light?`, `progress?`, `entrance?`, `isWorking?` | 状态灯、进度条、出入口、工位槽、工作状态(波浪流动)| `CleaningMachine` |
499
501
  | `ISingleJointRobotOperating` | `SINGLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、关节旋转、夹具切换、双工位槽 | `SingleJointRobot` |
500
502
  | `IDoubleJointRobotOperating` | `DOUBLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `j2?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、双关节旋转、夹具切换、双工位槽 | `DoubleJointRobot` |
501
503
  | `IRGVOperating` | `RGV` | `light?`, `x?`, `j1?`, `forkXY?`, `forkZ?`, `resource?` | 双状态灯、轨道位移、旋转、货叉 XY/Z、双工位槽 | `Rgv` |
@@ -513,6 +515,7 @@ type ILayerOperating =
513
515
  | `progress` | `IProgressOperating` | 加工进度 0~1 |
514
516
  | `entrance` | `IEntranceOperating` | 物料入口/出口动画 |
515
517
  | `stationRotatable` | `boolean` | 工位容器方向:`false` 横向,`true` 纵向 |
518
+ | `isWorking` | `boolean` | 工作状态:`true` 时工位容器玻璃背景呼吸闪动(默认 `false`) |
516
519
  | `resource` | `IResourceOperating` | 托盘等资源增删 |
517
520
 
518
521
  #### ILoadingStationOperating
@@ -543,7 +546,7 @@ type ILayerOperating =
543
546
  | `light` | `Omit<ILightOperating, 'rotating'>` | 状态灯 |
544
547
  | `progress` | `IProgressOperating` | 打标进度 |
545
548
  | `entrance` | `IEntranceOperating` | 出入口 |
546
- | `laserSiteNumberArray` | `ILaserSiteState[]` | 各激光工位打标状态 |
549
+ | `laserSiteNumberArray` | `ILaserSiteState[]` | 各激光工位打标状态(`active` 时点亮并按无序电报节奏闪动) |
547
550
  | `resource` | `IResourceOperating` | 工位槽资源 |
548
551
 
549
552
  **ILaserSiteState:**
@@ -560,6 +563,7 @@ type ILayerOperating =
560
563
  | `light` | `Omit<ILightOperating, 'rotating'>` | 状态灯 |
561
564
  | `progress` | `IProgressOperating` | 清洗进度 |
562
565
  | `entrance` | `IEntranceOperating` | 出入口 |
566
+ | `isWorking` | `boolean` | 工作状态:`true` 时工位容器内显示波浪流动效果(默认 `false`) |
563
567
  | `resource` | `IResourceOperating` | 工位槽资源 |
564
568
 
565
569
  #### ISingleJointRobotOperating
@@ -734,8 +738,8 @@ type ILayerOperating =
734
738
  | `stores/useDebugStore.ts` | 全局设置 Pinia store(facade):响应式读写 `useDataStore.globalSetting` / `scriptRunner`,持久化统一在 `@jnrs/lingshu-smart` |
735
739
  | `composables/useDebugEasterEgg.ts` | 调试触发检测:500ms 内 10 次点击打开面板 |
736
740
  | `components/debug/GlobalSetting.vue` | 全局设置对话框 UI(原 DebugPanel,含语言/日志等级/FPS/阴影/动画等开关) |
737
- | `components/debug/ScriptRunner/` | Socket 脚本模拟器:脚本步骤编排、断点调试、消息结构配置(code/msg、payload 字段名、type)、日志查看 |
738
- | `components/debug/WsProxy/` | WebSocket 代理器:声明式字段映射将后端 socket 结构桥接为 operating,支持连接/断开/重连、日志、配置导出/导入、场景像素换算(percentToPixel 百分比/ runtimeToPixel 运行时坐标)、standalone 独立标签页模式 / remote 远程接收模式(BroadcastChannel 跨标签页流转数据) |
741
+ | `components/debug/ScriptRunner/` | Socket 脚本模拟器:脚本步骤编排、断点调试、消息结构配置(code/msg、payload 字段名、type)、日志查看;设备下拉支持自定义/全部复位(resetAll)/资源操作 |
742
+ | `components/debug/WsProxy/` | WebSocket 代理器:声明式字段映射将后端 socket 结构桥接为 operating,支持连接/断开/重连、日志、配置导出/导入、场景像素换算(percentToPixel 百分比/ runtimeToPixel 运行时坐标)、standalone 独立标签页模式 / remote 远程接收模式(BroadcastChannel 跨标签页流转数据);操作规则含 single/resource/global/resetAll(ResetAll 接收源类型值 `resetAll` 后生成全部复位 operating) |
739
743
  | `components/debug/WsProxy/WsProxyPage.vue` | `WsProxy` 独立路由页面组件:以独立 URL/标签页运行代理器配置,将 operating/raw/状态广播给预览页驱动图形运转 |
740
744
  | `controller/AppController.ts` | 提供 `toggleShadows` / `toggleAnimations` / `setFps` 方法 |
741
745
 
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  | 设备模型 | 机床、机器人(单关节/双关节)、RGV、装载站、打标机、清洗机、轨道拖链、资源库、托盘等 |
14
14
  | 设备运转 | 灯光、进度条、入口动画、工位槽资源增删、坐标/角度/货叉控制 |
15
15
  | 坐标转换 | `transRuntimeToPixel` / `transPercentToPixel` — 物理坐标与像素坐标互转 |
16
- | WebSocket 代理器 | `WsProxy` — 声明式字段映射将后端 socket 数据桥接为 operating 驱动设备动画;支持内置请求器/外接注入两种数据源、direct/proxy 请求模式、自动连接开关、按 type 分类代理配置及配置导出/导入;特殊处理支持固定值、像素转换、字典转换、对象值映射、模型映射表、条件判断,「始终记录」可关闭显示仍持续收集日志 |
16
+ | WebSocket 代理器 | `WsProxy` — 声明式字段映射将后端 socket 数据桥接为 operating 驱动设备动画;支持内置请求器/外接注入两种数据源、direct/proxy 请求模式、自动连接开关、按 type 分类代理配置及配置导出/导入;操作规则含 single/resource/global/resetAll(ResetAll 触发画布全部复位);特殊处理支持固定值、像素转换、字典转换、对象值映射、模型映射表、条件判断,「始终记录」可关闭显示仍持续收集日志 |
17
17
 
18
18
  ## 💻 技术栈
19
19
 
@@ -54,6 +54,10 @@ export declare const deviceTypeOptions: {
54
54
  }[];
55
55
  /** 设备/资源下拉「自定义」选项的标识值(选中后编辑自定义业务数据 JSON) */
56
56
  export declare const CUSTOM_DEVICE_TYPE = "__custom__";
57
+ /** 设备/资源下拉「全部复位」选项的标识值(选中后业务数据 type 预置 resetAll,经代理器触发画布全部复位) */
58
+ export declare const RESET_ALL_TYPE = "__resetAll__";
59
+ /** 「全部复位」业务数据的 type 预设值(与代理器全局操作类 ResetAll 规则的源类型值一致) */
60
+ export declare const RESET_ALL_MSG_TYPE = "resetAll";
57
61
  /** 资源类型选项 */
58
62
  export declare const resourceTypeOptions: {
59
63
  label: string;
@@ -78,6 +82,8 @@ export declare const codeDict: CodeOption[];
78
82
  export declare const defaultPayloadKey: 'data' | 'payload';
79
83
  /** 默认顶层 type 值 */
80
84
  export declare const defaultMsgType = "update";
85
+ /** 顶层消息 type 预置选项(消息配置 type 下拉,filterable + allow-create 可自由输入其他值) */
86
+ export declare const msgTypeOptions: string[];
81
87
  /** 默认返回码 */
82
88
  export declare const defaultCode = 0;
83
89
  /** 默认返回说明 */
@@ -18,6 +18,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
18
18
  "update:targetFieldEditable": (value: boolean) => any;
19
19
  "open-condition": (mapper: FieldMapper) => any;
20
20
  "open-valuemap": (mapper: FieldMapper) => any;
21
+ "open-operation": (mapper: FieldMapper) => any;
21
22
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
23
  onAdd?: (() => any) | undefined;
23
24
  onRemove?: ((idx: number) => any) | undefined;
@@ -25,6 +26,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
25
26
  "onUpdate:targetFieldEditable"?: ((value: boolean) => any) | undefined;
26
27
  "onOpen-condition"?: ((mapper: FieldMapper) => any) | undefined;
27
28
  "onOpen-valuemap"?: ((mapper: FieldMapper) => any) | undefined;
29
+ "onOpen-operation"?: ((mapper: FieldMapper) => any) | undefined;
28
30
  }>, {
29
31
  targetFieldEditable: boolean;
30
32
  hasDictFn: boolean;
@@ -22,8 +22,8 @@ export interface FieldMapper {
22
22
  defaultValue?: boolean | number | string | Record<string, unknown>;
23
23
  /** 是否启用该映射(默认 true) */
24
24
  enabled?: boolean;
25
- /** 特殊处理:'constant' 固定值 / 'percentToPixel' 百分比转像素 / 'runtimeToPixel' 运行时坐标转像素 / 'dictLabel' 字典Label / 'dictColor' 字典Color / 'dictColorMap' 对象值批量字典Color / 'objDict' 对象值批量映射 / 'modelMap' 模型映射表 / 'condition' 条件判断;为空表示不处理 */
26
- transform?: 'constant' | 'percentToPixel' | 'runtimeToPixel' | 'dictLabel' | 'dictColor' | 'dictColorMap' | 'objDict' | 'modelMap' | 'condition';
25
+ /** 特殊处理:'constant' 固定值 / 'percentToPixel' 百分比转像素 / 'runtimeToPixel' 运行时坐标转像素 / 'dictLabel' 字典Label / 'dictColor' 字典Color / 'dictColorMap' 对象值批量字典Color / 'objDict' 对象值批量映射 / 'modelMap' 模型映射表 / 'condition' 条件判断 / 'operation' 运算处理(数字取反/布尔取反/转布尔值/拼接运算);为空表示不处理 */
26
+ transform?: 'constant' | 'percentToPixel' | 'runtimeToPixel' | 'dictLabel' | 'dictColor' | 'dictColorMap' | 'objDict' | 'modelMap' | 'condition' | 'operation';
27
27
  /** 换算维度(transform 为 percentToPixel / runtimeToPixel 时必填):'width' 横向 / 'height' 纵向 */
28
28
  transformType?: 'width' | 'height';
29
29
  /** 换算精度(transform 为 percentToPixel 时生效,默认 2) */
@@ -34,6 +34,10 @@ export interface FieldMapper {
34
34
  transformTargetType?: 'string' | 'number' | 'boolean';
35
35
  /** 条件判断列表(transform 为 'condition' 时生效,按顺序匹配首个为 true 的条件,赋其 value 给画布字段;无匹配时回退 defaultValue,未配置则保持源值) */
36
36
  conditions?: ConditionRule[];
37
+ /** 运算处理类型(transform 为 'operation' 时生效):'negate' 数字取反 / 'not' 布尔取反 / 'toBoolean' 转布尔值 / 'concat' 拼接运算 */
38
+ operateFn?: 'negate' | 'not' | 'toBoolean' | 'concat';
39
+ /** 拼接运算表达式(transform 为 'operation' 且 operateFn 为 'concat' 时生效):用 {value} 占位引用源字段值,支持字符串拼接(如 `设备-{value}`)与数字运算(如 `{value}*2+1`) */
40
+ expression?: string;
37
41
  }
38
42
  /** 字典转换函数:将「源业务数据」字段值按字典名称转换为「画布字段」值
39
43
  * @param name 特殊处理配置下的字典名称(dictName)
@@ -65,8 +69,8 @@ export interface ProxyRule {
65
69
  equipmentName?: string;
66
70
  /** 是否启用该规则 */
67
71
  enabled: boolean;
68
- /** 操作模式:single 单条 operating;resource 资源增删(生成 add/remove 两条);global 全局操作(如批量移除) */
69
- operate: 'single' | 'resource' | 'global';
72
+ /** 操作模式:single 单条 operating;resource 资源增删(生成 add/remove 两条);global 全局操作(如批量移除);resetAll 全部复位(生成 resetAll operating,画布所有模型重建) */
73
+ operate: 'single' | 'resource' | 'global' | 'resetAll';
70
74
  /** 字段映射列表(operate: 'single' 时生效) */
71
75
  mappings: FieldMapper[];
72
76
  /** 资源增删字段映射(operate: 'resource' 时生效,未配置时使用内置默认字段映射) */
@@ -162,7 +166,7 @@ export declare function createDefaultConfig(): WsProxyConfig;
162
166
  export declare function getDefaultDeviceRule(className: string): ProxyRule | null;
163
167
  /**
164
168
  * 为指定方案构建代理配置:仅包含该方案当前存在的设备类型(deviceClassNames)的默认映射,
165
- * 外加始终保留的 Resource / BatchRemove 操作规则。供「画布模型类」按 currentCase 动态生成使用。
169
+ * 外加始终保留的 Resource / BatchRemove / ResetAll 操作规则。供「画布模型类」按 currentCase 动态生成使用。
166
170
  * @param caseId 绑定的方案 uuid
167
171
  * @param deviceClassNames 方案中实际存在的设备类型 className 列表(去重后)
168
172
  */