(1) Verification whether Div ThresholdHI is greater then ThresholdLO, (2) Fixed a bug when no graph was selected and layout mode was changed.

This commit is contained in:
Milan Hanajik
2018-12-18 13:58:09 +01:00
parent 2f3f67c82e
commit 76042756b1
2 changed files with 18 additions and 9 deletions
@@ -105,6 +105,9 @@ namespace TBF.BenchControl.Elde.Diverter
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
int divLo;
int divHi;
if (!parentNameComboBox.Items.Contains(parentNameComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
@@ -140,15 +143,22 @@ namespace TBF.BenchControl.Elde.Diverter
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Starting Edge' should be between 0 and 100%";
}
if (!int.TryParse(thresholdLoTextBox.Text, out dummy) || dummy < 0 || dummy > 100)
if (!int.TryParse(thresholdLoTextBox.Text, out divLo) || divLo < 0 || divLo > 100)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Threshold LO' should be between 0 and 100%";
}
if (!int.TryParse(thresholdHiTextBox.Text, out dummy) || dummy < 0 || dummy > 100)
if (!int.TryParse(thresholdHiTextBox.Text, out divHi) || dummy > 100 || divHi <= divLo)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Threshold HI' should be between 0 and 100%";
if (divHi <= divLo)
{
message += Environment.NewLine + "'Threshold HI' should greater then 'Threshold LO'";
}
else
{
message += Environment.NewLine + "'Threshold HI' should be between 0 and 100%";
}
}
return flags;
}