| | |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.cpmmandParam.CrnCommandParam; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.JarProtocol; |
| | | 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; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.core.thread.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | private WrkMastCrnMapper wrkMastCrnMapper; |
| | | @Autowired |
| | | private WrkMastSplitTwinMapper wrkMastSplitTwinMapper; |
| | | @Autowired |
| | | private WrkMastSplitTwinService wrkMastSplitTwinService; |
| | | @Autowired |
| | | private BasJarMastService basJarMastService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | @Autowired |
| | | private WrkMastSplitTwinService wrkMastSplitTwinService; |
| | | |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | * Jar任务创建 |
| | | */ |
| | | public synchronized void jarGenerateWrkMastSta() { |
| | | try{ |
| | | |
| | | }catch (Exception e){ |
| | | log.error("小车复位线程报错!"+e); |
| | | for (JarSlave jarSlave : slaveProperties.getJar()) { |
| | | try{ |
| | | Integer count = basJarMastService.getJarMastByJarIdCount(jarSlave.getId().longValue()); |
| | | if (count>=7){ |
| | | continue; |
| | | } |
| | | BasJarMast jarMastByJarIdMax = basJarMastService.getJarMastByJarIdMax(jarSlave.getId().longValue()); |
| | | if (!Cools.isEmpty(jarMastByJarIdMax) && jarMastByJarIdMax.getJarLocDigit()==7){ |
| | | continue; |
| | | } |
| | | jarGenerateWrkMastStaExecute(jarSlave); |
| | | }catch (Exception e){ |
| | | log.error(jarSlave.getId()+"号小车复位线程报错!"+e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 执行 |
| | | */ |
| | | public synchronized boolean jarGenerateWrkMastStaExecute(JarSlave jarSlave) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 执行 |
| | | */ |
| | | public synchronized boolean jarGenerateWrkMastStaExecuteOne(JarSlave jarSlave) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Jar任务创建 执行 |
| | | */ |
| | | public synchronized boolean jarGenerateWrkMastStaExecuteTwo(JarSlave jarSlave) { |
| | | try{ |
| | | // 获取堆垛机信息 |
| | | JarThread jarThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getId()); |
| | | JarProtocol jarProtocol = jarThread.getJarProtocol(); |
| | | if (jarProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | return false; |
| | | } |
| | | if (jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | |
| | | //自动、空闲、右门关闭、 |
| | | if (jarProtocol.isAutoing() && !jarProtocol.isRightDoor() && jarProtocol.jarErr==0 && !jarOtherProtocol.isLeftDoor() && jarOtherProtocol.jarErr==0){ |
| | | |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | // log.error("堆垛机工位二完成等待确认异常,堆垛机号={},异常信息={},工位号={}",crn.getId(),e.getMessage(),2); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | return false; |
| | | } |
| | | /* |
| | | * 小车取空板至工位任务 满取 |
| | | * 穿梭板移动 |
| | | * */ |
| | | public synchronized boolean jarRgvTake8(Integer rgvId,BasJarMast basJarMast){ |
| | | return false; |