Lac调度实体
parent
803d5c57f2
commit
9907813aed
@ -0,0 +1,179 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.base.enumutil;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @CreateDate : 2019-10-29 13:37
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public class LacEnumUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适配器类型
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum SUIT_CASE_TYPE {
|
||||||
|
SOFTWARE(10, "软件"),
|
||||||
|
HARDWARE(20, "硬件");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private SUIT_CASE_TYPE (int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < values().length; i++) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LacEnumUtil.SUIT_CASE_TYPE valueOf(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < values().length; i++) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
return values()[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 硬件类型
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum HARDWARE_TYPE {
|
||||||
|
OPC_READ(10, "读OPC"),
|
||||||
|
OPC_WRITE(20, "写OPC");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private HARDWARE_TYPE (int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < values().length; i++) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LacEnumUtil.HARDWARE_TYPE valueOf(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < values().length; i++) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
return values()[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数类型
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum PARAM_TYPE{
|
||||||
|
OUT_PARAM(1,"出参"),
|
||||||
|
IN_PARAM(2,"入参");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
PARAM_TYPE(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < values().length; i++) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指令集状态
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||||
|
public enum STACK_STATUS{
|
||||||
|
RUNNING(1,"运行中"),
|
||||||
|
PAUSE(2,"暂停"),
|
||||||
|
FINISH(3,"完成");
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
STACK_STATUS(int value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String valueOfDescription(int val) {
|
||||||
|
String tmp = null;
|
||||||
|
for (int i = 0; i < values().length; i++) {
|
||||||
|
if (values()[i].value == val) {
|
||||||
|
tmp = values()[i].description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isRunning(int val) {
|
||||||
|
return RUNNING.getValue() == val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.model.lac;
|
||||||
|
|
||||||
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : lac 适配请求信息
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @CreateDate : 2019-10-29 15:07
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@XStreamAlias("request")
|
||||||
|
public class LacSuitRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指令集代码
|
||||||
|
*/
|
||||||
|
private String commandStackCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数集合
|
||||||
|
*/
|
||||||
|
private List<Task> taskList;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.model.lac;
|
||||||
|
|
||||||
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : lac 适配响应信息
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @CreateDate : 2019-10-29 15:07
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@XStreamAlias("response")
|
||||||
|
public class LacSuitResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否成功
|
||||||
|
*/
|
||||||
|
private boolean success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态信息
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回数据
|
||||||
|
*/
|
||||||
|
private Object result;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.model.lac;
|
||||||
|
|
||||||
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @CreateDate : 2019-10-29 17:06
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@XStreamAlias("task")
|
||||||
|
public class Task {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private List<TaskParam> paramList;
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.model.lac;
|
||||||
|
|
||||||
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
import com.thoughtworks.xstream.annotations.XStreamConverter;
|
||||||
|
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @CreateDate : 2019-10-29 15:10
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@XStreamAlias("param")
|
||||||
|
@XStreamConverter(value= ToAttributedValueConverter.class, strings={"value"})
|
||||||
|
public class TaskParam {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue