| | |
| | | List<SendDualCrnCommandParam> commandList = (List<SendDualCrnCommandParam>) task.getData(); |
| | | for (SendDualCrnCommandParam sendDualCrnCommandParam : commandList) { |
| | | DualCrnCommand dualCrnCommand = sendDualCrnCommandParam.getCommands().get(0); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_IDX.key + dualCrnCommand.getTaskNo(), sendDualCrnCommandParam.getCommandIdx(), 60 * 60 * 24); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_IDX.key + dualCrnCommand.getTaskNo(), 0, 60 * 60 * 24); |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_.key + dualCrnCommand.getTaskNo(), JSON.toJSONString(sendDualCrnCommandParam, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24); |
| | | if (sendDualCrnCommandParam.getStation() == 1) { |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + crnProtocol.getCrnNo(), dualCrnCommand.getTaskNo(), 60 * 60 * 24); |
| | | }else { |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + crnProtocol.getCrnNo(), dualCrnCommand.getTaskNo(), 60 * 60 * 24); |
| | | } |
| | | } |
| | | |
| | | redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getCrnNo(), JSON.toJSONString(commandList, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24); |
| | | } else if (step == 3) { |
| | | sendCommand((DualCrnCommand) task.getData()); |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | Object commandListObj = redisUtil.get(RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getCrnNo()); |
| | | if (commandListObj == null) { |
| | | continue; |
| | | } |
| | | List<SendDualCrnCommandParam> commandList = JSON.parseArray(commandListObj.toString(), SendDualCrnCommandParam.class); |
| | | List<SendDualCrnCommandParam> commandList = getDualCrnCommandList(); |
| | | for (SendDualCrnCommandParam commandParam : commandList) { |
| | | processStation(commandParam); |
| | | } |
| | |
| | | |
| | | //工位1 |
| | | crnProtocol.setTaskNo(0); |
| | | crnProtocol.setDeviceTaskNo(0); |
| | | crnProtocol.setStatus(-1); |
| | | crnProtocol.setBay(0); |
| | | crnProtocol.setLevel(0); |
| | |
| | | |
| | | //工位2 |
| | | crnProtocol.setTaskNoTwo(0); |
| | | crnProtocol.setDeviceTaskNoTwo(0); |
| | | crnProtocol.setStatusTwo(-1); |
| | | crnProtocol.setBayTwo(0); |
| | | crnProtocol.setLevelTwo(0); |
| | |
| | | crnProtocol.setMode(crnStatus.getMode()); |
| | | |
| | | //工位1 |
| | | crnProtocol.setTaskNo(crnStatus.getTaskNo()); |
| | | crnProtocol.setDeviceTaskNo(crnStatus.getTaskNo()); |
| | | crnProtocol.setStatus(crnStatus.getStatus()); |
| | | crnProtocol.setForkPos(crnStatus.getForkPos()); |
| | | crnProtocol.setLoaded(crnStatus.getLoaded()); |
| | |
| | | crnProtocol.setTaskSend(crnStatus.getTaskSend()); |
| | | |
| | | //工位2 |
| | | crnProtocol.setTaskNoTwo(crnStatus.getTaskNoTwo()); |
| | | crnProtocol.setDeviceTaskNoTwo(crnStatus.getTaskNoTwo()); |
| | | crnProtocol.setStatusTwo(crnStatus.getStatusTwo()); |
| | | crnProtocol.setForkPosTwo(crnStatus.getForkPosTwo()); |
| | | crnProtocol.setLoadedTwo(crnStatus.getLoadedTwo()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public List<SendDualCrnCommandParam> getDualCrnCommandList() { |
| | | List<SendDualCrnCommandParam> commandList = new ArrayList<>(); |
| | | SendDualCrnCommandParam command1 = getDualCrnCommandList(1); |
| | | SendDualCrnCommandParam command2 = getDualCrnCommandList(2); |
| | | if (command1 != null) { |
| | | commandList.add(command1); |
| | | } |
| | | |
| | | if (command2 != null) { |
| | | commandList.add(command2); |
| | | } |
| | | |
| | | return commandList; |
| | | } |
| | | |
| | | public SendDualCrnCommandParam getDualCrnCommandList(int station) { |
| | | SendDualCrnCommandParam sendDualCrnCommandParam = null; |
| | | String key = null; |
| | | if (station == 1 && crnProtocol.getTaskNo() > 0) { |
| | | key = RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getTaskNo(); |
| | | } else if (station == 2 && crnProtocol.getTaskNoTwo() > 0) { |
| | | key = RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getTaskNoTwo(); |
| | | } |
| | | |
| | | if (key == null) { |
| | | return null; |
| | | } |
| | | |
| | | Object commandObj = redisUtil.get(key); |
| | | if (commandObj == null) { |
| | | return null; |
| | | } |
| | | |
| | | sendDualCrnCommandParam = JSON.parseObject(commandObj.toString(), SendDualCrnCommandParam.class); |
| | | if (sendDualCrnCommandParam == null) { |
| | | return null; |
| | | } |
| | | |
| | | return sendDualCrnCommandParam; |
| | | } |
| | | } |