FM2014: refactoring,

MiniPrf: - checks extended
This commit is contained in:
Thomas Wiedebusch
2026-02-17 14:41:43 +01:00
parent c05f2fcf74
commit 6ea7407ed0
8 changed files with 669 additions and 574 deletions
+229 -193
View File
@@ -46,6 +46,22 @@
this.tbxFM2014FullId = new System.Windows.Forms.TextBox();
this.tbxFM2014ApplicationFwVersion = new System.Windows.Forms.TextBox();
this.gbxRegulationSetup = new System.Windows.Forms.GroupBox();
this.gbxBoxDebug = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.tbxRefFlowRateFromRefFrequencyCmPerH = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tbxRefFrequencyDirectHz = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.tbxDutPeriodMs = new System.Windows.Forms.TextBox();
this.tbxRefFlowRateFromRefPeriodCmPerH = new System.Windows.Forms.TextBox();
this.tbxDutFrequencyFromDutPeriodHz = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tbxDutFlowRateFromDutPeriodCmPerH = new System.Windows.Forms.TextBox();
this.tbxRefFrequencyFromRefPeriodHz = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.tbxRefPeriodMs = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.btnSaveSetupToFm2014 = new System.Windows.Forms.Button();
this.cbxToleranceDisplayAttenuation = new System.Windows.Forms.ComboBox();
this.lblRefPulsePerVolume = new System.Windows.Forms.Label();
@@ -81,30 +97,14 @@
this.lblActualFlowRateCmPerHour = new System.Windows.Forms.Label();
this.tbxActualFlowRateCmPerHour = new System.Windows.Forms.TextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.tbxRefFrequencyFromRefPeriodHz = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tbxRefFlowRateFromRefPeriodCmPerH = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.tbxRefPeriodMs = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.tbxDutPeriodMs = new System.Windows.Forms.TextBox();
this.tbxDutFrequencyFromDutPeriodHz = new System.Windows.Forms.TextBox();
this.tbxDutFlowRateFromDutPeriodCmPerH = new System.Windows.Forms.TextBox();
this.grpBoxDebug = new System.Windows.Forms.GroupBox();
this.label7 = new System.Windows.Forms.Label();
this.tbxRefFlowRateFromRefFrequencyCmPerH = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.tbxRefFrequencyDirectHz = new System.Windows.Forms.TextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.gbxFM2014Setup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picFM2014)).BeginInit();
this.gbxRegulationSetup.SuspendLayout();
this.gbxBoxDebug.SuspendLayout();
this.gbxManualRefCalibration.SuspendLayout();
this.gbxDutToRefRegulation.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.grpBoxDebug.SuspendLayout();
this.SuspendLayout();
//
// gbxFM2014Setup
@@ -147,10 +147,11 @@
"5"});
this.cbxToleranceDisplayRange.Location = new System.Drawing.Point(220, 150);
this.cbxToleranceDisplayRange.Name = "cbxToleranceDisplayRange";
this.cbxToleranceDisplayRange.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cbxToleranceDisplayRange.Size = new System.Drawing.Size(60, 21);
this.cbxToleranceDisplayRange.TabIndex = 3;
this.cbxToleranceDisplayRange.Text = "3";
this.cbxToleranceDisplayRange.SelectedValueChanged += new System.EventHandler(this.cbxFM2014BaseSettings_SelectedValueChanged);
this.cbxToleranceDisplayRange.SelectedValueChanged += new System.EventHandler(this.cbxProgramSettings_Changed);
//
// picFM2014
//
@@ -169,8 +170,10 @@
this.tbxFM2014SerialNumber.Location = new System.Drawing.Point(220, 75);
this.tbxFM2014SerialNumber.Name = "tbxFM2014SerialNumber";
this.tbxFM2014SerialNumber.ReadOnly = true;
this.tbxFM2014SerialNumber.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxFM2014SerialNumber.Size = new System.Drawing.Size(60, 20);
this.tbxFM2014SerialNumber.TabIndex = 29;
this.tbxFM2014SerialNumber.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// lblFM2014Tolerance
//
@@ -204,10 +207,11 @@
"22"});
this.cbxFM2014Address.Location = new System.Drawing.Point(220, 125);
this.cbxFM2014Address.Name = "cbxFM2014Address";
this.cbxFM2014Address.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cbxFM2014Address.Size = new System.Drawing.Size(60, 21);
this.cbxFM2014Address.TabIndex = 2;
this.cbxFM2014Address.Text = "1";
this.cbxFM2014Address.SelectedValueChanged += new System.EventHandler(this.cbxFM2014BaseSettings_SelectedValueChanged);
this.cbxFM2014Address.SelectedValueChanged += new System.EventHandler(this.cbxProgramSettings_Changed);
//
// lblFM2014Address
//
@@ -229,9 +233,9 @@
//
// btnFM2014Connect
//
this.btnFM2014Connect.Location = new System.Drawing.Point(170, 179);
this.btnFM2014Connect.Location = new System.Drawing.Point(163, 179);
this.btnFM2014Connect.Name = "btnFM2014Connect";
this.btnFM2014Connect.Size = new System.Drawing.Size(110, 25);
this.btnFM2014Connect.Size = new System.Drawing.Size(120, 25);
this.btnFM2014Connect.TabIndex = 0;
this.btnFM2014Connect.Text = "Connect";
this.btnFM2014Connect.UseVisualStyleBackColor = true;
@@ -242,10 +246,11 @@
this.cbxProgramComPort.FormattingEnabled = true;
this.cbxProgramComPort.Location = new System.Drawing.Point(220, 100);
this.cbxProgramComPort.Name = "cbxProgramComPort";
this.cbxProgramComPort.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cbxProgramComPort.Size = new System.Drawing.Size(60, 21);
this.cbxProgramComPort.TabIndex = 1;
this.cbxProgramComPort.Text = "NA";
this.cbxProgramComPort.SelectedValueChanged += new System.EventHandler(this.cbxFM2014BaseSettings_SelectedValueChanged);
this.cbxProgramComPort.SelectedValueChanged += new System.EventHandler(this.cbxProgramSettings_Changed);
//
// lblFM2014SerialPort
//
@@ -281,11 +286,14 @@
this.tbxFM2014ApplicationFwVersion.Location = new System.Drawing.Point(220, 50);
this.tbxFM2014ApplicationFwVersion.Name = "tbxFM2014ApplicationFwVersion";
this.tbxFM2014ApplicationFwVersion.ReadOnly = true;
this.tbxFM2014ApplicationFwVersion.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxFM2014ApplicationFwVersion.Size = new System.Drawing.Size(60, 20);
this.tbxFM2014ApplicationFwVersion.TabIndex = 31;
this.tbxFM2014ApplicationFwVersion.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// gbxRegulationSetup
//
this.gbxRegulationSetup.Controls.Add(this.gbxBoxDebug);
this.gbxRegulationSetup.Controls.Add(this.btnSaveSetupToFm2014);
this.gbxRegulationSetup.Controls.Add(this.cbxToleranceDisplayAttenuation);
this.gbxRegulationSetup.Controls.Add(this.lblRefPulsePerVolume);
@@ -302,11 +310,179 @@
this.gbxRegulationSetup.TabStop = false;
this.gbxRegulationSetup.Text = "Regulation Setup";
//
// grpBoxDebug
//
this.gbxBoxDebug.Controls.Add(this.label7);
this.gbxBoxDebug.Controls.Add(this.tbxRefFlowRateFromRefFrequencyCmPerH);
this.gbxBoxDebug.Controls.Add(this.label6);
this.gbxBoxDebug.Controls.Add(this.tbxRefFrequencyDirectHz);
this.gbxBoxDebug.Controls.Add(this.label1);
this.gbxBoxDebug.Controls.Add(this.tbxDutPeriodMs);
this.gbxBoxDebug.Controls.Add(this.tbxRefFlowRateFromRefPeriodCmPerH);
this.gbxBoxDebug.Controls.Add(this.tbxDutFrequencyFromDutPeriodHz);
this.gbxBoxDebug.Controls.Add(this.label2);
this.gbxBoxDebug.Controls.Add(this.tbxDutFlowRateFromDutPeriodCmPerH);
this.gbxBoxDebug.Controls.Add(this.tbxRefFrequencyFromRefPeriodHz);
this.gbxBoxDebug.Controls.Add(this.label5);
this.gbxBoxDebug.Controls.Add(this.tbxRefPeriodMs);
this.gbxBoxDebug.Controls.Add(this.label4);
this.gbxBoxDebug.Controls.Add(this.label3);
this.gbxBoxDebug.Location = new System.Drawing.Point(0, -1);
this.gbxBoxDebug.Name = "gbxBoxDebug";
this.gbxBoxDebug.Size = new System.Drawing.Size(288, 175);
this.gbxBoxDebug.TabIndex = 83;
this.gbxBoxDebug.TabStop = false;
this.gbxBoxDebug.Text = "Debug";
this.gbxBoxDebug.Visible = false;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(10, 101);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(128, 13);
this.label7.TabIndex = 96;
this.label7.Text = "Flow Rate f(frequ.) [m³/h]:";
//
// tbxRefFlowRateFromRefFrequencyCmPerH
//
this.tbxRefFlowRateFromRefFrequencyCmPerH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFlowRateFromRefFrequencyCmPerH.Location = new System.Drawing.Point(153, 99);
this.tbxRefFlowRateFromRefFrequencyCmPerH.Name = "tbxRefFlowRateFromRefFrequencyCmPerH";
this.tbxRefFlowRateFromRefFrequencyCmPerH.ReadOnly = true;
this.tbxRefFlowRateFromRefFrequencyCmPerH.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxRefFlowRateFromRefFrequencyCmPerH.Size = new System.Drawing.Size(60, 20);
this.tbxRefFlowRateFromRefFrequencyCmPerH.TabIndex = 95;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(10, 52);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(117, 13);
this.label6.TabIndex = 94;
this.label6.Text = "Frequency (direct) [Hz]:";
//
// tbxRefFrequencyDirectHz
//
this.tbxRefFrequencyDirectHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFrequencyDirectHz.Location = new System.Drawing.Point(153, 50);
this.tbxRefFrequencyDirectHz.Name = "tbxRefFrequencyDirectHz";
this.tbxRefFrequencyDirectHz.ReadOnly = true;
this.tbxRefFrequencyDirectHz.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxRefFrequencyDirectHz.Size = new System.Drawing.Size(60, 20);
this.tbxRefFrequencyDirectHz.TabIndex = 93;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(123, 13);
this.label1.TabIndex = 83;
this.label1.Text = "Frequency f(period) [Hz]:";
//
// tbxDutPeriodMs
//
this.tbxDutPeriodMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutPeriodMs.Location = new System.Drawing.Point(220, 123);
this.tbxDutPeriodMs.Name = "tbxDutPeriodMs";
this.tbxDutPeriodMs.ReadOnly = true;
this.tbxDutPeriodMs.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxDutPeriodMs.Size = new System.Drawing.Size(60, 20);
this.tbxDutPeriodMs.TabIndex = 92;
//
// tbxRefFlowRateFromRefPeriodCmPerH
//
this.tbxRefFlowRateFromRefPeriodCmPerH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFlowRateFromRefPeriodCmPerH.Location = new System.Drawing.Point(153, 74);
this.tbxRefFlowRateFromRefPeriodCmPerH.Name = "tbxRefFlowRateFromRefPeriodCmPerH";
this.tbxRefFlowRateFromRefPeriodCmPerH.ReadOnly = true;
this.tbxRefFlowRateFromRefPeriodCmPerH.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxRefFlowRateFromRefPeriodCmPerH.Size = new System.Drawing.Size(60, 20);
this.tbxRefFlowRateFromRefPeriodCmPerH.TabIndex = 81;
//
// tbxDutFrequencyFromDutPeriodHz
//
this.tbxDutFrequencyFromDutPeriodHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutFrequencyFromDutPeriodHz.Location = new System.Drawing.Point(220, 25);
this.tbxDutFrequencyFromDutPeriodHz.Name = "tbxDutFrequencyFromDutPeriodHz";
this.tbxDutFrequencyFromDutPeriodHz.ReadOnly = true;
this.tbxDutFrequencyFromDutPeriodHz.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxDutFrequencyFromDutPeriodHz.Size = new System.Drawing.Size(60, 20);
this.tbxDutFrequencyFromDutPeriodHz.TabIndex = 91;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(130, 13);
this.label2.TabIndex = 80;
this.label2.Text = "Flow Rate f(period) [m³/h]:";
//
// tbxDutFlowRateFromDutPeriodCmPerH
//
this.tbxDutFlowRateFromDutPeriodCmPerH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutFlowRateFromDutPeriodCmPerH.Location = new System.Drawing.Point(220, 74);
this.tbxDutFlowRateFromDutPeriodCmPerH.Name = "tbxDutFlowRateFromDutPeriodCmPerH";
this.tbxDutFlowRateFromDutPeriodCmPerH.ReadOnly = true;
this.tbxDutFlowRateFromDutPeriodCmPerH.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxDutFlowRateFromDutPeriodCmPerH.Size = new System.Drawing.Size(60, 20);
this.tbxDutFlowRateFromDutPeriodCmPerH.TabIndex = 90;
//
// tbxRefFrequencyFromRefPeriodHz
//
this.tbxRefFrequencyFromRefPeriodHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFrequencyFromRefPeriodHz.Location = new System.Drawing.Point(153, 25);
this.tbxRefFrequencyFromRefPeriodHz.Name = "tbxRefFrequencyFromRefPeriodHz";
this.tbxRefFrequencyFromRefPeriodHz.ReadOnly = true;
this.tbxRefFrequencyFromRefPeriodHz.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxRefFrequencyFromRefPeriodHz.Size = new System.Drawing.Size(60, 20);
this.tbxRefFrequencyFromRefPeriodHz.TabIndex = 82;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(232, 9);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(30, 13);
this.label5.TabIndex = 89;
this.label5.Text = "DUT";
//
// tbxRefPeriodMs
//
this.tbxRefPeriodMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefPeriodMs.Location = new System.Drawing.Point(153, 123);
this.tbxRefPeriodMs.Name = "tbxRefPeriodMs";
this.tbxRefPeriodMs.ReadOnly = true;
this.tbxRefPeriodMs.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.tbxRefPeriodMs.Size = new System.Drawing.Size(60, 20);
this.tbxRefPeriodMs.TabIndex = 85;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(169, 9);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(28, 13);
this.label4.TabIndex = 88;
this.label4.Text = "REF";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 125);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(62, 13);
this.label3.TabIndex = 84;
this.label3.Text = "Period [ms]:";
//
// btnSaveSetupToFm2014
//
this.btnSaveSetupToFm2014.Location = new System.Drawing.Point(173, 144);
this.btnSaveSetupToFm2014.Location = new System.Drawing.Point(163, 144);
this.btnSaveSetupToFm2014.Name = "btnSaveSetupToFm2014";
this.btnSaveSetupToFm2014.Size = new System.Drawing.Size(110, 25);
this.btnSaveSetupToFm2014.Size = new System.Drawing.Size(120, 25);
this.btnSaveSetupToFm2014.TabIndex = 7;
this.btnSaveSetupToFm2014.Text = "Save";
this.btnSaveSetupToFm2014.UseVisualStyleBackColor = true;
@@ -327,6 +503,7 @@
"9"});
this.cbxToleranceDisplayAttenuation.Location = new System.Drawing.Point(220, 101);
this.cbxToleranceDisplayAttenuation.Name = "cbxToleranceDisplayAttenuation";
this.cbxToleranceDisplayAttenuation.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.cbxToleranceDisplayAttenuation.Size = new System.Drawing.Size(60, 21);
this.cbxToleranceDisplayAttenuation.TabIndex = 6;
this.cbxToleranceDisplayAttenuation.Text = "3";
@@ -374,8 +551,10 @@
this.tbxRefPulsesPerCm.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefPulsesPerCm.Location = new System.Drawing.Point(220, 26);
this.tbxRefPulsesPerCm.Name = "tbxRefPulsesPerCm";
this.tbxRefPulsesPerCm.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxRefPulsesPerCm.Size = new System.Drawing.Size(60, 20);
this.tbxRefPulsesPerCm.TabIndex = 4;
this.tbxRefPulsesPerCm.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tbxRefPulsesPerCm.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbxRefPulsesPerCm_KeyDown);
this.tbxRefPulsesPerCm.Leave += new System.EventHandler(this.tbxRefPulsesPerCm_Leave);
//
@@ -384,8 +563,10 @@
this.tbxDutPulsesPerCm.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutPulsesPerCm.Location = new System.Drawing.Point(220, 51);
this.tbxDutPulsesPerCm.Name = "tbxDutPulsesPerCm";
this.tbxDutPulsesPerCm.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxDutPulsesPerCm.Size = new System.Drawing.Size(60, 20);
this.tbxDutPulsesPerCm.TabIndex = 5;
this.tbxDutPulsesPerCm.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tbxDutPulsesPerCm.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbxDutPulsesPerCm_KeyDown);
this.tbxDutPulsesPerCm.Leave += new System.EventHandler(this.tbxDutPulsesPerCm_Leave);
//
@@ -395,8 +576,10 @@
this.tbxScaleRefToDut.Location = new System.Drawing.Point(220, 76);
this.tbxScaleRefToDut.Name = "tbxScaleRefToDut";
this.tbxScaleRefToDut.ReadOnly = true;
this.tbxScaleRefToDut.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxScaleRefToDut.Size = new System.Drawing.Size(60, 20);
this.tbxScaleRefToDut.TabIndex = 66;
this.tbxScaleRefToDut.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// lblUpdateTimeValue
//
@@ -450,9 +633,9 @@
//
// btnDutToRefRegulation
//
this.btnDutToRefRegulation.Location = new System.Drawing.Point(113, 144);
this.btnDutToRefRegulation.Location = new System.Drawing.Point(104, 144);
this.btnDutToRefRegulation.Name = "btnDutToRefRegulation";
this.btnDutToRefRegulation.Size = new System.Drawing.Size(110, 25);
this.btnDutToRefRegulation.Size = new System.Drawing.Size(120, 25);
this.btnDutToRefRegulation.TabIndex = 11;
this.btnDutToRefRegulation.Text = "Start Regulation";
this.btnDutToRefRegulation.UseVisualStyleBackColor = true;
@@ -492,8 +675,10 @@
this.tbxDutPulsesMeasured.Location = new System.Drawing.Point(164, 51);
this.tbxDutPulsesMeasured.Name = "tbxDutPulsesMeasured";
this.tbxDutPulsesMeasured.ReadOnly = true;
this.tbxDutPulsesMeasured.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxDutPulsesMeasured.Size = new System.Drawing.Size(60, 20);
this.tbxDutPulsesMeasured.TabIndex = 75;
this.tbxDutPulsesMeasured.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// lblPulseVolumeCmRelation
//
@@ -510,8 +695,10 @@
this.tbxRefCalibrationResultPulsePerCm.Location = new System.Drawing.Point(164, 102);
this.tbxRefCalibrationResultPulsePerCm.Name = "tbxRefCalibrationResultPulsePerCm";
this.tbxRefCalibrationResultPulsePerCm.ReadOnly = true;
this.tbxRefCalibrationResultPulsePerCm.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxRefCalibrationResultPulsePerCm.Size = new System.Drawing.Size(60, 20);
this.tbxRefCalibrationResultPulsePerCm.TabIndex = 73;
this.tbxRefCalibrationResultPulsePerCm.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// lblWeightScaleVolume
//
@@ -527,8 +714,10 @@
this.tbxVolumeMeasuredLiters.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxVolumeMeasuredLiters.Location = new System.Drawing.Point(164, 77);
this.tbxVolumeMeasuredLiters.Name = "tbxVolumeMeasuredLiters";
this.tbxVolumeMeasuredLiters.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxVolumeMeasuredLiters.Size = new System.Drawing.Size(60, 20);
this.tbxVolumeMeasuredLiters.TabIndex = 8;
this.tbxVolumeMeasuredLiters.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tbxVolumeMeasuredLiters.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbxManualInputVolumeLiters_KeyStoke);
this.tbxVolumeMeasuredLiters.Leave += new System.EventHandler(this.tbxManualInputVolumeLiters_Leave);
//
@@ -547,14 +736,16 @@
this.tbxRefPulsesMeasured.Location = new System.Drawing.Point(164, 26);
this.tbxRefPulsesMeasured.Name = "tbxRefPulsesMeasured";
this.tbxRefPulsesMeasured.ReadOnly = true;
this.tbxRefPulsesMeasured.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxRefPulsesMeasured.Size = new System.Drawing.Size(60, 20);
this.tbxRefPulsesMeasured.TabIndex = 69;
this.tbxRefPulsesMeasured.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// btnManualRefCalibration
//
this.btnManualRefCalibration.Location = new System.Drawing.Point(114, 130);
this.btnManualRefCalibration.Location = new System.Drawing.Point(104, 130);
this.btnManualRefCalibration.Name = "btnManualRefCalibration";
this.btnManualRefCalibration.Size = new System.Drawing.Size(110, 25);
this.btnManualRefCalibration.Size = new System.Drawing.Size(120, 25);
this.btnManualRefCalibration.TabIndex = 9;
this.btnManualRefCalibration.Text = "Start Calibration";
this.btnManualRefCalibration.UseVisualStyleBackColor = true;
@@ -592,8 +783,10 @@
this.tbxRefFrequencyHz.Location = new System.Drawing.Point(163, 51);
this.tbxRefFrequencyHz.Name = "tbxRefFrequencyHz";
this.tbxRefFrequencyHz.ReadOnly = true;
this.tbxRefFrequencyHz.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxRefFrequencyHz.Size = new System.Drawing.Size(60, 20);
this.tbxRefFrequencyHz.TabIndex = 78;
this.tbxRefFrequencyHz.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// chkUseDampedTolerance
//
@@ -622,8 +815,10 @@
this.tbxActualMeasuredToleranceDutToRef.Location = new System.Drawing.Point(163, 25);
this.tbxActualMeasuredToleranceDutToRef.Name = "tbxActualMeasuredToleranceDutToRef";
this.tbxActualMeasuredToleranceDutToRef.ReadOnly = true;
this.tbxActualMeasuredToleranceDutToRef.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxActualMeasuredToleranceDutToRef.Size = new System.Drawing.Size(60, 20);
this.tbxActualMeasuredToleranceDutToRef.TabIndex = 77;
this.tbxActualMeasuredToleranceDutToRef.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// lblActualFlowRateCmPerHour
//
@@ -640,8 +835,10 @@
this.tbxActualFlowRateCmPerHour.Location = new System.Drawing.Point(163, 77);
this.tbxActualFlowRateCmPerHour.Name = "tbxActualFlowRateCmPerHour";
this.tbxActualFlowRateCmPerHour.ReadOnly = true;
this.tbxActualFlowRateCmPerHour.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.tbxActualFlowRateCmPerHour.Size = new System.Drawing.Size(60, 20);
this.tbxActualFlowRateCmPerHour.TabIndex = 75;
this.tbxActualFlowRateCmPerHour.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// pictureBox1
//
@@ -653,166 +850,6 @@
this.pictureBox1.TabIndex = 86;
this.pictureBox1.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(123, 13);
this.label1.TabIndex = 83;
this.label1.Text = "Frequency f(period) [Hz]:";
//
// tbxRefFrequencyFromRefPeriodHz
//
this.tbxRefFrequencyFromRefPeriodHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFrequencyFromRefPeriodHz.Location = new System.Drawing.Point(153, 25);
this.tbxRefFrequencyFromRefPeriodHz.Name = "tbxRefFrequencyFromRefPeriodHz";
this.tbxRefFrequencyFromRefPeriodHz.ReadOnly = true;
this.tbxRefFrequencyFromRefPeriodHz.Size = new System.Drawing.Size(60, 20);
this.tbxRefFrequencyFromRefPeriodHz.TabIndex = 82;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(130, 13);
this.label2.TabIndex = 80;
this.label2.Text = "Flow Rate f(period) [m³/h]:";
//
// tbxRefFlowRateFromRefPeriodCmPerH
//
this.tbxRefFlowRateFromRefPeriodCmPerH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFlowRateFromRefPeriodCmPerH.Location = new System.Drawing.Point(153, 74);
this.tbxRefFlowRateFromRefPeriodCmPerH.Name = "tbxRefFlowRateFromRefPeriodCmPerH";
this.tbxRefFlowRateFromRefPeriodCmPerH.ReadOnly = true;
this.tbxRefFlowRateFromRefPeriodCmPerH.Size = new System.Drawing.Size(60, 20);
this.tbxRefFlowRateFromRefPeriodCmPerH.TabIndex = 81;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 125);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(62, 13);
this.label3.TabIndex = 84;
this.label3.Text = "Period [ms]:";
//
// tbxRefPeriodMs
//
this.tbxRefPeriodMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefPeriodMs.Location = new System.Drawing.Point(153, 123);
this.tbxRefPeriodMs.Name = "tbxRefPeriodMs";
this.tbxRefPeriodMs.ReadOnly = true;
this.tbxRefPeriodMs.Size = new System.Drawing.Size(60, 20);
this.tbxRefPeriodMs.TabIndex = 85;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(169, 9);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(28, 13);
this.label4.TabIndex = 88;
this.label4.Text = "REF";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(232, 9);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(30, 13);
this.label5.TabIndex = 89;
this.label5.Text = "DUT";
//
// tbxDutPeriodMs
//
this.tbxDutPeriodMs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutPeriodMs.Location = new System.Drawing.Point(220, 123);
this.tbxDutPeriodMs.Name = "tbxDutPeriodMs";
this.tbxDutPeriodMs.ReadOnly = true;
this.tbxDutPeriodMs.Size = new System.Drawing.Size(60, 20);
this.tbxDutPeriodMs.TabIndex = 92;
//
// tbxDutFrequencyFromDutPeriodHz
//
this.tbxDutFrequencyFromDutPeriodHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutFrequencyFromDutPeriodHz.Location = new System.Drawing.Point(220, 25);
this.tbxDutFrequencyFromDutPeriodHz.Name = "tbxDutFrequencyFromDutPeriodHz";
this.tbxDutFrequencyFromDutPeriodHz.ReadOnly = true;
this.tbxDutFrequencyFromDutPeriodHz.Size = new System.Drawing.Size(60, 20);
this.tbxDutFrequencyFromDutPeriodHz.TabIndex = 91;
//
// tbxDutFlowRateFromDutPeriodCmPerH
//
this.tbxDutFlowRateFromDutPeriodCmPerH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxDutFlowRateFromDutPeriodCmPerH.Location = new System.Drawing.Point(220, 74);
this.tbxDutFlowRateFromDutPeriodCmPerH.Name = "tbxDutFlowRateFromDutPeriodCmPerH";
this.tbxDutFlowRateFromDutPeriodCmPerH.ReadOnly = true;
this.tbxDutFlowRateFromDutPeriodCmPerH.Size = new System.Drawing.Size(60, 20);
this.tbxDutFlowRateFromDutPeriodCmPerH.TabIndex = 90;
//
// grpBoxDebug
//
this.grpBoxDebug.Controls.Add(this.label7);
this.grpBoxDebug.Controls.Add(this.tbxRefFlowRateFromRefFrequencyCmPerH);
this.grpBoxDebug.Controls.Add(this.label6);
this.grpBoxDebug.Controls.Add(this.tbxRefFrequencyDirectHz);
this.grpBoxDebug.Controls.Add(this.label1);
this.grpBoxDebug.Controls.Add(this.tbxDutPeriodMs);
this.grpBoxDebug.Controls.Add(this.tbxRefFlowRateFromRefPeriodCmPerH);
this.grpBoxDebug.Controls.Add(this.tbxDutFrequencyFromDutPeriodHz);
this.grpBoxDebug.Controls.Add(this.label2);
this.grpBoxDebug.Controls.Add(this.tbxDutFlowRateFromDutPeriodCmPerH);
this.grpBoxDebug.Controls.Add(this.tbxRefFrequencyFromRefPeriodHz);
this.grpBoxDebug.Controls.Add(this.label5);
this.grpBoxDebug.Controls.Add(this.tbxRefPeriodMs);
this.grpBoxDebug.Controls.Add(this.label4);
this.grpBoxDebug.Controls.Add(this.label3);
this.grpBoxDebug.Location = new System.Drawing.Point(8, 238);
this.grpBoxDebug.Name = "grpBoxDebug";
this.grpBoxDebug.Size = new System.Drawing.Size(288, 175);
this.grpBoxDebug.TabIndex = 83;
this.grpBoxDebug.TabStop = false;
this.grpBoxDebug.Text = "Debug";
this.grpBoxDebug.Visible = false;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(10, 101);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(128, 13);
this.label7.TabIndex = 96;
this.label7.Text = "Flow Rate f(frequ.) [m³/h]:";
//
// tbxRefFlowRateFromRefFrequencyCmPerH
//
this.tbxRefFlowRateFromRefFrequencyCmPerH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFlowRateFromRefFrequencyCmPerH.Location = new System.Drawing.Point(153, 99);
this.tbxRefFlowRateFromRefFrequencyCmPerH.Name = "tbxRefFlowRateFromRefFrequencyCmPerH";
this.tbxRefFlowRateFromRefFrequencyCmPerH.ReadOnly = true;
this.tbxRefFlowRateFromRefFrequencyCmPerH.Size = new System.Drawing.Size(60, 20);
this.tbxRefFlowRateFromRefFrequencyCmPerH.TabIndex = 95;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(10, 52);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(117, 13);
this.label6.TabIndex = 94;
this.label6.Text = "Frequency (direct) [Hz]:";
//
// tbxRefFrequencyDirectHz
//
this.tbxRefFrequencyDirectHz.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tbxRefFrequencyDirectHz.Location = new System.Drawing.Point(153, 50);
this.tbxRefFrequencyDirectHz.Name = "tbxRefFrequencyDirectHz";
this.tbxRefFrequencyDirectHz.ReadOnly = true;
this.tbxRefFrequencyDirectHz.Size = new System.Drawing.Size(60, 20);
this.tbxRefFrequencyDirectHz.TabIndex = 93;
//
// menuStrip1
//
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
@@ -825,8 +862,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(543, 461);
this.Controls.Add(this.grpBoxDebug);
this.ClientSize = new System.Drawing.Size(543, 460);
this.Controls.Add(this.gbxRegulationSetup);
this.Controls.Add(this.gbxDutToRefRegulation);
this.Controls.Add(this.pictureBox1);
@@ -852,13 +888,13 @@
((System.ComponentModel.ISupportInitialize)(this.picFM2014)).EndInit();
this.gbxRegulationSetup.ResumeLayout(false);
this.gbxRegulationSetup.PerformLayout();
this.gbxBoxDebug.ResumeLayout(false);
this.gbxBoxDebug.PerformLayout();
this.gbxManualRefCalibration.ResumeLayout(false);
this.gbxManualRefCalibration.PerformLayout();
this.gbxDutToRefRegulation.ResumeLayout(false);
this.gbxDutToRefRegulation.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.grpBoxDebug.ResumeLayout(false);
this.grpBoxDebug.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -925,7 +961,7 @@
private System.Windows.Forms.TextBox tbxDutPeriodMs;
private System.Windows.Forms.TextBox tbxDutFrequencyFromDutPeriodHz;
private System.Windows.Forms.TextBox tbxDutFlowRateFromDutPeriodCmPerH;
private System.Windows.Forms.GroupBox grpBoxDebug;
private System.Windows.Forms.GroupBox gbxBoxDebug;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox tbxRefFrequencyDirectHz;
private System.Windows.Forms.Label label7;
+101 -70
View File
@@ -90,8 +90,12 @@ namespace Sensus.MiniPrf.Ui
// internal reminders of changed items to avoid write access on startup if items are preloaded
private Int32 _comPortIdx;
private Int32 _addressIdx;
private Int32 _currentOutputDisplayRange_percent;
private Byte _toleranceDisplayAttenuation;
private Int32 _currentOutputDisplayRangeIdx;
// Reminder of settings in standalone measurement to avoid repeated storage af already stored values
private UInt32 _initialRefPulsesPerCm;
private UInt16 _initialDutPulsesPerCm;
private Byte _initialCurrentOutputAttenuation;
/// <summary>
/// The regulation setup will be stored directly to the FM2014 being able to use it at startup
@@ -140,7 +144,7 @@ namespace Sensus.MiniPrf.Ui
_fm2014RegulationSetupHasChanged = false;
_programConfigSetupHasChanged = false;
grpBoxDebug.Visible = false;
gbxBoxDebug.Visible = false;
gbxDutToRefRegulation.Visible = true;
gbxRegulationSetup.Visible = true;
@@ -165,10 +169,11 @@ namespace Sensus.MiniPrf.Ui
{
cbxProgramComPort.Items.Add(comPort);
}
cbxProgramComPort.Text = cbxProgramComPort.Items[_comPortIdx].ToString();
// Select the last address
var itemContent = _fm2014Config.Address ?? 1;
for (var idx = 0; idx < cbxFM2014Address.MaxDropDownItems; idx++)
for (var idx = 0; idx < cbxFM2014Address.Items.Count; idx++)
{
if (!cbxFM2014Address.Items[idx].ToString().Equals(itemContent.ToString())) continue;
@@ -177,12 +182,13 @@ namespace Sensus.MiniPrf.Ui
break;
}
// Select the current output range
itemContent = _fm2014Config.CommonCurrentOutputDisplayRangeNominal_percent;
for (var idx = 0; idx < cbxToleranceDisplayRange.MaxDropDownItems; idx++)
for (var idx = 0; idx < cbxToleranceDisplayRange.Items.Count; idx++)
{
if (!cbxToleranceDisplayRange.Items[idx].ToString().Equals(itemContent.ToString())) continue;
_currentOutputDisplayRange_percent = idx;
_currentOutputDisplayRangeIdx = idx;
cbxToleranceDisplayRange.SelectedItem = cbxToleranceDisplayRange.Items[idx];
break;
}
@@ -230,11 +236,13 @@ namespace Sensus.MiniPrf.Ui
gbxDutToRefRegulation.Text = Resources.StrGbxDutToRefRegulation;
lblActualFlowRateCmPerHour.Text = Resources.StrLblActualMeasuredFlowRate;
tbxActualFlowRateCmPerHour.Text = "";
tbxActualFlowRateCmPerHour.BackColor = ColorStandardDisplayField;
lblActualMeasuredTolerance.Text = Resources.StrLblActualMeasuredToleranceDutToRef;
tbxActualMeasuredToleranceDutToRef.Text = "";
chkUseDampedTolerance.Text = Resources.StrChkUseDampedTolerance;
btnDutToRefRegulation.Text = Resources.StrBtnStartRegulation;
tbxRefFrequencyHz.Text = "";
tbxRefFrequencyHz.BackColor = ColorStandardDisplayField;
// Process status
lblActualProcess.Text = Resources.StrLblProcessStatus;
@@ -267,9 +275,16 @@ namespace Sensus.MiniPrf.Ui
_programConfigSetupHasChanged = false;
_fm2014Config.SharedSerialPort = cbxProgramComPort.Text;
_fm2014Config.Address = _addressIdx;
_fm2014Config.CommonCurrentOutputDisplayRangeNominal_percent = _currentOutputDisplayRange_percent;
if (int.TryParse(cbxFM2014Address.SelectedItem.ToString(), out var address))
{
_fm2014Config.Address = address;
}
if (int.TryParse(cbxToleranceDisplayRange.SelectedItem.ToString(), out var tolerancePercent)
&& (tolerancePercent == FM2014.CURRENT_OUTPUT_DISPLAY_RANGE_STANDARD_NOMINAL_percent ||
tolerancePercent == FM2014.CURRENT_OUTPUT_DISPLAY_RANGE_EXTENDED_NOMINAL_percent))
{
_fm2014Config.CommonCurrentOutputDisplayRangeNominal_percent = tolerancePercent;
}
_fm2014Config.Update();
}));
}
@@ -759,31 +774,34 @@ namespace Sensus.MiniPrf.Ui
LogText($"{resp.AnswerStr}: {resp.IntValue:D} {resp.Unit}");
switch (resp.CmdName)
{
case CmdName.CMD_REF_GET_PLS_CTR:
case CmdName.CMD_REF_GET_PLS_CTR_BU:
case CmdName.CmdGetRefPulsesCounted:
case CmdName.CmdGetRefPulsesCountedBackup:
tbxRefPulsesMeasured.Text = $@"{resp.IntValue:D}";
break;
case CmdName.CMD_DUT_GET_PLS_CTR:
case CmdName.CMD_DUT_GET_PLS_CTR_BU:
case CmdName.CmdGetDutPulsesCounted:
case CmdName.CmdGetDutPulsesCountedBackup:
tbxDutPulsesMeasured.Text = $@"{resp.IntValue:D}";
break;
case CmdName.CMD_REF_LPP_SCALE:
case CmdName.CmdSetRefPulsesPerCm:
tbxRefPulsesPerCm.Text = $@"{resp.IntValue:D}";
_initialRefPulsesPerCm = (UInt32)resp.IntValue;
break;
case CmdName.CMD_DUT_LPP_SCALE:
case CmdName.CmdSetDutPulsesPerCm:
tbxDutPulsesPerCm.Text = $@"{resp.IntValue:D}";
_initialDutPulsesPerCm = (UInt16)resp.IntValue;
break;
case CmdName.CMD_MEAS_SET_ATTN:
case CmdName.CmdSetCurrentOutputAttenuation:
var idx = cbxToleranceDisplayAttenuation.FindString($@"{resp.IntValue}");
cbxToleranceDisplayAttenuation.SelectedIndex = idx;
_initialCurrentOutputAttenuation = (Byte)resp.IntValue;
break;
case CmdName.CMD_GET_REF_FREQU:
case CmdName.CmdGetRefFrequency:
tbxRefFrequencyHz.Text = $@"{resp.IntValue:D}";
tbxRefFrequencyDirectHz.Text = $@"{resp.IntValue:D}";
tbxRefFrequencyHz.BackColor = statusColor;
tbxActualFlowRateCmPerHour.BackColor = statusColor;
break;
case CmdName.CMD_RST_MEAS:
case CmdName.CmdResetMeasurement:
// Immediately lock all buttons and input fields until reset is finished
SetFM2014AccessLocked();
// Check countdown of reset method
@@ -798,36 +816,36 @@ namespace Sensus.MiniPrf.Ui
LogText($"{resp.AnswerStr}: {resp.DoubleValue:F2} {resp.Unit}");
switch (resp.CmdName)
{
case CmdName.CMD_GET_UDTLC:
case CmdName.CMD_GET_DTLC:
case CmdName.CmdGetDutToRefToleranceUndamped:
case CmdName.CmdGetDutToRefToleranceDamped:
tbxActualMeasuredToleranceDutToRef.Text = $@"{resp.DoubleValue:F2}";
tbxActualMeasuredToleranceDutToRef.BackColor = statusColor;
break;
case CmdName.CMD_REF_SET_SCALE:
case CmdName.CmdRefToDutScale:
tbxScaleRefToDut.Text = $@"{resp.DoubleValue:F4}";
break;
// DEBUG
case CmdName.CMD_GET_REF_PERIOD:
case CmdName.CmdGetRefPeriod:
tbxRefPeriodMs.Text = $@"{resp.DoubleValue:F3}";
break;
case CmdName.CMD_GET_DUT_PERIOD:
case CmdName.CmdGetDutPeriod:
tbxDutPeriodMs.Text = $@"{resp.DoubleValue:F3}";
break;
case CmdName.CMD_CAL_FREQU_REF_PERIOD:
case CmdName.CmdCalculatedFrequRefPeriod:
tbxRefFrequencyFromRefPeriodHz.Text = $@"{resp.DoubleValue:F3}";
break;
case CmdName.CMD_CAL_FREQU_DUT_PERIOD:
case CmdName.CmdCalculatedFrequencyDutPeriod:
tbxDutFrequencyFromDutPeriodHz.Text = $@"{resp.DoubleValue:F3}";
break;
case CmdName.CMD_CAL_FLOW_REF_FREQU:
case CmdName.CmdCalculatedFlowRefFrequ:
tbxRefFlowRateFromRefFrequencyCmPerH.Text = $@"{resp.DoubleValue:F3}";
// TODO THW Check if the actual flow shall be taken based on 'REF Frequency'
tbxActualFlowRateCmPerHour.Text = $@"{resp.DoubleValue:F3}";
break;
case CmdName.CMD_CAL_FLOW_REF_PERIOD:
case CmdName.CmdCalculatedFlowRefPeriod:
tbxRefFlowRateFromRefPeriodCmPerH.Text = $@"{resp.DoubleValue:F3}";
break;
case CmdName.CMD_CAL_FLOW_DUT_PERIOD:
case CmdName.CmdCalculatedFlowDutPeriod:
tbxDutFlowRateFromDutPeriodCmPerH.Text = $@"{resp.DoubleValue:F3}";
break;
@@ -879,30 +897,13 @@ namespace Sensus.MiniPrf.Ui
_startTime = DateTimeOffset.UtcNow;
Invoke(new Action(() =>
{
if (FM2014.SharedCyclicMeasSequ == CyclicMeasSequ.IDLE)
if (FM2014.SharedCyclicMeasSequ == CyclicMeasSequ.idle)
{
if (FM2014.RegisteredFm2014s == null || FM2014.RegisteredFm2014s.Count == 0)
return;
// Take the settings from the inputs
UInt32 refPulses_per_cm = 1000;
UInt16 dutPulses_per_cm = 100;
UInt16 doublePulseDeadtime_ms = 0;
if (int.TryParse(tbxRefPulsesPerCm.Text, out var pulses_per_cm) &&
FM2014.PULSES_PER_CM_REGULATION_SETUP_MIN <= pulses_per_cm &&
FM2014.REF_PULSES_PER_CM_REGULATION_INPUT_MAX >= pulses_per_cm)
{
refPulses_per_cm = (UInt32)pulses_per_cm;
}
if (int.TryParse(tbxDutPulsesPerCm.Text, out pulses_per_cm) &&
FM2014.PULSES_PER_CM_REGULATION_SETUP_MIN <= pulses_per_cm &&
FM2014.PULSES_PER_CM_REGULATION_SETUP_MAX >= pulses_per_cm)
{
dutPulses_per_cm = (UInt16)pulses_per_cm;
}
if (FM2014.RegulationMeasurement(refPulses_per_cm, dutPulses_per_cm, doublePulseDeadtime_ms,
_toleranceDisplayAttenuation))
if (FM2014.RegulationMeasurement(Fm2014.RefPulses_per_cm, Fm2014.DutPulses_per_cm,
Fm2014.DoublePulseDeadtime_ms, Fm2014.CurrentOutputAttenuation))
{
_autoProgressBar = true;
ActionControl(true);
@@ -912,11 +913,10 @@ namespace Sensus.MiniPrf.Ui
}
else
{
_autoProgressBar = false;
// Deactivate the button temporary to avoid repeated execution as the reset takes a certain time
_autoProgressBar = false;
btnDutToRefRegulation.Enabled = false;
FM2014.ResetHardwareAllDevices();
ActionControl(false);
btnDutToRefRegulation.Text = Resources.StrBtnStartRegulation;
}
}));
@@ -933,7 +933,7 @@ namespace Sensus.MiniPrf.Ui
_startTime = DateTimeOffset.UtcNow;
Invoke(new Action(() =>
{
if (FM2014.SharedCyclicMeasSequ == CyclicMeasSequ.IDLE)
if (FM2014.SharedCyclicMeasSequ == CyclicMeasSequ.idle)
{
tbxRefPulsesMeasured.Text = "";
tbxDutPulsesMeasured.Text = "";
@@ -954,8 +954,8 @@ namespace Sensus.MiniPrf.Ui
else
{
// Deactivate the button temporary to avoid repeated execution as the reset takes a certain time
btnManualRefCalibration.Enabled = false;
_autoProgressBar = false;
btnManualRefCalibration.Enabled = false;
FM2014.ResetHardwareAllDevices();
}
}));
@@ -969,18 +969,19 @@ namespace Sensus.MiniPrf.Ui
/// <remarks date="2023-Jan-04" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void cbxFM2014BaseSettings_SelectedValueChanged(Object sender, EventArgs e)
private void cbxProgramSettings_Changed(Object sender, EventArgs e)
{
Invoke(new Action(() =>
{
if (_currentOutputDisplayRange_percent != cbxToleranceDisplayRange.SelectedIndex ||
if (_currentOutputDisplayRangeIdx != cbxToleranceDisplayRange.SelectedIndex ||
_addressIdx != cbxFM2014Address.SelectedIndex ||
_comPortIdx != cbxProgramComPort.SelectedIndex)
{
_currentOutputDisplayRange_percent = cbxToleranceDisplayRange.SelectedIndex;
_currentOutputDisplayRangeIdx = cbxToleranceDisplayRange.SelectedIndex;
_addressIdx = cbxFM2014Address.SelectedIndex;
_comPortIdx = cbxProgramComPort.SelectedIndex;
StoreProgramConfiguration();
Init();
}
}));
}
@@ -1079,7 +1080,7 @@ namespace Sensus.MiniPrf.Ui
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks date="2023-Jan-14..24" author="Thomas Wiedebusch">
/// <remarks date="2023-Jan-14..Feb-17" author="Thomas Wiedebusch">
/// - Initial.
/// </remarks>
private void tbxRefPulsesPerCm_Leave(Object sender, EventArgs e)
@@ -1114,15 +1115,24 @@ namespace Sensus.MiniPrf.Ui
return;
}
tbxRefPulsesPerCm.BackColor = ColorStandardInputField;
// Check if values have changed and need to be updated in the standalone setup
if (backupPulses_per_cm != pulses_per_cm || tbxRefPulsesPerCm.BackColor == ColorProcessFailed)
if (backupPulses_per_cm != pulses_per_cm && _initialRefPulsesPerCm != pulses_per_cm)
{
DutToRefRegulationSetupHasChanged();
}
else
{
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
}
}
else
{
tbxRefPulsesPerCm.BackColor = ColorProcessFailed;
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
}
}));
}
@@ -1203,15 +1213,24 @@ namespace Sensus.MiniPrf.Ui
return;
}
tbxDutPulsesPerCm.BackColor = ColorStandardInputField;
// Check if values have changed and need to be updated in the standalone setup
if (backupPulses_per_cm != Fm2014.DutPulses_per_cm)
if (backupPulses_per_cm != pulses_per_cm && _initialDutPulsesPerCm != pulses_per_cm)
{
DutToRefRegulationSetupHasChanged();
}
else
{
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
}
}
else
{
tbxDutPulsesPerCm.BackColor = ColorProcessFailed;
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
}
}));
}
@@ -1305,15 +1324,24 @@ namespace Sensus.MiniPrf.Ui
tbxRefCalibrationResultPulsePerCm.BackColor = ColorProcessFailed;
return;
}
tbxVolumeMeasuredLiters.BackColor = ColorStandardInputField;
tbxRefCalibrationResultPulsePerCm.BackColor = ColorStandardInputField;
// Check if values have changed and need to be updated in the standalone setup
if (backupPulses_per_cm != Fm2014.RefPulses_per_cm)
if (backupPulses_per_cm != pulses_per_cm && _initialRefPulsesPerCm != pulses_per_cm)
{
DutToRefRegulationSetupHasChanged();
}
else
{
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
}
}
else
{
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
tbxVolumeMeasuredLiters.BackColor = ColorProcessFailed;
tbxRefCalibrationResultPulsePerCm.BackColor = ColorProcessFailed;
tbxRefCalibrationResultPulsePerCm.Text = Resources.StrError;
@@ -1331,13 +1359,10 @@ namespace Sensus.MiniPrf.Ui
{
Invoke(new Action(() =>
{
grpBoxDebug.Visible = !grpBoxDebug.Visible;
gbxBoxDebug.Visible = !gbxBoxDebug.Visible;
gbxRegulationSetup.Visible = !gbxBoxDebug.Visible;
if (Fm2014 != null)
Fm2014.RequestDebugInformation = grpBoxDebug.Visible;
//gbxDutToRefRegulation.Visible = !grpBoxDebug.Visible;
gbxRegulationSetup.Visible = !grpBoxDebug.Visible;
Fm2014.RequestDebugInformation = gbxBoxDebug.Visible;
}));
}
@@ -1353,15 +1378,21 @@ namespace Sensus.MiniPrf.Ui
Invoke(new Action(() =>
{
//Backup the actual setting to detect changes
var backupAttenuation = Fm2014.CurrentOutputAttenuation;
if (byte.TryParse(cbxToleranceDisplayAttenuation.SelectedItem.ToString(), out var attenuation) &&
attenuation >= FM2014.CURRENT_OUTPUT_ATTENUATION_MIN &&
attenuation <= FM2014.CURRENT_OUTPUT_ATTENUATION_MAX &&
_toleranceDisplayAttenuation != attenuation)
backupAttenuation != attenuation && _initialCurrentOutputAttenuation != attenuation)
{
_fm2014RegulationSetupHasChanged = true;
_toleranceDisplayAttenuation = attenuation;
Fm2014.CurrentOutputAttenuation = attenuation;
btnSaveSetupToFm2014.Enabled = true;
DutToRefRegulationSetupHasChanged();
}
else
{
_fm2014RegulationSetupHasChanged = false;
btnSaveSetupToFm2014.Enabled = false;
}
}));
}
+1 -1
View File
@@ -90,7 +90,7 @@ namespace Sensus.MiniPrf.Ui.Properties {
}
/// <summary>
/// Looks up a localized string similar to Save.
/// Looks up a localized string similar to Store in FM2014.
/// </summary>
internal static string StrBtnSaveRegulationSetup {
get {
+1 -1
View File
@@ -184,7 +184,7 @@
<value>Dämpfung []:</value>
</data>
<data name="StrBtnSaveRegulationSetup" xml:space="preserve">
<value>Speichern</value>
<value>In FM2014 Speichern</value>
</data>
<data name="StrGbxManualRefCalibration" xml:space="preserve">
<value>Handkalibrierung REF zu Waage</value>
+1 -1
View File
@@ -184,7 +184,7 @@
<value>Attenuation []:</value>
</data>
<data name="StrBtnSaveRegulationSetup" xml:space="preserve">
<value>Save</value>
<value>Store in FM2014</value>
</data>
<data name="StrGbxManualRefCalibration" xml:space="preserve">
<value>Manual Calibration REF to Weight-Scale</value>