This commit introduces the `IperlHeadTestCtrl` component and `NfcServices` class, including core functionality for communication with iPerl heads via NFC/RFID. It integrates configuration options, multithreaded commands processing, and logging through `log4net`.
45 lines
1009 B
C#
45 lines
1009 B
C#
///
|
|
/// Copyright (c) 2022 Sensus Slovensko a.s.
|
|
///
|
|
using TBF.Resources;
|
|
|
|
namespace TBF.Rig.TestMethods.iPerlCommunication
|
|
{
|
|
public enum ConditionID
|
|
{
|
|
A,
|
|
B,
|
|
C,
|
|
Count,
|
|
}
|
|
|
|
public class SequenceConditionOp : IOperation
|
|
{
|
|
public const string ConditionNameFmt = "iPERL communication milestone {0}";
|
|
|
|
ConditionID id;
|
|
TestMethod testMethodComponent;
|
|
|
|
public SequenceConditionOp(TestMethod testMethodComponent, ConditionID id)
|
|
{
|
|
this.testMethodComponent = testMethodComponent;
|
|
this.id = id;
|
|
}
|
|
|
|
public void Start() { }
|
|
|
|
public Event Run()
|
|
{
|
|
bool conditionMet = testMethodComponent.IperlCommMilestone[(int)id];
|
|
return conditionMet ? Event.ConditionMet : Event.ConditionNotMet;
|
|
}
|
|
|
|
public void Stop() { }
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format(ConditionNameFmt, id);
|
|
}
|
|
}
|
|
}
|