diff --git a/TBF/BenchControl/BuiltIn/Valve/ValveCfgCtrl.cs b/TBF/BenchControl/BuiltIn/Valve/ValveCfgCtrl.cs index 7e7d53638..104cf494d 100644 --- a/TBF/BenchControl/BuiltIn/Valve/ValveCfgCtrl.cs +++ b/TBF/BenchControl/BuiltIn/Valve/ValveCfgCtrl.cs @@ -37,7 +37,6 @@ namespace TBF.BenchControl.BuiltIn.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()); @@ -113,8 +112,7 @@ namespace TBF.BenchControl.BuiltIn.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; + 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; diff --git a/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs b/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs index 9908c509f..e92d57de8 100644 --- a/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs +++ b/TBF/BenchControl/Dummy/RegulValve/RegulValveCfgCtrl.cs @@ -33,7 +33,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()); @@ -63,8 +62,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; @@ -87,9 +85,7 @@ 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) diff --git a/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs b/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs index 6d20dfc03..42e770ca8 100644 --- a/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs +++ b/TBF/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs @@ -50,7 +50,6 @@ namespace TBF.BenchControl.Elde.RegulValve } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -130,8 +129,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; @@ -197,9 +195,7 @@ 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; + 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) diff --git a/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs b/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs index 048f62992..8c76b9428 100644 --- a/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs +++ b/TBF/BenchControl/Elde/RegulValveCoax/RegulValveCfgCtrl.cs @@ -47,7 +47,6 @@ namespace TBF.BenchControl.Elde.RegulValveCoax } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -107,8 +106,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax flags |= CfgUpdateFlags.Error; 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; @@ -158,9 +156,7 @@ 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; + 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) diff --git a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs index eb28e8b07..06a510e7d 100644 --- a/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs +++ b/TBF/BenchControl/Elde/RegulValveTandem/RegulValveTandemCfgCtrl.cs @@ -48,7 +48,6 @@ namespace TBF.BenchControl.Elde.RegulValveTandem } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -88,8 +87,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem { 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; @@ -137,9 +135,7 @@ 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; + 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) diff --git a/TBF/BenchControl/Events.cs b/TBF/BenchControl/Events.cs index 6b7afba8a..33593d5e0 100644 --- a/TBF/BenchControl/Events.cs +++ b/TBF/BenchControl/Events.cs @@ -35,7 +35,6 @@ 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 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/Uni/RegValve/RegValveCfgCtrl.cs b/TBF/BenchControl/Uni/RegValve/RegValveCfgCtrl.cs index 3db7cc123..4bc6025d9 100644 --- a/TBF/BenchControl/Uni/RegValve/RegValveCfgCtrl.cs +++ b/TBF/BenchControl/Uni/RegValve/RegValveCfgCtrl.cs @@ -50,7 +50,6 @@ namespace TBF.BenchControl.Uni.RegValve } } - categoryComboBox.Items.Add(ValveCategory.All.ToString()); categoryComboBox.Items.Add(ValveCategory.Feeding.ToString()); categoryComboBox.Items.Add(ValveCategory.Output.ToString()); @@ -130,8 +129,7 @@ namespace TBF.BenchControl.Uni.RegValve 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; @@ -197,9 +195,7 @@ namespace TBF.BenchControl.Uni.RegValve } 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) 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 03828b47d..8f887f1c9 100644 --- a/TBF/UI/Bench/Paths/PathsDlg.cs +++ b/TBF/UI/Bench/Paths/PathsDlg.cs @@ -75,7 +75,7 @@ namespace TBF.UI.Bench.Paths foreach (var cmpnt in TbfComponents) { 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) { FeedingRegulValves.Add(regValve); } 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 87c226187..8e1e8e3b7 100644 --- a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs @@ -93,7 +93,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.Output) + if (vlv.Category == ValveCategory.Output) { Columns.Add(vlv.Cfg.Name, (ls.OutputColumnCount > clmn) ? ls.OutputColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct); clmn++; @@ -256,7 +256,7 @@ namespace TBF.UI.Bench.Paths foreach (var valve in parent.Valves) { - if (valve.Category == ValveCategory.All || valve.Category == ValveCategory.Output) + if (valve.Category == ValveCategory.Output) { if (path.ValvesOpen != null && path.ValvesOpen.Contains(valve)) { @@ -324,7 +324,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.Output) + if (parent.Valves[j].Category == ValveCategory.Output) { string text = lvi.SubItems[fixedColumnsCount + k].Text; if (text.Equals(Strings.open))