From 43a19a4424f67c379934ed0d70e0d1b3512cd769 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 27 三月 2025 09:31:44 +0800
Subject: [PATCH] 灌溉计划表中增加项目ID字段,计划列表返回值中增加项目名称,项目状态改为整数表示
---
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java
index 8e057db..8d9b36c 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/Manager.java
@@ -8,9 +8,11 @@
import com.dy.testServer.ServerProperties;
public class Manager {
-
- public static boolean enablemwTestStart = false ;
-
+
+ public static boolean enablemwTestStartTcpConnect = false ;
+
+ public static boolean enablemwTestStartRtuReport = false ;
+
public static int clientId = 1 ;
public static long maxClient = 0 ;
@@ -79,9 +81,13 @@
}else if(rqVo.code.equals(Code.cd3)){
resVo.obj = doDealGetStart(rqVo) ;
}else if(rqVo.code.equals(Code.cd4)){
- doDealReportCount(rqVo) ;
+ resVo.obj = doDealGetReport(rqVo) ;
}else if(rqVo.code.equals(Code.cd5)){
+ doDealReportCount(rqVo) ;
+ }else if(rqVo.code.equals(Code.cd6)){
doDealReportOver(rqVo) ;
+ }else if(rqVo.code.equals(Code.cd7)){
+ doDealAllOver(rqVo) ;
}
return resVo ;
}
@@ -114,7 +120,10 @@
conVo.rtuAddrEnd = (Long)rtuAddrs[1] ;
conVo.tcpServerIp = ServerProperties.tcpServerIp ;
conVo.tcpServerPort = ServerProperties.tcpServerPort ;
+ conVo.sendInterval = ServerProperties.sendInterval ;
+ conVo.heartbeatTimes = ServerProperties.heartbeatTimes ;
conVo.sendTimes = ServerProperties.sendTimes ;
+ conVo.sendOverThenCloseConnect = ServerProperties.sendOverThenCloseConnect ;
sta = new MwTestClientStatus() ;
sta.confVo = conVo ;
token2ClientMap.put("" + token, sta);
@@ -123,9 +132,9 @@
}
return conVo ;
}
- private static ResStartVo doDealGetStart(RmiRequestVo rqVo){
- ResStartVo rvo = new ResStartVo() ;
- rvo.start = enablemwTestStart ;
+ private static ResStartTcpConnectVo doDealGetStart(RmiRequestVo rqVo){
+ ResStartTcpConnectVo rvo = new ResStartTcpConnectVo() ;
+ rvo.start = enablemwTestStartTcpConnect ;
int token = Integer.parseInt(rqVo.token) ;
MwTestClientStatus sta = token2ClientMap.get("" + token);
if(sta == null){
@@ -137,7 +146,21 @@
}
return rvo ;
}
-
+ private static ResStartRtuReportVo doDealGetReport(RmiRequestVo rqVo){
+ ResStartRtuReportVo rvo = new ResStartRtuReportVo() ;
+ rvo.report = enablemwTestStartRtuReport ;
+ int token = Integer.parseInt(rqVo.token) ;
+ MwTestClientStatus sta = token2ClientMap.get("" + token);
+ if(sta == null){
+ sta = new MwTestClientStatus() ;
+ sta.reportVo = rvo ;
+ token2ClientMap.put("" + token, sta);
+ }else{
+ sta.reportVo = rvo ;
+ }
+ return rvo ;
+ }
+
private static void doDealReportCount(RmiRequestVo rqVo){
int token = Integer.parseInt(rqVo.token) ;
@@ -157,6 +180,19 @@
MwTestClientStatus sta = token2ClientMap.get("" + token);
if(sta == null){
sta = new MwTestClientStatus() ;
+ sta.overCount = rqVo.overCount ;
+ token2ClientMap.put("" + token, sta);
+ }else{
+ sta.overCount = rqVo.overCount ;
+ }
+ }
+
+
+ private static void doDealAllOver(RmiRequestVo rqVo){
+ int token = Integer.parseInt(rqVo.token) ;
+ MwTestClientStatus sta = token2ClientMap.get("" + token);
+ if(sta == null){
+ sta = new MwTestClientStatus() ;
if(rqVo.over != null && rqVo.over){
sta.over = true ;
sta.seconds = rqVo.seconds ;
@@ -170,4 +206,6 @@
}
}
+
+
}
--
Gitblit v1.8.0