Merge branch 'master-2' of gitserver:/srv/git/tbf into master-2
This commit is contained in:
commit
bdf3d155f4
21
TBF.sln
21
TBF.sln
@ -1,6 +1,8 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33424.131
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TBF\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C8939821-BA5C-4988-A3D0-BF53B74865C7} = {C8939821-BA5C-4988-A3D0-BF53B74865C7}
|
||||
@ -92,6 +94,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeatureVectorCalculator", "
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResultsParser", "ResultsParser\ResultsParser.csproj", "{2E08C19B-C0A9-4056-8564-E5B74477959D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sensus.iPerl.RfidCom", "..\iPerlHead\Sensus.iPerl.RfidCom\Sensus.iPerl.RfidCom.csproj", "{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -386,8 +390,23 @@ Global
|
||||
{2E08C19B-C0A9-4056-8564-E5B74477959D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{2E08C19B-C0A9-4056-8564-E5B74477959D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{2E08C19B-C0A9-4056-8564-E5B74477959D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A3E14180-7F00-42E5-94A9-8DB62EAD6EE8}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A7C8EF35-DF72-4DFC-83F7-9641AC1178CF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
97
TBF/Rig/TestMethods/iPerlCommunication/OpticalHeadTest.cs
Normal file
97
TBF/Rig/TestMethods/iPerlCommunication/OpticalHeadTest.cs
Normal file
@ -0,0 +1,97 @@
|
||||
using Sensus.iPerl.RfidCom.Helper;
|
||||
using Sensus.iPerl.RfidCom.Services;
|
||||
using Sensus.iPerl.RfidCom.Structures;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using TBF.Rig.TestMethods.iPerlCommunication.iPerlHead;
|
||||
|
||||
namespace TBF.Rig.TestMethods.iPerlCommunication
|
||||
{
|
||||
internal class OpticalHeadTest
|
||||
{
|
||||
internal static string OpenSealing(IperlHead iHead)
|
||||
{
|
||||
if (RfidCommands.OpenSealing($"COM{iHead.RfidComPortNr}")) return "OK";
|
||||
return "Error Open Sealing";
|
||||
}
|
||||
|
||||
internal static string ReadRequest_PCB(IperlHead iHead)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] pcb = null;
|
||||
int readRetVal = iPerlCommunicationForm.ReadRequestPort(iHead, MessageID.Configuration, 16, 5, out pcb);
|
||||
if (readRetVal == 0)
|
||||
{
|
||||
return RfidHelper.HexLiteral2Unsigned(RfidHelper.SwapHexcode(BitConverter.ToString(pcb).Replace("-", string.Empty))).ToString();
|
||||
}
|
||||
return "Error";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
internal static string SetActiveMode(IperlHead iHead)
|
||||
{
|
||||
return RfidCommands.SetActiveMode($"COM{iHead.RfidComPortNr}") ? "OK" : "Error Set Active Mode";
|
||||
}
|
||||
|
||||
internal static string SetTestMode(IperlHead iHead)
|
||||
{
|
||||
return RfidCommands.SetTestMode($"COM{iHead.RfidComPortNr}") ? "OK" : "Error Set Test Mode";
|
||||
}
|
||||
|
||||
internal static string TurnOffRadio(IperlHead iHead)
|
||||
{
|
||||
try
|
||||
{
|
||||
string payload = "03";
|
||||
RfidCommunicationService rfidCommunicationService = new RfidCommunicationService { ComPort = $"COM{iHead.RfidComPortNr}", WaitTimeAfterFailure = 2200, PassThroughWaitTime = 1500, MaxRetries = 3, TimeOut = 5000 };
|
||||
rfidCommunicationService.RfidWrite(Params.u8_WakeUpInterval, payload);
|
||||
return rfidCommunicationService.RfidRead(Params.u8_WakeUpInterval).ToString() == payload? "OK" : "Error";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
internal static string SetProductionMode(IperlHead iHead)
|
||||
{
|
||||
try
|
||||
{
|
||||
string payload = "01"; // 1 set the µC to the production mode, radio should not start
|
||||
RfidCommunicationService rfidCommunicationService = new RfidCommunicationService { ComPort = $"COM{iHead.RfidComPortNr}", WaitTimeAfterFailure = 2200, PassThroughWaitTime = 1500, MaxRetries = 3, TimeOut = 5000 };
|
||||
rfidCommunicationService.RfidWrite(SystemInfo.u8_system_state, payload);
|
||||
Thread.Sleep(1000); // must be for pass thru params
|
||||
return rfidCommunicationService.RfidRead(SystemInfo.u8_system_state).ToString() == payload ? "OK" : "Error";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (ex.Message.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
internal static string WriteRequestPort_u8_Customer_Text(IperlHead iHead)
|
||||
{
|
||||
string custText = "FF0123456789ABCDEF"; // Sample text to test write function
|
||||
try
|
||||
{
|
||||
byte[] cmd = RfidHelper.HexStringToByteArray(custText);
|
||||
if (0 == iPerlCommunicationForm.WriteRequestPort(iHead, MessageID.RadioPassthrough, 0x1899, 9, cmd))
|
||||
{
|
||||
RfidCommunicationService rfidCommunicationService = new RfidCommunicationService { ComPort = $"COM{iHead.RfidComPortNr}", WaitTimeAfterFailure = 2200, PassThroughWaitTime = 1500, MaxRetries = 3, TimeOut = 5000 };
|
||||
//rfidCommunicationService.RfidWrite(Params.u8_Customer_Text, custText);
|
||||
return rfidCommunicationService.RfidRead(Params.u8_Customer_Text).ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return (ex.Message.ToString());
|
||||
}
|
||||
return $"Error COM{iHead.RfidComPortNr}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,8 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
||||
public int CommTimeout; /// Communication timeout in ms (500 .. 5000)
|
||||
public int DelayBetweenRetries; /// Delay between communication retries in ms (0 .. 5000)
|
||||
public int MaxCommRetries; /// Max. number of retries (1 .. 10)
|
||||
public int WaitTimeAfterFailure; /// Wait time after communication failure in ms
|
||||
public int PassThroughWaitTime; /// Pass Through wait time for radio parameters in ms
|
||||
public int NrThreads; /// Numbwr of parallel threads (1, 2 or 4)
|
||||
public int IperlCheckErrorsToStop;
|
||||
|
||||
@ -59,7 +61,9 @@ namespace TBF.Rig.TestMethods.iPerlCommunication
|
||||
ParentName = string.Empty;
|
||||
CommTimeout = 1800; /// ms
|
||||
MaxCommRetries = 4;
|
||||
NrThreads = 2; /// 1, 2 or 4 threads
|
||||
WaitTimeAfterFailure = 2200;
|
||||
PassThroughWaitTime = 1500;
|
||||
NrThreads = 2; /// 1, 2 or 4 threads
|
||||
IperlCheckErrorsToStop = 10;
|
||||
|
||||
TestParams = CreateTestParamsProvider() as iPerlCommunicationParams;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -44,7 +44,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@ -55,7 +55,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -66,7 +66,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
@ -77,7 +77,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>TBF.Program</StartupObject>
|
||||
@ -1616,6 +1616,7 @@
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\iPerlHead\OptoReceivedEventArgs.cs" />
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\iPerlHead\ProcParams.cs" />
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\iPerlHead\StatusStruct.cs" />
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\OpticalHeadTest.cs" />
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\SequenceConditionOp.cs" />
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\TestMethod.cs" />
|
||||
<Compile Include="Rig\TestMethods\iPerlCommunication\TestMethodCfg.cs" />
|
||||
@ -3783,6 +3784,10 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\iPerlHead\Sensus.iPerl.RfidCom\Sensus.iPerl.RfidCom.csproj">
|
||||
<Project>{a3e14180-7f00-42e5-94a9-8db62ead6ee8}</Project>
|
||||
<Name>Sensus.iPerl.RfidCom</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
|
||||
<Name>Common</Name>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user