130 lines
3.6 KiB
C#
130 lines
3.6 KiB
C#
///
|
|
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
|
///
|
|
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Output.Printers.OnePerBatch
|
|
{
|
|
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PrinterCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new PrinterCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public string AutoTestParam;
|
|
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 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 Header; /// =Title
|
|
|
|
public int ColW0Pct;
|
|
public string[] CommonItems1;
|
|
public int ColW1Pct;
|
|
public string[] CommonItems2;
|
|
public int ColW2Pct;
|
|
public string[] CommonItems3;
|
|
|
|
public TableForm Form;
|
|
public string[] SelectedItems;
|
|
public string[] SelectedItems2;
|
|
|
|
public int BelowW0Pct;
|
|
public string[] BelowItems1;
|
|
public int BelowW1Pct;
|
|
public string[] BelowItems2;
|
|
public int BelowW2Pct;
|
|
public string[] BelowItems3;
|
|
|
|
public string Footer;
|
|
public bool TestsAreRows; /// true = Tests are rows
|
|
public int GraphLeft;
|
|
public int GraphTop;
|
|
public int GraphWid;
|
|
public int GraphHgh;
|
|
public int ImgLeft;
|
|
public int ImgTop;
|
|
public int ImgWid;
|
|
public int ImgHgh;
|
|
public string ImgName;
|
|
public string DocName;
|
|
|
|
[XmlIgnore]
|
|
public Config.Entities.MetersKind MetersKind;
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
PrinterCfg()
|
|
{
|
|
}
|
|
|
|
public PrinterCfg(string name, IComponentFactory factory, Config.Entities.MetersKind metersKind)
|
|
: this()
|
|
{
|
|
Name = name;
|
|
Factory = factory;
|
|
MetersKind = metersKind;
|
|
|
|
ParentName = string.Empty;
|
|
AutoTestParam = string.Empty;
|
|
Template = string.Empty;
|
|
PageOrientation = PageOrientation.Portrait;
|
|
TopMargin = 100;
|
|
BottomMargin = 100;
|
|
LeftMargin = 100;
|
|
TitFntFml = "Arial";
|
|
TitFntSz = 18;
|
|
TitFntSty = 1;
|
|
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;
|
|
ImgName = string.Empty;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Orientation={1}, Margins T={2} B={3} L={4}, SupressPrinting={5}",
|
|
Name,
|
|
PageOrientation,
|
|
TopMargin,
|
|
BottomMargin,
|
|
LeftMargin,
|
|
SupressPrinting ? "yes" : "no"
|
|
);
|
|
}
|
|
}
|
|
}
|