PmpWithFM and Transition sequences functionality implemented
This commit is contained in:
parent
d98762aaf8
commit
6eee83042b
@ -124,13 +124,20 @@ namespace TBF.BenchControl.Elde
|
||||
public void SetFMFreq(int index, float power)
|
||||
{
|
||||
#if FUZHOU300
|
||||
if (index == 0) FMFreq = new float[6] { power, 0, 0, 0, 0, 0 };
|
||||
else if (index == 1) FMFreq = new float[6] { 0, power, 0, 0, 0, 0 };
|
||||
else if (index == 2) FMFreq = new float[6] { 0, 0, power, 0, 0, 0 };
|
||||
else if (index == 3) FMFreq = new float[6] { 0, 0, 0, power, 0, 0 };
|
||||
else if (index == 4) FMFreq = new float[6] { 0, 0, 0, 0, power, 0 };
|
||||
else if (index == 5) FMFreq = new float[6] { 0, 0, 0, 0, 0, power };
|
||||
else FMFreq = new float[6] { 0, 0, 0, 0, 0, 0 };
|
||||
if ((FMFreq == null) || (FMFreq.Length != 6))
|
||||
{
|
||||
if (index == 0) FMFreq = new float[6] { power, 0, 0, 0, 0, 0 };
|
||||
else if (index == 1) FMFreq = new float[6] { 0, power, 0, 0, 0, 0 };
|
||||
else if (index == 2) FMFreq = new float[6] { 0, 0, power, 0, 0, 0 };
|
||||
else if (index == 3) FMFreq = new float[6] { 0, 0, 0, power, 0, 0 };
|
||||
else if (index == 4) FMFreq = new float[6] { 0, 0, 0, 0, power, 0 };
|
||||
else if (index == 5) FMFreq = new float[6] { 0, 0, 0, 0, 0, power };
|
||||
else FMFreq = new float[6] { 0, 0, 0, 0, 0, 0 };
|
||||
}
|
||||
else if(index >= 0 && index < 6)
|
||||
{
|
||||
FMFreq[index] = power;
|
||||
}
|
||||
#else
|
||||
if (index == 0) FMFreq = new float[2] { power, 0 };
|
||||
else if (index == 1) FMFreq = new float[2] { 0, power };
|
||||
|
||||
@ -4,7 +4,7 @@ using log4net;
|
||||
|
||||
namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
{
|
||||
public class Pump : Generic.IComponent, GenericDevices.IPumpFM, GenericDevices.IValve, IOperation
|
||||
public class Pump : ComponentBase, GenericDevices.IPumpFM, GenericDevices.IValve, IOperation
|
||||
{
|
||||
/// <summary>
|
||||
/// Info: StartMassMeasurement() and "Balance response = .., Mass = ..."
|
||||
@ -18,15 +18,12 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
private readonly PumpCfg pumpCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return pumpCfg; } }
|
||||
|
||||
public string Name { get { return pumpCfg.Name; } }
|
||||
|
||||
public int Delay { get { return pumpCfg.Delay; } }
|
||||
public int Delay { get { return (Cfg as PumpCfg).Delay; } }
|
||||
|
||||
public ValveCategory Category { get { return ValveCategory.Feeding; } } /// Pump category is Feeding
|
||||
|
||||
public float Power { get { return (TestParams is FMPumpTestParams) ? (TestParams as FMPumpTestParams).Power : 0; } }
|
||||
|
||||
public GenericDevices.IValve CoupledTo { get { return null; } }
|
||||
public bool InvertCouple { get { return false; } }
|
||||
public int LagOpening { get { return 0; } }
|
||||
@ -34,7 +31,7 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly int bitPosition; /// 0 .. 63
|
||||
int FMIndex; /// 0 .. FMPumpsCount-1
|
||||
int FMIndex; /// 0 .. FMPumpsCount-1
|
||||
|
||||
public readonly ulong Mask; /// derived from bitPosition in the constructor
|
||||
|
||||
@ -43,11 +40,12 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
get { return (controlBoard.Route & Mask) != 0; }
|
||||
}
|
||||
|
||||
public float powerForOp;
|
||||
|
||||
public Pump(PumpCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.pumpCfg = cfg;
|
||||
|
||||
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
@ -59,12 +57,30 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
public void TurnOnDfltPower()
|
||||
{
|
||||
controlBoard.SetFMFreq(FMIndex, Power);
|
||||
}
|
||||
|
||||
public void TurnOn(float powerArg)
|
||||
{
|
||||
controlBoard.SetFMFreq(FMIndex, powerArg);
|
||||
}
|
||||
|
||||
public void TurnOff()
|
||||
{
|
||||
controlBoard.SetFMFreq(FMIndex, 0.0f);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The currently running operation.
|
||||
/// </summary>
|
||||
public enum CurrentOp
|
||||
{
|
||||
None,
|
||||
TurnOnDfltPower,
|
||||
TurnOn,
|
||||
TurnOff,
|
||||
}
|
||||
@ -74,17 +90,28 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
/// <summary>
|
||||
/// Turn the pump frequency inverter on.
|
||||
/// </summary>
|
||||
public IOperation TurnOn()
|
||||
public IOperation TurnOnDfltPowerOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.TurnOn;
|
||||
currentOp = CurrentOp.TurnOnDfltPower;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turn the pump frequency inverter on.
|
||||
/// </summary>
|
||||
public IOperation TurnOnOp(float powerArg)
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.TurnOn;
|
||||
powerForOp = powerArg;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turn the pump frequency inverter on.
|
||||
/// </summary>
|
||||
public IOperation TurnOff()
|
||||
public IOperation TurnOffOp()
|
||||
{
|
||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||
currentOp = CurrentOp.TurnOff;
|
||||
@ -96,12 +123,15 @@ namespace TBF.BenchControl.Elde.PumpWithFM
|
||||
{
|
||||
switch (currentOp)
|
||||
{
|
||||
case CurrentOp.TurnOn:
|
||||
controlBoard.SetFMFreq(FMIndex, 50.0f);
|
||||
case CurrentOp.TurnOnDfltPower:
|
||||
TurnOnDfltPower();
|
||||
return;
|
||||
case CurrentOp.TurnOn:
|
||||
TurnOn(powerForOp);
|
||||
return;
|
||||
case CurrentOp.TurnOff:
|
||||
default:
|
||||
controlBoard.SetFMFreq(FMIndex, 0.0f);
|
||||
TurnOff();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,8 +19,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
RegisterReaderCfg registerReaderCfg;
|
||||
|
||||
public float PulsesPerLtr
|
||||
{
|
||||
get
|
||||
@ -37,7 +35,6 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.registerReaderCfg = cfg;
|
||||
|
||||
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
@ -8,14 +8,35 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// </summary>
|
||||
public interface IPumpFM : IPump
|
||||
{
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %)
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %)
|
||||
/// </summary>
|
||||
void TurnOnDfltPower();
|
||||
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter on using 'power' argument (0 .. 100.0f %)
|
||||
/// </summary>
|
||||
void TurnOn(float power);
|
||||
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter off
|
||||
/// </summary>
|
||||
void TurnOff();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %)
|
||||
/// </summary>
|
||||
IOperation TurnOnDfltPowerOp();
|
||||
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter on using 'power' argument (0 .. 100.0f %)
|
||||
/// </summary>
|
||||
IOperation TurnOn();
|
||||
IOperation TurnOnOp(float power);
|
||||
|
||||
/// <summary>
|
||||
/// Turns the frequency inverter off
|
||||
/// </summary>
|
||||
IOperation TurnOff();
|
||||
IOperation TurnOffOp();
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,6 +205,8 @@ namespace TBF.BenchControl.Sequences
|
||||
ISequence testMethodSequence = TbfComponents.FindComponent(test.Method) as ISequence;
|
||||
if (testMethodSequence != null)
|
||||
{
|
||||
StateMachine.LoadTestParams(test);
|
||||
|
||||
//--------------------------------------------------------------
|
||||
e = testMethodSequence.Execute(test);
|
||||
|
||||
@ -236,6 +238,8 @@ namespace TBF.BenchControl.Sequences
|
||||
ISequence testMethodSequence = TbfComponents.FindComponent(test.Method) as ISequence;
|
||||
if (testMethodSequence != null)
|
||||
{
|
||||
StateMachine.LoadTestParams(test);
|
||||
|
||||
//--------------------------------------------------------------
|
||||
e = testMethodSequence.Execute(test);
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ namespace TBF.BenchControl.Sequences
|
||||
public static BenchId.Component BenchId;
|
||||
public static IList<IFlowMeter> FlowMeters; /// list of reference flowmeters
|
||||
public static IList<IRegulValve> RegulValves; /// list of regulation valves
|
||||
public static IList<IPumpFM> PumpsWithFM; /// list of FM controlled pumps
|
||||
public static IList<IWaterMeter> WaterMeters; /// list of water meters
|
||||
public static IList<ICamera> Cameras; /// list of cameras
|
||||
|
||||
@ -394,8 +395,27 @@ namespace TBF.BenchControl.Sequences
|
||||
Bridge.OnActivity(this, string.Format(message, transitionSequence.Name, step.ItemNr + 1, stepsCount));
|
||||
//------------------------------------------------
|
||||
|
||||
/// Get new regulation valve positions and calculate the number of valves to change
|
||||
float[] allFMPumpPcts = Utils.GetPumpWithFMPcts(step);
|
||||
for (int i = 0; i < allFMPumpPcts.Length; i++)
|
||||
{
|
||||
float pwr = allFMPumpPcts[i];
|
||||
if (pwr > 0) /// Negative value means no power change
|
||||
{
|
||||
PumpsWithFM[i].TurnOn(pwr);
|
||||
}
|
||||
else if (pwr == 0)
|
||||
{
|
||||
PumpsWithFM[i].TurnOff();
|
||||
}
|
||||
else if (pwr == -2)
|
||||
{
|
||||
PumpsWithFM[i].TurnOnDfltPower();
|
||||
}
|
||||
}
|
||||
|
||||
/// Get new regulation valve positions and calculate the number of valves to change
|
||||
float[] allRegvPositions = Utils.RegulValvesPositions(step);
|
||||
float[] allRegvPositions = Utils.GetRegulValvesPositions(step);
|
||||
///
|
||||
IList<IOperation> rvPosOperations = new List<IOperation>();
|
||||
for (int i = 0; i < allRegvPositions.Length; i++)
|
||||
@ -472,10 +492,10 @@ namespace TBF.BenchControl.Sequences
|
||||
///
|
||||
/// Stop the pump at the end of test
|
||||
///
|
||||
StateMachine.ControlBoard.SetFMFreq(-1, 0); /// Stop FM controlled pumps
|
||||
foreach (var fmPump in PumpsWithFM) fmPump.TurnOff();
|
||||
State.Create("SequenceBase : Test(s) completed -> Stopping the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
|
||||
@ -198,6 +198,7 @@ namespace TBF.BenchControl
|
||||
IList<IBalance> balances = new List<IBalance>();
|
||||
SequenceBase.FlowMeters = new List<IFlowMeter>();
|
||||
SequenceBase.RegulValves = new List<IRegulValve>();
|
||||
SequenceBase.PumpsWithFM = new List<IPumpFM>();
|
||||
SequenceBase.WaterMeters = new List<IWaterMeter>();
|
||||
SequenceBase.Cameras = new List<ICamera>();
|
||||
ulong valvesToInvert = 0;
|
||||
@ -207,7 +208,8 @@ namespace TBF.BenchControl
|
||||
if (cmpnt is BenchId.Component) SequenceBase.BenchId = cmpnt as BenchId.Component;
|
||||
if (cmpnt is IFlowMeter) SequenceBase.FlowMeters.Add(cmpnt as IFlowMeter);
|
||||
if (cmpnt is IRegulValve) SequenceBase.RegulValves.Add(cmpnt as IRegulValve);
|
||||
if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter);
|
||||
if (cmpnt is IPumpFM) SequenceBase.PumpsWithFM.Add(cmpnt as IPumpFM);
|
||||
if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter);
|
||||
if (cmpnt is ICamera) SequenceBase.Cameras.Add(cmpnt as ICamera);
|
||||
if (cmpnt is GenericDevices.IAmbient) Ambient = cmpnt as GenericDevices.IAmbient;
|
||||
if (cmpnt is IBalance)
|
||||
@ -317,14 +319,7 @@ namespace TBF.BenchControl
|
||||
{
|
||||
foreach (var cmpnt in components)
|
||||
{
|
||||
if (cmpnt is ComponentBase)
|
||||
{
|
||||
if (cmpnt.Cfg.Name.Equals("ROI2"))
|
||||
{
|
||||
int a = 5;
|
||||
}
|
||||
(cmpnt as ComponentBase).GetProcedureParams(procedure);
|
||||
}
|
||||
if (cmpnt is ComponentBase) (cmpnt as ComponentBase).GetProcedureParams(procedure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
//------------------------------------------------
|
||||
State.Create("RoiDetection : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
@ -112,7 +112,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
//------------------------------------------------
|
||||
State.Create("RoiDetection : Stopping the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
|
||||
.EnterState();
|
||||
do
|
||||
@ -143,7 +143,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
State.Create("RoiDetection : Detection of ROI-s completed -> Stopping the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -168,7 +168,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps
|
||||
State.Create("RoiDetection : User selected STOP -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
@ -187,7 +187,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps
|
||||
State.Create("RoiDetection : ERROR -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
//------------------------------------------------
|
||||
State.Create("CombinedMeters : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -117,7 +117,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create("CombinedWithDetection : Start the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
@ -480,7 +480,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
//------------------------------------------------
|
||||
State.Create(Strings.Stop_the_pump)
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
@ -615,7 +615,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
State.Create("CombinedWithDetection : Test(s) completed -> Stopping the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -640,7 +640,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
|
||||
State.Create("CombinedWithDetection : User selected STOP -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
@ -658,7 +658,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
error:
|
||||
State.Create("close_before_error")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOffOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStart : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
//------------------------------------------------
|
||||
State.Create("FlyingStartCollectionMethod : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
||||
//------------------------------------------------
|
||||
State.Create("ReferenceFlowmeterCalibration : Starting the pump")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOn() : null)
|
||||
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOnDfltPowerOp() : null)
|
||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||
.EnterState();
|
||||
do
|
||||
|
||||
@ -219,7 +219,13 @@ namespace TBF.UiControls
|
||||
{
|
||||
fmPumpsPcts += lviSubitText;
|
||||
}
|
||||
else if(Utils.TryParseUFloat(lviSubitText, out fdummy) && (fdummy >= 0) && (fdummy <= 100.0f))
|
||||
else if (lviSubitText.Equals("Dflt"))
|
||||
{
|
||||
fmPumpsPcts += lviSubitText;
|
||||
if (valvesOpen != string.Empty) valvesOpen += ";";
|
||||
valvesOpen += valve.Cfg.Name;
|
||||
}
|
||||
else if (Utils.TryParseUFloat(lviSubitText, out fdummy) && (fdummy >= 0) && (fdummy <= 100.0f))
|
||||
{
|
||||
fmPumpsPcts += lviSubitText;
|
||||
if (fdummy > 0)
|
||||
|
||||
@ -110,7 +110,7 @@ namespace TBF
|
||||
/// </summary>
|
||||
/// <param name="entity">TransitionStep entity</param>
|
||||
/// <returns>float[] of regulation valve positions from 0 to 100.0f</returns>
|
||||
public static float[] RegulValvesPositions(Entities.TransitionStep step)
|
||||
public static float[] GetRegulValvesPositions(Entities.TransitionStep step)
|
||||
{
|
||||
int regvCount = BenchControl.Sequences.SequenceBase.RegulValves.Count;
|
||||
float[] result = new float[regvCount];
|
||||
@ -132,5 +132,37 @@ namespace TBF
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get an array of Pump-With-FM power percentages from a TransitionStep entity
|
||||
/// </summary>
|
||||
/// <param name="entity">TransitionStep entity</param>
|
||||
/// <returns>float[] of FM-pump power percentages from 0 to 100.0f</returns>
|
||||
public static float[] GetPumpWithFMPcts(Entities.TransitionStep step)
|
||||
{
|
||||
int fmPumpCount = BenchControl.Sequences.SequenceBase.PumpsWithFM.Count;
|
||||
float[] result = new float[fmPumpCount];
|
||||
|
||||
string[] rvPosStr = (step.PumpWithFMPcts != null) ? step.PumpWithFMPcts.Split(new char[] { ';' }) : new string[0];
|
||||
for (int i = 0; i < fmPumpCount; i++)
|
||||
{
|
||||
float fdummy;
|
||||
if ((i < rvPosStr.Length) && Utils.TryParseUFloat(rvPosStr[i], out fdummy) &&
|
||||
(fdummy >= 0) && (fdummy <= 100.0f))
|
||||
{
|
||||
result[i] = fdummy;
|
||||
}
|
||||
else if (rvPosStr[i].Equals("Dflt"))
|
||||
{
|
||||
result[i] = -2.0f; /// This value means default pump power defined by the Test parameter
|
||||
}
|
||||
else //if (rvPosStr[i].Equals("---"))
|
||||
{
|
||||
result[i] = -1.0f; /// This value means no pump power change
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user