parent
9b60d9da7a
commit
169a9ba45f
@ -0,0 +1,110 @@
|
|||||||
|
package org.jeecg.custom.enums;
|
||||||
|
|
||||||
|
import com.fazecast.jSerialComm.SerialPort;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
// 设备枚举
|
||||||
|
public enum DEVICE_TYPE {
|
||||||
|
|
||||||
|
COM1("192.168.10.201", "烘箱1", "", SerialPort.EVEN_PARITY),
|
||||||
|
COM2("192.168.10.202", "烘箱2", "", 2),
|
||||||
|
COM3("192.168.10.203", "烘箱3", "", 2),
|
||||||
|
COM4("192.168.10.204", "烘箱4", "", 2),
|
||||||
|
COM5("192.168.10.205", "烘箱5", "",2),
|
||||||
|
COM6("192.168.10.218", "烘箱6", "",2),
|
||||||
|
COM11("192.168.10.211", "模具1", "",2),
|
||||||
|
COM12("192.168.10.212", "模具2", "",2),
|
||||||
|
COM21("192.168.10.215", "罐子1", "",2),
|
||||||
|
COM22("192.168.10.216", "罐子2", "",2),
|
||||||
|
COM23("192.168.10.217", "罐子3", "",2),
|
||||||
|
COM24("192.168.10.229", "罐子4", "",2),
|
||||||
|
COM31("192.168.10.225", "数字电表1", "1B 03 00 32 00 02 67 FE", SerialPort.NO_PARITY),
|
||||||
|
COM32("192.168.10.226", "数字电表2", "07 03 00 32 00 02 65 A2", 0),
|
||||||
|
COM33("192.168.10.227", "数字电表3", "A0 03 00 32 00 02 7C B5",0),
|
||||||
|
COM34("192.168.10.228", "数字电表4", "1D 03 00 32 00 02 67 98",0);
|
||||||
|
|
||||||
|
|
||||||
|
private String hostNum;
|
||||||
|
private String name;
|
||||||
|
private String command;
|
||||||
|
|
||||||
|
private Integer parity;
|
||||||
|
|
||||||
|
private static final String tempCmd = "01 03 20 00 00 01 8F CA";
|
||||||
|
|
||||||
|
private DEVICE_TYPE(String hostNum, String name, String cmd, Integer parity) {
|
||||||
|
this.hostNum = hostNum;
|
||||||
|
this.name = name;
|
||||||
|
this.parity = parity;
|
||||||
|
this.command = StringUtils.isEmpty(cmd) ? tempCmd : cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHostNum() {
|
||||||
|
return hostNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommand(){
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getParity(){
|
||||||
|
return parity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 模具设备列表
|
||||||
|
public static List<DEVICE_TYPE> getJzjMolds() {
|
||||||
|
List<DEVICE_TYPE> jzjMolds = Arrays.asList(
|
||||||
|
DEVICE_TYPE.COM11,
|
||||||
|
DEVICE_TYPE.COM12
|
||||||
|
);
|
||||||
|
return jzjMolds;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 浇注机设备列表
|
||||||
|
public static List<DEVICE_TYPE> getJzjDevice() {
|
||||||
|
List<DEVICE_TYPE> jzjDevice = Arrays.asList(
|
||||||
|
DEVICE_TYPE.COM1,
|
||||||
|
DEVICE_TYPE.COM2,
|
||||||
|
DEVICE_TYPE.COM3,
|
||||||
|
DEVICE_TYPE.COM4,
|
||||||
|
DEVICE_TYPE.COM5,
|
||||||
|
DEVICE_TYPE.COM6,
|
||||||
|
DEVICE_TYPE.COM11,
|
||||||
|
DEVICE_TYPE.COM12
|
||||||
|
);
|
||||||
|
return jzjDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 集中供料罐列表
|
||||||
|
public static List<DEVICE_TYPE> getGzDevice() {
|
||||||
|
List<DEVICE_TYPE> gzDevice = Arrays.asList(
|
||||||
|
DEVICE_TYPE.COM21,
|
||||||
|
DEVICE_TYPE.COM22,
|
||||||
|
DEVICE_TYPE.COM23,
|
||||||
|
DEVICE_TYPE.COM24
|
||||||
|
);
|
||||||
|
return gzDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 数字电表列表
|
||||||
|
public static List<DEVICE_TYPE> getMeterDevice() {
|
||||||
|
List<DEVICE_TYPE> meterDevice = Arrays.asList(
|
||||||
|
DEVICE_TYPE.COM31,
|
||||||
|
DEVICE_TYPE.COM32,
|
||||||
|
DEVICE_TYPE.COM33,
|
||||||
|
DEVICE_TYPE.COM34
|
||||||
|
);
|
||||||
|
return meterDevice;
|
||||||
|
}
|
||||||
|
}
|
@ -1,56 +0,0 @@
|
|||||||
package org.jeecg.rscom.enums;
|
|
||||||
|
|
||||||
import com.fazecast.jSerialComm.SerialPort;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
// 设备枚举
|
|
||||||
public enum DEVICE_TYPE {
|
|
||||||
|
|
||||||
COM1("201", "烘箱1", "", SerialPort.EVEN_PARITY),
|
|
||||||
COM2("202", "烘箱2", "", 2),
|
|
||||||
COM3("203", "烘箱3", "", 2),
|
|
||||||
COM4("204", "烘箱4", "", 2),
|
|
||||||
COM5("205", "烘箱5", "",2),
|
|
||||||
COM6("218", "烘箱6", "",2),
|
|
||||||
COM11("211", "模具1", "",2),
|
|
||||||
COM12("212", "模具2", "",2),
|
|
||||||
COM21("215", "罐子1", "",2),
|
|
||||||
COM22("216", "罐子2", "",2),
|
|
||||||
COM23("217", "罐子3", "",2),
|
|
||||||
COM31("225", "数字电表1", "1B 03 00 32 00 02 67 FE", SerialPort.NO_PARITY),
|
|
||||||
COM32("226", "数字电表2", "07 03 00 32 00 02 65 A2", 0),
|
|
||||||
COM33("227", "数字电表3", "A0 03 00 32 00 02 7C B5",0),
|
|
||||||
COM34("228", "数字电表4", "1D 03 00 32 00 02 67 98",0),
|
|
||||||
COM35("229", "数字电表5", "",0); // todo
|
|
||||||
|
|
||||||
private String hostNum;
|
|
||||||
private String name;
|
|
||||||
private String command;
|
|
||||||
|
|
||||||
private Integer parity;
|
|
||||||
|
|
||||||
private static final String tempCmd = "01 03 20 00 00 01 8F CA";
|
|
||||||
|
|
||||||
private DEVICE_TYPE(String hostNum, String name, String cmd, Integer parity) {
|
|
||||||
this.hostNum = hostNum;
|
|
||||||
this.name = name;
|
|
||||||
this.parity = parity;
|
|
||||||
this.command = StringUtils.isEmpty(cmd) ? tempCmd : cmd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHostNum() {
|
|
||||||
return hostNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCommand(){
|
|
||||||
return command;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getParity(){
|
|
||||||
return parity;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue