Feeding regulation valves functionality implemented, ver. 2.11.367
This commit is contained in:
parent
45e0f50562
commit
0fb3a74879
@ -13,33 +13,27 @@ namespace TBF.BenchControl.Operations
|
|||||||
private static readonly ILog log = LogManager.GetLogger(typeof(SetAllRegulValvesOp));
|
private static readonly ILog log = LogManager.GetLogger(typeof(SetAllRegulValvesOp));
|
||||||
public override string ToString() { return string.Format("SetAllRegulValvesOp()"); }
|
public override string ToString() { return string.Format("SetAllRegulValvesOp()"); }
|
||||||
|
|
||||||
IList<IRegulValve> regulValves;
|
|
||||||
int rvCount;
|
int rvCount;
|
||||||
IOperation[] setRVPosOps;
|
IOperation[] setRVPosOps;
|
||||||
|
|
||||||
public SetAllRegulValvesOp(IList<IRegulValve> regulValves, string encodedPositions, int timeout)
|
public SetAllRegulValvesOp(IList<IRegulValve> regulValves, IList<float> positions, int timeout)
|
||||||
{
|
{
|
||||||
if (regulValves == null) throw new ArgumentNullException("regulValves");
|
if (regulValves == null || regulValves.Count == 0)
|
||||||
this.regulValves = regulValves;
|
|
||||||
rvCount = regulValves.Count;
|
|
||||||
|
|
||||||
// Parse the positions
|
|
||||||
float[] positions = new float[rvCount];
|
|
||||||
string[] rvPosStr = (encodedPositions != null) ? encodedPositions.Split(new char[] { ';' }) : new string[0];
|
|
||||||
for (int i = 0; i < Math.Min(rvCount, rvPosStr.Length); i++)
|
|
||||||
{
|
{
|
||||||
float posPct;
|
rvCount = 0;
|
||||||
if (float.TryParse(rvPosStr[i], out posPct) && posPct >= 0 && posPct <= 100.0f)
|
|
||||||
{
|
|
||||||
positions[i] = posPct;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
setRVPosOps = new IOperation[rvCount];
|
else
|
||||||
for (int i = 0; i < rvCount; i++)
|
|
||||||
{
|
{
|
||||||
float posLo = Math.Max(positions[i] - 5.0f, 0);
|
rvCount = regulValves.Count;
|
||||||
float posHi = Math.Min(positions[i] + 5.0f, 100.0f);
|
if (positions == null || positions.Count != rvCount) throw new ArgumentNullException("positions");
|
||||||
setRVPosOps[i] = regulValves[i].SetRegulValvePositionOp(posLo, posHi, timeout);
|
|
||||||
|
setRVPosOps = new IOperation[rvCount];
|
||||||
|
for (int i = 0; i < rvCount; i++)
|
||||||
|
{
|
||||||
|
float posLo = Math.Max(positions[i] - 3.0f, 0);
|
||||||
|
float posHi = Math.Min(positions[i] + 3.0f, 100.0f);
|
||||||
|
setRVPosOps[i] = regulValves[i].SetRegulValvePositionOp(posLo, posHi, timeout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +54,7 @@ namespace TBF.BenchControl.Operations
|
|||||||
{
|
{
|
||||||
Event evnt = setRVPosOps[i].Run();
|
Event evnt = setRVPosOps[i].Run();
|
||||||
if (evnt == Event.Error) anyError = true;
|
if (evnt == Event.Error) anyError = true;
|
||||||
|
else if (evnt == Event.OpArgumentError) anyTimeout = true;
|
||||||
else if (evnt == Event.RegulValveTimeOut) anyTimeout = true;
|
else if (evnt == Event.RegulValveTimeOut) anyTimeout = true;
|
||||||
else if (evnt != Event.PositionReached) allDone = false;
|
else if (evnt != Event.PositionReached) allDone = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -337,8 +337,8 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float lo = Math.Max(0, allRegvPositions[i] - 0.05f);
|
float lo = Math.Max(0, allRegvPositions[i] - 3.0f);
|
||||||
float hi = Math.Min(100.0f, allRegvPositions[i] + 0.05f);
|
float hi = Math.Min(100.0f, allRegvPositions[i] + 3.0f);
|
||||||
rvPosOps.Add(RegulValves[i].SetRegulValvePositionOp(lo, hi, 60));
|
rvPosOps.Add(RegulValves[i].SetRegulValvePositionOp(lo, hi, 60));
|
||||||
rvPosStr.Add(string.Format("RV{0}.SetRegulValvePositionOp({1}, {2}, 60s)", i, lo, hi));
|
rvPosStr.Add(string.Format("RV{0}.SetRegulValvePositionOp({1}, {2}, 60s)", i, lo, hi));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,42 +94,53 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
|
//------------------------------------------------
|
||||||
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
|
///
|
||||||
|
State.Create("Adjustment : Starting the pump")
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||||
|
.AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
|
||||||
|
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
|
||||||
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
|
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||||
|
|
||||||
|
|
||||||
|
if (test.TimeBeforeFlow > 0)
|
||||||
|
{
|
||||||
|
State.Create("Adjustment : Waiting before flow setting process starts")
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(new Operations.TimerOp(test.TimeBeforeFlow))
|
||||||
|
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
|
||||||
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
}
|
||||||
|
while (!e.Contains(Event.TimerExpired));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
State.Create("Adjustment : Setting the flow")
|
||||||
|
|
||||||
State.Create("Adjustment : Waiting 5 sec")
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperation(new Operations.TimerOp(5))
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
|
|
||||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.TimerExpired));
|
|
||||||
|
|
||||||
|
|
||||||
State.Create("Adjustment : Starting the pump")
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
|
|
||||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.ValvesSet));
|
|
||||||
|
|
||||||
//--------------------------------
|
|
||||||
State.Create("Adjustment : Setting the flow")
|
|
||||||
.AddOperation(checkUiOp)
|
.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();
|
.EnterState();
|
||||||
|
|||||||
@ -73,12 +73,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Optionally display prompt to emerge temperature meters to appropriate baths for heat meters test
|
||||||
|
///
|
||||||
|
IOperation heatMetersPromptOp = null;
|
||||||
|
if (heatMetersTestParams != null && !string.IsNullOrEmpty(heatMetersTestParams.Prompt))
|
||||||
|
{
|
||||||
|
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
|
|
||||||
State.Create("FixedStartMassCollection : Starting the pump")
|
State.Create("FixedStartMassCollection : Waiting before starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(new Operations.TimerOp(5))
|
.AddOperation(new Operations.TimerOp(5))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -91,11 +101,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.TimerExpired));
|
while (!e.Contains(Event.TimerExpired));
|
||||||
|
///
|
||||||
|
|
||||||
State.Create("FixedStartMassCollection : Starting the pump")
|
State.Create("FixedStartMassCollection : Starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||||
|
.AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
|
||||||
|
.AddOperation(heatMetersPromptOp)
|
||||||
|
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -104,17 +116,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
while (!e.Contains(Event.ValvesSet));
|
|
||||||
|
|
||||||
///
|
}
|
||||||
/// Optionally display prompt to emerge temperature meters to appropriate baths for heat meters test
|
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||||
///
|
|
||||||
IOperation heatMetersPrompt = null;
|
|
||||||
if (heatMetersTestParams != null && !string.IsNullOrEmpty(heatMetersTestParams.Prompt))
|
|
||||||
{
|
|
||||||
heatMetersPrompt = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
||||||
@ -125,7 +130,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
State.Create("FixedStartMassCollection : Measuring the mass of water in the tank")
|
State.Create("FixedStartMassCollection : Measuring the mass of water in the tank")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||||
.AddOperation(heatMetersPrompt)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -148,7 +153,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
///
|
///
|
||||||
/// Empty the water tank
|
/// Empty the water tank
|
||||||
///
|
///
|
||||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance, heatMetersPrompt))
|
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance, heatMetersPromptOp))
|
||||||
{
|
{
|
||||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -163,7 +168,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
State.Create("FixedStartMassCollection : Starting the pump")
|
State.Create("FixedStartMassCollection : Starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||||
.AddOperation(heatMetersPrompt)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -179,7 +184,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
State.Create("FixedStartMassCollection : Setting the flow")
|
State.Create("FixedStartMassCollection : Setting the flow")
|
||||||
.AddOperation(checkUiOp)
|
.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.
|
||||||
.AddOperation(heatMetersPrompt)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -219,7 +224,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
.AddOperation(heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefWarm2))
|
.AddOperation(heatMetersPath.TMeterRefWarm2.ReadTempOp(ref TempRefWarm2))
|
||||||
.AddOperation(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefCold1))
|
.AddOperation(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefCold1))
|
||||||
.AddOperation(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefCold2))
|
.AddOperation(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefCold2))
|
||||||
.AddOperation(heatMetersPrompt)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|||||||
@ -137,32 +137,35 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
|
//------------------------------------------------
|
||||||
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
|
///
|
||||||
|
State.Create("FlyingStart : Starting the pump")
|
||||||
|
.AddOperation(checkUiOp)
|
||||||
|
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||||
|
.AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
|
||||||
|
.AddOperation(heatMetersPromptOp)
|
||||||
|
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
|
|
||||||
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
|
|
||||||
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
int flowSetTime0 = StateMachine.Time;
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
State.Create("FlyingStart : Setting the flow")
|
||||||
int flowSetTime0 = StateMachine.Time;
|
|
||||||
|
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
|
||||||
State.Create("FlyingStart : Starting the pump")
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
|
||||||
.AddOperation(heatMetersPromptOp)
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
|
|
||||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.ValvesSet));
|
|
||||||
|
|
||||||
//--------------------------------
|
|
||||||
State.Create("FlyingStart : Setting the flow")
|
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
|
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 990)) /// timeout = 16.5 min.
|
||||||
.AddOperation(heatMetersPromptOp)
|
.AddOperation(heatMetersPromptOp)
|
||||||
|
|||||||
@ -177,51 +177,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
|||||||
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
|
//------------------------------------------------
|
||||||
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
///
|
///
|
||||||
/// Start the pump, set feeding regulation valves
|
State.Create("FlyingStartMassCollection : Starting the pump")
|
||||||
///
|
.AddOperation(checkUiOp)
|
||||||
IList<IOperation> startFeedingOperations = new List<IOperation>();
|
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||||
if (inPath.Pump != null) startFeedingOperations.Add(cBrd.SetValvesOp(inPath.Pump, null));
|
.AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
|
||||||
|
.AddOperation(heatMetersPromptOp)
|
||||||
//for (int i = 0; i < inPath.RegulValves.Count; i++)
|
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
|
||||||
//{
|
.EnterState();
|
||||||
// GenericDevices.IRegulValve rv = inPath.RegulValves[i];
|
do
|
||||||
// float position = inPath.RegulValvesPct[i];
|
|
||||||
// if (rv.IsCoax)
|
|
||||||
// {
|
|
||||||
// startFeedingOperations.Add(rv.SetRegulValvePositionOp(position, position, 60));
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// float lo = Math.Max(0, position - 2.0f);
|
|
||||||
// float hi = Math.Min(100.0f, position + 2.0f);
|
|
||||||
// startFeedingOperations.Add(rv.SetRegulValvePositionOp(lo, hi, 60));
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (startFeedingOperations.Count > 0)
|
|
||||||
{
|
{
|
||||||
//------------------------------------------------
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
//------------------------------------------------
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
|
||||||
///
|
|
||||||
State.Create("FlyingStartMassCollection : Starting the pump")
|
|
||||||
.AddOperation(checkUiOp)
|
|
||||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
|
||||||
.AddOperation(heatMetersPromptOp)
|
|
||||||
.AddOperations(startFeedingOperations)
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting));
|
|
||||||
|
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
while (!e.Contains(Event.ValvesSet));
|
|
||||||
}
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||||
|
|
||||||
|
|
||||||
if (test.TimePump2StartV > 0)
|
if (test.TimePump2StartV > 0)
|
||||||
|
|||||||
@ -60,18 +60,21 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
|
|
||||||
State.Create("LeakTest : Starting the pump")
|
State.Create("LeakTest : Starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||||
.EnterState();
|
.AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
|
||||||
|
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
|
||||||
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
while (e.Contains(Event.ValvesBusy));
|
}
|
||||||
|
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_water_pressure);
|
Bridge.OnActivity(this, Strings.Setting_the_water_pressure);
|
||||||
|
|||||||
@ -61,18 +61,21 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
|
|
||||||
State.Create("PMaxTest : Starting the pump")
|
State.Create("PMaxTest : Starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
.AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60))
|
||||||
|
.AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.ValvesBusy));
|
while (e.Contains(Event.ValvesBusy) || !e.Contains(Event.AllPositionsReached));
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_water_pressure);
|
Bridge.OnActivity(this, Strings.Setting_the_water_pressure);
|
||||||
|
|||||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.11.365.1")]
|
[assembly: AssemblyVersion("2.11.367.1")]
|
||||||
[assembly: AssemblyFileVersion("2.11.365.1")]
|
[assembly: AssemblyFileVersion("2.11.367.1")]
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
rmdir /s /q Config\bin
|
rmdir /s /q Config\bin
|
||||||
rmdir /s /q Config\obj
|
rmdir /s /q Config\obj
|
||||||
|
rmdir /s /q DeviceTest\bin
|
||||||
|
rmdir /s /q DeviceTest\obj
|
||||||
rmdir /s /q Results\bin
|
rmdir /s /q Results\bin
|
||||||
rmdir /s /q Results\obj
|
rmdir /s /q Results\obj
|
||||||
rmdir /s /q ResultsBrowser\bin
|
rmdir /s /q ResultsBrowser\bin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user