@cpzxrobot/sdk 1.0.39 → 1.0.41
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/camera_gateway.ts +8 -7
- package/device_filter.ts +1 -0
- package/dist/camera_gateway.js +1 -1
- package/dist/device_filter.js +1 -0
- package/dist/index.js +1 -0
- package/dist/transport_gateway.js +1 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/readme.md +6 -1
- package/transport_gateway.ts +1 -1
- package/types.d.ts +0 -2
package/camera_gateway.ts
CHANGED
|
@@ -6,24 +6,25 @@ export class CameraGateway extends Object {
|
|
|
6
6
|
super();
|
|
7
7
|
this.context = context;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
async search(
|
|
11
11
|
data:
|
|
12
12
|
| Unit
|
|
13
13
|
| {
|
|
14
|
-
workshop_id
|
|
15
|
-
factory_id
|
|
16
|
-
unit_id
|
|
14
|
+
workshop_id?: number;
|
|
15
|
+
factory_id?: number;
|
|
16
|
+
unit_id?: number;
|
|
17
17
|
}
|
|
18
18
|
): Promise<any> {
|
|
19
19
|
var axios = await this.context.ready;
|
|
20
20
|
var params = {};
|
|
21
21
|
|
|
22
22
|
if (!("id" in data)) {
|
|
23
|
+
//should has unit_id or factory_id or workshop_id at least one, if has more than one, use unit_id first,then workshop_id, then factory_id
|
|
23
24
|
params = data as {
|
|
24
|
-
workshop_id
|
|
25
|
-
factory_id
|
|
26
|
-
unit_id
|
|
25
|
+
workshop_id?: number;
|
|
26
|
+
factory_id?: number;
|
|
27
|
+
unit_id?: number;
|
|
27
28
|
};
|
|
28
29
|
}else{
|
|
29
30
|
params = {unit_id:data.id}
|
package/device_filter.ts
CHANGED
package/dist/camera_gateway.js
CHANGED
|
@@ -6,11 +6,11 @@ class CameraGateway extends Object {
|
|
|
6
6
|
super();
|
|
7
7
|
this.context = context;
|
|
8
8
|
}
|
|
9
|
-
//搜索摄像头,传入unit对象或者unit的id
|
|
10
9
|
async search(data) {
|
|
11
10
|
var axios = await this.context.ready;
|
|
12
11
|
var params = {};
|
|
13
12
|
if (!("id" in data)) {
|
|
13
|
+
//should has unit_id or factory_id or workshop_id at least one, if has more than one, use unit_id first,then workshop_id, then factory_id
|
|
14
14
|
params = data;
|
|
15
15
|
}
|
|
16
16
|
else {
|
package/dist/device_filter.js
CHANGED
|
@@ -253,6 +253,7 @@ class DeviceFilter {
|
|
|
253
253
|
unit: options === null || options === void 0 ? void 0 : options.unit,
|
|
254
254
|
data: options === null || options === void 0 ? void 0 : options.data,
|
|
255
255
|
status: options === null || options === void 0 ? void 0 : options.status,
|
|
256
|
+
supplier: options === null || options === void 0 ? void 0 : options.supplier,
|
|
256
257
|
},
|
|
257
258
|
});
|
|
258
259
|
})
|
package/dist/index.js
CHANGED
package/index.ts
CHANGED
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -116,6 +116,10 @@ factory_id: 工厂id
|
|
|
116
116
|
|
|
117
117
|
如果入参为:{factory_id:xxx}则按工厂搜索
|
|
118
118
|
|
|
119
|
+
如果入参为:{workshop_id:xxx}则按车间搜索
|
|
120
|
+
|
|
121
|
+
如果入参为Unit对象,则按Unit对象的id进行搜索
|
|
122
|
+
|
|
119
123
|
### app功能相关
|
|
120
124
|
|
|
121
125
|
`cpzxrobot().saveBlob(blob,filname)`
|
|
@@ -134,4 +138,5 @@ heatlamp 属性提供了一组方法,用于管理猪场的热灯配置。它
|
|
|
134
138
|
**cpzxrobot().pigfarm.heatlamp.add(unit, data)**:添加新的热灯配置。
|
|
135
139
|
**cpzxrobot().pigfarm.heatlamp.list(unit)**:列出指定单元的所有热灯配置。
|
|
136
140
|
**cpzxrobot().pigfarm.heatlamp.get(id)**:获取指定 ID 的热灯配置。
|
|
137
|
-
**cpzxrobot().pigfarm.heatlamp.update(lamp)**:更新热灯配置。
|
|
141
|
+
**cpzxrobot().pigfarm.heatlamp.update(lamp)**:更新热灯配置。
|
|
142
|
+
|
package/transport_gateway.ts
CHANGED