model-action 2.2.7 → 2.2.8
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 巡检操作方法
|
|
3
3
|
*/
|
|
4
4
|
import { Action } from "./Action";
|
|
5
|
-
export type RoutingActionType = 'start' | 'stop' | 'pause' | 'restart';
|
|
5
|
+
export type RoutingActionType = 'start' | 'stop' | 'pause' | 'restart' | 'updateMoveParam';
|
|
6
6
|
export type RoutingType = 'videoPatrol';
|
|
7
7
|
export interface RoutingParam {
|
|
8
8
|
type: RoutingType;
|
|
@@ -12,6 +12,12 @@ export interface RoutingParam {
|
|
|
12
12
|
isRolerMoveOnRouting?: boolean;
|
|
13
13
|
isViewFollow?: boolean;
|
|
14
14
|
}
|
|
15
|
+
export interface RoutingMoveParam {
|
|
16
|
+
speed?: number;
|
|
17
|
+
isPauseAtRouting?: boolean;
|
|
18
|
+
isRolerMoveOnRouting?: boolean;
|
|
19
|
+
isViewFollow?: boolean;
|
|
20
|
+
}
|
|
15
21
|
export declare class RoutingAction extends Action {
|
|
16
22
|
/**
|
|
17
23
|
* 开始路由巡视
|
|
@@ -33,5 +39,11 @@ export declare class RoutingAction extends Action {
|
|
|
33
39
|
* 从暂停点继续开始巡视
|
|
34
40
|
*/
|
|
35
41
|
static restart(): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* 更新移动参数
|
|
44
|
+
* 巡视过程中动态更新移动相关参数
|
|
45
|
+
* @param param 移动参数
|
|
46
|
+
*/
|
|
47
|
+
static updateMoveParam(param: RoutingMoveParam): Promise<any>;
|
|
36
48
|
}
|
|
37
49
|
//# sourceMappingURL=Routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Routing.d.ts","sourceRoot":"","sources":["../../src/modules/Routing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAa,MAAM,UAAU,CAAC;AAG7C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Routing.d.ts","sourceRoot":"","sources":["../../src/modules/Routing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAa,MAAM,UAAU,CAAC;AAG7C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,iBAAiB,CAAA;AAG1F,MAAM,MAAM,WAAW,GAAG,aAAa,CAAA;AAGvC,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAeD,qBAAa,aAAc,SAAQ,MAAM;IACrC;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY;IAyChC;;;OAGG;IACH,MAAM,CAAC,IAAI;IAcX;;OAEG;IACH,MAAM,CAAC,KAAK;IAcZ;;;OAGG;IACH,MAAM,CAAC,OAAO;IAcd;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,gBAAgB;CAoCjD"}
|
package/dist/modules/Routing.js
CHANGED
|
@@ -78,5 +78,37 @@ export class RoutingAction extends Action {
|
|
|
78
78
|
};
|
|
79
79
|
return this.sendParam(sendParam, '重新开始路由巡视');
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* 更新移动参数
|
|
83
|
+
* 巡视过程中动态更新移动相关参数
|
|
84
|
+
* @param param 移动参数
|
|
85
|
+
*/
|
|
86
|
+
static updateMoveParam(param) {
|
|
87
|
+
// 如果 isViewFollow 为 true,则 isRolerMoveOnRouting 应该为 false
|
|
88
|
+
if (param.isViewFollow === true && param.isRolerMoveOnRouting === true) {
|
|
89
|
+
console.warn('当 isViewFollow 为 true 时,isRolerMoveOnRouting 应该为 false');
|
|
90
|
+
}
|
|
91
|
+
const data = {
|
|
92
|
+
action: 'updateMoveParam'
|
|
93
|
+
};
|
|
94
|
+
// 可选参数
|
|
95
|
+
if (param.speed !== undefined) {
|
|
96
|
+
data.speed = param.speed;
|
|
97
|
+
}
|
|
98
|
+
if (param.isPauseAtRouting !== undefined) {
|
|
99
|
+
data.isPauseAtRouting = param.isPauseAtRouting;
|
|
100
|
+
}
|
|
101
|
+
if (param.isRolerMoveOnRouting !== undefined) {
|
|
102
|
+
data.isRolerMoveOnRouting = param.isRolerMoveOnRouting;
|
|
103
|
+
}
|
|
104
|
+
if (param.isViewFollow !== undefined) {
|
|
105
|
+
data.isViewFollow = param.isViewFollow;
|
|
106
|
+
}
|
|
107
|
+
const sendParam = {
|
|
108
|
+
cmd: "routing",
|
|
109
|
+
data
|
|
110
|
+
};
|
|
111
|
+
return this.sendParam(sendParam, '更新移动参数');
|
|
112
|
+
}
|
|
81
113
|
}
|
|
82
114
|
//# sourceMappingURL=Routing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Routing.js","sourceRoot":"","sources":["../../src/modules/Routing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAa,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Routing.js","sourceRoot":"","sources":["../../src/modules/Routing.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAa,MAAM,UAAU,CAAC;AAuC7C,MAAM,OAAO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AAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAC3C,CAAC;QAED,MAAM,SAAS,GAAqB;YAChC,GAAG,EAAE,SAAS;YACd,IAAI;SACP,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACJ"}
|
package/package.json
CHANGED
package/src/modules/Routing.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Action, SendParam } from "./Action";
|
|
5
5
|
|
|
6
6
|
// 路由巡视动作类型
|
|
7
|
-
export type RoutingActionType = 'start' | 'stop' | 'pause' | 'restart'
|
|
7
|
+
export type RoutingActionType = 'start' | 'stop' | 'pause' | 'restart' | 'updateMoveParam'
|
|
8
8
|
|
|
9
9
|
// 路由巡视类型
|
|
10
10
|
export type RoutingType = 'videoPatrol'
|
|
@@ -19,6 +19,14 @@ export interface RoutingParam {
|
|
|
19
19
|
isViewFollow?: boolean; // 巡检途中视角是否跟随路径线,默认 false。true时,isRolerMoveOnRouting 应为 false
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// 更新移动参数
|
|
23
|
+
export interface RoutingMoveParam {
|
|
24
|
+
speed?: number; // 移动速度,越小越慢
|
|
25
|
+
isPauseAtRouting?: boolean; // 巡检途中遇到摄像头弹框时是否停下来,默认 false
|
|
26
|
+
isRolerMoveOnRouting?: boolean; // 巡检途中是否有人在路径上行走,默认 false
|
|
27
|
+
isViewFollow?: boolean; // 巡检途中视角是否跟随路径线,默认 false。true时,isRolerMoveOnRouting 应为 false
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
type RoutingParamType = SendParam & {
|
|
23
31
|
cmd: "routing";
|
|
24
32
|
data: {
|
|
@@ -131,4 +139,46 @@ export class RoutingAction extends Action {
|
|
|
131
139
|
};
|
|
132
140
|
return this.sendParam(sendParam, '重新开始路由巡视');
|
|
133
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 更新移动参数
|
|
145
|
+
* 巡视过程中动态更新移动相关参数
|
|
146
|
+
* @param param 移动参数
|
|
147
|
+
*/
|
|
148
|
+
static updateMoveParam(param: RoutingMoveParam) {
|
|
149
|
+
// 如果 isViewFollow 为 true,则 isRolerMoveOnRouting 应该为 false
|
|
150
|
+
if (param.isViewFollow === true && param.isRolerMoveOnRouting === true) {
|
|
151
|
+
console.warn('当 isViewFollow 为 true 时,isRolerMoveOnRouting 应该为 false');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const data: {
|
|
155
|
+
action: 'updateMoveParam';
|
|
156
|
+
speed?: number;
|
|
157
|
+
isPauseAtRouting?: boolean;
|
|
158
|
+
isRolerMoveOnRouting?: boolean;
|
|
159
|
+
isViewFollow?: boolean;
|
|
160
|
+
} = {
|
|
161
|
+
action: 'updateMoveParam'
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// 可选参数
|
|
165
|
+
if (param.speed !== undefined) {
|
|
166
|
+
data.speed = param.speed;
|
|
167
|
+
}
|
|
168
|
+
if (param.isPauseAtRouting !== undefined) {
|
|
169
|
+
data.isPauseAtRouting = param.isPauseAtRouting;
|
|
170
|
+
}
|
|
171
|
+
if (param.isRolerMoveOnRouting !== undefined) {
|
|
172
|
+
data.isRolerMoveOnRouting = param.isRolerMoveOnRouting;
|
|
173
|
+
}
|
|
174
|
+
if (param.isViewFollow !== undefined) {
|
|
175
|
+
data.isViewFollow = param.isViewFollow;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const sendParam: RoutingParamType = {
|
|
179
|
+
cmd: "routing",
|
|
180
|
+
data
|
|
181
|
+
};
|
|
182
|
+
return this.sendParam(sendParam, '更新移动参数');
|
|
183
|
+
}
|
|
134
184
|
}
|