Waiting loop for temperature stability check in heat meters tests.
This commit is contained in:
+53
-2
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -186,7 +186,58 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
while (!e.Contains(Event.FlowReached));
|
||||
|
||||
flow_set:
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
|
||||
if (heatMetersTestParams != null && heatMetersPath != null)
|
||||
{
|
||||
//---------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_temperature);
|
||||
//---------------------------------------------------
|
||||
|
||||
int lastTimeSec = StateMachine.Time;
|
||||
float Tw_last = 0;
|
||||
float Tc_last = 0;
|
||||
FloatBox Tw1 = new FloatBox();
|
||||
FloatBox Tw2 = new FloatBox();
|
||||
FloatBox Tc1 = new FloatBox();
|
||||
FloatBox Tc2 = new FloatBox();
|
||||
|
||||
State.Create("FixedStartMassCollection : Check temperature stabilized.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(heatMetersPath.TMeterRefWarm1.ReadTempOp(ref Tw1))
|
||||
.AddOperation(heatMetersPath.TMeterRefWarm2.ReadTempOp(ref Tw2))
|
||||
.AddOperation(heatMetersPath.TMeterRefCold1.ReadTempOp(ref Tc1))
|
||||
.AddOperation(heatMetersPath.TMeterRefCold2.ReadTempOp(ref Tc2))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.Next)) goto temperature_set;
|
||||
|
||||
if (StateMachine.Time - lastTimeSec > 10 || StateMachine.Time - lastTimeSec < 0)
|
||||
{
|
||||
float Tw = (Tw1.Val + Tw2.Val) / 2.0f;
|
||||
float Tc = (Tc1.Val + Tc2.Val) / 2.0f;
|
||||
if (heatMetersTestParams.TempWarmLo <= Tw && Tw <= heatMetersTestParams.TempWarmHi &&
|
||||
heatMetersTestParams.TempColdLo <= Tc && Tc <= heatMetersTestParams.TempColdHi &&
|
||||
Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm &&
|
||||
Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold &&
|
||||
Math.Abs(Tw1.Val - Tw2.Val) <= heatMetersTestParams.DeltaTempWarm &&
|
||||
Math.Abs(Tc1.Val - Tc2.Val) <= heatMetersTestParams.DeltaTempCold)
|
||||
{
|
||||
goto temperature_set;
|
||||
}
|
||||
|
||||
lastTimeSec = StateMachine.Time;
|
||||
Tw_last = Tw;
|
||||
Tc_last = Tc;
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
||||
temperature_set:
|
||||
|
||||
//------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
|
||||
|
||||
@@ -112,9 +112,61 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
while (!e.Contains(Event.FlowReached));
|
||||
|
||||
flow_set:
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
|
||||
if (heatMetersTestParams != null && heatMetersPath != null)
|
||||
{
|
||||
//---------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_temperature);
|
||||
//---------------------------------------------------
|
||||
|
||||
int lastTimeSec = StateMachine.Time;
|
||||
float Tw_last = 0;
|
||||
float Tc_last = 0;
|
||||
FloatBox Tw1 = new FloatBox();
|
||||
FloatBox Tw2 = new FloatBox();
|
||||
FloatBox Tc1 = new FloatBox();
|
||||
FloatBox Tc2 = new FloatBox();
|
||||
|
||||
State.Create("FixedStartMassCollection : Check temperature stabilized.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(heatMetersPath.TMeterRefWarm1.ReadTempOp(ref Tw1))
|
||||
.AddOperation(heatMetersPath.TMeterRefWarm2.ReadTempOp(ref Tw2))
|
||||
.AddOperation(heatMetersPath.TMeterRefCold1.ReadTempOp(ref Tc1))
|
||||
.AddOperation(heatMetersPath.TMeterRefCold2.ReadTempOp(ref Tc2))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.Next)) goto temperature_set;
|
||||
|
||||
if (StateMachine.Time - lastTimeSec > 10 || StateMachine.Time - lastTimeSec < 0)
|
||||
{
|
||||
float Tw = (Tw1.Val + Tw2.Val) / 2.0f;
|
||||
float Tc = (Tc1.Val + Tc2.Val) / 2.0f;
|
||||
if (heatMetersTestParams.TempWarmLo <= Tw && Tw <= heatMetersTestParams.TempWarmHi &&
|
||||
heatMetersTestParams.TempColdLo <= Tc && Tc <= heatMetersTestParams.TempColdHi &&
|
||||
Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm &&
|
||||
Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold &&
|
||||
Math.Abs(Tw1.Val - Tw2.Val) <= heatMetersTestParams.DeltaTempWarm &&
|
||||
Math.Abs(Tc1.Val - Tc2.Val) <= heatMetersTestParams.DeltaTempCold)
|
||||
{
|
||||
goto temperature_set;
|
||||
}
|
||||
|
||||
lastTimeSec = StateMachine.Time;
|
||||
Tw_last = Tw;
|
||||
Tc_last = Tc;
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
||||
temperature_set:
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
for (int i = 0; i < sensPath.RegisterReaders.Length; i++)
|
||||
|
||||
+50
-1
@@ -214,12 +214,61 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
}
|
||||
while (!e.Contains(Event.FlowReached));
|
||||
|
||||
|
||||
flow_set:
|
||||
|
||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
||||
float currentFlow = RefFlow.Val;
|
||||
|
||||
if (heatMetersTestParams != null && heatMetersPath != null)
|
||||
{
|
||||
//---------------------------------------------------
|
||||
Bridge.OnActivity(this, Strings.Setting_temperature);
|
||||
//---------------------------------------------------
|
||||
|
||||
int lastTimeSec = StateMachine.Time;
|
||||
float Tw_last = 0;
|
||||
float Tc_last = 0;
|
||||
FloatBox Tw1 = new FloatBox();
|
||||
FloatBox Tw2 = new FloatBox();
|
||||
FloatBox Tc1 = new FloatBox();
|
||||
FloatBox Tc2 = new FloatBox();
|
||||
|
||||
State.Create("FixedStartMassCollection : Check temperature stabilized.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(heatMetersPath.TMeterRefWarm1.ReadTempOp(ref Tw1))
|
||||
.AddOperation(heatMetersPath.TMeterRefWarm2.ReadTempOp(ref Tw2))
|
||||
.AddOperation(heatMetersPath.TMeterRefCold1.ReadTempOp(ref Tc1))
|
||||
.AddOperation(heatMetersPath.TMeterRefCold2.ReadTempOp(ref Tc2))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||
if (e.Contains(Event.Next)) goto temperature_set;
|
||||
|
||||
if (StateMachine.Time - lastTimeSec > 10 || StateMachine.Time - lastTimeSec < 0)
|
||||
{
|
||||
float Tw = (Tw1.Val + Tw2.Val) / 2.0f;
|
||||
float Tc = (Tc1.Val + Tc2.Val) / 2.0f;
|
||||
if (heatMetersTestParams.TempWarmLo <= Tw && Tw <= heatMetersTestParams.TempWarmHi &&
|
||||
heatMetersTestParams.TempColdLo <= Tc && Tc <= heatMetersTestParams.TempColdHi &&
|
||||
Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm &&
|
||||
Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold &&
|
||||
Math.Abs(Tw1.Val - Tw2.Val) <= heatMetersTestParams.DeltaTempWarm &&
|
||||
Math.Abs(Tc1.Val - Tc2.Val) <= heatMetersTestParams.DeltaTempCold)
|
||||
{
|
||||
goto temperature_set;
|
||||
}
|
||||
|
||||
lastTimeSec = StateMachine.Time;
|
||||
Tw_last = Tw;
|
||||
Tc_last = Tc;
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
||||
temperature_set:
|
||||
|
||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||
IList<IOperation> measureOperations = new List<IOperation>();
|
||||
for (int i = 0; i < sensPath.RegisterReaders.Length; i++)
|
||||
|
||||
Reference in New Issue
Block a user