From 4f9b07ba204fb035b71a80ca8fdc95a6e65ad3be Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 24 Jun 2021 08:05:13 +0200 Subject: [PATCH] RegulValve.SetFlowOp : RqrdFlowRangeRatio = 0.5, requiredFlowLo/HI -= Config.Formulas.GetCorrection(...), ver. 2.26.1679 --- TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs | 26 ++++++++++++------- TBF/Properties/AssemblyInfo.cs | 4 +-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs index 9c4e88ca9..e9aaa2d13 100644 --- a/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Metering Systems +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -17,6 +17,10 @@ namespace TBF.BenchControl.Elde.RegulValve return string.Format("SetFlowOp({0}, Qfrom={1}, Qto={2})", regulValve.Name, requiredFlowLo, requiredFlowHi); } + + public const double RqrdFlowRangeRatio = 0.5; + + /// Set by the constructor readonly ControlBoardDev controlBoard; readonly RegulValve regulValve; @@ -93,9 +97,11 @@ namespace TBF.BenchControl.Elde.RegulValve nominalFlow = flowMeter.NominalFlow; maximalFlow = nominalFlow * 1.25; - this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2; - this.requiredFlowLo = (0.7 * requiredFlowLo) + (0.3 * this.reqFlowAve); /// Move the lower limit 15% of the range up - this.requiredFlowHi = (0.7 * requiredFlowHi) + (0.3 * this.reqFlowAve); /// Move the upper limit 15% of the range down + double rdrdFlowLoBeforeCorr = requiredFlowLo - Config.Formulas.GetCorrection(requiredFlowLo, flowMeter.Corrections); + double rdrdFlowHiBeforeCorr = requiredFlowHi - Config.Formulas.GetCorrection(requiredFlowHi, flowMeter.Corrections); + this.reqFlowAve = (rdrdFlowLoBeforeCorr + rdrdFlowHiBeforeCorr) / 2; + this.requiredFlowLo = (RqrdFlowRangeRatio * rdrdFlowLoBeforeCorr) + ((1 - RqrdFlowRangeRatio) * this.reqFlowAve); /// Move the lower limit a bit of the range up + this.requiredFlowHi = (RqrdFlowRangeRatio * rdrdFlowHiBeforeCorr) + ((1 - RqrdFlowRangeRatio) * this.reqFlowAve); /// Move the upper limit a bit of the range down if (flowBox == null) throw new ArgumentNullException("flowBox"); this.flowBox = flowBox; @@ -174,12 +180,12 @@ namespace TBF.BenchControl.Elde.RegulValve currentReqFlowLo = requiredFlowLo; /// Default lower limit currentReqFlowHi = requiredFlowHi; /// Default upper limit - if (flow != 0) - { - flowBox.Val = flow; - if (flow >= reqFlowAve) currentReqFlowHi = reqFlowAve; /// Decrease upper limit - if (flow <= reqFlowAve) currentReqFlowLo = reqFlowAve; /// Increase lower limit - } + //if (flow != 0) + //{ + // flowBox.Val = flow; + // if (flow >= reqFlowAve) currentReqFlowHi = reqFlowAve; /// Decrease upper limit + // if (flow <= reqFlowAve) currentReqFlowLo = reqFlowAve; /// Increase lower limit + //} flowWithinBoundsTime = 0; diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 083678a69..0705ebf7d 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.26.1675.0")] -[assembly: AssemblyFileVersion("2.26.1675.0")] +[assembly: AssemblyVersion("2.26.1679.0")] +[assembly: AssemblyFileVersion("2.26.1679.0")]