| | |
| | | public class DownGlassCacheLogic { |
| | | @Autowired |
| | | private SelectInfo selectInfo; |
| | | //识别逻辑 不交互 |
| | | |
| | | /** |
| | | * @param Number |
| | | * //识别逻辑 不交互 |
| | | */ |
| | | |
| | | public void identify(String Number){ |
| | | //查询任务 |
| | | PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | |
| | | } |
| | | } |
| | | //下片前理片 |
| | | public void Process(){ |
| | | String Result=S7control.getinstance().ReadWord("DB14.0", 1).get(0)+""; |
| | | String Number=S7control.getinstance().ReadWord("DB14.2", 1).get(0)+""; |
| | | if(Result=="1"){//进片请求 |
| | | processInto(Number); |
| | | }else if(Result=="2"){//出片请求 |
| | | public static final String RESULT_IN = "1"; |
| | | public static final String RESULT_OUT = "2"; |
| | | public static final String RESULT_IN_OUT = "3"; |
| | | |
| | | public void process() { |
| | | String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + ""; |
| | | String number = S7control.getinstance().ReadWord("DB14.2", 1).get(0) + ""; |
| | | |
| | | // 进片请求 |
| | | if (RESULT_IN.equals(result)) { |
| | | processInto(number); |
| | | } |
| | | // 出片请求 |
| | | else if (RESULT_OUT.equals(result)) { |
| | | processOut(); |
| | | }else if(Result=="3"){//进出片请求 |
| | | if (!processOut()) { //先出后进 |
| | | processInto(Number); |
| | | } |
| | | } |
| | | // 进出片请求 |
| | | else if (RESULT_IN_OUT.equals(result)) { |
| | | // 先出后进 |
| | | if (!processOut()) { |
| | | processInto(number); |
| | | } |
| | | } |
| | | } |
| | | //下片前理片 进 |
| | | |
| | | |
| | | /** |
| | | * @param Number |
| | | * @return |
| | | * //下片前理片 进 |
| | | */ |
| | | |
| | | public boolean processInto(String Number){ |
| | | //按id查询玻璃信息表里的玻璃 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | if(GlassInfo!=null){//存在此玻璃编号 |
| | | //存在此玻璃编号 |
| | | if(GlassInfo!=null){ |
| | | //同钢化版图内的栅格号 |
| | | List<DownStorageCageDetails> list=selectInfo.SelectIsExistIntoCache(GlassInfo.getTemperinglayoutid(),GlassInfo.getTemperingfeedsequence(),GlassInfo.getWidth()); |
| | | //空栅格号 |
| | |
| | | //理片 出 |
| | | public boolean processOut(){ |
| | | //查询任务 |
| | | String G04=S7control.getinstance().ReadWord("DB14.56", 1).get(0)+""; |
| | | String G05=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; |
| | | String G06=S7control.getinstance().ReadWord("DB14.56", 1).get(0)+""; |
| | | String G11=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; |
| | | String G13=S7control.getinstance().ReadWord("DB14.58", 1).get(0)+""; |
| | | PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | List<DownStorageCageDetails> list=selectInfo.SelectCacheOut(); |
| | | boolean isOut=true;//其他情况条件 如:后续设备故障禁止理片出片 等 |
| | | //其他情况条件 如:后续设备故障禁止理片出片 等 |
| | | boolean isOut=true; |
| | | if (list.size()>0&&isOut) { |
| | | DownStorageCageDetails item=list.get(0); |
| | | if(G04=="0"&&G05=="1"){ |
| | | //出到 G04 |
| | | //selectInfo.insertCacheTask(item.getGlassId()+"","0","04","2"); |
| | | selectInfo.insertCacheTask(item.getGlassId()+"","0","04","2",item.getWidth(),item.getHeight(),0,item.getThickness(),item.getFlowCardId()); |
| | | // |
| | | if(G06=="0"&&G11=="1"){ |
| | | //出到 G06 |
| | | |
| | | selectInfo.insertCacheTask(item.getGlassId()+"","0","06","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "1"); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | }else if(G04=="1"&&G05=="0"){ |
| | | //出到 G05 |
| | | //selectInfo.insertCacheTask(item.getGlassId()+"","0","05","2"); |
| | | selectInfo.insertCacheTask(item.getGlassId()+"","0","05","2",item.getWidth(),item.getHeight(),0,item.getThickness(),item.getFlowCardId()); |
| | | }else if(G06=="1"&&G11=="0"){ |
| | | //出到 G11 |
| | | |
| | | selectInfo.insertCacheTask(item.getGlassId()+"","0","11","2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), "2"); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | | }else if(G04=="0"&&G05=="0"){ |
| | | }else if(G06=="0"&&G11=="0"){ |
| | | //都允许 G04/G05 上一片是否和此片玻璃尺寸尺寸相同 |
| | | String endcell="04"; |
| | | String endcell="06"; |
| | | String SendEndcell="1"; |
| | | boolean If_=false; |
| | | GlassInfo glassInfo04= selectInfo.SelectLastOutCacheInfo("04"); |
| | | GlassInfo glassInfo05= selectInfo.SelectLastOutCacheInfo("05"); |
| | | if(glassInfo05!=null&&glassInfo05.getWidth()==item.getWidth()&&glassInfo05.getHeight()==item.getHeight()){ |
| | | endcell="05"; |
| | | GlassInfo glassInfo06= selectInfo.SelectLastOutCacheInfo("06"); |
| | | GlassInfo glassInfo11= selectInfo.SelectLastOutCacheInfo("11"); |
| | | GlassInfo glassInfo13= selectInfo.SelectLastOutCacheInfo("13"); |
| | | if(glassInfo06!=null&&glassInfo11.getWidth()==item.getWidth()&&glassInfo06.getHeight()==item.getHeight()){ |
| | | endcell="11"; |
| | | SendEndcell="2"; |
| | | }else if(glassInfo05!=null&&If_){ |
| | | //其他条件 |
| | | }else if(item.getHeight()>=3440&&item.getWidth()>=1440){ |
| | | //其他条件人工处理 |
| | | |
| | | } |
| | | //selectInfo.insertCacheTask(item.getGlassId()+"","0",endcell,"2"); |
| | | selectInfo.insertCacheTask(item.getGlassId()+"","0",endcell,"2",item.getWidth(),item.getHeight(),0,item.getThickness(),item.getFlowCardId()); |
| | | |
| | | selectInfo.insertCacheTask(item.getGlassId()+"","0",endcell,"2",item.getWidth(),item.getHeight(),item.getFilmsid(),item.getThickness(),item.getFlowCardId()); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.28").getAddress(), SendEndcell); |
| | | S7control.getinstance().writeString(plcmes.getPlcParameter("DB14.20").getAddress(), "1"); |
| | | return true; |
| | |
| | | return false; |
| | | } |
| | | |
| | | //磨边 不交互 理片和磨边机自己交互 |
| | | /** |
| | | * @param Number |
| | | * //磨边 不交互 理片和磨边机自己交互 |
| | | */ |
| | | |
| | | public void processMb(String Number){ |
| | | //按id查询玻璃信息表里的玻璃 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | |
| | | //返回结果 |
| | | } |
| | | |
| | | //按id查询玻璃信息表里的玻璃 |
| | | public boolean SelectMessageId(String Number){ |
| | | |
| | | /** |
| | | * @param Number |
| | | * @return |
| | | * 查询消息队列里此玻璃ID的数据 |
| | | */ |
| | | public boolean selectMessageId(String Number){ |
| | | //查询是否存在 |
| | | |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | return false;//返回 不存在 |
| | | //返回 不存在 |
| | | return false; |
| | | |
| | | } |
| | | return true;//返回 存在 |
| | | } |
| | | //删除消息队列里此玻璃ID的数据 |
| | | public boolean DeleteMessageId(String Number){ |
| | | //查询是否存在 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | return false;//返回 不存在 |
| | | } |
| | | return true;//返回 存在 |
| | | //返回 存在 |
| | | return true; |
| | | } |
| | | |
| | | //是否存在此编号玻璃 |
| | | /** |
| | | * @param Number |
| | | * @return |
| | | * 删除消息队列里此玻璃ID的数据 |
| | | */ |
| | | |
| | | public boolean deleteMessageId(String Number){ |
| | | //查询是否存在 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | //返回 不存在 |
| | | return false; |
| | | } |
| | | //返回 存在 |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @param Number |
| | | * @return |
| | | * //是否存在此编号玻璃 |
| | | */ |
| | | public boolean isExist(String Number){ |
| | | //查询是否存在 |
| | | GlassInfo GlassInfo=selectInfo.SelectGlassId(Number); |
| | | if(GlassInfo==null){ |
| | | return false;//返回 不存在 |
| | | //返回 不存在 |
| | | return false; |
| | | } |
| | | return true;//返回 存在 |
| | | //返回 存在 |
| | | return true; |
| | | } |
| | | |
| | | } |