From a890a98e7c9367e640249d851e31804a1a8325aa Mon Sep 17 00:00:00 2001 From: wenjy Date: Sun, 18 Feb 2024 11:04:29 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20NanNan=E8=BF=87=E6=BB=A4=E6=94=B9?= =?UTF-8?q?=E4=B8=BAZXYG=EF=BC=8C=E5=8F=96=E6=B6=88=E9=87=8D=E5=A4=8DID?= =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E6=96=AD=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ems.CollectService.Analysis/BufferAnalysis.cs | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Ems.CollectService.Analysis/BufferAnalysis.cs b/Ems.CollectService.Analysis/BufferAnalysis.cs index 127dad0..7c679db 100644 --- a/Ems.CollectService.Analysis/BufferAnalysis.cs +++ b/Ems.CollectService.Analysis/BufferAnalysis.cs @@ -81,7 +81,7 @@ namespace Ems.CollectService.Analysis { var clients = tcpService.GetClients(); var info = clients.Where(x => x.ID == clientIdStr).ToList(); - if (info.Count > 0) + /*if (info.Count > 0) { logger.Trace($"客户端:{client.ID};地址:{client.GetIPPort()};已存在连接信息,主动断开已有连接"); foreach (var item in info) @@ -89,7 +89,7 @@ namespace Ems.CollectService.Analysis item.Close(); logger.Trace($"客户端:{item.ID};地址:{item.GetIPPort()};已断开"); } - } + }*/ if (client.ID != clientIdStr) { client.ResetID(clientIdStr); @@ -154,9 +154,12 @@ namespace Ems.CollectService.Analysis if(SendMessageAsync(client, SendMessagePackInfo)) { logger.Debug($"向客户端:{client.ID};地址:{client.GetIPPort()};回复心跳指令成功"); - Thread.Sleep(500); - bool isRes = SendTimeSyncToClient(client, SendMessagePackInfo); - logger.Info($"向客户端:{client.ID};地址:{client.GetIPPort()};发送校时指令{(isRes ? "成功":"失败")}"); + if (client.ID.Contains("450063")) + { + Thread.Sleep(500); + bool isRes = SendTimeSyncToClient(client, SendMessagePackInfo); + logger.Info($"向客户端:{client.ID};地址:{client.GetIPPort()};发送校时指令{(isRes ? "成功":"失败")}"); + } return true; } else @@ -277,7 +280,7 @@ namespace Ems.CollectService.Analysis if (double.IsNaN(f_UA)) { //此处判断a为NaN - recordDnbInstant.vA = appConfig.virtualValue; + recordDnbInstant.vA = 0; } else { @@ -388,7 +391,8 @@ namespace Ems.CollectService.Analysis if (double.IsNaN(f_ZXYGZ)) { //此处判断a为NaN - recordDnbInstant.zxyg = 0; + //recordDnbInstant.zxyg = 0; + recordDnbInstant.zxyg = appConfig.virtualValue; } else { @@ -474,7 +478,7 @@ namespace Ems.CollectService.Analysis if (appConfig.virtualFlag) { - if (recordDnbInstant.vA != appConfig.virtualValue) + if (recordDnbInstant.zxyg != appConfig.virtualValue) { var info = SqlSugarHelper.Db.Insertable(recordDnbInstant).ExecuteCommand(); if (info > 0) @@ -490,7 +494,7 @@ namespace Ems.CollectService.Analysis else { - recordDnbInstant.vA = recordDnbInstant.vA == appConfig.virtualValue ? 0 : recordDnbInstant.vA; + recordDnbInstant.zxyg = recordDnbInstant.zxyg == appConfig.virtualValue ? 0 : recordDnbInstant.zxyg; var info = SqlSugarHelper.Db.Insertable(recordDnbInstant).ExecuteCommand(); if (info > 0)