| | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>ghlnwcs</finalName> |
| | | <finalName>mdqzwcs</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | | try { |
| | | |
| | | // 间隔 |
| | | Thread.sleep(1000); |
| | | |
| | | // 系统运行状态判断 |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 演示 |
| | | // mainService.crnDemoOfLocMove1(); |
| | | //刷新RGV地图 |
| | | // mainService.refreshRgvMap(); |
| | | |
| | | // 入出库模式切换函数 |
| | | // mainService.ioConvert(); |
| | | |
| | | // 拣料、并板、盘点再入库 |
| | | // mainService.stnToCrnStnPick(3); |
| | | // mainService.stnToCrnStnPick2(); |
| | | |
| | | // 入库 ===>> 入库站到堆垛机站,根据条码扫描生成入库工作档 |
| | | mainService.generateStoreWrkFile(1); // 组托 |
| | | // mainService.generateStoreWrkFile0(2); // WMS入库 |
| | | Thread.sleep(500); |
| | | |
| | | // 生成 空子/母托盘任务 |
| | | mainService.generateEmptyPalletStoreWrk(); |
| | | |
| | | // 出库 ===>> 堆垛机出库站到出库站 |
| | | mainService.crnStnToOutStn(4); |
| | | |
| | | // 入出库 ===>> 堆垛机入出库作业下发 |
| | | mainService.crnIoExecute(5); |
| | | // 入出库增强 ===>> 堆垛机命令下发后,异步修改工作档状态 |
| | | // mainService.crnIoWrkMast(); |
| | | |
| | | // 入库 ===>> 执行对工作档的完成操作 |
| | | mainService.storeFinished(6); |
| | | |
| | | // 堆垛机异常信息记录 |
| | | mainService.recCrnErr(7); |
| | | // 入库 ===>> 空栈板初始化入库,叉车入库站放货 |
| | | // mainService.storeEmptyPlt(8); |
| | | |
| | | // 出库 ===>> 工作档信息写入led显示器 |
| | | mainService.ledExecute(9); |
| | | |
| | | // 其他 ===>> LED显示器复位,显示默认信息 |
| | | mainService.ledReset(); |
| | | |
| | | mainService.outOfDevp(11); |
| | | |
| | | // 106生成转移任务 |
| | | mainService.autoMoveLoc(); |
| | | |
| | | // 给plc写开门信号 |
| | | mainService.writePlc305(); |
| | | |
| | | // 305入库调用底座到305 |
| | | mainService.invokingBase(); |
| | | |
| | | // if (i>10){ |
| | | // //空托盘自动出库 |
| | | // mainService.autoEmptyOut(); |
| | | // //空托盘自动入库 |
| | | // mainService.autoEmptyIn(); |
| | | // i=0; |
| | | // } |
| | | // i++; |
| | | |
| | | // 其他 ===>> 入出库模式切换 |
| | | // i++; |
| | | // if (i > 1) { |
| | | // mainService.ioConvert(); |
| | | // i = 0; |
| | | // } |
| | | |
| | | /////////////////////////////////////RGV调度///////////////////////////////////// |
| | | // |
| | | //完成小车任务 |
| | | // mainService.rgvCompleteWrkMastSta(); |
| | | |
| | | // //执行小车空板搬运任务 |
| | | // mainService.rgvRunWrkMastEmptyStaPut();//放 |
| | | // mainService.rgvRunWrkMastEmptyStaTake();//取 |
| | | // if (rgcWrk){ |
| | | // //执行小车货物搬运任务 |
| | | // mainService.rgvRunWrkMastFullSta(); |
| | | // rgcWrk = false; |
| | | // }else { |
| | | // mainService.rgvRunWrkMastEmptyStaAvoidance();//避让 |
| | | // rgcWrk = true; |
| | | // } |
| | | |
| | | |
| | | /////////////////////////////////////RGV调度///////////////////////////////////// |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | private short heartBeatVal = 1; |
| | | private StaError1 staError1; |
| | | public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | add(100);add(101);add(102);add(103); |
| | | add(1002);add(1020);add(1035);add(103); |
| | | add(104);add(105);add(106);add(107); |
| | | add(200);add(201);add(202);add(203);add(210); |
| | | add(300);add(301);add(302);add(303);add(304);add(305); |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.MatDto; |
| | |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.entity.*; |
| | | import com.zy.mapper.*; |
| | |
| | | public class MainServiceImpl { |
| | | |
| | | public static final long COMMAND_TIMEOUT = 5 * 1000; |
| | | |
| | | // 空拖出库站点 |
| | | public static final Map<Integer,String> emptyPalletSiteMap = new HashMap<>(); |
| | | |
| | | // 初始化空托盘出库站点 M空母托盘,Z空子托盘 |
| | | static { |
| | | emptyPalletSiteMap.put(1002,"M");emptyPalletSiteMap.put(1020,"M");emptyPalletSiteMap.put(1035,"Z"); |
| | | } |
| | | |
| | | @Autowired |
| | | private CommonService commonService; |
| | |
| | | // News.infoNoLog(""+mark+" - 0"+" - 拣料、并板、盘点再入库 ===》执行完成"); |
| | | } |
| | | |
| | | |
| | | //盘点再入库 |
| | | public synchronized void stnToCrnStnPick2(){ |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历拣料入库口 |
| | | for (DevpSlave.Sta pickSta : devp.getPickSta()) { |
| | | // 获取拣料入库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(pickSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() |
| | | // && staProtocol.getWorkNo() > 0 |
| | | && staProtocol.isPakMk()){ |
| | | |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode); |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { |
| | | staProtocol.setWorkNo(wrkNo); |
| | | staProtocol.setStaNo(pickSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | if (ledThread != null) { |
| | | String errorMsg = "扫码失败,请重试"; |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | } else { |
| | | staProtocol.setWorkNo(wrkNo); |
| | | staProtocol.setStaNo(pickSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | if (ledThread != null) { |
| | | String errorMsg = "扫码失败,请重试"; |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | WrkMast wrkMast = wrkMastMapper.selectPickStep2(barcode); |
| | | if (wrkMast == null) { |
| | | // 无盘点数据 |
| | | continue; |
| | | } |
| | | |
| | | // 出库确认信号位 |
| | | // if ((Cools.isEmpty(wrkMast.getInvWh()) || wrkMast.getInvWh().equals("N")) && wrkMast.getIoType() != 107) { |
| | | // continue; |
| | | // } |
| | | // if ( wrkMast.getIoType() != 107 || Cools.isEmpty(wrkMast.getStaNo()) |
| | | // || Cools.isEmpty(wrkMast.getSourceStaNo())) { |
| | | // continue; |
| | | // } |
| | | |
| | | // 获取库位号 |
| | | try { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setBarcode(barcode); |
| | | param.setIoType(107); |
| | | param.setSourceStaNo(pickSta.getStaNo()); //作业站点 |
| | | if (!Cools.isEmpty(locMast)){ |
| | | param.setLocType1(locMast.getLocType1()); |
| | | }else { |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | } |
| | | |
| | | String response = ""; |
| | | log.info("入库作业站"+pickSta.getStaNo()+"盘点再入库任务请求WMS===>>参数:" + param); |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin2/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | // .setTimeout(15, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | } catch(Exception e){ |
| | | log.error("入库作业站"+pickSta.getStaNo()+"盘点再入库任务请求WMS===>>参数:" + param); |
| | | log.error("stnToCrnStnPick2===>>盘点查库位入库接口失败", e); |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | log.info("入库作业站"+pickSta.getStaNo()+"盘点再入库任务请求WMS===>>参数:" + param); |
| | | log.info("入库作业站"+pickSta.getStaNo()+"下发盘点再入库任务请求WMS返回结果===>>" + response); |
| | | if(response.equals("")) { |
| | | continue; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (code == 200) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | if (Cools.isEmpty(dto) || Cools.isEmpty(dto.getStaNo())) { |
| | | log.error("任务号"+wrkMast.getWrkNo()+"盘点再入库查询库位失败===>>" + jsonObject.toJSONString()); |
| | | } else { |
| | | log.info("任务号"+wrkMast.getWrkNo()+"盘点再入库查询库位成功===>>" + jsonObject.toJSONString()); |
| | | try { |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo((short)161); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | ledThread.errorReset(); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | log.error("发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId()); |
| | | } |
| | | log.info("任务号"+wrkMast.getWrkNo()+"盘点再入库任务下发成功===>>" + staProtocol); |
| | | } catch (Exception e) { |
| | | log.error("盘点再入库失败===>>" + e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | } else { |
| | | staProtocol.setWorkNo(wrkNo); |
| | | staProtocol.setStaNo(pickSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin2/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("stnToCrnStnPick2===>>fail", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 堆垛机站出库到出库站 |
| | | */ |
| | |
| | | |
| | | } |
| | | // News.infoNoLog(""+mark+" - 0"+" - 堆垛机入出库作业下发执行完成"); |
| | | } |
| | | |
| | | /** |
| | | * 回原点,堆垛机没有执行中任务,设备存在入库任务时叫回原点 |
| | | */ |
| | | public synchronized void crnRebackHp(CrnProtocol crnProtocol, CrnThread crnThread) { |
| | | // for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // // 获取堆垛机信息 |
| | | // CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | // CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | // if (crnProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // BasCrnp basCrnp = basCrnpService.selectById(crn.getId()); |
| | | // if (basCrnp == null) { |
| | | // log.error("{}号堆垛机尚未在数据库进行维护!", crn.getId()); |
| | | // continue; |
| | | // } |
| | | if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | if (crnProtocol.getBay() == 1 && crnProtocol.getLevel() == 1) { |
| | | return; |
| | | } |
| | | |
| | | // 已经存在吊车执行任务时,则过滤3,12 |
| | | if (wrkMastMapper.selectWorking(crnProtocol.getCrnNo()) != null) { |
| | | return; |
| | | } |
| | | |
| | | //堆垛机有执行中任务,过滤3,4,11,12 |
| | | if (wrkMastMapper.selectCrnWorking(crnProtocol.getCrnNo()) != null) { |
| | | return; |
| | | } |
| | | |
| | | //输送线没有入库任务,过滤2 |
| | | if (wrkMastMapper.selectDevWorking(crnProtocol.getCrnNo()) == null) { |
| | | return; |
| | | } |
| | | News.info("堆垛机召回原点==>>" + crnProtocol.getCrnNo() + "号堆垛机有入库任务,召回原点"); |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |
| | | crnCommand.setTaskNo((short) 9999); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 回原点 |
| | | crnCommand.setSourcePosX((short) 0); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 0); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 0); // 源库位层 |
| | | crnCommand.setDestinationPosX((short) 0); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) 0); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) 0); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, crnCommand))) { |
| | | News.error("堆垛机回原点命令下发失败,堆垛机号={},任务数据={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } |
| | | crnThread.setBackHpFlag(true); |
| | | } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | News.infoNoLog(""+mark+" - 2"+" - 0"+" - 堆垛机入出库作业下发 : 出库执行完毕"); |
| | | } |
| | | |
| | | // /** |
| | | // * 出库 ===>> 库位到堆垛机站 |
| | | // */ |
| | | // public void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol){ |
| | | // for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) { |
| | | // // 获取工作状态为11(生成出库ID)的出库工作档 |
| | | // WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo()); |
| | | // if (wrkMast == null) { |
| | | // continue; |
| | | // } |
| | | // // 工作档状态判断 |
| | | // if (wrkMast.getIoType() < 100 || wrkMast.getSourceStaNo() == null){ |
| | | // log.error("查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType()); |
| | | // continue; |
| | | // } |
| | | // // 获取源库位信息 |
| | | // LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | // if (!sourceSta.getLocSts().equals("R") &&!sourceSta.getLocSts().equals("P")) { |
| | | // log.error("出库操作库位状态不符合--状态, 库位号={},库位状态={}", wrkMast.getLocNo(), sourceSta.getLocSts()); |
| | | // continue; |
| | | // } |
| | | // // 获取堆垛机出库站信息 |
| | | // SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId()); |
| | | // StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()); |
| | | // if (staProtocol == null) { |
| | | // continue; |
| | | // } else { |
| | | // staProtocol = staProtocol.clone(); |
| | | // } |
| | | // |
| | | //// // 入出库模式判断 |
| | | //// if (devpThread.ioMode != IoModeType.PAKOUT_MODE) { continue; } |
| | | // |
| | | // |
| | | // // 查询站点详细信息 |
| | | // BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); |
| | | // if (staDetl == null) { |
| | | // log.error("出库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNo()); |
| | | // continue; |
| | | // } |
| | | // // 判断堆垛机出库站状态 |
| | | // if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() !=null && staDetl.getCanouting().equals("Y") |
| | | // && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | // // 命令下发区 -------------------------------------------------------------------------- |
| | | // |
| | | // // 堆垛机控制过滤 |
| | | // if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | // if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | | // String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); |
| | | // LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | // // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬! |
| | | // if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | | // WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | // if (null == waitWrkMast) { |
| | | // log.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | // } else { |
| | | // if(waitWrkMast.getWrkSts() == 11) { |
| | | // waitWrkMast.setIoPri(15D); |
| | | // waitWrkMast.setModiTime(new Date()); |
| | | // if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | // log.error("调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | // } |
| | | // continue; |
| | | // } else { |
| | | // |
| | | // } |
| | | // } |
| | | // } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // // 此标记避免多次执行移库任务 |
| | | // if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档、改变浅库位的源库/目标库 库位状态、下发堆垛机命令(立马执行) |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | // } |
| | | // log.error("{}任务出库失败,浅库位堵塞!", wrkMast.getWrkNo()); |
| | | // continue; |
| | | // } |
| | | // } |
| | | // |
| | | // // 已经存在吊车执行任务时,则过滤 |
| | | // if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | // return; |
| | | // } |
| | | // |
| | | // // 1.堆垛机开始移动 |
| | | // CrnCommand crnCommand = new CrnCommand(); |
| | | // crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | | // crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 |
| | | // crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | // crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | // crnCommand.setSourcePosX(sourceSta.getRow1().shortValue()); // 源库位排 |
| | | // crnCommand.setSourcePosY(sourceSta.getBay1().shortValue()); // 源库位列 |
| | | // crnCommand.setSourcePosZ(sourceSta.getLev1().shortValue()); // 源库位层 |
| | | // crnCommand.setDestinationPosX(crnStn.getRow().shortValue()); // 目标库位排 |
| | | // crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 目标库位列 |
| | | // crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | // if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | // log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | // } else { |
| | | // // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | | // Date now = new Date(); |
| | | // wrkMast.setWrkSts(12L); |
| | | // wrkMast.setCrnStrTime(now); |
| | | // wrkMast.setModiTime(now); |
| | | // if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | // log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 库位移转 |
| | | */ |
| | |
| | | // News.infoNoLog(""+mark+" - 0"+" - 堆垛机异常信息记录执行完成"); |
| | | } |
| | | |
| | | |
| | | // ------------------------------------------------------------------------------- |
| | | |
| | | /** |
| | | * 空栈板初始化入库,叉车入库站放货 |
| | | */ |
| | | public synchronized void storeEmptyPlt(Integer mark) { |
| | | |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历空板入库口 |
| | | for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) { |
| | | // 获取空板入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | LedThread ledThread = null; |
| | | if (!Cools.isEmpty(emptyInSta.getLed())) { |
| | | ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed()); |
| | | } |
| | | |
| | | if (!staProtocol.isLoading()){ |
| | | continue; |
| | | } |
| | | |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() |
| | | && staProtocol.isPakMk() |
| | | && (staProtocol.getWorkNo() !=0 && staProtocol.getWorkNo() > 9700) |
| | | ) { |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货"); |
| | | |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(staProtocol.getSiteId().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("输送线下发6:"+dto.getWorkNo()+","+staProtocol.getSiteId()); |
| | | if (!result) { |
| | | News.errorNoLog(""+mark+" - 1"+" - 更新plc站点信息失败"); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | if (ledThread != null) { |
| | | // 命令集合 |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(dto.getWorkNo()); |
| | | ledCommand.setIoType(1); |
| | | ledCommand.setTitle("全板入库"); |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | commands.add(ledCommand); |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(1, commands)); |
| | | // ledThread.errorReset(); |
| | | } |
| | | } else { |
| | | // staProtocol.setWorkNo(wrkNo++); |
| | | // staProtocol.setStaNo(emptyInSta.getBackSta().shortValue()); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // if (!result) { |
| | | // News.errorNoLog(""+mark+" - 2"+" - 更新plc站点信息失败"); |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | // |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | // News.error(""+mark+" - 3"+" - 请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | |
| | | } else { |
| | | News.errorNoLog(""+mark+" - 4"+" - 站点信息不符合入库条件!!!"+" 自动信号:"+staProtocol.isAutoing()+"、可入信号:" + staProtocol.isInEnable() |
| | | +"、空板信号:"+ staProtocol.isEmptyMk()+"、工作号:" + staProtocol.getWorkNo() |
| | | +"、锁定标记"+ staProtocol.isPakMk()); |
| | | } |
| | | } |
| | | } |
| | | // News.infoNoLog(""+mark+" - 0"+" - 空栈板初始化入库,叉车入库站放货执行完成"); |
| | | } |
| | | |
| | | /** |
| | | * 出库 ===>> 工作档信息写入led显示器 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 因双深库位阻塞,对浅库位进行移转(入库版) |
| | | * tip:同步 |
| | | */ |
| | | @Transactional |
| | | public synchronized void moveLocForDeepLocPakin(CrnSlave crn, LocMast shallowLoc, WrkMast pakinWrkMast) { |
| | | LocMast loc = locMastService.selectById(pakinWrkMast.getLocNo()); |
| | | |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(0); |
| | | Date now = new Date(); |
| | | // 保存工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | wrkMast.setIoPri(15D); |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 源库位 |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt(shallowLoc.getFullPlt()); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(shallowLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setCtnNo("Y"); // 入库阻塞库位移转标记 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | int res = wrkMastMapper.insert(wrkMast); |
| | | if (res == 0) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 工作档明细保存 |
| | | if (shallowLoc.getLocSts().equals("F")) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", shallowLoc.getLocNo())); |
| | | for (LocDetl locDetl : locDetls) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setAnfme(locDetl.getAnfme()); |
| | | VersionUtils.setWrkDetl(wrkDetl, locDetl); // 版本控制 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | } |
| | | // 修改源库位状态 |
| | | if (shallowLoc.getLocSts().equals("D") || shallowLoc.getLocSts().equals("F")) { |
| | | shallowLoc.setLocSts("S"); // S.入库预约,入库阻塞库位移转 |
| | | shallowLoc.setModiTime(now); |
| | | if (!locMastService.updateById(shallowLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败"); |
| | | } |
| | | // // 修改目标库位状态 |
| | | // if (loc.getLocSts().equals("O")) { |
| | | // loc.setLocSts("S"); // S.入库预约 |
| | | // loc.setModiTime(new Date()); |
| | | // if (!locMastService.updateById(loc)) { |
| | | // throw new CoolException("更新目标库位状态失败"); |
| | | // } |
| | | // } else { |
| | | // throw new CoolException("移转失败"); |
| | | // } |
| | | wrkMast.setLocNo(shallowLoc.getLocNo()); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | throw new CoolException("修改阻塞入库任务失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 因双深库位阻塞,对浅库位进行移转(立即执行版) |
| | | * tip:同步 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 堆垛机演示 ===>> 库位移转 |
| | | */ |
| | | public synchronized void crnDemoOfLocMove1() { |
| | | try { |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | if (!crn.getDemo()) { |
| | | continue; |
| | | } // 必须为演示状态 |
| | | |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | // 只有当堆垛机空闲 并且 无任务时才继续执行 |
| | | if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | // 获取移库工作档信息 |
| | | WrkMast wrkMast = wrkMastMapper.selectLocMove(crn.getId()); |
| | | if (null != wrkMast) { |
| | | continue; |
| | | } |
| | | |
| | | LocMast sourceLoc = locMastService.queryDemoSourceLoc(crn.getId()); |
| | | LocMast loc = locMastService.queryDemoLoc(crn.getId()); |
| | | if (null == sourceLoc || null == loc) { |
| | | continue; |
| | | } |
| | | |
| | | String sourceLocNo = sourceLoc.getLocNo(); |
| | | String locNo = loc.getLocNo(); |
| | | |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(0); |
| | | // 保存工作档 |
| | | wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | wrkMast.setIoPri(13D); |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(sourceLocNo); // 源库位 |
| | | wrkMast.setLocNo(locNo); // 目标库位 |
| | | wrkMast.setFullPlt("N"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(sourceLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(sourceLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | int res = wrkMastMapper.insert(wrkMast); |
| | | if (res == 0) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 工作档明细保存 |
| | | // List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo)); |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // WrkDetl wrkDetl = new WrkDetl(); |
| | | // wrkDetl.setWrkNo(workNo); |
| | | // wrkDetl.setIoTime(new Date()); |
| | | // wrkDetl.setAnfme(locDetl.getAnfme()); |
| | | // VersionUtils.setWrkDetl(wrkDetl, locDetl); // 版本控制 |
| | | // wrkDetl.setAppeTime(new Date()); |
| | | // wrkDetl.setModiTime(new Date()); |
| | | // if (!wrkDetlService.insert(wrkDetl)) { |
| | | // throw new CoolException("保存工作档明细失败"); |
| | | // } |
| | | // } |
| | | // 修改源库位状态 |
| | | if (sourceLoc.getLocSts().equals("D")) { |
| | | sourceLoc.setLocSts("R"); // R.出库预约 |
| | | sourceLoc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败"); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("更新目标库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("移转失败"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("堆垛机演示 ===>> 库位移转失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 堆垛机命令下发后,异步修改工作档状态 |
| | | */ |
| | | public synchronized void crnIoWrkMast() { |
| | | for (CrnSlave crn : slaveProperties.getCrn()) { |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | Date now = new Date(); |
| | | // 堆垛机正在运行 |
| | | if (crnProtocol.getStatusType() != CrnStatusType.IDLE && crnProtocol.getTaskNo() != 0 && crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | // 获取工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | // 入库 |
| | | if (wrkMast.getWrkSts() == 1 || wrkMast.getWrkSts() == 2) { |
| | | News.warn("堆垛机非空闲情况下,开始修改工作档状态。[id:{},时间:{}] >>>>> 堆垛机当前状态为:{}。任务号:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); |
| | | // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | | wrkMast.setWrkSts(3L); |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | News.error("修改工作档状态 2.设备上走 => 3.吊车入库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | News.warn("修改工作档状态成功。[时间:{}] >>>>> 任务号:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); |
| | | } |
| | | // 出库、移库 |
| | | if (wrkMast.getWrkSts() == 11) { |
| | | News.warn("堆垛机非空闲情况下,开始修改工作档状态。[id:{},时间:{}] >>>>> 堆垛机当前状态为:{}。任务号:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | | wrkMast.setWrkSts(12L); |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | News.error("修改工作档状态 11.生成出库ID => 12.吊车出库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | News.warn("修改工作档状态成功。[时间:{}] >>>>> 任务号:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 入出库模式切换函数 |
| | | */ |
| | | public synchronized void ioConvert() { |
| | | try { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | Integer[] staNos; |
| | | if (devp.getId() == 1) { |
| | | staNos = new Integer[]{101, 103}; |
| | | }else { |
| | | staNos = new Integer[]{305}; |
| | | } |
| | | for (Integer staNo : staNos) { |
| | | WrkMast pakout = wrkMastMapper.selectWorkingPakout(staNo); |
| | | switch (staNo) { |
| | | case 101://1F |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf101 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf101 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(staNo); |
| | | if (pakin == null) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf101 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf101 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 103://1F |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf103 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf103 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(staNo); |
| | | if (pakin == null) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf103 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf103 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | case 305://1F |
| | | if (pakout != null) { |
| | | if (devpThread.ioModeOf305 != IoModeType.PAKOUT_MODE) { |
| | | // 出库切换中 |
| | | devpThread.ioModeOf305 = IoModeType.PAKOUT_BOOTING; |
| | | WrkMast pakin = wrkMastMapper.selectWorkingPakin(staNo); |
| | | if (pakin == null) { |
| | | // 出库模式 |
| | | devpThread.ioModeOf305 = IoModeType.PAKOUT_MODE; |
| | | } |
| | | } |
| | | } else { |
| | | // 入库模式 |
| | | devpThread.ioModeOf305 = IoModeType.PAKIN_MODE; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 并板,拣料,盘点出库,状态为14.已出库未确认,更新ctnNo为Y |
| | | * @param mark 标识 |
| | | */ |
| | |
| | | // News.infoNoLog(""+mark+" - 0"+" - outOfDevp执行完成"); |
| | | } |
| | | |
| | | |
| | | public synchronized void autoEmptyOut() { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(101);list.add(112); |
| | | Map<Integer,Integer> map = new HashMap<>(); |
| | | map.put(101,102);map.put(112,111); |
| | | for (Integer site:list){ |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("sta_no", map.get(site))); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | //如果站点可出禁用,则不生成空盘出库任务 |
| | | StaProtocol staProtocol = devpThread.getStation().get(site); |
| | | /** |
| | | * 生成 空子/母托盘任务 |
| | | */ |
| | | public synchronized void generateEmptyPalletStoreWrk() { |
| | | Integer devpId = 1; |
| | | for (Map.Entry<Integer, String> entry : emptyPalletSiteMap.entrySet()) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devpId); |
| | | StaProtocol staProtocol = devpThread.getStation().get(entry.getKey()); |
| | | if (staProtocol == null) { |
| | | return; |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() //自动 |
| | | && !staProtocol.isLoading() //无物 |
| | | && staProtocol.isOutEnable() //可出信号 |
| | | && staProtocol.getWorkNo() == 0 |
| | | ) { |
| | | WrkMast pakoutEmpty = wrkMastMapper.selectPakoutEmpty(site); |
| | | if (null != pakoutEmpty) { |
| | | return; |
| | | |
| | | // 自动&无物&可出 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staProtocol.isOutEnable()) { |
| | | // 判断是否已经生成任务 |
| | | if (wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("io_type", 110).eq("sta_no", entry.getKey())).size() > 0) { |
| | | log.warn("{}站点已经存在空板出库任务", entry.getKey()); |
| | | continue; |
| | | } |
| | | Short loctype1 = 1; |
| | | if (site == 101){ |
| | | loctype1 = 2; |
| | | } |
| | | LocTypeDto locTypeDto = new LocTypeDto(loctype1, (short) 1, (short) 1); |
| | | locTypeDto.setSiteId(site); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("site", String.valueOf(entry.getKey())); |
| | | map.put("flag", entry.getValue()); |
| | | String response = ""; |
| | | try { |
| | | String response = new HttpHandler.Builder() |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/auto/emptyOut/v1") |
| | | .setJson(JSON.toJSONString(locTypeDto)) |
| | | .setJson(JSON.toJSONString(map)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | String data = jsonObject.get("data").toString(); |
| | | News.info((String) jsonObject.get("msg")+","+data); |
| | | log.info("空托出库请求成功:请求参数{},返回值:{}", map, response); |
| | | } else { |
| | | News.warnNoLog("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1","", response); |
| | | log.error("空拖出库请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1", map, response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("空拖出库请求接口异常!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyOut/v1", map, response); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public synchronized void autoEmptyIn() { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(153);list.add(157); |
| | | for (Integer site:list){ |
| | | StaProtocol staProtocol = devpThread.getStation().get(site); |
| | | if (staProtocol == null) { |
| | | return; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() //自动 |
| | | && staProtocol.isLoading() //有物 |
| | | && staProtocol.isInEnable() //可入信号 |
| | | && staProtocol.isPakMk() |
| | | && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) //工作号为0或者工作号是9991~9999(输送机留用) |
| | | ) { |
| | | |
| | | try { |
| | | Short loctype1 = 1; |
| | | if (site == 153){ |
| | | loctype1 = 2; |
| | | } |
| | | LocTypeDto locTypeDto = new LocTypeDto(loctype1, (short) 1, (short) 1); |
| | | locTypeDto.setSiteId(site); |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/auto/emptyIn/v1") |
| | | .setJson(JSON.toJSONString(locTypeDto)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | News.info((String) jsonObject.get("msg")); |
| | | staProtocol.setWorkNo(jsonObject.get("data").hashCode()); |
| | | staProtocol.setStaNo(site.shortValue()); |
| | | devpThread.setPakMk(site,false); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | } else { |
| | | News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/auto/emptyIn/v1", JSON.toJSONString(locTypeDto), response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /* |
| | | * 小车地图更新 更新锁 |
| | | * */ |
| | | public synchronized boolean rgvMapUpdate(BasRgvMap basRgvMapCurrent,Integer staStart,Integer staEnd,String sign){ |
| | | |
| | | // List<Integer> integers = RouteUtils.RouteMapCurrentFar(basRgvMapCurrent.getNowRoute(),staStart,staEnd, basRgvMapCurrent.getLockStartRoute()); |
| | | //更新当前小车锁 |
| | | try{ |
| | | Integer farCurrentStaNo = RouteUtils.RouteIndexFarMas(basRgvMapCurrent.getNowRoute(), staStart, staEnd, basRgvMapCurrent.getLockStartRoute());//获取最远站点 |
| | | Integer fallMerge = RouteUtils.RouteIndexFarMas(basRgvMapCurrent.getRgvNo(), farCurrentStaNo); //获取合并干涉项 |
| | | basRgvMapCurrent.setLockEndRoute(fallMerge); |
| | | Integer i = basRgvMapMapper.updateById(basRgvMapCurrent); |
| | | // if (i>0){ |
| | | log.error("{}:==>{}:{}号车更新结束锁,{}",sign,new Date(),basRgvMapCurrent.getRgvNo(),JSON.toJSONString(basRgvMapCurrent)); |
| | | // } |
| | | |
| | | //更新另一台小车地图 |
| | | Integer rgvNoOther = basRgvMapCurrent.getRgvNoOther(basRgvMapCurrent.getRgvNo()); |
| | | BasRgvMap basRgvMapOther = basRgvMapMapper.selectById(rgvNoOther); |
| | | List<Integer> integers = RouteUtils.RouteMapCurrentFar(fallMerge, basRgvMapCurrent.getLockStartRoute()); |
| | | Integer lockEndRoute = RouteUtils.RouteMapOtherFarStnNo(integers, basRgvMapCurrent.getLockStartRoute());//另一台小车可活动最远位置 |
| | | basRgvMapOther.setEndRoute(lockEndRoute); |
| | | Integer i1 = basRgvMapMapper.updateById(basRgvMapOther); |
| | | // if (i1>0){ |
| | | log.error("{}:==>{}:{}号车更新结束位置,{}",sign,new Date(),basRgvMapOther.getRgvNo(),JSON.toJSONString(basRgvMapOther)); |
| | | // } |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("小车地图更新出错!"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * 刷新地图数据 |
| | | * */ |
| | | public synchronized void refreshRgvMap() { |
| | | try{ |
| | | List<BasRgvMap> basRgvMaps = basRgvMapService.selectList(new EntityWrapper<>()); |
| | | for (BasRgvMap rgvSlave:basRgvMaps) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | }else { |
| | | rgvProtocol = rgvProtocol.clone(); |
| | | } |
| | | BasRgv basRgv = basRgvService.selectById(rgvSlave.getRgvNo()); |
| | | if (basRgv == null) { |
| | | log.error("{}号RGV尚未在数据库进行维护!2", rgvSlave.getRgvNo()); |
| | | continue; |
| | | } |
| | | |
| | | // 只有当RGV空闲、自动,工位一无物//rgv可用 |
| | | if (rgvProtocol.getStatusType() == RgvStatusType.IDLE && |
| | | rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | && rgvProtocol.getLoaded1()==0 //现场修改:叠盘机,不满都算无物,怎么判断需要跟电控对接 |
| | | && (rgvProtocol.getTaskNo1()==0) |
| | | &&rgvThread.isPakMk() |
| | | ) { |
| | | BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | |
| | | Integer rgvNoOther = basRgvMap.getRgvNoOther(rgvProtocol.getRgvNo()); |
| | | RgvThread rgvThreadOther = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvNoOther); |
| | | RgvProtocol rgvProtocolOther = rgvThreadOther.getRgvProtocol(); |
| | | if (rgvProtocolOther == null) { |
| | | continue; |
| | | }else { |
| | | rgvProtocolOther = rgvProtocolOther.clone(); |
| | | } |
| | | if (rgvProtocolOther.getStatusType() == RgvStatusType.IDLE |
| | | && rgvProtocolOther.getModeType() == RgvModeType.AUTO |
| | | && rgvProtocolOther.getLoaded1()==0 |
| | | && (rgvProtocolOther.getTaskNo1()==0) |
| | | &&rgvThreadOther.isPakMk() |
| | | ){ |
| | | //对工作档进行判断 |
| | | basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); |
| | | if (rgvProtocol.getTaskNo1() >0 && rgvProtocol.getTaskNo1()<=9000){ |
| | | WrkMastSta wrkMastSta = wrkMastStaMapper.selectByWrkNo(rgvProtocol.getTaskNo1().intValue()); |
| | | rgvMapUpdate(basRgvMap, wrkMastSta.getStaStart(), wrkMastSta.getStaEnd(),"2366"); |
| | | }else if (rgvProtocol.getTaskNo1() == 0){ |
| | | rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute(),"2366"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("4109行执行小车初始化任务下发失败"); |
| | | log.error("4109行"+e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 完成小车任务 |
| | | */ |
| | | public synchronized void rgvCompleteWrkMastSta() { |
| | | try{ |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | List<BasRgvMap> basRgvMaps = basRgvMapService.selectList(new EntityWrapper<>()); |
| | | for (BasRgvMap rgvSlave:basRgvMaps) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | }else { |
| | | rgvProtocol = rgvProtocol.clone(); |
| | | } |
| | | BasRgv basRgv = basRgvService.selectById(rgvSlave.getRgvNo()); |
| | | if (basRgv == null) { |
| | | log.error("{}号RGV尚未在数据库进行维护!3", rgvSlave.getRgvNo()); |
| | | continue; |
| | | } |
| | | |
| | | // 只有当RGV等待WCS确认、自动 |
| | | if ((rgvProtocol.getStatusType1() == RgvStatusType.WAITING || rgvProtocol.getStatusType1()==RgvStatusType.FETCHWAITING) |
| | | && rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | && (rgvProtocol.getStatusType() == RgvStatusType.WORKING1) |
| | | ){ |
| | | log.info("{}号小车等待wcs确认,状态{},参数{}",rgvProtocol.getRgvNo(),rgvProtocol.getStatusType(),rgvProtocol); |
| | | if (rgvProtocol.getTaskNo1()!=0){ |
| | | if (rgvProtocol.getTaskNo1()==32222){ |
| | | boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo()); |
| | | if (!rgvComplete){ |
| | | log.error("小车复位失败,小车号{}!",rgvProtocol.getRgvNo()); |
| | | } |
| | | BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); |
| | | rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute(),"2415"); |
| | | rgvThread.setPakMk(true); |
| | | break; |
| | | } |
| | | WrkMastSta wrkMastSta = wrkMastStaMapper.selectByWrkNo(rgvProtocol.getTaskNo1().intValue()); |
| | | if (Cools.isEmpty(wrkMastSta) || wrkMastSta.getWrkSts()!=1){ |
| | | log.error("未查到小车执行任务或者执行任务状态不符合!"+wrkMastSta); |
| | | continue; |
| | | } |
| | | |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(wrkMastSta.getStaEnd()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (!staProtocol.isAutoing() || !staProtocol.isLoading()){ |
| | | continue; |
| | | } |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep3(wrkMastSta.getWrkNo().intValue()); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | if (!staProtocol.isPakMk()){ |
| | | continue; |
| | | } |
| | | // 下发站点信息 |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | log.error("rgv任务完成给输送线下发命令:"+wrkMast.getWrkNo()+","+wrkMast.getStaNo()); |
| | | if (!MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol))) { |
| | | continue; |
| | | } |
| | | }else { |
| | | log.error("rgv任务完成给输送线下发命令,但未查询到工作档"); |
| | | // 下发站点信息 |
| | | Map<Integer,Integer> map = new HashMap<>(); |
| | | map.put(101,102);map.put(112,111); |
| | | map.put(100,100); |
| | | staProtocol.setWorkNo(rgvProtocol.getTaskNo1().intValue()); |
| | | staProtocol.setStaNo(map.get(rgvProtocol.getRgvPosI()).shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // log.error("rgv任务完成给输送线下发命令:"+wrkMast.getWrkNo()+","+wrkMast.getStaNo()); |
| | | if (!MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol))) { |
| | | continue; |
| | | } |
| | | } |
| | | boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo()); |
| | | // boolean rgvComplete = true; |
| | | if (!rgvComplete){ |
| | | log.error("小车复位失败,小车号{}!",rgvProtocol.getRgvNo()); |
| | | break; |
| | | } |
| | | WrkMast wrkMast1 = wrkMastService.selectByWrkNo(rgvProtocol.getTaskNo1().intValue()); |
| | | wrkMast1.setUpdMk("Y"); |
| | | |
| | | wrkMastService.updateById(wrkMast1); |
| | | |
| | | wrkMastSta.setWrkSts(3); |
| | | wrkMastStaMapper.updateById(wrkMastSta); |
| | | BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); |
| | | rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute(),"2471"); |
| | | rgvThread.setPakMk(true); |
| | | } |
| | | |
| | | else { |
| | | log.error("小车复位失败,小车号{},等待wcs确认但是没有工作号!",rgvProtocol.getRgvNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("小车复位线程报错!"+e); |
| | | } |
| | | } |
| | | /** |
| | | * 执行小车搬运任务 |
| | | */ |
| | | public synchronized void rgvRunWrkMastFullSta() { |
| | | boolean wrkEnable = false; |
| | | try{ |
| | | List<BasRgvMap> basRgvMaps = basRgvMapService.selectList(new EntityWrapper<>()); |
| | | for (BasRgvMap rgvSlave:basRgvMaps) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | }else { |
| | | rgvProtocol = rgvProtocol.clone(); |
| | | } |
| | | BasRgv basRgv = basRgvService.selectById(rgvSlave.getRgvNo()); |
| | | if (basRgv == null) { |
| | | log.error("{}号RGV尚未在数据库进行维护!4", rgvSlave.getRgvNo()); |
| | | continue; |
| | | } |
| | | |
| | | // 只有当RGV空闲、自动,工位一无物//rgv可用 |
| | | if (rgvProtocol.getStatusType() == RgvStatusType.IDLE |
| | | && rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | && rgvProtocol.getLoaded1()==0 |
| | | && rgvProtocol.getTaskNo1() == 0 |
| | | ) { |
| | | BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | if (basRgvMap == null) { |
| | | log.error("{}号RGV尚未在数据库地图中进行维护!", rgvProtocol.getRgvNo()); |
| | | continue; |
| | | } |
| | | List<Integer> route = RouteUtils.getRoute(basRgvMap.getStartRoute(), basRgvMap.getEndRoute()); |
| | | basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); //更新小车当前位置站点号 |
| | | List<WrkMastSta> wrkMastStaList = wrkMastStaMapper.selectNoInterfereList(route, route); |
| | | for (WrkMastSta wrkMastSta : wrkMastStaList){ |
| | | if (wrkMastSta.getType()!=0 || wrkMastSta.getWrkType()!=3){//1:满版 3:取放 |
| | | continue; |
| | | } |
| | | boolean sign = rgvTakeFullAll(basRgvMap.getRgvNo(), wrkMastSta); //命令下发 |
| | | wrkEnable = true; |
| | | if (sign){ |
| | | rgvThread.setPakMk(false); |
| | | boolean signMap = rgvMapUpdate(basRgvMap, wrkMastSta.getStaStart(), wrkMastSta.getStaEnd(),"2526"); |
| | | if (signMap){ |
| | | Thread.sleep(300); |
| | | wrkMastSta.setWrkSts(1); |
| | | try{ |
| | | wrkMastStaMapper.updateById(wrkMastSta); |
| | | return; |
| | | }catch (Exception e){ |
| | | log.error("更新小车任务失败"); |
| | | } |
| | | break; |
| | | }else { |
| | | log.error("3864行,货物搬运任务:工作号{}所属任务下发后地图同步失败",wrkMastSta.getWrkNo()); |
| | | } |
| | | } else { |
| | | log.error("工作号{}所属任务下发失败",wrkMastSta.getWrkNo()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (!wrkEnable){ |
| | | rgvRunWrkMastEmptyStaAvoidance(); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("3875行执行小车搬运任务下发失败"); |
| | | log.error("3875行"+e); |
| | | } |
| | | } |
| | | /** |
| | | * 执行小车搬运任务 |
| | | */ |
| | | // public synchronized void rgvRunWrkMastEmptyStaPut() {//放 |
| | | // try{ |
| | | // for (RgvSlave rgvSlave:slaveProperties.getRgv()) { |
| | | // RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | // RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | // if (rgvProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // BasRgv basRgv = basRgvService.selectById(rgvSlave.getId()); |
| | | // if (basRgv == null) { |
| | | // log.error("{}号RGV尚未在数据库进行维护!5", rgvSlave.getId()); |
| | | // continue; |
| | | // } |
| | | // |
| | | // // 只有当RGV空闲、自动,工位二有物//rgv可用 |
| | | // if (rgvProtocol.getStatusType() == RgvStatusType.IDLE |
| | | // && rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | // && rgvProtocol.getLoaded1()==1 //现场修改:叠盘机,不满都算无物,怎么判断需要跟电控对接 |
| | | // ) { |
| | | // BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | // if (basRgvMap == null) { |
| | | // log.error("{}号RGV尚未在数据库地图中进行维护!", rgvProtocol.getRgvNo()); |
| | | // continue; |
| | | // } |
| | | // basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); //更新小车当前位置站点号 |
| | | // List<Integer> route = RouteUtils.getRoute(basRgvMap.getStartRoute(), basRgvMap.getEndRoute());//获取活动范围 |
| | | // List<WrkMastSta> wrkMastStaList = wrkMastStaMapper.selectNoInterfereList(route, route);//查询可执行任务 |
| | | // for (WrkMastSta wrkMastSta : wrkMastStaList){ |
| | | // if (wrkMastSta.getType()!=2 || (wrkMastSta.getWrkType()!=2 && wrkMastSta.getWrkType()!=4)){// 2:空板 2:放 4:拆盘 |
| | | // continue; |
| | | // } |
| | | // boolean sign = false; |
| | | // if (wrkMastSta.getStaStart()==0 && wrkMastSta.getStaEnd()!=0){//放 |
| | | // sign = rgvPutEmpty(rgvProtocol.getRgvNo(),wrkMastSta); |
| | | // }else { |
| | | // continue; |
| | | // } |
| | | // if (sign){ |
| | | // boolean signMap = rgvMapUpdate(basRgvMap, basRgvMap.getStartRoute(), wrkMastSta.getStaEnd()); |
| | | // if (signMap){ |
| | | // wrkMastSta.setWrkSts(2); |
| | | // try{ |
| | | // wrkMastStaMapper.updateById(wrkMastSta); |
| | | // }catch (Exception e){ |
| | | // log.error("更新小车任务失败"); |
| | | // } |
| | | // return; |
| | | // }else { |
| | | // log.error("3857行,货物搬运任务:工作号{}所属任务下发后地图同步失败",wrkMastSta.getWrkNo()); |
| | | // } |
| | | // }else { |
| | | // log.error("工作号{}所属任务下发失败",wrkMastSta.getWrkNo()); |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // }catch (Exception e){ |
| | | // log.error("3933行执行小车放空板任务下发失败"); |
| | | // log.error("3933行"+e); |
| | | // } |
| | | // } |
| | | |
| | | // public synchronized void rgvRunWrkMastEmptyStaTake() {//取 |
| | | // try{ |
| | | // for (RgvSlave rgvSlave:slaveProperties.getRgv()) { |
| | | // RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | // RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | // if (rgvProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // BasRgv basRgv = basRgvService.selectById(rgvSlave.getId()); |
| | | // if (basRgv == null) { |
| | | // log.error("{}号RGV尚未在数据库进行维护!6", rgvSlave.getId()); |
| | | // continue; |
| | | // } |
| | | // |
| | | // // 只有当RGV空闲、自动,工位二无物//rgv可用 |
| | | // if (rgvProtocol.getStatusType() == RgvStatusType.IDLE |
| | | // && rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | // && rgvProtocol.getLoaded1()==0 //现场修改:叠盘机,不满都算无物,怎么判断需要跟电控对接 |
| | | // ) { |
| | | // BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | // if (basRgvMap == null) { |
| | | // log.error("{}号RGV尚未在数据库地图中进行维护!", rgvProtocol.getRgvNo()); |
| | | // continue; |
| | | // } |
| | | // List<Integer> route = RouteUtils.getRoute(basRgvMap.getStartRoute(), basRgvMap.getEndRoute()); |
| | | // basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); //更新小车当前位置站点号 |
| | | // List<WrkMastSta> wrkMastStaList = wrkMastStaMapper.selectNoInterfereList(route, route); |
| | | // for (WrkMastSta wrkMastSta : wrkMastStaList){ |
| | | // if (wrkMastSta.getType()!=2 || wrkMastSta.getWrkType()!=1){// 2:空板 1:取 |
| | | // continue; |
| | | // } |
| | | // boolean sign = false; |
| | | // if (wrkMastSta.getStaEnd()==0 && wrkMastSta.getStaStart()!=0){//取 |
| | | // sign = rgvTakeEmpty(rgvProtocol.getRgvNo(),wrkMastSta); |
| | | // } else { |
| | | // continue; |
| | | // } |
| | | // if (sign){ |
| | | // boolean signMap = rgvMapUpdate(basRgvMap, wrkMastSta.getStaStart(), basRgvMap.getStartRoute()); |
| | | // if (signMap){ |
| | | // wrkMastSta.setWrkSts(1); |
| | | // try{ |
| | | // wrkMastStaMapper.updateById(wrkMastSta); |
| | | // }catch (Exception e){ |
| | | // log.error("更新小车任务失败"); |
| | | // } |
| | | // return; |
| | | // }else { |
| | | // log.error("3879行,货物搬运任务:工作号{}所属任务下发后地图同步失败",wrkMastSta.getWrkNo()); |
| | | // } |
| | | // }else { |
| | | // log.error("工作号{}所属任务下发失败",wrkMastSta.getWrkNo()); |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // }catch (Exception e){ |
| | | // log.error("3989行执行小车取空板任务下发失败"); |
| | | // log.error("3989行"+e); |
| | | // } |
| | | // } |
| | | |
| | | /* |
| | | * 有任务但未执行 此时需要调整小车位置 |
| | | * */ |
| | | public synchronized void rgvRunWrkMastEmptyStaAvoidance() { |
| | | try{ |
| | | Integer integer = wrkMastStaMapper.selectAllWrkStsCount(null,0);//查询状态为0的任务 |
| | | if (integer==0){ |
| | | return; |
| | | } |
| | | List<BasRgvMap> basRgvMaps = basRgvMapService.selectList(new EntityWrapper<>()); |
| | | for (BasRgvMap rgvSlave:basRgvMaps) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | }else { |
| | | rgvProtocol = rgvProtocol.clone(); |
| | | } |
| | | BasRgv basRgv = basRgvService.selectById(rgvSlave.getRgvNo()); |
| | | if (basRgv == null) { |
| | | log.error("{}号RGV尚未在数据库进行维护!1", rgvSlave.getRgvNo()); |
| | | continue; |
| | | } |
| | | |
| | | // 只有当RGV空闲、自动,工位一无物//rgv可用 |
| | | if (rgvProtocol.getStatusType() == RgvStatusType.IDLE |
| | | && rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | && rgvProtocol.getLoaded1()==0 //现场修改:叠盘机,不满都算无物,怎么判断需要跟电控对接 |
| | | && rgvProtocol.getTaskNo1()==0 |
| | | && rgvProtocol.getStatusType1() == RgvStatusType.IDLE |
| | | // && rgvProtocol.getTaskNo2()==0 |
| | | ) { |
| | | BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo()); |
| | | if (rgvProtocol.getRgvPosI().equals(basRgvMap.getStartRoute())){ |
| | | continue; |
| | | } |
| | | // if (rgvProtocol.getRgvNo()==1 && rgvProtocol.getRgvPosI().equals(100)){ |
| | | // continue; |
| | | // } else if (rgvProtocol.getRgvNo()==2 && rgvProtocol.getRgvPosI().equals(157) ){ |
| | | // continue; |
| | | // } |
| | | rgvAvoidanceXY(rgvProtocol.getRgvNo()); |
| | | rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute(),"2727"); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("4109行执行小车初始化任务下发失败"); |
| | | log.error("4109行"+e); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * 小车XY移动 避让 |
| | | * */ |
| | | public synchronized boolean rgvAvoidanceXY(Integer rgvId){ |
| | | BasRgvMap basRgvMap = basRgvMapService.selectByRgvNo(rgvId); |
| | | if (basRgvMap.getStartRoute() == 100 || basRgvMap.getStartRoute() == 101){ |
| | | try{ |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | rgvCommand.setAckFinish1((short) 0); // 工位1任务完成确认位 |
| | | rgvCommand.setTaskNo1((short)32222); // 工位1工作号 |
| | | rgvCommand.setTaskMode1(RgvTaskModeType.X_MOVE); // 工位1任务模式: 回原点 |
| | | //basRgvMap.getLockStartRoute().shortValue() |
| | | rgvCommand.setSourceStaNo1(basRgvMap.getStartRoute().shortValue()); |
| | | rgvCommand.setCommand((short) 1); //工位1任务确认 |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) { |
| | | //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 step=9,回原点 9999任务号 |
| | | log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }catch (Exception e){ |
| | | return false; |
| | | |
| | | } |
| | | }else { |
| | | try{ |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | rgvCommand.setAckFinish1((short) 0); // 工位1任务完成确认位 |
| | | rgvCommand.setTaskNo1((short)32222); // 工位1工作号 |
| | | rgvCommand.setTaskMode1(RgvTaskModeType.X_MOVE); // 工位1任务模式: 回原点 |
| | | //basRgvMap.getLockStartRoute().shortValue() |
| | | rgvCommand.setSourceStaNo1(basRgvMap.getStartRoute().shortValue()); |
| | | rgvCommand.setCommand((short) 1); //工位1任务确认 |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) { |
| | | //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 step=9,回原点 9999任务号 |
| | | log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }catch (Exception e){ |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /* |
| | | * 小车取货至工位任务 |
| | | * */ |
| | | public synchronized boolean rgvTakeFullAll(Integer rgvId,WrkMastSta wrkMastSta){ |
| | | try{ |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | rgvCommand.setAckFinish1((short) 0); // 工位1任务完成确认位 |
| | | rgvCommand.setTaskNo1(wrkMastSta.getWrkNo().shortValue()); // 工位1工作号 |
| | | rgvCommand.setTaskMode1(RgvTaskModeType.FETCH_PUT); // 工位1任务模式: 取放货 |
| | | rgvCommand.setSourceStaNo1(wrkMastSta.getStaStart().shortValue()); //工位1起点 |
| | | rgvCommand.setDestinationStaNo1(wrkMastSta.getStaEnd().shortValue()); //工位1目标站点 |
| | | rgvCommand.setCommand((short) 1); //工位1任务确认 |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) { |
| | | //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * 小车取货至工位任务 |
| | | * */ |
| | | // public synchronized boolean rgvTakeFull(Integer rgvId,WrkMastSta wrkMastSta){ |
| | | // try{ |
| | | // // 命令下发区 -------------------------------------------------------------------------- |
| | | // RgvCommand rgvCommand = new RgvCommand(); |
| | | // rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | // rgvCommand.setAckFinish1((short) 0); // 工位1任务完成确认位 |
| | | // rgvCommand.setTaskNo1(wrkMastSta.getWrkNo().shortValue()); // 工位1工作号 |
| | | // rgvCommand.setTaskMode1(RgvTaskModeType.FETCH); // 工位1任务模式: 取货 |
| | | // rgvCommand.setSourceStaNo1(wrkMastSta.getStaStart().shortValue()); //工位1起点 |
| | | // rgvCommand.setCommand((short) 1); //工位1任务确认 |
| | | // if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) { |
| | | // //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | // log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | // return false; |
| | | // } else { |
| | | // return true; |
| | | // } |
| | | // }catch (Exception e){ |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | /* |
| | | * 小车放货至输送线任务 |
| | | * */ |
| | | // public synchronized boolean rgvPutFull(Integer rgvId,WrkMastSta wrkMastSta){ |
| | | // try{ |
| | | // // 命令下发区 -------------------------------------------------------------------------- |
| | | // RgvCommand rgvCommand = new RgvCommand(); |
| | | // rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | // rgvCommand.setAckFinish1((short) 0); // 工位1任务完成确认位 |
| | | // rgvCommand.setTaskNo1(wrkMastSta.getWrkNo().shortValue()); // 工位1工作号 |
| | | // rgvCommand.setTaskMode1(RgvTaskModeType.PUT); // 工位1任务模式: 放货 |
| | | // rgvCommand.setDestinationStaNo1(wrkMastSta.getStaEnd().shortValue()); //工位1目标站点 |
| | | // rgvCommand.setCommand((short) 1); //工位1任务确认 |
| | | // if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) { |
| | | // //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | // log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | // return false; |
| | | // } else { |
| | | // return true; |
| | | // } |
| | | // }catch (Exception e){ |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | /* |
| | | * 小车取空板至工位任务 |
| | | * */ |
| | | // public synchronized boolean rgvTakeEmpty(Integer rgvId,WrkMastSta wrkMastSta){ |
| | | // try{ |
| | | // // 命令下发区 -------------------------------------------------------------------------- |
| | | // RgvCommand rgvCommand = new RgvCommand(); |
| | | // rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | // rgvCommand.setAckFinish2((short) 0); // 工位2任务完成确认位 |
| | | // rgvCommand.setTaskNo2(wrkMastSta.getWrkNo().shortValue()); // 工位2工作号 |
| | | // rgvCommand.setTaskMode2(RgvTaskModeType.FETCH); // 工位2任务模式: 取货 |
| | | // rgvCommand.setSourceStaNo2(wrkMastSta.getStaStart().shortValue()); //工位2起点 |
| | | // rgvCommand.setCommand((short) 2); //工位2任务确认 |
| | | // if (!MessageQueue.offer(SlaveType.Crn, rgvId, new Task(5, rgvCommand))) { |
| | | // //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | // log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | // return false; |
| | | // } else { |
| | | // return true; |
| | | // } |
| | | // }catch (Exception e){ |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | /* |
| | | * 小车放空板至输送线任务 |
| | | * */ |
| | | // public synchronized boolean rgvPutEmpty(Integer rgvId,WrkMastSta wrkMastSta){ |
| | | // try{ |
| | | // // 命令下发区 -------------------------------------------------------------------------- |
| | | // RgvCommand rgvCommand = new RgvCommand(); |
| | | // rgvCommand.setRgvNo(rgvId); // RGV编号 |
| | | // rgvCommand.setAckFinish2((short) 0); // 工位2任务完成确认位 |
| | | // rgvCommand.setTaskNo2(wrkMastSta.getWrkNo().shortValue()); // 工位2工作号 |
| | | // rgvCommand.setTaskMode2(RgvTaskModeType.PUT); // 工位2任务模式: 放货 |
| | | // rgvCommand.setDestinationStaNo2(wrkMastSta.getStaEnd().shortValue()); //工位2目标站点 |
| | | // rgvCommand.setCommand((short) 2); //工位2任务确认 |
| | | // if (!MessageQueue.offer(SlaveType.Crn, rgvId, new Task(5, rgvCommand))) { |
| | | // //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | // log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | // return false; |
| | | // } else { |
| | | // return true; |
| | | // } |
| | | // }catch (Exception e){ |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | /* |
| | | * 小车复位 |
| | | * */ |
| | | public synchronized boolean rgvComplete(Integer rgvId){ |
| | | try{ |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(3, new RgvCommand()))) { |
| | | //step=2,工位1、2写任务; step=4,工位1写任务; step=5,工位2写任务 |
| | | log.error("RGV命令下发失败,RGV号={}",rgvId); |
| | | return false; |
| | | } else { |
| | | log.info("RGV命令下发成功,RGV号={}",rgvId); |
| | | return true; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("RGV命令下发失败,RGV号={}。异常:"+e,rgvId); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public synchronized void autoMoveLoc() { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 16L)); |
| | | if (wrkMast == null || wrkMast.getStaNo() != 104 && wrkMast.getStaNo() != 107) { |
| | | return; |
| | | } |
| | | // 判断源站点情况 有任务号,有物,自动 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol106 = devpThread.getStation().get(106); |
| | | StaProtocol staProtocol105 = devpThread.getStation().get(105); |
| | | StaProtocol staProtocol107 = devpThread.getStation().get(107); |
| | | if (staProtocol106 == null) { |
| | | return; |
| | | } else { |
| | | staProtocol106 = staProtocol106.clone(); |
| | | } |
| | | if (staProtocol105 == null) { |
| | | return; |
| | | } else { |
| | | staProtocol105 = staProtocol105.clone(); |
| | | } |
| | | if (staProtocol107 == null) { |
| | | return; |
| | | } else { |
| | | staProtocol107 = staProtocol107.clone(); |
| | | } |
| | | |
| | | if (wrkMast.getStaNo() == 104) { |
| | | // 判断出库站点情况,可入,堆垛机可以取货,可出,堆垛机可以放货 |
| | | if (!staProtocol106.isInEnable() || !staProtocol105.isOutEnable() || !staProtocol105.isLoading()) { |
| | | return; |
| | | } |
| | | } else if (wrkMast.getStaNo() == 107) { |
| | | if (!staProtocol106.isInEnable() || !staProtocol107.isOutEnable() || staProtocol107.isLoading()) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 获取堆垛机信息 并 判断是否可入出 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, 1); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | return; |
| | | } |
| | | BasCrnp basCrnp = basCrnpService.selectById(1); |
| | | if (!basCrnp.getInEnable().equals("Y") && !basCrnp.getOutEnable().equals("Y")) { |
| | | return; |
| | | } |
| | | |
| | | // 堆垛机控制过滤 |
| | | if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { |
| | | return; |
| | | } |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(1) != null) { |
| | | return; |
| | | } |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(1); // 堆垛机编号 |
| | | crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | crnCommand.setSourcePosX((short) 3); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 28); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 1); // 源库位层 |
| | | crnCommand.setDestinationPosX((short) 1); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) 28); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) 1); // 目标库位层 |
| | | if(wrkMast.getStaNo() == 104) { // 目标站104,出到105位置 |
| | | crnCommand.setDestinationPosX((short) 2); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) 4); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) 1); // 目标库位层 |
| | | } |
| | | crnCommand.setCommand((short)1); |
| | | crnCommand.setTraySize(true); //库位类型 |
| | | if (!MessageQueue.offer(SlaveType.Crn, 1, new Task(2, crnCommand))) { |
| | | News.error("106移库1号堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } |
| | | // else { |
| | | // wrkMast.setCrnNo(2); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // } |
| | | News.infoNoLog("106移库给1号堆垛机下发完成"); |
| | | } |
| | | |
| | | public synchronized void writePlc305() { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305)); |
| | | if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) { |
| | | WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo()); |
| | | if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol305 = devpThread.getStation().get(305); |
| | | if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开 |
| | | // 请求打开 |
| | | if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){ |
| | | log.error("请求开门失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | public synchronized void readPlc305() { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 16L)); |
| | | |
| | | } |
| | | |
| | | public synchronized void invokingBase() { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 1L).eq("io_type", 1) |
| | | .eq("source_sta_no", 305)); |
| | | if (wrkMast != null) { |
| | | int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("wrk_sts", 2L).eq("io_type", 1) |
| | | .eq("source_sta_no", 305)); |
| | | if (count != 0) { |
| | | log.warn("存在305入库任务,状态为设备上走"); |
| | | return; |
| | | } |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol= devpThread.getStation().get(wrkMast.getStaNo()); |
| | | if (staProtocol == null) { |
| | | return; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if(staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() == 0) { |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getSourceStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp,1, new Task(2, staProtocol)); |
| | | log.info("入库请求底座------"); |
| | | } |
| | | } |
| | | } |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://10.10.10.243:1433;databasename=ghlnasrs |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=ghlnasrs |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=mdqzasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | enable: false |
| | | |
| | | wms: |
| | | url: 10.10.10.243:8080/ghlnwms |
| | | url: 127.0.0.1:8080/mdqzwms |
| | | |
| | | # 下位机配置 |
| | | wcs-slave: |
| | |
| | | row: 6 |
| | | bay: 28 |
| | | lev: 1 |
| | | # 堆垛机3 |
| | | crn[2]: |
| | | id: 3 |
| | | ip: 10.10.10.20 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | row: 6 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | row: 6 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机4 |
| | | crn[3]: |
| | | id: 4 |
| | | ip: 10.10.10.30 |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 偏移量,当堆垛机站点列号=1时,偏移量=2 |
| | | offset: 2 |
| | | demo: false |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | row: 6 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | row: 6 |
| | | bay: 1 |
| | | lev: 1 |
| | | |
| | | # 输送线1 |
| | | devp[0]: |
| | |
| | | # 入库口3 |
| | | inSta[2]: |
| | | staNo: 305 |
| | | # 空板入库口1 |
| | | # emptyInSta[0]: |
| | | # staNo: 101 |
| | | # barcode: ${wcs-slave.barcode[0].id} |
| | | # backSta: 100 |
| | | # led: ${wcs-slave.led[0].id} |
| | | # emptyInSta[1]: |
| | | # staNo: 103 |
| | | # barcode: ${wcs-slave.barcode[1].id} |
| | | # backSta: 102 |
| | | # led: ${wcs-slave.led[1].id} |
| | | # 出库口1 |
| | | outSta[0]: |
| | | staNo: 100 |
| | |
| | | outSta[1]: |
| | | staNo: 102 |
| | | led: ${wcs-slave.led[1].id} |
| | | # 出库口3 |
| | | outSta[2]: |
| | | staNo: 104 |
| | | led: ${wcs-slave.led[2].id} |
| | | # 出库口4 |
| | | outSta[3]: |
| | | staNo: 107 |
| | | # 出库口5 |
| | | outSta[4]: |
| | | staNo: 305 |
| | | |
| | | # 条码扫描仪1 |
| | | barcode[0]: |
| | |
| | | id: 2 |
| | | ip: 10.10.10.122 |
| | | port: 51236 |
| | | # 条码扫描仪3 |
| | | barcode[2]: |
| | | id: 3 |
| | | ip: 10.10.10.122 |
| | | port: 51236 |
| | | # 条码扫描仪4 |
| | | barcode[3]: |
| | | id: 4 |
| | | ip: 10.10.10.122 |
| | | port: 51236 |
| | | |
| | | # LED1 |
| | | led[0]: |
| | |
| | | ip: 10.10.10.190 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 101,100 |
| | | |
| | | staArr: 101 |
| | | # LED2 |
| | | led[1]: |
| | | id: 2 |
| | | ip: 10.10.10.191 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 102,103 |
| | | staArr: 102 |
| | | # LED3 |
| | | led[2]: |
| | | id: 3 |
| | | ip: 10.10.10.192 |
| | | ip: 10.10.10.191 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 104 |
| | | staArr: 102 |
| | | # LED4 |
| | | led[3]: |
| | | id: 4 |
| | | ip: 10.10.10.191 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 102 |
| | | # LED5 |
| | | led[4]: |
| | | id: 5 |
| | | ip: 10.10.10.191 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 102 |
| | | # LED6 |
| | | led[5]: |
| | | id: 6 |
| | | ip: 10.10.10.191 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 102 |
| | | # LED7 |
| | | led[6]: |
| | | id: 7 |
| | | ip: 10.10.10.191 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 102 |
| | |
| | | var baseUrl = "/ghlnwcs"; |
| | | var baseUrl = "/mdqzwcs"; |
| | | |
| | | // 赋值 |
| | | function setVal(el, val) { |
| | |
| | | let bLen |
| | | let interval // 间隔数 |
| | | |
| | | if (maxBayNo<35) { |
| | | if (i < 8) { |
| | | interval = 1 |
| | | bLen = maxBayNo / interval // 库位个数 |
| | | } else { |
| | |
| | | "rackCount": 8, |
| | | "crnCount": 2, |
| | | "stbCount": 18, |
| | | "hpPosition": 1, |
| | | "hpPosition": 2, |
| | | "minBayNo": 1, |
| | | "floors": 2, |
| | | "floors": 1, |
| | | "racks": [{ |
| | | "type": "rack", |
| | | "id": "rack1", |
| | | "top": 189, |
| | | "left": 200, |
| | | "width": 1350, |
| | | "height": 23, |
| | | "top": 100, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack8", |
| | | "top": 457, |
| | | "left": 200, |
| | | "width": 1300, |
| | | "height": 23, |
| | | "minBayNo": 2, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack7", |
| | | "top": 430, |
| | | "left": 200, |
| | | "width": 1300, |
| | | "height": 23, |
| | | "minBayNo": 2, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack6", |
| | | "top": 365, |
| | | "left": 200, |
| | | "width": 1350, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack5", |
| | | "top": 338, |
| | | "left": 200, |
| | | "width": 1350, |
| | | "height": 23, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack4", |
| | | "top": 311, |
| | | "left": 200, |
| | | "width": 1300, |
| | | "height": 23, |
| | | "minBayNo": 2, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "type": "rack", |
| | | "id": "rack3", |
| | | "top": 283, |
| | | "left": 200, |
| | | "width": 1300, |
| | | "height": 23, |
| | | "minBayNo": 2, |
| | | "maxBayNo": 31 |
| | | }, { |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack2", |
| | | "top": 217, |
| | | "left": 200, |
| | | "width": 1350, |
| | | "height": 23, |
| | | "top": 120, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 31 |
| | | }], |
| | | "rackDescs": [{ |
| | | "type": "rackDescs", |
| | | "id": "lb_desc8", |
| | | "text": "#8", |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack3", |
| | | "top": 170, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack4", |
| | | "top": 190, |
| | | "left": 150, |
| | | "width": 33, |
| | | "height": 23 |
| | | }, |
| | | {"type": "rackDescs", "id": "lb_desc7", "text": "#7", "top": 218, "left": 150, "width": 33, "height": 23}, |
| | | {"type": "rackDescs", "id": "lb_desc6", "text": "#6", "top": 280, "left": 150, "width": 33, "height": 23}, |
| | | {"type": "rackDescs", "id": "lb_desc5", "text": "#5", "top": 310, "left": 150, "width": 33, "height": 23}, |
| | | {"type": "rackDescs", "id": "lb_desc4", "text": "#4", "top": 340, "left": 150, "width": 33, "height": 23}, |
| | | {"type": "rackDescs", "id": "lb_desc3", "text": "#3", "top": 370, "left": 150, "width": 33, "height": 23}, |
| | | {"type": "rackDescs", "id": "lb_desc2", "text": "#2", "top": 430, "left": 150, "width": 33, "height": 23}, |
| | | {"type": "rackDescs", "id": "lb_desc1", "text": "#1", "top": 460, "left": 150, "width": 33, "height": 23}], |
| | | "crns": [{ |
| | | "type": "crane", |
| | | "id": "crn-1", |
| | | "text": "1", |
| | | "top": 393, |
| | | "left": 376, |
| | | "width": 101, |
| | | "height": 32 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track4", |
| | | "text": "", |
| | | "top": 408, |
| | | "left": 200, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 1 |
| | | }, { |
| | | "type": "crane", |
| | | "id": "crn-2", |
| | | "text": "2", |
| | | "top": 250, |
| | | "left": 383, |
| | | "width": 101, |
| | | "height": 29 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track3", |
| | | "text": "", |
| | | "top": 265, |
| | | "left": 200, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack5", |
| | | "top": 210, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 1 |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack6", |
| | | "top": 260, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack7", |
| | | "top": 280, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack8", |
| | | "top": 330, |
| | | "left": 450, |
| | | "width": 1300, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack9", |
| | | "top": 455, |
| | | "left": 960, |
| | | "width": 800, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack10", |
| | | "top": 475, |
| | | "left": 960, |
| | | "width": 800, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack11", |
| | | "top": 525, |
| | | "left": 960, |
| | | "width": 800, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | },{ |
| | | "type": "rack", |
| | | "id": "rack12", |
| | | "top": 545, |
| | | "left": 960, |
| | | "width": 800, |
| | | "height": 20, |
| | | "minBayNo": 1, |
| | | "maxBayNo": 40 |
| | | }], |
| | | "rackDescs": [ |
| | | {"type": "rackDescs", "id": "lb_desc1", "text": "#1", "top": 102, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc2", "text": "#2", "top": 120, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc3", "text": "#3", "top": 172, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc4", "text": "#4", "top": 192, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc5", "text": "#5", "top": 212, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc6", "text": "#6", "top": 262, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc7", "text": "#7", "top": 282, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc8", "text": "#8", "top": 332, "left": 1750, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc9", "text": "#9", "top": 457, "left": 1760, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc10", "text": "10", "top": 476, "left": 1760, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc11", "text": "11", "top": 527, "left": 1760, "width": 30, "height": 20}, |
| | | {"type": "rackDescs", "id": "lb_desc12", "text": "12", "top": 546, "left": 1760, "width": 30, "height": 20} |
| | | ], |
| | | "crns": [ |
| | | {"type": "crane", "id": "crn-1", "text": "1", "top": 142, "left": 376, "width": 100, "height": 30}, |
| | | {"type": "track", "id": "lb_track1","text": "", "top": 159, "left": 450, "width": 1300, "height": 1}, |
| | | {"type": "crane", "id": "crn-2", "text": "2", "top": 232, "left": 376, "width": 100, "height": 30}, |
| | | {"type": "track", "id": "lb_track2","text": "", "top": 250, "left": 450, "width": 1300, "height": 1}, |
| | | {"type": "crane", "id": "crn-3", "text": "3", "top": 302, "left": 460, "width": 100, "height": 30}, |
| | | {"type": "track", "id": "lb_track3","text": "", "top": 320, "left": 450, "width": 1300, "height": 1}, |
| | | {"type": "crane", "id": "crn-4", "text": "4", "top": 497, "left": 1200, "width": 100, "height": 30}, |
| | | {"type": "track", "id": "lb_track4","text": "", "top": 515, "left": 960, "width": 800, "height": 1}, |
| | | {"type": "track", "id": "lb_track5","text": "", "top": 612, "left": 303, "width": 1430, "height": 1}, |
| | | {"type": "track", "id": "lb_track6","text": "", "top": 638, "left": 270 , "width": 1464, "height": 1}, |
| | | {"type": "track", "id": "lb_track7","text": "", "top": 612, "left": 1733, "width": 1, "height": 26}, |
| | | {"type": "track", "id": "lb_track8","text": "", "top": 100, "left": 303, "width": 1, "height": 513}, |
| | | {"type": "track", "id": "lb_track9","text": "", "top": 100, "left": 270, "width": 33, "height": 1}, |
| | | {"type": "track", "id": "lb_track10","text": "", "top": 100, "left": 270, "width": 1, "height": 538}, |
| | | ], |
| | | "areas": [{ |
| | | "type": "Control_floor", |
| | | "id": "tabControl_floor1", |
| | |
| | | "left": 22, |
| | | "width": 1677, |
| | | "height": 613, |
| | | "stns": [{ |
| | | "type": "stn", |
| | | "id": "site-102", |
| | | "text": "102", |
| | | "top": 431, |
| | | "left": 1600, |
| | | "width": 59, |
| | | "height": 27 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-103", |
| | | "text": "103", |
| | | "top": 431, |
| | | "left": 1520, |
| | | "width": 59, |
| | | "height": 27 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-100", |
| | | "text": "100", |
| | | "top": 285, |
| | | "left": 1600, |
| | | "width": 59, |
| | | "height": 25 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-101", |
| | | "text": "101", |
| | | "top": 285, |
| | | "left": 1520, |
| | | "width": 59, |
| | | "height": 25 |
| | | }, |
| | | { |
| | | "type": "stn", |
| | | "id": "site-105", |
| | | "text": "105", |
| | | "top": 431, |
| | | "left": 1328, |
| | | "width": 85, |
| | | "height": 50 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-104", |
| | | "text": "104", |
| | | "top": 491, |
| | | "left": 1328, |
| | | "width": 85, |
| | | "height": 50 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-106", |
| | | "text": "106", |
| | | "top": 284, |
| | | "left": 287, |
| | | "width": 86, |
| | | "height": 105 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-107", |
| | | "text": "107", |
| | | "top": 431, |
| | | "left": 287, |
| | | "width": 86, |
| | | "height": 50 |
| | | }] |
| | | }, { |
| | | "type": "floor", |
| | | "id": "page_floor2", |
| | | "text": "2F", |
| | | "top": 4, |
| | | "left": 22, |
| | | "width": 1677, |
| | | "height": 613, |
| | | "stns": [{ |
| | | "type": "stn", |
| | | "id": "site-202", |
| | | "text": "202", |
| | | "top": 431, |
| | | "left": 1600, |
| | | "width": 59, |
| | | "height": 27 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-203", |
| | | "text": "203", |
| | | "top": 431, |
| | | "left": 1520, |
| | | "width": 59, |
| | | "height": 27 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-200", |
| | | "text": "200", |
| | | "top": 285, |
| | | "left": 1600, |
| | | "width": 59, |
| | | "height": 25 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-201", |
| | | "text": "201", |
| | | "top": 285, |
| | | "left": 1520, |
| | | "width": 59, |
| | | "height": 25 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-210", |
| | | "text": "210", |
| | | "top": 431, |
| | | "left": 1680, |
| | | "width": 59, |
| | | "height": 25 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track5", |
| | | "text": "", |
| | | "top": 110, |
| | | "left": 1690, |
| | | "width": 1, |
| | | "height": 350 |
| | | }, { |
| | | "type": "track", |
| | | "id": "lb_track6", |
| | | "text": "", |
| | | "top": 110, |
| | | "left": 1720, |
| | | "width": 1, |
| | | "height": 350 |
| | | }, { |
| | | "type": "stn", |
| | | "id": "site-300", |
| | | "text": "300", |
| | | "top": 120, |
| | | "left": 1630, |
| | | "width": 59, |
| | | "height": 25 |
| | | } |
| | | , { |
| | | "type": "stn", |
| | | "id": "site-301", |
| | | "text": "301", |
| | | "top": 120, |
| | | "left": 1570, |
| | | "width": 59, |
| | | "height": 25 |
| | | } |
| | | , { |
| | | "type": "stn", |
| | | "id": "site-302", |
| | | "text": "302", |
| | | "top": 120, |
| | | "left": 1510, |
| | | "width": 59, |
| | | "height": 25 |
| | | } |
| | | , { |
| | | "type": "stn", |
| | | "id": "site-303", |
| | | "text": "303", |
| | | "top": 120, |
| | | "left": 1450, |
| | | "width": 59, |
| | | "height": 25 |
| | | } |
| | | , { |
| | | "type": "stn", |
| | | "id": "site-304", |
| | | "text": "304", |
| | | "top": 94, |
| | | "left": 1450, |
| | | "width": 59, |
| | | "height": 25 |
| | | } |
| | | , { |
| | | "type": "stn", |
| | | "id": "site-305", |
| | | "text": "305", |
| | | "top": 68, |
| | | "left": 1450, |
| | | "width": 59, |
| | | "height": 25 |
| | | } |
| | | "stns": [ |
| | | {"type": "stn", "id": "site-1091", "text": "1091", "top": 172, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1092", "text": "1092", "top": 172, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1093", "text": "1093", "top": 172, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1094", "text": "1094", "top": 193, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1095", "text": "1095", "top": 193, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1096", "text": "1096", "top": 193, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1097", "text": "1097", "top": 214, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1098", "text": "1098", "top": 214, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1099", "text": "1099", "top": 214, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1100", "text": "1100", "top": 282, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1101", "text": "1101", "top": 282, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1102", "text": "1102", "top": 282, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1103", "text": "1103", "top": 261, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1104", "text": "1104", "top": 261, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1105", "text": "1105", "top": 332, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1106", "text": "1106", "top": 332, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1107", "top": 332, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1090", "top": 367, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1089", "top": 393, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1088", "top": 393, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1087", "top": 393, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1086", "top": 456, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1085", "top": 456, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1084", "top": 456, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1083", "top": 519, "left": 307, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1082", "top": 519, "left": 355, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1081", "top": 519, "left": 403, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1079", "top": 393, "left": 625, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1078", "top": 393, "left": 673, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1077", "top": 393, "left": 721, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1075", "top": 393, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1074", "top": 414, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1073", "top": 435, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1061", "top": 456, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1063", "top": 456, "left": 721, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1064", "top": 456, "left": 673, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1065", "top": 456, "left": 625, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1066", "top": 477, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1067", "top": 498, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1068", "top": 519, "left": 769, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1070", "top": 519, "left": 721, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1071", "top": 519, "left": 673, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1072", "top": 519, "left": 625, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1050", "top": 527, "left": 913, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1051", "top": 512, "left": 817, "width": 47, "height": 35}, |
| | | {"type": "stn", "id": "site-1107", "text": "1052", "top": 477, "left": 817, "width": 47, "height": 35}, |
| | | {"type": "stn", "id": "site-1107", "text": "1049", "top": 548, "left": 913, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1047", "top": 548, "left": 865, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1046", "top": 548, "left": 817, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1045", "top": 569, "left": 817, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1044", "top": 590, "left": 817, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1053", "top": 456, "left": 817, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1054", "top": 456, "left": 865, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1056", "top": 456, "left": 913, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1057", "top": 477, "left": 913, "width": 47, "height": 20}, |
| | | |
| | | {"type": "stn", "id": "site-1107", "text": "1001", "top": 640, "left": 1340, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1002", "top": 661, "left": 1340, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1004", "top": 682, "left": 1340, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1005", "top": 682, "left": 1388, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1006", "top": 640, "left": 1436, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1007", "top": 661, "left": 1436, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1008", "top": 682, "left": 1436, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1009", "top": 682, "left": 1484, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1010", "top": 682, "left": 1532, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1011", "top": 661, "left": 1532, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1012", "top": 640, "left": 1532, "width": 47, "height": 20}, |
| | | |
| | | {"type": "stn", "id": "site-1107", "text": "1041", "top": 640, "left": 1050, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1042", "top": 661, "left": 1050, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1043", "top": 682, "left": 1050, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1013", "top": 682, "left": 1098, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1014", "top": 682, "left": 1146, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1015", "top": 682, "left": 1194, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1016", "top": 682, "left": 1242, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1017", "top": 661, "left": 1242, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1018", "top": 640, "left": 1242, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1019", "top": 640, "left": 1146, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1020", "top": 661, "left": 1146, "width": 47, "height": 20}, |
| | | |
| | | {"type": "stn", "id": "site-1107", "text": "1022", "top": 640, "left": 400, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1023", "top": 661, "left": 400, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1024", "top": 682, "left": 400, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1025", "top": 682, "left": 448, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1026", "top": 640, "left": 496, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1027", "top": 661, "left": 496, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1028", "top": 682, "left": 496, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1030", "top": 682, "left": 544, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1031", "top": 682, "left": 592, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1032", "top": 661, "left": 592, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1033", "top": 640, "left": 592, "width": 47, "height": 20}, |
| | | |
| | | {"type": "stn", "id": "site-1107", "text": "1034", "top": 640, "left": 650, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1035", "top": 661, "left": 650, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1036", "top": 682, "left": 650, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1038", "top": 682, "left": 698, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1039", "top": 682, "left": 746, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "1040", "top": 682, "left": 794, "width": 47, "height": 20}, |
| | | |
| | | {"type": "stn", "id": "site-1107", "text": "1", "top": 627, "left": 737, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "2", "top": 627, "left": 800, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "3", "top": 627, "left": 850, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "4", "top": 627, "left": 900, "width": 47, "height": 20}, |
| | | {"type": "stn", "id": "site-1107", "text": "5", "top": 627, "left": 950, "width": 47, "height": 20}, |
| | | ] |
| | | }] |
| | | }] |
| | |
| | | <div class="select-container" style="padding: 20px 0;"> |
| | | <label><input type="radio" name="crnSelect" value="1" checked> 1号堆垛机</label> |
| | | <label><input type="radio" name="crnSelect" value="2"> 2号堆垛机</label> |
| | | <!-- <label><input type="radio" name="crnSelect" value="3"> 3号堆垛机</label>--> |
| | | <!-- <label><input type="radio" name="crnSelect" value="4"> 4号堆垛机</label>--> |
| | | <label><input type="radio" name="crnSelect" value="3"> 3号堆垛机</label> |
| | | <label><input type="radio" name="crnSelect" value="4"> 4号堆垛机</label> |
| | | </div> |
| | | </div> |
| | | <!-- 源站/源库位 选择 --> |
| | |
| | | <!-- 主体内容 --> |
| | | <iframe id="content" src="console.html"></iframe> |
| | | <footer class="footer"> |
| | | Copyright © 2024 All Rights Reserved. <a href="" target="_blank">苏州冠鸿智能装备有限公司</a> 保留所有权利 |
| | | Copyright © 2024 All Rights Reserved. <a href="http://www.zoneyung.com" target="_blank">浙江中扬立库技术有限公司</a> 保留所有权利 |
| | | </footer> |
| | | </body> |
| | | <script> |