diff --git a/TBF/Rig/BenchPath.cs b/TBF/Rig/BenchPath.cs index cd91c0e9e..5f8f4dfd6 100644 --- a/TBF/Rig/BenchPath.cs +++ b/TBF/Rig/BenchPath.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2015 Sensus Metering Systems +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System.Collections.Generic; using TBF.Rig.GenericDevices; @@ -12,6 +12,7 @@ namespace TBF.Rig public string Name; public float Qfrom; public float Qto; + public string Selector; public ITempMeter TempMtrUp; public ITempMeter TempMtrDown; public IPressureMeter PressMtrUp; @@ -36,6 +37,7 @@ namespace TBF.Rig { Qfrom = entity.Qfrom; Qto = entity.Qto; + Selector = entity.Selector; TempMtrUp = TbfComponents.FindComponent(entity.TempMtrUp, components) as ITempMeter; TempMtrDown = TbfComponents.FindComponent(entity.TempMtrDown, components) as ITempMeter; PressMtrUp = TbfComponents.FindComponent(entity.PressMtrUp, components) as IPressureMeter; diff --git a/TBF/Rig/FeedingPath.cs b/TBF/Rig/FeedingPath.cs index cfd142ca9..bcaeba079 100644 --- a/TBF/Rig/FeedingPath.cs +++ b/TBF/Rig/FeedingPath.cs @@ -12,7 +12,8 @@ namespace TBF.Rig public string Name; public float Qfrom; public float Qto; - public IValve Pump; /// pump to use with this path or null + public string Selector; + public IValve Pump; /// pump to use with this path or null public IList RegulValves; public IList RegulValvesPct; public IList ValvesOpen; /// a list of valves to open or null @@ -35,7 +36,8 @@ namespace TBF.Rig { Qfrom = entity.Qfrom; Qto = entity.Qto; - Pump = (IValve)TbfComponents.FindComponent(entity.Pump, components); + Selector = entity.Selector; + Pump = (IValve)TbfComponents.FindComponent(entity.Pump, components); /// /// Feeding regulation valve components diff --git a/TBF/Rig/OutputPath.cs b/TBF/Rig/OutputPath.cs index 077b6d8de..6a866a686 100644 --- a/TBF/Rig/OutputPath.cs +++ b/TBF/Rig/OutputPath.cs @@ -12,6 +12,7 @@ namespace TBF.Rig public string Name; public float Qfrom; public float Qto; + public string Selector; public IFlowMeter FlowMeter; public IRegValve RegValve; public float PidCoef; @@ -44,6 +45,7 @@ namespace TBF.Rig { Qfrom = entity.Qfrom; Qto = entity.Qto; + Selector = entity.Selector; FlowMeter = (IFlowMeter)TbfComponents.FindComponent(entity.FlowMeter, components); RegValve = (IRegValve)TbfComponents.FindComponent(entity.RegValve, components); PidCoef = entity.PidCoef; diff --git a/TBF/UI/Bench/Paths/PathsBenchCtrl.cs b/TBF/UI/Bench/Paths/PathsBenchCtrl.cs index 14cdc75d1..149cf86a4 100644 --- a/TBF/UI/Bench/Paths/PathsBenchCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsBenchCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Slovensko a.s. +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -28,6 +28,7 @@ namespace TBF.UI.Bench.Paths Name, Qfrom, Qto, + Selector, Tup, Tdown, Pup, @@ -67,8 +68,9 @@ namespace TBF.UI.Bench.Paths /// ListViewEx columns TBF.LocalSettings ls = Program.LocalSettings; Columns.Add(Strings.Name, (ls.BenchColumnCount > 0) ? ls.BenchColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); - Columns.Add(string.Format("{0} [m3/h]", Strings.Q_from), (ls.BenchColumnCount > 1) ? ls.BenchColumnWidths[1] : 50 * parent.Dpi / Constants.Dpi100pct); - Columns.Add(string.Format("{0} [m3/h]", Strings.Q_to), (ls.BenchColumnCount > 2) ? ls.BenchColumnWidths[2] : 50 * parent.Dpi / Constants.Dpi100pct); + Columns.Add(string.Format("{0} [m3/h]", Strings.Q_from), (ls.BenchColumnCount > 1) ? ls.BenchColumnWidths[1] : 80 * parent.Dpi / Constants.Dpi100pct); + Columns.Add(string.Format("{0} [m3/h]", Strings.Q_to), (ls.BenchColumnCount > 2) ? ls.BenchColumnWidths[2] : 80 * parent.Dpi / Constants.Dpi100pct); + Columns.Add("Selector", (ls.BenchColumnCount > 0) ? ls.BenchColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.T_in, (ls.BenchColumnCount > 3) ? ls.BenchColumnWidths[3] : 50 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.T_out, (ls.BenchColumnCount > 4) ? ls.BenchColumnWidths[4] : 50 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.P_in, (ls.BenchColumnCount > 5) ? ls.BenchColumnWidths[5] : 50 * parent.Dpi / Constants.Dpi100pct); @@ -117,7 +119,8 @@ namespace TBF.UI.Bench.Paths editors[(int)Column.Name] = new TextBox(); /// Name editors[(int)Column.Qfrom] = new TextBox(); /// Q_from editors[(int)Column.Qto] = new TextBox(); /// Q_to - editors[(int)Column.Tup] = tUpCBox; + editors[(int)Column.Selector] = new TextBox(); /// Selector + editors[(int)Column.Tup] = tUpCBox; editors[(int)Column.Tdown] = tDownCBox; editors[(int)Column.Pup] = prUpCBox; editors[(int)Column.Pdown] = prDownCBox; @@ -190,7 +193,7 @@ namespace TBF.UI.Bench.Paths public override void DrawOne(object myItem) { - Config.Entities.BenchPath entity =(Config.Entities.BenchPath)myItem; + Config.Entities.BenchPath entity = (Config.Entities.BenchPath)myItem; Rig.BenchPath path = new Rig.BenchPath(entity, parent.TbfComponents); ListViewItem lvi = new ListViewItem(entity.Name); @@ -198,7 +201,8 @@ namespace TBF.UI.Bench.Paths lvi.SubItems.Add(path.Qfrom.ToString()); lvi.SubItems.Add(path.Qto.ToString()); - lvi.SubItems.Add(path.TempMtrUp != null ? path.TempMtrUp.Cfg.Name : "---"); + lvi.SubItems.Add(path.Selector); + lvi.SubItems.Add(path.TempMtrUp != null ? path.TempMtrUp.Cfg.Name : "---"); lvi.SubItems.Add(path.TempMtrDown != null ? path.TempMtrDown.Cfg.Name : "---"); lvi.SubItems.Add(path.PressMtrUp != null ? path.PressMtrUp.Cfg.Name : "---"); lvi.SubItems.Add(path.PressMtrDown != null ? path.PressMtrDown.Cfg.Name : "---"); @@ -246,6 +250,7 @@ namespace TBF.UI.Bench.Paths allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); entity.Qto = Qto; + entity.Selector = lvi.SubItems[(int)Column.Selector].Text; entity.TempMtrUp = lvi.SubItems[(int)Column.Tup].Text; entity.TempMtrDown = lvi.SubItems[(int)Column.Tdown].Text; entity.PressMtrUp = lvi.SubItems[(int)Column.Pup].Text; diff --git a/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs b/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs index ccbcdf6fc..8dee44a40 100644 --- a/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsFeedingCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Slovensko a.s. +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -27,6 +27,7 @@ namespace TBF.UI.Bench.Paths Name, Qfrom, Qto, + Selector, Pump, FixedColumnsCount, } @@ -63,8 +64,9 @@ namespace TBF.UI.Bench.Paths /// ListViewEx columns TBF.LocalSettings ls = Program.LocalSettings; Columns.Add(Strings.Name, (ls.FeedingColumnCount > 0) ? ls.FeedingColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); - Columns.Add(string.Format("{0} [m3/h]", Strings.Q_from), (ls.FeedingColumnCount > 1) ? ls.FeedingColumnWidths[1] : 50 * parent.Dpi / Constants.Dpi100pct); - Columns.Add(string.Format("{0} [m3/h]", Strings.Q_to), (ls.FeedingColumnCount > 2) ? ls.FeedingColumnWidths[2] : 50 * parent.Dpi / Constants.Dpi100pct); + Columns.Add(string.Format("{0} [m3/h]", Strings.Q_from), (ls.FeedingColumnCount > 1) ? ls.FeedingColumnWidths[1] : 80 * parent.Dpi / Constants.Dpi100pct); + Columns.Add(string.Format("{0} [m3/h]", Strings.Q_to), (ls.FeedingColumnCount > 2) ? ls.FeedingColumnWidths[2] : 80 * parent.Dpi / Constants.Dpi100pct); + Columns.Add("Selector", (ls.FeedingColumnCount > 0) ? ls.FeedingColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.Pump, (ls.FeedingColumnCount > 3) ? ls.FeedingColumnWidths[3] : 60 * parent.Dpi / Constants.Dpi100pct); int clmn = (int)Column.FixedColumnsCount; @@ -98,7 +100,8 @@ namespace TBF.UI.Bench.Paths editors[(int)Column.Name] = new TextBox(); /// Name editors[(int)Column.Qfrom] = new TextBox(); /// Q_from editors[(int)Column.Qto] = new TextBox(); /// Q_to - editors[(int)Column.Pump] = pumpCBox; + editors[(int)Column.Selector] = new TextBox(); /// Selector + editors[(int)Column.Pump] = pumpCBox; for (int i = 0; i < regvCount; i++) { ComboBox cb = new ComboBox(); @@ -186,6 +189,7 @@ namespace TBF.UI.Bench.Paths lvi.SubItems.Add(path.Qfrom.ToString()); lvi.SubItems.Add(path.Qto.ToString()); + lvi.SubItems.Add(path.Selector); lvi.SubItems.Add(path.Pump != null ? path.Pump.Cfg.Name : "---"); string[] rvPosStr = (entity.RegVPositions != null) ? entity.RegVPositions.Split(new char[] {';'}) @@ -236,7 +240,9 @@ namespace TBF.UI.Bench.Paths allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); entity.Qto = Qto; - ComboBox pumpCB = editors[(int)Column.Pump] as ComboBox; + entity.Selector = lvi.SubItems[(int)Column.Selector].Text; + + ComboBox pumpCB = editors[(int)Column.Pump] as ComboBox; if (pumpCB.Items.Contains(lvi.SubItems[(int)Column.Pump].Text)) { entity.Pump = lvi.SubItems[(int)Column.Pump].Text.Equals("---") ? string.Empty : lvi.SubItems[(int)Column.Pump].Text; diff --git a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs index e628b2e05..fdf9b857d 100644 --- a/TBF/UI/Bench/Paths/PathsOutputCtrl.cs +++ b/TBF/UI/Bench/Paths/PathsOutputCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Slovensko a.s. +/// Copyright (c) 2013-2021 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -27,6 +27,7 @@ namespace TBF.UI.Bench.Paths Name, Qfrom, Qto, + Selector, RefFlowmtr, RegulValve, PidCoef, @@ -74,8 +75,9 @@ namespace TBF.UI.Bench.Paths /// ListViewEx columns TBF.LocalSettings ls = Program.LocalSettings; Columns.Add(Strings.Name, (ls.OutputColumnCount > 0) ? ls.OutputColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); - Columns.Add(string.Format("{0} [m3/h]", Strings.Q_from), (ls.OutputColumnCount > 1) ? ls.OutputColumnWidths[1] : 50 * parent.Dpi / Constants.Dpi100pct); - Columns.Add(string.Format("{0} [m3/h]", Strings.Q_to), (ls.OutputColumnCount > 2) ? ls.OutputColumnWidths[2] : 50 * parent.Dpi / Constants.Dpi100pct); + Columns.Add(string.Format("{0} [m3/h]", Strings.Q_from), (ls.OutputColumnCount > 1) ? ls.OutputColumnWidths[1] : 80 * parent.Dpi / Constants.Dpi100pct); + Columns.Add(string.Format("{0} [m3/h]", Strings.Q_to), (ls.OutputColumnCount > 2) ? ls.OutputColumnWidths[2] : 80 * parent.Dpi / Constants.Dpi100pct); + Columns.Add("Selector", (ls.OutputColumnCount > 0) ? ls.OutputColumnWidths[0] : 60 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.Flowmeter, (ls.OutputColumnCount > 3) ? ls.OutputColumnWidths[3] : 85 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.Reg_valve, (ls.OutputColumnCount > 4) ? ls.OutputColumnWidths[4] : 80 * parent.Dpi / Constants.Dpi100pct); Columns.Add(Strings.PID, (ls.OutputColumnCount > 5) ? ls.OutputColumnWidths[5] : 50 * parent.Dpi / Constants.Dpi100pct); @@ -148,7 +150,8 @@ namespace TBF.UI.Bench.Paths editors[(int)Column.Name] = new TextBox(); /// Name editors[(int)Column.Qfrom] = new TextBox(); /// Q_from editors[(int)Column.Qto] = new TextBox(); /// Q_to - editors[(int)Column.RefFlowmtr] = flowMeterComboBox; + editors[(int)Column.Selector] = new TextBox(); /// Selector + editors[(int)Column.RefFlowmtr] = flowMeterComboBox; editors[(int)Column.RegulValve] = regulValveComboBox; editors[(int)Column.PidCoef] = new TextBox(); /// PID editors[(int)Column.Div] = diverterComboBox; @@ -237,6 +240,7 @@ namespace TBF.UI.Bench.Paths lvi.SubItems.Add(path.Qfrom.ToString()); lvi.SubItems.Add(path.Qto.ToString()); + lvi.SubItems.Add(path.Selector); lvi.SubItems.Add((path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : "---"); lvi.SubItems.Add((path.RegValve != null) ? path.RegValve.Cfg.Name : "---"); lvi.SubItems.Add(path.PidCoef.ToString("F1")); @@ -295,6 +299,7 @@ namespace TBF.UI.Bench.Paths allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto); entity.Qto = Qto; + entity.Selector = lvi.SubItems[(int)Column.Selector].Text; entity.FlowMeter = lvi.SubItems[(int)Column.RefFlowmtr].Text.Equals("---") ? null : lvi.SubItems[(int)Column.RefFlowmtr].Text; entity.RegValve = lvi.SubItems[(int)Column.RegulValve].Text.Equals("---") ? null : lvi.SubItems[(int)Column.RegulValve].Text;