@teeechina/teee-map 0.0.11 → 0.0.12

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/index.d.ts CHANGED
@@ -282,6 +282,7 @@ export interface InterlockVisualizationGraphOptions {
282
282
  };
283
283
  firstSwitches?: string[];
284
284
  updateFeatureState?: (code: string | number, state: any) => void;
285
+ queryGeojsonFeatures?: (key: string) => GeoJSONFeature[];
285
286
  }
286
287
 
287
288
  export interface InterlockVisualizationGeoJsonOptions {
@@ -297,6 +298,7 @@ export interface InterlockVisualizationGeoJsonOptions {
297
298
  };
298
299
  firstSwitches?: string[];
299
300
  updateFeatureState?: (code: string | number, state: any) => void;
301
+ queryGeojsonFeatures?: (key: string) => GeoJSONFeature[];
300
302
  }
301
303
 
302
304
  export interface InterlockVisualizationLegacyOptions {
@@ -312,13 +314,48 @@ export interface InterlockVisualizationLegacyOptions {
312
314
  };
313
315
  firstSwitches?: string[];
314
316
  updateFeatureState?: (code: string | number, state: any) => void;
317
+ queryGeojsonFeatures?: (key: string) => GeoJSONFeature[];
315
318
  }
316
319
 
317
320
  export type InterlockVisualizationOptions = InterlockVisualizationGraphOptions | InterlockVisualizationGeoJsonOptions | InterlockVisualizationLegacyOptions;
318
321
 
319
322
  export declare class InterLockVisualization {
320
323
  constructor(options: InterlockVisualizationOptions);
324
+
325
+ /** 初始化绝缘节与信号机的映射关系,构造后需调用一次 */
326
+ initInsulation(): void;
327
+
328
+ /** 处理一帧联锁信号数据字符串,自动识别 ZK01 / YD 协议并刷新要素状态 */
329
+ handleSignalData(res: string): void;
330
+
331
+ /** 清空所有联锁状态缓存,将所有要素状态还原为初始值 */
332
+ turnOffSignals(): void;
333
+
334
+ /** 启用信号发送模式 */
335
+ startRunning(): void;
336
+
337
+ /** 禁用信号发送模式 */
338
+ stopRunning(): void;
339
+
340
+ /** 设置信号发送回调,回调参数为按协议格式组装的字符串数组 */
341
+ setSendSignalCallback(callback: (dataList: string[]) => void): void;
342
+
343
+ /** 设置站场信号状态列表 */
344
+ setStationSignalState(stationSignalState: string[]): void;
345
+
346
+ /** 将 interLockState 缓存中的状态按协议格式组装后触发回调 */
347
+ sendSignal(): void;
348
+
349
+ /** 将所有状态置零后发送一次清空帧,用于暂停场景 */
350
+ pauseSignal(): void;
351
+
352
+ /** 直接读取 MapLibre 图层 feature state 生成信号字符串并发送,不依赖缓存 */
353
+ collectStateAndSend(): void;
354
+
355
+ /** @deprecated 请改用 handleSignalData */
321
356
  setInterlockData(protocol: InterlockProtocol): void;
357
+
358
+ /** @deprecated 请改用 turnOffSignals */
322
359
  clear(): void;
323
360
  }
324
361
 
@@ -380,6 +417,9 @@ export declare class TeeeMap {
380
417
  getMapConfigs(): MapForgeConfig;
381
418
  getFeatureState(code: string | number): Record<string, unknown> | undefined;
382
419
  locateGeojsonFeature(data: GeoJSON.FeatureCollection): void;
420
+
421
+ // 信号解析与模拟
422
+ interLockVisualization?: InterLockVisualization;
383
423
  }
384
424
 
385
425
  export default TeeeMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teeechina/teee-map",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "",
5
5
  "main": "dist/teee-map.umd.js",
6
6
  "module": "dist/teee-map.mjs",