From 8a4ba0edad3d588652014c1ace29ada90ae8a84f Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 2 Aug 2024 10:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E9=A2=91=E5=BF=83=E7=8E=87=E5=90=AF?= =?UTF-8?q?=E5=8A=A8+5=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HealthMonitor.Service/Biz/db/TDengineService.cs | 10 +++++----- .../Resolver/PregnancyHeartRateResolver.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/HealthMonitor.Service/Biz/db/TDengineService.cs b/HealthMonitor.Service/Biz/db/TDengineService.cs index bdae874..7e9030b 100644 --- a/HealthMonitor.Service/Biz/db/TDengineService.cs +++ b/HealthMonitor.Service/Biz/db/TDengineService.cs @@ -892,15 +892,15 @@ namespace HealthMonitor.Service.Biz.db // 奇数个元素,取中间的数 median = sortedRes[count / 2]; } - Console.WriteLine("中位数是: " + median); - + //Console.WriteLine("中位数是: " + median); + _logger.LogInformation($"{serialNo} 中位数是: " + median); // 找出最接近平均值的众数 //var closestToAverage = modes.OrderBy(m => Math.Abs(m - average)).First(); //Console.WriteLine("最接近平均值的众数是: " + closestToAverage); // 找出最接近中位数的众数 var closestToMedian = modes.OrderBy(m => Math.Abs(m - median)).First(); - Console.WriteLine("最接近中位数的众数是: " + closestToMedian); + _logger.LogInformation($"{serialNo} 最接近中位数的众数是: " + closestToMedian); mode = closestToMedian; } #endregion @@ -914,8 +914,8 @@ namespace HealthMonitor.Service.Biz.db .ToList(); // 输出新数据集 - Console.WriteLine("新数据集: " + string.Join(", ", closestToModeData)); - Console.WriteLine("新数据集的数量: " + closestToModeData.Count); + _logger.LogInformation($"{serialNo} 新数据集: " + string.Join(", ", closestToModeData)); + _logger.LogInformation($"{serialNo} 新数据集的数量: " + closestToModeData.Count); var fhrMap = _mgrFhrPhrMapCache.GetHeartRatesMap(); var watchConfig = await _deviceCacheMgr.GetGpsDeviceWatchConfigCacheObjectBySerialNoAsync(serialNo, "0067"); diff --git a/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs b/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs index e0a307c..afa7f6d 100644 --- a/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs +++ b/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs @@ -152,8 +152,8 @@ namespace HealthMonitor.Service.Resolver // 如果需要,将时间差转换为秒 var timeDiffInSeconds = timeDiff.TotalSeconds; - // 高频心率启动 - if (timeDiffInSeconds <= highFreqSampleInterval) + // 高频心率启动,highFreqSampleInterval = highFreqSampleInterval+5,增加5秒兼容 + if (timeDiffInSeconds <= (highFreqSampleInterval+5)) { var phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno);