All printers enhanced and cleaned up: Template, Footer font, Doc.Name, etc., ver. 2.17.760

This commit is contained in:
Milan Hanajik 2017-12-04 10:58:02 +03:00
parent 6181e6a0f2
commit be7c433343
23 changed files with 1664 additions and 1242 deletions

View File

@ -28,210 +28,211 @@
/// </summary>
private void InitializeComponent()
{
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.downButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Enabled = false;
this.availableTabControl.Location = new System.Drawing.Point(9, 33);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 59;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableByQuantityTreeView);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
//
// availableAlphabeticTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableAlphabeticTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByCategoryTreeView);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByCategoryTreeView.Name = "availableByQuantityTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableAlphabeticTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(0, 0);
this.availableAlphabeticTreeView.Name = "availableByCategoryTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(198, 427);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// downButton
//
this.downButton.Enabled = false;
this.downButton.Location = new System.Drawing.Point(221, 351);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 58;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// upButton
//
this.upButton.Enabled = false;
this.upButton.Location = new System.Drawing.Point(221, 315);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 57;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.Enabled = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.GridLines = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(322, 33);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 56;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.DoubleClick += new System.EventHandler(this.selectedResultsListViewEx_DoubleClick);
//
// removeAllButton
//
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(221, 223);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 55;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(221, 188);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 54;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(221, 153);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 53;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(321, 11);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 52;
this.selectedResultsLabel.Text = "Selected results:";
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(11, 11);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 51;
this.availableResultsLabel.Text = "Available results:";
//
// ResultsConfigCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Name = "ResultsConfigCtrl";
this.Size = new System.Drawing.Size(925, 496);
this.Load += new System.EventHandler(this.ResultsConfigCtrl_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigCtrl_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
this.availableTabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.availableByQuantityTreeView = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.availableByCategoryTreeView = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.availableAlphabeticTreeView = new System.Windows.Forms.TreeView();
this.downButton = new System.Windows.Forms.Button();
this.upButton = new System.Windows.Forms.Button();
this.selectedResultsListViewEx = new Results.Forms.ListViewEx();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.availableTabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.SuspendLayout();
//
// availableTabControl
//
this.availableTabControl.Controls.Add(this.tabPage1);
this.availableTabControl.Controls.Add(this.tabPage2);
this.availableTabControl.Controls.Add(this.tabPage3);
this.availableTabControl.Enabled = false;
this.availableTabControl.Location = new System.Drawing.Point(9, 33);
this.availableTabControl.Name = "availableTabControl";
this.availableTabControl.SelectedIndex = 0;
this.availableTabControl.Size = new System.Drawing.Size(206, 453);
this.availableTabControl.TabIndex = 59;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.availableByQuantityTreeView);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(198, 427);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "A...Z";
this.tabPage1.UseVisualStyleBackColor = true;
//
// availableByQuantityTreeView
//
this.availableByQuantityTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByQuantityTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByQuantityTreeView.Name = "availableByQuantityTreeView";
this.availableByQuantityTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByQuantityTreeView.TabIndex = 0;
this.availableByQuantityTreeView.DoubleClick += new System.EventHandler(this.availableByQuantityTreeView_DoubleClick);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.availableByCategoryTreeView);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(198, 427);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "by quantity";
this.tabPage2.UseVisualStyleBackColor = true;
//
// availableByCategoryTreeView
//
this.availableByCategoryTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableByCategoryTreeView.Location = new System.Drawing.Point(3, 3);
this.availableByCategoryTreeView.Name = "availableByCategoryTreeView";
this.availableByCategoryTreeView.Size = new System.Drawing.Size(192, 421);
this.availableByCategoryTreeView.TabIndex = 0;
this.availableByCategoryTreeView.DoubleClick += new System.EventHandler(this.availableByCategoryTreeView_DoubleClick);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.availableAlphabeticTreeView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(198, 427);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "by category";
this.tabPage3.UseVisualStyleBackColor = true;
//
// availableAlphabeticTreeView
//
this.availableAlphabeticTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.availableAlphabeticTreeView.Location = new System.Drawing.Point(0, 0);
this.availableAlphabeticTreeView.Name = "availableAlphabeticTreeView";
this.availableAlphabeticTreeView.Size = new System.Drawing.Size(198, 427);
this.availableAlphabeticTreeView.TabIndex = 0;
this.availableAlphabeticTreeView.DoubleClick += new System.EventHandler(this.availableAlphabeticTreeView_DoubleClick);
//
// downButton
//
this.downButton.Enabled = false;
this.downButton.Location = new System.Drawing.Point(221, 351);
this.downButton.Name = "downButton";
this.downButton.Size = new System.Drawing.Size(93, 30);
this.downButton.TabIndex = 58;
this.downButton.Text = "Down";
this.downButton.UseVisualStyleBackColor = true;
this.downButton.Click += new System.EventHandler(this.downButton_Click);
//
// upButton
//
this.upButton.Enabled = false;
this.upButton.Location = new System.Drawing.Point(221, 315);
this.upButton.Name = "upButton";
this.upButton.Size = new System.Drawing.Size(93, 30);
this.upButton.TabIndex = 57;
this.upButton.Text = "Up";
this.upButton.UseVisualStyleBackColor = true;
this.upButton.Click += new System.EventHandler(this.upButton_Click);
//
// selectedResultsListViewEx
//
this.selectedResultsListViewEx.AllowColumnReorder = true;
this.selectedResultsListViewEx.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.selectedResultsListViewEx.DoubleClickActivation = false;
this.selectedResultsListViewEx.Enabled = false;
this.selectedResultsListViewEx.FullRowSelect = true;
this.selectedResultsListViewEx.GridLines = true;
this.selectedResultsListViewEx.Location = new System.Drawing.Point(322, 33);
this.selectedResultsListViewEx.Name = "selectedResultsListViewEx";
this.selectedResultsListViewEx.Size = new System.Drawing.Size(594, 453);
this.selectedResultsListViewEx.TabIndex = 56;
this.selectedResultsListViewEx.UseCompatibleStateImageBehavior = false;
this.selectedResultsListViewEx.View = System.Windows.Forms.View.Details;
this.selectedResultsListViewEx.DoubleClick += new System.EventHandler(this.selectedResultsListViewEx_DoubleClick);
//
// removeAllButton
//
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(221, 223);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 55;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Visible = false;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(221, 188);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 54;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(221, 153);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 53;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(321, 11);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 52;
this.selectedResultsLabel.Text = "Selected results:";
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(11, 11);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 51;
this.availableResultsLabel.Text = "Available results:";
//
// ResultsConfigCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.availableTabControl);
this.Controls.Add(this.downButton);
this.Controls.Add(this.upButton);
this.Controls.Add(this.selectedResultsListViewEx);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Name = "ResultsConfigCtrl";
this.Size = new System.Drawing.Size(925, 496);
this.Load += new System.EventHandler(this.ResultsConfigCtrl_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.ResultsConfigCtrl_KeyPress);
this.availableTabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}

View File

@ -27,7 +27,9 @@ namespace Results.Output.Printers.Enhanced
readonly int SpacingOneAndHalf;
readonly int SpacingOne4Header;
readonly int SpacingOneAndHalf4Header;
readonly int SpacingOne4Footer;
int CommonTop; /// = TitleY + 60
int BodyTop; /// = HdrTop + 160
///
@ -37,9 +39,10 @@ namespace Results.Output.Printers.Enhanced
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font headerFont;
Font titleFont;
Font titleFont;
Font headerFont;
Font font;
Font footerFont;
///
/// Data to print
@ -70,11 +73,12 @@ namespace Results.Output.Printers.Enhanced
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg)
public EnhancedPrintDocument(Results.Entities.Batch batch, EnhancedPrinterCfg cfg, string documentName)
{
this.batch = batch;
this.cfg = cfg;
DocumentName = documentName;
topMargin = cfg.TopMargin;
bottomMargin = cfg.BottomMargin;
leftMargin = cfg.LeftMargin;
@ -88,6 +92,7 @@ namespace Results.Output.Printers.Enhanced
titleFont = new Font((cfg.TitFntFml != null ? cfg.TitFntFml : "Arial"), (cfg.TitFntSz > 0 ? cfg.TitFntSz : 10), (FontStyle)cfg.TitFntSty);
headerFont = new Font((cfg.HdrFntFml != null ? cfg.HdrFntFml : "Arial"), (cfg.HdrFntSz > 0 ? cfg.HdrFntSz : 10), (FontStyle)cfg.HdrFntSty);
font = new Font((cfg.BodyFntFml != null ? cfg.BodyFntFml : "Arial"), (cfg.BodyFntSz > 0 ? cfg.BodyFntSz : 10), (FontStyle)cfg.BodyFntSty);
footerFont = new Font((cfg.FooterFntFml != null ? cfg.FooterFntFml : "Arial"), (cfg.FooterFntSz > 0 ? cfg.FooterFntSz : 10), (FontStyle)cfg.FooterFntSty);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
@ -107,6 +112,7 @@ namespace Results.Output.Printers.Enhanced
SpacingOneAndHalf = (3 * SpacingOne) / 2;
SpacingOne4Header = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", headerFont).Height;
SpacingOneAndHalf4Header = (3 * SpacingOne4Header) / 2;
SpacingOne4Footer = System.Windows.Forms.TextRenderer.MeasureText("Abcgq", footerFont).Height;
/// Calculate the tests count
int testsCount = 0;
@ -160,11 +166,17 @@ namespace Results.Output.Printers.Enhanced
/// Run base code
base.OnPrintPage(e);
if (File.Exists("C:\\TBF\\header.png"))
{
Image img = Image.FromFile("C:\\TBF\\header.png");
e.Graphics.DrawImage(new Bitmap(img), new Rectangle(0, 0, 827, 1169));
}
if (!string.IsNullOrEmpty(cfg.Template))
{
string templatePath = Path.Combine("C:\\TBF\\Templates\\", cfg.Template);
if (File.Exists(templatePath))
{
if (cfg.PageOrientation == PageOrientation.Portrait)
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), 827, 1169), new Rectangle(0, 0, 827, 1169));
else
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), 1169, 827), new Rectangle(0, 0, 1169, 827));
}
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
@ -226,8 +238,8 @@ namespace Results.Output.Printers.Enhanced
///----------
/// Footer
///----------
int footerWidth = (int)e.Graphics.MeasureString(footer, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
int footerWidth = (int)e.Graphics.MeasureString(footer, footerFont).Width;
PrintFooterAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * SpacingOne, footer);
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
@ -331,8 +343,6 @@ namespace Results.Output.Printers.Enhanced
{
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, 2000, SpacingOne);
@ -344,12 +354,21 @@ namespace Results.Output.Printers.Enhanced
{
PrintHeaderAt(e, p.X, p.Y, text);
}
void PrintHeaderAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Header);
e.Graphics.DrawString(text, this.headerFont, Brushes.Black, printArea);
}
}
void PrintFooterAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
{
PrintFooterAt(e, p.X, p.Y, text);
}
void PrintFooterAt(System.Drawing.Printing.PrintPageEventArgs e, int x, int y, string text)
{
RectangleF printArea = new RectangleF(x, y, 2000, SpacingOne4Footer);
e.Graphics.DrawString(text, this.footerFont, Brushes.Black, printArea);
}
}
}

View File

@ -1,17 +1,14 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Results.Output.Printers.Enhanced
{
public class EnhancedPrinterCfg
{
public Config.Entities.PageOrientation PageOrientation;
public int TopMargin;
public string Template;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
@ -23,11 +20,15 @@ namespace Results.Output.Printers.Enhanced
public string BodyFntFml;
public int BodyFntSz;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public string FooterFntFml;
public int FooterFntSz;
public int FooterFntSty;
public bool GoodOnly;
public bool SupressPrinting; /// Bypass printing when true
public System.Globalization.CultureInfo CultureInfo;
public string[] CommonItems;
public string Header; /// =Title
public string[] CommonItems;
public string[] TestItems;
public string Header; /// =Title
public string Footer;
}
}

View File

@ -38,9 +38,10 @@ namespace Results.Output.Printers.OnePerMeter
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font headerFont;
Font titleFont;
Font titleFont;
Font headerFont;
Font font;
Font footerFont;
///
/// Data to print
@ -65,11 +66,12 @@ namespace Results.Output.Printers.OnePerMeter
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public OnePerMeterPrintDocument(Results.Entities.Batch batch, OnePerMeterPrinterCfg cfg, Results.Entities.WaterMeter wm)
public OnePerMeterPrintDocument(Results.Entities.Batch batch, OnePerMeterPrinterCfg cfg, Results.Entities.WaterMeter wm, string documentName)
{
this.batch = batch;
this.cfg = cfg;
this.wm = wm;
DocumentName = documentName;
topMargin = cfg.TopMargin;
bottomMargin = cfg.BottomMargin;
@ -85,6 +87,7 @@ namespace Results.Output.Printers.OnePerMeter
titleFont = new Font((cfg.TitFntFml != null ? cfg.TitFntFml : "Arial"), (cfg.TitFntSz > 0 ? cfg.TitFntSz : 10), (FontStyle)cfg.TitFntSty);
headerFont = new Font((cfg.HdrFntFml != null ? cfg.HdrFntFml : "Arial"), (cfg.HdrFntSz > 0 ? cfg.HdrFntSz : 10), (FontStyle)cfg.HdrFntSty);
font = new Font((cfg.BodyFntFml != null ? cfg.BodyFntFml : "Arial"), (cfg.BodyFntSz > 0 ? cfg.BodyFntSz : 10), (FontStyle)cfg.BodyFntSty);
footerFont = new Font((cfg.FooterFntFml != null ? cfg.FooterFntFml : "Arial"), (cfg.FooterFntSz > 0 ? cfg.FooterFntSz : 10), (FontStyle)cfg.FooterFntSty);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
@ -131,6 +134,18 @@ namespace Results.Output.Printers.OnePerMeter
/// Run base code
base.OnPrintPage(e);
if (!string.IsNullOrEmpty(cfg.Template))
{
string templatePath = Path.Combine("C:\\TBF\\Templates\\", cfg.Template);
if (File.Exists(templatePath))
{
if (cfg.PageOrientation == PageOrientation.Portrait)
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), 827, 1169), new Rectangle(0, 0, 827, 1169));
else
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), 1169, 827), new Rectangle(0, 0, 1169, 827));
}
}
if (pageNr == 1)
{
titleHeight = System.Windows.Forms.TextRenderer.MeasureText(header, titleFont).Height;
@ -140,12 +155,6 @@ namespace Results.Output.Printers.OnePerMeter
bodyTop = commonTop + commonHeight + spacingOne4Header;
}
if (File.Exists("C:\\TBF\\header.png"))
{
Image img = Image.FromFile("C:\\TBF\\header.png");
e.Graphics.DrawImage(new Bitmap(img), new Rectangle(0, 0, 827, 1169));
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
@ -236,8 +245,8 @@ namespace Results.Output.Printers.OnePerMeter
///
/// Footer on the last page
///
float footerWidth = e.Graphics.MeasureString(footer, font).Width;
PrintAt(e, leftMargin, topMargin + printHeight - 2 * spacingOne, 0, footer, font, Alignment.Left);
float footerWidth = e.Graphics.MeasureString(footer, footerFont).Width;
PrintAt(e, leftMargin, topMargin + printHeight - 2 * spacingOne, 0, footer, footerFont, Alignment.Left);
}
///

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
namespace Results.Output.Printers.OnePerMeter
@ -7,6 +7,7 @@ namespace Results.Output.Printers.OnePerMeter
public class OnePerMeterPrinterCfg
{
public Config.Entities.PageOrientation PageOrientation;
public string Template;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
@ -19,6 +20,9 @@ namespace Results.Output.Printers.OnePerMeter
public string BodyFntFml;
public int BodyFntSz;
public int BodyFntSty;
public string FooterFntFml;
public int FooterFntSz;
public int FooterFntSty;
public bool GoodOnly;
public bool SupressPrinting; /// Bypass printing when true
public System.Globalization.CultureInfo CultureInfo;

View File

@ -44,9 +44,10 @@ namespace Results.Output.Printers.Zapiska
/// <summary>
/// Property variable for the Font the user wishes to use
/// </summary>
Font font;
Font headerFont;
Font titleFont;
Font titleFont;
Font headerFont;
Font font;
Font footerFont;
///
/// Data to print
@ -81,9 +82,10 @@ namespace Results.Output.Printers.Zapiska
/// Constructor
/// </summary>
/// <param name="textToPrint">Text to be printed</param>
public ZapiskaPrintDocument(Results.Entities.Batch batch, ZapiskaPrinterCfg cfg)
public ZapiskaPrintDocument(Results.Entities.Batch batch, ZapiskaPrinterCfg cfg, string documentName)
{
this.batch = batch;
DocumentName = documentName;
this.cfg = cfg;
topMargin = cfg.TopMargin;
@ -104,6 +106,7 @@ namespace Results.Output.Printers.Zapiska
titleFont = new Font((cfg.TitFntFml != null ? cfg.TitFntFml : "Arial"), (cfg.TitFntSz > 0 ? cfg.TitFntSz : 10), (FontStyle)cfg.TitFntSty);
headerFont = new Font((cfg.HdrFntFml != null ? cfg.HdrFntFml : "Arial"), (cfg.HdrFntSz > 0 ? cfg.HdrFntSz : 10), (FontStyle)cfg.HdrFntSty);
font = new Font((cfg.BodyFntFml != null ? cfg.BodyFntFml : "Arial"), (cfg.BodyFntSz > 0 ? cfg.BodyFntSz : 10), (FontStyle)cfg.BodyFntSty);
footerFont = new Font((cfg.FooterFntFml != null ? cfg.FooterFntFml : "Arial"), (cfg.FooterFntSz > 0 ? cfg.FooterFntSz : 10), (FontStyle)cfg.FooterFntSty);
/// Set print area size and margins (in dots using 100 dpi)
DefaultPageSettings.Landscape = (cfg.PageOrientation == PageOrientation.Landscape);
@ -150,8 +153,23 @@ namespace Results.Output.Printers.Zapiska
/// <remarks>This provides the print logic for our document</remarks>
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
{
/// Run base code
base.OnPrintPage(e);
if (pageNr == 1)
{
if (!string.IsNullOrEmpty(cfg.Template))
{
string templatePath = Path.Combine("C:\\TBF\\Templates\\", cfg.Template);
if (File.Exists(templatePath))
{
if (cfg.PageOrientation == PageOrientation.Portrait)
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), 827, 1169), new Rectangle(0, 0, 827, 1169));
else
e.Graphics.DrawImage(new Bitmap(Image.FromFile(templatePath), 1169, 827), new Rectangle(0, 0, 1169, 827));
}
}
/// Calculate the table rows count
int tableRowsCount = 0;
foreach (var wm in batch.WaterMeters)
@ -178,15 +196,6 @@ namespace Results.Output.Printers.Zapiska
nrPages = 2;
}
/// Run base code
base.OnPrintPage(e);
if (File.Exists("C:\\TBF\\header.png"))
{
Image img = Image.FromFile("C:\\TBF\\header.png");
e.Graphics.DrawImage(new Bitmap(img), new Rectangle(0, 0, 827, 1169));
}
/// Use the StringFormat class for the text layout of our document
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
@ -318,8 +327,8 @@ namespace Results.Output.Printers.Zapiska
///----------
/// Footer
///----------
float footerWidth = Measure(e, footer, font).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * spacingOne, 0, footer, font, Alignment.Left);
float footerWidth = Measure(e, footer, footerFont).Width;
PrintAt(e, leftMargin + (printWidth - footerWidth) / 2, topMargin + printHeight - 2 * spacingOne, 0, footer, footerFont, Alignment.Left);
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
float pageNrWidth = e.Graphics.MeasureString(pageNrText, font).Width;

View File

@ -1,17 +1,14 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Results.Output.Printers.Zapiska
{
public class ZapiskaPrinterCfg
{
public Config.Entities.PageOrientation PageOrientation;
public int TopMargin;
public string Template;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
@ -23,7 +20,10 @@ namespace Results.Output.Printers.Zapiska
public string BodyFntFml;
public int BodyFntSz;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public string FooterFntFml;
public int FooterFntSz;
public int FooterFntSty;
public bool SupressPrinting; /// Bypass printing when true
public bool GoodOnly;
public System.Globalization.CultureInfo CultureInfo;

View File

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

View File

@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl;
namespace TBF.BenchControl.Configs
{
public class ConfigCtrlUtils : UserControl
{
protected PageOrientation GetOrientation(string str)
{
if (str.Equals(PageOrientation.Landscape.ToString())) return PageOrientation.Landscape;
if (str.Equals(PageOrientation.Portrait.ToString())) return PageOrientation.Portrait;
return (PageOrientation)(-1);
}
/// <summary>
/// Updates destination variable when its value differes from the source value.
/// Returns appropriate flags
/// </summary>
/// <param name="cfgVar">Reference to destination variable</param>
/// <param name="intVal">Source value</param>
/// <param name="flagsWhenUpdated">Flags returned when an update occurs</param>
/// <returns>Flags or 0</returns>
protected CfgUpdateFlags UpdateDifferent(ref int cfgVar, int intVal, CfgUpdateFlags flagsWhenUpdated)
{
if (cfgVar != intVal) { cfgVar = intVal; return flagsWhenUpdated; } else return 0;
}
/// <summary>
/// Updates destination variable when its value differes from the source value.
/// Returns appropriate flags
/// </summary>
/// <param name="cfgVar">Reference to destination variable</param>
/// <param name="toBeParsedString">Source integer value is obtained by parsing this string</param>
/// <param name="flagsWhenUpdated">Flags returned when an update occurs</param>
/// <returns>Flags or 0</returns>
protected CfgUpdateFlags UpdateDifferent(ref int cfgVar, string toBeParsedString, CfgUpdateFlags flagsWhenUpdated)
{
int itmp = int.Parse(toBeParsedString);
if (cfgVar != itmp) { cfgVar = itmp; return flagsWhenUpdated; } else return 0;
}
/// <summary>
/// Updates destination variable when its value differes from the source value.
/// Returns appropriate flags
/// </summary>
/// <param name="cfgVar">Reference to destination variable</param>
/// <param name="boolVal">Source value</param>
/// <param name="flagsWhenUpdated">Flags returned when an update occurs</param>
/// <returns>Flags or 0</returns>
protected CfgUpdateFlags UpdateDifferent(ref bool cfgVar, bool boolVal, CfgUpdateFlags flagsWhenUpdated)
{
if (cfgVar != boolVal) { cfgVar = boolVal; return flagsWhenUpdated; } else return 0;
}
/// <summary>
/// Updates destination variable when its value differes from the source value.
/// Returns appropriate flags
/// </summary>
/// <param name="cfgVar">Reference to destination variable</param>
/// <param name="stringVal">Source value</param>
/// <param name="flagsWhenUpdated">Flags returned when an update occurs</param>
/// <returns>Flags or 0</returns>
protected CfgUpdateFlags UpdateDifferent(ref string cfgVar, string stringVal, CfgUpdateFlags flagsWhenUpdated)
{
if (cfgVar != stringVal) { cfgVar = stringVal; return flagsWhenUpdated; } else return 0;
}
/// <summary>
/// Updates destination variable when its value differes from the source value.
/// Returns appropriate flags
/// </summary>
/// <param name="cfgVar">Reference to destination array</param>
/// <param name="stringArrVal">Source array of strings</param>
/// <param name="flagsWhenUpdated">Flags returned when an update occurs</param>
/// <returns>Flags or 0</returns>
protected CfgUpdateFlags UpdateDifferent(ref string[] cfgVar, string[] stringArrVal, CfgUpdateFlags flagsWhenUpdated)
{
if (cfgVar == null && stringArrVal == null)
{
return 0;
}
else if (cfgVar == null || stringArrVal == null || !cfgVar.SequenceEqual<string>(stringArrVal))
{
cfgVar = stringArrVal;
return flagsWhenUpdated;
}
else
{
return 0;
}
}
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -13,7 +13,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
public override string ToString() { return string.Format("ResultsPrinters.Basic({0})", Cfg.ToString(1)); }
public override string ToString() { return string.Format("Output.Printers.Enhanced({0})", Cfg.ToString(1)); }
readonly PrinterCfg printerCfg;
@ -72,7 +72,8 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
if (args.Command == CfgChangeCmd.CfgChange)
{
printerCfg.PageOrientation = newCfg.PageOrientation;
printerCfg.TopMargin = newCfg.TopMargin;
printerCfg.Template = newCfg.Template;
printerCfg.TopMargin = newCfg.TopMargin;
printerCfg.BottomMargin = newCfg.BottomMargin;
printerCfg.LeftMargin = newCfg.LeftMargin;
@ -85,14 +86,20 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
printerCfg.BodyFntFml = newCfg.BodyFntFml;
printerCfg.BodyFntSz = newCfg.BodyFntSz;
printerCfg.BodyFntSty = newCfg.BodyFntSty;
printerCfg.FooterFntFml = newCfg.FooterFntFml;
printerCfg.FooterFntSz = newCfg.FooterFntSz;
printerCfg.FooterFntSty = newCfg.FooterFntSty;
printerCfg.SupressPrinting = newCfg.SupressPrinting;
printerCfg.GoodOnly = newCfg.GoodOnly;
printerCfg.SupressPrinting = newCfg.SupressPrinting;
printerCfg.Culture = newCfg.Culture;
printerCfg.CommonItems = newCfg.CommonItems;
printerCfg.SelectedItems = newCfg.SelectedItems;
printerCfg.Header = newCfg.Header;
printerCfg.Footer = newCfg.Footer;
printerCfg.DocName = newCfg.DocName;
ApplyConfig();
}
}
@ -123,7 +130,18 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
Thread.CurrentThread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
}
PrintResults(batch);
string documentName;
try
{
if (string.IsNullOrEmpty(printerCfg.DocName)) throw (new Exception());
documentName = string.Format(printerCfg.DocName, batch.StartTime, batch.EndTime, batch.BatchNr);
}
catch
{
documentName = string.Format("{0:yyyyMMdd-HHmm}", batch.EndTime);
}
PrintResults(batch, documentName);
Thread.CurrentThread.CurrentCulture = oriCulture;
}
@ -141,25 +159,30 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
}
void PrintResults(Results.Entities.Batch batch)
void PrintResults(Results.Entities.Batch batch, string documentName)
{
if (batch.WaterMeters.Count > 0)
{
EnhancedPrinterCfg cfg = new EnhancedPrinterCfg
{
PageOrientation = printerCfg.PageOrientation,
Template = printerCfg.Template,
TopMargin = printerCfg.TopMargin,
BottomMargin = printerCfg.BottomMargin,
LeftMargin = printerCfg.LeftMargin,
TitFntFml = printerCfg.TitFntFml,
HdrFntFml = printerCfg.HdrFntFml,
BodyFntFml = printerCfg.BodyFntFml,
TitFntSz = printerCfg.TitFntSz,
HdrFntSz = printerCfg.HdrFntSz,
BodyFntSz = printerCfg.BodyFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntFml = printerCfg.HdrFntFml,
HdrFntSz = printerCfg.HdrFntSz,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntFml = printerCfg.BodyFntFml,
BodyFntSz = printerCfg.BodyFntSz,
BodyFntSty = printerCfg.BodyFntSty,
FooterFntFml = printerCfg.FooterFntFml,
FooterFntSz = printerCfg.FooterFntSz,
FooterFntSty = printerCfg.FooterFntSty,
GoodOnly = printerCfg.GoodOnly,
SupressPrinting = printerCfg.SupressPrinting,
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
Header = printerCfg.Header,
@ -168,7 +191,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
Footer = printerCfg.Footer,
};
new Results.Output.Printers.Enhanced.EnhancedPrintDocument(batch, cfg).Print();
new Results.Output.Printers.Enhanced.EnhancedPrintDocument(batch, cfg, documentName).Print();
}
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System.Xml.Serialization;
using Config.Entities;
@ -18,24 +18,30 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
/// Serialized parameters
///
public PageOrientation PageOrientation;
public int TopMargin;
public string Template;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public string HdrFntFml;
public string BodyFntFml;
public int TitFntSz;
public int HdrFntSz;
public int BodyFntSz;
public int TitFntSty;
public int HdrFntSty;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public string TitFntFml;
public string HdrFntFml;
public string BodyFntFml;
public string FooterFntFml;
public int TitFntSz;
public int HdrFntSz;
public int BodyFntSz;
public int FooterFntSz;
public int TitFntSty;
public int HdrFntSty;
public int BodyFntSty;
public int FooterFntSty;
public bool GoodOnly;
public bool SupressPrinting; /// Bypass printing when true
public Culture Culture;
public string[] CommonItems;
public string[] SelectedItems;
public string Header; /// =Title
public string Footer;
public string DocName;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
@ -52,24 +58,30 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
Factory = factory;
MetersKind = metersKind;
ParentName = string.Empty;
PageOrientation = PageOrientation.Portrait;
ParentName = string.Empty;
Template = string.Empty;
PageOrientation = PageOrientation.Portrait;
TopMargin = 100;
BottomMargin = 100;
LeftMargin = 100;
TitFntFml = "Arial";
TitFntSz = 18;
TitFntSty = 1;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
SupressPrinting = false;
HdrFntFml = "Arial";
HdrFntSz = 10;
HdrFntSty = 0;
BodyFntFml = "Arial";
BodyFntSz = 10;
BodyFntSty = 0;
FooterFntFml = "Arial";
FooterFntSz = 10;
FooterFntSty = 0;
GoodOnly = false;
SupressPrinting = false;
Header = string.Empty;
Footer = string.Empty;
}
DocName = string.Empty;
}
public string ToString(int i)
{

View File

@ -31,391 +31,502 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
/// </summary>
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.supressPrintingCheckBox = new System.Windows.Forms.CheckBox();
this.orientationLabel = new System.Windows.Forms.Label();
this.orientationComboBox = new System.Windows.Forms.ComboBox();
this.topMarginTextBox = new System.Windows.Forms.TextBox();
this.topMarginLabel = new System.Windows.Forms.Label();
this.leftMarginTextBox = new System.Windows.Forms.TextBox();
this.bottomMarginTextBox = new System.Windows.Forms.TextBox();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.commonItemsButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.headerButton = new System.Windows.Forms.Button();
this.testItemsButton = new System.Windows.Forms.Button();
this.headerFontLabel = new System.Windows.Forms.Label();
this.titleFontLabel = new System.Windows.Forms.Label();
this.titleFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.headerFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.bodyFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.bodyFontLabel = new System.Windows.Forms.Label();
this.titleFontSizeTextBox = new System.Windows.Forms.TextBox();
this.headerFontSizeTextBox = new System.Windows.Forms.TextBox();
this.bodyFontSizeTextBox = new System.Windows.Forms.TextBox();
this.titleBoldCheckBox = new System.Windows.Forms.CheckBox();
this.titleItalicCheckBox = new System.Windows.Forms.CheckBox();
this.headerItalicCheckBox = new System.Windows.Forms.CheckBox();
this.headerBoldCheckBox = new System.Windows.Forms.CheckBox();
this.bodyItalicCheckBox = new System.Windows.Forms.CheckBox();
this.bodyBoldCheckBox = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(142, 40);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(218, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(16, 43);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(139, 16);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// supressPrintingCheckBox
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(143, 188);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 24;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(16, 67);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 3;
this.orientationLabel.Text = "Page orientation";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 64);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(218, 21);
this.orientationComboBox.TabIndex = 4;
//
// topMarginTextBox
//
this.topMarginTextBox.Enabled = false;
this.topMarginTextBox.Location = new System.Drawing.Point(142, 89);
this.topMarginTextBox.Name = "topMarginTextBox";
this.topMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.topMarginTextBox.TabIndex = 6;
//
// topMarginLabel
//
this.topMarginLabel.AutoSize = true;
this.topMarginLabel.Location = new System.Drawing.Point(16, 92);
this.topMarginLabel.Name = "topMarginLabel";
this.topMarginLabel.Size = new System.Drawing.Size(116, 13);
this.topMarginLabel.TabIndex = 5;
this.topMarginLabel.Text = "Top/bottom/left margin";
//
// leftMarginTextBox
//
this.leftMarginTextBox.Enabled = false;
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 89);
this.leftMarginTextBox.Name = "leftMarginTextBox";
this.leftMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.leftMarginTextBox.TabIndex = 8;
//
// bottomMarginTextBox
//
this.bottomMarginTextBox.Enabled = false;
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 89);
this.bottomMarginTextBox.Name = "bottomMarginTextBox";
this.bottomMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.bottomMarginTextBox.TabIndex = 7;
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(142, 209);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(218, 21);
this.cultureComboBox.TabIndex = 26;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(16, 212);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 25;
this.cultureLabel.Text = "Cullture";
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(142, 259);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(218, 23);
this.commonItemsButton.TabIndex = 28;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(142, 309);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(218, 23);
this.footerButton.TabIndex = 30;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(142, 234);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(218, 23);
this.headerButton.TabIndex = 27;
this.headerButton.Text = "Title";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(142, 284);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(218, 23);
this.testItemsButton.TabIndex = 29;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// headerFontLabel
//
this.headerFontLabel.AutoSize = true;
this.headerFontLabel.Location = new System.Drawing.Point(16, 140);
this.headerFontLabel.Name = "headerFontLabel";
this.headerFontLabel.Size = new System.Drawing.Size(112, 13);
this.headerFontLabel.TabIndex = 14;
this.headerFontLabel.Text = "Header font/size/style";
//
// titleFontLabel
//
this.titleFontLabel.AutoSize = true;
this.titleFontLabel.Location = new System.Drawing.Point(16, 116);
this.titleFontLabel.Name = "titleFontLabel";
this.titleFontLabel.Size = new System.Drawing.Size(97, 13);
this.titleFontLabel.TabIndex = 9;
this.titleFontLabel.Text = "Title font/size/style";
//
// titleFontFamilyComboBox
//
this.titleFontFamilyComboBox.Enabled = false;
this.titleFontFamilyComboBox.FormattingEnabled = true;
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 113);
this.titleFontFamilyComboBox.Name = "titleFontFamilyComboBox";
this.titleFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.titleFontFamilyComboBox.TabIndex = 10;
//
// headerFontFamilyComboBox
//
this.headerFontFamilyComboBox.Enabled = false;
this.headerFontFamilyComboBox.FormattingEnabled = true;
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 137);
this.headerFontFamilyComboBox.Name = "headerFontFamilyComboBox";
this.headerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.headerFontFamilyComboBox.TabIndex = 15;
//
// bodyFontFamilyComboBox
//
this.bodyFontFamilyComboBox.Enabled = false;
this.bodyFontFamilyComboBox.FormattingEnabled = true;
this.bodyFontFamilyComboBox.Location = new System.Drawing.Point(142, 161);
this.bodyFontFamilyComboBox.Name = "bodyFontFamilyComboBox";
this.bodyFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.bodyFontFamilyComboBox.TabIndex = 20;
//
// bodyFontLabel
//
this.bodyFontLabel.AutoSize = true;
this.bodyFontLabel.Location = new System.Drawing.Point(16, 164);
this.bodyFontLabel.Name = "bodyFontLabel";
this.bodyFontLabel.Size = new System.Drawing.Size(101, 13);
this.bodyFontLabel.TabIndex = 19;
this.bodyFontLabel.Text = "Body font/size/style";
//
// titleFontSizeTextBox
//
this.titleFontSizeTextBox.Enabled = false;
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 113);
this.titleFontSizeTextBox.Name = "titleFontSizeTextBox";
this.titleFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.titleFontSizeTextBox.TabIndex = 11;
//
// headerFontSizeTextBox
//
this.headerFontSizeTextBox.Enabled = false;
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 137);
this.headerFontSizeTextBox.Name = "headerFontSizeTextBox";
this.headerFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.headerFontSizeTextBox.TabIndex = 16;
//
// bodyFontSizeTextBox
//
this.bodyFontSizeTextBox.Enabled = false;
this.bodyFontSizeTextBox.Location = new System.Drawing.Point(258, 161);
this.bodyFontSizeTextBox.Name = "bodyFontSizeTextBox";
this.bodyFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.bodyFontSizeTextBox.TabIndex = 21;
//
// titleBoldCheckBox
//
this.titleBoldCheckBox.AutoSize = true;
this.titleBoldCheckBox.Enabled = false;
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 116);
this.titleBoldCheckBox.Name = "titleBoldCheckBox";
this.titleBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleBoldCheckBox.TabIndex = 12;
this.titleBoldCheckBox.UseVisualStyleBackColor = true;
//
// titleItalicCheckBox
//
this.titleItalicCheckBox.AutoSize = true;
this.titleItalicCheckBox.Enabled = false;
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 116);
this.titleItalicCheckBox.Name = "titleItalicCheckBox";
this.titleItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleItalicCheckBox.TabIndex = 13;
this.titleItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerItalicCheckBox
//
this.headerItalicCheckBox.AutoSize = true;
this.headerItalicCheckBox.Enabled = false;
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 140);
this.headerItalicCheckBox.Name = "headerItalicCheckBox";
this.headerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerItalicCheckBox.TabIndex = 18;
this.headerItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerBoldCheckBox
//
this.headerBoldCheckBox.AutoSize = true;
this.headerBoldCheckBox.Enabled = false;
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 140);
this.headerBoldCheckBox.Name = "headerBoldCheckBox";
this.headerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerBoldCheckBox.TabIndex = 17;
this.headerBoldCheckBox.UseVisualStyleBackColor = true;
//
// bodyItalicCheckBox
//
this.bodyItalicCheckBox.AutoSize = true;
this.bodyItalicCheckBox.Enabled = false;
this.bodyItalicCheckBox.Location = new System.Drawing.Point(334, 164);
this.bodyItalicCheckBox.Name = "bodyItalicCheckBox";
this.bodyItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyItalicCheckBox.TabIndex = 23;
this.bodyItalicCheckBox.UseVisualStyleBackColor = true;
//
// bodyBoldCheckBox
//
this.bodyBoldCheckBox.AutoSize = true;
this.bodyBoldCheckBox.Enabled = false;
this.bodyBoldCheckBox.Location = new System.Drawing.Point(306, 164);
this.bodyBoldCheckBox.Name = "bodyBoldCheckBox";
this.bodyBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyBoldCheckBox.TabIndex = 22;
this.bodyBoldCheckBox.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(296, 100);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 31;
this.label1.Text = "Bold";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(330, 100);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 32;
this.label2.Text = "Ital.";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.bodyItalicCheckBox);
this.Controls.Add(this.bodyBoldCheckBox);
this.Controls.Add(this.headerItalicCheckBox);
this.Controls.Add(this.headerBoldCheckBox);
this.Controls.Add(this.titleItalicCheckBox);
this.Controls.Add(this.titleBoldCheckBox);
this.Controls.Add(this.bodyFontSizeTextBox);
this.Controls.Add(this.headerFontSizeTextBox);
this.Controls.Add(this.titleFontSizeTextBox);
this.Controls.Add(this.bodyFontFamilyComboBox);
this.Controls.Add(this.bodyFontLabel);
this.Controls.Add(this.headerFontFamilyComboBox);
this.Controls.Add(this.titleFontFamilyComboBox);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.bottomMarginTextBox);
this.Controls.Add(this.titleFontLabel);
this.Controls.Add(this.leftMarginTextBox);
this.Controls.Add(this.headerFontLabel);
this.Controls.Add(this.topMarginTextBox);
this.Controls.Add(this.topMarginLabel);
this.Controls.Add(this.orientationComboBox);
this.Controls.Add(this.orientationLabel);
this.Controls.Add(this.supressPrintingCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "PrinterCfgCtrl";
this.Size = new System.Drawing.Size(400, 350);
this.Load += new System.EventHandler(this.PrinterCfgCtrl_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.supressPrintingCheckBox = new System.Windows.Forms.CheckBox();
this.orientationLabel = new System.Windows.Forms.Label();
this.orientationComboBox = new System.Windows.Forms.ComboBox();
this.topMarginTextBox = new System.Windows.Forms.TextBox();
this.topMarginLabel = new System.Windows.Forms.Label();
this.leftMarginTextBox = new System.Windows.Forms.TextBox();
this.bottomMarginTextBox = new System.Windows.Forms.TextBox();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.commonItemsButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.headerButton = new System.Windows.Forms.Button();
this.testItemsButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.docNameTextBox = new System.Windows.Forms.TextBox();
this.docNameLabel = new System.Windows.Forms.Label();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.footerItalicCheckBox = new System.Windows.Forms.CheckBox();
this.footerBoldCheckBox = new System.Windows.Forms.CheckBox();
this.footerFontSizeTextBox = new System.Windows.Forms.TextBox();
this.footerFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.footerFontLabel = new System.Windows.Forms.Label();
this.bodyItalicCheckBox = new System.Windows.Forms.CheckBox();
this.bodyBoldCheckBox = new System.Windows.Forms.CheckBox();
this.headerItalicCheckBox = new System.Windows.Forms.CheckBox();
this.headerBoldCheckBox = new System.Windows.Forms.CheckBox();
this.titleItalicCheckBox = new System.Windows.Forms.CheckBox();
this.titleBoldCheckBox = new System.Windows.Forms.CheckBox();
this.bodyFontSizeTextBox = new System.Windows.Forms.TextBox();
this.headerFontSizeTextBox = new System.Windows.Forms.TextBox();
this.titleFontSizeTextBox = new System.Windows.Forms.TextBox();
this.bodyFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.bodyFontLabel = new System.Windows.Forms.Label();
this.headerFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.titleFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.titleFontLabel = new System.Windows.Forms.Label();
this.headerFontLabel = new System.Windows.Forms.Label();
this.templateTextBox = new System.Windows.Forms.TextBox();
this.templateLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(142, 39);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(218, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(16, 42);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(139, 16);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// supressPrintingCheckBox
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(19, 259);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 33;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(16, 86);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 5;
this.orientationLabel.Text = "Page orientation";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 83);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(218, 21);
this.orientationComboBox.TabIndex = 6;
//
// topMarginTextBox
//
this.topMarginTextBox.Enabled = false;
this.topMarginTextBox.Location = new System.Drawing.Point(142, 106);
this.topMarginTextBox.Name = "topMarginTextBox";
this.topMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.topMarginTextBox.TabIndex = 8;
//
// topMarginLabel
//
this.topMarginLabel.AutoSize = true;
this.topMarginLabel.Location = new System.Drawing.Point(16, 109);
this.topMarginLabel.Name = "topMarginLabel";
this.topMarginLabel.Size = new System.Drawing.Size(116, 13);
this.topMarginLabel.TabIndex = 7;
this.topMarginLabel.Text = "Top/bottom/left margin";
//
// leftMarginTextBox
//
this.leftMarginTextBox.Enabled = false;
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 106);
this.leftMarginTextBox.Name = "leftMarginTextBox";
this.leftMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.leftMarginTextBox.TabIndex = 10;
//
// bottomMarginTextBox
//
this.bottomMarginTextBox.Enabled = false;
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 106);
this.bottomMarginTextBox.Name = "bottomMarginTextBox";
this.bottomMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.bottomMarginTextBox.TabIndex = 9;
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(142, 215);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(218, 21);
this.cultureComboBox.TabIndex = 32;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(16, 218);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 31;
this.cultureLabel.Text = "Cullture";
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(142, 259);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(218, 23);
this.commonItemsButton.TabIndex = 36;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(142, 303);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(218, 23);
this.footerButton.TabIndex = 38;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(142, 237);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(218, 23);
this.headerButton.TabIndex = 35;
this.headerButton.Text = "Title";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(142, 281);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(218, 23);
this.testItemsButton.TabIndex = 37;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(296, 114);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 41;
this.label1.Text = "Bold";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(330, 114);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 42;
this.label2.Text = "Ital.";
//
// docNameTextBox
//
this.docNameTextBox.Enabled = false;
this.docNameTextBox.Location = new System.Drawing.Point(197, 328);
this.docNameTextBox.Name = "docNameTextBox";
this.docNameTextBox.Size = new System.Drawing.Size(163, 20);
this.docNameTextBox.TabIndex = 40;
//
// docNameLabel
//
this.docNameLabel.AutoSize = true;
this.docNameLabel.Location = new System.Drawing.Point(16, 331);
this.docNameLabel.Name = "docNameLabel";
this.docNameLabel.Size = new System.Drawing.Size(175, 13);
this.docNameLabel.TabIndex = 39;
this.docNameLabel.Text = "Doc.name (0=start 1-end, 2=batch):";
//
// goodOnlyCheckBox
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(19, 281);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 34;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
//
// footerItalicCheckBox
//
this.footerItalicCheckBox.AutoSize = true;
this.footerItalicCheckBox.Enabled = false;
this.footerItalicCheckBox.Location = new System.Drawing.Point(334, 196);
this.footerItalicCheckBox.Name = "footerItalicCheckBox";
this.footerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.footerItalicCheckBox.TabIndex = 30;
this.footerItalicCheckBox.UseVisualStyleBackColor = true;
//
// footerBoldCheckBox
//
this.footerBoldCheckBox.AutoSize = true;
this.footerBoldCheckBox.Enabled = false;
this.footerBoldCheckBox.Location = new System.Drawing.Point(306, 196);
this.footerBoldCheckBox.Name = "footerBoldCheckBox";
this.footerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.footerBoldCheckBox.TabIndex = 29;
this.footerBoldCheckBox.UseVisualStyleBackColor = true;
//
// footerFontSizeTextBox
//
this.footerFontSizeTextBox.Enabled = false;
this.footerFontSizeTextBox.Location = new System.Drawing.Point(258, 193);
this.footerFontSizeTextBox.Name = "footerFontSizeTextBox";
this.footerFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.footerFontSizeTextBox.TabIndex = 28;
//
// footerFontFamilyComboBox
//
this.footerFontFamilyComboBox.Enabled = false;
this.footerFontFamilyComboBox.FormattingEnabled = true;
this.footerFontFamilyComboBox.Location = new System.Drawing.Point(142, 193);
this.footerFontFamilyComboBox.Name = "footerFontFamilyComboBox";
this.footerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.footerFontFamilyComboBox.TabIndex = 27;
//
// footerFontLabel
//
this.footerFontLabel.AutoSize = true;
this.footerFontLabel.Location = new System.Drawing.Point(16, 196);
this.footerFontLabel.Name = "footerFontLabel";
this.footerFontLabel.Size = new System.Drawing.Size(107, 13);
this.footerFontLabel.TabIndex = 26;
this.footerFontLabel.Text = "Footer font/size/style";
//
// bodyItalicCheckBox
//
this.bodyItalicCheckBox.AutoSize = true;
this.bodyItalicCheckBox.Enabled = false;
this.bodyItalicCheckBox.Location = new System.Drawing.Point(334, 174);
this.bodyItalicCheckBox.Name = "bodyItalicCheckBox";
this.bodyItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyItalicCheckBox.TabIndex = 25;
this.bodyItalicCheckBox.UseVisualStyleBackColor = true;
//
// bodyBoldCheckBox
//
this.bodyBoldCheckBox.AutoSize = true;
this.bodyBoldCheckBox.Enabled = false;
this.bodyBoldCheckBox.Location = new System.Drawing.Point(306, 174);
this.bodyBoldCheckBox.Name = "bodyBoldCheckBox";
this.bodyBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyBoldCheckBox.TabIndex = 24;
this.bodyBoldCheckBox.UseVisualStyleBackColor = true;
//
// headerItalicCheckBox
//
this.headerItalicCheckBox.AutoSize = true;
this.headerItalicCheckBox.Enabled = false;
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 152);
this.headerItalicCheckBox.Name = "headerItalicCheckBox";
this.headerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerItalicCheckBox.TabIndex = 20;
this.headerItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerBoldCheckBox
//
this.headerBoldCheckBox.AutoSize = true;
this.headerBoldCheckBox.Enabled = false;
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 152);
this.headerBoldCheckBox.Name = "headerBoldCheckBox";
this.headerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerBoldCheckBox.TabIndex = 19;
this.headerBoldCheckBox.UseVisualStyleBackColor = true;
//
// titleItalicCheckBox
//
this.titleItalicCheckBox.AutoSize = true;
this.titleItalicCheckBox.Enabled = false;
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 130);
this.titleItalicCheckBox.Name = "titleItalicCheckBox";
this.titleItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleItalicCheckBox.TabIndex = 15;
this.titleItalicCheckBox.UseVisualStyleBackColor = true;
//
// titleBoldCheckBox
//
this.titleBoldCheckBox.AutoSize = true;
this.titleBoldCheckBox.Enabled = false;
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 130);
this.titleBoldCheckBox.Name = "titleBoldCheckBox";
this.titleBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleBoldCheckBox.TabIndex = 14;
this.titleBoldCheckBox.UseVisualStyleBackColor = true;
//
// bodyFontSizeTextBox
//
this.bodyFontSizeTextBox.Enabled = false;
this.bodyFontSizeTextBox.Location = new System.Drawing.Point(258, 171);
this.bodyFontSizeTextBox.Name = "bodyFontSizeTextBox";
this.bodyFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.bodyFontSizeTextBox.TabIndex = 23;
//
// headerFontSizeTextBox
//
this.headerFontSizeTextBox.Enabled = false;
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 149);
this.headerFontSizeTextBox.Name = "headerFontSizeTextBox";
this.headerFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.headerFontSizeTextBox.TabIndex = 18;
//
// titleFontSizeTextBox
//
this.titleFontSizeTextBox.Enabled = false;
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 127);
this.titleFontSizeTextBox.Name = "titleFontSizeTextBox";
this.titleFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.titleFontSizeTextBox.TabIndex = 13;
//
// bodyFontFamilyComboBox
//
this.bodyFontFamilyComboBox.Enabled = false;
this.bodyFontFamilyComboBox.FormattingEnabled = true;
this.bodyFontFamilyComboBox.Location = new System.Drawing.Point(142, 171);
this.bodyFontFamilyComboBox.Name = "bodyFontFamilyComboBox";
this.bodyFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.bodyFontFamilyComboBox.TabIndex = 22;
//
// bodyFontLabel
//
this.bodyFontLabel.AutoSize = true;
this.bodyFontLabel.Location = new System.Drawing.Point(16, 174);
this.bodyFontLabel.Name = "bodyFontLabel";
this.bodyFontLabel.Size = new System.Drawing.Size(101, 13);
this.bodyFontLabel.TabIndex = 21;
this.bodyFontLabel.Text = "Body font/size/style";
//
// headerFontFamilyComboBox
//
this.headerFontFamilyComboBox.Enabled = false;
this.headerFontFamilyComboBox.FormattingEnabled = true;
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 149);
this.headerFontFamilyComboBox.Name = "headerFontFamilyComboBox";
this.headerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.headerFontFamilyComboBox.TabIndex = 17;
//
// titleFontFamilyComboBox
//
this.titleFontFamilyComboBox.Enabled = false;
this.titleFontFamilyComboBox.FormattingEnabled = true;
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 127);
this.titleFontFamilyComboBox.Name = "titleFontFamilyComboBox";
this.titleFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.titleFontFamilyComboBox.TabIndex = 12;
//
// titleFontLabel
//
this.titleFontLabel.AutoSize = true;
this.titleFontLabel.Location = new System.Drawing.Point(16, 130);
this.titleFontLabel.Name = "titleFontLabel";
this.titleFontLabel.Size = new System.Drawing.Size(97, 13);
this.titleFontLabel.TabIndex = 11;
this.titleFontLabel.Text = "Title font/size/style";
//
// headerFontLabel
//
this.headerFontLabel.AutoSize = true;
this.headerFontLabel.Location = new System.Drawing.Point(16, 152);
this.headerFontLabel.Name = "headerFontLabel";
this.headerFontLabel.Size = new System.Drawing.Size(112, 13);
this.headerFontLabel.TabIndex = 16;
this.headerFontLabel.Text = "Header font/size/style";
//
// templateTextBox
//
this.templateTextBox.Enabled = false;
this.templateTextBox.Location = new System.Drawing.Point(142, 61);
this.templateTextBox.Name = "templateTextBox";
this.templateTextBox.Size = new System.Drawing.Size(218, 20);
this.templateTextBox.TabIndex = 4;
//
// templateLabel
//
this.templateLabel.AutoSize = true;
this.templateLabel.Location = new System.Drawing.Point(16, 64);
this.templateLabel.Name = "templateLabel";
this.templateLabel.Size = new System.Drawing.Size(51, 13);
this.templateLabel.TabIndex = 3;
this.templateLabel.Text = "Template";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.templateTextBox);
this.Controls.Add(this.templateLabel);
this.Controls.Add(this.footerItalicCheckBox);
this.Controls.Add(this.footerBoldCheckBox);
this.Controls.Add(this.footerFontSizeTextBox);
this.Controls.Add(this.footerFontFamilyComboBox);
this.Controls.Add(this.footerFontLabel);
this.Controls.Add(this.bodyItalicCheckBox);
this.Controls.Add(this.bodyBoldCheckBox);
this.Controls.Add(this.headerItalicCheckBox);
this.Controls.Add(this.headerBoldCheckBox);
this.Controls.Add(this.titleItalicCheckBox);
this.Controls.Add(this.titleBoldCheckBox);
this.Controls.Add(this.bodyFontSizeTextBox);
this.Controls.Add(this.headerFontSizeTextBox);
this.Controls.Add(this.titleFontSizeTextBox);
this.Controls.Add(this.bodyFontFamilyComboBox);
this.Controls.Add(this.bodyFontLabel);
this.Controls.Add(this.headerFontFamilyComboBox);
this.Controls.Add(this.titleFontFamilyComboBox);
this.Controls.Add(this.titleFontLabel);
this.Controls.Add(this.headerFontLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.docNameTextBox);
this.Controls.Add(this.docNameLabel);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.bottomMarginTextBox);
this.Controls.Add(this.leftMarginTextBox);
this.Controls.Add(this.topMarginTextBox);
this.Controls.Add(this.topMarginLabel);
this.Controls.Add(this.orientationComboBox);
this.Controls.Add(this.orientationLabel);
this.Controls.Add(this.supressPrintingCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "PrinterCfgCtrl";
this.Size = new System.Drawing.Size(400, 350);
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@ -436,23 +547,33 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
private System.Windows.Forms.Button commonItemsButton;
private System.Windows.Forms.Button footerButton;
private System.Windows.Forms.Button headerButton;
private System.Windows.Forms.Button testItemsButton;
private System.Windows.Forms.Label headerFontLabel;
private System.Windows.Forms.Label titleFontLabel;
private System.Windows.Forms.ComboBox titleFontFamilyComboBox;
private System.Windows.Forms.ComboBox headerFontFamilyComboBox;
private System.Windows.Forms.ComboBox bodyFontFamilyComboBox;
private System.Windows.Forms.Label bodyFontLabel;
private System.Windows.Forms.TextBox titleFontSizeTextBox;
private System.Windows.Forms.TextBox headerFontSizeTextBox;
private System.Windows.Forms.TextBox bodyFontSizeTextBox;
private System.Windows.Forms.CheckBox titleBoldCheckBox;
private System.Windows.Forms.CheckBox titleItalicCheckBox;
private System.Windows.Forms.CheckBox headerItalicCheckBox;
private System.Windows.Forms.CheckBox headerBoldCheckBox;
private System.Windows.Forms.CheckBox bodyItalicCheckBox;
private System.Windows.Forms.CheckBox bodyBoldCheckBox;
private System.Windows.Forms.Button testItemsButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox docNameTextBox;
private System.Windows.Forms.Label docNameLabel;
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
private System.Windows.Forms.CheckBox footerItalicCheckBox;
private System.Windows.Forms.CheckBox footerBoldCheckBox;
private System.Windows.Forms.TextBox footerFontSizeTextBox;
private System.Windows.Forms.ComboBox footerFontFamilyComboBox;
private System.Windows.Forms.Label footerFontLabel;
private System.Windows.Forms.CheckBox bodyItalicCheckBox;
private System.Windows.Forms.CheckBox bodyBoldCheckBox;
private System.Windows.Forms.CheckBox headerItalicCheckBox;
private System.Windows.Forms.CheckBox headerBoldCheckBox;
private System.Windows.Forms.CheckBox titleItalicCheckBox;
private System.Windows.Forms.CheckBox titleBoldCheckBox;
private System.Windows.Forms.TextBox bodyFontSizeTextBox;
private System.Windows.Forms.TextBox headerFontSizeTextBox;
private System.Windows.Forms.TextBox titleFontSizeTextBox;
private System.Windows.Forms.ComboBox bodyFontFamilyComboBox;
private System.Windows.Forms.Label bodyFontLabel;
private System.Windows.Forms.ComboBox headerFontFamilyComboBox;
private System.Windows.Forms.ComboBox titleFontFamilyComboBox;
private System.Windows.Forms.Label titleFontLabel;
private System.Windows.Forms.Label headerFontLabel;
private System.Windows.Forms.TextBox templateTextBox;
private System.Windows.Forms.Label templateLabel;
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -8,10 +8,11 @@ using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
using TBF.BenchControl.Configs;
namespace TBF.BenchControl.Output.Printers.Enhanced
{
public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl
public partial class PrinterCfgCtrl : ConfigCtrlUtils, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
@ -46,7 +47,8 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
titleFontFamilyComboBox.Items.Add(ff.Name);
headerFontFamilyComboBox.Items.Add(ff.Name);
bodyFontFamilyComboBox.Items.Add(ff.Name);
}
footerFontFamilyComboBox.Items.Add(ff.Name);
}
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
@ -75,19 +77,13 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
{
}
PageOrientation GetOrientation(string str)
{
if (str.Equals(PageOrientation.Landscape.ToString())) return PageOrientation.Landscape;
if (str.Equals(PageOrientation.Portrait.ToString())) return PageOrientation.Portrait;
return (PageOrientation)(-1);
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
orientationComboBox.Text = config.PageOrientation.ToString();
templateTextBox.Text = config.Template;
orientationComboBox.Text = config.PageOrientation.ToString();
topMarginTextBox.Text = config.TopMargin.ToString();
bottomMarginTextBox.Text = config.BottomMargin.ToString();
leftMarginTextBox.Text = config.LeftMargin.ToString();
@ -107,14 +103,23 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
bodyBoldCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
bodyItalicCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
footerFontFamilyComboBox.Text = config.FooterFntFml;
footerFontSizeTextBox.Text = config.FooterFntSz.ToString();
footerBoldCheckBox.Checked = ((config.FooterFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
footerItalicCheckBox.Checked = ((config.FooterFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
supressPrintingCheckBox.Checked = config.SupressPrinting;
cultureComboBox.Text = config.Culture.ToString();
}
goodOnlyCheckBox.Checked = config.GoodOnly;
cultureComboBox.Text = config.Culture.ToString();
docNameTextBox.Text = config.DocName;
}
public void Unlock()
{
nameTextBox.Enabled = true;
orientationComboBox.Enabled = true;
templateTextBox.Enabled = true;
orientationComboBox.Enabled = true;
topMarginTextBox.Enabled = true;
bottomMarginTextBox.Enabled = true;
leftMarginTextBox.Enabled = true;
@ -130,13 +135,19 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
bodyFontSizeTextBox.Enabled = true;
bodyBoldCheckBox.Enabled = true;
bodyItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
cultureComboBox.Enabled = true;
footerFontFamilyComboBox.Enabled = true;
footerFontSizeTextBox.Enabled = true;
footerBoldCheckBox.Enabled = true;
footerItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
goodOnlyCheckBox.Enabled = true;
cultureComboBox.Enabled = true;
headerButton.Enabled = true;
commonItemsButton.Enabled = true;
testItemsButton.Enabled = true;
footerButton.Enabled = true;
}
docNameTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
@ -185,6 +196,12 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(footerFontSizeTextBox.Text, out dummy) || dummy < 4 || dummy > 48)
{
message += Environment.NewLine + "Footer font size' should be between 4 and 48";
flags |= CfgUpdateFlags.Error;
}
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
@ -212,117 +229,6 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
int tmp = int.Parse(topMarginTextBox.Text);
if (config.TopMargin != tmp)
{
config.TopMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bottomMarginTextBox.Text);
if (config.BottomMargin != tmp)
{
config.BottomMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(leftMarginTextBox.Text);
if (config.LeftMargin != tmp)
{
config.LeftMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Title font properties
if (config.TitFntFml != titleFontFamilyComboBox.Text)
{
config.TitFntFml = titleFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(titleFontSizeTextBox.Text);
if (config.TitFntSz != tmp)
{
config.TitFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.TitFntSty != tmp)
{
config.TitFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Header font properties
if (config.HdrFntFml != headerFontFamilyComboBox.Text)
{
config.HdrFntFml = headerFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(headerFontSizeTextBox.Text);
if (config.HdrFntSz != tmp)
{
config.HdrFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.HdrFntSty != tmp)
{
config.HdrFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Body font properties
if (config.BodyFntFml != bodyFontFamilyComboBox.Text)
{
config.BodyFntFml = bodyFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bodyFontSizeTextBox.Text);
if (config.BodyFntSz != tmp)
{
config.BodyFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.BodyFntSty != tmp)
{
config.BodyFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SupressPrinting != supressPrintingCheckBox.Checked)
{
config.SupressPrinting = supressPrintingCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.CommonItems != commonItems)
{
config.CommonItems = commonItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SelectedItems != testItems)
{
config.SelectedItems = testItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header)
{
config.Header = header;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Footer != footer)
{
config.Footer = footer;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
for (Culture i = 0; i < Culture.Count; i++)
{
if (i.ToString().Equals(cultureComboBox.Text) && (config.Culture != i))
@ -333,6 +239,50 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
}
}
flags |= UpdateDifferent(ref config.Template, templateTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TopMargin, topMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.BottomMargin, bottomMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.LeftMargin, leftMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Title font properties
flags |= UpdateDifferent(ref config.TitFntFml, titleFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TitFntSz, titleFontSizeTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
int tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.TitFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Header font properties
flags |= UpdateDifferent(ref config.HdrFntFml, headerFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.HdrFntSz, headerFontSizeTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.HdrFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Body font properties
flags |= UpdateDifferent(ref config.BodyFntFml, bodyFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.BodyFntSz, int.Parse(bodyFontSizeTextBox.Text), CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.BodyFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Footer font properties
flags |= UpdateDifferent(ref config.FooterFntFml, footerFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.FooterFntSz, int.Parse(footerFontSizeTextBox.Text), CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (footerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (footerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.FooterFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.SupressPrinting, supressPrintingCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.GoodOnly, goodOnlyCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.Header, header, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.CommonItems, commonItems, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.SelectedItems, testItems, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.Footer, footer, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -13,7 +13,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
public override string ToString() { return string.Format("ResultsPrinters.Basic({0})", Cfg.ToString(1)); }
public override string ToString() { return string.Format("Output.Printers.OnePerMeter({0})", Cfg.ToString(1)); }
readonly PrinterCfg printerCfg;
@ -72,6 +72,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
if (args.Command == CfgChangeCmd.CfgChange)
{
printerCfg.PageOrientation = newCfg.PageOrientation;
printerCfg.Template = newCfg.Template;
printerCfg.TopMargin = newCfg.TopMargin;
printerCfg.BottomMargin = newCfg.BottomMargin;
printerCfg.LeftMargin = newCfg.LeftMargin;
@ -85,6 +86,9 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
printerCfg.BodyFntFml = newCfg.BodyFntFml;
printerCfg.BodyFntSz = newCfg.BodyFntSz;
printerCfg.BodyFntSty = newCfg.BodyFntSty;
printerCfg.FooterFntFml = newCfg.FooterFntFml;
printerCfg.FooterFntSz = newCfg.FooterFntSz;
printerCfg.FooterFntSty = newCfg.FooterFntSty;
printerCfg.GoodOnly = newCfg.GoodOnly;
printerCfg.SupressPrinting = newCfg.SupressPrinting;
@ -96,6 +100,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
printerCfg.Footer = newCfg.Footer;
printerCfg.TestsAreRows = newCfg.TestsAreRows;
printerCfg.TestsAreRows2 = newCfg.TestsAreRows2;
printerCfg.DocName = newCfg.DocName;
ApplyConfig();
}
@ -131,7 +136,18 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
{
if (!printerCfg.GoodOnly || wm.Passed)
{
PrintResults(batch, wm);
string documentName;
try
{
if (string.IsNullOrEmpty(printerCfg.DocName)) throw (new Exception());
documentName = string.Format(printerCfg.DocName, wm.StartTime(), wm.EndTime(), wm.BatchNr(), wm.WMPosition, wm.SerialNr);
}
catch
{
documentName = string.Format("{0}-{1}", batch.BatchNr, wm.WMPosition);
}
PrintResults(batch, wm, documentName);
}
}
@ -151,24 +167,28 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
}
void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm)
void PrintResults(Results.Entities.Batch batch, Results.Entities.WaterMeter wm, string documentName)
{
if (batch.WaterMeters.Count > 0)
{
OnePerMeterPrinterCfg cfg = new OnePerMeterPrinterCfg {
PageOrientation = printerCfg.PageOrientation,
Template = printerCfg.Template,
TopMargin = printerCfg.TopMargin,
BottomMargin = printerCfg.BottomMargin,
LeftMargin = printerCfg.LeftMargin,
TitFntFml = printerCfg.TitFntFml,
HdrFntFml = printerCfg.HdrFntFml,
BodyFntFml = printerCfg.BodyFntFml,
TitFntSz = printerCfg.TitFntSz,
HdrFntSz = printerCfg.HdrFntSz,
BodyFntSz = printerCfg.BodyFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntFml = printerCfg.HdrFntFml,
HdrFntSz = printerCfg.HdrFntSz,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntFml = printerCfg.BodyFntFml,
BodyFntSz = printerCfg.BodyFntSz,
BodyFntSty = printerCfg.BodyFntSty,
FooterFntFml = printerCfg.FooterFntFml,
FooterFntSz = printerCfg.FooterFntSz,
FooterFntSty = printerCfg.FooterFntSty,
GoodOnly = printerCfg.GoodOnly,
SupressPrinting = printerCfg.SupressPrinting,
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
@ -181,7 +201,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
TestsAreRows2 = printerCfg.TestsAreRows2,
};
new Results.Output.Printers.OnePerMeter.OnePerMeterPrintDocument(batch, cfg, wm).Print();
new Results.Output.Printers.OnePerMeter.OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print();
}
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System.Xml.Serialization;
using Config.Entities;
@ -18,18 +18,22 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
/// Serialized parameters
///
public PageOrientation PageOrientation;
public string Template;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public string HdrFntFml;
public string BodyFntFml;
public int TitFntSz;
public string FooterFntFml;
public int TitFntSz;
public int HdrFntSz;
public int BodyFntSz;
public int TitFntSty;
public int FooterFntSz;
public int TitFntSty;
public int HdrFntSty;
public int BodyFntSty;
public int FooterFntSty;
public bool GoodOnly;
public bool SupressPrinting; /// Bypass printing when true
public Culture Culture;
@ -40,6 +44,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
public string Footer;
public bool TestsAreRows; /// true = Tests are rows
public bool TestsAreRows2; /// true = Tests are rows
public string DocName;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
@ -57,23 +62,28 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
MetersKind = metersKind;
ParentName = string.Empty;
PageOrientation = PageOrientation.Portrait;
Template = string.Empty;
PageOrientation = PageOrientation.Portrait;
TopMargin = 100;
BottomMargin = 100;
LeftMargin = 100;
TitFntFml = "Arial";
TitFntSz = 18;
TitFntSty = 1;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
HdrFntFml = "Arial";
HdrFntSz = 10;
HdrFntSty = 0;
BodyFntFml = "Arial";
BodyFntSz = 10;
BodyFntSty = 0;
FooterFntFml = "Arial";
FooterFntSz = 10;
FooterFntSty = 0;
GoodOnly = false;
SupressPrinting = false;
Header = string.Empty;
Footer = string.Empty;
DocName = string.Empty;
}
public string ToString(int i)

View File

@ -68,12 +68,21 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.tests2AreRowsCheckBox = new System.Windows.Forms.CheckBox();
this.testItems2Button = new System.Windows.Forms.Button();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.templateTextBox = new System.Windows.Forms.TextBox();
this.templateLabel = new System.Windows.Forms.Label();
this.docNameLabel = new System.Windows.Forms.Label();
this.docNameTextBox = new System.Windows.Forms.TextBox();
this.footerItalicCheckBox = new System.Windows.Forms.CheckBox();
this.footerBoldCheckBox = new System.Windows.Forms.CheckBox();
this.footerFontSizeTextBox = new System.Windows.Forms.TextBox();
this.footerFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.footerFontLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(142, 30);
this.nameTextBox.Location = new System.Drawing.Point(142, 24);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(218, 20);
this.nameTextBox.TabIndex = 2;
@ -81,7 +90,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(16, 33);
this.nameLabel.Location = new System.Drawing.Point(16, 27);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
@ -100,89 +109,89 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(143, 178);
this.supressPrintingCheckBox.Location = new System.Drawing.Point(19, 230);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 24;
this.supressPrintingCheckBox.TabIndex = 33;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(16, 57);
this.orientationLabel.Location = new System.Drawing.Point(16, 69);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 3;
this.orientationLabel.TabIndex = 5;
this.orientationLabel.Text = "Page orientation";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 54);
this.orientationComboBox.Location = new System.Drawing.Point(142, 66);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(218, 21);
this.orientationComboBox.TabIndex = 4;
this.orientationComboBox.TabIndex = 6;
//
// topMarginTextBox
//
this.topMarginTextBox.Enabled = false;
this.topMarginTextBox.Location = new System.Drawing.Point(142, 79);
this.topMarginTextBox.Location = new System.Drawing.Point(142, 88);
this.topMarginTextBox.Name = "topMarginTextBox";
this.topMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.topMarginTextBox.TabIndex = 6;
this.topMarginTextBox.TabIndex = 8;
//
// topMarginLabel
//
this.topMarginLabel.AutoSize = true;
this.topMarginLabel.Location = new System.Drawing.Point(16, 82);
this.topMarginLabel.Location = new System.Drawing.Point(16, 90);
this.topMarginLabel.Name = "topMarginLabel";
this.topMarginLabel.Size = new System.Drawing.Size(116, 13);
this.topMarginLabel.TabIndex = 5;
this.topMarginLabel.TabIndex = 7;
this.topMarginLabel.Text = "Top/bottom/left margin";
//
// leftMarginTextBox
//
this.leftMarginTextBox.Enabled = false;
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 79);
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 88);
this.leftMarginTextBox.Name = "leftMarginTextBox";
this.leftMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.leftMarginTextBox.TabIndex = 8;
this.leftMarginTextBox.TabIndex = 10;
//
// bottomMarginTextBox
//
this.bottomMarginTextBox.Enabled = false;
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 79);
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 88);
this.bottomMarginTextBox.Name = "bottomMarginTextBox";
this.bottomMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.bottomMarginTextBox.TabIndex = 7;
this.bottomMarginTextBox.TabIndex = 9;
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(142, 198);
this.cultureComboBox.Location = new System.Drawing.Point(142, 194);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(218, 21);
this.cultureComboBox.TabIndex = 26;
this.cultureComboBox.TabIndex = 32;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(16, 201);
this.cultureLabel.Location = new System.Drawing.Point(16, 199);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 25;
this.cultureLabel.TabIndex = 31;
this.cultureLabel.Text = "Cullture";
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(142, 246);
this.commonItemsButton.Location = new System.Drawing.Point(142, 238);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(218, 23);
this.commonItemsButton.TabIndex = 28;
this.commonItemsButton.TabIndex = 38;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
@ -190,10 +199,10 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(142, 318);
this.footerButton.Location = new System.Drawing.Point(142, 304);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(218, 23);
this.footerButton.TabIndex = 30;
this.footerButton.TabIndex = 41;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
@ -201,10 +210,10 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(142, 222);
this.headerButton.Location = new System.Drawing.Point(142, 216);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(218, 23);
this.headerButton.TabIndex = 27;
this.headerButton.TabIndex = 37;
this.headerButton.Text = "Title";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
@ -212,10 +221,10 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(142, 270);
this.testItemsButton.Location = new System.Drawing.Point(142, 260);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(218, 23);
this.testItemsButton.TabIndex = 29;
this.testItemsButton.TabIndex = 39;
this.testItemsButton.Text = "Test items - 1st table";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
@ -223,38 +232,38 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
// headerFontLabel
//
this.headerFontLabel.AutoSize = true;
this.headerFontLabel.Location = new System.Drawing.Point(16, 130);
this.headerFontLabel.Location = new System.Drawing.Point(16, 133);
this.headerFontLabel.Name = "headerFontLabel";
this.headerFontLabel.Size = new System.Drawing.Size(112, 13);
this.headerFontLabel.TabIndex = 14;
this.headerFontLabel.TabIndex = 16;
this.headerFontLabel.Text = "Header font/size/style";
//
// titleFontLabel
//
this.titleFontLabel.AutoSize = true;
this.titleFontLabel.Location = new System.Drawing.Point(16, 106);
this.titleFontLabel.Location = new System.Drawing.Point(16, 112);
this.titleFontLabel.Name = "titleFontLabel";
this.titleFontLabel.Size = new System.Drawing.Size(97, 13);
this.titleFontLabel.TabIndex = 9;
this.titleFontLabel.TabIndex = 11;
this.titleFontLabel.Text = "Title font/size/style";
//
// titleFontFamilyComboBox
//
this.titleFontFamilyComboBox.Enabled = false;
this.titleFontFamilyComboBox.FormattingEnabled = true;
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 103);
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 109);
this.titleFontFamilyComboBox.Name = "titleFontFamilyComboBox";
this.titleFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.titleFontFamilyComboBox.TabIndex = 10;
this.titleFontFamilyComboBox.TabIndex = 12;
//
// headerFontFamilyComboBox
//
this.headerFontFamilyComboBox.Enabled = false;
this.headerFontFamilyComboBox.FormattingEnabled = true;
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 127);
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 130);
this.headerFontFamilyComboBox.Name = "headerFontFamilyComboBox";
this.headerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.headerFontFamilyComboBox.TabIndex = 15;
this.headerFontFamilyComboBox.TabIndex = 17;
//
// bodyFontFamilyComboBox
//
@ -263,7 +272,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.bodyFontFamilyComboBox.Location = new System.Drawing.Point(142, 151);
this.bodyFontFamilyComboBox.Name = "bodyFontFamilyComboBox";
this.bodyFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.bodyFontFamilyComboBox.TabIndex = 20;
this.bodyFontFamilyComboBox.TabIndex = 22;
//
// bodyFontLabel
//
@ -271,24 +280,24 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.bodyFontLabel.Location = new System.Drawing.Point(16, 154);
this.bodyFontLabel.Name = "bodyFontLabel";
this.bodyFontLabel.Size = new System.Drawing.Size(101, 13);
this.bodyFontLabel.TabIndex = 19;
this.bodyFontLabel.TabIndex = 21;
this.bodyFontLabel.Text = "Body font/size/style";
//
// titleFontSizeTextBox
//
this.titleFontSizeTextBox.Enabled = false;
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 103);
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 109);
this.titleFontSizeTextBox.Name = "titleFontSizeTextBox";
this.titleFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.titleFontSizeTextBox.TabIndex = 11;
this.titleFontSizeTextBox.TabIndex = 13;
//
// headerFontSizeTextBox
//
this.headerFontSizeTextBox.Enabled = false;
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 127);
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 130);
this.headerFontSizeTextBox.Name = "headerFontSizeTextBox";
this.headerFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.headerFontSizeTextBox.TabIndex = 16;
this.headerFontSizeTextBox.TabIndex = 18;
//
// bodyFontSizeTextBox
//
@ -296,46 +305,46 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.bodyFontSizeTextBox.Location = new System.Drawing.Point(258, 151);
this.bodyFontSizeTextBox.Name = "bodyFontSizeTextBox";
this.bodyFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.bodyFontSizeTextBox.TabIndex = 21;
this.bodyFontSizeTextBox.TabIndex = 23;
//
// titleBoldCheckBox
//
this.titleBoldCheckBox.AutoSize = true;
this.titleBoldCheckBox.Enabled = false;
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 106);
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 112);
this.titleBoldCheckBox.Name = "titleBoldCheckBox";
this.titleBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleBoldCheckBox.TabIndex = 12;
this.titleBoldCheckBox.TabIndex = 14;
this.titleBoldCheckBox.UseVisualStyleBackColor = true;
//
// titleItalicCheckBox
//
this.titleItalicCheckBox.AutoSize = true;
this.titleItalicCheckBox.Enabled = false;
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 106);
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 112);
this.titleItalicCheckBox.Name = "titleItalicCheckBox";
this.titleItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleItalicCheckBox.TabIndex = 13;
this.titleItalicCheckBox.TabIndex = 15;
this.titleItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerItalicCheckBox
//
this.headerItalicCheckBox.AutoSize = true;
this.headerItalicCheckBox.Enabled = false;
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 130);
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 133);
this.headerItalicCheckBox.Name = "headerItalicCheckBox";
this.headerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerItalicCheckBox.TabIndex = 18;
this.headerItalicCheckBox.TabIndex = 20;
this.headerItalicCheckBox.UseVisualStyleBackColor = true;
//
// headerBoldCheckBox
//
this.headerBoldCheckBox.AutoSize = true;
this.headerBoldCheckBox.Enabled = false;
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 130);
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 133);
this.headerBoldCheckBox.Name = "headerBoldCheckBox";
this.headerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerBoldCheckBox.TabIndex = 17;
this.headerBoldCheckBox.TabIndex = 19;
this.headerBoldCheckBox.UseVisualStyleBackColor = true;
//
// bodyItalicCheckBox
@ -345,7 +354,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.bodyItalicCheckBox.Location = new System.Drawing.Point(334, 154);
this.bodyItalicCheckBox.Name = "bodyItalicCheckBox";
this.bodyItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyItalicCheckBox.TabIndex = 23;
this.bodyItalicCheckBox.TabIndex = 25;
this.bodyItalicCheckBox.UseVisualStyleBackColor = true;
//
// bodyBoldCheckBox
@ -355,37 +364,37 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
this.bodyBoldCheckBox.Location = new System.Drawing.Point(306, 154);
this.bodyBoldCheckBox.Name = "bodyBoldCheckBox";
this.bodyBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyBoldCheckBox.TabIndex = 22;
this.bodyBoldCheckBox.TabIndex = 24;
this.bodyBoldCheckBox.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(296, 90);
this.label1.Location = new System.Drawing.Point(296, 96);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 31;
this.label1.TabIndex = 37;
this.label1.Text = "Bold";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(330, 90);
this.label2.Location = new System.Drawing.Point(330, 96);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 32;
this.label2.TabIndex = 38;
this.label2.Text = "Ital.";
//
// testsAreRowsCheckBox
//
this.testsAreRowsCheckBox.AutoSize = true;
this.testsAreRowsCheckBox.Enabled = false;
this.testsAreRowsCheckBox.Location = new System.Drawing.Point(19, 274);
this.testsAreRowsCheckBox.Location = new System.Drawing.Point(19, 266);
this.testsAreRowsCheckBox.Name = "testsAreRowsCheckBox";
this.testsAreRowsCheckBox.Size = new System.Drawing.Size(95, 17);
this.testsAreRowsCheckBox.TabIndex = 33;
this.testsAreRowsCheckBox.TabIndex = 35;
this.testsAreRowsCheckBox.Text = "Tests are rows";
this.testsAreRowsCheckBox.UseVisualStyleBackColor = true;
//
@ -393,20 +402,20 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
//
this.tests2AreRowsCheckBox.AutoSize = true;
this.tests2AreRowsCheckBox.Enabled = false;
this.tests2AreRowsCheckBox.Location = new System.Drawing.Point(19, 298);
this.tests2AreRowsCheckBox.Location = new System.Drawing.Point(19, 284);
this.tests2AreRowsCheckBox.Name = "tests2AreRowsCheckBox";
this.tests2AreRowsCheckBox.Size = new System.Drawing.Size(104, 17);
this.tests2AreRowsCheckBox.TabIndex = 35;
this.tests2AreRowsCheckBox.TabIndex = 36;
this.tests2AreRowsCheckBox.Text = "Tests are rows 2";
this.tests2AreRowsCheckBox.UseVisualStyleBackColor = true;
//
// testItems2Button
//
this.testItems2Button.Enabled = false;
this.testItems2Button.Location = new System.Drawing.Point(142, 294);
this.testItems2Button.Location = new System.Drawing.Point(142, 282);
this.testItems2Button.Name = "testItems2Button";
this.testItems2Button.Size = new System.Drawing.Size(218, 23);
this.testItems2Button.TabIndex = 34;
this.testItems2Button.TabIndex = 40;
this.testItems2Button.Text = "Test items - 2nd table";
this.testItems2Button.UseVisualStyleBackColor = true;
this.testItems2Button.Click += new System.EventHandler(this.testItems2Button_Click);
@ -415,17 +424,106 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(19, 250);
this.goodOnlyCheckBox.Location = new System.Drawing.Point(19, 248);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 52;
this.goodOnlyCheckBox.TabIndex = 34;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
//
// templateTextBox
//
this.templateTextBox.Enabled = false;
this.templateTextBox.Location = new System.Drawing.Point(142, 45);
this.templateTextBox.Name = "templateTextBox";
this.templateTextBox.Size = new System.Drawing.Size(218, 20);
this.templateTextBox.TabIndex = 4;
//
// templateLabel
//
this.templateLabel.AutoSize = true;
this.templateLabel.Location = new System.Drawing.Point(16, 48);
this.templateLabel.Name = "templateLabel";
this.templateLabel.Size = new System.Drawing.Size(51, 13);
this.templateLabel.TabIndex = 3;
this.templateLabel.Text = "Template";
//
// docNameLabel
//
this.docNameLabel.AutoSize = true;
this.docNameLabel.Location = new System.Drawing.Point(16, 331);
this.docNameLabel.Name = "docNameLabel";
this.docNameLabel.Size = new System.Drawing.Size(243, 13);
this.docNameLabel.TabIndex = 42;
this.docNameLabel.Text = "Doc.name (0=start 1-end, 2=batch, 3=wm, 4=s/n):";
//
// docNameTextBox
//
this.docNameTextBox.Enabled = false;
this.docNameTextBox.Location = new System.Drawing.Point(258, 328);
this.docNameTextBox.Name = "docNameTextBox";
this.docNameTextBox.Size = new System.Drawing.Size(102, 20);
this.docNameTextBox.TabIndex = 43;
//
// footerItalicCheckBox
//
this.footerItalicCheckBox.AutoSize = true;
this.footerItalicCheckBox.Enabled = false;
this.footerItalicCheckBox.Location = new System.Drawing.Point(334, 175);
this.footerItalicCheckBox.Name = "footerItalicCheckBox";
this.footerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.footerItalicCheckBox.TabIndex = 30;
this.footerItalicCheckBox.UseVisualStyleBackColor = true;
//
// footerBoldCheckBox
//
this.footerBoldCheckBox.AutoSize = true;
this.footerBoldCheckBox.Enabled = false;
this.footerBoldCheckBox.Location = new System.Drawing.Point(306, 175);
this.footerBoldCheckBox.Name = "footerBoldCheckBox";
this.footerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.footerBoldCheckBox.TabIndex = 29;
this.footerBoldCheckBox.UseVisualStyleBackColor = true;
//
// footerFontSizeTextBox
//
this.footerFontSizeTextBox.Enabled = false;
this.footerFontSizeTextBox.Location = new System.Drawing.Point(258, 172);
this.footerFontSizeTextBox.Name = "footerFontSizeTextBox";
this.footerFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.footerFontSizeTextBox.TabIndex = 28;
//
// footerFontFamilyComboBox
//
this.footerFontFamilyComboBox.Enabled = false;
this.footerFontFamilyComboBox.FormattingEnabled = true;
this.footerFontFamilyComboBox.Location = new System.Drawing.Point(142, 172);
this.footerFontFamilyComboBox.Name = "footerFontFamilyComboBox";
this.footerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.footerFontFamilyComboBox.TabIndex = 27;
//
// footerFontLabel
//
this.footerFontLabel.AutoSize = true;
this.footerFontLabel.Location = new System.Drawing.Point(16, 175);
this.footerFontLabel.Name = "footerFontLabel";
this.footerFontLabel.Size = new System.Drawing.Size(107, 13);
this.footerFontLabel.TabIndex = 26;
this.footerFontLabel.Text = "Footer font/size/style";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.footerItalicCheckBox);
this.Controls.Add(this.footerBoldCheckBox);
this.Controls.Add(this.footerFontSizeTextBox);
this.Controls.Add(this.footerFontFamilyComboBox);
this.Controls.Add(this.footerFontLabel);
this.Controls.Add(this.docNameTextBox);
this.Controls.Add(this.docNameLabel);
this.Controls.Add(this.templateTextBox);
this.Controls.Add(this.templateLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.tests2AreRowsCheckBox);
this.Controls.Add(this.testItems2Button);
@ -510,5 +608,14 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
private System.Windows.Forms.CheckBox tests2AreRowsCheckBox;
private System.Windows.Forms.Button testItems2Button;
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
private System.Windows.Forms.TextBox templateTextBox;
private System.Windows.Forms.Label templateLabel;
private System.Windows.Forms.Label docNameLabel;
private System.Windows.Forms.TextBox docNameTextBox;
private System.Windows.Forms.CheckBox footerItalicCheckBox;
private System.Windows.Forms.CheckBox footerBoldCheckBox;
private System.Windows.Forms.TextBox footerFontSizeTextBox;
private System.Windows.Forms.ComboBox footerFontFamilyComboBox;
private System.Windows.Forms.Label footerFontLabel;
}
}

View File

@ -1,17 +1,19 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
using TBF.BenchControl.Configs;
namespace TBF.BenchControl.Output.Printers.OnePerMeter
{
public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl
public partial class PrinterCfgCtrl : ConfigCtrlUtils, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
@ -47,7 +49,8 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
titleFontFamilyComboBox.Items.Add(ff.Name);
headerFontFamilyComboBox.Items.Add(ff.Name);
bodyFontFamilyComboBox.Items.Add(ff.Name);
}
footerFontFamilyComboBox.Items.Add(ff.Name);
}
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
@ -66,6 +69,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
void Localize()
{
nameLabel.Text = Strings.Name;
templateLabel.Text = "Template";
cultureLabel.Text = "Culture";
headerButton.Text = Strings.Header;
commonItemsButton.Text = "Common items";
@ -89,6 +93,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
templateTextBox.Text = config.Template;
orientationComboBox.Text = config.PageOrientation.ToString();
topMarginTextBox.Text = config.TopMargin.ToString();
bottomMarginTextBox.Text = config.BottomMargin.ToString();
@ -109,17 +114,25 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
bodyBoldCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
bodyItalicCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
footerFontFamilyComboBox.Text = config.FooterFntFml;
footerFontSizeTextBox.Text = config.FooterFntSz.ToString();
footerBoldCheckBox.Checked = ((config.FooterFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
footerItalicCheckBox.Checked = ((config.FooterFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
supressPrintingCheckBox.Checked = config.SupressPrinting;
goodOnlyCheckBox.Checked = config.GoodOnly;
testsAreRowsCheckBox.Checked = config.TestsAreRows;
tests2AreRowsCheckBox.Checked = config.TestsAreRows2;
cultureComboBox.Text = config.Culture.ToString();
docNameTextBox.Text = config.DocName;
}
public void Unlock()
{
nameTextBox.Enabled = true;
templateTextBox.Enabled = true;
orientationComboBox.Enabled = true;
topMarginTextBox.Enabled = true;
bottomMarginTextBox.Enabled = true;
@ -136,7 +149,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
bodyFontSizeTextBox.Enabled = true;
bodyBoldCheckBox.Enabled = true;
bodyItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
footerFontFamilyComboBox.Enabled = true;
footerFontSizeTextBox.Enabled = true;
footerBoldCheckBox.Enabled = true;
footerItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
goodOnlyCheckBox.Enabled = true;
cultureComboBox.Enabled = true;
headerButton.Enabled = true;
@ -146,6 +163,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
footerButton.Enabled = true;
testsAreRowsCheckBox.Enabled = true;
tests2AreRowsCheckBox.Enabled = true;
docNameTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@ -195,6 +213,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(footerFontSizeTextBox.Text, out dummy) || dummy < 4 || dummy > 48)
{
message += Environment.NewLine + "Footer font size' should be between 4 and 48";
flags |= CfgUpdateFlags.Error;
}
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
@ -204,17 +228,21 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
return flags;
}
///
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange;
}
flags |= UpdateDifferent(ref config.Template, templateTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if (config.PageOrientation != GetOrientation(orientationComboBox.Text))
{
@ -222,122 +250,48 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
int tmp = int.Parse(topMarginTextBox.Text);
if (config.TopMargin != tmp)
{
config.TopMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bottomMarginTextBox.Text);
if (config.BottomMargin != tmp)
{
config.BottomMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(leftMarginTextBox.Text);
if (config.LeftMargin != tmp)
{
config.LeftMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.TopMargin, topMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.BottomMargin, bottomMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.LeftMargin, leftMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Title font properties
if (config.TitFntFml != titleFontFamilyComboBox.Text)
{
config.TitFntFml = titleFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(titleFontSizeTextBox.Text);
if (config.TitFntSz != tmp)
{
config.TitFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.TitFntSty != tmp)
{
config.TitFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.TitFntFml, titleFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TitFntSz, titleFontSizeTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
int tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.TitFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Header font properties
if (config.HdrFntFml != headerFontFamilyComboBox.Text)
{
config.HdrFntFml = headerFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(headerFontSizeTextBox.Text);
if (config.HdrFntSz != tmp)
{
config.HdrFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.HdrFntSty != tmp)
{
config.HdrFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.HdrFntFml, headerFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.HdrFntSz, headerFontSizeTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.HdrFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Body font properties
if (config.BodyFntFml != bodyFontFamilyComboBox.Text)
{
config.BodyFntFml = bodyFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bodyFontSizeTextBox.Text);
if (config.BodyFntSz != tmp)
{
config.BodyFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.BodyFntSty != tmp)
{
config.BodyFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Body font properties
flags |= UpdateDifferent(ref config.BodyFntFml, bodyFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.BodyFntSz, int.Parse(bodyFontSizeTextBox.Text), CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.BodyFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if (config.SupressPrinting != supressPrintingCheckBox.Checked)
{
config.SupressPrinting = supressPrintingCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Footer font properties
flags |= UpdateDifferent(ref config.FooterFntFml, footerFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.FooterFntSz, int.Parse(footerFontSizeTextBox.Text), CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (footerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (footerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.FooterFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if (config.CommonItems != commonItems)
{
config.CommonItems = commonItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.SupressPrinting, supressPrintingCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.GoodOnly, goodOnlyCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TestsAreRows, testsAreRowsCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TestsAreRows2, tests2AreRowsCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if (config.SelectedItems != testItems)
{
config.SelectedItems = testItems;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SelectedItems2 != testItems2)
{
config.SelectedItems2 = testItems2;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header)
{
config.Header = header;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Footer != footer)
{
config.Footer = footer;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.CommonItems, commonItems, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.SelectedItems, testItems, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.SelectedItems2, testItems2, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.Header, header, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.Footer, footer, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
for (Culture i = 0; i < Culture.Count; i++)
{
@ -349,23 +303,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
}
}
if (config.GoodOnly != goodOnlyCheckBox.Checked)
{
config.GoodOnly = goodOnlyCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.TestsAreRows != testsAreRowsCheckBox.Checked)
{
config.TestsAreRows = testsAreRowsCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.TestsAreRows2 != tests2AreRowsCheckBox.Checked)
{
config.TestsAreRows2 = tests2AreRowsCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -13,7 +13,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
{
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
public override string ToString() { return string.Format("ResultsPrinters.Basic({0})", Cfg.ToString(1)); }
public override string ToString() { return string.Format("Output.Printers.Zapiska({0})", Cfg.ToString(1)); }
readonly PrinterCfg printerCfg;
@ -72,7 +72,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
if (args.Command == CfgChangeCmd.CfgChange)
{
printerCfg.PageOrientation = newCfg.PageOrientation;
printerCfg.TopMargin = newCfg.TopMargin;
printerCfg.Template = newCfg.Template;
printerCfg.TopMargin = newCfg.TopMargin;
printerCfg.BottomMargin = newCfg.BottomMargin;
printerCfg.LeftMargin = newCfg.LeftMargin;
@ -85,9 +86,13 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
printerCfg.BodyFntFml = newCfg.BodyFntFml;
printerCfg.BodyFntSz = newCfg.BodyFntSz;
printerCfg.BodyFntSty = newCfg.BodyFntSty;
printerCfg.FooterFntFml = newCfg.FooterFntFml;
printerCfg.FooterFntSz = newCfg.FooterFntSz;
printerCfg.FooterFntSty = newCfg.FooterFntSty;
printerCfg.SupressPrinting = newCfg.SupressPrinting;
printerCfg.Culture = newCfg.Culture;
printerCfg.GoodOnly = newCfg.GoodOnly;
printerCfg.Culture = newCfg.Culture;
printerCfg.Header = newCfg.Header;
printerCfg.ColW0Pct = newCfg.ColW0Pct;
printerCfg.ColW1Pct = newCfg.ColW1Pct;
@ -104,7 +109,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
printerCfg.BelowItems3 = newCfg.BelowItems3;
printerCfg.Footer = newCfg.Footer;
printerCfg.GoodOnly = newCfg.GoodOnly;
printerCfg.DocName = newCfg.DocName;
ApplyConfig();
}
@ -136,7 +141,18 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
Thread.CurrentThread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
}
PrintResults(batch);
string documentName;
try
{
if (string.IsNullOrEmpty(printerCfg.DocName)) throw (new Exception());
documentName = string.Format(printerCfg.DocName, batch.StartTime, batch.EndTime, batch.BatchNr);
}
catch
{
documentName = string.Format("{0:yyyyMMdd-HHmm}", batch.EndTime);
}
PrintResults(batch, documentName);
Thread.CurrentThread.CurrentCulture = oriCulture;
}
@ -154,25 +170,29 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
}
void PrintResults(Results.Entities.Batch batch)
void PrintResults(Results.Entities.Batch batch, string documentName)
{
if (batch.WaterMeters.Count > 0)
{
ZapiskaPrinterCfg cfg = new ZapiskaPrinterCfg {
PageOrientation = printerCfg.PageOrientation,
TopMargin = printerCfg.TopMargin,
Template = printerCfg.Template,
TopMargin = printerCfg.TopMargin,
BottomMargin = printerCfg.BottomMargin,
LeftMargin = printerCfg.LeftMargin,
TitFntFml = printerCfg.TitFntFml,
HdrFntFml = printerCfg.HdrFntFml,
BodyFntFml = printerCfg.BodyFntFml,
TitFntSz = printerCfg.TitFntSz,
HdrFntSz = printerCfg.HdrFntSz,
BodyFntSz = printerCfg.BodyFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntSty = printerCfg.BodyFntSty,
SupressPrinting = printerCfg.SupressPrinting,
TitFntFml = printerCfg.TitFntFml,
TitFntSz = printerCfg.TitFntSz,
TitFntSty = printerCfg.TitFntSty,
HdrFntFml = printerCfg.HdrFntFml,
HdrFntSz = printerCfg.HdrFntSz,
HdrFntSty = printerCfg.HdrFntSty,
BodyFntFml = printerCfg.BodyFntFml,
BodyFntSz = printerCfg.BodyFntSz,
BodyFntSty = printerCfg.BodyFntSty,
FooterFntFml = printerCfg.FooterFntFml,
FooterFntSz = printerCfg.FooterFntSz,
FooterFntSty = printerCfg.FooterFntSty,
SupressPrinting = printerCfg.SupressPrinting,
GoodOnly = printerCfg.GoodOnly,
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
Header = printerCfg.Header,
@ -192,7 +212,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
Footer = printerCfg.Footer,
};
new Results.Output.Printers.Zapiska.ZapiskaPrintDocument(batch, cfg).Print();
new Results.Output.Printers.Zapiska.ZapiskaPrintDocument(batch, cfg, documentName).Print();
}
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System.Xml.Serialization;
using Config.Entities;
@ -18,19 +18,23 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
/// Serialized parameters
///
public PageOrientation PageOrientation;
public int TopMargin;
public string Template;
public int TopMargin;
public int BottomMargin;
public int LeftMargin;
public string TitFntFml;
public string HdrFntFml;
public string BodyFntFml;
public int TitFntSz;
public string FooterFntFml;
public int TitFntSz;
public int HdrFntSz;
public int BodyFntSz;
public int TitFntSty;
public int FooterFntSz;
public int TitFntSty;
public int HdrFntSty;
public int BodyFntSty;
public bool SupressPrinting; /// Bypass printing when true
public int FooterFntSty;
public bool SupressPrinting; /// Bypass printing when true
public Culture Culture;
public bool GoodOnly;
@ -53,6 +57,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
public string[] BelowItems3;
public string Footer;
public string DocName;
[XmlIgnore]
public Config.Entities.MetersKind MetersKind;
@ -69,7 +74,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
Factory = factory;
MetersKind = metersKind;
ParentName = string.Empty;
Template = string.Empty;
ParentName = string.Empty;
PageOrientation = PageOrientation.Portrait;
TopMargin = 100;
BottomMargin = 100;
@ -77,16 +83,20 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
TitFntFml = "Arial";
TitFntSz = 18;
TitFntSty = 1;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
TitFntFml = "Arial";
TitFntSz = 10;
TitFntSty = 0;
SupressPrinting = false;
HdrFntFml = "Arial";
HdrFntSz = 10;
HdrFntSty = 0;
BodyFntFml = "Arial";
BodyFntSz = 10;
BodyFntSty = 0;
FooterFntFml = "Arial";
FooterFntSz = 10;
FooterFntSty = 0;
SupressPrinting = false;
Header = string.Empty;
Footer = string.Empty;
}
DocName = string.Empty;
}
public string ToString(int i)
{

View File

@ -84,20 +84,29 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
this.belowItems2Button = new System.Windows.Forms.Button();
this.belowItems1Button = new System.Windows.Forms.Button();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.docNameTextBox = new System.Windows.Forms.TextBox();
this.docNameLabel = new System.Windows.Forms.Label();
this.footerItalicCheckBox = new System.Windows.Forms.CheckBox();
this.footerBoldCheckBox = new System.Windows.Forms.CheckBox();
this.footerFontSizeTextBox = new System.Windows.Forms.TextBox();
this.footerFontFamilyComboBox = new System.Windows.Forms.ComboBox();
this.footerFontLabel = new System.Windows.Forms.Label();
this.templateTextBox = new System.Windows.Forms.TextBox();
this.templateLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(142, 40);
this.nameTextBox.Location = new System.Drawing.Point(142, 23);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(205, 20);
this.nameTextBox.Size = new System.Drawing.Size(218, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(16, 43);
this.nameLabel.Location = new System.Drawing.Point(16, 26);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
@ -106,7 +115,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(139, 16);
this.classNameLabel.Location = new System.Drawing.Point(139, 6);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
@ -116,7 +125,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(353, 42);
this.supressPrintingCheckBox.Location = new System.Drawing.Point(16, 220);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 38;
@ -126,7 +135,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(16, 67);
this.orientationLabel.Location = new System.Drawing.Point(16, 68);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 3;
@ -136,7 +145,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(142, 64);
this.orientationComboBox.Location = new System.Drawing.Point(142, 65);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(146, 21);
this.orientationComboBox.TabIndex = 4;
@ -144,7 +153,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// topMarginTextBox
//
this.topMarginTextBox.Enabled = false;
this.topMarginTextBox.Location = new System.Drawing.Point(142, 89);
this.topMarginTextBox.Location = new System.Drawing.Point(142, 87);
this.topMarginTextBox.Name = "topMarginTextBox";
this.topMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.topMarginTextBox.TabIndex = 6;
@ -152,7 +161,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// topMarginLabel
//
this.topMarginLabel.AutoSize = true;
this.topMarginLabel.Location = new System.Drawing.Point(16, 92);
this.topMarginLabel.Location = new System.Drawing.Point(16, 90);
this.topMarginLabel.Name = "topMarginLabel";
this.topMarginLabel.Size = new System.Drawing.Size(116, 13);
this.topMarginLabel.TabIndex = 5;
@ -161,7 +170,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// leftMarginTextBox
//
this.leftMarginTextBox.Enabled = false;
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 89);
this.leftMarginTextBox.Location = new System.Drawing.Point(244, 87);
this.leftMarginTextBox.Name = "leftMarginTextBox";
this.leftMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.leftMarginTextBox.TabIndex = 8;
@ -169,7 +178,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// bottomMarginTextBox
//
this.bottomMarginTextBox.Enabled = false;
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 89);
this.bottomMarginTextBox.Location = new System.Drawing.Point(193, 87);
this.bottomMarginTextBox.Name = "bottomMarginTextBox";
this.bottomMarginTextBox.Size = new System.Drawing.Size(44, 20);
this.bottomMarginTextBox.TabIndex = 7;
@ -178,7 +187,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(142, 185);
this.cultureComboBox.Location = new System.Drawing.Point(142, 196);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(218, 21);
this.cultureComboBox.TabIndex = 26;
@ -186,7 +195,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(16, 188);
this.cultureLabel.Location = new System.Drawing.Point(16, 197);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 25;
@ -195,7 +204,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// commonItems1Button
//
this.commonItems1Button.Enabled = false;
this.commonItems1Button.Location = new System.Drawing.Point(301, 236);
this.commonItems1Button.Location = new System.Drawing.Point(301, 240);
this.commonItems1Button.Name = "commonItems1Button";
this.commonItems1Button.Size = new System.Drawing.Size(47, 23);
this.commonItems1Button.TabIndex = 33;
@ -206,7 +215,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(142, 314);
this.footerButton.Location = new System.Drawing.Point(142, 306);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(312, 23);
this.footerButton.TabIndex = 37;
@ -217,7 +226,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(142, 209);
this.headerButton.Location = new System.Drawing.Point(142, 218);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(312, 23);
this.headerButton.TabIndex = 27;
@ -228,7 +237,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(142, 261);
this.testItemsButton.Location = new System.Drawing.Point(142, 262);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(312, 23);
this.testItemsButton.TabIndex = 36;
@ -239,7 +248,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// headerFontLabel
//
this.headerFontLabel.AutoSize = true;
this.headerFontLabel.Location = new System.Drawing.Point(16, 140);
this.headerFontLabel.Location = new System.Drawing.Point(16, 133);
this.headerFontLabel.Name = "headerFontLabel";
this.headerFontLabel.Size = new System.Drawing.Size(112, 13);
this.headerFontLabel.TabIndex = 14;
@ -248,7 +257,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// titleFontLabel
//
this.titleFontLabel.AutoSize = true;
this.titleFontLabel.Location = new System.Drawing.Point(16, 116);
this.titleFontLabel.Location = new System.Drawing.Point(16, 111);
this.titleFontLabel.Name = "titleFontLabel";
this.titleFontLabel.Size = new System.Drawing.Size(97, 13);
this.titleFontLabel.TabIndex = 9;
@ -258,7 +267,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.titleFontFamilyComboBox.Enabled = false;
this.titleFontFamilyComboBox.FormattingEnabled = true;
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 113);
this.titleFontFamilyComboBox.Location = new System.Drawing.Point(142, 108);
this.titleFontFamilyComboBox.Name = "titleFontFamilyComboBox";
this.titleFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.titleFontFamilyComboBox.TabIndex = 10;
@ -267,7 +276,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.headerFontFamilyComboBox.Enabled = false;
this.headerFontFamilyComboBox.FormattingEnabled = true;
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 137);
this.headerFontFamilyComboBox.Location = new System.Drawing.Point(142, 130);
this.headerFontFamilyComboBox.Name = "headerFontFamilyComboBox";
this.headerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.headerFontFamilyComboBox.TabIndex = 15;
@ -276,7 +285,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.bodyFontFamilyComboBox.Enabled = false;
this.bodyFontFamilyComboBox.FormattingEnabled = true;
this.bodyFontFamilyComboBox.Location = new System.Drawing.Point(142, 161);
this.bodyFontFamilyComboBox.Location = new System.Drawing.Point(142, 152);
this.bodyFontFamilyComboBox.Name = "bodyFontFamilyComboBox";
this.bodyFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.bodyFontFamilyComboBox.TabIndex = 20;
@ -284,7 +293,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// bodyFontLabel
//
this.bodyFontLabel.AutoSize = true;
this.bodyFontLabel.Location = new System.Drawing.Point(16, 164);
this.bodyFontLabel.Location = new System.Drawing.Point(16, 155);
this.bodyFontLabel.Name = "bodyFontLabel";
this.bodyFontLabel.Size = new System.Drawing.Size(101, 13);
this.bodyFontLabel.TabIndex = 19;
@ -293,7 +302,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// titleFontSizeTextBox
//
this.titleFontSizeTextBox.Enabled = false;
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 113);
this.titleFontSizeTextBox.Location = new System.Drawing.Point(258, 108);
this.titleFontSizeTextBox.Name = "titleFontSizeTextBox";
this.titleFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.titleFontSizeTextBox.TabIndex = 11;
@ -301,7 +310,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// headerFontSizeTextBox
//
this.headerFontSizeTextBox.Enabled = false;
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 137);
this.headerFontSizeTextBox.Location = new System.Drawing.Point(258, 130);
this.headerFontSizeTextBox.Name = "headerFontSizeTextBox";
this.headerFontSizeTextBox.Size = new System.Drawing.Size(30, 20);
this.headerFontSizeTextBox.TabIndex = 16;
@ -309,7 +318,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// bodyFontSizeTextBox
//
this.bodyFontSizeTextBox.Enabled = false;
this.bodyFontSizeTextBox.Location = new System.Drawing.Point(258, 161);
this.bodyFontSizeTextBox.Location = new System.Drawing.Point(258, 152);
this.bodyFontSizeTextBox.Name = "bodyFontSizeTextBox";
this.bodyFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.bodyFontSizeTextBox.TabIndex = 21;
@ -318,7 +327,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.titleBoldCheckBox.AutoSize = true;
this.titleBoldCheckBox.Enabled = false;
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 116);
this.titleBoldCheckBox.Location = new System.Drawing.Point(306, 111);
this.titleBoldCheckBox.Name = "titleBoldCheckBox";
this.titleBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleBoldCheckBox.TabIndex = 12;
@ -328,7 +337,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.titleItalicCheckBox.AutoSize = true;
this.titleItalicCheckBox.Enabled = false;
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 116);
this.titleItalicCheckBox.Location = new System.Drawing.Point(334, 111);
this.titleItalicCheckBox.Name = "titleItalicCheckBox";
this.titleItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.titleItalicCheckBox.TabIndex = 13;
@ -338,7 +347,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.headerItalicCheckBox.AutoSize = true;
this.headerItalicCheckBox.Enabled = false;
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 140);
this.headerItalicCheckBox.Location = new System.Drawing.Point(334, 133);
this.headerItalicCheckBox.Name = "headerItalicCheckBox";
this.headerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerItalicCheckBox.TabIndex = 18;
@ -348,7 +357,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.headerBoldCheckBox.AutoSize = true;
this.headerBoldCheckBox.Enabled = false;
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 140);
this.headerBoldCheckBox.Location = new System.Drawing.Point(306, 133);
this.headerBoldCheckBox.Name = "headerBoldCheckBox";
this.headerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.headerBoldCheckBox.TabIndex = 17;
@ -358,7 +367,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.bodyItalicCheckBox.AutoSize = true;
this.bodyItalicCheckBox.Enabled = false;
this.bodyItalicCheckBox.Location = new System.Drawing.Point(334, 164);
this.bodyItalicCheckBox.Location = new System.Drawing.Point(334, 155);
this.bodyItalicCheckBox.Name = "bodyItalicCheckBox";
this.bodyItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyItalicCheckBox.TabIndex = 23;
@ -368,7 +377,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.bodyBoldCheckBox.AutoSize = true;
this.bodyBoldCheckBox.Enabled = false;
this.bodyBoldCheckBox.Location = new System.Drawing.Point(306, 164);
this.bodyBoldCheckBox.Location = new System.Drawing.Point(306, 155);
this.bodyBoldCheckBox.Name = "bodyBoldCheckBox";
this.bodyBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.bodyBoldCheckBox.TabIndex = 22;
@ -378,7 +387,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(296, 100);
this.label1.Location = new System.Drawing.Point(296, 96);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 13);
this.label1.TabIndex = 31;
@ -388,7 +397,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(330, 100);
this.label2.Location = new System.Drawing.Point(330, 96);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 32;
@ -397,7 +406,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// commonItems2Button
//
this.commonItems2Button.Enabled = false;
this.commonItems2Button.Location = new System.Drawing.Point(354, 236);
this.commonItems2Button.Location = new System.Drawing.Point(354, 240);
this.commonItems2Button.Name = "commonItems2Button";
this.commonItems2Button.Size = new System.Drawing.Size(47, 23);
this.commonItems2Button.TabIndex = 34;
@ -408,7 +417,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// commonItems3Button
//
this.commonItems3Button.Enabled = false;
this.commonItems3Button.Location = new System.Drawing.Point(407, 236);
this.commonItems3Button.Location = new System.Drawing.Point(407, 240);
this.commonItems3Button.Name = "commonItems3Button";
this.commonItems3Button.Size = new System.Drawing.Size(47, 23);
this.commonItems3Button.TabIndex = 35;
@ -419,7 +428,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// colW2TextBox
//
this.colW2TextBox.Enabled = false;
this.colW2TextBox.Location = new System.Drawing.Point(245, 237);
this.colW2TextBox.Location = new System.Drawing.Point(245, 241);
this.colW2TextBox.Name = "colW2TextBox";
this.colW2TextBox.Size = new System.Drawing.Size(30, 20);
this.colW2TextBox.TabIndex = 31;
@ -427,7 +436,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// colW1TextBox
//
this.colW1TextBox.Enabled = false;
this.colW1TextBox.Location = new System.Drawing.Point(192, 237);
this.colW1TextBox.Location = new System.Drawing.Point(192, 241);
this.colW1TextBox.Name = "colW1TextBox";
this.colW1TextBox.Size = new System.Drawing.Size(30, 20);
this.colW1TextBox.TabIndex = 29;
@ -435,7 +444,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(222, 240);
this.label3.Location = new System.Drawing.Point(222, 244);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(15, 13);
this.label3.TabIndex = 30;
@ -444,7 +453,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(275, 240);
this.label4.Location = new System.Drawing.Point(275, 244);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(15, 13);
this.label4.TabIndex = 32;
@ -453,7 +462,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(16, 239);
this.label5.Location = new System.Drawing.Point(16, 243);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(97, 13);
this.label5.TabIndex = 28;
@ -462,7 +471,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(172, 240);
this.label6.Location = new System.Drawing.Point(172, 244);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(15, 13);
this.label6.TabIndex = 40;
@ -471,7 +480,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// colW0TextBox
//
this.colW0TextBox.Enabled = false;
this.colW0TextBox.Location = new System.Drawing.Point(142, 237);
this.colW0TextBox.Location = new System.Drawing.Point(142, 241);
this.colW0TextBox.Name = "colW0TextBox";
this.colW0TextBox.Size = new System.Drawing.Size(30, 20);
this.colW0TextBox.TabIndex = 39;
@ -479,7 +488,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(172, 293);
this.label7.Location = new System.Drawing.Point(172, 289);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(15, 13);
this.label7.TabIndex = 50;
@ -488,7 +497,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// belowW0TextBox
//
this.belowW0TextBox.Enabled = false;
this.belowW0TextBox.Location = new System.Drawing.Point(142, 290);
this.belowW0TextBox.Location = new System.Drawing.Point(142, 286);
this.belowW0TextBox.Name = "belowW0TextBox";
this.belowW0TextBox.Size = new System.Drawing.Size(30, 20);
this.belowW0TextBox.TabIndex = 49;
@ -496,7 +505,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(16, 292);
this.label8.Location = new System.Drawing.Point(16, 288);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(97, 13);
this.label8.TabIndex = 41;
@ -505,7 +514,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(275, 293);
this.label9.Location = new System.Drawing.Point(275, 289);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(15, 13);
this.label9.TabIndex = 45;
@ -514,7 +523,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(222, 293);
this.label10.Location = new System.Drawing.Point(222, 289);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(15, 13);
this.label10.TabIndex = 43;
@ -523,7 +532,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// belowW2TextBox
//
this.belowW2TextBox.Enabled = false;
this.belowW2TextBox.Location = new System.Drawing.Point(245, 290);
this.belowW2TextBox.Location = new System.Drawing.Point(245, 286);
this.belowW2TextBox.Name = "belowW2TextBox";
this.belowW2TextBox.Size = new System.Drawing.Size(30, 20);
this.belowW2TextBox.TabIndex = 44;
@ -531,7 +540,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// belowW1TextBox
//
this.belowW1TextBox.Enabled = false;
this.belowW1TextBox.Location = new System.Drawing.Point(192, 290);
this.belowW1TextBox.Location = new System.Drawing.Point(192, 286);
this.belowW1TextBox.Name = "belowW1TextBox";
this.belowW1TextBox.Size = new System.Drawing.Size(30, 20);
this.belowW1TextBox.TabIndex = 42;
@ -539,7 +548,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// belowItems3Button
//
this.belowItems3Button.Enabled = false;
this.belowItems3Button.Location = new System.Drawing.Point(407, 288);
this.belowItems3Button.Location = new System.Drawing.Point(407, 284);
this.belowItems3Button.Name = "belowItems3Button";
this.belowItems3Button.Size = new System.Drawing.Size(47, 23);
this.belowItems3Button.TabIndex = 48;
@ -550,7 +559,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// belowItems2Button
//
this.belowItems2Button.Enabled = false;
this.belowItems2Button.Location = new System.Drawing.Point(354, 288);
this.belowItems2Button.Location = new System.Drawing.Point(354, 284);
this.belowItems2Button.Name = "belowItems2Button";
this.belowItems2Button.Size = new System.Drawing.Size(47, 23);
this.belowItems2Button.TabIndex = 47;
@ -561,7 +570,7 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
// belowItems1Button
//
this.belowItems1Button.Enabled = false;
this.belowItems1Button.Location = new System.Drawing.Point(301, 288);
this.belowItems1Button.Location = new System.Drawing.Point(301, 284);
this.belowItems1Button.Name = "belowItems1Button";
this.belowItems1Button.Size = new System.Drawing.Size(47, 23);
this.belowItems1Button.TabIndex = 46;
@ -573,17 +582,106 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(16, 265);
this.goodOnlyCheckBox.Location = new System.Drawing.Point(16, 266);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 51;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
//
// docNameTextBox
//
this.docNameTextBox.Enabled = false;
this.docNameTextBox.Location = new System.Drawing.Point(197, 329);
this.docNameTextBox.Name = "docNameTextBox";
this.docNameTextBox.Size = new System.Drawing.Size(163, 20);
this.docNameTextBox.TabIndex = 53;
//
// docNameLabel
//
this.docNameLabel.AutoSize = true;
this.docNameLabel.Location = new System.Drawing.Point(16, 332);
this.docNameLabel.Name = "docNameLabel";
this.docNameLabel.Size = new System.Drawing.Size(175, 13);
this.docNameLabel.TabIndex = 52;
this.docNameLabel.Text = "Doc.name (0=start 1-end, 2=batch):";
//
// footerItalicCheckBox
//
this.footerItalicCheckBox.AutoSize = true;
this.footerItalicCheckBox.Enabled = false;
this.footerItalicCheckBox.Location = new System.Drawing.Point(334, 177);
this.footerItalicCheckBox.Name = "footerItalicCheckBox";
this.footerItalicCheckBox.Size = new System.Drawing.Size(15, 14);
this.footerItalicCheckBox.TabIndex = 58;
this.footerItalicCheckBox.UseVisualStyleBackColor = true;
//
// footerBoldCheckBox
//
this.footerBoldCheckBox.AutoSize = true;
this.footerBoldCheckBox.Enabled = false;
this.footerBoldCheckBox.Location = new System.Drawing.Point(306, 177);
this.footerBoldCheckBox.Name = "footerBoldCheckBox";
this.footerBoldCheckBox.Size = new System.Drawing.Size(15, 14);
this.footerBoldCheckBox.TabIndex = 57;
this.footerBoldCheckBox.UseVisualStyleBackColor = true;
//
// footerFontSizeTextBox
//
this.footerFontSizeTextBox.Enabled = false;
this.footerFontSizeTextBox.Location = new System.Drawing.Point(258, 174);
this.footerFontSizeTextBox.Name = "footerFontSizeTextBox";
this.footerFontSizeTextBox.Size = new System.Drawing.Size(29, 20);
this.footerFontSizeTextBox.TabIndex = 56;
//
// footerFontFamilyComboBox
//
this.footerFontFamilyComboBox.Enabled = false;
this.footerFontFamilyComboBox.FormattingEnabled = true;
this.footerFontFamilyComboBox.Location = new System.Drawing.Point(142, 174);
this.footerFontFamilyComboBox.Name = "footerFontFamilyComboBox";
this.footerFontFamilyComboBox.Size = new System.Drawing.Size(110, 21);
this.footerFontFamilyComboBox.TabIndex = 55;
//
// footerFontLabel
//
this.footerFontLabel.AutoSize = true;
this.footerFontLabel.Location = new System.Drawing.Point(16, 177);
this.footerFontLabel.Name = "footerFontLabel";
this.footerFontLabel.Size = new System.Drawing.Size(107, 13);
this.footerFontLabel.TabIndex = 54;
this.footerFontLabel.Text = "Footer font/size/style";
//
// templateTextBox
//
this.templateTextBox.Enabled = false;
this.templateTextBox.Location = new System.Drawing.Point(142, 44);
this.templateTextBox.Name = "templateTextBox";
this.templateTextBox.Size = new System.Drawing.Size(218, 20);
this.templateTextBox.TabIndex = 60;
//
// templateLabel
//
this.templateLabel.AutoSize = true;
this.templateLabel.Location = new System.Drawing.Point(16, 47);
this.templateLabel.Name = "templateLabel";
this.templateLabel.Size = new System.Drawing.Size(51, 13);
this.templateLabel.TabIndex = 59;
this.templateLabel.Text = "Template";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.templateTextBox);
this.Controls.Add(this.templateLabel);
this.Controls.Add(this.footerItalicCheckBox);
this.Controls.Add(this.footerBoldCheckBox);
this.Controls.Add(this.footerFontSizeTextBox);
this.Controls.Add(this.footerFontFamilyComboBox);
this.Controls.Add(this.footerFontLabel);
this.Controls.Add(this.docNameTextBox);
this.Controls.Add(this.docNameLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.label7);
this.Controls.Add(this.belowW0TextBox);
@ -700,5 +798,14 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
private System.Windows.Forms.Button belowItems2Button;
private System.Windows.Forms.Button belowItems1Button;
private System.Windows.Forms.CheckBox goodOnlyCheckBox;
private System.Windows.Forms.TextBox docNameTextBox;
private System.Windows.Forms.Label docNameLabel;
private System.Windows.Forms.CheckBox footerItalicCheckBox;
private System.Windows.Forms.CheckBox footerBoldCheckBox;
private System.Windows.Forms.TextBox footerFontSizeTextBox;
private System.Windows.Forms.ComboBox footerFontFamilyComboBox;
private System.Windows.Forms.Label footerFontLabel;
private System.Windows.Forms.TextBox templateTextBox;
private System.Windows.Forms.Label templateLabel;
}
}

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
/// Copyright (c) 2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -8,10 +8,11 @@ using log4net;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
using TBF.BenchControl.Configs;
namespace TBF.BenchControl.Output.Printers.Zapiska
{
public partial class PrinterCfgCtrl : UserControl, IComponentCfgCtrl
public partial class PrinterCfgCtrl : ConfigCtrlUtils, IComponentCfgCtrl
{
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
@ -51,7 +52,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
titleFontFamilyComboBox.Items.Add(ff.Name);
headerFontFamilyComboBox.Items.Add(ff.Name);
bodyFontFamilyComboBox.Items.Add(ff.Name);
}
footerFontFamilyComboBox.Items.Add(ff.Name);
}
}
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
@ -87,19 +89,13 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
{
}
PageOrientation GetOrientation(string str)
{
if (str.Equals(PageOrientation.Landscape.ToString())) return PageOrientation.Landscape;
if (str.Equals(PageOrientation.Portrait.ToString())) return PageOrientation.Portrait;
return (PageOrientation)(-1);
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
orientationComboBox.Text = config.PageOrientation.ToString();
templateTextBox.Text = config.Template;
orientationComboBox.Text = config.PageOrientation.ToString();
topMarginTextBox.Text = config.TopMargin.ToString();
bottomMarginTextBox.Text = config.BottomMargin.ToString();
leftMarginTextBox.Text = config.LeftMargin.ToString();
@ -119,6 +115,11 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
bodyBoldCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
bodyItalicCheckBox.Checked = ((config.BodyFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
footerFontFamilyComboBox.Text = config.FooterFntFml;
footerFontSizeTextBox.Text = config.FooterFntSz.ToString();
footerBoldCheckBox.Checked = ((config.FooterFntSty & (int)System.Drawing.FontStyle.Bold) != 0);
footerItalicCheckBox.Checked = ((config.FooterFntSty & (int)System.Drawing.FontStyle.Italic) != 0);
colW0TextBox.Text = config.ColW0Pct.ToString();
colW1TextBox.Text = config.ColW1Pct.ToString();
colW2TextBox.Text = config.ColW2Pct.ToString();
@ -130,12 +131,15 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
supressPrintingCheckBox.Checked = config.SupressPrinting;
goodOnlyCheckBox.Checked = config.GoodOnly;
cultureComboBox.Text = config.Culture.ToString();
}
docNameTextBox.Text = config.DocName;
}
public void Unlock()
{
nameTextBox.Enabled = true;
orientationComboBox.Enabled = true;
templateTextBox.Enabled = true;
orientationComboBox.Enabled = true;
topMarginTextBox.Enabled = true;
bottomMarginTextBox.Enabled = true;
leftMarginTextBox.Enabled = true;
@ -151,7 +155,11 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
bodyFontSizeTextBox.Enabled = true;
bodyBoldCheckBox.Enabled = true;
bodyItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
footerFontFamilyComboBox.Enabled = true;
footerFontSizeTextBox.Enabled = true;
footerBoldCheckBox.Enabled = true;
footerItalicCheckBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
goodOnlyCheckBox.Enabled = true;
cultureComboBox.Enabled = true;
headerButton.Enabled = true;
@ -169,7 +177,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
belowItems2Button.Enabled = true;
belowItems3Button.Enabled = true;
footerButton.Enabled = true;
}
docNameTextBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
@ -218,6 +227,12 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
flags |= CfgUpdateFlags.Error;
}
if (!int.TryParse(footerFontSizeTextBox.Text, out dummy) || dummy < 4 || dummy > 48)
{
message += Environment.NewLine + "Footer font size' should be between 4 and 48";
flags |= CfgUpdateFlags.Error;
}
if (!cultureComboBox.Items.Contains(cultureComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
@ -287,104 +302,48 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.Template, templateTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if (config.PageOrientation != GetOrientation(orientationComboBox.Text))
{
config.PageOrientation = GetOrientation(orientationComboBox.Text);
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
int tmp = int.Parse(topMarginTextBox.Text);
if (config.TopMargin != tmp)
{
config.TopMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.TopMargin, topMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.BottomMargin, bottomMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.LeftMargin, leftMarginTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = int.Parse(bottomMarginTextBox.Text);
if (config.BottomMargin != tmp)
{
config.BottomMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Title font properties
flags |= UpdateDifferent(ref config.TitFntFml, titleFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.TitFntSz, titleFontSizeTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
int tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.TitFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = int.Parse(leftMarginTextBox.Text);
if (config.LeftMargin != tmp)
{
config.LeftMargin = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Header font properties
flags |= UpdateDifferent(ref config.HdrFntFml, headerFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.HdrFntSz, headerFontSizeTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.HdrFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Title font properties
if (config.TitFntFml != titleFontFamilyComboBox.Text)
{
config.TitFntFml = titleFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(titleFontSizeTextBox.Text);
if (config.TitFntSz != tmp)
{
config.TitFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (titleBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (titleItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.TitFntSty != tmp)
{
config.TitFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Body font properties
flags |= UpdateDifferent(ref config.BodyFntFml, bodyFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.BodyFntSz, int.Parse(bodyFontSizeTextBox.Text), CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.BodyFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Header font properties
if (config.HdrFntFml != headerFontFamilyComboBox.Text)
{
config.HdrFntFml = headerFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(headerFontSizeTextBox.Text);
if (config.HdrFntSz != tmp)
{
config.HdrFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (headerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (headerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.HdrFntSty != tmp)
{
config.HdrFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
/// Footer font properties
flags |= UpdateDifferent(ref config.FooterFntFml, footerFontFamilyComboBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.FooterFntSz, int.Parse(footerFontSizeTextBox.Text), CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = (footerBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (footerItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
flags |= UpdateDifferent(ref config.FooterFntSty, tmp, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
/// Body font properties
if (config.BodyFntFml != bodyFontFamilyComboBox.Text)
{
config.BodyFntFml = bodyFontFamilyComboBox.Text;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = int.Parse(bodyFontSizeTextBox.Text);
if (config.BodyFntSz != tmp)
{
config.BodyFntSz = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
tmp = (bodyBoldCheckBox.Checked ? (int)System.Drawing.FontStyle.Bold : 0)
+ (bodyItalicCheckBox.Checked ? (int)System.Drawing.FontStyle.Italic : 0);
if (config.BodyFntSty != tmp)
{
config.BodyFntSty = tmp;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.SupressPrinting != supressPrintingCheckBox.Checked)
{
config.SupressPrinting = supressPrintingCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.GoodOnly != goodOnlyCheckBox.Checked)
{
config.GoodOnly = goodOnlyCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
flags |= UpdateDifferent(ref config.SupressPrinting, supressPrintingCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.GoodOnly, goodOnlyCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
tmp = int.Parse(colW0TextBox.Text);
if (config.ColW0Pct != tmp)
@ -423,7 +382,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header) { config.Header = header; flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); }
flags |= UpdateDifferent(ref config.Header, header, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref config.Footer, footer, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if (config.CommonItems1 != commonItems1) { config.CommonItems1 = commonItems1; flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); }
if (config.CommonItems2 != commonItems2) { config.CommonItems2 = commonItems2; flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); }
@ -435,8 +395,6 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
if (config.BelowItems2 != belowItems2) { config.BelowItems2 = belowItems2; flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); }
if (config.BelowItems3 != belowItems3) { config.BelowItems3 = belowItems3; flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); }
if (config.Footer != footer) { config.Footer = footer; flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange); }
for (Culture i = 0; i < Culture.Count; i++)
{
if (i.ToString().Equals(cultureComboBox.Text) && (config.Culture != i))
@ -447,6 +405,8 @@ namespace TBF.BenchControl.Output.Printers.Zapiska
}
}
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));

View File

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

View File

@ -175,6 +175,9 @@
<DependentUpon>ComponentCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\BenchInfo\Polska\ComponentFactory.cs" />
<Compile Include="BenchControl\Configs\ConfigCtrlUtils.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="BenchControl\Configs\NameOnly\TestMethodCfg.cs" />
<Compile Include="BenchControl\Configs\NameOnly\TestMethodCfgCtrl.cs">
<SubType>UserControl</SubType>