jsy-app/utils/indexUtil/ValveControlParam.js
2025-02-11 16:58:41 +08:00

83 lines
2.3 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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