From ee5b362447f3223d0af6adc60807fa63f707e796 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期三, 25 十一月 2020 10:45:42 +0800
Subject: [PATCH] opf文件中将unloadbatterydone的扫描周期修改为10ms

---
 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