diff --git a/TBF/BenchControl/Dummy/RegulValve/RegulValveCfg.cs b/TBF/BenchControl/Dummy/RegulValve/RegulValveCfg.cs index 978a2bb28..c1c0faed5 100644 --- a/TBF/BenchControl/Dummy/RegulValve/RegulValveCfg.cs +++ b/TBF/BenchControl/Dummy/RegulValve/RegulValveCfg.cs @@ -16,7 +16,7 @@ namespace TBF.BenchControl.Dummy.RegulValve /// /// Serialized parameters /// - public ValveCategory Category; /// Feeding, Output or All + public ValveCategory Category; /// Feeding or Output /// Private parameterless constructor invoked by all other (public) constructors RegulValveCfg() diff --git a/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs b/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs index eadf9028d..f6dc707b9 100644 --- a/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs +++ b/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs @@ -32,7 +32,6 @@ namespace TBF.BenchControl.Dummy.RegulValve private void RegulationValveCfgCtrl_Load(object sender, EventArgs e) { - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -62,8 +61,7 @@ namespace TBF.BenchControl.Dummy.RegulValve { CfgUpdateFlags flags = CfgUpdateFlags.None; - if (!categoryComboBox.Text.Equals(ValveCategory.All.ToString()) && - !categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && + if (!categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && !categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) { flags |= CfgUpdateFlags.Error; @@ -86,11 +84,10 @@ namespace TBF.BenchControl.Dummy.RegulValve } ValveCategory newCategory; - if (categoryComboBox.Text.Equals(ValveCategory.All.ToString())) newCategory = ValveCategory.All; - else if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; - else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) newCategory = ValveCategory.Bench; + if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; else newCategory = ValveCategory.None; + if (newCategory != config.Category) { config.Category = newCategory; diff --git a/TBF/BenchControl/Elde/RegulValve/RegulValveCfg.cs b/TBF/BenchControl/Elde/RegulValve/RegulValveCfg.cs index 7d822313a..0e8835ba2 100644 --- a/TBF/BenchControl/Elde/RegulValve/RegulValveCfg.cs +++ b/TBF/BenchControl/Elde/RegulValve/RegulValveCfg.cs @@ -20,7 +20,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Serialized parameters /// public int Idx1; /// 1..8 - public ValveCategory Category; /// Feeding, Output or All + public ValveCategory Category; /// Feeding or Output public int AdcValueClosed; /// 0..1023 public int AdcValueOpen; /// 0..1023 public int StableTimeMs; /// 200..1500 ms, step is 50 ms diff --git a/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs b/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs index a98dd2222..5f3fe3f5f 100644 --- a/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs +++ b/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs @@ -49,7 +49,6 @@ namespace TBF.BenchControl.Elde.RegulValve } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -117,8 +116,7 @@ namespace TBF.BenchControl.Elde.RegulValve message += Environment.NewLine + "Invalid 'Parent Name'"; } - if (!categoryComboBox.Text.Equals(ValveCategory.All.ToString()) && - !categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && + if (!categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && !categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) { flags |= CfgUpdateFlags.Error; @@ -178,11 +176,10 @@ namespace TBF.BenchControl.Elde.RegulValve } ValveCategory newCategory; - if (categoryComboBox.Text.Equals(ValveCategory.All.ToString())) newCategory = ValveCategory.All; - else if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; - else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) newCategory = ValveCategory.Bench; - else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; - else newCategory = ValveCategory.None; + if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; + else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; + else newCategory = ValveCategory.None; + if (newCategory != config.Category) { config.Category = newCategory; diff --git a/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfg.cs b/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfg.cs index 33935a560..c28567b0f 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfg.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfg.cs @@ -20,7 +20,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax /// Serialized parameters /// public int Idx1; /// 1..8 - public ValveCategory Category; /// Feeding, Output or All + public ValveCategory Category; /// Feeding or Output public int StableTimeMs; /// 200..1500 ms public int FlowStableSec; /// 0..60 sec public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions diff --git a/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs b/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs index 1e47bc3c8..664dfa117 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs @@ -46,7 +46,6 @@ namespace TBF.BenchControl.Elde.RegulValveCoax } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -95,8 +94,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax message += Environment.NewLine + "Invalid 'Parent Name'"; } - if (!categoryComboBox.Text.Equals(ValveCategory.All.ToString()) && - !categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && + if (!categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && !categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) { flags |= CfgUpdateFlags.Error; @@ -144,11 +142,10 @@ namespace TBF.BenchControl.Elde.RegulValveCoax } ValveCategory newCategory; - if (categoryComboBox.Text.Equals(ValveCategory.All.ToString())) newCategory = ValveCategory.All; - else if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; - else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) newCategory = ValveCategory.Bench; - else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; - else newCategory = ValveCategory.None; + if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; + else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; + else newCategory = ValveCategory.None; + if (newCategory != config.Category) { config.Category = newCategory; diff --git a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfg.cs b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfg.cs index 463d7fde0..a32043026 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfg.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfg.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2016 Sensus Metering Systems +/// Copyright (c) 2013-2020 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem /// /// Serialized parameters /// - public ValveCategory Category; /// Feeding, Output or All + public ValveCategory Category; /// Feeding, Output or None public string RegulValveName; /// Name of the regulation valve used to control the flow public string FixedRVName; /// Name of the regulation valve with a fixed position public float FixedRVPosition; /// Fixed RV position 0 .. 100 in [%] diff --git a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs index f2853e535..0afddf6c8 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs @@ -47,9 +47,9 @@ namespace TBF.BenchControl.Elde.RegulValveTandem } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); + categoryComboBox.Items.Add(ValveCategory.None.ToString()); Redraw(); } @@ -87,9 +87,9 @@ namespace TBF.BenchControl.Elde.RegulValveTandem { CfgUpdateFlags flags = CfgUpdateFlags.None; - if (!categoryComboBox.Text.Equals(ValveCategory.All.ToString()) && - !categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && - !categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) + if (!categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString()) && + !categoryComboBox.Text.Equals(ValveCategory.Output.ToString()) && + !categoryComboBox.Text.Equals(ValveCategory.None.ToString())) { flags |= CfgUpdateFlags.Error; message += Environment.NewLine + "Invalid 'Category'"; @@ -136,11 +136,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem } ValveCategory newCategory; - if (categoryComboBox.Text.Equals(ValveCategory.All.ToString())) newCategory = ValveCategory.All; - else if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; - else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) newCategory = ValveCategory.Bench; - else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; - else newCategory = ValveCategory.None; + if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; + else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; + else newCategory = ValveCategory.None; + if (newCategory != config.Category) { config.Category = newCategory; diff --git a/TBF/BenchControl/Elde/Valve/ValveCfg.cs b/TBF/BenchControl/Elde/Valve/ValveCfg.cs index 3b8f3b80a..a2b443763 100644 --- a/TBF/BenchControl/Elde/Valve/ValveCfg.cs +++ b/TBF/BenchControl/Elde/Valve/ValveCfg.cs @@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde.Valve /// Serialized parameters /// public int BitPosition; /// Bit-position - public ValveCategory Category; /// None, Feeding, Bench or Output + public ValveCategory Category; /// Feeding, Bench, Output or None public int OpenCloseTime; /// Delay for SetValvesOp operations public bool Inverted; /// The valve is inverted: 0=open, 1=closed /// diff --git a/TBF/BenchControl/Elde/Valve/ValveCfgCtrl.cs b/TBF/BenchControl/Elde/Valve/ValveCfgCtrl.cs index 6106bcbf5..8e7c8666a 100644 --- a/TBF/BenchControl/Elde/Valve/ValveCfgCtrl.cs +++ b/TBF/BenchControl/Elde/Valve/ValveCfgCtrl.cs @@ -35,7 +35,6 @@ namespace TBF.BenchControl.Elde.Valve parent = ParentForm as ComponentParametersDlg; if (parent == null) return; - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Bench.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -111,11 +110,10 @@ namespace TBF.BenchControl.Elde.Valve int newOpenCloseTime = int.Parse(openCloseTimeTextBox.Text); ValveCategory newCategory; - if (categoryComboBox.Text.Equals(ValveCategory.All.ToString())) newCategory = ValveCategory.All; - else if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; - else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) newCategory = ValveCategory.Bench; + if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) newCategory = ValveCategory.Feeding; + else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) newCategory = ValveCategory.Bench; else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) newCategory = ValveCategory.Output; - else newCategory = ValveCategory.None; + else newCategory = ValveCategory.None; if (config.Name != nameTextBox.Text || config.ParentName != newParentName || diff --git a/TBF/BenchControl/Events.cs b/TBF/BenchControl/Events.cs index 6b7afba8a..a3d74dde3 100644 --- a/TBF/BenchControl/Events.cs +++ b/TBF/BenchControl/Events.cs @@ -35,11 +35,10 @@ namespace TBF.BenchControl public enum ValveCategory { - All = 0, /// Valve will be shown in all paths Feeding, /// Valve will be shown in Feeding paths Bench, /// Valve will be shown in Bench paths Output, /// Valve will be shown in Output paths - None, /// Valve will not be shown in the paths + None, /// Valve will not be shown in any path } public enum ValveExOperation diff --git a/TBF/BenchControl/FeedingPath.cs b/TBF/BenchControl/FeedingPath.cs index 9bc37a9b4..c969f06b2 100644 --- a/TBF/BenchControl/FeedingPath.cs +++ b/TBF/BenchControl/FeedingPath.cs @@ -43,7 +43,7 @@ namespace TBF.BenchControl foreach (var cmpnt in components) { IRegulValve regValve = cmpnt as IRegulValve; - if (regValve != null && (regValve.Category == TBF.BenchControl.ValveCategory.Feeding || regValve.Category == TBF.BenchControl.ValveCategory.All)) + if (regValve != null && regValve.Category == TBF.BenchControl.ValveCategory.Feeding) { RegulValves.Add(regValve); } diff --git a/TBF/BenchControl/Sequences/SequenceBase.cs b/TBF/BenchControl/Sequences/SequenceBase.cs index e2f1ffa55..3dc0d70f4 100644 --- a/TBF/BenchControl/Sequences/SequenceBase.cs +++ b/TBF/BenchControl/Sequences/SequenceBase.cs @@ -39,7 +39,8 @@ namespace TBF.BenchControl.Sequences ///------------------------------------------------------------ public static IList FlowMeters; /// list of reference flowmeters public static IList RegulValves; /// list of regulation valves - public static IList OutputRegulValves; /// list of regulation valves + public static IList FeedingRegulValves; /// list of feeding regulation valves + public static IList OutputRegulValves; /// list of output 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 @@ -608,9 +609,10 @@ namespace TBF.BenchControl.Sequences log.Info(activity + " " +step.Message); //------------------------------------------------ - /// + /// Prepare operation to switch valves + IOperation setValvesOp = StateMachine.ControlBoard.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step)); + /// Fetch the condition operation, null value is allowed if there is no condition - /// IOperation conditionOperation = null; if (step.EndCondition != "None") { @@ -658,7 +660,7 @@ namespace TBF.BenchControl.Sequences .Create(string.Format("SequenceBase.Transition() : Step {0} start, opening={1}, closing={2}", step.ItemNr + 1, step.ValvesOpen, step.ValvesClose)) .AddOperation(checkUiOp) .AddOperation(conditionOperation) - .AddOperation(StateMachine.ControlBoard.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step))); + .AddOperation(setValvesOp); for (int j = 0; j <= i; j++) { stepStrt.AddOperation(rvPosOps[j]); @@ -678,7 +680,7 @@ namespace TBF.BenchControl.Sequences .Create(string.Format("SequenceBase.Transition() : Step {0} delay {1}s, opening={2}, closing={3}", step.ItemNr + 1, delay, step.ValvesOpen, step.ValvesClose)) .AddOperation(checkUiOp) .AddOperation(conditionOperation) - .AddOperation(StateMachine.ControlBoard.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step))) + .AddOperation(setValvesOp) .AddOperation(new TimerOp(delay)); for (int j = 0; j <= lastStartedRV; j++) { @@ -723,7 +725,7 @@ namespace TBF.BenchControl.Sequences .Create(string.Format("SequenceBase.Transition() : Step {0} stop, opening={1}, closing={2}", step.ItemNr + 1, step.ValvesOpen, step.ValvesClose)) .AddOperation(checkUiOp) .AddOperation(conditionOperation) - .AddOperation(StateMachine.ControlBoard.SetValvesOp(Utils.ValvesOpen(step), Utils.ValvesClose(step))); + .AddOperation(setValvesOp); for (int j = first; j <= lastStartedRV; j++) { stepStop.AddOperation(rvPosOps[j]); @@ -839,13 +841,14 @@ namespace TBF.BenchControl.Sequences bool errorFlag = false; IList e; + IOperation setValvesOp = StateMachine.ControlBoard.SetValvesOp(valvesToOpen, valvesToClose); int lastStartedRV = -1; for (int i = 0; i < rvPosOps.Count; i++) { State stepStrt = State.Create(stateTitle) .AddOperation(checkUiOp) - .AddOperation(StateMachine.ControlBoard.SetValvesOp(valvesToOpen, valvesToClose)); + .AddOperation(setValvesOp); for (int j = 0; j <= i; j++) stepStrt.AddOperation(rvPosOps[j]); lastStartedRV = i; stepStrt.EnterState(); @@ -862,7 +865,7 @@ namespace TBF.BenchControl.Sequences { State stepRegul = State.Create(stateTitle) .AddOperation(checkUiOp) - .AddOperation(StateMachine.ControlBoard.SetValvesOp(valvesToOpen, valvesToClose)); + .AddOperation(setValvesOp); for (int j = 0; j <= lastStartedRV; j++) stepRegul.AddOperation(rvPosOps[j]); stepRegul.EnterState(); @@ -879,7 +882,7 @@ namespace TBF.BenchControl.Sequences { State stepStop = State.Create(stateTitle) .AddOperation(checkUiOp) - .AddOperation(StateMachine.ControlBoard.SetValvesOp(valvesToOpen, valvesToClose)); + .AddOperation(setValvesOp); for (int j = first; j <= lastStartedRV; j++) stepStop.AddOperation(rvPosOps[j]); stepStop.EnterState(); diff --git a/TBF/BenchControl/StateMachine.cs b/TBF/BenchControl/StateMachine.cs index 0dccc115d..710a9678d 100644 --- a/TBF/BenchControl/StateMachine.cs +++ b/TBF/BenchControl/StateMachine.cs @@ -223,6 +223,7 @@ namespace TBF.BenchControl ProcessData.IperlHeads = new List(); SequenceBase.FlowMeters = new List(); SequenceBase.RegulValves = new List(); + SequenceBase.FeedingRegulValves = new List(); SequenceBase.OutputRegulValves = new List(); SequenceBase.PumpsWithFM = new List(); SequenceBase.WaterMeters = new List(); @@ -248,7 +249,8 @@ namespace TBF.BenchControl { IRegulValve rv = cmpnt as IRegulValve; SequenceBase.RegulValves.Add(rv); - if (rv.Category == ValveCategory.Output || rv.Category == ValveCategory.All) SequenceBase.OutputRegulValves.Add(rv); + if (rv.Category == ValveCategory.Feeding) SequenceBase.FeedingRegulValves.Add(rv); + if (rv.Category == ValveCategory.Output) SequenceBase.OutputRegulValves.Add(rv); } if (cmpnt is IPumpFM && !(cmpnt is Elde.PumpTandem.Pump)) { diff --git a/TBF/UI/Bench/Paths/PathsBenchCtrl.cs b/TBF/UI/Bench/Paths/PathsBenchCtrl.cs index e23c0b624..4f716af37 100644 --- a/TBF/UI/Bench/Paths/PathsBenchCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsBenchCtrl.cs @@ -78,7 +78,7 @@ namespace TBF.UI.Bench.Paths int clmn = (int)Column.FixedColumnsCount; foreach (var vlv in parent.Valves) { - if (vlv.Category == ValveCategory.All || vlv.Category == ValveCategory.Bench) + if (vlv.Category == ValveCategory.Bench) { Columns.Add(vlv.Cfg.Name, (ls.BenchColumnCount > clmn) ? ls.BenchColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct); clmn++; @@ -207,7 +207,7 @@ namespace TBF.UI.Bench.Paths foreach (var valve in parent.Valves) { - if (valve.Category == ValveCategory.All || valve.Category == ValveCategory.Bench) + if (valve.Category == ValveCategory.Bench) { if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { @@ -258,7 +258,7 @@ namespace TBF.UI.Bench.Paths int k = 0; for (int j = 0; j < parent.Valves.Count; j++) { - if (parent.Valves[j].Category == ValveCategory.All || parent.Valves[j].Category == ValveCategory.Bench) + if (parent.Valves[j].Category == ValveCategory.Bench) { string text = lvi.SubItems[fixedColumnsCount + k].Text; if (text.Equals(Strings.open)) diff --git a/TBF/UI/Bench/Paths/PathsDlg.cs b/TBF/UI/Bench/Paths/PathsDlg.cs index 44fa10c88..294a01062 100644 --- a/TBF/UI/Bench/Paths/PathsDlg.cs +++ b/TBF/UI/Bench/Paths/PathsDlg.cs @@ -9,6 +9,7 @@ using NHibernate; using log4net; using Config.Entities; using Results.Forms; +using TBF.BenchControl; using TBF.BenchControl.GenericDevices; using TBF.Resources; using TBF.UI.Shared; @@ -83,17 +84,14 @@ namespace TBF.UI.Bench.Paths foreach (var cmpnt in TbfComponents) { IRegulValve regValve = cmpnt as IRegulValve; - if (regValve != null) + if (regValve != null && !(cmpnt is TBF.BenchControl.Elde.RegulValveTandem.RegulValveTandem)) { switch (regValve.Category) { - case TBF.BenchControl.ValveCategory.Feeding: + case ValveCategory.Feeding: FeedingRegulValves.Add(regValve); break; - case TBF.BenchControl.ValveCategory.Output: - OutputRegulValves.Add(regValve); - break; - case TBF.BenchControl.ValveCategory.All: + case ValveCategory.Output: OutputRegulValves.Add(regValve); break; } diff --git a/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs b/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs index 0f7d1de42..ac6fa4be4 100644 --- a/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs @@ -77,7 +77,7 @@ namespace TBF.UI.Bench.Paths foreach (var vlv in parent.Valves) { - if (vlv.Category == TBF.BenchControl.ValveCategory.All || vlv.Category == TBF.BenchControl.ValveCategory.Feeding) + if (vlv.Category == TBF.BenchControl.ValveCategory.Feeding) { Columns.Add(vlv.Cfg.Name, (ls.FeedingColumnCount > clmn) ? ls.FeedingColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct); clmn++; @@ -197,7 +197,7 @@ namespace TBF.UI.Bench.Paths foreach (var valve in parent.Valves) { - if (valve.Category == TBF.BenchControl.ValveCategory.All || valve.Category == TBF.BenchControl.ValveCategory.Feeding) + if (valve.Category == TBF.BenchControl.ValveCategory.Feeding) { if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { @@ -266,7 +266,7 @@ namespace TBF.UI.Bench.Paths int k = 0; for (int j = 0; j < parent.Valves.Count; j++) { - if (parent.Valves[j].Category == TBF.BenchControl.ValveCategory.All || parent.Valves[j].Category == TBF.BenchControl.ValveCategory.Feeding) + if (parent.Valves[j].Category == TBF.BenchControl.ValveCategory.Feeding) { string text = lvi.SubItems[fixedColumnsCount + regvCount + k].Text; if (text.Equals(Strings.open)) diff --git a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs index aa48b7a94..3e0089282 100644 --- a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs @@ -101,7 +101,7 @@ namespace TBF.UI.Bench.Paths /// foreach (var vlv in parent.Valves) { - if (vlv.Category == ValveCategory.All || vlv.Category == ValveCategory.Output) + if (vlv.Category == ValveCategory.Output) { Columns.Add(vlv.Cfg.Name, (ls.OutputColumnCount > clmn) ? ls.OutputColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct); clmn++; @@ -288,7 +288,7 @@ namespace TBF.UI.Bench.Paths foreach (var valve in parent.Valves) { int subItemNr = lvi.SubItems.Count; - if (valve.Category == ValveCategory.All || valve.Category == ValveCategory.Output) + if (valve.Category == ValveCategory.Output) { if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { @@ -372,7 +372,7 @@ namespace TBF.UI.Bench.Paths int k = 0; foreach (var valve in parent.Valves) { - if (valve.Category == ValveCategory.All || valve.Category == ValveCategory.Output) + if (valve.Category == ValveCategory.Output) { string text = lvi.SubItems[fixedColumnsCount + k].Text; if (text.Equals(Strings.open))