From d516441ff86aad2deab4bfc6285a8d72fbe9e5a5 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 25 Apr 2016 15:25:23 +0200 Subject: [PATCH] Calibration certificate nr., date, validity, etc. added to Metrology UI, BalanceCfg, ver.2.5.275 --- .../GenericDevices/IBalanceCfg.cs | 15 +- .../MettlerToledo/Multi/BalanceCfg.cs | 38 +++- .../MettlerToledo/Multi/BalanceDev.cs | 2 + .../MettlerToledo/Standard/BalanceCfg.cs | 32 +++- .../MettlerToledo/Standard/BalanceDev.cs | 2 + TestBenchFramework/LocalSettings.cs | 4 +- TestBenchFramework/Properties/AssemblyInfo.cs | 4 +- .../MetrologyDlgBalanceTab.Designer.cs | 162 ++++++++++++++++-- .../UiControls/MetrologyDlgBalanceTab.cs | 40 +++-- 9 files changed, 257 insertions(+), 42 deletions(-) diff --git a/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs b/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs index 100e85bdc..6f6333491 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs @@ -1,16 +1,23 @@ /// /// Copyright (c) 2013-2016 Sensus Metering Systems /// +using System; using TBF.BenchControl.Generic; namespace TBF.BenchControl.GenericDevices { public interface IBalanceCfg : IComponentCfg { + /// /// Parameters displayed in Metrology tab page - float BuoyancyTemp { get; set; } - float BuoyancyPress { get; set; } - float BuoyancyHumi { get; set; } - } + /// + float BuoyancyTemp { get; set; } /// ambient temperature in [degree C] + float BuoyancyPress { get; set; } /// ambient pressure in [100000 Pa] + float BuoyancyHumi { get; set; } /// ambient relative humidity in [%] + float WeightStandardDensity { get; set; } /// density of the weight standard used to calibrate the scale [kg/m3] + string CalibCertificateNr { get; set; } /// calibration certificate number + DateTime CalibDate { get; set; } /// date of calibration + DateTime CalibValidDate { get; set; } /// calibration valid until (date) + } } diff --git a/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceCfg.cs b/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceCfg.cs index 24fe8249c..fa4b83730 100644 --- a/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceCfg.cs +++ b/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceCfg.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2015 Sensus Metering Systems /// Author: Milan Hanajik /// +using System; using System.IO; using System.Collections.Generic; using System.IO.Ports; @@ -32,10 +33,16 @@ namespace TBF.BenchControl.MettlerToledo.Multi public StopBits StopBits; public Handshake Handshake; - /// Buoyancy - Displayed in Metrology tab page - private float buoyancyTemp; - private float buoyancyPress; - private float buoyancyHumi; + /// + /// Buoyancy related serialized parameters - Displayed in Metrology tab page + /// + float buoyancyTemp; + float buoyancyPress; + float buoyancyHumi; + float weightStandardDensity; + string calibCertificateNr; + DateTime calibDate; + DateTime calibValidDate; /// public float BuoyancyTemp { @@ -52,8 +59,29 @@ namespace TBF.BenchControl.MettlerToledo.Multi get { return buoyancyHumi; } set { buoyancyHumi = value; } } + public float WeightStandardDensity + { + get { return weightStandardDensity; } + set { weightStandardDensity = value; } + } + public string CalibCertificateNr + { + get { return calibCertificateNr; } + set { calibCertificateNr = value; } + } + public DateTime CalibDate + { + get { return calibDate; } + set { calibDate = value; } + } + public DateTime CalibValidDate + { + get { return calibValidDate; } + set { calibValidDate = value; } + } + - /// Private parameterless constructor invoked by all other (public) constructors + /// Private parameterless constructor invoked by all other (public) constructors BalanceCfg() { Name = "Balance"; diff --git a/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceDev.cs b/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceDev.cs index ced96d731..3e79ff94a 100644 --- a/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceDev.cs +++ b/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceDev.cs @@ -59,6 +59,8 @@ namespace TBF.BenchControl.MettlerToledo.Multi public float BuoyancyTemp { get { return balanceCfg.BuoyancyTemp; } } public float BuoyancyPress { get { return balanceCfg.BuoyancyPress; } } public float BuoyancyHumi { get { return balanceCfg.BuoyancyHumi; } } + public float WeightStandardDensity { get { return balanceCfg.WeightStandardDensity; } } + /// The state of the mass measurement public MsrmntState MsrmntState { get { return msrmntState; } } diff --git a/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs b/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs index 46c4b671e..6b3e3b8d4 100644 --- a/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs +++ b/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs @@ -1,7 +1,7 @@ /// -/// Copyright (c) 2013-2015 Sensus Metering Systems -/// Author: Milan Hanajik +/// Copyright (c) 2013-2016 Sensus Metering Systems /// +using System; using System.IO; using System.Collections.Generic; using System.IO.Ports; @@ -34,10 +34,16 @@ namespace TBF.BenchControl.MettlerToledo.Standard public string Format; public int EmptyTimeSec; /// s - /// Buoyancy - Displayed in Metrology tab page + /// + /// Buoyancy related serialized parameters - Displayed in Metrology tab page + /// private float buoyancyTemp; private float buoyancyPress; private float buoyancyHumi; + private float weightStandardDensity; + string calibCertificateNr; + DateTime calibDate; + DateTime calibValidDate; /// public float BuoyancyTemp { @@ -54,6 +60,26 @@ namespace TBF.BenchControl.MettlerToledo.Standard get { return buoyancyHumi; } set { buoyancyHumi = value; } } + public float WeightStandardDensity + { + get { return weightStandardDensity; } + set { weightStandardDensity = value; } + } + public string CalibCertificateNr + { + get { return calibCertificateNr; } + set { calibCertificateNr = value; } + } + public DateTime CalibDate + { + get { return calibDate; } + set { calibDate = value; } + } + public DateTime CalibValidDate + { + get { return calibValidDate; } + set { calibValidDate = value; } + } /// Private parameterless constructor invoked by all other (public) constructors diff --git a/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceDev.cs b/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceDev.cs index b9efb2f03..09eaefcfb 100644 --- a/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceDev.cs +++ b/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceDev.cs @@ -56,6 +56,8 @@ namespace TBF.BenchControl.MettlerToledo.Standard public float BuoyancyTemp { get { return balanceCfg.BuoyancyTemp; } } public float BuoyancyPress { get { return balanceCfg.BuoyancyPress; } } public float BuoyancyHumi { get { return balanceCfg.BuoyancyHumi; } } + public float WeightStandardDensity { get { return balanceCfg.WeightStandardDensity; } } + /// The state of the mass measurement public MsrmntState MsrmntState { get { return msrmntState; } } diff --git a/TestBenchFramework/LocalSettings.cs b/TestBenchFramework/LocalSettings.cs index b93797811..a66e3b4a9 100644 --- a/TestBenchFramework/LocalSettings.cs +++ b/TestBenchFramework/LocalSettings.cs @@ -45,8 +45,8 @@ namespace TBF public string LastProcedureName; public int BatchNr; - public float RealDensity; - public float AtTemperature; + public float RealDensity; /// water density [kg/m3] + public float AtTemperature; /// measured at temperature [degree C] public int RightPaneHorizSplitterDistance; public int TopPaneVerticalSplitterDistance; diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index a1794337e..46723237d 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.5.274.1")] -[assembly: AssemblyFileVersion("2.5.274.1")] +[assembly: AssemblyVersion("2.5.275.1")] +[assembly: AssemblyFileVersion("2.5.275.1")] diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs index 2bbc75d4d..851b3717c 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs @@ -33,7 +33,18 @@ namespace TBF.UiControls { this.cmpntNameLabel = new System.Windows.Forms.Label(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.calibrationGroupBox = new System.Windows.Forms.GroupBox(); + this.calibValidDateTextBox = new System.Windows.Forms.TextBox(); + this.calibValidDateLabel = new System.Windows.Forms.Label(); + this.calibDateTextBox = new System.Windows.Forms.TextBox(); + this.calibDateLabel = new System.Windows.Forms.Label(); + this.calibCertificateNrTextBox = new System.Windows.Forms.TextBox(); + this.calibCertificateNrLabel = new System.Windows.Forms.Label(); this.buoancyGroupBox = new System.Windows.Forms.GroupBox(); + this.weightStandardDensityTextBox = new System.Windows.Forms.TextBox(); + this.weightStandardDensityLabel = new System.Windows.Forms.Label(); + this.airDensityTextBox = new System.Windows.Forms.TextBox(); + this.airDensityLabel = new System.Windows.Forms.Label(); this.buoyancyHumiTextBox = new System.Windows.Forms.TextBox(); this.buoyancyPressTextBox = new System.Windows.Forms.TextBox(); this.buoyancyTempTextBox = new System.Windows.Forms.TextBox(); @@ -51,6 +62,7 @@ namespace TBF.UiControls this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + this.calibrationGroupBox.SuspendLayout(); this.buoancyGroupBox.SuspendLayout(); this.nameGroupBox.SuspendLayout(); this.testGroupBox.SuspendLayout(); @@ -59,7 +71,7 @@ namespace TBF.UiControls // cmpntNameLabel // this.cmpntNameLabel.AutoSize = true; - this.cmpntNameLabel.Location = new System.Drawing.Point(20, 41); + this.cmpntNameLabel.Location = new System.Drawing.Point(69, 16); this.cmpntNameLabel.Name = "cmpntNameLabel"; this.cmpntNameLabel.Size = new System.Drawing.Size(64, 13); this.cmpntNameLabel.TabIndex = 0; @@ -75,6 +87,7 @@ namespace TBF.UiControls // // splitContainer1.Panel1 // + this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox); this.splitContainer1.Panel1.Controls.Add(this.buoancyGroupBox); this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox); this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); @@ -82,29 +95,133 @@ namespace TBF.UiControls // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.listViewEx); - this.splitContainer1.Size = new System.Drawing.Size(550, 300); - this.splitContainer1.SplitterDistance = 105; + this.splitContainer1.Size = new System.Drawing.Size(668, 400); + this.splitContainer1.SplitterDistance = 150; this.splitContainer1.TabIndex = 1; // + // calibrationGroupBox + // + this.calibrationGroupBox.Controls.Add(this.calibValidDateTextBox); + this.calibrationGroupBox.Controls.Add(this.calibValidDateLabel); + this.calibrationGroupBox.Controls.Add(this.calibDateTextBox); + this.calibrationGroupBox.Controls.Add(this.calibDateLabel); + this.calibrationGroupBox.Controls.Add(this.calibCertificateNrTextBox); + this.calibrationGroupBox.Controls.Add(this.calibCertificateNrLabel); + this.calibrationGroupBox.Location = new System.Drawing.Point(16, 54); + this.calibrationGroupBox.Name = "calibrationGroupBox"; + this.calibrationGroupBox.Size = new System.Drawing.Size(228, 86); + this.calibrationGroupBox.TabIndex = 6; + this.calibrationGroupBox.TabStop = false; + this.calibrationGroupBox.Text = "Calibration"; + // + // calibValidDateTextBox + // + this.calibValidDateTextBox.Enabled = false; + this.calibValidDateTextBox.Location = new System.Drawing.Point(140, 59); + this.calibValidDateTextBox.Name = "calibValidDateTextBox"; + this.calibValidDateTextBox.Size = new System.Drawing.Size(82, 20); + this.calibValidDateTextBox.TabIndex = 15; + // + // calibValidDateLabel + // + this.calibValidDateLabel.AutoSize = true; + this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62); + this.calibValidDateLabel.Name = "calibValidDateLabel"; + this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13); + this.calibValidDateLabel.TabIndex = 14; + this.calibValidDateLabel.Text = "Valid until"; + // + // calibDateTextBox + // + this.calibDateTextBox.Enabled = false; + this.calibDateTextBox.Location = new System.Drawing.Point(140, 37); + this.calibDateTextBox.Name = "calibDateTextBox"; + this.calibDateTextBox.Size = new System.Drawing.Size(82, 20); + this.calibDateTextBox.TabIndex = 13; + // + // calibDateLabel + // + this.calibDateLabel.AutoSize = true; + this.calibDateLabel.Location = new System.Drawing.Point(17, 40); + this.calibDateLabel.Name = "calibDateLabel"; + this.calibDateLabel.Size = new System.Drawing.Size(30, 13); + this.calibDateLabel.TabIndex = 12; + this.calibDateLabel.Text = "Date"; + // + // calibCertificateNrTextBox + // + this.calibCertificateNrTextBox.Enabled = false; + this.calibCertificateNrTextBox.Location = new System.Drawing.Point(140, 15); + this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox"; + this.calibCertificateNrTextBox.Size = new System.Drawing.Size(82, 20); + this.calibCertificateNrTextBox.TabIndex = 11; + // + // calibCertificateNrLabel + // + this.calibCertificateNrLabel.AutoSize = true; + this.calibCertificateNrLabel.Location = new System.Drawing.Point(17, 18); + this.calibCertificateNrLabel.Name = "calibCertificateNrLabel"; + this.calibCertificateNrLabel.Size = new System.Drawing.Size(69, 13); + this.calibCertificateNrLabel.TabIndex = 10; + this.calibCertificateNrLabel.Text = "Certificate nr."; + // // buoancyGroupBox // + this.buoancyGroupBox.Controls.Add(this.weightStandardDensityTextBox); + this.buoancyGroupBox.Controls.Add(this.weightStandardDensityLabel); + this.buoancyGroupBox.Controls.Add(this.airDensityTextBox); + this.buoancyGroupBox.Controls.Add(this.airDensityLabel); this.buoancyGroupBox.Controls.Add(this.buoyancyHumiTextBox); this.buoancyGroupBox.Controls.Add(this.buoyancyPressTextBox); this.buoancyGroupBox.Controls.Add(this.buoyancyTempTextBox); this.buoancyGroupBox.Controls.Add(this.buoyancyHumiLabel); this.buoancyGroupBox.Controls.Add(this.buoyancyPressLabel); this.buoancyGroupBox.Controls.Add(this.buoyancyTempLabel); - this.buoancyGroupBox.Location = new System.Drawing.Point(112, 10); + this.buoancyGroupBox.Location = new System.Drawing.Point(255, 10); this.buoancyGroupBox.Name = "buoancyGroupBox"; - this.buoancyGroupBox.Size = new System.Drawing.Size(228, 88); + this.buoancyGroupBox.Size = new System.Drawing.Size(228, 130); this.buoancyGroupBox.TabIndex = 5; this.buoancyGroupBox.TabStop = false; this.buoancyGroupBox.Text = "Buoyancy"; // + // weightStandardDensityTextBox + // + this.weightStandardDensityTextBox.Enabled = false; + this.weightStandardDensityTextBox.Location = new System.Drawing.Point(140, 103); + this.weightStandardDensityTextBox.Name = "weightStandardDensityTextBox"; + this.weightStandardDensityTextBox.Size = new System.Drawing.Size(82, 20); + this.weightStandardDensityTextBox.TabIndex = 9; + // + // weightStandardDensityLabel + // + this.weightStandardDensityLabel.AutoSize = true; + this.weightStandardDensityLabel.Location = new System.Drawing.Point(17, 106); + this.weightStandardDensityLabel.Name = "weightStandardDensityLabel"; + this.weightStandardDensityLabel.Size = new System.Drawing.Size(119, 13); + this.weightStandardDensityLabel.TabIndex = 8; + this.weightStandardDensityLabel.Text = "Standard dens. [kg/m3]"; + // + // airDensityTextBox + // + this.airDensityTextBox.Enabled = false; + this.airDensityTextBox.Location = new System.Drawing.Point(140, 81); + this.airDensityTextBox.Name = "airDensityTextBox"; + this.airDensityTextBox.Size = new System.Drawing.Size(82, 20); + this.airDensityTextBox.TabIndex = 7; + // + // airDensityLabel + // + this.airDensityLabel.AutoSize = true; + this.airDensityLabel.Location = new System.Drawing.Point(17, 84); + this.airDensityLabel.Name = "airDensityLabel"; + this.airDensityLabel.Size = new System.Drawing.Size(95, 13); + this.airDensityLabel.TabIndex = 6; + this.airDensityLabel.Text = "Air density [kg/m3]"; + // // buoyancyHumiTextBox // this.buoyancyHumiTextBox.Enabled = false; - this.buoyancyHumiTextBox.Location = new System.Drawing.Point(140, 61); + this.buoyancyHumiTextBox.Location = new System.Drawing.Point(140, 59); this.buoyancyHumiTextBox.Name = "buoyancyHumiTextBox"; this.buoyancyHumiTextBox.Size = new System.Drawing.Size(82, 20); this.buoyancyHumiTextBox.TabIndex = 5; @@ -112,7 +229,7 @@ namespace TBF.UiControls // buoyancyPressTextBox // this.buoyancyPressTextBox.Enabled = false; - this.buoyancyPressTextBox.Location = new System.Drawing.Point(140, 38); + this.buoyancyPressTextBox.Location = new System.Drawing.Point(140, 37); this.buoyancyPressTextBox.Name = "buoyancyPressTextBox"; this.buoyancyPressTextBox.Size = new System.Drawing.Size(82, 20); this.buoyancyPressTextBox.TabIndex = 4; @@ -128,7 +245,7 @@ namespace TBF.UiControls // buoyancyHumiLabel // this.buoyancyHumiLabel.AutoSize = true; - this.buoyancyHumiLabel.Location = new System.Drawing.Point(17, 64); + this.buoyancyHumiLabel.Location = new System.Drawing.Point(17, 62); this.buoyancyHumiLabel.Name = "buoyancyHumiLabel"; this.buoyancyHumiLabel.Size = new System.Drawing.Size(72, 13); this.buoyancyHumiLabel.TabIndex = 2; @@ -137,7 +254,7 @@ namespace TBF.UiControls // buoyancyPressLabel // this.buoyancyPressLabel.AutoSize = true; - this.buoyancyPressLabel.Location = new System.Drawing.Point(17, 41); + this.buoyancyPressLabel.Location = new System.Drawing.Point(17, 40); this.buoyancyPressLabel.Name = "buoyancyPressLabel"; this.buoyancyPressLabel.Size = new System.Drawing.Size(76, 13); this.buoyancyPressLabel.TabIndex = 1; @@ -157,7 +274,7 @@ namespace TBF.UiControls this.nameGroupBox.Controls.Add(this.cmpntNameLabel); this.nameGroupBox.Location = new System.Drawing.Point(16, 10); this.nameGroupBox.Name = "nameGroupBox"; - this.nameGroupBox.Size = new System.Drawing.Size(90, 88); + this.nameGroupBox.Size = new System.Drawing.Size(228, 40); this.nameGroupBox.TabIndex = 4; this.nameGroupBox.TabStop = false; this.nameGroupBox.Text = "Component"; @@ -168,16 +285,16 @@ namespace TBF.UiControls this.testGroupBox.Controls.Add(this.measuredTextBox); this.testGroupBox.Controls.Add(this.correctedLabel); this.testGroupBox.Controls.Add(this.measuredLabel); - this.testGroupBox.Location = new System.Drawing.Point(346, 10); + this.testGroupBox.Location = new System.Drawing.Point(490, 10); this.testGroupBox.Name = "testGroupBox"; this.testGroupBox.Size = new System.Drawing.Size(170, 88); this.testGroupBox.TabIndex = 3; this.testGroupBox.TabStop = false; - this.testGroupBox.Text = "Test correction"; + this.testGroupBox.Text = "Correction test"; // // correctedTextBox // - this.correctedTextBox.Location = new System.Drawing.Point(91, 38); + this.correctedTextBox.Location = new System.Drawing.Point(91, 37); this.correctedTextBox.Name = "correctedTextBox"; this.correctedTextBox.ReadOnly = true; this.correctedTextBox.Size = new System.Drawing.Size(73, 20); @@ -194,7 +311,7 @@ namespace TBF.UiControls // correctedLabel // this.correctedLabel.AutoSize = true; - this.correctedLabel.Location = new System.Drawing.Point(18, 41); + this.correctedLabel.Location = new System.Drawing.Point(18, 40); this.correctedLabel.Name = "correctedLabel"; this.correctedLabel.Size = new System.Drawing.Size(53, 13); this.correctedLabel.TabIndex = 3; @@ -218,7 +335,7 @@ namespace TBF.UiControls this.listViewEx.GridLines = true; this.listViewEx.Location = new System.Drawing.Point(0, 0); this.listViewEx.Name = "listViewEx"; - this.listViewEx.Size = new System.Drawing.Size(550, 191); + this.listViewEx.Size = new System.Drawing.Size(668, 246); this.listViewEx.TabIndex = 0; this.listViewEx.UseCompatibleStateImageBehavior = false; this.listViewEx.View = System.Windows.Forms.View.Details; @@ -230,12 +347,14 @@ namespace TBF.UiControls this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.splitContainer1); this.Name = "MetrologyDlgBalanceTab"; - this.Size = new System.Drawing.Size(550, 300); + this.Size = new System.Drawing.Size(668, 400); this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_Load); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); + this.calibrationGroupBox.ResumeLayout(false); + this.calibrationGroupBox.PerformLayout(); this.buoancyGroupBox.ResumeLayout(false); this.buoancyGroupBox.PerformLayout(); this.nameGroupBox.ResumeLayout(false); @@ -264,5 +383,16 @@ namespace TBF.UiControls private System.Windows.Forms.Label buoyancyHumiLabel; private System.Windows.Forms.Label buoyancyPressLabel; private System.Windows.Forms.Label buoyancyTempLabel; + private System.Windows.Forms.TextBox weightStandardDensityTextBox; + private System.Windows.Forms.Label weightStandardDensityLabel; + private System.Windows.Forms.TextBox airDensityTextBox; + private System.Windows.Forms.Label airDensityLabel; + private System.Windows.Forms.GroupBox calibrationGroupBox; + private System.Windows.Forms.TextBox calibValidDateTextBox; + private System.Windows.Forms.Label calibValidDateLabel; + private System.Windows.Forms.TextBox calibDateTextBox; + private System.Windows.Forms.Label calibDateLabel; + private System.Windows.Forms.TextBox calibCertificateNrTextBox; + private System.Windows.Forms.Label calibCertificateNrLabel; } } diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs index c3ca3c401..381f711f5 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs @@ -87,6 +87,8 @@ namespace TBF.UiControls buoyancyTempLabel.Text = Strings.Ambient_temperature_; buoyancyPressLabel.Text = Strings.Ambient_pressure_; buoyancyHumiLabel.Text = Strings.Ambient_humidity_; + /// airDensityLabel.Text = + /// weightStandardDensityLabel = testGroupBox.Text = Strings.Test_measured_corrected; measuredLabel.Text = Strings.Measured; @@ -97,9 +99,15 @@ namespace TBF.UiControls { if (BalanceCfg != null) { + calibCertificateNrTextBox.Text = BalanceCfg.CalibCertificateNr; + calibDateTextBox.Text = BalanceCfg.CalibDate.ToShortDateString(); + calibValidDateTextBox.Text = BalanceCfg.CalibValidDate.ToShortDateString(); + buoyancyTempTextBox.Text = BalanceCfg.BuoyancyTemp.ToString("F2"); buoyancyPressTextBox.Text = BalanceCfg.BuoyancyPress.ToString("F4"); buoyancyHumiTextBox.Text = BalanceCfg.BuoyancyHumi.ToString("F1"); + /// airDensityTextBox.Text = //calculate air density + weightStandardDensityTextBox.Text = BalanceCfg.WeightStandardDensity.ToString("F1"); } listViewEx.Items.Clear(); @@ -150,9 +158,13 @@ namespace TBF.UiControls { unlocked = true; + calibCertificateNrTextBox.Enabled = true; + calibDateTextBox.Enabled = true; + calibValidDateTextBox.Enabled = true; buoyancyTempTextBox.Enabled = true; buoyancyPressTextBox.Enabled = true; buoyancyHumiTextBox.Enabled = true; + weightStandardDensityTextBox.Enabled = true; if (listViewEx.SelectedItems.Count == 1) { @@ -165,18 +177,26 @@ namespace TBF.UiControls public void OkBtnClicked() { - try + if (BalanceCfg != null) { - BalanceCfg.BuoyancyTemp = Utils.ParseSFloat(buoyancyTempTextBox.Text); - BalanceCfg.BuoyancyPress = Utils.ParseUFloat(buoyancyPressTextBox.Text); - BalanceCfg.BuoyancyHumi = Utils.ParseUFloat(buoyancyHumiTextBox.Text); + try + { + BalanceCfg.CalibCertificateNr = calibCertificateNrTextBox.Text; + BalanceCfg.CalibDate = DateTime.Parse(calibDateTextBox.Text); + BalanceCfg.CalibValidDate = DateTime.Parse(calibValidDateTextBox.Text); - Component modified = BalanceCfg.CreateDbEntity(); - MeterEntity.Parameters = modified.Parameters; - } - catch - { - MessageBox.Show(Strings.Invalid_buoyancy_parameter_Correct_pls, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + BalanceCfg.BuoyancyTemp = Utils.ParseSFloat(buoyancyTempTextBox.Text); + BalanceCfg.BuoyancyPress = Utils.ParseUFloat(buoyancyPressTextBox.Text); + BalanceCfg.BuoyancyHumi = Utils.ParseUFloat(buoyancyHumiTextBox.Text); + BalanceCfg.WeightStandardDensity = Utils.ParseUFloat(weightStandardDensityTextBox.Text); + + Component modified = BalanceCfg.CreateDbEntity(); + MeterEntity.Parameters = modified.Parameters; + } + catch + { + MessageBox.Show(Strings.Invalid_buoyancy_parameter_Correct_pls, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } } }