Added FLIP MODE Constant, Randomised

Add support for Flip Mode configuration in iPerl: Implement `SetFlipMode` functionality in `OptoHeadTest` and `RadioService`, integrate constants, enhance UI, and add unit and integration tests for constant/randomized flip mode settings.
This commit is contained in:
2026-08-18 13:59:59 +02:00
parent c71fe75446
commit 8738edd0c5
11 changed files with 508 additions and 20 deletions
@@ -5,6 +5,7 @@ using System.Web.UI.WebControls;
using System.Windows.Forms;
using TBF.Rig.Sequences;
using TBF.Rig.TestMethods.iPerlCommunication.communication;
using TBF.Rig.TestMethods.iPerlCommunication.communication.C4.protocolCommons;
namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
{
@@ -38,6 +39,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
new {Name = "Read Additional Common Parameters", Value = "ReadAdditionalCommonParameters" },
new {Name = "Set Test Mode", Value = "SetTestMode" },
new {Name = "Set Active Mode", Value = "SetActiveMode" },
new {Name = "Set Flip Mode Constant", Value = "SetFlipModeConstant" },
new {Name = "Set Flip Mode Randomized", Value = "SetFlipModeRandomized" },
#if DEBUG
new {Name = "Start Read Opto Data", Value = "ReadOptoData" },
new {Name = "Stop Read Opto Data", Value = "StopReadOptoData" },
@@ -143,6 +146,34 @@ namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
stopWorkerThread = true;
iPerlHead.StopDataStreamProcessing(); // close opto port
break;
case "SetFlipModeConstant":
{
if (iPerlHead == null || iPerlHead.OptoHeadTest == null)
{
rfidListItem.Text = "Set Flip Mode Constant (0x00) - FAILED: iPerl head is not available.";
break;
}
bool successful = iPerlHead.OptoHeadTest.SetFlipMode(FlipMode.DisabledConstant);
rfidListItem.Text = successful
? "Set Flip Mode Constant (0x00) - OK"
: "Set Flip Mode Constant (0x00) - FAILED";
break;
}
case "SetFlipModeRandomized":
{
if (iPerlHead == null || iPerlHead.OptoHeadTest == null)
{
rfidListItem.Text = "Set Flip Mode Randomized (0x01) - FAILED: iPerl head is not available.";
break;
}
bool successful = iPerlHead.OptoHeadTest.SetFlipMode(FlipMode.EnabledRandomized);
rfidListItem.Text = successful
? "Set Flip Mode Randomized (0x01) - OK"
: "Set Flip Mode Randomized (0x01) - FAILED";
break;
}
case "ResetNfcHead":
iPerlHead.ResetNfcInterface();
break;