2015-08-11 06:50:32 +00:00
|
|
|
|
///
|
2021-08-29 07:49:34 +00:00
|
|
|
|
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
2015-08-11 06:50:32 +00:00
|
|
|
|
///
|
|
|
|
|
|
using System.Collections.Generic;
|
2025-09-07 15:42:26 +00:00
|
|
|
|
using System.IO.Ports;
|
|
|
|
|
|
using System.Threading;
|
2015-08-11 06:50:32 +00:00
|
|
|
|
using System.Xml.Serialization;
|
2021-05-27 15:30:04 +00:00
|
|
|
|
using Common;
|
2015-12-04 16:17:20 +00:00
|
|
|
|
using Config.Entities;
|
2021-03-05 13:47:21 +00:00
|
|
|
|
using TBF.Rig.Generic;
|
2025-10-18 07:59:07 +00:00
|
|
|
|
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
|
2025-11-12 11:34:29 +00:00
|
|
|
|
using TBF.Rig.TestMethods.SmartMeterFlyingStartMassCollection;
|
2015-08-11 06:50:32 +00:00
|
|
|
|
|
2021-03-05 13:47:21 +00:00
|
|
|
|
namespace TBF.Rig.TestMethods.iPerlCommunication
|
2015-08-11 06:50:32 +00:00
|
|
|
|
{
|
2025-10-27 10:49:42 +00:00
|
|
|
|
[XmlRoot("TestMethodCfg")] // Add this attribute to match the XML root
|
2025-10-18 07:59:07 +00:00
|
|
|
|
public class TestMethodCfg_IPerl : ComponentCfgBase, IiPerlTestMethodCfg
|
2015-08-11 06:50:32 +00:00
|
|
|
|
{
|
2025-10-18 07:59:07 +00:00
|
|
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg_IPerl) })[0];
|
2018-06-18 10:44:37 +00:00
|
|
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
2017-06-21 21:39:34 +00:00
|
|
|
|
|
2021-03-01 20:42:16 +00:00
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new TestMethodCfgCtrl(); }
|
2015-08-11 06:50:32 +00:00
|
|
|
|
|
2025-10-18 07:59:07 +00:00
|
|
|
|
//
|
2018-05-10 11:25:46 +00:00
|
|
|
|
public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
|
|
|
|
|
|
public override IParamsProvider CreateTestParamsProvider() { return new iPerlCommunicationParams(true); }
|
2018-05-22 13:33:07 +00:00
|
|
|
|
public override IParamsProvider GetUITestParamsProvider(Test test)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null;
|
|
|
|
|
|
}
|
2015-08-11 06:50:32 +00:00
|
|
|
|
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
2025-10-18 07:59:07 +00:00
|
|
|
|
TestMethodCfg_IPerl()
|
2015-08-11 06:50:32 +00:00
|
|
|
|
{
|
2025-11-12 11:34:29 +00:00
|
|
|
|
Name = "SmartCommunication";
|
2015-08-11 06:50:32 +00:00
|
|
|
|
ParentName = string.Empty;
|
2015-09-06 21:36:14 +00:00
|
|
|
|
CommTimeout = 1800; /// ms
|
|
|
|
|
|
MaxCommRetries = 4;
|
2025-09-07 15:42:26 +00:00
|
|
|
|
WaitTimeAfterFailure = 2200;
|
|
|
|
|
|
PassThroughWaitTime = 1500;
|
|
|
|
|
|
NrThreads = 2; /// 1, 2 or 4 threads
|
2019-03-11 12:39:11 +00:00
|
|
|
|
IperlCheckErrorsToStop = 10;
|
2025-09-07 15:42:26 +00:00
|
|
|
|
MciTimeoutMs = 4000; // ms, NFC interface
|
|
|
|
|
|
BaudRate = 57600; // NFC Interface
|
|
|
|
|
|
DataBits = 8; // NFC Interface
|
|
|
|
|
|
ParityBit = Parity.None; // NFC Interface
|
|
|
|
|
|
StopBits = StopBits.Two; // NFC Interface
|
2015-09-06 21:36:14 +00:00
|
|
|
|
|
2025-09-07 15:42:26 +00:00
|
|
|
|
TestParams = CreateTestParamsProvider() as iPerlCommunicationParams;
|
2015-08-11 06:50:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-18 07:59:07 +00:00
|
|
|
|
public TestMethodCfg_IPerl(IComponentFactory factory)
|
2015-08-11 06:50:32 +00:00
|
|
|
|
: this()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Factory = factory;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ToString(int i)
|
|
|
|
|
|
{
|
2021-08-29 07:49:34 +00:00
|
|
|
|
return string.Format("Name={0}, CommTimeout={1}, MaxRetries={2}, NrThreads={3}", Name, CommTimeout, MaxCommRetries, NrThreads);
|
2015-08-11 06:50:32 +00:00
|
|
|
|
}
|
2025-10-18 07:59:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int DelayBetweenRetries { get; set; }
|
|
|
|
|
|
public int MaxCommRetries { get; set; }
|
|
|
|
|
|
public int WaitTimeAfterFailure { get; set; }
|
|
|
|
|
|
public int PassThroughWaitTime { get; set; }
|
|
|
|
|
|
public int NrThreads { get; set; }
|
|
|
|
|
|
public int CommTimeout { get; set; }
|
|
|
|
|
|
public int IperlCheckErrorsToStop { get; set; }
|
|
|
|
|
|
public int MciTimeoutMs { get; set; }
|
|
|
|
|
|
public int BaudRate { get; set; }
|
|
|
|
|
|
public int DataBits { get; set; }
|
|
|
|
|
|
public Parity ParityBit { get; set; }
|
|
|
|
|
|
public StopBits StopBits { get; set; }
|
|
|
|
|
|
public int DfltQ2c_15_rl { get; set; }
|
|
|
|
|
|
public int DfltQ2c_15_lr { get; set; }
|
|
|
|
|
|
public int DfltQ2c_20_rl { get; set; }
|
|
|
|
|
|
public int DfltQ2c_20_lr { get; set; }
|
|
|
|
|
|
public int DfltQ2c_25_63_rl { get; set; }
|
|
|
|
|
|
public int DfltQ2c_25_63_lr { get; set; }
|
|
|
|
|
|
public int DfltQ2c_25_10_rl { get; set; }
|
|
|
|
|
|
public int DfltQ2c_25_10_lr { get; set; }
|
|
|
|
|
|
public int DfltQ2c_32_rl { get; set; }
|
|
|
|
|
|
public int DfltQ2c_32_lr { get; set; }
|
|
|
|
|
|
public int DfltQ2c_40_rl { get; set; }
|
|
|
|
|
|
public int DfltQ2c_40_lr { get; set; }
|
|
|
|
|
|
public bool UseWebService { get; set; }
|
|
|
|
|
|
public string BaseUrl { get; set; }
|
|
|
|
|
|
public string RelativeUrl { get; set; }
|
2025-10-21 08:06:29 +00:00
|
|
|
|
|
|
|
|
|
|
///Remember to Ignore in XmlSerializer !!
|
|
|
|
|
|
[XmlIgnore]
|
2025-10-18 07:59:07 +00:00
|
|
|
|
public ITestParams TestParams { get; set; }
|
2015-08-11 06:50:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|