model-action 1.0.9 → 1.0.11
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/dist/modules/Poi.d.ts +7 -1
- package/dist/modules/Poi.js +14 -2
- package/package.json +1 -1
- package/src/modules/Scene.ts +35 -0
package/dist/modules/Poi.d.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* POI点方法
|
3
3
|
*/
|
4
4
|
import { Action, LocationItem, SendParam } from "./Action";
|
5
|
-
type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo';
|
5
|
+
type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo' | 'status';
|
6
6
|
type PoiType = {
|
7
7
|
action: PoiActionType;
|
8
8
|
id?: string;
|
@@ -15,6 +15,7 @@ type PoiType = {
|
|
15
15
|
linkId?: string;
|
16
16
|
floorNum?: string;
|
17
17
|
lowestFloor?: string;
|
18
|
+
state?: 'normal' | 'alarm';
|
18
19
|
} & SendParam;
|
19
20
|
export declare class PoiAction extends Action {
|
20
21
|
/**
|
@@ -46,6 +47,11 @@ export declare class PoiAction extends Action {
|
|
46
47
|
* @param {*} place POI所在位置
|
47
48
|
*/
|
48
49
|
static poiHide(id: PoiType['id'], type: PoiType['type'], place: PoiType['place']): void;
|
50
|
+
/**
|
51
|
+
* 把所有的POI恢复到Normal状态
|
52
|
+
* @param {*} state normal一般状态 alarm 告警状态
|
53
|
+
*/
|
54
|
+
static poiNormal(state: 'normal' | 'alarm'): void;
|
49
55
|
/**
|
50
56
|
* 获取指定POI
|
51
57
|
* @param {*} type 相机type
|
package/dist/modules/Poi.js
CHANGED
@@ -43,7 +43,7 @@ export class PoiAction extends Action {
|
|
43
43
|
* @param {*} type 相机type
|
44
44
|
* @param {*} place POI所在位置
|
45
45
|
*/
|
46
|
-
static poiShow(id, type
|
46
|
+
static poiShow(id, type, place) {
|
47
47
|
const param = {
|
48
48
|
cmd: "POI",
|
49
49
|
action: "show",
|
@@ -61,7 +61,7 @@ export class PoiAction extends Action {
|
|
61
61
|
* @param {*} type 相机type
|
62
62
|
* @param {*} place POI所在位置
|
63
63
|
*/
|
64
|
-
static poiHide(id, type
|
64
|
+
static poiHide(id, type, place) {
|
65
65
|
const param = {
|
66
66
|
cmd: "POI",
|
67
67
|
action: "hide",
|
@@ -73,6 +73,18 @@ export class PoiAction extends Action {
|
|
73
73
|
}
|
74
74
|
this.sendParam(param, '隐藏POI');
|
75
75
|
}
|
76
|
+
/**
|
77
|
+
* 把所有的POI恢复到Normal状态
|
78
|
+
* @param {*} state normal一般状态 alarm 告警状态
|
79
|
+
*/
|
80
|
+
static poiNormal(state) {
|
81
|
+
const param = {
|
82
|
+
cmd: "POI",
|
83
|
+
action: "status",
|
84
|
+
state
|
85
|
+
};
|
86
|
+
this.sendParam(param, `恢复至${state}状态`);
|
87
|
+
}
|
76
88
|
/**
|
77
89
|
* 获取指定POI
|
78
90
|
* @param {*} type 相机type
|
package/package.json
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
/**
|
5
|
+
* 场景方法
|
6
|
+
*/
|
7
|
+
import { Action, SendParam } from "./Action";
|
8
|
+
|
9
|
+
|
10
|
+
enum SceneActionType{
|
11
|
+
Exit = '0', //退出独显
|
12
|
+
Enter = '1', //进入独显
|
13
|
+
}
|
14
|
+
type SceneType = {
|
15
|
+
action: SceneActionType,
|
16
|
+
isAdjustLight: boolean //是否调整灯光
|
17
|
+
tag?: string, //指定场景需要打的tag,根据项目定义,如果场景中只有一处需要独显,这里可以不传该字段
|
18
|
+
} & SendParam
|
19
|
+
|
20
|
+
export class SceneAction extends Action {
|
21
|
+
/**
|
22
|
+
* 独显某场景模型
|
23
|
+
* @param {*} action 自定义轨迹ID
|
24
|
+
*/
|
25
|
+
static show(action:SceneActionType,isAdjustLight:SceneType['isAdjustLight'] = false,tag:SceneType['tag']) {
|
26
|
+
const param: SceneType = {
|
27
|
+
cmd: "POI",
|
28
|
+
action,
|
29
|
+
tag,
|
30
|
+
isAdjustLight
|
31
|
+
};
|
32
|
+
this.sendParam(param, `${action==='0'?'退出':'进入'}独显`);
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|