Files
tbf/TBF/Rig/ControlBoard/Legacy/Factory.cs
T

38 lines
1.2 KiB
C#

///
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.ControlBoard.Legacy
{
public class Factory : IComponentFactory
{
public string ClassName { get { return GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponent DummyComponent() { return new CBoard(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new CBoard(cfg); }
public IComponentCfg DefaultConfig() { return new ControlBoardCfg(this); }
public IComponentCfgCtrl CreateCfgCtrl() { return new ControlBoardCfgCtrl(); }
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new CBoard((ControlBoardCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(ControlBoardCfg.Serializer, component, this);
}
public void ResetStaticProperties() { CBoard.ResetStaticProperties(); }
}
}