tbf/TBF/BenchControl/Elde/CoverTest/CoverTestCfg.cs

60 lines
1.8 KiB
C#

///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
namespace TBF.BenchControl.Elde.CoverTest
{
public class CoverTestCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CoverTestCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new CoverTestCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition;
public bool Invert;
public string Message;
public Users.Entities.GID[] BypassLevel;
/// Private parameterless constructor invoked by all other (public) constructors
CoverTestCfg()
{
Name = "CoverTest";
ParentName = "CB";
/// Default values for closed cover test
BitPosition = 22;
Invert = false;
Message = Strings.Close_the_cover;
BypassLevel = new Users.Entities.GID[] { Users.Entities.GID.TestingSpecialists };
}
public CoverTestCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("{0} ({1}) Bit={2}, Inv={3}, Message={4}, BypassLelvel={5}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
BitPosition,
Invert ? "yes" : "no",
Message,
BypassLevel);
}
}
}