diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryForm.cs index 1881f3e4c..8c116d08d 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -152,10 +152,17 @@ namespace TBF.BenchControl.DataEntry.Standard12 switch (currentOp) { case CurrentOp.ShowFormAtCycleBeginning: - Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + if (!entryFormCfg.EnterSerialNrsAtTheEnd) + { + Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + } break; 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); } @@ -180,60 +187,64 @@ namespace TBF.BenchControl.DataEntry.Standard12 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); - if (dlg != null) { - purchaseOrder = dlg.PurchaseOrder; + purchaseOrder = dlg.PurchaseOrder; - for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++) - { - if (waterMeters[i] != null) - { - serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i]; - disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; - } - } - } + for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); 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) + else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd) { CycleEndForm dlg = (modelessDlg as CycleEndForm); int count = waterMeters.Length; 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; - } - } + { + 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++) + if (dlg != null) { - wmStartState[i] = dlg.WMStartState[i]; - wmStartStateStr[i] = dlg.WMStartStateStr[i]; + 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); + 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; modelessDlg = null; } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfg.cs b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfg.cs index 7bcf30730..9b57ec6dd 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfg.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfg.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -17,14 +17,18 @@ namespace TBF.BenchControl.DataEntry.Standard12 /// /// Serialized parameters /// + public bool EnterSerialNrsAtTheEnd; public bool ShowCycleEndForm; + public bool SensusExtensions; /// Private parameterless constructor invoked by all other (public) constructors EntryFormCfg() { Name = "DataEntry-Standard-12"; ParentName = string.Empty; + EnterSerialNrsAtTheEnd = false; ShowCycleEndForm = false; + SensusExtensions = false; } public EntryFormCfg(IComponentFactory factory) @@ -35,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard12 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); } } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.cs b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.cs index 10071eb5e..9e18da3db 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Windows.Forms; @@ -39,8 +39,10 @@ namespace TBF.BenchControl.DataEntry.Standard12 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() { @@ -51,14 +53,18 @@ namespace TBF.BenchControl.DataEntry.Standard12 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; + enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd; + showEndStateFormCheckBox.Checked = config.ShowCycleEndForm; + sensusExtensionsCheckBox.Checked = config.SensusExtensions; } public void Unlock() { nameTextBox.Enabled = true; - showCycleEndFormCheckBox.Enabled = true; - } + enterSNsAtTheEndCheckBox.Enabled = true; + showEndStateFormCheckBox.Enabled = true; + sensusExtensionsCheckBox.Enabled = true; + } 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 config.Name = nameTextBox.Text; - config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; + config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked; + config.ShowCycleEndForm = showEndStateFormCheckBox.Checked; + config.SensusExtensions = sensusExtensionsCheckBox.Checked; return flags; } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.designer.cs index d78b73844..3de325a34 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.designer.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard12/EntryFormCfgCtrl.designer.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2013-2015 Sensus Metering Systems /// namespace TBF.BenchControl.DataEntry.Standard12 { @@ -31,62 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard12 /// 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(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox(); + this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox(); + this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(99, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(35, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(96, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // showEndStateFormCheckBox + // + this.showEndStateFormCheckBox.AutoSize = true; + this.showEndStateFormCheckBox.Enabled = false; + this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112); + this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox"; + this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17); + this.showEndStateFormCheckBox.TabIndex = 4; + this.showEndStateFormCheckBox.Text = "Watermeter end state form"; + this.showEndStateFormCheckBox.UseVisualStyleBackColor = true; + // + // enterSNsAtTheEndCheckBox + // + this.enterSNsAtTheEndCheckBox.AutoSize = true; + this.enterSNsAtTheEndCheckBox.Enabled = false; + this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89); + this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox"; + this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17); + this.enterSNsAtTheEndCheckBox.TabIndex = 3; + this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end"; + this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true; + // + // 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.Label nameLabel; 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; } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs index db244ae21..c3ebaebac 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -152,10 +152,17 @@ namespace TBF.BenchControl.DataEntry.Standard24 switch (currentOp) { case CurrentOp.ShowFormAtCycleBeginning: - Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + if (!entryFormCfg.EnterSerialNrsAtTheEnd) + { + Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + } break; 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); } @@ -180,60 +187,64 @@ namespace TBF.BenchControl.DataEntry.Standard24 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); - if (dlg != null) { - purchaseOrder = dlg.PurchaseOrder; + purchaseOrder = dlg.PurchaseOrder; - for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++) - { - if (waterMeters[i] != null) - { - serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i]; - disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; - } - } - } + for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); 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) + else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd) { CycleEndForm dlg = (modelessDlg as CycleEndForm); int count = waterMeters.Length; 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; - } - } + { + 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++) + if (dlg != null) { - wmStartState[i] = dlg.WMStartState[i]; - wmStartStateStr[i] = dlg.WMStartStateStr[i]; + 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); + 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; modelessDlg = null; } @@ -252,12 +263,12 @@ namespace TBF.BenchControl.DataEntry.Standard24 currentOp = CurrentOp.None; } - /// - /// Updates test results with the information collected in watermeters. - /// + /// + /// Updates test results with the information collected in watermeters. + /// /// Test results to be updated with the information public void UpdateTestResults(Results.BatchResults batchResults) - { + { foreach (var wm in batchResults.WaterMeters) { if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder; diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfg.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfg.cs index a7f5a9b92..cce7c118d 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfg.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfg.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -17,14 +17,18 @@ namespace TBF.BenchControl.DataEntry.Standard24 /// /// Serialized parameters /// + public bool EnterSerialNrsAtTheEnd; public bool ShowCycleEndForm; + public bool SensusExtensions; /// Private parameterless constructor invoked by all other (public) constructors EntryFormCfg() { Name = "DataEntry-Standard-24"; ParentName = string.Empty; + EnterSerialNrsAtTheEnd = false; ShowCycleEndForm = false; + SensusExtensions = false; } public EntryFormCfg(IComponentFactory factory) @@ -35,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 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); } } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.cs index 2fd8925eb..0940e4600 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Windows.Forms; @@ -39,8 +39,10 @@ namespace TBF.BenchControl.DataEntry.Standard24 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() { @@ -51,14 +53,18 @@ namespace TBF.BenchControl.DataEntry.Standard24 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; + enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd; + showEndStateFormCheckBox.Checked = config.ShowCycleEndForm; + sensusExtensionsCheckBox.Checked = config.SensusExtensions; } public void Unlock() { nameTextBox.Enabled = true; - showCycleEndFormCheckBox.Enabled = true; - } + enterSNsAtTheEndCheckBox.Enabled = true; + showEndStateFormCheckBox.Enabled = true; + sensusExtensionsCheckBox.Enabled = true; + } 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 config.Name = nameTextBox.Text; - config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; + config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked; + config.ShowCycleEndForm = showEndStateFormCheckBox.Checked; + config.SensusExtensions = sensusExtensionsCheckBox.Checked; return flags; } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.designer.cs index 2ae781c22..ae3317915 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.designer.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/EntryFormCfgCtrl.designer.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2015 Sensus Metering Systems /// namespace TBF.BenchControl.DataEntry.Standard24 { @@ -31,62 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard24 /// 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(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox(); + this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox(); + this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(99, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(35, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(96, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // showEndStateFormCheckBox + // + this.showEndStateFormCheckBox.AutoSize = true; + this.showEndStateFormCheckBox.Enabled = false; + this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112); + this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox"; + this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17); + this.showEndStateFormCheckBox.TabIndex = 4; + this.showEndStateFormCheckBox.Text = "Watermeter end state form"; + this.showEndStateFormCheckBox.UseVisualStyleBackColor = true; + // + // enterSNsAtTheEndCheckBox + // + this.enterSNsAtTheEndCheckBox.AutoSize = true; + this.enterSNsAtTheEndCheckBox.Enabled = false; + this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89); + this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox"; + this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17); + this.enterSNsAtTheEndCheckBox.TabIndex = 3; + this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end"; + this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true; + // + // 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.Label nameLabel; 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; } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryForm.cs index 00ff2efa7..2f1900830 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -152,10 +152,17 @@ namespace TBF.BenchControl.DataEntry.Standard48 switch (currentOp) { case CurrentOp.ShowFormAtCycleBeginning: - Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + if (!entryFormCfg.EnterSerialNrsAtTheEnd) + { + Program.MainWnd.Invoke(new EntryFormDlgt(OpenBeginningDlg), this); + } break; 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); } @@ -180,60 +187,64 @@ namespace TBF.BenchControl.DataEntry.Standard48 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); - if (dlg != null) { - purchaseOrder = dlg.PurchaseOrder; + purchaseOrder = dlg.PurchaseOrder; - for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); i++) - { - if (waterMeters[i] != null) - { - serialNr[i] = waterMeters[i].SerialNr = dlg.SNText[i]; - disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; - } - } - } + for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Length); 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) + else if (entryFormCfg.ShowCycleEndForm && currentOp == CurrentOp.ShowFormAtCycleEnd) { CycleEndForm dlg = (modelessDlg as CycleEndForm); int count = waterMeters.Length; 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; - } - } + { + 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++) + if (dlg != null) { - wmStartState[i] = dlg.WMStartState[i]; - wmStartStateStr[i] = dlg.WMStartStateStr[i]; + 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); + 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; modelessDlg = null; } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfg.cs b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfg.cs index 22b04d613..b817082df 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfg.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfg.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -17,14 +17,18 @@ namespace TBF.BenchControl.DataEntry.Standard48 /// /// Serialized parameters /// + public bool EnterSerialNrsAtTheEnd; public bool ShowCycleEndForm; + public bool SensusExtensions; /// Private parameterless constructor invoked by all other (public) constructors EntryFormCfg() { Name = "DataEntry-Standard-48"; ParentName = string.Empty; + EnterSerialNrsAtTheEnd = false; ShowCycleEndForm = false; + SensusExtensions = false; } public EntryFormCfg(IComponentFactory factory) @@ -35,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard48 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); } } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.cs b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.cs index ee548518c..fb955d692 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2016 Sensus Metering Systems /// using System; using System.Windows.Forms; @@ -39,8 +39,10 @@ namespace TBF.BenchControl.DataEntry.Standard48 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() { @@ -51,14 +53,18 @@ namespace TBF.BenchControl.DataEntry.Standard48 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; + enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd; + showEndStateFormCheckBox.Checked = config.ShowCycleEndForm; + sensusExtensionsCheckBox.Checked = config.SensusExtensions; } public void Unlock() { nameTextBox.Enabled = true; - showCycleEndFormCheckBox.Enabled = true; - } + enterSNsAtTheEndCheckBox.Enabled = true; + showEndStateFormCheckBox.Enabled = true; + sensusExtensionsCheckBox.Enabled = true; + } 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 config.Name = nameTextBox.Text; - config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; + config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked; + config.ShowCycleEndForm = showEndStateFormCheckBox.Checked; + config.SensusExtensions = sensusExtensionsCheckBox.Checked; return flags; } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.designer.cs index a7688cab7..1dad4c603 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.designer.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard48/EntryFormCfgCtrl.designer.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015 Sensus Metering Systems +/// Copyright (c) 2015-2015 Sensus Metering Systems /// namespace TBF.BenchControl.DataEntry.Standard48 { @@ -31,62 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard48 /// 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(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox(); + this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox(); + this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(99, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(35, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(96, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // showEndStateFormCheckBox + // + this.showEndStateFormCheckBox.AutoSize = true; + this.showEndStateFormCheckBox.Enabled = false; + this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112); + this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox"; + this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17); + this.showEndStateFormCheckBox.TabIndex = 4; + this.showEndStateFormCheckBox.Text = "Watermeter end state form"; + this.showEndStateFormCheckBox.UseVisualStyleBackColor = true; + // + // enterSNsAtTheEndCheckBox + // + this.enterSNsAtTheEndCheckBox.AutoSize = true; + this.enterSNsAtTheEndCheckBox.Enabled = false; + this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89); + this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox"; + this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17); + this.enterSNsAtTheEndCheckBox.TabIndex = 3; + this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end"; + this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true; + // + // 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.Label nameLabel; 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; } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryForm.cs index c15a02b39..7e51aa921 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2015 Sensus Metering Systems +/// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 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.Standard({0})", Cfg.ToString(1)); } + public override string ToString() { return string.Format("DataEntry.Standard6({0})", Cfg.ToString(1)); } readonly EntryFormCfg entryFormCfg; diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfg.cs b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfg.cs index 686895ee8..72d32ed8e 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfg.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfg.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2015 Sensus Metering Systems +/// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Collections.Generic; @@ -19,6 +19,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 /// public bool EnterSerialNrsAtTheEnd; public bool ShowCycleEndForm; + public bool SensusExtensions; /// Private parameterless constructor invoked by all other (public) constructors EntryFormCfg() @@ -27,6 +28,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 ParentName = string.Empty; EnterSerialNrsAtTheEnd = false; ShowCycleEndForm = false; + SensusExtensions = false; } public EntryFormCfg(IComponentFactory factory) @@ -37,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 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); } } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.cs b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.cs index e467aef43..5e4c2193d 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2015 Sensus Metering Systems +/// Copyright (c) 2013-2016 Sensus Metering Systems /// using System; using System.Windows.Forms; @@ -41,7 +41,8 @@ namespace TBF.BenchControl.DataEntry.Standard6 { enterSNsAtTheEndCheckBox.Text = Strings.Enter_SNs_at_the_end; showEndStateFormCheckBox.Text = Strings.Show_cycle_end_form; - } + sensusExtensionsCheckBox.Text = Strings.Sensus_production_extensions; + } public void Closing() { @@ -54,6 +55,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 nameTextBox.Text = config.Name; enterSNsAtTheEndCheckBox.Checked = config.EnterSerialNrsAtTheEnd; showEndStateFormCheckBox.Checked = config.ShowCycleEndForm; + sensusExtensionsCheckBox.Checked = config.SensusExtensions; } public void Unlock() @@ -61,7 +63,8 @@ namespace TBF.BenchControl.DataEntry.Standard6 nameTextBox.Enabled = true; enterSNsAtTheEndCheckBox.Enabled = true; showEndStateFormCheckBox.Enabled = true; - } + sensusExtensionsCheckBox.Enabled = true; + } public CfgUpdateFlags VerifyCfg(ref string message) { @@ -78,6 +81,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 config.Name = nameTextBox.Text; config.EnterSerialNrsAtTheEnd = enterSNsAtTheEndCheckBox.Checked; config.ShowCycleEndForm = showEndStateFormCheckBox.Checked; + config.SensusExtensions = sensusExtensionsCheckBox.Checked; return flags; } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.designer.cs b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.designer.cs index 23f7e8c1d..de9de095d 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.designer.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard6/EntryFormCfgCtrl.designer.cs @@ -31,75 +31,88 @@ namespace TBF.BenchControl.DataEntry.Standard6 /// 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.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox(); - this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox(); - this.SuspendLayout(); - // - // nameTextBox - // - this.nameTextBox.Enabled = false; - this.nameTextBox.Location = new System.Drawing.Point(99, 57); - this.nameTextBox.Name = "nameTextBox"; - this.nameTextBox.Size = new System.Drawing.Size(130, 20); - this.nameTextBox.TabIndex = 2; - // - // nameLabel - // - this.nameLabel.AutoSize = true; - this.nameLabel.Location = new System.Drawing.Point(35, 60); - this.nameLabel.Name = "nameLabel"; - this.nameLabel.Size = new System.Drawing.Size(35, 13); - this.nameLabel.TabIndex = 1; - this.nameLabel.Text = "Name"; - // - // classNameLabel - // - this.classNameLabel.AutoSize = true; - this.classNameLabel.Location = new System.Drawing.Point(96, 33); - this.classNameLabel.Name = "classNameLabel"; - this.classNameLabel.Size = new System.Drawing.Size(83, 13); - this.classNameLabel.TabIndex = 0; - this.classNameLabel.Text = "ComonentName"; - // - // showEndStateFormCheckBox - // - this.showEndStateFormCheckBox.AutoSize = true; - this.showEndStateFormCheckBox.Enabled = false; - this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112); - this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox"; - this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17); - this.showEndStateFormCheckBox.TabIndex = 4; - this.showEndStateFormCheckBox.Text = "Watermeter end state form"; - this.showEndStateFormCheckBox.UseVisualStyleBackColor = true; - // - // enterSNsAtTheEndCheckBox - // - this.enterSNsAtTheEndCheckBox.AutoSize = true; - this.enterSNsAtTheEndCheckBox.Enabled = false; - this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89); - this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox"; - this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17); - this.enterSNsAtTheEndCheckBox.TabIndex = 3; - this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end"; - this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true; - // - // EntryFormCfgCtrl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - 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(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.showEndStateFormCheckBox = new System.Windows.Forms.CheckBox(); + this.enterSNsAtTheEndCheckBox = new System.Windows.Forms.CheckBox(); + this.sensusExtensionsCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(99, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 2; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(35, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 1; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(96, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 0; + this.classNameLabel.Text = "ComonentName"; + // + // showEndStateFormCheckBox + // + this.showEndStateFormCheckBox.AutoSize = true; + this.showEndStateFormCheckBox.Enabled = false; + this.showEndStateFormCheckBox.Location = new System.Drawing.Point(99, 112); + this.showEndStateFormCheckBox.Name = "showEndStateFormCheckBox"; + this.showEndStateFormCheckBox.Size = new System.Drawing.Size(151, 17); + this.showEndStateFormCheckBox.TabIndex = 4; + this.showEndStateFormCheckBox.Text = "Watermeter end state form"; + this.showEndStateFormCheckBox.UseVisualStyleBackColor = true; + // + // enterSNsAtTheEndCheckBox + // + this.enterSNsAtTheEndCheckBox.AutoSize = true; + this.enterSNsAtTheEndCheckBox.Enabled = false; + this.enterSNsAtTheEndCheckBox.Location = new System.Drawing.Point(99, 89); + this.enterSNsAtTheEndCheckBox.Name = "enterSNsAtTheEndCheckBox"; + this.enterSNsAtTheEndCheckBox.Size = new System.Drawing.Size(167, 17); + this.enterSNsAtTheEndCheckBox.TabIndex = 3; + this.enterSNsAtTheEndCheckBox.Text = "Enter serial number at the end"; + this.enterSNsAtTheEndCheckBox.UseVisualStyleBackColor = true; + // + // 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(); } @@ -110,5 +123,6 @@ namespace TBF.BenchControl.DataEntry.Standard6 private System.Windows.Forms.Label classNameLabel; private System.Windows.Forms.CheckBox showEndStateFormCheckBox; private System.Windows.Forms.CheckBox enterSNsAtTheEndCheckBox; + private System.Windows.Forms.CheckBox sensusExtensionsCheckBox; } } diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index db399f18b..29753b143 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -2931,6 +2931,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Sensus production extensions. + /// + internal static string Sensus_production_extensions { + get { + return ResourceManager.GetString("Sensus_production_extensions", resourceCulture); + } + } + /// /// Looks up a localized string similar to Sent. /// diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index 1ba5fc741..2e40e27f9 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -1414,4 +1414,7 @@ Printed + + Sensus production extensions + \ No newline at end of file