2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2021-04-13 14:54:40 +00:00
|
|
|
|
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System;
|
2015-02-19 07:37:37 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using log4net;
|
2015-12-04 16:17:20 +00:00
|
|
|
|
using Config.Entities;
|
2021-03-05 13:47:21 +00:00
|
|
|
|
using TBF.Rig;
|
2021-04-13 14:54:40 +00:00
|
|
|
|
using TBF.Rig.Sequences;
|
|
|
|
|
|
using TBF.UiBridge;
|
2015-02-19 07:37:37 +00:00
|
|
|
|
|
2021-03-05 13:47:21 +00:00
|
|
|
|
namespace TBF.Rig.TestMethods.PMaxTest
|
2015-02-19 07:37:37 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
|
|
|
|
|
|
{
|
|
|
|
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
2021-04-07 10:48:44 +00:00
|
|
|
|
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
2015-02-19 07:37:37 +00:00
|
|
|
|
|
2015-12-04 16:17:20 +00:00
|
|
|
|
public bool CanTest(MetersKind meters) { return true; }
|
2017-12-02 16:54:38 +00:00
|
|
|
|
public bool DoTransitions() { return true; }
|
2020-05-14 08:44:36 +00:00
|
|
|
|
public bool CheckDeviceCaps(Test test, OutputPath devices, out string message)
|
|
|
|
|
|
{
|
2021-01-14 08:50:11 +00:00
|
|
|
|
return PMaxTestSeq.CheckDeviceCaps(test, devices, out message);
|
2020-05-14 08:44:36 +00:00
|
|
|
|
}
|
2015-02-19 07:37:37 +00:00
|
|
|
|
|
2017-07-25 13:10:06 +00:00
|
|
|
|
|
2020-05-14 08:44:36 +00:00
|
|
|
|
readonly TestMethodCfg testMethodCfg;
|
2015-06-29 09:14:33 +00:00
|
|
|
|
|
2020-05-14 08:44:36 +00:00
|
|
|
|
public TestMethod() { }
|
|
|
|
|
|
///
|
|
|
|
|
|
public TestMethod(Generic.IComponentCfg cfg)
|
2015-02-19 07:37:37 +00:00
|
|
|
|
: base(cfg)
|
|
|
|
|
|
{
|
2016-08-05 12:32:36 +00:00
|
|
|
|
testMethodCfg = cfg as TestMethodCfg;
|
2021-02-19 08:48:00 +00:00
|
|
|
|
log.Warn(this.ToString());
|
2015-02-19 07:37:37 +00:00
|
|
|
|
}
|
2021-04-03 07:39:17 +00:00
|
|
|
|
///
|
|
|
|
|
|
public override void Initialize() { }
|
2015-02-19 07:37:37 +00:00
|
|
|
|
|
2017-12-02 16:54:38 +00:00
|
|
|
|
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
|
2015-02-19 07:37:37 +00:00
|
|
|
|
{
|
2021-04-13 14:54:40 +00:00
|
|
|
|
if (DebugLevel == DebugMode.Normal)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (new PMaxTestSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.TestParams);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
/// DebugLevel == DebugMode.Simulate
|
|
|
|
|
|
(new PMaxTestSeq()).MakeSimulatedTrivial(test, repetNr, test.Part);
|
|
|
|
|
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Progress.Completed));
|
|
|
|
|
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Results.Utils.GetTestName(test.Name, 1, 1), 0)));
|
|
|
|
|
|
return new List<Event> { Event.Done };
|
|
|
|
|
|
}
|
2015-02-19 07:37:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|