| | |
| | | package com.example.springboot.component; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | // 查询报警信息 |
| | | List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo(); |
| | | jsonObject.append("alarmmg", alarmmg); |
| | | // // 读去Plc进片车与出片车位置W |
| | | // List<String> addressList = new ArrayList<String>(); |
| | | // addressList.add("DB106.12"); |
| | | // addressList.add("DB106.0"); |
| | | // List<Short> paramlist = S7control.getinstance().ReadWord(addressList); |
| | | // if (paramlist != null) { |
| | | // jsonObject.append("params", paramlist); |
| | | // } |
| | | // // 获取进片车状态 |
| | | // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", |
| | | // 1);// 获取进片车状态 |
| | | // boolean exist1 = datas1ListState.contains((short) 0); |
| | | // jsonObject.append("zhuangtai", exist1); |
| | | // // 获取进片玻璃信息 |
| | | // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1); |
| | | // if (inglassInfo != null) { |
| | | // if (inglassInfo.size() > 0) |
| | | // jsonObject.append("loadglassheight", inglassInfo.get(0) * 70); |
| | | // } |
| | | |
| | | // 读去Plc进片车与出片车位置W |
| | | List<String> addressList = new ArrayList<String>(); |
| | | addressList.add("DB106.12"); |
| | | addressList.add("DB106.0"); |
| | | List<Short> paramlist = S7control.getinstance().ReadWord(addressList); |
| | | if (paramlist != null) { |
| | | jsonObject.append("params", paramlist); |
| | | } |
| | | // 获取进片车状态 |
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", |
| | | 1);// 获取进片车状态 |
| | | boolean exist1 = datas1ListState.contains((short) 0); |
| | | jsonObject.append("zhuangtai", exist1); |
| | | // 获取进片玻璃信息 |
| | | List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1); |
| | | if (inglassInfo != null) { |
| | | if (inglassInfo.size() > 0) |
| | | jsonObject.append("loadglassheight", inglassInfo.get(0) * 70); |
| | | } |
| | | // 伍 获取进是否有待确认的玻璃id |
| | | String queid = spianMapper.Selectqueueid(); |
| | | int state = spianMapper.Selectqueuestate(); |
| | |
| | | // 获取当前出片队列状态 |
| | | jsonObject.append("isAllowQueue", Plchome.isAllowQueue); |
| | | |
| | | // // 获取铝框idDB106.DBW64 |
| | | // String frameno=spianService.queGlassid("DB106.24",14).toString(); |
| | | // if(frameno!=Plchome.FrameNo){ |
| | | // Plchome.FrameNo=frameno; |
| | | // } |
| | | // try { |
| | | // north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo); |
| | | // } catch (SQLException e) { |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | // 获取铝框idDB106.DBW64 |
| | | String frameno=spianService.queGlassid("DB103.270",14).toString(); |
| | | if(frameno!=Plchome.FrameNo&&frameno!=""){ |
| | | Plchome.FrameNo=frameno; |
| | | } |
| | | try { |
| | | north_Glass_Buffer1Service.AddOutSliceS(Plchome.FrameNo); |
| | | } catch (SQLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | // 是否需要人工确认上片玻璃 |
| | | jsonObject.append("isConfirm", isConfirm); |
| | | |
| | | |
| | | //复位倒计时 |
| | | // 地址104.9.6 |
| | | List<Boolean> countdown = S7control.getinstance().ReadBits("104.9.6", 71); |
| | | jsonObject.append("countdown", countdown); |
| | | // 铝框线交互 |
| | | |
| | | // //铝框id请求字 |