From 20b2b9da97fc652f54954c516cb38a6ad7c53590 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Fri, 14 Dec 2018 14:53:58 +0100 Subject: [PATCH] (1) ResultsBrowser : Import of printer configuration, (2) DataEntry.Combined.CycleBeginningForm with Remark, ver. 2.18.1098 --- .../Forms/PrinterConfigDlg.Designer.cs | 153 ++-- ResultsBrowser/Forms/PrinterConfigDlg.cs | 82 ++- ResultsBrowser/Properties/AssemblyInfo.cs | 4 +- .../Combined/CycleBeginningForm.Designer.cs | 677 +++++++++--------- .../DataEntry/Combined/CycleBeginningForm.cs | 97 +-- .../DataEntry/Combined/EntryForm.cs | 9 +- .../DataEntry/Combined/EntryFormCfg.cs | 6 +- .../DataEntry/Combined/EntryFormCfgCtrl.cs | 10 +- .../Combined/EntryFormCfgCtrl.designer.cs | 126 ++-- TBF/BenchControl/DataEntry/DEUtils.cs | 34 + .../DataEntry/Standard6/CycleBeginningForm.cs | 29 +- TBF/Properties/AssemblyInfo.cs | 4 +- TBF/Resources/Strings.cs.resx | 3 + TBF/TBF.csproj | 1 + 14 files changed, 688 insertions(+), 547 deletions(-) create mode 100644 TBF/BenchControl/DataEntry/DEUtils.cs diff --git a/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs b/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs index 4d4088e23..439835110 100644 --- a/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs +++ b/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs @@ -28,76 +28,88 @@ /// private void InitializeComponent() { - this.printerClassComboBox = new System.Windows.Forms.ComboBox(); - this.changePrinterClassButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.configureButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // printerClassComboBox - // - this.printerClassComboBox.Enabled = false; - this.printerClassComboBox.FormattingEnabled = true; - this.printerClassComboBox.Location = new System.Drawing.Point(12, 29); - this.printerClassComboBox.Name = "printerClassComboBox"; - this.printerClassComboBox.Size = new System.Drawing.Size(389, 21); - this.printerClassComboBox.TabIndex = 0; - // - // changePrinterClassButton - // - this.changePrinterClassButton.Location = new System.Drawing.Point(15, 67); - this.changePrinterClassButton.Name = "changePrinterClassButton"; - this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43); - this.changePrinterClassButton.TabIndex = 1; - this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)"; - this.changePrinterClassButton.UseVisualStyleBackColor = true; - this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(60, 13); - this.label1.TabIndex = 2; - this.label1.Text = "Printer type"; - // - // configureButton - // - this.configureButton.Location = new System.Drawing.Point(196, 67); - this.configureButton.Name = "configureButton"; - this.configureButton.Size = new System.Drawing.Size(95, 43); - this.configureButton.TabIndex = 3; - this.configureButton.Text = "Configure"; - this.configureButton.UseVisualStyleBackColor = true; - this.configureButton.Click += new System.EventHandler(this.configureButton_Click); - // - // cancelButton - // - this.cancelButton.Location = new System.Drawing.Point(306, 67); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(95, 43); - this.cancelButton.TabIndex = 4; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // PrinterConfigDlg - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(416, 122); - 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(); + this.printerClassComboBox = new System.Windows.Forms.ComboBox(); + this.changePrinterClassButton = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.configureButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.importButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // printerClassComboBox + // + this.printerClassComboBox.Enabled = false; + this.printerClassComboBox.FormattingEnabled = true; + this.printerClassComboBox.Location = new System.Drawing.Point(12, 29); + this.printerClassComboBox.Name = "printerClassComboBox"; + this.printerClassComboBox.Size = new System.Drawing.Size(457, 21); + this.printerClassComboBox.TabIndex = 0; + // + // changePrinterClassButton + // + this.changePrinterClassButton.Location = new System.Drawing.Point(12, 67); + this.changePrinterClassButton.Name = "changePrinterClassButton"; + this.changePrinterClassButton.Size = new System.Drawing.Size(161, 43); + this.changePrinterClassButton.TabIndex = 1; + this.changePrinterClassButton.Text = "Change printer type (configuration will be deleted)"; + this.changePrinterClassButton.UseVisualStyleBackColor = true; + this.changePrinterClassButton.Click += new System.EventHandler(this.changePrinterClassButton_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(60, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Printer type"; + // + // configureButton + // + this.configureButton.Location = new System.Drawing.Point(188, 67); + this.configureButton.Name = "configureButton"; + this.configureButton.Size = new System.Drawing.Size(83, 43); + this.configureButton.TabIndex = 3; + this.configureButton.Text = "Configure"; + this.configureButton.UseVisualStyleBackColor = true; + this.configureButton.Click += new System.EventHandler(this.configureButton_Click); + // + // cancelButton + // + this.cancelButton.Location = new System.Drawing.Point(383, 67); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(84, 43); + this.cancelButton.TabIndex = 4; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // importButton + // + this.importButton.Location = new System.Drawing.Point(285, 67); + this.importButton.Name = "importButton"; + this.importButton.Size = new System.Drawing.Size(83, 43); + this.importButton.TabIndex = 5; + this.importButton.Text = "Import"; + this.importButton.UseVisualStyleBackColor = true; + this.importButton.Click += new System.EventHandler(this.importButton_Click); + // + // PrinterConfigDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + 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.Button configureButton; private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button importButton; } } \ No newline at end of file diff --git a/ResultsBrowser/Forms/PrinterConfigDlg.cs b/ResultsBrowser/Forms/PrinterConfigDlg.cs index 04162e1f3..e11b14e63 100644 --- a/ResultsBrowser/Forms/PrinterConfigDlg.cs +++ b/ResultsBrowser/Forms/PrinterConfigDlg.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.IO; using System.Windows.Forms; +using Config.Entities; using TBF.BenchControl; using TBF.BenchControl.Generic; @@ -90,7 +92,7 @@ namespace ResultsBrowser.Forms cfgControl.Config.ItemNr = 0; TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg(); - cfgForm.TbfComponents = new List(); + cfgForm.TbfComponents = new List(); cfgForm.ComponentCfgCtrl = cfgControl; cfgForm.UnlockAfterStart = true; @@ -104,23 +106,65 @@ namespace ResultsBrowser.Forms } - /// - /// Updates component factory - /// - /// Component class name - /// Reference to a factory - /// true when factory changed - IComponentFactory GetFactory(string className) - { - if (!string.IsNullOrEmpty(className)) - { - foreach (var fac in TbfComponents.Factories) - { - if (fac.ClassName == className) return fac; - } - } + private void importButton_Click(object sender, EventArgs e) + { + string oriClassName = PrinterClass; - 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; + } + } + + + /// + /// Updates component factory + /// + /// Component class name + /// Reference to a factory + /// true when factory changed + IComponentFactory GetFactory(string className) + { + if (!string.IsNullOrEmpty(className)) + { + foreach (var fac in TbfComponents.Factories) + { + if (fac.ClassName == className) return fac; + } + } + + return null; + } + } } diff --git a/ResultsBrowser/Properties/AssemblyInfo.cs b/ResultsBrowser/Properties/AssemblyInfo.cs index b7ef64159..490d4c679 100644 --- a/ResultsBrowser/Properties/AssemblyInfo.cs +++ b/ResultsBrowser/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.18.1096.0")] -[assembly: AssemblyFileVersion("2.18.1096.0")] +[assembly: AssemblyVersion("2.18.1098.0")] +[assembly: AssemblyFileVersion("2.18.1098.0")] diff --git a/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.Designer.cs b/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.Designer.cs index 2f21da6f8..914493cfa 100644 --- a/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.Designer.cs +++ b/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.Designer.cs @@ -31,325 +31,361 @@ namespace TBF.BenchControl.DataEntry.Combined /// private void InitializeComponent() { - this.okButton = new System.Windows.Forms.Button(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.aux1ComboBox = new System.Windows.Forms.ComboBox(); - this.main1ComboBox = new System.Windows.Forms.ComboBox(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.auxSN1Label = new System.Windows.Forms.Label(); - this.mainSN1Label = new System.Windows.Forms.Label(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.aux2ComboBox = new System.Windows.Forms.ComboBox(); - this.main2ComboBox = new System.Windows.Forms.ComboBox(); - this.checkBox2 = new System.Windows.Forms.CheckBox(); - this.auxSN2Label = new System.Windows.Forms.Label(); - this.mainSN2Label = new System.Windows.Forms.Label(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.aux3ComboBox = new System.Windows.Forms.ComboBox(); - this.main3ComboBox = new System.Windows.Forms.ComboBox(); - this.checkBox3 = new System.Windows.Forms.CheckBox(); - this.auxSN3Label = new System.Windows.Forms.Label(); - this.mainSN3Label = new System.Windows.Forms.Label(); - this.clearButton = new System.Windows.Forms.Button(); - this.orderGroupBox = new System.Windows.Forms.GroupBox(); - this.orderComboBox = new System.Windows.Forms.ComboBox(); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.orderGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // okButton - // - this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.okButton.ForeColor = System.Drawing.Color.Black; - this.okButton.Location = new System.Drawing.Point(589, 33); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(117, 63); - this.okButton.TabIndex = 0; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.aux1ComboBox); - this.groupBox1.Controls.Add(this.main1ComboBox); - this.groupBox1.Controls.Add(this.checkBox1); - this.groupBox1.Controls.Add(this.auxSN1Label); - this.groupBox1.Controls.Add(this.mainSN1Label); - this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.groupBox1.ForeColor = System.Drawing.Color.Black; - this.groupBox1.Location = new System.Drawing.Point(28, 118); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(533, 137); - this.groupBox1.TabIndex = 1; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Water Meter 1"; - this.groupBox1.Visible = false; - // - // aux1ComboBox - // - this.aux1ComboBox.FormattingEnabled = true; - this.aux1ComboBox.Location = new System.Drawing.Point(287, 83); - this.aux1ComboBox.Name = "aux1ComboBox"; - this.aux1ComboBox.Size = new System.Drawing.Size(175, 31); - this.aux1ComboBox.TabIndex = 6; - this.aux1ComboBox.Visible = false; - this.aux1ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux1ComboBox_SelectedIndexChanged); - this.aux1ComboBox.TextChanged += new System.EventHandler(this.aux1ComboBox_TextChanged); - this.aux1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1ComboBox_KeyPress); - // - // main1ComboBox - // - this.main1ComboBox.FormattingEnabled = true; - this.main1ComboBox.Location = new System.Drawing.Point(287, 37); - this.main1ComboBox.Name = "main1ComboBox"; - this.main1ComboBox.Size = new System.Drawing.Size(175, 31); - this.main1ComboBox.TabIndex = 5; - this.main1ComboBox.Visible = false; - this.main1ComboBox.SelectedIndexChanged += new System.EventHandler(this.main1ComboBox_SelectedIndexChanged); - this.main1ComboBox.TextChanged += new System.EventHandler(this.main1ComboBox_TextChanged); - this.main1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1ComboBox_KeyPress); - // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.Font = new System.Drawing.Font("Verdana", 27.75F); - this.checkBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBox1.Location = new System.Drawing.Point(490, 69); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(15, 14); - this.checkBox1.TabIndex = 4; - this.checkBox1.UseVisualStyleBackColor = true; - this.checkBox1.Visible = false; - // - // auxSN1Label - // - this.auxSN1Label.AutoSize = true; - this.auxSN1Label.Location = new System.Drawing.Point(21, 86); - this.auxSN1Label.Name = "auxSN1Label"; - this.auxSN1Label.Size = new System.Drawing.Size(193, 23); - this.auxSN1Label.TabIndex = 2; - this.auxSN1Label.Text = "Aux. WM Serial Nr."; - this.auxSN1Label.Visible = false; - // - // mainSN1Label - // - this.mainSN1Label.AutoSize = true; - this.mainSN1Label.Location = new System.Drawing.Point(21, 40); - this.mainSN1Label.Name = "mainSN1Label"; - this.mainSN1Label.Size = new System.Drawing.Size(195, 23); - this.mainSN1Label.TabIndex = 0; - this.mainSN1Label.Text = "Main WM Serial Nr."; - this.mainSN1Label.Visible = false; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.aux2ComboBox); - this.groupBox2.Controls.Add(this.main2ComboBox); - this.groupBox2.Controls.Add(this.checkBox2); - this.groupBox2.Controls.Add(this.auxSN2Label); - this.groupBox2.Controls.Add(this.mainSN2Label); - this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.groupBox2.ForeColor = System.Drawing.Color.Black; - this.groupBox2.Location = new System.Drawing.Point(28, 275); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(533, 137); - this.groupBox2.TabIndex = 2; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Water Meter 2"; - this.groupBox2.Visible = false; - // - // aux2ComboBox - // - this.aux2ComboBox.FormattingEnabled = true; - this.aux2ComboBox.Location = new System.Drawing.Point(287, 83); - this.aux2ComboBox.Name = "aux2ComboBox"; - this.aux2ComboBox.Size = new System.Drawing.Size(175, 31); - this.aux2ComboBox.TabIndex = 10; - this.aux2ComboBox.Visible = false; - this.aux2ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux2ComboBox_SelectedIndexChanged); - this.aux2ComboBox.TextChanged += new System.EventHandler(this.aux2ComboBox_TextChanged); - this.aux2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2ComboBox_KeyPress); - // - // main2ComboBox - // - this.main2ComboBox.FormattingEnabled = true; - this.main2ComboBox.Location = new System.Drawing.Point(287, 37); - this.main2ComboBox.Name = "main2ComboBox"; - this.main2ComboBox.Size = new System.Drawing.Size(175, 31); - this.main2ComboBox.TabIndex = 9; - this.main2ComboBox.Visible = false; - this.main2ComboBox.SelectedIndexChanged += new System.EventHandler(this.main2ComboBox_SelectedIndexChanged); - this.main2ComboBox.TextChanged += new System.EventHandler(this.main2ComboBox_TextChanged); - this.main2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2ComboBox_KeyPress); - // - // checkBox2 - // - this.checkBox2.AutoSize = true; - this.checkBox2.Font = new System.Drawing.Font("Verdana", 27.75F); - this.checkBox2.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBox2.Location = new System.Drawing.Point(490, 69); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(15, 14); - this.checkBox2.TabIndex = 8; - this.checkBox2.UseVisualStyleBackColor = true; - this.checkBox2.Visible = false; - // - // auxSN2Label - // - this.auxSN2Label.AutoSize = true; - this.auxSN2Label.Location = new System.Drawing.Point(21, 86); - this.auxSN2Label.Name = "auxSN2Label"; - this.auxSN2Label.Size = new System.Drawing.Size(193, 23); - this.auxSN2Label.TabIndex = 2; - this.auxSN2Label.Text = "Aux. WM Serial Nr."; - this.auxSN2Label.Visible = false; - // - // mainSN2Label - // - this.mainSN2Label.AutoSize = true; - this.mainSN2Label.Location = new System.Drawing.Point(21, 40); - this.mainSN2Label.Name = "mainSN2Label"; - this.mainSN2Label.Size = new System.Drawing.Size(195, 23); - this.mainSN2Label.TabIndex = 0; - this.mainSN2Label.Text = "Main WM Serial Nr."; - this.mainSN2Label.Visible = false; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.aux3ComboBox); - this.groupBox3.Controls.Add(this.main3ComboBox); - this.groupBox3.Controls.Add(this.checkBox3); - this.groupBox3.Controls.Add(this.auxSN3Label); - this.groupBox3.Controls.Add(this.mainSN3Label); - this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.groupBox3.ForeColor = System.Drawing.Color.Black; - this.groupBox3.Location = new System.Drawing.Point(28, 430); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(533, 137); - this.groupBox3.TabIndex = 3; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Water Meter 3"; - this.groupBox3.Visible = false; - // - // aux3ComboBox - // - this.aux3ComboBox.FormattingEnabled = true; - this.aux3ComboBox.Location = new System.Drawing.Point(287, 83); - this.aux3ComboBox.Name = "aux3ComboBox"; - this.aux3ComboBox.Size = new System.Drawing.Size(175, 31); - this.aux3ComboBox.TabIndex = 10; - this.aux3ComboBox.Visible = false; - this.aux3ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux3ComboBox_SelectedIndexChanged); - this.aux3ComboBox.TextChanged += new System.EventHandler(this.aux3ComboBox_TextChanged); - this.aux3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3ComboBox_KeyPress); - // - // main3ComboBox - // - this.main3ComboBox.FormattingEnabled = true; - this.main3ComboBox.Location = new System.Drawing.Point(287, 37); - this.main3ComboBox.Name = "main3ComboBox"; - this.main3ComboBox.Size = new System.Drawing.Size(175, 31); - this.main3ComboBox.TabIndex = 9; - this.main3ComboBox.Visible = false; - this.main3ComboBox.SelectedIndexChanged += new System.EventHandler(this.main3ComboBox_SelectedIndexChanged); - this.main3ComboBox.TextChanged += new System.EventHandler(this.main3ComboBox_TextChanged); - this.main3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3ComboBox_KeyPress); - // - // checkBox3 - // - this.checkBox3.AutoSize = true; - this.checkBox3.Font = new System.Drawing.Font("Verdana", 27.75F); - this.checkBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.checkBox3.Location = new System.Drawing.Point(490, 68); - this.checkBox3.Name = "checkBox3"; - this.checkBox3.Size = new System.Drawing.Size(15, 14); - this.checkBox3.TabIndex = 8; - this.checkBox3.UseVisualStyleBackColor = true; - this.checkBox3.Visible = false; - // - // auxSN3Label - // - this.auxSN3Label.AutoSize = true; - this.auxSN3Label.Location = new System.Drawing.Point(21, 86); - this.auxSN3Label.Name = "auxSN3Label"; - this.auxSN3Label.Size = new System.Drawing.Size(193, 23); - this.auxSN3Label.TabIndex = 2; - this.auxSN3Label.Text = "Aux. WM Serial Nr."; - this.auxSN3Label.Visible = false; - // - // mainSN3Label - // - this.mainSN3Label.AutoSize = true; - this.mainSN3Label.Location = new System.Drawing.Point(21, 40); - this.mainSN3Label.Name = "mainSN3Label"; - this.mainSN3Label.Size = new System.Drawing.Size(195, 23); - this.mainSN3Label.TabIndex = 0; - this.mainSN3Label.Text = "Main WM Serial Nr."; - this.mainSN3Label.Visible = false; - // - // clearButton - // - this.clearButton.Font = new System.Drawing.Font("Verdana", 14.25F); - this.clearButton.ForeColor = System.Drawing.Color.Black; - this.clearButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.clearButton.Location = new System.Drawing.Point(589, 116); - this.clearButton.Name = "clearButton"; - this.clearButton.Size = new System.Drawing.Size(117, 63); - this.clearButton.TabIndex = 9; - this.clearButton.Text = "Clear"; - this.clearButton.UseVisualStyleBackColor = true; - this.clearButton.Click += new System.EventHandler(this.clearButton_Click); - // - // orderGroupBox - // - this.orderGroupBox.Controls.Add(this.orderComboBox); - this.orderGroupBox.Font = new System.Drawing.Font("Verdana", 14.25F); - this.orderGroupBox.ForeColor = System.Drawing.Color.Black; - this.orderGroupBox.Location = new System.Drawing.Point(28, 16); - this.orderGroupBox.Name = "orderGroupBox"; - this.orderGroupBox.Size = new System.Drawing.Size(533, 82); - this.orderGroupBox.TabIndex = 10; - this.orderGroupBox.TabStop = false; - this.orderGroupBox.Text = "Order"; - // - // orderComboBox - // - this.orderComboBox.FormattingEnabled = true; - this.orderComboBox.Location = new System.Drawing.Point(165, 30); - this.orderComboBox.Name = "orderComboBox"; - this.orderComboBox.Size = new System.Drawing.Size(297, 31); - this.orderComboBox.TabIndex = 0; - // - // CycleBeginningForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSize = true; - this.BackColor = System.Drawing.Color.DarkGoldenrod; - this.ClientSize = new System.Drawing.Size(732, 593); - this.Controls.Add(this.orderGroupBox); - this.Controls.Add(this.clearButton); - this.Controls.Add(this.groupBox3); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.okButton); - this.ForeColor = System.Drawing.Color.Black; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Name = "CycleBeginningForm"; - this.Text = "Daten"; - this.TopMost = true; - this.Load += new System.EventHandler(this.CycleBeginningForm_Load); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.orderGroupBox.ResumeLayout(false); - this.ResumeLayout(false); + this.okButton = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.aux1ComboBox = new System.Windows.Forms.ComboBox(); + this.main1ComboBox = new System.Windows.Forms.ComboBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.auxSN1Label = new System.Windows.Forms.Label(); + this.mainSN1Label = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.aux2ComboBox = new System.Windows.Forms.ComboBox(); + this.main2ComboBox = new System.Windows.Forms.ComboBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.auxSN2Label = new System.Windows.Forms.Label(); + this.mainSN2Label = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.aux3ComboBox = new System.Windows.Forms.ComboBox(); + this.main3ComboBox = new System.Windows.Forms.ComboBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.auxSN3Label = new System.Windows.Forms.Label(); + this.mainSN3Label = new System.Windows.Forms.Label(); + this.clearButton = new System.Windows.Forms.Button(); + this.orderGroupBox = new System.Windows.Forms.GroupBox(); + this.orderComboBox = new System.Windows.Forms.ComboBox(); + this.remarkComboBox1 = new System.Windows.Forms.ComboBox(); + this.remarkComboBox2 = new System.Windows.Forms.ComboBox(); + this.remarkComboBox3 = new System.Windows.Forms.ComboBox(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.orderGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // okButton + // + this.okButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.okButton.ForeColor = System.Drawing.Color.Black; + this.okButton.Location = new System.Drawing.Point(589, 33); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(117, 63); + this.okButton.TabIndex = 0; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.remarkComboBox1); + this.groupBox1.Controls.Add(this.aux1ComboBox); + this.groupBox1.Controls.Add(this.main1ComboBox); + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Controls.Add(this.auxSN1Label); + this.groupBox1.Controls.Add(this.mainSN1Label); + this.groupBox1.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox1.ForeColor = System.Drawing.Color.Black; + this.groupBox1.Location = new System.Drawing.Point(28, 118); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(533, 143); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Water Meter 1"; + this.groupBox1.Visible = false; + // + // aux1ComboBox + // + this.aux1ComboBox.FormattingEnabled = true; + this.aux1ComboBox.Location = new System.Drawing.Point(318, 64); + this.aux1ComboBox.Name = "aux1ComboBox"; + this.aux1ComboBox.Size = new System.Drawing.Size(175, 31); + this.aux1ComboBox.TabIndex = 6; + this.aux1ComboBox.Visible = false; + this.aux1ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux1ComboBox_SelectedIndexChanged); + this.aux1ComboBox.TextChanged += new System.EventHandler(this.aux1ComboBox_TextChanged); + this.aux1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux1ComboBox_KeyPress); + // + // main1ComboBox + // + this.main1ComboBox.FormattingEnabled = true; + this.main1ComboBox.Location = new System.Drawing.Point(318, 27); + this.main1ComboBox.Name = "main1ComboBox"; + this.main1ComboBox.Size = new System.Drawing.Size(175, 31); + this.main1ComboBox.TabIndex = 5; + this.main1ComboBox.Visible = false; + this.main1ComboBox.SelectedIndexChanged += new System.EventHandler(this.main1ComboBox_SelectedIndexChanged); + this.main1ComboBox.TextChanged += new System.EventHandler(this.main1ComboBox_TextChanged); + this.main1ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main1ComboBox_KeyPress); + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Font = new System.Drawing.Font("Verdana", 27.75F); + this.checkBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.checkBox1.Location = new System.Drawing.Point(506, 28); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(15, 14); + this.checkBox1.TabIndex = 4; + this.checkBox1.UseVisualStyleBackColor = true; + this.checkBox1.Visible = false; + // + // auxSN1Label + // + this.auxSN1Label.AutoSize = true; + this.auxSN1Label.Location = new System.Drawing.Point(21, 67); + this.auxSN1Label.Name = "auxSN1Label"; + this.auxSN1Label.Size = new System.Drawing.Size(193, 23); + this.auxSN1Label.TabIndex = 2; + this.auxSN1Label.Text = "Aux. WM Serial Nr."; + this.auxSN1Label.Visible = false; + // + // mainSN1Label + // + this.mainSN1Label.AutoSize = true; + this.mainSN1Label.Location = new System.Drawing.Point(21, 33); + this.mainSN1Label.Name = "mainSN1Label"; + this.mainSN1Label.Size = new System.Drawing.Size(195, 23); + this.mainSN1Label.TabIndex = 0; + this.mainSN1Label.Text = "Main WM Serial Nr."; + this.mainSN1Label.Visible = false; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.remarkComboBox2); + this.groupBox2.Controls.Add(this.aux2ComboBox); + this.groupBox2.Controls.Add(this.main2ComboBox); + this.groupBox2.Controls.Add(this.checkBox2); + this.groupBox2.Controls.Add(this.auxSN2Label); + this.groupBox2.Controls.Add(this.mainSN2Label); + this.groupBox2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox2.ForeColor = System.Drawing.Color.Black; + this.groupBox2.Location = new System.Drawing.Point(28, 275); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(533, 143); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Water Meter 2"; + this.groupBox2.Visible = false; + // + // aux2ComboBox + // + this.aux2ComboBox.FormattingEnabled = true; + this.aux2ComboBox.Location = new System.Drawing.Point(318, 64); + this.aux2ComboBox.Name = "aux2ComboBox"; + this.aux2ComboBox.Size = new System.Drawing.Size(175, 31); + this.aux2ComboBox.TabIndex = 10; + this.aux2ComboBox.Visible = false; + this.aux2ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux2ComboBox_SelectedIndexChanged); + this.aux2ComboBox.TextChanged += new System.EventHandler(this.aux2ComboBox_TextChanged); + this.aux2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux2ComboBox_KeyPress); + // + // main2ComboBox + // + this.main2ComboBox.FormattingEnabled = true; + this.main2ComboBox.Location = new System.Drawing.Point(318, 27); + this.main2ComboBox.Name = "main2ComboBox"; + this.main2ComboBox.Size = new System.Drawing.Size(175, 31); + this.main2ComboBox.TabIndex = 9; + this.main2ComboBox.Visible = false; + this.main2ComboBox.SelectedIndexChanged += new System.EventHandler(this.main2ComboBox_SelectedIndexChanged); + this.main2ComboBox.TextChanged += new System.EventHandler(this.main2ComboBox_TextChanged); + this.main2ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main2ComboBox_KeyPress); + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Font = new System.Drawing.Font("Verdana", 27.75F); + this.checkBox2.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.checkBox2.Location = new System.Drawing.Point(506, 28); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(15, 14); + this.checkBox2.TabIndex = 8; + this.checkBox2.UseVisualStyleBackColor = true; + this.checkBox2.Visible = false; + // + // auxSN2Label + // + this.auxSN2Label.AutoSize = true; + this.auxSN2Label.Location = new System.Drawing.Point(21, 67); + this.auxSN2Label.Name = "auxSN2Label"; + this.auxSN2Label.Size = new System.Drawing.Size(193, 23); + this.auxSN2Label.TabIndex = 2; + this.auxSN2Label.Text = "Aux. WM Serial Nr."; + this.auxSN2Label.Visible = false; + // + // mainSN2Label + // + this.mainSN2Label.AutoSize = true; + this.mainSN2Label.Location = new System.Drawing.Point(21, 33); + this.mainSN2Label.Name = "mainSN2Label"; + this.mainSN2Label.Size = new System.Drawing.Size(195, 23); + this.mainSN2Label.TabIndex = 0; + this.mainSN2Label.Text = "Main WM Serial Nr."; + this.mainSN2Label.Visible = false; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.remarkComboBox3); + this.groupBox3.Controls.Add(this.aux3ComboBox); + this.groupBox3.Controls.Add(this.main3ComboBox); + this.groupBox3.Controls.Add(this.checkBox3); + this.groupBox3.Controls.Add(this.auxSN3Label); + this.groupBox3.Controls.Add(this.mainSN3Label); + this.groupBox3.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.groupBox3.ForeColor = System.Drawing.Color.Black; + this.groupBox3.Location = new System.Drawing.Point(28, 430); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(533, 143); + this.groupBox3.TabIndex = 3; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Water Meter 3"; + this.groupBox3.Visible = false; + // + // aux3ComboBox + // + this.aux3ComboBox.FormattingEnabled = true; + this.aux3ComboBox.Location = new System.Drawing.Point(318, 64); + this.aux3ComboBox.Name = "aux3ComboBox"; + this.aux3ComboBox.Size = new System.Drawing.Size(175, 31); + this.aux3ComboBox.TabIndex = 10; + this.aux3ComboBox.Visible = false; + this.aux3ComboBox.SelectedIndexChanged += new System.EventHandler(this.aux3ComboBox_SelectedIndexChanged); + this.aux3ComboBox.TextChanged += new System.EventHandler(this.aux3ComboBox_TextChanged); + this.aux3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.aux3ComboBox_KeyPress); + // + // main3ComboBox + // + this.main3ComboBox.FormattingEnabled = true; + this.main3ComboBox.Location = new System.Drawing.Point(318, 27); + this.main3ComboBox.Name = "main3ComboBox"; + this.main3ComboBox.Size = new System.Drawing.Size(175, 31); + this.main3ComboBox.TabIndex = 9; + this.main3ComboBox.Visible = false; + this.main3ComboBox.SelectedIndexChanged += new System.EventHandler(this.main3ComboBox_SelectedIndexChanged); + this.main3ComboBox.TextChanged += new System.EventHandler(this.main3ComboBox_TextChanged); + this.main3ComboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.main3ComboBox_KeyPress); + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Font = new System.Drawing.Font("Verdana", 27.75F); + this.checkBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.checkBox3.Location = new System.Drawing.Point(506, 27); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(15, 14); + this.checkBox3.TabIndex = 8; + this.checkBox3.UseVisualStyleBackColor = true; + this.checkBox3.Visible = false; + // + // auxSN3Label + // + this.auxSN3Label.AutoSize = true; + this.auxSN3Label.Location = new System.Drawing.Point(21, 67); + this.auxSN3Label.Name = "auxSN3Label"; + this.auxSN3Label.Size = new System.Drawing.Size(193, 23); + this.auxSN3Label.TabIndex = 2; + this.auxSN3Label.Text = "Aux. WM Serial Nr."; + this.auxSN3Label.Visible = false; + // + // mainSN3Label + // + this.mainSN3Label.AutoSize = true; + this.mainSN3Label.Location = new System.Drawing.Point(21, 33); + this.mainSN3Label.Name = "mainSN3Label"; + this.mainSN3Label.Size = new System.Drawing.Size(195, 23); + this.mainSN3Label.TabIndex = 0; + this.mainSN3Label.Text = "Main WM Serial Nr."; + this.mainSN3Label.Visible = false; + // + // clearButton + // + this.clearButton.Font = new System.Drawing.Font("Verdana", 14.25F); + this.clearButton.ForeColor = System.Drawing.Color.Black; + this.clearButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.clearButton.Location = new System.Drawing.Point(589, 116); + this.clearButton.Name = "clearButton"; + this.clearButton.Size = new System.Drawing.Size(117, 63); + this.clearButton.TabIndex = 9; + this.clearButton.Text = "Clear"; + this.clearButton.UseVisualStyleBackColor = true; + this.clearButton.Click += new System.EventHandler(this.clearButton_Click); + // + // orderGroupBox + // + this.orderGroupBox.Controls.Add(this.orderComboBox); + this.orderGroupBox.Font = new System.Drawing.Font("Verdana", 14.25F); + this.orderGroupBox.ForeColor = System.Drawing.Color.Black; + this.orderGroupBox.Location = new System.Drawing.Point(28, 16); + this.orderGroupBox.Name = "orderGroupBox"; + this.orderGroupBox.Size = new System.Drawing.Size(533, 82); + this.orderGroupBox.TabIndex = 10; + this.orderGroupBox.TabStop = false; + this.orderGroupBox.Text = "Order"; + // + // orderComboBox + // + this.orderComboBox.FormattingEnabled = true; + this.orderComboBox.Location = new System.Drawing.Point(196, 31); + this.orderComboBox.Name = "orderComboBox"; + this.orderComboBox.Size = new System.Drawing.Size(297, 31); + this.orderComboBox.TabIndex = 0; + // + // remarkComboBox1 + // + this.remarkComboBox1.Font = new System.Drawing.Font("Verdana", 14.25F); + this.remarkComboBox1.FormattingEnabled = true; + this.remarkComboBox1.Location = new System.Drawing.Point(56, 101); + this.remarkComboBox1.Name = "remarkComboBox1"; + this.remarkComboBox1.Size = new System.Drawing.Size(437, 31); + this.remarkComboBox1.TabIndex = 35; + this.remarkComboBox1.Visible = false; + // + // remarkComboBox2 + // + this.remarkComboBox2.Font = new System.Drawing.Font("Verdana", 14.25F); + this.remarkComboBox2.FormattingEnabled = true; + this.remarkComboBox2.Location = new System.Drawing.Point(56, 101); + this.remarkComboBox2.Name = "remarkComboBox2"; + this.remarkComboBox2.Size = new System.Drawing.Size(437, 31); + this.remarkComboBox2.TabIndex = 36; + this.remarkComboBox2.Visible = 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 aux3ComboBox; private System.Windows.Forms.ComboBox main3ComboBox; + private System.Windows.Forms.ComboBox remarkComboBox1; + private System.Windows.Forms.ComboBox remarkComboBox2; + private System.Windows.Forms.ComboBox remarkComboBox3; } } \ No newline at end of file diff --git a/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.cs b/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.cs index 58c2098a3..ec62d4dcb 100644 --- a/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.cs +++ b/TBF/BenchControl/DataEntry/Combined/CycleBeginningForm.cs @@ -17,12 +17,14 @@ namespace TBF.BenchControl.DataEntry.Combined /// Number of water meters public readonly int WaterMetersCount; + public readonly bool RemarksEnabled; // To be retrieved after the form closes public string PurchaseOrder; public string[] MainSNText; public string[] AuxSNText; public bool[] Disabled; + public string[] Remark; // Set to 'true' when the form closes public bool Completed { get { return completed; } } @@ -35,44 +37,52 @@ namespace TBF.BenchControl.DataEntry.Combined ComboBox[] mainComboBoxes; ComboBox[] auxComboBoxes; CheckBox[] checkBoxes; - IList enabledComboBoxes; - + ComboBox[] remarkBoxes; + IList enabledComboBoxes; + /// + /// Default constructor - Default number of compound water meters + /// public CycleBeginningForm() + : this (Config.Data.CompoundWMsCount, false) { - InitializeComponent(); - ControlBox = false; - - TextBoxesCount = 3; - mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label }; - auxLabels = new Label[] { auxSN1Label, auxSN2Label, auxSN3Label }; - mainComboBoxes = new ComboBox[] { main1ComboBox, main2ComboBox, main3ComboBox }; - auxComboBoxes = new ComboBox[] { aux1ComboBox, aux2ComboBox, aux3ComboBox }; - checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3 }; - enabledComboBoxes = new List(); - - this.WaterMetersCount = Config.Data.CompoundWMsCount; /// Default number of compound water meters - - completed = false; - StartForceCloseHandler(); + this.WaterMetersCount = Config.Data.CompoundWMsCount; } /// /// Constructor /// /// Number of text boxes for serial numbers - public CycleBeginningForm(int compoundWaterMetersCount) - : this() + /// Enable + public CycleBeginningForm(int compoundWaterMetersCount, bool remarksEnabled) { - this.WaterMetersCount = compoundWaterMetersCount; /// = Program.CompondWMsCount - MainSNText = new string[compoundWaterMetersCount]; - AuxSNText = new string[compoundWaterMetersCount]; - Disabled = new bool[compoundWaterMetersCount]; + InitializeComponent(); + ControlBox = false; + + TextBoxesCount = 3; + mainLabels = new Label[] { mainSN1Label, mainSN2Label, mainSN3Label }; + auxLabels = new Label[] { auxSN1Label, auxSN2Label, auxSN3Label }; + mainComboBoxes = new ComboBox[] { main1ComboBox, main2ComboBox, main3ComboBox }; + auxComboBoxes = new ComboBox[] { aux1ComboBox, aux2ComboBox, aux3ComboBox }; + checkBoxes = new CheckBox[] { checkBox1, checkBox2, checkBox3 }; + 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(); ShuffleTextBoxes(compoundWaterMetersCount); - Height = 110 + WaterMetersCount * 157; - } + Height = 115 + WaterMetersCount * 157; + + completed = false; + StartForceCloseHandler(); + } /// /// Make sure the layout of labels/text boxes on the screen @@ -88,7 +98,7 @@ namespace TBF.BenchControl.DataEntry.Combined { Localize(); - PrepareOrderCombo(orderComboBox); + DEUtils.PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory); if (WaterMetersCount >= 1) groupBox1.Visible = true; if (WaterMetersCount >= 2) groupBox2.Visible = true; @@ -99,6 +109,11 @@ namespace TBF.BenchControl.DataEntry.Combined mainLabels[i].Visible = mainComboBoxes[i].Visible = true; auxLabels[i].Visible = auxComboBoxes[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(auxComboBoxes[i]); @@ -128,23 +143,6 @@ namespace TBF.BenchControl.DataEntry.Combined clearButton.Text = Strings.ClearBtnText; } - /// - /// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array - /// - /// Puchase order ComboBox - void PrepareOrderCombo(ComboBox orderComboBox) - { - for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++) - { - orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]); - } - - if (orderComboBox.Items.Count > 0) - { - orderComboBox.Text = orderComboBox.Items[0].ToString(); - } - } - private void okButton_Click(object sender, EventArgs e) { PurchaseOrder = orderComboBox.Text; @@ -160,10 +158,15 @@ namespace TBF.BenchControl.DataEntry.Combined 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; Disabled[i] = !checkBoxes[i].Checked; - } + Remark[i] = remarkBoxes[i].Text; + } completed = true; Close(); @@ -280,12 +283,14 @@ namespace TBF.BenchControl.DataEntry.Combined /// TextBox control which received the event private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner) { +#if !CEVAK_200 if (e.KeyChar == '+') { /// Process '+' key ..... Form completed okButton_Click(sender, e); } - if (e.KeyChar == '\r') +#endif + if (e.KeyChar == '\r') { /// Process key ..... Next text field if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox diff --git a/TBF/BenchControl/DataEntry/Combined/EntryForm.cs b/TBF/BenchControl/DataEntry/Combined/EntryForm.cs index 07f7b93d3..995ed454a 100644 --- a/TBF/BenchControl/DataEntry/Combined/EntryForm.cs +++ b/TBF/BenchControl/DataEntry/Combined/EntryForm.cs @@ -124,7 +124,7 @@ namespace TBF.BenchControl.DataEntry.Combined /// void OpenBeginningDlg(EntryForm myRef) { - myRef.modelessDlg = new CycleBeginningForm(Config.Data.CompoundWMsCount); + myRef.modelessDlg = new CycleBeginningForm(Config.Data.CompoundWMsCount, myRef.entryFormCfg.RemarkEnabled); modelessDlg.Show(); } /// @@ -203,9 +203,12 @@ namespace TBF.BenchControl.DataEntry.Combined { waterMeters[i].SerialNr = dlg.MainSNText[i]; waterMeters[i].SerialNrAux = dlg.AuxSNText[i]; - disabled[i] = waterMeters[i].Disabled = dlg.Disabled[i]; - } + if (dlg.RemarksEnabled) + { + waterMeters[i].Remark = dlg.Remark[i]; + } + } } } } diff --git a/TBF/BenchControl/DataEntry/Combined/EntryFormCfg.cs b/TBF/BenchControl/DataEntry/Combined/EntryFormCfg.cs index 20133f6ab..4f88c2c57 100644 --- a/TBF/BenchControl/DataEntry/Combined/EntryFormCfg.cs +++ b/TBF/BenchControl/DataEntry/Combined/EntryFormCfg.cs @@ -20,6 +20,7 @@ namespace TBF.BenchControl.DataEntry.Combined /// Serialized parameters /// public bool ShowCycleEndForm; + public bool RemarkEnabled; /// Private parameterless constructor invoked by all other (public) constructors EntryFormCfg() @@ -27,7 +28,8 @@ namespace TBF.BenchControl.DataEntry.Combined Name = "DataEntry-Combined"; ParentName = string.Empty; ShowCycleEndForm = false; - } + RemarkEnabled = false; + } public EntryFormCfg(IComponentFactory factory) : this() @@ -37,7 +39,7 @@ namespace TBF.BenchControl.DataEntry.Combined 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); } } } diff --git a/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.cs b/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.cs index bec8b5781..2b0b6c297 100644 --- a/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.cs +++ b/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.cs @@ -38,7 +38,8 @@ namespace TBF.BenchControl.DataEntry.Combined void Localize() { showCycleEndFormCheckBox.Text = Strings.Show_cycle_end_form; - } + remarkEnabledCheckBox.Text = Strings.Enable_Remark; + } public void Closing() { @@ -50,13 +51,15 @@ namespace TBF.BenchControl.DataEntry.Combined classNameLabel.Text = config.Factory.ClassName; nameTextBox.Text = config.Name; showCycleEndFormCheckBox.Checked = config.ShowCycleEndForm; - } + remarkEnabledCheckBox.Checked = config.RemarkEnabled; + } public void Unlock() { nameTextBox.Enabled = true; showCycleEndFormCheckBox.Enabled = true; - } + remarkEnabledCheckBox.Enabled = true; + } public CfgUpdateFlags VerifyCfg(ref string message) { @@ -72,6 +75,7 @@ namespace TBF.BenchControl.DataEntry.Combined config.Name = nameTextBox.Text; config.ShowCycleEndForm = showCycleEndFormCheckBox.Checked; + config.RemarkEnabled = remarkEnabledCheckBox.Checked; return flags; } diff --git a/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.designer.cs b/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.designer.cs index 9091a61b4..66ab07089 100644 --- a/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.designer.cs +++ b/TBF/BenchControl/DataEntry/Combined/EntryFormCfgCtrl.designer.cs @@ -31,62 +31,75 @@ namespace TBF.BenchControl.DataEntry.Combined /// private void InitializeComponent() { - this.nameTextBox = new System.Windows.Forms.TextBox(); - this.nameLabel = new System.Windows.Forms.Label(); - this.classNameLabel = new System.Windows.Forms.Label(); - this.showCycleEndFormCheckBox = new System.Windows.Forms.CheckBox(); - this.SuspendLayout(); - // - // nameTextBox - // - this.nameTextBox.Enabled = false; - this.nameTextBox.Location = new System.Drawing.Point(137, 57); - this.nameTextBox.Name = "nameTextBox"; - this.nameTextBox.Size = new System.Drawing.Size(130, 20); - this.nameTextBox.TabIndex = 5; - // - // nameLabel - // - this.nameLabel.AutoSize = true; - this.nameLabel.Location = new System.Drawing.Point(27, 60); - this.nameLabel.Name = "nameLabel"; - this.nameLabel.Size = new System.Drawing.Size(35, 13); - this.nameLabel.TabIndex = 4; - this.nameLabel.Text = "Name"; - // - // classNameLabel - // - this.classNameLabel.AutoSize = true; - this.classNameLabel.Location = new System.Drawing.Point(134, 33); - this.classNameLabel.Name = "classNameLabel"; - this.classNameLabel.Size = new System.Drawing.Size(83, 13); - this.classNameLabel.TabIndex = 3; - this.classNameLabel.Text = "ComonentName"; - // - // showCycleEndFormCheckBox - // - this.showCycleEndFormCheckBox.AutoSize = true; - this.showCycleEndFormCheckBox.Enabled = false; - this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(137, 90); - this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox"; - this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17); - this.showCycleEndFormCheckBox.TabIndex = 14; - this.showCycleEndFormCheckBox.Text = "Show cycle end form"; - this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true; - // - // EntryFormCfgCtrl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.showCycleEndFormCheckBox); - this.Controls.Add(this.nameTextBox); - this.Controls.Add(this.nameLabel); - this.Controls.Add(this.classNameLabel); - this.Name = "EntryFormCfgCtrl"; - this.Size = new System.Drawing.Size(300, 200); - this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); - this.ResumeLayout(false); - this.PerformLayout(); + 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.remarkEnabledCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(114, 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(39, 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(111, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // showCycleEndFormCheckBox + // + this.showCycleEndFormCheckBox.AutoSize = true; + this.showCycleEndFormCheckBox.Enabled = false; + this.showCycleEndFormCheckBox.Location = new System.Drawing.Point(114, 90); + this.showCycleEndFormCheckBox.Name = "showCycleEndFormCheckBox"; + this.showCycleEndFormCheckBox.Size = new System.Drawing.Size(125, 17); + this.showCycleEndFormCheckBox.TabIndex = 14; + this.showCycleEndFormCheckBox.Text = "Show cycle end form"; + this.showCycleEndFormCheckBox.UseVisualStyleBackColor = true; + // + // remarkEnabledCheckBox + // + this.remarkEnabledCheckBox.AutoSize = true; + this.remarkEnabledCheckBox.Enabled = false; + this.remarkEnabledCheckBox.Location = new System.Drawing.Point(114, 113); + this.remarkEnabledCheckBox.Name = "remarkEnabledCheckBox"; + this.remarkEnabledCheckBox.Size = new System.Drawing.Size(99, 17); + this.remarkEnabledCheckBox.TabIndex = 15; + this.remarkEnabledCheckBox.Text = "Enable remarks"; + this.remarkEnabledCheckBox.UseVisualStyleBackColor = true; + // + // 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 classNameLabel; private System.Windows.Forms.CheckBox showCycleEndFormCheckBox; + private System.Windows.Forms.CheckBox remarkEnabledCheckBox; } } diff --git a/TBF/BenchControl/DataEntry/DEUtils.cs b/TBF/BenchControl/DataEntry/DEUtils.cs new file mode 100644 index 000000000..2bd280fc1 --- /dev/null +++ b/TBF/BenchControl/DataEntry/DEUtils.cs @@ -0,0 +1,34 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Windows.Forms; + +namespace TBF.BenchControl.DataEntry +{ + public class DEUtils + { + /// + /// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array + /// + /// Puchase order ComboBox + 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]); + } + } + } +} diff --git a/TBF/BenchControl/DataEntry/Standard6/CycleBeginningForm.cs b/TBF/BenchControl/DataEntry/Standard6/CycleBeginningForm.cs index 651053ff3..c69f9ae6f 100644 --- a/TBF/BenchControl/DataEntry/Standard6/CycleBeginningForm.cs +++ b/TBF/BenchControl/DataEntry/Standard6/CycleBeginningForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2013-2017 Sensus Metering Systems +/// Copyright (c) 2013-2018 Sensus Slovensko a.s. /// using System; using System.Collections.Generic; @@ -48,6 +48,7 @@ namespace TBF.BenchControl.DataEntry.Standard6 this.WaterMetersCount = waterMetersCount; this.RemarksEnabled = remarksEnabled; + SNText = new string[WaterMetersCount]; Disabled = new bool[WaterMetersCount]; Remark = new string[WaterMetersCount]; @@ -67,11 +68,11 @@ namespace TBF.BenchControl.DataEntry.Standard6 { Localize(); - PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory); + DEUtils.PrepareCombo(orderComboBox, Program.LocalSettings.PurchaseOrderHistory); 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) @@ -123,28 +124,6 @@ namespace TBF.BenchControl.DataEntry.Standard6 label6.Text = Strings.Water_Meter + " 6"; } - /// - /// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array - /// - /// Puchase order ComboBox - 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) { diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 52998a281..0a20a8407 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.1096.0")] -[assembly: AssemblyFileVersion("2.18.1096.0")] +[assembly: AssemblyVersion("2.18.1098.0")] +[assembly: AssemblyFileVersion("2.18.1098.0")] diff --git a/TBF/Resources/Strings.cs.resx b/TBF/Resources/Strings.cs.resx index 5001adab4..db33ae9da 100644 --- a/TBF/Resources/Strings.cs.resx +++ b/TBF/Resources/Strings.cs.resx @@ -1356,4 +1356,7 @@ Chyba při ukládání parametrů {0} + + Zobrazit poznámku + \ No newline at end of file diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index d4e6d068d..8b68ac44d 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -415,6 +415,7 @@ TestStartEndForm.cs +