| | |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.properties.SystemProperties; |
| | | import com.zy.core.thread.RgvThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | vo.setStatusType(crnProtocol.modeType.desc); // 模式状态 |
| | | vo.setStatus(crnProtocol.getStatusType().desc); // 状态 |
| | | vo.setLoading(crnProtocol.getLoaded()==1?"有物":"无物"); // 有物 |
| | | vo.setLoadTwoing(crnProtocol.getLoadedTwo() == 1 ? "有物" : "无物"); // 有物 |
| | | |
| | | vo.setBay(crnProtocol.getBay()); // 列 |
| | | vo.setLev(crnProtocol.getLevel()); // 层 |
| | | |
| | |
| | | } else { |
| | | vo.setStatus(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO.getDesc(): CrnStatusType.MACHINE_UN_AUTO.getDesc()); // 模式状态 |
| | | } |
| | | |
| | | if (crnProtocol.getTaskNoTwo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNoTwo()); |
| | | if (wrkMast != null) { |
| | | vo.setSourceStaNo2(wrkMast.getSourceStaNo$()); // 源站 |
| | | vo.setStaNo2(wrkMast.getStaNo$()); // 目标站 |
| | | vo.setSourceLocNo2(wrkMast.getSourceLocNo()); // 源库位 |
| | | vo.setLocNo2(wrkMast.getLocNo()); // 目标库位 |
| | | } |
| | | } else { |
| | | vo.setStatus(crnProtocol.modeType.equals(CrnModeType.AUTO) ? CrnStatusType.MACHINE_AUTO.getDesc() : CrnStatusType.MACHINE_UN_AUTO.getDesc()); // 模式状态 |
| | | } |
| | | |
| | | vo.setXspeed(crnProtocol.getXSpeed()); // 走行速度(m/min) |
| | | vo.setYspeed(crnProtocol.getYSpeed()); // 升降速度(m/min) |
| | | vo.setZspeed(crnProtocol.getZSpeed()); // 叉牙速度(m/min) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /****************************************************************/ |
| | | /************************** 手动操作 ******************************/ |
| | | /****************************************************************/ |
| | |
| | | // command.setTraySize(locSts); |
| | | // return crnControl(command)?R.ok():R.error(); |
| | | // } |
| | | |
| | | @ManagerAuth(memo = "库位转移") |
| | | @PostMapping("/operator/stockMove") |
| | | public R crnStockMove(CrnOperatorParam param){ |
| | |
| | | @PostMapping("/operator/taskComplete") |
| | | public R crnTaskComplete(CrnOperatorParam param){ |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setPltType(param.getC()); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 1); // 任务完成确认位 |
| | |
| | | command.setDestinationPosZ((short) 0); // 目标库位层 |
| | | return crnControl(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | |
| | | |
| | | // @ManagerAuth(memo = "暂停") |
| | |
| | | throw new CoolException("堆垛机不在线"); |
| | | } |
| | | // 空闲判断 |
| | | // if (crnProtocol.getStatusType().equals(com.zy.core.enums.CrnStatusType.IDLE) && crnProtocol.getTaskNo() == 0) { |
| | | if (MessageQueue.offer(SlaveType.Crn, crn.getId(), new Task(2, command))) { |
| | | return true; |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | // } else { |
| | | // throw new CoolException("堆垛机不在空闲状态"); |
| | | // } |
| | | |
| | | } |
| | | } |
| | | return false; |