| | |
| | | private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>(); |
| | | private short heartBeatVal = 1; |
| | | private StaError1 staError1; |
| | | // public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | // |
| | | // }}; |
| | | public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103); |
| | | add(104);add(105); |
| | | add(104);add(105);add(106); |
| | | }}; |
| | | |
| | | /*public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | |
| | | }};*/ |
| | | |
| | | public static final ArrayList<Integer> BarcodeList1 = new ArrayList<Integer>() {{ |
| | | add(1); add(2);add(3);add(4);add(5); |
| | | add(1); add(2);add(3);add(4);add(5);add(6); |
| | | }}; |
| | | |
| | | /* public static final ArrayList<Integer> BarcodeList2 = new ArrayList<Integer>() {{ |
| | |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> staNoWeight1 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103);add(104);add(105); |
| | | add(101);add(102);add(103);add(104);add(105);add(106); |
| | | }}; |
| | | |
| | | /*public static final ArrayList<Integer> staNoWeight2 = new ArrayList<Integer>() {{ |
| | |
| | | staProtocol.setHigh(status[6]); // 高库位 |
| | | staProtocol.setLow(status[7]); // 低库位 |
| | | |
| | | status = siemensS7Net.getByteTransform().TransBool(result.Content, i * 8 + 7, 1); |
| | | staProtocol.setMid(status[0]); // 中库位 |
| | | //读取磅秤 |
| | | if (staProtocol.getSiteId() == 102){ |
| | | resultWeight = siemensS7Net.Read("DB101.1272", (short) (4)); |
| | | staProtocol.setWeight(siemensS7Net.getByteTransform().TransInt16(resultWeight.Content, 0)); |
| | | } |
| | | |
| | | if (!staProtocol.isPakMk() && !staProtocol.isLoading()) { |
| | | staProtocol.setPakMk(true); |
| | |
| | | |
| | | //条码扫描器 |
| | | ArrayList<Integer> barcodeList = getBarcodeList(); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.200", (short) (barcodeList.size() * 8)); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.602", (short) (barcodeList.size() * 8)); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeList.size(); i++) { |
| | | Integer barcodeId = barcodeList.get(i); |
| | |
| | | //外形检测 |
| | | ArrayList<Integer> staNoErrs = staNosErrList; |
| | | int staNoErrsSize = staNoErrs.size(); |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.102", (short) (staNoErrsSize * 7)); |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.802", (short) (staNoErrsSize * 7)); |
| | | if (resultErr.IsSuccess) { |
| | | for (int i = 0; i < staNoErrsSize; i++) { |
| | | Integer siteId = staNoErrs.get(i); // 站点编号 |