Munich: Changes in YearOfProduction (Eichjahr), Zaehlertyp, Pruefvorlage, etc., ver.2.7.289

This commit is contained in:
Milan Hanajik
2016-05-20 10:39:12 +02:00
parent 4ae4ba15cf
commit 1bcbe382d7
14 changed files with 198 additions and 155 deletions
@@ -34,6 +34,9 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
/// Data to print
///
readonly Results.Entities.WaterMeter wm;
string zaehlertyp;
string pruefvorlage;
readonly IList<Results.Entities.MeterTestRslt> results;
readonly int resultsCount;
readonly bool compound; /// true when MetersKind is MetersKind.Combined
@@ -62,6 +65,23 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
this.wm = wm;
compound = wm.Compound();
string[] info = wm.ProductName().Split(new char[] { ';' });
if (info.Length >= 2)
{
pruefvorlage = info[0];
zaehlertyp = info[1];
}
else if (info.Length == 1)
{
pruefvorlage = info[0];
zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler";
}
else
{
pruefvorlage = wm.ProcedureName();
zaehlertyp = compound ? "Verbundzähler" : "Einzelzähler";
}
results = wm.MeterTestRslts;
this.resultsCount = compound ? (results.Count / 3) : results.Count;
@@ -131,13 +151,13 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Zahlertyp :");
PrintAt(e, Tab2, lineNr * SpacingOne, prn.Zaehlertyp);
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
PrintAt(e, Tab4, lineNr * SpacingOne, (wm.YearOfProduction != 0) ? wm.YearOfProduction.ToString() : prn.Eichjahr);
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
lineNr++;
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
PrintAt(e, Tab2, lineNr * SpacingOne, prn.Pruefvorlage);
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
lineNr += 2;
if (compound)
@@ -25,14 +25,12 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
Results.Entities.Batch batch;
public string Title;
public string Version { get { return printerCfg.ProcParams.Version; } }
public string Zaehlertyp { get { return printerCfg.ProcParams.Zaehlertyp; } }
public string Pruefvorlage { get { return printerCfg.ProcParams.Pruefvorlage; } }
public string Eichjahr { get { return printerCfg.ProcParams.Eichjahr; } }
public string Version { get { return printerCfg.Version; } }
public Printer() { }
public Printer()
{
}
public Printer(PrinterCfg cfg)
: base(cfg)
@@ -18,7 +18,8 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
///
/// Serialized parameters
///
public PageOrientation PageOrientation;
public string Version;
public PageOrientation PageOrientation;
public bool SupressPrinting; /// Bypass printing when true
/// <summary> Procedure parameters </summary>
@@ -55,6 +55,7 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
versionTextBox.Text = config.Version;
orientationComboBox.Text = config.PageOrientation.ToString();
supressPrintingCheckBox.Checked = config.SupressPrinting;
}
@@ -62,7 +63,8 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
public void Unlock()
{
nameTextBox.Enabled = true;
orientationComboBox.Enabled = true;
versionTextBox.Enabled = true;
orientationComboBox.Enabled = true;
supressPrintingCheckBox.Enabled = true;
}
@@ -86,7 +88,8 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
config.PageOrientation = GetOrientation(orientationComboBox.Text);
config.Version = versionTextBox.Text;
config.PageOrientation = GetOrientation(orientationComboBox.Text);
config.SupressPrinting = supressPrintingCheckBox.Checked;
return flags;
@@ -31,84 +31,105 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
/// </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.orientationComboBox = new System.Windows.Forms.ComboBox();
this.orientationLabel = new System.Windows.Forms.Label();
this.supressPrintingCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(143, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 5;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(25, 60);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 4;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(140, 24);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 3;
this.classNameLabel.Text = "ComonentName";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(143, 85);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(130, 21);
this.orientationComboBox.TabIndex = 9;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(25, 88);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 8;
this.orientationLabel.Text = "Page orientation";
//
// supressPrintingCheckBox
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(143, 123);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 12;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
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(300, 200);
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.orientationComboBox = new System.Windows.Forms.ComboBox();
this.orientationLabel = new System.Windows.Forms.Label();
this.supressPrintingCheckBox = new System.Windows.Forms.CheckBox();
this.versionTextBox = new System.Windows.Forms.TextBox();
this.versionLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(143, 57);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(25, 60);
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(140, 24);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// orientationComboBox
//
this.orientationComboBox.Enabled = false;
this.orientationComboBox.FormattingEnabled = true;
this.orientationComboBox.Location = new System.Drawing.Point(143, 109);
this.orientationComboBox.Name = "orientationComboBox";
this.orientationComboBox.Size = new System.Drawing.Size(130, 21);
this.orientationComboBox.TabIndex = 6;
//
// orientationLabel
//
this.orientationLabel.AutoSize = true;
this.orientationLabel.Location = new System.Drawing.Point(25, 112);
this.orientationLabel.Name = "orientationLabel";
this.orientationLabel.Size = new System.Drawing.Size(84, 13);
this.orientationLabel.TabIndex = 5;
this.orientationLabel.Text = "Page orientation";
//
// supressPrintingCheckBox
//
this.supressPrintingCheckBox.AutoSize = true;
this.supressPrintingCheckBox.Enabled = false;
this.supressPrintingCheckBox.Location = new System.Drawing.Point(143, 137);
this.supressPrintingCheckBox.Name = "supressPrintingCheckBox";
this.supressPrintingCheckBox.Size = new System.Drawing.Size(101, 17);
this.supressPrintingCheckBox.TabIndex = 7;
this.supressPrintingCheckBox.Text = "Supress printing";
this.supressPrintingCheckBox.UseVisualStyleBackColor = true;
//
// versionTextBox
//
this.versionTextBox.Enabled = false;
this.versionTextBox.Location = new System.Drawing.Point(143, 83);
this.versionTextBox.Name = "versionTextBox";
this.versionTextBox.Size = new System.Drawing.Size(130, 20);
this.versionTextBox.TabIndex = 4;
//
// versionLabel
//
this.versionLabel.AutoSize = true;
this.versionLabel.Location = new System.Drawing.Point(25, 86);
this.versionLabel.Name = "versionLabel";
this.versionLabel.Size = new System.Drawing.Size(42, 13);
this.versionLabel.TabIndex = 3;
this.versionLabel.Text = "Version";
//
// PrinterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.versionTextBox);
this.Controls.Add(this.versionLabel);
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(300, 200);
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -120,5 +141,7 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
private System.Windows.Forms.ComboBox orientationComboBox;
private System.Windows.Forms.Label orientationLabel;
private System.Windows.Forms.CheckBox supressPrintingCheckBox;
private System.Windows.Forms.TextBox versionTextBox;
private System.Windows.Forms.Label versionLabel;
}
}