diff --git a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.cs b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.cs index d5567b789..fac00e745 100644 --- a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.cs @@ -88,10 +88,10 @@ namespace TBF.BenchControl.DataEntry.WMStates if (WaterMetersCount >= 6) SNText[5] = snTextBox6.Text; if (WaterMetersCount >= 1) WMState[0] = Utils.ParseUFloat(wmStateTextBox1.Text); - if (WaterMetersCount >= 2) WMState[1] = Utils.ParseUFloat(wmStateTextBox3.Text); - if (WaterMetersCount >= 3) WMState[2] = Utils.ParseUFloat(wmStateTextBox4.Text); - if (WaterMetersCount >= 4) WMState[3] = Utils.ParseUFloat(wmStateTextBox5.Text); - if (WaterMetersCount >= 5) WMState[4] = Utils.ParseUFloat(wmStateTextBox6.Text); + if (WaterMetersCount >= 2) WMState[1] = Utils.ParseUFloat(wmStateTextBox2.Text); + if (WaterMetersCount >= 3) WMState[2] = Utils.ParseUFloat(wmStateTextBox3.Text); + if (WaterMetersCount >= 4) WMState[3] = Utils.ParseUFloat(wmStateTextBox4.Text); + if (WaterMetersCount >= 5) WMState[4] = Utils.ParseUFloat(wmStateTextBox5.Text); if (WaterMetersCount >= 6) WMState[5] = Utils.ParseUFloat(wmStateTextBox6.Text); } catch diff --git a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.designer.cs b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.designer.cs index 48ad87626..6b51a7383 100644 --- a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.designer.cs +++ b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.designer.cs @@ -28,270 +28,270 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WMSNsAndStatesForm)); - this.okButton = new System.Windows.Forms.Button(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.wmStateTextBox1 = new System.Windows.Forms.TextBox(); - this.wmStateLabel1 = new System.Windows.Forms.Label(); - this.snTextBox1 = new System.Windows.Forms.TextBox(); - this.snLabel1 = new System.Windows.Forms.Label(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.wmStateTextBox2 = new System.Windows.Forms.TextBox(); - this.wmStateLabel2 = new System.Windows.Forms.Label(); - this.snTextBox2 = new System.Windows.Forms.TextBox(); - this.snLabel2 = new System.Windows.Forms.Label(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.wmStateTextBox3 = new System.Windows.Forms.TextBox(); - this.wmStateLabel3 = new System.Windows.Forms.Label(); - this.snTextBox3 = new System.Windows.Forms.TextBox(); - this.snLabel3 = new System.Windows.Forms.Label(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.wmStateTextBox4 = new System.Windows.Forms.TextBox(); - this.wmStateLabel4 = new System.Windows.Forms.Label(); - this.snTextBox4 = new System.Windows.Forms.TextBox(); - this.snLabel4 = new System.Windows.Forms.Label(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.wmStateTextBox5 = new System.Windows.Forms.TextBox(); - this.wmStateLabel5 = new System.Windows.Forms.Label(); - this.snTextBox5 = new System.Windows.Forms.TextBox(); - this.snLabel5 = new System.Windows.Forms.Label(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.wmStateTextBox6 = new System.Windows.Forms.TextBox(); - this.wmStateLabel6 = new System.Windows.Forms.Label(); - this.snTextBox6 = new System.Windows.Forms.TextBox(); - this.snLabel6 = new System.Windows.Forms.Label(); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.SuspendLayout(); - // - // okButton - // - resources.ApplyResources(this.okButton, "okButton"); - this.okButton.ForeColor = System.Drawing.Color.Black; - this.okButton.Name = "okButton"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.wmStateTextBox1); - this.groupBox1.Controls.Add(this.wmStateLabel1); - this.groupBox1.Controls.Add(this.snTextBox1); - this.groupBox1.Controls.Add(this.snLabel1); - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.ForeColor = System.Drawing.Color.Black; - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; - // - // wmStateTextBox1 - // - resources.ApplyResources(this.wmStateTextBox1, "wmStateTextBox1"); - this.wmStateTextBox1.Name = "wmStateTextBox1"; - // - // wmStateLabel1 - // - resources.ApplyResources(this.wmStateLabel1, "wmStateLabel1"); - this.wmStateLabel1.Name = "wmStateLabel1"; - // - // snTextBox1 - // - resources.ApplyResources(this.snTextBox1, "snTextBox1"); - this.snTextBox1.Name = "snTextBox1"; - // - // snLabel1 - // - resources.ApplyResources(this.snLabel1, "snLabel1"); - this.snLabel1.Name = "snLabel1"; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.wmStateTextBox2); - this.groupBox2.Controls.Add(this.wmStateLabel2); - this.groupBox2.Controls.Add(this.snTextBox2); - this.groupBox2.Controls.Add(this.snLabel2); - resources.ApplyResources(this.groupBox2, "groupBox2"); - this.groupBox2.ForeColor = System.Drawing.Color.Black; - this.groupBox2.Name = "groupBox2"; - this.groupBox2.TabStop = false; - // - // wmStateTextBox2 - // - resources.ApplyResources(this.wmStateTextBox2, "wmStateTextBox2"); - this.wmStateTextBox2.Name = "wmStateTextBox2"; - // - // wmStateLabel2 - // - resources.ApplyResources(this.wmStateLabel2, "wmStateLabel2"); - this.wmStateLabel2.Name = "wmStateLabel2"; - // - // snTextBox2 - // - resources.ApplyResources(this.snTextBox2, "snTextBox2"); - this.snTextBox2.Name = "snTextBox2"; - // - // snLabel2 - // - resources.ApplyResources(this.snLabel2, "snLabel2"); - this.snLabel2.Name = "snLabel2"; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.wmStateTextBox3); - this.groupBox3.Controls.Add(this.wmStateLabel3); - this.groupBox3.Controls.Add(this.snTextBox3); - this.groupBox3.Controls.Add(this.snLabel3); - resources.ApplyResources(this.groupBox3, "groupBox3"); - this.groupBox3.ForeColor = System.Drawing.Color.Black; - this.groupBox3.Name = "groupBox3"; - this.groupBox3.TabStop = false; - // - // wmStateTextBox3 - // - resources.ApplyResources(this.wmStateTextBox3, "wmStateTextBox3"); - this.wmStateTextBox3.Name = "wmStateTextBox3"; - // - // wmStateLabel3 - // - resources.ApplyResources(this.wmStateLabel3, "wmStateLabel3"); - this.wmStateLabel3.Name = "wmStateLabel3"; - // - // snTextBox3 - // - resources.ApplyResources(this.snTextBox3, "snTextBox3"); - this.snTextBox3.Name = "snTextBox3"; - // - // snLabel3 - // - resources.ApplyResources(this.snLabel3, "snLabel3"); - this.snLabel3.Name = "snLabel3"; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.wmStateTextBox4); - this.groupBox4.Controls.Add(this.wmStateLabel4); - this.groupBox4.Controls.Add(this.snTextBox4); - this.groupBox4.Controls.Add(this.snLabel4); - resources.ApplyResources(this.groupBox4, "groupBox4"); - this.groupBox4.ForeColor = System.Drawing.Color.Black; - this.groupBox4.Name = "groupBox4"; - this.groupBox4.TabStop = false; - // - // wmStateTextBox4 - // - resources.ApplyResources(this.wmStateTextBox4, "wmStateTextBox4"); - this.wmStateTextBox4.Name = "wmStateTextBox4"; - // - // wmStateLabel4 - // - resources.ApplyResources(this.wmStateLabel4, "wmStateLabel4"); - this.wmStateLabel4.Name = "wmStateLabel4"; - // - // snTextBox4 - // - resources.ApplyResources(this.snTextBox4, "snTextBox4"); - this.snTextBox4.Name = "snTextBox4"; - // - // snLabel4 - // - resources.ApplyResources(this.snLabel4, "snLabel4"); - this.snLabel4.Name = "snLabel4"; - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.wmStateTextBox5); - this.groupBox5.Controls.Add(this.wmStateLabel5); - this.groupBox5.Controls.Add(this.snTextBox5); - this.groupBox5.Controls.Add(this.snLabel5); - resources.ApplyResources(this.groupBox5, "groupBox5"); - this.groupBox5.ForeColor = System.Drawing.Color.Black; - this.groupBox5.Name = "groupBox5"; - this.groupBox5.TabStop = false; - // - // wmStateTextBox5 - // - resources.ApplyResources(this.wmStateTextBox5, "wmStateTextBox5"); - this.wmStateTextBox5.Name = "wmStateTextBox5"; - // - // wmStateLabel5 - // - resources.ApplyResources(this.wmStateLabel5, "wmStateLabel5"); - this.wmStateLabel5.Name = "wmStateLabel5"; - // - // snTextBox5 - // - resources.ApplyResources(this.snTextBox5, "snTextBox5"); - this.snTextBox5.Name = "snTextBox5"; - // - // snLabel5 - // - resources.ApplyResources(this.snLabel5, "snLabel5"); - this.snLabel5.Name = "snLabel5"; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.wmStateTextBox6); - this.groupBox6.Controls.Add(this.wmStateLabel6); - this.groupBox6.Controls.Add(this.snTextBox6); - this.groupBox6.Controls.Add(this.snLabel6); - resources.ApplyResources(this.groupBox6, "groupBox6"); - this.groupBox6.ForeColor = System.Drawing.Color.Black; - this.groupBox6.Name = "groupBox6"; - this.groupBox6.TabStop = false; - // - // wmStateTextBox6 - // - resources.ApplyResources(this.wmStateTextBox6, "wmStateTextBox6"); - this.wmStateTextBox6.Name = "wmStateTextBox6"; - // - // wmStateLabel6 - // - resources.ApplyResources(this.wmStateLabel6, "wmStateLabel6"); - this.wmStateLabel6.Name = "wmStateLabel6"; - // - // snTextBox6 - // - resources.ApplyResources(this.snTextBox6, "snTextBox6"); - this.snTextBox6.Name = "snTextBox6"; - // - // snLabel6 - // - resources.ApplyResources(this.snLabel6, "snLabel6"); - this.snLabel6.Name = "snLabel6"; - // - // CycleBeginningForm - // - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.DarkGoldenrod; - this.Controls.Add(this.groupBox6); - this.Controls.Add(this.groupBox5); - this.Controls.Add(this.groupBox4); - this.Controls.Add(this.groupBox3); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.okButton); - this.ForeColor = System.Drawing.Color.Black; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Name = "CycleBeginningForm"; - this.TopMost = true; - this.Load += new System.EventHandler(this.CycleBeginningForm_Load); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - this.groupBox6.ResumeLayout(false); - this.groupBox6.PerformLayout(); - this.ResumeLayout(false); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WMSNsAndStatesForm)); + this.okButton = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.wmStateTextBox1 = new System.Windows.Forms.TextBox(); + this.wmStateLabel1 = new System.Windows.Forms.Label(); + this.snTextBox1 = new System.Windows.Forms.TextBox(); + this.snLabel1 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.wmStateTextBox2 = new System.Windows.Forms.TextBox(); + this.wmStateLabel2 = new System.Windows.Forms.Label(); + this.snTextBox2 = new System.Windows.Forms.TextBox(); + this.snLabel2 = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.wmStateTextBox3 = new System.Windows.Forms.TextBox(); + this.wmStateLabel3 = new System.Windows.Forms.Label(); + this.snTextBox3 = new System.Windows.Forms.TextBox(); + this.snLabel3 = new System.Windows.Forms.Label(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.wmStateTextBox4 = new System.Windows.Forms.TextBox(); + this.wmStateLabel4 = new System.Windows.Forms.Label(); + this.snTextBox4 = new System.Windows.Forms.TextBox(); + this.snLabel4 = new System.Windows.Forms.Label(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.wmStateTextBox5 = new System.Windows.Forms.TextBox(); + this.wmStateLabel5 = new System.Windows.Forms.Label(); + this.snTextBox5 = new System.Windows.Forms.TextBox(); + this.snLabel5 = new System.Windows.Forms.Label(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.wmStateTextBox6 = new System.Windows.Forms.TextBox(); + this.wmStateLabel6 = new System.Windows.Forms.Label(); + this.snTextBox6 = new System.Windows.Forms.TextBox(); + this.snLabel6 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.SuspendLayout(); + // + // okButton + // + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.ForeColor = System.Drawing.Color.Black; + this.okButton.Name = "okButton"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.wmStateTextBox1); + this.groupBox1.Controls.Add(this.wmStateLabel1); + this.groupBox1.Controls.Add(this.snTextBox1); + this.groupBox1.Controls.Add(this.snLabel1); + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.ForeColor = System.Drawing.Color.Black; + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // wmStateTextBox1 + // + resources.ApplyResources(this.wmStateTextBox1, "wmStateTextBox1"); + this.wmStateTextBox1.Name = "wmStateTextBox1"; + // + // wmStateLabel1 + // + resources.ApplyResources(this.wmStateLabel1, "wmStateLabel1"); + this.wmStateLabel1.Name = "wmStateLabel1"; + // + // snTextBox1 + // + resources.ApplyResources(this.snTextBox1, "snTextBox1"); + this.snTextBox1.Name = "snTextBox1"; + // + // snLabel1 + // + resources.ApplyResources(this.snLabel1, "snLabel1"); + this.snLabel1.Name = "snLabel1"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.wmStateTextBox2); + this.groupBox2.Controls.Add(this.wmStateLabel2); + this.groupBox2.Controls.Add(this.snTextBox2); + this.groupBox2.Controls.Add(this.snLabel2); + resources.ApplyResources(this.groupBox2, "groupBox2"); + this.groupBox2.ForeColor = System.Drawing.Color.Black; + this.groupBox2.Name = "groupBox2"; + this.groupBox2.TabStop = false; + // + // wmStateTextBox2 + // + resources.ApplyResources(this.wmStateTextBox2, "wmStateTextBox2"); + this.wmStateTextBox2.Name = "wmStateTextBox2"; + // + // wmStateLabel2 + // + resources.ApplyResources(this.wmStateLabel2, "wmStateLabel2"); + this.wmStateLabel2.Name = "wmStateLabel2"; + // + // snTextBox2 + // + resources.ApplyResources(this.snTextBox2, "snTextBox2"); + this.snTextBox2.Name = "snTextBox2"; + // + // snLabel2 + // + resources.ApplyResources(this.snLabel2, "snLabel2"); + this.snLabel2.Name = "snLabel2"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.wmStateTextBox3); + this.groupBox3.Controls.Add(this.wmStateLabel3); + this.groupBox3.Controls.Add(this.snTextBox3); + this.groupBox3.Controls.Add(this.snLabel3); + resources.ApplyResources(this.groupBox3, "groupBox3"); + this.groupBox3.ForeColor = System.Drawing.Color.Black; + this.groupBox3.Name = "groupBox3"; + this.groupBox3.TabStop = false; + // + // wmStateTextBox3 + // + resources.ApplyResources(this.wmStateTextBox3, "wmStateTextBox3"); + this.wmStateTextBox3.Name = "wmStateTextBox3"; + // + // wmStateLabel3 + // + resources.ApplyResources(this.wmStateLabel3, "wmStateLabel3"); + this.wmStateLabel3.Name = "wmStateLabel3"; + // + // snTextBox3 + // + resources.ApplyResources(this.snTextBox3, "snTextBox3"); + this.snTextBox3.Name = "snTextBox3"; + // + // snLabel3 + // + resources.ApplyResources(this.snLabel3, "snLabel3"); + this.snLabel3.Name = "snLabel3"; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.wmStateTextBox4); + this.groupBox4.Controls.Add(this.wmStateLabel4); + this.groupBox4.Controls.Add(this.snTextBox4); + this.groupBox4.Controls.Add(this.snLabel4); + resources.ApplyResources(this.groupBox4, "groupBox4"); + this.groupBox4.ForeColor = System.Drawing.Color.Black; + this.groupBox4.Name = "groupBox4"; + this.groupBox4.TabStop = false; + // + // wmStateTextBox4 + // + resources.ApplyResources(this.wmStateTextBox4, "wmStateTextBox4"); + this.wmStateTextBox4.Name = "wmStateTextBox4"; + // + // wmStateLabel4 + // + resources.ApplyResources(this.wmStateLabel4, "wmStateLabel4"); + this.wmStateLabel4.Name = "wmStateLabel4"; + // + // snTextBox4 + // + resources.ApplyResources(this.snTextBox4, "snTextBox4"); + this.snTextBox4.Name = "snTextBox4"; + // + // snLabel4 + // + resources.ApplyResources(this.snLabel4, "snLabel4"); + this.snLabel4.Name = "snLabel4"; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.wmStateTextBox5); + this.groupBox5.Controls.Add(this.wmStateLabel5); + this.groupBox5.Controls.Add(this.snTextBox5); + this.groupBox5.Controls.Add(this.snLabel5); + resources.ApplyResources(this.groupBox5, "groupBox5"); + this.groupBox5.ForeColor = System.Drawing.Color.Black; + this.groupBox5.Name = "groupBox5"; + this.groupBox5.TabStop = false; + // + // wmStateTextBox5 + // + resources.ApplyResources(this.wmStateTextBox5, "wmStateTextBox5"); + this.wmStateTextBox5.Name = "wmStateTextBox5"; + // + // wmStateLabel5 + // + resources.ApplyResources(this.wmStateLabel5, "wmStateLabel5"); + this.wmStateLabel5.Name = "wmStateLabel5"; + // + // snTextBox5 + // + resources.ApplyResources(this.snTextBox5, "snTextBox5"); + this.snTextBox5.Name = "snTextBox5"; + // + // snLabel5 + // + resources.ApplyResources(this.snLabel5, "snLabel5"); + this.snLabel5.Name = "snLabel5"; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.wmStateTextBox6); + this.groupBox6.Controls.Add(this.wmStateLabel6); + this.groupBox6.Controls.Add(this.snTextBox6); + this.groupBox6.Controls.Add(this.snLabel6); + resources.ApplyResources(this.groupBox6, "groupBox6"); + this.groupBox6.ForeColor = System.Drawing.Color.Black; + this.groupBox6.Name = "groupBox6"; + this.groupBox6.TabStop = false; + // + // wmStateTextBox6 + // + resources.ApplyResources(this.wmStateTextBox6, "wmStateTextBox6"); + this.wmStateTextBox6.Name = "wmStateTextBox6"; + // + // wmStateLabel6 + // + resources.ApplyResources(this.wmStateLabel6, "wmStateLabel6"); + this.wmStateLabel6.Name = "wmStateLabel6"; + // + // snTextBox6 + // + resources.ApplyResources(this.snTextBox6, "snTextBox6"); + this.snTextBox6.Name = "snTextBox6"; + // + // snLabel6 + // + resources.ApplyResources(this.snLabel6, "snLabel6"); + this.snLabel6.Name = "snLabel6"; + // + // WMSNsAndStatesForm + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.DarkGoldenrod; + this.Controls.Add(this.groupBox6); + this.Controls.Add(this.groupBox5); + this.Controls.Add(this.groupBox4); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.okButton); + this.ForeColor = System.Drawing.Color.Black; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "WMSNsAndStatesForm"; + this.TopMost = true; + this.Load += new System.EventHandler(this.CycleBeginningForm_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.ResumeLayout(false); } diff --git a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.resx b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.resx index cb8fe7854..21ef852d3 100644 --- a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.resx +++ b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMSNsAndStatesForm.resx @@ -146,81 +146,6 @@ 6 - - wmStateTextBox1 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - wmStateLabel1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 1 - - - snTextBox1 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - snLabel1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - - Verdana, 14.25pt - - - 28, 18 - - - 575, 92 - - - 1 - - - Water Meter 1 - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - 386, 37 @@ -317,80 +242,32 @@ 3 - - wmStateTextBox2 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 0 - - - wmStateLabel2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - snTextBox2 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 2 - - - snLabel2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 3 - - + Verdana, 14.25pt - - 28, 123 + + 28, 18 - + 575, 92 - - 2 + + 1 - - Water Meter 2 + + Water Meter 1 - - groupBox2 + + groupBox1 - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 4 + + 5 386, 37 @@ -492,80 +369,32 @@ 3 - - wmStateTextBox3 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox3 - - - 0 - - - wmStateLabel3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox3 - - - 1 - - - snTextBox3 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox3 - - - 2 - - - snLabel3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox3 - - - 3 - - + Verdana, 14.25pt - - 28, 228 + + 28, 123 - + 575, 92 - - 3 + + 2 - - Water Meter 3 + + Water Meter 2 - - groupBox3 + + groupBox2 - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 3 + + 4 386, 37 @@ -666,80 +495,32 @@ 3 - - wmStateTextBox4 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 0 - - - wmStateLabel4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 1 - - - snTextBox4 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 2 - - - snLabel4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 3 - - + Verdana, 14.25pt - - 28, 333 + + 28, 228 - + 575, 92 - - 4 + + 3 - - Water Meter 4 + + Water Meter 3 - - groupBox4 + + groupBox3 - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 2 + + 3 386, 37 @@ -840,80 +621,32 @@ 3 - - wmStateTextBox5 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox5 - - - 0 - - - wmStateLabel5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox5 - - - 1 - - - snTextBox5 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox5 - - - 2 - - - snLabel5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox5 - - - 3 - - + Verdana, 14.25pt - - 28, 438 + + 28, 333 - + 575, 92 - - 5 + + 4 - - Water Meter 5 + + Water Meter 4 - - groupBox5 + + groupBox4 - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 1 + + 2 386, 32 @@ -1014,80 +747,32 @@ 3 - - wmStateTextBox6 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox6 - - - 0 - - - wmStateLabel6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox6 - - - 1 - - - snTextBox6 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox6 - - - 2 - - - snLabel6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox6 - - - 3 - - + Verdana, 14.25pt - - 28, 543 + + 28, 438 - + 575, 92 - - 4 + + 5 - - Water Meter 6 + + Water Meter 5 - - groupBox6 + + groupBox5 - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 0 + + 1 386, 37 @@ -1188,6 +873,33 @@ 3 + + Verdana, 14.25pt + + + 28, 543 + + + 575, 92 + + + 4 + + + Water Meter 6 + + + groupBox6 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + True @@ -1204,7 +916,7 @@ Water Meter Serial Numbers and States - CycleBeginningForm + WMSNsAndStatesForm System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMStatesForm.cs b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMStatesForm.cs index 4a18f8417..98fa038b9 100644 --- a/TestBenchFramework/BenchControl/DataEntry/WMStates/WMStatesForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/WMStates/WMStatesForm.cs @@ -71,10 +71,10 @@ namespace TBF.BenchControl.DataEntry.WMStates try { if (WaterMetersCount >= 1) WMState[0] = Utils.ParseUFloat(wmStateTextBox1.Text); - if (WaterMetersCount >= 2) WMState[1] = Utils.ParseUFloat(wmStateTextBox3.Text); - if (WaterMetersCount >= 3) WMState[2] = Utils.ParseUFloat(wmStateTextBox4.Text); - if (WaterMetersCount >= 4) WMState[3] = Utils.ParseUFloat(wmStateTextBox5.Text); - if (WaterMetersCount >= 5) WMState[4] = Utils.ParseUFloat(wmStateTextBox6.Text); + if (WaterMetersCount >= 2) WMState[1] = Utils.ParseUFloat(wmStateTextBox2.Text); + if (WaterMetersCount >= 3) WMState[2] = Utils.ParseUFloat(wmStateTextBox3.Text); + if (WaterMetersCount >= 4) WMState[3] = Utils.ParseUFloat(wmStateTextBox4.Text); + if (WaterMetersCount >= 5) WMState[4] = Utils.ParseUFloat(wmStateTextBox5.Text); if (WaterMetersCount >= 6) WMState[5] = Utils.ParseUFloat(wmStateTextBox6.Text); } catch diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs new file mode 100644 index 000000000..58b518ac2 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -0,0 +1,332 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; +using TBF.BenchControl; +using TBF.Boxes; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.BenchControl.TestMethods.Adjustment +{ + public class FlyingStartSeq : Sequences.SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(FlyingStartSeq)); + + /// + /// Flying start mass collection method sequence + /// + /// Test entity + /// + /// Event.Done . . . . . . . OK + /// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP + /// Event.OpArgumentError . Target flow is out of range + /// Event.Error . . . . . . Unspecified error + /// + public IList Execute(Entities.Test test) + { + System.Windows.Forms.Form modelessDlg = null; + + Elde.ControlBoardDev cBrd = StateMachine.ControlBoard; + + IList e = new List(); /// Events from currently running operations + Event retVal = Event.Done; + checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state + + ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h] + + /// Notes: + /// float timeHr = volumeLtr / (1000.0f * targetFlow); + /// float timeSec = 3600.0f * timeHr; + /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); + int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f); + + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this); + + int repetitionNr = 1; /// First test: repetitionNr=1 + + //==================================== + // Transition or SetRoute - Start + //==================================== + switch (Transition(transitionStart, TransitionContext.TestStart)) + { + case Event.Error: { retVal = Event.Error; goto stopTest; } + case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; } + } + + /// Start the test, initialize test results + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); + Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + int flowSetTime0 = StateMachine.Time; + float estFlowSetTime = 10.0f; + + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); + State.Create("Adjustment : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(cBrd.SetValvesOp(inPath.Pump, null)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.ValvesSet)); + + //-------------------------------- + State.Create("Adjustment : Setting the flow") + .AddOperation(checkUiOp) + .AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min. + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + + int flowSetTime = StateMachine.Time - flowSetTime0; + float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress)); + + if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; } + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + if (e.Contains(Event.RegulValveTimeOut)) + { + Bridge.OnError(this, Strings.Timeout); + retVal = Event.Done; + goto stopTest; + } + if (e.Contains(Event.Next)) goto flow_set; + } + while (!e.Contains(Event.FlowReached)); + + /// + /// Show the modeless dialog with error indication + /// + modelessDlg = new WMErrorsForm(Program.WMsCount); + modelessDlg.Show(); + + flow_set: + loop: + int time = StateMachine.Time; + float currentFlow = refFlow.Val; + + /// Extract cameras from the current sensors path, add operations to the detection state + IList measureOperations = new List(); + for (int i = 0; i < sensPath.RegisterReaders.Length; i++) + { + GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi; + if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp()); + } + + tstRslt.TimeStart = DateTime.Now; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + State.Create("Adjustment : Starting the test") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Synchro, (float)test.TolerRed)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.MeasurementStarted)); + + /// Measurement loop - preparation + readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses); + queryEnd1 = cBrd.QueryMeasurementEndOp(); + queryEnd2 = cBrd.QueryMeasurementEndOp(); + + bool firstTime = true; /// To reset sums for averaging + ResetAveragedData(); + + /// Measurement loop - begin + while (true) + { + //-------------------------------- + switch (ReadRegistersTempPressAmbient(measureOperations, true)) + { + case Event.Error: { retVal = Event.Error; goto stopTest; } + case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; } + case Event.MeasurementCompleted: goto one_test_completed; + } + + if (firstTime) + { + firstTime = false; /// Do the following only once + tstRslt.TempInStart = tempIn.Val; + tstRslt.TempOutStart = tempOut.Val; + tstRslt.TempDivStart = tempDiv.Val; + tstRslt.PressInStart = pressIn.Val; + tstRslt.PressOutStart = pressOut.Val; + } + + tstRslt.TempInEnd = tempIn.Val; + tstRslt.TempOutEnd = tempOut.Val; + tstRslt.TempDivEnd = tempDiv.Val; + tstRslt.PressInEnd = pressIn.Val; + tstRslt.PressOutEnd = pressOut.Val; + tstRslt.MassEndRaw = mass.Val; + + AccumulateAveragedData(); + + refFreq.Val = cBrd.ReferenceFreq; + refFlow.Val = cBrd.ReferenceFlow; + tstRslt.AmbientTempAve = airTemperature.Val; + tstRslt.AmbientPressAve = airPressure.Val; + tstRslt.AmbientHumiAve = airHumidity.Val; + + string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq, + cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow); + for (int i = 0; i < Program.WMsCount; i++) + { + logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]); + } + log.Debug(logstr); + + + float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime); + Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress)); + } + /// Measurement loop - end + + one_test_completed: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Adjustment_in_progress); + //------------------------------------------------ + + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (cycleBeginFormOpened) + { + cycleBeginFormOpened = false; + if (CloseCycleBeginForm()) goto stopTest; + } + + /// + /// Populate TestResult data entity with data + /// + tstRslt.TimeEnd = DateTime.Now; + tstRslt.CycleNr = Program.LocalSettings.CycleNr; + UpdateTestRsltWithAveragedData(tstRslt); + tstRslt.MassStart = 0; + tstRslt.MassEnd = 0; + tstRslt.MassDiff = 0; + tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3] + tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3] + tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3] + tstRslt.Time = cBrd.TTime; /// [s] measurement time + tstRslt.FlowMass = 0; /// [kg/h] + tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h] + tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total) + tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter + tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume / 1000.0f); /// Convert the flow to [m3/h] + tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] + /// Corrected master pulses per liter + tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement + tstRslt.TimeDivStart0 = 0; + tstRslt.TimeDivStart1 = 0; + tstRslt.TimeDivStart2 = 0; + tstRslt.TimeDivStart3 = 0; + tstRslt.TimeDivStart4 = 0; + tstRslt.TimeDivStart5 = 0; + tstRslt.TimeDivEnd0 = 0; + tstRslt.TimeDivEnd1 = 0; + tstRslt.TimeDivEnd2 = 0; + tstRslt.TimeDivEnd3 = 0; + tstRslt.TimeDivEnd4 = 0; + tstRslt.TimeDivEnd5 = 0; + for (int i = 0; i < Program.WMsCount; i++) + { + if (sensPath.RegisterReaders[i] != null) + { + tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty; + tstRslt.Meters[i].VolumeStart = 0; /// liter + tstRslt.Meters[i].VolumeEnd = 0; /// liter + if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0; + else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr; + tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter + tstRslt.Meters[i].PulsesMeter = WMPulses[i]; + tstRslt.Meters[i].PulsesMaster = WMRefPulses[i]; + tstRslt.Meters[i].Time = cBrd.TTime; + if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0) + { + tstRslt.Meters[i].VolumeErrorPct = + 100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef; + /// % + } + else + { + tstRslt.Meters[i].VolumeErrorPct = -100; + } + tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi); + } + } + /// Add data - end + + + /// Update modeless dialog error information + Bridge.OnAdjustmentInProgress(this, new AdjustmentInProgressEventArgs(tstRslt)); + + /// Test 'Quit' + if ((modelessDlg is GenericDevices.IHasCompleted) && !(modelessDlg as GenericDevices.IHasCompleted).Completed) + { + goto loop; /// Modeless dilaog not closed, keep looping + } + modelessDlg = null; /// Modeless dialog is closed now + + + /// + /// Add to results (after user quits the adjustment loop) + /// + AddOrOverwriteResult(tstRslt); + Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt)); + FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt); + + /// Append the results to the CSV-file + allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0))); + + stopTest: + + ///----------------------/// + /// Quit this sequence /// + ///----------------------/// + + State.Create("Adjustment : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.PreviousStopped)); + + /// Transition sequence at the end of test + /// Prevent overwriting 'retVal' in case it was set to non-default value earlier + switch (Transition(transitionStop, TransitionContext.TestEnd)) + { + case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; } + case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; } + } + + /// Create a list with one item 'retVal' (default is Event.Done) and return it + IList retList = new List(); + retList.Add(retVal); + return retList; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs new file mode 100644 index 000000000..99940ce63 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethod.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using log4net; +using TBF.BenchControl; + +namespace TBF.BenchControl.TestMethods.Adjustment +{ + public class TestMethod : ComponentBase, GenericDevices.ITestMethod, ISequence + { + private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); + public override string ToString() { return string.Format("TestMethods.Adjustment({0})", Cfg.ToString(1)); } + + public TestMethod(TestMethodCfg cfg) + : base(cfg) + { + log.Debug(this.ToString()); + } + + public IList Execute(Entities.Test test) + { + return (new FlyingStartSeq()).Execute(test); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfg.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfg.cs new file mode 100644 index 000000000..228b2551a --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfg.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml.Serialization; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.Adjustment +{ + public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg + { + public IComponent GetComponent(IList components) { return new TestMethod(this); } + public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } + + /// Private parameterless constructor invoked by all other (public) constructors + TestMethodCfg() + { + Name = "Adjustment"; + ParentName = string.Empty; + } + + public TestMethodCfg(IComponentFactory factory) + : this() + { + this.Factory = factory; + } + + public string ToString(int i) + { + return string.Format("Name={0}", Name); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..4bf1c3378 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.cs @@ -0,0 +1,68 @@ +using System; +using System.Windows.Forms; +using log4net; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.Adjustment +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl)); + + public bool ShowMore { get { return false; } } + + TestMethodCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + public void Closing() + { + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgUpdateFlags VerifyCfg(ref string message) + { + CfgUpdateFlags flags = CfgUpdateFlags.None; + return flags; + } + + public CfgUpdateFlags UpdateCfg() + { + CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + + if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + + return flags; + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..59dc41643 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,83 @@ +namespace TBF.BenchControl.TestMethods.Adjustment +{ + partial class TestMethodCfgCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.resx b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodCfgCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodFactory.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodFactory.cs new file mode 100644 index 000000000..30523d418 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/TestMethodFactory.cs @@ -0,0 +1,18 @@ +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.Adjustment +{ + public class TestMethodFactory : IComponentFactory + { + public string ClassName { get { return "Adjustment"; } } + + public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); } + + public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); } + + public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component) + { + return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.cs new file mode 100644 index 000000000..02a36eda7 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.cs @@ -0,0 +1,101 @@ +using System; +using System.Windows.Forms; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.Adjustment +{ + public partial class WMErrorsForm : Form, GenericDevices.IHasCompleted + { + /// Number of text boxes for serial numbers + public readonly int WaterMetersCount; + + // To be retrieved after the form closes + public float[] WMState; + + // Set to 'true' when the form closes + public bool Completed { get { return completed; } } + bool completed; + + /// + /// Constructor + /// + /// Number of text boxes for serial numbers + public WMErrorsForm(int waterMetersCount) + { + this.WaterMetersCount = waterMetersCount; + InitializeComponent(); + WMState = new float[WaterMetersCount]; + completed = false; + } + + /// Parameterless constructor for 3 watermeters + public WMErrorsForm() + : this(Program.WMsCount) + { + UiBridge.Bridge.AdjustmentInProgressHandler += delegate(object sender, UiBridge.AdjustmentInProgressEventArgs args) + { + if (InvokeRequired) + { + Invoke(new EventHandler(OnAdjustmentInProgress), sender, args); + } + else OnAdjustmentInProgress(sender, args); + }; + } + + void Localize() + { + Text = Strings.Water_Meter_States; + groupBox1.Text = Strings.Water_Meter + " 1"; + groupBox2.Text = Strings.Water_Meter + " 2"; + groupBox3.Text = Strings.Water_Meter + " 3"; + groupBox4.Text = Strings.Water_Meter + " 4"; + groupBox5.Text = Strings.Water_Meter + " 5"; + groupBox6.Text = Strings.Water_Meter + " 6"; + wmErrorLabel1.Text = Strings.Error_pct; + wmErrorLabel2.Text = Strings.Error_pct; + wmErrorLabel3.Text = Strings.Error_pct; + wmErrorLabel4.Text = Strings.Error_pct; + wmErrorLabel5.Text = Strings.Error_pct; + wmErrorLabel6.Text = Strings.Error_pct; + okButton.Text = Strings.OkBtnText; + } + + private void CycleEndForm_Load(object sender, EventArgs e) + { + Localize(); + + Height = 195 + 90 * WaterMetersCount; + + if (WaterMetersCount < 1) groupBox1.Visible = false; + if (WaterMetersCount < 2) groupBox2.Visible = false; + if (WaterMetersCount < 3) groupBox3.Visible = false; + if (WaterMetersCount < 4) groupBox4.Visible = false; + if (WaterMetersCount < 5) groupBox5.Visible = false; + if (WaterMetersCount < 6) groupBox6.Visible = false; + + wmErrorTextBox1.Text = "---"; + wmErrorTextBox2.Text = "---"; + wmErrorTextBox3.Text = "---"; + wmErrorTextBox4.Text = "---"; + wmErrorTextBox5.Text = "---"; + wmErrorTextBox6.Text = "---"; + } + + void OnAdjustmentInProgress(object sender, UiBridge.AdjustmentInProgressEventArgs args) + { + Entities.TestResult tr = args.TestResult; + if (WaterMetersCount >= 1) wmErrorTextBox1.Text = tr.Meters[0].VolumeErrorPct.ToString("F1"); + if (WaterMetersCount >= 2) wmErrorTextBox2.Text = tr.Meters[1].VolumeErrorPct.ToString("F1"); + if (WaterMetersCount >= 3) wmErrorTextBox3.Text = tr.Meters[2].VolumeErrorPct.ToString("F1"); + if (WaterMetersCount >= 4) wmErrorTextBox4.Text = tr.Meters[3].VolumeErrorPct.ToString("F1"); + if (WaterMetersCount >= 5) wmErrorTextBox5.Text = tr.Meters[4].VolumeErrorPct.ToString("F1"); + if (WaterMetersCount >= 6) wmErrorTextBox6.Text = tr.Meters[5].VolumeErrorPct.ToString("F1"); + } + + private void okButton_Click(object sender, EventArgs e) + { + completed = true; + Close(); + } + } +} diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.designer.cs b/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.designer.cs new file mode 100644 index 000000000..9fc36f67a --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.designer.cs @@ -0,0 +1,302 @@ +namespace TBF.BenchControl.TestMethods.Adjustment +{ + partial class WMErrorsForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.wmErrorTextBox2 = new System.Windows.Forms.TextBox(); + this.wmErrorLabel2 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.wmErrorTextBox1 = new System.Windows.Forms.TextBox(); + this.wmErrorLabel1 = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.wmErrorTextBox3 = new System.Windows.Forms.TextBox(); + this.wmErrorLabel3 = new System.Windows.Forms.Label(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.wmErrorTextBox4 = new System.Windows.Forms.TextBox(); + this.wmErrorLabel4 = new System.Windows.Forms.Label(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.wmErrorTextBox5 = new System.Windows.Forms.TextBox(); + this.wmErrorLabel5 = new System.Windows.Forms.Label(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.wmErrorTextBox6 = new System.Windows.Forms.TextBox(); + this.wmErrorLabel6 = new System.Windows.Forms.Label(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.wmErrorTextBox2); + this.groupBox2.Controls.Add(this.wmErrorLabel2); + this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox2.ForeColor = System.Drawing.Color.Black; + this.groupBox2.Location = new System.Drawing.Point(25, 102); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(362, 81); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Water Meter 2"; + // + // wmErrorTextBox2 + // + this.wmErrorTextBox2.Location = new System.Drawing.Point(183, 31); + this.wmErrorTextBox2.Name = "wmErrorTextBox2"; + this.wmErrorTextBox2.Size = new System.Drawing.Size(163, 31); + this.wmErrorTextBox2.TabIndex = 1; + // + // wmErrorLabel2 + // + this.wmErrorLabel2.AutoSize = true; + this.wmErrorLabel2.Location = new System.Drawing.Point(18, 34); + this.wmErrorLabel2.Name = "wmErrorLabel2"; + this.wmErrorLabel2.Size = new System.Drawing.Size(103, 23); + this.wmErrorLabel2.TabIndex = 0; + this.wmErrorLabel2.Text = "Error [%]"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.wmErrorTextBox1); + this.groupBox1.Controls.Add(this.wmErrorLabel1); + this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox1.ForeColor = System.Drawing.Color.Black; + this.groupBox1.Location = new System.Drawing.Point(25, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(362, 81); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Water Meter 1"; + // + // wmErrorTextBox1 + // + this.wmErrorTextBox1.Location = new System.Drawing.Point(183, 31); + this.wmErrorTextBox1.Name = "wmErrorTextBox1"; + this.wmErrorTextBox1.Size = new System.Drawing.Size(163, 31); + this.wmErrorTextBox1.TabIndex = 1; + // + // wmErrorLabel1 + // + this.wmErrorLabel1.AutoSize = true; + this.wmErrorLabel1.Location = new System.Drawing.Point(18, 34); + this.wmErrorLabel1.Name = "wmErrorLabel1"; + this.wmErrorLabel1.Size = new System.Drawing.Size(103, 23); + this.wmErrorLabel1.TabIndex = 0; + this.wmErrorLabel1.Text = "Error [%]"; + // + // okButton + // + this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.okButton.ForeColor = System.Drawing.Color.Black; + this.okButton.Location = new System.Drawing.Point(425, 21); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(98, 63); + this.okButton.TabIndex = 7; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.wmErrorTextBox3); + this.groupBox3.Controls.Add(this.wmErrorLabel3); + this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox3.ForeColor = System.Drawing.Color.Black; + this.groupBox3.Location = new System.Drawing.Point(25, 192); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(362, 81); + this.groupBox3.TabIndex = 3; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Water Meter 3"; + // + // wmErrorTextBox3 + // + this.wmErrorTextBox3.Location = new System.Drawing.Point(183, 31); + this.wmErrorTextBox3.Name = "wmErrorTextBox3"; + this.wmErrorTextBox3.Size = new System.Drawing.Size(163, 31); + this.wmErrorTextBox3.TabIndex = 1; + // + // wmErrorLabel3 + // + this.wmErrorLabel3.AutoSize = true; + this.wmErrorLabel3.Location = new System.Drawing.Point(18, 34); + this.wmErrorLabel3.Name = "wmErrorLabel3"; + this.wmErrorLabel3.Size = new System.Drawing.Size(103, 23); + this.wmErrorLabel3.TabIndex = 0; + this.wmErrorLabel3.Text = "Error [%]"; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.wmErrorTextBox4); + this.groupBox4.Controls.Add(this.wmErrorLabel4); + this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox4.ForeColor = System.Drawing.Color.Black; + this.groupBox4.Location = new System.Drawing.Point(25, 282); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(362, 81); + this.groupBox4.TabIndex = 4; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Water Meter 4"; + // + // wmErrorTextBox4 + // + this.wmErrorTextBox4.Location = new System.Drawing.Point(183, 31); + this.wmErrorTextBox4.Name = "wmErrorTextBox4"; + this.wmErrorTextBox4.Size = new System.Drawing.Size(163, 31); + this.wmErrorTextBox4.TabIndex = 1; + // + // wmErrorLabel4 + // + this.wmErrorLabel4.AutoSize = true; + this.wmErrorLabel4.Location = new System.Drawing.Point(18, 34); + this.wmErrorLabel4.Name = "wmErrorLabel4"; + this.wmErrorLabel4.Size = new System.Drawing.Size(103, 23); + this.wmErrorLabel4.TabIndex = 0; + this.wmErrorLabel4.Text = "Error [%]"; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.wmErrorTextBox5); + this.groupBox5.Controls.Add(this.wmErrorLabel5); + this.groupBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox5.ForeColor = System.Drawing.Color.Black; + this.groupBox5.Location = new System.Drawing.Point(25, 372); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(362, 81); + this.groupBox5.TabIndex = 5; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Water Meter 5"; + // + // wmErrorTextBox5 + // + this.wmErrorTextBox5.Location = new System.Drawing.Point(183, 31); + this.wmErrorTextBox5.Name = "wmErrorTextBox5"; + this.wmErrorTextBox5.Size = new System.Drawing.Size(163, 31); + this.wmErrorTextBox5.TabIndex = 1; + // + // wmErrorLabel5 + // + this.wmErrorLabel5.AutoSize = true; + this.wmErrorLabel5.Location = new System.Drawing.Point(18, 34); + this.wmErrorLabel5.Name = "wmErrorLabel5"; + this.wmErrorLabel5.Size = new System.Drawing.Size(103, 23); + this.wmErrorLabel5.TabIndex = 0; + this.wmErrorLabel5.Text = "Error [%]"; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.wmErrorTextBox6); + this.groupBox6.Controls.Add(this.wmErrorLabel6); + this.groupBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox6.ForeColor = System.Drawing.Color.Black; + this.groupBox6.Location = new System.Drawing.Point(25, 462); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(362, 81); + this.groupBox6.TabIndex = 6; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "Water Meter 6"; + // + // wmErrorTextBox6 + // + this.wmErrorTextBox6.Location = new System.Drawing.Point(183, 31); + this.wmErrorTextBox6.Name = "wmErrorTextBox6"; + this.wmErrorTextBox6.Size = new System.Drawing.Size(163, 31); + this.wmErrorTextBox6.TabIndex = 1; + // + // wmErrorLabel6 + // + this.wmErrorLabel6.AutoSize = true; + this.wmErrorLabel6.Location = new System.Drawing.Point(18, 34); + this.wmErrorLabel6.Name = "wmErrorLabel6"; + this.wmErrorLabel6.Size = new System.Drawing.Size(103, 23); + this.wmErrorLabel6.TabIndex = 0; + this.wmErrorLabel6.Text = "Error [%]"; + // + // WMErrorsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.DarkGoldenrod; + this.ClientSize = new System.Drawing.Size(559, 565); + this.Controls.Add(this.groupBox6); + this.Controls.Add(this.groupBox5); + this.Controls.Add(this.groupBox4); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.okButton); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "WMErrorsForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Water Meter States"; + this.TopMost = true; + this.Load += new System.EventHandler(this.CycleEndForm_Load); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox wmErrorTextBox2; + private System.Windows.Forms.Label wmErrorLabel2; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox wmErrorTextBox1; + private System.Windows.Forms.Label wmErrorLabel1; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.TextBox wmErrorTextBox3; + private System.Windows.Forms.Label wmErrorLabel3; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.TextBox wmErrorTextBox4; + private System.Windows.Forms.Label wmErrorLabel4; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.TextBox wmErrorTextBox5; + private System.Windows.Forms.Label wmErrorLabel5; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.TextBox wmErrorTextBox6; + private System.Windows.Forms.Label wmErrorLabel6; + + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.resx b/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/TestMethods/Adjustment/WMErrorsForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index f69cb3c6e..e9c913215 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -58,48 +58,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStart Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single); - - if (!test.Emptying) /// If condition met => skip measuring and force emptying - { - /// - /// Measure the weight and skip emptying if there is enough room in the tank - /// - State.Create("FlyingStart : Measuring the mass of water in the tank") - .AddOperation(checkUiOp) - .AddOperation(outPath.Balance.ReadMassOp(ref mass)) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.BalanceDone)); - - float estimatedEndMass = mass.Val + test.Volume; - if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor) - { - goto set_flow; /// Enough room in the tank -> skip emptying - } - } - - /// - /// Empty the water tank - /// - switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance)) - { - case Event.Error: { retVal = Event.Error; goto stopTest; } - case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; } - } - - set_flow: - - int flowSetTime0 = StateMachine.Time; - float estFlowSetTime = 10.0f; - //------------------------------------------------ Bridge.OnActivity(this, Strings.Setting_the_flow); //------------------------------------------------ + int flowSetTime0 = StateMachine.Time; + float estFlowSetTime = 10.0f; + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); State.Create("FlyingStart : Starting the pump") .AddOperation(checkUiOp) diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index 961158014..cf8cc5017 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.1026 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -105,6 +105,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Adjustment in progress. + /// + internal static string Adjustment_in_progress { + get { + return ResourceManager.GetString("Adjustment_in_progress", resourceCulture); + } + } + /// /// Looks up a localized string similar to Administrator. /// @@ -699,6 +708,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Error [%]. + /// + internal static string Error_pct { + get { + return ResourceManager.GetString("Error_pct", resourceCulture); + } + } + /// /// Looks up a localized string similar to Error while creating the database. Reason: . /// diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index b54b80e93..bdd9c5603 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -946,4 +946,10 @@ Pump power [%] + + Adjustment in progress + + + Error [%] + \ No newline at end of file diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj index 87584f92d..044b3561a 100644 --- a/TestBenchFramework/TBF.csproj +++ b/TestBenchFramework/TBF.csproj @@ -427,6 +427,22 @@ + + + + + UserControl + + + TestMethodCfgCtrl.cs + + + + Form + + + WMErrorsForm.cs + @@ -855,6 +871,7 @@ TransitionsDlg.cs + @@ -1046,6 +1063,12 @@ WriterCfgCtrl.cs + + TestMethodCfgCtrl.cs + + + WMErrorsForm.cs + RoiDetectionCfgCtrl.cs diff --git a/TestBenchFramework/UiBridge/AdjustmentInProgressEventArgs.cs b/TestBenchFramework/UiBridge/AdjustmentInProgressEventArgs.cs new file mode 100644 index 000000000..9c279b702 --- /dev/null +++ b/TestBenchFramework/UiBridge/AdjustmentInProgressEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace TBF.UiBridge +{ + public class AdjustmentInProgressEventArgs : EventArgs + { + public Entities.TestResult TestResult; + + public AdjustmentInProgressEventArgs(Entities.TestResult testResult) + { + this.TestResult = testResult; + } + } +} diff --git a/TestBenchFramework/UiBridge/Bridge.cs b/TestBenchFramework/UiBridge/Bridge.cs index 7a56ea56c..e74c19d77 100644 --- a/TestBenchFramework/UiBridge/Bridge.cs +++ b/TestBenchFramework/UiBridge/Bridge.cs @@ -90,6 +90,18 @@ namespace TBF.UiBridge public static event EventHandler TestProgressHandler; + /// + /// Called from the state machine when one test of the adjustment process was completed and UI needs to be updated. + /// + public static void OnAdjustmentInProgress(object sender, AdjustmentInProgressEventArgs data) + { + if (AdjustmentInProgressHandler == null) return; + try { AdjustmentInProgressHandler(sender, data); } + catch (Exception e) { log.Error("AdjustmentInProgressHandler(...) failed", e); } + } + public static event EventHandler AdjustmentInProgressHandler; + + /// /// Called from the state machine when the test is completed and UI needs to be updated. ///