From 6eee83042b3d0ac86a9ca178846f09a4fdefe46d Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 8 Sep 2014 13:16:31 +0200 Subject: [PATCH] PmpWithFM and Transition sequences functionality implemented --- .../BenchControl/Elde/ControlBoardDev.cs | 21 ++++-- .../BenchControl/Elde/PumpWithFM/Pump.cs | 60 +++++++++++++----- .../Elde/RegisterReader/RegisterReader.cs | 3 - .../BenchControl/GenericDevices/IPumpFM.cs | 29 +++++++-- .../BenchControl/Sequences/MainSeq.cs | 4 ++ .../BenchControl/Sequences/SequenceBase.cs | 26 +++++++- .../BenchControl/StateMachine.cs | 13 ++-- .../CameraRoiDetection/RoiDetectionSeq.cs | 10 +-- .../CombinedMeters/CombinedMetersSeq.cs | 2 +- .../CombinedWithDetectionSeq.cs | 10 +-- .../FixedStartMassCollectionSeq.cs | 2 +- .../TestMethods/FlyingStart/FlyingStartSeq.cs | 2 +- .../FlyingStartCollectionMethodSeq.cs | 2 +- .../ReferenceFlowmeterCalibrationSeq.cs | 2 +- .../UiControls/TransitionStepsCtrl.cs | 8 ++- TestBenchFramework/Utils.cs | 36 ++++++++++- .../Fuzhou300/ControlComponent3U.dll | Bin 375808 -> 375808 bytes 17 files changed, 171 insertions(+), 59 deletions(-) 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 708d8056131ee2561bb494ce000356743f655268..59759fa807061ac0d5e314eed5f3b7650a8c0e36 100644 GIT binary patch delta 5415 zcmX}wd5|2{eFyN@b7*#V?&-OEX4S1-9oDWEUCU7d(=AqVWJOMugfT`obX$N$S>ZM@ zsFdkO;t&Y11(gAWQMXr#EaNy}Yz7~MZhRz^2{t7RiJU6BBO&ZqI3Nt6iYk$Be+Btt z-+sRD_xk;M)H83jYrkK&->-lD&gAWv=AXDb+ej~x64K<(eT_TzHKf75Mq=-+xsilO zC2q(IF|s2+IOpNSyWdNe)$#tab;%c`^5E3Eq&_Jv8JvGp@||*j>z&C;|9Cu1?Zz+@ z>+yKFC?529ZX_O-$8k?QY>eZhv7Wm#Io`iKj-7b8C7yd9!{DafN#)b$#kWzB78P(G zBC$PA+wX_#rzCl(JT%!pJ=fe3PbQl8Ob8+E$YIq)TKAXxHQB!Rpg!zLV#eU=Uh`?4_jIgdn_aIb4@t$r)bZroX=$jho=DD|n~gU+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