From 376367d0b26f3364742680c7db13103622b2352a Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 12 Jun 2015 11:47:48 +0200 Subject: [PATCH] DataEntry.Combined.TestStartEndForm (for fixed start method) added. --- TODO.txt | 2 + .../DataEntry/Combined/TestStartEndForm.cs | 422 +++++++++++++++ .../Combined/TestStartEndForm.designer.cs | 482 ++++++++++++++++++ .../DataEntry/Combined/TestStartEndForm.resx | 120 +++++ .../DataEntry/Standard/TestStartEndForm.cs | 2 +- .../Resources/Strings.Designer.cs | 18 + TestBenchFramework/Resources/Strings.resx | 6 + TestBenchFramework/TBF.csproj | 9 + 8 files changed, 1060 insertions(+), 1 deletion(-) create mode 100644 TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.cs create mode 100644 TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.designer.cs create mode 100644 TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.resx diff --git a/TODO.txt b/TODO.txt index a6bb47e82..016809313 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,3 +1,5 @@ +- vysledky z Logs do Results (podla rokov/mesiacov) + - dokoncenie process obrazovky + rozsirenie pre 12 a 24 meracov - stranka pre analyzy - vypustanie malej vahy v Toruni pred Testom !!! diff --git a/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.cs b/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.cs new file mode 100644 index 000000000..2aa61275c --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.cs @@ -0,0 +1,422 @@ +/// +/// Copyright (c) 2013-2015 Sensus Metering Systems +/// +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using log4net; +using TBF.Resources; + +namespace TBF.BenchControl.DataEntry.Combined +{ + public partial class TestStartEndForm : Form, GenericDevices.IHasCompleted + { + private static readonly ILog log = LogManager.GetLogger(typeof(TestStartEndForm)); + + // Set to 'true' when the form closes + public bool Completed { get { return completed; } } + bool completed; + + /// Number of water meters + public readonly int WaterMetersCount; /// Main + Aux water meter count as one (combined) water meter + + readonly bool[] disabled; + + // To be retrieved after the form closes + public float[] MainStartState; + public float[] AuxStartState; + + // To be retrieved after the form closes + public readonly string[] MainStartStateStr; + public readonly string[] AuxStartStateStr; + + // To be retrieved after the form closes + public float[] MainEndState; + public float[] AuxEndState; + + bool endStates; /// false=start states, true=end states + float refVolume; + float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo + float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi + + int TextBoxesCount; + /// + Label[] mainLabels; + Label[] auxLabels; + TextBox[] mainStartTextBoxes; + TextBox[] auxStartTextBoxes; + TextBox[] mainEndTextBoxes; + TextBox[] auxEndTextBoxes; + IList enabledTextBoxes; + + /// + /// Parameterless constructor initializing common part for start and endstate form + /// + public TestStartEndForm() + { + InitializeComponent(); + + TextBoxesCount = 3; + + endStates = false; + mainLabels = new Label[] { main1Label, main2Label, main3Label, }; + auxLabels = new Label[] { aux1Label, aux2Label, aux3Label, }; + mainStartTextBoxes = new TextBox[] { main1StartTextBox, main2StartTextBox, main3StartTextBox, }; + auxStartTextBoxes = new TextBox[] { aux1StartTextBox, aux2StartTextBox, aux3StartTextBox, }; + mainEndTextBoxes = new TextBox[] { main1EndTextBox, main2EndTextBox, main3EndTextBox, }; + auxEndTextBoxes = new TextBox[] { aux1EndTextBox, aux2EndTextBox, aux3EndTextBox, }; + enabledTextBoxes = new List(); + + completed = false; + StartForceCloseHandler(); + } + + /// + /// Constructor to fill in start states + /// + /// Number of water meters + /// Information from CycleBeginningForm about availability of water meters + public TestStartEndForm(int waterMetersCount, bool[] disabled) + : this() + { + endStates = false; + + this.WaterMetersCount = waterMetersCount; + this.disabled = disabled; + + ShuffleTextBoxes(); + + MainStartState = new float[waterMetersCount]; + AuxStartState = new float[waterMetersCount]; + MainStartStateStr = new string[waterMetersCount]; + AuxStartStateStr = new string[waterMetersCount]; + } + + /// + /// Constructor to fill in end states + /// + /// Number of water meters + /// Information entered on test start (main) + /// Information entered on test start (aux) + /// Information from CycleBeginningForm about availability of water meters + /// Reference volume, it is used to verify the end state, show/hide exclamation if necessary + /// Error limit low, it is used to verify the end state, show/hide exclamation if necessary + /// Error limit high, it is used to verify the end state, show/hide exclamation if necessary + public TestStartEndForm(int waterMetersCount, string[] mainStartStateStr, string[] auxStartStateStr, + bool[] disabled, float refVolume, float errLimLo, float errLimHi) + : this() + { + endStates = true; + + this.WaterMetersCount = waterMetersCount; + if (mainStartStateStr == null || mainStartStateStr.Length != waterMetersCount) + throw (new Exception("Invalid 'mainStartStateStr' argument")); + this.MainStartStateStr = mainStartStateStr; + if (auxStartStateStr == null || auxStartStateStr.Length != waterMetersCount) + throw (new Exception("Invalid 'auxStartStateStr' argument")); + this.AuxStartStateStr = auxStartStateStr; + this.disabled = disabled; + this.refVolume = refVolume; + this.warningLimLo = 2 * errLimLo; + this.warningLimHi = 2 * errLimHi; + + ShuffleTextBoxes(); + + MainEndState = new float[waterMetersCount]; + AuxEndState = new float[waterMetersCount]; + } + + /// + /// Make sure the layout of labels/text boxes on the screen + /// corresponds to the layout of watermeters of the test bench. + /// + void ShuffleTextBoxes() + { + if (Program.WMsCount / 2 < TextBoxesCount) + { + TextBoxesCount = Program.WMsCount / 2; + } + } + + private void CycleEndForm_Load(object sender, EventArgs e) + { + Localize(); + + //Height = 115 + 90 * WaterMetersCount; + + for (int i = 0; i < TextBoxesCount; i++) + { + if (i < WaterMetersCount) + { + mainLabels[i].Visible = mainStartTextBoxes[i].Visible = mainEndTextBoxes[i].Visible = true; + auxLabels[i].Visible = auxStartTextBoxes[i].Visible = auxEndTextBoxes[i].Visible = true; + } + } + if (TextBoxesCount >= 1) groupBox1.Visible = true; + if (TextBoxesCount >= 2) groupBox2.Visible = true; + if (TextBoxesCount >= 3) groupBox2.Visible = true; + + if (endStates) + { + for (int i = 0; i < TextBoxesCount; i++) + { + if (MainStartStateStr != null && i < MainStartStateStr.Length) + { + mainStartTextBoxes[i].Text = MainStartStateStr[i]; + } + if (AuxStartStateStr != null && i < AuxStartStateStr.Length) + { + auxStartTextBoxes[i].Text = AuxStartStateStr[i]; + } + + if (disabled != null && i < disabled.Length && disabled[i]) + { + mainEndTextBoxes[i].Enabled = false; + auxEndTextBoxes[i].Enabled = false; + } + else + { + mainEndTextBoxes[i].Enabled = true; + auxEndTextBoxes[i].Enabled = true; + enabledTextBoxes.Add(mainEndTextBoxes[i]); + enabledTextBoxes.Add(auxEndTextBoxes[i]); + } + } + } + else + { + for (int i = 0; i < TextBoxesCount; i++) + { + if (disabled != null && i < disabled.Length && disabled[i]) + { + mainStartTextBoxes[i].Enabled = false; + auxStartTextBoxes[i].Enabled = false; + } + else + { + mainStartTextBoxes[i].Enabled = true; + auxStartTextBoxes[i].Enabled = true; + enabledTextBoxes.Add(mainStartTextBoxes[i]); + enabledTextBoxes.Add(auxStartTextBoxes[i]); + } + } + } + } + + void Localize() + { + Text = Strings.Water_Meter_States; + groupBox1.Text = Strings.Water_Meter + " 1"; + groupBox2.Text = Strings.Water_Meter + " 2"; + groupBox2.Text = Strings.Water_Meter + " 3"; + for (int i = 0; i < TextBoxesCount; i++) + { + mainLabels[i].Text = Strings.Main_; + auxLabels[i].Text = Strings.Aux_; + } + startLabel.Text = Strings.Start; + endLabel.Text = Strings.End; + okButton.Text = Strings.OkBtnText; + } + + private void okButton_Click(object sender, EventArgs eArgs) + { + try + { + if (endStates) + { + for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++) + { + if (mainEndTextBoxes[i].Visible && mainEndTextBoxes[i].Enabled) + { + MainEndState[i] = Utils.ParseUFloat(mainEndTextBoxes[i].Text); + } + if (auxEndTextBoxes[i].Visible && auxEndTextBoxes[i].Enabled) + { + AuxEndState[i] = Utils.ParseUFloat(auxEndTextBoxes[i].Text); + } + } + } + else + { + for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++) + { + if (mainStartTextBoxes[i].Visible && mainStartTextBoxes[i].Enabled) + { + MainStartStateStr[i] = mainStartTextBoxes[i].Text; + MainStartState[i] = Utils.ParseUFloat(mainStartTextBoxes[i].Text); + } + if (auxStartTextBoxes[i].Visible && auxStartTextBoxes[i].Enabled) + { + AuxStartStateStr[i] = auxStartTextBoxes[i].Text; + AuxStartState[i] = Utils.ParseUFloat(auxStartTextBoxes[i].Text); + } + } + } + } + catch (Exception e) + { + log.ErrorFormat("Exception: {0}", e.Message); + return; + } + + 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 + + /// + /// Calculate the approximate error and verify whether it is within limits. + /// Make an exclamation mark visible if out of range. + /// Similar event handler is implemented for all main/auxEndTextBoxes (1..3). + /// + private void main1EndTextBox_TextChanged(object sender, EventArgs e) + { + //float err = 0; + //try + //{ + // float endState = Utils.ParseUFloat(main1EndTextBox.Text); + // float startState = Utils.ParseUFloat(main1StartTextBox.Text); + // err = 100.0f * (endState - startState - refVolume) / refVolume; + //} + //catch { }; + + //main1Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err); + } + + private void aux1EndTextBox_TextChanged(object sender, EventArgs e) + { + //float err = 0; + //try + //{ + // float endState = Utils.ParseUFloat(aux1EndTextBox.Text); + // float startState = Utils.ParseUFloat(aux1StartTextBox.Text); + // err = 100.0f * (endState - startState - refVolume) / refVolume; + //} + //catch { err = 1000.0f; }; + + //aux1Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err); + } + + private void main2EndTextBox_TextChanged(object sender, EventArgs e) + { + //float err = 0; + //try + //{ + // float endState = Utils.ParseUFloat(main2EndTextBox.Text); + // float startState = Utils.ParseUFloat(main2StartTextBox.Text); + // err = 100.0f * (endState - startState - refVolume) / refVolume; + //} + //catch { err = 1000.0f; }; + + //main2Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err); + } + + private void aux2EndTextBox_TextChanged(object sender, EventArgs e) + { + //float err = 0; + //try + //{ + // float endState = Utils.ParseUFloat(aux2EndTextBox.Text); + // float startState = Utils.ParseUFloat(aux2StartTextBox.Text); + // err = 100.0f * (endState - startState - refVolume) / refVolume; + //} + //catch { err = 1000.0f; }; + + //aux2Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err); + } + + private void main3EndTextBox_TextChanged(object sender, EventArgs e) + { + //float err = 0; + //try + //{ + // float endState = Utils.ParseUFloat(main3EndTextBox.Text); + // float startState = Utils.ParseUFloat(main3StartTextBox.Text); + // err = 100.0f * (endState - startState - refVolume) / refVolume; + //} + //catch { err = 1000.0f; }; + + //main3Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err); + } + + private void aux3EndTextBox_TextChanged(object sender, EventArgs e) + { + //float err = 0; + //try + //{ + // float endState = Utils.ParseUFloat(aux3EndTextBox.Text); + // float startState = Utils.ParseUFloat(aux3StartTextBox.Text); + // err = 100.0f * (endState - startState - refVolume) / refVolume; + //} + //catch { err = 1000.0f; }; + + //aux3Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err); + } + + + /// + /// Process a key press within any enabled text boxe + /// + /// + /// + /// TextBox control which received the event + private void ProcKeyPress(object sender, KeyPressEventArgs e, TextBox currentFocusOwner) + { + if (e.KeyChar == '+') + { + /// Process '+' key ..... Form completed + okButton_Click(sender, e); + } + if (e.KeyChar == '\r') + { + /// Process key ..... Next text field + if (enabledTextBoxes.Count < 2) return; /// There is just one enabled textbox + + for (int i = 0; i < enabledTextBoxes.Count; i++) + { + if (enabledTextBoxes[i] == currentFocusOwner) + { + /// Change focus to the next enabled text box + enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus(); + return; + } + } + } + } + + private void main1StartTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, main1StartTextBox); } + private void main2StartTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, main2StartTextBox); } + private void main3StartTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, main3StartTextBox); } + + private void aux1StartTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, aux1StartTextBox); } + private void aux2StartTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, aux2StartTextBox); } + private void aux3StartTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, aux3StartTextBox); } + + private void main1EndTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, main1EndTextBox); } + private void main2EndTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, main2EndTextBox); } + private void main3EndTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, main3EndTextBox); } + + private void aux1EndTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, aux1EndTextBox); } + private void aux2EndTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, aux2EndTextBox); } + private void aux3EndTextBox_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, aux3EndTextBox); } + } +} diff --git a/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.designer.cs b/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.designer.cs new file mode 100644 index 000000000..4cd8bb438 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.designer.cs @@ -0,0 +1,482 @@ +/// +/// Copyright (c) 2013-2015 Sensus Metering Systems +/// +namespace TBF.BenchControl.DataEntry.Combined +{ + partial class TestStartEndForm + { + /// + /// 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.aux1Exclamation = new System.Windows.Forms.Label(); + this.aux1StartTextBox = new System.Windows.Forms.TextBox(); + this.aux1EndTextBox = new System.Windows.Forms.TextBox(); + this.aux1Label = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.main1Exclamation = new System.Windows.Forms.Label(); + this.main1StartTextBox = new System.Windows.Forms.TextBox(); + this.main1EndTextBox = new System.Windows.Forms.TextBox(); + this.main1Label = new System.Windows.Forms.Label(); + this.okButton = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.aux2Exclamation = new System.Windows.Forms.Label(); + this.main2Exclamation = new System.Windows.Forms.Label(); + this.aux2StartTextBox = new System.Windows.Forms.TextBox(); + this.main2StartTextBox = new System.Windows.Forms.TextBox(); + this.aux2EndTextBox = new System.Windows.Forms.TextBox(); + this.aux2Label = new System.Windows.Forms.Label(); + this.main2EndTextBox = new System.Windows.Forms.TextBox(); + this.main2Label = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.aux3Exclamation = new System.Windows.Forms.Label(); + this.main3Exclamation = new System.Windows.Forms.Label(); + this.aux3StartTextBox = new System.Windows.Forms.TextBox(); + this.main3StartTextBox = new System.Windows.Forms.TextBox(); + this.aux3EndTextBox = new System.Windows.Forms.TextBox(); + this.aux3Label = new System.Windows.Forms.Label(); + this.main3EndTextBox = new System.Windows.Forms.TextBox(); + this.main3Label = new System.Windows.Forms.Label(); + this.startLabel = new System.Windows.Forms.Label(); + this.endLabel = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // aux1Exclamation + // + this.aux1Exclamation.AutoSize = true; + this.aux1Exclamation.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.aux1Exclamation.ForeColor = System.Drawing.Color.Red; + this.aux1Exclamation.Location = new System.Drawing.Point(515, 71); + this.aux1Exclamation.Name = "aux1Exclamation"; + this.aux1Exclamation.Size = new System.Drawing.Size(30, 38); + this.aux1Exclamation.TabIndex = 4; + this.aux1Exclamation.Text = "!"; + this.aux1Exclamation.Visible = false; + // + // aux1StartTextBox + // + this.aux1StartTextBox.Enabled = false; + this.aux1StartTextBox.Location = new System.Drawing.Point(164, 75); + this.aux1StartTextBox.Name = "aux1StartTextBox"; + this.aux1StartTextBox.Size = new System.Drawing.Size(163, 31); + this.aux1StartTextBox.TabIndex = 1; + this.aux1StartTextBox.Visible = false; + this.aux1StartTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1StartTextBox_KeyPress); + // + // aux1EndTextBox + // + this.aux1EndTextBox.Enabled = false; + this.aux1EndTextBox.Location = new System.Drawing.Point(350, 75); + this.aux1EndTextBox.Name = "aux1EndTextBox"; + this.aux1EndTextBox.Size = new System.Drawing.Size(163, 31); + this.aux1EndTextBox.TabIndex = 3; + this.aux1EndTextBox.Visible = false; + this.aux1EndTextBox.TextChanged += new System.EventHandler(this.aux1EndTextBox_TextChanged); + this.aux1EndTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1EndTextBox_KeyPress); + // + // aux1Label + // + this.aux1Label.AutoSize = true; + this.aux1Label.Location = new System.Drawing.Point(18, 78); + this.aux1Label.Name = "aux1Label"; + this.aux1Label.Size = new System.Drawing.Size(55, 23); + this.aux1Label.TabIndex = 0; + this.aux1Label.Text = "Aux:"; + this.aux1Label.Visible = false; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.aux1Exclamation); + this.groupBox1.Controls.Add(this.main1Exclamation); + this.groupBox1.Controls.Add(this.aux1StartTextBox); + this.groupBox1.Controls.Add(this.aux1EndTextBox); + this.groupBox1.Controls.Add(this.main1StartTextBox); + this.groupBox1.Controls.Add(this.aux1Label); + this.groupBox1.Controls.Add(this.main1EndTextBox); + this.groupBox1.Controls.Add(this.main1Label); + 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, 32); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(547, 124); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Water Meter 1"; + this.groupBox1.Visible = false; + // + // main1Exclamation + // + this.main1Exclamation.AutoSize = true; + this.main1Exclamation.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.main1Exclamation.ForeColor = System.Drawing.Color.Red; + this.main1Exclamation.Location = new System.Drawing.Point(515, 27); + this.main1Exclamation.Name = "main1Exclamation"; + this.main1Exclamation.Size = new System.Drawing.Size(30, 38); + this.main1Exclamation.TabIndex = 3; + this.main1Exclamation.Text = "!"; + this.main1Exclamation.Visible = false; + // + // main1StartTextBox + // + this.main1StartTextBox.Enabled = false; + this.main1StartTextBox.Location = new System.Drawing.Point(164, 31); + this.main1StartTextBox.Name = "main1StartTextBox"; + this.main1StartTextBox.Size = new System.Drawing.Size(163, 31); + this.main1StartTextBox.TabIndex = 0; + this.main1StartTextBox.Visible = false; + this.main1StartTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1StartTextBox_KeyPress); + // + // main1EndTextBox + // + this.main1EndTextBox.Enabled = false; + this.main1EndTextBox.Location = new System.Drawing.Point(350, 31); + this.main1EndTextBox.Name = "main1EndTextBox"; + this.main1EndTextBox.Size = new System.Drawing.Size(163, 31); + this.main1EndTextBox.TabIndex = 2; + this.main1EndTextBox.Visible = false; + this.main1EndTextBox.TextChanged += new System.EventHandler(this.main1EndTextBox_TextChanged); + this.main1EndTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1EndTextBox_KeyPress); + // + // main1Label + // + this.main1Label.AutoSize = true; + this.main1Label.Location = new System.Drawing.Point(18, 34); + this.main1Label.Name = "main1Label"; + this.main1Label.Size = new System.Drawing.Size(64, 23); + this.main1Label.TabIndex = 0; + this.main1Label.Text = "Main:"; + this.main1Label.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(603, 46); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(98, 63); + this.okButton.TabIndex = 4; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.aux2Exclamation); + this.groupBox2.Controls.Add(this.main2Exclamation); + this.groupBox2.Controls.Add(this.aux2StartTextBox); + this.groupBox2.Controls.Add(this.main2StartTextBox); + this.groupBox2.Controls.Add(this.aux2EndTextBox); + this.groupBox2.Controls.Add(this.aux2Label); + this.groupBox2.Controls.Add(this.main2EndTextBox); + this.groupBox2.Controls.Add(this.main2Label); + 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, 177); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(547, 124); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Water Meter 2"; + this.groupBox2.Visible = false; + // + // aux2Exclamation + // + this.aux2Exclamation.AutoSize = true; + this.aux2Exclamation.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.aux2Exclamation.ForeColor = System.Drawing.Color.Red; + this.aux2Exclamation.Location = new System.Drawing.Point(515, 70); + this.aux2Exclamation.Name = "aux2Exclamation"; + this.aux2Exclamation.Size = new System.Drawing.Size(30, 38); + this.aux2Exclamation.TabIndex = 5; + this.aux2Exclamation.Text = "!"; + this.aux2Exclamation.Visible = false; + // + // main2Exclamation + // + this.main2Exclamation.AutoSize = true; + this.main2Exclamation.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.main2Exclamation.ForeColor = System.Drawing.Color.Red; + this.main2Exclamation.Location = new System.Drawing.Point(515, 27); + this.main2Exclamation.Name = "main2Exclamation"; + this.main2Exclamation.Size = new System.Drawing.Size(30, 38); + this.main2Exclamation.TabIndex = 5; + this.main2Exclamation.Text = "!"; + this.main2Exclamation.Visible = false; + // + // aux2StartTextBox + // + this.aux2StartTextBox.Enabled = false; + this.aux2StartTextBox.Location = new System.Drawing.Point(164, 74); + this.aux2StartTextBox.Name = "aux2StartTextBox"; + this.aux2StartTextBox.Size = new System.Drawing.Size(163, 31); + this.aux2StartTextBox.TabIndex = 1; + this.aux2StartTextBox.Visible = false; + this.aux2StartTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2StartTextBox_KeyPress); + // + // main2StartTextBox + // + this.main2StartTextBox.Enabled = false; + this.main2StartTextBox.Location = new System.Drawing.Point(164, 31); + this.main2StartTextBox.Name = "main2StartTextBox"; + this.main2StartTextBox.Size = new System.Drawing.Size(163, 31); + this.main2StartTextBox.TabIndex = 0; + this.main2StartTextBox.Visible = false; + this.main2StartTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2StartTextBox_KeyPress); + // + // aux2EndTextBox + // + this.aux2EndTextBox.Enabled = false; + this.aux2EndTextBox.Location = new System.Drawing.Point(350, 74); + this.aux2EndTextBox.Name = "aux2EndTextBox"; + this.aux2EndTextBox.Size = new System.Drawing.Size(163, 31); + this.aux2EndTextBox.TabIndex = 3; + this.aux2EndTextBox.Visible = false; + this.aux2EndTextBox.TextChanged += new System.EventHandler(this.aux2EndTextBox_TextChanged); + this.aux2EndTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2EndTextBox_KeyPress); + // + // aux2Label + // + this.aux2Label.AutoSize = true; + this.aux2Label.Location = new System.Drawing.Point(18, 77); + this.aux2Label.Name = "aux2Label"; + this.aux2Label.Size = new System.Drawing.Size(55, 23); + this.aux2Label.TabIndex = 0; + this.aux2Label.Text = "Aux:"; + this.aux2Label.Visible = false; + // + // main2EndTextBox + // + this.main2EndTextBox.Enabled = false; + this.main2EndTextBox.Location = new System.Drawing.Point(350, 31); + this.main2EndTextBox.Name = "main2EndTextBox"; + this.main2EndTextBox.Size = new System.Drawing.Size(163, 31); + this.main2EndTextBox.TabIndex = 2; + this.main2EndTextBox.Visible = false; + this.main2EndTextBox.TextChanged += new System.EventHandler(this.main2EndTextBox_TextChanged); + this.main2EndTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2EndTextBox_KeyPress); + // + // main2Label + // + this.main2Label.AutoSize = true; + this.main2Label.Location = new System.Drawing.Point(18, 34); + this.main2Label.Name = "main2Label"; + this.main2Label.Size = new System.Drawing.Size(64, 23); + this.main2Label.TabIndex = 0; + this.main2Label.Text = "Main:"; + this.main2Label.Visible = false; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.aux3Exclamation); + this.groupBox3.Controls.Add(this.main3Exclamation); + this.groupBox3.Controls.Add(this.aux3StartTextBox); + this.groupBox3.Controls.Add(this.main3StartTextBox); + this.groupBox3.Controls.Add(this.aux3EndTextBox); + this.groupBox3.Controls.Add(this.aux3Label); + this.groupBox3.Controls.Add(this.main3EndTextBox); + this.groupBox3.Controls.Add(this.main3Label); + 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, 321); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(547, 124); + this.groupBox3.TabIndex = 3; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Water Meter 3"; + this.groupBox3.Visible = false; + // + // aux3Exclamation + // + this.aux3Exclamation.AutoSize = true; + this.aux3Exclamation.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.aux3Exclamation.ForeColor = System.Drawing.Color.Red; + this.aux3Exclamation.Location = new System.Drawing.Point(515, 70); + this.aux3Exclamation.Name = "aux3Exclamation"; + this.aux3Exclamation.Size = new System.Drawing.Size(30, 38); + this.aux3Exclamation.TabIndex = 5; + this.aux3Exclamation.Text = "!"; + this.aux3Exclamation.Visible = false; + // + // main3Exclamation + // + this.main3Exclamation.AutoSize = true; + this.main3Exclamation.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.main3Exclamation.ForeColor = System.Drawing.Color.Red; + this.main3Exclamation.Location = new System.Drawing.Point(515, 27); + this.main3Exclamation.Name = "main3Exclamation"; + this.main3Exclamation.Size = new System.Drawing.Size(30, 38); + this.main3Exclamation.TabIndex = 5; + this.main3Exclamation.Text = "!"; + this.main3Exclamation.Visible = false; + // + // aux3StartTextBox + // + this.aux3StartTextBox.Enabled = false; + this.aux3StartTextBox.Location = new System.Drawing.Point(164, 74); + this.aux3StartTextBox.Name = "aux3StartTextBox"; + this.aux3StartTextBox.Size = new System.Drawing.Size(163, 31); + this.aux3StartTextBox.TabIndex = 1; + this.aux3StartTextBox.Visible = false; + this.aux3StartTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3StartTextBox_KeyPress); + // + // main3StartTextBox + // + this.main3StartTextBox.Enabled = false; + this.main3StartTextBox.Location = new System.Drawing.Point(164, 31); + this.main3StartTextBox.Name = "main3StartTextBox"; + this.main3StartTextBox.Size = new System.Drawing.Size(163, 31); + this.main3StartTextBox.TabIndex = 0; + this.main3StartTextBox.Visible = false; + this.main3StartTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3StartTextBox_KeyPress); + // + // aux3EndTextBox + // + this.aux3EndTextBox.Enabled = false; + this.aux3EndTextBox.Location = new System.Drawing.Point(350, 74); + this.aux3EndTextBox.Name = "aux3EndTextBox"; + this.aux3EndTextBox.Size = new System.Drawing.Size(163, 31); + this.aux3EndTextBox.TabIndex = 3; + this.aux3EndTextBox.Visible = false; + this.aux3EndTextBox.TextChanged += new System.EventHandler(this.aux3EndTextBox_TextChanged); + this.aux3EndTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3EndTextBox_KeyPress); + // + // aux3Label + // + this.aux3Label.AutoSize = true; + this.aux3Label.Location = new System.Drawing.Point(18, 77); + this.aux3Label.Name = "aux3Label"; + this.aux3Label.Size = new System.Drawing.Size(55, 23); + this.aux3Label.TabIndex = 0; + this.aux3Label.Text = "Aux:"; + this.aux3Label.Visible = false; + // + // main3EndTextBox + // + this.main3EndTextBox.Enabled = false; + this.main3EndTextBox.Location = new System.Drawing.Point(350, 31); + this.main3EndTextBox.Name = "main3EndTextBox"; + this.main3EndTextBox.Size = new System.Drawing.Size(163, 31); + this.main3EndTextBox.TabIndex = 2; + this.main3EndTextBox.Visible = false; + this.main3EndTextBox.TextChanged += new System.EventHandler(this.main3EndTextBox_TextChanged); + this.main3EndTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3EndTextBox_KeyPress); + // + // main3Label + // + this.main3Label.AutoSize = true; + this.main3Label.Location = new System.Drawing.Point(18, 34); + this.main3Label.Name = "main3Label"; + this.main3Label.Size = new System.Drawing.Size(64, 23); + this.main3Label.TabIndex = 0; + this.main3Label.Text = "Main:"; + this.main3Label.Visible = false; + // + // startLabel + // + this.startLabel.AutoSize = true; + this.startLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.startLabel.Location = new System.Drawing.Point(245, 11); + this.startLabel.Name = "startLabel"; + this.startLabel.Size = new System.Drawing.Size(56, 23); + this.startLabel.TabIndex = 5; + this.startLabel.Text = "Start"; + // + // endLabel + // + this.endLabel.AutoSize = true; + this.endLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.endLabel.Location = new System.Drawing.Point(431, 11); + this.endLabel.Name = "endLabel"; + this.endLabel.Size = new System.Drawing.Size(46, 23); + this.endLabel.TabIndex = 5; + this.endLabel.Text = "End"; + // + // TestStartEndForm + // + 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(729, 471); + this.Controls.Add(this.endLabel); + this.Controls.Add(this.startLabel); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.okButton); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "TestStartEndForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "End States"; + this.TopMost = true; + this.Load += new System.EventHandler(this.CycleEndForm_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox aux1EndTextBox; + private System.Windows.Forms.Label aux1Label; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox main1EndTextBox; + private System.Windows.Forms.Label main1Label; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox main2EndTextBox; + private System.Windows.Forms.Label main2Label; + private System.Windows.Forms.TextBox aux2EndTextBox; + private System.Windows.Forms.Label aux2Label; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.TextBox main3EndTextBox; + private System.Windows.Forms.Label main3Label; + private System.Windows.Forms.TextBox aux3EndTextBox; + private System.Windows.Forms.Label aux3Label; + private System.Windows.Forms.TextBox aux1StartTextBox; + private System.Windows.Forms.TextBox main1StartTextBox; + private System.Windows.Forms.TextBox main2StartTextBox; + private System.Windows.Forms.TextBox aux2StartTextBox; + private System.Windows.Forms.TextBox main3StartTextBox; + private System.Windows.Forms.TextBox aux3StartTextBox; + private System.Windows.Forms.Label startLabel; + private System.Windows.Forms.Label endLabel; + private System.Windows.Forms.Label aux1Exclamation; + private System.Windows.Forms.Label main1Exclamation; + private System.Windows.Forms.Label main2Exclamation; + private System.Windows.Forms.Label aux2Exclamation; + private System.Windows.Forms.Label main3Exclamation; + private System.Windows.Forms.Label aux3Exclamation; + + } +} \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.resx b/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TestBenchFramework/BenchControl/DataEntry/Combined/TestStartEndForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard/TestStartEndForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard/TestStartEndForm.cs index bd7139e52..b1a57e644 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard/TestStartEndForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard/TestStartEndForm.cs @@ -16,7 +16,7 @@ namespace TBF.BenchControl.DataEntry.Standard public bool Completed { get { return completed; } } bool completed; - /// Number of text boxes for serial numbers + /// Number of water meters public readonly int WaterMetersCount; readonly bool[] disabled; diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index 60b504094..5688ef266 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -195,6 +195,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Aux:. + /// + internal static string Aux_ { + get { + return ResourceManager.GetString("Aux_", resourceCulture); + } + } + /// /// Looks up a localized string similar to Aux Water Meter. /// @@ -1041,6 +1050,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Main:. + /// + internal static string Main_ { + get { + return ResourceManager.GetString("Main_", resourceCulture); + } + } + /// /// Looks up a localized string similar to Main Water Meter. /// diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index b8326a371..c12ee084e 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -1054,4 +1054,10 @@ Communication + + Aux: + + + Main: + \ No newline at end of file diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj index 09d759674..6299a8192 100644 --- a/TestBenchFramework/TBF.csproj +++ b/TestBenchFramework/TBF.csproj @@ -150,6 +150,12 @@ AmbientCfgCtrl.cs + + Form + + + TestStartEndForm.cs + Form @@ -1213,6 +1219,9 @@ EntryFormCfgCtrl.cs + + TestStartEndForm.cs + CycleBeginningForm.cs