diff --git a/TBF/BenchControl/ControlBoard/Legacy/ControlBoardDev.cs b/TBF/BenchControl/ControlBoard/Legacy/ControlBoardDev.cs index f2d5c8f2f..e952b0455 100644 --- a/TBF/BenchControl/ControlBoard/Legacy/ControlBoardDev.cs +++ b/TBF/BenchControl/ControlBoard/Legacy/ControlBoardDev.cs @@ -614,7 +614,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy /// Valve regulation mode, see the enum /// Target position or target frequency or pulse duration /// Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec. - public void ValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue, int stableTime) + public void ValveMove(int valveNo, RegulValveMode valveMode, double[] valveValue, int stableTime) { controlCom.ValveMove(valveNo, valveMode, valveValue, stableTime); } diff --git a/TBF/BenchControl/ControlBoard/Legacy/ControlComSim.cs b/TBF/BenchControl/ControlBoard/Legacy/ControlComSim.cs index 38f15edee..5f42580c3 100644 --- a/TBF/BenchControl/ControlBoard/Legacy/ControlComSim.cs +++ b/TBF/BenchControl/ControlBoard/Legacy/ControlComSim.cs @@ -128,7 +128,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy /// int regulValveNo; RegulValveMode regulValveMode; - float[] regulValveValue; + double[] regulValveValue; Random rand; @@ -255,7 +255,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy /// ??? /// ??? /// Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec. - public void ValveMove(int regulValveNo, RegulValveMode regulValveMode, float[] regulValveValue, int stableTime) + public void ValveMove(int regulValveNo, RegulValveMode regulValveMode, double[] regulValveValue, int stableTime) { log.InfoFormat("ValveMove({0}, {1}, [{2},{3}], {4})", regulValveNo, regulValveMode, regulValveValue[0], regulValveValue[1], stableTime); @@ -298,7 +298,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy switch (regulValveMode) { case RegulValveMode.TargetFrequency: - float targetFlow = ((regulValveValue[0] + regulValveValue[1]) / 2.0f) * (Qnom / 2000.0f); + double targetFlow = ((regulValveValue[0] + regulValveValue[1]) / 2.0) * (Qnom / 2000.0); TestBenchSim.UpdateSimFlow(targetFlow); //if (referenceFreq < valveValue[0]) referenceFreq += ((float)rand.Next(20) + 10.0f) / 2.0f; diff --git a/TBF/BenchControl/ControlBoard/Legacy/IControlCom.cs b/TBF/BenchControl/ControlBoard/Legacy/IControlCom.cs index 520c18056..21c22e30a 100644 --- a/TBF/BenchControl/ControlBoard/Legacy/IControlCom.cs +++ b/TBF/BenchControl/ControlBoard/Legacy/IControlCom.cs @@ -76,7 +76,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy /// ??? /// ??? /// Stabilization time when setting the flow: 0=200ms, step 50ms, max. 1.5 sec. - void ValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue, int stableTime); + void ValveMove(int valveNo, RegulValveMode valveMode, double[] valveValue, int stableTime); void RunDeviceBefore(); void RunDeviceAfter(); diff --git a/TBF/BenchControl/ControlBoard/Legacy/StartMeasurementOp.cs b/TBF/BenchControl/ControlBoard/Legacy/StartMeasurementOp.cs index 70fa21499..ad3c9e6bf 100644 --- a/TBF/BenchControl/ControlBoard/Legacy/StartMeasurementOp.cs +++ b/TBF/BenchControl/ControlBoard/Legacy/StartMeasurementOp.cs @@ -14,7 +14,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy /// Set by the constructor readonly CBoard controlBoard; - readonly IRegulValve regulValve; + readonly IRegValve regulValve; readonly int regulValveNr; readonly int regulValveStableTime; readonly int flowMeterNr; @@ -208,13 +208,13 @@ namespace TBF.BenchControl.ControlBoard.Legacy if (regulValve.IsCoax) { controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)((freqLo + freqHi) / 2), (float)((freqLo + freqHi) / 2) }, + new double[2] { (freqLo + freqHi) / 2, (freqLo + freqHi) / 2 }, regulValveStableTime); } else { controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)freqLo, (float)freqHi }, + new double[2] { freqLo, freqHi }, regulValveStableTime); } diff --git a/TBF/BenchControl/ControlBoard/Legacy/TestBenchSim.cs b/TBF/BenchControl/ControlBoard/Legacy/TestBenchSim.cs index 67851c71d..d6963bac3 100644 --- a/TBF/BenchControl/ControlBoard/Legacy/TestBenchSim.cs +++ b/TBF/BenchControl/ControlBoard/Legacy/TestBenchSim.cs @@ -754,10 +754,10 @@ namespace TBF.BenchControl.ControlBoard.Legacy /// /// Target flow [m3/h] /// Nominal flow of the path [m3/h] - public static void UpdateSimFlow(float targetFlow) + public static void UpdateSimFlow(double targetFlow) { - float A = 0.7f; /// higher value -> slower regulation - float B = 1.0f - A; + double A = 0.7; /// higher value -> slower regulation + double B = 1.0 - A; switch (regulValveNo) { diff --git a/TBF/BenchControl/ControlBoard/Uni/GeneralData.cs b/TBF/BenchControl/ControlBoard/Uni/GeneralData.cs index 668fd5d96..c38527843 100644 --- a/TBF/BenchControl/ControlBoard/Uni/GeneralData.cs +++ b/TBF/BenchControl/ControlBoard/Uni/GeneralData.cs @@ -90,7 +90,11 @@ namespace TBF.BenchControl.ControlBoard.Uni /// A/D converters: Feedback from RV-s and diverters for (int i = 0; i < Const.ADCsCount; i++) /// Byte 25 .. 56 { - AnalogInput[15 - i] = GetInt16(data, offs + (int)Poz.Analogy + 2 * i); +#if DEBUG + AnalogInput[Const.ADCsCount - 1 - i] = (short)(11 * (15 - i)); +#else + AnalogInput[Const.ADCsCount - 1 - i] = GetInt16(data, offs + (int)Poz.Analogy + 2 * i); +#endif } /// Groch temperature meters diff --git a/TBF/BenchControl/ControlBoard/Uni/UniCB.cs b/TBF/BenchControl/ControlBoard/Uni/UniCB.cs index 949ee0e2f..881f7d6f1 100644 --- a/TBF/BenchControl/ControlBoard/Uni/UniCB.cs +++ b/TBF/BenchControl/ControlBoard/Uni/UniCB.cs @@ -138,7 +138,7 @@ namespace TBF.BenchControl.ControlBoard.Uni OutputPath devices; IFlowMeter flowMeter { get { return devices.FlowMeter; } } - IRegulValve regValve { get { return devices.RegValve; } } + IRegValve regValve { get { return devices.RegValve; } } IDiverter diverter { get { return devices.Diverter; } } diff --git a/TBF/BenchControl/Dummy/RegulValve/ChangeValvePositionOp.cs b/TBF/BenchControl/Dummy/RegulValve/ChangeValvePositionOp.cs index 2c2b9b653..95e82a461 100644 --- a/TBF/BenchControl/Dummy/RegulValve/ChangeValvePositionOp.cs +++ b/TBF/BenchControl/Dummy/RegulValve/ChangeValvePositionOp.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2017 Sensus Metering Systems +/// Copyright (c) 2017-2021 Sensus Slovensko a.s. /// using System; using log4net; @@ -16,7 +16,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Set by the constructor readonly RegulValve regulValve; - readonly float timePulseSec; + readonly double timePulseSec; /// /// Set required water flow. @@ -28,7 +28,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public ChangeRegulValvePositionOp(RegulValve regulValve, float timePulseSec) + public ChangeRegulValvePositionOp(RegulValve regulValve, double timePulseSec) { this.regulValve = regulValve as RegulValve; if (this.regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); diff --git a/TBF/BenchControl/Dummy/RegulValve/RegulValve.cs b/TBF/BenchControl/Dummy/RegulValve/RegulValve.cs index 61c17cf7b..5c7c8b250 100644 --- a/TBF/BenchControl/Dummy/RegulValve/RegulValve.cs +++ b/TBF/BenchControl/Dummy/RegulValve/RegulValve.cs @@ -8,7 +8,7 @@ using TBF.Boxes; namespace TBF.BenchControl.Dummy.RegulValve { - public class RegulValve : ComponentBase, IDevice, GenericDevices.IRegulValve, SchematicDrawing.IDrawingItCmpnt + public class RegulValve : ComponentBase, IDevice, GenericDevices.IRegValve, SchematicDrawing.IDrawingItCmpnt { private static readonly ILog log = LogManager.GetLogger(typeof(RegulValve)); public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(1)); } @@ -20,11 +20,11 @@ namespace TBF.BenchControl.Dummy.RegulValve /// public bool IsCoax { get { return false; } } - public float Position { get { return 50.0f; } } + public double Position { get { return 50.0; } } - IDictionary dict; - public IDictionary Dict { get { return dict; } } + IDictionary dict; + public IDictionary Dict { get { return dict; } } public RegulValve() @@ -35,7 +35,7 @@ namespace TBF.BenchControl.Dummy.RegulValve : base(cfg) { RegulValveCfg = cfg as RegulValveCfg; - dict = new Dictionary(); + dict = new Dictionary(); log.Warn(this.ToString()); } @@ -86,12 +86,12 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Lower limit of the required valve position in [%] /// Higher limit of the required valve position in [%] /// SetPositionOp instance - public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs) + public IOperation SetRegulValvePositionOp(double pctLo, double pctHi, int timeoutMs) { return new SetRegulValvePositionOp(this, pctLo, pctHi, timeoutMs); } - public IOperation ChangeRegulValvePositionOp(float timePulseSec) + public IOperation ChangeRegulValvePositionOp(double timePulseSec) { return new ChangeRegulValvePositionOp(this, timePulseSec); } diff --git a/TBF/BenchControl/Dummy/RegulValve/SetFlowOp.cs b/TBF/BenchControl/Dummy/RegulValve/SetFlowOp.cs index d3dfc5f57..860a8efa3 100644 --- a/TBF/BenchControl/Dummy/RegulValve/SetFlowOp.cs +++ b/TBF/BenchControl/Dummy/RegulValve/SetFlowOp.cs @@ -47,7 +47,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Timeout for the flow setting in [s] /// true = Leave the measurement running after op. stop /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetFlowOp(IRegulValve regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, + public SetFlowOp(IRegValve regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout, bool leaveMeasurementRunning) { this.regulValve = regulValve as RegulValve; @@ -72,7 +72,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Set required water flow - Do not leave the measurement running. /// Events: FlowSet /// - public SetFlowOp(IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout) + public SetFlowOp(IRegValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout) : this(regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, false) { } @@ -81,7 +81,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Set required water flow - No timeout. /// Events: FlowSet /// - public SetFlowOp(IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow) + public SetFlowOp(IRegValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow) : this(regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, int.MaxValue, false) { } diff --git a/TBF/BenchControl/Dummy/RegulValve/SetRegulValvePositionOp.cs b/TBF/BenchControl/Dummy/RegulValve/SetRegulValvePositionOp.cs index 3e4f7e560..dd057f754 100644 --- a/TBF/BenchControl/Dummy/RegulValve/SetRegulValvePositionOp.cs +++ b/TBF/BenchControl/Dummy/RegulValve/SetRegulValvePositionOp.cs @@ -16,8 +16,6 @@ namespace TBF.BenchControl.Dummy.RegulValve return string.Format("SetRegulValvePositionOp({0},{1},{2})", regulValve.Name, posLoPct, posHiPct); } - const int CoaxValveNr = 7; /// Coax. valve has number 7 - /// /// Internal states of this operation /// @@ -32,8 +30,8 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Set by the constructor readonly RegulValve regulValve; - readonly float posLoPct; - readonly float posHiPct; + readonly double posLoPct; + readonly double posHiPct; readonly int timeout; /// Process values @@ -51,7 +49,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetRegulValvePositionOp(RegulValve regulValve, float posLoPct, float posHiPct, int timeout) + public SetRegulValvePositionOp(RegulValve regulValve, double posLoPct, double posHiPct, int timeout) { this.regulValve = regulValve as RegulValve; if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); @@ -68,7 +66,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// Set required water flow - no timeout. /// Events: FlowSet /// - public SetRegulValvePositionOp(RegulValve regValve, float posLoPct, float posHiPct) + public SetRegulValvePositionOp(RegulValve regValve, double posLoPct, double posHiPct) : this(regValve, posLoPct, posHiPct, int.MaxValue) { } diff --git a/TBF/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs b/TBF/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs index f4926e38d..3421cd585 100644 --- a/TBF/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs +++ b/TBF/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs @@ -20,7 +20,7 @@ namespace TBF.BenchControl.Elde.RegulValve readonly TBF.BenchControl.ControlBoard.Legacy.CBoard controlBoard; readonly RegulValve regulValve; readonly int regulValveNr; - readonly float timePulseSec; + readonly double timePulseSec; /// /// Set required water flow. @@ -32,7 +32,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public ChangeRegulValvePositionOp(TBF.BenchControl.ControlBoard.IControlBoard cb, RegulValve rv, float timePulseSec) + public ChangeRegulValvePositionOp(TBF.BenchControl.ControlBoard.IControlBoard cb, RegulValve rv, double timePulseSec) { controlBoard = cb as TBF.BenchControl.ControlBoard.Legacy.CBoard; if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); @@ -54,7 +54,7 @@ namespace TBF.BenchControl.Elde.RegulValve controlBoard.ValveMove(regulValveNr, TBF.BenchControl.ControlBoard.Legacy.RegulValveMode.PulseWidth, - new float[2] { timePulseSec, timePulseSec }, + new double[2] { timePulseSec, timePulseSec }, regulValve.StableTime); } diff --git a/TBF/BenchControl/Elde/RegulValve/RegulValve.cs b/TBF/BenchControl/Elde/RegulValve/RegulValve.cs index 4b1927dfb..fe063740d 100644 --- a/TBF/BenchControl/Elde/RegulValve/RegulValve.cs +++ b/TBF/BenchControl/Elde/RegulValve/RegulValve.cs @@ -11,7 +11,7 @@ using TBF.Boxes; namespace TBF.BenchControl.Elde.RegulValve { - public class RegulValve : ComponentBase, IDevice, GenericDevices.IRegulValve, IDrawingItCmpntWithSetpoint + public class RegulValve : ComponentBase, IDevice, GenericDevices.IRegValve, IDrawingItCmpntWithSetpoint { private static readonly ILog log = LogManager.GetLogger(typeof(RegulValve)); public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(1)); } @@ -20,8 +20,8 @@ namespace TBF.BenchControl.Elde.RegulValve public readonly RegulValveCfg RegulValveCfg; public IDrawingItem DrawingItem { get { return RegulValveCfg as IDrawingItem; } } - IDictionary dict; - public IDictionary Dict { get { return dict; } } + IDictionary dict; + public IDictionary Dict { get { return dict; } } public readonly CBoard ControlBoard; @@ -34,7 +34,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// public bool IsCoax { get { return false; } } /// - public float Position { get { return ControlBoard.RValvePosition(Idx1); } } + public double Position { get { return ControlBoard.RValvePosition(Idx1); } } /// public double SetpointVal { @@ -81,13 +81,13 @@ namespace TBF.BenchControl.Elde.RegulValve } else if (args.Command == CfgChangeCmd.RVOpenStep) { - ControlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new float[2] { 2.0f, 2.0f }, StableTime); + ControlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new double[2] { 2.0, 2.0 }, StableTime); // TODO: avoid conflicts // TOTEST } else if (args.Command == CfgChangeCmd.RVCloseStep) { - ControlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new float[2] { -2.0f, -2.0f }, StableTime); + ControlBoard.ValveMove(Idx1, RegulValveMode.PulseWidth, new double[2] { -2.0, -2.0 }, StableTime); // TODO: avoid conflicts // TOTEST } @@ -115,7 +115,7 @@ namespace TBF.BenchControl.Elde.RegulValve ControlBoard = (CBoard)TbfComponents.FindComponent(cfg.ParentName, components); if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); - this.dict = new Dictionary(); + this.dict = new Dictionary(); #if GENESIS adcChannel = (Idx1 < 6) ? (Idx1 - 1) : (Idx1 - 2); @@ -199,12 +199,12 @@ namespace TBF.BenchControl.Elde.RegulValve /// Lower limit of the required valve position in [%] /// Higher limit of the required valve position in [%] /// SetPositionOp instance - public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs) + public IOperation SetRegulValvePositionOp(double pctLo, double pctHi, int timeoutMs) { return new SetRegulValvePositionOp(ControlBoard, this, pctLo, pctHi, timeoutMs); } - public IOperation ChangeRegulValvePositionOp(float timePulseSec) + public IOperation ChangeRegulValvePositionOp(double timePulseSec) { return new ChangeRegulValvePositionOp(ControlBoard, this, timePulseSec); } diff --git a/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs index 18477a242..c44e129e9 100644 --- a/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValve/SetFlowOp.cs @@ -56,8 +56,8 @@ namespace TBF.BenchControl.Elde.RegulValve double currentReqFlowLo; double currentReqFlowHi; - float targetPositionLo; - float targetPositionHi; + double targetPositionLo; + double targetPositionHi; int startTime; int expireTime; @@ -78,7 +78,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Timeout for the flow setting in [s] /// true = Leave the measurement running after op. stop /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetFlowOp(CBoard controlBoard, IRegulValve regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, + public SetFlowOp(CBoard controlBoard, IRegValve regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox flowBox, bool reTryCmds, int timeout, bool leaveMeasurementRunning) { if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); @@ -114,7 +114,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Set required water flow - Do not leave the measurement running. /// Events: FlowSet /// - public SetFlowOp(CBoard controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, + public SetFlowOp(CBoard controlBoard, IRegValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox flowbox, bool reTryCmds, int timeout) : this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, flowbox, reTryCmds, timeout, false) { @@ -124,7 +124,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Set required water flow - No timeout. /// Events: FlowSet /// - public SetFlowOp(CBoard controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, + public SetFlowOp(CBoard controlBoard, IRegValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox flowbox, bool reTryCmds) : this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, flowbox, reTryCmds, int.MaxValue, false) { @@ -137,9 +137,9 @@ namespace TBF.BenchControl.Elde.RegulValve /// Target valve position low limit (output) /// Target valve position high limit (output) /// true when positions for the target flow are stored in the memory, otherwise return false - bool FetchTargetPosition(double avgReqFlow, out float positionLo, out float positionHi) + bool FetchTargetPosition(double avgReqFlow, out double positionLo, out double positionHi) { - float targetPosition; + double targetPosition; if (regulValve.Dict.TryGetValue(avgReqFlow, out targetPosition)) { positionLo = Math.Max(targetPosition * 0.95f, 0.0f); @@ -154,11 +154,11 @@ namespace TBF.BenchControl.Elde.RegulValve } } - void StoreTargetPosition(double avgReqFlow, float actPosition) + void StoreTargetPosition(double avgReqFlow, double actPosition) { if (!regulValve.Dict.ContainsKey(reqFlowAve)) { - regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); + regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); } return; } @@ -261,7 +261,7 @@ namespace TBF.BenchControl.Elde.RegulValve { /// Issues the appropriate ValveMove(...) command controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { targetPositionLo, targetPositionHi }, + new double[2] { targetPositionLo, targetPositionHi }, regulValve.StableTime); opState = OpState.SettingPosition; @@ -290,7 +290,7 @@ namespace TBF.BenchControl.Elde.RegulValve { /// Repeat appropriate ValveMove(...) command controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { targetPositionLo, targetPositionHi }, + new double[2] { targetPositionLo, targetPositionHi }, regulValve.StableTime); log.InfoFormat("SetFlowOp: ValveMove({0}, Position, {1}, {2}, {3})", @@ -335,7 +335,7 @@ namespace TBF.BenchControl.Elde.RegulValve double freqLo = 2000.0 * currentReqFlowLo / nominalFlow; double freqHi = 2000.0 * currentReqFlowHi / nominalFlow; controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)freqLo, (float)freqHi }, + new double[2] { freqLo, freqHi }, regulValve.StableTime); opState = OpState.ValveMoveToFlow3; @@ -367,7 +367,7 @@ namespace TBF.BenchControl.Elde.RegulValve double freqLo = 2000.0 * currentReqFlowLo / nominalFlow; double freqHi = 2000.0 * currentReqFlowHi / nominalFlow; controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)freqLo, (float)freqHi }, + new double[2] { (float)freqLo, (float)freqHi }, regulValve.StableTime); log.InfoFormat("SetFlowOp: ValveMove({0}, Frequency, {1}, {2}, {3})", @@ -396,7 +396,7 @@ namespace TBF.BenchControl.Elde.RegulValve if (regulValve.RegulValveCfg.StoredPositionReuse) { - float storedPosition; + double storedPosition; if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition)) { /// update the stored valve position diff --git a/TBF/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs b/TBF/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs index 9606d6898..2f32d7f30 100644 --- a/TBF/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs +++ b/TBF/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs @@ -35,8 +35,8 @@ namespace TBF.BenchControl.Elde.RegulValve readonly CBoard controlBoard; readonly RegulValve regulValve; readonly int regulValveNr; - readonly float posLoPct; - readonly float posHiPct; + readonly double posLoPct; + readonly double posHiPct; readonly int timeout; /// Process values @@ -54,7 +54,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regulValve, float posLoPct, float posHiPct, int timeout) + public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regulValve, double posLoPct, double posHiPct, int timeout) { if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); this.controlBoard = controlBoard; @@ -75,7 +75,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Set required water flow - no timeout. /// Events: FlowSet /// - public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regValve, float posLoPct, float posHiPct) + public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regValve, double posLoPct, double posHiPct) : this(controlBoard, regValve, posLoPct, posHiPct, int.MaxValue) { } @@ -109,7 +109,7 @@ namespace TBF.BenchControl.Elde.RegulValve controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { posLoPct, posHiPct }, + new double[2] { posLoPct, posHiPct }, regulValve.StableTime); opState = OpState.CheckState; return Event.None; diff --git a/TBF/BenchControl/Elde/RegulValveCoax/ChangeValvePositionOp.cs b/TBF/BenchControl/Elde/RegulValveCoax/ChangeValvePositionOp.cs index da555ec69..c43c3150b 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/ChangeValvePositionOp.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/ChangeValvePositionOp.cs @@ -21,7 +21,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax readonly CBoard controlBoard; readonly RegulValve regulValve; readonly int regulValveNr; - readonly float timePulseSec; + readonly double timePulseSec; /// /// Set required water flow. @@ -33,7 +33,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public ChangeRegulValvePositionOp(CBoard controlBoard, RegulValve _regulValve, float timePulseSec) + public ChangeRegulValvePositionOp(CBoard controlBoard, RegulValve _regulValve, double timePulseSec) { if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); this.controlBoard = controlBoard; @@ -55,7 +55,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax controlBoard.ValveMove(regulValveNr, RegulValveMode.PulseWidth, - new float[2] { timePulseSec, timePulseSec }, + new double[2] { timePulseSec, timePulseSec }, regulValve.StableTime); } diff --git a/TBF/BenchControl/Elde/RegulValveCoax/RegulValve.cs b/TBF/BenchControl/Elde/RegulValveCoax/RegulValve.cs index 935dbd4a8..c1706d7d4 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/RegulValve.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/RegulValve.cs @@ -10,7 +10,7 @@ using TBF.Boxes; namespace TBF.BenchControl.Elde.RegulValveCoax { - public class RegulValve : ComponentBase, GenericDevices.IRegulValve, IDrawingItCmpntWithSetpoint + public class RegulValve : ComponentBase, GenericDevices.IRegValve, IDrawingItCmpntWithSetpoint { private static readonly ILog log = LogManager.GetLogger(typeof(RegulValve)); public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(1)); } @@ -19,8 +19,8 @@ namespace TBF.BenchControl.Elde.RegulValveCoax public readonly RegulValveCfg RegulValveCfg; public IDrawingItem DrawingItem { get { return RegulValveCfg as IDrawingItem; } } - IDictionary dict; - public IDictionary Dict { get { return dict; } } + IDictionary dict; + public IDictionary Dict { get { return dict; } } public readonly CBoard ControlBoard; @@ -31,7 +31,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// public bool IsCoax { get { return true; } } /// - public float Position { get { return ControlBoard.RValvePosition(Idx1); } } + public double Position { get { return ControlBoard.RValvePosition(Idx1); } } /// public double SetpointVal { @@ -62,7 +62,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax ControlBoard = (CBoard)TbfComponents.FindComponent(cfg.ParentName, components); if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); - this.dict = new Dictionary(); + this.dict = new Dictionary(); log.Warn(this.ToString()); } @@ -107,12 +107,12 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Lower limit of the required valve position in [%] /// Higher limit of the required valve position in [%] /// SetPositionOp instance - public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs) + public IOperation SetRegulValvePositionOp(double pctLo, double pctHi, int timeoutMs) { return new SetRegulValvePositionOp(ControlBoard, this, pctLo, pctHi, timeoutMs); } - public IOperation ChangeRegulValvePositionOp(float timePulseSec) + public IOperation ChangeRegulValvePositionOp(double timePulseSec) { return new ChangeRegulValvePositionOp(ControlBoard, this, timePulseSec); } diff --git a/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs index 5d4c7cde7..d254eed39 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/SetFlowOp.cs @@ -56,8 +56,8 @@ namespace TBF.BenchControl.Elde.RegulValveCoax double currentReqFlowLo; double currentReqFlowHi; - float targetPositionLo; - float targetPositionHi; + double targetPositionLo; + double targetPositionHi; int expireTime; DoubleBox measuredFlow; @@ -77,7 +77,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Timeout for the flow setting in [s] /// true = Leave the measurement running after op. stop /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetFlowOp(CBoard controlBoard, IRegulValve _regulValve, IFlowMeter flowMeter, + public SetFlowOp(CBoard controlBoard, IRegValve _regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, bool reTryCmds, int timeout, bool leaveMeasurementRunning) { @@ -121,7 +121,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Set required water flow - Do not leave the measurement running. /// Events: FlowSet /// - public SetFlowOp(CBoard controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, + public SetFlowOp(CBoard controlBoard, IRegValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, bool reTryCmds, int timeout) : this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, reTryCmds, timeout, false) { @@ -131,7 +131,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Set required water flow - No timeout. /// Events: FlowSet /// - public SetFlowOp(CBoard controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, + public SetFlowOp(CBoard controlBoard, IRegValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, bool reTryCmds) : this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, reTryCmds, int.MaxValue, false) { @@ -144,9 +144,9 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Target valve position low limit (output) /// Target valve position high limit (output) /// true when positions for the target flow are stored in the memory, otherwise return false - bool FetchTargetPosition(double avgReqFlow, out float positionLo, out float positionHi) + bool FetchTargetPosition(double avgReqFlow, out double positionLo, out double positionHi) { - float targetPosition; + double targetPosition; if (regulValve.Dict.TryGetValue(avgReqFlow, out targetPosition)) { positionLo = Math.Max(targetPosition * 0.95f, 0.0f); @@ -161,11 +161,11 @@ namespace TBF.BenchControl.Elde.RegulValveCoax } } - void StoreTargetPosition(double avgReqFlow, float actPosition) + void StoreTargetPosition(double avgReqFlow, double actPosition) { if (!regulValve.Dict.ContainsKey(reqFlowAve)) { - regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); + regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); } return; } @@ -276,7 +276,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax { /// Issues the appropriate ValveMove(...) command controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 }, + new double[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 }, regulValve.StableTime); opState = OpState.SettingPosition; @@ -308,7 +308,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax { /// Repeat appropriate ValveMove(...) command controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 }, + new double[2] { (targetPositionLo + targetPositionHi) / 2, (targetPositionLo + targetPositionHi) / 2 }, regulValve.StableTime); log.InfoFormat(" Run() ValveMove({0}, Position, {1}, {2}, {3})", @@ -355,7 +355,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax double freqLo = 2000.0 * currentReqFlowLo / nominalFlow; double freqHi = 2000.0 * currentReqFlowHi / nominalFlow; controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)((freqLo + freqHi) / 2), (float)((freqLo + freqHi) / 2) }, + new double[2] { (freqLo + freqHi) / 2, (freqLo + freqHi) / 2 }, regulValve.StableTime); log.WarnFormat(" Run() ValveMove({0}, Freq., {1}, {2}, {3}) flowMtr#={4} TARGET: flowLo={5} flowHi={6}", regulValveNr, (freqLo + freqHi) / 2, (freqLo + freqHi) / 2, @@ -387,7 +387,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax double freqLo = 2000.0 * currentReqFlowLo / nominalFlow; double freqHi = 2000.0 * currentReqFlowHi / nominalFlow; controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)((freqLo + freqHi) / 2), (float)((freqLo + freqHi) / 2) }, + new double[2] { (freqLo + freqHi) / 2, (freqLo + freqHi) / 2 }, regulValve.StableTime); log.WarnFormat(" Run() ValveMove({0}, Frequency, {1}, {2}, {3}) flowMtr#={4} TARGET: flowLo={5} flowHi={6}", @@ -417,7 +417,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax { if (regulValve.RegulValveCfg.StoredPositionReuse) { - float storedPosition; + double storedPosition; if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition)) { /// update the stored valve position diff --git a/TBF/BenchControl/Elde/RegulValveCoax/SetRegulValvePositionOp.cs b/TBF/BenchControl/Elde/RegulValveCoax/SetRegulValvePositionOp.cs index dce552333..692826a4a 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/SetRegulValvePositionOp.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/SetRegulValvePositionOp.cs @@ -35,8 +35,8 @@ namespace TBF.BenchControl.Elde.RegulValveCoax readonly CBoard controlBoard; readonly RegulValve regulValve; readonly int regulValveNr; - readonly float posLoPct; - readonly float posHiPct; + readonly double posLoPct; + readonly double posHiPct; readonly int timeout; /// Process values @@ -54,7 +54,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regulValve, float posLoPct, float posHiPct, int timeout) + public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regulValve, double posLoPct, double posHiPct, int timeout) { if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); this.controlBoard = controlBoard; @@ -75,7 +75,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Set required water flow - no timeout. /// Events: FlowSet /// - public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regValve, float posLoPct, float posHiPct) + public SetRegulValvePositionOp(CBoard controlBoard, RegulValve regValve, double posLoPct, double posHiPct) : this(controlBoard, regValve, posLoPct, posHiPct, int.MaxValue) { } @@ -109,7 +109,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { posLoPct, posHiPct }, + new double[2] { posLoPct, posHiPct }, regulValve.StableTime); opState = OpState.CheckState; return Event.None; diff --git a/TBF/BenchControl/Elde/RegulValveTandem/ChangeValvePositionOp.cs b/TBF/BenchControl/Elde/RegulValveTandem/ChangeValvePositionOp.cs index d17737b2b..ab7b73639 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/ChangeValvePositionOp.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/ChangeValvePositionOp.cs @@ -21,7 +21,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem readonly CBoard controlBoard; readonly Elde.RegulValve.RegulValve regulValve; readonly int regulValveNr; - readonly float timePulseSec; + readonly double timePulseSec; /// /// Set required water flow. @@ -33,7 +33,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public ChangeRegulValvePositionOp(CBoard controlBoard, IRegulValve _regulValve, float timePulseSec) + public ChangeRegulValvePositionOp(CBoard controlBoard, IRegValve _regulValve, float timePulseSec) { if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); this.controlBoard = controlBoard; @@ -50,12 +50,12 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Start this operation public void Start() { - float positionPct = controlBoard.RValvePosition(regulValveNr); + double positionPct = controlBoard.RValvePosition(regulValveNr); log.WarnFormat("RV#={0}, actPos={1}%", regulValveNr, positionPct.ToString("F1")); controlBoard.ValveMove(regulValveNr, RegulValveMode.PulseWidth, - new float[2] { timePulseSec, timePulseSec }, + new double[2] { timePulseSec, timePulseSec }, regulValve.StableTime); } diff --git a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandem.cs b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandem.cs index f4a99add0..f623d684e 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandem.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandem.cs @@ -10,15 +10,15 @@ using TBF.Boxes; namespace TBF.BenchControl.Elde.RegulValveTandem { - public class RegulValveTandem : ComponentBase, GenericDevices.IRegulValve + public class RegulValveTandem : ComponentBase, GenericDevices.IRegValve { private static readonly ILog log = LogManager.GetLogger(typeof(RegulValveTandem)); public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(1)); } public readonly RegulValveTandemCfg RegulValveTandemCfg; - IDictionary dict; - public IDictionary Dict { get { return dict; } } + IDictionary dict; + public IDictionary Dict { get { return dict; } } CBoard controlBoard { get { return regulValve.ControlBoard; } } public ValveCategory Category { get { return RegulValveTandemCfg.Category; } } @@ -33,7 +33,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// public bool IsCoax { get { return false; } } - public float Position + public double Position { get { return regulValve.Position; } } @@ -57,7 +57,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem fixedPctLo = Math.Max(0.0f, RegulValveTandemCfg.FixedRVPosition - 3.0f); fixedPctHi = Math.Min(100.0f, RegulValveTandemCfg.FixedRVPosition + 3.0f); - this.dict = new Dictionary(); + this.dict = new Dictionary(); log.Warn(this.ToString()); } @@ -103,12 +103,12 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Lower limit of the required valve position in [%] /// Higher limit of the required valve position in [%] /// SetPositionOp instance - public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs) + public IOperation SetRegulValvePositionOp(double pctLo, double pctHi, int timeoutMs) { return null; } - public IOperation ChangeRegulValvePositionOp(float timePulseSec) + public IOperation ChangeRegulValvePositionOp(double timePulseSec) { return null; } diff --git a/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs b/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs index 3e8dd46c4..5e0b98395 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/SetFlowOp.cs @@ -24,8 +24,8 @@ namespace TBF.BenchControl.Elde.RegulValveTandem readonly int regulValveNr; readonly Elde.RegulValve.RegulValve fixedRV; readonly int fixedRVNr; - readonly float fixedPctLo; - readonly float fixedPctHi; + readonly double fixedPctLo; + readonly double fixedPctHi; readonly int flowMeterNr; readonly double finalReqFlowLo; readonly double finalReqFlowHi; @@ -51,9 +51,9 @@ namespace TBF.BenchControl.Elde.RegulValveTandem OpState opState; double currentReqFlowLo; - double currentReqFlowHi; - float targetPositionLo; - float targetPositionHi; + double currentReqFlowHi; + double targetPositionLo; + double targetPositionHi; int expireTime; DoubleBox measuredFlow; @@ -76,7 +76,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Timeout for the flow setting in [s] /// true = Leave the measurement running after op. stop /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetFlowOp(CBoard controlBoard, IRegulValve regV, IRegulValve fxdRV, float fxdPctLo, float fxdPctHi, + public SetFlowOp(CBoard controlBoard, IRegValve regV, IRegValve fxdRV, float fxdPctLo, float fxdPctHi, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout, bool leaveMeasurementRunning) { @@ -126,7 +126,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Set required water flow - Do not leave the measurement running. /// Events: FlowSet /// - public SetFlowOp(CBoard controlBoard, IRegulValve regValve, IRegulValve fixedRV, float fixedPctLo, float fixedPctHi, + public SetFlowOp(CBoard controlBoard, IRegValve regValve, IRegValve fixedRV, float fixedPctLo, float fixedPctHi, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout) : this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, false) { @@ -136,7 +136,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Set required water flow - No timeout. /// Events: FlowSet /// - public SetFlowOp(CBoard controlBoard, IRegulValve regValve, IRegulValve fixedRV, float fixedPctLo, float fixedPctHi, + public SetFlowOp(CBoard controlBoard, IRegValve regValve, IRegValve fixedRV, float fixedPctLo, float fixedPctHi, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow) : this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, int.MaxValue, false) { @@ -149,28 +149,28 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Target valve position low limit (output) /// Target valve position high limit (output) /// true when positions for the target flow are stored in the memory, otherwise return false - bool FetchTargetPosition(double avgReqFlow, out float positionLo, out float positionHi) + bool FetchTargetPosition(double avgReqFlow, out double positionLo, out double positionHi) { - float targetPosition; + double targetPosition; if (regulValve.Dict.TryGetValue(avgReqFlow, out targetPosition)) { - positionLo = Math.Max(targetPosition * 0.95f, 0.0f); - positionHi = Math.Min(targetPosition * 1.05f, 100.0f); + positionLo = Math.Max(targetPosition * 0.95, 0.0); + positionHi = Math.Min(targetPosition * 1.05, 100.0); return true; } else { - positionLo = 0.0f; - positionHi = 0.0f; + positionLo = 0.0; + positionHi = 0.0; return false; } } - void StoreTargetPosition(double avgReqFlow, float actPosition) + void StoreTargetPosition(double avgReqFlow, double actPosition) { if (!regulValve.Dict.ContainsKey(reqFlowAve)) { - regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); + regulValve.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); } return; } @@ -248,7 +248,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Done once, issues an appropriate ValveMove(...) command /// controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { targetPositionLo, targetPositionHi }, + new double[2] { targetPositionLo, targetPositionHi }, regulValve.StableTime); opState = OpState.SettingPosition; @@ -271,7 +271,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Done once, issues an appropriate ValveMove(...) command /// controlBoard.ValveMove(fixedRVNr, RegulValveMode.TargetPosition, - new float[2] { fixedPctLo, fixedPctHi }, + new double[2] { fixedPctLo, fixedPctHi }, regulValve.StableTime); opState = OpState.SettingPosition_FixedRV; @@ -304,7 +304,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem double freqLo = 2000.0 * currentReqFlowLo / nominalFlow; double freqHi = 2000.0 * currentReqFlowHi / nominalFlow; controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetFrequency, - new float[2] { (float)freqLo, (float)freqHi }, + new double[2] { freqLo, freqHi }, regulValve.StableTime); opState = OpState.SettingFlow; @@ -321,7 +321,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem { if (regulValve.RegulValveCfg.StoredPositionReuse) { - float storedPosition; + double storedPosition; if (regulValve.Dict.TryGetValue(reqFlowAve, out storedPosition)) { /// update the stored valve position diff --git a/TBF/BenchControl/Elde/RegulValveTandem/SetRegulValvePositionOp.cs b/TBF/BenchControl/Elde/RegulValveTandem/SetRegulValvePositionOp.cs index eda639b8b..080a7119a 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/SetRegulValvePositionOp.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/SetRegulValvePositionOp.cs @@ -21,8 +21,8 @@ namespace TBF.BenchControl.Elde.RegulValveTandem readonly CBoard controlBoard; readonly Elde.RegulValve.RegulValve regulValve; readonly int regulValveNr; - readonly float posLoPct; - readonly float posHiPct; + readonly double posLoPct; + readonly double posHiPct; readonly int timeout; /// Process values @@ -40,7 +40,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetRegulValvePositionOp(CBoard controlBoard, IRegulValve regV, float posLoPct, float posHiPct, int timeout) + public SetRegulValvePositionOp(CBoard controlBoard, IRegValve regV, float posLoPct, float posHiPct, int timeout) { if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); this.controlBoard = controlBoard; @@ -94,7 +94,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem controlBoard.ValveMove(regulValveNr, RegulValveMode.TargetPosition, - new float[2] { posLoPct, posHiPct }, + new double[2] { posLoPct, posHiPct }, regulValve.StableTime); return Event.None; } @@ -128,7 +128,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem { controlBoard.ValveMove(regulValveNr, RegulValveMode.Stop, - new float[2] { posLoPct, posHiPct }, + new double[2] { posLoPct, posHiPct }, regulValve.StableTime); } } diff --git a/TBF/BenchControl/FeedingPath.cs b/TBF/BenchControl/FeedingPath.cs index 6fc7b756b..284df2b0c 100644 --- a/TBF/BenchControl/FeedingPath.cs +++ b/TBF/BenchControl/FeedingPath.cs @@ -13,7 +13,7 @@ namespace TBF.BenchControl public float Qfrom; public float Qto; public IValve Pump; /// pump to use with this path or null - public IList RegulValves; + public IList RegulValves; public IList RegulValvesPct; public IList ValvesOpen; /// a list of valves to open or null public IList ValvesClose; /// a list of valves to close or null @@ -25,7 +25,7 @@ namespace TBF.BenchControl Name = name; ValvesOpen = new List(); ValvesClose = new List(); - RegulValves = new List(); + RegulValves = new List(); RegulValvesPct = new List(); } @@ -42,7 +42,7 @@ namespace TBF.BenchControl /// foreach (var cmpnt in components) { - IRegulValve regValve = cmpnt as IRegulValve; + IRegValve regValve = cmpnt as IRegValve; if (regValve != null && regValve.Category == TBF.BenchControl.ValveCategory.Feeding) { RegulValves.Add(regValve); diff --git a/TBF/BenchControl/GenericDevices/IRegulValve.cs b/TBF/BenchControl/GenericDevices/IRegValve.cs similarity index 91% rename from TBF/BenchControl/GenericDevices/IRegulValve.cs rename to TBF/BenchControl/GenericDevices/IRegValve.cs index 7f7b404ce..260452f3a 100644 --- a/TBF/BenchControl/GenericDevices/IRegulValve.cs +++ b/TBF/BenchControl/GenericDevices/IRegValve.cs @@ -8,7 +8,7 @@ using TBF.Boxes; namespace TBF.BenchControl.GenericDevices { - public interface IRegulValve : IComponent + public interface IRegValve : IComponent { /// /// All, Feeding, Bench, Output or None @@ -23,12 +23,12 @@ namespace TBF.BenchControl.GenericDevices /// /// Regulation valve position 0.0 .. 100.0 % /// - float Position { get; } + double Position { get; } /// /// Dictionary for position re-use /// - IDictionary Dict { get; } + IDictionary Dict { get; } /// /// Operation to set the water flow within tolerances @@ -65,7 +65,7 @@ namespace TBF.BenchControl.GenericDevices /// Higher limit of the required valve position in % /// Timeout in [s] /// SetPositionOp instance - IOperation SetRegulValvePositionOp(float posLoPct, float posHiPct, int timeout); + IOperation SetRegulValvePositionOp(double posLoPct, double posHiPct, int timeout); /// /// Operation to set the regulation valve to a required position @@ -73,6 +73,6 @@ namespace TBF.BenchControl.GenericDevices /// /// Time pulse in sec /// SetPositionOp instance - IOperation ChangeRegulValvePositionOp(float timePulseSec); + IOperation ChangeRegulValvePositionOp(double timePulseSec); } } diff --git a/TBF/BenchControl/Operations/SetAllRegulValvesOp.cs b/TBF/BenchControl/Operations/SetAllRegulValvesOp.cs index 42e2556a5..e645079f7 100644 --- a/TBF/BenchControl/Operations/SetAllRegulValvesOp.cs +++ b/TBF/BenchControl/Operations/SetAllRegulValvesOp.cs @@ -16,7 +16,7 @@ namespace TBF.BenchControl.Operations int rvCount; IOperation[] setRVPosOps; - public SetAllRegulValvesOp(IList regulValves, IList positions, int timeout) + public SetAllRegulValvesOp(IList regulValves, IList positions, int timeout) { if (regulValves == null || regulValves.Count == 0) { diff --git a/TBF/BenchControl/OutputPath.cs b/TBF/BenchControl/OutputPath.cs index 3469e3783..bea0d954c 100644 --- a/TBF/BenchControl/OutputPath.cs +++ b/TBF/BenchControl/OutputPath.cs @@ -13,7 +13,7 @@ namespace TBF.BenchControl public float Qfrom; public float Qto; public IFlowMeter FlowMeter; - public IRegulValve RegValve; + public IRegValve RegValve; public float PidCoef; public IDiverter Diverter; public ITempMeter TempMtrDiv; @@ -45,7 +45,7 @@ namespace TBF.BenchControl Qfrom = outputPathEntity.Qfrom; Qto = outputPathEntity.Qto; FlowMeter = (IFlowMeter)TbfComponents.FindComponent(outputPathEntity.FlowMeter, components); - RegValve = (IRegulValve)TbfComponents.FindComponent(outputPathEntity.RegValve, components); + RegValve = (IRegValve)TbfComponents.FindComponent(outputPathEntity.RegValve, components); PidCoef = outputPathEntity.PidCoef; Diverter = (IDiverter)TbfComponents.FindComponent(outputPathEntity.Diverter, components); TempMtrDiv = (ITempMeter)TbfComponents.FindComponent(outputPathEntity.TempMtrDiv, components); diff --git a/TBF/BenchControl/Sequences/SequenceBase.cs b/TBF/BenchControl/Sequences/SequenceBase.cs index 8fa6ca03b..94139594d 100644 --- a/TBF/BenchControl/Sequences/SequenceBase.cs +++ b/TBF/BenchControl/Sequences/SequenceBase.cs @@ -36,7 +36,7 @@ namespace TBF.BenchControl.Sequences /// Global static variables set only once. ///------------------------------------------------------------ public static IList FlowMeters; /// list of reference flowmeters - public static IList RegulValves; /// list of regulation valves + 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 @@ -951,7 +951,7 @@ namespace TBF.BenchControl.Sequences } - protected Event SetFlowEtc(Test test, IFlowMeter flowMeter, IRegulValve regulValve, IValve pump, IValve stopBFValve, IList extraOperations, bool doNotWait) + protected Event SetFlowEtc(Test test, IFlowMeter flowMeter, IRegValve regulValve, IValve pump, IValve stopBFValve, IList extraOperations, bool doNotWait) { IList e; Event retVal = Event.Done; @@ -1866,7 +1866,7 @@ namespace TBF.BenchControl.Sequences log.FatalFormat(" Output path: {0}", (outPath != null) ? outPath.ToString() : "none"); if (inPath.Pump is IPump) log.FatalFormat(" Pump power: {0}%", (inPath.Pump as IPump).Power); else if (inPath.Pump is IValve) log.FatalFormat(" Feeding valve: {0}", (inPath.Pump as IValve).State ? "open" : "close"); - if (outPath.RegValve is IRegulValve) log.FatalFormat(" Regulation valve position: {0}%", outPath.RegValve.Position); + if (outPath.RegValve is IRegValve) log.FatalFormat(" Regulation valve position: {0}%", outPath.RegValve.Position); log.FatalFormat(" Flow: {0}", RefFlow); log.FatalFormat(" Mass: {0}", Mass); log.FatalFormat(" Start mass: {0}", StartMass); diff --git a/TBF/BenchControl/StateMachine.cs b/TBF/BenchControl/StateMachine.cs index eb4672a2f..44d27d34c 100644 --- a/TBF/BenchControl/StateMachine.cs +++ b/TBF/BenchControl/StateMachine.cs @@ -153,7 +153,7 @@ namespace TBF.BenchControl ProcessData.IperlHeads = new List(); SequenceBase.FlowMeters = new List(); - SequenceBase.RegulValves = new List(); + SequenceBase.RegulValves = new List(); SequenceBase.PumpsWithFM = new List(); SequenceBase.WaterMeters = new List(); SequenceBase.Cameras = new List(); @@ -263,9 +263,9 @@ namespace TBF.BenchControl } if (cmpnt is IFlowMeter) SequenceBase.FlowMeters.Add(cmpnt as IFlowMeter); - if ((cmpnt is IRegulValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem)) + if ((cmpnt is IRegValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem)) { - SequenceBase.RegulValves.Add(cmpnt as IRegulValve); + SequenceBase.RegulValves.Add(cmpnt as IRegValve); } if (cmpnt is IPumpFM && !(cmpnt is BuiltIn.PumpTandem.Pump)) SequenceBase.PumpsWithFM.Add(cmpnt as IPumpFM); if (cmpnt is IWaterMeter) SequenceBase.WaterMeters.Add(cmpnt as IWaterMeter); diff --git a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index f8db02766..277b818b6 100644 --- a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -40,7 +40,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index 813762075..648a9616c 100644 --- a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -55,7 +55,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs b/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs index 7d76fd9ce..a2dab7366 100644 --- a/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs +++ b/TBF/BenchControl/TestMethods/DiverterTest/DiverterTestSeq.cs @@ -60,7 +60,7 @@ namespace TBF.BenchControl.TestMethods.DiverterTest return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs index dd8cd3ccf..982cfcc46 100644 --- a/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs +++ b/TBF/BenchControl/TestMethods/Endurance/EnduranceSeq.cs @@ -38,7 +38,7 @@ namespace TBF.BenchControl.TestMethods.Endurance return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs index afa6adf01..ae9a8782c 100644 --- a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs @@ -37,7 +37,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs b/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs index e54c8fc0c..3bb73b1ca 100644 --- a/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs @@ -40,7 +40,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs index 09a528070..e13c54fa7 100644 --- a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs @@ -40,7 +40,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs index 065925b0c..1031f4e60 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs @@ -52,7 +52,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollAdvanced return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs index acba0dd70..ae05f9ee9 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs @@ -54,7 +54,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index b27fc79b3..8b62b3b81 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -52,7 +52,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs index d5d0ed921..e48725afb 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs @@ -52,7 +52,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs b/TBF/BenchControl/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs index 76fb3fd3d..362533a6c 100644 --- a/TBF/BenchControl/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs +++ b/TBF/BenchControl/TestMethods/FlowAdjustment/FlowAdjustmentSeq.cs @@ -40,7 +40,7 @@ namespace TBF.BenchControl.TestMethods.FlowAdjustment return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 781db9b9e..7fbe9fba0 100644 --- a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -39,7 +39,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 7eee3b464..9fd20d47b 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -60,7 +60,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs index d02c86096..95c1954e4 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs @@ -60,7 +60,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index 4b20ed341..382e663a8 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -51,7 +51,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 25c6e1974..06362f07e 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -60,7 +60,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs index 44aacf758..3d4814642 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs @@ -58,7 +58,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection return false; } - if (!(devices.RegValve is GenericDevices.IRegulValve)) + if (!(devices.RegValve is GenericDevices.IRegValve)) { /// Regulation valve is missing message = string.Format("{0}: {1}", test.Name, Strings.Missing_a_regulation_valve); diff --git a/TBF/BenchControl/Uni/RegValve/ChangeValvePositionOp.cs b/TBF/BenchControl/Uni/RegValve/ChangeValvePositionOp.cs index 217f11321..d7e3d4775 100644 --- a/TBF/BenchControl/Uni/RegValve/ChangeValvePositionOp.cs +++ b/TBF/BenchControl/Uni/RegValve/ChangeValvePositionOp.cs @@ -20,7 +20,7 @@ namespace TBF.BenchControl.Uni.RegValve readonly TBF.BenchControl.ControlBoard.Legacy.CBoard controlBoard; readonly RegValve regulValve; readonly int regulValveNr; - readonly float timePulseSec; + readonly double timePulseSec; /// /// Set required water flow. @@ -32,7 +32,7 @@ namespace TBF.BenchControl.Uni.RegValve /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public ChangeRegulValvePositionOp(TBF.BenchControl.ControlBoard.IControlBoard cb, RegValve rv, float timePulseSec) + public ChangeRegulValvePositionOp(TBF.BenchControl.ControlBoard.IControlBoard cb, RegValve rv, double timePulseSec) { controlBoard = cb as TBF.BenchControl.ControlBoard.Legacy.CBoard; if (controlBoard == null) throw new ArgumentNullException("ctrlBoard"); @@ -49,12 +49,12 @@ namespace TBF.BenchControl.Uni.RegValve /// Start this operation public void Start() { - float positionPct = controlBoard.RValvePosition(regulValveNr); + double positionPct = controlBoard.RValvePosition(regulValveNr); log.WarnFormat("RV#={0}, actPos={1}%", regulValveNr, positionPct.ToString("F1")); controlBoard.ValveMove(regulValveNr, TBF.BenchControl.ControlBoard.Legacy.RegulValveMode.PulseWidth, - new float[2] { timePulseSec, timePulseSec }, + new double[2] { timePulseSec, timePulseSec }, regulValve.StableTime); } diff --git a/TBF/BenchControl/Uni/RegValve/RegValve.cs b/TBF/BenchControl/Uni/RegValve/RegValve.cs index 71d42da64..9a89ea06d 100644 --- a/TBF/BenchControl/Uni/RegValve/RegValve.cs +++ b/TBF/BenchControl/Uni/RegValve/RegValve.cs @@ -11,7 +11,7 @@ using TBF.Boxes; namespace TBF.BenchControl.Uni.RegValve { - public class RegValve : ComponentBase, IDevice, GenericDevices.IRegulValve, IDrawingItCmpntWithSetpoint + public class RegValve : ComponentBase, IDevice, GenericDevices.IRegValve, IDrawingItCmpntWithSetpoint { private static readonly ILog log = LogManager.GetLogger(typeof(RegValve)); public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(1)); } @@ -20,21 +20,31 @@ namespace TBF.BenchControl.Uni.RegValve public readonly RegValveCfg regValveCfg; public IDrawingItem DrawingItem { get { return regValveCfg as IDrawingItem; } } - IDictionary dict; - public IDictionary Dict { get { return dict; } } + IDictionary dict; + public IDictionary Dict { get { return dict; } } readonly UniCB uniCB; + readonly int adcChannel; public ValveCategory Category { get { return regValveCfg.Category; } } - public int Idx1 { get { return regValveCfg.Idx1; } } /// 1..7 - public int DacValueClosed { get { return regValveCfg.AdcValueClosed; } } /// 0..1023 - public int DacValueOpen { get { return regValveCfg.AdcValueOpen; } } /// 0..1023 + public int Idx1 { get { return regValveCfg.Idx1; } } /// 1 .. 8 + public int DacValueClosed { get { return regValveCfg.AdcValueClosed; } } /// 0 .. 1023 + public int DacValueOpen { get { return regValveCfg.AdcValueOpen; } } /// 0 .. 1023 public int StableTime { get { return regValveCfg.StableTime; } } /// 0=200ms, step=50ms, max. 1500ms (max.26) - public int FlowStableSec { get { return regValveCfg.FlowStableSec; } } /// 0..60 sec + public int FlowStableSec { get { return regValveCfg.FlowStableSec; } } /// 0 .. 60 sec /// public bool IsCoax { get { return false; } } - /// - public float Position { get { return Raw2Position(uniCB.AnalogInput(AdcChannel)); } } /// 0 .. 100% + + /// 0.0 .. 100.0 + public double Position + { + get + { + int denominator = DacValueOpen - DacValueClosed; + if (denominator == 0) denominator = 1; + return 100.0 * Convert.ToDouble(uniCB.AnalogInput(adcChannel) - DacValueClosed) / Convert.ToDouble(denominator); + } + } /// public double SetpointVal { @@ -52,21 +62,8 @@ namespace TBF.BenchControl.Uni.RegValve /// TODO } - public int AdcChannel; - public RegValveMode RegValveMode; public RegValveState RegValveState; - public float TargetRegValvePosition; - - /// - /// - /// - /// - /// - float Raw2Position(Int16 analogInputValue) - { - /// TODO - return 0.5f; /// return 50% - } + public double TargetRegValvePosition; public void SendCommand(Command command, int v1, int v2, int v3, StopDevs v4) { @@ -131,7 +128,7 @@ namespace TBF.BenchControl.Uni.RegValve } else if (args.Command == CfgChangeCmd.GetAdc1 || args.Command == CfgChangeCmd.GetAdc2) { - short adcValue = uniCB.AnalogInput(AdcChannel); + short adcValue = uniCB.AnalogInput(adcChannel); RegValveCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(args.Command, Idx1, adcValue)); } } @@ -149,11 +146,12 @@ namespace TBF.BenchControl.Uni.RegValve : base(cfg) { regValveCfg = cfg as RegValveCfg; + adcChannel = regValveCfg.Idx1 - 1; this.uniCB = TbfComponents.FindComponent(cfg.ParentName, components) as UniCB; if (this.uniCB == null) throw new Exception(string.Format("Cannot find {0} (a parent of {1})", cfg.ParentName, Name)); - this.dict = new Dictionary(); + this.dict = new Dictionary(); StartChangeHandler(); @@ -167,7 +165,7 @@ namespace TBF.BenchControl.Uni.RegValve public void Initialize() { } public void RunDeviceBefore() { - Int16 adcValue = uniCB.Data.AnalogInput[AdcChannel]; + Int16 adcValue = uniCB.AnalogInput(adcChannel); Handlers.OnAdcChanged(this, new CmdResponseArgs(CfgChangeCmd.GetAdc, Idx1, adcValue)); } public void RunDeviceAfter() { } @@ -214,12 +212,12 @@ namespace TBF.BenchControl.Uni.RegValve /// Lower limit of the required valve position in [%] /// Higher limit of the required valve position in [%] /// SetPositionOp instance - public IOperation SetRegulValvePositionOp(float pctLo, float pctHi, int timeoutMs) + public IOperation SetRegulValvePositionOp(double pctLo, double pctHi, int timeoutMs) { return new SetRegValvePositionOp(uniCB, this, pctLo, pctHi, timeoutMs); } - public IOperation ChangeRegulValvePositionOp(float timePulseSec) + public IOperation ChangeRegulValvePositionOp(double timePulseSec) { return new ChangeRegulValvePositionOp(uniCB, this, timePulseSec); } diff --git a/TBF/BenchControl/Uni/RegValve/SetFlowOp.cs b/TBF/BenchControl/Uni/RegValve/SetFlowOp.cs index 9cd0cf29f..003befd94 100644 --- a/TBF/BenchControl/Uni/RegValve/SetFlowOp.cs +++ b/TBF/BenchControl/Uni/RegValve/SetFlowOp.cs @@ -56,8 +56,8 @@ namespace TBF.BenchControl.Uni.RegValve double currentReqFlowLo; double currentReqFlowHi; - float targetPositionLo; - float targetPositionHi; + double targetPositionLo; + double targetPositionHi; int startTime; int expireTime; @@ -78,7 +78,7 @@ namespace TBF.BenchControl.Uni.RegValve /// Timeout for the flow setting in [s] /// true = Leave the measurement running after op. stop /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetFlowOp(UniCB cBoard, IRegulValve regValve, IFlowMeter flowMeter, double targetFlowLo, double targetFlowHi, + public SetFlowOp(UniCB cBoard, IRegValve regValve, IFlowMeter flowMeter, double targetFlowLo, double targetFlowHi, DoubleBox flowBox, bool reTryCmds, int timeout, bool leaveMeasurementRunning) { this.cBoard = cBoard; @@ -113,7 +113,7 @@ namespace TBF.BenchControl.Uni.RegValve /// Set required water flow - Do not leave the measurement running. /// Events: FlowSet /// - public SetFlowOp(UniCB cBoard, IRegulValve regValve, IFlowMeter flowMeter, double targetFlowLo, double targetFlowHi, + public SetFlowOp(UniCB cBoard, IRegValve regValve, IFlowMeter flowMeter, double targetFlowLo, double targetFlowHi, DoubleBox flowbox, bool reTryCmds, int timeout) : this(cBoard, regValve, flowMeter, targetFlowLo, targetFlowHi, flowbox, reTryCmds, timeout, false) { @@ -123,7 +123,7 @@ namespace TBF.BenchControl.Uni.RegValve /// Set required water flow - No timeout. /// Events: FlowSet /// - public SetFlowOp(UniCB cBoard, IRegulValve regValve, IFlowMeter flowMeter, double targetFlowLo, double targetFlowHi, + public SetFlowOp(UniCB cBoard, IRegValve regValve, IFlowMeter flowMeter, double targetFlowLo, double targetFlowHi, DoubleBox flowbox, bool reTryCmds) : this(cBoard, regValve, flowMeter, targetFlowLo, targetFlowHi, flowbox, reTryCmds, int.MaxValue, false) { @@ -136,28 +136,28 @@ namespace TBF.BenchControl.Uni.RegValve /// Target valve position low limit (output) /// Target valve position high limit (output) /// true when positions for the target flow are stored in the memory, otherwise return false - bool FetchTargetPosition(double avgReqFlow, out float positionLo, out float positionHi) + bool FetchTargetPosition(double avgReqFlow, out double positionLo, out double positionHi) { - float targetPosition; + double targetPosition; if (regV.Dict.TryGetValue(avgReqFlow, out targetPosition)) { - positionLo = Math.Max(targetPosition * 0.95f, 0.0f); - positionHi = Math.Min(targetPosition * 1.05f, 100.0f); + positionLo = Math.Max(targetPosition * 0.95, 0.0); + positionHi = Math.Min(targetPosition * 1.05, 100.0); return true; } else { - positionLo = 0.0f; - positionHi = 0.0f; + positionLo = 0; + positionHi = 0; return false; } } - void StoreTargetPosition(double avgReqFlow, float actPosition) + void StoreTargetPosition(double avgReqFlow, double actPosition) { if (!regV.Dict.ContainsKey(targetFlowAve)) { - regV.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); + regV.Dict.Add(new KeyValuePair(avgReqFlow, actPosition)); } return; } @@ -212,7 +212,7 @@ namespace TBF.BenchControl.Uni.RegValve /// public Event Run() { - float rvPosition = regV.Position; + double rvPosition = regV.Position; double flowMtrFreq = flowMeter.ReadFrequency(); double flow = flowMeter.ReadFlow(); @@ -387,12 +387,12 @@ namespace TBF.BenchControl.Uni.RegValve if (regV.regValveCfg.StoredPositionReuse) { - float storedPosition; + double storedPosition; if (regV.Dict.TryGetValue(targetFlowAve, out storedPosition)) { /// update the stored valve position - StoreTargetPosition(targetFlowAve, (rvPosition + storedPosition) / 2.0f); + StoreTargetPosition(targetFlowAve, (rvPosition + storedPosition) / 2.0); log.InfoFormat("Run(): rv#={0} reqFlow={1} pos={2}% stored={3} <--- Updating a stored position", regulValveNr, targetFlowAve, rvPosition.ToString("F1"), storedPosition); } diff --git a/TBF/BenchControl/Uni/RegValve/SetRegValvePositionOp.cs b/TBF/BenchControl/Uni/RegValve/SetRegValvePositionOp.cs index 892ca287b..6c909aa4c 100644 --- a/TBF/BenchControl/Uni/RegValve/SetRegValvePositionOp.cs +++ b/TBF/BenchControl/Uni/RegValve/SetRegValvePositionOp.cs @@ -35,8 +35,8 @@ namespace TBF.BenchControl.Uni.RegValve readonly UniCB cBoard; readonly RegValve regV; readonly int regValveNr; - readonly float posLoPct; - readonly float posHiPct; + readonly double posLoPct; + readonly double posHiPct; readonly int timeout; /// Process values @@ -54,7 +54,7 @@ namespace TBF.BenchControl.Uni.RegValve /// Upper limit of the position to be achieved /// Timeout in sec. for setting the flow /// Only Elde.Valve flow are used, other flow on the lists are ignored - public SetRegValvePositionOp(UniCB cBoard, RegValve regValve, float posLoPct, float posHiPct, int timeout) + public SetRegValvePositionOp(UniCB cBoard, RegValve regValve, double posLoPct, double posHiPct, int timeout) { this.cBoard = cBoard; if (this.cBoard == null) throw new ArgumentNullException("ctrlBoard"); @@ -114,7 +114,7 @@ namespace TBF.BenchControl.Uni.RegValve if (positionReached) return Event.PositionReached; - float positionPct = regV.Position; + double positionPct = regV.Position; log.WarnFormat("Run(): RV#={0}, actPos={1}%", regValveNr, positionPct.ToString("F1")); if (opState == OpState.CheckState) diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index b04bfa3cb..9ace58492 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.1.1602.0")] -[assembly: AssemblyFileVersion("3.1.1602.0")] +[assembly: AssemblyVersion("3.1.1603.0")] +[assembly: AssemblyFileVersion("3.1.1603.0")] diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 928e9ccd2..9a8f42af5 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -1964,7 +1964,7 @@ - + diff --git a/TBF/UI/Bench/Paths/PathsDlg.cs b/TBF/UI/Bench/Paths/PathsDlg.cs index 8f887f1c9..efcd04cd3 100644 --- a/TBF/UI/Bench/Paths/PathsDlg.cs +++ b/TBF/UI/Bench/Paths/PathsDlg.cs @@ -33,7 +33,7 @@ namespace TBF.UI.Bench.Paths public IList TbfComponents; public IList Valves; - public IList FeedingRegulValves; + public IList FeedingRegulValves; public ISession Session; /// One common DB session passed also to the controls inside tab pages public IList Procedures; public IList Tests; @@ -71,10 +71,10 @@ namespace TBF.UI.Bench.Paths Valves = BenchControl.BuiltIn.ValveBase.GetMasterValves(TbfComponents); /// Find all feeding regulation valves - FeedingRegulValves = new List(); + FeedingRegulValves = new List(); foreach (var cmpnt in TbfComponents) { - IRegulValve regValve = cmpnt as IRegulValve; + IRegValve regValve = cmpnt as IRegValve; if (regValve != null && regValve.Category == TBF.BenchControl.ValveCategory.Feeding) { FeedingRegulValves.Add(regValve); diff --git a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs index 43eafeb39..3bb444a7b 100644 --- a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs @@ -131,7 +131,7 @@ namespace TBF.UI.Bench.Paths foreach (var cmpnt in parent.TbfComponents) { if (cmpnt is IFlowMeter) flowMeterComboBox.Items.Add(cmpnt.Cfg.Name); - if (cmpnt is IRegulValve) regulValveComboBox.Items.Add(cmpnt.Cfg.Name); + if (cmpnt is IRegValve) regulValveComboBox.Items.Add(cmpnt.Cfg.Name); if (cmpnt is IDiverter) diverterComboBox.Items.Add(cmpnt.Cfg.Name); if (cmpnt is ITempMeter) tempMeterDivComboBox.Items.Add(cmpnt.Cfg.Name); if (cmpnt is IScaleOrTank) scaleComboBox.Items.Add(cmpnt.Cfg.Name); diff --git a/TBF/UI/Bench/Transitions/TransitionsDlg.cs b/TBF/UI/Bench/Transitions/TransitionsDlg.cs index a83ce8ea1..89270575d 100644 --- a/TBF/UI/Bench/Transitions/TransitionsDlg.cs +++ b/TBF/UI/Bench/Transitions/TransitionsDlg.cs @@ -53,7 +53,7 @@ namespace TBF.UI.Bench.Transitions /// Auxiliary public lists used also by user controls in tab pages public IList TbfComponents; public IList Valves; - public IList RegulValves; + public IList RegulValves; IList seqStepsCtrls; @@ -98,12 +98,12 @@ namespace TBF.UI.Bench.Transitions var cmptnEntities = Session.QueryOver().OrderBy(x => x.ItemNr).Asc.List(); TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(cmptnEntities); Valves = BenchControl.BuiltIn.ValveBase.GetMasterValves(TbfComponents); - RegulValves = new List(); + RegulValves = new List(); foreach (var cmpnt in TbfComponents) { - if ((cmpnt is IRegulValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem)) + if ((cmpnt is IRegValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem)) { - RegulValves.Add(cmpnt as IRegulValve); + RegulValves.Add(cmpnt as IRegValve); } } diff --git a/TBF/UI/Procedures/ProcedureDlg.cs b/TBF/UI/Procedures/ProcedureDlg.cs index cb79f595b..a0f7454c7 100644 --- a/TBF/UI/Procedures/ProcedureDlg.cs +++ b/TBF/UI/Procedures/ProcedureDlg.cs @@ -46,7 +46,7 @@ namespace TBF.UI.Procedures /// Auxiliary public lists used also by user controls in tab pages public IList TbfComponents; public IList Valves; - public IList RegulValves; + public IList RegulValves; public IList TestMethods; public IList UsedTestMethods; ComboBox methodCBox; @@ -146,7 +146,7 @@ namespace TBF.UI.Procedures var cmptnEntities = session.QueryOver().OrderBy(x => x.ItemNr).Asc.List(); TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(cmptnEntities); Valves = BenchControl.BuiltIn.ValveBase.GetMasterValves(TbfComponents); - RegulValves = new List(); + RegulValves = new List(); TestMethods = new List(); dataEntryComboBox.Items.Add("---"); printer1ComboBox.Items.Add("---"); @@ -161,7 +161,7 @@ namespace TBF.UI.Procedures foreach (var cmpnt in TbfComponents) { - if (cmpnt is IRegulValve) RegulValves.Add(cmpnt as IRegulValve); + if (cmpnt is IRegValve) RegulValves.Add(cmpnt as IRegValve); if (cmpnt is ITestMethod) TestMethods.Add(cmpnt as ITestMethod); if (cmpnt is IDataEntry) dataEntryComboBox.Items.Add(cmpnt.Cfg.Name); if (cmpnt is IResultsPrinter)