- reconfigured to use Munich component and 5 watermeters

- valve categories used in paths, Category property added to IValve
This commit is contained in:
Milan Hanajik
2014-09-02 18:10:16 +02:00
parent c767512fad
commit 08468e60d6
22 changed files with 868 additions and 689 deletions
@@ -31,6 +31,12 @@ 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());
categoryComboBox.Items.Add(ValveCategory.None.ToString());
if (parent.TbfComponents != null)
{
parentNameComboBox.Items.Add("---");
@@ -59,6 +65,7 @@ namespace TBF.BenchControl.Elde.Valve
nameTextBox.Text = config.Name;
parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName;
bitPositionTextBox.Text = config.BitPosition.ToString();
categoryComboBox.Text = config.Category.ToString();
coupledToComboBox.Text = string.IsNullOrEmpty(config.CoupledToName) ? "---" : config.CoupledToName;
invertCheckBox.Checked = config.Invert;
lagOpeningTextBox.Text = config.LagOpening.ToString();
@@ -70,6 +77,7 @@ namespace TBF.BenchControl.Elde.Valve
nameTextBox.Enabled = true;
parentNameComboBox.Enabled = true;
bitPositionTextBox.Enabled = true;
categoryComboBox.Enabled = true;
coupledToComboBox.Enabled = true;
invertCheckBox.Enabled = true;
lagOpeningTextBox.Enabled = true;
@@ -83,6 +91,13 @@ namespace TBF.BenchControl.Elde.Valve
config.Name = nameTextBox.Text;
config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text;
config.BitPosition = int.Parse(bitPositionTextBox.Text);
if (categoryComboBox.Text.Equals(ValveCategory.All.ToString())) config.Category = ValveCategory.All;
else if (categoryComboBox.Text.Equals(ValveCategory.Feeding.ToString())) config.Category = ValveCategory.Feeding;
else if (categoryComboBox.Text.Equals(ValveCategory.Bench.ToString())) config.Category = ValveCategory.Bench;
else if (categoryComboBox.Text.Equals(ValveCategory.Output.ToString())) config.Category = ValveCategory.Output;
else config.Category = ValveCategory.None;
config.CoupledToName = coupledToComboBox.Text.Equals("---") ? string.Empty : coupledToComboBox.Text;
config.Invert = invertCheckBox.Checked;
config.LagOpening = int.Parse(lagOpeningTextBox.Text);
@@ -99,7 +114,12 @@ namespace TBF.BenchControl.Elde.Valve
flags |= CfgVerifyFlags.Error;
message += Environment.NewLine + "Invalid 'Parent Name'";
}
if (!coupledToComboBox.Items.Contains(coupledToComboBox.Text))
if (!categoryComboBox.Items.Contains(categoryComboBox.Text))
{
flags |= CfgVerifyFlags.Error;
message += Environment.NewLine + "Invalid 'Category'";
}
if (!coupledToComboBox.Items.Contains(coupledToComboBox.Text))
{
flags |= CfgVerifyFlags.Error;
message += Environment.NewLine + "Invalid 'Coupled To'";