@nnepoch/dtc-sdk 3.0.7 → 3.0.9

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.
@@ -2264,8 +2264,8 @@ interface TrainSimulateSetTrainVolumeRequest {
2264
2264
  parentId?: string;
2265
2265
  /** 唯一编号,必填。 */
2266
2266
  id: string;
2267
- /** 音量大小,取值 0-1,默认 0.5。 */
2268
- volume?: number;
2267
+ /** 声音是否开启,默认 true。 */
2268
+ volumeOn?: boolean;
2269
2269
  }
2270
2270
  //#endregion
2271
2271
  //#region src/types/buildingFloor.d.ts
@@ -3430,22 +3430,22 @@ declare class Camera extends BaseApi {
3430
3430
  */
3431
3431
  reset(callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
3432
3432
  /**
3433
- * 相机跟随场景中运动的对象。
3434
- * 默认值:`smooth=0.85`。
3435
- * @param payload - 跟随参数。
3436
- * @param callback - 可选回调函数。
3437
- * @returns Promise 形式的接口响应。
3438
- * @agentSideEffects write
3439
- * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
3440
- * @agentRiskLevel low
3441
- * @agentExample { id: 'myCar', offSet: { x: 0, y: 3, z: 5, ePSGType: '0000' }, smooth: 0.85 }
3442
- * @example
3443
- * ```ts
3444
- * dtcEngine.Camera.startCameraObjFollow({ id: 'myCar', offSet: new dtcEngine.Type.Vector3(0, 3, 5), smooth: 0.85 }, (result) => {
3445
- * console.log(result);
3446
- * });
3447
- * ```
3448
- */
3433
+ * 相机跟随场景中运动的对象。
3434
+ * 默认值:`smooth=0.85`。
3435
+ * @param payload - 跟随参数。
3436
+ * @param callback - 可选回调函数。
3437
+ * @returns Promise 形式的接口响应。
3438
+ * @agentSideEffects write
3439
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
3440
+ * @agentRiskLevel low
3441
+ * @agentExample { id: 'myCar', offSet: { x: 0, y: 3, z: 5, ePSGType: '0000' }, smooth: 0.85 }
3442
+ * @example
3443
+ * ```ts
3444
+ dtcEngine.Camera.startCameraObjFollow({ id: 'myCar', offSet: new dtcEngine.Type.Vector3(0, 3, 5), smooth: 0.85 }, (result) => {
3445
+ console.log(result);
3446
+ });
3447
+ * ```
3448
+ */
3449
3449
  startCameraObjFollow(payload: CameraObjFollowRequest, callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
3450
3450
  /**
3451
3451
  * 停止相机跟随。
@@ -4396,6 +4396,8 @@ declare class Navigation extends BaseApi {
4396
4396
  * @agentExample { parentId: 'Players', id: 'Player1', nodes: [{ x: 114.7985155712282, y: 34.842421780635625, z: 2 }, { x: 114.79789723105696, y: 34.84218433379876, z: 1.5 }], isCache: false, planColor: '#00ff00', passColor: '#e1e1e1' }
4397
4397
  * @example
4398
4398
  * ```ts
4399
+ *
4400
+ * 示例1:模型对象根据路过的节点进行导航
4399
4401
  dtcEngine.Navigation.startNav({
4400
4402
  parentId: 'Players',
4401
4403
  id: 'Player1',
@@ -4412,6 +4414,52 @@ declare class Navigation extends BaseApi {
4412
4414
  passColor: '#e1e1e1',
4413
4415
  offSetZ: 0.5,
4414
4416
  }, (result) => { console.log(result); });
4417
+ * 示例2:模型对象根据目标编码进行导航
4418
+ dtcEngine.Navigation.startNav({
4419
+ parentId: 'Players',
4420
+ id: 'Player1',
4421
+ targetCodes: ['1d370e56f4684f07963fed87e91e2164','070b49c4a6c24e0bae3aa8dcd4563556','d7d92d67093f47b881d11e3b59107d0f', 'd5eab05cbf8543aaacd218db300c61cd','a2e0eb51ee8f438088a48a392ffe02d3', '2459436d256847db9084e04e5ef9115c','5317033054e44835a14a6b7a9f5eed74'],
4422
+ isCache: false,
4423
+ planColor: '#00ff00',
4424
+ passColor: '#e1e1e1',
4425
+ offSetZ: 0.5,
4426
+ }, (result) => { console.log(result); });
4427
+
4428
+ ** 示例3:模型对象根据目标坐标进行导航
4429
+ dtcEngine.Navigation.startNav({
4430
+ parentId: 'patrolLayer',
4431
+ id: 'TestNav',
4432
+ targetIds: [
4433
+ "14b5770c062c47e1b359c09026221adc",
4434
+ "56ce729e6ab74858a830b85b638fbe32",
4435
+ "738f6f36bf704969955872c63fab0bd1",
4436
+ "534500c3a1c84defab8a9a3d0c0e60a0",
4437
+ "74b694f0216d4aaf9b059bba22228c21",
4438
+ "2a025d1b1d6641a2b2a2e76f82abbb8c",
4439
+ "bc60c0fd9e6247989e2fda0e57756188",
4440
+ "42dd7766abc94cce97cb36244c348937",
4441
+ "ad594980d6d54752baf63b2f26a29493",
4442
+ ],
4443
+ isCache: false,
4444
+ planColor: '#ff820b',
4445
+ passColor: '#e1e1e1',
4446
+ speed: 3,
4447
+ offSetZ: 0.5,
4448
+ isAutoClear: false,//是否自动清除,默认 `true`。
4449
+ scale: new dtcEngine.Type.Vector3(3, 3, 3),
4450
+ }, (result) => {
4451
+ console.log(result);
4452
+ let param = JSON.parse(result.param);
4453
+ if (param.status == 'start') {
4454
+ // dtcEngine.Camera.startCameraObjFollow({
4455
+ // parentId: "patrolLayer",
4456
+ // id: 'TestNav',
4457
+ // offSet: new dtcEngine.Type.Vector3(-10, 0, 3),
4458
+ // });
4459
+ } else if (param.status == 'finished') {
4460
+ dtcEngine.Camera.endCameraObjFollow();
4461
+ }
4462
+ });
4415
4463
  * ```
4416
4464
  */
4417
4465
  startNav(payload: NavigationMeshNavRequest, callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
@@ -4778,17 +4826,24 @@ declare class PathPatrol extends BaseApi {
4778
4826
  interface PointIconVisibilityResult {
4779
4827
  requestedCount: number;
4780
4828
  affectedCount: number;
4781
- notFoundIds: string[];
4829
+ /** 按 ids 调用(show/hide/showByGroup/hideByGroup)时返回;按 codes 调用时该字段缺失。 */
4830
+ notFoundIds?: string[];
4831
+ /** 按 codes 调用(showByCode/hideByCode)时返回;按 ids 调用时该字段缺失。 */
4832
+ notFoundCodes?: string[];
4782
4833
  }
4783
4834
  interface PointIconIdsRequest {
4784
4835
  ids: string[];
4785
4836
  }
4786
4837
  type PointIconIdsInput = string[] | PointIconIdsRequest;
4838
+ interface PointIconCodesRequest {
4839
+ codes: string[];
4840
+ }
4841
+ type PointIconCodesInput = string[] | PointIconCodesRequest;
4787
4842
  type PointIconResponse = ApiResponseEnvelope<PointIconVisibilityResult>;
4788
4843
  /**
4789
4844
  * 设备点位图标显隐控制 API。
4790
4845
  * @agentTitle 设备点位图标
4791
- * @agentCapabilities 指定点位显隐, 分组点位显隐, 全部点位显隐
4846
+ * @agentCapabilities 指定点位显隐, 按编码点位显隐, 分组点位显隐, 全部点位显隐
4792
4847
  * @hideconstructor
4793
4848
  */
4794
4849
  declare class PointIcon extends BaseApi {
@@ -4809,6 +4864,22 @@ declare class PointIcon extends BaseApi {
4809
4864
  * @agentExample { ids: ['point-001', 'point-002'] }
4810
4865
  */
4811
4866
  hide(payload: PointIconIdsInput, callback?: ApiCallback<PointIconResponse>): Promise<PointIconResponse>;
4867
+ /**
4868
+ * 显示指定编码(code)的全部设备点位图标,编码精确匹配且不要求唯一。
4869
+ * @agentSideEffects write
4870
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
4871
+ * @agentRiskLevel low
4872
+ * @agentExample { codes: ['CAM-001', 'CAM-002'] }
4873
+ */
4874
+ showByCode(payload: PointIconCodesInput, callback?: ApiCallback<PointIconResponse>): Promise<PointIconResponse>;
4875
+ /**
4876
+ * 隐藏指定编码(code)的全部设备点位图标,编码精确匹配且不要求唯一。
4877
+ * @agentSideEffects write
4878
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
4879
+ * @agentRiskLevel low
4880
+ * @agentExample { codes: ['CAM-001', 'CAM-002'] }
4881
+ */
4882
+ hideByCode(payload: PointIconCodesInput, callback?: ApiCallback<PointIconResponse>): Promise<PointIconResponse>;
4812
4883
  /**
4813
4884
  * 显示指定分组及其子分组内的设备点位图标。
4814
4885
  * @agentSideEffects write
@@ -5762,93 +5833,98 @@ declare class SpatialQuery extends BaseApi {
5762
5833
  * @hideconstructor
5763
5834
  */
5764
5835
  declare class TrainSimulate extends BaseApi {
5765
- constructor(bridge: ApiBridge, runtimeOptions?: BaseApiRuntimeOptions);
5766
5836
  /**
5767
- * 设置火车的动态并启动列车。
5768
- * 默认值:`direction='0'`、`action='1'`、`stopTime=180`、`moveType=StopAtTheEnd`。
5769
- * `id` 为必填的唯一编号;`parentId` 用于避免重名,可不填。
5770
- * @param payload - 列车启动参数。
5771
- * @param callback - 可选回调函数。
5772
- * @returns Promise 形式的接口响应。
5773
- * @agentSideEffects write
5774
- * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5775
- * @agentRiskLevel low
5776
- * @agentExample { parentId: 'RailTrains', id: 'DTrain1', trainCode: 'G501', startStationName: '北京', endStationName: '上海', direction: '0', action: '1', stopTime: 180, moveType: 'StopAtTheEnd' }
5777
- * @example
5778
- * ```ts
5779
- * dtcEngine.TrainSimulate.startTrain(
5780
- * {
5781
- * parentId: 'RailTrains',
5782
- * id: 'DTrain1',
5783
- * trainCode: 'G501',
5784
- * startStationName: '北京',
5785
- * endStationName: '上海',
5786
- * direction: '0',
5787
- * action: '1',
5788
- * stopTime: 180,
5789
- * moveType: dtcEngine.Enums.TrainBehavior.StopAtTheEnd
5790
- * },
5791
- * (result) => { console.log(result); }
5792
- * );
5793
- * ```
5837
+ * 相机模块实例,`setCameraFollowTrain` 复用其 `startCameraObjFollow` 接口。
5794
5838
  */
5839
+ private readonly camera;
5840
+ constructor(bridge: ApiBridge, runtimeOptions?: BaseApiRuntimeOptions);
5841
+ /**
5842
+ * 设置火车的动态并启动列车。
5843
+ * 默认值:`direction='0'`、`action='1'`、`stopTime=180`、`moveType=StopAtTheEnd`。
5844
+ * `id` 为必填的唯一编号;`parentId` 用于避免重名,可不填。
5845
+ * @param payload - 列车启动参数。
5846
+ * @param callback - 可选回调函数。
5847
+ * @returns Promise 形式的接口响应。
5848
+ * @agentSideEffects write
5849
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5850
+ * @agentRiskLevel low
5851
+ * @agentExample { parentId: 'RailTrains', id: 'DTrain1', trainCode: 'G501', startStationName: '北京', endStationName: '上海', direction: '0', action: '1', stopTime: 180, moveType: 'StopAtTheEnd' }
5852
+ * @example
5853
+ * ```ts
5854
+ dtcEngine.TrainSimulate.startTrain(
5855
+ {
5856
+ parentId: 'RailTrains',
5857
+ id: 'DTrain1',
5858
+ trainCode: 'G501',
5859
+ startStationName: '北京',
5860
+ endStationName: '上海',
5861
+ direction: '0',
5862
+ action: '1',
5863
+ stopTime: 180,
5864
+ moveType: dtcEngine.Enums.TrainBehavior.StopAtTheEnd
5865
+ },
5866
+ (result) => { console.log(result); }
5867
+ );
5868
+ * ```
5869
+ */
5795
5870
  startTrain(payload: TrainSimulateStartTrainRequest, callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
5796
5871
  /**
5797
- * 设置火车的运动方式。
5798
- * 默认值:`moveType=StopAtTheEnd`。
5799
- * @param payload - 列车运动方式参数。
5800
- * @param callback - 可选回调函数。
5801
- * @returns Promise 形式的接口响应。
5802
- * @agentSideEffects write
5803
- * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5804
- * @agentRiskLevel low
5805
- * @agentExample { parentId: 'RailTrains', id: 'DTrain1', moveType: 'Loop' }
5806
- * @example
5807
- * ```ts
5808
- * dtcEngine.TrainSimulate.setTrainBehavior(
5809
- * { parentId: 'RailTrains', id: 'DTrain1', moveType: dtcEngine.Enums.TrainBehavior.Loop },
5810
- * (result) => { console.log(result); }
5811
- * );
5812
- * ```
5813
- */
5872
+ * 设置火车的运动方式。
5873
+ * 默认值:`moveType=StopAtTheEnd`。
5874
+ * @param payload - 列车运动方式参数。
5875
+ * @param callback - 可选回调函数。
5876
+ * @returns Promise 形式的接口响应。
5877
+ * @agentSideEffects write
5878
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5879
+ * @agentRiskLevel low
5880
+ * @agentExample { parentId: 'RailTrains', id: 'DTrain1', moveType: 'Loop' }
5881
+ * @example
5882
+ * ```ts
5883
+ dtcEngine.TrainSimulate.setTrainBehavior(
5884
+ { parentId: 'RailTrains', id: 'DTrain1', moveType: dtcEngine.Enums.TrainBehavior.Loop },
5885
+ (result) => { console.log(result); }
5886
+ );
5887
+ * ```
5888
+ */
5814
5889
  setTrainBehavior(payload: TrainSimulateSetTrainBehaviorRequest, callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
5815
5890
  /**
5816
- * 设置相机跟随火车。
5817
- * 默认偏移量 `offSet=(26, 18, 15)`,坐标类型固定为 `'0000'`。
5818
- * @param payload - 相机跟随参数。
5819
- * @param callback - 可选回调函数。
5820
- * @returns Promise 形式的接口响应。
5821
- * @agentSideEffects write
5822
- * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5823
- * @agentRiskLevel low
5824
- * @agentExample { parentId: 'RailTrains', id: 'DTrain1', offSet: { x: 26, y: 18, z: 15, ePSGType: '0000' } }
5825
- * @example
5826
- * ```ts
5827
- * dtcEngine.TrainSimulate.setCameraFollowTrain(
5828
- * { parentId: 'RailTrains', id: 'DTrain1', offSet: new dtcEngine.Type.Vector3(26, 18, 15) },
5829
- * (result) => { console.log(result); }
5830
- * );
5831
- * ```
5832
- */
5891
+ * 设置相机跟随火车。
5892
+ * 内部调用相机模块的 `Camera.startCameraObjFollow` 接口实现。
5893
+ * 默认偏移量 `offSet=(-100, 0, 30)`,坐标类型固定为 `'0000'`。
5894
+ * @param payload - 相机跟随参数。
5895
+ * @param callback - 可选回调函数。
5896
+ * @returns Promise 形式的接口响应。
5897
+ * @agentSideEffects write
5898
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5899
+ * @agentRiskLevel low
5900
+ * @agentExample { parentId: 'RailTrains', id: 'DTrain1', offSet: { x: 26, y: 18, z: 15, ePSGType: '0000' } }
5901
+ * @example
5902
+ * ```ts
5903
+ dtcEngine.TrainSimulate.setCameraFollowTrain(
5904
+ { parentId: 'RailTrains', id: 'DTrain1', offSet: new dtcEngine.Type.Vector3(26, 18, 15) },
5905
+ (result) => { console.log(result); }
5906
+ );
5907
+ * ```
5908
+ */
5833
5909
  setCameraFollowTrain(payload: TrainSimulateSetCameraFollowTrainRequest, callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
5834
5910
  /**
5835
- * 设置火车的音量大小。
5836
- * 默认值:`volume=0.5`,取值范围 0-1。
5837
- * @param payload - 列车音量参数。
5838
- * @param callback - 可选回调函数。
5839
- * @returns Promise 形式的接口响应。
5840
- * @agentSideEffects write
5841
- * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5842
- * @agentRiskLevel low
5843
- * @agentExample { parentId: 'RailTrains', id: 'DTrain1', volume: 0.5 }
5844
- * @example
5845
- * ```ts
5846
- * dtcEngine.TrainSimulate.setTrainVolume(
5847
- * { parentId: 'RailTrains', id: 'DTrain1', volume: 0.5 },
5848
- * (result) => { console.log(result); }
5849
- * );
5850
- * ```
5851
- */
5911
+ * 设置火车的声音的开关。
5912
+ * 默认值:`volumeOn=true`。
5913
+ * @param payload - 列车声音参数。
5914
+ * @param callback - 可选回调函数。
5915
+ * @returns Promise 形式的接口响应。
5916
+ * @agentSideEffects write
5917
+ * @agentPreconditions DTCEngine 已完成鉴权并建立 WebRTC 连接
5918
+ * @agentRiskLevel low
5919
+ * @agentExample { parentId: 'RailTrains', id: 'DTrain1', volumeOn: false } => { code: 0, message: 'success', data: null }
5920
+ * @example
5921
+ * ```ts
5922
+ dtcEngine.TrainSimulate.setTrainVolume(
5923
+ { parentId: '', id: 'Train1', volumeOn: false },
5924
+ (result) => { console.log(result); }
5925
+ );
5926
+ * ```
5927
+ */
5852
5928
  setTrainVolume(payload: TrainSimulateSetTrainVolumeRequest, callback?: ApiCallback<ApiResponseEnvelope<unknown>>): Promise<ApiResponseEnvelope<unknown>>;
5853
5929
  /**
5854
5930
  * 取消相机跟随火车,无需传参。
@@ -6691,6 +6767,9 @@ declare class DTCEngine {
6691
6767
  readonly LoadMQTTDataFinished: "LoadMQTTDataFinished";
6692
6768
  /** 设备数据加载进度事件 */
6693
6769
  readonly LoadMQTTDataProgress: "LoadMQTTDataProgress";
6770
+ /** 列车可见性变化事件 */
6771
+ readonly TrainsVisible: "TrainsVisible";
6772
+ readonly TrainsInfo: "TrainsInfo";
6694
6773
  };
6695
6774
  readonly Enums: {
6696
6775
  DlssQuality: {