jsy-app/utils/indexUtil/ValveControlParam.js

83 lines
2.3 KiB
JavaScript
Raw Permalink Normal View History

2024-11-27 18:46:21 +08:00
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;
2025-02-11 16:58:41 +08:00
/**
* @description 其他参数
* */
params = null;
2024-11-27 18:46:21 +08:00
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;
2025-02-11 16:58:41 +08:00
this.params = null;
2024-11-27 18:46:21 +08:00
}
clear () {
this.deviceTypeId = null;
this.deviceCode = null;
this.valveNo = null;
this.angle = null;
this.angleKey = null;
this.anglePercent = null;
2025-02-11 16:58:41 +08:00
this.params = null;
2024-11-27 18:46:21 +08:00
}
get () {
return {
deviceTypeId: this.deviceTypeId,
deviceCode: this.deviceCode,
valveNo: this.valveNo,
angle: this.angle,
angleKey: this.angleKey,
2025-02-11 16:58:41 +08:00
anglePercent: this.anglePercent,
params: this.params
2024-11-27 18:46:21 +08:00
};
}
}
export default ValveControlParam