DataEntry.StandardXX : EnterSerialNrsAtTheEnd and SensusExtensions supported in all StandardXX, ver.2.7.303

This commit is contained in:
Milan Hanajik
2016-06-10 13:03:00 +02:00
parent 2c0e8c90ed
commit d439d94645
18 changed files with 577 additions and 392 deletions
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -152,10 +152,17 @@ namespace TBF.BenchControl.DataEntry.Standard12
switch (currentOp) switch (currentOp)
{ {
case CurrentOp.ShowFormAtCycleBeginning: case CurrentOp.ShowFormAtCycleBeginning:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); if (!entryFormCfg.EnterSerialNrsAtTheEnd)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
}
break; break;
case CurrentOp.ShowFormAtCycleEnd: case CurrentOp.ShowFormAtCycleEnd:
if (entryFormCfg.ShowCycleEndForm) if (entryFormCfg.EnterSerialNrsAtTheEnd)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
}
else if (entryFormCfg.ShowCycleEndForm)
{ {
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this); Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this);
} }
@@ -180,60 +187,64 @@ namespace TBF.BenchControl.DataEntry.Standard12
if (!resultSaved) /// This is to save the result only once if (!resultSaved) /// This is to save the result only once
{ {
if (currentOp == CurrentOp.ShowFormAtCycleBeginning) if ((!entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleBeginning) ||
(entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleEnd))
{ {
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm); CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
if (dlg != null) if (dlg != null)
{ {
purchaseOrder = dlg.PurchaseOrder; purchaseOrder = dlg.PurchaseOrder;
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++) for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
{ {
if (waterMeters[i] != null) if (waterMeters[i] != null)
{ {
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i]; serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
} }
} }
} }
} }
else if (currentOp == CurrentOp.ShowFormAtCycleEnd) else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd)
{ {
CycleEndForm dlg = (modelessDlg as CycleEndForm); CycleEndForm dlg = (modelessDlg as CycleEndForm);
int count = waterMeters.Length; int count = waterMeters.Length;
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount; if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
if (waterMeters[i] != null) if (waterMeters[i] != null)
{ {
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty /// 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; wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
} }
} }
} }
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates) else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
{ {
/// Fixed start test - start /// Fixed start test - start
TestStartEndForm dlg = (modelessDlg as TestStartEndForm); TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
if (dlg != null)
for (int i = 0; i < dlg.WaterMetersCount; i++)
{ {
wmStartState[i] = dlg.WMStartState[i]; for (int i = 0; i < dlg.WaterMetersCount; i++)
wmStartStateStr[i] = dlg.WMStartStateStr[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);
if (dlg != null)
{
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
wmEndState[i] = dlg.WMEndState[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; resultSaved = true;
modelessDlg = null; modelessDlg = null;
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -17,14 +17,18 @@ namespace TBF.BenchControl.DataEntry.Standard12
/// ///
/// Serialized parameters /// Serialized parameters
/// ///
public bool EnterSerialNrsAtTheEnd;
public bool ShowCycleEndForm; public bool ShowCycleEndForm;
public bool SensusExtensions;
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg() EntryFormCfg()
{ {
Name = "DataEntry-Standard-12"; Name = "DataEntry-Standard-12";
ParentName = string.Empty; ParentName = string.Empty;
EnterSerialNrsAtTheEnd = false;
ShowCycleEndForm = false; ShowCycleEndForm = false;
SensusExtensions = false;
} }
public EntryFormCfg(IComponentFactory factory) public EntryFormCfg(IComponentFactory factory)
@@ -35,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
public string ToString(int i) public string ToString(int i)
{ {
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm); return string.Format("Name={0}, EnterSNsAtTheEnd={1}, ShowEndForm={2}, SensusExt={3}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm, SensusExtensions);
} }
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
@@ -39,8 +39,10 @@ namespace TBF.BenchControl.DataEntry.Standard12
void Localize() void Localize()
{ {
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form; enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end;
} showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form;
sensusExtensionsCheckBox.Text = Strings.Sensus_production_extensions;
}
public void Closing() public void Closing()
{ {
@@ -51,14 +53,18 @@ namespace TBF.BenchControl.DataEntry.Standard12
if (config == null) return; /// Control was not loaded, settings were not changed if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName; classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name; nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm; enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
sensusExtensionsCheckBox.Checked = config.SensusExtensions;
} }
public void Unlock() public void Unlock()
{ {
nameTextBox.Enabled = true; nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true; enterSNsAtTheEndCheckBox.Enabled = true;
} showEndStateFormCheckBox.Enabled = true;
sensusExtensionsCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message) public CfgUpdateFlags VerifyCfg(ref string message)
{ {
@@ -73,7 +79,9 @@ namespace TBF.BenchControl.DataEntry.Standard12
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text; config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
config.SensusExtensions = sensusExtensionsCheckBox.Checked;
return flags; return flags;
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2013-2015 Sensus Metering Systems
/// ///
namespace TBF.BenchControl.DataEntry.Standard12 namespace TBF.BenchControl.DataEntry.Standard12
{ {
@@ -31,62 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard12
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.nameTextBox = new System.Windows.Forms.TextBox(); this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label(); this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label(); this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox(); this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox();
// this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox();
// nameTextBox this.SuspendLayout();
// //
this.nameTextBox.Enabled = false; // nameTextBox
this.nameTextBox.Location = new System.Drawing.Point(131, 57); //
this.nameTextBox.Name = "nameTextBox"; this.nameTextBox.Enabled = false;
this.nameTextBox.Size = new System.Drawing.Size(130, 20); this.nameTextBox.Location = new System.Drawing.Point(99, 57);
this.nameTextBox.TabIndex = 5; this.nameTextBox.Name = "nameTextBox";
// this.nameTextBox.Size = new System.Drawing.Size(130, 20);
// nameLabel this.nameTextBox.TabIndex = 2;
// //
this.nameLabel.AutoSize = true; // nameLabel
this.nameLabel.Location = new System.Drawing.Point(32, 60); //
this.nameLabel.Name = "nameLabel"; this.nameLabel.AutoSize = true;
this.nameLabel.Size = new System.Drawing.Size(35, 13); this.nameLabel.Location = new System.Drawing.Point(35, 60);
this.nameLabel.TabIndex = 4; this.nameLabel.Name = "nameLabel";
this.nameLabel.Text = "Name"; this.nameLabel.Size = new System.Drawing.Size(35, 13);
// this.nameLabel.TabIndex = 1;
// classNameLabel this.nameLabel.Text = "Name";
// //
this.classNameLabel.AutoSize = true; // classNameLabel
this.classNameLabel.Location = new System.Drawing.Point(128, 32); //
this.classNameLabel.Name = "classNameLabel"; this.classNameLabel.AutoSize = true;
this.classNameLabel.Size = new System.Drawing.Size(83, 13); this.classNameLabel.Location = new System.Drawing.Point(96, 33);
this.classNameLabel.TabIndex = 3; this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Text = "ComonentName"; this.classNameLabel.Size = new System.Drawing.Size(83, 13);
// this.classNameLabel.TabIndex = 0;
// showCycleEndFormCheckBox this.classNameLabel.Text = "ComonentName";
// //
this.showCycleEndFormCheckBox.AutoSize = true; // showEndStateFormCheckBox
this.showCycleEndFormCheckBox.Enabled = false; //
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90); this.showEndStateFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox"; this.showEndStateFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17); this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112);
this.showCycleEndFormCheckBox.TabIndex = 13; this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox";
this.showCycleEndFormCheckBox.Text = "Show cycle end form"; this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17);
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true; this.showEndStateFormCheckBox.TabIndex = 4;
// this.showEndStateFormCheckBox.Text = "Watermeter end state form";
// EntryFormCfgCtrl this.showEndStateFormCheckBox.UseVisualStyleBackColor = true;
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); // enterSNsAtTheEndCheckBox
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; //
this.Controls.Add(this.showCycleEndFormCheckBox); this.enterSNsAtTheEndCheckBox.AutoSize = true;
this.Controls.Add(this.nameTextBox); this.enterSNsAtTheEndCheckBox.Enabled = false;
this.Controls.Add(this.nameLabel); this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89);
this.Controls.Add(this.classNameLabel); this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox";
this.Name = "EntryFormCfgCtrl"; this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17);
this.Size = new System.Drawing.Size(300, 200); this.enterSNsAtTheEndCheckBox.TabIndex = 3;
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end";
this.ResumeLayout(false); this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true;
this.PerformLayout(); //
// sensusExtensionsCheckBox
//
this.sensusExtensionsCheckBox.AutoSize = true;
this.sensusExtensionsCheckBox.Enabled = false;
this.sensusExtensionsCheckBox.Location = new System.Drawing.Point(99, 135);
this.sensusExtensionsCheckBox.Name = "sensusExtensionsCheckBox";
this.sensusExtensionsCheckBox.Size = new System.Drawing.Size(167, 17);
this.sensusExtensionsCheckBox.TabIndex = 5;
this.sensusExtensionsCheckBox.Text = "Sensus production extensions";
this.sensusExtensionsCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.sensusExtensionsCheckBox);
this.Controls.Add(this.enterSNsAtTheEndCheckBox);
this.Controls.Add(this.showEndStateFormCheckBox);
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();
} }
@@ -95,6 +121,8 @@ namespace TBF.BenchControl.DataEntry.Standard12
private System.Windows.Forms.TextBox nameTextBox; private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel; private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel; private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showCycleEndFormCheckBox; private System.Windows.Forms.CheckBox showEndStateFormCheckBox;
private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox;
private System.Windows.Forms.CheckBox sensusExtensionsCheckBox;
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -152,10 +152,17 @@ namespace TBF.BenchControl.DataEntry.Standard24
switch (currentOp) switch (currentOp)
{ {
case CurrentOp.ShowFormAtCycleBeginning: case CurrentOp.ShowFormAtCycleBeginning:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); if (!entryFormCfg.EnterSerialNrsAtTheEnd)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
}
break; break;
case CurrentOp.ShowFormAtCycleEnd: case CurrentOp.ShowFormAtCycleEnd:
if (entryFormCfg.ShowCycleEndForm) if (entryFormCfg.EnterSerialNrsAtTheEnd)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
}
else if (entryFormCfg.ShowCycleEndForm)
{ {
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this); Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this);
} }
@@ -180,60 +187,64 @@ namespace TBF.BenchControl.DataEntry.Standard24
if (!resultSaved) /// This is to save the result only once if (!resultSaved) /// This is to save the result only once
{ {
if (currentOp == CurrentOp.ShowFormAtCycleBeginning) if ((!entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleBeginning) ||
(entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleEnd))
{ {
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm); CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
if (dlg != null) if (dlg != null)
{ {
purchaseOrder = dlg.PurchaseOrder; purchaseOrder = dlg.PurchaseOrder;
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++) for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
{ {
if (waterMeters[i] != null) if (waterMeters[i] != null)
{ {
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i]; serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
} }
} }
} }
} }
else if (currentOp == CurrentOp.ShowFormAtCycleEnd) else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd)
{ {
CycleEndForm dlg = (modelessDlg as CycleEndForm); CycleEndForm dlg = (modelessDlg as CycleEndForm);
int count = waterMeters.Length; int count = waterMeters.Length;
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount; if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
if (waterMeters[i] != null) if (waterMeters[i] != null)
{ {
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty /// 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; wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
} }
} }
} }
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates) else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
{ {
/// Fixed start test - start /// Fixed start test - start
TestStartEndForm dlg = (modelessDlg as TestStartEndForm); TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
if (dlg != null)
for (int i = 0; i < dlg.WaterMetersCount; i++)
{ {
wmStartState[i] = dlg.WMStartState[i]; for (int i = 0; i < dlg.WaterMetersCount; i++)
wmStartStateStr[i] = dlg.WMStartStateStr[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);
if (dlg != null)
{
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
wmEndState[i] = dlg.WMEndState[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; resultSaved = true;
modelessDlg = null; modelessDlg = null;
} }
@@ -252,12 +263,12 @@ namespace TBF.BenchControl.DataEntry.Standard24
currentOp = CurrentOp.None; currentOp = CurrentOp.None;
} }
/// <summary> /// <summary>
/// Updates test results with the information collected in watermeters. /// Updates test results with the information collected in watermeters.
/// </summary> /// </summary>
/// <param name="batchResults">Test results to be updated with the information</param> /// <param name="batchResults">Test results to be updated with the information</param>
public void UpdateTestResults(Results.BatchResults batchResults) public void UpdateTestResults(Results.BatchResults batchResults)
{ {
foreach (var wm in batchResults.WaterMeters) foreach (var wm in batchResults.WaterMeters)
{ {
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder; if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -17,14 +17,18 @@ namespace TBF.BenchControl.DataEntry.Standard24
/// ///
/// Serialized parameters /// Serialized parameters
/// ///
public bool EnterSerialNrsAtTheEnd;
public bool ShowCycleEndForm; public bool ShowCycleEndForm;
public bool SensusExtensions;
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg() EntryFormCfg()
{ {
Name = "DataEntry-Standard-24"; Name = "DataEntry-Standard-24";
ParentName = string.Empty; ParentName = string.Empty;
EnterSerialNrsAtTheEnd = false;
ShowCycleEndForm = false; ShowCycleEndForm = false;
SensusExtensions = false;
} }
public EntryFormCfg(IComponentFactory factory) public EntryFormCfg(IComponentFactory factory)
@@ -35,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
public string ToString(int i) public string ToString(int i)
{ {
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm); return string.Format("Name={0}, EnterSNsAtTheEnd={1}, ShowEndForm={2}, SensusExt={3}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm, SensusExtensions);
} }
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
@@ -39,8 +39,10 @@ namespace TBF.BenchControl.DataEntry.Standard24
void Localize() void Localize()
{ {
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form; enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end;
} showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form;
sensusExtensionsCheckBox.Text = Strings.Sensus_production_extensions;
}
public void Closing() public void Closing()
{ {
@@ -51,14 +53,18 @@ namespace TBF.BenchControl.DataEntry.Standard24
if (config == null) return; /// Control was not loaded, settings were not changed if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName; classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name; nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm; enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
sensusExtensionsCheckBox.Checked = config.SensusExtensions;
} }
public void Unlock() public void Unlock()
{ {
nameTextBox.Enabled = true; nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true; enterSNsAtTheEndCheckBox.Enabled = true;
} showEndStateFormCheckBox.Enabled = true;
sensusExtensionsCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message) public CfgUpdateFlags VerifyCfg(ref string message)
{ {
@@ -73,7 +79,9 @@ namespace TBF.BenchControl.DataEntry.Standard24
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text; config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
config.SensusExtensions = sensusExtensionsCheckBox.Checked;
return flags; return flags;
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2015 Sensus Metering Systems
/// ///
namespace TBF.BenchControl.DataEntry.Standard24 namespace TBF.BenchControl.DataEntry.Standard24
{ {
@@ -31,62 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard24
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.nameTextBox = new System.Windows.Forms.TextBox(); this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label(); this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label(); this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox(); this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox();
// this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox();
// nameTextBox this.SuspendLayout();
// //
this.nameTextBox.Enabled = false; // nameTextBox
this.nameTextBox.Location = new System.Drawing.Point(131, 57); //
this.nameTextBox.Name = "nameTextBox"; this.nameTextBox.Enabled = false;
this.nameTextBox.Size = new System.Drawing.Size(130, 20); this.nameTextBox.Location = new System.Drawing.Point(99, 57);
this.nameTextBox.TabIndex = 5; this.nameTextBox.Name = "nameTextBox";
// this.nameTextBox.Size = new System.Drawing.Size(130, 20);
// nameLabel this.nameTextBox.TabIndex = 2;
// //
this.nameLabel.AutoSize = true; // nameLabel
this.nameLabel.Location = new System.Drawing.Point(32, 60); //
this.nameLabel.Name = "nameLabel"; this.nameLabel.AutoSize = true;
this.nameLabel.Size = new System.Drawing.Size(35, 13); this.nameLabel.Location = new System.Drawing.Point(35, 60);
this.nameLabel.TabIndex = 4; this.nameLabel.Name = "nameLabel";
this.nameLabel.Text = "Name"; this.nameLabel.Size = new System.Drawing.Size(35, 13);
// this.nameLabel.TabIndex = 1;
// classNameLabel this.nameLabel.Text = "Name";
// //
this.classNameLabel.AutoSize = true; // classNameLabel
this.classNameLabel.Location = new System.Drawing.Point(128, 32); //
this.classNameLabel.Name = "classNameLabel"; this.classNameLabel.AutoSize = true;
this.classNameLabel.Size = new System.Drawing.Size(83, 13); this.classNameLabel.Location = new System.Drawing.Point(96, 33);
this.classNameLabel.TabIndex = 3; this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Text = "ComonentName"; this.classNameLabel.Size = new System.Drawing.Size(83, 13);
// this.classNameLabel.TabIndex = 0;
// showCycleEndFormCheckBox this.classNameLabel.Text = "ComonentName";
// //
this.showCycleEndFormCheckBox.AutoSize = true; // showEndStateFormCheckBox
this.showCycleEndFormCheckBox.Enabled = false; //
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90); this.showEndStateFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox"; this.showEndStateFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17); this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112);
this.showCycleEndFormCheckBox.TabIndex = 13; this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox";
this.showCycleEndFormCheckBox.Text = "Show cycle end form"; this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17);
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true; this.showEndStateFormCheckBox.TabIndex = 4;
// this.showEndStateFormCheckBox.Text = "Watermeter end state form";
// EntryFormCfgCtrl this.showEndStateFormCheckBox.UseVisualStyleBackColor = true;
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); // enterSNsAtTheEndCheckBox
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; //
this.Controls.Add(this.showCycleEndFormCheckBox); this.enterSNsAtTheEndCheckBox.AutoSize = true;
this.Controls.Add(this.nameTextBox); this.enterSNsAtTheEndCheckBox.Enabled = false;
this.Controls.Add(this.nameLabel); this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89);
this.Controls.Add(this.classNameLabel); this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox";
this.Name = "EntryFormCfgCtrl"; this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17);
this.Size = new System.Drawing.Size(300, 200); this.enterSNsAtTheEndCheckBox.TabIndex = 3;
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end";
this.ResumeLayout(false); this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true;
this.PerformLayout(); //
// sensusExtensionsCheckBox
//
this.sensusExtensionsCheckBox.AutoSize = true;
this.sensusExtensionsCheckBox.Enabled = false;
this.sensusExtensionsCheckBox.Location = new System.Drawing.Point(99, 135);
this.sensusExtensionsCheckBox.Name = "sensusExtensionsCheckBox";
this.sensusExtensionsCheckBox.Size = new System.Drawing.Size(167, 17);
this.sensusExtensionsCheckBox.TabIndex = 5;
this.sensusExtensionsCheckBox.Text = "Sensus production extensions";
this.sensusExtensionsCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.sensusExtensionsCheckBox);
this.Controls.Add(this.enterSNsAtTheEndCheckBox);
this.Controls.Add(this.showEndStateFormCheckBox);
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();
} }
@@ -95,6 +121,8 @@ namespace TBF.BenchControl.DataEntry.Standard24
private System.Windows.Forms.TextBox nameTextBox; private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel; private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel; private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showCycleEndFormCheckBox; private System.Windows.Forms.CheckBox showEndStateFormCheckBox;
private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox;
private System.Windows.Forms.CheckBox sensusExtensionsCheckBox;
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -152,10 +152,17 @@ namespace TBF.BenchControl.DataEntry.Standard48
switch (currentOp) switch (currentOp)
{ {
case CurrentOp.ShowFormAtCycleBeginning: case CurrentOp.ShowFormAtCycleBeginning:
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); if (!entryFormCfg.EnterSerialNrsAtTheEnd)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
}
break; break;
case CurrentOp.ShowFormAtCycleEnd: case CurrentOp.ShowFormAtCycleEnd:
if (entryFormCfg.ShowCycleEndForm) if (entryFormCfg.EnterSerialNrsAtTheEnd)
{
Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this);
}
else if (entryFormCfg.ShowCycleEndForm)
{ {
Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this); Program.MainWnd.Invoke(new EntryFormDlgt(OpenEndDlg), this);
} }
@@ -180,60 +187,64 @@ namespace TBF.BenchControl.DataEntry.Standard48
if (!resultSaved) /// This is to save the result only once if (!resultSaved) /// This is to save the result only once
{ {
if (currentOp == CurrentOp.ShowFormAtCycleBeginning) if ((!entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleBeginning) ||
(entryFormCfg.EnterSerialNrsAtTheEnd && currentOp == CurrentOp.ShowFormAtCycleEnd))
{ {
CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm); CycleBeginningForm dlg = (modelessDlg as CycleBeginningForm);
if (dlg != null) if (dlg != null)
{ {
purchaseOrder = dlg.PurchaseOrder; purchaseOrder = dlg.PurchaseOrder;
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++) for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++)
{ {
if (waterMeters[i] != null) if (waterMeters[i] != null)
{ {
serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i]; serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
} }
} }
} }
} }
else if (currentOp == CurrentOp.ShowFormAtCycleEnd) else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd)
{ {
CycleEndForm dlg = (modelessDlg as CycleEndForm); CycleEndForm dlg = (modelessDlg as CycleEndForm);
int count = waterMeters.Length; int count = waterMeters.Length;
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount; if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
if (waterMeters[i] != null) if (waterMeters[i] != null)
{ {
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty /// 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; wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
} }
} }
} }
else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates) else if (modelessDlg is TestStartEndForm && currentOp == CurrentOp.EnterTestStartStates)
{ {
/// Fixed start test - start /// Fixed start test - start
TestStartEndForm dlg = (modelessDlg as TestStartEndForm); TestStartEndForm dlg = (modelessDlg as TestStartEndForm);
if (dlg != null)
for (int i = 0; i < dlg.WaterMetersCount; i++)
{ {
wmStartState[i] = dlg.WMStartState[i]; for (int i = 0; i < dlg.WaterMetersCount; i++)
wmStartStateStr[i] = dlg.WMStartStateStr[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);
if (dlg != null)
{
for (int i = 0; i < dlg.WaterMetersCount; i++)
{
wmEndState[i] = dlg.WMEndState[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; resultSaved = true;
modelessDlg = null; modelessDlg = null;
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -17,14 +17,18 @@ namespace TBF.BenchControl.DataEntry.Standard48
/// ///
/// Serialized parameters /// Serialized parameters
/// ///
public bool EnterSerialNrsAtTheEnd;
public bool ShowCycleEndForm; public bool ShowCycleEndForm;
public bool SensusExtensions;
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg() EntryFormCfg()
{ {
Name = "DataEntry-Standard-48"; Name = "DataEntry-Standard-48";
ParentName = string.Empty; ParentName = string.Empty;
EnterSerialNrsAtTheEnd = false;
ShowCycleEndForm = false; ShowCycleEndForm = false;
SensusExtensions = false;
} }
public EntryFormCfg(IComponentFactory factory) public EntryFormCfg(IComponentFactory factory)
@@ -35,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
public string ToString(int i) public string ToString(int i)
{ {
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm); return string.Format("Name={0}, EnterSNsAtTheEnd={1}, ShowEndForm={2}, SensusExt={3}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm, SensusExtensions);
} }
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
@@ -39,8 +39,10 @@ namespace TBF.BenchControl.DataEntry.Standard48
void Localize() void Localize()
{ {
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form; enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end;
} showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form;
sensusExtensionsCheckBox.Text = Strings.Sensus_production_extensions;
}
public void Closing() public void Closing()
{ {
@@ -51,14 +53,18 @@ namespace TBF.BenchControl.DataEntry.Standard48
if (config == null) return; /// Control was not loaded, settings were not changed if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName; classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name; nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm; enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
sensusExtensionsCheckBox.Checked = config.SensusExtensions;
} }
public void Unlock() public void Unlock()
{ {
nameTextBox.Enabled = true; nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true; enterSNsAtTheEndCheckBox.Enabled = true;
} showEndStateFormCheckBox.Enabled = true;
sensusExtensionsCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message) public CfgUpdateFlags VerifyCfg(ref string message)
{ {
@@ -73,7 +79,9 @@ namespace TBF.BenchControl.DataEntry.Standard48
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text; config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
config.SensusExtensions = sensusExtensionsCheckBox.Checked;
return flags; return flags;
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2015 Sensus Metering Systems /// Copyright (c) 2015-2015 Sensus Metering Systems
/// ///
namespace TBF.BenchControl.DataEntry.Standard48 namespace TBF.BenchControl.DataEntry.Standard48
{ {
@@ -31,62 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard48
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.nameTextBox = new System.Windows.Forms.TextBox(); this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label(); this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label(); this.classNameLabel = new System.Windows.Forms.Label();
this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox(); this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox();
// this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox();
// nameTextBox this.SuspendLayout();
// //
this.nameTextBox.Enabled = false; // nameTextBox
this.nameTextBox.Location = new System.Drawing.Point(131, 57); //
this.nameTextBox.Name = "nameTextBox"; this.nameTextBox.Enabled = false;
this.nameTextBox.Size = new System.Drawing.Size(130, 20); this.nameTextBox.Location = new System.Drawing.Point(99, 57);
this.nameTextBox.TabIndex = 5; this.nameTextBox.Name = "nameTextBox";
// this.nameTextBox.Size = new System.Drawing.Size(130, 20);
// nameLabel this.nameTextBox.TabIndex = 2;
// //
this.nameLabel.AutoSize = true; // nameLabel
this.nameLabel.Location = new System.Drawing.Point(32, 60); //
this.nameLabel.Name = "nameLabel"; this.nameLabel.AutoSize = true;
this.nameLabel.Size = new System.Drawing.Size(35, 13); this.nameLabel.Location = new System.Drawing.Point(35, 60);
this.nameLabel.TabIndex = 4; this.nameLabel.Name = "nameLabel";
this.nameLabel.Text = "Name"; this.nameLabel.Size = new System.Drawing.Size(35, 13);
// this.nameLabel.TabIndex = 1;
// classNameLabel this.nameLabel.Text = "Name";
// //
this.classNameLabel.AutoSize = true; // classNameLabel
this.classNameLabel.Location = new System.Drawing.Point(128, 32); //
this.classNameLabel.Name = "classNameLabel"; this.classNameLabel.AutoSize = true;
this.classNameLabel.Size = new System.Drawing.Size(83, 13); this.classNameLabel.Location = new System.Drawing.Point(96, 33);
this.classNameLabel.TabIndex = 3; this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Text = "ComonentName"; this.classNameLabel.Size = new System.Drawing.Size(83, 13);
// this.classNameLabel.TabIndex = 0;
// showCycleEndFormCheckBox this.classNameLabel.Text = "ComonentName";
// //
this.showCycleEndFormCheckBox.AutoSize = true; // showEndStateFormCheckBox
this.showCycleEndFormCheckBox.Enabled = false; //
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(131, 90); this.showEndStateFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox"; this.showEndStateFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17); this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112);
this.showCycleEndFormCheckBox.TabIndex = 13; this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox";
this.showCycleEndFormCheckBox.Text = "Show cycle end form"; this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17);
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true; this.showEndStateFormCheckBox.TabIndex = 4;
// this.showEndStateFormCheckBox.Text = "Watermeter end state form";
// EntryFormCfgCtrl this.showEndStateFormCheckBox.UseVisualStyleBackColor = true;
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); // enterSNsAtTheEndCheckBox
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; //
this.Controls.Add(this.showCycleEndFormCheckBox); this.enterSNsAtTheEndCheckBox.AutoSize = true;
this.Controls.Add(this.nameTextBox); this.enterSNsAtTheEndCheckBox.Enabled = false;
this.Controls.Add(this.nameLabel); this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89);
this.Controls.Add(this.classNameLabel); this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox";
this.Name = "EntryFormCfgCtrl"; this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17);
this.Size = new System.Drawing.Size(300, 200); this.enterSNsAtTheEndCheckBox.TabIndex = 3;
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end";
this.ResumeLayout(false); this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true;
this.PerformLayout(); //
// sensusExtensionsCheckBox
//
this.sensusExtensionsCheckBox.AutoSize = true;
this.sensusExtensionsCheckBox.Enabled = false;
this.sensusExtensionsCheckBox.Location = new System.Drawing.Point(99, 135);
this.sensusExtensionsCheckBox.Name = "sensusExtensionsCheckBox";
this.sensusExtensionsCheckBox.Size = new System.Drawing.Size(167, 17);
this.sensusExtensionsCheckBox.TabIndex = 5;
this.sensusExtensionsCheckBox.Text = "Sensus production extensions";
this.sensusExtensionsCheckBox.UseVisualStyleBackColor = true;
//
// EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.sensusExtensionsCheckBox);
this.Controls.Add(this.enterSNsAtTheEndCheckBox);
this.Controls.Add(this.showEndStateFormCheckBox);
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();
} }
@@ -95,6 +121,8 @@ namespace TBF.BenchControl.DataEntry.Standard48
private System.Windows.Forms.TextBox nameTextBox; private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel; private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel; private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showCycleEndFormCheckBox; private System.Windows.Forms.CheckBox showEndStateFormCheckBox;
private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox;
private System.Windows.Forms.CheckBox sensusExtensionsCheckBox;
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2015 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasWMStatesForm
{ {
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm)); private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
public override string ToString() { return string.Format("DataEntry.Standard({0})", Cfg.ToString(1)); } public override string ToString() { return string.Format("DataEntry.Standard6({0})", Cfg.ToString(1)); }
readonly EntryFormCfg entryFormCfg; readonly EntryFormCfg entryFormCfg;
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2015 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -19,6 +19,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// ///
public bool EnterSerialNrsAtTheEnd; public bool EnterSerialNrsAtTheEnd;
public bool ShowCycleEndForm; public bool ShowCycleEndForm;
public bool SensusExtensions;
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg() EntryFormCfg()
@@ -27,6 +28,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
ParentName = string.Empty; ParentName = string.Empty;
EnterSerialNrsAtTheEnd = false; EnterSerialNrsAtTheEnd = false;
ShowCycleEndForm = false; ShowCycleEndForm = false;
SensusExtensions = false;
} }
public EntryFormCfg(IComponentFactory factory) public EntryFormCfg(IComponentFactory factory)
@@ -37,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
public string ToString(int i) public string ToString(int i)
{ {
return string.Format("Name={0}, EnterSNsAtTheEnd={1}, ShowEndForm={2}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm); return string.Format("Name={0}, EnterSNsAtTheEnd={1}, ShowEndForm={2}, SensusExt={3}", Name, EnterSerialNrsAtTheEnd, ShowCycleEndForm, SensusExtensions);
} }
} }
} }
@@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2015 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
@@ -41,7 +41,8 @@ namespace TBF.BenchControl.DataEntry.Standard6
{ {
enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end; enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end;
showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form; showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form;
} sensusExtensionsCheckBox.Text = Strings.Sensus_production_extensions;
}
public void Closing() public void Closing()
{ {
@@ -54,6 +55,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
nameTextBox.Text = config.Name; nameTextBox.Text = config.Name;
enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd; enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd;
showEndStateFormCheckBox.Checked = config.ShowCycleEndForm; showEndStateFormCheckBox.Checked = config.ShowCycleEndForm;
sensusExtensionsCheckBox.Checked = config.SensusExtensions;
} }
public void Unlock() public void Unlock()
@@ -61,7 +63,8 @@ namespace TBF.BenchControl.DataEntry.Standard6
nameTextBox.Enabled = true; nameTextBox.Enabled = true;
enterSNsAtTheEndCheckBox.Enabled = true; enterSNsAtTheEndCheckBox.Enabled = true;
showEndStateFormCheckBox.Enabled = true; showEndStateFormCheckBox.Enabled = true;
} sensusExtensionsCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message) public CfgUpdateFlags VerifyCfg(ref string message)
{ {
@@ -78,6 +81,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
config.Name = nameTextBox.Text; config.Name = nameTextBox.Text;
config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked; config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked;
config.ShowCycleEndForm = showEndStateFormCheckBox.Checked; config.ShowCycleEndForm = showEndStateFormCheckBox.Checked;
config.SensusExtensions = sensusExtensionsCheckBox.Checked;
return flags; return flags;
} }
@@ -31,75 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard6
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.nameTextBox = new System.Windows.Forms.TextBox(); this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label(); this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label(); this.classNameLabel = new System.Windows.Forms.Label();
this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox(); this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox();
this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox(); this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox();
// this.SuspendLayout();
// nameTextBox //
// // nameTextBox
this.nameTextBox.Enabled = false; //
this.nameTextBox.Location = new System.Drawing.Point(99, 57); this.nameTextBox.Enabled = false;
this.nameTextBox.Name = "nameTextBox"; this.nameTextBox.Location = new System.Drawing.Point(99, 57);
this.nameTextBox.Size = new System.Drawing.Size(130, 20); this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.TabIndex = 2; this.nameTextBox.Size = new System.Drawing.Size(130, 20);
// this.nameTextBox.TabIndex = 2;
// nameLabel //
// // nameLabel
this.nameLabel.AutoSize = true; //
this.nameLabel.Location = new System.Drawing.Point(35, 60); this.nameLabel.AutoSize = true;
this.nameLabel.Name = "nameLabel"; this.nameLabel.Location = new System.Drawing.Point(35, 60);
this.nameLabel.Size = new System.Drawing.Size(35, 13); this.nameLabel.Name = "nameLabel";
this.nameLabel.TabIndex = 1; this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.Text = "Name"; this.nameLabel.TabIndex = 1;
// this.nameLabel.Text = "Name";
// classNameLabel //
// // classNameLabel
this.classNameLabel.AutoSize = true; //
this.classNameLabel.Location = new System.Drawing.Point(96, 33); this.classNameLabel.AutoSize = true;
this.classNameLabel.Name = "classNameLabel"; this.classNameLabel.Location = new System.Drawing.Point(96, 33);
this.classNameLabel.Size = new System.Drawing.Size(83, 13); this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.TabIndex = 0; this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.Text = "ComonentName"; this.classNameLabel.TabIndex = 0;
// this.classNameLabel.Text = "ComonentName";
// showEndStateFormCheckBox //
// // showEndStateFormCheckBox
this.showEndStateFormCheckBox.AutoSize = true; //
this.showEndStateFormCheckBox.Enabled = false; this.showEndStateFormCheckBox.AutoSize = true;
this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112); this.showEndStateFormCheckBox.Enabled = false;
this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox"; this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112);
this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17); this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox";
this.showEndStateFormCheckBox.TabIndex = 4; this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17);
this.showEndStateFormCheckBox.Text = "Watermeter end state form"; this.showEndStateFormCheckBox.TabIndex = 4;
this.showEndStateFormCheckBox.UseVisualStyleBackColor = true; this.showEndStateFormCheckBox.Text = "Watermeter end state form";
// this.showEndStateFormCheckBox.UseVisualStyleBackColor = true;
// enterSNsAtTheEndCheckBox //
// // enterSNsAtTheEndCheckBox
this.enterSNsAtTheEndCheckBox.AutoSize = true; //
this.enterSNsAtTheEndCheckBox.Enabled = false; this.enterSNsAtTheEndCheckBox.AutoSize = true;
this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89); this.enterSNsAtTheEndCheckBox.Enabled = false;
this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox"; this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89);
this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17); this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox";
this.enterSNsAtTheEndCheckBox.TabIndex = 3; this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17);
this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end"; this.enterSNsAtTheEndCheckBox.TabIndex = 3;
this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true; this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end";
// this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true;
// EntryFormCfgCtrl //
// // sensusExtensionsCheckBox
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.sensusExtensionsCheckBox.AutoSize = true;
this.Controls.Add(this.enterSNsAtTheEndCheckBox); this.sensusExtensionsCheckBox.Enabled = false;
this.Controls.Add(this.showEndStateFormCheckBox); this.sensusExtensionsCheckBox.Location = new System.Drawing.Point(99, 135);
this.Controls.Add(this.nameTextBox); this.sensusExtensionsCheckBox.Name = "sensusExtensionsCheckBox";
this.Controls.Add(this.nameLabel); this.sensusExtensionsCheckBox.Size = new System.Drawing.Size(167, 17);
this.Controls.Add(this.classNameLabel); this.sensusExtensionsCheckBox.TabIndex = 5;
this.Name = "EntryFormCfgCtrl"; this.sensusExtensionsCheckBox.Text = "Sensus production extensions";
this.Size = new System.Drawing.Size(300, 200); this.sensusExtensionsCheckBox.UseVisualStyleBackColor = true;
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); //
this.ResumeLayout(false); // EntryFormCfgCtrl
this.PerformLayout(); //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.sensusExtensionsCheckBox);
this.Controls.Add(this.enterSNsAtTheEndCheckBox);
this.Controls.Add(this.showEndStateFormCheckBox);
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();
} }
@@ -110,5 +123,6 @@ namespace TBF.BenchControl.DataEntry.Standard6
private System.Windows.Forms.Label classNameLabel; private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox showEndStateFormCheckBox; private System.Windows.Forms.CheckBox showEndStateFormCheckBox;
private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox; private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox;
private System.Windows.Forms.CheckBox sensusExtensionsCheckBox;
} }
} }
+9
View File
@@ -2931,6 +2931,15 @@ namespace TBF.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Sensus production extensions.
/// </summary>
internal static string Sensus_production_extensions {
get {
return ResourceManager.GetString("Sensus_production_extensions", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Sent. /// Looks up a localized string similar to Sent.
/// </summary> /// </summary>
@@ -1414,4 +1414,7 @@
<data name="Printed" xml:space="preserve"> <data name="Printed" xml:space="preserve">
<value>Printed</value> <value>Printed</value>
</data> </data>
<data name="Sensus_production_extensions" xml:space="preserve">
<value>Sensus production extensions</value>
</data>
</root> </root>