Clean-up
This commit is contained in:
parent
7de5551c24
commit
685d57db8b
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2017-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using Common;
|
||||
@ -9,13 +9,14 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
{
|
||||
public class FactoryCompound : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(8) + ".Compound"; } }
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8) + ".Compound"; } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new Printer(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg("Printer.Enhanced.Compound", this, MetersKind.Combined); }
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg(this, "Printer.Enhanced.Compound", MetersKind.Combined); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2017-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using Common;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.Enhanced
|
||||
@ -9,12 +10,13 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
public class FactoryHeatMeters : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8) + ".HeatMeters"; } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new Printer(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg("Printer.Enhanced.HeatMeters", this, Common.MetersKind.HeatMeter); }
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg(this, "Printer.Enhanced.HeatMeters", MetersKind.HeatMeter); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2017-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using Common;
|
||||
@ -9,13 +9,14 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
{
|
||||
public class FactorySingle : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(8) + ".Single"; } }
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8) + ".Single"; } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new Printer(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg("Printer.Enhanced.Single", this, MetersKind.Single); }
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg(this, "Printer.Enhanced.Single", MetersKind.Single); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
|
||||
@ -8,12 +8,15 @@ using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.Enhanced
|
||||
{
|
||||
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
public class PrinterCfg : ComponentCfgBase, 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(); }
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
return new PrinterCfgCtrl();
|
||||
}
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
@ -57,14 +60,21 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
{
|
||||
}
|
||||
|
||||
public PrinterCfg(string name, IComponentFactory factory, MetersKind metersKind)
|
||||
public PrinterCfg(IComponentFactory factory, string name, MetersKind metersKind)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
MetersKind = metersKind;
|
||||
|
||||
Factory = factory;
|
||||
Name = name;
|
||||
ParentName = string.Empty;
|
||||
MetersKind = metersKind;
|
||||
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
Template = string.Empty;
|
||||
PageOrientation = PageOrientation.Portrait;
|
||||
TopMargin = 100;
|
||||
@ -98,8 +108,7 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
TopMargin,
|
||||
BottomMargin,
|
||||
LeftMargin,
|
||||
SupressPrinting ? "yes" : "no"
|
||||
);
|
||||
SupressPrinting ? "yes" : "no" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user