代码调整

This commit is contained in:
2025-01-15 08:57:27 +08:00
parent 3afa32bda4
commit 7163f387f6
3 changed files with 18 additions and 1 deletions

View File

@@ -991,6 +991,8 @@ public class SocketDevResponseService {
//在这一步判断是否已经触发暂停按钮 //在这一步判断是否已经触发暂停按钮
if (FormalTestManager.stopFlag && CollUtil.isNotEmpty(SocketManager.getSourceList())) { if (FormalTestManager.stopFlag && CollUtil.isNotEmpty(SocketManager.getSourceList())) {
FormalTestManager.stopTime = 0; FormalTestManager.stopTime = 0;
FormalTestManager.hasStopFlag = true;
successComm.clear(); successComm.clear();
realDataXiList.clear(); realDataXiList.clear();
sendWebSocket(param.getUserPageId(), "preStopTest", "stop", null); sendWebSocket(param.getUserPageId(), "preStopTest", "stop", null);
@@ -1228,6 +1230,8 @@ public class SocketDevResponseService {
successDevComm.clear(); successDevComm.clear();
failDevComm.clear(); failDevComm.clear();
FormalTestManager.stopFlag = false; FormalTestManager.stopFlag = false;
FormalTestManager.hasStopFlag = false;
FormalTestManager.stopTime = 0;
//初始化相序集合 //初始化相序集合
this.devInfo.clear(); this.devInfo.clear();

View File

@@ -40,8 +40,21 @@ public class FormalTestManager {
public static Map<String, String> devIdMapComm = new HashMap<>(); public static Map<String, String> devIdMapComm = new HashMap<>();
/**
* 停止触发标识
*/
public static Boolean stopFlag = false; public static Boolean stopFlag = false;
/**
* 已经暂停后的标识
*/
public static Boolean hasStopFlag = false;
/**
* 暂停后的超时计时时间
*/
public static Integer stopTime = 0; public static Integer stopTime = 0;

View File

@@ -101,7 +101,7 @@ public class NettyDevClientHandler extends SimpleChannelInboundHandler<String> {
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
if (evt instanceof IdleStateEvent) { if (evt instanceof IdleStateEvent) {
if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) { if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
if(!FormalTestManager.stopFlag) { if(!FormalTestManager.hasStopFlag) {
if (CollUtil.isNotEmpty(SocketManager.getSourceList())) { if (CollUtil.isNotEmpty(SocketManager.getSourceList())) {
SourceIssue sourceIssue = SocketManager.getSourceList().get(0); SourceIssue sourceIssue = SocketManager.getSourceList().get(0);
if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) { if (SocketManager.clockMap.containsKey(sourceIssue.getIndex())) {