diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs index 73bc1e40a..ae3b48cfc 100644 --- a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs @@ -9,7 +9,7 @@ using TBF.BenchControl.Generic; namespace TBF.BenchControl.Elde.FlowMeter { - public class FlowMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg + public class FlowMeterCfg : ComponentCfgBase, GenericDevices.ICalibInfoCfg, IChildComponentCfg { public IComponent GetComponent(IList components) { return new FlowMeter(this, components); } public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); } @@ -20,6 +20,27 @@ namespace TBF.BenchControl.Elde.FlowMeter public int Idx1; /// 1..5 public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz + /// Calibration info serialized parameters displayed in Metrology tab page + string calibCertificateNr; + DateTime calibDate; + DateTime calibValidDate; + 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 FlowMeterCfg() { diff --git a/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs b/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs index 6f6333491..1b432e52a 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/IBalanceCfg.cs @@ -15,6 +15,7 @@ namespace TBF.BenchControl.GenericDevices 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/GenericDevices/ICalibInfoCfg.cs b/TestBenchFramework/BenchControl/GenericDevices/ICalibInfoCfg.cs new file mode 100644 index 000000000..5683a98f9 --- /dev/null +++ b/TestBenchFramework/BenchControl/GenericDevices/ICalibInfoCfg.cs @@ -0,0 +1,19 @@ +/// +/// Copyright (c) 2013-2016 Sensus Metering Systems +/// +using System; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.GenericDevices +{ + public interface ICalibInfoCfg : IComponentCfg + { + /// + /// Parameters are displayed in Metrology tab page + /// + 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 fa4b83730..f70a2f49a 100644 --- a/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceCfg.cs +++ b/TestBenchFramework/BenchControl/MettlerToledo/Multi/BalanceCfg.cs @@ -11,7 +11,7 @@ using TBF.BenchControl.Generic; namespace TBF.BenchControl.MettlerToledo.Multi { - public class BalanceCfg : ComponentCfgBase, GenericDevices.IBalanceCfg + public class BalanceCfg : ComponentCfgBase, GenericDevices.IBalanceCfg, GenericDevices.ICalibInfoCfg { public IComponent GetComponent(IList components) { return new BalanceDev(this); } public IComponentCfgCtrl GetControl() { return new BalanceCfgCtrl(); } diff --git a/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs b/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs index 6b3e3b8d4..9d12feb21 100644 --- a/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs +++ b/TestBenchFramework/BenchControl/MettlerToledo/Standard/BalanceCfg.cs @@ -10,7 +10,7 @@ using TBF.BenchControl.Generic; namespace TBF.BenchControl.MettlerToledo.Standard { - public class BalanceCfg : ComponentCfgBase, GenericDevices.IBalanceCfg + public class BalanceCfg : ComponentCfgBase, GenericDevices.IBalanceCfg, GenericDevices.ICalibInfoCfg { public IComponent GetComponent(IList components) { @@ -34,17 +34,11 @@ namespace TBF.BenchControl.MettlerToledo.Standard public string Format; public int EmptyTimeSec; /// s - /// - /// Buoyancy related serialized parameters - 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 { get { return buoyancyTemp; } @@ -65,6 +59,11 @@ namespace TBF.BenchControl.MettlerToledo.Standard get { return weightStandardDensity; } set { weightStandardDensity = value; } } + + /// Calibration info serialized parameters displayed in Metrology tab page + string calibCertificateNr; + DateTime calibDate; + DateTime calibValidDate; public string CalibCertificateNr { get { return calibCertificateNr; } diff --git a/TestBenchFramework/MetrologyDlg.cs b/TestBenchFramework/MetrologyDlg.cs index c1ed91a84..b3bb5b1cb 100644 --- a/TestBenchFramework/MetrologyDlg.cs +++ b/TestBenchFramework/MetrologyDlg.cs @@ -90,7 +90,8 @@ namespace TBF TabPage tabPage = new TabPage(" " + cmpnt.Name + " "); MetrologyDlgFlowMeterTab uiControl = new MetrologyDlgFlowMeterTab(); uiControl.MeterEntity = cmpnt; - uiControl.Dock = DockStyle.Fill; + uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg; + uiControl.Dock = DockStyle.Fill; tabPage.Tag = uiControl; tabPage.Controls.Add(uiControl); metrologyTabControl.TabPages.Add(tabPage); diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 46723237d..07de88bad 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.275.1")] -[assembly: AssemblyFileVersion("2.5.275.1")] +[assembly: AssemblyVersion("2.5.276.1")] +[assembly: AssemblyFileVersion("2.5.276.1")] diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index 962cf242d..ab345f983 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -1221,6 +1221,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Invalid calibration information. Correct it please.. + /// + internal static string Invalid_calib_info_Correct_pls { + get { + return ResourceManager.GetString("Invalid_calib_info_Correct_pls", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid password. /// diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index 75fb05a44..275ec94f7 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -1219,4 +1219,7 @@ At least one of Buoyancy parameters is invalid,\r\ncorrect it please. + + Invalid calibration information. Correct it please. + \ No newline at end of file diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj index 86f9a15ac..55cbedd8a 100644 --- a/TestBenchFramework/TBF.csproj +++ b/TestBenchFramework/TBF.csproj @@ -337,6 +337,7 @@ + diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs index 851b3717c..9338a8206 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.Designer.cs @@ -311,7 +311,7 @@ namespace TBF.UiControls // correctedLabel // this.correctedLabel.AutoSize = true; - this.correctedLabel.Location = new System.Drawing.Point(18, 40); + this.correctedLabel.Location = new System.Drawing.Point(17, 40); this.correctedLabel.Name = "correctedLabel"; this.correctedLabel.Size = new System.Drawing.Size(53, 13); this.correctedLabel.TabIndex = 3; diff --git a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs index 381f711f5..1e8449bd7 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgBalanceTab.cs @@ -90,6 +90,7 @@ namespace TBF.UiControls /// airDensityLabel.Text = /// weightStandardDensityLabel = + nameGroupBox.Text = Strings.Component; testGroupBox.Text = Strings.Test_measured_corrected; measuredLabel.Text = Strings.Measured; correctedLabel.Text = Strings.Corrected; @@ -161,6 +162,7 @@ namespace TBF.UiControls calibCertificateNrTextBox.Enabled = true; calibDateTextBox.Enabled = true; calibValidDateTextBox.Enabled = true; + buoyancyTempTextBox.Enabled = true; buoyancyPressTextBox.Enabled = true; buoyancyHumiTextBox.Enabled = true; diff --git a/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs index c9a336179..ef508bc6f 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.Designer.cs @@ -31,146 +31,224 @@ namespace TBF.UiControls /// private void InitializeComponent() { - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.label1 = new System.Windows.Forms.Label(); - this.cmpntNameLabel = new System.Windows.Forms.Label(); - this.listViewEx = new TBF.UiControls.ListViewEx(); - this.correctedTextBox = new System.Windows.Forms.TextBox(); - this.testGroupBox = new System.Windows.Forms.GroupBox(); - this.measuredTextBox = new System.Windows.Forms.TextBox(); - this.correctedLabel = new System.Windows.Forms.Label(); - this.measuredLabel = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.testGroupBox.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.testGroupBox); - this.splitContainer1.Panel1.Controls.Add(this.label1); - this.splitContainer1.Panel1.Controls.Add(this.cmpntNameLabel); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.listViewEx); - this.splitContainer1.Size = new System.Drawing.Size(420, 300); - this.splitContainer1.SplitterDistance = 80; - this.splitContainer1.TabIndex = 2; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(14, 12); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(64, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Component:"; - // - // cmpntNameLabel - // - this.cmpntNameLabel.AutoSize = true; - this.cmpntNameLabel.Location = new System.Drawing.Point(97, 12); - this.cmpntNameLabel.Name = "cmpntNameLabel"; - this.cmpntNameLabel.Size = new System.Drawing.Size(88, 13); - this.cmpntNameLabel.TabIndex = 0; - this.cmpntNameLabel.Text = "componentName"; - // - // listViewEx - // - this.listViewEx.AllowColumnReorder = true; - this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; - this.listViewEx.DoubleClickActivation = false; - this.listViewEx.FullRowSelect = true; - this.listViewEx.GridLines = true; - this.listViewEx.Location = new System.Drawing.Point(0, 0); - this.listViewEx.Name = "listViewEx"; - this.listViewEx.Size = new System.Drawing.Size(420, 216); - this.listViewEx.TabIndex = 0; - this.listViewEx.UseCompatibleStateImageBehavior = false; - this.listViewEx.View = System.Windows.Forms.View.Details; - this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); - // - // correctedTextBox - // - this.correctedTextBox.Location = new System.Drawing.Point(74, 38); - this.correctedTextBox.Name = "correctedTextBox"; - this.correctedTextBox.ReadOnly = true; - this.correctedTextBox.Size = new System.Drawing.Size(73, 20); - this.correctedTextBox.TabIndex = 5; - // - // testGroupBox - // - this.testGroupBox.Controls.Add(this.correctedTextBox); - 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(245, 7); - this.testGroupBox.Name = "testGroupBox"; - this.testGroupBox.Size = new System.Drawing.Size(157, 64); - this.testGroupBox.TabIndex = 4; - this.testGroupBox.TabStop = false; - this.testGroupBox.Text = "Test"; - // - // measuredTextBox - // - this.measuredTextBox.Location = new System.Drawing.Point(74, 13); - this.measuredTextBox.Name = "measuredTextBox"; - this.measuredTextBox.Size = new System.Drawing.Size(73, 20); - this.measuredTextBox.TabIndex = 4; - this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); - // - // correctedLabel - // - this.correctedLabel.AutoSize = true; - this.correctedLabel.Location = new System.Drawing.Point(7, 41); - this.correctedLabel.Name = "correctedLabel"; - this.correctedLabel.Size = new System.Drawing.Size(53, 13); - this.correctedLabel.TabIndex = 3; - this.correctedLabel.Text = "Corrected"; - // - // measuredLabel - // - this.measuredLabel.AutoSize = true; - this.measuredLabel.Location = new System.Drawing.Point(6, 20); - this.measuredLabel.Name = "measuredLabel"; - this.measuredLabel.Size = new System.Drawing.Size(54, 13); - this.measuredLabel.TabIndex = 2; - this.measuredLabel.Text = "Measured"; - // - // MetrologyDlgFlowMeterTab - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.splitContainer1); - this.Name = "MetrologyDlgFlowMeterTab"; - this.Size = new System.Drawing.Size(420, 300); - this.Load += new System.EventHandler(this.MetrologyDlgFlowMeterTab_Load); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel1.PerformLayout(); - this.splitContainer1.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - this.testGroupBox.ResumeLayout(false); - this.testGroupBox.PerformLayout(); - this.ResumeLayout(false); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.correctedTextBox = new System.Windows.Forms.TextBox(); + this.measuredTextBox = new System.Windows.Forms.TextBox(); + this.correctedLabel = new System.Windows.Forms.Label(); + this.measuredLabel = new System.Windows.Forms.Label(); + this.cmpntNameLabel = new System.Windows.Forms.Label(); + this.listViewEx = new TBF.UiControls.ListViewEx(); + this.nameGroupBox = new System.Windows.Forms.GroupBox(); + 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(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.testGroupBox.SuspendLayout(); + this.nameGroupBox.SuspendLayout(); + this.calibrationGroupBox.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.calibrationGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.listViewEx); + this.splitContainer1.Size = new System.Drawing.Size(650, 400); + this.splitContainer1.SplitterDistance = 102; + this.splitContainer1.TabIndex = 2; + // + // testGroupBox + // + this.testGroupBox.Controls.Add(this.correctedTextBox); + 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(424, 10); + this.testGroupBox.Name = "testGroupBox"; + this.testGroupBox.Size = new System.Drawing.Size(170, 88); + this.testGroupBox.TabIndex = 4; + this.testGroupBox.TabStop = false; + this.testGroupBox.Text = "Correction test"; + // + // correctedTextBox + // + 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); + this.correctedTextBox.TabIndex = 5; + // + // measuredTextBox + // + this.measuredTextBox.Location = new System.Drawing.Point(91, 15); + this.measuredTextBox.Name = "measuredTextBox"; + this.measuredTextBox.Size = new System.Drawing.Size(73, 20); + this.measuredTextBox.TabIndex = 4; + this.measuredTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); + // + // correctedLabel + // + this.correctedLabel.AutoSize = true; + this.correctedLabel.Location = new System.Drawing.Point(17, 40); + this.correctedLabel.Name = "correctedLabel"; + this.correctedLabel.Size = new System.Drawing.Size(53, 13); + this.correctedLabel.TabIndex = 3; + this.correctedLabel.Text = "Corrected"; + // + // measuredLabel + // + this.measuredLabel.AutoSize = true; + this.measuredLabel.Location = new System.Drawing.Point(17, 18); + this.measuredLabel.Name = "measuredLabel"; + this.measuredLabel.Size = new System.Drawing.Size(54, 13); + this.measuredLabel.TabIndex = 2; + this.measuredLabel.Text = "Measured"; + // + // cmpntNameLabel + // + this.cmpntNameLabel.AutoSize = true; + this.cmpntNameLabel.Location = new System.Drawing.Point(43, 37); + this.cmpntNameLabel.Name = "cmpntNameLabel"; + this.cmpntNameLabel.Size = new System.Drawing.Size(64, 13); + this.cmpntNameLabel.TabIndex = 0; + this.cmpntNameLabel.Text = "cmpntName"; + // + // listViewEx + // + this.listViewEx.AllowColumnReorder = true; + this.listViewEx.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewEx.DoubleClickActivation = false; + this.listViewEx.FullRowSelect = true; + this.listViewEx.GridLines = true; + this.listViewEx.Location = new System.Drawing.Point(0, 0); + this.listViewEx.Name = "listViewEx"; + this.listViewEx.Size = new System.Drawing.Size(650, 294); + this.listViewEx.TabIndex = 0; + this.listViewEx.UseCompatibleStateImageBehavior = false; + this.listViewEx.View = System.Windows.Forms.View.Details; + this.listViewEx.SelectedIndexChanged += new System.EventHandler(this.listViewEx_SelectedIndexChanged); + // + // nameGroupBox + // + 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(160, 86); + this.nameGroupBox.TabIndex = 5; + this.nameGroupBox.TabStop = false; + this.nameGroupBox.Text = "Component"; + // + // 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(186, 10); + this.calibrationGroupBox.Name = "calibrationGroupBox"; + this.calibrationGroupBox.Size = new System.Drawing.Size(228, 86); + this.calibrationGroupBox.TabIndex = 7; + 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."; + // + // MetrologyDlgFlowMeterTab + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Name = "MetrologyDlgFlowMeterTab"; + this.Size = new System.Drawing.Size(650, 400); + this.Load += new System.EventHandler(this.MetrologyDlgFlowMeterTab_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.testGroupBox.ResumeLayout(false); + this.testGroupBox.PerformLayout(); + this.nameGroupBox.ResumeLayout(false); + this.nameGroupBox.PerformLayout(); + this.calibrationGroupBox.ResumeLayout(false); + this.calibrationGroupBox.PerformLayout(); + this.ResumeLayout(false); } #endregion - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Label cmpntNameLabel; private ListViewEx listViewEx; private System.Windows.Forms.GroupBox testGroupBox; @@ -178,6 +256,14 @@ namespace TBF.UiControls private System.Windows.Forms.TextBox measuredTextBox; private System.Windows.Forms.Label correctedLabel; private System.Windows.Forms.Label measuredLabel; + private System.Windows.Forms.GroupBox nameGroupBox; + 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/MetrologyDlgFlowMeterTab.cs b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.cs index 7fd716f98..91b6eb9dc 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgFlowMeterTab.cs @@ -26,6 +26,11 @@ namespace TBF.UiControls set { meterEntity = value; } } + /// + /// Calibration information configuration + /// + public BenchControl.GenericDevices.ICalibInfoCfg CalibInfoCfg; + /// /// A list of 'measurement-correction' pairs to be deleted from the database on OK. /// @@ -53,6 +58,8 @@ namespace TBF.UiControls parent = ParentForm as MetrologyDlg; + Localize(); + /// Panel1 cmpntNameLabel.Text = meterEntity.Name; @@ -78,8 +85,23 @@ namespace TBF.UiControls RefreshAll(); } - void RefreshAll() + void Localize() + { + nameGroupBox.Text = Strings.Component; + testGroupBox.Text = Strings.Test_measured_corrected; + measuredLabel.Text = Strings.Measured; + correctedLabel.Text = Strings.Corrected; + } + + void RefreshAll() { + if (CalibInfoCfg != null) + { + calibCertificateNrTextBox.Text = CalibInfoCfg.CalibCertificateNr; + calibDateTextBox.Text = CalibInfoCfg.CalibDate.ToShortDateString(); + calibValidDateTextBox.Text = CalibInfoCfg.CalibValidDate.ToShortDateString(); + } + listViewEx.Items.Clear(); foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr); } @@ -128,6 +150,10 @@ namespace TBF.UiControls { unlocked = true; + calibCertificateNrTextBox.Enabled = true; + calibDateTextBox.Enabled = true; + calibValidDateTextBox.Enabled = true; + if (listViewEx.SelectedItems.Count == 1) { int ix = listViewEx.SelectedIndices[0]; @@ -139,7 +165,23 @@ namespace TBF.UiControls public void OkBtnClicked() { - } + if (CalibInfoCfg != null) + { + try + { + CalibInfoCfg.CalibCertificateNr = calibCertificateNrTextBox.Text; + CalibInfoCfg.CalibDate = DateTime.Parse(calibDateTextBox.Text); + CalibInfoCfg.CalibValidDate = DateTime.Parse(calibValidDateTextBox.Text); + + Component modified = CalibInfoCfg.CreateDbEntity(); + MeterEntity.Parameters = modified.Parameters; + } + catch + { + MessageBox.Show(Strings.Invalid_calib_info_Correct_pls, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + } + } public void CancelBtnClicked() {