From 990445751e7e7f65521d0413b7de4dc607e76e14 Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期三, 10 三月 2021 20:08:44 +0800 Subject: [PATCH] 1. 添加抽检周数配置 --- HeightDetection.cs | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HeightDetection.cs b/HeightDetection.cs index 7d4663d..c237cda 100644 --- a/HeightDetection.cs +++ b/HeightDetection.cs @@ -305,11 +305,11 @@ double standardGap = opcConfig.batteryHeightLimit.Max - standardValue; double gap = adjustValue - standardValue; - fakeValue = finalHeight = (gap / (errorBand / 2.0)) * standardGap + standardValue; + fakeValue = finalHeight = Math.Round(((gap / (errorBand / 2.0)) * standardGap + standardValue), 5); if (finalHeight < opcConfig.batteryHeightLimit.Min || finalHeight > opcConfig.batteryHeightLimit.Max) { - fakeValue = standardValue + (CommonUtil.random.NextDouble() - 0.5) * 2.0 * standardGap; + fakeValue = Math.Round((standardValue + (CommonUtil.random.NextDouble() - 0.5) * 2.0 * standardGap), 5); } if (isEnableRawData) -- Gitblit v1.8.0