patrick.xu
2021-03-10 990445751e7e7f65521d0413b7de4dc607e76e14
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)