tbf/TBF/Rig/TestMethods/Endurance/Component.cs
2021-10-26 19:38:09 +02:00

44 lines
1.1 KiB
C#

///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using Common;
using Config.Entities;
namespace TBF.Rig.TestMethods.Endurance
{
public class Component : ComponentBase, GenericDevices.ITestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(8), Cfg.ToString(1));
}
readonly TestMethodCfg testMethodCfg;
public bool CanTest(MetersKind meters) { return true; }
public bool DoTransitions() { return true; }
public Component() { }
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
testMethodCfg = cfg as TestMethodCfg;
}
public override void Initialize()
{
log.FatalFormat("{0} initialized: {1}", Name, this);
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
return (new EnduranceSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.Cycle, DebugLevel);
}
}
}