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