Barcode printing in Output.Printers.Enhanced and Output.Printers.OnePerMeter.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -102,6 +102,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
printerCfg.DocName = newCfg.DocName;
|
||||
printerCfg.NrOfCopies = newCfg.NrOfCopies;
|
||||
|
||||
printerCfg.BarcodeType = newCfg.BarcodeType;
|
||||
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
|
||||
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
|
||||
|
||||
ApplyConfig();
|
||||
}
|
||||
}
|
||||
@@ -191,6 +195,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
CommonItems = printerCfg.CommonItems,
|
||||
TestItems = printerCfg.SelectedItems,
|
||||
Footer = printerCfg.Footer,
|
||||
BarcodeType = printerCfg.BarcodeType,
|
||||
BarcodeWidth = printerCfg.BarcodeWidth,
|
||||
BarcodeHeight = printerCfg.BarcodeHeight,
|
||||
};
|
||||
|
||||
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
@@ -44,6 +44,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
public string DocName;
|
||||
public int NrOfCopies;
|
||||
|
||||
public Results.Output.Printers.BarcodeType BarcodeType;
|
||||
public int BarcodeWidth;
|
||||
public int BarcodeHeight;
|
||||
|
||||
[XmlIgnore]
|
||||
public Config.Entities.MetersKind MetersKind;
|
||||
|
||||
|
||||
@@ -76,6 +76,12 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
this.templateLabel = new System.Windows.Forms.Label();
|
||||
this.nrOfCopiesTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nrOfCopiesLabel = new System.Windows.Forms.Label();
|
||||
this.barcodeTypeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.barcodeLabel = new System.Windows.Forms.Label();
|
||||
this.barcodeWidthTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.barcodeHeightTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
@@ -108,7 +114,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
//
|
||||
this.supressPrintingCheckBox.AutoSize = true;
|
||||
this.supressPrintingCheckBox.Enabled = false;
|
||||
this.supressPrintingCheckBox.Location = new System.Drawing.Point(19, 259);
|
||||
this.supressPrintingCheckBox.Location = new System.Drawing.Point(91, 307);
|
||||
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
|
||||
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
|
||||
this.supressPrintingCheckBox.TabIndex = 33;
|
||||
@@ -187,9 +193,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
// commonItemsButton
|
||||
//
|
||||
this.commonItemsButton.Enabled = false;
|
||||
this.commonItemsButton.Location = new System.Drawing.Point(142, 259);
|
||||
this.commonItemsButton.Location = new System.Drawing.Point(193, 259);
|
||||
this.commonItemsButton.Name = "commonItemsButton";
|
||||
this.commonItemsButton.Size = new System.Drawing.Size(218, 23);
|
||||
this.commonItemsButton.Size = new System.Drawing.Size(167, 23);
|
||||
this.commonItemsButton.TabIndex = 36;
|
||||
this.commonItemsButton.Text = "Common items";
|
||||
this.commonItemsButton.UseVisualStyleBackColor = true;
|
||||
@@ -198,9 +204,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
// footerButton
|
||||
//
|
||||
this.footerButton.Enabled = false;
|
||||
this.footerButton.Location = new System.Drawing.Point(142, 303);
|
||||
this.footerButton.Location = new System.Drawing.Point(193, 303);
|
||||
this.footerButton.Name = "footerButton";
|
||||
this.footerButton.Size = new System.Drawing.Size(218, 23);
|
||||
this.footerButton.Size = new System.Drawing.Size(167, 23);
|
||||
this.footerButton.TabIndex = 38;
|
||||
this.footerButton.Text = "Footer";
|
||||
this.footerButton.UseVisualStyleBackColor = true;
|
||||
@@ -209,9 +215,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
// headerButton
|
||||
//
|
||||
this.headerButton.Enabled = false;
|
||||
this.headerButton.Location = new System.Drawing.Point(142, 237);
|
||||
this.headerButton.Location = new System.Drawing.Point(193, 237);
|
||||
this.headerButton.Name = "headerButton";
|
||||
this.headerButton.Size = new System.Drawing.Size(218, 23);
|
||||
this.headerButton.Size = new System.Drawing.Size(167, 23);
|
||||
this.headerButton.TabIndex = 35;
|
||||
this.headerButton.Text = "Title";
|
||||
this.headerButton.UseVisualStyleBackColor = true;
|
||||
@@ -220,9 +226,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
// testItemsButton
|
||||
//
|
||||
this.testItemsButton.Enabled = false;
|
||||
this.testItemsButton.Location = new System.Drawing.Point(142, 281);
|
||||
this.testItemsButton.Location = new System.Drawing.Point(193, 281);
|
||||
this.testItemsButton.Name = "testItemsButton";
|
||||
this.testItemsButton.Size = new System.Drawing.Size(218, 23);
|
||||
this.testItemsButton.Size = new System.Drawing.Size(167, 23);
|
||||
this.testItemsButton.TabIndex = 37;
|
||||
this.testItemsButton.Text = "Test items";
|
||||
this.testItemsButton.UseVisualStyleBackColor = true;
|
||||
@@ -251,9 +257,9 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
// docNameTextBox
|
||||
//
|
||||
this.docNameTextBox.Enabled = false;
|
||||
this.docNameTextBox.Location = new System.Drawing.Point(197, 328);
|
||||
this.docNameTextBox.Location = new System.Drawing.Point(193, 328);
|
||||
this.docNameTextBox.Name = "docNameTextBox";
|
||||
this.docNameTextBox.Size = new System.Drawing.Size(163, 20);
|
||||
this.docNameTextBox.Size = new System.Drawing.Size(167, 20);
|
||||
this.docNameTextBox.TabIndex = 40;
|
||||
//
|
||||
// docNameLabel
|
||||
@@ -269,7 +275,7 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
//
|
||||
this.goodOnlyCheckBox.AutoSize = true;
|
||||
this.goodOnlyCheckBox.Enabled = false;
|
||||
this.goodOnlyCheckBox.Location = new System.Drawing.Point(19, 281);
|
||||
this.goodOnlyCheckBox.Location = new System.Drawing.Point(15, 307);
|
||||
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
|
||||
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
|
||||
this.goodOnlyCheckBox.TabIndex = 34;
|
||||
@@ -494,16 +500,74 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
this.nrOfCopiesLabel.TabIndex = 44;
|
||||
this.nrOfCopiesLabel.Text = "# copies";
|
||||
//
|
||||
// barcodeTypeComboBox
|
||||
//
|
||||
this.barcodeTypeComboBox.Enabled = false;
|
||||
this.barcodeTypeComboBox.FormattingEnabled = true;
|
||||
this.barcodeTypeComboBox.Location = new System.Drawing.Point(19, 257);
|
||||
this.barcodeTypeComboBox.Name = "barcodeTypeComboBox";
|
||||
this.barcodeTypeComboBox.Size = new System.Drawing.Size(167, 21);
|
||||
this.barcodeTypeComboBox.TabIndex = 45;
|
||||
//
|
||||
// barcodeLabel
|
||||
//
|
||||
this.barcodeLabel.AutoSize = true;
|
||||
this.barcodeLabel.Location = new System.Drawing.Point(16, 241);
|
||||
this.barcodeLabel.Name = "barcodeLabel";
|
||||
this.barcodeLabel.Size = new System.Drawing.Size(47, 13);
|
||||
this.barcodeLabel.TabIndex = 46;
|
||||
this.barcodeLabel.Text = "Barcode";
|
||||
//
|
||||
// barcodeWidthTextBox
|
||||
//
|
||||
this.barcodeWidthTextBox.Enabled = false;
|
||||
this.barcodeWidthTextBox.Location = new System.Drawing.Point(79, 281);
|
||||
this.barcodeWidthTextBox.Name = "barcodeWidthTextBox";
|
||||
this.barcodeWidthTextBox.Size = new System.Drawing.Size(31, 20);
|
||||
this.barcodeWidthTextBox.TabIndex = 14;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(42, 285);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(35, 13);
|
||||
this.label5.TabIndex = 15;
|
||||
this.label5.Text = "Width";
|
||||
//
|
||||
// barcodeHeightTextBox
|
||||
//
|
||||
this.barcodeHeightTextBox.Enabled = false;
|
||||
this.barcodeHeightTextBox.Location = new System.Drawing.Point(156, 281);
|
||||
this.barcodeHeightTextBox.Name = "barcodeHeightTextBox";
|
||||
this.barcodeHeightTextBox.Size = new System.Drawing.Size(30, 20);
|
||||
this.barcodeHeightTextBox.TabIndex = 17;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(116, 285);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(38, 13);
|
||||
this.label6.TabIndex = 18;
|
||||
this.label6.Text = "Height";
|
||||
//
|
||||
// PrinterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.barcodeLabel);
|
||||
this.Controls.Add(this.barcodeTypeComboBox);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.nrOfCopiesLabel);
|
||||
this.Controls.Add(this.nrOfCopiesTextBox);
|
||||
this.Controls.Add(this.barcodeHeightTextBox);
|
||||
this.Controls.Add(this.templateTextBox);
|
||||
this.Controls.Add(this.templateLabel);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.footerItalicCheckBox);
|
||||
this.Controls.Add(this.footerBoldCheckBox);
|
||||
this.Controls.Add(this.barcodeWidthTextBox);
|
||||
this.Controls.Add(this.footerFontSizeTextBox);
|
||||
this.Controls.Add(this.footerFontFamilyComboBox);
|
||||
this.Controls.Add(this.footerFontLabel);
|
||||
@@ -598,5 +662,11 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
private System.Windows.Forms.Label templateLabel;
|
||||
private System.Windows.Forms.TextBox nrOfCopiesTextBox;
|
||||
private System.Windows.Forms.Label nrOfCopiesLabel;
|
||||
private System.Windows.Forms.ComboBox barcodeTypeComboBox;
|
||||
private System.Windows.Forms.Label barcodeLabel;
|
||||
private System.Windows.Forms.TextBox barcodeWidthTextBox;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox barcodeHeightTextBox;
|
||||
private System.Windows.Forms.Label label6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using Results.Output.Printers;
|
||||
using TBF.BenchControl.Configs;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
using TBF.BenchControl.Configs;
|
||||
|
||||
namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
{
|
||||
@@ -49,7 +50,12 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
bodyFontFamilyComboBox.Items.Add(ff.Name);
|
||||
footerFontFamilyComboBox.Items.Add(ff.Name);
|
||||
}
|
||||
}
|
||||
|
||||
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
|
||||
{
|
||||
barcodeTypeComboBox.Items.Add(bt.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -114,6 +120,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
|
||||
docNameTextBox.Text = config.DocName;
|
||||
nrOfCopiesTextBox.Text = config.NrOfCopies.ToString();
|
||||
|
||||
barcodeTypeComboBox.Text = config.BarcodeType.ToString();
|
||||
barcodeWidthTextBox.Text = config.BarcodeWidth.ToString();
|
||||
barcodeHeightTextBox.Text = config.BarcodeHeight.ToString();
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
@@ -149,6 +159,10 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
footerButton.Enabled = true;
|
||||
docNameTextBox.Enabled = true;
|
||||
nrOfCopiesTextBox.Enabled = true;
|
||||
|
||||
barcodeTypeComboBox.Enabled = true;
|
||||
barcodeWidthTextBox.Enabled = true;
|
||||
barcodeHeightTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
@@ -216,6 +230,22 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
if (!barcodeTypeComboBox.Items.Contains(barcodeTypeComboBox.Text))
|
||||
{
|
||||
message += Environment.NewLine + "Invalid barcode type";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
if (!int.TryParse(barcodeWidthTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
|
||||
{
|
||||
message += Environment.NewLine + "Barcode 'Width' should be between 0 and 200";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
if (!int.TryParse(barcodeHeightTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
|
||||
{
|
||||
message += Environment.NewLine + "Barcode 'Height' should be between 0 and 200";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -292,6 +322,18 @@ namespace TBF.BenchControl.Output.Printers.Enhanced
|
||||
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref config.NrOfCopies, nrOfCopiesTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
|
||||
{
|
||||
if (bt.ToString().Equals(barcodeTypeComboBox.Text))
|
||||
{
|
||||
config.BarcodeType = bt;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
flags |= UpdateDifferent(ref config.BarcodeWidth, barcodeWidthTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref config.BarcodeHeight, barcodeHeightTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
|
||||
@@ -122,6 +122,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
printerCfg.ImgHgh = newCfg.ImgHgh;
|
||||
printerCfg.ImgName = newCfg.ImgName;
|
||||
printerCfg.DocName = newCfg.DocName;
|
||||
printerCfg.BarcodeType = newCfg.BarcodeType;
|
||||
printerCfg.BarcodeLeft = newCfg.BarcodeLeft;
|
||||
printerCfg.BarcodeTop = newCfg.BarcodeTop;
|
||||
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
|
||||
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
|
||||
|
||||
ApplyConfig();
|
||||
}
|
||||
@@ -238,6 +243,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
ImgWid = printerCfg.ImgWid,
|
||||
ImgHgh = printerCfg.ImgHgh,
|
||||
ImgFullPathName = (wm.ArchivePath != null) ? System.IO.Path.Combine(wm.ArchivePath, printerCfg.ImgName) : null,
|
||||
BarcodeType = printerCfg.BarcodeType,
|
||||
BarcodeLeft = printerCfg.BarcodeLeft,
|
||||
BarcodeTop = printerCfg.BarcodeTop,
|
||||
BarcodeWidth = printerCfg.BarcodeWidth,
|
||||
BarcodeHeight = printerCfg.BarcodeHeight,
|
||||
};
|
||||
|
||||
new OnePerMeterPrintDocument(batch, cfg, wm, documentName).Print();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
@@ -70,6 +70,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
public string ImgName;
|
||||
public string DocName;
|
||||
|
||||
public Results.Output.Printers.BarcodeType BarcodeType; /// s/n is printed as barcode when valid (BarcodeType.None < BarcodeType < BarcodeType.Count)
|
||||
public int BarcodeLeft;
|
||||
public int BarcodeTop;
|
||||
public int BarcodeWidth;
|
||||
public int BarcodeHeight;
|
||||
|
||||
[XmlIgnore]
|
||||
public Config.Entities.MetersKind MetersKind;
|
||||
|
||||
@@ -109,6 +115,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
Footer = string.Empty;
|
||||
DocName = string.Empty;
|
||||
ImgName = string.Empty;
|
||||
BarcodeType = Results.Output.Printers.BarcodeType.None;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
|
||||
@@ -107,6 +107,13 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
this.graphWidthTextBox = new System.Windows.Forms.TextBox();
|
||||
this.graphTopTextBox = new System.Windows.Forms.TextBox();
|
||||
this.graphLeftTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.barcodeLabel = new System.Windows.Forms.Label();
|
||||
this.barcodeHeightTextBox = new System.Windows.Forms.TextBox();
|
||||
this.barcodeWidthTextBox = new System.Windows.Forms.TextBox();
|
||||
this.barcodeTopTextBox = new System.Windows.Forms.TextBox();
|
||||
this.barcodeLeftTextBox = new System.Windows.Forms.TextBox();
|
||||
this.barcodeTypeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
@@ -139,7 +146,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
//
|
||||
this.supressPrintingCheckBox.AutoSize = true;
|
||||
this.supressPrintingCheckBox.Enabled = false;
|
||||
this.supressPrintingCheckBox.Location = new System.Drawing.Point(334, 26);
|
||||
this.supressPrintingCheckBox.Location = new System.Drawing.Point(306, 5);
|
||||
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
|
||||
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
|
||||
this.supressPrintingCheckBox.TabIndex = 33;
|
||||
@@ -421,7 +428,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
//
|
||||
this.goodOnlyCheckBox.AutoSize = true;
|
||||
this.goodOnlyCheckBox.Enabled = false;
|
||||
this.goodOnlyCheckBox.Location = new System.Drawing.Point(334, 44);
|
||||
this.goodOnlyCheckBox.Location = new System.Drawing.Point(306, 21);
|
||||
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
|
||||
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
|
||||
this.goodOnlyCheckBox.TabIndex = 34;
|
||||
@@ -448,18 +455,18 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
// docNameLabel
|
||||
//
|
||||
this.docNameLabel.AutoSize = true;
|
||||
this.docNameLabel.Location = new System.Drawing.Point(16, 331);
|
||||
this.docNameLabel.Location = new System.Drawing.Point(297, 41);
|
||||
this.docNameLabel.Name = "docNameLabel";
|
||||
this.docNameLabel.Size = new System.Drawing.Size(246, 13);
|
||||
this.docNameLabel.Size = new System.Drawing.Size(127, 13);
|
||||
this.docNameLabel.TabIndex = 42;
|
||||
this.docNameLabel.Text = "Doc.name (0=start 1-end, 2=batch, 3=wm, 4=s/n) :";
|
||||
this.docNameLabel.Text = "Doc.name (0=start 1-end,";
|
||||
//
|
||||
// docNameTextBox
|
||||
//
|
||||
this.docNameTextBox.Enabled = false;
|
||||
this.docNameTextBox.Location = new System.Drawing.Point(261, 328);
|
||||
this.docNameTextBox.Location = new System.Drawing.Point(302, 69);
|
||||
this.docNameTextBox.Name = "docNameTextBox";
|
||||
this.docNameTextBox.Size = new System.Drawing.Size(135, 20);
|
||||
this.docNameTextBox.Size = new System.Drawing.Size(151, 20);
|
||||
this.docNameTextBox.TabIndex = 43;
|
||||
//
|
||||
// footerItalicCheckBox
|
||||
@@ -513,7 +520,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
this.imageNameTextBox.Enabled = false;
|
||||
this.imageNameTextBox.Location = new System.Drawing.Point(287, 306);
|
||||
this.imageNameTextBox.Name = "imageNameTextBox";
|
||||
this.imageNameTextBox.Size = new System.Drawing.Size(135, 20);
|
||||
this.imageNameTextBox.Size = new System.Drawing.Size(166, 20);
|
||||
this.imageNameTextBox.TabIndex = 44;
|
||||
//
|
||||
// imageLeftTextBox
|
||||
@@ -758,7 +765,7 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
this.table1FormComboBox.FormattingEnabled = true;
|
||||
this.table1FormComboBox.Location = new System.Drawing.Point(392, 237);
|
||||
this.table1FormComboBox.Name = "table1FormComboBox";
|
||||
this.table1FormComboBox.Size = new System.Drawing.Size(64, 21);
|
||||
this.table1FormComboBox.Size = new System.Drawing.Size(61, 21);
|
||||
this.table1FormComboBox.TabIndex = 78;
|
||||
//
|
||||
// label3
|
||||
@@ -802,10 +809,76 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
this.graphLeftTextBox.Size = new System.Drawing.Size(33, 20);
|
||||
this.graphLeftTextBox.TabIndex = 79;
|
||||
//
|
||||
// label14
|
||||
//
|
||||
this.label14.AutoSize = true;
|
||||
this.label14.Location = new System.Drawing.Point(339, 56);
|
||||
this.label14.Name = "label14";
|
||||
this.label14.Size = new System.Drawing.Size(120, 13);
|
||||
this.label14.TabIndex = 84;
|
||||
this.label14.Text = " 2=batch, 3=wm, 4=s/n)";
|
||||
//
|
||||
// barcodeLabel
|
||||
//
|
||||
this.barcodeLabel.AutoSize = true;
|
||||
this.barcodeLabel.Location = new System.Drawing.Point(17, 330);
|
||||
this.barcodeLabel.Name = "barcodeLabel";
|
||||
this.barcodeLabel.Size = new System.Drawing.Size(121, 13);
|
||||
this.barcodeLabel.TabIndex = 89;
|
||||
this.barcodeLabel.Text = "Barcode left/t/w/h/type";
|
||||
//
|
||||
// barcodeHeightTextBox
|
||||
//
|
||||
this.barcodeHeightTextBox.Enabled = false;
|
||||
this.barcodeHeightTextBox.Location = new System.Drawing.Point(245, 327);
|
||||
this.barcodeHeightTextBox.Name = "barcodeHeightTextBox";
|
||||
this.barcodeHeightTextBox.Size = new System.Drawing.Size(31, 20);
|
||||
this.barcodeHeightTextBox.TabIndex = 88;
|
||||
//
|
||||
// barcodeWidthTextBox
|
||||
//
|
||||
this.barcodeWidthTextBox.Enabled = false;
|
||||
this.barcodeWidthTextBox.Location = new System.Drawing.Point(211, 327);
|
||||
this.barcodeWidthTextBox.Name = "barcodeWidthTextBox";
|
||||
this.barcodeWidthTextBox.Size = new System.Drawing.Size(31, 20);
|
||||
this.barcodeWidthTextBox.TabIndex = 87;
|
||||
//
|
||||
// barcodeTopTextBox
|
||||
//
|
||||
this.barcodeTopTextBox.Enabled = false;
|
||||
this.barcodeTopTextBox.Location = new System.Drawing.Point(177, 327);
|
||||
this.barcodeTopTextBox.Name = "barcodeTopTextBox";
|
||||
this.barcodeTopTextBox.Size = new System.Drawing.Size(31, 20);
|
||||
this.barcodeTopTextBox.TabIndex = 86;
|
||||
//
|
||||
// barcodeLeftTextBox
|
||||
//
|
||||
this.barcodeLeftTextBox.Enabled = false;
|
||||
this.barcodeLeftTextBox.Location = new System.Drawing.Point(141, 327);
|
||||
this.barcodeLeftTextBox.Name = "barcodeLeftTextBox";
|
||||
this.barcodeLeftTextBox.Size = new System.Drawing.Size(33, 20);
|
||||
this.barcodeLeftTextBox.TabIndex = 85;
|
||||
//
|
||||
// barcodeTypeComboBox
|
||||
//
|
||||
this.barcodeTypeComboBox.Enabled = false;
|
||||
this.barcodeTypeComboBox.FormattingEnabled = true;
|
||||
this.barcodeTypeComboBox.Location = new System.Drawing.Point(287, 327);
|
||||
this.barcodeTypeComboBox.Name = "barcodeTypeComboBox";
|
||||
this.barcodeTypeComboBox.Size = new System.Drawing.Size(166, 21);
|
||||
this.barcodeTypeComboBox.TabIndex = 90;
|
||||
//
|
||||
// PrinterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.barcodeTypeComboBox);
|
||||
this.Controls.Add(this.barcodeLabel);
|
||||
this.Controls.Add(this.barcodeHeightTextBox);
|
||||
this.Controls.Add(this.barcodeWidthTextBox);
|
||||
this.Controls.Add(this.barcodeTopTextBox);
|
||||
this.Controls.Add(this.barcodeLeftTextBox);
|
||||
this.Controls.Add(this.label14);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.graphHeightTextBox);
|
||||
this.Controls.Add(this.graphWidthTextBox);
|
||||
@@ -968,5 +1041,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
private System.Windows.Forms.TextBox graphWidthTextBox;
|
||||
private System.Windows.Forms.TextBox graphTopTextBox;
|
||||
private System.Windows.Forms.TextBox graphLeftTextBox;
|
||||
private System.Windows.Forms.Label label14;
|
||||
private System.Windows.Forms.Label barcodeLabel;
|
||||
private System.Windows.Forms.TextBox barcodeHeightTextBox;
|
||||
private System.Windows.Forms.TextBox barcodeWidthTextBox;
|
||||
private System.Windows.Forms.TextBox barcodeTopTextBox;
|
||||
private System.Windows.Forms.TextBox barcodeLeftTextBox;
|
||||
private System.Windows.Forms.ComboBox barcodeTypeComboBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using Results.Output.Printers;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
using TBF.BenchControl.Configs;
|
||||
@@ -61,7 +62,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
{
|
||||
table1FormComboBox.Items.Add(f.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
|
||||
{
|
||||
barcodeTypeComboBox.Items.Add(bt.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -151,6 +157,12 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
docNameTextBox.Text = config.DocName;
|
||||
|
||||
table1FormComboBox.Text = config.Form.ToString();
|
||||
|
||||
barcodeTypeComboBox.Text = config.BarcodeType.ToString();
|
||||
barcodeLeftTextBox.Text = config.BarcodeLeft.ToString();
|
||||
barcodeTopTextBox.Text = config.BarcodeTop.ToString();
|
||||
barcodeWidthTextBox.Text = config.BarcodeWidth.ToString();
|
||||
barcodeHeightTextBox.Text = config.BarcodeHeight.ToString();
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
@@ -207,6 +219,11 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
imageHeightTextBox.Enabled = true;
|
||||
imageNameTextBox.Enabled = true;
|
||||
docNameTextBox.Enabled = true;
|
||||
barcodeTypeComboBox.Enabled = true;
|
||||
barcodeLeftTextBox.Enabled = true;
|
||||
barcodeTopTextBox.Enabled = true;
|
||||
barcodeWidthTextBox.Enabled = true;
|
||||
barcodeHeightTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
@@ -361,6 +378,32 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
if (!barcodeTypeComboBox.Items.Contains(barcodeTypeComboBox.Text))
|
||||
{
|
||||
message += Environment.NewLine + "Invalid barcode type";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
if (!int.TryParse(barcodeLeftTextBox.Text, out dummy) || dummy < 0 || dummy > 2000)
|
||||
{
|
||||
message += Environment.NewLine + "Barcode 'Left' should be between 0 and 2000";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
if (!int.TryParse(barcodeTopTextBox.Text, out dummy) || dummy < 0 || dummy > 2000)
|
||||
{
|
||||
message += Environment.NewLine + "Barcode 'Top' should be between 0 and 2000";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
if (!int.TryParse(barcodeWidthTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
|
||||
{
|
||||
message += Environment.NewLine + "Barcode 'Width' should be between 0 and 200";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
if (!int.TryParse(barcodeHeightTextBox.Text, out dummy) || dummy < 0 || dummy > 200)
|
||||
{
|
||||
message += Environment.NewLine + "Barcode 'Height' should be between 0 and 200";
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -471,6 +514,20 @@ namespace TBF.BenchControl.Output.Printers.OnePerMeter
|
||||
|
||||
flags |= UpdateDifferent(ref config.DocName, docNameTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
for (BarcodeType bt = BarcodeType.None; bt < BarcodeType.Count; bt++)
|
||||
{
|
||||
if (bt.ToString().Equals(barcodeTypeComboBox.Text))
|
||||
{
|
||||
config.BarcodeType = bt;
|
||||
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
break;
|
||||
}
|
||||
}
|
||||
flags |= UpdateDifferent(ref config.BarcodeLeft, barcodeLeftTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref config.BarcodeTop, barcodeTopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref config.BarcodeWidth, barcodeWidthTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
flags |= UpdateDifferent(ref config.BarcodeHeight, barcodeHeightTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
|
||||
Reference in New Issue
Block a user