diff --git a/TestBenchFramework/BenchControl/Formulas.cs b/TestBenchFramework/BenchControl/Formulas.cs index 7f6a34680..22a414069 100644 --- a/TestBenchFramework/BenchControl/Formulas.cs +++ b/TestBenchFramework/BenchControl/Formulas.cs @@ -275,7 +275,7 @@ namespace TBF.BenchControl /// Calibrated ITS-90 coefficient a7 /// Calibrated ITS-90 coefficient b7 /// Calibrated ITS-90 coefficient c7 - /// + /// Temperature in [°C] public static double PlatinumResistanceTM_ITS90_R2T(double R, double R001C, double a7, double b7, double c7) { double w = R / R001C; /// ratio @@ -292,5 +292,20 @@ namespace TBF.BenchControl return sum; } + + /// + /// Conversion of measured resistance of a platinum thermometer to temperature using Callendar-Van Dusen equations + /// + /// Measured resistance in [°C] + /// Calibrated resistance in Ohm at 0°C + /// Calibration coefficient a + /// Calibration coefficient b + /// Temperature in [°C] + public static double PlatinumResistanceTM_ITS27_R2T(double R, double R0, double a, double b) + { + if (R0 * R0 * a * a - 4 * R0 * b * (R0 - R) <= 0) return 0; /// Out of range + + return (-(R0 * a) + Math.Sqrt(R0 * R0 * a * a - 4 * R0 * b * (R0 - R))) / (2 * R0 * b); + } } } diff --git a/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeter.cs b/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeter.cs index 4186fab27..a35f51d16 100644 --- a/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeter.cs +++ b/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeter.cs @@ -51,11 +51,21 @@ namespace TBF.BenchControl.Keithley.TempMeter double temperature = 0; if (resistance > 0 && resistance < 200) { - temperature = Formulas.PlatinumResistanceTM_ITS90_R2T(resistance, - tempMtrCfg.R001C, - tempMtrCfg.a7, - tempMtrCfg.b7, - tempMtrCfg.c7); + if (tempMtrCfg.UseITS90) + { + temperature = Formulas.PlatinumResistanceTM_ITS90_R2T(resistance, + tempMtrCfg.R001C, + tempMtrCfg.a7, + tempMtrCfg.b7, + tempMtrCfg.c7); + } + else + { + temperature = Formulas.PlatinumResistanceTM_ITS27_R2T(resistance, + tempMtrCfg.R0, + tempMtrCfg.a, + tempMtrCfg.b); + } log.DebugFormat("Ch = {0}, R = {1} Ohm, T = {2} °C", Channel, resistance.ToString("F3"), temperature.ToString("F3")); } diff --git a/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeterCfg.cs b/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeterCfg.cs index 6b8a86913..0af345436 100644 --- a/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeterCfg.cs +++ b/TestBenchFramework/BenchControl/Keithley/TempMeter/TempMeterCfg.cs @@ -17,31 +17,25 @@ namespace TBF.BenchControl.Keithley.TempMeter /// Serialized parameters /// public int Channel; /// 1..5 + + public bool UseITS90; /// true: use ITS-90 calibration coefficients + /// false: use Callendar-Van Dusen equations (coefficients) + + /// ITS-90 calibration coefficients public double R001C; public double a7; public double b7; public double c7; - /// 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; } - } + /// Callendar-Van Dusen equations + public double R0; + public double a; + public double b; + /// Calibration info serialized parameters displayed in Metrology tab page + public string CalibCertificateNr; + public DateTime CalibDate; + public DateTime CalibValidDate; /// Private parameterless constructor invoked by all other (public) constructors TempMeterCfg() @@ -55,15 +49,19 @@ namespace TBF.BenchControl.Keithley.TempMeter this.Factory = factory; ParentName = "Keithley.Multimeter_2010_RS232"; Channel = 1; + UseITS90 = false; + R0 = 100.0; + a = 3.9083E-3; + b = -5.775E-7; } public string ToString(int i) { - return string.Format("Name={0}, Parent={1}, Channel={2}, R0={3}, a7={4}, b7={5}, c7={6}", + return string.Format("Name={0}, Parent={1}, Channel={2}, ITS-90={3}", Name, (string.IsNullOrEmpty(ParentName) ? "-" : ParentName), Channel, - R001C, a7, b7, c7); + UseITS90); } } } diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index 64bc23efb..92b990105 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -447,6 +447,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Calibration coefficients. + /// + internal static string Calibration_coefficients { + get { + return ResourceManager.GetString("Calibration_coefficients", resourceCulture); + } + } + /// /// Looks up a localized string similar to Calibration Specialist. /// @@ -1635,6 +1644,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to ITS-27 calibration coefficients. + /// + internal static string ITS27_calibration_coefficients { + get { + return ResourceManager.GetString("ITS27_calibration_coefficients", resourceCulture); + } + } + /// /// Looks up a localized string similar to ITS-90 calibration coefficients. /// @@ -4185,6 +4203,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Use {0}. + /// + internal static string Use_0 { + get { + return ResourceManager.GetString("Use_0", resourceCulture); + } + } + /// /// Looks up a localized string similar to User. /// diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index ac962174e..5a63147ef 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -1576,4 +1576,13 @@ Temperature + + ITS-27 calibration coefficients + + + Use {0} + + + Calibration coefficients + \ No newline at end of file diff --git a/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.Designer.cs b/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.Designer.cs index 2386b00e3..bc0212752 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.Designer.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.Designer.cs @@ -45,22 +45,32 @@ namespace TBF.UiControls this.c7Label = new System.Windows.Forms.Label(); this.b7TextBox = new System.Windows.Forms.TextBox(); this.a7TextBox = new System.Windows.Forms.TextBox(); - this.r0TextBox = new System.Windows.Forms.TextBox(); + this.r001cTextBox = new System.Windows.Forms.TextBox(); this.b7Label = new System.Windows.Forms.Label(); this.a7Label = new System.Windows.Forms.Label(); this.r0Label = new System.Windows.Forms.Label(); this.nameGroupBox = new System.Windows.Forms.GroupBox(); - this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.its27CalibrationCoefficientsGroupBox = new System.Windows.Forms.GroupBox(); this.temperatureTextBox = new System.Windows.Forms.TextBox(); this.resistanceTextBox = new System.Windows.Forms.TextBox(); this.temperatureLabel = new System.Windows.Forms.Label(); this.resistanceLabel = new System.Windows.Forms.Label(); + this.bTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.aTextBox = new System.Windows.Forms.TextBox(); + this.r0TextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.calibrationGroupBox.SuspendLayout(); this.its90CalibrationCoefficientsGroupBox.SuspendLayout(); this.nameGroupBox.SuspendLayout(); + this.its27CalibrationCoefficientsGroupBox.SuspendLayout(); this.testGroupBox.SuspendLayout(); this.SuspendLayout(); // @@ -83,12 +93,15 @@ namespace TBF.UiControls // // splitContainer1.Panel1 // + this.splitContainer1.Panel1.Controls.Add(this.radioButton2); + this.splitContainer1.Panel1.Controls.Add(this.radioButton1); + this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); this.splitContainer1.Panel1.Controls.Add(this.calibrationGroupBox); this.splitContainer1.Panel1.Controls.Add(this.its90CalibrationCoefficientsGroupBox); this.splitContainer1.Panel1.Controls.Add(this.nameGroupBox); - this.splitContainer1.Panel1.Controls.Add(this.testGroupBox); + this.splitContainer1.Panel1.Controls.Add(this.its27CalibrationCoefficientsGroupBox); this.splitContainer1.Size = new System.Drawing.Size(668, 400); - this.splitContainer1.SplitterDistance = 150; + this.splitContainer1.SplitterDistance = 300; this.splitContainer1.TabIndex = 1; // // calibrationGroupBox @@ -101,7 +114,7 @@ namespace TBF.UiControls 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(208, 86); + this.calibrationGroupBox.Size = new System.Drawing.Size(208, 95); this.calibrationGroupBox.TabIndex = 6; this.calibrationGroupBox.TabStop = false; this.calibrationGroupBox.Text = "Calibration"; @@ -109,7 +122,7 @@ namespace TBF.UiControls // calibValidDateTextBox // this.calibValidDateTextBox.Enabled = false; - this.calibValidDateTextBox.Location = new System.Drawing.Point(107, 59); + this.calibValidDateTextBox.Location = new System.Drawing.Point(105, 65); this.calibValidDateTextBox.Name = "calibValidDateTextBox"; this.calibValidDateTextBox.Size = new System.Drawing.Size(95, 20); this.calibValidDateTextBox.TabIndex = 15; @@ -117,7 +130,7 @@ namespace TBF.UiControls // calibValidDateLabel // this.calibValidDateLabel.AutoSize = true; - this.calibValidDateLabel.Location = new System.Drawing.Point(17, 62); + this.calibValidDateLabel.Location = new System.Drawing.Point(17, 68); this.calibValidDateLabel.Name = "calibValidDateLabel"; this.calibValidDateLabel.Size = new System.Drawing.Size(52, 13); this.calibValidDateLabel.TabIndex = 14; @@ -126,7 +139,7 @@ namespace TBF.UiControls // calibDateTextBox // this.calibDateTextBox.Enabled = false; - this.calibDateTextBox.Location = new System.Drawing.Point(107, 37); + this.calibDateTextBox.Location = new System.Drawing.Point(105, 40); this.calibDateTextBox.Name = "calibDateTextBox"; this.calibDateTextBox.Size = new System.Drawing.Size(95, 20); this.calibDateTextBox.TabIndex = 13; @@ -134,7 +147,7 @@ namespace TBF.UiControls // calibDateLabel // this.calibDateLabel.AutoSize = true; - this.calibDateLabel.Location = new System.Drawing.Point(17, 40); + this.calibDateLabel.Location = new System.Drawing.Point(17, 43); this.calibDateLabel.Name = "calibDateLabel"; this.calibDateLabel.Size = new System.Drawing.Size(30, 13); this.calibDateLabel.TabIndex = 12; @@ -143,7 +156,7 @@ namespace TBF.UiControls // calibCertificateNrTextBox // this.calibCertificateNrTextBox.Enabled = false; - this.calibCertificateNrTextBox.Location = new System.Drawing.Point(107, 15); + this.calibCertificateNrTextBox.Location = new System.Drawing.Point(105, 15); this.calibCertificateNrTextBox.Name = "calibCertificateNrTextBox"; this.calibCertificateNrTextBox.Size = new System.Drawing.Size(95, 20); this.calibCertificateNrTextBox.TabIndex = 11; @@ -163,13 +176,13 @@ namespace TBF.UiControls this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.c7Label); this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.b7TextBox); this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.a7TextBox); - this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.r0TextBox); + this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.r001cTextBox); this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.b7Label); this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.a7Label); this.its90CalibrationCoefficientsGroupBox.Controls.Add(this.r0Label); - this.its90CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(233, 10); + this.its90CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(230, 54); this.its90CalibrationCoefficientsGroupBox.Name = "its90CalibrationCoefficientsGroupBox"; - this.its90CalibrationCoefficientsGroupBox.Size = new System.Drawing.Size(230, 130); + this.its90CalibrationCoefficientsGroupBox.Size = new System.Drawing.Size(220, 140); this.its90CalibrationCoefficientsGroupBox.TabIndex = 5; this.its90CalibrationCoefficientsGroupBox.TabStop = false; this.its90CalibrationCoefficientsGroupBox.Text = "ITS-90 calibration coefficients"; @@ -177,7 +190,7 @@ namespace TBF.UiControls // c7TextBox // this.c7TextBox.Enabled = false; - this.c7TextBox.Location = new System.Drawing.Point(95, 101); + this.c7TextBox.Location = new System.Drawing.Point(82, 104); this.c7TextBox.Name = "c7TextBox"; this.c7TextBox.Size = new System.Drawing.Size(124, 20); this.c7TextBox.TabIndex = 7; @@ -185,7 +198,7 @@ namespace TBF.UiControls // c7Label // this.c7Label.AutoSize = true; - this.c7Label.Location = new System.Drawing.Point(23, 104); + this.c7Label.Location = new System.Drawing.Point(20, 107); this.c7Label.Name = "c7Label"; this.c7Label.Size = new System.Drawing.Size(19, 13); this.c7Label.TabIndex = 6; @@ -194,7 +207,7 @@ namespace TBF.UiControls // b7TextBox // this.b7TextBox.Enabled = false; - this.b7TextBox.Location = new System.Drawing.Point(95, 76); + this.b7TextBox.Location = new System.Drawing.Point(82, 79); this.b7TextBox.Name = "b7TextBox"; this.b7TextBox.Size = new System.Drawing.Size(124, 20); this.b7TextBox.TabIndex = 5; @@ -202,23 +215,23 @@ namespace TBF.UiControls // a7TextBox // this.a7TextBox.Enabled = false; - this.a7TextBox.Location = new System.Drawing.Point(95, 51); + this.a7TextBox.Location = new System.Drawing.Point(82, 54); this.a7TextBox.Name = "a7TextBox"; this.a7TextBox.Size = new System.Drawing.Size(124, 20); this.a7TextBox.TabIndex = 4; // - // r0TextBox + // r001cTextBox // - this.r0TextBox.Enabled = false; - this.r0TextBox.Location = new System.Drawing.Point(95, 26); - this.r0TextBox.Name = "r0TextBox"; - this.r0TextBox.Size = new System.Drawing.Size(124, 20); - this.r0TextBox.TabIndex = 3; + this.r001cTextBox.Enabled = false; + this.r001cTextBox.Location = new System.Drawing.Point(82, 29); + this.r001cTextBox.Name = "r001cTextBox"; + this.r001cTextBox.Size = new System.Drawing.Size(124, 20); + this.r001cTextBox.TabIndex = 3; // // b7Label // this.b7Label.AutoSize = true; - this.b7Label.Location = new System.Drawing.Point(23, 79); + this.b7Label.Location = new System.Drawing.Point(20, 82); this.b7Label.Name = "b7Label"; this.b7Label.Size = new System.Drawing.Size(19, 13); this.b7Label.TabIndex = 2; @@ -227,7 +240,7 @@ namespace TBF.UiControls // a7Label // this.a7Label.AutoSize = true; - this.a7Label.Location = new System.Drawing.Point(23, 54); + this.a7Label.Location = new System.Drawing.Point(20, 57); this.a7Label.Name = "a7Label"; this.a7Label.Size = new System.Drawing.Size(19, 13); this.a7Label.TabIndex = 1; @@ -236,7 +249,7 @@ namespace TBF.UiControls // r0Label // this.r0Label.AutoSize = true; - this.r0Label.Location = new System.Drawing.Point(23, 29); + this.r0Label.Location = new System.Drawing.Point(20, 32); this.r0Label.Name = "r0Label"; this.r0Label.Size = new System.Drawing.Size(53, 13); this.r0Label.TabIndex = 0; @@ -252,39 +265,41 @@ namespace TBF.UiControls this.nameGroupBox.TabStop = false; this.nameGroupBox.Text = "Component"; // - // testGroupBox + // its27CalibrationCoefficientsGroupBox // - this.testGroupBox.Controls.Add(this.temperatureTextBox); - this.testGroupBox.Controls.Add(this.resistanceTextBox); - this.testGroupBox.Controls.Add(this.temperatureLabel); - this.testGroupBox.Controls.Add(this.resistanceLabel); - this.testGroupBox.Location = new System.Drawing.Point(472, 10); - this.testGroupBox.Name = "testGroupBox"; - this.testGroupBox.Size = new System.Drawing.Size(180, 130); - this.testGroupBox.TabIndex = 3; - this.testGroupBox.TabStop = false; - this.testGroupBox.Text = "ITS-90 test"; + this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.bTextBox); + this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.label1); + this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.aTextBox); + this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.r0TextBox); + this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.label2); + this.its27CalibrationCoefficientsGroupBox.Controls.Add(this.label3); + this.its27CalibrationCoefficientsGroupBox.Location = new System.Drawing.Point(459, 54); + this.its27CalibrationCoefficientsGroupBox.Name = "its27CalibrationCoefficientsGroupBox"; + this.its27CalibrationCoefficientsGroupBox.Size = new System.Drawing.Size(190, 140); + this.its27CalibrationCoefficientsGroupBox.TabIndex = 3; + this.its27CalibrationCoefficientsGroupBox.TabStop = false; + this.its27CalibrationCoefficientsGroupBox.Text = "ITS-27 calibration coefficients"; // // temperatureTextBox // - this.temperatureTextBox.Location = new System.Drawing.Point(101, 51); + this.temperatureTextBox.Location = new System.Drawing.Point(121, 46); this.temperatureTextBox.Name = "temperatureTextBox"; this.temperatureTextBox.ReadOnly = true; - this.temperatureTextBox.Size = new System.Drawing.Size(63, 20); + this.temperatureTextBox.Size = new System.Drawing.Size(79, 20); this.temperatureTextBox.TabIndex = 5; // // resistanceTextBox // - this.resistanceTextBox.Location = new System.Drawing.Point(101, 26); + this.resistanceTextBox.Location = new System.Drawing.Point(121, 20); this.resistanceTextBox.Name = "resistanceTextBox"; - this.resistanceTextBox.Size = new System.Drawing.Size(63, 20); + this.resistanceTextBox.Size = new System.Drawing.Size(79, 20); this.resistanceTextBox.TabIndex = 4; this.resistanceTextBox.TextChanged += new System.EventHandler(this.measuredTextBox_TextChanged); // // temperatureLabel // this.temperatureLabel.AutoSize = true; - this.temperatureLabel.Location = new System.Drawing.Point(8, 54); + this.temperatureLabel.Location = new System.Drawing.Point(16, 49); this.temperatureLabel.Name = "temperatureLabel"; this.temperatureLabel.Size = new System.Drawing.Size(87, 13); this.temperatureLabel.TabIndex = 3; @@ -293,12 +308,98 @@ namespace TBF.UiControls // resistanceLabel // this.resistanceLabel.AutoSize = true; - this.resistanceLabel.Location = new System.Drawing.Point(8, 29); + this.resistanceLabel.Location = new System.Drawing.Point(16, 23); this.resistanceLabel.Name = "resistanceLabel"; this.resistanceLabel.Size = new System.Drawing.Size(78, 13); this.resistanceLabel.TabIndex = 2; this.resistanceLabel.Text = "Resistance [Ω]"; // + // bTextBox + // + this.bTextBox.Enabled = false; + this.bTextBox.Location = new System.Drawing.Point(52, 79); + this.bTextBox.Name = "bTextBox"; + this.bTextBox.Size = new System.Drawing.Size(124, 20); + this.bTextBox.TabIndex = 13; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(22, 82); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(13, 13); + this.label1.TabIndex = 12; + this.label1.Text = "b"; + // + // aTextBox + // + this.aTextBox.Enabled = false; + this.aTextBox.Location = new System.Drawing.Point(52, 54); + this.aTextBox.Name = "aTextBox"; + this.aTextBox.Size = new System.Drawing.Size(124, 20); + this.aTextBox.TabIndex = 11; + // + // r0TextBox + // + this.r0TextBox.Enabled = false; + this.r0TextBox.Location = new System.Drawing.Point(52, 29); + this.r0TextBox.Name = "r0TextBox"; + this.r0TextBox.Size = new System.Drawing.Size(124, 20); + this.r0TextBox.TabIndex = 10; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(22, 57); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(13, 13); + this.label2.TabIndex = 9; + this.label2.Text = "a"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(22, 32); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(21, 13); + this.label3.TabIndex = 8; + this.label3.Text = "R0"; + // + // testGroupBox + // + this.testGroupBox.Controls.Add(this.temperatureTextBox); + this.testGroupBox.Controls.Add(this.resistanceLabel); + this.testGroupBox.Controls.Add(this.temperatureLabel); + this.testGroupBox.Controls.Add(this.resistanceTextBox); + this.testGroupBox.Location = new System.Drawing.Point(16, 155); + this.testGroupBox.Name = "testGroupBox"; + this.testGroupBox.Size = new System.Drawing.Size(208, 77); + this.testGroupBox.TabIndex = 9; + this.testGroupBox.TabStop = false; + this.testGroupBox.Text = "Test"; + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(235, 24); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(187, 17); + this.radioButton1.TabIndex = 10; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "Use ITS-90 calibration coefficients"; + this.radioButton1.UseVisualStyleBackColor = true; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(462, 24); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(187, 17); + this.radioButton2.TabIndex = 11; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "Use ITS-27 calibration coefficients"; + this.radioButton2.UseVisualStyleBackColor = true; + // // MetrologyDlgPlatinumResistanceTMeterTab // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -308,6 +409,7 @@ namespace TBF.UiControls this.Size = new System.Drawing.Size(668, 400); this.Load += new System.EventHandler(this.MetrologyDlgBalanceTab_Load); this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.calibrationGroupBox.ResumeLayout(false); @@ -316,6 +418,8 @@ namespace TBF.UiControls this.its90CalibrationCoefficientsGroupBox.PerformLayout(); this.nameGroupBox.ResumeLayout(false); this.nameGroupBox.PerformLayout(); + this.its27CalibrationCoefficientsGroupBox.ResumeLayout(false); + this.its27CalibrationCoefficientsGroupBox.PerformLayout(); this.testGroupBox.ResumeLayout(false); this.testGroupBox.PerformLayout(); this.ResumeLayout(false); @@ -327,7 +431,7 @@ namespace TBF.UiControls private System.Windows.Forms.Label cmpntNameLabel; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Label resistanceLabel; - private System.Windows.Forms.GroupBox testGroupBox; + private System.Windows.Forms.GroupBox its27CalibrationCoefficientsGroupBox; private System.Windows.Forms.TextBox temperatureTextBox; private System.Windows.Forms.TextBox resistanceTextBox; private System.Windows.Forms.Label temperatureLabel; @@ -335,7 +439,7 @@ namespace TBF.UiControls private System.Windows.Forms.GroupBox nameGroupBox; private System.Windows.Forms.TextBox b7TextBox; private System.Windows.Forms.TextBox a7TextBox; - private System.Windows.Forms.TextBox r0TextBox; + private System.Windows.Forms.TextBox r001cTextBox; private System.Windows.Forms.Label b7Label; private System.Windows.Forms.Label a7Label; private System.Windows.Forms.Label r0Label; @@ -348,5 +452,14 @@ namespace TBF.UiControls private System.Windows.Forms.Label calibDateLabel; private System.Windows.Forms.TextBox calibCertificateNrTextBox; private System.Windows.Forms.Label calibCertificateNrLabel; + private System.Windows.Forms.GroupBox testGroupBox; + private System.Windows.Forms.TextBox bTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox aTextBox; + private System.Windows.Forms.TextBox r0TextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton1; } } diff --git a/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.cs b/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.cs index 36e9a7138..865336b39 100644 --- a/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.cs +++ b/TestBenchFramework/UiControls/MetrologyDlgPlatinumResistanceTMeterTab.cs @@ -76,12 +76,15 @@ namespace TBF.UiControls calibDateLabel.Text = Strings.Date; calibValidDateLabel.Text = Strings.Valid_until; - its90CalibrationCoefficientsGroupBox.Text = Strings.ITS90_calibration_coefficients; - // r0Label.Text a7Label.Text b7Label.Text c7Label.Text are not translated - - testGroupBox.Text = Strings.ITS90_test; + testGroupBox.Text = Strings.Test; resistanceLabel.Text = string.Format("{0} [Ω]", Strings.Resistance); temperatureLabel.Text = string.Format("{0} [°C]", Strings.Temperature); + + radioButton1.Text = string.Format(Strings.Use_0, Strings.ITS90_calibration_coefficients); + radioButton2.Text = string.Format(Strings.Use_0, Strings.ITS27_calibration_coefficients); + + its90CalibrationCoefficientsGroupBox.Text = Strings.ITS90_calibration_coefficients; + its27CalibrationCoefficientsGroupBox.Text = Strings.ITS27_calibration_coefficients; } void RefreshAll() @@ -92,10 +95,17 @@ namespace TBF.UiControls calibDateTextBox.Text = TempMeterCfg.CalibDate.ToShortDateString(); calibValidDateTextBox.Text = TempMeterCfg.CalibValidDate.ToShortDateString(); - r0TextBox.Text = TempMeterCfg.R001C.ToString(); + radioButton1.Checked = TempMeterCfg.UseITS90; + radioButton2.Checked = !TempMeterCfg.UseITS90; + + r001cTextBox.Text = TempMeterCfg.R001C.ToString(); a7TextBox.Text = TempMeterCfg.a7.ToString(); b7TextBox.Text = TempMeterCfg.b7.ToString(); c7TextBox.Text = TempMeterCfg.c7.ToString(); + + r0TextBox.Text = TempMeterCfg.R0.ToString(); + aTextBox.Text = TempMeterCfg.a.ToString(); + bTextBox.Text = TempMeterCfg.b.ToString(); } } @@ -107,10 +117,17 @@ namespace TBF.UiControls calibDateTextBox.Enabled = true; calibValidDateTextBox.Enabled = true; - r0TextBox.Enabled = true; + radioButton1.Enabled = true; + radioButton2.Enabled = true; + + r001cTextBox.Enabled = true; a7TextBox.Enabled = true; b7TextBox.Enabled = true; c7TextBox.Enabled = true; + + r0TextBox.Enabled = true; + aTextBox.Enabled = true; + bTextBox.Enabled = true; } public void OkBtnClicked() @@ -123,17 +140,23 @@ namespace TBF.UiControls TempMeterCfg.CalibDate = DateTime.Parse(calibDateTextBox.Text); TempMeterCfg.CalibValidDate = DateTime.Parse(calibValidDateTextBox.Text); - TempMeterCfg.R001C = Utils.ParseUDouble(r0TextBox.Text); + TempMeterCfg.UseITS90 = radioButton1.Checked; + + TempMeterCfg.R001C = Utils.ParseUDouble(r001cTextBox.Text); TempMeterCfg.a7 = Utils.ParseEDouble(a7TextBox.Text); TempMeterCfg.b7 = Utils.ParseEDouble(b7TextBox.Text); TempMeterCfg.c7 = Utils.ParseEDouble(c7TextBox.Text); + TempMeterCfg.R0 = Utils.ParseUDouble(r0TextBox.Text); + TempMeterCfg.a = Utils.ParseEDouble(aTextBox.Text); + TempMeterCfg.b = Utils.ParseEDouble(bTextBox.Text); + Component modified = TempMeterCfg.CreateDbEntity(); MeterEntity.Parameters = modified.Parameters; } catch { - MessageBox.Show(string.Format(Strings.Invalid_0, Strings.ITS90_calibration_coefficients), + MessageBox.Show(string.Format(Strings.Invalid_0, Strings.Calibration_coefficients), Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); @@ -146,9 +169,34 @@ namespace TBF.UiControls double resistance; if (Utils.TryParseUDouble(resistanceTextBox.Text, out resistance)) { - double temperature = BenchControl.Formulas.PlatinumResistanceTM_ITS90_R2T(resistance, TempMeterCfg.R001C, TempMeterCfg.a7, TempMeterCfg.b7, TempMeterCfg.c7); - temperatureTextBox.Text = temperature.ToString(); - } + try + { + double temperature; + if (radioButton1.Checked) + { + double R001C = Utils.ParseUDouble(r001cTextBox.Text); + double a7 = Utils.ParseEDouble(a7TextBox.Text); + double b7 = Utils.ParseEDouble(b7TextBox.Text); + double c7 = Utils.ParseEDouble(c7TextBox.Text); + temperature = BenchControl.Formulas.PlatinumResistanceTM_ITS90_R2T(resistance, R001C, a7, b7, c7); + } + else + { + double R0 = Utils.ParseUDouble(r0TextBox.Text); + double a = Utils.ParseEDouble(aTextBox.Text); + double b = Utils.ParseEDouble(bTextBox.Text); + temperature = BenchControl.Formulas.PlatinumResistanceTM_ITS27_R2T(resistance, R0, a, b); + } + temperatureTextBox.Text = temperature.ToString(); + } + catch + { + MessageBox.Show(string.Format(Strings.Invalid_0, Strings.Calibration_coefficients), + Strings.Error, + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); + } + } } public void CancelBtnClicked()