From 1905d3644eae8d08baaf43ea66780434603f8a70 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 14 Apr 2021 11:48:49 +0200 Subject: [PATCH] Bug fix in LeakTestSeq. --- TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs | 67 ++++++++++++--------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs b/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs index 3aaf5f0ff..5d1fba5c7 100644 --- a/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs @@ -50,22 +50,17 @@ namespace TBF.Rig.TestMethods.LeakTest /// public IList Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition, LeakTestParams testParams) { - IScale scale = null; - if ((testParams.MaxPressureDrop != 0) && (benchPath.PressMtrDown == null)) { Bridge.OnError(this, Strings.Missing_a_pressure_meter); return new List { Event.ConfigurationError }; } - - if (testParams.MaxMassIncrease > 0) + + IScale scale = outPath.Scale as IScale; + if (testParams.MaxMassIncrease > 0 && scale == null) { - scale = outPath.Scale as IScale; - if (scale == null) - { - Bridge.OnError(this, Strings.Missing_a_scale); - return new List { Event.ConfigurationError }; - } + Bridge.OnError(this, Strings.Missing_a_scale); + return new List { Event.ConfigurationError }; } IList e; /// Events from currently running operations @@ -379,26 +374,38 @@ namespace TBF.Rig.TestMethods.LeakTest tstRslt.DensityDiv = 0; /// Main results - tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName; - tstRslt.StartTime = TestStartTime; - tstRslt.EndTime = TestEndTime; - tstRslt.FlowSetTime = 0; - tstRslt.TestTime = Convert.ToDouble(testParams.DurationPMax); /// [s] measurement time - tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total) - tstRslt.MassStartRaw = StartMass.Val; - tstRslt.MassStart = Config.Formulas.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections); - tstRslt.MassEndRaw = EndMass.Val; - tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections); - tstRslt.MassOfEvapWater = 0; - tstRslt.FlowMass = 0; /// [kg/h] - tstRslt.FlowVolume = 0; /// [m3/h] - tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter - tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3] - tstRslt.ConstMasterRaw = 0; /// Convert the flow to [m3/h] - tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h] - tstRslt.ErrorMaster = 0; - tstRslt.ErrorFlags = 0; - tstRslt.InfoFlags = 0; + tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName; + tstRslt.StartTime = TestStartTime; + tstRslt.EndTime = TestEndTime; + tstRslt.FlowSetTime = 0; + tstRslt.TestTime = Convert.ToDouble(testParams.DurationPMax); /// [s] measurement time + tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total) + + if (testParams.MaxMassIncrease > 0) + { + tstRslt.MassStartRaw = StartMass.Val; + tstRslt.MassEndRaw = EndMass.Val; + tstRslt.MassStart = Config.Formulas.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections); + tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections); + } + else + { + tstRslt.MassStartRaw = 0; + tstRslt.MassStart = 0; + tstRslt.MassEndRaw = 0; + tstRslt.MassEnd = 0; + } + + tstRslt.MassOfEvapWater = 0; + tstRslt.FlowMass = 0; /// [kg/h] + tstRslt.FlowVolume = 0; /// [m3/h] + tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter + tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.ConstMasterRaw = 0; /// Convert the flow to [m3/h] + tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h] + tstRslt.ErrorMaster = 0; + tstRslt.ErrorFlags = 0; + tstRslt.InfoFlags = 0; bool pressureDropPassed = (testParams.MaxPressureDrop == 0) ? true : ((testParams.MaxPressureDrop > 0) ? (PressDownStat.First - PressDownStat.Last < testParams.MaxPressureDrop)