tbf/TBF/Rig/Output/FileWriters/Xml/FactorySingle.cs
2021-10-26 19:38:09 +02:00

29 lines
948 B
C#

///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using Common;
using TBF.Rig.Generic;
namespace TBF.Rig.Output.FileWriters.Xml
{
public class FactorySingle : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(8) + ".Single"; } }
public IComponent DummyComponent() { return new Writer(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Writer(cfg); }
public IComponentCfg DefaultConfig() { return new WriterCfg("FileWriter.Xml.Single", this, Common.MetersKind.Single); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
IComponentCfg cfg = ComponentCfgBase.CreateFromDbEntity(WriterCfg.Serializer, component, this);
(cfg as WriterCfg).MetersKind = MetersKind.Single;
return cfg;
}
}
}