|  |  |  | 
|---|
|  |  |  | import com.zy.core.model.DevpSlave; | 
|---|
|  |  |  | import com.zy.core.model.Task; | 
|---|
|  |  |  | import com.zy.core.model.protocol.StaProtocol; | 
|---|
|  |  |  | import com.zy.core.properties.SlaveProperties; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.text.MessageFormat; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | 
|---|
|  |  |  | private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>(); | 
|---|
|  |  |  | private short heartBeatVal = 1; | 
|---|
|  |  |  | public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{ | 
|---|
|  |  |  | add(101);add(102);add(103);add(104);add(105);add(106);add(107);add(108);add(109); | 
|---|
|  |  |  | add(110);add(111);add(112);add(113);add(114);add(115);add(116);add(117);add(118);add(119); | 
|---|
|  |  |  | add(120);add(121);add(122);add(123);add(124);add(125);add(126);add(127);add(128);add(129); | 
|---|
|  |  |  | add(130);add(131);add(132);add(133);add(134);add(135);add(136); | 
|---|
|  |  |  | add(101);add(102);add(103);add(104); | 
|---|
|  |  |  | add(201);add(202);add(203);add(204); | 
|---|
|  |  |  | add(301);add(302);add(303);add(304);add(305);add(306); | 
|---|
|  |  |  | }}; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public IoModeType ioMode = IoModeType.NONE; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 182站堆垛机执行中出库数量 | 
|---|
|  |  |  | * 条码数量 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int PRE_COUNT=0; | 
|---|
|  |  |  | private SlaveProperties slaveProperties; | 
|---|
|  |  |  | private int barcodeSize = 1; | 
|---|
|  |  |  | public IoModeType ioMode = IoModeType.NONE; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public SiemensDevpThread(DevpSlave slave) { | 
|---|
|  |  |  | this.slave = slave; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Thread.sleep(200); | 
|---|
|  |  |  | int barcodeSize = slaveProperties.getBarcode().size(); | 
|---|
|  |  |  | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.190",(short)(barcodeSize*8)); | 
|---|
|  |  |  | if (result2.IsSuccess) { | 
|---|
|  |  |  | for (int i = 0; i < barcodeSize; i++) { | 
|---|