| | |
| | | private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>(); |
| | | public boolean charge0; //请求充电 |
| | | public boolean charge1; //请求充电 |
| | | private short weight464; |
| | | private String matnr464; |
| | | private short heartBeatVal = 1; |
| | | public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{ |
| | | add(100);add(101);add(102);add(103);add(104);add(105);add(106);add(107); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | try{ |
| | | OperateResultExOne<byte[]> resultW464 = siemensS7Net.Read("DB100.1874", (short) 2); |
| | | weight464 = siemensS7Net.getByteTransform().TransInt16(resultW464.Content, 0);// 重量464 |
| | | OperateResultExOne<byte[]> resultM464 = siemensS7Net.Read("DB100.1882", (short) 16); |
| | | matnr464 = siemensS7Net.getByteTransform().TransString(resultM464.Content, 0,16, "UTF-8"); |
| | | matnr464 = matnr464.replaceAll("\\s+", ""); |
| | | } catch (Exception e){ |
| | | log.error("读取464站点信息失败"); |
| | | weight464 = 0; |
| | | matnr464 = ""; |
| | | } |
| | | } |
| | | |
| | | // //RGV小车 |
| | |
| | | List<BasDevp> basDevps = new ArrayList<>(); |
| | | for (Integer siteId : staNos) { |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | basDevps.add(staProtocol.toSqlModel()); |
| | | if (siteId == 464){ |
| | | BasDevp basDevp = staProtocol.toSqlModel(); |
| | | basDevp.setGrossWt(Double.valueOf(weight464)); |
| | | basDevp.setDecDesc(matnr464); |
| | | basDevps.add(basDevp); |
| | | } else { |
| | | basDevps.add(staProtocol.toSqlModel()); |
| | | } |
| | | } |
| | | |
| | | try{ |