83 lines
2.3 KiB
JavaScript
83 lines
2.3 KiB
JavaScript
class ValveControlParam {
|
||
/**
|
||
* @description 设备类型
|
||
* @1 433基站
|
||
* @2 433阀门
|
||
* @3 4G阀门
|
||
* @4 施肥机
|
||
* @5 首部控制器
|
||
* @6 气象站
|
||
* @7 病虫
|
||
* @8 孢子
|
||
* @9 监控
|
||
* @10 杀虫灯
|
||
* @11 蝶阀
|
||
* @12 4G蝶阀
|
||
* @13 五通阀
|
||
* */
|
||
deviceTypeId = null;
|
||
/**
|
||
* @description 设备编码 系统内唯一
|
||
* */
|
||
deviceCode = null;
|
||
/**
|
||
* @蝶阀 蝶阀为子设备索引,现在默认都是1;
|
||
* @三通 三通阀为开关索引:1①开 2②开 3全开 4全关;
|
||
* @五通 五通阀为阀口1234对应1234口;
|
||
* */
|
||
valveNo = null;
|
||
/**
|
||
* @description 若此参数 有值,使用此参数直接控制,忽略参数 [angleKey][anglePer]
|
||
* @description 系统正常控制无此参数,目前有2种情况会传递此参数。,其它场景待扩展。
|
||
* @description ①给第三方提供API时,可以传递此参数控制
|
||
* @description ②调试的时候,可以传递此参数控制
|
||
* */
|
||
angle = null;
|
||
/**
|
||
* @description 对应操作的adc配置key
|
||
* @description 和 角度百分比[anglePer] 配套使用
|
||
* */
|
||
angleKey = null;
|
||
/**
|
||
* @description 和 目标角度key[angleKey] 配套使用
|
||
* */
|
||
anglePercent = null;
|
||
/**
|
||
* @description 其他参数
|
||
* */
|
||
params = null;
|
||
|
||
|
||
constructor(deviceTypeId = null, deviceCode = null, valveNo = null, angle = null, angleKey = null, anglePercent = null) {
|
||
this.deviceTypeId = deviceTypeId;
|
||
this.deviceCode = deviceCode;
|
||
this.valveNo = valveNo;
|
||
this.angle = angle;
|
||
this.angleKey = angleKey;
|
||
this.anglePercent = anglePercent;
|
||
this.params = null;
|
||
}
|
||
|
||
clear () {
|
||
this.deviceTypeId = null;
|
||
this.deviceCode = null;
|
||
this.valveNo = null;
|
||
this.angle = null;
|
||
this.angleKey = null;
|
||
this.anglePercent = null;
|
||
this.params = null;
|
||
}
|
||
|
||
get () {
|
||
return {
|
||
deviceTypeId: this.deviceTypeId,
|
||
deviceCode: this.deviceCode,
|
||
valveNo: this.valveNo,
|
||
angle: this.angle,
|
||
angleKey: this.angleKey,
|
||
anglePercent: this.anglePercent,
|
||
params: this.params
|
||
};
|
||
}
|
||
}
|
||
export default ValveControlParam |