| | |
| | | if (inSta.getStaNo().equals(203)){ |
| | | staProtocol.setWorkNo((short)9996); |
| | | staProtocol.setStaNo((short)103); |
| | | }if (inSta.getStaNo().equals(113)){ |
| | | } |
| | | if (inSta.getStaNo().equals(113)) { |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo((short)114); |
| | | }else if (inSta.getStaNo().equals(213)){ |
| | |
| | | && staProtocol.isPakMk()) { |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep11(inSta.getStaNo()); |
| | | if (wrkMast == null) { continue; } |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | if (flag) { |
| | | if (flag && devpThread.getStation().get(204).isLoading()) { |
| | | News.error("MainServiceImpl 346行"+"204站点存在货物,捡料盘点货物暂时不重新入库!!!"); |
| | | continue; |
| | | } |
| | |
| | | } else { |
| | | errorMsg = "当前拣料任务请移动至103站"; |
| | | } |
| | | if (ledThread != null) {MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, errorMsg));} |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | News.error("入库路径不存在!type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); |
| | | continue; |
| | | } |
| | |
| | | News.error("拣料/盘点转全板,任务号工作档不存在===>>[任务号:{}]", staProtocol.getWorkNo()); |
| | | continue; |
| | | } |
| | | if (wrkMast.getIoType() != 101) { continue; } |
| | | if (wrkMast.getIoType() != 101) { |
| | | continue; |
| | | } |
| | | |
| | | //拣料转全板默认出库站100站,当100站有物时,目标改200站 |
| | | Integer staNo = 100; |
| | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { continue; } |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | BasCrnp basCrnp = basCrnpService.selectById(crn.getId()); |
| | | if (basCrnp == null) { |
| | | News.error("{}号堆垛机尚未在数据库进行维护!", crn.getId()); |
| | |
| | | if (wrkMastMapper.selectShallowLoc(Integer.parseInt(wrkMast.getLocNo().substring(0, 2)),Integer.parseInt(wrkMast.getLocNo().substring(2, 5)),Integer.parseInt(wrkMast.getLocNo().substring(5, 7)))!=null){ |
| | | //检查入库库位是否是在堆垛机边库位 |
| | | ArrayList<Integer> outLoc = new ArrayList<>(); |
| | | outLoc.add(3);outLoc.add(4);outLoc.add(11);outLoc.add(12);outLoc.add(18);outLoc.add(19); |
| | | outLoc.add(3); |
| | | outLoc.add(4); |
| | | outLoc.add(11); |
| | | outLoc.add(12); |
| | | outLoc.add(18); |
| | | outLoc.add(19); |
| | | if (!outLoc.contains(Integer.parseInt(wrkMast.getLocNo().substring(0, 2)))) { |
| | | continue; |
| | | } |
| | |
| | | // 小车处于空闲 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | |
| | |
| | | // 给穿梭车下发命令 让其将货物挪至堆垛机搬运点 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | |
| | |
| | | // 给穿梭车下发命令 让其将货物挪至堆垛机搬运点 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | //小车只能绑定一笔作业中任务 |
| | |
| | | if (null == wrkMastMapper.selectPakin(slave.getId(), steNo)) { |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | this.letCarBeWaiting(wrkMast, steNo, wrkMast.getLocNo()); |
| | | // if(steProtocol.getLoca()==3 || steProtocol.getLoca()==4){ |
| | | // //小车已经在待机位时,无需下发到待机位任务,直接更新状态微3,同时绑定小车 |
| | |
| | | // 小车处于空闲 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | |
| | | // 小车处于空闲 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | |
| | | // 给穿梭车下发命令 让其将货物挪至堆垛机搬运点 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | //小车只能绑定一笔作业中任务 |
| | |
| | | // 小车处于空闲 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | |
| | | // 获取堆垛机信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | |
| | | // 获取堆垛机信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | //小车只能绑定一笔作业中任务 |
| | |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | |
| | | if (!basSteService.updatePakMk(steNo, "Y")) { |
| | | News.error("修改穿梭车作业状态 失败!!,穿梭车={}", steNo); |
| | |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | //小车只能绑定一笔作业中任务 |
| | |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | //小车只能绑定一笔作业中任务 |
| | |
| | | // 获取堆垛机信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | if(steProtocol.getLoad() == 1){ |
| | | News.error("小车上方有货,无法下发任务===>>{}", steNo); |
| | | return; |
| | |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol == null) { |
| | | return; |
| | | } |
| | | // 穿梭车空闲 |
| | | if (steProtocol.isIdle() && steProtocol.getLoad() == 0) { |
| | | // 堆垛机空闲 |
| | |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { continue; } |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | // 状态:等待确认 并且 任务完成位 = 1 |
| | | if (crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.getTaskNo() != 0) { |
| | | // 获取入库待确认工作档 |
| | |
| | | } |
| | | |
| | | } |
| | | if (wrkMast == null) { continue; } |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | if (wrkMast.getIoType() != 11 && wrkMast.getIoType() != 111) { |
| | | // 入库 ==>> 货物搬入库 |
| | | if (wrkMast.getWrkSts() == 7){ |
| | |
| | | Integer steNo = wrkMast.getSteNo(); |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | // if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | |
| | | Integer steNo = wrkMast.getSteNo(); |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | // if (steProtocol.loca==0) continue; |
| | | // 穿梭车重新定位排列层 |
| | | if (!steThread.confirmPos()) { |
| | |
| | | Integer steNo = wrkMast.getSteNo(); |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | // if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | |
| | | Integer steNo = wrkMast.getSteNo(); |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | |
| | | Integer steNo = wrkMast.getSteNo(); |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (steProtocol.loca==0) continue; |
| | | // 穿梭车重新定位排列层 |
| | | if (!steThread.confirmPos()) { |
| | |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.getWaiting() && steProtocol.getTaskNo() == 0){ |
| | |
| | | steProtocol.getSteNo(), steProtocol.getTaskNo(), steProtocol.getStatus(), wrkMast.getWrkSts()); |
| | | } |
| | | |
| | | if (wrkMast == null) { continue; } |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | switch (wrkMast.getWrkSts().intValue()) { |
| | | case 2: |
| | | // 修改工作档状态 2.设备上走 => 3.小车待搬 |
| | |
| | | } |
| | | // 获取工作档数据 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); |
| | | if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; } |
| | | if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { |
| | | continue; |
| | | } |
| | | wrkMasts.add(wrkMast); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { continue; } |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } |
| | | if (staProtocol.getWorkNo() != 0) { |
| | | reset = false; |
| | | break; |
| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | BasSte basSte = basSteService.selectById(ste.getId()); |
| | | if (Cools.isEmpty(steProtocol, basSte)) { continue; } |
| | | if (Cools.isEmpty(steProtocol, basSte)) { |
| | | continue; |
| | | } |
| | | try { |
| | | // 在线 空闲 无作业标记 不在充电 |
| | | if (steProtocol.getMode() == 0 |
| | |
| | | } else if (wrkCharge.getWrkSts() == 24L) { |
| | | // 小车行驶至充电位 |
| | | if (steProtocol.statusType.equals(SteStatusType.IDLE) && steProtocol.getPakMk().equals("N")) { |
| | | if (steProtocol.getChargeStatus() == 1) { continue; } |
| | | if (steProtocol.getChargeStatus() == 1) { |
| | | continue; |
| | | } |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(wrkCharge.getSteNo()); // 穿梭车编号 |
| | |
| | | } |
| | | } |
| | | } else if (wrkCharge.getWrkSts() == 26) { |
| | | if (steProtocol.getChargeStatus() == 0) { continue; } |
| | | if (steProtocol.getChargeStatus() == 0) { |
| | | continue; |
| | | } |
| | | // 给输送线下发充电任务 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | SteChargeType steChargeType = SteChargeType.get(wrkCharge.getLocNo()); |
| | |
| | | } |
| | | |
| | | |
| | | public List<String> crn1DemoLocs = new ArrayList<String>(); public String crn1LastLoc = ""; |
| | | public List<String> crn2DemoLocs = new ArrayList<String>(); public String crn2LastLoc = ""; |
| | | public List<String> crn3DemoLocs = new ArrayList<String>(); public String crn3LastLoc = ""; |
| | | public List<String> crn1DemoLocs = new ArrayList<String>(); |
| | | public String crn1LastLoc = ""; |
| | | public List<String> crn2DemoLocs = new ArrayList<String>(); |
| | | public String crn2LastLoc = ""; |
| | | public List<String> crn3DemoLocs = new ArrayList<String>(); |
| | | public String crn3LastLoc = ""; |
| | | |
| | | public synchronized void demo() { |
| | | if (Cools.isEmpty(crn1DemoLocs)) { |
| | | crn1DemoLocs = locMastService.getDemoNextLoc(1); |
| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | BasSte basSte = basSteService.selectById(steNo); |
| | | if (Cools.isEmpty(steProtocol, basSte)) { continue; } |
| | | if (Cools.isEmpty(steProtocol, basSte)) { |
| | | continue; |
| | | } |
| | | |
| | | // 只有当穿梭车空闲 并且 无任务时才继续执行 |
| | | if (steProtocol.isIdle()) { |
| | |
| | | } |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, wrkCharge.getSteNo()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (null == steProtocol) { return; } |
| | | if (null == steProtocol) { |
| | | return; |
| | | } |
| | | if (steProtocol.isIdle()) { |
| | | // 31.生成演示ID |
| | | if (wrkCharge.getWrkSts() == 31L) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public synchronized void ioConvert2F() { |
| | | try { |
| | | // 根据输送线plc遍历 |
| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | BasSte basSte = basSteService.selectById(ste.getId()); |
| | | if (Cools.isEmpty(steProtocol, basSte)) { continue; } |
| | | if (Cools.isEmpty(steProtocol, basSte)) { |
| | | continue; |
| | | } |
| | | try{ |
| | | // 在线 空闲 无作业标记 不在充电 |
| | | if (steProtocol.getMode() == 0 |