Refactoring : TestBenchFramework --> TBF ver. 2.18.789

This commit is contained in:
Milan Hanajik
2018-01-29 09:48:01 +01:00
parent 06018303e7
commit 0d3ee53bd5
1300 changed files with 441 additions and 612 deletions
@@ -0,0 +1,381 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.Combined
{
partial class CycleBeginningForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.okButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.aux1ComboBox = new System.Windows.Forms.ComboBox();
this.main1ComboBox = new System.Windows.Forms.ComboBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.auxSN1Label = new System.Windows.Forms.Label();
this.mainSN1Label = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.aux2ComboBox = new System.Windows.Forms.ComboBox();
this.main2ComboBox = new System.Windows.Forms.ComboBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.auxSN2Label = new System.Windows.Forms.Label();
this.mainSN2Label = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.aux3ComboBox = new System.Windows.Forms.ComboBox();
this.main3ComboBox = new System.Windows.Forms.ComboBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.auxSN3Label = new System.Windows.Forms.Label();
this.mainSN3Label = new System.Windows.Forms.Label();
this.clearButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.orderGroupBox.SuspendLayout();
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(589, 33);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(117, 63);
this.okButton.TabIndex = 0;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.aux1ComboBox);
this.groupBox1.Controls.Add(this.main1ComboBox);
this.groupBox1.Controls.Add(this.checkBox1);
this.groupBox1.Controls.Add(this.auxSN1Label);
this.groupBox1.Controls.Add(this.mainSN1Label);
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(28, 118);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(533, 137);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Water Meter 1";
this.groupBox1.Visible = false;
//
// aux1ComboBox
//
this.aux1ComboBox.FormattingEnabled = true;
this.aux1ComboBox.Location = new System.Drawing.Point(287, 83);
this.aux1ComboBox.Name = "aux1ComboBox";
this.aux1ComboBox.Size = new System.Drawing.Size(175, 31);
this.aux1ComboBox.TabIndex = 6;
this.aux1ComboBox.Visible = false;
this.aux1ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux1ComboBox_SelectedIndexChanged);
this.aux1ComboBox.TextChanged += new System.EventHandler(this.aux1ComboBox_TextChanged);
this.aux1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1ComboBox_KeyPress);
//
// main1ComboBox
//
this.main1ComboBox.FormattingEnabled = true;
this.main1ComboBox.Location = new System.Drawing.Point(287, 37);
this.main1ComboBox.Name = "main1ComboBox";
this.main1ComboBox.Size = new System.Drawing.Size(175, 31);
this.main1ComboBox.TabIndex = 5;
this.main1ComboBox.Visible = false;
this.main1ComboBox.SelectedIndexChanged += new System.EventHandler(this.main1ComboBox_SelectedIndexChanged);
this.main1ComboBox.TextChanged += new System.EventHandler(this.main1ComboBox_TextChanged);
this.main1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1ComboBox_KeyPress);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Font = new System.Drawing.Font("Verdana", 27.75F);
this.checkBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.checkBox1.Location = new System.Drawing.Point(490, 69);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(15, 14);
this.checkBox1.TabIndex = 4;
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.Visible = false;
//
// auxSN1Label
//
this.auxSN1Label.AutoSize = true;
this.auxSN1Label.Location = new System.Drawing.Point(21, 86);
this.auxSN1Label.Name = "auxSN1Label";
this.auxSN1Label.Size = new System.Drawing.Size(193, 23);
this.auxSN1Label.TabIndex = 2;
this.auxSN1Label.Text = "Aux. WM Serial Nr.";
this.auxSN1Label.Visible = false;
//
// mainSN1Label
//
this.mainSN1Label.AutoSize = true;
this.mainSN1Label.Location = new System.Drawing.Point(21, 40);
this.mainSN1Label.Name = "mainSN1Label";
this.mainSN1Label.Size = new System.Drawing.Size(195, 23);
this.mainSN1Label.TabIndex = 0;
this.mainSN1Label.Text = "Main WM Serial Nr.";
this.mainSN1Label.Visible = false;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.aux2ComboBox);
this.groupBox2.Controls.Add(this.main2ComboBox);
this.groupBox2.Controls.Add(this.checkBox2);
this.groupBox2.Controls.Add(this.auxSN2Label);
this.groupBox2.Controls.Add(this.mainSN2Label);
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(28, 275);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(533, 137);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Water Meter 2";
this.groupBox2.Visible = false;
//
// aux2ComboBox
//
this.aux2ComboBox.FormattingEnabled = true;
this.aux2ComboBox.Location = new System.Drawing.Point(287, 83);
this.aux2ComboBox.Name = "aux2ComboBox";
this.aux2ComboBox.Size = new System.Drawing.Size(175, 31);
this.aux2ComboBox.TabIndex = 10;
this.aux2ComboBox.Visible = false;
this.aux2ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux2ComboBox_SelectedIndexChanged);
this.aux2ComboBox.TextChanged += new System.EventHandler(this.aux2ComboBox_TextChanged);
this.aux2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2ComboBox_KeyPress);
//
// main2ComboBox
//
this.main2ComboBox.FormattingEnabled = true;
this.main2ComboBox.Location = new System.Drawing.Point(287, 37);
this.main2ComboBox.Name = "main2ComboBox";
this.main2ComboBox.Size = new System.Drawing.Size(175, 31);
this.main2ComboBox.TabIndex = 9;
this.main2ComboBox.Visible = false;
this.main2ComboBox.SelectedIndexChanged += new System.EventHandler(this.main2ComboBox_SelectedIndexChanged);
this.main2ComboBox.TextChanged += new System.EventHandler(this.main2ComboBox_TextChanged);
this.main2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2ComboBox_KeyPress);
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Font = new System.Drawing.Font("Verdana", 27.75F);
this.checkBox2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.checkBox2.Location = new System.Drawing.Point(490, 69);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(15, 14);
this.checkBox2.TabIndex = 8;
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.Visible = false;
//
// auxSN2Label
//
this.auxSN2Label.AutoSize = true;
this.auxSN2Label.Location = new System.Drawing.Point(21, 86);
this.auxSN2Label.Name = "auxSN2Label";
this.auxSN2Label.Size = new System.Drawing.Size(193, 23);
this.auxSN2Label.TabIndex = 2;
this.auxSN2Label.Text = "Aux. WM Serial Nr.";
this.auxSN2Label.Visible = false;
//
// mainSN2Label
//
this.mainSN2Label.AutoSize = true;
this.mainSN2Label.Location = new System.Drawing.Point(21, 40);
this.mainSN2Label.Name = "mainSN2Label";
this.mainSN2Label.Size = new System.Drawing.Size(195, 23);
this.mainSN2Label.TabIndex = 0;
this.mainSN2Label.Text = "Main WM Serial Nr.";
this.mainSN2Label.Visible = false;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.aux3ComboBox);
this.groupBox3.Controls.Add(this.main3ComboBox);
this.groupBox3.Controls.Add(this.checkBox3);
this.groupBox3.Controls.Add(this.auxSN3Label);
this.groupBox3.Controls.Add(this.mainSN3Label);
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(28, 430);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(533, 137);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Water Meter 3";
this.groupBox3.Visible = false;
//
// aux3ComboBox
//
this.aux3ComboBox.FormattingEnabled = true;
this.aux3ComboBox.Location = new System.Drawing.Point(287, 83);
this.aux3ComboBox.Name = "aux3ComboBox";
this.aux3ComboBox.Size = new System.Drawing.Size(175, 31);
this.aux3ComboBox.TabIndex = 10;
this.aux3ComboBox.Visible = false;
this.aux3ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux3ComboBox_SelectedIndexChanged);
this.aux3ComboBox.TextChanged += new System.EventHandler(this.aux3ComboBox_TextChanged);
this.aux3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3ComboBox_KeyPress);
//
// main3ComboBox
//
this.main3ComboBox.FormattingEnabled = true;
this.main3ComboBox.Location = new System.Drawing.Point(287, 37);
this.main3ComboBox.Name = "main3ComboBox";
this.main3ComboBox.Size = new System.Drawing.Size(175, 31);
this.main3ComboBox.TabIndex = 9;
this.main3ComboBox.Visible = false;
this.main3ComboBox.SelectedIndexChanged += new System.EventHandler(this.main3ComboBox_SelectedIndexChanged);
this.main3ComboBox.TextChanged += new System.EventHandler(this.main3ComboBox_TextChanged);
this.main3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3ComboBox_KeyPress);
//
// checkBox3
//
this.checkBox3.AutoSize = true;
this.checkBox3.Font = new System.Drawing.Font("Verdana", 27.75F);
this.checkBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.checkBox3.Location = new System.Drawing.Point(490, 68);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(15, 14);
this.checkBox3.TabIndex = 8;
this.checkBox3.UseVisualStyleBackColor = true;
this.checkBox3.Visible = false;
//
// auxSN3Label
//
this.auxSN3Label.AutoSize = true;
this.auxSN3Label.Location = new System.Drawing.Point(21, 86);
this.auxSN3Label.Name = "auxSN3Label";
this.auxSN3Label.Size = new System.Drawing.Size(193, 23);
this.auxSN3Label.TabIndex = 2;
this.auxSN3Label.Text = "Aux. WM Serial Nr.";
this.auxSN3Label.Visible = false;
//
// mainSN3Label
//
this.mainSN3Label.AutoSize = true;
this.mainSN3Label.Location = new System.Drawing.Point(21, 40);
this.mainSN3Label.Name = "mainSN3Label";
this.mainSN3Label.Size = new System.Drawing.Size(195, 23);
this.mainSN3Label.TabIndex = 0;
this.mainSN3Label.Text = "Main WM Serial Nr.";
this.mainSN3Label.Visible = false;
//
// clearButton
//
this.clearButton.Font = new System.Drawing.Font("Verdana", 14.25F);
this.clearButton.ForeColor = System.Drawing.Color.Black;
this.clearButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.clearButton.Location = new System.Drawing.Point(589, 116);
this.clearButton.Name = "clearButton";
this.clearButton.Size = new System.Drawing.Size(117, 63);
this.clearButton.TabIndex = 9;
this.clearButton.Text = "Clear";
this.clearButton.UseVisualStyleBackColor = true;
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
this.orderGroupBox.Font = new System.Drawing.Font("Verdana", 14.25F);
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Location = new System.Drawing.Point(28, 16);
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.Size = new System.Drawing.Size(533, 82);
this.orderGroupBox.TabIndex = 10;
this.orderGroupBox.TabStop = false;
this.orderGroupBox.Text = "Order";
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
this.orderComboBox.Location = new System.Drawing.Point(165, 30);
this.orderComboBox.Name = "orderComboBox";
this.orderComboBox.Size = new System.Drawing.Size(297, 31);
this.orderComboBox.TabIndex = 0;
//
// CycleBeginningForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.ClientSize = new System.Drawing.Size(732, 593);
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.clearButton);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.Text = "Daten";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.orderGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label mainSN1Label;
private System.Windows.Forms.Label auxSN1Label;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label auxSN2Label;
private System.Windows.Forms.Label mainSN2Label;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label auxSN3Label;
private System.Windows.Forms.Label mainSN3Label;
private System.Windows.Forms.Button clearButton;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.GroupBox orderGroupBox;
private System.Windows.Forms.ComboBox orderComboBox;
private System.Windows.Forms.ComboBox aux1ComboBox;
private System.Windows.Forms.ComboBox main1ComboBox;
private System.Windows.Forms.ComboBox aux2ComboBox;
private System.Windows.Forms.ComboBox main2ComboBox;
private System.Windows.Forms.ComboBox aux3ComboBox;
private System.Windows.Forms.ComboBox main3ComboBox;
}
}
@@ -0,0 +1,312 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
#pragma warning disable 162 /// Disables 'Unreachable code detected' warning
namespace TBF.BenchControl.DataEntry.Combined
{
public partial class CycleBeginningForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleBeginningForm));
/// <summary> Number of water meters </summary>
public readonly int WaterMetersCount;
// To be retrieved after the form closes
public string PurchaseOrder;
public string[] MainSNText;
public string[] AuxSNText;
public bool[] Disabled;
// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Number of text boxes for serial numbers </summary>
int TextBoxesCount;
Label[] mainLabels;
Label[] auxLabels;
ComboBox[] mainComboBoxes;
ComboBox[] auxComboBoxes;
CheckBox[] checkBoxes;
IList<ComboBox> enabledComboBoxes;
public CycleBeginningForm()
{
InitializeComponent();
ControlBox = false;
TextBoxesCount = 3;
mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label };
auxLabels = new Label[] { auxSN1Label, auxSN2Label, auxSN3Label };
mainComboBoxes = new ComboBox[] { main1ComboBox, main2ComboBox, main3ComboBox };
auxComboBoxes = new ComboBox[] { aux1ComboBox, aux2ComboBox, aux3ComboBox };
checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3 };
enabledComboBoxes = new List<ComboBox>();
this.WaterMetersCount = Config.Data.CompoundWMsCount; /// Default number of compound water meters
completed = false;
StartForceCloseHandler();
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="compoundWaterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int compoundWaterMetersCount)
: this()
{
this.WaterMetersCount = compoundWaterMetersCount; /// = Program.CompondWMsCount
MainSNText = new string[compoundWaterMetersCount];
AuxSNText = new string[compoundWaterMetersCount];
Disabled = new bool[compoundWaterMetersCount];
ShuffleTextBoxes(compoundWaterMetersCount);
Height = 110 + WaterMetersCount * 157;
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
/// <param name="compoundWMsCount">Numebr of combined watermeters</param>
void ShuffleTextBoxes(int compoundWMsCount)
{
if (compoundWMsCount < TextBoxesCount) TextBoxesCount = compoundWMsCount;
}
private void CycleBeginningForm_Load(object sender, EventArgs e)
{
Localize();
PrepareOrderCombo(orderComboBox);
if (WaterMetersCount >= 1) groupBox1.Visible = true;
if (WaterMetersCount >= 2) groupBox2.Visible = true;
if (WaterMetersCount >= 3) groupBox3.Visible = true;
for (int i = 0; i < TextBoxesCount; i++)
{
mainLabels[i].Visible = mainComboBoxes[i].Visible = true;
auxLabels[i].Visible = auxComboBoxes[i].Visible = true;
checkBoxes[i].Visible = true;
enabledComboBoxes.Add(mainComboBoxes[i]);
enabledComboBoxes.Add(auxComboBoxes[i]);
if (Program.LocalSettings.LastMainSNTextsCount == TextBoxesCount &&
Program.LocalSettings.LastAuxSNTextsCount == TextBoxesCount)
{
mainComboBoxes[i].Items.Add((Program.LocalSettings.LastMainSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastMainSNTexts[i]);
auxComboBoxes[i].Items.Add((Program.LocalSettings.LastAuxSNTexts[i] == null) ? string.Empty : Program.LocalSettings.LastAuxSNTexts[i]);
}
}
}
void Localize()
{
Text = Strings.Data;
orderGroupBox.Text = Strings.Purchase_order;
groupBox1.Text = Strings.Water_Meter + " 1";
groupBox2.Text = Strings.Water_Meter + " 2";
groupBox3.Text = Strings.Water_Meter + " 3";
mainSN1Label.Text = Strings.Main_WM_SerialNr;
mainSN2Label.Text = Strings.Main_WM_SerialNr;
mainSN3Label.Text = Strings.Main_WM_SerialNr;
auxSN1Label.Text = Strings.Aux_WM_SerialNr;
auxSN2Label.Text = Strings.Aux_WM_SerialNr;
auxSN3Label.Text = Strings.Aux_WM_SerialNr;
okButton.Text = Strings.OkBtnText;
clearButton.Text = Strings.ClearBtnText;
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareOrderCombo(ComboBox orderComboBox)
{
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
{
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
}
if (orderComboBox.Items.Count > 0)
{
orderComboBox.Text = orderComboBox.Items[0].ToString();
}
}
private void okButton_Click(object sender, EventArgs e)
{
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
, 20
#endif
);
Program.LocalSettings.LastMainSNTexts = MainSNText;
Program.LocalSettings.LastAuxSNTexts = AuxSNText;
for (int i = 0; i < TextBoxesCount; i++)
{
MainSNText[i] = mainComboBoxes[i].Text;
AuxSNText[i] = auxComboBoxes[i].Text;
Disabled[i] = !checkBoxes[i].Checked;
}
completed = true;
Close();
}
private void clearButton_Click(object sender, EventArgs e)
{
for (int i = 0; i < TextBoxesCount; i++)
{
mainComboBoxes[i].Text = string.Empty;
auxComboBoxes[i].Text = string.Empty;
checkBoxes[i].Checked = false;
}
}
/// <summary>
/// When one combo box is updated using drop-down menu, all combo boxes
/// are updated by this function.
/// </summary>
private void UpdateAllCombos()
{
for (int i = 0; i < TextBoxesCount; i++)
{
mainComboBoxes[i].Text = Program.LocalSettings.LastMainSNTexts[i];
auxComboBoxes[i].Text = Program.LocalSettings.LastAuxSNTexts[i];
checkBoxes[i].Checked = !string.IsNullOrEmpty(mainComboBoxes[i].Text)
|| !string.IsNullOrEmpty(auxComboBoxes[i].Text);
}
}
private void main1ComboBox_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
private void main1ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (Program.LocalSettings.LastMainSNTextsCount == WaterMetersCount)
{
if (main1ComboBox.Text.Equals(main1ComboBox.Items[0])) UpdateAllCombos();
}
}
private void aux1ComboBox_TextChanged(object sender, EventArgs e) { checkBox1.Checked = true; }
private void aux1ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (Program.LocalSettings.LastAuxSNTextsCount == WaterMetersCount)
{
if (aux1ComboBox.Text.Equals(aux1ComboBox.Items[0])) UpdateAllCombos();
}
}
private void main2ComboBox_TextChanged(object sender, EventArgs e) { checkBox2.Checked = true; }
private void main2ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (Program.LocalSettings.LastMainSNTextsCount == WaterMetersCount)
{
if (main2ComboBox.Text.Equals(main2ComboBox.Items[0])) UpdateAllCombos();
}
}
private void aux2ComboBox_TextChanged(object sender, EventArgs e) { checkBox2.Checked = true; }
private void aux2ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (Program.LocalSettings.LastAuxSNTextsCount == WaterMetersCount)
{
if (aux2ComboBox.Text.Equals(aux2ComboBox.Items[0])) UpdateAllCombos();
}
}
private void main3ComboBox_TextChanged(object sender, EventArgs e) { checkBox3.Checked = true; }
private void main3ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (Program.LocalSettings.LastMainSNTextsCount == WaterMetersCount)
{
if (main3ComboBox.Text.Equals(main3ComboBox.Items[0])) UpdateAllCombos();
}
}
private void aux3ComboBox_TextChanged(object sender, EventArgs e) { checkBox3.Checked = true; }
private void aux3ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (Program.LocalSettings.LastAuxSNTextsCount == WaterMetersCount)
{
if (aux3ComboBox.Text.Equals(aux3ComboBox.Items[0])) UpdateAllCombos();
}
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
/// <summary>
/// Process a key press within any enabled text boxe
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
{
if (e.KeyChar == '+')
{
/// Process '+' key ..... Form completed
okButton_Click(sender, e);
}
if (e.KeyChar == '\r')
{
/// Process <enter> key ..... Next text field
if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox
for (int i = 0; i < enabledComboBoxes.Count; i++)
{
if (enabledComboBoxes[i] == currentFocusOwner)
{
/// Change focus to the next enabled text box
enabledComboBoxes[(i + 1) % enabledComboBoxes.Count].Focus();
return;
}
}
}
}
private void main1ComboBox_KeyPress(object sender, KeyPressEventArgs e) { ProcKeyPress(sender, e, main1ComboBox); }
private void main2ComboBox_KeyPress(object sender, KeyPressEventArgs e) { ProcKeyPress(sender, e, main2ComboBox); }
private void main3ComboBox_KeyPress(object sender, KeyPressEventArgs e) { ProcKeyPress(sender, e, main3ComboBox); }
private void aux1ComboBox_KeyPress(object sender, KeyPressEventArgs e) { ProcKeyPress(sender, e, aux1ComboBox); }
private void aux2ComboBox_KeyPress(object sender, KeyPressEventArgs e) { ProcKeyPress(sender, e, aux2ComboBox); }
private void aux3ComboBox_KeyPress(object sender, KeyPressEventArgs e) { ProcKeyPress(sender, e, aux3ComboBox); }
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,443 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.Combined
{
partial class CycleEndForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainState1TextBox = new System.Windows.Forms.TextBox();
this.mainState1Label = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.qFall1Label = new System.Windows.Forms.Label();
this.qFall1TextBox = new System.Windows.Forms.TextBox();
this.qRise1Label = new System.Windows.Forms.Label();
this.qRise1TextBox = new System.Windows.Forms.TextBox();
this.auxState1TextBox = new System.Windows.Forms.TextBox();
this.auxState1Label = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.protocolGroupBox = new System.Windows.Forms.GroupBox();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.qFall2Label = new System.Windows.Forms.Label();
this.qFall2TextBox = new System.Windows.Forms.TextBox();
this.qRise2Label = new System.Windows.Forms.Label();
this.qRise2TextBox = new System.Windows.Forms.TextBox();
this.mainState2TextBox = new System.Windows.Forms.TextBox();
this.mainState2Label = new System.Windows.Forms.Label();
this.auxState2TextBox = new System.Windows.Forms.TextBox();
this.auxState2Label = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.qFall3Label = new System.Windows.Forms.Label();
this.qFall3TextBox = new System.Windows.Forms.TextBox();
this.qRise3Label = new System.Windows.Forms.Label();
this.qRise3TextBox = new System.Windows.Forms.TextBox();
this.mainState3TextBox = new System.Windows.Forms.TextBox();
this.mainState3Label = new System.Windows.Forms.Label();
this.auxState3TextBox = new System.Windows.Forms.TextBox();
this.auxState3Label = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.protocolGroupBox.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// mainState1TextBox
//
this.mainState1TextBox.Location = new System.Drawing.Point(211, 42);
this.mainState1TextBox.Name = "mainState1TextBox";
this.mainState1TextBox.Size = new System.Drawing.Size(135, 31);
this.mainState1TextBox.TabIndex = 1;
//
// mainState1Label
//
this.mainState1Label.AutoSize = true;
this.mainState1Label.Location = new System.Drawing.Point(18, 45);
this.mainState1Label.Name = "mainState1Label";
this.mainState1Label.Size = new System.Drawing.Size(153, 23);
this.mainState1Label.TabIndex = 0;
this.mainState1Label.Text = "Main WM State";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.qFall1Label);
this.groupBox1.Controls.Add(this.qFall1TextBox);
this.groupBox1.Controls.Add(this.qRise1Label);
this.groupBox1.Controls.Add(this.qRise1TextBox);
this.groupBox1.Controls.Add(this.mainState1TextBox);
this.groupBox1.Controls.Add(this.mainState1Label);
this.groupBox1.Controls.Add(this.auxState1TextBox);
this.groupBox1.Controls.Add(this.auxState1Label);
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, 23);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(375, 237);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Water Meter 1";
//
// qFall1Label
//
this.qFall1Label.AutoSize = true;
this.qFall1Label.Location = new System.Drawing.Point(18, 184);
this.qFall1Label.Name = "qFall1Label";
this.qFall1Label.Size = new System.Drawing.Size(55, 23);
this.qFall1Label.TabIndex = 6;
this.qFall1Label.Text = "Qfall";
//
// qFall1TextBox
//
this.qFall1TextBox.Location = new System.Drawing.Point(211, 177);
this.qFall1TextBox.Name = "qFall1TextBox";
this.qFall1TextBox.Size = new System.Drawing.Size(135, 31);
this.qFall1TextBox.TabIndex = 7;
//
// qRise1Label
//
this.qRise1Label.AutoSize = true;
this.qRise1Label.Location = new System.Drawing.Point(18, 135);
this.qRise1Label.Name = "qRise1Label";
this.qRise1Label.Size = new System.Drawing.Size(60, 23);
this.qRise1Label.TabIndex = 4;
this.qRise1Label.Text = "Qrise";
//
// qRise1TextBox
//
this.qRise1TextBox.Location = new System.Drawing.Point(211, 132);
this.qRise1TextBox.Name = "qRise1TextBox";
this.qRise1TextBox.Size = new System.Drawing.Size(135, 31);
this.qRise1TextBox.TabIndex = 5;
//
// auxState1TextBox
//
this.auxState1TextBox.Location = new System.Drawing.Point(211, 87);
this.auxState1TextBox.Name = "auxState1TextBox";
this.auxState1TextBox.Size = new System.Drawing.Size(135, 31);
this.auxState1TextBox.TabIndex = 3;
//
// auxState1Label
//
this.auxState1Label.AutoSize = true;
this.auxState1Label.Location = new System.Drawing.Point(18, 90);
this.auxState1Label.Name = "auxState1Label";
this.auxState1Label.Size = new System.Drawing.Size(151, 23);
this.auxState1Label.TabIndex = 2;
this.auxState1Label.Text = "Aux. WM State";
//
// 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(699, 33);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(98, 63);
this.okButton.TabIndex = 0;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// protocolGroupBox
//
this.protocolGroupBox.Controls.Add(this.radioButton3);
this.protocolGroupBox.Controls.Add(this.radioButton2);
this.protocolGroupBox.Controls.Add(this.radioButton1);
this.protocolGroupBox.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.protocolGroupBox.Location = new System.Drawing.Point(422, 118);
this.protocolGroupBox.Name = "protocolGroupBox";
this.protocolGroupBox.Size = new System.Drawing.Size(375, 142);
this.protocolGroupBox.TabIndex = 4;
this.protocolGroupBox.TabStop = false;
this.protocolGroupBox.Text = "Protocol";
//
// radioButton3
//
this.radioButton3.AutoSize = true;
this.radioButton3.Location = new System.Drawing.Point(34, 100);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(152, 27);
this.radioButton3.TabIndex = 2;
this.radioButton3.Text = "radioButton3";
this.radioButton3.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(34, 67);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(152, 27);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = "radioButton2";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(34, 34);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(152, 27);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "radioButton1";
this.radioButton1.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.qFall2Label);
this.groupBox2.Controls.Add(this.qFall2TextBox);
this.groupBox2.Controls.Add(this.qRise2Label);
this.groupBox2.Controls.Add(this.qRise2TextBox);
this.groupBox2.Controls.Add(this.mainState2TextBox);
this.groupBox2.Controls.Add(this.mainState2Label);
this.groupBox2.Controls.Add(this.auxState2TextBox);
this.groupBox2.Controls.Add(this.auxState2Label);
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, 282);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(375, 237);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Water Meter 2";
//
// qFall2Label
//
this.qFall2Label.AutoSize = true;
this.qFall2Label.Location = new System.Drawing.Point(18, 184);
this.qFall2Label.Name = "qFall2Label";
this.qFall2Label.Size = new System.Drawing.Size(55, 23);
this.qFall2Label.TabIndex = 6;
this.qFall2Label.Text = "Qfall";
//
// qFall2TextBox
//
this.qFall2TextBox.Location = new System.Drawing.Point(211, 177);
this.qFall2TextBox.Name = "qFall2TextBox";
this.qFall2TextBox.Size = new System.Drawing.Size(135, 31);
this.qFall2TextBox.TabIndex = 7;
//
// qRise2Label
//
this.qRise2Label.AutoSize = true;
this.qRise2Label.Location = new System.Drawing.Point(18, 135);
this.qRise2Label.Name = "qRise2Label";
this.qRise2Label.Size = new System.Drawing.Size(60, 23);
this.qRise2Label.TabIndex = 4;
this.qRise2Label.Text = "Qrise";
//
// qRise2TextBox
//
this.qRise2TextBox.Location = new System.Drawing.Point(211, 132);
this.qRise2TextBox.Name = "qRise2TextBox";
this.qRise2TextBox.Size = new System.Drawing.Size(135, 31);
this.qRise2TextBox.TabIndex = 5;
//
// mainState2TextBox
//
this.mainState2TextBox.Location = new System.Drawing.Point(211, 42);
this.mainState2TextBox.Name = "mainState2TextBox";
this.mainState2TextBox.Size = new System.Drawing.Size(135, 31);
this.mainState2TextBox.TabIndex = 1;
//
// mainState2Label
//
this.mainState2Label.AutoSize = true;
this.mainState2Label.Location = new System.Drawing.Point(17, 45);
this.mainState2Label.Name = "mainState2Label";
this.mainState2Label.Size = new System.Drawing.Size(153, 23);
this.mainState2Label.TabIndex = 0;
this.mainState2Label.Text = "Main WM State";
//
// auxState2TextBox
//
this.auxState2TextBox.Location = new System.Drawing.Point(211, 87);
this.auxState2TextBox.Name = "auxState2TextBox";
this.auxState2TextBox.Size = new System.Drawing.Size(135, 31);
this.auxState2TextBox.TabIndex = 3;
//
// auxState2Label
//
this.auxState2Label.AutoSize = true;
this.auxState2Label.Location = new System.Drawing.Point(18, 90);
this.auxState2Label.Name = "auxState2Label";
this.auxState2Label.Size = new System.Drawing.Size(151, 23);
this.auxState2Label.TabIndex = 2;
this.auxState2Label.Text = "Aux. WM State";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.qFall3Label);
this.groupBox3.Controls.Add(this.qFall3TextBox);
this.groupBox3.Controls.Add(this.qRise3Label);
this.groupBox3.Controls.Add(this.qRise3TextBox);
this.groupBox3.Controls.Add(this.mainState3TextBox);
this.groupBox3.Controls.Add(this.mainState3Label);
this.groupBox3.Controls.Add(this.auxState3TextBox);
this.groupBox3.Controls.Add(this.auxState3Label);
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(422, 282);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(375, 237);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Water Meter 3";
//
// qFall3Label
//
this.qFall3Label.AutoSize = true;
this.qFall3Label.Location = new System.Drawing.Point(18, 184);
this.qFall3Label.Name = "qFall3Label";
this.qFall3Label.Size = new System.Drawing.Size(55, 23);
this.qFall3Label.TabIndex = 6;
this.qFall3Label.Text = "Qfall";
//
// qFall3TextBox
//
this.qFall3TextBox.Location = new System.Drawing.Point(211, 177);
this.qFall3TextBox.Name = "qFall3TextBox";
this.qFall3TextBox.Size = new System.Drawing.Size(135, 31);
this.qFall3TextBox.TabIndex = 7;
//
// qRise3Label
//
this.qRise3Label.AutoSize = true;
this.qRise3Label.Location = new System.Drawing.Point(18, 135);
this.qRise3Label.Name = "qRise3Label";
this.qRise3Label.Size = new System.Drawing.Size(60, 23);
this.qRise3Label.TabIndex = 4;
this.qRise3Label.Text = "Qrise";
//
// qRise3TextBox
//
this.qRise3TextBox.Location = new System.Drawing.Point(211, 132);
this.qRise3TextBox.Name = "qRise3TextBox";
this.qRise3TextBox.Size = new System.Drawing.Size(135, 31);
this.qRise3TextBox.TabIndex = 5;
//
// mainState3TextBox
//
this.mainState3TextBox.Location = new System.Drawing.Point(211, 42);
this.mainState3TextBox.Name = "mainState3TextBox";
this.mainState3TextBox.Size = new System.Drawing.Size(135, 31);
this.mainState3TextBox.TabIndex = 1;
//
// mainState3Label
//
this.mainState3Label.AutoSize = true;
this.mainState3Label.Location = new System.Drawing.Point(18, 45);
this.mainState3Label.Name = "mainState3Label";
this.mainState3Label.Size = new System.Drawing.Size(153, 23);
this.mainState3Label.TabIndex = 0;
this.mainState3Label.Text = "Main WM State";
//
// auxState3TextBox
//
this.auxState3TextBox.Location = new System.Drawing.Point(211, 87);
this.auxState3TextBox.Name = "auxState3TextBox";
this.auxState3TextBox.Size = new System.Drawing.Size(135, 31);
this.auxState3TextBox.TabIndex = 3;
//
// auxState3Label
//
this.auxState3Label.AutoSize = true;
this.auxState3Label.Location = new System.Drawing.Point(18, 90);
this.auxState3Label.Name = "auxState3Label";
this.auxState3Label.Size = new System.Drawing.Size(151, 23);
this.auxState3Label.TabIndex = 2;
this.auxState3Label.Text = "Aux. WM State";
//
// CycleEndForm
//
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(822, 542);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.protocolGroupBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleEndForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Daten";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleEndForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.protocolGroupBox.ResumeLayout(false);
this.protocolGroupBox.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TextBox mainState1TextBox;
private System.Windows.Forms.Label mainState1Label;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox auxState1TextBox;
private System.Windows.Forms.Label auxState1Label;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox protocolGroupBox;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.Label qFall1Label;
private System.Windows.Forms.TextBox qFall1TextBox;
private System.Windows.Forms.Label qRise1Label;
private System.Windows.Forms.TextBox qRise1TextBox;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label qFall2Label;
private System.Windows.Forms.TextBox qFall2TextBox;
private System.Windows.Forms.Label qRise2Label;
private System.Windows.Forms.TextBox qRise2TextBox;
private System.Windows.Forms.TextBox mainState2TextBox;
private System.Windows.Forms.Label mainState2Label;
private System.Windows.Forms.TextBox auxState2TextBox;
private System.Windows.Forms.Label auxState2Label;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label qFall3Label;
private System.Windows.Forms.TextBox qFall3TextBox;
private System.Windows.Forms.Label qRise3Label;
private System.Windows.Forms.TextBox qRise3TextBox;
private System.Windows.Forms.TextBox mainState3TextBox;
private System.Windows.Forms.Label mainState3Label;
private System.Windows.Forms.TextBox auxState3TextBox;
private System.Windows.Forms.Label auxState3Label;
}
}
@@ -0,0 +1,158 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
#pragma warning disable 162 /// Disables 'Unreachable code detected' warning
namespace TBF.BenchControl.DataEntry.Combined
{
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleEndForm));
// To be set before the form opens
public string ProtocolName1;
public string ProtocolName2;
public string ProtocolName3;
// To be retrieved after the form closes
public string[] MainStateText;
public string[] AuxStateText;
public float[] QRise;
public float[] QFall;
public string ProtocolTitle;
// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
public CycleEndForm()
{
InitializeComponent();
ControlBox = false;
MainStateText = new string[Config.Data.CompoundWMsCount];
AuxStateText = new string[Config.Data.CompoundWMsCount];
QRise = new float[Config.Data.CompoundWMsCount];
QFall = new float[Config.Data.CompoundWMsCount];
completed = false;
StartForceCloseHandler();
Localize();
}
void Localize()
{
Text = Strings.Data;
protocolGroupBox.Text = Strings.Protocol;
groupBox1.Text = Strings.Water_Meter + " 1";
mainState1Label.Text = Strings.Main_Water_Meter_State;
auxState1Label.Text = Strings.Aux_Water_Meter_State;
qRise1Label.Text = Strings.Qrise;
qFall1Label.Text = Strings.Qfall;
groupBox2.Text = Strings.Water_Meter + " 2";
mainState2Label.Text = Strings.Main_Water_Meter_State;
auxState2Label.Text = Strings.Aux_Water_Meter_State;
qRise2Label.Text = Strings.Qrise;
qFall2Label.Text = Strings.Qfall;
groupBox3.Text = Strings.Water_Meter + " 3";
mainState3Label.Text = Strings.Main_Water_Meter_State;
auxState3Label.Text = Strings.Aux_Water_Meter_State;
qRise3Label.Text = Strings.Qrise;
qFall3Label.Text = Strings.Qfall;
}
private void CycleEndForm_Load(object sender, EventArgs e)
{
radioButton1.Text = ProtocolName1;
radioButton2.Text = ProtocolName2;
radioButton3.Text = ProtocolName3;
qRise1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
qFall1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
if (Config.Data.CompoundWMsCount >= 2)
{
qRise2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
qFall2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
}
else
{
groupBox2.Visible = false;
Height = 305;
}
if (Config.Data.CompoundWMsCount >= 3)
{
qRise3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
qFall3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
}
else
{
groupBox3.Visible = false;
}
}
private void okButton_Click(object sender, EventArgs e)
{
float ftmp;
bool allOK = true;
MainStateText[0] = mainState1TextBox.Text;
AuxStateText[0] = auxState1TextBox.Text;
if (Utils.TryParseUFloat(qRise1TextBox.Text, out ftmp)) { QRise[0] = ftmp; } else { allOK = false; }
if (Utils.TryParseUFloat(qFall1TextBox.Text, out ftmp)) { QFall[0] = ftmp; } else { allOK = false; }
if (Config.Data.CompoundWMsCount >= 2)
{
MainStateText[1] = mainState2TextBox.Text;
AuxStateText[1] = auxState2TextBox.Text;
if (Utils.TryParseUFloat(qRise2TextBox.Text, out ftmp)) { QRise[1] = ftmp; } else { allOK = false; }
if (Utils.TryParseUFloat(qFall2TextBox.Text, out ftmp)) { QFall[1] = ftmp; } else { allOK = false; }
}
if (Config.Data.CompoundWMsCount >= 3)
{
MainStateText[2] = mainState3TextBox.Text;
AuxStateText[2] = auxState3TextBox.Text;
if (Utils.TryParseUFloat(qRise3TextBox.Text, out ftmp)) { QRise[2] = ftmp; } else { allOK = false; }
if (Utils.TryParseUFloat(qFall3TextBox.Text, out ftmp)) { QFall[2] = ftmp; } else { allOK = false; }
}
if (radioButton1.Checked) ProtocolTitle = ProtocolName1;
else if (radioButton2.Checked) ProtocolTitle = ProtocolName2;
else if (radioButton3.Checked) ProtocolTitle = ProtocolName3;
if (allOK)
{
completed = true;
Close();
}
}
#region Forced close handling
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseModelessFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}
@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="mainState1TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="mainState1Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qFall1Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qFall1TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qRise1Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qRise1TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="auxState1TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="auxState1Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="okButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="protocolGroupBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="radioButton3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="radioButton2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="radioButton1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="groupBox2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qFall2Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qFall2TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qRise2Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qRise2TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="mainState2TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="mainState2Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="auxState2TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="auxState2Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="groupBox3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qFall3Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qFall3TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qRise3Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="qRise3TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="mainState3TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="mainState3Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="auxState3TextBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="auxState3Label.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
@@ -0,0 +1,281 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.DataEntry.Combined
{
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
{
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
public override string ToString() { return string.Format("DataEntry.Combined({0})", Cfg.ToString(1)); }
public bool UsesCameras() { return false; }
readonly EntryFormCfg entryFormCfg;
IRegisterReader[] regReaders;
/// <summary>
/// Properties set by the Begin and the End form
/// </summary>
string purchaseOrder;
public string PurchaseOrder { get { return purchaseOrder; } }
bool[] disabled; /// This array is shared between forms
string[] wmCycleEndState;
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
double[] wmStartState;
public double WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
double[] wmEndState;
public double WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
string[] wmStartStateStr;
System.Windows.Forms.Form modelessDlg;
double refVolume;
double errLimLo;
double errLimHi;
bool resultSaved; /// Set in Run() when results are saved
Results.Entities.WaterMeter[] waterMeters; /// Reference to ...ProcessData.BatchRslts.WaterMeters[]
public enum CurrentOp
{
None,
ShowFormAtCycleBeginning,
ShowFormAtCycleEnd,
EnterTestStartStates,
EnterTestEndStates,
}
CurrentOp currentOp;
public EntryForm()
{
}
public EntryForm(Generic.IComponentCfg cfg)
: base(cfg)
{
entryFormCfg = cfg as EntryFormCfg;
disabled = new bool[Config.Data.CompoundWMsCount];
wmStartState = new double[Config.Data.CompoundWMsCount * 2];
wmStartStateStr = new string[Config.Data.CompoundWMsCount * 2];
wmEndState = new double[Config.Data.CompoundWMsCount * 2];
wmCycleEndState = new string[Config.Data.CompoundWMsCount * 2];
currentOp = CurrentOp.None;
log.Debug(this.ToString());
}
/// <returns>Reference to the operation</returns>
public IOperation ShowCycleBeginFormOp()
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.ShowFormAtCycleBeginning;
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowCycleEndFormOp()
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.ShowFormAtCycleEnd;
this.waterMeters = TBF.BenchControl.Sequences.ProcessData.BatchRslts.WaterMeters;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowTestStartFormOp(IRegisterReader[] regReaders)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.EnterTestStartStates;
this.regReaders = regReaders;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowTestEndFormOp(IRegisterReader[] regReaders, double refVolume, double errLimLo, double errLimHi)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.EnterTestEndStates;
this.regReaders = regReaders;
this.refVolume = refVolume;
this.errLimLo = errLimLo;
this.errLimHi = errLimHi;
return this;
}
delegate void EntryFormDlgt(EntryForm myRef);
///
void OpenBeginningDlg(EntryForm myRef)
{
myRef.modelessDlg = new CycleBeginningForm(Config.Data.CompoundWMsCount);
modelessDlg.Show();
}
///
void OpenEndDlg(EntryForm myRef)
{
CycleEndForm endForm = new CycleEndForm();
myRef.modelessDlg = endForm;
modelessDlg.Show();
}
///
void OpenTestStartStatesDlg(EntryForm myRef)
{
myRef.modelessDlg = new TestStartEndForm(Config.Data.CompoundWMsCount, myRef.regReaders, myRef.disabled);
modelessDlg.Show();
}
///
void OpenTestEndStatesDlg(EntryForm myRef)
{
string[] mainStartStateStr = new string[Config.Data.CompoundWMsCount];
string[] auxStartStateStr = new string[Config.Data.CompoundWMsCount];
for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
{
mainStartStateStr[i] = wmStartStateStr[2 * i];
auxStartStateStr[i] = wmStartStateStr[2 * i + 1];
}
myRef.modelessDlg = new TestStartEndForm(Config.Data.CompoundWMsCount, myRef.regReaders, mainStartStateStr, auxStartStateStr, disabled, refVolume, errLimLo, errLimHi);
modelessDlg.Show();
}
/// <summary>Start this operation</summary>
public void Start()
{
resultSaved = false;
switch (currentOp)
{
case CurrentOp.ShowFormAtCycleBeginning:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
break;
case CurrentOp.ShowFormAtCycleEnd:
if (entryFormCfg.ShowCycleEndForm)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this);
}
break;
case CurrentOp.EnterTestStartStates:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestStartStatesDlg), this);
break;
case CurrentOp.EnterTestEndStates:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenTestEndStatesDlg), this);
break;
}
}
/// <summary>Run this operation</summary>
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
if ((modelessDlg is IHasCompleted) && !(modelessDlg as IHasCompleted).Completed)
{
return Event.ModelessFormIsOpen;
}
if (!resultSaved) /// This is to save the result only once
{
if (currentOp == CurrentOp.ShowFormAtCycleBeginning)
{
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
if (dlg != null)
{
purchaseOrder = dlg.PurchaseOrder;
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
{
if (waterMeters[i] != null)
{
waterMeters[i].SerialNr = dlg.MainSNText[i];
waterMeters[i].SerialNrAux = dlg.AuxSNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
}
}
}
}
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
{
//CycleEndForm dlg = (modelessDlg as CycleEndForm);
//int count = waterMeters.Count;
//if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
//for (int i = 0; i < count; i++)
//{
// if (waterMeters[i] != null)
// {
// /// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty
// wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
// }
//}
}
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
{
/// Fixed start test - start
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
wmStartState[2 * i] = dlg.MainStartState[i];
wmStartStateStr[2 * i] = dlg.MainStartStateStr[i];
wmStartState[2 * i + 1] = dlg.AuxStartState[i];
wmStartStateStr[2 * i + 1] = dlg.AuxStartStateStr[i];
}
}
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestEndStates)
{
/// Fixed start test - end
TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
wmEndState[2 * i] = dlg.MainEndState[i];
wmEndState[2 * i + 1] = dlg.AuxEndState[i];
}
}
resultSaved = true;
modelessDlg = null;
}
return Event.ModelessFormClosed; /// Form closed
}
/// <summary>Stop this operation</summary>
public void Stop()
{
if (modelessDlg is IHasCompleted)
{
UiBridge.Bridge.OnCloseModelessForm(this, null);
modelessDlg = null;
}
currentOp = CurrentOp.None;
}
/// <summary>
/// Updates test results with the information collected in watermeters.
/// </summary>
/// <param name="batchResults">Test results to be updated with the information</param>
public void UpdateTestResults(Results.BatchResults batchResults)
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
}
}
}
@@ -0,0 +1,43 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.Combined
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
/// Serialized parameters
///
public bool ShowCycleEndForm;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
{
Name = "DataEntry-Combined";
ParentName = string.Empty;
ShowCycleEndForm = false;
}
public EntryFormCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm);
}
}
}
@@ -0,0 +1,81 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.Combined
{
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
public bool ShowMore { get { return false; } }
EntryFormCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as EntryFormCfg;
Redraw();
}
}
public EntryFormCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
Localize();
Redraw();
}
void Localize()
{
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form;
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
}
public void Unlock()
{
nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
return flags;
}
}
}
@@ -0,0 +1,100 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.Combined
{
partial class EntryFormCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(137, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(27, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(134, 33);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// showCycleEndFormCheckBox
//
this.showCycleEndFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(137, 90);
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.TabIndex = 14;
this.showCycleEndFormCheckBox.Text = "Show cycle end form";
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.showCycleEndFormCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "EntryFormCfgCtrl";
this.Size = new System.Drawing.Size(300, 200);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showCycleEndFormCheckBox;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.Combined
{
public class EntryFormFactory : IComponentFactory
{
public string ClassName { get { return "DataEntry-Combined"; } }
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
public IComponent DummyComponent() { return new EntryForm(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new EntryForm(cfg); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(EntryFormCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,426 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.GenericDevices;
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;
/// <summary> Number of water meters </summary>
public readonly int WaterMetersCount; /// Main + Aux water meter count as one (combined) water meter
readonly IRegisterReader[] regReaders;
readonly bool[] disabled;
// To be retrieved after the form closes
public double[] MainStartState;
public double[] AuxStartState;
// To be retrieved after the form closes
public readonly string[] MainStartStateStr;
public readonly string[] AuxStartStateStr;
// To be retrieved after the form closes
public double[] MainEndState;
public double[] AuxEndState;
bool endStates; /// false=start states, true=end states
double refVolume;
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
int TextBoxesCount;
///
Label[] mainLabels;
Label[] auxLabels;
TextBox[] mainStartTextBoxes;
TextBox[] auxStartTextBoxes;
TextBox[] mainEndTextBoxes;
TextBox[] auxEndTextBoxes;
IList<TextBox> enabledTextBoxes;
/// <summary>
/// Parameterless constructor initializing common part for start and endstate form
/// </summary>
public TestStartEndForm()
{
InitializeComponent();
ControlBox = false;
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<TextBox>();
completed = false;
StartForceCloseHandler();
}
/// <summary>
/// Constructor to fill in start states
/// </summary>
/// <param name="waterMetersCount">Number of water meters</param>
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
public TestStartEndForm(int waterMetersCount, IRegisterReader[] regReaders, bool[] disabled)
: this()
{
endStates = false;
this.WaterMetersCount = waterMetersCount;
this.regReaders = regReaders;
this.disabled = disabled;
ShuffleTextBoxes();
MainStartState = new double[waterMetersCount];
AuxStartState = new double[waterMetersCount];
MainStartStateStr = new string[waterMetersCount];
AuxStartStateStr = new string[waterMetersCount];
}
/// <summary>
/// Constructor to fill in end states
/// </summary>
/// <param name="waterMetersCount">Number of water meters</param>
/// <param name="mainStartStateStr">Information entered on test start (main)</param>
/// <param name="auxStartStateStr">Information entered on test start (aux)</param>
/// <param name="disabled">Information from CycleBeginningForm about availability of water meters</param>
/// <param name="refVolume">Reference volume, it is used to verify the end state, show/hide exclamation if necessary</param>
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
public TestStartEndForm(int waterMetersCount, IRegisterReader[] regReaders, string[] mainStartStateStr, string[] auxStartStateStr,
bool[] disabled, double refVolume, double errLimLo, double errLimHi)
: this()
{
endStates = true;
this.WaterMetersCount = waterMetersCount;
this.regReaders = regReaders;
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 double[waterMetersCount];
AuxEndState = new double[waterMetersCount];
}
/// <summary>
/// Make sure the layout of labels/text boxes on the screen
/// corresponds to the layout of watermeters of the test bench.
/// </summary>
void ShuffleTextBoxes()
{
if (Config.Data.CompoundWMsCount < TextBoxesCount)
{
TextBoxesCount = Config.Data.CompoundWMsCount;
}
}
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) groupBox3.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";
groupBox3.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.ParseUDouble(mainEndTextBoxes[i].Text);
}
if (auxEndTextBoxes[i].Visible && auxEndTextBoxes[i].Enabled)
{
AuxEndState[i] = Utils.ParseUDouble(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.ParseUDouble(mainStartTextBoxes[i].Text);
}
if (auxStartTextBoxes[i].Visible && auxStartTextBoxes[i].Enabled)
{
AuxStartStateStr[i] = auxStartTextBoxes[i].Text;
AuxStartState[i] = Utils.ParseUDouble(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<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
};
}
void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
/// <summary>
/// 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).
/// </summary>
private void main1EndTextBox_TextChanged(object sender, EventArgs e)
{
//double err = 0;
//try
//{
// double endState = Utils.ParseUDouble(main1EndTextBox.Text);
// double startState = Utils.ParseUDouble(main1StartTextBox.Text);
// err = 100.0 * (endState - startState - refVolume) / refVolume;
//}
//catch { };
//main1Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void aux1EndTextBox_TextChanged(object sender, EventArgs e)
{
//double err = 0;
//try
//{
// double endState = Utils.ParseUDouble(aux1EndTextBox.Text);
// double startState = Utils.ParseUDouble(aux1StartTextBox.Text);
// err = 100.0 * (endState - startState - refVolume) / refVolume;
//}
//catch { err = 1000.0f; };
//aux1Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void main2EndTextBox_TextChanged(object sender, EventArgs e)
{
//double err = 0;
//try
//{
// double endState = Utils.ParseUDouble(main2EndTextBox.Text);
// double startState = Utils.ParseUDouble(main2StartTextBox.Text);
// err = 100.0 * (endState - startState - refVolume) / refVolume;
//}
//catch { err = 1000.0f; };
//main2Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void aux2EndTextBox_TextChanged(object sender, EventArgs e)
{
//double err = 0;
//try
//{
// double endState = Utils.ParseUDouble(aux2EndTextBox.Text);
// double startState = Utils.ParseUDouble(aux2StartTextBox.Text);
// err = 100.0 * (endState - startState - refVolume) / refVolume;
//}
//catch { err = 1000.0f; };
//aux2Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void main3EndTextBox_TextChanged(object sender, EventArgs e)
{
//double err = 0;
//try
//{
// double endState = Utils.ParseUDouble(main3EndTextBox.Text);
// double startState = Utils.ParseUDouble(main3StartTextBox.Text);
// err = 100.0 * (endState - startState - refVolume) / refVolume;
//}
//catch { err = 1000.0f; };
//main3Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void aux3EndTextBox_TextChanged(object sender, EventArgs e)
{
//double err = 0;
//try
//{
// double endState = Utils.ParseUDouble(aux3EndTextBox.Text);
// double startState = Utils.ParseUDouble(aux3StartTextBox.Text);
// err = 100.0 * (endState - startState - refVolume) / refVolume;
//}
//catch { err = 1000.0f; };
//aux3Exclamation.Visible = (err < warningLimLo) || (warningLimHi < err);
}
/// <summary>
/// Process a key press within any enabled text boxe
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="currentFocusOwner">TextBox control which received the event</param>
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 <enter> 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); }
}
}
@@ -0,0 +1,482 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.Combined
{
partial class TestStartEndForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>