Draining modified, in BERLIN done always before flow setting, ver. 2.12.518

This commit is contained in:
Milan Hanajik
2017-03-28 23:54:52 +02:00
parent 2ca5eec8e1
commit d420128b4b
42 changed files with 553 additions and 523 deletions
@@ -103,14 +103,14 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
while (!e.Contains(Event.ValvesSet));
if (!test.Emptying) /// If condition met => skip measuring and force emptying
if (!test.Draining) /// If condition met => skip measuring and force emptying
{
///
/// Measure the weight and skip emptying if there is enough room in the tank
///
State.Create("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
.AddOperation(checkUiOp)
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
.EnterState();
do
{
@@ -124,7 +124,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
while (!e.Contains(Event.BalanceDone));
double estimatedEndMass = Mass.Val + test.Volume;
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
if (estimatedEndMass < outPath.Scale.Capacity * Constants.TankFullFactor)
{
goto set_flow; /// Enough room in the tank -> skip emptying
}
@@ -133,7 +133,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
///
/// Empty the water tank
///
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
switch (DrainTheTank(outPath.DrainValve, outPath.Scale))
{
case Event.Error: { retVal = Event.Error; goto stopTest; }
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
@@ -182,7 +182,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(outPath.Scale.ReadStableMassOp(ref StartMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -251,7 +251,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
.AddOperation(readRegistersOp)
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
.AddOperation(outPath.Scale.ReadMassOp(ref Mass))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
@@ -277,7 +277,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
.AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(outPath.Scale.ReadStableMassOp(ref EndMass, test.MassRepeats, test.MassSpread, test.MassMethod))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.EnterState();
@@ -362,9 +362,9 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Scale.Corrections);
tstRslt.MassEndRaw = EndMass.Val;
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Scale.Corrections);
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
@@ -388,7 +388,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
(BenchInfo != null) ? BenchInfo.TestBenchName : "testbench",
inPath.Pump != null ? inPath.Pump.Name : string.Empty,
outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty,
outPath.Balance != null ? outPath.Balance.Name : string.Empty,
outPath.Scale != null ? outPath.Scale.Name : string.Empty,
outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty,
outPath.Diverter != null ? outPath.Diverter.Name : string.Empty));