Munich: Possibility to print the protocol again, ver.2.7.299
This commit is contained in:
@@ -27,12 +27,10 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
const int MarginTop = 7; /// Margins of the text from table lines
|
||||
const int MarginLeft = 4; /// Margins of the text from table lines
|
||||
|
||||
/// Initialized in the constructor
|
||||
readonly Printer prn;
|
||||
|
||||
///
|
||||
/// Data to print
|
||||
///
|
||||
readonly string docVersion;
|
||||
readonly Results.Entities.WaterMeter wm;
|
||||
string zaehlertyp;
|
||||
string pruefvorlage;
|
||||
@@ -57,11 +55,11 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="textToPrint">Text to be printed</param>
|
||||
public MunichPrintDocument(Printer printer,
|
||||
public MunichPrintDocument(string docVersion,
|
||||
Results.Entities.WaterMeter wm,
|
||||
PageOrientation pageOrientation)
|
||||
{
|
||||
prn = printer;
|
||||
this.docVersion = docVersion;
|
||||
this.wm = wm;
|
||||
compound = wm.Compound();
|
||||
|
||||
@@ -141,10 +139,10 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
StringFormat format = new StringFormat(StringFormatFlags.LineLimit);
|
||||
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
||||
e.Graphics.DrawString(prn.Title, this.fontTitle, Brushes.Black, printArea);
|
||||
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
|
||||
|
||||
int lineNr = FirstLineNr;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, prn.Version);
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
||||
lineNr++;
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
||||
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
/// <summary> Data to print </summary>
|
||||
Results.Entities.Batch batch;
|
||||
|
||||
public string Title;
|
||||
public string Version { get { return printerCfg.Version; } }
|
||||
|
||||
|
||||
@@ -47,7 +46,6 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
public IOperation PrintResultsOp(Results.Entities.Batch batch)
|
||||
{
|
||||
this.batch = batch;
|
||||
this.Title = batch.ProtocolTitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -56,7 +54,7 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
|
||||
{
|
||||
foreach (var wm in batch.WaterMeters)
|
||||
{
|
||||
new MunichPrintDocument(this, wm, printerCfg.PageOrientation).Print();
|
||||
new MunichPrintDocument(printerCfg.Version, wm, printerCfg.PageOrientation).Print();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,21 +45,33 @@ namespace TBF.Forms
|
||||
startTimeLabel.Text = string.Format("{0} {1}", StarTime.ToShortDateString(), StarTime.ToShortTimeString());
|
||||
endTimeLabel.Text = string.Format("{0} {1}", EndTime.ToShortDateString(), EndTime.ToShortTimeString());
|
||||
procedureLabel.Text = ProcedureName;
|
||||
purchaseOrderLabel.Text = string.Format("Obj.: {0}", PurchaseOrder);
|
||||
passedCountLabel.Text = string.Format("Dobrých: {0}", PassedCount);
|
||||
failedCountLabel.Text = string.Format("Zlých: {0}", FailedCount);
|
||||
purchaseOrderLabel.Text = string.Format("{0}: {1}", Strings.Purchase_order, PurchaseOrder);
|
||||
passedCountLabel.Text = string.Format("{0}: {1}", Strings.Passed, PassedCount);
|
||||
failedCountLabel.Text = string.Format("{0}: {1}", Strings.Failed, FailedCount);
|
||||
|
||||
#if MUNICH
|
||||
sentCheckBox.Text = Strings.Printed;
|
||||
sentCheckBox.Checked = Sent;
|
||||
sendButton.Enabled = true;
|
||||
sendButton.Text = Strings.Again;
|
||||
#else
|
||||
sentCheckBox.Text = Strings.Sent;
|
||||
sentCheckBox.Checked = Sent;
|
||||
sendButton.Enabled = !Sent;
|
||||
sendButton.Text = Strings.Again;
|
||||
#endif
|
||||
}
|
||||
|
||||
public void UpdateSentState(bool sent)
|
||||
{
|
||||
this.Sent = sent;
|
||||
#if MUNICH
|
||||
sentCheckBox.Checked = sent;
|
||||
sendButton.Enabled = true;
|
||||
#else
|
||||
sentCheckBox.Checked = sent;
|
||||
sendButton.Enabled = !sent;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void sendButton_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -109,6 +109,20 @@ namespace TBF.Forms
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
#elif MUNICH
|
||||
string docVersion = string.Empty;
|
||||
foreach (var cmp in TBF.BenchControl.StateMachine.Components)
|
||||
{
|
||||
if (cmp.ClassName == "ResultsPrinter4Munich")
|
||||
{
|
||||
docVersion = (cmp as TBF.BenchControl.ResultsPrinters.Munich.Printer).Version;
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (var wm in b.WaterMeters)
|
||||
{
|
||||
new TBF.BenchControl.ResultsPrinters.Munich.MunichPrintDocument(docVersion, wm, Config.Entities.PageOrientation.Portrait).Print();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.7.298.1")]
|
||||
[assembly: AssemblyFileVersion("2.7.298.1")]
|
||||
[assembly: AssemblyVersion("2.7.299.1")]
|
||||
[assembly: AssemblyFileVersion("2.7.299.1")]
|
||||
|
||||
@@ -2301,6 +2301,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Printed.
|
||||
/// </summary>
|
||||
internal static string Printed {
|
||||
get {
|
||||
return ResourceManager.GetString("Printed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Printer.
|
||||
/// </summary>
|
||||
|
||||
@@ -1189,7 +1189,7 @@
|
||||
<value>Wasserzählerergebnisse drucken</value>
|
||||
</data>
|
||||
<data name="Again" xml:space="preserve">
|
||||
<value>wieder</value>
|
||||
<value>Wieder</value>
|
||||
</data>
|
||||
<data name="Previous_results" xml:space="preserve">
|
||||
<value>Vorherige Ergebnisse</value>
|
||||
@@ -1236,4 +1236,7 @@
|
||||
<data name="End_Condition" xml:space="preserve">
|
||||
<value>Bedingung für das Ende</value>
|
||||
</data>
|
||||
<data name="Printed" xml:space="preserve">
|
||||
<value>Gedruckt</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1411,4 +1411,7 @@
|
||||
<data name="Saving_and_printing_results" xml:space="preserve">
|
||||
<value>Saving and printing results</value>
|
||||
</data>
|
||||
<data name="Printed" xml:space="preserve">
|
||||
<value>Printed</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -45,7 +45,7 @@ namespace TBF.Screens
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
#if MUNICH
|
||||
#if !(IPERLST || IPERLST_SPECIAL || MUNICH)
|
||||
previousResultsButton.Visible = false;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user