70 lines
2.2 KiB
C#
70 lines
2.2 KiB
C#
///
|
|
/// Copyright (c) 2015 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|
{
|
|
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
{
|
|
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
|
|
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public int RfidPortNrBoard1;
|
|
public int RfidPortNrBoard2;
|
|
public int RfidPortNrBoard3;
|
|
public int RfidPortNrBoard4;
|
|
public int CommTimeout; /// Communication timeout in ms (500 .. 5000)
|
|
public int MaxCommRetries; /// Max. number of retries (1 .. 10)
|
|
public int NrThreads; /// Numbwr of parallel threads (1, 2 or 4)
|
|
|
|
|
|
/// <summary> Test parameters </summary>
|
|
[XmlIgnore]
|
|
public iPerlCommunicationParams TestParams;
|
|
public override IParamsProvider GetTestParams() { return TestParams; }
|
|
public override IParamsProvider CreateTestParams(Test test)
|
|
{
|
|
iPerlCommunicationParams testParams = new iPerlCommunicationParams();
|
|
testParams.UpdateTestParams(Name, test);
|
|
return testParams;
|
|
}
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
TestMethodCfg()
|
|
{
|
|
Name = "iPerlCommunication";
|
|
ParentName = string.Empty;
|
|
RfidPortNrBoard1 = 51;
|
|
RfidPortNrBoard1 = 52;
|
|
RfidPortNrBoard1 = 53;
|
|
RfidPortNrBoard1 = 54;
|
|
CommTimeout = 1800; /// ms
|
|
MaxCommRetries = 4;
|
|
NrThreads = 2; /// 1, 2 or 4 threads
|
|
|
|
TestParams = new iPerlCommunicationParams();
|
|
}
|
|
|
|
public TestMethodCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Brd#1=COM{1}, Brd#2=COM{2}, Brd#3=COM{3}, Brd#4=COM{4}, CommTimeout={5}, MaxRetries={6}, NrThreads={7}",
|
|
Name, RfidPortNrBoard1, RfidPortNrBoard2, RfidPortNrBoard3, RfidPortNrBoard4, CommTimeout, MaxCommRetries, NrThreads);
|
|
}
|
|
}
|
|
}
|