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

59 lines
1.7 KiB
C#
Raw Normal View History

2017-05-04 14:31:40 +00:00
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
using TBF.Resources;
2017-05-04 14:31:40 +00:00
namespace TBF.BenchControl.Elde.CoverTest
{
public class CoverTestCfg : ComponentCfgBase, IChildComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CoverTestCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; }
2017-05-04 14:31:40 +00:00
public IComponentCfgCtrl GetControl() { return new CoverTestCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition;
public bool Invert;
2017-05-04 14:31:40 +00:00
public string Message;
public Users.Grp.GID BypassLevel;
/// Private parameterless constructor invoked by all other (public) constructors
CoverTestCfg()
{
Name = "CoverTest";
ParentName = "CB";
/// Default values for closed cover test
2017-05-04 14:31:40 +00:00
BitPosition = 22;
Invert = false;
Message = Strings.Close_the_cover;
2017-05-04 14:31:40 +00:00
BypassLevel = Users.Grp.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}",
2017-05-04 14:31:40 +00:00
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
BitPosition,
Invert ? "yes" : "no",
2017-05-04 14:31:40 +00:00
Message,
BypassLevel);
}
}
}