All changes done for Badger-velka-trat merged into this branch, version 2.1.210.

This commit is contained in:
Milan Hanajik 2016-02-07 22:27:32 +01:00
parent adb37826a5
commit 3407b51c27
24 changed files with 169 additions and 76 deletions

View File

@ -55,10 +55,10 @@ namespace Config.Entities
result += indent + "Duration = " + Duration.ToString() + ", "; result += indent + "Duration = " + Duration.ToString() + ", ";
result += indent + "Message = " + Message + ", "; result += indent + "Message = " + Message + ", ";
result += indent + "EndCondition = " + EndCondition.ToString() + ", "; result += indent + "EndCondition = " + EndCondition.ToString() + ", ";
result += indent + "ValvesOpen = " + ValvesOpen.ToString() + ", "; result += indent + "ValvesOpen = " + ValvesOpen + ", ";
result += indent + "ValvesClose = " + ValvesClose.ToString() + ", "; result += indent + "ValvesClose = " + ValvesClose + ", ";
result += indent + "RegulValvesPct = " + RegulValvesPct.ToString() + ", "; result += indent + "RegulValvesPct = " + RegulValvesPct + ", ";
result += indent + "PumpsWithFMPct = " + RegulValvesPct.ToString() + Environment.NewLine; result += indent + "PumpsWithFMPct = " + PumpWithFMPcts + Environment.NewLine;
return result; return result;
} }
} }

View File

@ -24,13 +24,14 @@ namespace TBF.BenchControl.Elde
TestInProgress = 0x20, TestInProgress = 0x20,
//DiverterError = 0x20, //DiverterError = 0x20,
MsrmntWithDivrtr = 0x80, MsrmntWithDivrtr = 0x80,
RefPulsesMsrmnt = 0x100, RefPulsesMsrmnt = 0x100, /// bit 8
SynchroMethod = 0x800, SynchroMethod = 0x800, /// bit 11
WaterMeterCalib = 0x1000, WaterMeterCalib = 0x1000, /// bit 12
EmgcyStopActive = 0x2000, EmgcyStopActive = 0x2000,
MsrmntGateActive = 0x4000, MsrmntGateActive = 0x4000,
TimeMeasurement = 0x8000, TimeMeasurement = 0x8000,
FrequencyMeasured = 0x80000, FrequencyMeasured = 0x80000, /// bit 19
CoaxRegValveBusy = 0x200000, /// bit 21
ADCError = 0x80000000, ADCError = 0x80000000,
TimeoutOccured = 0x100000000, TimeoutOccured = 0x100000000,
MeretAddresses = 0x200000000, MeretAddresses = 0x200000000,
@ -56,6 +57,7 @@ namespace TBF.BenchControl.Elde
MsrmntGateActive = 0x4000, MsrmntGateActive = 0x4000,
TimeMeasurement = 0x8000, TimeMeasurement = 0x8000,
FrequencyMeasured = 0x80000, FrequencyMeasured = 0x80000,
CoaxRegValveBusy = 0x200000, /// bit 21
ADCError = 0x80000000, ADCError = 0x80000000,
TimeoutOccured = 0x100000000, TimeoutOccured = 0x100000000,
MeretAddresses = 0x200000000, MeretAddresses = 0x200000000,

View File

@ -124,6 +124,8 @@ namespace TBF.BenchControl.Elde
/// <param name="divEdge">Percentages for switching of diverters, ix = diverter nr.(0,1), typ.value 50 (%)</param> /// <param name="divEdge">Percentages for switching of diverters, ix = diverter nr.(0,1), typ.value 50 (%)</param>
public void SendCalibData(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, float[] etCalib, uint[] divEdge, uint[] balanceRange) public void SendCalibData(uint[,] rvCalib, byte[] meretA, int usedCom, float[,] tempCalib, float[] etCalib, uint[] divEdge, uint[] balanceRange)
{ {
log.Info("SendCalibData(...)");
this.regValveCalib = rvCalib; this.regValveCalib = rvCalib;
this.meretRS485Address = meretA; this.meretRS485Address = meretA;
this.tempCalibData = tempCalib; this.tempCalibData = tempCalib;
@ -141,13 +143,35 @@ namespace TBF.BenchControl.Elde
/// <param name="refPulses">kolko impulzov ma trvat skuska</param> /// <param name="refPulses">kolko impulzov ma trvat skuska</param>
/// <param name="testMethods">See ControlBoard.TestMethods enum</param> /// <param name="testMethods">See ControlBoard.TestMethods enum</param>
/// <param name="filterConstant">0 = No filtering (0..255)</param> /// <param name="filterConstant">0 = No filtering (0..255)</param>
/// <param name="FMFreq">Freq.inverter control (not applicable in DT100, Munich)</param> /// <param name="fmFreq">Freq.inverter control (not applicable in DT100, Munich)</param>
/// <param name="regConst">Coefficient used to control reg. valves (1..100)</param> /// <param name="regConst">Coefficient used to control reg. valves (1..100)</param>
/// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param> /// <param name="shortImp">0 = default value, 1 = spec. processing of very short pulses</param>
/// <param name="stopDevs">What to stop</param> /// <param name="stopDevs">What to stop</param>
public void SendCommand(Command cmd, int refFlowmtrNr, ulong route, int totalRefPulses, TestMethods testMethods, public void SendCommand(Command cmd, int refFlowmtrNr, ulong route, int totalRefPulses, TestMethods testMethods,
float filterConstant, float[] FMFreq, int regConst, int shortImp, StopDevs stopDevs) float filterConstant, float[] fmFreq, int regConst, int shortImp, StopDevs stopDevs)
{ {
log.InfoFormat("SendCommand(cmd={0}, ref={1}, route={2} {3} {4} {5}, pulses={6}, TM={7}, filt={8}, pumpFM=[{9}{10}{11}{12}{13}{14}], reg={15}, shrtImp={16}, stop={17})",
cmd,
refFlowmtrNr,
((route >> 48) & 0xFFFF).ToString("X4"),
((route >> 32) & 0xFFFF).ToString("X4"),
((route >> 16) & 0xFFFF).ToString("X4"),
(route & 0xFFFF).ToString("X4"),
totalRefPulses,
testMethods,
filterConstant,
fmFreq[0].ToString(),
(fmFreq.Length > 1) ? ("," + fmFreq[1].ToString()) : "",
(fmFreq.Length > 2) ? ("," + fmFreq[2].ToString()) : "",
(fmFreq.Length > 3) ? ("," + fmFreq[3].ToString()) : "",
(fmFreq.Length > 4) ? ("," + fmFreq[4].ToString()) : "",
(fmFreq.Length > 5) ? ("," + fmFreq[5].ToString()) : "",
regConst,
shortImp,
stopDevs);
///
/// Simulation
///
Command lastCmd = this.cmd; Command lastCmd = this.cmd;
this.cmd = cmd; this.cmd = cmd;
this.refFlowmtrNr = refFlowmtrNr; this.refFlowmtrNr = refFlowmtrNr;
@ -169,7 +193,7 @@ namespace TBF.BenchControl.Elde
this.totalRefPulses = totalRefPulses; this.totalRefPulses = totalRefPulses;
this.testMethods = testMethods; this.testMethods = testMethods;
this.filterConstant = filterConstant; this.filterConstant = filterConstant;
this.FMFreq = FMFreq; this.FMFreq = fmFreq;
this.regConst = regConst; this.regConst = regConst;
this.shortImp = shortImp; this.shortImp = shortImp;
this.stopDevs = stopDevs; this.stopDevs = stopDevs;
@ -210,6 +234,8 @@ namespace TBF.BenchControl.Elde
/// <param name="stableTime">Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec.</param> /// <param name="stableTime">Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec.</param>
public void ValveMove(int regulValveNo, RegulValveMode regulValveMode, float[] regulValveValue, int stableTime) public void ValveMove(int regulValveNo, RegulValveMode regulValveMode, float[] regulValveValue, int stableTime)
{ {
log.InfoFormat("ValveMove({0}, {1}, [{2},{3}], {4})", regulValveNo, regulValveMode, regulValveValue[0], regulValveValue[1], stableTime);
this.regulValveNo = regulValveNo; this.regulValveNo = regulValveNo;
this.regulValveMode = regulValveMode; this.regulValveMode = regulValveMode;
this.regulValveValue = regulValveValue; this.regulValveValue = regulValveValue;
@ -219,7 +245,7 @@ namespace TBF.BenchControl.Elde
{ {
TestBenchSim.RunDevice(regulValveNo, refFlowmtrNr, statusP); TestBenchSim.RunDevice(regulValveNo, refFlowmtrNr, statusP);
log.DebugFormat("refFreq=", referenceFreq); log.DebugFormat("refFreq={0}", referenceFreq);
tTime += 1.0f; tTime += 1.0f;

View File

@ -30,11 +30,10 @@ namespace TBF.BenchControl.Elde.RegulValve
public int DacValueOpen { get { return RegulValveCfg.AdcValueOpen; } } /// 0..1023 public int DacValueOpen { get { return RegulValveCfg.AdcValueOpen; } } /// 0..1023
public int StableTime { get { return RegulValveCfg.StableTime; } } /// 0=200ms, step=50ms, max. 1500ms (max.26) public int StableTime { get { return RegulValveCfg.StableTime; } } /// 0=200ms, step=50ms, max. 1500ms (max.26)
public int FlowStableSec { get { return RegulValveCfg.FlowStableSec; } } /// 0..60 sec public int FlowStableSec { get { return RegulValveCfg.FlowStableSec; } } /// 0..60 sec
/// ///
public float Position public bool IsCoax { get { return (Idx1 == COAX_IDX); } }
{ ///
get { return ControlBoard.RValvePosition(Idx1); } public float Position { get { return ControlBoard.RValvePosition(Idx1); } }
}
#region Configuration Change Handling #region Configuration Change Handling

View File

@ -17,6 +17,9 @@ namespace TBF.BenchControl.Elde.RegulValve
return string.Format("SetFlowOp({0}, Qfrom={1}, Qto={2}, PID={3})", regulValve.Name, reqFlowLo, reqFlowHi, pidCoef); return string.Format("SetFlowOp({0}, Qfrom={1}, Qto={2}, PID={3})", regulValve.Name, reqFlowLo, reqFlowHi, pidCoef);
} }
const int CoaxValveNr = 7; /// Coax. valve has number 7
/// Set by the constructor /// Set by the constructor
readonly ControlBoardDev controlBoard; readonly ControlBoardDev controlBoard;
readonly Elde.RegulValve.RegulValve regulValve; readonly Elde.RegulValve.RegulValve regulValve;
@ -267,7 +270,17 @@ namespace TBF.BenchControl.Elde.RegulValve
opState = OpState.SendCommandAgain; opState = OpState.SendCommandAgain;
return Event.None; return Event.None;
} }
else if (regulValveNr == 7 || controlBoard.RegulValveState(regulValveNr) != RegulValveState.DacValueRegul) else if (regulValveNr == CoaxValveNr && ((ulong)controlBoard.StatusP & (ulong)StatusP.CoaxRegValveBusy) == 0)
{
/// Repeat appropriate ValveMove(...) command
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition,
new float[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 },
regulValve.StableTime);
opState = OpState.ValveMoveToPosition3;
return Event.None;
}
else if (regulValveNr < 6 && controlBoard.RegulValveState(regulValveNr) != RegulValveState.DacValueRegul)
{ {
/// Repeat appropriate ValveMove(...) command /// Repeat appropriate ValveMove(...) command
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition,
@ -331,7 +344,19 @@ namespace TBF.BenchControl.Elde.RegulValve
opState = OpState.SendCommandAgain; opState = OpState.SendCommandAgain;
return Event.None; return Event.None;
} }
else if (regulValveNr == 7 || controlBoard.RegulValveState(regulValveNr) != RegulValveState.PwOrFreqRegul) else if (regulValveNr == CoaxValveNr && ((ulong)controlBoard.StatusP & (ulong)StatusP.CoaxRegValveBusy) == 0)
{
/// Done once, issues an appropriate ValveMove(...) command
float freqLo = 2000.0f * reqFlowLo / nominalFlow;
float freqHi = 2000.0f * reqFlowHi / nominalFlow;
controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency,
new float[2] { (freqLo + freqHi) / 2.0f, (freqLo + freqHi) / 2.0f },
regulValve.StableTime);
opState = OpState.ValveMoveToFlow3;
return Event.None;
}
else if (regulValveNr < 6 && controlBoard.RegulValveState(regulValveNr) != RegulValveState.PwOrFreqRegul)
{ {
/// Done once, issues an appropriate ValveMove(...) command /// Done once, issues an appropriate ValveMove(...) command
float freqLo = 2000.0f * reqFlowLo / nominalFlow; float freqLo = 2000.0f * reqFlowLo / nominalFlow;
@ -376,11 +401,15 @@ namespace TBF.BenchControl.Elde.RegulValve
regulValveNr, reqFlowAve, rvPosition.ToString("F1")); regulValveNr, reqFlowAve, rvPosition.ToString("F1"));
} }
} }
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2}, REACHED)", flow, reqFlowLo, reqFlowHi);
opState = OpState.FlowReached; opState = OpState.FlowReached;
return Event.FlowReached; return Event.FlowReached;
} }
else else
{ {
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2}, FLOW_OK_TIMER={3}s)", flow, reqFlowLo, reqFlowHi, flowWithinBoundsTime);
return Event.None; return Event.None;
} }
} }
@ -390,12 +419,14 @@ namespace TBF.BenchControl.Elde.RegulValve
} }
else else
{ {
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2})", flow, reqFlowLo, reqFlowHi);
flowWithinBoundsTime = 0; flowWithinBoundsTime = 0;
return Event.None; return Event.None;
} }
} }
else /// opState == OpState.FlowReached else /// opState == OpState.FlowReached
{ {
log.InfoFormat("flow = {0} m3/h (lo={1}, hi={2}, REACHED)", flow, reqFlowLo, reqFlowHi);
return Event.FlowReached; return Event.FlowReached;
} }
} }

View File

@ -84,7 +84,8 @@ namespace TBF.BenchControl.Elde.RegulValve
{ {
if (firstRun) if (firstRun)
{ {
if (posLoPct >= posHiPct || posLoPct >= 100.0f || posHiPct <= 0) if (posLoPct > posHiPct || (!regulValve.IsCoax && posLoPct == posHiPct) ||
posLoPct > 100.0f || posHiPct < 0)
{ {
return Event.OpArgumentError; return Event.OpArgumentError;
} }
@ -125,10 +126,11 @@ namespace TBF.BenchControl.Elde.RegulValve
/// <summary>Stop this operation</summary> /// <summary>Stop this operation</summary>
public void Stop() public void Stop()
{ {
controlBoard.ValveMove(regulValveNr, if (!regulValve.IsCoax)
RegulValveMode.Stop, {
new float[2] { posLoPct, posHiPct }, controlBoard.ValveMove(regulValveNr, RegulValveMode.Stop,
regulValve.StableTime); new float[2] { posLoPct, posHiPct }, regulValve.StableTime);
}
} }
} }
} }

View File

@ -29,7 +29,9 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
public int FlowStableSec { get { return RegulValveTandemCfg.FlowStableSec; } } /// 0..60 sec public int FlowStableSec { get { return RegulValveTandemCfg.FlowStableSec; } } /// 0..60 sec
/// ///
public float Position public bool IsCoax { get { return false; } }
public float Position
{ {
get { return regulValve.Position; } get { return regulValve.Position; }
} }

View File

@ -97,8 +97,8 @@ namespace TBF.BenchControl.Elde
public void Start() public void Start()
{ {
controlBoard.SyncRoute(); controlBoard.SyncRoute();
#if IPERLST #if IPERLST || BADGER_VELKA_TRAT
int flowMeterIdxAndDiv = flowMeterNr + 16 * diverterNr; int flowMeterIdxAndDiv = flowMeterNr + 16 * diverterNr;
#else #else
int flowMeterIdxAndDiv = flowMeterNr; int flowMeterIdxAndDiv = flowMeterNr;
#endif #endif

View File

@ -10,6 +10,11 @@ namespace TBF.BenchControl.GenericDevices
{ {
public interface IRegulValve : IComponent public interface IRegulValve : IComponent
{ {
/// <summary>
/// true = The regulation valve is 4-20 mA current controlled coaxial valve
/// </summary>
bool IsCoax { get; }
/// <summary> /// <summary>
/// Regulation valve position 0.0 .. 100.0 % /// Regulation valve position 0.0 .. 100.0 %
/// </summary> /// </summary>

View File

@ -39,7 +39,6 @@ namespace TBF.BenchControl.MettlerToledo.Multi
/// <summary>Start this operation</summary> /// <summary>Start this operation</summary>
public void Start() public void Start()
{ {
started = false;
done = false; done = false;
started = BalanceDev.GetImmediateMassMeasurement(balanceDev.IdNr, balanceDev.Name); started = BalanceDev.GetImmediateMassMeasurement(balanceDev.IdNr, balanceDev.Name);
} }
@ -55,19 +54,21 @@ namespace TBF.BenchControl.MettlerToledo.Multi
if (!started) if (!started)
{ {
started = BalanceDev.GetImmediateMassMeasurement(balanceDev.IdNr, balanceDev.Name); started = BalanceDev.GetImmediateMassMeasurement(balanceDev.IdNr, balanceDev.Name);
return Event.Busy; if (!done) return Event.Busy;
else return Event.BalanceDone;
}
else if (started && balanceDev.MsrmntState == MsrmntState.Valid)
{
result.Val = balanceDev.Mass;
log.InfoFormat("ReadMassOp.Run() ... mass={0} ... returning Event.BalanceDone", balanceDev.Mass);
done = true;
started = false;
return Event.BalanceDone; /// Mass read OK
} }
else if (done) else if (done)
{ {
return Event.BalanceDone; /// Mass has already been read (at least once) return Event.BalanceDone; /// Mass has already been read (at least once)
} }
else if (balanceDev.MsrmntState == MsrmntState.Valid)
{
result.Val = balanceDev.Mass;
log.InfoFormat("ReadMassOp.Run() ... mass={0} ... returning Event.BalanceDone", balanceDev.Mass);
done = true;
return Event.BalanceDone; /// Mass read OK
}
else else
{ {
return Event.Busy; return Event.Busy;

View File

@ -233,9 +233,10 @@ namespace TBF.BenchControl.Sequences
public enum TransitionContext public enum TransitionContext
{ {
PurgeBegin, PurgeBegin,
PurgeEnd,
BeforeTest, BeforeTest,
AfterTest, AfterTest,
PurgeEnd,
Stop,
} }
/// <summary> /// <summary>
@ -250,20 +251,25 @@ namespace TBF.BenchControl.Sequences
/// </returns> /// </returns>
protected Event Transition(TransitionSequence transitionSequence, TransitionContext context) protected Event Transition(TransitionSequence transitionSequence, TransitionContext context)
{ {
bool stopFlag = false;
bool errorFlag = false;
IList<Event> e; IList<Event> e;
string message; string message;
///
switch (context) switch (context)
{ {
case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break; case TransitionContext.PurgeBegin: message = Strings.Purging_i_n; break;
case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break; case TransitionContext.BeforeTest: message = Strings.Test_start_sequence_i_n; break;
case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break; case TransitionContext.AfterTest: message = Strings.Test_stop_sequence_i_n; break;
default: message = "Transition"; break; case TransitionContext.PurgeEnd: message = Strings.Emptying_i_n; break;
case TransitionContext.Stop: message = Strings.Test_stop_sequence_i_n; break;
default: message = "Transition"; break;
} }
if (transitionSequence == null) if (transitionSequence == null)
{ {
log.WarnFormat("Transition(null, context={0})", context);
/// ///
/// No transition sequence defined --> Default action /// No transition sequence defined --> Default action
/// ///
@ -311,6 +317,9 @@ namespace TBF.BenchControl.Sequences
.List<TransitionStep>(); .List<TransitionStep>();
int stepsCount = transitionSteps.Count; int stepsCount = transitionSteps.Count;
log.WarnFormat("Transition(sequence={0} ({1} steps), context={2})", transitionSequence.Name, stepsCount, context);
foreach (var step in transitionSteps) foreach (var step in transitionSteps)
{ {
//------------------------------------------------ //------------------------------------------------
@ -346,18 +355,24 @@ namespace TBF.BenchControl.Sequences
{ {
if (allRegvPositions[i] >= 0) /// Negative value means no position change if (allRegvPositions[i] >= 0) /// Negative value means no position change
{ {
float lo = Math.Max(0, allRegvPositions[i] - 0.05f); if (RegulValves[i].IsCoax)
float hi = Math.Min(100.0f, allRegvPositions[i] + 0.05f); {
rvPosOps.Add(RegulValves[i].SetRegulValvePositionOp(lo, hi, 60)); rvPosOps.Add(RegulValves[i].SetRegulValvePositionOp(allRegvPositions[i], allRegvPositions[i], 60));
rvPosStr.Add(string.Format("RV{0}.SetRegulValvePositionOp({1}, {2}, 60s)", i, lo, hi)); rvPosStr.Add(string.Format("RV{0}.SetRegulValvePositionOp({1}, {1}, 60s)", i, allRegvPositions[i]));
}
else
{
float lo = Math.Max(0, allRegvPositions[i] - 0.05f);
float hi = Math.Min(100.0f, allRegvPositions[i] + 0.05f);
rvPosOps.Add(RegulValves[i].SetRegulValvePositionOp(lo, hi, 60));
rvPosStr.Add(string.Format("RV{0}.SetRegulValvePositionOp({1}, {2}, 60s)", i, lo, hi));
}
} }
} }
/// Max. one SetRegulValvePositionOp can be started or stopped in one sub-step. /// Max. one SetRegulValvePositionOp can be started or stopped in one sub-step.
/// Therefore SetRegulValvePositionOp operations are added and removed to subsequent states one by one. /// Therefore SetRegulValvePositionOp operations are added and removed to subsequent states one by one.
int delay = Math.Max(2, step.Duration - rvPosOps.Count + 2); int delay = Math.Max(2, step.Duration - rvPosOps.Count + 2);
bool stopFlag = false;
bool errorFlag = false;
/// ///
int lastStartedRV = -1; int lastStartedRV = -1;
@ -383,7 +398,7 @@ namespace TBF.BenchControl.Sequences
} }
/// Max. valaue of lastStartedRV after exitting the loop is (rvPosOps.Count - 1) /// Max. valaue of lastStartedRV after exitting the loop is (rvPosOps.Count - 1)
if (!(stopFlag || errorFlag)) if (!stopFlag && !errorFlag)
{ {
log.DebugFormat("SequenceBase.Transition() : Step {0} delay {1}s, opening={2}, closing={3}", step.ItemNr + 1, delay, step.ValvesOpen, step.ValvesClose); log.DebugFormat("SequenceBase.Transition() : Step {0} delay {1}s, opening={2}, closing={3}", step.ItemNr + 1, delay, step.ValvesOpen, step.ValvesClose);
State stepDelay = State State stepDelay = State
@ -446,32 +461,42 @@ namespace TBF.BenchControl.Sequences
if (e.Contains(Event.UiCmdStop)) { stopFlag = true; } if (e.Contains(Event.UiCmdStop)) { stopFlag = true; }
} }
if (errorFlag) return Event.Error; if (errorFlag || stopFlag) break;
if (stopFlag) return Event.UiCmdStop;
} }
Bridge.OnMessage(this, string.Empty); /// Clear the last step message
} }
if (context == TransitionContext.AfterTest) if (context == TransitionContext.Stop || errorFlag || stopFlag)
{ {
/// ///
/// Stop the pump at the end of test /// Stop the pump at the end of test
/// ///
foreach (var fmPump in PumpsWithFM) fmPump.TurnOff(); foreach (var fmPump in PumpsWithFM) fmPump.TurnOff();
State.Create("SequenceBase : Test(s) completed -> Stopping the pump")
.AddOperation(checkUiOp) if (inPath != null)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
.EnterState();
do
{ {
e = StateMachine.WaitRunDevsRunOps(); State.Create("SequenceBase.Transition() : Test stopped -> Stopping the pump")
if (e.Contains(Event.Error)) return Event.Error; .AddOperation(checkUiOp)
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) return Event.Error;
}
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
} }
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
} }
return Event.Done; if (errorFlag)
return Event.Error;
else if (stopFlag)
return Event.UiCmdStop;
else
return Event.Done;
} }

View File

@ -377,7 +377,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -147,7 +147,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -496,7 +496,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -592,7 +592,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -620,7 +620,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -591,7 +591,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -347,7 +347,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -533,7 +533,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -399,9 +399,9 @@ namespace TBF.BenchControl.TestMethods.LeakTest
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
} }

View File

@ -315,7 +315,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }

View File

@ -410,9 +410,9 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
/// Transition sequence at the end of test /// Transition sequence at the end of test
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier /// Prevent overwriting 'retVal' in case it was set to non-default value earlier
switch (Transition(transitionAfter, TransitionContext.AfterTest)) switch (Transition(transitionAfter, (retVal == Event.Done) ? TransitionContext.AfterTest : TransitionContext.Stop))
{ {
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
} }

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("2.1.190.1")] [assembly: AssemblyVersion("2.1.210.1")]
[assembly: AssemblyFileVersion("2.1.190.1")] [assembly: AssemblyFileVersion("2.1.210.1")]