DataEntry.iPerl forms added, version = 1.5.95.

This commit is contained in:
Milan Hanajik 2015-08-24 08:01:41 +02:00
parent 6b10e67c17
commit 217ceffa67
17 changed files with 3910 additions and 2 deletions

View File

@ -0,0 +1,86 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.iPerl
{
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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBeginningForm));
this.okButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox();
this.orderGroupBox.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// orderGroupBox
//
this.orderGroupBox.Controls.Add(this.orderComboBox);
resources.ApplyResources(this.orderGroupBox, "orderGroupBox");
this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
this.orderGroupBox.Name = "orderGroupBox";
this.orderGroupBox.TabStop = false;
//
// orderComboBox
//
this.orderComboBox.FormattingEnabled = true;
resources.ApplyResources(this.orderComboBox, "orderComboBox");
this.orderComboBox.Name = "orderComboBox";
//
// CycleBeginningForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.orderGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox orderGroupBox;
private System.Windows.Forms.ComboBox orderComboBox;
}
}

View File

@ -0,0 +1,106 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.iPerl
{
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 is closed
public string PurchaseOrder;
public string[] SNText;
public bool[] Disabled;
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
/// <summary> Parameterless constructor for common functionality </summary>
public CycleBeginningForm()
{
InitializeComponent();
completed = false;
StartForceCloseHandler();
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int waterMetersCount)
: this()
{
this.WaterMetersCount = waterMetersCount;
SNText = null;
Disabled = null;
}
private void CycleBeginningForm_Load(object sender, EventArgs e)
{
Text = Strings.Data;
orderGroupBox.Text = Strings.Purchase_Order;
okButton.Text = Strings.OkBtnText;
PrepareOrderCombo(orderComboBox);
}
/// <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);
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);
};
}
private void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}

View File

@ -0,0 +1,218 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="okButton.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 14.25pt</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>627, 26</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>112, 63</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="orderComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>90, 31</value>
</data>
<data name="orderComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>376, 31</value>
</data>
<data name="orderComboBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;orderComboBox.Name" xml:space="preserve">
<value>orderComboBox</value>
</data>
<data name="&gt;&gt;orderComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;orderComboBox.Parent" xml:space="preserve">
<value>orderGroupBox</value>
</data>
<data name="&gt;&gt;orderComboBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="orderGroupBox.Font" type="System.Drawing.Font, System.Drawing">
<value>Verdana, 14.25pt</value>
</data>
<data name="orderGroupBox.Location" type="System.Drawing.Point, System.Drawing">
<value>28, 12</value>
</data>
<data name="orderGroupBox.Size" type="System.Drawing.Size, System.Drawing">
<value>537, 82</value>
</data>
<data name="orderGroupBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="orderGroupBox.Text" xml:space="preserve">
<value>Order</value>
</data>
<data name="&gt;&gt;orderGroupBox.Name" xml:space="preserve">
<value>orderGroupBox</value>
</data>
<data name="&gt;&gt;orderGroupBox.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;orderGroupBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;orderGroupBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>801, 119</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Batch data</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>CycleBeginningForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -0,0 +1,305 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.iPerl
{
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.groupBox2 = new System.Windows.Forms.GroupBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.okButton = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.textBox6 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.SuspendLayout();
//
// groupBox2
//
this.groupBox2.Controls.Add(this.textBox2);
this.groupBox2.Controls.Add(this.label2);
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, 104);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(362, 81);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Wasserzähler 2";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(183, 31);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(163, 31);
this.textBox2.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(18, 34);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(74, 23);
this.label2.TabIndex = 0;
this.label2.Text = "Stand:";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.label1);
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, 14);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(362, 81);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Wasserzähler 1";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(183, 31);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(163, 31);
this.textBox1.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(18, 34);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 23);
this.label1.TabIndex = 0;
this.label1.Text = "Stand:";
//
// okButton
//
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.Location = new System.Drawing.Point(425, 23);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(98, 63);
this.okButton.TabIndex = 7;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.textBox3);
this.groupBox3.Controls.Add(this.label3);
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, 194);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(362, 81);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Wasserzähler 3";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(183, 31);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(163, 31);
this.textBox3.TabIndex = 1;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(18, 34);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(74, 23);
this.label3.TabIndex = 0;
this.label3.Text = "Stand:";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.textBox4);
this.groupBox4.Controls.Add(this.label4);
this.groupBox4.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox4.ForeColor = System.Drawing.Color.Black;
this.groupBox4.Location = new System.Drawing.Point(25, 284);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(362, 81);
this.groupBox4.TabIndex = 4;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Wasserzähler 4";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(183, 31);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(163, 31);
this.textBox4.TabIndex = 1;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(18, 34);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(74, 23);
this.label4.TabIndex = 0;
this.label4.Text = "Stand:";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.textBox5);
this.groupBox5.Controls.Add(this.label5);
this.groupBox5.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox5.ForeColor = System.Drawing.Color.Black;
this.groupBox5.Location = new System.Drawing.Point(25, 374);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(362, 81);
this.groupBox5.TabIndex = 5;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Wasserzähler 5";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(183, 31);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(163, 31);
this.textBox5.TabIndex = 1;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(18, 34);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(74, 23);
this.label5.TabIndex = 0;
this.label5.Text = "Stand:";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.textBox6);
this.groupBox6.Controls.Add(this.label6);
this.groupBox6.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox6.ForeColor = System.Drawing.Color.Black;
this.groupBox6.Location = new System.Drawing.Point(25, 464);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(362, 81);
this.groupBox6.TabIndex = 6;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "Wasserzähler 6";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(183, 31);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(163, 31);
this.textBox6.TabIndex = 1;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(18, 34);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(74, 23);
this.label6.TabIndex = 0;
this.label6.Text = "Stand:";
//
// 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(559, 566);
this.Controls.Add(this.groupBox6);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.okButton);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleEndForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Daten";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleEndForm_Load);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label label6;
}
}

View File

@ -0,0 +1,108 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.iPerl
{
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
{
private static readonly ILog log = LogManager.GetLogger(typeof(CycleEndForm));
/// <summary> Number of text boxes for serial numbers </summary>
public readonly int WaterMetersCount;
// To be retrieved after the form closes
public string[] EndStateText;
// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
/// <summary>
/// Constructor
/// </summary>
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
public CycleEndForm(int waterMetersCount)
{
this.WaterMetersCount = waterMetersCount;
InitializeComponent();
EndStateText = new string[WaterMetersCount];
completed = false;
StartForceCloseHandler();
}
/// <summary> Parameterless constructor for 3 watermeters </summary>
public CycleEndForm()
: this(3)
{
}
private void CycleEndForm_Load(object sender, EventArgs e)
{
Localize();
Height = 50 + 90 * WaterMetersCount;
if (WaterMetersCount < 1) groupBox1.Visible = false;
if (WaterMetersCount < 2) groupBox2.Visible = false;
if (WaterMetersCount < 3) groupBox3.Visible = false;
if (WaterMetersCount < 4) groupBox4.Visible = false;
if (WaterMetersCount < 5) groupBox5.Visible = false;
if (WaterMetersCount < 6) groupBox6.Visible = false;
}
void Localize()
{
Text = Strings.Data;
groupBox1.Text = Strings.Water_Meter + " 1";
groupBox2.Text = Strings.Water_Meter + " 2";
groupBox3.Text = Strings.Water_Meter + " 3";
groupBox4.Text = Strings.Water_Meter + " 4";
groupBox5.Text = Strings.Water_Meter + " 5";
groupBox6.Text = Strings.Water_Meter + " 6";
label1.Text = Strings.State;
label2.Text = Strings.State;
label3.Text = Strings.State;
label4.Text = Strings.State;
label5.Text = Strings.State;
label6.Text = Strings.State;
okButton.Text = Strings.OkBtnText;
}
private void okButton_Click(object sender, EventArgs e)
{
if (WaterMetersCount >= 1) EndStateText[0] = textBox1.Text;
if (WaterMetersCount >= 2) EndStateText[1] = textBox3.Text;
if (WaterMetersCount >= 3) EndStateText[2] = textBox4.Text;
if (WaterMetersCount >= 4) EndStateText[3] = textBox5.Text;
if (WaterMetersCount >= 5) EndStateText[4] = textBox6.Text;
if (WaterMetersCount >= 6) EndStateText[5] = textBox6.Text;
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
}
}

View File

@ -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>

View File

@ -0,0 +1,276 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.BenchControl;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.DataEntry.iPerl
{
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.Standard24({0})", Cfg.ToString(1)); }
readonly EntryFormCfg entryFormCfg;
/// <summary>
/// Properties set by the Begin, End and WMStates form
/// </summary>
string purchaseOrder;
public string PurchaseOrder { get { return purchaseOrder; } }
string[] serialNr;
public string SerialNr(int wmNr) { return (wmNr >= 0 && wmNr < serialNr.Length) ? serialNr[wmNr] : string.Empty; }
bool[] disabled;
public bool Disabled(int wmNr) { return (wmNr >= 0 && wmNr < disabled.Length) ? disabled[wmNr] : false; }
string[] wmCycleEndState;
public string WMCycleEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmCycleEndState.Length) ? wmCycleEndState[wmNr] : string.Empty; }
float[] wmStartState;
public float WMStartState(int wmNr) { return (wmNr >= 0 && wmNr < wmStartState.Length) ? wmStartState[wmNr] : 0; }
float[] wmEndState;
public float WMEndState(int wmNr) { return (wmNr >= 0 && wmNr < wmEndState.Length) ? wmEndState[wmNr] : 0; }
string[] wmStartStateStr;
System.Windows.Forms.Form modelessDlg;
float refVolume;
float errLimLo;
float errLimHi;
bool resultSaved; /// Set in Run() when results are saved
IList<IWaterMeter> waterMeters; /// Passesd as an argument of ShowCycleBeginFormOp/ShowCycleEndFormOp constructor
public enum CurrentOp
{
None,
ShowFormAtCycleBeginning,
ShowFormAtCycleEnd,
EnterTestStartStates,
EnterTestEndStates,
}
CurrentOp currentOp;
public EntryForm()
{
}
public EntryForm(EntryFormCfg cfg)
: base(cfg)
{
serialNr = new string[Program.WMsCount];
disabled = new bool[Program.WMsCount];
wmStartState = new float[Program.WMsCount];
wmStartStateStr = new string[Program.WMsCount];
wmEndState = new float[Program.WMsCount];
wmCycleEndState = new string[Program.WMsCount];
entryFormCfg = cfg;
currentOp = CurrentOp.None;
log.Debug(this.ToString());
}
/// <returns>Reference to the operation</returns>
public IOperation ShowCycleBeginFormOp(IList<IWaterMeter> waterMeters)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.ShowFormAtCycleBeginning;
this.waterMeters = waterMeters;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowCycleEndFormOp(IList<IWaterMeter> waterMeters)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.ShowFormAtCycleEnd;
this.waterMeters = waterMeters;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowTestStartFormOp()
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.EnterTestStartStates;
return this;
}
/// <returns>Reference to the operation</returns>
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
{
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
currentOp = CurrentOp.EnterTestEndStates;
this.refVolume = refVolume;
this.errLimLo = errLimLo;
this.errLimHi = errLimHi;
return this;
}
delegate void EntryFormDlgt(EntryForm myRef);
///
void OpenBeginningDlg(EntryForm myRef)
{
myRef.modelessDlg = new CycleBeginningForm(Program.WMsCount);
modelessDlg.Show();
}
///
void OpenEndDlg(EntryForm myRef)
{
myRef.modelessDlg = new CycleEndForm(Program.WMsCount);
modelessDlg.Show();
}
///
void OpenTestStartStatesDlg(EntryForm myRef)
{
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, disabled);
modelessDlg.Show();
}
///
void OpenTestEndStatesDlg(EntryForm myRef)
{
myRef.modelessDlg = new TestStartEndForm(Program.WMsCount, wmStartStateStr, 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.Count); i++)
{
if (waterMeters[i] != null)
{
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[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[i] = dlg.WMStartState[i];
wmStartStateStr[i] = dlg.WMStartStateStr[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[i] = dlg.WMEndState[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="waterMeters">Watermetes with information entered in the forms</param>
/// <param name="testResults">Test results to be updated with the information</param>
public void UpdateTestResults(IList<IWaterMeter> waterMeters, IList<Entities.TestResult> testResults)
{
foreach (var testRslt in testResults)
{
if (testRslt.MetersKind != Entities.MetersKind.Single) continue;
testRslt.PurchaseOrder = PurchaseOrder;
for (int i = 0; i < testRslt.Meters.Count; i++)
{
testRslt.Meters[i].SerialNr = SerialNr(i);
testRslt.Meters[i].Disabled = Disabled(i);
testRslt.Meters[i].EndState = WMCycleEndState(i);
}
}
}
}
}

View File

@ -0,0 +1,41 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.iPerl
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
/// Serialized parameters
///
public bool ShowCycleEndForm;
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
{
Name = "DataEntry-Standard-24";
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);
}
}
}

View File

@ -0,0 +1,81 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.iPerl
{
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;
}
}
}

View File

@ -0,0 +1,100 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
namespace TBF.BenchControl.DataEntry.iPerl
{
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(131, 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(32, 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(128, 32);
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(131, 90);
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.TabIndex = 13;
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;
}
}

View File

@ -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>

View File

@ -0,0 +1,23 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.iPerl
{
public class EntryFormFactory : IComponentFactory
{
public string ClassName { get { return "DataEntry-Standard-24"; } }
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
public IComponent DummyComponent() { return new EntryForm(); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
}
}
}

View File

@ -0,0 +1,649 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.DataEntry.iPerl
{
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 text boxes for serial numbers </summary>
public readonly int WaterMetersCount;
readonly bool[] disabled;
// To be retrieved after the form closes
public float[] WMStartState;
// To be retrieved after the form closes
public readonly string[] WMStartStateStr;
// To be retrieved after the form closes
public float[] WMEndState;
bool endStates; /// false=start states, true=end states
float refVolume;
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
int TextBoxesCount;
///
Label[] labels;
TextBox[] startTextBoxes;
TextBox[] endTextBoxes;
IList<TextBox> enabledTextBoxes;
/// <summary>
/// Parameterless constructor initializing common part for start and endstate form
/// </summary>
public TestStartEndForm()
{
InitializeComponent();
TextBoxesCount = 24;
labels = new Label[]
{
label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,
label11, label12, label13, label14, label15, label16, label17, label18, label19, label20,
label21, label22, label23, label24,
};
startTextBoxes = new TextBox[]
{
startTextBox1, startTextBox2, startTextBox3, startTextBox4, startTextBox5, startTextBox6,
startTextBox7, startTextBox8, startTextBox9, startTextBox10, startTextBox11, startTextBox12,
startTextBox13, startTextBox14, startTextBox15, startTextBox16, startTextBox17, startTextBox18,
startTextBox19, startTextBox20, startTextBox21, startTextBox22, startTextBox23, startTextBox24,
};
endTextBoxes = new TextBox[]
{
endTextBox1, endTextBox2, endTextBox3, endTextBox4, endTextBox5, endTextBox6,
endTextBox7, endTextBox8, endTextBox9, endTextBox10, endTextBox11, endTextBox12,
endTextBox13, endTextBox14, endTextBox15, endTextBox16, endTextBox17, endTextBox18,
endTextBox19, endTextBox20, endTextBox21, endTextBox22, endTextBox23, endTextBox24,
};
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, bool[] disabled)
: this()
{
endStates = false;
this.WaterMetersCount = waterMetersCount;
this.disabled = disabled;
ShuffleTextBoxes();
WMStartState = new float[waterMetersCount];
WMStartStateStr = new string[waterMetersCount];
}
/// <summary>
/// Constructor to fill in end states
/// </summary>
/// <param name="waterMetersCount">Number of water meters</param>
/// <param name="wmStartStateStr">Information entered on test start</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, string[] wmStartStateStr, bool[] disabled,
float refVolume, float errLimLo, float errLimHi)
: this()
{
endStates = true;
this.WaterMetersCount = waterMetersCount;
if (wmStartStateStr == null || wmStartStateStr.Length != waterMetersCount)
throw (new Exception("Invalid 'wmStartStateStr' argument"));
this.WMStartStateStr = wmStartStateStr;
this.disabled = disabled;
this.refVolume = refVolume;
this.warningLimLo = 2 * errLimLo;
this.warningLimHi = 2 * errLimHi;
ShuffleTextBoxes();
WMEndState = new float[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 (Program.WMsCount < TextBoxesCount)
{
int nrLines = Program.WMsCount / Program.LineSize;
int gap = (TextBoxesCount - Program.WMsCount) / nrLines;
int dest = 0;
for (int l = 0; l < nrLines; l++)
{
for (int i = 0; i < Program.LineSize; i++)
{
labels[dest] = labels[l * Program.LineSize + l * gap + i];
startTextBoxes[dest] = startTextBoxes[l * Program.LineSize + l * gap + i];
endTextBoxes[dest] = endTextBoxes[l * Program.LineSize + l * gap + i];
dest++;
}
}
TextBoxesCount = Program.WMsCount;
}
}
private void CycleEndForm_Load(object sender, EventArgs e)
{
Localize();
//Height = 115 + 90 * WaterMetersCount;
for (int i = 0; i < TextBoxesCount; i++)
{
if (i < WaterMetersCount)
{
labels[i].Visible = startTextBoxes[i].Visible = endTextBoxes[i].Visible = true;
}
}
if (endStates)
{
for (int i = 0; i < TextBoxesCount; i++)
{
if (WMStartStateStr != null && i < WMStartStateStr.Length)
{
startTextBoxes[i].Text = WMStartStateStr[i];
}
if (disabled != null && i < disabled.Length && disabled[i])
{
endTextBoxes[i].Enabled = false;
}
else
{
endTextBoxes[i].Enabled = true;
enabledTextBoxes.Add(endTextBoxes[i]);
}
}
}
else
{
for (int i = 0; i < TextBoxesCount; i++)
{
if (disabled != null && i < disabled.Length && disabled[i])
{
startTextBoxes[i].Enabled = false;
}
else
{
startTextBoxes[i].Enabled = true;
enabledTextBoxes.Add(startTextBoxes[i]);
}
}
}
}
void Localize()
{
Text = Strings.Water_Meter_States;
for (int i = 0; i < TextBoxesCount; i++)
{
labels[i].Text = Strings.Water_Meter + " " + (i + 1).ToString();
}
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 (endTextBoxes[i].Visible && endTextBoxes[i].Enabled)
{
WMEndState[i] = Utils.ParseUFloat(endTextBoxes[i].Text);
}
}
}
else
{
for (int i = 0; i < Math.Min(WaterMetersCount, TextBoxesCount); i++)
{
if (startTextBoxes[i].Visible && startTextBoxes[i].Enabled)
{
WMStartStateStr[i] = startTextBoxes[i].Text;
WMStartState[i] = Utils.ParseUFloat(startTextBoxes[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 endTextBoxes (1..24).
/// </summary>
private void endTextBox1_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox1.Text);
float startState = Utils.ParseUFloat(startTextBox1.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { };
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox2_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox2.Text);
float startState = Utils.ParseUFloat(startTextBox2.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox3_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox3.Text);
float startState = Utils.ParseUFloat(startTextBox3.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox4_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox4.Text);
float startState = Utils.ParseUFloat(startTextBox4.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox5_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox5.Text);
float startState = Utils.ParseUFloat(startTextBox5.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox6_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox6.Text);
float startState = Utils.ParseUFloat(startTextBox6.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox7_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox7.Text);
float startState = Utils.ParseUFloat(startTextBox7.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox8_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox8.Text);
float startState = Utils.ParseUFloat(startTextBox8.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox9_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox9.Text);
float startState = Utils.ParseUFloat(startTextBox9.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox10_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox10.Text);
float startState = Utils.ParseUFloat(startTextBox10.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox11_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox11.Text);
float startState = Utils.ParseUFloat(startTextBox11.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox12_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox12.Text);
float startState = Utils.ParseUFloat(startTextBox12.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox13_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox13.Text);
float startState = Utils.ParseUFloat(startTextBox13.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox14_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox14.Text);
float startState = Utils.ParseUFloat(startTextBox14.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox15_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox15.Text);
float startState = Utils.ParseUFloat(startTextBox15.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox16_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox16.Text);
float startState = Utils.ParseUFloat(startTextBox16.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox17_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox17.Text);
float startState = Utils.ParseUFloat(startTextBox17.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox18_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox18.Text);
float startState = Utils.ParseUFloat(startTextBox18.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox19_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox19.Text);
float startState = Utils.ParseUFloat(startTextBox19.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox20_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox20.Text);
float startState = Utils.ParseUFloat(startTextBox20.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox21_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox21.Text);
float startState = Utils.ParseUFloat(startTextBox21.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox22_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox22.Text);
float startState = Utils.ParseUFloat(startTextBox22.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox23_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox23.Text);
float startState = Utils.ParseUFloat(startTextBox23.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
}
private void endTextBox24_TextChanged(object sender, EventArgs e)
{
float err = 0;
try
{
float endState = Utils.ParseUFloat(endTextBox24.Text);
float startState = Utils.ParseUFloat(startTextBox24.Text);
err = 100.0f * (endState - startState - refVolume) / refVolume;
}
catch { err = 1000.0f; };
exclamation24.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 startTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox1); }
private void startTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox2); }
private void startTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox3); }
private void startTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox4); }
private void startTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox5); }
private void startTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox6); }
private void startTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox7); }
private void startTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox8); }
private void startTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox9); }
private void startTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox10); }
private void startTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox11); }
private void startTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox12); }
private void startTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox13); }
private void startTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox14); }
private void startTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox15); }
private void startTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox16); }
private void startTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox17); }
private void startTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox18); }
private void startTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox19); }
private void startTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox20); }
private void startTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox21); }
private void startTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox22); }
private void startTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox23); }
private void startTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, startTextBox24); }
private void endTextBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox1); }
private void endTextBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox2); }
private void endTextBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox3); }
private void endTextBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox4); }
private void endTextBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox5); }
private void endTextBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox6); }
private void endTextBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox7); }
private void endTextBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox8); }
private void endTextBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox9); }
private void endTextBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox10); }
private void endTextBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox11); }
private void endTextBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox12); }
private void endTextBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox13); }
private void endTextBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox14); }
private void endTextBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox15); }
private void endTextBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox16); }
private void endTextBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox17); }
private void endTextBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox18); }
private void endTextBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox19); }
private void endTextBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox20); }
private void endTextBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox21); }
private void endTextBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox22); }
private void endTextBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox23); }
private void endTextBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, endTextBox24); }
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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>

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.5.94.1")]
[assembly: AssemblyFileVersion("1.5.94.1")]
[assembly: AssemblyVersion("1.5.95.1")]
[assembly: AssemblyFileVersion("1.5.95.1")]

View File

@ -176,6 +176,33 @@
<Compile Include="BenchControl\DataEntry\Combined\TestStartEndForm.designer.cs">
<DependentUpon>TestStartEndForm.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\CycleBeginningForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\CycleBeginningForm.designer.cs">
<DependentUpon>CycleBeginningForm.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\CycleEndForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\CycleEndForm.designer.cs">
<DependentUpon>CycleEndForm.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\EntryForm.cs" />
<Compile Include="BenchControl\DataEntry\iPerl\EntryFormCfg.cs" />
<Compile Include="BenchControl\DataEntry\iPerl\EntryFormCfgCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\EntryFormCfgCtrl.designer.cs">
<DependentUpon>EntryFormCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\EntryFormFactory.cs" />
<Compile Include="BenchControl\DataEntry\iPerl\TestStartEndForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BenchControl\DataEntry\iPerl\TestStartEndForm.designer.cs">
<DependentUpon>TestStartEndForm.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\DataEntry\Standard24\CycleBeginningForm.cs">
<SubType>Form</SubType>
</Compile>
@ -1343,6 +1370,18 @@
<EmbeddedResource Include="BenchControl\DataEntry\Combined\TestStartEndForm.resx">
<DependentUpon>TestStartEndForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\iPerl\CycleBeginningForm.resx">
<DependentUpon>CycleBeginningForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\iPerl\CycleEndForm.resx">
<DependentUpon>CycleEndForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\iPerl\EntryFormCfgCtrl.resx">
<DependentUpon>EntryFormCfgCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\iPerl\TestStartEndForm.resx">
<DependentUpon>TestStartEndForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BenchControl\DataEntry\Munich3\CycleBeginningForm.resx">
<DependentUpon>CycleBeginningForm.cs</DependentUpon>
</EmbeddedResource>