TestWizard.VolumeAndErrorSelection fixed - conversion to float avoided.
This commit is contained in:
@@ -2470,8 +2470,8 @@ namespace TBF.UI.Procedures
|
||||
|
||||
/// Pre-calculate additional data and flow for ROI detection
|
||||
roiData.Calculate();
|
||||
test.Qfrom = (float)(roiData.Q * 0.95);
|
||||
test.Qto = (float)(roiData.Q * 1.05);
|
||||
test.Qfrom = (0.95 * roiData.Q);
|
||||
test.Qto = (1.05 * roiData.Q);
|
||||
|
||||
flowLabel:
|
||||
switch (flowDlg.ShowDialog())
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace TBF.UI.Procedures.TestWizard
|
||||
{
|
||||
if (test == null) return;
|
||||
|
||||
volumeTextBox.Text = Units.ConvertTo(volumeUnit, (double)test.Volume).ToString();
|
||||
volumeTextBox.Text = Units.ConvertTo(volumeUnit, test.Volume).ToString();
|
||||
durationTextBox.Text = test.TestTime.ToString();
|
||||
errLoPctTextBox.Text = test.ErrLimLo.ToString();
|
||||
errHiPctTextBox.Text = test.ErrLimHi.ToString();
|
||||
@@ -80,34 +80,34 @@ namespace TBF.UI.Procedures.TestWizard
|
||||
bool IsFormValid()
|
||||
{
|
||||
int idummy;
|
||||
float dummy;
|
||||
double dummy;
|
||||
|
||||
bool tabsValid;
|
||||
switch (tabId)
|
||||
{
|
||||
default:
|
||||
case TabId.WaterMeterTab:
|
||||
tabsValid = Utils.TryParseSFloat(errLoPctTextBox.Text, out dummy)
|
||||
&& Utils.TryParseSFloat(errHiPctTextBox.Text, out dummy);
|
||||
tabsValid = Utils.TryParseSDouble(errLoPctTextBox.Text, out dummy)
|
||||
&& Utils.TryParseSDouble(errHiPctTextBox.Text, out dummy);
|
||||
break;
|
||||
case TabId.HeatMeterTab:
|
||||
tabsValid = int.TryParse(classComboBox.Text, out idummy)
|
||||
&& idummy >= 1 && idummy <= 3
|
||||
&& Utils.TryParseUFloat(qpTextBox.Text, out dummy);
|
||||
&& Utils.TryParseUDouble(qpTextBox.Text, out dummy);
|
||||
break;
|
||||
}
|
||||
|
||||
/// Return complete result
|
||||
return tabsValid && Utils.TryParseUFloat(volumeTextBox.Text, out dummy)
|
||||
&& Utils.TryParseUFloat(durationTextBox.Text, out dummy)
|
||||
&& Utils.TryParseUFloat(uncertaintyTextBox.Text, out dummy);
|
||||
return tabsValid && Utils.TryParseUDouble(volumeTextBox.Text, out dummy)
|
||||
&& Utils.TryParseUDouble(durationTextBox.Text, out dummy)
|
||||
&& Utils.TryParseUDouble(uncertaintyTextBox.Text, out dummy);
|
||||
}
|
||||
|
||||
void UpdateTest()
|
||||
{
|
||||
test.Volume = (float)Units.ConvertFrom(volumeUnit, Utils.ParseUDouble(volumeTextBox.Text));
|
||||
test.Volume = Units.ConvertFrom(volumeUnit, Utils.ParseUDouble(volumeTextBox.Text));
|
||||
test.VolumeUnit = volumeUnit;
|
||||
test.TestTime = Utils.ParseUFloat(durationTextBox.Text);
|
||||
test.TestTime = Utils.ParseUDouble(durationTextBox.Text);
|
||||
test.Uncertainty = Utils.ParseUFloat(uncertaintyTextBox.Text);
|
||||
|
||||
switch (tabId)
|
||||
|
||||
Reference in New Issue
Block a user