diff --git a/TBF/LocalSettings.cs b/TBF/LocalSettings.cs
index 1832875d0..a75c191d5 100644
--- a/TBF/LocalSettings.cs
+++ b/TBF/LocalSettings.cs
@@ -310,7 +310,6 @@ namespace TBF
TextReader txtReader = new StringReader(srDecrypt.ReadToEnd());
LocalSettings ls = serializer.Deserialize(txtReader) as LocalSettings;
- ls.CondInitRealDensity();
ls.UpdateResultsOutputData();
return ls;
}
@@ -324,7 +323,6 @@ namespace TBF
using (StreamReader reader = new StreamReader(fileName))
{
LocalSettings ls = serializer.Deserialize(reader) as LocalSettings;
- ls.CondInitRealDensity();
ls.UpdateResultsOutputData();
return ls;
}
@@ -385,16 +383,9 @@ namespace TBF
}
}
- void CondInitRealDensity()
- {
- if (RealDensity < 500 || RealDensity > 1500)
- {
- /// Use default value if density value was not set yet
- RealDensity = 998.2008; /// kg/m3
- AtTemperature = 20.0; /// deg.C
- }
- }
-
+ ///
+ /// To be able to have RealDensity and AtTemperatire in reports.
+ ///
void UpdateResultsOutputData()
{
Results.WMeterRsltItemSpec.RealDensity = this.RealDensity;
diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs
index f121e2213..50203598a 100644
--- a/TBF/Properties/AssemblyInfo.cs
+++ b/TBF/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
-[assembly: AssemblyVersion("2.18.1264.0")]
-[assembly: AssemblyFileVersion("2.18.1264.0")]
+[assembly: AssemblyVersion("2.18.1265.0")]
+[assembly: AssemblyFileVersion("2.18.1265.0")]
diff --git a/TBF/SampleConfig/config.xml b/TBF/SampleConfig/config.xml
index af847058f..314d8740f 100644
--- a/TBF/SampleConfig/config.xml
+++ b/TBF/SampleConfig/config.xml
@@ -17,7 +17,7 @@
Test Bench
1
- 988.2008
+ 998.2008
20
25
75
diff --git a/TBF/UiControls/MetrologyDlgDensityTab.Designer.cs b/TBF/UiControls/MetrologyDlgDensityTab.Designer.cs
index 061a73acd..dada06996 100644
--- a/TBF/UiControls/MetrologyDlgDensityTab.Designer.cs
+++ b/TBF/UiControls/MetrologyDlgDensityTab.Designer.cs
@@ -31,104 +31,104 @@ namespace TBF.UiControls
///
private void InitializeComponent()
{
- this.splitContainer1 = new System.Windows.Forms.SplitContainer();
- this.densityCorrTextBox = new System.Windows.Forms.TextBox();
- this.densityCorrLabel = new System.Windows.Forms.Label();
- this.temperatureTextBox = new System.Windows.Forms.TextBox();
- this.temperatureLabel = new System.Windows.Forms.Label();
- this.densityTextBox = new System.Windows.Forms.TextBox();
- this.densityLabel = new System.Windows.Forms.Label();
- ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
- this.splitContainer1.Panel1.SuspendLayout();
- this.splitContainer1.SuspendLayout();
- this.SuspendLayout();
- //
- // splitContainer1
- //
- this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
- this.splitContainer1.Location = new System.Drawing.Point(0, 0);
- this.splitContainer1.Name = "splitContainer1";
- this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
- //
- // splitContainer1.Panel1
- //
- this.splitContainer1.Panel1.Controls.Add(this.densityCorrTextBox);
- this.splitContainer1.Panel1.Controls.Add(this.densityCorrLabel);
- this.splitContainer1.Panel1.Controls.Add(this.temperatureTextBox);
- this.splitContainer1.Panel1.Controls.Add(this.temperatureLabel);
- this.splitContainer1.Panel1.Controls.Add(this.densityTextBox);
- this.splitContainer1.Panel1.Controls.Add(this.densityLabel);
- this.splitContainer1.Size = new System.Drawing.Size(420, 300);
- this.splitContainer1.SplitterDistance = 120;
- this.splitContainer1.TabIndex = 1;
- //
- // densityCorrTextBox
- //
- this.densityCorrTextBox.Enabled = false;
- this.densityCorrTextBox.Location = new System.Drawing.Point(185, 86);
- this.densityCorrTextBox.Name = "densityCorrTextBox";
- this.densityCorrTextBox.Size = new System.Drawing.Size(100, 20);
- this.densityCorrTextBox.TabIndex = 5;
- //
- // densityCorrLabel
- //
- this.densityCorrLabel.AutoSize = true;
- this.densityCorrLabel.Location = new System.Drawing.Point(37, 89);
- this.densityCorrLabel.Name = "densityCorrLabel";
- this.densityCorrLabel.Size = new System.Drawing.Size(132, 13);
- this.densityCorrLabel.TabIndex = 4;
- this.densityCorrLabel.Text = "Density correction [kg/m3]";
- //
- // temperatureTextBox
- //
- this.temperatureTextBox.Enabled = false;
- this.temperatureTextBox.Location = new System.Drawing.Point(185, 43);
- this.temperatureTextBox.Name = "temperatureTextBox";
- this.temperatureTextBox.Size = new System.Drawing.Size(100, 20);
- this.temperatureTextBox.TabIndex = 3;
- this.temperatureTextBox.TextChanged += new System.EventHandler(this.temperatureTextBox_TextChanged);
- //
- // temperatureLabel
- //
- this.temperatureLabel.AutoSize = true;
- this.temperatureLabel.Location = new System.Drawing.Point(37, 46);
- this.temperatureLabel.Name = "temperatureLabel";
- this.temperatureLabel.Size = new System.Drawing.Size(112, 13);
- this.temperatureLabel.TabIndex = 2;
- this.temperatureLabel.Text = "@Temperature [degC]";
- //
- // densityTextBox
- //
- this.densityTextBox.Enabled = false;
- this.densityTextBox.Location = new System.Drawing.Point(185, 17);
- this.densityTextBox.Name = "densityTextBox";
- this.densityTextBox.Size = new System.Drawing.Size(100, 20);
- this.densityTextBox.TabIndex = 1;
- this.densityTextBox.TextChanged += new System.EventHandler(this.densityTextBox_TextChanged);
- //
- // densityLabel
- //
- this.densityLabel.AutoSize = true;
- this.densityLabel.Location = new System.Drawing.Point(37, 20);
- this.densityLabel.Name = "densityLabel";
- this.densityLabel.Size = new System.Drawing.Size(82, 13);
- this.densityLabel.TabIndex = 0;
- this.densityLabel.Text = "Density [kg/m3]";
- //
- // MetrologyDlgDensityTab
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.splitContainer1);
- this.Name = "MetrologyDlgDensityTab";
- this.Size = new System.Drawing.Size(420, 300);
- this.Load += new System.EventHandler(this.MetrologyDlgDensityTab_Load);
- this.splitContainer1.Panel1.ResumeLayout(false);
- this.splitContainer1.Panel1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
- this.splitContainer1.ResumeLayout(false);
- this.ResumeLayout(false);
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.densityCorrTextBox = new System.Windows.Forms.TextBox();
+ this.densityCorrLabel = new System.Windows.Forms.Label();
+ this.temperatureTextBox = new System.Windows.Forms.TextBox();
+ this.temperatureLabel = new System.Windows.Forms.Label();
+ this.densityTextBox = new System.Windows.Forms.TextBox();
+ this.densityLabel = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer1.Name = "splitContainer1";
+ this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.densityCorrTextBox);
+ this.splitContainer1.Panel1.Controls.Add(this.densityCorrLabel);
+ this.splitContainer1.Panel1.Controls.Add(this.temperatureTextBox);
+ this.splitContainer1.Panel1.Controls.Add(this.temperatureLabel);
+ this.splitContainer1.Panel1.Controls.Add(this.densityTextBox);
+ this.splitContainer1.Panel1.Controls.Add(this.densityLabel);
+ this.splitContainer1.Size = new System.Drawing.Size(420, 300);
+ this.splitContainer1.SplitterDistance = 120;
+ this.splitContainer1.TabIndex = 1;
+ //
+ // densityCorrTextBox
+ //
+ this.densityCorrTextBox.Enabled = false;
+ this.densityCorrTextBox.Location = new System.Drawing.Point(185, 86);
+ this.densityCorrTextBox.Name = "densityCorrTextBox";
+ this.densityCorrTextBox.Size = new System.Drawing.Size(110, 20);
+ this.densityCorrTextBox.TabIndex = 5;
+ //
+ // densityCorrLabel
+ //
+ this.densityCorrLabel.AutoSize = true;
+ this.densityCorrLabel.Location = new System.Drawing.Point(37, 89);
+ this.densityCorrLabel.Name = "densityCorrLabel";
+ this.densityCorrLabel.Size = new System.Drawing.Size(132, 13);
+ this.densityCorrLabel.TabIndex = 4;
+ this.densityCorrLabel.Text = "Density correction [kg/m3]";
+ //
+ // temperatureTextBox
+ //
+ this.temperatureTextBox.Enabled = false;
+ this.temperatureTextBox.Location = new System.Drawing.Point(185, 43);
+ this.temperatureTextBox.Name = "temperatureTextBox";
+ this.temperatureTextBox.Size = new System.Drawing.Size(110, 20);
+ this.temperatureTextBox.TabIndex = 3;
+ this.temperatureTextBox.TextChanged += new System.EventHandler(this.temperatureTextBox_TextChanged);
+ //
+ // temperatureLabel
+ //
+ this.temperatureLabel.AutoSize = true;
+ this.temperatureLabel.Location = new System.Drawing.Point(37, 46);
+ this.temperatureLabel.Name = "temperatureLabel";
+ this.temperatureLabel.Size = new System.Drawing.Size(112, 13);
+ this.temperatureLabel.TabIndex = 2;
+ this.temperatureLabel.Text = "@Temperature [degC]";
+ //
+ // densityTextBox
+ //
+ this.densityTextBox.Enabled = false;
+ this.densityTextBox.Location = new System.Drawing.Point(185, 17);
+ this.densityTextBox.Name = "densityTextBox";
+ this.densityTextBox.Size = new System.Drawing.Size(110, 20);
+ this.densityTextBox.TabIndex = 1;
+ this.densityTextBox.TextChanged += new System.EventHandler(this.densityTextBox_TextChanged);
+ //
+ // densityLabel
+ //
+ this.densityLabel.AutoSize = true;
+ this.densityLabel.Location = new System.Drawing.Point(37, 20);
+ this.densityLabel.Name = "densityLabel";
+ this.densityLabel.Size = new System.Drawing.Size(82, 13);
+ this.densityLabel.TabIndex = 0;
+ this.densityLabel.Text = "Density [kg/m3]";
+ //
+ // MetrologyDlgDensityTab
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.splitContainer1);
+ this.Name = "MetrologyDlgDensityTab";
+ this.Size = new System.Drawing.Size(420, 300);
+ this.Load += new System.EventHandler(this.MetrologyDlgDensityTab_Load);
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+ this.splitContainer1.ResumeLayout(false);
+ this.ResumeLayout(false);
}
diff --git a/TBF/UiControls/MetrologyDlgDensityTab.cs b/TBF/UiControls/MetrologyDlgDensityTab.cs
index 789d4eda7..91a078047 100644
--- a/TBF/UiControls/MetrologyDlgDensityTab.cs
+++ b/TBF/UiControls/MetrologyDlgDensityTab.cs
@@ -61,9 +61,9 @@ namespace TBF.UiControls
void RefreshAll()
{
- densityTextBox.Text = Program.LocalSettings.RealDensity.ToString();
- temperatureTextBox.Text = Program.LocalSettings.AtTemperature.ToString();
- densityCorrTextBox.Text = Config.Formulas.DensityCorrection(Program.LocalSettings.RealDensity, Program.LocalSettings.AtTemperature).ToString();
+ densityTextBox.Text = Program.LocalSettings.RealDensity.ToString("F4");
+ temperatureTextBox.Text = Program.LocalSettings.AtTemperature.ToString("F2");
+ densityCorrTextBox.Text = Config.Formulas.DensityCorrection(Program.LocalSettings.RealDensity, Program.LocalSettings.AtTemperature).ToString("F5");
}
public void Unlock()