Browse Source

增加指令间隔时间,功图指令每3次采集重新划分(使12次采集返回长度各不同)

chenwen 1 year ago
parent
commit
92a99f2c8d

+ 2 - 2
src/main/java/com/hb/proj/gather/business/DataAssembler.java

@@ -27,7 +27,7 @@ public class DataAssembler extends Thread{
 	private static Map<String,DataPieceSingleBox> singlePkgs=new HashMap<String,DataPieceSingleBox>(100);
 	
 	public  static SingleCombPO putPieceData(String channelSerial,Map<String,Float> pieceData) {
-		logger.info("接收单值片段数据:{},{}",channelSerial,pieceData);
+		//logger.info("接收单值片段数据:{},{}",channelSerial,pieceData);
 		if(!singlePkgs.containsKey(channelSerial)) {
 			singlePkgs.put(channelSerial, new DataPieceSingleBox(channelSerial));
 		}
@@ -35,7 +35,7 @@ public class DataAssembler extends Thread{
 	}
 	
 	public  static DiagramPO putPieceData(String channelSerial,String pieceName,List<Float> pieceDatas) {
-		logger.info("接收功图片段数据:{},{}",channelSerial,pieceName);
+		//logger.info("接收功图片段数据:{},{}",channelSerial,pieceName);
 		if(!diagramPkgs.containsKey(channelSerial)) {
 			diagramPkgs.put(channelSerial, new DataPieceDiagramBox(channelSerial));
 		}

+ 2 - 2
src/main/java/com/hb/proj/gather/business/GatherTask.java

@@ -47,7 +47,7 @@ public class GatherTask implements Runnable{
 				channel.writeAndFlush(byteBuf);
 				channel.attr(ChannelGroupMgr.ATTR_KEY_CMD).set(cmd.name());
 				logger.info("发送完指令:{}",cmd.name());
-				channel.wait(20*1000);  //等待接收返回数据后继续,最多等待5s,此处释放锁,回复还未收到就被多值任务获得锁并发指令,会导致两个指令间隔很短
+				channel.wait(30*1000);  //等待接收返回数据后继续,此处释放锁,回复还未收到因超时释放锁,就被多值任务获得锁并发指令,会导致两个指令间隔很短
 			}
 		}
 		catch (InterruptedException e) {
@@ -96,7 +96,7 @@ public class GatherTask implements Runnable{
 				channel.writeAndFlush(byteBuf);
 				channel.attr(ChannelGroupMgr.ATTR_KEY_CMD).set(cmd.name());
 				logger.info("发送完后指令:{}",cmd.name());
-				channel.wait(20*1000);  //等待接收返回数据后继续,最多等待10s
+				channel.wait(30*1000);  //等待接收返回数据后继续,超时后自动释放锁,继续后面执行
 			}
 		}
 		catch (InterruptedException e) {

+ 35 - 35
src/main/java/com/hb/proj/gather/protocol/ZLOpdProtCMDEnum.java

@@ -40,48 +40,48 @@ public enum ZLOpdProtCMDEnum {
 	
 	
 	
-	//200-100 功图位移第1部分 01 03 03 e8 00 64
+	//196-98功图位移第1部分 01 03 03 e8 00 62  
 	DIAGRAM_DISP_1(
-			new byte[] {0x01, 0x03, 0x03, (byte)0xe8, 0x00, 0x64,        (byte)0xc4, 0x51},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x03, (byte)0xe8, 0x00, 0x62,        (byte)0x44, 0x53},  
+			0xc4,  
 			2,
 			new String[]{"disp_1"}),
 	
-	//200-100 功图位移第2部分 01 03 04 4c 00 64
+	//200-100 功图位移第2部分 01 03 04 4a 00 64
 	DIAGRAM_DISP_2(
-			new byte[] {0x01, 0x03, 0x04, 0x4c, 0x00, 0x64,        (byte)0x84, (byte)0xc6},  
+			new byte[] {0x01, 0x03, 0x04, 0x4a, 0x00, 0x64,        0x64, (byte)0xc7},  
 			0xc8,  
 			2,
 			new String[]{"disp_2"}),
 	
-	//100-50 功图位移第3部分 01 03 04 b0 00 32
+	//104-52 功图位移第3部分 01 03 04 ae 00 34
 	DIAGRAM_DISP_3(
-			new byte[] {0x01, 0x03, 0x04, (byte)0xb0, 0x00, 0x32,        (byte)0xc4, (byte)0xc8},  
-			0x64,  
+			new byte[] {0x01, 0x03, 0x04, (byte)0xae, 0x00, 0x34,        0x24, (byte)0xcc},  
+			0x68,  
 			2,
 			new String[]{"disp_3"}),
 	
 	
 	
 	
-	//200-100 功图载荷第1部分 01 03 04 e2 00 64
+	//192-96 功图载荷第1部分 01 03 04 e2 00 60    01 03 05 42 00 5a   01 03 05 9c 00 40
 	DIAGRAM_LOAD_1(
-			new byte[] {0x01, 0x03, 0x04, (byte)0xe2, 0x00, 0x64,        (byte)0xe5, 0x27},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x04, (byte)0xe2, 0x00, 0x60,        (byte)0xe4, (byte)0xe4},  
+			0xc0,  
 			2,
 			new String[]{"chartload_1"}),
 		
-	//200-100 功图载荷第2部分 01 03 05 46 00 64
+	//180-90 功图载荷第2部分 01 03 05 42 00 5a
 	DIAGRAM_LOAD_2(
-			new byte[] {0x01, 0x03, 0x05, 0x46, 0x00, 0x64,        (byte)0xa5, 0x38},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x05, 0x42, 0x00, 0x5a,       0x65, 0x29},  
+			0xb4,  
 			2,
 			new String[]{"chartload_2"}),
 		
-	//100-50 功图载荷第3部分 01 03 05 aa 00 32
+	//128-64 功图载荷第3部分  01 03 05 9c 00 40
 	DIAGRAM_LOAD_3(
-			new byte[] {0x01, 0x03, 0x05, (byte)0xaa, 0x00, 0x32,        (byte)0xe4, (byte)0xf3},  
-			0x64,  
+			new byte[] {0x01, 0x03, 0x05, (byte)0x9c, 0x00, 0x40,        (byte)0x84, (byte)0xd8},  
+			0x80,  
 			2,
 			new String[]{"chartload_3"}),
 	
@@ -90,24 +90,24 @@ public enum ZLOpdProtCMDEnum {
 	
 	
 	
-	//200-100 电流图电流第1部分 01 03 05 dc 00 64
+	//188-94 电流图电流第1部分 01 03 05 dc 00 5e   01 03 06 3a 00 58   01 03 06 92 00 44
 	DIAGRAM_CURR_1(
-			new byte[] {0x01, 0x03, 0x05, (byte)0xdc, 0x00, 0x64,        (byte)0x85, 0x17},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x05, (byte)0xdc, 0x00, 0x5e,        0x05, 0x04},  
+			0xbc,  
 			2,
 			new String[]{"chartcurr_1"}),
 			
-	//200-100 电流图电流第2部分 01 03 06 40 00 64
+	//176-88 电流图电流第2部分 01 03 06 3a 00 58
 	DIAGRAM_CURR_2(
-			new byte[] {0x01, 0x03, 0x06, 0x40, 0x00, 0x64,        0x45, 0x7d},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x06, 0x3a, 0x00, 0x58,        0x64, (byte)0xb5},  
+			0xb0,  
 			2,
 			new String[]{"chartcurr_2"}),
 			
-	//100-50 电流图电流第3部分 01 03 06 a4 00 32 
+	//136-68 电流图电流第3部分 01 03 06 92 00 44 
 	DIAGRAM_CURR_3(
-			new byte[] {0x01, 0x03, 0x06, (byte)0xa4, 0x00, 0x32,        (byte)0x85, (byte)0x74},  
-			0x64,  
+			new byte[] {0x01, 0x03, 0x06, (byte)0x92, 0x00, 0x44,        (byte)0xe4, (byte)0x9c},  
+			0x88,  
 			2,
 			new String[]{"chartcurr_3"}),
 	
@@ -115,24 +115,24 @@ public enum ZLOpdProtCMDEnum {
 	
 	
 	
-	//200-100 功率图功率第1部分 01 03 06 d6 00 64
+	//184-92 功率图功率第1部分 01 03 06 d6 00 5c    01 03 07 32 00 56   01 03 07 88 00 48
 	DIAGRAM_POWER_1(
-			new byte[] {0x01, 0x03, 0x06, (byte)0xd6, 0x00, 0x64,        (byte)0xa5, 0x51},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x06, (byte)0xd6, 0x00, 0x5c,        (byte)0xa4, (byte)0x83},  
+			0xb8,  
 			2,
 			new String[]{"chartpower_1"}),
 				
-	//200-100 功率图功率第2部分 01 03 07 3a 00 64
+	//172-86 功率图功率第2部分  01 03 07 32 00 56
 	DIAGRAM_POWER_2(
-			new byte[] {0x01, 0x03, 0x07, 0x3a, 0x00, 0x64,        0x65, 0x58},  
-			0xc8,  
+			new byte[] {0x01, 0x03, 0x07, 0x32, 0x00, 0x56,        0x65, 0x4f},  
+			0xac,  
 			2,
 			new String[]{"chartpower_2"}),
 				
-	//100-50 功率图功率第3部分 01 03 07 9e 00 32
+	//144-72 功率图功率第3部分 01 03 07 88 00 48
 	DIAGRAM_POWER_3(
-			new byte[] {0x01, 0x03, 0x07, (byte)0x9e, 0x00, 0x32,       (byte)0xa4, (byte)0x85},  
-			0x64,  
+			new byte[] {0x01, 0x03, 0x07, (byte)0x88, 0x00, 0x48,       (byte)0xc4, (byte)0xa2},  
+			0x90,  
 			2,
 			new String[]{"chartpower_3"})
 	;