diff --git a/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs b/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs index cacbc5d7e..d64c51dc6 100644 --- a/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs +++ b/TestBenchFramework/BenchControl/Elde/ControlBoardDev.cs @@ -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 }; diff --git a/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs b/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs index 49d42a9b0..ff9a6b4f0 100644 --- a/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs +++ b/TestBenchFramework/BenchControl/Elde/PumpWithFM/Pump.cs @@ -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 { /// /// 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 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); + } + + /// /// The currently running operation. /// public enum CurrentOp { None, + TurnOnDfltPower, TurnOn, TurnOff, } @@ -74,17 +90,28 @@ namespace TBF.BenchControl.Elde.PumpWithFM /// /// Turn the pump frequency inverter on. /// - public IOperation TurnOn() + public IOperation TurnOnDfltPowerOp() { if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); - currentOp = CurrentOp.TurnOn; + currentOp = CurrentOp.TurnOnDfltPower; return this; } + /// + /// Turn the pump frequency inverter on. + /// + public IOperation TurnOnOp(float powerArg) + { + if (currentOp != CurrentOp.None) throw new Exception("Sequence error"); + currentOp = CurrentOp.TurnOn; + powerForOp = powerArg; + return this; + } + /// /// Turn the pump frequency inverter on. /// - 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; } } diff --git a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs index e698020cc..5fc9da5dc 100644 --- a/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs +++ b/TestBenchFramework/BenchControl/Elde/RegisterReader/RegisterReader.cs @@ -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"); diff --git a/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs b/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs index 1f268054e..3feecf7bd 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/IPumpFM.cs @@ -8,14 +8,35 @@ namespace TBF.BenchControl.GenericDevices /// public interface IPumpFM : IPump { - /// - /// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %) + /// + /// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %) + /// + void TurnOnDfltPower(); + + /// + /// Turns the frequency inverter on using 'power' argument (0 .. 100.0f %) + /// + void TurnOn(float power); + + /// + /// Turns the frequency inverter off + /// + void TurnOff(); + + + /// + /// Turns the frequency inverter on using the test parameter 'Power' (0 .. 100.0f %) + /// + IOperation TurnOnDfltPowerOp(); + + /// + /// Turns the frequency inverter on using 'power' argument (0 .. 100.0f %) /// - IOperation TurnOn(); + IOperation TurnOnOp(float power); /// /// Turns the frequency inverter off /// - IOperation TurnOff(); + IOperation TurnOffOp(); } } diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index 683886ea3..b2ba7cda3 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -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); diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs index a1baa8889..2f7ae23a0 100644 --- a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -24,6 +24,7 @@ namespace TBF.BenchControl.Sequences public static BenchId.Component BenchId; public static IList FlowMeters; /// list of reference flowmeters public static IList RegulValves; /// list of regulation valves + public static IList PumpsWithFM; /// list of FM controlled pumps public static IList WaterMeters; /// list of water meters public static IList 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 rvPosOperations = new List(); 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(); diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs index 42ef6cd27..e476d0e8f 100644 --- a/TestBenchFramework/BenchControl/StateMachine.cs +++ b/TestBenchFramework/BenchControl/StateMachine.cs @@ -198,6 +198,7 @@ namespace TBF.BenchControl IList balances = new List(); SequenceBase.FlowMeters = new List(); SequenceBase.RegulValves = new List(); + SequenceBase.PumpsWithFM = new List(); SequenceBase.WaterMeters = new List(); SequenceBase.Cameras = new List(); 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); } } diff --git a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs index a3903b46f..10294ff9b 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CameraRoiDetection/RoiDetectionSeq.cs @@ -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 diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs index 218b0f1ff..61df1f439 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedMeters/CombinedMetersSeq.cs @@ -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 diff --git a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 964937f1c..87109ae1b 100644 --- a/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -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 diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index de8bd33d6..ce72adf50 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -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 diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 35a60e8c0..e2b45fb5b 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -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 diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs index 1df12fe3d..ba7767a80 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -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 diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs index accbd6889..451c9f208 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs @@ -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 diff --git a/TestBenchFramework/UiControls/TransitionStepsCtrl.cs b/TestBenchFramework/UiControls/TransitionStepsCtrl.cs index d8be74160..4831aa021 100644 --- a/TestBenchFramework/UiControls/TransitionStepsCtrl.cs +++ b/TestBenchFramework/UiControls/TransitionStepsCtrl.cs @@ -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) diff --git a/TestBenchFramework/Utils.cs b/TestBenchFramework/Utils.cs index f3b188420..370518eae 100644 --- a/TestBenchFramework/Utils.cs +++ b/TestBenchFramework/Utils.cs @@ -110,7 +110,7 @@ namespace TBF /// /// TransitionStep entity /// float[] of regulation valve positions from 0 to 100.0f - 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; } - } + + /// + /// Get an array of Pump-With-FM power percentages from a TransitionStep entity + /// + /// TransitionStep entity + /// float[] of FM-pump power percentages from 0 to 100.0f + 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; + } + } } diff --git a/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll b/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll index 708d80561..59759fa80 100644 Binary files a/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll and b/packages/ControlBoard/Fuzhou300/ControlComponent3U.dll differ