From 351cb734a84c10e90144551f7e7d6dd9a5c4abd2 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期日, 22 十一月 2020 13:40:57 +0800
Subject: [PATCH] 1. 数据库脚本添加启动大复位报警提示 2. 开放上传数据时间限制 3. 添加软件报警输出配置,目前提供连续NG报警和启动时大复位报警

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