| | |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.RgvStatusCache; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | |
| | | return taskWrk; |
| | | } |
| | | |
| | | public boolean deviceDetection(RgvSlave slave){ |
| | | RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(slave.getId()); |
| | | if (rgvProtocol == null) { |
| | | return false; |
| | | } |
| | | if (!rgvProtocol.getModeType().equals(RgvModeType.AUTO) || rgvProtocol.getRgvPos().equals(0L) |
| | | || (!rgvProtocol.getStatusType().equals(RgvStatusType.IDLE) && !rgvProtocol.getStatusType().equals(RgvStatusType.ROAM))) { |
| | | return false; |
| | | } |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getOtherId()); |
| | | if (rgvProtocolOther == null) { |
| | | return false; |
| | | } |
| | | if (rgvProtocolOther.statusEnable){ |
| | | if (!rgvProtocolOther.getModeType().equals(RgvModeType.AUTO) || rgvProtocolOther.getRgvPos().equals(0L)) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public boolean rgvOtherStatusEnable(RgvSlave slave){ |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getOtherId()); |
| | | if (rgvProtocolOther == null) { |
| | | return true; |
| | | } |
| | | if (rgvProtocolOther.statusEnable){ |
| | | // if (!rgvProtocolOther.getModeType().equals(RgvModeType.AUTO) || rgvProtocolOther.getRgvPos().equals(0L)) { |
| | | return true; |
| | | // } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | private void sc(){ |
| | | |
| | | |
| | | // 根据输送线plc遍历 |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | if (!deviceDetection(rgvSlave)){ |
| | | continue; |
| | | } |
| | | RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(rgvSlave.getId()); |
| | | |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(rgvSlave.getOtherId()); |
| | | |
| | | //求出当前车可运行范围 |
| | | Long[] farthestPoint = new Long[]{0L,0L}; |
| | | if (!rgvProtocolOther.statusEnable){ |
| | | farthestPoint = new Long[]{0L,0L}; |
| | | } else { |
| | | if (rgvProtocolOther.getStatusType().equals(RgvStatusType.IDLE)){ |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 遍历入库口 |
| | | for (RgvSlave.RgvStn inSta : rgvSlave.getRgvInSStn()) { |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |