diff --git a/TBF/BenchControl/TbfComponents.cs b/TBF/BenchControl/TbfComponents.cs index 167b3ee87..67cc5a20c 100644 --- a/TBF/BenchControl/TbfComponents.cs +++ b/TBF/BenchControl/TbfComponents.cs @@ -76,6 +76,7 @@ namespace TBF.BenchControl Factories.Add(new TestMethods.OuterLoop.End.Factory()); Factories.Add(new TestMethods.PMaxTest.TestMethodFactory()); Factories.Add(new TestMethods.PulsesTest.Factory()); + Factories.Add(new TestMethods.PulsesTestManual.Factory()); Factories.Add(new TestMethods.SensitivityTest.TestMethodFactory()); Factories.Add(new TestMethods.iPerlCommunication.TestMethodFactory()); /// iPerlCommunication Factories.Add(new TestMethods.RoiDetection.RoiDetectionFactory()); diff --git a/TBF/BenchControl/TestMethods/PulsesTest/Factory.cs b/TBF/BenchControl/TestMethods/PulsesTest/Factory.cs index 7816784cb..8ea50aa83 100644 --- a/TBF/BenchControl/TestMethods/PulsesTest/Factory.cs +++ b/TBF/BenchControl/TestMethods/PulsesTest/Factory.cs @@ -3,7 +3,6 @@ /// using System.Collections.Generic; using TBF.BenchControl.Generic; -using TBF.BenchControl.Configs.NameOnly; namespace TBF.BenchControl.TestMethods.PulsesTest { diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/Factory.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/Factory.cs new file mode 100644 index 000000000..47832b43d --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/Factory.cs @@ -0,0 +1,30 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System.Collections.Generic; +using TBF.BenchControl.Generic; +using TBF.BenchControl.Configs.NameOnly; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + public class Factory : IComponentFactory + { + public string ClassName { get { return this.GetType().Namespace.Substring(17); } } + + public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); } + + public IComponent DummyComponent() { return new TestMethod(); } + + public IComponent GetComponent(IComponentCfg cfg, IList components) { return new TestMethod(cfg); } + + public IComponentCfg DefaultConfig() + { + return new TestMethodCfg(this.GetType().Namespace.Substring(29), this); + } + + public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component) + { + return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this); + } + } +} diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/IHasGetPassed.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/IHasGetPassed.cs new file mode 100644 index 000000000..77016669a --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/IHasGetPassed.cs @@ -0,0 +1,9 @@ +using System; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + interface IHasGetPassed + { + bool GetPassed(int i); + } +} diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.cs new file mode 100644 index 000000000..482bab484 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.cs @@ -0,0 +1,137 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using log4net; +using Config.Entities; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + public partial class ManualPulsesForm : Form, GenericDevices.IHasCompleted, IHasGetPassed + { + private static readonly ILog log = LogManager.GetLogger(typeof(ManualPulsesForm)); + + /// + /// Updated in constructor + /// + readonly int waterMetersCount; /// Number of text boxes for serial numbers + readonly bool[] disabled; + readonly CheckBox[] pulsesCountOKCheckBox; + + /// + /// Result of manual pulses test + /// + bool[] passed; + public bool GetPassed(int i) { return (i >= 0 && i < passed.Length) ? passed[i] : false; } + + /// + /// Set to 'true' when the form closes + /// + public bool Completed { get { return completed; } } + bool completed; + + /// + /// Constructor + /// + /// Number of text boxes for serial numbers + public ManualPulsesForm(IList waterMeters) + : this() + { + waterMetersCount = waterMeters.Count; + + disabled = new bool[waterMetersCount]; + passed = new bool[waterMetersCount]; + for (int i = 0; i < waterMetersCount; i++) + { + disabled[i] = waterMeters[i].Disabled; + passed[i] = false; + } + } + + /// Parameterless constructor for 3 watermeters + public ManualPulsesForm() + { + InitializeComponent(); + ControlBox = false; + + completed = false; + + pulsesCountOKCheckBox = new CheckBox[] { pulsesCountOKCheckBox1, pulsesCountOKCheckBox2, pulsesCountOKCheckBox3, + pulsesCountOKCheckBox4, pulsesCountOKCheckBox5, pulsesCountOKCheckBox6, }; + } + + 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"; + pulsesCountOKCheckBox1.Text = Strings.Pulses_count_is_OK; + pulsesCountOKCheckBox2.Text = Strings.Pulses_count_is_OK; + pulsesCountOKCheckBox3.Text = Strings.Pulses_count_is_OK; + pulsesCountOKCheckBox4.Text = Strings.Pulses_count_is_OK; + pulsesCountOKCheckBox5.Text = Strings.Pulses_count_is_OK; + pulsesCountOKCheckBox6.Text = Strings.Pulses_count_is_OK; + okButton.Text = Strings.OkBtnText; + } + + private void WMPulsesForm_Load(object sender, EventArgs e) + { + Localize(); + + Height = 50 + 90 * waterMetersCount; + + if (waterMetersCount < 1 || disabled[0]) groupBox1.Visible = false; + if (waterMetersCount < 2 || disabled[1]) groupBox2.Visible = false; + if (waterMetersCount < 3 || disabled[2]) groupBox3.Visible = false; + if (waterMetersCount < 4 || disabled[3]) groupBox4.Visible = false; + if (waterMetersCount < 5 || disabled[4]) groupBox5.Visible = false; + if (waterMetersCount < 6 || disabled[5]) groupBox6.Visible = false; + + pulsesCountOKCheckBox1.Checked = false; + pulsesCountOKCheckBox2.Checked = false; + pulsesCountOKCheckBox3.Checked = false; + pulsesCountOKCheckBox4.Checked = false; + pulsesCountOKCheckBox5.Checked = false; + pulsesCountOKCheckBox6.Checked = false; + } + + private void okButton_Click(object sender, EventArgs e) + { + int count = Math.Min(waterMetersCount, TBF.BenchControl.Sequences.ProcessData.BatchRslts.WMPositionsCount); + for (int i = 0; i < count; i++) + { + passed[i] = pulsesCountOKCheckBox[i].Checked; + } + + completed = true; + Close(); + } + + #region Forced close handling + + public void StartForceCloseHandler() + { + UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args) + { + if (InvokeRequired) { Invoke(new EventHandler(OnForceClose), sender, args); } + else OnForceClose(sender, args); + }; + } + + void OnForceClose(object sender, EventArgs args) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + #endregion + } +} diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.designer.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.designer.cs new file mode 100644 index 000000000..49e46179d --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.designer.cs @@ -0,0 +1,252 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + partial class ManualPulsesForm + { + /// + /// 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.pulsesCountOKCheckBox2 = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.pulsesCountOKCheckBox1 = new System.Windows.Forms.CheckBox(); + this.okButton = new System.Windows.Forms.Button(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.pulsesCountOKCheckBox3 = new System.Windows.Forms.CheckBox(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.pulsesCountOKCheckBox4 = new System.Windows.Forms.CheckBox(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.pulsesCountOKCheckBox5 = new System.Windows.Forms.CheckBox(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.pulsesCountOKCheckBox6 = new System.Windows.Forms.CheckBox(); + 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.pulsesCountOKCheckBox2); + 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(333, 81); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Water Meter 2"; + // + // pulsesCountOKCheckBox2 + // + this.pulsesCountOKCheckBox2.AutoSize = true; + this.pulsesCountOKCheckBox2.Location = new System.Drawing.Point(33, 35); + this.pulsesCountOKCheckBox2.Name = "pulsesCountOKCheckBox2"; + this.pulsesCountOKCheckBox2.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox2.TabIndex = 2; + this.pulsesCountOKCheckBox2.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox2.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.pulsesCountOKCheckBox1); + 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(333, 81); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Water Meter 1"; + // + // pulsesCountOKCheckBox1 + // + this.pulsesCountOKCheckBox1.AutoSize = true; + this.pulsesCountOKCheckBox1.Location = new System.Drawing.Point(33, 35); + this.pulsesCountOKCheckBox1.Name = "pulsesCountOKCheckBox1"; + this.pulsesCountOKCheckBox1.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox1.TabIndex = 1; + this.pulsesCountOKCheckBox1.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox1.UseVisualStyleBackColor = true; + // + // okButton + // + this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + 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(394, 26); + 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.pulsesCountOKCheckBox3); + 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(333, 81); + this.groupBox3.TabIndex = 3; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Water Meter 3"; + // + // pulsesCountOKCheckBox3 + // + this.pulsesCountOKCheckBox3.AutoSize = true; + this.pulsesCountOKCheckBox3.Location = new System.Drawing.Point(33, 35); + this.pulsesCountOKCheckBox3.Name = "pulsesCountOKCheckBox3"; + this.pulsesCountOKCheckBox3.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox3.TabIndex = 2; + this.pulsesCountOKCheckBox3.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox3.UseVisualStyleBackColor = true; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.pulsesCountOKCheckBox4); + 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(333, 81); + this.groupBox4.TabIndex = 4; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Water Meter 4"; + // + // pulsesCountOKCheckBox4 + // + this.pulsesCountOKCheckBox4.AutoSize = true; + this.pulsesCountOKCheckBox4.Location = new System.Drawing.Point(33, 36); + this.pulsesCountOKCheckBox4.Name = "pulsesCountOKCheckBox4"; + this.pulsesCountOKCheckBox4.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox4.TabIndex = 2; + this.pulsesCountOKCheckBox4.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox4.UseVisualStyleBackColor = true; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.pulsesCountOKCheckBox5); + 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(333, 81); + this.groupBox5.TabIndex = 5; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Water Meter 5"; + // + // pulsesCountOKCheckBox5 + // + this.pulsesCountOKCheckBox5.AutoSize = true; + this.pulsesCountOKCheckBox5.Location = new System.Drawing.Point(33, 34); + this.pulsesCountOKCheckBox5.Name = "pulsesCountOKCheckBox5"; + this.pulsesCountOKCheckBox5.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox5.TabIndex = 2; + this.pulsesCountOKCheckBox5.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox5.UseVisualStyleBackColor = true; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.pulsesCountOKCheckBox6); + 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(333, 81); + this.groupBox6.TabIndex = 6; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "Water Meter 6"; + // + // pulsesCountOKCheckBox6 + // + this.pulsesCountOKCheckBox6.AutoSize = true; + this.pulsesCountOKCheckBox6.Location = new System.Drawing.Point(33, 35); + this.pulsesCountOKCheckBox6.Name = "pulsesCountOKCheckBox6"; + this.pulsesCountOKCheckBox6.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox6.TabIndex = 2; + this.pulsesCountOKCheckBox6.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox6.UseVisualStyleBackColor = true; + // + // WMPulsesForm + // + 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(523, 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 = "WMPulsesForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Water Meter States"; + this.TopMost = true; + this.Load += new System.EventHandler(this.WMPulsesForm_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.GroupBox groupBox1; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox2; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox1; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox3; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox4; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox5; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox6; + + } +} \ No newline at end of file diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.resx b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm.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/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.cs new file mode 100644 index 000000000..5cd99ea04 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.cs @@ -0,0 +1,178 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using log4net; +using Config.Entities; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + public partial class ManualPulsesForm12 : Form, GenericDevices.IHasCompleted, IHasGetPassed + { + private static readonly ILog log = LogManager.GetLogger(typeof(ManualPulsesForm12)); + + const int MaxWMsCount = 12; /// Implementation limit of this form + + /// + /// Updated in constructor + /// + readonly int waterMetersCount; /// Number of text boxes for serial numbers + readonly bool[] disabled; + int textBoxesCount; + Label[] labels; + CheckBox[] pulsesCountOKCheckBox; + + /// + /// Result of manual pulses test + /// + bool[] passed; + public bool GetPassed(int i) { return (i >= 0 && i < passed.Length) ? passed[i] : false; } + + /// + /// Updated in OnAdjustmentInProgress() + /// + double[] pulsesCount; /// Created in constructor + double minPulsesCount; + + /// + /// Set to 'true' when the form closes + /// + public bool Completed { get { return completed; } } + bool completed; + + + /// Parameterless constructor for 3 watermeters + public ManualPulsesForm12() + { + InitializeComponent(); + ControlBox = false; + + textBoxesCount = MaxWMsCount; + + labels = new Label[MaxWMsCount] + { + wmPulsesCountLabel1, wmPulsesCountLabel2, wmPulsesCountLabel3, wmPulsesCountLabel4, + wmPulsesCountLabel5, wmPulsesCountLabel6, wmPulsesCountLabel7, wmPulsesCountLabel8, + wmPulsesCountLabel9, wmPulsesCountLabel10, wmPulsesCountLabel11, wmPulsesCountLabel12, + }; + pulsesCountOKCheckBox = new CheckBox[MaxWMsCount] + { + pulsesCountOKCheckBox1, pulsesCountOKCheckBox2, pulsesCountOKCheckBox3, pulsesCountOKCheckBox4, + pulsesCountOKCheckBox5, pulsesCountOKCheckBox6, pulsesCountOKCheckBox7, pulsesCountOKCheckBox8, + pulsesCountOKCheckBox9, pulsesCountOKCheckBox10, pulsesCountOKCheckBox11, pulsesCountOKCheckBox12, + }; + + completed = false; + minPulsesCount = 1; /// Must be >0 so that initially the indication is RED + } + + /// + /// Constructor + /// + /// Number of text boxes for serial numbers + public ManualPulsesForm12(IList waterMeters) + : this() + { + waterMetersCount = waterMeters.Count; + + ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize); + + disabled = new bool[waterMetersCount]; + passed = new bool[waterMetersCount]; + for (int i = 0; i < waterMetersCount; i++) + { + disabled[i] = waterMeters[i].Disabled; + passed[i] = false; + } + } + + + /// + /// Make sure the layout of labels/text boxes on the screen + /// corresponds to the layout of watermeters of the test bench. + /// + /// Number of watermeters + /// Number of watermeters in one line + void ShuffleTextBoxes(int wmsCount, int lineSize) + { + if (wmsCount < textBoxesCount && lineSize > 0) + { + int nrLines = (wmsCount + lineSize - 1) / lineSize; + int gap = (textBoxesCount - wmsCount) / nrLines; + + int dest = 0; + for (int l = 0; l < nrLines; l++) + { + for (int i = 0; i < lineSize; i++) + { + labels[dest] = labels[l * lineSize + l * gap + i]; + pulsesCountOKCheckBox[dest] = pulsesCountOKCheckBox[l * lineSize + l * gap + i]; + dest++; + } + } + textBoxesCount = wmsCount; + } + } + + + void Localize() + { + Text = Strings.Water_Meter_States; + for (int i = 0; i < textBoxesCount; i++) + { + labels[i].Text = string.Format("{0} {1}", Strings.Water_Meter, i + 1); + pulsesCountOKCheckBox[i].Text = Strings.Pulses_count_is_OK; + } + okButton.Text = Strings.OkBtnText; + } + + private void WMPulsesForm12_Load(object sender, EventArgs e) + { + Localize(); + + //Height = 50 + 90 * WaterMetersCount; + + for (int i = 0; i < textBoxesCount; i++) + { + labels[i].Visible = (disabled == null || i >= disabled.Length || !disabled[i]); + pulsesCountOKCheckBox[i].Visible = (disabled == null || i >= disabled.Length || !disabled[i]); + pulsesCountOKCheckBox[i].Checked = false; + } + } + + private void okButton_Click(object sender, EventArgs e) + { + int count = Math.Min(waterMetersCount, TBF.BenchControl.Sequences.ProcessData.BatchRslts.WMPositionsCount); + for (int i = 0; i < count; i++) + { + passed[i] = pulsesCountOKCheckBox[i].Checked; + } + + completed = true; + Close(); + } + + #region Forced close handling + + public void StartForceCloseHandler() + { + UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args) + { + if (InvokeRequired) { Invoke(new EventHandler(OnForceClose), sender, args); } + else OnForceClose(sender, args); + }; + } + + void OnForceClose(object sender, EventArgs args) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + #endregion + } +} diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.designer.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.designer.cs new file mode 100644 index 000000000..e15acadd2 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.designer.cs @@ -0,0 +1,408 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + partial class ManualPulsesForm12 + { + /// + /// 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.okButton = new System.Windows.Forms.Button(); + this.pulsesCountOKCheckBox1 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox2 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox3 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox4 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox5 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox6 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox7 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox8 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox9 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox10 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox11 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox12 = new System.Windows.Forms.CheckBox(); + this.wmPulsesCountLabel1 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel2 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel3 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel4 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel5 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel6 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel7 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel8 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel9 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel10 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel11 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel12 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // 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(601, 28); + 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); + // + // pulsesCountOKCheckBox1 + // + this.pulsesCountOKCheckBox1.AutoSize = true; + this.pulsesCountOKCheckBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox1.Location = new System.Drawing.Point(198, 35); + this.pulsesCountOKCheckBox1.Name = "pulsesCountOKCheckBox1"; + this.pulsesCountOKCheckBox1.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox1.TabIndex = 20; + this.pulsesCountOKCheckBox1.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox1.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox2 + // + this.pulsesCountOKCheckBox2.AutoSize = true; + this.pulsesCountOKCheckBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox2.Location = new System.Drawing.Point(198, 81); + this.pulsesCountOKCheckBox2.Name = "pulsesCountOKCheckBox2"; + this.pulsesCountOKCheckBox2.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox2.TabIndex = 21; + this.pulsesCountOKCheckBox2.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox2.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox3 + // + this.pulsesCountOKCheckBox3.AutoSize = true; + this.pulsesCountOKCheckBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox3.Location = new System.Drawing.Point(198, 127); + this.pulsesCountOKCheckBox3.Name = "pulsesCountOKCheckBox3"; + this.pulsesCountOKCheckBox3.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox3.TabIndex = 22; + this.pulsesCountOKCheckBox3.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox3.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox4 + // + this.pulsesCountOKCheckBox4.AutoSize = true; + this.pulsesCountOKCheckBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox4.Location = new System.Drawing.Point(198, 173); + this.pulsesCountOKCheckBox4.Name = "pulsesCountOKCheckBox4"; + this.pulsesCountOKCheckBox4.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox4.TabIndex = 23; + this.pulsesCountOKCheckBox4.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox4.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox5 + // + this.pulsesCountOKCheckBox5.AutoSize = true; + this.pulsesCountOKCheckBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox5.Location = new System.Drawing.Point(198, 220); + this.pulsesCountOKCheckBox5.Name = "pulsesCountOKCheckBox5"; + this.pulsesCountOKCheckBox5.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox5.TabIndex = 24; + this.pulsesCountOKCheckBox5.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox5.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox6 + // + this.pulsesCountOKCheckBox6.AutoSize = true; + this.pulsesCountOKCheckBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox6.Location = new System.Drawing.Point(198, 267); + this.pulsesCountOKCheckBox6.Name = "pulsesCountOKCheckBox6"; + this.pulsesCountOKCheckBox6.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox6.TabIndex = 25; + this.pulsesCountOKCheckBox6.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox6.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox7 + // + this.pulsesCountOKCheckBox7.AutoSize = true; + this.pulsesCountOKCheckBox7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox7.Location = new System.Drawing.Point(198, 313); + this.pulsesCountOKCheckBox7.Name = "pulsesCountOKCheckBox7"; + this.pulsesCountOKCheckBox7.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox7.TabIndex = 26; + this.pulsesCountOKCheckBox7.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox7.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox8 + // + this.pulsesCountOKCheckBox8.AutoSize = true; + this.pulsesCountOKCheckBox8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox8.Location = new System.Drawing.Point(198, 359); + this.pulsesCountOKCheckBox8.Name = "pulsesCountOKCheckBox8"; + this.pulsesCountOKCheckBox8.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox8.TabIndex = 27; + this.pulsesCountOKCheckBox8.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox8.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox9 + // + this.pulsesCountOKCheckBox9.AutoSize = true; + this.pulsesCountOKCheckBox9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox9.Location = new System.Drawing.Point(198, 404); + this.pulsesCountOKCheckBox9.Name = "pulsesCountOKCheckBox9"; + this.pulsesCountOKCheckBox9.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox9.TabIndex = 28; + this.pulsesCountOKCheckBox9.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox9.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox10 + // + this.pulsesCountOKCheckBox10.AutoSize = true; + this.pulsesCountOKCheckBox10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox10.Location = new System.Drawing.Point(198, 450); + this.pulsesCountOKCheckBox10.Name = "pulsesCountOKCheckBox10"; + this.pulsesCountOKCheckBox10.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox10.TabIndex = 29; + this.pulsesCountOKCheckBox10.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox10.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox11 + // + this.pulsesCountOKCheckBox11.AutoSize = true; + this.pulsesCountOKCheckBox11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox11.Location = new System.Drawing.Point(198, 496); + this.pulsesCountOKCheckBox11.Name = "pulsesCountOKCheckBox11"; + this.pulsesCountOKCheckBox11.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox11.TabIndex = 30; + this.pulsesCountOKCheckBox11.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox11.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox12 + // + this.pulsesCountOKCheckBox12.AutoSize = true; + this.pulsesCountOKCheckBox12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox12.Location = new System.Drawing.Point(198, 542); + this.pulsesCountOKCheckBox12.Name = "pulsesCountOKCheckBox12"; + this.pulsesCountOKCheckBox12.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox12.TabIndex = 31; + this.pulsesCountOKCheckBox12.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox12.UseVisualStyleBackColor = true; + // + // wmPulsesCountLabel1 + // + this.wmPulsesCountLabel1.AutoSize = true; + this.wmPulsesCountLabel1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel1.Location = new System.Drawing.Point(33, 39); + this.wmPulsesCountLabel1.Name = "wmPulsesCountLabel1"; + this.wmPulsesCountLabel1.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel1.TabIndex = 0; + this.wmPulsesCountLabel1.Text = "Pulses count"; + this.wmPulsesCountLabel1.Visible = false; + // + // wmPulsesCountLabel2 + // + this.wmPulsesCountLabel2.AutoSize = true; + this.wmPulsesCountLabel2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel2.Location = new System.Drawing.Point(33, 85); + this.wmPulsesCountLabel2.Name = "wmPulsesCountLabel2"; + this.wmPulsesCountLabel2.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel2.TabIndex = 0; + this.wmPulsesCountLabel2.Text = "Pulses count"; + this.wmPulsesCountLabel2.Visible = false; + // + // wmPulsesCountLabel3 + // + this.wmPulsesCountLabel3.AutoSize = true; + this.wmPulsesCountLabel3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel3.Location = new System.Drawing.Point(33, 131); + this.wmPulsesCountLabel3.Name = "wmPulsesCountLabel3"; + this.wmPulsesCountLabel3.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel3.TabIndex = 0; + this.wmPulsesCountLabel3.Text = "Pulses count"; + this.wmPulsesCountLabel3.Visible = false; + // + // wmPulsesCountLabel4 + // + this.wmPulsesCountLabel4.AutoSize = true; + this.wmPulsesCountLabel4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel4.Location = new System.Drawing.Point(33, 177); + this.wmPulsesCountLabel4.Name = "wmPulsesCountLabel4"; + this.wmPulsesCountLabel4.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel4.TabIndex = 0; + this.wmPulsesCountLabel4.Text = "Pulses count"; + this.wmPulsesCountLabel4.Visible = false; + // + // wmPulsesCountLabel5 + // + this.wmPulsesCountLabel5.AutoSize = true; + this.wmPulsesCountLabel5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel5.Location = new System.Drawing.Point(33, 224); + this.wmPulsesCountLabel5.Name = "wmPulsesCountLabel5"; + this.wmPulsesCountLabel5.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel5.TabIndex = 0; + this.wmPulsesCountLabel5.Text = "Pulses count"; + this.wmPulsesCountLabel5.Visible = false; + // + // wmPulsesCountLabel6 + // + this.wmPulsesCountLabel6.AutoSize = true; + this.wmPulsesCountLabel6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel6.Location = new System.Drawing.Point(33, 271); + this.wmPulsesCountLabel6.Name = "wmPulsesCountLabel6"; + this.wmPulsesCountLabel6.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel6.TabIndex = 0; + this.wmPulsesCountLabel6.Text = "Pulses count"; + this.wmPulsesCountLabel6.Visible = false; + // + // wmPulsesCountLabel7 + // + this.wmPulsesCountLabel7.AutoSize = true; + this.wmPulsesCountLabel7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel7.Location = new System.Drawing.Point(33, 317); + this.wmPulsesCountLabel7.Name = "wmPulsesCountLabel7"; + this.wmPulsesCountLabel7.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel7.TabIndex = 8; + this.wmPulsesCountLabel7.Text = "Pulses count"; + this.wmPulsesCountLabel7.Visible = false; + // + // wmPulsesCountLabel8 + // + this.wmPulsesCountLabel8.AutoSize = true; + this.wmPulsesCountLabel8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel8.Location = new System.Drawing.Point(33, 363); + this.wmPulsesCountLabel8.Name = "wmPulsesCountLabel8"; + this.wmPulsesCountLabel8.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel8.TabIndex = 10; + this.wmPulsesCountLabel8.Text = "Pulses count"; + this.wmPulsesCountLabel8.Visible = false; + // + // wmPulsesCountLabel9 + // + this.wmPulsesCountLabel9.AutoSize = true; + this.wmPulsesCountLabel9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel9.Location = new System.Drawing.Point(33, 408); + this.wmPulsesCountLabel9.Name = "wmPulsesCountLabel9"; + this.wmPulsesCountLabel9.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel9.TabIndex = 12; + this.wmPulsesCountLabel9.Text = "Pulses count"; + this.wmPulsesCountLabel9.Visible = false; + // + // wmPulsesCountLabel10 + // + this.wmPulsesCountLabel10.AutoSize = true; + this.wmPulsesCountLabel10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel10.Location = new System.Drawing.Point(33, 454); + this.wmPulsesCountLabel10.Name = "wmPulsesCountLabel10"; + this.wmPulsesCountLabel10.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel10.TabIndex = 14; + this.wmPulsesCountLabel10.Text = "Pulses count"; + this.wmPulsesCountLabel10.Visible = false; + // + // wmPulsesCountLabel11 + // + this.wmPulsesCountLabel11.AutoSize = true; + this.wmPulsesCountLabel11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel11.Location = new System.Drawing.Point(33, 500); + this.wmPulsesCountLabel11.Name = "wmPulsesCountLabel11"; + this.wmPulsesCountLabel11.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel11.TabIndex = 16; + this.wmPulsesCountLabel11.Text = "Pulses count"; + this.wmPulsesCountLabel11.Visible = false; + // + // wmPulsesCountLabel12 + // + this.wmPulsesCountLabel12.AutoSize = true; + this.wmPulsesCountLabel12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel12.Location = new System.Drawing.Point(33, 546); + this.wmPulsesCountLabel12.Name = "wmPulsesCountLabel12"; + this.wmPulsesCountLabel12.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel12.TabIndex = 18; + this.wmPulsesCountLabel12.Text = "Pulses count"; + this.wmPulsesCountLabel12.Visible = false; + // + // ManualPulsesForm12 + // + 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(731, 592); + this.Controls.Add(this.pulsesCountOKCheckBox12); + this.Controls.Add(this.pulsesCountOKCheckBox11); + this.Controls.Add(this.pulsesCountOKCheckBox10); + this.Controls.Add(this.pulsesCountOKCheckBox9); + this.Controls.Add(this.pulsesCountOKCheckBox8); + this.Controls.Add(this.pulsesCountOKCheckBox7); + this.Controls.Add(this.pulsesCountOKCheckBox6); + this.Controls.Add(this.pulsesCountOKCheckBox5); + this.Controls.Add(this.pulsesCountOKCheckBox4); + this.Controls.Add(this.pulsesCountOKCheckBox3); + this.Controls.Add(this.pulsesCountOKCheckBox2); + this.Controls.Add(this.pulsesCountOKCheckBox1); + this.Controls.Add(this.wmPulsesCountLabel12); + this.Controls.Add(this.wmPulsesCountLabel11); + this.Controls.Add(this.wmPulsesCountLabel10); + this.Controls.Add(this.wmPulsesCountLabel9); + this.Controls.Add(this.wmPulsesCountLabel8); + this.Controls.Add(this.wmPulsesCountLabel7); + this.Controls.Add(this.wmPulsesCountLabel6); + this.Controls.Add(this.wmPulsesCountLabel5); + this.Controls.Add(this.wmPulsesCountLabel4); + this.Controls.Add(this.wmPulsesCountLabel3); + this.Controls.Add(this.wmPulsesCountLabel2); + this.Controls.Add(this.wmPulsesCountLabel1); + this.Controls.Add(this.okButton); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "ManualPulsesForm12"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Water Meter States"; + this.TopMost = true; + this.Load += new System.EventHandler(this.WMPulsesForm12_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox1; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox2; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox3; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox4; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox5; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox6; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox7; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox8; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox9; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox10; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox11; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox12; + private System.Windows.Forms.Label wmPulsesCountLabel1; + private System.Windows.Forms.Label wmPulsesCountLabel2; + private System.Windows.Forms.Label wmPulsesCountLabel3; + private System.Windows.Forms.Label wmPulsesCountLabel4; + private System.Windows.Forms.Label wmPulsesCountLabel5; + private System.Windows.Forms.Label wmPulsesCountLabel6; + private System.Windows.Forms.Label wmPulsesCountLabel7; + private System.Windows.Forms.Label wmPulsesCountLabel8; + private System.Windows.Forms.Label wmPulsesCountLabel9; + private System.Windows.Forms.Label wmPulsesCountLabel10; + private System.Windows.Forms.Label wmPulsesCountLabel11; + private System.Windows.Forms.Label wmPulsesCountLabel12; + + } +} \ No newline at end of file diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.resx b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm12.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/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.cs new file mode 100644 index 000000000..09fc77913 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.cs @@ -0,0 +1,184 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using log4net; +using Config.Entities; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + public partial class ManualPulsesForm24 : Form, GenericDevices.IHasCompleted, IHasGetPassed + { + private static readonly ILog log = LogManager.GetLogger(typeof(ManualPulsesForm24)); + + const int MaxWMsCount = 24; /// Implementation limit of this form + + /// + /// Updated in constructor + /// + readonly int waterMetersCount; /// Number of text boxes for serial numbers + readonly bool[] disabled; + int textBoxesCount; + Label[] labels; + CheckBox[] pulsesCountOKCheckBox; + + /// + /// Result of manual pulses test + /// + bool[] passed; + public bool GetPassed(int i) { return (i >= 0 && i < passed.Length) ? passed[i] : false; } + + /// + /// Updated in OnAdjustmentInProgress() + /// + double[] pulsesCount; /// Created in constructor + double minPulsesCount; + + /// + /// Set to 'true' when the form closes + /// + public bool Completed { get { return completed; } } + bool completed; + + + /// Parameterless constructor for 3 watermeters + public ManualPulsesForm24() + { + InitializeComponent(); + ControlBox = false; + + textBoxesCount = MaxWMsCount; + + labels = new Label[MaxWMsCount] + { + wmPulsesCountLabel1, wmPulsesCountLabel2, wmPulsesCountLabel3, wmPulsesCountLabel4, + wmPulsesCountLabel5, wmPulsesCountLabel6, wmPulsesCountLabel7, wmPulsesCountLabel8, + wmPulsesCountLabel9, wmPulsesCountLabel10, wmPulsesCountLabel11, wmPulsesCountLabel12, + wmPulsesCountLabel13, wmPulsesCountLabel14, wmPulsesCountLabel15, wmPulsesCountLabel16, + wmPulsesCountLabel17, wmPulsesCountLabel18, wmPulsesCountLabel19, wmPulsesCountLabel20, + wmPulsesCountLabel21, wmPulsesCountLabel22, wmPulsesCountLabel23, wmPulsesCountLabel24, + }; + pulsesCountOKCheckBox = new CheckBox[MaxWMsCount] + { + pulsesCountOKCheckBox1, pulsesCountOKCheckBox2, pulsesCountOKCheckBox3, pulsesCountOKCheckBox4, + pulsesCountOKCheckBox5, pulsesCountOKCheckBox6, pulsesCountOKCheckBox7, pulsesCountOKCheckBox8, + pulsesCountOKCheckBox9, pulsesCountOKCheckBox10, pulsesCountOKCheckBox11, pulsesCountOKCheckBox12, + pulsesCountOKCheckBox13, pulsesCountOKCheckBox14, pulsesCountOKCheckBox15, pulsesCountOKCheckBox16, + pulsesCountOKCheckBox17, pulsesCountOKCheckBox18, pulsesCountOKCheckBox19, pulsesCountOKCheckBox20, + pulsesCountOKCheckBox21, pulsesCountOKCheckBox22, pulsesCountOKCheckBox23, pulsesCountOKCheckBox24, + }; + + completed = false; + minPulsesCount = 1; /// Must be >0 so that initially the indication is RED + } + + /// + /// Constructor + /// + /// Number of text boxes for serial numbers + public ManualPulsesForm24(IList waterMeters) + : this() + { + waterMetersCount = waterMeters.Count; + + ShuffleTextBoxes(waterMetersCount, Config.Data.LineSize); + + disabled = new bool[waterMetersCount]; + passed = new bool[waterMetersCount]; + for (int i = 0; i < waterMetersCount; i++) + { + disabled[i] = waterMeters[i].Disabled; + passed[i] = false; + } + } + + + /// + /// Make sure the layout of labels/text boxes on the screen + /// corresponds to the layout of watermeters of the test bench. + /// + /// Number of watermeters + /// Number of watermeters in one line + void ShuffleTextBoxes(int wmsCount, int lineSize) + { + if (wmsCount < textBoxesCount && lineSize > 0) + { + int nrLines = (wmsCount + lineSize - 1) / lineSize; + int gap = (textBoxesCount - wmsCount) / nrLines; + + int dest = 0; + for (int l = 0; l < nrLines; l++) + { + for (int i = 0; i < lineSize; i++) + { + labels[dest] = labels[l * lineSize + l * gap + i]; + pulsesCountOKCheckBox[dest] = pulsesCountOKCheckBox[l * lineSize + l * gap + i]; + dest++; + } + } + textBoxesCount = wmsCount; + } + } + + + void Localize() + { + Text = Strings.Water_Meter_States; + for (int i = 0; i < textBoxesCount; i++) + { + labels[i].Text = string.Format("{0} {1}", Strings.Water_Meter, i + 1); + pulsesCountOKCheckBox[i].Text = Strings.Pulses_count_is_OK; + } + okButton.Text = Strings.OkBtnText; + } + + private void WMPulsesForm24_Load(object sender, EventArgs e) + { + Localize(); + + //Height = 50 + 90 * WaterMetersCount; + + for (int i = 0; i < textBoxesCount; i++) + { + labels[i].Visible = (disabled == null || i >= disabled.Length || !disabled[i]); + pulsesCountOKCheckBox[i].Visible = (disabled == null || i >= disabled.Length || !disabled[i]); + pulsesCountOKCheckBox[i].Checked = false; + } + } + + private void okButton_Click(object sender, EventArgs e) + { + int count = Math.Min(waterMetersCount, TBF.BenchControl.Sequences.ProcessData.BatchRslts.WMPositionsCount); + for (int i = 0; i < count; i++) + { + passed[i] = pulsesCountOKCheckBox[i].Checked; + } + + completed = true; + Close(); + } + + #region Forced close handling + + public void StartForceCloseHandler() + { + UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args) + { + if (InvokeRequired) { Invoke(new EventHandler(OnForceClose), sender, args); } + else OnForceClose(sender, args); + }; + } + + void OnForceClose(object sender, EventArgs args) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + #endregion + } +} diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.designer.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.designer.cs new file mode 100644 index 000000000..70a84222c --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.designer.cs @@ -0,0 +1,744 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + partial class ManualPulsesForm24 + { + /// + /// 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.wmPulsesCountLabel2 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel1 = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.wmPulsesCountLabel3 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel4 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel5 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel6 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel7 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel8 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel9 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel10 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel12 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel11 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel24 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel23 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel22 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel21 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel20 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel19 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel18 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel17 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel16 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel15 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel14 = new System.Windows.Forms.Label(); + this.wmPulsesCountLabel13 = new System.Windows.Forms.Label(); + this.pulsesCountOKCheckBox1 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox12 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox11 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox10 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox9 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox8 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox7 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox6 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox5 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox4 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox3 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox2 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox13 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox14 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox15 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox16 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox17 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox18 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox19 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox20 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox21 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox22 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox23 = new System.Windows.Forms.CheckBox(); + this.pulsesCountOKCheckBox24 = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // wmPulsesCountLabel2 + // + this.wmPulsesCountLabel2.AutoSize = true; + this.wmPulsesCountLabel2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel2.Location = new System.Drawing.Point(33, 85); + this.wmPulsesCountLabel2.Name = "wmPulsesCountLabel2"; + this.wmPulsesCountLabel2.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel2.TabIndex = 0; + this.wmPulsesCountLabel2.Text = "Pulses count"; + this.wmPulsesCountLabel2.Visible = false; + // + // wmPulsesCountLabel1 + // + this.wmPulsesCountLabel1.AutoSize = true; + this.wmPulsesCountLabel1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel1.Location = new System.Drawing.Point(33, 39); + this.wmPulsesCountLabel1.Name = "wmPulsesCountLabel1"; + this.wmPulsesCountLabel1.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel1.TabIndex = 0; + this.wmPulsesCountLabel1.Text = "Pulses count"; + this.wmPulsesCountLabel1.Visible = false; + // + // 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(1157, 28); + 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); + // + // wmPulsesCountLabel3 + // + this.wmPulsesCountLabel3.AutoSize = true; + this.wmPulsesCountLabel3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel3.Location = new System.Drawing.Point(33, 131); + this.wmPulsesCountLabel3.Name = "wmPulsesCountLabel3"; + this.wmPulsesCountLabel3.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel3.TabIndex = 0; + this.wmPulsesCountLabel3.Text = "Pulses count"; + this.wmPulsesCountLabel3.Visible = false; + // + // wmPulsesCountLabel4 + // + this.wmPulsesCountLabel4.AutoSize = true; + this.wmPulsesCountLabel4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel4.Location = new System.Drawing.Point(33, 177); + this.wmPulsesCountLabel4.Name = "wmPulsesCountLabel4"; + this.wmPulsesCountLabel4.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel4.TabIndex = 0; + this.wmPulsesCountLabel4.Text = "Pulses count"; + this.wmPulsesCountLabel4.Visible = false; + // + // wmPulsesCountLabel5 + // + this.wmPulsesCountLabel5.AutoSize = true; + this.wmPulsesCountLabel5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel5.Location = new System.Drawing.Point(33, 224); + this.wmPulsesCountLabel5.Name = "wmPulsesCountLabel5"; + this.wmPulsesCountLabel5.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel5.TabIndex = 0; + this.wmPulsesCountLabel5.Text = "Pulses count"; + this.wmPulsesCountLabel5.Visible = false; + // + // wmPulsesCountLabel6 + // + this.wmPulsesCountLabel6.AutoSize = true; + this.wmPulsesCountLabel6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel6.Location = new System.Drawing.Point(33, 271); + this.wmPulsesCountLabel6.Name = "wmPulsesCountLabel6"; + this.wmPulsesCountLabel6.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel6.TabIndex = 0; + this.wmPulsesCountLabel6.Text = "Pulses count"; + this.wmPulsesCountLabel6.Visible = false; + // + // wmPulsesCountLabel7 + // + this.wmPulsesCountLabel7.AutoSize = true; + this.wmPulsesCountLabel7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel7.Location = new System.Drawing.Point(33, 317); + this.wmPulsesCountLabel7.Name = "wmPulsesCountLabel7"; + this.wmPulsesCountLabel7.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel7.TabIndex = 8; + this.wmPulsesCountLabel7.Text = "Pulses count"; + this.wmPulsesCountLabel7.Visible = false; + // + // wmPulsesCountLabel8 + // + this.wmPulsesCountLabel8.AutoSize = true; + this.wmPulsesCountLabel8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel8.Location = new System.Drawing.Point(33, 363); + this.wmPulsesCountLabel8.Name = "wmPulsesCountLabel8"; + this.wmPulsesCountLabel8.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel8.TabIndex = 10; + this.wmPulsesCountLabel8.Text = "Pulses count"; + this.wmPulsesCountLabel8.Visible = false; + // + // wmPulsesCountLabel9 + // + this.wmPulsesCountLabel9.AutoSize = true; + this.wmPulsesCountLabel9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel9.Location = new System.Drawing.Point(33, 408); + this.wmPulsesCountLabel9.Name = "wmPulsesCountLabel9"; + this.wmPulsesCountLabel9.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel9.TabIndex = 12; + this.wmPulsesCountLabel9.Text = "Pulses count"; + this.wmPulsesCountLabel9.Visible = false; + // + // wmPulsesCountLabel10 + // + this.wmPulsesCountLabel10.AutoSize = true; + this.wmPulsesCountLabel10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel10.Location = new System.Drawing.Point(33, 454); + this.wmPulsesCountLabel10.Name = "wmPulsesCountLabel10"; + this.wmPulsesCountLabel10.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel10.TabIndex = 14; + this.wmPulsesCountLabel10.Text = "Pulses count"; + this.wmPulsesCountLabel10.Visible = false; + // + // wmPulsesCountLabel12 + // + this.wmPulsesCountLabel12.AutoSize = true; + this.wmPulsesCountLabel12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel12.Location = new System.Drawing.Point(33, 546); + this.wmPulsesCountLabel12.Name = "wmPulsesCountLabel12"; + this.wmPulsesCountLabel12.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel12.TabIndex = 18; + this.wmPulsesCountLabel12.Text = "Pulses count"; + this.wmPulsesCountLabel12.Visible = false; + // + // wmPulsesCountLabel11 + // + this.wmPulsesCountLabel11.AutoSize = true; + this.wmPulsesCountLabel11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel11.Location = new System.Drawing.Point(33, 500); + this.wmPulsesCountLabel11.Name = "wmPulsesCountLabel11"; + this.wmPulsesCountLabel11.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel11.TabIndex = 16; + this.wmPulsesCountLabel11.Text = "Pulses count"; + this.wmPulsesCountLabel11.Visible = false; + // + // wmPulsesCountLabel24 + // + this.wmPulsesCountLabel24.AutoSize = true; + this.wmPulsesCountLabel24.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel24.Location = new System.Drawing.Point(589, 546); + this.wmPulsesCountLabel24.Name = "wmPulsesCountLabel24"; + this.wmPulsesCountLabel24.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel24.TabIndex = 42; + this.wmPulsesCountLabel24.Text = "Pulses count"; + this.wmPulsesCountLabel24.Visible = false; + // + // wmPulsesCountLabel23 + // + this.wmPulsesCountLabel23.AutoSize = true; + this.wmPulsesCountLabel23.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel23.Location = new System.Drawing.Point(589, 500); + this.wmPulsesCountLabel23.Name = "wmPulsesCountLabel23"; + this.wmPulsesCountLabel23.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel23.TabIndex = 40; + this.wmPulsesCountLabel23.Text = "Pulses count"; + this.wmPulsesCountLabel23.Visible = false; + // + // wmPulsesCountLabel22 + // + this.wmPulsesCountLabel22.AutoSize = true; + this.wmPulsesCountLabel22.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel22.Location = new System.Drawing.Point(589, 454); + this.wmPulsesCountLabel22.Name = "wmPulsesCountLabel22"; + this.wmPulsesCountLabel22.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel22.TabIndex = 38; + this.wmPulsesCountLabel22.Text = "Pulses count"; + this.wmPulsesCountLabel22.Visible = false; + // + // wmPulsesCountLabel21 + // + this.wmPulsesCountLabel21.AutoSize = true; + this.wmPulsesCountLabel21.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel21.Location = new System.Drawing.Point(589, 408); + this.wmPulsesCountLabel21.Name = "wmPulsesCountLabel21"; + this.wmPulsesCountLabel21.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel21.TabIndex = 36; + this.wmPulsesCountLabel21.Text = "Pulses count"; + this.wmPulsesCountLabel21.Visible = false; + // + // wmPulsesCountLabel20 + // + this.wmPulsesCountLabel20.AutoSize = true; + this.wmPulsesCountLabel20.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel20.Location = new System.Drawing.Point(589, 363); + this.wmPulsesCountLabel20.Name = "wmPulsesCountLabel20"; + this.wmPulsesCountLabel20.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel20.TabIndex = 34; + this.wmPulsesCountLabel20.Text = "Pulses count"; + this.wmPulsesCountLabel20.Visible = false; + // + // wmPulsesCountLabel19 + // + this.wmPulsesCountLabel19.AutoSize = true; + this.wmPulsesCountLabel19.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel19.Location = new System.Drawing.Point(589, 317); + this.wmPulsesCountLabel19.Name = "wmPulsesCountLabel19"; + this.wmPulsesCountLabel19.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel19.TabIndex = 32; + this.wmPulsesCountLabel19.Text = "Pulses count"; + this.wmPulsesCountLabel19.Visible = false; + // + // wmPulsesCountLabel18 + // + this.wmPulsesCountLabel18.AutoSize = true; + this.wmPulsesCountLabel18.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel18.Location = new System.Drawing.Point(589, 271); + this.wmPulsesCountLabel18.Name = "wmPulsesCountLabel18"; + this.wmPulsesCountLabel18.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel18.TabIndex = 23; + this.wmPulsesCountLabel18.Text = "Pulses count"; + this.wmPulsesCountLabel18.Visible = false; + // + // wmPulsesCountLabel17 + // + this.wmPulsesCountLabel17.AutoSize = true; + this.wmPulsesCountLabel17.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel17.Location = new System.Drawing.Point(589, 224); + this.wmPulsesCountLabel17.Name = "wmPulsesCountLabel17"; + this.wmPulsesCountLabel17.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel17.TabIndex = 22; + this.wmPulsesCountLabel17.Text = "Pulses count"; + this.wmPulsesCountLabel17.Visible = false; + // + // wmPulsesCountLabel16 + // + this.wmPulsesCountLabel16.AutoSize = true; + this.wmPulsesCountLabel16.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel16.Location = new System.Drawing.Point(589, 177); + this.wmPulsesCountLabel16.Name = "wmPulsesCountLabel16"; + this.wmPulsesCountLabel16.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel16.TabIndex = 21; + this.wmPulsesCountLabel16.Text = "Pulses count"; + this.wmPulsesCountLabel16.Visible = false; + // + // wmPulsesCountLabel15 + // + this.wmPulsesCountLabel15.AutoSize = true; + this.wmPulsesCountLabel15.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel15.Location = new System.Drawing.Point(589, 131); + this.wmPulsesCountLabel15.Name = "wmPulsesCountLabel15"; + this.wmPulsesCountLabel15.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel15.TabIndex = 20; + this.wmPulsesCountLabel15.Text = "Pulses count"; + this.wmPulsesCountLabel15.Visible = false; + // + // wmPulsesCountLabel14 + // + this.wmPulsesCountLabel14.AutoSize = true; + this.wmPulsesCountLabel14.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel14.Location = new System.Drawing.Point(589, 85); + this.wmPulsesCountLabel14.Name = "wmPulsesCountLabel14"; + this.wmPulsesCountLabel14.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel14.TabIndex = 25; + this.wmPulsesCountLabel14.Text = "Pulses count"; + this.wmPulsesCountLabel14.Visible = false; + // + // wmPulsesCountLabel13 + // + this.wmPulsesCountLabel13.AutoSize = true; + this.wmPulsesCountLabel13.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.wmPulsesCountLabel13.Location = new System.Drawing.Point(589, 39); + this.wmPulsesCountLabel13.Name = "wmPulsesCountLabel13"; + this.wmPulsesCountLabel13.Size = new System.Drawing.Size(130, 23); + this.wmPulsesCountLabel13.TabIndex = 24; + this.wmPulsesCountLabel13.Text = "Pulses count"; + this.wmPulsesCountLabel13.Visible = false; + // + // pulsesCountOKCheckBox1 + // + this.pulsesCountOKCheckBox1.AutoSize = true; + this.pulsesCountOKCheckBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox1.Location = new System.Drawing.Point(198, 35); + this.pulsesCountOKCheckBox1.Name = "pulsesCountOKCheckBox1"; + this.pulsesCountOKCheckBox1.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox1.TabIndex = 44; + this.pulsesCountOKCheckBox1.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox1.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox12 + // + this.pulsesCountOKCheckBox12.AutoSize = true; + this.pulsesCountOKCheckBox12.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox12.Location = new System.Drawing.Point(198, 542); + this.pulsesCountOKCheckBox12.Name = "pulsesCountOKCheckBox12"; + this.pulsesCountOKCheckBox12.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox12.TabIndex = 55; + this.pulsesCountOKCheckBox12.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox12.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox11 + // + this.pulsesCountOKCheckBox11.AutoSize = true; + this.pulsesCountOKCheckBox11.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox11.Location = new System.Drawing.Point(198, 496); + this.pulsesCountOKCheckBox11.Name = "pulsesCountOKCheckBox11"; + this.pulsesCountOKCheckBox11.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox11.TabIndex = 54; + this.pulsesCountOKCheckBox11.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox11.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox10 + // + this.pulsesCountOKCheckBox10.AutoSize = true; + this.pulsesCountOKCheckBox10.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox10.Location = new System.Drawing.Point(198, 450); + this.pulsesCountOKCheckBox10.Name = "pulsesCountOKCheckBox10"; + this.pulsesCountOKCheckBox10.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox10.TabIndex = 53; + this.pulsesCountOKCheckBox10.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox10.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox9 + // + this.pulsesCountOKCheckBox9.AutoSize = true; + this.pulsesCountOKCheckBox9.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox9.Location = new System.Drawing.Point(198, 404); + this.pulsesCountOKCheckBox9.Name = "pulsesCountOKCheckBox9"; + this.pulsesCountOKCheckBox9.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox9.TabIndex = 52; + this.pulsesCountOKCheckBox9.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox9.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox8 + // + this.pulsesCountOKCheckBox8.AutoSize = true; + this.pulsesCountOKCheckBox8.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox8.Location = new System.Drawing.Point(198, 359); + this.pulsesCountOKCheckBox8.Name = "pulsesCountOKCheckBox8"; + this.pulsesCountOKCheckBox8.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox8.TabIndex = 51; + this.pulsesCountOKCheckBox8.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox8.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox7 + // + this.pulsesCountOKCheckBox7.AutoSize = true; + this.pulsesCountOKCheckBox7.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox7.Location = new System.Drawing.Point(198, 313); + this.pulsesCountOKCheckBox7.Name = "pulsesCountOKCheckBox7"; + this.pulsesCountOKCheckBox7.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox7.TabIndex = 50; + this.pulsesCountOKCheckBox7.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox7.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox6 + // + this.pulsesCountOKCheckBox6.AutoSize = true; + this.pulsesCountOKCheckBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox6.Location = new System.Drawing.Point(198, 267); + this.pulsesCountOKCheckBox6.Name = "pulsesCountOKCheckBox6"; + this.pulsesCountOKCheckBox6.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox6.TabIndex = 49; + this.pulsesCountOKCheckBox6.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox6.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox5 + // + this.pulsesCountOKCheckBox5.AutoSize = true; + this.pulsesCountOKCheckBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox5.Location = new System.Drawing.Point(198, 220); + this.pulsesCountOKCheckBox5.Name = "pulsesCountOKCheckBox5"; + this.pulsesCountOKCheckBox5.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox5.TabIndex = 48; + this.pulsesCountOKCheckBox5.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox5.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox4 + // + this.pulsesCountOKCheckBox4.AutoSize = true; + this.pulsesCountOKCheckBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox4.Location = new System.Drawing.Point(198, 173); + this.pulsesCountOKCheckBox4.Name = "pulsesCountOKCheckBox4"; + this.pulsesCountOKCheckBox4.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox4.TabIndex = 47; + this.pulsesCountOKCheckBox4.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox4.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox3 + // + this.pulsesCountOKCheckBox3.AutoSize = true; + this.pulsesCountOKCheckBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox3.Location = new System.Drawing.Point(198, 127); + this.pulsesCountOKCheckBox3.Name = "pulsesCountOKCheckBox3"; + this.pulsesCountOKCheckBox3.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox3.TabIndex = 46; + this.pulsesCountOKCheckBox3.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox3.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox2 + // + this.pulsesCountOKCheckBox2.AutoSize = true; + this.pulsesCountOKCheckBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox2.Location = new System.Drawing.Point(198, 81); + this.pulsesCountOKCheckBox2.Name = "pulsesCountOKCheckBox2"; + this.pulsesCountOKCheckBox2.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox2.TabIndex = 45; + this.pulsesCountOKCheckBox2.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox2.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox13 + // + this.pulsesCountOKCheckBox13.AutoSize = true; + this.pulsesCountOKCheckBox13.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox13.Location = new System.Drawing.Point(754, 35); + this.pulsesCountOKCheckBox13.Name = "pulsesCountOKCheckBox13"; + this.pulsesCountOKCheckBox13.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox13.TabIndex = 56; + this.pulsesCountOKCheckBox13.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox13.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox14 + // + this.pulsesCountOKCheckBox14.AutoSize = true; + this.pulsesCountOKCheckBox14.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox14.Location = new System.Drawing.Point(754, 81); + this.pulsesCountOKCheckBox14.Name = "pulsesCountOKCheckBox14"; + this.pulsesCountOKCheckBox14.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox14.TabIndex = 57; + this.pulsesCountOKCheckBox14.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox14.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox15 + // + this.pulsesCountOKCheckBox15.AutoSize = true; + this.pulsesCountOKCheckBox15.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox15.Location = new System.Drawing.Point(754, 127); + this.pulsesCountOKCheckBox15.Name = "pulsesCountOKCheckBox15"; + this.pulsesCountOKCheckBox15.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox15.TabIndex = 58; + this.pulsesCountOKCheckBox15.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox15.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox16 + // + this.pulsesCountOKCheckBox16.AutoSize = true; + this.pulsesCountOKCheckBox16.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox16.Location = new System.Drawing.Point(754, 173); + this.pulsesCountOKCheckBox16.Name = "pulsesCountOKCheckBox16"; + this.pulsesCountOKCheckBox16.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox16.TabIndex = 59; + this.pulsesCountOKCheckBox16.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox16.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox17 + // + this.pulsesCountOKCheckBox17.AutoSize = true; + this.pulsesCountOKCheckBox17.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox17.Location = new System.Drawing.Point(754, 220); + this.pulsesCountOKCheckBox17.Name = "pulsesCountOKCheckBox17"; + this.pulsesCountOKCheckBox17.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox17.TabIndex = 60; + this.pulsesCountOKCheckBox17.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox17.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox18 + // + this.pulsesCountOKCheckBox18.AutoSize = true; + this.pulsesCountOKCheckBox18.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox18.Location = new System.Drawing.Point(754, 267); + this.pulsesCountOKCheckBox18.Name = "pulsesCountOKCheckBox18"; + this.pulsesCountOKCheckBox18.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox18.TabIndex = 61; + this.pulsesCountOKCheckBox18.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox18.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox19 + // + this.pulsesCountOKCheckBox19.AutoSize = true; + this.pulsesCountOKCheckBox19.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox19.Location = new System.Drawing.Point(754, 313); + this.pulsesCountOKCheckBox19.Name = "pulsesCountOKCheckBox19"; + this.pulsesCountOKCheckBox19.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox19.TabIndex = 62; + this.pulsesCountOKCheckBox19.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox19.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox20 + // + this.pulsesCountOKCheckBox20.AutoSize = true; + this.pulsesCountOKCheckBox20.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox20.Location = new System.Drawing.Point(754, 359); + this.pulsesCountOKCheckBox20.Name = "pulsesCountOKCheckBox20"; + this.pulsesCountOKCheckBox20.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox20.TabIndex = 63; + this.pulsesCountOKCheckBox20.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox20.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox21 + // + this.pulsesCountOKCheckBox21.AutoSize = true; + this.pulsesCountOKCheckBox21.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox21.Location = new System.Drawing.Point(754, 404); + this.pulsesCountOKCheckBox21.Name = "pulsesCountOKCheckBox21"; + this.pulsesCountOKCheckBox21.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox21.TabIndex = 64; + this.pulsesCountOKCheckBox21.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox21.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox22 + // + this.pulsesCountOKCheckBox22.AutoSize = true; + this.pulsesCountOKCheckBox22.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox22.Location = new System.Drawing.Point(754, 450); + this.pulsesCountOKCheckBox22.Name = "pulsesCountOKCheckBox22"; + this.pulsesCountOKCheckBox22.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox22.TabIndex = 65; + this.pulsesCountOKCheckBox22.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox22.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox23 + // + this.pulsesCountOKCheckBox23.AutoSize = true; + this.pulsesCountOKCheckBox23.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox23.Location = new System.Drawing.Point(754, 496); + this.pulsesCountOKCheckBox23.Name = "pulsesCountOKCheckBox23"; + this.pulsesCountOKCheckBox23.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox23.TabIndex = 66; + this.pulsesCountOKCheckBox23.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox23.UseVisualStyleBackColor = true; + // + // pulsesCountOKCheckBox24 + // + this.pulsesCountOKCheckBox24.AutoSize = true; + this.pulsesCountOKCheckBox24.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.pulsesCountOKCheckBox24.Location = new System.Drawing.Point(754, 542); + this.pulsesCountOKCheckBox24.Name = "pulsesCountOKCheckBox24"; + this.pulsesCountOKCheckBox24.Size = new System.Drawing.Size(207, 27); + this.pulsesCountOKCheckBox24.TabIndex = 67; + this.pulsesCountOKCheckBox24.Text = "Pulses count is OK"; + this.pulsesCountOKCheckBox24.UseVisualStyleBackColor = true; + // + // ManualPulsesForm24 + // + 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(1267, 592); + this.Controls.Add(this.pulsesCountOKCheckBox24); + this.Controls.Add(this.pulsesCountOKCheckBox23); + this.Controls.Add(this.pulsesCountOKCheckBox22); + this.Controls.Add(this.pulsesCountOKCheckBox21); + this.Controls.Add(this.pulsesCountOKCheckBox20); + this.Controls.Add(this.pulsesCountOKCheckBox19); + this.Controls.Add(this.pulsesCountOKCheckBox18); + this.Controls.Add(this.pulsesCountOKCheckBox17); + this.Controls.Add(this.pulsesCountOKCheckBox16); + this.Controls.Add(this.pulsesCountOKCheckBox15); + this.Controls.Add(this.pulsesCountOKCheckBox14); + this.Controls.Add(this.pulsesCountOKCheckBox13); + this.Controls.Add(this.pulsesCountOKCheckBox12); + this.Controls.Add(this.pulsesCountOKCheckBox11); + this.Controls.Add(this.pulsesCountOKCheckBox10); + this.Controls.Add(this.pulsesCountOKCheckBox9); + this.Controls.Add(this.pulsesCountOKCheckBox8); + this.Controls.Add(this.pulsesCountOKCheckBox7); + this.Controls.Add(this.pulsesCountOKCheckBox6); + this.Controls.Add(this.pulsesCountOKCheckBox5); + this.Controls.Add(this.pulsesCountOKCheckBox4); + this.Controls.Add(this.pulsesCountOKCheckBox3); + this.Controls.Add(this.pulsesCountOKCheckBox2); + this.Controls.Add(this.pulsesCountOKCheckBox1); + this.Controls.Add(this.wmPulsesCountLabel24); + this.Controls.Add(this.wmPulsesCountLabel23); + this.Controls.Add(this.wmPulsesCountLabel22); + this.Controls.Add(this.wmPulsesCountLabel21); + this.Controls.Add(this.wmPulsesCountLabel20); + this.Controls.Add(this.wmPulsesCountLabel19); + this.Controls.Add(this.wmPulsesCountLabel18); + this.Controls.Add(this.wmPulsesCountLabel17); + this.Controls.Add(this.wmPulsesCountLabel16); + this.Controls.Add(this.wmPulsesCountLabel15); + this.Controls.Add(this.wmPulsesCountLabel14); + this.Controls.Add(this.wmPulsesCountLabel13); + this.Controls.Add(this.wmPulsesCountLabel12); + this.Controls.Add(this.wmPulsesCountLabel11); + this.Controls.Add(this.wmPulsesCountLabel10); + this.Controls.Add(this.wmPulsesCountLabel9); + this.Controls.Add(this.wmPulsesCountLabel8); + this.Controls.Add(this.wmPulsesCountLabel7); + this.Controls.Add(this.wmPulsesCountLabel6); + this.Controls.Add(this.wmPulsesCountLabel5); + this.Controls.Add(this.wmPulsesCountLabel4); + this.Controls.Add(this.wmPulsesCountLabel3); + this.Controls.Add(this.wmPulsesCountLabel2); + this.Controls.Add(this.wmPulsesCountLabel1); + this.Controls.Add(this.okButton); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "ManualPulsesForm24"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Water Meter States"; + this.TopMost = true; + this.Load += new System.EventHandler(this.WMPulsesForm24_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label wmPulsesCountLabel2; + private System.Windows.Forms.Label wmPulsesCountLabel1; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Label wmPulsesCountLabel3; + private System.Windows.Forms.Label wmPulsesCountLabel4; + private System.Windows.Forms.Label wmPulsesCountLabel5; + private System.Windows.Forms.Label wmPulsesCountLabel6; + private System.Windows.Forms.Label wmPulsesCountLabel7; + private System.Windows.Forms.Label wmPulsesCountLabel8; + private System.Windows.Forms.Label wmPulsesCountLabel9; + private System.Windows.Forms.Label wmPulsesCountLabel10; + private System.Windows.Forms.Label wmPulsesCountLabel12; + private System.Windows.Forms.Label wmPulsesCountLabel11; + private System.Windows.Forms.Label wmPulsesCountLabel24; + private System.Windows.Forms.Label wmPulsesCountLabel23; + private System.Windows.Forms.Label wmPulsesCountLabel22; + private System.Windows.Forms.Label wmPulsesCountLabel21; + private System.Windows.Forms.Label wmPulsesCountLabel20; + private System.Windows.Forms.Label wmPulsesCountLabel19; + private System.Windows.Forms.Label wmPulsesCountLabel18; + private System.Windows.Forms.Label wmPulsesCountLabel17; + private System.Windows.Forms.Label wmPulsesCountLabel16; + private System.Windows.Forms.Label wmPulsesCountLabel15; + private System.Windows.Forms.Label wmPulsesCountLabel14; + private System.Windows.Forms.Label wmPulsesCountLabel13; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox1; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox12; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox11; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox10; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox9; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox8; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox7; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox6; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox5; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox4; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox3; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox2; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox13; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox14; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox15; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox16; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox17; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox18; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox19; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox20; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox21; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox22; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox23; + private System.Windows.Forms.CheckBox pulsesCountOKCheckBox24; + + } +} \ No newline at end of file diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.resx b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/ManualPulsesForm24.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/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs new file mode 100644 index 000000000..05ee85af5 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/PulsesTestManualSeq.cs @@ -0,0 +1,499 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.Text; +using log4net; +using Config.Entities; +using TBF.BenchControl; +using TBF.Boxes; +using TBF.Resources; +using TBF.UiBridge; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + public class PulseTestManualSeq : Sequences.SequenceBase + { + private static readonly ILog log = LogManager.GetLogger(typeof(PulseTestManualSeq)); + + System.Windows.Forms.Form modelessDlg; + /// + delegate void ErrorsFormDlgt(PulseTestManualSeq myRef, IList waterMeters); + /// + void OpenWMErrorsForm(PulseTestManualSeq myRef, IList waterMeters) + { +#pragma warning disable 162 /// Disables 'Unreachable code detected' warning + + if (Config.Data.WMsCount > 12) + { + myRef.modelessDlg = new ManualPulsesForm24(waterMeters); + } + else if (Config.Data.WMsCount > 6) + { + myRef.modelessDlg = new ManualPulsesForm12(waterMeters); + } + else + { + myRef.modelessDlg = new ManualPulsesForm(waterMeters); + } + +#pragma warning restore 162 /// Disables 'Unreachable code detected' warning + + modelessDlg.Show(); + } + + /// + /// Adjustment 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(Test test, int repetitionNr, bool isLastRepetition, DebugMode mode) + { + float simulatedError = 4.5f; /// % + + 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); + + int rangeIx = 0; /// Default range, used for non-Elde flowmeters + if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter) + { + Elde.FlowMeter.FlowMeter eldeFM = outPath.FlowMeter as Elde.FlowMeter.FlowMeter; + rangeIx = -1; /// Indicates invalid range + for (int r = 0; r <= 5; r++) + { + if (eldeFM.RangeEnabled(r) && eldeFM.GetTempLo(r) <= test.TempLimLo + && eldeFM.GetTempHi(r) >= test.TempLimHi) + { + rangeIx = r; + } + } + + if (rangeIx == -1) + { + Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions); + retVal = Event.UiCmdStop; + goto stopTestWOStoppingDivGateEtc; + } + } + + processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false); + + /// Start the test, initialize test results + Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses)); + string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr); + TestStartTime = DateTime.Now; + + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + int flowSetTime0 = StateMachine.Time; + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Starting_the_pump); + //------------------------------------------------ + if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower); + /// + State.Create("Adjustment : Starting the pump") + .AddOperation(checkUiOp) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) +// .AddOperation(new Operations.SetAllRegulValvesOp(inPath.RegulValves, inPath.RegulValvesPct, 60)) + .AddOperation(inPath.Pump != null ? cBrd.SetValvesOp(inPath.Pump, null) : null) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + + } + while (e.Contains(Event.ValvesBusy) /* || !e.Contains(Event.AllPositionsReached)*/); + + + if (test.TimePump2StartV > 0) + { + State.Create(string.Format("{0}({1}) : Waiting after the pump started", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(test.TimePump2StartV)) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + } + + + if (benchPath.StopBFValve != null) + { + State.Create(string.Format("{0}({1}) : Opening the stop backflow valve", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperation(StateMachine.ControlBoard.SetValvesOp(benchPath.StopBFValve, null)) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + } + while (!e.Contains(Event.ValvesSet)); + } + + + if (test.TimeBeforeFlow > 0) + { + State.Create(string.Format("{0}({1}) : Waiting before flow setting process starts", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(test.TimeBeforeFlow)) + .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + } + + + setting_flow: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Setting_the_flow); + //------------------------------------------------ + 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(); + Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); + + if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; } + if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } + if (e.Contains(Event.RegulValveTimeOut)) + { + Bridge.OnError(this, Strings.Flow_adjustment_failed); + retVal = Event.UiCmdStop; + goto stopTest; + } + if (e.Contains(Event.Next)) goto flow_set; + } + while (!e.Contains(Event.FlowReached)); + + flow_set: + + int flowSetTime = StateMachine.Time - flowSetTime0; + + if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null) + { + //--------------------------------------------------- + Bridge.OnActivity(this, Strings.Setting_temperature); + //--------------------------------------------------- + + State.Create(string.Format("{0}({1}) : Wait until the water temperature is within limits", test.Method, test.Name)) + .AddOperation(checkUiOp) + .AddOperation(benchPath.TempMtrUp.ReadTempOp(ref TempUp)) + .AddOperation(benchPath.TempMtrDown.ReadTempOp(ref TempDown)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + if (e.Contains(Event.Next)) goto temperature_set; + + if (TempUp.Val >= test.TempLimLo && TempUp.Val <= test.TempLimHi && + TempDown.Val >= test.TempLimLo && TempDown.Val <= test.TempLimHi) + { + goto temperature_set; + } + } + while (true); + } + + temperature_set: + + /// Show the modeless dialog with error indication + Program.MainWnd.Invoke(new ErrorsFormDlgt(OpenWMErrorsForm), new object[] { this, WaterMeters }); + + loop: + int time = StateMachine.Time; + double currentFlow = RefFlow.Val; + + + /// + /// Prepare cameras, ROI-s and measurementOperations + /// + + /// Find ROI-s + int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; + IList rois = new List(); + foreach (var rr in sensPath.RegisterReaders) + { + TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader; + if (regr != null) + { + if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; } + } + + GenericDevices.IRoi roi = rr as GenericDevices.IRoi; + if (roi != null && roi.Detected) + { + rois.Add(roi); + } + } + + /// Find cameras + IList cameras = new List(); + foreach (var roi in rois) + { + if (roi.Camera != null && !cameras.Contains(roi.Camera)) + { + roi.Camera.ClearRoiParams(); + cameras.Add(roi.Camera); + } + } + + /// Register ROI-parameters to cameras + foreach (var roi in rois) roi.RegisterRoiToCamera(); + + /// Prepare measurementOperations + IList measureOperations = new List(); + foreach (var camera in cameras) measureOperations.Add(camera.MeasurementOp()); + + + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Test_in_progress); + //------------------------------------------------ + if (mode == Config.Entities.DebugMode.Simulate) + { + /// TODO: Reimplement + //tstRslt = MakeSimulated(test, 1, simulatedError); + simulatedError *= 0.6f; + + State.Create("Adjustment : Simulating the test") + .AddOperation(checkUiOp) + .AddOperation(new Operations.TimerOp(5)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.TimerExpired)); + } + else + { + State.Create("Adjustment : Starting the test") + .AddOperation(checkUiOp) + .AddOperations(measureOperations) + .AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro, + test.Qfrom, test.Qto, totalPulses, filters)) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test,e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.MeasurementStarted)); + + /// Measurement loop - preparation + readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders); + queryEnd1 = cBrd.QueryMeasurementEndOp(); + queryEnd2 = cBrd.QueryMeasurementEndOp(); + + StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr); + + /// 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; + } + + RefFreq.Val = cBrd.ReferenceFreq; + RefFlow.Val = cBrd.ReferenceFlow; + UpdateAllStatistics(StateMachine.Time); + + Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); + } + /// Measurement loop - end + + one_test_completed: + + //------------------------------------------------ + Bridge.OnActivity(this, Strings.Adjustment_in_progress); + //------------------------------------------------ + + TestEndTime = DateTime.Now; + + /// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results + if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest; + + /// + /// Populate TestResult data entity with data + /// + Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part); + + if (tstRslt != null) + { + UpdateTempPressDensAmb(tstRslt); + + /// Main results + tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName; + tstRslt.StartTime = TestStartTime; + tstRslt.EndTime = TestEndTime; + tstRslt.FlowSetTime = flowSetTime; + tstRslt.TestTime = cBrd.TTime; /// [s] measurement time + tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total) + tstRslt.MassStart = 0; + tstRslt.MassEnd = 0; + tstRslt.FlowMass = 0; /// [kg/h] + tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h] + tstRslt.Buoyancy = Config.Formulas.Buoyancy(); + tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter + tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter + tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement + + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowStart = (float)RefFlowStat.First; + tstRslt.FlowEnd = (float)RefFlowStat.Last; + tstRslt.FlowMin = (float)RefFlowStat.Min; + tstRslt.FlowMax = (float)RefFlowStat.Max; + + tstRslt.DiverterStart = 0; + tstRslt.DiverterEnd = 0; + tstRslt.ErrorFlagsMd = (ErrorFlagsComp != null) ? (sbyte)ErrorFlagsComp.Mode : (sbyte)0; + tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, false, 0, 0) : 0; + + for (int i = 0; i < BatchRslts.WMPositionsCount; i++) + { + if (test.Part != 0 && test.Part != Utils.PartNr(i + 1, BatchRslts.Batch.Compound)) continue; + + Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single); + GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[i]; + + if (meterRslt != null && regReader != null) + { + meterRslt.RegReaderType = (int)regReader.RegisterReaderType; + meterRslt.PulsesPerLiter = regReader.PulsesPerLtr; + meterRslt.PulsesMeter = Convert.ToDouble(regReader.WMPulses); + meterRslt.PulsesMaster = Convert.ToDouble(regReader.WMRefPulses); + meterRslt.VolumeStart = 0; /// liter + meterRslt.VolumeEnd = 0; /// liter + meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter + meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter + meterRslt.TestTime = cBrd.ImpulseTime(i + 1); + meterRslt.Error = 0; + meterRslt.Passed = (modelessDlg as IHasGetPassed).GetPassed(i); + meterRslt.TestDone = true; + tstRslt.TestDone = true; + } + } + + tstRslt.Components = Results.Entities.Components + .UpdateList(BatchRslts.ComponentsList, + new Results.Entities.Components((BenchInfo != null) ? BenchInfo.TestBenchId : 1, + (BenchInfo != null) ? BenchInfo.TestBenchName : "testbench", + inPath.Pump != null ? inPath.Pump.Name : string.Empty, + outPath.FlowMeter != null ? outPath.FlowMeter.Name : string.Empty, + outPath.Scale != null ? outPath.Scale.Name : string.Empty, + outPath.RegulValve != null ? outPath.RegulValve.Name : string.Empty, + outPath.Diverter != null ? outPath.Diverter.Name : string.Empty)); + + /// Update water meter error flags + if (ErrorFlagsComp != null) + { + for (int i = 0; i < BatchRslts.WMPositionsCount; i++) + { + if (BatchRslts.WaterMeters[i] != null) + { + BatchRslts.WaterMeters[i].ErrorFlags = ErrorFlagsComp.GetWMtrErrorFlags(BatchRslts.WaterMeters[i].MeterTestRslts); + } + } + } + + /// Update results + Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName, tstRslt)); + } + /// Add data - end + } + + /// 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 + + /// Append the results to the CSV-file + allResults.Info(TestResult2CsvLine(testName, test.Part)); + + stopTest: + + /// + /// Quit this sequence + /// + if (isLastRepetition || retVal == Event.UiCmdStop || retVal == Event.OpArgumentError + || retVal == Event.Error || retVal == Event.ConfigurationError) + { + State.Create("Adjustment : Stopping diverter, gate, etc.") + .AddOperation(checkUiOp) + .AddOperation(cBrd.StopPreviousOp()) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } + } + while (!e.Contains(Event.PreviousStopped)); + } + + stopTestWOStoppingDivGateEtc: + + /// Create a list with one item 'retVal' (default is Event.Done) and return it + IList retList = new List(1); + retList.Add(retVal); + return retList; + } + } +} diff --git a/TBF/BenchControl/TestMethods/PulsesTestManual/TestMethod.cs b/TBF/BenchControl/TestMethods/PulsesTestManual/TestMethod.cs new file mode 100644 index 000000000..392009693 --- /dev/null +++ b/TBF/BenchControl/TestMethods/PulsesTestManual/TestMethod.cs @@ -0,0 +1,35 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using log4net; +using Config.Entities; +using TBF.BenchControl; + +namespace TBF.BenchControl.TestMethods.PulsesTestManual +{ + public class TestMethod : ComponentBase, GenericDevices.ITestMethod + { + private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod)); + public override string ToString() { return string.Format("TestMethods.PulsesTestManual({0})", Cfg.ToString(1)); } + + public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; } + public bool DoTransitions() { return true; } + + public TestMethod() + { + } + + public TestMethod(Generic.IComponentCfg cfg) + : base(cfg) + { + log.Debug(this.ToString()); + } + + public IList Execute(Test test, int repetNr, bool isLastRepetition) + { + return (new PulseTestManualSeq()).Execute(test, repetNr, isLastRepetition, DebugLevel); + } + } +} diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 42736512e..84ef4aa19 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.993.0")] -[assembly: AssemblyFileVersion("2.18.993.0")] +[assembly: AssemblyVersion("2.18.994.0")] +[assembly: AssemblyFileVersion("2.18.994.0")] diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index 4b682f0c9..c95f1e117 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -3165,6 +3165,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Pulses count is OK. + /// + internal static string Pulses_count_is_OK { + get { + return ResourceManager.GetString("Pulses_count_is_OK", resourceCulture); + } + } + /// /// Looks up a localized string similar to Pulses per kWh. /// diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index 491c6b8d7..3bc79d94b 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -1855,4 +1855,7 @@ Press OK when you are done. + + Pulses count is OK + \ No newline at end of file diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 52044bbcf..ede96fc85 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -1167,6 +1167,28 @@ + + + + + + Form + + + ManualPulsesForm.cs + + + Form + + + ManualPulsesForm12.cs + + + Form + + + ManualPulsesForm24.cs + @@ -2490,6 +2512,15 @@ CfgCtrl.cs + + ManualPulsesForm.cs + + + ManualPulsesForm12.cs + + + ManualPulsesForm24.cs + TestMethodCfgCtrl.cs