Config.Entities.OutputPath.RegVPositions added, UI and SequenceBase changes, ver. 3.4.1975

This commit is contained in:
Milan Hanajik
2022-10-28 15:03:58 +02:00
parent 0f738be73e
commit ac5684a2b5
15 changed files with 348 additions and 163 deletions
+12 -12
View File
@@ -76,18 +76,18 @@ namespace TBF.UI.Bench.Paths
Columns.Add(Strings.Pump, (ls.FeedingColumnCount > 5) ? ls.FeedingColumnWidths[5] : 60 * parent.Dpi / Constants.Dpi100pct);
int clmn = (int)Column.FixedColumnsCount;
foreach (var rv in parent.FeedingRegulValves)
foreach (var rv in parent.FeedingRegValves)
{
Columns.Add(rv.Cfg.Name, (ls.FeedingColumnCount > clmn) ? ls.FeedingColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(string.Format("{0} [%]", rv.Name), (ls.FeedingColumnCount > clmn) ? ls.FeedingColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct);
clmn++;
}
regvCount = clmn - (int)Column.FixedColumnsCount;
regvCount = parent.FeedingRegValves.Count;
foreach (var vlv in parent.Valves)
{
if (vlv.Category == TBF.Rig.ValveCategory.Feeding)
{
Columns.Add(vlv.Cfg.Name, (ls.FeedingColumnCount > clmn) ? ls.FeedingColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct);
Columns.Add(vlv.Name, (ls.FeedingColumnCount > clmn) ? ls.FeedingColumnWidths[clmn] : 50 * parent.Dpi / Constants.Dpi100pct);
clmn++;
}
}
@@ -105,7 +105,7 @@ namespace TBF.UI.Bench.Paths
if (cmpnt is IPump) pumpCBox.Items.Add(cmpnt.Cfg.Name);
}
editors = new Control[fixedColumnsCount + regvCount + 64];
editors = new Control[fixedColumnsCount + regvCount + valvesCount];
///
editors[(int)Column.Name] = new TextBox(); /// Name
editors[(int)Column.Qfrom] = new TextBox(); /// Q_from
@@ -125,8 +125,8 @@ namespace TBF.UI.Bench.Paths
editors[fixedColumnsCount + i] = cb;
}
/// Prepare valve combo-boxes (max. 64 valves)
for (int i = 0; i < 64; i++)
/// Prepare valve combo-boxes
for (int i = 0; i < valvesCount; i++)
{
ComboBox cb = new ComboBox();
cb.Items.Add("---");
@@ -264,7 +264,7 @@ namespace TBF.UI.Bench.Paths
lvi.SubItems.Add(path.Pump != null ? path.Pump.Cfg.Name : "---");
string[] rvPosStr = (entity.RegVPositions != null) ? entity.RegVPositions.Split(new char[] {';'})
: new string[0];
: new string[0];
for (int i = 0; i < regvCount; i++)
{
lvi.SubItems.Add((i < rvPosStr.Length) ? rvPosStr[i] : "---");
@@ -322,18 +322,18 @@ namespace TBF.UI.Bench.Paths
///
/// Regulation valves
///
string regulValvesPct = string.Empty;
string regulVPositions = string.Empty;
for (int i = fixedColumnsCount; i < fixedColumnsCount + regvCount; i++)
{
if (regulValvesPct.Length > 0) regulValvesPct += ";";
if (regulVPositions.Length > 0) regulVPositions += ";";
float fdummy;
if (lvi.SubItems[i].Text.Equals("---") ||
(Utils.TryParseUFloat(lvi.SubItems[i].Text, out fdummy) && (fdummy >= 0) && (fdummy <= 100.0f)))
{
regulValvesPct += lvi.SubItems[i].Text;
regulVPositions += lvi.SubItems[i].Text;
}
}
entity.RegVPositions = regulValvesPct;
entity.RegVPositions = regulVPositions;
///
/// Valves