@jnrs/lingshu-smart 3.1.6 → 3.1.7

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.
@@ -19,6 +19,8 @@ export declare class AppController {
19
19
  private animationsEnabled;
20
20
  private alarmHighlights;
21
21
  private hostExtensions;
22
+ /** 设备注册表快照:key 为画布图层 id(layerId),value 为注册表中该设备的数据(点击设备时从 rawData.device 读取) */
23
+ private deviceRegistrySnapshot;
22
24
  constructor(options?: IContainer);
23
25
  start(): void;
24
26
  destroy(): void;
@@ -35,6 +37,24 @@ export declare class AppController {
35
37
  * @returns 实际复位的模型数量
36
38
  */
37
39
  resetAllModels(): number;
40
+ /**
41
+ * 按设备标识定位模型实例列表:
42
+ * 1. 业务标识(编辑器「业务数据配置」rawData.id)→ businessMap;
43
+ * 2. 未命中时回退画布 ID(图层 id)→ modelsMap(须 className 一致)。
44
+ * 该顺序与代理器下发 device_id 的优先级(设备类型标识 → 业务标识 → 画布 ID)配套使用。
45
+ */
46
+ resolveDeviceModels(className: string, id: string): ModelAbs[];
47
+ /**
48
+ * 同步「设备注册表」快照到画布模型业务数据:
49
+ * 传入 layerId → 注册表设备记录(null 表示清除),写入模型 config.rawData.device,
50
+ * 点击设备时可在回调的 layer.rawData.device / data.rawData.device 中读取到该设备注册表数据。
51
+ */
52
+ setDeviceRegistrySnapshot(entries: Array<{
53
+ layerId: string;
54
+ device: Record<string, unknown> | null;
55
+ }>): void;
56
+ /** 将快照写入指定模型的 rawData.device(无快照时移除) */
57
+ private applyDeviceRegistrySnapshotTo;
38
58
  /**
39
59
  * 复位单个业务设备(device_init 全量覆盖语义:缺省字段重置为默认值,见文档第七章)
40
60
  * @param className 设备类型(EnumModel 值)
@@ -1,4 +1,4 @@
1
- import { b as a, u as o, c as r, a as t } from "../useAppStore-D1MhA1kj.js";
1
+ import { b as a, u as o, c as r, a as t } from "../useAppStore-ByhpgBWp.js";
2
2
  export {
3
3
  a as useAppStore,
4
4
  o as useDataStore,
@@ -16043,6 +16043,10 @@ export declare const useAppStore: import('pinia').StoreDefinition<"@jnrs/lingshu
16043
16043
  feedSocketMessage: (msg: unknown) => void;
16044
16044
  setSocketHandlers: (handlers: Pick<SocketDispatcherOptions, "onAck" | "onRaw">) => void;
16045
16045
  resetModels: () => void;
16046
+ syncDeviceRegistry: (entries: Array<{
16047
+ layerId: string;
16048
+ device: Record<string, unknown> | null;
16049
+ }>) => void;
16046
16050
  }, "currentCase">, Pick<{
16047
16051
  currentCase: import('vue').Ref<{
16048
16052
  id: string;
@@ -32086,6 +32090,10 @@ export declare const useAppStore: import('pinia').StoreDefinition<"@jnrs/lingshu
32086
32090
  feedSocketMessage: (msg: unknown) => void;
32087
32091
  setSocketHandlers: (handlers: Pick<SocketDispatcherOptions, "onAck" | "onRaw">) => void;
32088
32092
  resetModels: () => void;
32093
+ syncDeviceRegistry: (entries: Array<{
32094
+ layerId: string;
32095
+ device: Record<string, unknown> | null;
32096
+ }>) => void;
32089
32097
  }, never>, Pick<{
32090
32098
  currentCase: import('vue').Ref<{
32091
32099
  id: string;
@@ -48129,4 +48137,8 @@ export declare const useAppStore: import('pinia').StoreDefinition<"@jnrs/lingshu
48129
48137
  feedSocketMessage: (msg: unknown) => void;
48130
48138
  setSocketHandlers: (handlers: Pick<SocketDispatcherOptions, "onAck" | "onRaw">) => void;
48131
48139
  resetModels: () => void;
48132
- }, "operating" | "initContainer" | "resizeContainer" | "destroyContainer" | "feedSocketMessage" | "setSocketHandlers" | "resetModels">>;
48140
+ syncDeviceRegistry: (entries: Array<{
48141
+ layerId: string;
48142
+ device: Record<string, unknown> | null;
48143
+ }>) => void;
48144
+ }, "operating" | "initContainer" | "resizeContainer" | "destroyContainer" | "feedSocketMessage" | "setSocketHandlers" | "resetModels" | "syncDeviceRegistry">>;