| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.zy.asrs.wcs.common.ExecuteSupport; |
| | | import com.zy.asrs.wcs.core.entity.Loc; |
| | | import com.zy.asrs.wcs.core.entity.Task; |
| | | import com.zy.asrs.wcs.core.model.NavigateNode; |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleAssignCommand; |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleCommand; |
| | | import com.zy.asrs.wcs.core.model.command.ShuttleRedisCommand; |
| | | import com.zy.asrs.wcs.core.model.enums.MotionCtgType; |
| | | import com.zy.asrs.wcs.core.model.enums.ShuttleCommandModeType; |
| | | import com.zy.asrs.wcs.core.model.enums.ShuttleTaskModeType; |
| | | import com.zy.asrs.wcs.core.service.BasShuttleService; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Component |
| | | public class ShuttleAction { |
| | |
| | | if (shuttleProtocol == null) { |
| | | return false; |
| | | } |
| | | |
| | | //判断设备是否空闲 |
| | | if (!shuttleThread.isDeviceIdle()) { |
| | | return false; |
| | | } |
| | | // if (!shuttleThread.isIdle(() -> { |
| | | // return shuttleProtocol.getTaskNo().equals(taskNo); |
| | | // })) { |
| | | // return false; |
| | | // } |
| | | |
| | | //判断工作号是否相同 |
| | | if (!shuttleProtocol.getTaskNo().equals(taskNo)) { |
| | |
| | | //取出命令 |
| | | ShuttleCommand command = commands.get(commandStep); |
| | | |
| | | Integer mode = command.getMode(); |
| | | //判断设备是否空闲 |
| | | if (!shuttleThread.isDeviceIdle(new ExecuteSupport() { |
| | | @Override |
| | | public Boolean judgement() { |
| | | if (ShuttleCommandModeType.CHARGE_CLOSE.id.equals(mode)) {//关闭充电motion |
| | | return false;//不需要判断状态 |
| | | } |
| | | return true;//需要判断状态 |
| | | } |
| | | })) { |
| | | return false; |
| | | } |
| | | |
| | | // 下发命令 |
| | | if (!write(command, device)) { |
| | | News.error("四向穿梭车命令下发失败,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command)); |