设备在线状态和工作状态取值调整
This commit is contained in:
@ -80,7 +80,8 @@ public class ModbusProcessor {
|
||||
break;
|
||||
}
|
||||
case HOLDING_REGISTER: {
|
||||
writeRegisterRequest(master, config.getSlaveId(), address, Integer.parseInt(String.valueOf(tag.getValue())));
|
||||
double doubleValue = Double.parseDouble(String.valueOf(tag.getValue()));
|
||||
writeRegisterRequest(master, config.getSlaveId(), address, (int) doubleValue);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package com.xzzn.common.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* device-通信状态
|
||||
*
|
||||
@ -11,10 +8,7 @@ import java.util.List;
|
||||
public enum DeviceRunningStatus
|
||||
{
|
||||
OFFLINE("0", "离线"),
|
||||
STANDBY("1", "待机") ,
|
||||
RUNNING("2", "运行"),
|
||||
FAULT("3", "故障"),
|
||||
SHUTDOWN("4", "停机");
|
||||
ONLINE("1", "在线");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
@ -35,15 +29,4 @@ public enum DeviceRunningStatus
|
||||
return info;
|
||||
}
|
||||
|
||||
/** 停机状态 */
|
||||
public static List<String> getShutdownCodeList()
|
||||
{
|
||||
return Arrays.asList(SHUTDOWN.getCode());
|
||||
}
|
||||
|
||||
/** 运行状态 */
|
||||
public static List<String> getRunningCodeList()
|
||||
{
|
||||
return Arrays.asList(STANDBY.getCode(), RUNNING.getCode(), FAULT.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ package com.xzzn.common.enums;
|
||||
*/
|
||||
public enum WorkStatus
|
||||
{
|
||||
NORMAL("0", "正常"), ABNORMAL("1", "异常"), STOP("2", "停止");
|
||||
NORMAL("0", "运行"), STOP("1", "停机"), ABNORMAL("2", "故障");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
Reference in New Issue
Block a user