You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.8 KiB
62 lines
1.8 KiB
package com.mh.user.constants; |
|
|
|
import com.mh.user.factory.*; |
|
|
|
/** |
|
* @author LJF |
|
* @version 1.0 |
|
* @project CHWS |
|
* @description 设备枚举类 |
|
* @date 2024-03-19 10:06:29 |
|
*/ |
|
public enum DeviceEnum { |
|
|
|
WtMeterEnum("水表", WtMeter.getInstance()), |
|
EleMeterEnum("电表", EleMeter.getInstance()), |
|
PressureTransEnum("压变", PressureTrans.getInstance()), |
|
HeatPumpEnum("热泵", HeatPump.getInstance()), |
|
TempControlEnum("温控", TempControl.getInstance()), |
|
BackTempControlEnum("回水温控", BackTempControl.getInstance()), |
|
TimeControlEnum("时控", TimeControl.getInstance()), |
|
ALiTaControlEnum("阿丽塔时控", TimeControl.getInstance()), |
|
WaterLevelSwitchEnum("水位开关", WaterLevelSwitch.getInstance()), |
|
StatusCheckEnum("状态检测", StatusCheck.getInstance()), |
|
TempTransEnum("温度变送器", TempTrans.getInstance()), |
|
HeatPumpStatusEnum("热泵状态", HeatPumpStatus.getInstance()), |
|
MultiControlEnum("多路控制", MultiControl.getInstance()); |
|
|
|
private String deviceType; |
|
|
|
private Device device; |
|
|
|
private |
|
DeviceEnum(String deviceType, Device device) { |
|
this.deviceType = deviceType; |
|
this.device = device; |
|
} |
|
|
|
public String getDeviceType() { |
|
return deviceType; |
|
} |
|
|
|
public void setDeviceType(String deviceType) { |
|
this.deviceType = deviceType; |
|
} |
|
|
|
public Device getDevice() { |
|
return device; |
|
} |
|
|
|
public void setDevice(Device device) { |
|
this.device = device; |
|
} |
|
|
|
public static Device getDevice(String deviceType) { |
|
for (DeviceEnum deviceEnum : DeviceEnum.values()) { |
|
if (deviceEnum.getDeviceType().equals(deviceType)) { |
|
return deviceEnum.getDevice(); |
|
} |
|
} |
|
return null; |
|
} |
|
}
|
|
|