From ab09a3065390a817dba0efed6cf320eb94637d4b Mon Sep 17 00:00:00 2001
From: lsh <lsh>
Date: 星期四, 16 五月 2024 20:04:43 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/SiemensDevpThread.java |   71 ++++++++++++++++++++---------------
 1 files changed, 41 insertions(+), 30 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/SiemensDevpThread.java b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
index 45e2c6a..e41eb73 100644
--- a/src/main/java/com/zy/core/thread/SiemensDevpThread.java
+++ b/src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -42,30 +42,47 @@
     private DevpSlave slave;
     private SiemensS7Net siemensS7Net;
     private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
+    public boolean charge0;     //璇锋眰鍏呯數
+    public boolean charge1;     //璇锋眰鍏呯數
     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);
-        add(108);add(109);add(110);add(111);
-        add(112);add(113);add(114);add(115);
-        add(116);add(117);add(118);add(119);
-        add(120);add(121);add(122);add(123);
-//        add(124);add(125);add(126);add(127);
-        add(130);add(131);
-        add(132);add(133);add(134);add(135);
-        add(136);add(137);add(138);add(139);
-        add(140);add(141);add(142);add(143);
-        add(144);add(145);add(146);add(147);
-        add(148);add(149);add(150);add(151);
-        add(152);add(153);
+        add(100);add(101);add(102);add(103);add(104);add(105);add(106);add(107);
+        add(108);add(109);add(110);add(111);add(112);add(113);add(114);add(115);
+        add(116);add(117);add(118);add(119);add(120);add(121);add(122);add(123);
+        add(124);add(125);add(126);add(127);add(128);add(129);add(130);add(131);
+        add(132);add(133);add(134);add(135);add(136);add(137);add(138);add(139);
+        add(140);add(141);add(142);add(143);add(144);add(145);add(146);add(147);
+        add(148);add(149);add(150);add(151);add(152);add(153);add(154);add(155);
+        add(156);add(157);add(158);add(159);add(160);add(161);add(162);add(163);
+        add(164);add(165);add(166);add(167);add(168);add(169);add(170);add(171);
+        add(172);add(173);add(174);add(175);add(176);add(177);add(178);add(179);
+        add(180);add(181);add(182);add(183);add(184);add(185);add(186);add(187);
+        add(188);add(189);add(190);add(191);add(192);add(193);
+        add(200);add(201);add(202);add(203);add(204);add(205);add(206);add(207);
+        add(208);add(209);add(210);add(211);add(212);add(213);add(214);add(215);
+        add(216);add(217);add(218);add(219);add(220);add(221);add(222);add(2000);
     }};
     public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
-        add(200);add(201);add(202);add(203);
-        add(204);add(205);add(206);add(207);
-        add(208);add(209);add(210);add(211);
-        add(212);add(213);add(214);add(215);
-        add(216);add(217);add(218);add(219);
-        add(220);add(221);add(222);add(2000);
+        add(400);add(401);add(402);add(403);add(404);add(405);add(406);add(407);
+        add(408);add(409);add(410);add(411);add(412);add(413);add(414);add(415);
+        add(416);add(417);add(418);add(419);add(420);add(421);add(422);add(423);
+        add(424);add(425);add(426);add(427);add(428);add(429);add(430);add(431);
+        add(432);add(433);add(434);add(435);add(436);add(437);add(438);add(439);
+        add(440);add(441);add(442);add(443);add(444);add(445);add(446);add(447);
+        add(448);add(449);add(450);add(451);add(452);add(453);add(454);add(455);
+        add(456);add(457);add(458);add(459);add(460);add(461);add(462);add(463);
+        add(464);add(465);add(466);add(467);add(468);add(469);add(470);add(471);
+        add(472);add(473);add(474);add(475);add(476);add(477);add(478);add(479);
+        add(480);add(481);add(482);add(483);add(484);add(485);add(486);add(487);
+        add(488);add(489);add(490);add(491);add(492);add(493);add(494);add(495);
+        add(496);add(497);add(498);add(499);
+        add(500);add(501);add(502);add(503);add(504);add(505);add(506);add(507);
+        add(508);add(509);add(510);add(511);add(512);add(513);add(514);add(515);
+        add(516);add(517);add(518);add(519);add(520);add(521);add(522);add(523);
+        add(524);add(525);add(526);add(527);add(528);add(529);add(530);add(531);
+        add(532);add(533);add(534);add(535);add(536);add(537);add(538);add(539);
+        add(540);add(541);add(542);add(543);add(544);add(545);add(546);add(547);
+        add(548);add(549);
     }};
 
     /**
@@ -119,10 +136,6 @@
                         break;
                     // 鍐欐暟鎹� ID+鐩爣绔�
                     case 2:
-//                        write3((StaProtocol)task.getData());
-//                        Thread.sleep(400);
-//                        write4((StaProtocol)task.getData());
-//                        Thread.sleep(400);
                         write((StaProtocol)task.getData());
                         break;
                     // 鍐欐暟鎹� ID+鐩爣绔� 鐮佸灈瀹屾垚  缁欒緭閫佺嚎鍐欎换鍔″畬鎴�
@@ -212,7 +225,7 @@
 
         Thread.sleep(200);
         OperateResultExOne<byte[]> resultError = siemensS7Net.Read("DB101.800", (short) (8));
-        if (resultError.IsSuccess && staNoSize==staNos2.size()) {
+        if (resultError.IsSuccess) {
             ArrayList<Integer> staNoError = new ArrayList<Integer>() {{ add(217);add(221); }};
             for (int i = 0; i < staNoError.size(); i++) {
                 Integer siteId = staNoError.get(i); // 绔欑偣缂栧彿
@@ -271,7 +284,7 @@
         //鏉$爜鎵弿鍣�
         Thread.sleep(200);
         OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.840",(short)(barcodeSize*8));
-        if (result2.IsSuccess && staNoSize==staNos2.size()) {
+        if (result2.IsSuccess) {
             for (int i = 0; i < barcodeSize; i++) {  //1:217  2:221  3:null 4:215  5:219
                 String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,6, "UTF-8");
                 BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
@@ -279,12 +292,12 @@
                     barcodeThread.setBarcode(barcode);
                 }
             }
-
         }
+
         //RGV灏忚溅
         Thread.sleep(200);
         OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2);
-        if (result3.IsSuccess && staNoSize==staNos2.size()) {
+        if (result3.IsSuccess) {
             Integer siteId = 2000;
             StaProtocol staProtocol = station.get(siteId);
             if (null == staProtocol) {
@@ -294,8 +307,6 @@
             }
             staProtocol.setNearbySta(String.valueOf(siemensS7Net.getByteTransform().TransInt16(result3.Content, 0)));
         }
-
-
 
         if (result.IsSuccess) {
 

--
Gitblit v1.9.1