75 lines
2.6 KiB
C#
75 lines
2.6 KiB
C#
///
|
|
/// Copyright (c) 2015-2016 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 static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
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)
|
|
public bool UseMuxBoards;
|
|
public int RfidPortNrBoard1;
|
|
public int RfidPortNrBoard2;
|
|
public int RfidPortNrBoard3;
|
|
public int RfidPortNrBoard4;
|
|
public int IperlCheckErrorsToStop;
|
|
|
|
|
|
/// <summary> Test parameters </summary>
|
|
[XmlIgnore]
|
|
public iPerlCommunicationParams TestParams;
|
|
public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
|
|
public override IParamsProvider CreateTestParamsProvider() { return new iPerlCommunicationParams(true); }
|
|
public override IParamsProvider GetUITestParamsProvider(Test test)
|
|
{
|
|
return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null;
|
|
}
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
TestMethodCfg()
|
|
{
|
|
Name = "iPerlCommunication";
|
|
ParentName = string.Empty;
|
|
CommTimeout = 1800; /// ms
|
|
MaxCommRetries = 4;
|
|
NrThreads = 2; /// 1, 2 or 4 threads
|
|
UseMuxBoards = true;
|
|
RfidPortNrBoard1 = 51;
|
|
RfidPortNrBoard1 = 52;
|
|
RfidPortNrBoard1 = 53;
|
|
RfidPortNrBoard1 = 54;
|
|
IperlCheckErrorsToStop = 10;
|
|
|
|
TestParams = CreateTestParamsProvider() as iPerlCommunicationParams;
|
|
}
|
|
|
|
public TestMethodCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, CommTimeout={1}, MaxRetries={2}, NrThreads={3}, MuxBrds={4}, Brd#1=COM{5}, Brd#2=COM{6}, Brd#3=COM{7}, Brd#4=COM{8}",
|
|
Name, CommTimeout, MaxCommRetries, NrThreads, UseMuxBoards, RfidPortNrBoard1, RfidPortNrBoard2, RfidPortNrBoard3, RfidPortNrBoard4);
|
|
}
|
|
}
|
|
}
|