@cpzxrobot/sdk 1.0.71 → 1.0.73

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.
@@ -190,6 +190,11 @@ export class FeedTowerGateway extends DeviceFilter<FeedTower> {
190
190
  update: (ft: FeedTowerV2) => {
191
191
  return this.context.axios.post("/api/v2/device/feedTower/update", ft);
192
192
  },
193
+ adzero: (ft: FeedTowerV2) => {
194
+ return this.context.axios.post(`/api/v2/device/feedTower/adzero`,{
195
+ id: ft.id
196
+ });
197
+ }
193
198
  };
194
199
  }
195
200
  }
@@ -128,6 +128,11 @@ class FeedTowerGateway extends device_filter_1.DeviceFilter {
128
128
  update: (ft) => {
129
129
  return this.context.axios.post("/api/v2/device/feedTower/update", ft);
130
130
  },
131
+ adzero: (ft) => {
132
+ return this.context.axios.post(`/api/v2/device/feedTower/adzero`, {
133
+ id: ft.id
134
+ });
135
+ }
131
136
  };
132
137
  }
133
138
  }
@@ -62,6 +62,12 @@ class PigfarmGateway extends Object {
62
62
  });
63
63
  });
64
64
  }
65
+ //根据单元类型和传感器类型获取告警阈值曲线
66
+ threshold(data, sensorType) {
67
+ return this.context.ready.then((axios) => {
68
+ return axios.get(`/api/v1/pigfarm/alertThershold/${data.type}/${sensorType}`, data);
69
+ });
70
+ }
65
71
  get relay() {
66
72
  return {
67
73
  list: (unit) => {
@@ -57,6 +57,12 @@ class UnitGateway extends Object {
57
57
  return axios.get(`/api/v2/unit/delete?id=${unit.id}`);
58
58
  });
59
59
  },
60
+ //获取单元的展示布局信息
61
+ layout: (unit) => {
62
+ return this.context.ready.then((axios) => {
63
+ return axios.get(`/api/v2/unit/config/appLayout/${unit.id}`);
64
+ });
65
+ },
60
66
  };
61
67
  }
62
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -81,6 +81,16 @@ export class PigfarmGateway extends Object {
81
81
  });
82
82
  }
83
83
 
84
+ //根据单元类型和传感器类型获取告警阈值曲线
85
+ threshold(data: Unit, sensorType: String) {
86
+ return this.context.ready.then((axios) => {
87
+ return axios.get(
88
+ `/api/v1/pigfarm/alertThershold/${data.type}/${sensorType}`,
89
+ data
90
+ );
91
+ });
92
+ }
93
+
84
94
  get relay() {
85
95
  return {
86
96
  list: (unit: Unit) => {
@@ -109,7 +119,6 @@ export class PigfarmGateway extends Object {
109
119
  return axios.get(`/api/v2/pigfarm/weightMeter/list/${factory.id}`);
110
120
  });
111
121
  },
112
-
113
122
  add: (data: WeightMeter) => {
114
123
  return this.context.ready.then((axios) => {
115
124
  return axios.post(`/api/v2/pigfarm/weightMeter/add`, data);
@@ -178,7 +187,7 @@ export class PigfarmGateway extends Object {
178
187
  });
179
188
  },
180
189
  update: (data: weightMeterSensorsConfig) => {
181
- if(!data.weightMeterConfigId){
190
+ if (!data.weightMeterConfigId) {
182
191
  throw new Error("weightMeterConfigId不能为空");
183
192
  }
184
193
  return this.context.ready.then((axios) => {
@@ -189,7 +198,7 @@ export class PigfarmGateway extends Object {
189
198
  });
190
199
  },
191
200
  add: (data: weightMeterSensorsConfig) => {
192
- if(data.weightMeterConfigId){
201
+ if (data.weightMeterConfigId) {
193
202
  throw new Error("weightMeterConfigId不为空");
194
203
  }
195
204
  return this.context.ready.then((axios) => {
package/readme.md CHANGED
@@ -78,6 +78,7 @@ baseURL: "/"
78
78
  | cpzxrobot().device.data | 获得设备的数据,该接口用于获取单个设备的详细数据 |
79
79
  | cpzxrobot().device.feedTower.list | 获得料塔设备的列表 |
80
80
  | cpzxrobot().device.feedTower.v2.list | 获得料塔设备的列表(新版),暂不支持v1版本的data等附加参数,只支持按工厂获取 |
81
+ | cpzxrobot().device.feedTower.v2.adzero | 将某一个特定料塔设置清零 |
81
82
  | cpzxrobot().device.xxx | 获得设备的相关信息 |
82
83
  | cpzxrobot().device.v2.add | 新增设备(仅限v2设备) |
83
84
  | cpzxrobot().device.v2.update | 更新设备(仅限v2设备) |
@@ -101,11 +102,13 @@ baseURL: "/"
101
102
  | cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
102
103
  | cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
103
104
  | cpzxrobot().pigfarm.heatlamp.iotFields | 获取保温灯用于获取iot的字段列表 |
105
+ | cpzxrobot().pigfarm.threshold | 获取单元中特定类型的阈值信息 |
104
106
  | cpzxrobot().scanQrcode | 调用扫码功能,获得扫码文字 |
105
107
  | cpzxrobot().unit.v2.list | 获得单元列表,v2版本 |
106
108
  | cpzxrobot().unit.v2.add | 添加单元,v2版本 |
107
109
  | cpzxrobot().unit.v2.update | 更新单元,v2版本 |
108
110
  | cpzxrobot().unit.v2.delete | 删除单元,v2版本 |
111
+ | cpzxrobot().unit.v2.layout | 获取单元的展示布局,v2版本 |
109
112
 
110
113
 
111
114
  ### 工厂信息接口
package/unit_gateway.ts CHANGED
@@ -72,6 +72,12 @@ export class UnitGateway extends Object {
72
72
  return axios.get(`/api/v2/unit/delete?id=${unit.id}`);
73
73
  });
74
74
  },
75
+ //获取单元的展示布局信息
76
+ layout: (unit: Unit) => {
77
+ return this.context.ready.then((axios) => {
78
+ return axios.get(`/api/v2/unit/config/appLayout/${unit.id}`);
79
+ });
80
+ },
75
81
  };
76
82
  }
77
83
  }