| | |
| | | add(104);add(105); |
| | | }}; |
| | | |
| | | /*public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103); |
| | | add(104);add(105);add(106);add(107); |
| | | add(108);add(109); |
| | | |
| | | add(201);add(202);add(203); |
| | | add(204);add(205);add(206);add(207); |
| | | add(208);add(209);add(210);add(211); |
| | | |
| | | add(401);add(402);add(403);add(404); |
| | | }};*/ |
| | | |
| | | public static final ArrayList<Integer> BarcodeList1 = new ArrayList<Integer>() {{ |
| | | add(1); add(2);add(3);add(4);add(5); |
| | | }}; |
| | | |
| | | /* public static final ArrayList<Integer> BarcodeList2 = new ArrayList<Integer>() {{ |
| | | add(6);add(7);add(8);add(9); |
| | | add(10); add(11); add(12); add(13); |
| | | }};*/ |
| | | /*public static final ArrayList<Integer> staNosErrList2 = new ArrayList<Integer>() {{ |
| | | add(102); add(105);add(107);add(109); |
| | | add(203);add(205);add(208);add(211); |
| | | }};*/ |
| | | |
| | | |
| | | public static final ArrayList<Integer> staNosErrList1 = new ArrayList<Integer>() {{ |
| | | add(101); |
| | | add(102);add(103);add(104);add(105); |
| | | |
| | | add(102); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> staNoWeight1 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103);add(104);add(105); |
| | | }}; |
| | | |
| | | /*public static final ArrayList<Integer> staNoWeight2 = new ArrayList<Integer>() {{ |
| | | add(102);add(105);add(107);add(109); |
| | | add(203);add(205);add(208);add(211); |
| | | }};*/ |
| | | |
| | | |
| | | private Integer count=0; |
| | | |
| | |
| | | |
| | | //条码扫描器 |
| | | ArrayList<Integer> barcodeList = getBarcodeList(); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.2848", (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.2808", (short) (staNoErrsSize * 4)); |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.702", (short) (staNoErrsSize * 7)); |
| | | if (resultErr.IsSuccess) { |
| | | for (int i = 0; i < staNoErrsSize; i++) { |
| | | Integer siteId = staNoErrs.get(i); // 站点编号 |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i * 4 + 2, 1); |
| | | // boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i * 4 + 2, 1); |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i * 7, 1); |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | staProtocol.setFrontErr(status[0]); |
| | | staProtocol.setBackErr(status[1]); |