+ * 表 + *
+ * + * @author caixiang + * @since 2022-05-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class DDJInfoCallBack implements Serializable { + + private static final long serialVersionUID = 1L; + private Integer status; + private String content; + private Integer taskId; +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/entity/TaskDTO.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/entity/TaskDTO.java new file mode 100644 index 0000000..2188fba --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/entity/TaskDTO.java @@ -0,0 +1,39 @@ +package com.cnbm.dispatchDDJ.entity; + +import lombok.Data; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2021/11/9 20:50 + */ +@Data +public class TaskDTO { + //任务类型 + private Integer missionType; + + //起点-排 + private Integer fromRow; + //起点-列 + private Integer fromList; + //起点-层 + private Integer fromLayer; + + //终点-排 + private Integer toRow; + //终点-列 + private Integer toList; + //终点-层 + private Integer toLayer; + + //货物尺寸 + private Integer goodsSiZe; + //坐标转换 + private Integer coordinateConversion; + + //任务号 + private Integer missionID; + + //条码值 + private Integer palletNum; +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/CodeEnum.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/CodeEnum.java new file mode 100644 index 0000000..d0c4dee --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/CodeEnum.java @@ -0,0 +1,15 @@ +package com.cnbm.dispatchDDJ.enums; + +/** + * @Author: 蔡翔 + * @Date: 2019/10/14 10:07 + * @Version 1.0 + */ +public interface CodeEnum { + Integer getNamespace(); + String getIdentity(); + String getType(); + String getName(); + String getDesc(); + void set(String name,Integer nameSpace,String identity); +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj1/DDJPlc2WcsVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj1/DDJPlc2WcsVar.java new file mode 100644 index 0000000..307f9a3 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj1/DDJPlc2WcsVar.java @@ -0,0 +1,110 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj1; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJPlc2WcsVar { + + Operate_Mode("Operate_Mode", PlcVar.INT,1, DaveArea.DB,2,0,0), + Mission_State("Mission_State",PlcVar.INT,1,DaveArea.DB,2,2,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,2,4,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,2,6,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,2,8,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,2,10,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,2,12,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,2,14,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,2,16,0), + Act_Pos_X("Act_Pos_X", PlcVar.DINT,1, DaveArea.DB,2,18,0), + Act_Pos_Y("Act_Pos_Y", PlcVar.DINT,1, DaveArea.DB,2,22,0), + Act_Speed_X("Act_Speed_X", PlcVar.DINT,1, DaveArea.DB,2,26,0), + Act_Speed_Y("Act_Speed_Y", PlcVar.DINT,1, DaveArea.DB,2,30,0), + Status_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,2,34,0), + Status_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,2,35,0), + Fault_No("Fault_No", PlcVar.INT,1, DaveArea.DB,2,36,0), + Now_List("Now_List", PlcVar.INT,1, DaveArea.DB,2,38,0), + Now_Layer("Now_Layer", PlcVar.INT,1, DaveArea.DB,2,40,0), + Mission_ID("Act_Pos_X", PlcVar.INT,1, DaveArea.DB,2,42,0), + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,2,44,0), + + + + + + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj1/DDJWcs2PlcVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj1/DDJWcs2PlcVar.java new file mode 100644 index 0000000..2d90354 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj1/DDJWcs2PlcVar.java @@ -0,0 +1,101 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj1; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJWcs2PlcVar { + + Mission_Count("Mission_Count", PlcVar.INT,1, DaveArea.DB,1,0,0), + Command_No("Command_No", PlcVar.INT,1, DaveArea.DB,1,2,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,1,4,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,1,6,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,1,8,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,1,10,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,1,12,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,1,14,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,1,16,0), + Control_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,1,18,0), + Control_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,1,19,0), + Goods_Size("Goods_Size", PlcVar.INT,1, DaveArea.DB,1,20,0), + Coordinate_conversion("Coordinate_conversion", PlcVar.INT,1, DaveArea.DB,1,22,0), + Mission_ID("Mission_ID", PlcVar.INT,1, DaveArea.DB,1,24,0), + //todo 条码值 要写长度 + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,1,26,0), + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj2/DDJPlc2WcsVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj2/DDJPlc2WcsVar.java new file mode 100644 index 0000000..04ed891 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj2/DDJPlc2WcsVar.java @@ -0,0 +1,110 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj2; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJPlc2WcsVar { + + Operate_Mode("Operate_Mode", PlcVar.INT,1, DaveArea.DB,2,0,0), + Mission_State("Mission_State",PlcVar.INT,1,DaveArea.DB,2,2,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,2,4,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,2,6,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,2,8,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,2,10,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,2,12,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,2,14,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,2,16,0), + Act_Pos_X("Act_Pos_X", PlcVar.DINT,1, DaveArea.DB,2,18,0), + Act_Pos_Y("Act_Pos_Y", PlcVar.DINT,1, DaveArea.DB,2,22,0), + Act_Speed_X("Act_Speed_X", PlcVar.DINT,1, DaveArea.DB,2,26,0), + Act_Speed_Y("Act_Speed_Y", PlcVar.DINT,1, DaveArea.DB,2,30,0), + Status_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,2,34,0), + Status_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,2,35,0), + Fault_No("Fault_No", PlcVar.INT,1, DaveArea.DB,2,36,0), + Now_List("Now_List", PlcVar.INT,1, DaveArea.DB,2,38,0), + Now_Layer("Now_Layer", PlcVar.INT,1, DaveArea.DB,2,40,0), + Mission_ID("Act_Pos_X", PlcVar.INT,1, DaveArea.DB,2,42,0), + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,2,44,0), + + + + + + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj2/DDJWcs2PlcVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj2/DDJWcs2PlcVar.java new file mode 100644 index 0000000..ea833d4 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj2/DDJWcs2PlcVar.java @@ -0,0 +1,101 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj2; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJWcs2PlcVar { + + Mission_Count("Mission_Count", PlcVar.INT,1, DaveArea.DB,1,0,0), + Command_No("Command_No", PlcVar.INT,1, DaveArea.DB,1,2,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,1,4,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,1,6,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,1,8,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,1,10,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,1,12,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,1,14,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,1,16,0), + Control_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,1,18,0), + Control_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,1,19,0), + Goods_Size("Goods_Size", PlcVar.INT,1, DaveArea.DB,1,20,0), + Coordinate_conversion("Coordinate_conversion", PlcVar.INT,1, DaveArea.DB,1,22,0), + Mission_ID("Mission_ID", PlcVar.INT,1, DaveArea.DB,1,24,0), + //todo 条码值 要写长度 + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,1,26,0), + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj3/DDJPlc2WcsVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj3/DDJPlc2WcsVar.java new file mode 100644 index 0000000..5562ac7 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj3/DDJPlc2WcsVar.java @@ -0,0 +1,110 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj3; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJPlc2WcsVar { + + Operate_Mode("Operate_Mode", PlcVar.INT,1, DaveArea.DB,2,0,0), + Mission_State("Mission_State",PlcVar.INT,1,DaveArea.DB,2,2,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,2,4,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,2,6,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,2,8,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,2,10,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,2,12,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,2,14,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,2,16,0), + Act_Pos_X("Act_Pos_X", PlcVar.DINT,1, DaveArea.DB,2,18,0), + Act_Pos_Y("Act_Pos_Y", PlcVar.DINT,1, DaveArea.DB,2,22,0), + Act_Speed_X("Act_Speed_X", PlcVar.DINT,1, DaveArea.DB,2,26,0), + Act_Speed_Y("Act_Speed_Y", PlcVar.DINT,1, DaveArea.DB,2,30,0), + Status_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,2,34,0), + Status_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,2,35,0), + Fault_No("Fault_No", PlcVar.INT,1, DaveArea.DB,2,36,0), + Now_List("Now_List", PlcVar.INT,1, DaveArea.DB,2,38,0), + Now_Layer("Now_Layer", PlcVar.INT,1, DaveArea.DB,2,40,0), + Mission_ID("Act_Pos_X", PlcVar.INT,1, DaveArea.DB,2,42,0), + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,2,44,0), + + + + + + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj3/DDJWcs2PlcVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj3/DDJWcs2PlcVar.java new file mode 100644 index 0000000..fbd5b9c --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj3/DDJWcs2PlcVar.java @@ -0,0 +1,101 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj3; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJWcs2PlcVar { + + Mission_Count("Mission_Count", PlcVar.INT,1, DaveArea.DB,1,0,0), + Command_No("Command_No", PlcVar.INT,1, DaveArea.DB,1,2,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,1,4,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,1,6,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,1,8,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,1,10,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,1,12,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,1,14,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,1,16,0), + Control_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,1,18,0), + Control_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,1,19,0), + Goods_Size("Goods_Size", PlcVar.INT,1, DaveArea.DB,1,20,0), + Coordinate_conversion("Coordinate_conversion", PlcVar.INT,1, DaveArea.DB,1,22,0), + Mission_ID("Mission_ID", PlcVar.INT,1, DaveArea.DB,1,24,0), + //todo 条码值 要写长度 + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,1,26,0), + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj4/DDJPlc2WcsVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj4/DDJPlc2WcsVar.java new file mode 100644 index 0000000..25a992c --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj4/DDJPlc2WcsVar.java @@ -0,0 +1,110 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj4; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJPlc2WcsVar { + + Operate_Mode("Operate_Mode", PlcVar.INT,1, DaveArea.DB,2,0,0), + Mission_State("Mission_State",PlcVar.INT,1,DaveArea.DB,2,2,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,2,4,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,2,6,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,2,8,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,2,10,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,2,12,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,2,14,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,2,16,0), + Act_Pos_X("Act_Pos_X", PlcVar.DINT,1, DaveArea.DB,2,18,0), + Act_Pos_Y("Act_Pos_Y", PlcVar.DINT,1, DaveArea.DB,2,22,0), + Act_Speed_X("Act_Speed_X", PlcVar.DINT,1, DaveArea.DB,2,26,0), + Act_Speed_Y("Act_Speed_Y", PlcVar.DINT,1, DaveArea.DB,2,30,0), + Status_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,2,34,0), + Status_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,2,35,0), + Fault_No("Fault_No", PlcVar.INT,1, DaveArea.DB,2,36,0), + Now_List("Now_List", PlcVar.INT,1, DaveArea.DB,2,38,0), + Now_Layer("Now_Layer", PlcVar.INT,1, DaveArea.DB,2,40,0), + Mission_ID("Act_Pos_X", PlcVar.INT,1, DaveArea.DB,2,42,0), + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,2,44,0), + + + + + + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJPlc2WcsVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj4/DDJWcs2PlcVar.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj4/DDJWcs2PlcVar.java new file mode 100644 index 0000000..b3ea34b --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/enums/ddj/ddj4/DDJWcs2PlcVar.java @@ -0,0 +1,101 @@ +package com.cnbm.dispatchDDJ.enums.ddj.ddj4; + +import com.cnbm.s7.s7connector.api.DaveArea; +import com.cnbm.s7.s7connector.type.PlcVar; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023/2/21 19:35 + */ +public enum DDJWcs2PlcVar { + + Mission_Count("Mission_Count", PlcVar.INT,1, DaveArea.DB,1,0,0), + Command_No("Command_No", PlcVar.INT,1, DaveArea.DB,1,2,0), + Mission_Type("Mission_Type",PlcVar.INT,1,DaveArea.DB,1,4,0), + From_Row("From_Row",PlcVar.INT,1,DaveArea.DB,1,6,0), + From_List("From_List",PlcVar.INT,1,DaveArea.DB,1,8,0), + From_Layer("From_Layer",PlcVar.INT,1,DaveArea.DB,1,10,0), + To_Row("To_Row",PlcVar.INT,1,DaveArea.DB,1,12,0), + To_List("To_List",PlcVar.INT,1,DaveArea.DB,1,14,0), + To_Layer("To_Layer",PlcVar.INT,1,DaveArea.DB,1,16,0), + Control_bit1("Status_bit1", PlcVar.BOOL_Array,8, DaveArea.DB,1,18,0), + Control_bit2("Status_bit2", PlcVar.BOOL_Array,8, DaveArea.DB,1,19,0), + Goods_Size("Goods_Size", PlcVar.INT,1, DaveArea.DB,1,20,0), + Coordinate_conversion("Coordinate_conversion", PlcVar.INT,1, DaveArea.DB,1,22,0), + Mission_ID("Mission_ID", PlcVar.INT,1, DaveArea.DB,1,24,0), + //todo 条码值 要写长度 + Pallet_Num("Pallet_Num", PlcVar.STRING,1, DaveArea.DB,1,26,0), + + ; + + private String name; + private DaveArea area; + private Integer areaNumber; + private Integer byteOffset; + private Integer bitOffset; + private PlcVar type; + //length = 1代表 非数组;;; length > 1 代表数组 ;; 注意 length这个参数 是实际plc中 数组的长度,和read操作相关 + //如果是String 类型不用填length 只需要填string类型的起始位置就行了,我会自己去取数据长度(也就是说这里的length并不是string 的长度)。 + private Integer length; + + //这个字段只是给 字符串变量 和 字符串数组 用, 这个字段是plc中设置的最大String长度 + private Integer strSize; + + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = 0; + } + DDJWcs2PlcVar(String name, PlcVar type, Integer length, DaveArea area, Integer areaNumber, Integer byteOffset, Integer bitOffset, Integer strSize){ + this.name = name; + this.type = type; + this.length = length; + this.area = area; + this.areaNumber = areaNumber; + this.byteOffset = byteOffset; + this.bitOffset = bitOffset; + this.strSize = strSize; + } + + public Integer getStrSize() { + return strSize; + } + + public void setStrSize(Integer strSize) { + this.strSize = strSize; + } + + public String getName() { + return name; + } + + public DaveArea getArea() { + return area; + } + + public Integer getAreaNumber() { + return areaNumber; + } + + public Integer getBitOffset() { + return bitOffset; + } + + public Integer getByteOffset() { + return byteOffset; + } + + public PlcVar getType() { + return type; + } + + public Integer getLength() { + return length; + } +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/interfaces/Listener.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/interfaces/Listener.java new file mode 100644 index 0000000..4cb298e --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/interfaces/Listener.java @@ -0,0 +1,10 @@ +package com.cnbm.dispatchDDJ.interfaces; + +/** + * @Desc: "" + * @Author: caixiang + * @DATE: 2023-07-28 14:54 + */ +public interface Listener { + public void addRuntimeEQErrListener(RuntimeEQErrListener errCode); +} diff --git a/ym-packing/src/main/java/com/cnbm/dispatchDDJ/interfaces/RuntimeEQErrListener.java b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/interfaces/RuntimeEQErrListener.java new file mode 100644 index 0000000..320cf62 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/dispatchDDJ/interfaces/RuntimeEQErrListener.java @@ -0,0 +1,31 @@ +package com.cnbm.dispatchDDJ.interfaces; + + + + + +import java.util.EventListener; + +/** + * SecsMessage receive Listener. + * + *
+ * This interface is used in {@link #()}
+ * Receive-Message is only Primary-Message.
+ *
+ * Not accept {@code null}.
+ *