diff --git a/TBF/Rig/Dummy/Balance/Component.cs b/TBF/Rig/Dummy/Balance/Component.cs index db48521f7..641d7212d 100644 --- a/TBF/Rig/Dummy/Balance/Component.cs +++ b/TBF/Rig/Dummy/Balance/Component.cs @@ -27,6 +27,7 @@ namespace TBF.Rig.Dummy.Balance public float BuoyancyPress { get { return 1.013f; } } public float BuoyancyHumi { get { return 50.0f; } } + public double Mass { get { return 0; } } @@ -45,12 +46,6 @@ namespace TBF.Rig.Dummy.Balance return this; } - public IOperation ReadMassOp(ref Boxes.DoubleBox mass) - { - mass.Val = 0; - return this; - } - public IOperation ReadStableMassOp(ref Boxes.DoubleBox mass, int delayBefore, Config.Entities.MassMethod method, int readingsCount, double maxSpread) { mass.Val = 0; diff --git a/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs b/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs index 1da6369a5..ca835f2db 100644 --- a/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs +++ b/TBF/Rig/MettlerToledo/Standard/BalanceDev.cs @@ -527,16 +527,6 @@ namespace TBF.Rig.MettlerToledo.Standard return new TaringOp(this, ref tara); } - /// - /// Events: BalanceDone, Error - /// - /// Reference to a variable for the measured mass in kg - /// ReadMassOp instance reference casted to IOperaton - public IOperation ReadMassOp(ref DoubleBox mass) - { - return new ReadMassOp(this, ref mass); - } - /// /// Events: BalanceDone, Error /// diff --git a/TBF/Rig/MettlerToledo/Standard/ReadMassOp.cs b/TBF/Rig/MettlerToledo/Standard/ReadMassOp.cs deleted file mode 100644 index fe36d9f94..000000000 --- a/TBF/Rig/MettlerToledo/Standard/ReadMassOp.cs +++ /dev/null @@ -1,53 +0,0 @@ -/// -/// Copyright (c) 2013-2020 Sensus Slovensko a.s. -/// -using System; -using log4net; -using TBF.Boxes; - -namespace TBF.Rig.MettlerToledo.Standard -{ - public class ReadMassOp : IOperation - { - private static readonly ILog log = LogManager.GetLogger(typeof(ReadMassOp)); - public override string ToString() { return string.Format("ReadMassOp(.,.)"); } - - /// Set by the constructor - BalanceDev scale; - DoubleBox result; - - /// - /// Events: BalanceDone (always) - /// - /// Balance device instance - /// Reference to the measured mass in kg - public ReadMassOp(BalanceDev scale, ref DoubleBox result) - { - if (scale == null) throw new ArgumentNullException("balanceDev"); - this.scale = scale; - this.result = result; - log.Debug(this.ToString()); - } - - /// Start this operation - public void Start() - { - result.Val = scale.Mass; - } - - /// Run this operation - /// - /// Event.BalanceDone - /// - public Event Run() - { - result.Val = scale.Mass; - return Event.ScaleDone; - } - - /// Stop this operation - public void Stop() - { - } - } -} diff --git a/TBF/Rig/Sequences/SequenceBase.cs b/TBF/Rig/Sequences/SequenceBase.cs index 25ccf8d3a..1ccf6b77c 100644 --- a/TBF/Rig/Sequences/SequenceBase.cs +++ b/TBF/Rig/Sequences/SequenceBase.cs @@ -278,7 +278,7 @@ namespace TBF.Rig.Sequences if (e.Contains(Event.Error)) return Event.Error; if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop; } - while (!e.Contains(Event.ValvesSet) || ((tank is IScale) && !e.Contains(Event.ScaleDone))); + while (!e.Contains(Event.ValvesSet)); if (tank.DrainValve2 != null) { @@ -950,8 +950,7 @@ namespace TBF.Rig.Sequences if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop; if (e.Contains(Event.TestCompleted) || e.Contains(Event.Next)) return Event.TestCompleted; } - while ( (realTest && (outPath.Scale is IScale) && !e.Contains(Event.ScaleDone)) || - !e.Contains(Event.ReadAllRegistersDone)); + while (!e.Contains(Event.ReadAllRegistersDone)); return Event.Done; } diff --git a/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs index 139eb96f8..0136d867b 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs @@ -247,8 +247,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadStableMassOp(ref StartMass, 0, test.MassMethod, test.MassRepeats, test.MassSpread)) - .AddOperation(new Operations.TimerOp(StableMassMsrmntTimeoutSec)) + .AddOperation(scale.ReadStableMassOp(ref StartMass, test.TimeFlow2Mass, test.MassMethod, test.MassRepeats, test.MassSpread)) .AddOperation(processDataLoggingOp) .EnterState(); do { diff --git a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 5faeee260..85e56ac30 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2019 Sensus Slovensko a.s. +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; diff --git a/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs b/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs index 78d86ec63..b0fbc091d 100644 --- a/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs +++ b/TBF/Rig/TestMethods/LeakTest/LeakTestSeq.cs @@ -252,7 +252,7 @@ namespace TBF.Rig.TestMethods.LeakTest State.Create(string.Format("{0}({1}) : Measuring the start mass", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadStableMassOp(ref StartMass, 0, test.MassMethod, test.MassRepeats, test.MassSpread)) + .AddOperation(scale.ReadStableMassOp(ref StartMass, test.TimeFlow2Mass, test.MassMethod, test.MassRepeats, test.MassSpread)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -309,7 +309,7 @@ namespace TBF.Rig.TestMethods.LeakTest State.Create(string.Format("{0}({1}) : Measuring the end mass", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadStableMassOp(ref EndMass, 0, test.MassMethod, test.MassRepeats, test.MassSpread)) + .AddOperation(scale.ReadStableMassOp(ref EndMass, test.TimeStop2Mass, test.MassMethod, test.MassRepeats, test.MassSpread)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 2b8243646..91584cac0 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -628,7 +628,6 @@ -