From 417d5011c0b774fb9c8776def2a3e3f18528ad91 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期二, 17 十一月 2020 15:48:22 +0800
Subject: [PATCH] 1. 修改高度检测和长宽检测精度为小数点后5位 2. 添加启动时写入产品结果NA 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