From 9f9883ac3e599255cdacc6bc80b73ad14a3e7d87 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Mon, 19 Mar 2018 02:41:20 +0100 Subject: [PATCH] ResultsBrowser : UI for printer component OK, ver. 2.18.847 --- DeviceTest/DeviceTestDlg.cs | 4 +- ResultsBrowser/FiltersConfig.cs | 3 + .../Forms/DatabaseSettingsDlg.Designer.cs | 398 +++++------ ResultsBrowser/Forms/DatabaseSettingsDlg.cs | 2 + .../Forms/PrinterConfigDlg.Designer.cs | 112 +++ ResultsBrowser/Forms/PrinterConfigDlg.cs | 126 ++++ ResultsBrowser/Forms/PrinterConfigDlg.resx | 120 ++++ .../QueryResults/QueryResultsPrintDocument.cs | 386 ----------- ResultsBrowser/Properties/AssemblyInfo.cs | 4 +- ResultsBrowser/Resources/Strings.resx | 5 +- ResultsBrowser/Resources/Strings1.Designer.cs | 11 +- ResultsBrowser/ResultsBrowser.csproj | 16 +- ResultsBrowser/ResultsBrowserWnd.Designer.cs | 651 +++++++++--------- ResultsBrowser/ResultsBrowserWnd.cs | 88 ++- 14 files changed, 992 insertions(+), 934 deletions(-) create mode 100644 ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs create mode 100644 ResultsBrowser/Forms/PrinterConfigDlg.cs create mode 100644 ResultsBrowser/Forms/PrinterConfigDlg.resx delete mode 100644 ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs diff --git a/DeviceTest/DeviceTestDlg.cs b/DeviceTest/DeviceTestDlg.cs index aaa130d68..57be4d3f4 100644 --- a/DeviceTest/DeviceTestDlg.cs +++ b/DeviceTest/DeviceTestDlg.cs @@ -68,10 +68,10 @@ namespace DeviceTest public DeviceTestDlg() { InitializeComponent(); - compClasses = new List(); radioButton0.Checked = true; stopButton.Enabled = false; - + + compClasses = new List(); foreach (var componentFactory in TbfComponents.Factories) { compClasses.Add(componentFactory.ClassName); diff --git a/ResultsBrowser/FiltersConfig.cs b/ResultsBrowser/FiltersConfig.cs index 65013654f..61e09c81d 100644 --- a/ResultsBrowser/FiltersConfig.cs +++ b/ResultsBrowser/FiltersConfig.cs @@ -27,6 +27,9 @@ namespace ResultsBrowser public string[] ResultItems; + public string PrinterClass; + public string PrinterCfg; + [XmlArrayAttribute("ResultsClmnWidths")] public int[] ResultsClmnWidths; [XmlIgnore] diff --git a/ResultsBrowser/Forms/DatabaseSettingsDlg.Designer.cs b/ResultsBrowser/Forms/DatabaseSettingsDlg.Designer.cs index 67d8c7f29..25dbed19c 100644 --- a/ResultsBrowser/Forms/DatabaseSettingsDlg.Designer.cs +++ b/ResultsBrowser/Forms/DatabaseSettingsDlg.Designer.cs @@ -28,204 +28,204 @@ /// private void InitializeComponent() { - this.connectionStringTextBox1 = new System.Windows.Forms.TextBox(); - this.benchNameLabel = new System.Windows.Forms.Label(); - this.connectionStringLabel = new System.Windows.Forms.Label(); - this.connectionStringTextBox2 = new System.Windows.Forms.TextBox(); - this.connectionStringTextBox3 = new System.Windows.Forms.TextBox(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.benchNameTextBox1 = new System.Windows.Forms.TextBox(); - this.benchNameTextBox2 = new System.Windows.Forms.TextBox(); - this.benchNameTextBox3 = new System.Windows.Forms.TextBox(); - this.languageLabel = new System.Windows.Forms.Label(); - this.languageTextBox = new System.Windows.Forms.TextBox(); - this.formatLabel = new System.Windows.Forms.Label(); - this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox(); - this.benchNameTextBox5 = new System.Windows.Forms.TextBox(); - this.benchNameTextBox4 = new System.Windows.Forms.TextBox(); - this.connectionStringTextBox5 = new System.Windows.Forms.TextBox(); - this.connectionStringTextBox4 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // connectionStringTextBox1 - // - this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45); - this.connectionStringTextBox1.Name = "connectionStringTextBox1"; - this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20); - this.connectionStringTextBox1.TabIndex = 3; - // - // benchNameLabel - // - this.benchNameLabel.AutoSize = true; - this.benchNameLabel.Location = new System.Drawing.Point(26, 20); - this.benchNameLabel.Name = "benchNameLabel"; - this.benchNameLabel.Size = new System.Drawing.Size(67, 13); - this.benchNameLabel.TabIndex = 0; - this.benchNameLabel.Text = "Bench name"; - // - // connectionStringLabel - // - this.connectionStringLabel.AutoSize = true; - this.connectionStringLabel.Location = new System.Drawing.Point(154, 20); - this.connectionStringLabel.Name = "connectionStringLabel"; - this.connectionStringLabel.Size = new System.Drawing.Size(89, 13); - this.connectionStringLabel.TabIndex = 1; - this.connectionStringLabel.Text = "Connection string"; - // - // connectionStringTextBox2 - // - this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71); - this.connectionStringTextBox2.Name = "connectionStringTextBox2"; - this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20); - this.connectionStringTextBox2.TabIndex = 5; - // - // connectionStringTextBox3 - // - this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97); - this.connectionStringTextBox3.Name = "connectionStringTextBox3"; - this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20); - this.connectionStringTextBox3.TabIndex = 7; - // - // okButton - // - this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.okButton.Location = new System.Drawing.Point(506, 250); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(95, 38); - this.okButton.TabIndex = 16; - this.okButton.Text = "OK"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(617, 250); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(95, 38); - this.cancelButton.TabIndex = 17; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // benchNameTextBox1 - // - this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45); - this.benchNameTextBox1.Name = "benchNameTextBox1"; - this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20); - this.benchNameTextBox1.TabIndex = 2; - // - // benchNameTextBox2 - // - this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71); - this.benchNameTextBox2.Name = "benchNameTextBox2"; - this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20); - this.benchNameTextBox2.TabIndex = 4; - // - // benchNameTextBox3 - // - this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97); - this.benchNameTextBox3.Name = "benchNameTextBox3"; - this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20); - this.benchNameTextBox3.TabIndex = 6; - // - // languageLabel - // - this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.languageLabel.AutoSize = true; - this.languageLabel.Location = new System.Drawing.Point(26, 239); - this.languageLabel.Name = "languageLabel"; - this.languageLabel.Size = new System.Drawing.Size(55, 13); - this.languageLabel.TabIndex = 14; - this.languageLabel.Text = "Language"; - // - // languageTextBox - // - this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.languageTextBox.Location = new System.Drawing.Point(29, 263); - this.languageTextBox.Name = "languageTextBox"; - this.languageTextBox.Size = new System.Drawing.Size(100, 20); - this.languageTextBox.TabIndex = 15; - // - // formatLabel - // - this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.formatLabel.AutoSize = true; - this.formatLabel.Location = new System.Drawing.Point(26, 185); - this.formatLabel.Name = "formatLabel"; - this.formatLabel.Size = new System.Drawing.Size(39, 13); - this.formatLabel.TabIndex = 12; - this.formatLabel.Text = "Format"; - // - // timePeriodFormatTextBox - // - this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 207); - this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox"; - this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20); - this.timePeriodFormatTextBox.TabIndex = 13; - // - // benchNameTextBox5 - // - this.benchNameTextBox5.Location = new System.Drawing.Point(29, 149); - this.benchNameTextBox5.Name = "benchNameTextBox5"; - this.benchNameTextBox5.Size = new System.Drawing.Size(100, 20); - this.benchNameTextBox5.TabIndex = 10; - // - // benchNameTextBox4 - // - this.benchNameTextBox4.Location = new System.Drawing.Point(29, 123); - this.benchNameTextBox4.Name = "benchNameTextBox4"; - this.benchNameTextBox4.Size = new System.Drawing.Size(100, 20); - this.benchNameTextBox4.TabIndex = 8; - // - // connectionStringTextBox5 - // - this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 149); - this.connectionStringTextBox5.Name = "connectionStringTextBox5"; - this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20); - this.connectionStringTextBox5.TabIndex = 11; - // - // connectionStringTextBox4 - // - this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 123); - this.connectionStringTextBox4.Name = "connectionStringTextBox4"; - this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20); - this.connectionStringTextBox4.TabIndex = 9; - // - // DatabaseSettingsDlg - // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(743, 310); - this.Controls.Add(this.benchNameTextBox5); - this.Controls.Add(this.benchNameTextBox4); - this.Controls.Add(this.connectionStringTextBox5); - this.Controls.Add(this.connectionStringTextBox4); - this.Controls.Add(this.timePeriodFormatTextBox); - this.Controls.Add(this.formatLabel); - this.Controls.Add(this.languageTextBox); - this.Controls.Add(this.languageLabel); - this.Controls.Add(this.benchNameTextBox3); - this.Controls.Add(this.benchNameTextBox2); - this.Controls.Add(this.benchNameTextBox1); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.connectionStringTextBox3); - this.Controls.Add(this.connectionStringLabel); - this.Controls.Add(this.connectionStringTextBox2); - this.Controls.Add(this.benchNameLabel); - this.Controls.Add(this.connectionStringTextBox1); - this.Name = "DatabaseSettingsDlg"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Database Settings"; - this.Load += new System.EventHandler(this.DatabaseSettings_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.connectionStringTextBox1 = new System.Windows.Forms.TextBox(); + this.benchNameLabel = new System.Windows.Forms.Label(); + this.connectionStringLabel = new System.Windows.Forms.Label(); + this.connectionStringTextBox2 = new System.Windows.Forms.TextBox(); + this.connectionStringTextBox3 = new System.Windows.Forms.TextBox(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.benchNameTextBox1 = new System.Windows.Forms.TextBox(); + this.benchNameTextBox2 = new System.Windows.Forms.TextBox(); + this.benchNameTextBox3 = new System.Windows.Forms.TextBox(); + this.languageLabel = new System.Windows.Forms.Label(); + this.languageTextBox = new System.Windows.Forms.TextBox(); + this.formatLabel = new System.Windows.Forms.Label(); + this.timePeriodFormatTextBox = new System.Windows.Forms.TextBox(); + this.benchNameTextBox5 = new System.Windows.Forms.TextBox(); + this.benchNameTextBox4 = new System.Windows.Forms.TextBox(); + this.connectionStringTextBox5 = new System.Windows.Forms.TextBox(); + this.connectionStringTextBox4 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // connectionStringTextBox1 + // + this.connectionStringTextBox1.Location = new System.Drawing.Point(157, 45); + this.connectionStringTextBox1.Name = "connectionStringTextBox1"; + this.connectionStringTextBox1.Size = new System.Drawing.Size(555, 20); + this.connectionStringTextBox1.TabIndex = 3; + // + // benchNameLabel + // + this.benchNameLabel.AutoSize = true; + this.benchNameLabel.Location = new System.Drawing.Point(26, 20); + this.benchNameLabel.Name = "benchNameLabel"; + this.benchNameLabel.Size = new System.Drawing.Size(67, 13); + this.benchNameLabel.TabIndex = 0; + this.benchNameLabel.Text = "Bench name"; + // + // connectionStringLabel + // + this.connectionStringLabel.AutoSize = true; + this.connectionStringLabel.Location = new System.Drawing.Point(154, 20); + this.connectionStringLabel.Name = "connectionStringLabel"; + this.connectionStringLabel.Size = new System.Drawing.Size(89, 13); + this.connectionStringLabel.TabIndex = 1; + this.connectionStringLabel.Text = "Connection string"; + // + // connectionStringTextBox2 + // + this.connectionStringTextBox2.Location = new System.Drawing.Point(157, 71); + this.connectionStringTextBox2.Name = "connectionStringTextBox2"; + this.connectionStringTextBox2.Size = new System.Drawing.Size(555, 20); + this.connectionStringTextBox2.TabIndex = 5; + // + // connectionStringTextBox3 + // + this.connectionStringTextBox3.Location = new System.Drawing.Point(157, 97); + this.connectionStringTextBox3.Name = "connectionStringTextBox3"; + this.connectionStringTextBox3.Size = new System.Drawing.Size(555, 20); + this.connectionStringTextBox3.TabIndex = 7; + // + // okButton + // + this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.okButton.Location = new System.Drawing.Point(506, 250); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(95, 38); + this.okButton.TabIndex = 18; + this.okButton.Text = "OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(617, 250); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(95, 38); + this.cancelButton.TabIndex = 19; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // benchNameTextBox1 + // + this.benchNameTextBox1.Location = new System.Drawing.Point(29, 45); + this.benchNameTextBox1.Name = "benchNameTextBox1"; + this.benchNameTextBox1.Size = new System.Drawing.Size(100, 20); + this.benchNameTextBox1.TabIndex = 2; + // + // benchNameTextBox2 + // + this.benchNameTextBox2.Location = new System.Drawing.Point(29, 71); + this.benchNameTextBox2.Name = "benchNameTextBox2"; + this.benchNameTextBox2.Size = new System.Drawing.Size(100, 20); + this.benchNameTextBox2.TabIndex = 4; + // + // benchNameTextBox3 + // + this.benchNameTextBox3.Location = new System.Drawing.Point(29, 97); + this.benchNameTextBox3.Name = "benchNameTextBox3"; + this.benchNameTextBox3.Size = new System.Drawing.Size(100, 20); + this.benchNameTextBox3.TabIndex = 6; + // + // languageLabel + // + this.languageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.languageLabel.AutoSize = true; + this.languageLabel.Location = new System.Drawing.Point(26, 239); + this.languageLabel.Name = "languageLabel"; + this.languageLabel.Size = new System.Drawing.Size(55, 13); + this.languageLabel.TabIndex = 14; + this.languageLabel.Text = "Language"; + // + // languageTextBox + // + this.languageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.languageTextBox.Location = new System.Drawing.Point(29, 263); + this.languageTextBox.Name = "languageTextBox"; + this.languageTextBox.Size = new System.Drawing.Size(100, 20); + this.languageTextBox.TabIndex = 15; + // + // formatLabel + // + this.formatLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.formatLabel.AutoSize = true; + this.formatLabel.Location = new System.Drawing.Point(26, 185); + this.formatLabel.Name = "formatLabel"; + this.formatLabel.Size = new System.Drawing.Size(94, 13); + this.formatLabel.TabIndex = 12; + this.formatLabel.Text = "Time period format"; + // + // timePeriodFormatTextBox + // + this.timePeriodFormatTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.timePeriodFormatTextBox.Location = new System.Drawing.Point(29, 207); + this.timePeriodFormatTextBox.Name = "timePeriodFormatTextBox"; + this.timePeriodFormatTextBox.Size = new System.Drawing.Size(683, 20); + this.timePeriodFormatTextBox.TabIndex = 13; + // + // benchNameTextBox5 + // + this.benchNameTextBox5.Location = new System.Drawing.Point(29, 149); + this.benchNameTextBox5.Name = "benchNameTextBox5"; + this.benchNameTextBox5.Size = new System.Drawing.Size(100, 20); + this.benchNameTextBox5.TabIndex = 10; + // + // benchNameTextBox4 + // + this.benchNameTextBox4.Location = new System.Drawing.Point(29, 123); + this.benchNameTextBox4.Name = "benchNameTextBox4"; + this.benchNameTextBox4.Size = new System.Drawing.Size(100, 20); + this.benchNameTextBox4.TabIndex = 8; + // + // connectionStringTextBox5 + // + this.connectionStringTextBox5.Location = new System.Drawing.Point(157, 149); + this.connectionStringTextBox5.Name = "connectionStringTextBox5"; + this.connectionStringTextBox5.Size = new System.Drawing.Size(555, 20); + this.connectionStringTextBox5.TabIndex = 11; + // + // connectionStringTextBox4 + // + this.connectionStringTextBox4.Location = new System.Drawing.Point(157, 123); + this.connectionStringTextBox4.Name = "connectionStringTextBox4"; + this.connectionStringTextBox4.Size = new System.Drawing.Size(555, 20); + this.connectionStringTextBox4.TabIndex = 9; + // + // DatabaseSettingsDlg + // + this.AcceptButton = this.okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(743, 310); + this.Controls.Add(this.benchNameTextBox5); + this.Controls.Add(this.benchNameTextBox4); + this.Controls.Add(this.connectionStringTextBox5); + this.Controls.Add(this.connectionStringTextBox4); + this.Controls.Add(this.timePeriodFormatTextBox); + this.Controls.Add(this.formatLabel); + this.Controls.Add(this.languageTextBox); + this.Controls.Add(this.languageLabel); + this.Controls.Add(this.benchNameTextBox3); + this.Controls.Add(this.benchNameTextBox2); + this.Controls.Add(this.benchNameTextBox1); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.connectionStringTextBox3); + this.Controls.Add(this.connectionStringLabel); + this.Controls.Add(this.connectionStringTextBox2); + this.Controls.Add(this.benchNameLabel); + this.Controls.Add(this.connectionStringTextBox1); + this.Name = "DatabaseSettingsDlg"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Settings"; + this.Load += new System.EventHandler(this.DatabaseSettings_Load); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -248,6 +248,6 @@ private System.Windows.Forms.TextBox benchNameTextBox5; private System.Windows.Forms.TextBox benchNameTextBox4; private System.Windows.Forms.TextBox connectionStringTextBox5; - private System.Windows.Forms.TextBox connectionStringTextBox4; + private System.Windows.Forms.TextBox connectionStringTextBox4; } } \ No newline at end of file diff --git a/ResultsBrowser/Forms/DatabaseSettingsDlg.cs b/ResultsBrowser/Forms/DatabaseSettingsDlg.cs index 45d388426..cec3bb063 100644 --- a/ResultsBrowser/Forms/DatabaseSettingsDlg.cs +++ b/ResultsBrowser/Forms/DatabaseSettingsDlg.cs @@ -1,6 +1,8 @@ using System; +using System.Collections.Generic; using System.Windows.Forms; using ResultsBrowser.Resources; +using TBF.BenchControl; namespace ResultsBrowser.Forms { diff --git a/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs b/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs new file mode 100644 index 000000000..4d4088e23 --- /dev/null +++ b/ResultsBrowser/Forms/PrinterConfigDlg.Designer.cs @@ -0,0 +1,112 @@ +namespace ResultsBrowser.Forms +{ + partial class PrinterConfigDlg + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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(); + + } + + #endregion + + private System.Windows.Forms.ComboBox printerClassComboBox; + private System.Windows.Forms.Button changePrinterClassButton; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button configureButton; + private System.Windows.Forms.Button cancelButton; + } +} \ No newline at end of file diff --git a/ResultsBrowser/Forms/PrinterConfigDlg.cs b/ResultsBrowser/Forms/PrinterConfigDlg.cs new file mode 100644 index 000000000..04162e1f3 --- /dev/null +++ b/ResultsBrowser/Forms/PrinterConfigDlg.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using TBF.BenchControl; +using TBF.BenchControl.Generic; + +namespace ResultsBrowser.Forms +{ + public partial class PrinterConfigDlg : Form + { + public string PrinterClass; /// To be initialized in the constructor + public string PrinterCfg; + + IList printerFactories; /// Printer components classes + IComponentFactory printerFactory; + + + public PrinterConfigDlg() + { + InitializeComponent(); + + printerFactories = new List(); + foreach (var fctry in TbfComponents.Factories) + { + if (fctry.ClassName.Contains("Output.Printers.")) printerFactories.Add(fctry); + } + } + + + private void PrinterClassDlg_Load(object sender, EventArgs e) + { + printerClassComboBox.Items.Add("---"); + foreach (var fctry in printerFactories) + { + printerClassComboBox.Items.Add(fctry.ClassName); + } + printerClassComboBox.Text = string.IsNullOrEmpty(PrinterClass) ? "---" : PrinterClass; + } + + + private void changePrinterClassButton_Click(object sender, EventArgs e) + { + printerClassComboBox.Enabled = true; + } + + + private void cancelButton_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + + private void configureButton_Click(object sender, EventArgs e) + { + string oriClassName = PrinterClass; + + PrinterClass = string.Empty; + if (printerClassComboBox.Text != "---") + { + foreach (var pc in printerFactories) + { + if (printerClassComboBox.Text == pc.ClassName) PrinterClass = pc.ClassName; + } + } + + printerFactory = GetFactory(PrinterClass); + if (printerFactory == null) + { + MessageBox.Show("Invalid printer"); + return; + } + + IComponentCfg printerCfg; + if ((oriClassName != printerFactory.ClassName) || string.IsNullOrEmpty(PrinterCfg)) + { + printerCfg = printerFactory.DefaultConfig(); + } + else + { + Config.Entities.Component cmpnt = new Config.Entities.Component(); + cmpnt.Name = "printer"; + cmpnt.ClassName = PrinterClass; + cmpnt.Parameters = PrinterCfg; + printerCfg = printerFactory.CmpntCfgFromCmpntEntity(cmpnt); + } + + IComponentCfgCtrl cfgControl = printerCfg.GetControl(); + cfgControl.Config = printerCfg; + cfgControl.Config.ItemNr = 0; + + TBF.ComponentParametersDlg cfgForm = new TBF.ComponentParametersDlg(); + cfgForm.TbfComponents = new List(); + + cfgForm.ComponentCfgCtrl = cfgControl; + cfgForm.UnlockAfterStart = true; + DialogResult dr = cfgForm.ShowDialog(); + if (dr != DialogResult.OK) return; + + PrinterCfg = (printerCfg != null) ? printerCfg.CreateDbEntity().Parameters : string.Empty; + + DialogResult = DialogResult.OK; + Close(); + } + + + /// + /// 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/Forms/PrinterConfigDlg.resx b/ResultsBrowser/Forms/PrinterConfigDlg.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/ResultsBrowser/Forms/PrinterConfigDlg.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs b/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs deleted file mode 100644 index 8444b5aa0..000000000 --- a/ResultsBrowser/Output/Printers/QueryResults/QueryResultsPrintDocument.cs +++ /dev/null @@ -1,386 +0,0 @@ -/// -/// Copyright (c) 2016 Sensus Metering Systems -/// -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Printing; -using Config.Entities; - -namespace ResultsBrowser.Output.Printers.QueryResults -{ - public class QueryResultsPrintDocument : PrintDocument - { - const string FontFamilyName = "Arial"; //"Times New Roman"; - - const int SpacingOne = 18; - const int SpacingOneAndHalf = (3 * SpacingOne) / 2; - const int TitleX = 240; - const int TitleY = 180; /// Depends on the size of the header - const int FirstLineNr = 14; /// Depends on the size of the header - const int Tab1 = 80; /// Positions of columns above the table - const int Tab2 = 240; - const int Tab3 = 430; - const int Tab4 = 590; - const int BorderW = 1; /// Table border line width - const int MarginTop = 7; /// Margins of the text from table lines - const int MarginLeft = 4; /// Margins of the text from table lines - - /// - /// Data to print - /// - readonly string docVersion; - readonly Results.Entities.WaterMeter wm; - string zaehlertyp; - string pruefvorlage; - - readonly IList results; - readonly int resultsCount; - readonly bool compound; /// true when MetersKind is MetersKind.Combined - - readonly int secondTableOffset; /// Calculated in the constructor - - /// Top coordinate of the table - int top; - - /// - /// Property variable for the Font the user wishes to use - /// - Font font; - Font boldFont; - Font fontTitle; - - /// - /// Constructor - /// - /// Text to be printed - public QueryResultsPrintDocument(string docVersion, - Results.Entities.WaterMeter wm, - PageOrientation pageOrientation) - { - this.docVersion = docVersion; - this.wm = wm; - compound = wm.Compound(); - - string[] info = wm.ProductName().Split(new char[] { ';' }); - if (info.Length >= 2) - { - pruefvorlage = info[0]; - zaehlertyp = info[1]; - } - else if (info.Length == 1) - { - pruefvorlage = info[0]; - zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler"; - } - else - { - pruefvorlage = wm.ProcedureName(); - zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler"; - } - - results = wm.MeterTestRslts; - this.resultsCount = compound ? (results.Count / 3) : results.Count; - - int resultsCount = wm.MeterTestRslts.Count; - if (compound) resultsCount /= 3; - - secondTableOffset = (resultsCount + 2) * SpacingOneAndHalf; - - DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape); - } - - /// - /// Override the default onbeginPrint method of the PrintDocument Object. - /// - /// - /// - protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e) - { - base.OnBeginPrint(e); - - if (font == null) { font = new Font(FontFamilyName, 10, FontStyle.Regular); } - if (boldFont == null) { boldFont = new Font(FontFamilyName, 10, FontStyle.Bold); } - if (fontTitle == null) { fontTitle = new Font(FontFamilyName, 24, FontStyle.Bold); } - } - - /// - /// Override the default OnPrintPage method of the PrintDocument. - /// - /// - /// This provides the print logic for our document - protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e) - { - // Run base code - base.OnPrintPage(e); - - /// Set print area size and margins (in dots using 80 dpi) - int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom; - int printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right; - int leftMargin = base.DefaultPageSettings.Margins.Left; /// X - int topMargin = base.DefaultPageSettings.Margins.Top; /// Y - - /// Check if the user selected to print in Landscape mode - /// if they did then we need to swap height/width parameters - if (base.DefaultPageSettings.Landscape) - { - int tmp = printHeight; - printHeight = printWidth; - printWidth = tmp; - } - - int x = leftMargin; - int y = topMargin; - - /// Use the StringFormat class for the text layout of our document - StringFormat format = new StringFormat(StringFormatFlags.LineLimit); - - RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50); - e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea); - - int lineNr = FirstLineNr; - PrintAt(e, Tab1, lineNr * SpacingOne, docVersion); - lineNr++; - PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :"); - PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString()); - PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :"); - PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d")); - lineNr++; - PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :"); - PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp); - PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString()); - lineNr++; - PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :"); - PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage); - lineNr += 2; - - if (compound) - { - PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler"); - PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler"); - lineNr++; - } - - PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer()); - if (compound) - { - PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux()); - } - lineNr++; - - PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr); - if (compound) - { - PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux); - } - lineNr++; - - PrintAt(e, Tab1, lineNr * SpacingOne, "Qn :"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString()); - if (compound) - { - PrintAt(e, Tab3, lineNr * SpacingOne, "Qn :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString()); - } - lineNr++; - - PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo()); - if (compound) - { - PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux()); - } - lineNr++; - - PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass()); - if (compound) - { - PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux()); - } - lineNr++; - - PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState); - if (compound) - { - PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :"); - PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux); - - lineNr += 2; - PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :"); - lineNr++; - PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig"); - PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h"); - lineNr++; - PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall"); - PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h"); - } - - lineNr += 2; - top = SpacingOne * lineNr; - - PrintTable(e); - DrawTable(e); - - lineNr += (secondTableOffset * 2) / SpacingOne; - PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C"); - lineNr++; - PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %"); - lineNr++; - PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck"); - PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbPressMean().ToString("F0") + " mbar"); - - lineNr++; - PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d")); - lineNr ++; - PrintAt(e, Tab3, lineNr * SpacingOne, "Datum"); - PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift"); - } - - /// - /// Print table texts. - /// - void PrintTable(System.Drawing.Printing.PrintPageEventArgs e) - { - PrintAt(e, FromTest(-1, -1), "Prüflauf"); - PrintAt(e, FromTest(-1, 0), "Q [l/h]"); - PrintAt(e, FromTest(-1, 1), "Prüf-Vol.[l]"); - PrintAt(e, FromTest(-1, 2), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]"); - PrintAt(e, FromTest(-1, 3), compound ? "NZ-Vol.[l]" : "-"); - PrintAt(e, FromTest(-1, 4), "Fehler [%]"); - PrintAt(e, FromTest(-1, 5), "Ergebnis"); - - PrintAt(e, FromTest(-1, 6), "Q [l/h]"); - PrintAt(e, FromTest(-1, 7), "Temperatur"); - PrintAt(e, FromTest(-1, 8), "Dichte"); - PrintAt(e, FromTest(-1, 9), "Prüfzeit"); - PrintAt(e, FromTest(-1, 10), "Druck Eing."); - PrintAt(e, FromTest(-1, 11), "Druck Ausg."); - - int rowCnt = 0; - foreach (var mtr in wm.MeterTestRslts) - { - if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound) - { - Point p = FromTest(rowCnt, -1); - PrintAt(e, p.X, p.Y, mtr.Name()); - PrintAt(e, p.X, p.Y + (resultsCount + 2) * SpacingOneAndHalf, mtr.Name()); - - PrintAt(e, FromTest(rowCnt, 0), mtr.TestRslt.FlowMass.ToString("F1")); - PrintAt(e, FromTest(rowCnt, 1), mtr.TestRslt.VolumeCTV.ToString("F2")); - if (compound) - { - Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain); - Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux); - - PrintAt(e, FromTest(rowCnt, 2), mainMtr.VolumeMeter.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 3), auxMtr.VolumeMeter.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 4), mtr.Error.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO"); - } - else - { - PrintAt(e, FromTest(rowCnt, 2), mtr.VolumeMeter.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 3), "-"); - PrintAt(e, FromTest(rowCnt, 4), mtr.Error.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 5), mtr.Passed ? "iO" : "NiO"); - } - PrintAt(e, FromTest(rowCnt, 6), mtr.TestRslt.FlowMass.ToString("F1")); - PrintAt(e, FromTest(rowCnt, 7), mtr.TestRslt.TempDownMean.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 8), mtr.TestRslt.DensityDiv.ToString("F2")); - PrintAt(e, FromTest(rowCnt, 9), mtr.TestTime.ToString("F1")); - PrintAt(e, FromTest(rowCnt, 10), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3")); - PrintAt(e, FromTest(rowCnt, 11), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3")); - - rowCnt++; - } - } - } - - /// - /// Draw table lines. - /// - void DrawTable(System.Drawing.Printing.PrintPageEventArgs e) - { - int mid = top + SpacingOneAndHalf; - int bot = top + (resultsCount + 1) * SpacingOneAndHalf; - - int top2 = top + secondTableOffset; - int mid2 = mid + secondTableOffset; - int bot2 = bot + secondTableOffset; - - // Horizontal lines - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top), new Point(747, top)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid), new Point(747, mid)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot), new Point(747, bot)); - - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, top2), new Point(747, top2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, mid2), new Point(747, mid2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, bot2), new Point(747, bot2)); - - // Vertical lines - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top), new Point( 80, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top), new Point(267, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top), new Point(347, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top), new Point(427, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top), new Point(507, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top), new Point(587, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top), new Point(667, bot)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top), new Point(747, bot)); - - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, top2), new Point( 80, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, top2), new Point(267, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, top2), new Point(347, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, top2), new Point(427, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, top2), new Point(507, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, top2), new Point(587, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, top2), new Point(667, bot2)); - e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, top2), new Point(747, bot2)); - } - - void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text) - { - PrintAt(e, p.X, p.Y, text); - } - - void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text) - { - RectangleF printArea = new RectangleF(x, y, 667, SpacingOne); - e.Graphics.DrawString(text, this.font, Brushes.Black, printArea); - } - - void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text) - { - PrintBoldAt(e, p.X, p.Y, text); - } - - void PrintBoldAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text) - { - RectangleF printArea = new RectangleF(x, y, 667, SpacingOne); - e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea); - } - - Point FromTest(int testNr, int parNr) - { - const int NrParamsInOneTableRow = 6; - - int x = 267 + (parNr % NrParamsInOneTableRow) * 80 + MarginLeft; - int y = top + SpacingOneAndHalf + MarginTop + testNr * SpacingOneAndHalf - + ((parNr >= NrParamsInOneTableRow) ? secondTableOffset : 0); - - if (parNr < 0) x = 80 + MarginLeft; /// When parNr == -1 return the left column x coordinate - - return new Point(x, y); - } - } -} diff --git a/ResultsBrowser/Properties/AssemblyInfo.cs b/ResultsBrowser/Properties/AssemblyInfo.cs index 09b9d6e79..aa566cc29 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.844.0")] -[assembly: AssemblyFileVersion("2.18.844.0")] +[assembly: AssemblyVersion("2.18.847.0")] +[assembly: AssemblyFileVersion("2.18.847.0")] diff --git a/ResultsBrowser/Resources/Strings.resx b/ResultsBrowser/Resources/Strings.resx index 92c945be4..bac76065b 100644 --- a/ResultsBrowser/Resources/Strings.resx +++ b/ResultsBrowser/Resources/Strings.resx @@ -706,7 +706,7 @@ Filters - Format of results + Configure output Load filters @@ -810,4 +810,7 @@ Print + + Configure printer + \ No newline at end of file diff --git a/ResultsBrowser/Resources/Strings1.Designer.cs b/ResultsBrowser/Resources/Strings1.Designer.cs index 28596ee99..ba41b8559 100644 --- a/ResultsBrowser/Resources/Strings1.Designer.cs +++ b/ResultsBrowser/Resources/Strings1.Designer.cs @@ -555,6 +555,15 @@ namespace ResultsBrowser.Resources { } } + /// + /// Looks up a localized string similar to Configure printer. + /// + internal static string Configure_printer { + get { + return ResourceManager.GetString("Configure_printer", resourceCulture); + } + } + /// /// Looks up a localized string similar to Configure test benches (password required). /// @@ -1186,7 +1195,7 @@ namespace ResultsBrowser.Resources { } /// - /// Looks up a localized string similar to Format of results. + /// Looks up a localized string similar to Configure output. /// internal static string Format_of_results { get { diff --git a/ResultsBrowser/ResultsBrowser.csproj b/ResultsBrowser/ResultsBrowser.csproj index 1431a07a4..b6c0c127e 100644 --- a/ResultsBrowser/ResultsBrowser.csproj +++ b/ResultsBrowser/ResultsBrowser.csproj @@ -125,6 +125,12 @@ NoBenchOrDatabaseDlg.cs + + Form + + + PrinterConfigDlg.cs + Form @@ -138,9 +144,6 @@ StatisticsOptionsDlg.cs - - Component - Component @@ -182,6 +185,9 @@ NoBenchOrDatabaseDlg.cs + + PrinterConfigDlg.cs + StatisticsDlg.cs @@ -230,6 +236,10 @@ {9D0DCC88-DC81-47EB-9FDD-4C3907871BFB} Results + + {8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48} + TBF + {6E5CB0E9-E1B6-4E5D-AC6E-B1049E180F2B} Users diff --git a/ResultsBrowser/ResultsBrowserWnd.Designer.cs b/ResultsBrowser/ResultsBrowserWnd.Designer.cs index 442e3e000..a3d7a1dcb 100644 --- a/ResultsBrowser/ResultsBrowserWnd.Designer.cs +++ b/ResultsBrowser/ResultsBrowserWnd.Designer.cs @@ -28,325 +28,337 @@ /// private void InitializeComponent() { - this.vSplitContainer = new System.Windows.Forms.SplitContainer(); - this.hSplitContainer = new System.Windows.Forms.SplitContainer(); - this.filtersGroupBox = new System.Windows.Forms.GroupBox(); - this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.resultsGroupBox = new System.Windows.Forms.GroupBox(); - this.resultsListView = new System.Windows.Forms.ListView(); - this.statisticsBtn = new System.Windows.Forms.Button(); - this.printQueryResultsBtn = new System.Windows.Forms.Button(); - this.exportQueryResultsBtn = new System.Windows.Forms.Button(); - this.formatOfResultsBtn = new System.Windows.Forms.Button(); - this.clearFiltersBtn = new System.Windows.Forms.Button(); - this.settingsBtn = new System.Windows.Forms.Button(); - this.saveConfigBtn = new System.Windows.Forms.Button(); - this.loadConfigBtn = new System.Windows.Forms.Button(); - this.executeQueryBtn = new System.Windows.Forms.Button(); - this.addFilterBtn = new System.Windows.Forms.Button(); - this.testBenchesGroupBox = new System.Windows.Forms.GroupBox(); - this.checkBox5 = new System.Windows.Forms.RadioButton(); - this.checkBox4 = new System.Windows.Forms.RadioButton(); - this.checkBox3 = new System.Windows.Forms.RadioButton(); - this.checkBox2 = new System.Windows.Forms.RadioButton(); - this.checkBox1 = new System.Windows.Forms.RadioButton(); - ((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).BeginInit(); - this.vSplitContainer.Panel1.SuspendLayout(); - this.vSplitContainer.Panel2.SuspendLayout(); - this.vSplitContainer.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).BeginInit(); - this.hSplitContainer.Panel1.SuspendLayout(); - this.hSplitContainer.Panel2.SuspendLayout(); - this.hSplitContainer.SuspendLayout(); - this.filtersGroupBox.SuspendLayout(); - this.resultsGroupBox.SuspendLayout(); - this.testBenchesGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // vSplitContainer - // - this.vSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.vSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.vSplitContainer.Location = new System.Drawing.Point(0, 0); - this.vSplitContainer.Name = "vSplitContainer"; - // - // vSplitContainer.Panel1 - // - this.vSplitContainer.Panel1.Controls.Add(this.hSplitContainer); - this.vSplitContainer.Panel1MinSize = 100; - // - // vSplitContainer.Panel2 - // - this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn); - this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn); - this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn); - this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn); - this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn); - this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn); - this.vSplitContainer.Panel2.Controls.Add(this.saveConfigBtn); - this.vSplitContainer.Panel2.Controls.Add(this.loadConfigBtn); - this.vSplitContainer.Panel2.Controls.Add(this.executeQueryBtn); - this.vSplitContainer.Panel2.Controls.Add(this.addFilterBtn); - this.vSplitContainer.Panel2.Controls.Add(this.testBenchesGroupBox); - this.vSplitContainer.Panel2MinSize = 100; - this.vSplitContainer.Size = new System.Drawing.Size(984, 712); - this.vSplitContainer.SplitterDistance = 840; - this.vSplitContainer.TabIndex = 0; - // - // hSplitContainer - // - this.hSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.hSplitContainer.Location = new System.Drawing.Point(0, 0); - this.hSplitContainer.Name = "hSplitContainer"; - this.hSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // hSplitContainer.Panel1 - // - this.hSplitContainer.Panel1.Controls.Add(this.filtersGroupBox); - // - // hSplitContainer.Panel2 - // - this.hSplitContainer.Panel2.Controls.Add(this.resultsGroupBox); - this.hSplitContainer.Size = new System.Drawing.Size(840, 712); - this.hSplitContainer.SplitterDistance = 280; - this.hSplitContainer.TabIndex = 0; - // - // filtersGroupBox - // - this.filtersGroupBox.Controls.Add(this.filtersFlowLayoutPanel); - this.filtersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.filtersGroupBox.Location = new System.Drawing.Point(0, 0); - this.filtersGroupBox.Name = "filtersGroupBox"; - this.filtersGroupBox.Size = new System.Drawing.Size(840, 280); - this.filtersGroupBox.TabIndex = 1; - this.filtersGroupBox.TabStop = false; - this.filtersGroupBox.Text = "Filters"; - // - // filtersFlowLayoutPanel - // - this.filtersFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.filtersFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); - this.filtersFlowLayoutPanel.Name = "filtersFlowLayoutPanel"; - this.filtersFlowLayoutPanel.Size = new System.Drawing.Size(834, 261); - this.filtersFlowLayoutPanel.TabIndex = 0; - // - // resultsGroupBox - // - this.resultsGroupBox.Controls.Add(this.resultsListView); - this.resultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.resultsGroupBox.Location = new System.Drawing.Point(0, 0); - this.resultsGroupBox.Name = "resultsGroupBox"; - this.resultsGroupBox.Size = new System.Drawing.Size(840, 428); - this.resultsGroupBox.TabIndex = 1; - this.resultsGroupBox.TabStop = false; - this.resultsGroupBox.Text = "Query results"; - // - // resultsListView - // - this.resultsListView.Dock = System.Windows.Forms.DockStyle.Fill; - this.resultsListView.Location = new System.Drawing.Point(3, 16); - this.resultsListView.Name = "resultsListView"; - this.resultsListView.Size = new System.Drawing.Size(834, 409); - this.resultsListView.TabIndex = 0; - this.resultsListView.UseCompatibleStateImageBehavior = false; - this.resultsListView.View = System.Windows.Forms.View.Details; - // - // statisticsBtn - // - this.statisticsBtn.Location = new System.Drawing.Point(8, 581); - this.statisticsBtn.Name = "statisticsBtn"; - this.statisticsBtn.Size = new System.Drawing.Size(125, 33); - this.statisticsBtn.TabIndex = 10; - this.statisticsBtn.Text = "Statistics"; - this.statisticsBtn.UseVisualStyleBackColor = true; - this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click); - // - // printQueryResultsBtn - // - this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 506); - this.printQueryResultsBtn.Name = "printQueryResultsBtn"; - this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 33); - this.printQueryResultsBtn.TabIndex = 9; - this.printQueryResultsBtn.Text = "Print query results"; - this.printQueryResultsBtn.UseVisualStyleBackColor = true; - this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click); - // - // exportQueryResultsBtn - // - this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 467); - this.exportQueryResultsBtn.Name = "exportQueryResultsBtn"; - this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 33); - this.exportQueryResultsBtn.TabIndex = 8; - this.exportQueryResultsBtn.Text = "Export query results"; - this.exportQueryResultsBtn.UseVisualStyleBackColor = true; - this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click); - // - // formatOfResultsBtn - // - this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 274); - this.formatOfResultsBtn.Name = "formatOfResultsBtn"; - this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 33); - this.formatOfResultsBtn.TabIndex = 7; - this.formatOfResultsBtn.Text = "Format of results"; - this.formatOfResultsBtn.UseVisualStyleBackColor = true; - this.formatOfResultsBtn.Click += new System.EventHandler(this.formatOfResultsBtn_Click); - // - // clearFiltersBtn - // - this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196); - this.clearFiltersBtn.Name = "clearFiltersBtn"; - this.clearFiltersBtn.Size = new System.Drawing.Size(125, 33); - this.clearFiltersBtn.TabIndex = 2; - this.clearFiltersBtn.Text = "Clear filters"; - this.clearFiltersBtn.UseVisualStyleBackColor = true; - this.clearFiltersBtn.Click += new System.EventHandler(this.clearFiltersBtn_Click); - // - // settingsBtn - // - this.settingsBtn.Location = new System.Drawing.Point(8, 12); - this.settingsBtn.Name = "settingsBtn"; - this.settingsBtn.Size = new System.Drawing.Size(125, 33); - this.settingsBtn.TabIndex = 0; - this.settingsBtn.Text = "Settings"; - this.settingsBtn.UseVisualStyleBackColor = true; - this.settingsBtn.Click += new System.EventHandler(this.settingsBtn_Click); - // - // saveConfigBtn - // - this.saveConfigBtn.Location = new System.Drawing.Point(8, 313); - this.saveConfigBtn.Name = "saveConfigBtn"; - this.saveConfigBtn.Size = new System.Drawing.Size(125, 33); - this.saveConfigBtn.TabIndex = 5; - this.saveConfigBtn.Text = "Save configuration"; - this.saveConfigBtn.UseVisualStyleBackColor = true; - this.saveConfigBtn.Click += new System.EventHandler(this.saveConfigBtn_Click); - // - // loadConfigBtn - // - this.loadConfigBtn.Location = new System.Drawing.Point(8, 352); - this.loadConfigBtn.Name = "loadConfigBtn"; - this.loadConfigBtn.Size = new System.Drawing.Size(125, 33); - this.loadConfigBtn.TabIndex = 4; - this.loadConfigBtn.Text = "Load configuration"; - this.loadConfigBtn.UseVisualStyleBackColor = true; - this.loadConfigBtn.Click += new System.EventHandler(this.loadConfigBtn_Click); - // - // executeQueryBtn - // - this.executeQueryBtn.Location = new System.Drawing.Point(8, 428); - this.executeQueryBtn.Name = "executeQueryBtn"; - this.executeQueryBtn.Size = new System.Drawing.Size(125, 33); - this.executeQueryBtn.TabIndex = 6; - this.executeQueryBtn.Text = "Execute query"; - this.executeQueryBtn.UseVisualStyleBackColor = true; - this.executeQueryBtn.Click += new System.EventHandler(this.executeQueryBtn_Click); - // - // addFilterBtn - // - this.addFilterBtn.Location = new System.Drawing.Point(8, 235); - this.addFilterBtn.Name = "addFilterBtn"; - this.addFilterBtn.Size = new System.Drawing.Size(125, 33); - this.addFilterBtn.TabIndex = 3; - this.addFilterBtn.Text = "Add filter"; - this.addFilterBtn.UseVisualStyleBackColor = true; - this.addFilterBtn.Click += new System.EventHandler(this.addFilterBtn_Click); - // - // testBenchesGroupBox - // - this.testBenchesGroupBox.Controls.Add(this.checkBox5); - this.testBenchesGroupBox.Controls.Add(this.checkBox4); - this.testBenchesGroupBox.Controls.Add(this.checkBox3); - this.testBenchesGroupBox.Controls.Add(this.checkBox2); - this.testBenchesGroupBox.Controls.Add(this.checkBox1); - this.testBenchesGroupBox.Location = new System.Drawing.Point(8, 54); - this.testBenchesGroupBox.Name = "testBenchesGroupBox"; - this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 135); - this.testBenchesGroupBox.TabIndex = 1; - this.testBenchesGroupBox.TabStop = false; - this.testBenchesGroupBox.Text = "Test benches"; - // - // checkBox5 - // - this.checkBox5.AutoSize = true; - this.checkBox5.Location = new System.Drawing.Point(23, 106); - this.checkBox5.Name = "checkBox5"; - this.checkBox5.Size = new System.Drawing.Size(85, 17); - this.checkBox5.TabIndex = 4; - this.checkBox5.TabStop = true; - this.checkBox5.Text = "radioButton5"; - this.checkBox5.UseVisualStyleBackColor = true; - this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged); - // - // checkBox4 - // - this.checkBox4.AutoSize = true; - this.checkBox4.Location = new System.Drawing.Point(23, 86); - this.checkBox4.Name = "checkBox4"; - this.checkBox4.Size = new System.Drawing.Size(85, 17); - this.checkBox4.TabIndex = 3; - this.checkBox4.TabStop = true; - this.checkBox4.Text = "radioButton4"; - this.checkBox4.UseVisualStyleBackColor = true; - this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged); - // - // checkBox3 - // - this.checkBox3.AutoSize = true; - this.checkBox3.Location = new System.Drawing.Point(23, 65); - this.checkBox3.Name = "checkBox3"; - this.checkBox3.Size = new System.Drawing.Size(85, 17); - this.checkBox3.TabIndex = 2; - this.checkBox3.TabStop = true; - this.checkBox3.Text = "radioButton3"; - this.checkBox3.UseVisualStyleBackColor = true; - this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged); - // - // checkBox2 - // - this.checkBox2.AutoSize = true; - this.checkBox2.Location = new System.Drawing.Point(23, 44); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(85, 17); - this.checkBox2.TabIndex = 1; - this.checkBox2.TabStop = true; - this.checkBox2.Text = "radioButton2"; - this.checkBox2.UseVisualStyleBackColor = true; - this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); - // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.Location = new System.Drawing.Point(23, 23); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(85, 17); - this.checkBox1.TabIndex = 0; - this.checkBox1.TabStop = true; - this.checkBox1.Text = "radioButton1"; - this.checkBox1.UseVisualStyleBackColor = true; - this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); - // - // ResultsBrowserWnd - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(984, 712); - this.Controls.Add(this.vSplitContainer); - this.Name = "ResultsBrowserWnd"; - this.Text = "Results Browser"; - this.Load += new System.EventHandler(this.ResultsBrowserWnd_Load); - this.vSplitContainer.Panel1.ResumeLayout(false); - this.vSplitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).EndInit(); - this.vSplitContainer.ResumeLayout(false); - this.hSplitContainer.Panel1.ResumeLayout(false); - this.hSplitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).EndInit(); - this.hSplitContainer.ResumeLayout(false); - this.filtersGroupBox.ResumeLayout(false); - this.resultsGroupBox.ResumeLayout(false); - this.testBenchesGroupBox.ResumeLayout(false); - this.testBenchesGroupBox.PerformLayout(); - this.ResumeLayout(false); + this.vSplitContainer = new System.Windows.Forms.SplitContainer(); + this.hSplitContainer = new System.Windows.Forms.SplitContainer(); + this.filtersGroupBox = new System.Windows.Forms.GroupBox(); + this.filtersFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.resultsGroupBox = new System.Windows.Forms.GroupBox(); + this.resultsListView = new System.Windows.Forms.ListView(); + this.printerConfigBtn = new System.Windows.Forms.Button(); + this.statisticsBtn = new System.Windows.Forms.Button(); + this.printQueryResultsBtn = new System.Windows.Forms.Button(); + this.exportQueryResultsBtn = new System.Windows.Forms.Button(); + this.formatOfResultsBtn = new System.Windows.Forms.Button(); + this.clearFiltersBtn = new System.Windows.Forms.Button(); + this.settingsBtn = new System.Windows.Forms.Button(); + this.saveConfigBtn = new System.Windows.Forms.Button(); + this.loadConfigBtn = new System.Windows.Forms.Button(); + this.executeQueryBtn = new System.Windows.Forms.Button(); + this.addFilterBtn = new System.Windows.Forms.Button(); + this.testBenchesGroupBox = new System.Windows.Forms.GroupBox(); + this.checkBox5 = new System.Windows.Forms.RadioButton(); + this.checkBox4 = new System.Windows.Forms.RadioButton(); + this.checkBox3 = new System.Windows.Forms.RadioButton(); + this.checkBox2 = new System.Windows.Forms.RadioButton(); + this.checkBox1 = new System.Windows.Forms.RadioButton(); + ((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).BeginInit(); + this.vSplitContainer.Panel1.SuspendLayout(); + this.vSplitContainer.Panel2.SuspendLayout(); + this.vSplitContainer.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).BeginInit(); + this.hSplitContainer.Panel1.SuspendLayout(); + this.hSplitContainer.Panel2.SuspendLayout(); + this.hSplitContainer.SuspendLayout(); + this.filtersGroupBox.SuspendLayout(); + this.resultsGroupBox.SuspendLayout(); + this.testBenchesGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // vSplitContainer + // + this.vSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.vSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.vSplitContainer.Location = new System.Drawing.Point(0, 0); + this.vSplitContainer.Name = "vSplitContainer"; + // + // vSplitContainer.Panel1 + // + this.vSplitContainer.Panel1.Controls.Add(this.hSplitContainer); + this.vSplitContainer.Panel1MinSize = 100; + // + // vSplitContainer.Panel2 + // + this.vSplitContainer.Panel2.Controls.Add(this.printerConfigBtn); + this.vSplitContainer.Panel2.Controls.Add(this.statisticsBtn); + this.vSplitContainer.Panel2.Controls.Add(this.printQueryResultsBtn); + this.vSplitContainer.Panel2.Controls.Add(this.exportQueryResultsBtn); + this.vSplitContainer.Panel2.Controls.Add(this.formatOfResultsBtn); + this.vSplitContainer.Panel2.Controls.Add(this.clearFiltersBtn); + this.vSplitContainer.Panel2.Controls.Add(this.settingsBtn); + this.vSplitContainer.Panel2.Controls.Add(this.saveConfigBtn); + this.vSplitContainer.Panel2.Controls.Add(this.loadConfigBtn); + this.vSplitContainer.Panel2.Controls.Add(this.executeQueryBtn); + this.vSplitContainer.Panel2.Controls.Add(this.addFilterBtn); + this.vSplitContainer.Panel2.Controls.Add(this.testBenchesGroupBox); + this.vSplitContainer.Panel2MinSize = 100; + this.vSplitContainer.Size = new System.Drawing.Size(984, 712); + this.vSplitContainer.SplitterDistance = 840; + this.vSplitContainer.TabIndex = 0; + // + // hSplitContainer + // + this.hSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.hSplitContainer.Location = new System.Drawing.Point(0, 0); + this.hSplitContainer.Name = "hSplitContainer"; + this.hSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // hSplitContainer.Panel1 + // + this.hSplitContainer.Panel1.Controls.Add(this.filtersGroupBox); + // + // hSplitContainer.Panel2 + // + this.hSplitContainer.Panel2.Controls.Add(this.resultsGroupBox); + this.hSplitContainer.Size = new System.Drawing.Size(840, 712); + this.hSplitContainer.SplitterDistance = 280; + this.hSplitContainer.TabIndex = 0; + // + // filtersGroupBox + // + this.filtersGroupBox.Controls.Add(this.filtersFlowLayoutPanel); + this.filtersGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.filtersGroupBox.Location = new System.Drawing.Point(0, 0); + this.filtersGroupBox.Name = "filtersGroupBox"; + this.filtersGroupBox.Size = new System.Drawing.Size(840, 280); + this.filtersGroupBox.TabIndex = 1; + this.filtersGroupBox.TabStop = false; + this.filtersGroupBox.Text = "Filters"; + // + // filtersFlowLayoutPanel + // + this.filtersFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.filtersFlowLayoutPanel.Location = new System.Drawing.Point(3, 16); + this.filtersFlowLayoutPanel.Name = "filtersFlowLayoutPanel"; + this.filtersFlowLayoutPanel.Size = new System.Drawing.Size(834, 261); + this.filtersFlowLayoutPanel.TabIndex = 0; + // + // resultsGroupBox + // + this.resultsGroupBox.Controls.Add(this.resultsListView); + this.resultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.resultsGroupBox.Location = new System.Drawing.Point(0, 0); + this.resultsGroupBox.Name = "resultsGroupBox"; + this.resultsGroupBox.Size = new System.Drawing.Size(840, 428); + this.resultsGroupBox.TabIndex = 1; + this.resultsGroupBox.TabStop = false; + this.resultsGroupBox.Text = "Query results"; + // + // resultsListView + // + this.resultsListView.Dock = System.Windows.Forms.DockStyle.Fill; + this.resultsListView.Location = new System.Drawing.Point(3, 16); + this.resultsListView.Name = "resultsListView"; + this.resultsListView.Size = new System.Drawing.Size(834, 409); + this.resultsListView.TabIndex = 0; + this.resultsListView.UseCompatibleStateImageBehavior = false; + this.resultsListView.View = System.Windows.Forms.View.Details; + // + // printerConfigBtn + // + this.printerConfigBtn.Location = new System.Drawing.Point(8, 316); + this.printerConfigBtn.Name = "printerConfigBtn"; + this.printerConfigBtn.Size = new System.Drawing.Size(125, 35); + this.printerConfigBtn.TabIndex = 11; + this.printerConfigBtn.Text = "Configure printer"; + this.printerConfigBtn.UseVisualStyleBackColor = true; + this.printerConfigBtn.Click += new System.EventHandler(this.printerConfigBtn_Click); + // + // statisticsBtn + // + this.statisticsBtn.Location = new System.Drawing.Point(8, 621); + this.statisticsBtn.Name = "statisticsBtn"; + this.statisticsBtn.Size = new System.Drawing.Size(125, 35); + this.statisticsBtn.TabIndex = 10; + this.statisticsBtn.Text = "Statistics"; + this.statisticsBtn.UseVisualStyleBackColor = true; + this.statisticsBtn.Click += new System.EventHandler(this.statisticsBtn_Click); + // + // printQueryResultsBtn + // + this.printQueryResultsBtn.Location = new System.Drawing.Point(8, 548); + this.printQueryResultsBtn.Name = "printQueryResultsBtn"; + this.printQueryResultsBtn.Size = new System.Drawing.Size(125, 35); + this.printQueryResultsBtn.TabIndex = 9; + this.printQueryResultsBtn.Text = "Print query results"; + this.printQueryResultsBtn.UseVisualStyleBackColor = true; + this.printQueryResultsBtn.Click += new System.EventHandler(this.printQueryResultsBtn_Click); + // + // exportQueryResultsBtn + // + this.exportQueryResultsBtn.Location = new System.Drawing.Point(8, 508); + this.exportQueryResultsBtn.Name = "exportQueryResultsBtn"; + this.exportQueryResultsBtn.Size = new System.Drawing.Size(125, 35); + this.exportQueryResultsBtn.TabIndex = 8; + this.exportQueryResultsBtn.Text = "Export query results"; + this.exportQueryResultsBtn.UseVisualStyleBackColor = true; + this.exportQueryResultsBtn.Click += new System.EventHandler(this.exportQueryResultsBtn_Click); + // + // formatOfResultsBtn + // + this.formatOfResultsBtn.Location = new System.Drawing.Point(8, 276); + this.formatOfResultsBtn.Name = "formatOfResultsBtn"; + this.formatOfResultsBtn.Size = new System.Drawing.Size(125, 35); + this.formatOfResultsBtn.TabIndex = 7; + this.formatOfResultsBtn.Text = "Configure output"; + this.formatOfResultsBtn.UseVisualStyleBackColor = true; + this.formatOfResultsBtn.Click += new System.EventHandler(this.formatOfResultsBtn_Click); + // + // clearFiltersBtn + // + this.clearFiltersBtn.Location = new System.Drawing.Point(8, 196); + this.clearFiltersBtn.Name = "clearFiltersBtn"; + this.clearFiltersBtn.Size = new System.Drawing.Size(125, 35); + this.clearFiltersBtn.TabIndex = 2; + this.clearFiltersBtn.Text = "Clear filters"; + this.clearFiltersBtn.UseVisualStyleBackColor = true; + this.clearFiltersBtn.Click += new System.EventHandler(this.clearFiltersBtn_Click); + // + // settingsBtn + // + this.settingsBtn.Location = new System.Drawing.Point(8, 12); + this.settingsBtn.Name = "settingsBtn"; + this.settingsBtn.Size = new System.Drawing.Size(125, 33); + this.settingsBtn.TabIndex = 0; + this.settingsBtn.Text = "Settings"; + this.settingsBtn.UseVisualStyleBackColor = true; + this.settingsBtn.Click += new System.EventHandler(this.settingsBtn_Click); + // + // saveConfigBtn + // + this.saveConfigBtn.Location = new System.Drawing.Point(8, 356); + this.saveConfigBtn.Name = "saveConfigBtn"; + this.saveConfigBtn.Size = new System.Drawing.Size(125, 35); + this.saveConfigBtn.TabIndex = 5; + this.saveConfigBtn.Text = "Save configuration"; + this.saveConfigBtn.UseVisualStyleBackColor = true; + this.saveConfigBtn.Click += new System.EventHandler(this.saveConfigBtn_Click); + // + // loadConfigBtn + // + this.loadConfigBtn.Location = new System.Drawing.Point(8, 396); + this.loadConfigBtn.Name = "loadConfigBtn"; + this.loadConfigBtn.Size = new System.Drawing.Size(125, 35); + this.loadConfigBtn.TabIndex = 4; + this.loadConfigBtn.Text = "Load configuration"; + this.loadConfigBtn.UseVisualStyleBackColor = true; + this.loadConfigBtn.Click += new System.EventHandler(this.loadConfigBtn_Click); + // + // executeQueryBtn + // + this.executeQueryBtn.Location = new System.Drawing.Point(8, 468); + this.executeQueryBtn.Name = "executeQueryBtn"; + this.executeQueryBtn.Size = new System.Drawing.Size(125, 35); + this.executeQueryBtn.TabIndex = 6; + this.executeQueryBtn.Text = "Execute query"; + this.executeQueryBtn.UseVisualStyleBackColor = true; + this.executeQueryBtn.Click += new System.EventHandler(this.executeQueryBtn_Click); + // + // addFilterBtn + // + this.addFilterBtn.Location = new System.Drawing.Point(8, 236); + this.addFilterBtn.Name = "addFilterBtn"; + this.addFilterBtn.Size = new System.Drawing.Size(125, 35); + this.addFilterBtn.TabIndex = 3; + this.addFilterBtn.Text = "Add filter"; + this.addFilterBtn.UseVisualStyleBackColor = true; + this.addFilterBtn.Click += new System.EventHandler(this.addFilterBtn_Click); + // + // testBenchesGroupBox + // + this.testBenchesGroupBox.Controls.Add(this.checkBox5); + this.testBenchesGroupBox.Controls.Add(this.checkBox4); + this.testBenchesGroupBox.Controls.Add(this.checkBox3); + this.testBenchesGroupBox.Controls.Add(this.checkBox2); + this.testBenchesGroupBox.Controls.Add(this.checkBox1); + this.testBenchesGroupBox.Location = new System.Drawing.Point(8, 54); + this.testBenchesGroupBox.Name = "testBenchesGroupBox"; + this.testBenchesGroupBox.Size = new System.Drawing.Size(125, 135); + this.testBenchesGroupBox.TabIndex = 1; + this.testBenchesGroupBox.TabStop = false; + this.testBenchesGroupBox.Text = "Test benches"; + // + // checkBox5 + // + this.checkBox5.AutoSize = true; + this.checkBox5.Location = new System.Drawing.Point(23, 106); + this.checkBox5.Name = "checkBox5"; + this.checkBox5.Size = new System.Drawing.Size(85, 17); + this.checkBox5.TabIndex = 4; + this.checkBox5.TabStop = true; + this.checkBox5.Text = "radioButton5"; + this.checkBox5.UseVisualStyleBackColor = true; + this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged); + // + // checkBox4 + // + this.checkBox4.AutoSize = true; + this.checkBox4.Location = new System.Drawing.Point(23, 86); + this.checkBox4.Name = "checkBox4"; + this.checkBox4.Size = new System.Drawing.Size(85, 17); + this.checkBox4.TabIndex = 3; + this.checkBox4.TabStop = true; + this.checkBox4.Text = "radioButton4"; + this.checkBox4.UseVisualStyleBackColor = true; + this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged); + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Location = new System.Drawing.Point(23, 65); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(85, 17); + this.checkBox3.TabIndex = 2; + this.checkBox3.TabStop = true; + this.checkBox3.Text = "radioButton3"; + this.checkBox3.UseVisualStyleBackColor = true; + this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged); + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Location = new System.Drawing.Point(23, 44); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(85, 17); + this.checkBox2.TabIndex = 1; + this.checkBox2.TabStop = true; + this.checkBox2.Text = "radioButton2"; + this.checkBox2.UseVisualStyleBackColor = true; + this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(23, 23); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(85, 17); + this.checkBox1.TabIndex = 0; + this.checkBox1.TabStop = true; + this.checkBox1.Text = "radioButton1"; + this.checkBox1.UseVisualStyleBackColor = true; + this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); + // + // ResultsBrowserWnd + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(984, 712); + this.Controls.Add(this.vSplitContainer); + this.Name = "ResultsBrowserWnd"; + this.Text = "Results Browser"; + this.Load += new System.EventHandler(this.ResultsBrowserWnd_Load); + this.vSplitContainer.Panel1.ResumeLayout(false); + this.vSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.vSplitContainer)).EndInit(); + this.vSplitContainer.ResumeLayout(false); + this.hSplitContainer.Panel1.ResumeLayout(false); + this.hSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.hSplitContainer)).EndInit(); + this.hSplitContainer.ResumeLayout(false); + this.filtersGroupBox.ResumeLayout(false); + this.resultsGroupBox.ResumeLayout(false); + this.testBenchesGroupBox.ResumeLayout(false); + this.testBenchesGroupBox.PerformLayout(); + this.ResumeLayout(false); } @@ -374,5 +386,6 @@ private System.Windows.Forms.ListView resultsListView; private System.Windows.Forms.RadioButton checkBox5; private System.Windows.Forms.RadioButton checkBox4; + private System.Windows.Forms.Button printerConfigBtn; } } \ No newline at end of file diff --git a/ResultsBrowser/ResultsBrowserWnd.cs b/ResultsBrowser/ResultsBrowserWnd.cs index 4c8b2a514..2a9018c84 100644 --- a/ResultsBrowser/ResultsBrowserWnd.cs +++ b/ResultsBrowser/ResultsBrowserWnd.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; +using System.IO; using System.Windows.Forms; using NHibernate; using Results.Entities; +using TBF.BenchControl; +using TBF.BenchControl.Generic; using ResultsBrowser.Filters; using ResultsBrowser.Resources; -using System.IO; namespace ResultsBrowser { @@ -13,7 +15,7 @@ namespace ResultsBrowser { const string OpenFileDlg_SaveFileDlg_Filter = "{0} (*.qry)|*.qry|{1} (*.*)|*.*"; - string[] args; + string[] args; /// Comand line argument IList filters; /// Filters and the UI of filters FiltersConfig filtersConfig; /// Serializable configuration of filters and displayed results @@ -26,6 +28,7 @@ namespace ResultsBrowser public ResultsBrowserWnd(string[] args) { InitializeComponent(); + filters = new List(); filtersConfig = new FiltersConfig(); this.args = args; @@ -95,15 +98,19 @@ namespace ResultsBrowser resultsGroupBox.Text = Strings.Query_results; settingsBtn.Text = Strings.Settings; testBenchesGroupBox.Text = Strings.Test_benches; - clearFiltersBtn.Text = Strings.Clear_filters; + + clearFiltersBtn.Text = Strings.Clear_filters; addFilterBtn.Text = Strings.Add_filter; - loadConfigBtn.Text = Strings.Load_filters; + formatOfResultsBtn.Text = Strings.Format_of_results; + printerConfigBtn.Text = Strings.Configure_printer; + loadConfigBtn.Text = Strings.Load_filters; saveConfigBtn.Text = Strings.Save_filters; - executeQueryBtn.Text = Strings.Execute_query; - formatOfResultsBtn.Text = Strings.Format_of_results; + + executeQueryBtn.Text = Strings.Execute_query; exportQueryResultsBtn.Text = Strings.Export_query_results; printQueryResultsBtn.Text = Strings.Print_query_results; - statisticsBtn.Text = Strings.Statistics; + + statisticsBtn.Text = Strings.Statistics; } private void settingsBtn_Click(object sender, EventArgs e) @@ -147,6 +154,34 @@ namespace ResultsBrowser } } + private void formatOfResultsBtn_Click(object sender, EventArgs e) + { + Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(); + dlg.MetersKind = Config.Entities.MetersKind.Single; + dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems); + + if (dlg.ShowDialog() == DialogResult.OK) + { + filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems); + RedrawResults(); + } + } + + private void printerConfigBtn_Click(object sender, EventArgs e) + { + Forms.PrinterConfigDlg dlg = new Forms.PrinterConfigDlg + { + PrinterClass = filtersConfig.PrinterClass, + PrinterCfg = filtersConfig.PrinterCfg + }; + + if (dlg.ShowDialog() == DialogResult.OK) + { + filtersConfig.PrinterClass = dlg.PrinterClass; + filtersConfig.PrinterCfg = dlg.PrinterCfg; + } + } + private void loadConfigBtn_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); @@ -295,19 +330,6 @@ namespace ResultsBrowser } } - private void formatOfResultsBtn_Click(object sender, EventArgs e) - { - Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(); - dlg.MetersKind = Config.Entities.MetersKind.Single; - dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems); - - if (dlg.ShowDialog() == DialogResult.OK) - { - filtersConfig.ResultItems = Results.WMeterRsltItemSpec.ToStrArray(dlg.SelectedItems); - RedrawResults(); - } - } - private void exportQueryResultsBtn_Click(object sender, EventArgs e) { IList items = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems); @@ -382,6 +404,11 @@ namespace ResultsBrowser "PT40 Z/E-35-A", "0111-OOP-C035-13").Print(); } +#else + foreach (var wm in waterMeters) + { + new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print(); + } #endif } @@ -408,5 +435,24 @@ namespace ResultsBrowser timePeriodStart, timePeriodEnd); statisticsDlg.ShowDialog(); } - } + + /// + /// 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; + } + } }