| | |
| | | |
| | | private boolean flag1007 = false; |
| | | |
| | | private Map<Integer, Long> staNoSet = new HashMap<>(); |
| | | |
| | | public Map<Integer, Long> getStaNoSet() { |
| | | return staNoSet; |
| | | } |
| | | |
| | | public void setStaNoSet(Map<Integer, Long> staNoSet) { |
| | | this.staNoSet = staNoSet; |
| | | } |
| | | |
| | | /** |
| | | * 入库,从拣料站到入库站(CTU取货站) |
| | | */ |
| | | public synchronized void generateStoreWrkFile(Integer mark) { |
| | | for (Map.Entry<Integer, Long> entry : staNoSet.entrySet()) { |
| | | if (entry.getValue() != null && System.currentTimeMillis() - entry.getValue() > 1000 * 60 * 5) { |
| | | log.info("超时:{}", entry.getKey()); |
| | | staNoSet.remove(entry.getKey()); |
| | | } |
| | | } |
| | | // 根据输送线plc遍历 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(1004); |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | // 判断是否满足条件 |
| | | // if (!staProtocol.isLoading()) { |
| | | // return; |
| | | // } |
| | | if (!staProtocol.isLoading()) { |
| | | return; |
| | | } |
| | | Long i = staNoSet.get(staProtocol.getWorkNo()); |
| | | if (i != null) { |
| | | return; |
| | | } |
| | | // && staProtocol.isInEnable() |
| | | if (staProtocol.getWorkNo() > 0 && staProtocol.isAutoing() && !staProtocol.isEmptyMk() && staProtocol.isPakMk()) { |
| | | if (staProtocol.getStaNo() == 1004) { |
| | |
| | | } |
| | | staProtocol.setStaNo((short) 1007); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | staNoSet.put(staProtocol.getWorkNo(), System.currentTimeMillis()); |
| | | log.info("入库输送线下发:{},{}", staProtocol.getWorkNo(), 1007); |
| | | |
| | | } |
| | |
| | | } |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(1001); |
| | | if (i >= 6) { |
| | | if (i >= 7) { |
| | | OpenBusSubmitParam openBusSubmitParam = new OpenBusSubmitParam(); |
| | | openBusSubmitParam.setBatch(DateUtils.convert(new Date())); |
| | | List<TaskDto> taskList = new ArrayList<>(); |