ProcessData base class with 'public static' process data introduced.

This commit is contained in:
Milan Hanajik
2015-12-20 20:48:50 +01:00
parent 15ac3608c4
commit bb2087c002
17 changed files with 461 additions and 448 deletions
@@ -111,7 +111,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
///
State.Create("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
.AddOperation(checkUiOp)
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
.EnterState();
do
{
@@ -121,7 +121,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
}
while (!e.Contains(Event.BalanceDone));
float estimatedEndMass = mass.Val + test.Volume;
float estimatedEndMass = Mass.Val + test.Volume;
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
{
goto set_flow; /// Enough room in the tank -> skip emptying
@@ -142,7 +142,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
//--------------------------------
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
.AddOperation(checkUiOp)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
.EnterState();
do
{
@@ -166,20 +166,20 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
flow_set:
int time = StateMachine.Time;
float currentFlow = refFlow.Val;
float currentFlow = RefFlow.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
//------------------------------------------------
State.Create("ReferenceFlowmeterCalibration : Measuring the start mass")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
@@ -194,7 +194,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
tstRslt.TimeStart = DateTime.Now;
tstRslt.MassStartRaw = startMass.Val;
mass.Val = startMass.Val;
Mass.Val = startMass.Val;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@@ -234,27 +234,27 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
if (firstTime)
{
firstTime = false; /// Do the following only once
tstRslt.TempInStart = tempIn.Val;
tstRslt.TempOutStart = tempOut.Val;
tstRslt.TempDivStart = tempDiv.Val;
tstRslt.PressInStart = pressIn.Val;
tstRslt.PressOutStart = pressOut.Val;
tstRslt.TempInStart = TempIn.Val;
tstRslt.TempOutStart = TempOut.Val;
tstRslt.TempDivStart = TempDiv.Val;
tstRslt.PressInStart = PressureUp.Val;
tstRslt.PressOutStart = PressureDown.Val;
}
tstRslt.TempInEnd = tempIn.Val;
tstRslt.TempOutEnd = tempOut.Val;
tstRslt.TempDivEnd = tempDiv.Val;
tstRslt.PressInEnd = pressIn.Val;
tstRslt.PressOutEnd = pressOut.Val;
tstRslt.MassEndRaw = mass.Val;
tstRslt.TempInEnd = TempIn.Val;
tstRslt.TempOutEnd = TempOut.Val;
tstRslt.TempDivEnd = TempDiv.Val;
tstRslt.PressInEnd = PressureUp.Val;
tstRslt.PressOutEnd = PressureDown.Val;
tstRslt.MassEndRaw = Mass.Val;
AccumulateAveragedData();
refFreq.Val = cBrd.ReferenceFreq;
refFlow.Val = cBrd.ReferenceFlow;
tstRslt.AmbientTempAve = airTemperature.Val;
tstRslt.AmbientPressAve = airPressure.Val;
tstRslt.AmbientHumiAve = airHumidity.Val;
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
tstRslt.AmbientTempAve = AmbientTemp.Val;
tstRslt.AmbientPressAve = AmbientPressure.Val;
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
@@ -273,15 +273,15 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
test_completed:
State.Create("FlyingStartCollectionMethod : Waiting before mass measurement")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation(readRegistersOp)
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
@@ -299,13 +299,13 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
//------------------------------------------------
State.Create("ReferenceFlowmeterCalibration : Measuring the end mass")
.AddOperation(checkUiOp)
.AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut))
.AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv))
.AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn))
.AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut))
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
.AddOperation((StateMachine.Ambient != null)
? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null)
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
.AddOperation(cBrd.UpdateTankWeightOp())
.AddOperation(processDataLoggingOp)