Paths : Selector : UI changes.

This commit is contained in:
Milan Hanajik
2021-04-13 15:35:38 +02:00
parent 5aec3c1ecc
commit 1dc35e6135
6 changed files with 40 additions and 18 deletions
+11 -5
View File
@@ -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;