(1) ResultsBrowser : Import of printer configuration, (2) DataEntry.Combined.CycleBeginningForm with Remark, ver. 2.18.1098

This commit is contained in:
Milan Hanajik 2018-12-14 14:53:58 +01:00
parent 55aff104ae
commit 20b2b9da97
14 changed files with 688 additions and 547 deletions

View File

@ -28,76 +28,88 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.printerClassComboBox = new System.Windows.Forms.ComboBox(); this.printerClassComboBox = new System.Windows.Forms.ComboBox();
this.changePrinterClassButton = new System.Windows.Forms.Button(); this.changePrinterClassButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.configureButton = new System.Windows.Forms.Button(); this.configureButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button(); this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout(); this.importButton = new System.Windows.Forms.Button();
// this.SuspendLayout();
// printerClassComboBox //
// // printerClassComboBox
this.printerClassComboBox.Enabled = false; //
this.printerClassComboBox.FormattingEnabled = true; this.printerClassComboBox.Enabled = false;
this.printerClassComboBox.Location = new System.Drawing.Point(12, 29); this.printerClassComboBox.FormattingEnabled = true;
this.printerClassComboBox.Name = "printerClassComboBox"; this.printerClassComboBox.Location = new System.Drawing.Point(12, 29);
this.printerClassComboBox.Size = new System.Drawing.Size(389, 21); this.printerClassComboBox.Name = "printerClassComboBox";
this.printerClassComboBox.TabIndex = 0; this.printerClassComboBox.Size = new System.Drawing.Size(457, 21);
// this.printerClassComboBox.TabIndex = 0;
// changePrinterClassButton //
// // changePrinterClassButton
this.changePrinterClassButton.Location = new System.Drawing.Point(15, 67); //
this.changePrinterClassButton.Name = "changePrinterClassButton"; this.changePrinterClassButton.Location = new System.Drawing.Point(12, 67);
this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43); this.changePrinterClassButton.Name = "changePrinterClassButton";
this.changePrinterClassButton.TabIndex = 1; this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43);
this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)"; this.changePrinterClassButton.TabIndex = 1;
this.changePrinterClassButton.UseVisualStyleBackColor = true; this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)";
this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click); this.changePrinterClassButton.UseVisualStyleBackColor = true;
// this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click);
// label1 //
// // label1
this.label1.AutoSize = true; //
this.label1.Location = new System.Drawing.Point(12, 9); this.label1.AutoSize = true;
this.label1.Name = "label1"; this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Size = new System.Drawing.Size(60, 13); this.label1.Name = "label1";
this.label1.TabIndex = 2; this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.Text = "Printer type"; this.label1.TabIndex = 2;
// this.label1.Text = "Printer type";
// configureButton //
// // configureButton
this.configureButton.Location = new System.Drawing.Point(196, 67); //
this.configureButton.Name = "configureButton"; this.configureButton.Location = new System.Drawing.Point(188, 67);
this.configureButton.Size = new System.Drawing.Size(95, 43); this.configureButton.Name = "configureButton";
this.configureButton.TabIndex = 3; this.configureButton.Size = new System.Drawing.Size(83, 43);
this.configureButton.Text = "Configure"; this.configureButton.TabIndex = 3;
this.configureButton.UseVisualStyleBackColor = true; this.configureButton.Text = "Configure";
this.configureButton.Click += new System.EventHandler(this.configureButton_Click); this.configureButton.UseVisualStyleBackColor = true;
// this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
// cancelButton //
// // cancelButton
this.cancelButton.Location = new System.Drawing.Point(306, 67); //
this.cancelButton.Name = "cancelButton"; this.cancelButton.Location = new System.Drawing.Point(383, 67);
this.cancelButton.Size = new System.Drawing.Size(95, 43); this.cancelButton.Name = "cancelButton";
this.cancelButton.TabIndex = 4; this.cancelButton.Size = new System.Drawing.Size(84, 43);
this.cancelButton.Text = "Cancel"; this.cancelButton.TabIndex = 4;
this.cancelButton.UseVisualStyleBackColor = true; this.cancelButton.Text = "Cancel";
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); this.cancelButton.UseVisualStyleBackColor = true;
// this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
// PrinterConfigDlg //
// // importButton
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.importButton.Location = new System.Drawing.Point(285, 67);
this.ClientSize = new System.Drawing.Size(416, 122); this.importButton.Name = "importButton";
this.Controls.Add(this.cancelButton); this.importButton.Size = new System.Drawing.Size(83, 43);
this.Controls.Add(this.configureButton); this.importButton.TabIndex = 5;
this.Controls.Add(this.label1); this.importButton.Text = "Import";
this.Controls.Add(this.changePrinterClassButton); this.importButton.UseVisualStyleBackColor = true;
this.Controls.Add(this.printerClassComboBox); this.importButton.Click += new System.EventHandler(this.importButton_Click);
this.Name = "PrinterConfigDlg"; //
this.Text = "Printer configuration"; // PrinterConfigDlg
this.Load += new System.EventHandler(this.PrinterClassDlg_Load); //
this.ResumeLayout(false); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.PerformLayout(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(481, 122);
this.Controls.Add(this.importButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.configureButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.changePrinterClassButton);
this.Controls.Add(this.printerClassComboBox);
this.Name = "PrinterConfigDlg";
this.Text = "Printer configuration";
this.Load += new System.EventHandler(this.PrinterClassDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
} }
@ -108,5 +120,6 @@
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button configureButton; private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.Button cancelButton; private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button importButton;
} }
} }

View File

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl; using TBF.BenchControl;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
@ -90,7 +92,7 @@ namespace ResultsBrowser.Forms
cfgControl.Config.ItemNr = 0; cfgControl.Config.ItemNr = 0;
TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg(); TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg();
cfgForm.TbfComponents = new List<Config.Entities.Component>(); cfgForm.TbfComponents = new List<Component>();
cfgForm.ComponentCfgCtrl = cfgControl; cfgForm.ComponentCfgCtrl = cfgControl;
cfgForm.UnlockAfterStart = true; cfgForm.UnlockAfterStart = true;
@ -104,23 +106,65 @@ namespace ResultsBrowser.Forms
} }
/// <summary> private void importButton_Click(object sender, EventArgs e)
/// Updates component factory {
/// </summary> string oriClassName = PrinterClass;
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null; OpenFileDialog dlg = new OpenFileDialog();
} if (dlg.ShowDialog() != DialogResult.OK) return;
}
/// Import a procedure from a file
Component newComponent = Component.Import(new StreamReader(dlg.FileName, System.Text.Encoding.UTF8));
bool classIsOK = false;
foreach (var pc in printerFactories)
{
if (newComponent.ClassName == pc.ClassName) { classIsOK = true; break; }
}
if (classIsOK)
{
printerClassComboBox.Text = newComponent.ClassName;
IComponentCfg printerCfg = TbfComponents.CmpntCfgFromCmpntEntity(newComponent);
if (printerCfg != null)
{
PrinterClass = newComponent.ClassName;
PrinterCfg = printerCfg.CreateDbEntity().Parameters;
DialogResult = DialogResult.OK;
Close();
}
else
{
MessageBox.Show("Importing printer configuration failed, file is corrupt.");
return;
}
}
else
{
MessageBox.Show("Invalid class of the imported component.");
return;
}
}
/// <summary>
/// Updates component factory
/// </summary>
/// <param name="className">Component class name</param>
/// <param name="factory">Reference to a factory</param>
/// <returns>true when factory changed</returns>
IComponentFactory GetFactory(string className)
{
if (!string.IsNullOrEmpty(className))
{
foreach (var fac in TbfComponents.Factories)
{
if (fac.ClassName == className) return fac;
}
}
return null;
}
}
} }

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.1096.0")] [assembly: AssemblyVersion("2.18.1098.0")]
[assembly: AssemblyFileVersion("2.18.1096.0")] [assembly: AssemblyFileVersion("2.18.1098.0")]

View File

@ -31,325 +31,361 @@ namespace TBF.BenchControl.DataEntry.Combined
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.okButton = new System.Windows.Forms.Button(); this.okButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.aux1ComboBox = new System.Windows.Forms.ComboBox(); this.aux1ComboBox = new System.Windows.Forms.ComboBox();
this.main1ComboBox = new System.Windows.Forms.ComboBox(); this.main1ComboBox = new System.Windows.Forms.ComboBox();
this.checkBox1 = new System.Windows.Forms.CheckBox(); this.checkBox1 = new System.Windows.Forms.CheckBox();
this.auxSN1Label = new System.Windows.Forms.Label(); this.auxSN1Label = new System.Windows.Forms.Label();
this.mainSN1Label = new System.Windows.Forms.Label(); this.mainSN1Label = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
this.aux2ComboBox = new System.Windows.Forms.ComboBox(); this.aux2ComboBox = new System.Windows.Forms.ComboBox();
this.main2ComboBox = new System.Windows.Forms.ComboBox(); this.main2ComboBox = new System.Windows.Forms.ComboBox();
this.checkBox2 = new System.Windows.Forms.CheckBox(); this.checkBox2 = new System.Windows.Forms.CheckBox();
this.auxSN2Label = new System.Windows.Forms.Label(); this.auxSN2Label = new System.Windows.Forms.Label();
this.mainSN2Label = new System.Windows.Forms.Label(); this.mainSN2Label = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.aux3ComboBox = new System.Windows.Forms.ComboBox(); this.aux3ComboBox = new System.Windows.Forms.ComboBox();
this.main3ComboBox = new System.Windows.Forms.ComboBox(); this.main3ComboBox = new System.Windows.Forms.ComboBox();
this.checkBox3 = new System.Windows.Forms.CheckBox(); this.checkBox3 = new System.Windows.Forms.CheckBox();
this.auxSN3Label = new System.Windows.Forms.Label(); this.auxSN3Label = new System.Windows.Forms.Label();
this.mainSN3Label = new System.Windows.Forms.Label(); this.mainSN3Label = new System.Windows.Forms.Label();
this.clearButton = new System.Windows.Forms.Button(); this.clearButton = new System.Windows.Forms.Button();
this.orderGroupBox = new System.Windows.Forms.GroupBox(); this.orderGroupBox = new System.Windows.Forms.GroupBox();
this.orderComboBox = new System.Windows.Forms.ComboBox(); this.orderComboBox = new System.Windows.Forms.ComboBox();
this.groupBox1.SuspendLayout(); this.remarkComboBox1 = new System.Windows.Forms.ComboBox();
this.groupBox2.SuspendLayout(); this.remarkComboBox2 = new System.Windows.Forms.ComboBox();
this.groupBox3.SuspendLayout(); this.remarkComboBox3 = new System.Windows.Forms.ComboBox();
this.orderGroupBox.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.groupBox2.SuspendLayout();
// this.groupBox3.SuspendLayout();
// okButton this.orderGroupBox.SuspendLayout();
// this.SuspendLayout();
this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); //
this.okButton.ForeColor = System.Drawing.Color.Black; // okButton
this.okButton.Location = new System.Drawing.Point(589, 33); //
this.okButton.Name = "okButton"; this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.okButton.Size = new System.Drawing.Size(117, 63); this.okButton.ForeColor = System.Drawing.Color.Black;
this.okButton.TabIndex = 0; this.okButton.Location = new System.Drawing.Point(589, 33);
this.okButton.Text = "OK"; this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true; this.okButton.Size = new System.Drawing.Size(117, 63);
this.okButton.Click += new System.EventHandler(this.okButton_Click); this.okButton.TabIndex = 0;
// this.okButton.Text = "OK";
// groupBox1 this.okButton.UseVisualStyleBackColor = true;
// this.okButton.Click += new System.EventHandler(this.okButton_Click);
this.groupBox1.Controls.Add(this.aux1ComboBox); //
this.groupBox1.Controls.Add(this.main1ComboBox); // groupBox1
this.groupBox1.Controls.Add(this.checkBox1); //
this.groupBox1.Controls.Add(this.auxSN1Label); this.groupBox1.Controls.Add(this.remarkComboBox1);
this.groupBox1.Controls.Add(this.mainSN1Label); this.groupBox1.Controls.Add(this.aux1ComboBox);
this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.groupBox1.Controls.Add(this.main1ComboBox);
this.groupBox1.ForeColor = System.Drawing.Color.Black; this.groupBox1.Controls.Add(this.checkBox1);
this.groupBox1.Location = new System.Drawing.Point(28, 118); this.groupBox1.Controls.Add(this.auxSN1Label);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Controls.Add(this.mainSN1Label);
this.groupBox1.Size = new System.Drawing.Size(533, 137); this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox1.TabIndex = 1; this.groupBox1.ForeColor = System.Drawing.Color.Black;
this.groupBox1.TabStop = false; this.groupBox1.Location = new System.Drawing.Point(28, 118);
this.groupBox1.Text = "Water Meter 1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Visible = false; this.groupBox1.Size = new System.Drawing.Size(533, 143);
// this.groupBox1.TabIndex = 1;
// aux1ComboBox this.groupBox1.TabStop = false;
// this.groupBox1.Text = "Water Meter 1";
this.aux1ComboBox.FormattingEnabled = true; this.groupBox1.Visible = false;
this.aux1ComboBox.Location = new System.Drawing.Point(287, 83); //
this.aux1ComboBox.Name = "aux1ComboBox"; // aux1ComboBox
this.aux1ComboBox.Size = new System.Drawing.Size(175, 31); //
this.aux1ComboBox.TabIndex = 6; this.aux1ComboBox.FormattingEnabled = true;
this.aux1ComboBox.Visible = false; this.aux1ComboBox.Location = new System.Drawing.Point(318, 64);
this.aux1ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux1ComboBox_SelectedIndexChanged); this.aux1ComboBox.Name = "aux1ComboBox";
this.aux1ComboBox.TextChanged += new System.EventHandler(this.aux1ComboBox_TextChanged); this.aux1ComboBox.Size = new System.Drawing.Size(175, 31);
this.aux1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1ComboBox_KeyPress); this.aux1ComboBox.TabIndex = 6;
// this.aux1ComboBox.Visible = false;
// main1ComboBox this.aux1ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux1ComboBox_SelectedIndexChanged);
// this.aux1ComboBox.TextChanged += new System.EventHandler(this.aux1ComboBox_TextChanged);
this.main1ComboBox.FormattingEnabled = true; this.aux1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1ComboBox_KeyPress);
this.main1ComboBox.Location = new System.Drawing.Point(287, 37); //
this.main1ComboBox.Name = "main1ComboBox"; // main1ComboBox
this.main1ComboBox.Size = new System.Drawing.Size(175, 31); //
this.main1ComboBox.TabIndex = 5; this.main1ComboBox.FormattingEnabled = true;
this.main1ComboBox.Visible = false; this.main1ComboBox.Location = new System.Drawing.Point(318, 27);
this.main1ComboBox.SelectedIndexChanged += new System.EventHandler(this.main1ComboBox_SelectedIndexChanged); this.main1ComboBox.Name = "main1ComboBox";
this.main1ComboBox.TextChanged += new System.EventHandler(this.main1ComboBox_TextChanged); this.main1ComboBox.Size = new System.Drawing.Size(175, 31);
this.main1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1ComboBox_KeyPress); this.main1ComboBox.TabIndex = 5;
// this.main1ComboBox.Visible = false;
// checkBox1 this.main1ComboBox.SelectedIndexChanged += new System.EventHandler(this.main1ComboBox_SelectedIndexChanged);
// this.main1ComboBox.TextChanged += new System.EventHandler(this.main1ComboBox_TextChanged);
this.checkBox1.AutoSize = true; this.main1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1ComboBox_KeyPress);
this.checkBox1.Font = new System.Drawing.Font("Verdana", 27.75F); //
this.checkBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl; // checkBox1
this.checkBox1.Location = new System.Drawing.Point(490, 69); //
this.checkBox1.Name = "checkBox1"; this.checkBox1.AutoSize = true;
this.checkBox1.Size = new System.Drawing.Size(15, 14); this.checkBox1.Font = new System.Drawing.Font("Verdana", 27.75F);
this.checkBox1.TabIndex = 4; this.checkBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.Location = new System.Drawing.Point(506, 28);
this.checkBox1.Visible = false; this.checkBox1.Name = "checkBox1";
// this.checkBox1.Size = new System.Drawing.Size(15, 14);
// auxSN1Label this.checkBox1.TabIndex = 4;
// this.checkBox1.UseVisualStyleBackColor = true;
this.auxSN1Label.AutoSize = true; this.checkBox1.Visible = false;
this.auxSN1Label.Location = new System.Drawing.Point(21, 86); //
this.auxSN1Label.Name = "auxSN1Label"; // auxSN1Label
this.auxSN1Label.Size = new System.Drawing.Size(193, 23); //
this.auxSN1Label.TabIndex = 2; this.auxSN1Label.AutoSize = true;
this.auxSN1Label.Text = "Aux. WM Serial Nr."; this.auxSN1Label.Location = new System.Drawing.Point(21, 67);
this.auxSN1Label.Visible = false; this.auxSN1Label.Name = "auxSN1Label";
// this.auxSN1Label.Size = new System.Drawing.Size(193, 23);
// mainSN1Label this.auxSN1Label.TabIndex = 2;
// this.auxSN1Label.Text = "Aux. WM Serial Nr.";
this.mainSN1Label.AutoSize = true; this.auxSN1Label.Visible = false;
this.mainSN1Label.Location = new System.Drawing.Point(21, 40); //
this.mainSN1Label.Name = "mainSN1Label"; // mainSN1Label
this.mainSN1Label.Size = new System.Drawing.Size(195, 23); //
this.mainSN1Label.TabIndex = 0; this.mainSN1Label.AutoSize = true;
this.mainSN1Label.Text = "Main WM Serial Nr."; this.mainSN1Label.Location = new System.Drawing.Point(21, 33);
this.mainSN1Label.Visible = false; this.mainSN1Label.Name = "mainSN1Label";
// this.mainSN1Label.Size = new System.Drawing.Size(195, 23);
// groupBox2 this.mainSN1Label.TabIndex = 0;
// this.mainSN1Label.Text = "Main WM Serial Nr.";
this.groupBox2.Controls.Add(this.aux2ComboBox); this.mainSN1Label.Visible = false;
this.groupBox2.Controls.Add(this.main2ComboBox); //
this.groupBox2.Controls.Add(this.checkBox2); // groupBox2
this.groupBox2.Controls.Add(this.auxSN2Label); //
this.groupBox2.Controls.Add(this.mainSN2Label); this.groupBox2.Controls.Add(this.remarkComboBox2);
this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.groupBox2.Controls.Add(this.aux2ComboBox);
this.groupBox2.ForeColor = System.Drawing.Color.Black; this.groupBox2.Controls.Add(this.main2ComboBox);
this.groupBox2.Location = new System.Drawing.Point(28, 275); this.groupBox2.Controls.Add(this.checkBox2);
this.groupBox2.Name = "groupBox2"; this.groupBox2.Controls.Add(this.auxSN2Label);
this.groupBox2.Size = new System.Drawing.Size(533, 137); this.groupBox2.Controls.Add(this.mainSN2Label);
this.groupBox2.TabIndex = 2; this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox2.TabStop = false; this.groupBox2.ForeColor = System.Drawing.Color.Black;
this.groupBox2.Text = "Water Meter 2"; this.groupBox2.Location = new System.Drawing.Point(28, 275);
this.groupBox2.Visible = false; this.groupBox2.Name = "groupBox2";
// this.groupBox2.Size = new System.Drawing.Size(533, 143);
// aux2ComboBox this.groupBox2.TabIndex = 2;
// this.groupBox2.TabStop = false;
this.aux2ComboBox.FormattingEnabled = true; this.groupBox2.Text = "Water Meter 2";
this.aux2ComboBox.Location = new System.Drawing.Point(287, 83); this.groupBox2.Visible = false;
this.aux2ComboBox.Name = "aux2ComboBox"; //
this.aux2ComboBox.Size = new System.Drawing.Size(175, 31); // aux2ComboBox
this.aux2ComboBox.TabIndex = 10; //
this.aux2ComboBox.Visible = false; this.aux2ComboBox.FormattingEnabled = true;
this.aux2ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux2ComboBox_SelectedIndexChanged); this.aux2ComboBox.Location = new System.Drawing.Point(318, 64);
this.aux2ComboBox.TextChanged += new System.EventHandler(this.aux2ComboBox_TextChanged); this.aux2ComboBox.Name = "aux2ComboBox";
this.aux2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2ComboBox_KeyPress); this.aux2ComboBox.Size = new System.Drawing.Size(175, 31);
// this.aux2ComboBox.TabIndex = 10;
// main2ComboBox this.aux2ComboBox.Visible = false;
// this.aux2ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux2ComboBox_SelectedIndexChanged);
this.main2ComboBox.FormattingEnabled = true; this.aux2ComboBox.TextChanged += new System.EventHandler(this.aux2ComboBox_TextChanged);
this.main2ComboBox.Location = new System.Drawing.Point(287, 37); this.aux2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2ComboBox_KeyPress);
this.main2ComboBox.Name = "main2ComboBox"; //
this.main2ComboBox.Size = new System.Drawing.Size(175, 31); // main2ComboBox
this.main2ComboBox.TabIndex = 9; //
this.main2ComboBox.Visible = false; this.main2ComboBox.FormattingEnabled = true;
this.main2ComboBox.SelectedIndexChanged += new System.EventHandler(this.main2ComboBox_SelectedIndexChanged); this.main2ComboBox.Location = new System.Drawing.Point(318, 27);
this.main2ComboBox.TextChanged += new System.EventHandler(this.main2ComboBox_TextChanged); this.main2ComboBox.Name = "main2ComboBox";
this.main2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2ComboBox_KeyPress); this.main2ComboBox.Size = new System.Drawing.Size(175, 31);
// this.main2ComboBox.TabIndex = 9;
// checkBox2 this.main2ComboBox.Visible = false;
// this.main2ComboBox.SelectedIndexChanged += new System.EventHandler(this.main2ComboBox_SelectedIndexChanged);
this.checkBox2.AutoSize = true; this.main2ComboBox.TextChanged += new System.EventHandler(this.main2ComboBox_TextChanged);
this.checkBox2.Font = new System.Drawing.Font("Verdana", 27.75F); this.main2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2ComboBox_KeyPress);
this.checkBox2.ImeMode = System.Windows.Forms.ImeMode.NoControl; //
this.checkBox2.Location = new System.Drawing.Point(490, 69); // checkBox2
this.checkBox2.Name = "checkBox2"; //
this.checkBox2.Size = new System.Drawing.Size(15, 14); this.checkBox2.AutoSize = true;
this.checkBox2.TabIndex = 8; this.checkBox2.Font = new System.Drawing.Font("Verdana", 27.75F);
this.checkBox2.UseVisualStyleBackColor = true; this.checkBox2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.checkBox2.Visible = false; this.checkBox2.Location = new System.Drawing.Point(506, 28);
// this.checkBox2.Name = "checkBox2";
// auxSN2Label this.checkBox2.Size = new System.Drawing.Size(15, 14);
// this.checkBox2.TabIndex = 8;
this.auxSN2Label.AutoSize = true; this.checkBox2.UseVisualStyleBackColor = true;
this.auxSN2Label.Location = new System.Drawing.Point(21, 86); this.checkBox2.Visible = false;
this.auxSN2Label.Name = "auxSN2Label"; //
this.auxSN2Label.Size = new System.Drawing.Size(193, 23); // auxSN2Label
this.auxSN2Label.TabIndex = 2; //
this.auxSN2Label.Text = "Aux. WM Serial Nr."; this.auxSN2Label.AutoSize = true;
this.auxSN2Label.Visible = false; this.auxSN2Label.Location = new System.Drawing.Point(21, 67);
// this.auxSN2Label.Name = "auxSN2Label";
// mainSN2Label this.auxSN2Label.Size = new System.Drawing.Size(193, 23);
// this.auxSN2Label.TabIndex = 2;
this.mainSN2Label.AutoSize = true; this.auxSN2Label.Text = "Aux. WM Serial Nr.";
this.mainSN2Label.Location = new System.Drawing.Point(21, 40); this.auxSN2Label.Visible = false;
this.mainSN2Label.Name = "mainSN2Label"; //
this.mainSN2Label.Size = new System.Drawing.Size(195, 23); // mainSN2Label
this.mainSN2Label.TabIndex = 0; //
this.mainSN2Label.Text = "Main WM Serial Nr."; this.mainSN2Label.AutoSize = true;
this.mainSN2Label.Visible = false; this.mainSN2Label.Location = new System.Drawing.Point(21, 33);
// this.mainSN2Label.Name = "mainSN2Label";
// groupBox3 this.mainSN2Label.Size = new System.Drawing.Size(195, 23);
// this.mainSN2Label.TabIndex = 0;
this.groupBox3.Controls.Add(this.aux3ComboBox); this.mainSN2Label.Text = "Main WM Serial Nr.";
this.groupBox3.Controls.Add(this.main3ComboBox); this.mainSN2Label.Visible = false;
this.groupBox3.Controls.Add(this.checkBox3); //
this.groupBox3.Controls.Add(this.auxSN3Label); // groupBox3
this.groupBox3.Controls.Add(this.mainSN3Label); //
this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.groupBox3.Controls.Add(this.remarkComboBox3);
this.groupBox3.ForeColor = System.Drawing.Color.Black; this.groupBox3.Controls.Add(this.aux3ComboBox);
this.groupBox3.Location = new System.Drawing.Point(28, 430); this.groupBox3.Controls.Add(this.main3ComboBox);
this.groupBox3.Name = "groupBox3"; this.groupBox3.Controls.Add(this.checkBox3);
this.groupBox3.Size = new System.Drawing.Size(533, 137); this.groupBox3.Controls.Add(this.auxSN3Label);
this.groupBox3.TabIndex = 3; this.groupBox3.Controls.Add(this.mainSN3Label);
this.groupBox3.TabStop = false; this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.groupBox3.Text = "Water Meter 3"; this.groupBox3.ForeColor = System.Drawing.Color.Black;
this.groupBox3.Visible = false; this.groupBox3.Location = new System.Drawing.Point(28, 430);
// this.groupBox3.Name = "groupBox3";
// aux3ComboBox this.groupBox3.Size = new System.Drawing.Size(533, 143);
// this.groupBox3.TabIndex = 3;
this.aux3ComboBox.FormattingEnabled = true; this.groupBox3.TabStop = false;
this.aux3ComboBox.Location = new System.Drawing.Point(287, 83); this.groupBox3.Text = "Water Meter 3";
this.aux3ComboBox.Name = "aux3ComboBox"; this.groupBox3.Visible = false;
this.aux3ComboBox.Size = new System.Drawing.Size(175, 31); //
this.aux3ComboBox.TabIndex = 10; // aux3ComboBox
this.aux3ComboBox.Visible = false; //
this.aux3ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux3ComboBox_SelectedIndexChanged); this.aux3ComboBox.FormattingEnabled = true;
this.aux3ComboBox.TextChanged += new System.EventHandler(this.aux3ComboBox_TextChanged); this.aux3ComboBox.Location = new System.Drawing.Point(318, 64);
this.aux3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3ComboBox_KeyPress); this.aux3ComboBox.Name = "aux3ComboBox";
// this.aux3ComboBox.Size = new System.Drawing.Size(175, 31);
// main3ComboBox this.aux3ComboBox.TabIndex = 10;
// this.aux3ComboBox.Visible = false;
this.main3ComboBox.FormattingEnabled = true; this.aux3ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux3ComboBox_SelectedIndexChanged);
this.main3ComboBox.Location = new System.Drawing.Point(287, 37); this.aux3ComboBox.TextChanged += new System.EventHandler(this.aux3ComboBox_TextChanged);
this.main3ComboBox.Name = "main3ComboBox"; this.aux3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3ComboBox_KeyPress);
this.main3ComboBox.Size = new System.Drawing.Size(175, 31); //
this.main3ComboBox.TabIndex = 9; // main3ComboBox
this.main3ComboBox.Visible = false; //
this.main3ComboBox.SelectedIndexChanged += new System.EventHandler(this.main3ComboBox_SelectedIndexChanged); this.main3ComboBox.FormattingEnabled = true;
this.main3ComboBox.TextChanged += new System.EventHandler(this.main3ComboBox_TextChanged); this.main3ComboBox.Location = new System.Drawing.Point(318, 27);
this.main3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3ComboBox_KeyPress); this.main3ComboBox.Name = "main3ComboBox";
// this.main3ComboBox.Size = new System.Drawing.Size(175, 31);
// checkBox3 this.main3ComboBox.TabIndex = 9;
// this.main3ComboBox.Visible = false;
this.checkBox3.AutoSize = true; this.main3ComboBox.SelectedIndexChanged += new System.EventHandler(this.main3ComboBox_SelectedIndexChanged);
this.checkBox3.Font = new System.Drawing.Font("Verdana", 27.75F); this.main3ComboBox.TextChanged += new System.EventHandler(this.main3ComboBox_TextChanged);
this.checkBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.main3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3ComboBox_KeyPress);
this.checkBox3.Location = new System.Drawing.Point(490, 68); //
this.checkBox3.Name = "checkBox3"; // checkBox3
this.checkBox3.Size = new System.Drawing.Size(15, 14); //
this.checkBox3.TabIndex = 8; this.checkBox3.AutoSize = true;
this.checkBox3.UseVisualStyleBackColor = true; this.checkBox3.Font = new System.Drawing.Font("Verdana", 27.75F);
this.checkBox3.Visible = false; this.checkBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
// this.checkBox3.Location = new System.Drawing.Point(506, 27);
// auxSN3Label this.checkBox3.Name = "checkBox3";
// this.checkBox3.Size = new System.Drawing.Size(15, 14);
this.auxSN3Label.AutoSize = true; this.checkBox3.TabIndex = 8;
this.auxSN3Label.Location = new System.Drawing.Point(21, 86); this.checkBox3.UseVisualStyleBackColor = true;
this.auxSN3Label.Name = "auxSN3Label"; this.checkBox3.Visible = false;
this.auxSN3Label.Size = new System.Drawing.Size(193, 23); //
this.auxSN3Label.TabIndex = 2; // auxSN3Label
this.auxSN3Label.Text = "Aux. WM Serial Nr."; //
this.auxSN3Label.Visible = false; this.auxSN3Label.AutoSize = true;
// this.auxSN3Label.Location = new System.Drawing.Point(21, 67);
// mainSN3Label this.auxSN3Label.Name = "auxSN3Label";
// this.auxSN3Label.Size = new System.Drawing.Size(193, 23);
this.mainSN3Label.AutoSize = true; this.auxSN3Label.TabIndex = 2;
this.mainSN3Label.Location = new System.Drawing.Point(21, 40); this.auxSN3Label.Text = "Aux. WM Serial Nr.";
this.mainSN3Label.Name = "mainSN3Label"; this.auxSN3Label.Visible = false;
this.mainSN3Label.Size = new System.Drawing.Size(195, 23); //
this.mainSN3Label.TabIndex = 0; // mainSN3Label
this.mainSN3Label.Text = "Main WM Serial Nr."; //
this.mainSN3Label.Visible = false; this.mainSN3Label.AutoSize = true;
// this.mainSN3Label.Location = new System.Drawing.Point(21, 33);
// clearButton this.mainSN3Label.Name = "mainSN3Label";
// this.mainSN3Label.Size = new System.Drawing.Size(195, 23);
this.clearButton.Font = new System.Drawing.Font("Verdana", 14.25F); this.mainSN3Label.TabIndex = 0;
this.clearButton.ForeColor = System.Drawing.Color.Black; this.mainSN3Label.Text = "Main WM Serial Nr.";
this.clearButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.mainSN3Label.Visible = false;
this.clearButton.Location = new System.Drawing.Point(589, 116); //
this.clearButton.Name = "clearButton"; // clearButton
this.clearButton.Size = new System.Drawing.Size(117, 63); //
this.clearButton.TabIndex = 9; this.clearButton.Font = new System.Drawing.Font("Verdana", 14.25F);
this.clearButton.Text = "Clear"; this.clearButton.ForeColor = System.Drawing.Color.Black;
this.clearButton.UseVisualStyleBackColor = true; this.clearButton.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.clearButton.Click += new System.EventHandler(this.clearButton_Click); this.clearButton.Location = new System.Drawing.Point(589, 116);
// this.clearButton.Name = "clearButton";
// orderGroupBox this.clearButton.Size = new System.Drawing.Size(117, 63);
// this.clearButton.TabIndex = 9;
this.orderGroupBox.Controls.Add(this.orderComboBox); this.clearButton.Text = "Clear";
this.orderGroupBox.Font = new System.Drawing.Font("Verdana", 14.25F); this.clearButton.UseVisualStyleBackColor = true;
this.orderGroupBox.ForeColor = System.Drawing.Color.Black; this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
this.orderGroupBox.Location = new System.Drawing.Point(28, 16); //
this.orderGroupBox.Name = "orderGroupBox"; // orderGroupBox
this.orderGroupBox.Size = new System.Drawing.Size(533, 82); //
this.orderGroupBox.TabIndex = 10; this.orderGroupBox.Controls.Add(this.orderComboBox);
this.orderGroupBox.TabStop = false; this.orderGroupBox.Font = new System.Drawing.Font("Verdana", 14.25F);
this.orderGroupBox.Text = "Order"; this.orderGroupBox.ForeColor = System.Drawing.Color.Black;
// this.orderGroupBox.Location = new System.Drawing.Point(28, 16);
// orderComboBox this.orderGroupBox.Name = "orderGroupBox";
// this.orderGroupBox.Size = new System.Drawing.Size(533, 82);
this.orderComboBox.FormattingEnabled = true; this.orderGroupBox.TabIndex = 10;
this.orderComboBox.Location = new System.Drawing.Point(165, 30); this.orderGroupBox.TabStop = false;
this.orderComboBox.Name = "orderComboBox"; this.orderGroupBox.Text = "Order";
this.orderComboBox.Size = new System.Drawing.Size(297, 31); //
this.orderComboBox.TabIndex = 0; // orderComboBox
// //
// CycleBeginningForm this.orderComboBox.FormattingEnabled = true;
// this.orderComboBox.Location = new System.Drawing.Point(196, 31);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.orderComboBox.Name = "orderComboBox";
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.orderComboBox.Size = new System.Drawing.Size(297, 31);
this.AutoSize = true; this.orderComboBox.TabIndex = 0;
this.BackColor = System.Drawing.Color.DarkGoldenrod; //
this.ClientSize = new System.Drawing.Size(732, 593); // remarkComboBox1
this.Controls.Add(this.orderGroupBox); //
this.Controls.Add(this.clearButton); this.remarkComboBox1.Font = new System.Drawing.Font("Verdana", 14.25F);
this.Controls.Add(this.groupBox3); this.remarkComboBox1.FormattingEnabled = true;
this.Controls.Add(this.groupBox2); this.remarkComboBox1.Location = new System.Drawing.Point(56, 101);
this.Controls.Add(this.groupBox1); this.remarkComboBox1.Name = "remarkComboBox1";
this.Controls.Add(this.okButton); this.remarkComboBox1.Size = new System.Drawing.Size(437, 31);
this.ForeColor = System.Drawing.Color.Black; this.remarkComboBox1.TabIndex = 35;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.remarkComboBox1.Visible = false;
this.Name = "CycleBeginningForm"; //
this.Text = "Daten"; // remarkComboBox2
this.TopMost = true; //
this.Load += new System.EventHandler(this.CycleBeginningForm_Load); this.remarkComboBox2.Font = new System.Drawing.Font("Verdana", 14.25F);
this.groupBox1.ResumeLayout(false); this.remarkComboBox2.FormattingEnabled = true;
this.groupBox1.PerformLayout(); this.remarkComboBox2.Location = new System.Drawing.Point(56, 101);
this.groupBox2.ResumeLayout(false); this.remarkComboBox2.Name = "remarkComboBox2";
this.groupBox2.PerformLayout(); this.remarkComboBox2.Size = new System.Drawing.Size(437, 31);
this.groupBox3.ResumeLayout(false); this.remarkComboBox2.TabIndex = 36;
this.groupBox3.PerformLayout(); this.remarkComboBox2.Visible = false;
this.orderGroupBox.ResumeLayout(false); //
this.ResumeLayout(false); // remarkComboBox3
//
this.remarkComboBox3.Font = new System.Drawing.Font("Verdana", 14.25F);
this.remarkComboBox3.FormattingEnabled = true;
this.remarkComboBox3.Location = new System.Drawing.Point(56, 101);
this.remarkComboBox3.Name = "remarkComboBox3";
this.remarkComboBox3.Size = new System.Drawing.Size(437, 31);
this.remarkComboBox3.TabIndex = 37;
this.remarkComboBox3.Visible = false;
//
// CycleBeginningForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.Color.DarkGoldenrod;
this.ClientSize = new System.Drawing.Size(732, 593);
this.Controls.Add(this.orderGroupBox);
this.Controls.Add(this.clearButton);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.okButton);
this.ForeColor = System.Drawing.Color.Black;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "CycleBeginningForm";
this.Text = "Daten";
this.TopMost = true;
this.Load += new System.EventHandler(this.CycleBeginningForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.orderGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
} }
@ -377,5 +413,8 @@ namespace TBF.BenchControl.DataEntry.Combined
private System.Windows.Forms.ComboBox main2ComboBox; private System.Windows.Forms.ComboBox main2ComboBox;
private System.Windows.Forms.ComboBox aux3ComboBox; private System.Windows.Forms.ComboBox aux3ComboBox;
private System.Windows.Forms.ComboBox main3ComboBox; private System.Windows.Forms.ComboBox main3ComboBox;
private System.Windows.Forms.ComboBox remarkComboBox1;
private System.Windows.Forms.ComboBox remarkComboBox2;
private System.Windows.Forms.ComboBox remarkComboBox3;
} }
} }

View File

@ -17,12 +17,14 @@ namespace TBF.BenchControl.DataEntry.Combined
/// <summary> Number of water meters </summary> /// <summary> Number of water meters </summary>
public readonly int WaterMetersCount; public readonly int WaterMetersCount;
public readonly bool RemarksEnabled;
// To be retrieved after the form closes // To be retrieved after the form closes
public string PurchaseOrder; public string PurchaseOrder;
public string[] MainSNText; public string[] MainSNText;
public string[] AuxSNText; public string[] AuxSNText;
public bool[] Disabled; public bool[] Disabled;
public string[] Remark;
// Set to 'true' when the form closes // Set to 'true' when the form closes
public bool Completed { get { return completed; } } public bool Completed { get { return completed; } }
@ -35,44 +37,52 @@ namespace TBF.BenchControl.DataEntry.Combined
ComboBox[] mainComboBoxes; ComboBox[] mainComboBoxes;
ComboBox[] auxComboBoxes; ComboBox[] auxComboBoxes;
CheckBox[] checkBoxes; CheckBox[] checkBoxes;
IList<ComboBox> enabledComboBoxes; ComboBox[] remarkBoxes;
IList<ComboBox> enabledComboBoxes;
/// <summary>
/// Default constructor - Default number of compound water meters
/// </summary>
public CycleBeginningForm() public CycleBeginningForm()
: this (Config.Data.CompoundWMsCount, false)
{ {
InitializeComponent(); this.WaterMetersCount = Config.Data.CompoundWMsCount;
ControlBox = false;
TextBoxesCount = 3;
mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label };
auxLabels = new Label[] { auxSN1Label, auxSN2Label, auxSN3Label };
mainComboBoxes = new ComboBox[] { main1ComboBox, main2ComboBox, main3ComboBox };
auxComboBoxes = new ComboBox[] { aux1ComboBox, aux2ComboBox, aux3ComboBox };
checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3 };
enabledComboBoxes = new List<ComboBox>();
this.WaterMetersCount = Config.Data.CompoundWMsCount; /// Default number of compound water meters
completed = false;
StartForceCloseHandler();
} }
/// <summary> /// <summary>
/// Constructor /// Constructor
/// </summary> /// </summary>
/// <param name="compoundWaterMetersCount">Number of text boxes for serial numbers</param> /// <param name="compoundWaterMetersCount">Number of text boxes for serial numbers</param>
public CycleBeginningForm(int compoundWaterMetersCount) /// <param name="remarksEnabled">Enable </param>
: this() public CycleBeginningForm(int compoundWaterMetersCount, bool remarksEnabled)
{ {
this.WaterMetersCount = compoundWaterMetersCount; /// = Program.CompondWMsCount InitializeComponent();
MainSNText = new string[compoundWaterMetersCount]; ControlBox = false;
AuxSNText = new string[compoundWaterMetersCount];
Disabled = new bool[compoundWaterMetersCount]; TextBoxesCount = 3;
mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label };
auxLabels = new Label[] { auxSN1Label, auxSN2Label, auxSN3Label };
mainComboBoxes = new ComboBox[] { main1ComboBox, main2ComboBox, main3ComboBox };
auxComboBoxes = new ComboBox[] { aux1ComboBox, aux2ComboBox, aux3ComboBox };
checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3 };
remarkBoxes = new ComboBox[] { remarkComboBox1, remarkComboBox2, remarkComboBox3 };
this.WaterMetersCount = compoundWaterMetersCount; /// = Program.CompondWMsCount
this.RemarksEnabled = remarksEnabled;
MainSNText = new string[compoundWaterMetersCount];
AuxSNText = new string[compoundWaterMetersCount];
Disabled = new bool[compoundWaterMetersCount];
Remark = new string[compoundWaterMetersCount];
enabledComboBoxes = new List<ComboBox>();
ShuffleTextBoxes(compoundWaterMetersCount); ShuffleTextBoxes(compoundWaterMetersCount);
Height = 110 + WaterMetersCount * 157; Height = 115 + WaterMetersCount * 157;
}
completed = false;
StartForceCloseHandler();
}
/// <summary> /// <summary>
/// Make sure the layout of labels/text boxes on the screen /// Make sure the layout of labels/text boxes on the screen
@ -88,7 +98,7 @@ namespace TBF.BenchControl.DataEntry.Combined
{ {
Localize(); Localize();
PrepareOrderCombo(orderComboBox); DEUtils.PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory);
if (WaterMetersCount >= 1) groupBox1.Visible = true; if (WaterMetersCount >= 1) groupBox1.Visible = true;
if (WaterMetersCount >= 2) groupBox2.Visible = true; if (WaterMetersCount >= 2) groupBox2.Visible = true;
@ -99,6 +109,11 @@ namespace TBF.BenchControl.DataEntry.Combined
mainLabels[i].Visible = mainComboBoxes[i].Visible = true; mainLabels[i].Visible = mainComboBoxes[i].Visible = true;
auxLabels[i].Visible = auxComboBoxes[i].Visible = true; auxLabels[i].Visible = auxComboBoxes[i].Visible = true;
checkBoxes[i].Visible = true; checkBoxes[i].Visible = true;
if (RemarksEnabled)
{
DEUtils.PrepareCombo(remarkBoxes[i], Program.LocalSettings.RemarkHistory, true);
remarkBoxes[i].Visible = true;
}
enabledComboBoxes.Add(mainComboBoxes[i]); enabledComboBoxes.Add(mainComboBoxes[i]);
enabledComboBoxes.Add(auxComboBoxes[i]); enabledComboBoxes.Add(auxComboBoxes[i]);
@ -128,23 +143,6 @@ namespace TBF.BenchControl.DataEntry.Combined
clearButton.Text = Strings.ClearBtnText; clearButton.Text = Strings.ClearBtnText;
} }
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="orderComboBox">Puchase order ComboBox</param>
void PrepareOrderCombo(ComboBox orderComboBox)
{
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
{
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
}
if (orderComboBox.Items.Count > 0)
{
orderComboBox.Text = orderComboBox.Items[0].ToString();
}
}
private void okButton_Click(object sender, EventArgs e) private void okButton_Click(object sender, EventArgs e)
{ {
PurchaseOrder = orderComboBox.Text; PurchaseOrder = orderComboBox.Text;
@ -160,10 +158,15 @@ namespace TBF.BenchControl.DataEntry.Combined
for (int i = 0; i < TextBoxesCount; i++) for (int i = 0; i < TextBoxesCount; i++)
{ {
MainSNText[i] = mainComboBoxes[i].Text; if (RemarksEnabled)
{
Program.LocalSettings.UpdateHistory(remarkBoxes[i].Text, ref Program.LocalSettings.RemarkHistory, 20);
}
MainSNText[i] = mainComboBoxes[i].Text;
AuxSNText[i] = auxComboBoxes[i].Text; AuxSNText[i] = auxComboBoxes[i].Text;
Disabled[i] = !checkBoxes[i].Checked; Disabled[i] = !checkBoxes[i].Checked;
} Remark[i] = remarkBoxes[i].Text;
}
completed = true; completed = true;
Close(); Close();
@ -280,12 +283,14 @@ namespace TBF.BenchControl.DataEntry.Combined
/// <param name="currentFocusOwner">TextBox control which received the event</param> /// <param name="currentFocusOwner">TextBox control which received the event</param>
private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner) private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner)
{ {
#if !CEVAK_200
if (e.KeyChar == '+') if (e.KeyChar == '+')
{ {
/// Process '+' key ..... Form completed /// Process '+' key ..... Form completed
okButton_Click(sender, e); okButton_Click(sender, e);
} }
if (e.KeyChar == '\r') #endif
if (e.KeyChar == '\r')
{ {
/// Process <enter> key ..... Next text field /// Process <enter> key ..... Next text field
if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox

View File

@ -124,7 +124,7 @@ namespace TBF.BenchControl.DataEntry.Combined
/// ///
void OpenBeginningDlg(EntryForm myRef) void OpenBeginningDlg(EntryForm myRef)
{ {
myRef.modelessDlg = new CycleBeginningForm(Config.Data.CompoundWMsCount); myRef.modelessDlg = new CycleBeginningForm(Config.Data.CompoundWMsCount, myRef.entryFormCfg.RemarkEnabled);
modelessDlg.Show(); modelessDlg.Show();
} }
/// ///
@ -203,9 +203,12 @@ namespace TBF.BenchControl.DataEntry.Combined
{ {
waterMeters[i].SerialNr = dlg.MainSNText[i]; waterMeters[i].SerialNr = dlg.MainSNText[i];
waterMeters[i].SerialNrAux = dlg.AuxSNText[i]; waterMeters[i].SerialNrAux = dlg.AuxSNText[i];
disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i];
} if (dlg.RemarksEnabled)
{
waterMeters[i].Remark = dlg.Remark[i];
}
}
} }
} }
} }

View File

@ -20,6 +20,7 @@ namespace TBF.BenchControl.DataEntry.Combined
/// Serialized parameters /// Serialized parameters
/// ///
public bool ShowCycleEndForm; public bool ShowCycleEndForm;
public bool RemarkEnabled;
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg() EntryFormCfg()
@ -27,7 +28,8 @@ namespace TBF.BenchControl.DataEntry.Combined
Name = "DataEntry-Combined"; Name = "DataEntry-Combined";
ParentName = string.Empty; ParentName = string.Empty;
ShowCycleEndForm = false; ShowCycleEndForm = false;
} RemarkEnabled = false;
}
public EntryFormCfg(IComponentFactory factory) public EntryFormCfg(IComponentFactory factory)
: this() : this()
@ -37,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Combined
public string ToString(int i) public string ToString(int i)
{ {
return string.Format("Name={0}, ShowEndForm={1}", Name, ShowCycleEndForm); return string.Format("Name={0}, ShowEndForm={1}, Remark={2}", Name, ShowCycleEndForm, RemarkEnabled);
} }
} }
} }

View File

@ -38,7 +38,8 @@ namespace TBF.BenchControl.DataEntry.Combined
void Localize() void Localize()
{ {
showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form; showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form;
} remarkEnabledCheckBox.Text = Strings.Enable_Remark;
}
public void Closing() public void Closing()
{ {
@ -50,13 +51,15 @@ namespace TBF.BenchControl.DataEntry.Combined
classNameLabel.Text = config.Factory.ClassName; classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name; nameTextBox.Text = config.Name;
showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm; showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm;
} remarkEnabledCheckBox.Checked = config.RemarkEnabled;
}
public void Unlock() public void Unlock()
{ {
nameTextBox.Enabled = true; nameTextBox.Enabled = true;
showCycleEndFormCheckBox.Enabled = true; showCycleEndFormCheckBox.Enabled = true;
} remarkEnabledCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message) public CfgUpdateFlags VerifyCfg(ref string message)
{ {
@ -72,6 +75,7 @@ namespace TBF.BenchControl.DataEntry.Combined
config.Name = nameTextBox.Text; config.Name = nameTextBox.Text;
config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked;
config.RemarkEnabled = remarkEnabledCheckBox.Checked;
return flags; return flags;
} }

View File

@ -31,62 +31,75 @@ namespace TBF.BenchControl.DataEntry.Combined
/// </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.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.remarkEnabledCheckBox = new System.Windows.Forms.CheckBox();
// this.SuspendLayout();
// nameTextBox //
// // nameTextBox
this.nameTextBox.Enabled = false; //
this.nameTextBox.Location = new System.Drawing.Point(137, 57); this.nameTextBox.Enabled = false;
this.nameTextBox.Name = "nameTextBox"; this.nameTextBox.Location = new System.Drawing.Point(114, 57);
this.nameTextBox.Size = new System.Drawing.Size(130, 20); this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.TabIndex = 5; this.nameTextBox.Size = new System.Drawing.Size(130, 20);
// this.nameTextBox.TabIndex = 5;
// nameLabel //
// // nameLabel
this.nameLabel.AutoSize = true; //
this.nameLabel.Location = new System.Drawing.Point(27, 60); this.nameLabel.AutoSize = true;
this.nameLabel.Name = "nameLabel"; this.nameLabel.Location = new System.Drawing.Point(39, 60);
this.nameLabel.Size = new System.Drawing.Size(35, 13); this.nameLabel.Name = "nameLabel";
this.nameLabel.TabIndex = 4; this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.Text = "Name"; this.nameLabel.TabIndex = 4;
// this.nameLabel.Text = "Name";
// classNameLabel //
// // classNameLabel
this.classNameLabel.AutoSize = true; //
this.classNameLabel.Location = new System.Drawing.Point(134, 33); this.classNameLabel.AutoSize = true;
this.classNameLabel.Name = "classNameLabel"; this.classNameLabel.Location = new System.Drawing.Point(111, 33);
this.classNameLabel.Size = new System.Drawing.Size(83, 13); this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.TabIndex = 3; this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.Text = "ComonentName"; this.classNameLabel.TabIndex = 3;
// this.classNameLabel.Text = "ComonentName";
// showCycleEndFormCheckBox //
// // showCycleEndFormCheckBox
this.showCycleEndFormCheckBox.AutoSize = true; //
this.showCycleEndFormCheckBox.Enabled = false; this.showCycleEndFormCheckBox.AutoSize = true;
this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(137, 90); this.showCycleEndFormCheckBox.Enabled = false;
this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox"; this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(114, 90);
this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17); this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox";
this.showCycleEndFormCheckBox.TabIndex = 14; this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17);
this.showCycleEndFormCheckBox.Text = "Show cycle end form"; this.showCycleEndFormCheckBox.TabIndex = 14;
this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true; this.showCycleEndFormCheckBox.Text = "Show cycle end form";
// this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true;
// EntryFormCfgCtrl //
// // remarkEnabledCheckBox
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.remarkEnabledCheckBox.AutoSize = true;
this.Controls.Add(this.showCycleEndFormCheckBox); this.remarkEnabledCheckBox.Enabled = false;
this.Controls.Add(this.nameTextBox); this.remarkEnabledCheckBox.Location = new System.Drawing.Point(114, 113);
this.Controls.Add(this.nameLabel); this.remarkEnabledCheckBox.Name = "remarkEnabledCheckBox";
this.Controls.Add(this.classNameLabel); this.remarkEnabledCheckBox.Size = new System.Drawing.Size(99, 17);
this.Name = "EntryFormCfgCtrl"; this.remarkEnabledCheckBox.TabIndex = 15;
this.Size = new System.Drawing.Size(300, 200); this.remarkEnabledCheckBox.Text = "Enable remarks";
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); this.remarkEnabledCheckBox.UseVisualStyleBackColor = true;
this.ResumeLayout(false); //
this.PerformLayout(); // EntryFormCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.remarkEnabledCheckBox);
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();
} }
@ -96,5 +109,6 @@ namespace TBF.BenchControl.DataEntry.Combined
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 showCycleEndFormCheckBox;
private System.Windows.Forms.CheckBox remarkEnabledCheckBox;
} }
} }

View File

@ -0,0 +1,34 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
namespace TBF.BenchControl.DataEntry
{
public class DEUtils
{
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="comboBox">Puchase order ComboBox</param>
public static void PrepareCombo(ComboBox comboBox, string[] history, bool emptyOnStart = false)
{
int historyLen = (history != null) ? history.Length : 0;
if (!emptyOnStart && (historyLen > 0))
{
comboBox.Text = history[0];
}
else
{
comboBox.Text = string.Empty;
}
for (int i = 0; i < historyLen; i++)
{
comboBox.Items.Add(history[i]);
}
}
}
}

View File

@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2017 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -48,6 +48,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
this.WaterMetersCount = waterMetersCount; this.WaterMetersCount = waterMetersCount;
this.RemarksEnabled = remarksEnabled; this.RemarksEnabled = remarksEnabled;
SNText = new string[WaterMetersCount]; SNText = new string[WaterMetersCount];
Disabled = new bool[WaterMetersCount]; Disabled = new bool[WaterMetersCount];
Remark = new string[WaterMetersCount]; Remark = new string[WaterMetersCount];
@ -67,11 +68,11 @@ namespace TBF.BenchControl.DataEntry.Standard6
{ {
Localize(); Localize();
PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory); DEUtils.PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory);
for (int i = 0; i < WaterMetersCount; i++) for (int i = 0; i < WaterMetersCount; i++)
{ {
PrepareCombo(remarkBoxes[i], Program.LocalSettings.RemarkHistory, true); DEUtils.PrepareCombo(remarkBoxes[i], Program.LocalSettings.RemarkHistory, true);
} }
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount) if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
@ -123,28 +124,6 @@ namespace TBF.BenchControl.DataEntry.Standard6
label6.Text = Strings.Water_Meter + " 6"; label6.Text = Strings.Water_Meter + " 6";
} }
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="comboBox">Puchase order ComboBox</param>
void PrepareCombo(ComboBox comboBox, string[] history, bool emptyOnStart = false)
{
int historyLen = (history != null) ? history.Length : 0;
if (!emptyOnStart && (historyLen > 0))
{
comboBox.Text = history[0];
}
else
{
comboBox.Text = string.Empty;
}
for (int i = 0; i < historyLen; i++)
{
comboBox.Items.Add(history[i]);
}
}
private void okButton_Click(object sender, EventArgs e) private void okButton_Click(object sender, EventArgs e)
{ {

View File

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

View File

@ -1356,4 +1356,7 @@
<data name="Error_saving_parameters_of_0" xml:space="preserve"> <data name="Error_saving_parameters_of_0" xml:space="preserve">
<value>Chyba při ukládání parametrů {0}</value> <value>Chyba při ukládání parametrů {0}</value>
</data> </data>
<data name="Enable_Remark" xml:space="preserve">
<value>Zobrazit poznámku</value>
</data>
</root> </root>

View File

@ -415,6 +415,7 @@
<Compile Include="BenchControl\DataEntry\StandardCamera\TestStartEndForm.designer.cs"> <Compile Include="BenchControl\DataEntry\StandardCamera\TestStartEndForm.designer.cs">
<DependentUpon>TestStartEndForm.cs</DependentUpon> <DependentUpon>TestStartEndForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="BenchControl\DataEntry\DEUtils.cs" />
<Compile Include="BenchControl\Dummy\Balance\Component.cs" /> <Compile Include="BenchControl\Dummy\Balance\Component.cs" />
<Compile Include="BenchControl\Dummy\Balance\Factory.cs" /> <Compile Include="BenchControl\Dummy\Balance\Factory.cs" />
<Compile Include="BenchControl\Dummy\Diverter\Component.cs" /> <Compile Include="BenchControl\Dummy\Diverter\Component.cs" />