RegulValveTandem op SetFlowOp should be functional, to be tested

This commit is contained in:
Milan Hanajik
2015-02-03 10:30:24 +01:00
parent ab8aa61a29
commit 5806a65a0c
10 changed files with 139 additions and 99 deletions
@@ -61,7 +61,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
nameTextBox.Text = config.Name;
regulValveNameComboBox.Text = string.IsNullOrEmpty(config.RegulValveName) ? "---" : config.RegulValveName;
fixedRVNameComboBox.Text = string.IsNullOrEmpty(config.FixedRVName) ? "---" : config.FixedRVName;
stableTimeTextBox.Text = config.StableTimeMs.ToString();
fixedRVPositionTextBox.Text = config.FixedRVPosition.ToString("F0");
storedPosReuseCheckBox.Checked = config.StoredPositionReuse;
flowStableSecTextBox.Text = config.FlowStableSec.ToString();
}
@@ -71,7 +71,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
nameTextBox.Enabled = true;
regulValveNameComboBox.Enabled = true;
fixedRVNameComboBox.Enabled = true;
stableTimeTextBox.Enabled = true;
fixedRVPositionTextBox.Enabled = true;
storedPosReuseCheckBox.Enabled = true;
flowStableSecTextBox.Enabled = true;
}
@@ -93,13 +93,13 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
}
int dummy;
if (!int.TryParse(stableTimeTextBox.Text, out dummy) || dummy < 200 || dummy > 1500 || (dummy % 50) != 0)
if (!int.TryParse(fixedRVPositionTextBox.Text, out dummy) || dummy < 0 || dummy > 100)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Stable time' should be between 200 and 1500 ms in 50 ms steps";
}
if (!int.TryParse(flowStableSecTextBox.Text, out dummy) || dummy < 0 || dummy > 60)
if (!int.TryParse(flowStableSecTextBox.Text, out dummy) || dummy < 0 || dummy > 60)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Flow stable' should be between 0 and 60 sec";
@@ -134,10 +134,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
flags |= CfgUpdateFlags.RestartRqrd;
}
int tmp = int.Parse(stableTimeTextBox.Text);
if (config.StableTimeMs != tmp)
int tmp = int.Parse(fixedRVPositionTextBox.Text);
if (config.FixedRVPosition != (float)tmp)
{
config.StableTimeMs = tmp;
config.FixedRVPosition = (float)tmp;
flags |= CfgUpdateFlags.RestartRqrd;
}