2016-08-17 10:24:24 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
|
|
|
|
|
///
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using log4net;
|
2021-09-23 09:46:40 +00:00
|
|
|
|
using Common;
|
2016-08-17 10:24:24 +00:00
|
|
|
|
using Config.Entities;
|
2021-10-26 09:23:57 +00:00
|
|
|
|
using TBF.Rig.Sequences;
|
2021-04-13 11:57:00 +00:00
|
|
|
|
using TBF.UiBridge;
|
2016-08-17 10:24:24 +00:00
|
|
|
|
|
2021-10-26 09:23:57 +00:00
|
|
|
|
namespace TBF.Rig.TestMethods.FlyingStartMassCollection.Single
|
2016-08-17 10:24:24 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class Component : ComponentBase, GenericDevices.ITestMethod
|
|
|
|
|
|
{
|
|
|
|
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
2021-10-26 09:23:57 +00:00
|
|
|
|
return string.Format("{0}({1})", this.GetType().Namespace.Substring(8), Cfg.ToString(1));
|
2016-08-17 10:24:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; }
|
2017-12-02 16:54:38 +00:00
|
|
|
|
public bool DoTransitions() { return true; }
|
2016-08-17 10:24:24 +00:00
|
|
|
|
|
2021-04-07 07:57:42 +00:00
|
|
|
|
public Component() { }
|
2016-08-17 10:24:24 +00:00
|
|
|
|
|
|
|
|
|
|
public Component(Generic.IComponentCfg cfg)
|
|
|
|
|
|
: base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-07 07:57:42 +00:00
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
log.FatalFormat("{0} initialized: {1}", Name, this);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-02 16:54:38 +00:00
|
|
|
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
2016-08-17 10:24:24 +00:00
|
|
|
|
{
|
2021-04-13 11:57:00 +00:00
|
|
|
|
if (DebugLevel == DebugMode.Normal)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (new FlyingStartMassCollectionSeq()).Execute(test, repetNr, isLastRepetition, null, null, DebugLevel);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
/// DebugLevel == DebugMode.Simulate
|
|
|
|
|
|
(new FlyingStartMassCollectionSeq()).MakeSimulatedTrivial(test, repetNr, test.Part);
|
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Progress.Completed));
|
2022-12-12 16:36:40 +00:00
|
|
|
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Common.Utils.GetTestName(test.Name, 1, 1), 0)));
|
2021-04-13 11:57:00 +00:00
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-08-17 10:24:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|