Compare commits

...
Author SHA1 Message Date
michal 77cabfd712 bugfix Parallel CLI Runner 2025-10-27 11:48:22 +01:00
michal c933e2d759 test disabled 2025-10-27 11:47:38 +01:00
michal f3f0a46627 improvemnet, Sensus Developer super user added 2025-10-27 11:46:56 +01:00
michal b5fb4c2947 improvemnet, Sensus Developer super user added 2025-10-27 11:46:34 +01:00
michal f6cce9df3c bugfix Parallel CLI Runner
Additional needed classes
2025-10-27 11:42:12 +01:00
michal c0385c0782 bugfix Parallel CLI Runner
Add parallel execution tests and improve cancellation handling in `CliRunner`

- Introduced new tests (`RunMultipleTimesTestProgram_CheckParalelWork` and `RunMultipleTimesTestProgram_CheckParalelWorkCumulative`) to verify parallel execution behavior.
- Enhanced `SendAsync` and `RunAndCaptureJsonAsync` methods in `CliRunner` with `CancellationToken` support for better task cancellation.
- Refactored process output handling for improved clarity and robustness.
- Added error handling during CLI logger initialization.
2025-10-27 11:38:43 +01:00
michal db43bdb652 FlowMeter improvement
Add `FromDescription` check in `ParseFlowUnit` for better unit parsing
2025-10-27 11:29:58 +01:00
michal 6bdc10f4a7 Merge branch 'master-3' into feature/SmartMeters 2025-10-22 14:37:04 +02:00
michal 9692dc7f4f HeatMeter - columns exchange
Update `ProcedureDlg` to fix `MetersPath` ordering and version bump to 3.9.2149.0
2025-10-22 12:18:01 +02:00
michal 6795793858 Update iPerlReaderUNI configuration handling and validation
- Replace `PoseidonReader.IPerlCfgCtrl` with `RegisterReaders.iPerlReaderUNI.IPerlUniCfgCtrl` for proper configuration control.
- Add null-check and error handling in `ComponentsManagerDlg` to ensure valid default configurations.
- Mark `ITestParams` as `[XmlIgnore]` in `IPerl` configurations to avoid serialization issues.
- Minor import adjustments and functionality improvements for TestMethod classes.
2025-10-21 10:06:29 +02:00
michal a2c564d789 polishing - work now 2025-10-18 09:59:07 +02:00
michal 3bc9e731e8 Move iPerlReaderUNI.communication components to CommonRR.IPerl.communication and rename associated classes for clarity and consistency. 2025-10-14 14:20:26 +02:00
michal 95c5f09238 Working NfcC7_DLL, tests, clean up
"Remove unused NfcHanler classes and utilities"

This commit deletes several obsolete and unused files from the NfcHanler directory, including utility classes, enums, and a large command handling class. This cleanup improves code maintainability by eliminating unnecessary dependencies and clutter.
2025-10-14 13:15:31 +02:00
michal 0a45d66c0b Add SerialFirmwareDownloadTask to NfcC7_DLL for firmware upgrade handling 2025-10-09 11:01:08 +02:00
michal 96408eaef3 Merge branch 'master-3' into feature/SmartMeters
# Conflicts:
#	NfcC7_DLL/Properties/AssemblyInfo.cs
2025-10-06 11:16:36 +02:00
michal cae3ca7cdf HEAT_METERS enabled 2025-10-03 09:59:44 +02:00
michal c8adc093e0 NfcC7_DLL bug fix 2025-10-02 13:34:29 +02:00
michal 4395516216 test project 2025-10-02 13:30:59 +02:00
michal 9281b52464 Poseidon DLL - Comunication Implementation - not finall 2025-10-02 13:28:37 +02:00
michal 6571de7c32 Add NfcC7_DLL project with initial implementation and solution integration 2025-09-29 09:58:09 +02:00
michal a75d66e028 Merge branch 'refs/heads/master-3' into feature/SmartMeters
# Conflicts:
#	TBF.sln.DotSettings.user
2025-09-27 10:27:40 +02:00
michal e839148a6f Ignore .DotSettings.user file 2025-09-27 10:05:09 +02:00
michal 65b502a9b1 Remove TBF.sln.DotSettings.user file 2025-09-27 09:54:47 +02:00
michal 9cde62b2e2 packages added to git
Add `System.Net.Sockets.xml` documentation for zh-Hant locale in `netstandard1.3` API reference.
2025-09-27 09:53:21 +02:00
michal cc86c38246 Update user credentials in Utils.cs 2025-09-26 16:22:00 +02:00
michal 357df87f49 feature/Enhanced_Writer_NoSeparator_AndName 2025-09-26 15:10:34 +02:00
michal 4b33da565c Untrack TBF.sln.DotSettings.user 2025-09-26 15:02:15 +02:00
michal d11f855325 Update .DotSettings.user file with new ResxEditorPersonal configurations 2025-09-26 14:54:22 +02:00
michal 97eed27458 Update .DotSettings.user to include Nullable<T>.cs in force-included files. 2025-09-26 14:18:19 +02:00
michal fe08550dc3 iPerlReaderUNI.Factory => TBF components 2025-09-25 16:24:10 +02:00
michal 8a0ae8080f refactor - completisation Smart Meter <= iPerl 2025-09-24 11:57:47 +02:00
michal ab4025e55f Add ISmartTestMethod interface and initial designer file for iPerlCommunicationForm in SharedDialogs 2025-09-23 11:14:04 +02:00
michal 22fffe602c iPerl Reader - NOT FINISHED
Add initial implementation for `iPerlReaderUNI` with `Factory`, `ProcParams`, and `IPerlReader` classes.
2025-09-23 11:10:55 +02:00
204 changed files with 97736 additions and 694 deletions
+3
View File
@@ -32,6 +32,8 @@ LabelPrinting/bin/
LabelPrinting/obj/
MergeResultsDBs/bin/
MergeResultsDBs/obj/
NfcC7_Dll/bin/
NfcC7_Dll/obj/
OrderManagement/bin/
OrderManagement/obj/
ProductionTracing/bin/
@@ -86,3 +88,4 @@ Users/obj/
.idea/
*.suo
*.bak
TBF.sln.DotSettings.user
+4 -1
View File
@@ -302,7 +302,7 @@ namespace Common
string passwordOfDay = Convert.ToString(number, 8);
return (userName.Equals("milan") && password.Equals("kraken")) ||
(userName.Equals("michal") && password.Equals("70630")) ||
(userName.Equals("BuMi") && password.Equals("70630")) ||
(userName.Equals("igor") && password.Equals("mojronko8")) ||
(userName.Equals("lubo1212") && password.Equals("Tatry52")) ||
(userName.Equals("Michal") && password.Equals("Plok789456123")) ||
@@ -311,6 +311,9 @@ namespace Common
(userName.Equals("jan") && password.Equals("jaugust")) ||
(userName.Equals("JCermak") && password.Equals("Zt6911")) ||
(userName.Equals("gilles") && password.Equals("alibaba")) ||
#if DEBUG
(userName.Equals("Sensus Developers") && password.Equals("5fbg12gf5hn8nhy1fr")) ||
#endif
(userName.Equals(passwordOfDay) && password.Equals(passwordOfDay));
}
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<DefineConstants>TRACE;DEBUG;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW;</DefineConstants>
<DefineConstants>TRACE;JUZNA_AFRIKA_NEW;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -23,7 +23,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;</DefineConstants>
<DefineConstants>DEBUG;TRACE;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
@@ -32,7 +32,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;</DefineConstants>
<DefineConstants>TRACE;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+20
View File
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.10.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.10.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NfcC7_DLL\NfcC7_DLL.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,87 @@
using System;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NfcC7_DLL.NfcHanler;
using NfcC7_DLL.NfcHanler.Protocols;
using NfcC7_DLL.NfcHanler.Utils;
namespace NfcC7_DLL.Tests.NfcHanler;
[TestClass]
[TestSubject(typeof(NFCHeadService))]
public class NFCHeadServiceTest
{
[TestMethod]
public void SetTestingMode_Optohead_C7_ON_LiveMeterTest()
{
SerialPortData serialPortData = new SerialPortData(
"COM5",
"HatCliDemo.exe",
74);
NFCHeadService service = new NFCHeadService(serialPortData);
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadC7);
Assert.AreEqual(OptoHeadStatus.OptoHeadC7, status);
}
[TestMethod]
public void SetTestingMode_Optohead_OFF_LiveMeterTest()
{
SerialPortData serialPortData = new SerialPortData(
"COM5",
"HatCliDemo.exe",
74);
NFCHeadService service = new NFCHeadService(serialPortData);
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadDisabled);
Assert.AreEqual(OptoHeadStatus.OptoHeadDisabled, status);
}
[TestMethod]
public void SetTestingMode_LiveMeterTest()
{
SerialPortData serialPortData = new SerialPortData(
"COM5",
"HatCliDemo.exe",
74);
NFCHeadService service = new NFCHeadService(serialPortData);
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadC2);
Assert.AreEqual(OptoHeadStatus.OptoHeadC2, status);
status = service.SetTestingMode(OptoHeadStatus.OptoHeadC7);
Assert.AreEqual(OptoHeadStatus.OptoHeadC7, status);
status = service.SetTestingMode(OptoHeadStatus.OptoHeadDisabled);
Assert.AreEqual(OptoHeadStatus.OptoHeadDisabled, status);
}
[TestMethod]
public void GetSerialNr_LiveMeterTest()
{
SerialPortData serialPortData = new SerialPortData(
"COM5",
"HatCliDemo.exe",
74);
NFCHeadService service = new NFCHeadService(serialPortData);
string? serialNr = service.GetSerialNr();
Assert.IsFalse(string.IsNullOrEmpty(serialNr));
Console.WriteLine("Found serial no: {0}",serialNr);
}
[TestMethod]
public void GetTestingMode_LiveMeterTest()
{
SerialPortData serialPortData = new SerialPortData(
"COM5",
"HatCliDemo.exe",
74);
NFCHeadService service = new NFCHeadService(serialPortData);
OptoHeadStatus status = service.GetTestingMode();
Assert.IsFalse(OptoHeadStatus.Unknown == status);
}
}
@@ -0,0 +1,71 @@
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Helpers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NfcC7_DLL.NfcHanler;
using NfcC7_DLL.NfcHanler.Protocols;
using NfcC7_DLL.NfcHanler.Utils;
namespace NfcC7_DLL.Tests.NfcHanler;
[TestClass]
[TestSubject(typeof(OptoHeadService))]
public class OptoHeadServiceTest
{
[TestMethod]
public void RunLoop_Test()
{
//Switch meter to Optohead C7 testing mode
SerialPortData serialPortData = new SerialPortData(
"COM5",
"HatCliDemo.exe",
74);
NFCHeadService service = new NFCHeadService(serialPortData);
OptoHeadStatus status = service.SetTestingMode(OptoHeadStatus.OptoHeadC7);
Assert.AreEqual(OptoHeadStatus.OptoHeadC7, status);
//Open serial connection to Optohead
OptoHeadService.Con con = new OptoHeadService.Con();
con.com = "COM6";
OptoHeadService optoHeadService = new OptoHeadService(con);
Assert.IsTrue(optoHeadService.CreateSerialConnection());
//start loop to receive data
optoHeadService.RunLoop();
WaterMetrologyData lastData = null;
int iCycles = 0, iCyclesMax = 10;
for (int i = 0; i < iCyclesMax; i++)
{
bool finished = false;
while (!finished)
{
//optoHeadService.Run();
if (optoHeadService.WaterMetrologyData != null
&& lastData != optoHeadService.WaterMetrologyData
&& optoHeadService.WaterMetrologyData.OptoHeadStatus != OptoHeadStatus.Unknown)
{
lastData = optoHeadService.WaterMetrologyData;
finished = true;
iCycles++;
if (lastData.OptoHeadStatus.HasFlag(OptoHeadStatus.OptoHeadC7))
{
Assert.IsNotNull(lastData.C7Data);
}
else
{
Assert.IsNotNull(lastData.C2Data);
}
System.Console.WriteLine("Cycle: {0} lastData: {1}", iCycles, lastData);
}
}
}
optoHeadService.CloseSerialConnection();
Assert.IsTrue(iCycles > 0);
Assert.IsTrue(iCycles == iCyclesMax);
//Close Optohead
status = service.SetTestingMode(OptoHeadStatus.OptoHeadDisabled);
Assert.AreEqual(OptoHeadStatus.OptoHeadDisabled, status);
}
}
@@ -0,0 +1,224 @@
using System;
using System.IO.Ports;
using JetBrains.Annotations;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NfcC7_DLL.NfcHanler.Utils;
namespace NfcC7_DLL.Tests.NfcHanler.Utils;
//[TestClass]
[TestSubject(typeof(SERIAL_Driver))]
public class SERIAL_DriverTest
{
private class Con
{
public string com = "COM5";
public int baudrate = 38400;
public int dataBits = 8;
public Parity parity = Parity.None;
public StopBits stopbits = StopBits.Two;
public int readTimeout = 5000;
public int writeTimeout = 1000;
}
private readonly byte[] Open =
{ 0x6B, 0x80, 0x01, 0x10, 0x00, 0x30, 0x00, 0x47, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x49, 0x50, 0x65, 0x72,
0x6C, 0x55, 0x74, 0x69, 0x6C, 0x69, 0x74, 0x79, 0x00, 0x00, 0x27, 0xD7 };
private readonly byte[] CommDeviceSessionEnd = { 0x6B, 0x61, 0x00, 0x10, 0x05, 0x31, 0x00, 0x1F, 0x29, 0xF9, 0xC5 };
private readonly byte[] ProductDetails =
{ 0x6B, 0x30, 0x01, 0x10, 0x03, 0x21, 0x01, 0x02, 0x6B, 0x90, 0x00, 0x00, 0x11, 0x40, 0x05, 0x00, 0x02, 0x04, 0x60, 0x62, 0x42, 0x04, 0xA5, 0x64 };
private readonly byte[] ProductDetails2 =
{ 0x6B, 0x30, 0x01, 0x10, 0x03, 0x21, 0x01, 0x02, 0x6B, 0x90, 0x00, 0x00, 0x11, 0x40, 0x05, 0x00, 0x02, 0x04, 0x60 };
static Con con5 = new Con(){
com = "COM5",
baudrate = 38400,
dataBits = 8,
parity = Parity.None,
stopbits = StopBits.Two,
readTimeout = 5000,
writeTimeout = 1000
};
static Con con6 = new Con()
{
com = "COM6",
baudrate = 38400,
dataBits = 8,
parity = Parity.None,
stopbits = StopBits.Two,
readTimeout = 5000,
writeTimeout = 1000
};
//[TestMethod]
public void SendMessage_Test()
{
Con con = con5;
byte[] message = Open;
byte[] bytesReceived;
SERIAL_Driver driver = new SERIAL_Driver();
bool isopen = driver.OpenConnection(
con.com,
con.baudrate,
con.dataBits,
con.parity,
con.stopbits,
con.readTimeout,
con.writeTimeout);
Assert.IsTrue(isopen);
driver.SendMessage(message, message.Length);
//Assert.IsTrue(driver.GetRawData().Length == 0);
bytesReceived = driver.GetRawData();
//Assert.IsTrue(bytesReceived.Length > 0);
Console.WriteLine("IsOpened: {0}", driver.isOpen());
// Display raw bytes (as hex or byte count)
if (bytesReceived != null)
{
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
Console.WriteLine("Bytes string: {0}", response);
}
// --- Get Serial No ---
message = ProductDetails;
// Send Open message
bool sendSuccess = driver.SendMessage(message, message.Length);
Assert.IsTrue(sendSuccess, "Failed to send Open message");
Console.WriteLine("Sent message for product details: {0}", message.ToString());
bytesReceived = driver.GetRawData();
// Display raw bytes (as hex or byte count)
if (bytesReceived != null)
{
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
Console.WriteLine("Bytes string: {0}", response);
}
else
{
Console.WriteLine("Response not received!");
}
message = CommDeviceSessionEnd;
driver.SendMessage(message, message.Length);
driver.Close();
}
//[TestMethod]
public void SendMessage_TestLoop()
{
Con con = con6;
byte[] message = {0x00};
byte[] bytesReceived;
SERIAL_Driver driver = new SERIAL_Driver();
bool isopen = driver.OpenConnection(
con.com,
con.baudrate,
con.dataBits,
con.parity,
con.stopbits,
con.readTimeout,
con.writeTimeout);
Assert.IsTrue(isopen);
for (int iStep = 0; iStep < 100; iStep++)
{
driver.SendMessage(message, message.Length);
//Assert.IsTrue(driver.GetRawData().Length == 0);
bytesReceived = driver.GetRawData();
Assert.IsTrue(bytesReceived.Length > 0);
Console.WriteLine("IsOpened: {0}", driver.isOpen());
// Display raw bytes (as hex or byte count)
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
Console.WriteLine("Bytes string: {0}", response);
}
//message = CommDeviceSessionEnd;
//driver.SendMessage(message, message.Length);
driver.CloseConnection();
}
//[TestMethod]
public void SendMessage_TestGetSerialNo()
{
Con con = con6;
byte[] message = Open;
byte[] bytesReceived;
SERIAL_Driver driver = new SERIAL_Driver();
bool isopen = driver.OpenConnection(
con.com,
con.baudrate,
con.dataBits,
con.parity,
con.stopbits,
con.readTimeout,
con.writeTimeout);
Assert.IsTrue(isopen);
driver.SendMessage(message, message.Length,con.readTimeout);
//Assert.IsTrue(driver.GetRawData().Length == 0);
bytesReceived = driver.GetRawData();
Assert.IsTrue(bytesReceived.Length > 0);
if (bytesReceived[0] == 0xFF)
Console.WriteLine("Error message: {0}", driver.ErrorMessage);
// Display raw bytes (as hex or byte count)
Console.WriteLine("IsOpened: {0}", driver.isOpen());
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
string response = System.Text.Encoding.UTF8.GetString(bytesReceived);
Console.WriteLine("Bytes string: {0}",response);
// --- Get Serial No ---
message = ProductDetails;
driver.SendMessage(message, message.Length,con.readTimeout);
bytesReceived = driver.GetRawData();
Assert.IsTrue(bytesReceived.Length > 0);
if (bytesReceived[0] == 0xFF)
Console.WriteLine("Error message: {0}", driver.ErrorMessage);
// Display raw bytes (as hex or byte count)
Console.WriteLine("IsOpened: {0}", driver.isOpen());
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
response = System.Text.Encoding.UTF8.GetString(bytesReceived);
Console.WriteLine("Bytes string: {0}",response);
// --- Get Serial No ---
message = ProductDetails2;
driver.SendMessage(message, message.Length,con.readTimeout);
bytesReceived = driver.GetRawData();
Assert.IsTrue(bytesReceived.Length > 0);
if (bytesReceived[0] == 0xFF)
Console.WriteLine("Error message: {0}", driver.ErrorMessage);
// Display raw bytes (as hex or byte count)
Console.WriteLine("IsOpened: {0}", driver.isOpen());
Console.WriteLine(string.Format("Bytes received: {0}", bytesReceived.Length));
Console.WriteLine(string.Format("Bytes (hex): {0}", BitConverter.ToString(bytesReceived)));
response = System.Text.Encoding.UTF8.GetString(bytesReceived);
Console.WriteLine("Bytes string: {0}",response);
message = CommDeviceSessionEnd;
driver.SendMessage(message, message.Length);
driver.Close();
}
}
+52
View File
@@ -0,0 +1,52 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Copyright>Copyright © 2025</Copyright>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>TRACE;IPERL;</DefineConstants>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE;IPERL;</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="System.IO.Ports" Version="10.0.0-rc.1.25451.107" />
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
<PackageReference Include="System.Threading" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="NA2WNFC">
<HintPath>NfcHanler\NfcReaderLibrary\NA2WNFC.dll</HintPath>
</Reference>
<Reference Include="OBIDISC4NET">
<HintPath>NfcHanler\NfcReaderLibrary\OBIDISC4NET.dll</HintPath>
</Reference>
<Reference Include="OBIDISC4NETnative">
<HintPath>NfcHanler\NfcReaderLibrary\OBIDISC4NETnative.dll</HintPath>
</Reference>
<Reference Include="OBIDISC4NET_API">
<HintPath>NfcHanler\NfcReaderLibrary\OBIDISC4NET_API.dll</HintPath>
</Reference>
<Reference Include="PresentationCore">
<HintPath>..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework">
<HintPath>..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll</HintPath>
</Reference>
<Reference Include="Sensus">
<HintPath>NfcHanler\FieldLogicLibrary\Sensus.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
+9
View File
@@ -0,0 +1,9 @@
using NfcC7_DLL.NfcHanler.Protocols;
namespace NfcC7_DLL.NfcHanler;
public class HeadInfo
{
string SerialNr { get; set; }
OptoHeadStatus OptoHeadStatus { get; set; }
}
@@ -0,0 +1,22 @@
namespace NfcC7_DLL.NfcHanler
{
public class JsonDataFromPoseidon
{
public bool? NfcTagDetected { get; set; }
public int? ProductType { get; set; }
public string ProductTypeVersion { get; set; }
public string DeviceId { get; set; }
public string Reading { get; set; }
public string Reading_Totalizer { get; set; }
public string Reading_Digits { get; set; }
public string Reading_Shift { get; set; }
public string Reading_Resolution { get; set; }
public string Reading_Units { get; set; }
public string Reading_FlowDirection { get; set; }
public string Reading_FlowRate { get; set; }
public string CalibrationFactor { get; set; }
public bool? ReadingComplete { get; set; }
}
}
+216
View File
@@ -0,0 +1,216 @@
using System.Text.RegularExpressions;
using System.Windows;
using NfcC7_DLL.NfcHanler.Protocols;
using NfcC7_DLL.NfcHanler.Utils;
namespace NfcC7_DLL.NfcHanler;
public class NFCHeadService
{
private bool activeHandlerSessioEnabled = false;
private CliRunner _cliRunner;
private SerialPortData serialPort;
public NFCHeadService(SerialPortData serialPort)
{
this.serialPort = serialPort;
ValidateCliFileExistence(true);
}
private CliRunner CliRunner
{
get
{
return (_cliRunner != null ?
_cliRunner :
(_cliRunner = new CliRunner(CliLogging)));
}
}
private bool CliLogging{get {return false; }}
private static readonly Regex OpticalDataModeRegex = new Regex(
@"(?im)(?:" +
@"^\s*OpticalDataMode\s*Id\s*:\s*([^\r\n]+)\s*$" + // old format
@"|" +
@"""OpticalDataMode""\s*:\s*""?(0x[0-9A-Fa-f]+|\d+)""?" + // JSON format (handles hex and decimal)
@")",
RegexOptions.Compiled);
public bool TryGetOpticalDataMode(string result, out string s)
{
s = null;
if (string.IsNullOrEmpty(result))
return false;
var m = OpticalDataModeRegex.Match(result);
if (!m.Success)
return false;
// one of the groups will be filled
s = !string.IsNullOrEmpty(m.Groups[1].Value)
? m.Groups[1].Value.Trim()
: m.Groups[2].Value.Trim();
return true;
}
private static readonly Regex DeviceIdRegex = new Regex(
@"(?im)(?:" +
@"^\s*Device\s*Id\s*:\s*([^\r\n]+)\s*$" + // old format
@"|" +
@"""DeviceId""\s*:\s*""?([0-9]+)""?" + // JSON format
@")",
RegexOptions.Compiled);
public bool TryGetDeviceId(string result, out string s)
{
s = null;
if (string.IsNullOrEmpty(result))
return false;
var m = DeviceIdRegex.Match(result);
if (!m.Success)
return false;
// one of the groups will be filled
s = !string.IsNullOrEmpty(m.Groups[1].Value)
? m.Groups[1].Value.Trim()
: m.Groups[2].Value.Trim();
return true;
}
private void ValidateCliFileExistence(bool showErrorIfMissing)
{
if (serialPort != null)
{
if (!serialPort.CliExists)
{
throw new Exception("CLI file " + serialPort.SerialPortCmdClientPath + " does not exist! Current path: " + Environment.CurrentDirectory);
}
}
}
/// <summary>
/// ////////////
/// </summary>
public string? GetSerialNr()
{
if (serialPort == null)
throw new Exception("Serial port not initialized");
Task optoheadDeviceIdTask = CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.DeviceId);
var timeOut = CliRunner.AddTimeOut(5000);
var doneTask = CliRunner.WhenAny();
if (timeOut == doneTask)
{
throw new Exception("Timeout");
}
else
{
if (optoheadDeviceIdTask is Task<string>)
{
string serialNr;
if (optoheadDeviceIdTask.Status == TaskStatus.Faulted)
throw new Exception("Error TaskStatus.Faulted");
string result = (optoheadDeviceIdTask as Task<string>).Result;
if (TryGetDeviceId(result, out serialNr))
{
return serialNr;
}
}
}
return null;
}
public OptoHeadStatus SetTestingMode(OptoHeadStatus status)
{
if (serialPort == null)
throw new Exception("Serial port not initialized");
Task optoheadMode = CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.Optohead, $"0x{((byte)status):X2}");
var timeOut = CliRunner.AddTimeOut(5000);
var doneTask = CliRunner.WhenAny();
if (timeOut == doneTask)
{
throw new Exception("Timeout");
}
else
{
if (optoheadMode is Task<string>)
{
string strOpticalDataMode;
if (optoheadMode.Status == TaskStatus.Faulted)
throw new Exception("Error TaskStatus.Faulted");
string result = (optoheadMode as Task<string>).Result;
if (TryGetOpticalDataMode(result, out strOpticalDataMode))
{
byte value;
if (strOpticalDataMode.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
value = Convert.ToByte(strOpticalDataMode, 16); // interpret as hex
else
value = Convert.ToByte(strOpticalDataMode); // interpret as decimal
OptoHeadStatus optoheadStatus = (OptoHeadStatus)value;
return optoheadStatus;
}
}
}
return OptoHeadStatus.Unknown;
}
public OptoHeadStatus GetTestingMode()
{
if (serialPort == null)
throw new Exception("Serial port not initialized");
Task optoheadMode = CliRunner.AddSendAsync(serialPort, SerialPortData.EMeterArg.Optohead);
var timeOut = CliRunner.AddTimeOut(5000);
var doneTask = CliRunner.WhenAny();
if (timeOut == doneTask)
{
throw new Exception("Timeout");
}
else
{
if (optoheadMode is Task<string>)
{
string strOpticalDataMode;
if (optoheadMode.Status == TaskStatus.Faulted)
throw new Exception("Error TaskStatus.Faulted");
string result = (optoheadMode as Task<string>).Result;
if (TryGetOpticalDataMode(result, out strOpticalDataMode))
{
byte value;
if (strOpticalDataMode.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
value = Convert.ToByte(strOpticalDataMode, 16); // interpret as hex
else
value = Convert.ToByte(strOpticalDataMode); // interpret as decimal
OptoHeadStatus optoheadStatus = (OptoHeadStatus)value;
return optoheadStatus;
}
}
}
return OptoHeadStatus.Unknown;
}
private void SendCommand()
{
}
private string RawDataAnswer()
{
return "";
}
}
+109
View File
@@ -0,0 +1,109 @@
using System.IO.Ports;
using System.Windows.Documents;
using NfcC7_DLL.NfcHanler.Protocols;
using NfcC7_DLL.NfcHanler.Utils;
namespace NfcC7_DLL.NfcHanler;
public class OptoHeadService
{
public class Con
{
public string com = "COM5";
public int baudrate = 38400;
public int dataBits = 8;
public Parity parity = Parity.None;
public StopBits stopbits = StopBits.Two;
public int readTimeout = 5000;
public int writeTimeout = 1000;
}
private Con Connection { get; set; }
private SERIAL_Driver driver;
/// <summary>
/// Filed After Run() is called.
/// </summary>
public WaterMetrologyData? WaterMetrologyData { get; private set; }
public OptoHeadService(Con con)
{
Connection = con;
driver = new SERIAL_Driver();
}
public bool CreateSerialConnection()
{
bool isopen = false;
Con con = Connection;
byte[] message = {0x00};
byte[] bytesReceived;
if (!driver.isOpen())
{
isopen = driver.OpenConnection(
con.com,
con.baudrate,
con.dataBits,
con.parity,
con.stopbits,
con.readTimeout,
con.writeTimeout);
}
return isopen;
}
public void CloseSerialConnection()
{
dissableRunLoop = true;
driver.Close();
}
public void RunLoop()
{
Task.Run(() => Run());
}
private bool dissableRunLoop = false;
/// <summary>
/// Run the service. Catch one communication to WaterMetrologyData field.
/// </summary>
public void Run()
{
while (!dissableRunLoop)
{
WaterMetrologyData = ParseData(RunReading());
}
}
byte[] RunReading()
{
if (driver.isOpen())
{
driver.SendMessage(new byte[] {0x00}, 1);
return driver.GetRawData();
}
else
{
dissableRunLoop = true;
}
return [0xFF];
}
public WaterMetrologyData? ParseData(byte[] data)
{
try
{
return WaterMetrologyData.Parse(data, DateTime.Now, "");
}catch(Exception e)
{
return null;
}
}
}
@@ -0,0 +1,9 @@
namespace NfcC7_DLL.NfcHanler.Protocols;
public enum OptoHeadStatus : byte
{
Unknown = 0xFF,
OptoHeadDisabled = 0x00,
OptoHeadC2 = 0xC2,
OptoHeadC7 = 0xC7,
}
@@ -0,0 +1,41 @@
namespace NfcC7_DLL.NfcHanler.Protocols;
public class WaterMetrologyData
{
private OptoHeadStatus _optoHeadStatus;
private WaterMetrologyDataC7 c7Data;
private WaterMetrologyDataC2 c2Data;
public WaterMetrologyDataC7 C7Data { get => c7Data; }
public WaterMetrologyDataC2 C2Data { get => c2Data; }
public OptoHeadStatus OptoHeadStatus { get => _optoHeadStatus; }
public static WaterMetrologyData? Parse(byte[] data, DateTime dt, string dutinfo)
{
if (data.Length < 24)
{
throw new ArgumentException("Invalid data length for WaterMetrologyData C2.");
}
WaterMetrologyData waterMetrologyData = new WaterMetrologyData();
waterMetrologyData._optoHeadStatus = OptoHeadStatus.Unknown;
// Probably C2
if(data.Length > 24 && data.Length < 48)
{
waterMetrologyData.c2Data = WaterMetrologyDataC2.Parse(data, dt, dutinfo);
waterMetrologyData._optoHeadStatus = OptoHeadStatus.OptoHeadC2;
}
// Probably C7
else if(data.Length >= 48)
{
waterMetrologyData.c7Data = WaterMetrologyDataC7.Parse(data, dt, dutinfo);
waterMetrologyData._optoHeadStatus = OptoHeadStatus.OptoHeadC7;
}
return waterMetrologyData;
}
public override string ToString()
{
return $"Status: {_optoHeadStatus}, C7Data: {c7Data}, C2Data: {c2Data}";
}
}
@@ -0,0 +1,91 @@
namespace NfcC7_DLL.NfcHanler.Protocols
{
public class WaterMetrologyDataC2
{
public string DutInfo { get; set; }
public DateTime Dt { get; set; }
public int AdcSample { get; set; }
public short LastField { get; set; }
public short FlowRate { get; set; }
public uint Accumulator { get; set; }
public ushort FlipPeriod { get; set; }
public ushort VinfStart { get; set; }
public ushort VinfEnd { get; set; }
public short ElectrodeDelta { get; set; }
public ushort Impedance { get; set; }
public byte FieldDriveTime { get; set; }
public bool IsInLowFlow { get; set; }
public bool IsInEmptyPipe { get; set; }
public bool FastHPFC { get; set; }
public bool FieldPolarity { get; set; }
public bool ImpedancePolarity { get; set; }
public double CalcFlowmLps
{
get { return FlowRate / 4.0; } // FlowRate is in 1/4 mL/s
}
public double CalcFlowGPM
{
get { return CalcFlowmLps * 0.015850323141489; } // mL/s to gal/min conversion
}
public double CalcAccGal
{
get { return (Accumulator / 4.0) * 0.000264172; } // Accumulator is in 1/4 mL, convert to gallons
}
public static WaterMetrologyDataC2 Parse(string base64Data, DateTime dt, string dutinfo)
{
byte[] data = Convert.FromBase64String(base64Data);
return Parse(data, dt, dutinfo);
}
public static WaterMetrologyDataC2 Parse(byte[] data, DateTime dt, string dutinfo)
{
if (data.Length < 24)
{
throw new ArgumentException("Invalid data length for WaterMetrologyData C2.");
}
WaterMetrologyDataC2 result = new WaterMetrologyDataC2();
result.DutInfo = dutinfo;
result.Dt = dt;
result.AdcSample = BitConverter.ToInt32(data, 0);
result.LastField = BitConverter.ToInt16(data, 4);
result.FlowRate = BitConverter.ToInt16(data, 6);
result.Accumulator = BitConverter.ToUInt32(data, 8);
result.FlipPeriod = BitConverter.ToUInt16(data, 12);
result.VinfStart = BitConverter.ToUInt16(data, 14);
result.VinfEnd = BitConverter.ToUInt16(data, 16);
result.ElectrodeDelta = BitConverter.ToInt16(data, 18);
result.Impedance = BitConverter.ToUInt16(data, 20);
result.FieldDriveTime = data[22];
byte flags = data[23];
result.IsInLowFlow = (flags & 0x01) != 0;
result.IsInEmptyPipe = (flags & 0x02) != 0;
result.FastHPFC = (flags & 0x04) != 0; // Fast High Pass Filter Constant in bit 2
result.FieldPolarity = (flags & 0x08) != 0; // Field Polarity in bit 3
result.ImpedancePolarity = (flags & 0x10) != 0; // Impedance Polarity in bit 4
return result;
}
//public override string ToString()
//{
// return $"ADC Sample: {AdcSample}, Last Field: {LastField}, Flow Rate: {FlowRate}, Accumulator: {Accumulator}, " +
// $"Flip Period Ticks: {FlipPeriodTicks}, Vinf Start: {VinfStart}, Vinf End: {VinfEnd}, Electrode Delta: {ElectrodeDelta}, " +
// $"Impedance: {Impedance}, Field Drive Time: {FieldDriveTime}, Is Low Flow: {IsInLowFlow}, Is Empty Pipe: {IsInEmptyPipe}, " +
// $"Fast High Pass Filter: {FastHighPassFilterConstant}, Field Polarity: {FieldPolarity}, Impedance Polarity: {ImpedancePolarity}";
//}
public override string ToString()
{
return $"DutInfo: {DutInfo}, Dt: {Dt}, ADC Sample: {AdcSample}, Last Field: {LastField}, Flow Rate: {FlowRate}, Accumulator: {Accumulator}, " +
$"Flip Period: {FlipPeriod}, Vinf Start: {VinfStart}, Vinf End: {VinfEnd}, Electrode Delta: {ElectrodeDelta}, " +
$"Impedance: {Impedance}, Field Drive Time: {FieldDriveTime}, Is Low Flow: {IsInLowFlow}, Is Empty Pipe: {IsInEmptyPipe}, " +
$"Fast HPFC: {FastHPFC}, Field Polarity: {FieldPolarity}, Impedance Polarity: {ImpedancePolarity}, " +
$"Calc Flow mL/s: {CalcFlowmLps:F2}, Calc Flow GPM: {CalcFlowGPM:F2}, Calc Acc Gal: {CalcAccGal:F2}";
}
}
}
@@ -0,0 +1,92 @@
namespace NfcC7_DLL.NfcHanler.Protocols
{
public class WaterMetrologyDataC7 : WaterMetrologyDataC2
{
// New fields for C7
public int LastFieldmilliGauss { get; set; }
public int ImpedanceI { get; set; } // In-phase impedance
public int ImpedanceQ { get; set; } // Out-of-phase impedance
public int NoiseMetric { get; set; }
public short LearningLockout { get; set; }
public short ReverseBuffer { get; set; }
public int ConditionedAdc { get; set; }
public uint Totalalizer { get; set; }
//public bool IsInLowFlow { get; set; }
//public bool IsInEmptyPipe { get; set; }
//public bool FastHPFC { get; set; }
//public bool FieldPolarity { get; set; }
//public bool ImpedancePolarity { get; set; }
public bool MagTamperState { get; set; }
public bool IsLearningActive { get; set; }
public bool AdcShiftsUpdated { get; set; }
public static WaterMetrologyDataC7 Parse(string base64Data, DateTime dt, string dutinfo)
{
byte[] data = Convert.FromBase64String(base64Data);
return Parse(data, dt, dutinfo);
}
public static WaterMetrologyDataC7 Parse(byte[] data, DateTime dt, string dutinfo)
{
// You may want to check for the minimum length required for C7
if (data.Length < 48) /* minimum required length for C7 */
{
throw new ArgumentException("Invalid data length for WaterMetrologyData C7.");
}
var result = new WaterMetrologyDataC7();
// Parse base C2 fields
var c2 = WaterMetrologyDataC2.Parse(data, dt, dutinfo);
//Copy base fields
result.DutInfo = c2.DutInfo;
result.Dt = c2.Dt;
result.AdcSample = c2.AdcSample;
result.LastField = c2.LastField;
result.FlowRate = c2.FlowRate;
result.Accumulator = c2.Accumulator;
result.FlipPeriod = c2.FlipPeriod;
result.VinfStart = c2.VinfStart;
result.VinfEnd = c2.VinfEnd;
result.ElectrodeDelta = c2.ElectrodeDelta;
result.Impedance = c2.Impedance;
result.FieldDriveTime = c2.FieldDriveTime;
result.IsInLowFlow = c2.IsInLowFlow;
result.IsInEmptyPipe = c2.IsInEmptyPipe;
result.FieldPolarity = c2.FieldPolarity;
result.ImpedancePolarity = c2.ImpedancePolarity;
// Parse new C7 fields (replace ENUM_OptPack0xC7.FIELD_MILLI_GAUSS etc. with actual offsets)
byte flags = data[23];
result.MagTamperState = (flags & 0x60) != 0; // bits 5 and 6 represent MagTamperState
result.IsLearningActive = (flags & 0x80) != 0; // bit 7 represents IsLearningActive
byte flagTwo = data[24];
result.AdcShiftsUpdated = (flagTwo & 0x01) != 0; // bit 0 represents AdcShiftsUpdated
result.LastFieldmilliGauss = BitConverter.ToInt32(data, 25);
result.ImpedanceI = BitConverter.ToInt32(data, 29); // in phase
result.ImpedanceQ = BitConverter.ToInt32(data, 33); // out of phase
result.NoiseMetric = BitConverter.ToInt32(data, 37); //
result.LearningLockout = BitConverter.ToInt16(data, 41);
result.ReverseBuffer = BitConverter.ToInt16(data, 43);
result.ConditionedAdc = BitConverter.ToInt32(data, 45);
result.Totalalizer = BitConverter.ToUInt32(data, 49);
return result;
}
public override string ToString()
{
return $"C7: LastFieldmilliGauss={LastFieldmilliGauss}, ImpedanceI={ImpedanceI}, ImpedanceQ={ImpedanceQ}, NoiseMetric={NoiseMetric}, LearningLockout={LearningLockout}, ReverseBuffer={ReverseBuffer}, ConditionedAdc={ConditionedAdc}, Totalalizer={Totalalizer}, MagTamperState={MagTamperState}, IsLearningActive={IsLearningActive}, AdcShiftsUpdated={AdcShiftsUpdated}" + base.ToString();
}
}
}
+1
View File
@@ -0,0 +1 @@
# Protocol Description
+262
View File
@@ -0,0 +1,262 @@
using System.Diagnostics;
using System.Reflection;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace NfcC7_DLL.NfcHanler.Utils
{
public class CliRunner
{
//static readonly Logger log = LogManager.GetLogger(typeof(CliRunner));
//private readonly ILog log;
private List<Task> taskPool = new List<Task>();
private long startTime;
public List<Task> TaskPool { get { return taskPool; } }
public void AddTask(Task task) { taskPool.Add(task); }
public void WaitAll() { Task.WaitAll(taskPool.ToArray()); }
/// <summary>
/// continue with WhenAny() to commpare results if time out is reached
/// </summary>
/// <param name="timeout"></param>
/// <returns></returns>
public Task AddTimeOut(int timeout)
{
Task timeOut = Task.Delay(timeout);
taskPool.Add(timeOut);
return timeOut;
}
/// <summary>
/// mainly used for time out additional task to compare results
/// </summary>
/// <returns></returns>
public Task WhenAny() { return Task.WhenAny(taskPool.ToArray()); }
public void Clear() { taskPool.Clear(); }
public void CancelAll() { Task.WhenAll(taskPool).ContinueWith(t => { }); }
public void StartAll()
{
taskPool.ForEach(t => t.Start());
}
public bool AreTasksDone()
{
return taskPool.All(task => task.IsCompleted);
}
public long StartTime
{
get => startTime;
}
public bool TimeOutReceived(long timeout)
{
return (DateTime.Now.Ticks - startTime) > timeout;
}
public CliRunner(bool isCliLogging)
{
startTime = DateTime.Now.Ticks;
if (isCliLogging)
{
try
{
/*log = new ScopedLoggerFactory().CreateLogger<CliRunner>(
@"C:\TBF\Logs\CliRunner.txt",
10, // maxFileSizeMB
7, // maxBackups
log4net.Core.Level.Debug,
true, // zipRolledFiles
true, // singleZipPerDay
TimeSpan.FromMinutes(2) // zipScanInterval
);*/
}
catch (Exception ex)
{
// Fallback to console or handle gracefully
Console.WriteLine($"Failed to initialize logger: {ex.Message}");
}
}
}
/// <summary>
///
/// </summary>
/// <param name="fileName"></param>
/// <param name="args"></param>
/// <typeparam name="T"></typeparam>
public Task AddSendAsync(SerialPortData data, SerialPortData.EMeterArg eMeterArg)
{
var task = SendAsync(data.SerialPortCmdClientPath, data.DefaultArgSettingsRead(eMeterArg));
taskPool.Add(task);
return task;
}
public Task AddSendAsync(SerialPortData data, SerialPortData.EMeterArg eMeterArg, string arg)
{
var task = SendAsync(data.SerialPortCmdClientPath, data.DefaultArgSettingsWrite(eMeterArg, arg));
taskPool.Add(task);
return task;
}
public void AddSendAsync(string fileName, string args)
{
var task = SendAsync(fileName, args);
taskPool.Add(task);
}
public async Task<string> SendAsync(string fileName, string args, CancellationToken ct = default)
{
var psi = new ProcessStartInfo
{
FileName = fileName,
Arguments = args,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
};
using var process = new Process { StartInfo = psi, EnableRaisingEvents = true };
process.Start();
Task<string> stdOutTask = process.StandardOutput.ReadToEndAsync();
Task<string> stdErrTask = process.StandardError.ReadToEndAsync();
try
{
await Task.WhenAll(stdOutTask, stdErrTask, process.WaitForExitAsync(ct));
}
catch (OperationCanceledException)
{
if (!process.HasExited)
{
process.Kill();
}
throw;
}
string allOutput = (stdOutTask.Result ?? "") + (stdErrTask.Result ?? "");
//log?.Debug(allOutput);
return allOutput;
}
public Task<T> AddRunAndCaptureJsonAsync<T>(SerialPortData data, SerialPortData.EMeterArg eMeterArg) where T : new()
{
var task = RunAndCaptureJsonAsync<T>(data.SerialPortCmdClientPath, data.DefaultArgSettingsRead(eMeterArg));
taskPool.Add(task);
return task;
}
public async Task<T> RunAndCaptureJsonAsync<T>(string fileName, string args, CancellationToken ct = default) where T : new()
{
var psi = new ProcessStartInfo
{
FileName = fileName,
Arguments = args,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
};
using var process = new Process { StartInfo = psi, EnableRaisingEvents = true };
process.Start();
var stdoutTask = process.StandardOutput.ReadToEndAsync();
var stderrTask = process.StandardError.ReadToEndAsync();
await Task.WhenAll(stdoutTask, stderrTask, process.WaitForExitAsync(ct));
string allOutput = (stdoutTask.Result ?? "") + (stderrTask.Result ?? "");
//log?.Debug(allOutput);
string json = ExtractJson(allOutput);
if (TryJsonStringDeserialize(json, out T result)) return result;
return default;
}
public bool TryJsonStringDeserialize<T>(string json, out T runAndCaptureJsonAsync) where T : new()
{
if (json != null)
{
try
{
runAndCaptureJsonAsync = JsonConvert.DeserializeObject<T>(json);
return true;
}
catch (Exception ex)
{
// log.Debug(ex.Message);
runAndCaptureJsonAsync = TryConvert<T>(json);
return true;
}
}
runAndCaptureJsonAsync = default;
return false;
}
private static T TryConvert<T>(string json) where T : new()
{
T obj = new T();
try
{
JObject jObject = JObject.Parse(json);
foreach (PropertyInfo prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
if (!prop.CanWrite) continue;
JToken token;
if (jObject.TryGetValue(prop.Name, StringComparison.OrdinalIgnoreCase, out token))
{
try
{
object value = token.ToObject(prop.PropertyType);
prop.SetValue(obj, value);
}
catch
{
// leave default if conversion fails
}
}
// else → keep default value
}
}
catch (Exception ex)
{
Console.WriteLine($"TryConvert failed: {ex.Message}");
}
return obj;
}
public string ExtractJson(string text)
{
int start = text.IndexOf('{');
int end = text.LastIndexOf('}');
if (start >= 0 && end > start)
{
return text.Substring(start, end - start + 1);
}
return null;
}
}
}
@@ -0,0 +1,36 @@
using System.Diagnostics;
namespace NfcC7_DLL.NfcHanler.Utils
{
public static class ProcessExtensions
{
public static Task WaitForExitAsync(this Process process, CancellationToken cancellationToken = default)
{
if (process == null) throw new ArgumentNullException(nameof(process));
if (process.HasExited) return Task.CompletedTask;
var tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
EventHandler handler = null;
handler = (s, e) =>
{
try { tcs.TrySetResult(null); }
finally { process.Exited -= handler; }
};
process.EnableRaisingEvents = true;
process.Exited += handler;
if (cancellationToken.CanBeCanceled)
{
cancellationToken.Register(() =>
{
tcs.TrySetCanceled(cancellationToken);
process.Exited -= handler;
});
}
return tcs.Task;
}
}
}
+167
View File
@@ -0,0 +1,167 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO.Ports;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace NfcC7_DLL.NfcHanler.Utils
{
public class SERIAL_Driver
{
public string ErrorMessage { get; private set; }
public Collection<byte> SerialPortReadBuffer = new Collection<byte>();
private SerialPort _serialPort;
private List<byte[]> _binMessages = new List<byte[]>();
private bool _isReading;
private Parity Parity { get; set; }
private StopBits StopBits { get; set; }
public SERIAL_Driver()
{
_serialPort = new SerialPort();
}
public bool OpenConnection(string comPort, int baudrate, int dataBits, Parity parity, StopBits stopbits, int readTimeout=1000, int writeTimeout = 1000)
{
lock (this)
{
if ((_serialPort != null) && (_serialPort.IsOpen))
{
_serialPort.DataReceived -= DataReceivedHandler;
_serialPort.Close();
_serialPort.Dispose();
_serialPort = null;
}
try
{
ErrorMessage = "";
//_serialPort = new SerialPort(comPort, 57600, Parity.None, 8, StopBits.Two);
_serialPort = new SerialPort(comPort, baudrate, parity, dataBits, stopbits);
_serialPort.ReadTimeout = readTimeout;
_serialPort.WriteTimeout = writeTimeout;
_serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
_serialPort.Open();
}
catch (Exception ex)
{
ErrorMessage = String.Format("COM error: Open failed {0}.{1}", comPort, ex.Message);
return false;
}
if (!_serialPort.IsOpen)
{
ErrorMessage = String.Format("COM error: Can't Open {0}.", comPort);
return false;
}
}//End Lock
return true;
}
public bool SendMessage(byte[] sendDataBytes, int length, int readTimeout = 1000, int writeTimeout=1000)
{
if (!isOpen()) return false;
if (sendDataBytes.Length == 0) return true; // nothing to send - no error
try
{
PrepareReading(); //clear read buffer etc.
_serialPort.WriteTimeout = writeTimeout;
_serialPort.ReadTimeout = readTimeout;
_serialPort.Write(sendDataBytes, 0, length);
_isReading = true;
Thread.Sleep(100);
var stopWatch = Stopwatch.StartNew(); //start stop watch for data recevie timeout
while (_isReading) //wait until reading finishes or timeout occur
{
if (stopWatch.ElapsedMilliseconds > readTimeout)
{
stopWatch.Stop();
ErrorMessage = "COM error: Receive timeout";
return false;
}
}
}
catch (Exception ex)
{
ErrorMessage = String.Format("COM error: Transmit timeout {0}.{1}", _serialPort.PortName, ex.Message);
return false; // Exception in send function
}
return true;
}
private void PrepareReading()
{
_serialPort.DiscardInBuffer();
if(_binMessages != null) _binMessages.Clear();
_isReading = true;
}
public byte[] GetRawData()
{
try
{
if (_binMessages.Count > 0)
return _binMessages[0].ToArray();
else
{
return null;
}
}
catch(Exception)
{
byte[] err = { 0xFF };
return err;
}
}
private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
{
if (!_serialPort.IsOpen) return;
lock (this)
{
Thread.Sleep(100);
if (!_serialPort.IsOpen) return;
SerialPortReadBuffer = new Collection<byte>();
while (_serialPort.BytesToRead > 0)
{
SerialPortReadBuffer.Add((byte)_serialPort.ReadByte());
}
_binMessages.Add(SerialPortReadBuffer.ToArray());
_isReading = false;
}
}
public void CloseConnection()
{
if ((_serialPort != null) && (_serialPort.IsOpen))
{
_serialPort.DataReceived -= DataReceivedHandler;
_serialPort.Close();
_serialPort.Dispose();
_serialPort = null;
}
}
public void Close()
{
if (isOpen())
{
_serialPort.Close();
}
}
public void Dispose()
{
if (_serialPort != null)
{
_serialPort.Dispose();
}
}
public bool isOpen()
{
if(_serialPort != null)
return _serialPort.IsOpen;
return false;
}
}
}
@@ -0,0 +1,72 @@
namespace NfcC7_DLL.NfcHanler.Utils
{
public class SerialPortData
{
private Boolean? _cliExists;
public bool CliExists { get {
if (_cliExists == null || !_cliExists.HasValue)
{
_cliExists = File.Exists(SerialPortCmdClientPath);
}
return _cliExists.Value;
} }
public string SerialPortCmdClientPath {
get {
#if DEBUG
return Path.Combine("C:","TBF","Cli", CmdClientName);
#else
return Path.Combine("..","Cli", CmdClientName);
#endif
}
}
public string CmdClientName { get; set; } = "HalCli.exe";
public string PortName { get; set; }
public int MeterType { get; set; }
public enum EMeterArg {
Calibration = 0,
AllParams = 2,
DeviceId = 3,
Optohead = 4,
}
EMeterArg _eMeterArg = EMeterArg.AllParams;
public string DefaultArgSettingsRead(EMeterArg eMeterArg)
{
switch (eMeterArg)
{
case EMeterArg.AllParams:
return $"-p {PortName} -m {MeterType} --operation readall";
case EMeterArg.DeviceId:
return $"-p {PortName} -m {MeterType} --operation read --parameter DeviceId";
case EMeterArg.Optohead:
return $"-p {PortName} -m {MeterType} --operation read --parameter \"OpticalDataMode\"";
default:
throw new Exception("Not implemented correct command!");
}
}
public string DefaultArgSettingsWrite(EMeterArg eMeterArg, string arg)
{
switch (eMeterArg)
{
case EMeterArg.Calibration:
return $"-p {PortName} -m {MeterType} --operation write --parameter Calibration --value {arg}";
case EMeterArg.Optohead:
return $"-p {PortName} -m {MeterType} --operation write --parameter \"OpticalDataMode\" --value {arg}";
default:
throw new Exception("Not implemented correct command!");
}
}
public SerialPortData(
string portName,
string cmdClientName,
int meterType)
{
PortName = portName;
CmdClientName = cmdClientName;
MeterType = meterType;
}
}
}
+156
View File
@@ -0,0 +1,156 @@
using System.Text;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace NfcC7_DLL.NfcHanler.Utils
{
public static class Tools
{
public static bool ByteArrayCompare(byte[] a1, byte[] a2)
{
// thanks to https://stackoverflow.com/questions/43289/comparing-two-byte-arrays-in-net
if (a1.Length != a2.Length)
return false;
for (int i = 0; i < a1.Length; i++)
if (a1[i] != a2[i])
return false;
return true;
}
public static string SwapHex(string sHex)
{
string sResult = "";
int iPos = sHex.Length - 2;
while (iPos >= 0)
{
sResult += sHex.Substring(iPos, 2);
sHex = sHex.Remove(iPos, 2);
iPos = sHex.Length - 2;
}
return sResult;
}
public static string DecimalToHexString(string value, int size = 1)
{
try
{
long Lval = long.Parse(value);
if (size == 1) return Lval.ToString("X2");
if (size == 2) return Lval.ToString("X4");
if (size == 4) return Lval.ToString("X8");
}
catch (Exception)
{
if (size == 1) return "00";
if (size == 2) return "0000";
if (size == 4) return "00000000";
}
return "00";
}
public static string ByteToHexString(byte data)
{
List<byte> val = new List<byte>();
val.Add(data);
byte[] arr = val.ToArray();
return BytesToHex(arr);
}
public static string BytesToHex(byte[] data)
{
StringBuilder sb = new StringBuilder();
foreach (byte b in data)
sb.Append(b.ToString("X2"));
return sb.ToString();
}
public static byte[] HexStringToByteArray(String hexString)
{
int numberChars = hexString.Length;
byte[] bytes = new byte[numberChars / 2];
for (int i = 0; i < numberChars; i += 2)
{
bytes[i / 2] = Convert.ToByte(hexString.Substring(i, 2), 16);
}
return bytes;
}
public enum InitialCrcValue
{
Zeros,
NonZero1 = 0xffff,
NonZero2 = 0x1D0F
}
public class Crc16Ccitt
{
private const ushort poly = 0x1021;
ushort[] table = new ushort[256];
ushort initialValue = 0;
public ushort ComputeChecksum(byte[] bytes)
{
ushort crc = this.initialValue;
for (int i = 0; i < bytes.Length; ++i)
{
crc = (ushort)((crc << 8) ^ table[((crc >> 8) ^ (0xff & bytes[i]))]);
}
return crc;
}
public byte[] ComputeChecksumBytes(byte[] bytes)
{
ushort crc = ComputeChecksum(bytes);
return BitConverter.GetBytes(crc);
}
public Crc16Ccitt(InitialCrcValue initialValue)
{
this.initialValue = (ushort) initialValue;
ushort temp, a;
for (int i = 0; i < table.Length; ++i)
{
temp = 0;
a = (ushort) (i << 8);
for (int j = 0; j < 8; ++j)
{
if (((temp ^ a) & 0x8000) != 0)
{
temp = (ushort) ((temp << 1) ^ poly);
}
else
{
temp <<= 1;
}
a <<= 1;
}
table[i] = temp;
}
}
public byte[] calcCRCfromMessage(byte[] message)
{
// CRC calculation goes from MessageID to Password
// For Read this means MsgID (1) + Offset (2) + PayloadLength (1) + Password (2) = 6
// for write the length of the payload comes on top.
// STX(1), length(1), CRC(2) and ETX(1) are excluded, in total 5 bytes.
//
// the method works both for sending messages (where the CRC and ETX are not in message)
// and for receiving messages (where the CRC and ETX are included at the end)
byte[] crc_msg = new byte[message[1]]; // message length is 2nd byte
Array.Copy(message, 2, crc_msg, 0, crc_msg.Length);
return ComputeChecksumBytes(crc_msg);
}
public string commentCRC(byte[] crc_meter, byte[] crc_computed)
{
bool crc_do_match = Tools.ByteArrayCompare(crc_meter, crc_computed);
string crcComment = crc_do_match ? "ok." : "CRC DOESN'T MATCH!!";
return "CRC Meter: " + Tools.BytesToHex(crc_meter) + (crc_do_match ? " == " : " != ")
+ "CRC Computed: " + Tools.BytesToHex(crc_computed) + ". " + crcComment;
}
public bool crc_do_match(byte[] a, byte[] b)
{
return ByteArrayCompare(a, b);
}
}
}
}
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;IPERL;</DefineConstants>
<DefineConstants>TRACE;DEBUG;IPERL;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;IPERL;</DefineConstants>
<DefineConstants>TRACE;IPERL;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -17,7 +17,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;LANG_PL;</DefineConstants>
<DefineConstants>TRACE;DEBUG;LANG_PL;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -25,7 +25,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;</DefineConstants>
<DefineConstants>TRACE;HEAT_METERS;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+28
View File
@@ -119,6 +119,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sensus.iPerl.TestConsole",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NfcS5_DLL", "..\NfcS5_DLL\NfcS5_DLL.csproj", "{5954D496-CAAB-4F7A-BDE2-BDC8F47DAB19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NfcC7_DLL", "NfcC7_DLL\NfcC7_DLL.csproj", "{53E75979-B530-4805-8FC9-B314F14A62BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NfcC7_DLL.Tests", "NfcC7_DLL.Tests\NfcC7_DLL.Tests.csproj", "{715605C5-568B-48D6-9C09-2DC5F2E81F66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -539,6 +543,30 @@ Global
{5954D496-CAAB-4F7A-BDE2-BDC8F47DAB19}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{5954D496-CAAB-4F7A-BDE2-BDC8F47DAB19}.Release|x86.ActiveCfg = Release|Any CPU
{5954D496-CAAB-4F7A-BDE2-BDC8F47DAB19}.Release|x86.Build.0 = Release|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Debug|x86.ActiveCfg = Debug|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Debug|x86.Build.0 = Debug|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Release|Any CPU.Build.0 = Release|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Release|x86.ActiveCfg = Release|Any CPU
{53E75979-B530-4805-8FC9-B314F14A62BE}.Release|x86.Build.0 = Release|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Debug|x86.ActiveCfg = Debug|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Debug|x86.Build.0 = Debug|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Release|Any CPU.Build.0 = Release|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Release|x86.ActiveCfg = Release|Any CPU
{715605C5-568B-48D6-9C09-2DC5F2E81F66}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -30,16 +30,20 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003A_005F_005FError_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4290c01eea7748b3aa477ca831e6a387531830_003Ffa_003Fa44fa010_003F_005F_005FError_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodInfoExtensions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F63_003F30e5e5fa_003FMethodInfoExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATask_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3020f90f960f433086d545c4e07afdfd531820_003F34_003F74019b66_003FTask_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStringBuilder_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3789ee403a53437cbb6b5d9ab6311f51573620_003F35_003Ff9dfb3b8_003FStringBuilder_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:Boolean x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/ShowAdvancedOptions/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=743DF7DB_002DC7B6_002D42EB_002D986D_002D0F485E5588E4/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=8648FD92_002DCDA1_002D4C3A_002DB5F9_002DFE547CE1FA48/@EntryIndexedValue">77EB589F-C670-4489-AAD6-2A3C02061FD1</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestTemplateMapping/=MSTest/@EntryIndexedValue">d6790ab7-33c2-4425-b2c9-51480cd1a852</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=311ca613_002Da634_002D4e0f_002Db9fb_002D4b7af9b7abb2/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="GetCorrection" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=311ca613_002Da634_002D4e0f_002Db9fb_002D4b7af9b7abb2/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="GetCorrection" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Entities.MeasurementCorrectionTest.GetCorrection&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Modbus.Meret.AdjustableScale.AdjustableMeterTest.GetCorrection&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.RtpListener&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Output.FileWriters.Enhanced.WriterTest.GetFilenameTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.RegisterReaders.PoseidonCmdStartStop.CliRunnerTest.ExtractJson_Test&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.RegisterReaders.PoseidonCmdStartStop.CliRunnerTest.ExtractJson_Test2&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.RegisterReaders.PoseidonCmdStartStop.CliRunnerTest.TryJsonStringDeserialize_Test&lt;/TestId&gt;&#xD;
@@ -56,6 +60,8 @@
&lt;ProjectFile&gt;77EB589F-C670-4489-AAD6-2A3C02061FD1/d:Entities/f:MeasurementCorrectionTest.cs&lt;/ProjectFile&gt;&#xD;
&lt;/Or&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="Initialize" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=943f9249_002Ded52_002D453e_002Db953_002Db234aabc0cc0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="TryJsonStringDeserialize_Test" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.RegisterReaders.PoseidonCmdStartStop.CliRunnerTest.TryJsonStringDeserialize_Test&lt;/TestId&gt;&#xD;
@@ -68,9 +74,12 @@
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="Initialize" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest.Initialize&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Output.FileWriters.Enhanced.WriterTest.GetFilenameTest&lt;/TestId&gt;&#xD;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.RegisterReaders.PoseidonCmdStartStop.CliRunnerTest.ExtractJson_Test&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=AppDiagnostic_002FMainForm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=AppDiagnostic_002FProperties_002FResources/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Config_002FResources_002FStrings/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=DeviceTest_002FDeviceTestDlg/@EntryIndexedValue">False</s:Boolean>
@@ -150,6 +159,12 @@
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FModbus_002FQuidoRS_002FQuidoRSCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FModbus_002FTankSelector_002FTankSelectorCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterFTP_002FNetadapterCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterJMS_002FNetadapterCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FTerminalDlg/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapter_002FNetadapterCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterJMS_002FNetadapterCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue">True</s:Boolean>
@@ -160,6 +175,8 @@
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FDisplay_002FDisplayForm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FKeyenceIV3G120_002FCameraCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartKeyence_002FRoiCfgCtrl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoi_002FRoiCfgCtrl/@EntryIndexedValue">True</s:Boolean>
@@ -0,0 +1,999 @@
<CorruptedSettingsDescription>
<Exception Message="Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATestMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4472e9d6a19b4c92bcc9a80bd60ca17d26da8_003F98_003F3ffb6d31_003FTestMethodInfo_002Ecs/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AXmlReflectionImporter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9e4992465ee24dc8915fd9be20badb7d281d48_003F14_003Ffe12756e_003FXmlReflectionImporter_002Ecs/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="Duplicate entry with key /Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fee81c72_002D0b13_002D439c_002D8921_002D12878bb8cd86/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterJMS_002FNetadapterCfgCtrl/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterJMS_002FNetadapterCfgCtrl/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterJMS_002FNetadapterCfgCtrl/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FAdapterJMS_002FNetadapterCfgCtrl/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FCameraCfgCtrl/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FTerminalDlg/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FTerminalDlg/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FTerminalDlg/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FCJMS11_002FTerminalDlg/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue. Using the second occurrence." Kind="Error">Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue. Using the second occurrence.
--- EXCEPTION #1/2 [WarningException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue. Using the second occurrence.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.WarningException
HResult = COR_E_SYSTEM=80131501
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “Duplicate entry with key /Default/ResxEditorPersonal/CheckedGroups/=TBF_002FRig_002FNetwork_002FCamera_002FRoiForFixedStartCJMS11_002FRoiCfgCtrl/@EntryIndexedValue. Using the second occurrence.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_ReadEntryValueEnd_CommitContent() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_002D mvid 5EF9 or Step.il:line IL_0084 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown() in RunUntilShutdown.il:line IL_0044 mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<Exception Message="The 's:String' start tag on line 64 position 3 does not match the end tag of 'wpf:ResourceDictionary'. Line 355, position 91." Kind="Error">The 's:String' start tag on line 64 position 3 does not match the end tag of 'wpf:ResourceDictionary'. Line 355, position 91.
--- EXCEPTION #1/2 [XmlException]
Message = “The 's:String' start tag on line 64 position 3 does not match the end tag of 'wpf:ResourceDictionary'. Line 355, position 91.”
res = “The '{0}' start tag on line {1} position {2} does not match the end tag of '{3}'.”
args.#0 = s:String
args.#1 = 64
args.#2 = 3
args.#3 = wpf:ResourceDictionary
lineNumber = 355
linePosition = 91
version = 2.0
StackTraceString = “
at System.Xml.XmlTextReaderImpl.Throw(Exception e) in Throw.il:line IL_0027 mvid F2DC or Throw.il:line IL_0029 mvid F2DC
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) in Throw.il:line IL_0027 mvid F2DC or Throw.il:line IL_0029 mvid F2DC
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag) in ThrowTagMismatch.il:line IL_0086 mvid F2DC
at System.Xml.XmlTextReaderImpl.ParseEndElement() in ParseEndElement.il:line IL_00F2 mvid F2DC
at System.Xml.XmlTextReaderImpl.ParseElementContent() in ParseElementContent.il:line IL_0152 mvid F2DC
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_GenericRead() in Step.il:line IL_0000 mvid 5EF9
ExceptionPath = Root.InnerException
ClassName = System.Xml.XmlException
HResult = Xml=80131940
Source = System.Private.Xml
Data.ThreadLocalDebugInfo = ShutdownRequested
--- Outer ---
--- EXCEPTION #2/2 [LoggerException]
Message = “The 's:String' start tag on line 64 position 3 does not match the end tag of 'wpf:ResourceDictionary'. Line 355, position 91.”
InnerException = “Exception #1 at Root.InnerException”
StackTraceString = “
at JetBrains.Util.ILoggerEx.LogException(ILogger logger, LoggingLevel level, Exception exception, ExceptionOrigin exceptionOrigin, String comment) in LogException.il:line IL_002E mvid D244
at JetBrains.Util.ILoggerEx.Error(ILogger logger, Exception exception, ExceptionOrigin origin, String comment) in Error.il:line IL_0000 mvid D244
at JetBrains.Util.ILoggerEx.LogOuterDataException(ILogger logger, Exception exception, String comment) in LogOuterDataException.il:line IL_0000 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step_GenericRead() in Step.il:line IL_0000 mvid 5EF9 or Step.il:line IL_006F mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Step() in Step.il:line IL_0000 mvid 5EF9 or Step.il:line IL_006F mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.EntriesReader.Run(XmlReader reader, EntryPositionsFlag entryPositionsFlag) in Run.il:line IL_006B mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__5(XmlReader xmlreader)
at JetBrains.Util.XmlReaderEx.ReadXml[TResult](Stream stream, Func`2 FRead) in ReadXml.il:line IL_002F mvid 54EE
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_2.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__4(Stream streamR)
at JetBrains.Util.FileSystemPathOpenEx.ReadStream[T,TF,TFile,TDir](FileSystemPathBase`3 path, Func`2 λRead) in ReadStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_1.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__2()
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.XmlWriterEx.InElement(XmlWriter writer, String name, Action nested, Boolean writeFullEndElement)
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__1(XmlWriter xmlwriter)
at JetBrains.Util.XmlWriterEx.WriteXml(Stream stream, Action`1 FWrite) in WriteXml.il:line IL_0023 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass34_0.&lt;Save_WriteFile_BackupOldCorruptedFile&gt;b__0(Stream stream)
at JetBrains.Util.FileSystemPathOpenEx.WriteStream[T,TFile,TDir](FileSystemPathBase`3 path, Action`1 λWrite) in WriteStream.il:line IL_0029 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile_BackupOldCorruptedFile(FileSystemPath path) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass31_0.&lt;Save_WriteFile&gt;b__0()
at JetBrains.Util.ILoggerEx.Catch(ILogger logger, Action action, ExceptionOrigin origin, LoggingLevel loggingLevel) in Catch.il:line IL_0060 mvid D244
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save_WriteFile(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.Save(SaveDiffFlags flagsDiff, SaveForcedFlags flagsForced) in Save.il:line IL_002C mvid 5EF9 or Save.il:line IL_00D2 mvid 5EF9 or Save.il:line IL_0241 mvid 5EF9
at JetBrains.Application.Settings.Storage.Persistence.SettingsStoreSerializationToXmlDiskFile.&lt;&gt;c__DisplayClass9_0.&lt;Init_FirstLoadLastSave&gt;b__1()
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass0_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.CombinedProperty2`3.&lt;&gt;c__DisplayClass8_0.&lt;AdviseCore&gt;b__1() in CombinedProperty2.il:line IL_009C mvid D244
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.ProjectModel.SolutionInstance.CloseSolutionInstance() in CloseSolutionInstance.il:line IL_0087 mvid 4DD6
at JetBrains.ProjectModel.SolutionManagerBase.CloseSolutionInstance(SolutionInstance instance) in CloseSolutionInstance.il:line IL_0000 mvid 4DD6
at JetBrains.ProjectModel.ProjectsHost.SolutionHost.Impl.SolutionHostManager.CloseSolution() in CloseSolution.il:line IL_0046 mvid 1A79
at JetBrains.Rider.Backend.Features.ProjectModel.RiderSolutionWatcher.&lt;&gt;c__DisplayClass4_0.&lt;.ctor&gt;b__2() in RiderSolutionWatcher.il:line IL_002D mvid 2082
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Application.Components.SingletonDescriptorBindings`1.Dispose() in Dispose.il:line IL_0000 mvid F14D
at JetBrains.Application.Components.SingletonDescriptor`1.DisposeInternalResources() in DisposeInternalResources.il:line IL_0048 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.DoDisposeSafe(Object instance) in DoDisposeSafe.il:line IL_0036 mvid F14D
at JetBrains.Application.Components.AsyncDescriptorBase.Dispose() in Dispose.il:line IL_00DD mvid F14D
at JetBrains.Application.Components.ComponentStorage.DisposeDescriptor(IComponentDescriptor descriptor) in DisposeDescriptor.il:line IL_000A mvid F14D
at JetBrains.Application.Components.ComponentStorage.Terminate() in Terminate.il:line IL_00AE mvid F14D
at JetBrains.Lifetimes.LifetimeDefinition.Destruct() in Destruct.il:line IL_00A8 mvid 6B8D or Destruct.il:line IL_00B1 mvid 6B8D
at JetBrains.Lifetimes.LifetimeDefinition.Terminate() in Terminate.il:line IL_0162 mvid 6B8D
at JetBrains.Lifetimes.SequentialLifetimes.TrySetNewAndTerminateOld(LifetimeDefinition newLifetimeDefinition, Action`1 actionWithNewLifetime) in TrySetNewAndTerminateOld.il:line IL_001F mvid 6B8D
at JetBrains.DataFlow.IPropertyEx.&lt;&gt;c__DisplayClass39_0.&lt;WhenTrue&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertyEx.il:line IL_0000 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.RunsProducts.&lt;&gt;c__DisplayClass5_1.&lt;.ctor&gt;b__0(PropertyChangedEventArgs`1 _)
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass1_0`1.&lt;Advise_FallingFront&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_2.&lt;AdviseCore&gt;b__4() in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.Util.Logging.Logger.Catch(Action action) in Catch.il:line IL_000F mvid D244
at JetBrains.Util.DataFlow.ProjectedProperty`2.&lt;&gt;c__DisplayClass10_0.&lt;AdviseCore&gt;b__3(PropertyChangedEventArgs`1 args) in ProjectedProperty.il:line IL_0000 mvid D244 or ProjectedProperty.il:line IL_0139 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.UpdateActiveTellers(Lifetime lifetimeComponent, List`1 tellers, IThreading threading, IProperty`1 propComposite, ILogger logger) in UpdateActiveTellers.il:line IL_00FD mvid 5EF9
at JetBrains.Application.Environment.ReportsProductsAllowedToRun.&lt;&gt;c__DisplayClass2_0.&lt;UpdateActiveTellers&gt;g__UpdateActiveTellersAgain|0() in ReportsProductsAllowedToRun.il:line IL_000B mvid 5EF9
at JetBrains.DataFlow.IPropertySignalEx.&lt;&gt;c__DisplayClass10_0`1.&lt;Advise_NoAcknowledgement&gt;b__0(PropertyChangedEventArgs`1 args) in IPropertySignalEx.il:line IL_0010 mvid D244 or IPropertySignalEx.il:line IL_0028 mvid D244
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in Fire.il:line IL_0054 mvid D244
at JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie)
at JetBrains.DataFlow.Property`1.set_Value(TValue value)
at JetBrains.Application.Environment.ApplicationShutdownRequests.&lt;&gt;c__DisplayClass10_0.&lt;ProcessShutdownVerdict&gt;b__0() in ApplicationShutdownRequests.il:line IL_00C3 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.ReentrancyGuard.Execute(String name, CallerInfo&amp; caller, Action action) in Execute.il:line IL_0122 mvid D244
at JetBrains.Threading.ReentrancyGuard.ExecutePendingActions(TaskPriority priorityLowestAllowedToExecute) in ExecutePendingActions.il:line IL_0088 mvid D244
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.ProcessQueue(Int32 nMinBucket, Int32 nProcessQueueGeneration) in ProcessQueue.il:line IL_01D0 mvid D244
at JetBrains.Util.Concurrency.Dispatcher.JetDispatcherTransportReliabilityLayer.OnInvoke(TaskPriority priority) in OnInvoke.il:line IL_007F mvid D244
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.OnMessage(Void* hwnd, WindowsMessages message, IntPtr wParam, IntPtr lParam) in OnMessage.il:line IL_01CD mvid D244
at JetBrains.Interop.Windows.Wrappers.NativeWin32Window.WndProc(Void* hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in WndProc.il:line IL_0071 mvid 9494
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.InternalPumpMessagesOnce()
at JetBrains.Util.Concurrency.Dispatcher.WindowsMessageQueueTransportForJetDispatcher.JetBrains.Threading.IPlatformSpecificJetDispatcherThreadUnderlyingTransport.PumpMessagesOnce(TimeSpan maxWaitForFirstMessage)
at JetBrains.Threading.RunsAndSleeps.RunOrSleep(Func`1 FCondition, IProperty`1 propCondition, TimeSpan timeout, OnWaitTimeout ontimeout, RunOrSleepFlags flags) in RunOrSleep.il:line IL_03B2 mvid D244
at JetBrains.Threading.JetDispatcher.Run(IProperty`1 condition, TimeSpan timeout, Boolean bThrowOnTimeout) in Run.il:line IL_0005 mvid D244
at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) in RunHostMessageLoop.il:line IL_000E mvid 5EF9
at JetBrains.Application.Environment.HostParameters.MessagePumpMainLoopHostMixin.JetBrains.Application.Environment.HostParameters.IRunMainLoopHostMixin.RunMainLoop(ComponentContainer containerEnv)
at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) in RunMainLoop.il:line IL_009F mvid 5EF9
at JetBrains.Application.Environment.JetEnvironment.&lt;&gt;c__DisplayClass12_0.&lt;RunUntilShutdown&gt;b__0() in JetEnvironment.il:line IL_0000 mvid 5EF9
at JetBrains.Util.Concurrency.ExecutionContextEx.WithinExecutionContext(Object o) in WithinExecutionContext.il:line IL_002F mvid D244
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid 243A
at JetBrains.Threading.JetDispatcher.Closure.Execute() in Execute.il:line IL_01C6 mvid D244
at JetBrains.Threading.JetDispatcher.Invoke(OuterLifetime lifetime, String name, CallerInfo&amp; caller, Action action, TaskPriority priority, Nullable`1 limit)
at JetBrains.Threading.JetDispatcher.Invoke(String name, Action action, TaskPriority priority, String callerFilePath, String callerMemberName)
at JetBrains.Application.Environment.JetEnvironment.RunUntilShutdown()
at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(JetHostParameters hostparams) in CreateAndRun.il:line IL_000B mvid 5EF9
at JetBrains.Application.Environment.JetHostItems.CreateAndRun(Full input) in CreateAndRun.il:line IL_0000 mvid 5EF9
at JetBrains.Rider.Backend.Product.RiderBackendProgram.MainX(Assembly assembly, HostInfo hostInfo) in MainX.il:line IL_00B3 mvid 2082
at JetBrains.Rider.Backend.Product.RiderBackendProgram.&lt;&gt;c.&lt;Main&gt;b__4_0(Lifetime lifetime) in RiderBackendProgram.il:line IL_002B mvid 2082
at JetBrains.Lifetimes.Lifetime.Using[T](Func`2 action) in Using.il:line IL_0014 mvid 6B8D
at JetBrains.Rider.Backend.Product.RiderBackendProgram.Main() in Main.il:line IL_005D mvid 2082
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
</Exception>
<!--The backup file has been created before writing in-memory changes to the settings file. As the existing settings file is corrupted, many settings might get lost when writing the new content. If you'd like to restore the settings from the previous version, here're the changes against the backed-up version (note: subsequent changes are not reflected here).-->
<InMemoryChanges>
<SetValue>
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=943f9249_002Ded52_002D453e_002Db953_002Db234aabc0cc0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="TryJsonStringDeserialize_Test" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
&lt;TestAncestor&gt;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.RegisterReaders.PoseidonCmdStartStop.CliRunnerTest.TryJsonStringDeserialize_Test&lt;/TestId&gt;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.RoiForFixedStartKeyence.RoiTest.Valve&lt;/TestId&gt;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.KeyenceIV3G120.CameraTest&lt;/TestId&gt;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Network.Camera.CJMS11.CameraTest&lt;/TestId&gt;
&lt;TestId&gt;MSTest::77EB589F-C670-4489-AAD6-2A3C02061FD1::.NETFramework,Version=v4.7.2::TBFTests.Rig.Output.FileWriters.Enhanced.WriterTest&lt;/TestId&gt;
&lt;/TestAncestor&gt;
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>
</SetValue>
<ClearValue></ClearValue>
</InMemoryChanges>
</CorruptedSettingsDescription>
+44
View File
@@ -0,0 +1,44 @@
///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System.Drawing;
using System.Windows.Forms;
namespace TBF.Boxes
{
public class CheckBoxImage : PictureBox
{
private bool cbChecked;
private readonly Image checkedImg;
private readonly Image uncheckedImg;
public CheckBoxImage()
: this(new Bitmap(TBF.Properties.Resources.SwitchOn), new Bitmap(TBF.Properties.Resources.SwitchOff), true)
{
SizeMode = PictureBoxSizeMode.StretchImage;
}
public CheckBoxImage(Image checkedImg, Image uncheckedImg, bool initState)
: base()
{
this.checkedImg = checkedImg;
this.uncheckedImg = uncheckedImg;
Click += (sender, e) => { Checked = !Checked; };
Checked = initState;
}
public bool Checked
{
get { return cbChecked; }
set
{
if (Enabled)
{
Image = value ? checkedImg : uncheckedImg;
cbChecked = value;
}
}
}
}
}
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.9.2147.1")]
[assembly: AssemblyFileVersion("3.9.2147.1")]
[assembly: AssemblyVersion("3.9.2149.0")]
[assembly: AssemblyFileVersion("3.9.2149.0")]
+5
View File
@@ -0,0 +1,5 @@
## Version History
| Version | Target Environment | Title | Description |
|------------|--------------------------------------------------------------|-----------------------------------------------------|------------------------------------|
| 3.9.2149.0 | HeatMeters, Heat meter sensors, Procedure Dilog, Tab Process | Excanged columns value 'Sensor' and 'Heat meter sensor' | Fix in code ProcedureDlg, row 1851 |
+8 -1
View File
@@ -1,12 +1,19 @@
///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using Common;
using Config.Entities;
namespace TBF.Rig.Generic
{
public interface ITestParams
public interface ITestParams : IParamsProvider
{
public string Activity { get; set; } /// Communication activity
public bool SimultWithPrevious { get; set; }
public bool SimultWithNext { get; set; }
void UpdateFromDbEntity(ComponentTest dbEntity);
void FromDbEntity(string componentName, Test test);
ComponentTest ToDbEntity(string componentName, Test test);
+26 -7
View File
@@ -127,11 +127,16 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
/// </summary>
/// <param name="time">Date and time</param>
/// <returns>File name</returns>
string GetFilename(string destinationPath, Results.Entities.Batch batch)
public string GetFilename(string destinationPath, Results.Entities.Batch batch, DateTime now)
{
string directory = destinationPath; /// Ends with "\\";
DateTime time = batch.EndTime;
if (writerCfg.FileNameFormat.Contains("{5:"))
{
time = now; //define path and file name now
}
switch (writerCfg.YearFolders)
{
case YearFolders.FourDigit:
@@ -195,7 +200,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
else
{
TBF.Rig.GenericDevices.IBenchInfo bi = TBF.Rig.Sequences.ProcessData.BenchInfo;
return directory + string.Format(writerCfg.FileNameFormat, batch.EndTime, batch.StartTime, batch.BatchNr, bi.TestBenchName, bi.TestBenchId);
return directory + string.Format(writerCfg.FileNameFormat, batch.EndTime, batch.StartTime, batch.BatchNr, bi.TestBenchName, bi.TestBenchId, time);
}
}
catch
@@ -248,6 +253,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
}
void WriteRslts(Results.Entities.Batch batch, string destination)
{
if (batch == null || batch.WaterMeters == null || batch.WaterMeters.Count <= 0) return;
@@ -257,8 +263,9 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
StreamWriter writer = StreamWriter.Null;
try
{
writer = File.AppendText(GetFilename(destination, batch));
WriteRsltsEx(batch, writer);
DateTime now = DateTime.Now; // Common time for '{5:' possibility of output
writer = File.AppendText(GetFilename(destination, batch, now));
WriteRsltsEx(batch, writer,now);
log.WarnFormat("Batch {0} written by {1} to file {2}", batch.BatchNr, Name, destination);
}
catch
@@ -273,7 +280,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
}
void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr)
public void WriteRsltsEx(Results.Entities.Batch batch, StreamWriter wrtr, DateTime now)
{
///----------
/// Header
@@ -291,7 +298,15 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
foreach (var v in commonItems)
{
leftColumn[cnt] = v.Caption;
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
if (v.Uid == 72 && writerCfg.FileNameFormat.Contains("{5:"))
{
rightColumn[cnt] = string.Format(v.Format, now);
}
else
{
rightColumn[cnt] = (batch.WaterMeters.Count > 0) ? v.Print(batch.WaterMeters[0]) : string.Empty;
}
cnt++;
}
@@ -308,7 +323,11 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
{
wrtr.Write(new string(' ', maxLen - leftColumn[i].Length + 3));
}
wrtr.Write(separatorStr);
if (!writerCfg.NoSeparatorBetweenItems)
{
wrtr.Write(separatorStr);
}
wrtr.WriteLine(rightColumn[i]);
}
@@ -33,6 +33,13 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
public string[] SelectedItems;
public string Footer;
[XmlIgnore]
private bool? noSeparatorBetweenItems;
public bool NoSeparatorBetweenItems {
get { return noSeparatorBetweenItems.HasValue ? noSeparatorBetweenItems.Value : false; }
set { noSeparatorBetweenItems = value;}
}
[XmlIgnore]
public MetersKind MetersKind;
@@ -61,11 +68,12 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
SaveGoodOnly = false;
Header = string.Empty;
Footer = string.Empty;
NoSeparatorBetweenItems = false;
}
public string ToString(int i)
{
return string.Format("{0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Separator={6}, NoSpaces={7}, GoodOnly={8}",
return string.Format("{0}, Path={1}, Y={2}, M={3}, D={4}, FNameFmt={5}, Separator={6}, NoSpaces={7}, GoodOnly={8}, NoSeparatorBetweenItems={9}",
Name,
DestinationPath,
YearFolders,
@@ -74,7 +82,8 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
FileNameFormat,
Separator,
EliminateSpaces,
SaveGoodOnly);
SaveGoodOnly,
NoSeparatorBetweenItems);
}
}
}
@@ -69,6 +69,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
separatorLabel.Text = "Separator";
eliminateSpacesCheckBox.Text = "No spaces";
goodOnlyCheckBox.Text = "Good only";
noSeparatorCICheckBox.Text = "No separ. `Common i`";
headerButton.Text = Strings.Header;
commonItemsButton.Text = "Common items";
testItemsButton.Text = "Test items";
@@ -96,7 +97,8 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
separatorComboBox.Text = config.Separator.ToString();
eliminateSpacesCheckBox.Checked = config.EliminateSpaces;
goodOnlyCheckBox.Checked = config.SaveGoodOnly;
}
noSeparatorCICheckBox.Checked = config.NoSeparatorBetweenItems;
}
public void Unlock()
{
@@ -118,6 +120,7 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
commonItemsButton.Enabled = true;
testItemsButton.Enabled = true;
footerButton.Enabled = true;
noSeparatorCICheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
@@ -255,6 +258,12 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
config.SaveGoodOnly = goodOnlyCheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.NoSeparatorBetweenItems != noSeparatorCICheckBox.Checked)
{
config.NoSeparatorBetweenItems = noSeparatorCICheckBox.Checked;
flags |= (CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
}
if (config.Header != header)
{
+447 -397
View File
@@ -25,409 +25,459 @@ namespace TBF.Rig.Output.FileWriters.Enhanced
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
this.testItemsButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
this.fileNameFmtLabel = new System.Windows.Forms.Label();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.headerButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.commonItemsButton = new System.Windows.Forms.Button();
this.upgradeWizardButton = new System.Windows.Forms.Button();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.subtitleFmtTextBox = new System.Windows.Forms.TextBox();
this.subtitleFmtLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(108, 28);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(17, 31);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(105, 6);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(108, 49);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(146, 20);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(17, 52);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(60, 13);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(269, 49);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 5;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(17, 224);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
this.separatorLabel.TabIndex = 19;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(108, 221);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
this.separatorComboBox.TabIndex = 20;
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(108, 296);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(146, 23);
this.testItemsButton.TabIndex = 25;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(17, 94);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(63, 13);
this.yearFoldersLabel.TabIndex = 9;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(17, 116);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(71, 13);
this.monthFoldersLabel.TabIndex = 11;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(17, 138);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(60, 13);
this.dayFoldersLabel.TabIndex = 13;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(108, 91);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.yearFoldersComboBox.TabIndex = 10;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(108, 113);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.monthFoldersComboBox.TabIndex = 12;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(108, 135);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(146, 21);
this.dayFoldersComboBox.TabIndex = 14;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(269, 70);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(30, 20);
this.destination2Button.TabIndex = 8;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(108, 70);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(146, 20);
this.destination2TextBox.TabIndex = 7;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(17, 73);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(69, 13);
this.destination2Label.TabIndex = 6;
this.destination2Label.Text = "Destination 2";
//
// fileNameFmtTextBox
//
this.fileNameFmtTextBox.Enabled = false;
this.fileNameFmtTextBox.Location = new System.Drawing.Point(108, 157);
this.fileNameFmtTextBox.Name = "fileNameFmtTextBox";
this.fileNameFmtTextBox.Size = new System.Drawing.Size(146, 20);
this.fileNameFmtTextBox.TabIndex = 16;
//
// fileNameFmtLabel
//
this.fileNameFmtLabel.AutoSize = true;
this.fileNameFmtLabel.Location = new System.Drawing.Point(17, 160);
this.fileNameFmtLabel.Name = "fileNameFmtLabel";
this.fileNameFmtLabel.Size = new System.Drawing.Size(84, 13);
this.fileNameFmtLabel.TabIndex = 15;
this.fileNameFmtLabel.Text = "File name format";
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(20, 262);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(77, 17);
this.eliminateSpacesCheckBox.TabIndex = 21;
this.eliminateSpacesCheckBox.Text = "No spaces";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(108, 246);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(146, 23);
this.headerButton.TabIndex = 23;
this.headerButton.Text = "Header";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(108, 321);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(146, 23);
this.footerButton.TabIndex = 26;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(108, 271);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(146, 23);
this.commonItemsButton.TabIndex = 24;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// upgradeWizardButton
//
this.upgradeWizardButton.Location = new System.Drawing.Point(269, 271);
this.upgradeWizardButton.Name = "upgradeWizardButton";
this.upgradeWizardButton.Size = new System.Drawing.Size(80, 48);
this.upgradeWizardButton.TabIndex = 27;
this.upgradeWizardButton.Text = "Upgrade wizard";
this.upgradeWizardButton.UseVisualStyleBackColor = true;
this.upgradeWizardButton.Click += new System.EventHandler(this.upgradeWizardButton_Click);
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(108, 178);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(146, 21);
this.cultureComboBox.TabIndex = 18;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(17, 181);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(42, 13);
this.cultureLabel.TabIndex = 17;
this.cultureLabel.Text = "Cullture";
//
// goodOnlyCheckBox
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(20, 285);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(74, 17);
this.goodOnlyCheckBox.TabIndex = 22;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = true;
//
// subtitleFmtTextBox
//
this.subtitleFmtTextBox.Enabled = false;
this.subtitleFmtTextBox.Location = new System.Drawing.Point(108, 200);
this.subtitleFmtTextBox.Name = "subtitleFmtTextBox";
this.subtitleFmtTextBox.Size = new System.Drawing.Size(146, 20);
this.subtitleFmtTextBox.TabIndex = 29;
//
// subtitleFmtLabel
//
this.subtitleFmtLabel.AutoSize = true;
this.subtitleFmtLabel.Location = new System.Drawing.Point(17, 203);
this.subtitleFmtLabel.Name = "subtitleFmtLabel";
this.subtitleFmtLabel.Size = new System.Drawing.Size(74, 13);
this.subtitleFmtLabel.TabIndex = 28;
this.subtitleFmtLabel.Text = "Subtitle format";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(257, 211);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(174, 13);
this.label1.TabIndex = 30;
this.label1.Text = "4:wmStr 5:s/n 6:main s/n 7:aux.s/n";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(257, 198);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(168, 13);
this.label2.TabIndex = 31;
this.label2.Text = "0:pos 1:s/n 2:aux.s/n 3:compl.s/n";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(257, 155);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(138, 13);
this.label3.TabIndex = 32;
this.label3.Text = "0:end t. 1:start t. 2:batch nr.";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(257, 168);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(128, 13);
this.label4.TabIndex = 33;
this.label4.Text = "3:bench name 4:bench id";
//
// WriterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.subtitleFmtTextBox);
this.Controls.Add(this.subtitleFmtLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.upgradeWizardButton);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.fileNameFmtTextBox);
this.Controls.Add(this.fileNameFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "WriterCfgCtrl";
this.Size = new System.Drawing.Size(440, 350);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.destinationButton = new System.Windows.Forms.Button();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
this.testItemsButton = new System.Windows.Forms.Button();
this.yearFoldersLabel = new System.Windows.Forms.Label();
this.monthFoldersLabel = new System.Windows.Forms.Label();
this.dayFoldersLabel = new System.Windows.Forms.Label();
this.yearFoldersComboBox = new System.Windows.Forms.ComboBox();
this.monthFoldersComboBox = new System.Windows.Forms.ComboBox();
this.dayFoldersComboBox = new System.Windows.Forms.ComboBox();
this.destination2Button = new System.Windows.Forms.Button();
this.destination2TextBox = new System.Windows.Forms.TextBox();
this.destination2Label = new System.Windows.Forms.Label();
this.fileNameFmtTextBox = new System.Windows.Forms.TextBox();
this.fileNameFmtLabel = new System.Windows.Forms.Label();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.headerButton = new System.Windows.Forms.Button();
this.footerButton = new System.Windows.Forms.Button();
this.commonItemsButton = new System.Windows.Forms.Button();
this.upgradeWizardButton = new System.Windows.Forms.Button();
this.cultureComboBox = new System.Windows.Forms.ComboBox();
this.cultureLabel = new System.Windows.Forms.Label();
this.goodOnlyCheckBox = new System.Windows.Forms.CheckBox();
this.subtitleFmtTextBox = new System.Windows.Forms.TextBox();
this.subtitleFmtLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.noSeparatorCICheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(162, 43);
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(217, 26);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(26, 48);
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(51, 20);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(158, 9);
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(125, 20);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(162, 75);
this.destinationTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(217, 26);
this.destinationTextBox.TabIndex = 4;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(26, 80);
this.destinationLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(90, 20);
this.destinationLabel.TabIndex = 3;
this.destinationLabel.Text = "Destination";
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(404, 75);
this.destinationButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(45, 31);
this.destinationButton.TabIndex = 5;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(26, 345);
this.separatorLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(80, 20);
this.separatorLabel.TabIndex = 19;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(162, 340);
this.separatorComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(217, 28);
this.separatorComboBox.TabIndex = 20;
//
// testItemsButton
//
this.testItemsButton.Enabled = false;
this.testItemsButton.Location = new System.Drawing.Point(162, 455);
this.testItemsButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.testItemsButton.Name = "testItemsButton";
this.testItemsButton.Size = new System.Drawing.Size(219, 35);
this.testItemsButton.TabIndex = 25;
this.testItemsButton.Text = "Test items";
this.testItemsButton.UseVisualStyleBackColor = true;
this.testItemsButton.Click += new System.EventHandler(this.testItemsButton_Click);
//
// yearFoldersLabel
//
this.yearFoldersLabel.AutoSize = true;
this.yearFoldersLabel.Location = new System.Drawing.Point(26, 145);
this.yearFoldersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.yearFoldersLabel.Name = "yearFoldersLabel";
this.yearFoldersLabel.Size = new System.Drawing.Size(95, 20);
this.yearFoldersLabel.TabIndex = 9;
this.yearFoldersLabel.Text = "Year folders";
//
// monthFoldersLabel
//
this.monthFoldersLabel.AutoSize = true;
this.monthFoldersLabel.Location = new System.Drawing.Point(26, 178);
this.monthFoldersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.monthFoldersLabel.Name = "monthFoldersLabel";
this.monthFoldersLabel.Size = new System.Drawing.Size(106, 20);
this.monthFoldersLabel.TabIndex = 11;
this.monthFoldersLabel.Text = "Month folders";
//
// dayFoldersLabel
//
this.dayFoldersLabel.AutoSize = true;
this.dayFoldersLabel.Location = new System.Drawing.Point(26, 212);
this.dayFoldersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.dayFoldersLabel.Name = "dayFoldersLabel";
this.dayFoldersLabel.Size = new System.Drawing.Size(89, 20);
this.dayFoldersLabel.TabIndex = 13;
this.dayFoldersLabel.Text = "Day folders";
//
// yearFoldersComboBox
//
this.yearFoldersComboBox.Enabled = false;
this.yearFoldersComboBox.FormattingEnabled = true;
this.yearFoldersComboBox.Location = new System.Drawing.Point(162, 140);
this.yearFoldersComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.yearFoldersComboBox.Name = "yearFoldersComboBox";
this.yearFoldersComboBox.Size = new System.Drawing.Size(217, 28);
this.yearFoldersComboBox.TabIndex = 10;
//
// monthFoldersComboBox
//
this.monthFoldersComboBox.Enabled = false;
this.monthFoldersComboBox.FormattingEnabled = true;
this.monthFoldersComboBox.Location = new System.Drawing.Point(162, 174);
this.monthFoldersComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.monthFoldersComboBox.Name = "monthFoldersComboBox";
this.monthFoldersComboBox.Size = new System.Drawing.Size(217, 28);
this.monthFoldersComboBox.TabIndex = 12;
//
// dayFoldersComboBox
//
this.dayFoldersComboBox.Enabled = false;
this.dayFoldersComboBox.FormattingEnabled = true;
this.dayFoldersComboBox.Location = new System.Drawing.Point(162, 208);
this.dayFoldersComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dayFoldersComboBox.Name = "dayFoldersComboBox";
this.dayFoldersComboBox.Size = new System.Drawing.Size(217, 28);
this.dayFoldersComboBox.TabIndex = 14;
//
// destination2Button
//
this.destination2Button.Enabled = false;
this.destination2Button.Location = new System.Drawing.Point(404, 108);
this.destination2Button.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destination2Button.Name = "destination2Button";
this.destination2Button.Size = new System.Drawing.Size(45, 31);
this.destination2Button.TabIndex = 8;
this.destination2Button.Text = "...";
this.destination2Button.UseVisualStyleBackColor = true;
//
// destination2TextBox
//
this.destination2TextBox.Enabled = false;
this.destination2TextBox.Location = new System.Drawing.Point(162, 108);
this.destination2TextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.destination2TextBox.Name = "destination2TextBox";
this.destination2TextBox.Size = new System.Drawing.Size(217, 26);
this.destination2TextBox.TabIndex = 7;
//
// destination2Label
//
this.destination2Label.AutoSize = true;
this.destination2Label.Location = new System.Drawing.Point(26, 112);
this.destination2Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.destination2Label.Name = "destination2Label";
this.destination2Label.Size = new System.Drawing.Size(103, 20);
this.destination2Label.TabIndex = 6;
this.destination2Label.Text = "Destination 2";
//
// fileNameFmtTextBox
//
this.fileNameFmtTextBox.Enabled = false;
this.fileNameFmtTextBox.Location = new System.Drawing.Point(162, 242);
this.fileNameFmtTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.fileNameFmtTextBox.Name = "fileNameFmtTextBox";
this.fileNameFmtTextBox.Size = new System.Drawing.Size(217, 26);
this.fileNameFmtTextBox.TabIndex = 16;
//
// fileNameFmtLabel
//
this.fileNameFmtLabel.AutoSize = true;
this.fileNameFmtLabel.Location = new System.Drawing.Point(26, 246);
this.fileNameFmtLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.fileNameFmtLabel.Name = "fileNameFmtLabel";
this.fileNameFmtLabel.Size = new System.Drawing.Size(128, 20);
this.fileNameFmtLabel.TabIndex = 15;
this.fileNameFmtLabel.Text = "File name format";
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Enabled = false;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(30, 403);
this.eliminateSpacesCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(110, 24);
this.eliminateSpacesCheckBox.TabIndex = 21;
this.eliminateSpacesCheckBox.Text = "No spaces";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// headerButton
//
this.headerButton.Enabled = false;
this.headerButton.Location = new System.Drawing.Point(162, 378);
this.headerButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.headerButton.Name = "headerButton";
this.headerButton.Size = new System.Drawing.Size(219, 35);
this.headerButton.TabIndex = 23;
this.headerButton.Text = "Header";
this.headerButton.UseVisualStyleBackColor = true;
this.headerButton.Click += new System.EventHandler(this.headerButton_Click);
//
// footerButton
//
this.footerButton.Enabled = false;
this.footerButton.Location = new System.Drawing.Point(162, 494);
this.footerButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.footerButton.Name = "footerButton";
this.footerButton.Size = new System.Drawing.Size(219, 35);
this.footerButton.TabIndex = 26;
this.footerButton.Text = "Footer";
this.footerButton.UseVisualStyleBackColor = true;
this.footerButton.Click += new System.EventHandler(this.footerButton_Click);
//
// commonItemsButton
//
this.commonItemsButton.Enabled = false;
this.commonItemsButton.Location = new System.Drawing.Point(162, 417);
this.commonItemsButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.commonItemsButton.Name = "commonItemsButton";
this.commonItemsButton.Size = new System.Drawing.Size(219, 35);
this.commonItemsButton.TabIndex = 24;
this.commonItemsButton.Text = "Common items";
this.commonItemsButton.UseVisualStyleBackColor = true;
this.commonItemsButton.Click += new System.EventHandler(this.commonItemsButton_Click);
//
// upgradeWizardButton
//
this.upgradeWizardButton.Location = new System.Drawing.Point(404, 417);
this.upgradeWizardButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.upgradeWizardButton.Name = "upgradeWizardButton";
this.upgradeWizardButton.Size = new System.Drawing.Size(120, 74);
this.upgradeWizardButton.TabIndex = 27;
this.upgradeWizardButton.Text = "Upgrade wizard";
this.upgradeWizardButton.UseVisualStyleBackColor = true;
this.upgradeWizardButton.Click += new System.EventHandler(this.upgradeWizardButton_Click);
//
// cultureComboBox
//
this.cultureComboBox.Enabled = false;
this.cultureComboBox.FormattingEnabled = true;
this.cultureComboBox.Location = new System.Drawing.Point(162, 274);
this.cultureComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.cultureComboBox.Name = "cultureComboBox";
this.cultureComboBox.Size = new System.Drawing.Size(217, 28);
this.cultureComboBox.TabIndex = 18;
//
// cultureLabel
//
this.cultureLabel.AutoSize = true;
this.cultureLabel.Location = new System.Drawing.Point(26, 278);
this.cultureLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.cultureLabel.Name = "cultureLabel";
this.cultureLabel.Size = new System.Drawing.Size(63, 20);
this.cultureLabel.TabIndex = 17;
this.cultureLabel.Text = "Cullture";
//
// goodOnlyCheckBox
//
this.goodOnlyCheckBox.AutoSize = true;
this.goodOnlyCheckBox.Enabled = false;
this.goodOnlyCheckBox.Location = new System.Drawing.Point(30, 438);
this.goodOnlyCheckBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.goodOnlyCheckBox.Name = "goodOnlyCheckBox";
this.goodOnlyCheckBox.Size = new System.Drawing.Size(107, 24);
this.goodOnlyCheckBox.TabIndex = 22;
this.goodOnlyCheckBox.Text = "Good only";
this.goodOnlyCheckBox.UseVisualStyleBackColor = false;
//
// subtitleFmtTextBox
//
this.subtitleFmtTextBox.Enabled = false;
this.subtitleFmtTextBox.Location = new System.Drawing.Point(162, 308);
this.subtitleFmtTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.subtitleFmtTextBox.Name = "subtitleFmtTextBox";
this.subtitleFmtTextBox.Size = new System.Drawing.Size(217, 26);
this.subtitleFmtTextBox.TabIndex = 29;
//
// subtitleFmtLabel
//
this.subtitleFmtLabel.AutoSize = true;
this.subtitleFmtLabel.Location = new System.Drawing.Point(26, 312);
this.subtitleFmtLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.subtitleFmtLabel.Name = "subtitleFmtLabel";
this.subtitleFmtLabel.Size = new System.Drawing.Size(113, 20);
this.subtitleFmtLabel.TabIndex = 28;
this.subtitleFmtLabel.Text = "Subtitle format";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(386, 325);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(248, 20);
this.label1.TabIndex = 30;
this.label1.Text = "4:wmStr 5:s/n 6:main s/n 7:aux.s/n";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(386, 305);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(237, 20);
this.label2.TabIndex = 31;
this.label2.Text = "0:pos 1:s/n 2:aux.s/n 3:compl.s/n";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(386, 238);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(203, 20);
this.label3.TabIndex = 32;
this.label3.Text = "0:end t. 1:start t. 2:batch nr.";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(386, 258);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(239, 20);
this.label4.TabIndex = 33;
this.label4.Text = "3:bench name 4:bench id, 5:Now";
//
// noSeparatorCICheckBox
//
this.noSeparatorCICheckBox.Enabled = false;
this.noSeparatorCICheckBox.Location = new System.Drawing.Point(30, 470);
this.noSeparatorCICheckBox.Name = "noSeparatorCICheckBox";
this.noSeparatorCICheckBox.Size = new System.Drawing.Size(125, 59);
this.noSeparatorCICheckBox.TabIndex = 34;
this.noSeparatorCICheckBox.Text = "No separ. \"Common i.\"";
this.noSeparatorCICheckBox.UseVisualStyleBackColor = true;
//
// WriterCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.noSeparatorCICheckBox);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.subtitleFmtTextBox);
this.Controls.Add(this.subtitleFmtLabel);
this.Controls.Add(this.goodOnlyCheckBox);
this.Controls.Add(this.cultureComboBox);
this.Controls.Add(this.cultureLabel);
this.Controls.Add(this.upgradeWizardButton);
this.Controls.Add(this.commonItemsButton);
this.Controls.Add(this.footerButton);
this.Controls.Add(this.headerButton);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.fileNameFmtTextBox);
this.Controls.Add(this.fileNameFmtLabel);
this.Controls.Add(this.destination2Button);
this.Controls.Add(this.destination2TextBox);
this.Controls.Add(this.destination2Label);
this.Controls.Add(this.dayFoldersComboBox);
this.Controls.Add(this.monthFoldersComboBox);
this.Controls.Add(this.yearFoldersComboBox);
this.Controls.Add(this.dayFoldersLabel);
this.Controls.Add(this.monthFoldersLabel);
this.Controls.Add(this.yearFoldersLabel);
this.Controls.Add(this.testItemsButton);
this.Controls.Add(this.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "WriterCfgCtrl";
this.Size = new System.Drawing.Size(660, 538);
this.Load += new System.EventHandler(this.WriterCfgCtrl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.CheckBox noSeparatorCICheckBox;
#endregion
private System.Windows.Forms.TextBox nameTextBox;
+109
View File
@@ -0,0 +1,109 @@
///
/// Copyright (c) 2015-2021 Sensus Metering Systems
///
namespace TBF.Rig.RegisterReaders.CommonRR
{
public enum MessageID
{
Calibration = 0x00, /// Access to stCalibration
Configuration = 0x01, /// Access to stConfig
Status = 0x02, /// Access to stStaus, read only
Power = 0x03, /// Access to stPower, containing power info from both processors
LCD = 0x04, /// Access to stLCD
EventData = 0x05, /// NOT USED
IntervalData = 0x06, /// NOT USED
Diagnostics = 0x07, /// Access tostMetroDiagArray, read onl
MetrologyMemory = 0x08, /// Memory block access, read only
Error_LongAck = 0x09, /// Error message
Command = 0x0A, /// Command to execute, with no arguments
Parameterizing = 0x0B, /// Parameterizing message is used in MCI-SPI interface only
Error_ShortAck = 0x0C, /// Short acknowledge message is used in MCI-SPI interface only
ChanelAlive = 0x0D, /// Channel alive message is used in MCI-SPI interface only
RadioPassthrough = 0x0E, /// RFID <-> Metrology <-> Radio passthrough message
ASICRegisterReadTest = 0x0F, /// ASIC Register read test
IMIDebugMessagesAccess = 0x10, /// IMI debug messages read test
ProductionChecksumsRead = 0x11, /// Production checksum read: Calibration (1 byte), Configuration (2 bytes), spare (4 bytes)
HardwareParametersTest = 0x12, /// Hardware Parameters Testing: User configurable fixed field drive time (1 byte)
/// <summary>
/// Notes:
/// 1. Short Ack message contains 1-byte error code and all the fields (Offset, Payload length, payload and password) will not be present.
/// 2. Channel Alive message does not contain the fields (Offset, Payload length, payload and password).
/// 3. Except the above two special messages, rest all the messages in the above table will follow the message format mentioned in sections 3.1 and 3.2.
/// </summary>
Count /// Number of MessageID-s
}
public enum MeterType : byte
{
DN15 = 0,
CoaxManifold = 1,
DN20 = 2,
DN25 = 3, /// DN25 Q3 = 6.3 m3/h
DN25_Q3_10 = 4, /// DN25 Q3 = 10 m3/h
DN32 = 5,
DN40 = 6,
AutoDetect,
Count /// Number of meter types
}
public enum VolumeUnits : byte
{
m3 = 0,
UK_gallon = 1,
US_gallon = 2,
Count /// Number of volume units
}
public enum FlowArrow : byte
{
No = 0,
Right = 1,
Left = 2,
Count /// Number of flow arrows
}
public enum MeterSealed : byte
{
InProduction = 0x00,
OutOfProduction = 0xA5,
Sealed = 0x5A,
}
public enum MeterState : byte
{
None = 0,
Idle = 1,
Active = 2,
Test = 3,
EndOfLife = 4,
Count /// Number of meter states
}
public enum Command : byte
{
SetActiveMode = 6,
SetTestMode = 7,
}
public enum FlowState : byte
{
No = 0,
Reverse = 1,
Forward = 2,
EmptyPipe = 3,
Count /// Number of flow states
}
public enum DataStreamState
{
Flush = 0,
ProcessAndSave,
}
public enum CommunicationInterface
{
RFID,
NFC
}
}
+8
View File
@@ -0,0 +1,8 @@
namespace TBF.Rig.RegisterReaders.CommonRR
{
public interface IArg
{
int Value { get; }
string Name { get; }
}
}
@@ -0,0 +1,16 @@
using System.IO.Ports;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
{
public interface ICombiHeadParams
{
///
/// NFC S4.5 Combihead params
///
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; }
}
}
@@ -0,0 +1,13 @@
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
{
public interface ICommunicationTimeOuts
{
/// Communication timeout in ms (500 .. 5000)
public int DelayBetweenRetries { get; set; } /// Delay between communication retries in ms (0 .. 5000)
public int MaxCommRetries { get; set; } /// Max. number of retries (1 .. 10)
public int WaitTimeAfterFailure { get; set; } /// Wait time after communication failure in ms
public int PassThroughWaitTime { get; set; } /// Pass Through wait time for radio parameters in ms
public int NrThreads { get; set; } /// Numbwr of parallel threads (1, 2 or 4)
public int CommTimeout { get; set; }
}
}
@@ -0,0 +1,16 @@
using System;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
{
public interface ISerialPortData
{
public Boolean? CliExists { get;}
public string CmdClientName { get; set; }
public string PortName { get; set; }
public int MeterType { get; set; }
public string SerialPortCmdClientPath { get; }
public IArg MeterArg { get; }
}
}
@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.IO.Ports;
using Config.Entities;
using TBF.Rig.Generic;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
{
public interface ITestMethodCfg : IComponentCfg, ICommunicationTimeOuts, ICombiHeadParams, IWebService
{
public abstract IComponentCfgCtrl GetControl(IList<Component> cmpntEntities);
public abstract string ToString(int i);
}
}
@@ -0,0 +1,9 @@
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
{
public interface IWebService
{
public bool UseWebService { get; set; }
public string BaseUrl { get; set; }
public string RelativeUrl { get; set; }
}
}
@@ -0,0 +1,41 @@
using System.IO.Ports;
using System.Xml.Serialization;
using TBF.Rig.Generic;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl
{
public interface IiPerlTestMethodCfg : ITestMethodCfg
{
///
/// Serialized parameters
///
public int IperlCheckErrorsToStop { 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; }
/// <summary> Test parameters </summary>
/// Remember to Ignore in XmlSerializer !!
[XmlIgnore]
public ITestParams TestParams { get; set; }
}
}
@@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.IO;
using Sensus.iPerl.RfidCom.Structures;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
namespace NfcC7_DLL.NfcHanler.Utils
{
public class SerialPortData : ISerialPortData
{
private Boolean? _cliExists;
public bool? CliExists
{
get
{
if (_cliExists == null || !_cliExists.HasValue)
{
_cliExists = File.Exists(SerialPortCmdClientPath);
}
return _cliExists.Value;
}
}
public string SerialPortCmdClientPath {
get {
#if DEBUG
return Path.Combine("C:","TBF","Cli", CmdClientName);
#else
return Path.Combine("..","Cli", CmdClientName);
#endif
}
}
public string CmdClientName { get; set; } = "HalCli.exe";
public string PortName { get; set; }
public int MeterType { get; set; }
public class EMeterArg : IArg{
public int Value { get; }
public string Name { get; }
private EMeterArg(int value, string name)
{
Value = value;
Name = name;
}
public static readonly EMeterArg Calibration = new EMeterArg(0, "Calibration");
public static readonly EMeterArg AllParams = new EMeterArg(2, "AllParams");
public static readonly EMeterArg DeviceId = new EMeterArg(3, "DeviceId");
public static readonly EMeterArg OptoHead = new EMeterArg(4, "OptoHead");
}
public IArg MeterArg { get{return _eMeterArg;} }
EMeterArg _eMeterArg = EMeterArg.AllParams;
private static readonly Dictionary<EMeterArg, string> _commandsRead = new Dictionary<EMeterArg, string>
{
{ EMeterArg.AllParams, "-p {0} -m {1} --operation readall" },
{ EMeterArg.DeviceId, "-p {0} -m {1} --operation read --parameter DeviceId" },
{ EMeterArg.OptoHead, "-p {0} -m {1} --operation read --parameter \"OpticalDataMode\"" }
};
public string DefaultArgSettingsRead(IArg eMeterArg)
{
EMeterArg meterArg = eMeterArg as EMeterArg;
if (meterArg != null && _commandsRead.TryGetValue(meterArg, out var cmd))
return string.Format(cmd, PortName, MeterType);
throw new Exception("Not implemented correct command!");
}
private static readonly Dictionary<EMeterArg, string> _commandsWrite = new Dictionary<EMeterArg, string>
{
{ EMeterArg.Calibration, "-p {0} -m {1} --operation write --parameter Calibration --value {2}" },
{ EMeterArg.OptoHead, "-p {0} -m {1} --operation write --parameter \"OpticalDataMode\" --value {arg}" },
};
public string DefaultArgSettingsWrite(IArg eMeterArg, string arg)
{
EMeterArg meterArg = eMeterArg as EMeterArg;
if (meterArg != null && _commandsRead.TryGetValue(meterArg, out var cmd))
return string.Format(cmd, PortName, MeterType);
throw new Exception("Not implemented correct command!");
}
public SerialPortData(
string portName,
string cmdClientName,
int meterType)
{
PortName = portName;
CmdClientName = cmdClientName;
MeterType = meterType;
}
}
}
@@ -0,0 +1,243 @@
///
/// Copyright (c) 2015-2020 Sensus Metering Systems
///
using System;
using System.IO;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
public class CalibrationStruct
{
public const int Length = 35;
public Byte Version;
public MeterType MeterType;
public UInt16 Calibration;
public VolumeUnits VolumeUnits;
public FlowArrow FlowArrow;
public UInt16 FWVersion;
public UInt16[] TargetField;
public UInt16 RecipMeanCurrent;
public UInt16 ThresholdVolume;
public UInt16 ThresholdTime;
public UInt16 FlowActivationThr;
public UInt16 VolumeArrowThr;
public UInt32 CalibrationTime;
public ulong SerialNumber;
public MeterSealed MeterSealed;
public byte CheckSum;
public CalibrationStruct()
{
TargetField = new UInt16[3];
}
public byte[] ToByteArray()
{
byte[] result = new byte[Length];
result[0] = Version;
result[1] = (byte)MeterType;
result[2] = (byte)(Calibration & 0x00FF);
result[3] = (byte)((Calibration >> 8) & 0x00FF);
result[4] = (byte)VolumeUnits;
result[5] = (byte)FlowArrow;
result[6] = (byte)(FWVersion & 0x00FF);
result[7] = (byte)((FWVersion >> 8) & 0x00FF);
result[8] = (byte)( TargetField[0] & 0x00FF);
result[9] = (byte)((TargetField[0] >> 8) & 0x00FF);
result[10] = (byte)( TargetField[1] & 0x00FF);
result[11] = (byte)((TargetField[1] >> 8) & 0x00FF);
result[12] = (byte)( TargetField[2] & 0x00FF);
result[13] = (byte)((TargetField[2] >> 8) & 0x00FF);
result[14] = (byte)(RecipMeanCurrent & 0x00FF);
result[15] = (byte)((RecipMeanCurrent >> 8) & 0x00FF);
result[16] = (byte)(ThresholdVolume & 0x00FF);
result[17] = (byte)((ThresholdVolume >> 8) & 0x00FF);
result[18] = (byte)(ThresholdTime & 0x00FF);
result[19] = (byte)((ThresholdTime >> 8) & 0x00FF);
result[20] = (byte)(FlowActivationThr & 0x00FF);
result[21] = (byte)((FlowActivationThr >> 8) & 0x00FF);
result[22] = (byte)(VolumeArrowThr & 0x00FF);
result[23] = (byte)((VolumeArrowThr >> 8) & 0x00FF);
result[24] = (byte)(CalibrationTime & 0x000000FF);
result[25] = (byte)((CalibrationTime >> 8) & 0x000000FF);
result[26] = (byte)((CalibrationTime >> 16) & 0x000000FF);
result[27] = (byte)((CalibrationTime >> 24) & 0x000000FF);
result[28] = (byte)(SerialNumber & 0x00000000000000FF);
result[29] = (byte)((SerialNumber >> 8) & 0x00000000000000FF);
result[30] = (byte)((SerialNumber >> 16) & 0x00000000000000FF);
result[31] = (byte)((SerialNumber >> 24) & 0x00000000000000FF);
result[32] = (byte)((SerialNumber >> 32) & 0x00000000000000FF);
result[33] = (byte)MeterSealed;
result[34] = CheckSum;
return result;
}
/// <summary>
/// Create a calibration structure from a complete byte array
/// </summary>
/// <param name="data">A complete byte array data</param>
/// <returns>CalibrationStruct or null when byte array was not complete</returns>
public static CalibrationStruct FromByteArray(byte[] data)
{
if (data.Length != Length) return null;
CalibrationStruct result = new CalibrationStruct();
result.Version = data[0];
result.MeterType = (MeterType)data[1];
result.Calibration = (UInt16)(data[2] + 256 * data[3]);
result.VolumeUnits = (VolumeUnits)data[4];
result.FlowArrow = (FlowArrow)data[5];
result.FWVersion = (UInt16)(data[6] + 256 * data[7]);
result.TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
result.TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
result.TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
result.RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
result.ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
result.ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
result.FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
result.VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
result.CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
result.SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
result.MeterSealed = (MeterSealed)data[33];
result.CheckSum = data[34];
return result;
}
/// <summary>
/// Update the calibration structure from an incomplete byte array
/// </summary>
/// <param name="data">Byte array data</param>
/// <param name="offset">Offset of byte array data in CalibrationStruct</param>
/// <returns>true when successful, false when data are not appropriate</returns>
public bool Update(byte[] data, int offset)
{
if ((data.Length == 2) && (offset == 2))
{
/// Data containing iPerl calibration factor
Calibration = (UInt16)(data[0] + 256 * data[1]);
return true;
}
else if ((data.Length == Length) && (offset == 0))
{
/// Data containing a complete CalibrationStruct
Version = data[0];
MeterType = (MeterType)data[1];
Calibration = (UInt16)(data[2] + 256 * data[3]);
VolumeUnits = (VolumeUnits)data[4];
FlowArrow = (FlowArrow)data[5];
FWVersion = (UInt16)(data[6] + 256 * data[7]);
TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
MeterSealed = (MeterSealed)data[33];
CheckSum = data[34];
return true;
}
else
return false;
}
public string FWVersionStr()
{
int d1 = (FWVersion >> 8) & 0x000F;
int d2 = (FWVersion >> 12) & 0x000F;
int d3 = (FWVersion >> 4) & 0x000F;
int d4 = FWVersion & 0x000F;
return string.Format("{0}.{1}{2}{3}", d1, d2, d3, d4);
}
public override string ToString()
{
return string.Format("Calibration: V{0} Type={1} Cal={2} Units={3} FlowArrow.{4} FW={5} Hi={6} Norm={7} Low={8} RMC={9} ThrVol={10} ThrTime={11} FlActThr={12} VolArrThr={13} CalTm={14} SN={15} MeterSealed={16} Chksum={17}",
Version,
MeterType,
Calibration,
VolumeUnits,
FlowArrow,
FWVersion,
TargetField[0],
TargetField[1],
TargetField[2],
RecipMeanCurrent,
ThresholdVolume,
ThresholdTime,
FlowActivationThr,
VolumeArrowThr,
CalibrationTime,
SerialNumber,
MeterSealed,
CheckSum.ToString("X2"));
}
public virtual void WriteBinary(BinaryWriter writer)
{
writer.Write(Version);
writer.Write((byte)MeterType);
writer.Write(Calibration);
writer.Write((byte)VolumeUnits);
writer.Write((byte)FlowArrow);
writer.Write(FWVersion);
writer.Write(TargetField[0]);
writer.Write(TargetField[1]);
writer.Write(TargetField[2]);
writer.Write(RecipMeanCurrent);
writer.Write(ThresholdVolume);
writer.Write(ThresholdTime);
writer.Write(FlowActivationThr);
writer.Write(VolumeArrowThr);
writer.Write(CalibrationTime);
writer.Write(SerialNumber);
writer.Write((byte)MeterSealed);
writer.Write(CheckSum);
}
public virtual void ReadBinary(BinaryReader reader)
{
Version = reader.ReadByte();
MeterType = (MeterType)reader.ReadByte();
Calibration = reader.ReadUInt16();
VolumeUnits = (VolumeUnits)reader.ReadByte();
FlowArrow = (FlowArrow)reader.ReadByte();
FWVersion = reader.ReadUInt16();
TargetField[0] = reader.ReadUInt16();
TargetField[1] = reader.ReadUInt16();
TargetField[2] = reader.ReadUInt16();
RecipMeanCurrent = reader.ReadUInt16();
ThresholdVolume = reader.ReadUInt16();
ThresholdTime = reader.ReadUInt16();
FlowActivationThr = reader.ReadUInt16();
VolumeArrowThr = reader.ReadUInt16();
CalibrationTime = reader.ReadUInt32();
SerialNumber = reader.ReadUInt64();
MeterSealed = (MeterSealed)reader.ReadByte();
CheckSum = reader.ReadByte();
}
}
}
@@ -0,0 +1,259 @@
///
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
///
using System;
using System.IO;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
public class CalibrationStructV4
{
public const int Length = 37;
public Byte Version;
public MeterType MeterType;
public UInt16 Calibration;
public VolumeUnits VolumeUnits;
public FlowArrow FlowArrow;
public UInt16 FWVersion;
public UInt16[] TargetField;
public UInt16 RecipMeanCurrent;
public UInt16 ThresholdVolume;
public UInt16 ThresholdTime;
public UInt16 FlowActivationThr;
public UInt16 VolumeArrowThr;
public UInt32 CalibrationTime;
public ulong SerialNumber;
public MeterSealed MeterSealed;
public UInt16 CalibrationLNA;
public byte CheckSum;
public CalibrationStructV4()
{
TargetField = new UInt16[3];
}
public byte[] ToByteArray()
{
byte[] result = new byte[Length];
result[0] = Version;
result[1] = (byte)MeterType;
result[2] = (byte)(Calibration & 0x00FF);
result[3] = (byte)((Calibration >> 8) & 0x00FF);
result[4] = (byte)VolumeUnits;
result[5] = (byte)FlowArrow;
result[6] = (byte)(FWVersion & 0x00FF);
result[7] = (byte)((FWVersion >> 8) & 0x00FF);
result[8] = (byte)( TargetField[0] & 0x00FF);
result[9] = (byte)((TargetField[0] >> 8) & 0x00FF);
result[10] = (byte)( TargetField[1] & 0x00FF);
result[11] = (byte)((TargetField[1] >> 8) & 0x00FF);
result[12] = (byte)( TargetField[2] & 0x00FF);
result[13] = (byte)((TargetField[2] >> 8) & 0x00FF);
result[14] = (byte)(RecipMeanCurrent & 0x00FF);
result[15] = (byte)((RecipMeanCurrent >> 8) & 0x00FF);
result[16] = (byte)(ThresholdVolume & 0x00FF);
result[17] = (byte)((ThresholdVolume >> 8) & 0x00FF);
result[18] = (byte)(ThresholdTime & 0x00FF);
result[19] = (byte)((ThresholdTime >> 8) & 0x00FF);
result[20] = (byte)(FlowActivationThr & 0x00FF);
result[21] = (byte)((FlowActivationThr >> 8) & 0x00FF);
result[22] = (byte)(VolumeArrowThr & 0x00FF);
result[23] = (byte)((VolumeArrowThr >> 8) & 0x00FF);
result[24] = (byte)(CalibrationTime & 0x000000FF);
result[25] = (byte)((CalibrationTime >> 8) & 0x000000FF);
result[26] = (byte)((CalibrationTime >> 16) & 0x000000FF);
result[27] = (byte)((CalibrationTime >> 24) & 0x000000FF);
result[28] = (byte)(SerialNumber & 0x00000000000000FF);
result[29] = (byte)((SerialNumber >> 8) & 0x00000000000000FF);
result[30] = (byte)((SerialNumber >> 16) & 0x00000000000000FF);
result[31] = (byte)((SerialNumber >> 24) & 0x00000000000000FF);
result[32] = (byte)((SerialNumber >> 32) & 0x00000000000000FF);
result[33] = (byte)MeterSealed;
result[34] = (byte)(CalibrationLNA & 0x00FF);
result[35] = (byte)((CalibrationLNA >> 8) & 0x00FF);
result[36] = CheckSum;
return result;
}
/// <summary>
/// Create a calibration structure from a complete byte array
/// </summary>
/// <param name="data">A complete byte array data</param>
/// <returns>CalibrationStructV4 or null when byte array was not complete</returns>
public static CalibrationStructV4 FromByteArray(byte[] data)
{
if (data.Length != Length) return null;
CalibrationStructV4 result = new CalibrationStructV4();
result.Version = data[0];
result.MeterType = (MeterType)data[1];
result.Calibration = (UInt16)(data[2] + 256 * data[3]);
result.VolumeUnits = (VolumeUnits)data[4];
result.FlowArrow = (FlowArrow)data[5];
result.FWVersion = (UInt16)(data[6] + 256 * data[7]);
result.TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
result.TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
result.TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
result.RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
result.ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
result.ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
result.FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
result.VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
result.CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
result.SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
result.MeterSealed = (MeterSealed)data[33];
result.CalibrationLNA = (UInt16)(data[34] + 256 * data[35]);
result.CheckSum = data[36];
return result;
}
/// <summary>
/// Update the calibration structure from an incomplete byte array
/// </summary>
/// <param name="data">Byte array data</param>
/// <param name="offset">Offset of byte array data in CalibrationStructV2</param>
/// <returns>true when successful, false when data are not appropriate</returns>
public bool Update(byte[] data, int offset)
{
if ((data.Length == 2) && (offset == 2))
{
/// Data containing iPerl calibration factor
Calibration = (UInt16)(data[0] + 256 * data[1]);
return true;
}
else if ((data.Length == 2) && (offset == 34))
{
/// Data containing iPerl calibration factor
CalibrationLNA = (UInt16)(data[0] + 256 * data[1]);
return true;
}
else if ((data.Length == Length) && (offset == 0))
{
/// Data containing a complete CalibrationStruct
Version = data[0];
MeterType = (MeterType)data[1];
Calibration = (UInt16)(data[2] + 256 * data[3]);
VolumeUnits = (VolumeUnits)data[4];
FlowArrow = (FlowArrow)data[5];
FWVersion = (UInt16)(data[6] + 256 * data[7]);
TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
MeterSealed = (MeterSealed)data[33];
CalibrationLNA = (UInt16)(data[34] + 256 * data[35]);
CheckSum = data[36];
return true;
}
else
return false;
}
public string FWVersionStr()
{
int d1 = (FWVersion >> 8) & 0x000F;
int d2 = (FWVersion >> 12) & 0x000F;
int d3 = (FWVersion >> 4) & 0x000F;
int d4 = FWVersion & 0x000F;
return string.Format("{0}.{1}{2}{3}", d1, d2, d3, d4);
}
public override string ToString()
{
return string.Format("Calibration: V{0} Type={1} Cal={2} Units={3} FlowArrow.{4} FW={5} Hi={6} Norm={7} Low={8} RMC={9} ThrVol={10} ThrTime={11} FlActThr={12} VolArrThr={13} CalTm={14} SN={15} MeterSealed={16} CalLNA={17} Chksum={18}",
Version,
MeterType,
Calibration,
VolumeUnits,
FlowArrow,
FWVersion,
TargetField[0],
TargetField[1],
TargetField[2],
RecipMeanCurrent,
ThresholdVolume,
ThresholdTime,
FlowActivationThr,
VolumeArrowThr,
CalibrationTime,
SerialNumber,
MeterSealed,
CalibrationLNA,
CheckSum.ToString("X2"));
}
public virtual void WriteBinary(BinaryWriter writer)
{
writer.Write(Version);
writer.Write((byte)MeterType);
writer.Write(Calibration);
writer.Write((byte)VolumeUnits);
writer.Write((byte)FlowArrow);
writer.Write(FWVersion);
writer.Write(TargetField[0]);
writer.Write(TargetField[1]);
writer.Write(TargetField[2]);
writer.Write(RecipMeanCurrent);
writer.Write(ThresholdVolume);
writer.Write(ThresholdTime);
writer.Write(FlowActivationThr);
writer.Write(VolumeArrowThr);
writer.Write(CalibrationTime);
writer.Write(SerialNumber);
writer.Write((byte)MeterSealed);
writer.Write(CalibrationLNA);
writer.Write(CheckSum);
}
public virtual void ReadBinary(BinaryReader reader)
{
Version = reader.ReadByte();
MeterType = (MeterType)reader.ReadByte();
Calibration = reader.ReadUInt16();
VolumeUnits = (VolumeUnits)reader.ReadByte();
FlowArrow = (FlowArrow)reader.ReadByte();
FWVersion = reader.ReadUInt16();
TargetField[0] = reader.ReadUInt16();
TargetField[1] = reader.ReadUInt16();
TargetField[2] = reader.ReadUInt16();
RecipMeanCurrent = reader.ReadUInt16();
ThresholdVolume = reader.ReadUInt16();
ThresholdTime = reader.ReadUInt16();
FlowActivationThr = reader.ReadUInt16();
VolumeArrowThr = reader.ReadUInt16();
CalibrationTime = reader.ReadUInt32();
SerialNumber = reader.ReadUInt64();
MeterSealed = (MeterSealed)reader.ReadByte();
CalibrationLNA = reader.ReadUInt16();
CheckSum = reader.ReadByte();
}
}
}
@@ -0,0 +1,42 @@
///
/// Copyright (c) 2015-2019 Sensus Metering Systems
/// Author: Milan Hanajík
///
using System;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
public class CommCompletedEventArgs : EventArgs
{
public int ThreadId;
public int WMNr0; /// 0-based water meter position
public IPerlReader Ihead;
public Results.Entities.WaterMeter Wm;
public string CommMessage;
public CommErr CommErr;
public CommCompletedEventArgs(int threadId, int wmNr0, IPerlReader ihead, Results.Entities.WaterMeter wm, string commMessage, CommErr commErr)
{
this.ThreadId = threadId;
this.WMNr0 = wmNr0;
this.Ihead = ihead;
this.Wm = wm;
this.CommMessage = commMessage;
this.CommErr = commErr;
}
public override string ToString()
{
return string.Format("Thread={0} WMNr0={1} IHead={2} WM={3} CommMsg={4} CommErr={5}",
ThreadId,
WMNr0,
(Ihead != null) ? Ihead.Name : "null",
Wm.WMPosition,
(CommMessage != null) ? CommMessage : "null",
CommErr);
}
}
}
@@ -0,0 +1,267 @@
///
/// Copyright (c) 2015-2020 Sensus Metering Systems
///
using System;
using System.IO;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
public class ConfigStruct
{
public const int Length = 32;
public Byte Version; /// 0: 1 byte
public MeterState MeterState; /// 1: 1 byte
public UInt32 TargetTimeVeryLowBatt; /// 2: 4 bytes in seconds
public UInt32 TargetTimeLowBatt; /// 6: 4 bytes, in seconds
public UInt32 TestModeTime; /// 10: 4 bytes, Max. test mode time in seconds
public UInt16 EmptyPipeThreshold; /// 14: 2 bytes
public byte[] PCBNumber; /// 16: 5 bytes
public byte TestModeConfig; /// 21: 1 byte
public UInt32 RadioAddress; /// 22: 4 bytes
public UInt16 TempCalibration; /// 26: 2 bytes
public UInt16 AlarmMask; /// 28: 2 bytes, Default 0xA3F7
public UInt16 ConfigCheckSum; /// 30: 2 bytes
public ConfigStruct()
{
PCBNumber = new byte[5];
}
public byte[] ToByteArray()
{
byte[] result = new byte[Length];
result[0] = Version;
result[1] = (byte)MeterState;
result[2] = (byte)(TargetTimeVeryLowBatt & 0x000000FF);
result[3] = (byte)((TargetTimeVeryLowBatt >> 8) & 0x000000FF);
result[4] = (byte)((TargetTimeVeryLowBatt >> 16) & 0x000000FF);
result[5] = (byte)((TargetTimeVeryLowBatt >> 24) & 0x000000FF);
result[6] = (byte)(TargetTimeLowBatt & 0x000000FF);
result[7] = (byte)((TargetTimeLowBatt >> 8) & 0x000000FF);
result[8] = (byte)((TargetTimeLowBatt >> 16) & 0x000000FF);
result[9] = (byte)((TargetTimeLowBatt >> 24) & 0x000000FF);
result[10] = (byte)(TestModeTime & 0x000000FF);
result[11] = (byte)((TestModeTime >> 8) & 0x000000FF);
result[12] = (byte)((TestModeTime >> 16) & 0x000000FF);
result[13] = (byte)((TestModeTime >> 24) & 0x000000FF);
result[14] = (byte)(EmptyPipeThreshold & 0x00FF);
result[15] = (byte)((EmptyPipeThreshold >> 8) & 0x00FF);
result[16] = PCBNumber[0];
result[17] = PCBNumber[1];
result[18] = PCBNumber[2];
result[19] = PCBNumber[3];
result[20] = PCBNumber[4];
result[21] = TestModeConfig;
result[22] = (byte)(RadioAddress & 0x000000FF);
result[23] = (byte)((RadioAddress >> 8) & 0x000000FF);
result[24] = (byte)((RadioAddress >> 16) & 0x000000FF);
result[25] = (byte)((RadioAddress >> 24) & 0x000000FF);
result[26] = (byte)(TempCalibration & 0x00FF);
result[27] = (byte)((TempCalibration >> 8) & 0x00FF);
result[28] = (byte)(AlarmMask & 0x00FF);
result[29] = (byte)((AlarmMask >> 8) & 0x00FF);
result[30] = (byte)(ConfigCheckSum & 0x00FF);
result[31] = (byte)((ConfigCheckSum >> 8) & 0x00FF);
return result;
}
/// <summary>
/// Create a configuration structure from a complete byte array
/// </summary>
/// <param name="data">A complete byte array data</param>
/// <returns>ConfigStruct or null when byte array was not complete</returns>
public static ConfigStruct FromByteArray(byte[] data)
{
if (data.Length != Length) return null;
ConfigStruct result = new ConfigStruct();
result.Version = data[0];
result.MeterState = (MeterState)data[1];
result.TargetTimeVeryLowBatt = (((UInt32)data[5] * 256 + data[4]) * 256 + data[3]) * 256 + data[2];
result.TargetTimeLowBatt = (((UInt32)data[9] * 256 + data[8]) * 256 + data[7]) * 256 + data[6];
result.TestModeTime = (((UInt32)data[13] * 256 + data[12]) * 256 + data[11]) * 256 + data[10];
result.EmptyPipeThreshold = (UInt16)(data[15] * 256 + data[14]);
result.PCBNumber[0] = data[16];
result.PCBNumber[1] = data[17];
result.PCBNumber[2] = data[18];
result.PCBNumber[3] = data[19];
result.PCBNumber[4] = data[20];
result.TestModeConfig = data[21];
result.RadioAddress = (((UInt32)data[25] * 256 + data[24]) * 256 + data[23]) * 256 + data[22];
result.TempCalibration = (UInt16)(data[27] * 256 + data[26]);
result.AlarmMask = (UInt16)(data[29] * 256 + data[28]);
result.ConfigCheckSum = (UInt16)(data[31] * 256 + data[30]);
return result;
}
/// <summary>
/// Update the configuration structure from an incomplete byte array
/// </summary>
/// <param name="offset">Offset of byte array data in ConfigStruct</param>
/// <param name="data">Byte array data</param>
/// <returns>true when successful, false when data are not appropriate</returns>
public bool Update(int offset, byte[] data)
{
if (offset == 0 && data.Length == 2)
{
/// iPerl mode of function
Version = data[0];
MeterState = (MeterState)data[1];
return true;
}
else if (offset == 0 && data.Length == 4)
{
/// iPerl mode of function and extra 2 bytes
Version = data[0];
MeterState = (MeterState)data[1];
return true;
}
else if (offset == 21 && data.Length == 1)
{
/// TestModeConfig value
TestModeConfig = data[21 - offset];
return true;
}
else if (offset == 0 && data.Length == Length)
{
/// Complete ConfigStruct
Version = data[0];
MeterState = (MeterState)data[1];
TargetTimeVeryLowBatt = (((UInt32)data[5] * 256 + data[4]) * 256 + data[3]) * 256 + data[2];
TargetTimeLowBatt = (((UInt32)data[9] * 256 + data[8]) * 256 + data[7]) * 256 + data[6];
TestModeTime = (((UInt32)data[13] * 256 + data[12]) * 256 + data[11]) * 256 + data[10];
EmptyPipeThreshold = (UInt16)(data[15] * 256 + data[14]);
PCBNumber[0] = data[16];
PCBNumber[1] = data[17];
PCBNumber[2] = data[18];
PCBNumber[3] = data[19];
PCBNumber[4] = data[20];
TestModeConfig = data[21];
RadioAddress = (((UInt32)data[25] * 256 + data[24]) * 256 + data[23]) * 256 + data[22];
TempCalibration = (UInt16)(data[27] * 256 + data[26]);
AlarmMask = (UInt16)(data[29] * 256 + data[28]);
ConfigCheckSum = (UInt16)(data[31] * 256 + data[30]);
return true;
}
else
return false;
}
/// <summary>
/// Returns PCB number string (12 characters, 12 decimal digits)
/// </summary>
/// <returns>PCB number STRING</returns>
public string GetPcbNrString()
{
return PCBNumber2String(this.PCBNumber);
}
/// <summary>
/// Converts PCBNumber to string (12 characters, 12 decimal digits)
/// </summary>
/// <param name="pcbNumber"></param>
/// <returns>PCB number string</returns>
public static string PCBNumber2String(byte[] pcbNumber)
{
if (pcbNumber.Length != 5) return string.Empty;
Int64 number = 0;
for (int i = 4; i >= 0; i--)
{
number = 256 * number + (Int64)pcbNumber[i];
}
return number.ToString();
}
public override string ToString()
{
return string.Format("Config: V{0} State={1} VLoBattT={2}s LoBattT={3}s TestModeT={4}s EPThld={5} PCB#={6} TMCfg={7} RadioAddr={8} TempCalib={9} AlarmMask={10} CfgCheckSum={11}",
Version,
MeterState,
TargetTimeVeryLowBatt,
TargetTimeLowBatt,
TestModeTime,
EmptyPipeThreshold,
GetPcbNrString(),
TestModeConfig.ToString("X2"),
RadioAddress,
TempCalibration,
AlarmMask.ToString("X4"),
ConfigCheckSum.ToString("X4"));
}
public string ToString(int sel)
{
return string.Format("{1} PCB#={6} TMCfg={7}",
Version,
MeterState,
TargetTimeVeryLowBatt,
TargetTimeLowBatt,
TestModeTime,
EmptyPipeThreshold,
GetPcbNrString(),
TestModeConfig.ToString("X2"),
RadioAddress,
TempCalibration,
AlarmMask.ToString("X4"),
ConfigCheckSum.ToString("X4"));
}
public virtual void WriteBinary(BinaryWriter writer)
{
writer.Write(Version);
writer.Write((byte)MeterState);
writer.Write(TargetTimeVeryLowBatt);
writer.Write(TargetTimeLowBatt);
writer.Write(TestModeTime);
writer.Write(EmptyPipeThreshold);
writer.Write(PCBNumber[0]);
writer.Write(PCBNumber[1]);
writer.Write(PCBNumber[2]);
writer.Write(PCBNumber[3]);
writer.Write(PCBNumber[4]);
writer.Write(TestModeConfig);
writer.Write(RadioAddress);
writer.Write(TempCalibration);
writer.Write(AlarmMask);
writer.Write(ConfigCheckSum);
}
public virtual void ReadBinary(BinaryReader reader)
{
Version = reader.ReadByte();
MeterState = (MeterState)reader.ReadByte();
TargetTimeVeryLowBatt = reader.ReadUInt32();
TargetTimeLowBatt = reader.ReadUInt32();
TestModeTime = reader.ReadUInt32();
EmptyPipeThreshold = reader.ReadUInt16();
PCBNumber[0] = reader.ReadByte();
PCBNumber[1] = reader.ReadByte();
PCBNumber[2] = reader.ReadByte();
PCBNumber[3] = reader.ReadByte();
PCBNumber[4] = reader.ReadByte();
TestModeConfig = reader.ReadByte();
RadioAddress = reader.ReadUInt32();
TempCalibration = reader.ReadUInt16();
AlarmMask = reader.ReadUInt16();
ConfigCheckSum = reader.ReadUInt16();
}
}
}
@@ -0,0 +1,12 @@
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
public class IPerlCommunicationsTimeOut : ICommunicationTimeOuts
{
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; }
}
}
@@ -0,0 +1,317 @@
using System;
using System.Globalization;
using System.Text;
using System.Threading;
using log4net;
using Sensus.iPerl.NfcHandler;
using Sensus.iPerl.RfidCom.Exceptions;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
using static Sensus.iPerl.NfcHandler.MCI_Protocol;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
internal class NfcServices
{
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
internal static int ReadRequest(ITestMethodCfg cfg, IntIPerlReader iperlHead, MCI_Protocol.StructName structName, int offset, int length, out byte[] buffer)
{
for (int i = 0; i < cfg.MaxCommRetries; i++)
{
NfcDataHandler _nfcDataHandler = new NfcDataHandler();
MessageEventHandlers(_nfcDataHandler);
CR95HF_MessageEventHandlers(_nfcDataHandler._CR95HF_Reader);
ST25DV_MessageEventHandlers(_nfcDataHandler._ST25DV_Device);
MCI_MessageEventHandlers(_nfcDataHandler._MCI_Protocol);
NFCHeadConfig_MessageEventHandlers(_nfcDataHandler._NFCHead_Config);
try
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} ReadRequest : {structName}, {offset}, {length}");
OpenConnection(_nfcDataHandler, cfg, iperlHead);
buffer = MciRead(_nfcDataHandler, cfg, structName, (ushort)offset, length);
_nfcDataHandler.RFProtocolOFF(); // turn off rf antenna due to possible interference
CloseComPort(_nfcDataHandler);
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} ReadRequest : {structName}, {offset}, {length} ; Response= {ByteArrayToHexString(buffer)} ; Error: {_nfcDataHandler.LastErrorMessage}");
if (_nfcDataHandler.LastErrorCode != 0)
{
throw new RfidValidationException(_nfcDataHandler.LastErrorMessage);
}
return Convert.ToInt32(_nfcDataHandler.LastErrorCode); //return 0;
}
catch (RfidValidationException)
{
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
catch (Exception ex)
{
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} ReadRequest Error: {ex.Message}");
buffer = new byte[length];
return 3;
}
}
buffer = new byte[length];
return 3;
}
internal static int WriteRequest(ITestMethodCfg cfg, IntIPerlReader iperlHead, MCI_Protocol.StructName structName, int offset, int length, byte[] buffer)
{
NfcDataHandler _nfcDataHandler = new NfcDataHandler();
MessageEventHandlers(_nfcDataHandler);
CR95HF_MessageEventHandlers(_nfcDataHandler._CR95HF_Reader);
ST25DV_MessageEventHandlers(_nfcDataHandler._ST25DV_Device);
MCI_MessageEventHandlers(_nfcDataHandler._MCI_Protocol);
NFCHeadConfig_MessageEventHandlers(_nfcDataHandler._NFCHead_Config);
try
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} WriteRequest : {structName}, {offset}, {length}, {ByteArrayToHexString(buffer)}");
OpenConnection(_nfcDataHandler, cfg, iperlHead);
MciWrite(_nfcDataHandler, cfg, structName, (ushort)offset, length, buffer);
_nfcDataHandler.RFProtocolOFF(); // turn off rf antenna due to possible interference
CloseComPort(_nfcDataHandler);
return 0;
}
catch (Exception ex)
{
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} WriteRequest Error: {ex.Message}");
return 3;
}
}
private static void OpenConnection(NfcDataHandler nfcDataHandler, ITestMethodCfg cfg, IntIPerlReader iperlHead)
{
string comPort = $"COM{iperlHead.RfidComPortNr}";
int retryCount = 0 ;
Open:
nfcDataHandler.Close();
Thread.Sleep(100);
if (nfcDataHandler.OpenConnection(comPort, cfg.BaudRate, cfg.DataBits, cfg.ParityBit, cfg.StopBits))
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} Port Open");
if (nfcDataHandler.ConnectReader())
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} Reader connected");
if (!nfcDataHandler.ConnectDevice())
{
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} Error connect device.");
for (int i = 0; i < cfg.MaxCommRetries; i++)
{
if (nfcDataHandler.Echo()) break;
}
}
}
else
{
retryCount++;
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} Error connect reader. Reconnect comport {retryCount}");
if (retryCount < cfg.MaxCommRetries)
{
nfcDataHandler.Close();
iperlHead.ResetNfcInterface(); // reset NFC head via optoport - switch to RFID and back to NFC interface
goto Open;
}
}
}
else
rfidDataLogger.Error($"Open NFC COM{iperlHead.RfidComPortNr} Port Failed");
}
private static void CloseComPort(NfcDataHandler nfcDataHandler)
{
nfcDataHandler.Close();
}
private static byte[] MciRead(NfcDataHandler nfcDataHandler, ITestMethodCfg cfg, StructName structName, ushort offset, int length)
{
bool isReadValues = false;
int retryCount = 0;
Read:
try
{
isReadValues = false;
long num1 = (long)length;
int timeoutMs = 4000;
byte payloadlength = Convert.ToByte(num1.ToString("X2"), 16);
if (nfcDataHandler.MCI_Read(structName, offset, payloadlength, timeoutMs))
{
byte[] lastData = nfcDataHandler.LastData;
if ((long)lastData.Length >= num1)
{
rfidDataLogger.Info($"COM: MciRead ({structName},{offset},{length}) = {ByteArrayToHexString(lastData)}");
return lastData;
}
else
rfidDataLogger.Info($"COM: MciRead ({structName},{offset},{length}) = {ByteArrayToHexString(lastData)}");
}
else if (nfcDataHandler.LastErrorCode == (byte)0)
{
rfidDataLogger.Info($"MCI Error: Unidentified");
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Read;
}
else
{
rfidDataLogger.Info("Last error message: " + nfcDataHandler.LastErrorMessage);
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Read;
}
}
catch (Exception ex)
{
rfidDataLogger.Error("MciRead Last error message: " + ex.Message);
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Read;
}
return new byte[length];
}
private static void MciWrite(NfcDataHandler nfcDataHandler, ITestMethodCfg cfg, MCI_Protocol.StructName structName, ushort offset, int length, byte[] payload)
{
int retryCount = 0;
Write:
try
{
long num1 = (long)length;
int timeoutMs = 4000;
byte payloadlength = Convert.ToByte(num1);
if ((int)payloadlength != payload.Length)
rfidDataLogger.Error("Insufficient Payload -- Payload lenth : " + (object)payload.Length);
else if (nfcDataHandler.MCI_Write(structName, offset, payloadlength, payload, timeoutMs))
{
// OK
}
else if (nfcDataHandler.LastErrorCode > (byte)0)
{
rfidDataLogger.Error("Last error message: " + nfcDataHandler.LastErrorMessage);
//int num2 = (int)MessageBox.Show(this._nfcDataHandler.LastErrorMessage);
}
}
catch (Exception ex)
{
rfidDataLogger.Error("MciWrite error message: " + ex.Message);
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Write;
}
}
private static void MciWriteCommand(NfcDataHandler nfcDataHandler, byte commandcode)
{
try
{
ushort offset = 0;
int timeoutMs = 4000;
byte payloadlength = 1;
byte[] payload = new byte[1] { commandcode };
if (nfcDataHandler.MCI_Write(MCI_Protocol.StructName.Command, offset, payloadlength, payload, timeoutMs) || nfcDataHandler.LastErrorCode <= (byte)0)
return;
rfidDataLogger.Error("MciWriteCommand Last error message: " + nfcDataHandler.LastErrorMessage);
}
catch (Exception ex)
{
rfidDataLogger.Error("MciWriteCommand Last error message: " + ex.Message);
}
}
public static string ByteArrayToHexString(byte[] data)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (byte num in data)
stringBuilder.Append(num.ToString("X2"));
return stringBuilder.ToString();
}
private static byte[] BuildPayLoad(string strPayLoad, int length)
{
byte[] collection;
if (strPayLoad.Split(':').Length > 1)
{
uint timestamp = ConvertDateTimeToTimestamp(Convert.ToDateTime(DateTime.ParseExact(strPayLoad, "HH:mm:ss dd/MM/yyyy", (IFormatProvider)CultureInfo.InvariantCulture)));
byte[] bytes = BitConverter.GetBytes(timestamp);
return bytes;
}
else if (strPayLoad.Split(',').Length > 1)
{
string[] strArray = strPayLoad.Split(',');
collection = new byte[strArray.Length];
for (int index3 = 0; index3 < strArray.Length; ++index3)
collection[index3] = Convert.ToByte(strArray[index3], 16);
return collection;
}
else
{
//int num = strPayLoad.Split(',').Length;
collection = HexStringToByteArray(strPayLoad.Substring(strPayLoad.Length - length * 2).ToUpper());
Array.Reverse((Array)collection);
return collection;
}
}
public static byte[] HexStringToByteArray(string hexString)
{
int length = hexString.Length;
byte[] byteArray = new byte[length / 2];
for (int startIndex = 0; startIndex < length; startIndex += 2)
byteArray[startIndex / 2] = Convert.ToByte(hexString.Substring(startIndex, 2), 16);
return byteArray;
}
private static uint ConvertDateTimeToTimestamp(DateTime datetime)
{
TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
return (uint)((datetime - new DateTime(2000, 1, 1, 0, 0, 0).ToLocalTime()).TotalSeconds + utcOffset.TotalSeconds);
}
#region EventHandlers
public static void MCI_MessageEventHandlers(MCI_Protocol e)
{
DelNfc_MCI_MessageHandler mciMessageHandler = new DelNfc_MCI_MessageHandler(OnHandler);
e.MessageEvent += mciMessageHandler;
}
public static void ST25DV_MessageEventHandlers(ST25DV_Device e)
{
DelNfc_ST25DV_MessageHandler dvMessageHandler = new DelNfc_ST25DV_MessageHandler(OnHandler);
e.MessageEvent += dvMessageHandler;
}
public static void CR95HF_MessageEventHandlers(CR95HF_Reader e)
{
DelNfc_CR95HF_MessageHandler hfMessageHandler = new DelNfc_CR95HF_MessageHandler(OnHandler);
e.MessageEvent += hfMessageHandler;
}
public static void NFCHeadConfig_MessageEventHandlers(NFCHeadConfig e)
{
DelNfc_NFCHeadConfig_MessageHandler configMessageHandler = new DelNfc_NFCHeadConfig_MessageHandler(OnHandler);
e.MessageEvent += configMessageHandler;
}
public static void MessageEventHandlers(NfcDataHandler e)
{
DelNfcMessageHandler nfcMessageHandler = new DelNfcMessageHandler(OnHandler);
e.MessageEvent += nfcMessageHandler;
}
public static void OnHandler(object sender, NfcMessageEventArgs e)
{
if (e.Message == null)
return;
string message = e.Message.Replace("\n", " ").Replace("\r", "");
rfidDataLogger.Debug(message);
}
#endregion
}
}
@@ -0,0 +1,18 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
public class OptoReceivedEventArgs : EventArgs
{
public string Data;
public OptoReceivedEventArgs(string data)
{
this.Data = data;
}
}
}
@@ -0,0 +1,126 @@
using System;
using System.Text.RegularExpressions;
using System.Threading;
using log4net;
using Sensus.iPerl.RfidCom;
using Sensus.iPerl.RfidCom.Exceptions;
using Sensus.iPerl.RfidCom.Helper;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
internal class RfidServices
{
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
private static readonly ILog log = LogManager.GetLogger(typeof(SmartCommunicationForm));
internal static int ReadRequest(ITestMethodCfg cfg, IntIPerlReader iperlHead, MessageID messageID, int offset, int length, out byte[] buffer)
{
for (int i = 0; i < cfg.MaxCommRetries; i++)
{
rfidDataLogger.Error($"{iperlHead.CommInterface} Start {i} reading: COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},{offset}, {length}... timeout {cfg.CommTimeout})");
using (RfidLogic writer = new RfidLogic($"COM{iperlHead.RfidComPortNr}"))
{
try
{
byte[] response = writer.ReadRequest((byte)messageID, offset, length, cfg.CommTimeout);
string hexString = RfidHelper.ConvertByteArrayToHexString(response);
string swapHexString = RfidHelper.SwapHexcode(hexString);
string decString = RfidHelper.HexLiteral2Unsigned(RfidHelper.SwapHexcode(hexString)).ToString();
if (length > 10)
{
//if the result only contains "00"s we are working on the wrong COM port
// or the module just isn't connected
if (Regex.IsMatch(hexString, @"^(00)\1+$"))
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) <- Error: No RFID signal.");
throw new RfidValidationException("Error_Rfid_NoSignal");
}
//if the result only contains "03"s the meter did not answer.
// Might be due to the module being positioned incorrectly.
if (Regex.IsMatch(hexString, @"^(03)\1+$"))
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) <- Error: No meter signal.");
throw new RfidValidationException("Error_Rfid_NoAnswerFromMeter");
}
}
writer.ClosePort();
buffer = response;
rfidDataLogger.Info($"{iperlHead.Name} ({iperlHead.SerialNr}): ReadRequestPort(COM{iperlHead.RfidComPortNr},...) returned HEX: {hexString}; SwapHexCodeToDecimal: {decString}");
return 0;
}
catch (RfidDataNotAvailableException)
{
if (/*RfidHelper.IsPassThrough(messageID)*/ messageID == MessageID.ASICRegisterReadTest || messageID == MessageID.RadioPassthrough)
{
rfidDataLogger.Info($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) {(i > 0 ? "<- Error: Invalid Pass-Through data." : "<- Info: Wait for Pass-Through data.")}");
Thread.Sleep(cfg.PassThroughWaitTime);
}
else
{
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
}
catch (RfidValidationException)
{
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
catch (Exception ex)
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) {ex.Message}");
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
}
}
rfidDataLogger.Error($"{iperlHead.CommInterface} reading failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...)");
log.Error($"{iperlHead.CommInterface} reading failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...)");
buffer = new byte[length];
return 3;
}
internal static int WriteRequest(ITestMethodCfg cfg, IntIPerlReader iperlHead, MessageID messageID, int offset, int length, byte[] buffer)
{
RfidLogic writer = new RfidLogic($"COM{iperlHead.RfidComPortNr}");
string payload = RfidHelper.ConvertByteArrayToHexString(buffer);
for (var i = 0; i < cfg.MaxCommRetries; i++)
{
rfidDataLogger.Error($"{iperlHead.CommInterface} Start {i} writting: COM{iperlHead.RfidComPortNr}: WriteRequest ({messageID},{offset}, {length}, {payload}... timeout {cfg.CommTimeout})");
try
{
if (writer.ClosePort()) writer.OpenPort();
writer.WriteRequest((byte)messageID, offset, length, buffer, cfg.CommTimeout, false);
writer.ClosePort();
rfidDataLogger.InfoFormat($"{iperlHead.Name}({iperlHead.SerialNr},COM{iperlHead.RfidComPortNr}): WriteRequestPort({messageID}, {offset}, {length}, {payload})");
return 0;
}
catch (Exception ex)
{
if (messageID == MessageID.RadioPassthrough || messageID == MessageID.ASICRegisterReadTest)
{
Thread.Sleep(1500);
}
else
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: Error: {ex.Message}");
Thread.Sleep(cfg.WaitTimeAfterFailure);
if (i > 1)
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: Reopen the com port.");
writer.ClosePort();
}
}
}
}
writer.ClosePort();
rfidDataLogger.Error($"RFID writing failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: WriteRequestPort ({messageID},...) {System.Text.Encoding.UTF8.GetString(buffer)}");
log.Error($"RFID writing failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: WriteRequestPort ({messageID},...) {System.Text.Encoding.UTF8.GetString(buffer)}");
return 2;
}
}
}
@@ -0,0 +1,65 @@
using System;
using System.Linq;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
namespace TBF.Rig.RegisterReaders.CommonRR.IPerl.communication
{
internal class SimulationServices
{
const int Q2CorrFactorsAddr = iPerlCommunicationConstants.Q2CorrFactorsAddr;
internal static int ReadRequest(IntIPerlReader iperlHead, MessageID messageID, int offset, int length, out byte[] buffer)
{
byte[] configurationBuffer = new byte[ConfigStruct.Length] { 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] calibrationBuffer = new byte[CalibrationStructV4.Length] { 3, 0, 150, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 150, 10 };
buffer = new byte[length];
if (messageID == MessageID.Configuration)
{
Array.Copy(GetPCB(iperlHead), 0, configurationBuffer, 16, 5); // set PCB Number according to iPerlHead configuration
Array.Copy(configurationBuffer,offset,buffer,0,length);
}
else if (messageID == MessageID.Calibration)
{
Array.Copy(calibrationBuffer, offset, buffer, 0, length);
}
else if ((messageID == MessageID.MetrologyMemory) && (offset == Q2CorrFactorsAddr) && (length == 2))
{
buffer = new byte[2] { 0, 0 };
}
else
{
buffer = new byte[length];
}
return iperlHead.Name.Equals("iPerl13") ? 2 : 0; /// Simulates an error on position 13
}
internal static int WriteRequest(ITestMethodCfg cfg, IntIPerlReader iperlHead, MessageID messageID, int offset,
int length, byte[] buffer)
{
return 0;
}
private static Array GetPCB(IntIPerlReader iperlHead)
{
string pcbStr = iperlHead.RfidComPortNr.ToString().PadRight(10,'0') + iperlHead.Position.ToString("D2");
long decVal = Convert.ToInt64(pcbStr);
string nHexStr = decVal.ToString("X4");
string hexStr = "";
for (int a = nHexStr.Length; a >= 1; a = a - 2)
{
hexStr = hexStr + nHexStr.Substring(a - 2, 2);
}
return Enumerable.Range(0, hexStr.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(hexStr.Substring(x, 2), 16))
.ToArray();
}
}
}
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using log4net;
using log4net.Config;
@@ -53,15 +54,23 @@ namespace TBF.Rig.RegisterReaders.PoseidonCmdStartStop
if (isCliLogging)
{
log = new ScopedLoggerFactory().CreateLogger<CliRunner>(
@"C:\TBF\Logs\CliRunner.txt",
10, // maxFileSizeMB
7, // maxBackups
log4net.Core.Level.Debug,
true, // zipRolledFiles
true, // singleZipPerDay
TimeSpan.FromMinutes(2) // zipScanInterval
);
try
{
log = new ScopedLoggerFactory().CreateLogger<CliRunner>(
@"C:\TBF\Logs\CliRunner.txt",
10, // maxFileSizeMB
7, // maxBackups
log4net.Core.Level.Debug,
true, // zipRolledFiles
true, // singleZipPerDay
TimeSpan.FromMinutes(2) // zipScanInterval
);
}
catch (Exception ex)
{
// Fallback to console or handle gracefully
Console.WriteLine($"Failed to initialize logger: {ex.Message}");
}
}
}
@@ -84,7 +93,7 @@ namespace TBF.Rig.RegisterReaders.PoseidonCmdStartStop
}
public async Task<string> SendAsync(string fileName, string args)
public async Task<string> SendAsync(string fileName, string args, CancellationToken ct = default)
{
var psi = new ProcessStartInfo
{
@@ -96,26 +105,31 @@ namespace TBF.Rig.RegisterReaders.PoseidonCmdStartStop
CreateNoWindow = true
};
var process = new Process { StartInfo = psi };
var sb = new StringBuilder();
process.OutputDataReceived += (sender, e) =>
{
if (e.Data != null)
sb.AppendLine(e.Data);
};
using var process = new Process { StartInfo = psi, EnableRaisingEvents = true };
process.Start();
process.BeginOutputReadLine();
process.WaitForExit();
Task<string> stdOutTask = process.StandardOutput.ReadToEndAsync();
Task<string> stdErrTask = process.StandardError.ReadToEndAsync();
try
{
await Task.WhenAll(stdOutTask, stdErrTask, process.WaitForExitAsync(ct));
}
catch (OperationCanceledException)
{
if (!process.HasExited)
{
process.Kill();
}
// Now all outputs are available
string allOutput = sb.ToString();
throw;
}
string allOutput = (stdOutTask.Result ?? "") + (stdErrTask.Result ?? "");
log?.Debug(allOutput);
return allOutput;
}
public void AddRunAndCaptureJsonAsync<T>(SerialPortData data, SerialPortData.EMeterArg eMeterArg) where T : new()
{
@@ -123,7 +137,7 @@ namespace TBF.Rig.RegisterReaders.PoseidonCmdStartStop
taskPool.Add(task);
}
public async Task<T> RunAndCaptureJsonAsync<T>(string fileName, string args) where T : new()
public async Task<T> RunAndCaptureJsonAsync<T>(string fileName, string args, CancellationToken ct = default) where T : new()
{
var psi = new ProcessStartInfo
{
@@ -135,29 +149,19 @@ namespace TBF.Rig.RegisterReaders.PoseidonCmdStartStop
CreateNoWindow = true
};
var process = new Process { StartInfo = psi };
var sb = new StringBuilder();
process.OutputDataReceived += (sender, e) =>
{
if (e.Data != null)
sb.AppendLine(e.Data);
};
using var process = new Process { StartInfo = psi, EnableRaisingEvents = true };
process.Start();
process.BeginOutputReadLine();
process.WaitForExit();
var stdoutTask = process.StandardOutput.ReadToEndAsync();
var stderrTask = process.StandardError.ReadToEndAsync();
// Now sb contains all output text
string allOutput = sb.ToString();
await Task.WhenAll(stdoutTask, stderrTask, process.WaitForExitAsync(ct));
string allOutput = (stdoutTask.Result ?? "") + (stderrTask.Result ?? "");
log?.Debug(allOutput);
// Extract JSON part
string json = ExtractJson(allOutput);
if (TryJsonStringDeserialize(json, out T runAndCaptureJsonAsync)) return runAndCaptureJsonAsync;
if (TryJsonStringDeserialize(json, out T result)) return result;
return default;
}
@@ -0,0 +1,39 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace TBF.Rig.RegisterReaders.PoseidonCmdStartStop
{
public static class ProcessExtensions
{
public static Task WaitForExitAsync(this Process process, CancellationToken cancellationToken = default)
{
if (process == null) throw new ArgumentNullException(nameof(process));
if (process.HasExited) return Task.CompletedTask;
var tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
EventHandler handler = null;
handler = (s, e) =>
{
try { tcs.TrySetResult(null); }
finally { process.Exited -= handler; }
};
process.EnableRaisingEvents = true;
process.Exited += handler;
if (cancellationToken.CanBeCanceled)
{
cancellationToken.Register(() =>
{
tcs.TrySetCanceled(cancellationToken);
process.Exited -= handler;
});
}
return tcs.Task;
}
}
}
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using TBF.Rig.Generic;
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
public class Factory: IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new IPerlReader(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new IPerlReader(cfg); }
public IComponentCfg DefaultConfig() { return new IPerlCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(IPerlCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,70 @@
using System.Collections.Generic;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
public class IPerlCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(IPerlCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Component> cmpntEntities)
{
return new IPerlCfgCtrl();
}
///
/// Serialized parameters
///
public bool UseTcpIP;
public string OptoIPAddress;
public ushort OptoTcpipPortNr;
public int HeadCommunicationComPortNr;
public int OptoComPortNr;
public int RfidComPortNr; /// 0 = use MuxBoardNr
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4
public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort, 1 .. 10
public CommunicationInterface CommunicationInterface; /// Communication Interface: RFID or NFC
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcParams ProcParams;
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
[XmlIgnore]
public MeterType MeterType { get { return (ProcParams != null) ? ProcParams.MeterType : MeterType.AutoDetect; } }
/// Private parameterless constructor invoked by all other (public) constructors
IPerlCfg()
{
Name = "iPerl";
ParentName = string.Empty;
OptoComPortNr = 10;
RfidComPortNr = 0; /// = use mux. board
MuxBoardNr = 1;
ProcParams = CreateProcParamsProvider() as ProcParams;
CommunicationInterface = CommunicationInterface.RFID;
HeadCommunicationComPortNr = 0;
}
public IPerlCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return $"{Name} Group1 (mux#)={MuxBoardNr}, Group2={Group}, Opto=Com{OptoComPortNr}, {CommunicationInterface}=Com{RfidComPortNr}";
}
}
}
@@ -0,0 +1,165 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
using System.Net;
using System.Windows.Forms;
using Common;
using TBF.Resources;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
public partial class IPerlCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
IPerlCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as IPerlCfg;
Redraw();
}
}
public IPerlCfgCtrl()
{
InitializeComponent();
}
private void WaterMeterCfgCtrl_Load(object sender, EventArgs e)
{
nameLabel.Text = Strings.Name;
classNameLabel.Text = config.Factory.ClassName;
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
nameTextBox.Text = config.Name;
radioButton1.Checked = config.UseTcpIP;
radioButton2.Checked = !config.UseTcpIP;
ipAddressTextBox.Text = (config.OptoIPAddress != null) ? config.OptoIPAddress : "0.0.0.0";
tcpipPortTextBox.Text = config.OptoTcpipPortNr.ToString();
headPortNrTextBox.Text = config.HeadCommunicationComPortNr.ToString();
optoSerialPortTextBox.Text = config.OptoComPortNr.ToString();
rfidPortNrTextBox.Text = config.RfidComPortNr.ToString();
muxBoardNrTextBox.Text = config.MuxBoardNr.ToString();
groupTextBox.Text = config.Group.ToString();
comboBoxCommunicationInterface.SelectedItem = config.CommunicationInterface.ToString();
tabPage2.Controls.Add(new IperlHeadTestCtrl(config));
}
public void Unlock()
{
nameTextBox.Enabled = true;
radioButton1.Enabled = true;
radioButton2.Enabled = true;
ipAddressTextBox.Enabled = true;
tcpipPortTextBox.Enabled = true;
optoSerialPortTextBox.Enabled = true;
rfidPortNrTextBox.Enabled = true;
headPortNrTextBox.Enabled = true;
muxBoardNrTextBox.Enabled = true;
groupTextBox.Enabled = true;
comboBoxCommunicationInterface.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
if (radioButton1.Checked)
{
IPAddress dummyIPAddress;
if (!IPAddress.TryParse(ipAddressTextBox.Text, out dummyIPAddress))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'IP address' is not valid";
}
ushort sdummy;
if (!ushort.TryParse(tcpipPortTextBox.Text, out sdummy))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'TCP/IP port nr.' is not valid";
}
}
else
{
if (!int.TryParse(optoSerialPortTextBox.Text, out dummy) || dummy < 1 || dummy > 999)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Opto serial port nr.' is not valid";
}
}
if (!int.TryParse(rfidPortNrTextBox.Text, out dummy) || dummy < 0 || dummy > 999)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'RFID serial port nr.' is not valid";
}
if (!int.TryParse(headPortNrTextBox.Text, out dummy) || dummy < 0 || dummy > 999)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Head communication serial port nr.' is not valid";
}
if (!int.TryParse(muxBoardNrTextBox.Text, out dummy) || dummy < 1 || dummy > 4)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, muxBoardNrLabel.Text);
}
if (!int.TryParse(groupTextBox.Text, out dummy) || dummy < 1 || dummy > 10)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, groupLabel.Text);
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
if (radioButton1.Checked)
{
config.UseTcpIP = true;
config.OptoIPAddress = ipAddressTextBox.Text;
config.OptoTcpipPortNr = ushort.Parse(tcpipPortTextBox.Text);
}
else
{
config.UseTcpIP = false;
config.OptoComPortNr = int.Parse(optoSerialPortTextBox.Text);
}
config.RfidComPortNr = int.Parse(rfidPortNrTextBox.Text);
config.MuxBoardNr = int.Parse(muxBoardNrTextBox.Text);
config.Group = int.Parse(groupTextBox.Text);
config.CommunicationInterface = (CommunicationInterface)comboBoxCommunicationInterface.SelectedIndex;
config.HeadCommunicationComPortNr = int.Parse(headPortNrTextBox.Text);
return flags;
}
}
}
@@ -0,0 +1,441 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
partial class IPerlCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.comboBoxCommunicationInterface = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.rfidPortNrTextBox = new System.Windows.Forms.TextBox();
this.rfidSerialPortNrLabel = new System.Windows.Forms.Label();
this.optoDataGroupBox = new System.Windows.Forms.GroupBox();
this.tcpipPortLabel = new System.Windows.Forms.Label();
this.tcpipPortTextBox = new System.Windows.Forms.TextBox();
this.ipAddressLabel = new System.Windows.Forms.Label();
this.ipAddressTextBox = new System.Windows.Forms.TextBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.optoSerialPortLabel = new System.Windows.Forms.Label();
this.optoSerialPortTextBox = new System.Windows.Forms.TextBox();
this.groupTextBox = new System.Windows.Forms.TextBox();
this.groupLabel = new System.Windows.Forms.Label();
this.muxBoardNrTextBox = new System.Windows.Forms.TextBox();
this.muxBoardNrLabel = new System.Windows.Forms.Label();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.headPortNrTextBox = new System.Windows.Forms.TextBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.optoDataGroupBox.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(3, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(611, 432);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.label4);
this.tabPage1.Controls.Add(this.label3);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.optoDataGroupBox);
this.tabPage1.Controls.Add(this.groupTextBox);
this.tabPage1.Controls.Add(this.groupLabel);
this.tabPage1.Controls.Add(this.muxBoardNrTextBox);
this.tabPage1.Controls.Add(this.muxBoardNrLabel);
this.tabPage1.Controls.Add(this.nameTextBox);
this.tabPage1.Controls.Add(this.nameLabel);
this.tabPage1.Controls.Add(this.classNameLabel);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(603, 403);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Config";
this.tabPage1.UseVisualStyleBackColor = true;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(208, 101);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 16);
this.label4.TabIndex = 25;
this.label4.Text = "1 .. 10";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(208, 72);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(33, 16);
this.label3.TabIndex = 24;
this.label3.Text = "1 .. 4";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.comboBoxCommunicationInterface);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.rfidPortNrTextBox);
this.groupBox1.Controls.Add(this.rfidSerialPortNrLabel);
this.groupBox1.Location = new System.Drawing.Point(10, 259);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(552, 68);
this.groupBox1.TabIndex = 23;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "RFID / NFC communication (in case mux. board is not used)";
//
// comboBoxCommunicationInterface
//
this.comboBoxCommunicationInterface.Enabled = false;
this.comboBoxCommunicationInterface.FormattingEnabled = true;
this.comboBoxCommunicationInterface.Items.AddRange(new object[] {
"RFID",
"NFC"});
this.comboBoxCommunicationInterface.Location = new System.Drawing.Point(201, 27);
this.comboBoxCommunicationInterface.Name = "comboBoxCommunicationInterface";
this.comboBoxCommunicationInterface.Size = new System.Drawing.Size(71, 24);
this.comboBoxCommunicationInterface.TabIndex = 9;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(41, 30);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(153, 16);
this.label1.TabIndex = 8;
this.label1.Text = "Communication Interface";
//
// rfidPortNrTextBox
//
this.rfidPortNrTextBox.Enabled = false;
this.rfidPortNrTextBox.Location = new System.Drawing.Point(439, 26);
this.rfidPortNrTextBox.Margin = new System.Windows.Forms.Padding(4);
this.rfidPortNrTextBox.Name = "rfidPortNrTextBox";
this.rfidPortNrTextBox.Size = new System.Drawing.Size(44, 22);
this.rfidPortNrTextBox.TabIndex = 7;
//
// rfidSerialPortNrLabel
//
this.rfidSerialPortNrLabel.AutoSize = true;
this.rfidSerialPortNrLabel.Location = new System.Drawing.Point(321, 30);
this.rfidSerialPortNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.rfidSerialPortNrLabel.Name = "rfidSerialPortNrLabel";
this.rfidSerialPortNrLabel.Size = new System.Drawing.Size(88, 16);
this.rfidSerialPortNrLabel.TabIndex = 6;
this.rfidSerialPortNrLabel.Text = "Serial port nr.:";
//
// optoDataGroupBox
//
this.optoDataGroupBox.Controls.Add(this.tcpipPortLabel);
this.optoDataGroupBox.Controls.Add(this.tcpipPortTextBox);
this.optoDataGroupBox.Controls.Add(this.ipAddressLabel);
this.optoDataGroupBox.Controls.Add(this.ipAddressTextBox);
this.optoDataGroupBox.Controls.Add(this.radioButton1);
this.optoDataGroupBox.Controls.Add(this.radioButton2);
this.optoDataGroupBox.Controls.Add(this.optoSerialPortLabel);
this.optoDataGroupBox.Controls.Add(this.optoSerialPortTextBox);
this.optoDataGroupBox.Location = new System.Drawing.Point(10, 131);
this.optoDataGroupBox.Margin = new System.Windows.Forms.Padding(4);
this.optoDataGroupBox.Name = "optoDataGroupBox";
this.optoDataGroupBox.Padding = new System.Windows.Forms.Padding(4);
this.optoDataGroupBox.Size = new System.Drawing.Size(552, 119);
this.optoDataGroupBox.TabIndex = 18;
this.optoDataGroupBox.TabStop = false;
this.optoDataGroupBox.Text = "Opto-data";
//
// tcpipPortLabel
//
this.tcpipPortLabel.AutoSize = true;
this.tcpipPortLabel.Location = new System.Drawing.Point(41, 87);
this.tcpipPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.tcpipPortLabel.Name = "tcpipPortLabel";
this.tcpipPortLabel.Size = new System.Drawing.Size(54, 16);
this.tcpipPortLabel.TabIndex = 4;
this.tcpipPortLabel.Text = "Port nr..:";
//
// tcpipPortTextBox
//
this.tcpipPortTextBox.Enabled = false;
this.tcpipPortTextBox.Location = new System.Drawing.Point(143, 84);
this.tcpipPortTextBox.Margin = new System.Windows.Forms.Padding(4);
this.tcpipPortTextBox.Name = "tcpipPortTextBox";
this.tcpipPortTextBox.Size = new System.Drawing.Size(51, 22);
this.tcpipPortTextBox.TabIndex = 5;
//
// ipAddressLabel
//
this.ipAddressLabel.AutoSize = true;
this.ipAddressLabel.Location = new System.Drawing.Point(41, 59);
this.ipAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.ipAddressLabel.Name = "ipAddressLabel";
this.ipAddressLabel.Size = new System.Drawing.Size(78, 16);
this.ipAddressLabel.TabIndex = 2;
this.ipAddressLabel.Text = "IP address.:";
//
// ipAddressTextBox
//
this.ipAddressTextBox.Enabled = false;
this.ipAddressTextBox.Location = new System.Drawing.Point(143, 55);
this.ipAddressTextBox.Margin = new System.Windows.Forms.Padding(4);
this.ipAddressTextBox.Name = "ipAddressTextBox";
this.ipAddressTextBox.Size = new System.Drawing.Size(129, 22);
this.ipAddressTextBox.TabIndex = 3;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Enabled = false;
this.radioButton1.Location = new System.Drawing.Point(29, 23);
this.radioButton1.Margin = new System.Windows.Forms.Padding(4);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(99, 20);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Use TCP/IP";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Enabled = false;
this.radioButton2.Location = new System.Drawing.Point(312, 23);
this.radioButton2.Margin = new System.Windows.Forms.Padding(4);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(115, 20);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = "Use serial port";
this.radioButton2.UseVisualStyleBackColor = true;
//
// optoSerialPortLabel
//
this.optoSerialPortLabel.AutoSize = true;
this.optoSerialPortLabel.Location = new System.Drawing.Point(321, 55);
this.optoSerialPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.optoSerialPortLabel.Name = "optoSerialPortLabel";
this.optoSerialPortLabel.Size = new System.Drawing.Size(88, 16);
this.optoSerialPortLabel.TabIndex = 6;
this.optoSerialPortLabel.Text = "Serial port nr.:";
//
// optoSerialPortTextBox
//
this.optoSerialPortTextBox.Enabled = false;
this.optoSerialPortTextBox.Location = new System.Drawing.Point(439, 52);
this.optoSerialPortTextBox.Margin = new System.Windows.Forms.Padding(4);
this.optoSerialPortTextBox.Name = "optoSerialPortTextBox";
this.optoSerialPortTextBox.Size = new System.Drawing.Size(44, 22);
this.optoSerialPortTextBox.TabIndex = 7;
//
// groupTextBox
//
this.groupTextBox.Enabled = false;
this.groupTextBox.Location = new System.Drawing.Point(153, 97);
this.groupTextBox.Margin = new System.Windows.Forms.Padding(4);
this.groupTextBox.Name = "groupTextBox";
this.groupTextBox.Size = new System.Drawing.Size(44, 22);
this.groupTextBox.TabIndex = 22;
//
// groupLabel
//
this.groupLabel.AutoSize = true;
this.groupLabel.Location = new System.Drawing.Point(6, 101);
this.groupLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.groupLabel.Name = "groupLabel";
this.groupLabel.Size = new System.Drawing.Size(54, 16);
this.groupLabel.TabIndex = 21;
this.groupLabel.Text = "Group 2";
//
// muxBoardNrTextBox
//
this.muxBoardNrTextBox.Enabled = false;
this.muxBoardNrTextBox.Location = new System.Drawing.Point(153, 69);
this.muxBoardNrTextBox.Margin = new System.Windows.Forms.Padding(4);
this.muxBoardNrTextBox.Name = "muxBoardNrTextBox";
this.muxBoardNrTextBox.Size = new System.Drawing.Size(44, 22);
this.muxBoardNrTextBox.TabIndex = 20;
//
// muxBoardNrLabel
//
this.muxBoardNrLabel.AutoSize = true;
this.muxBoardNrLabel.Location = new System.Drawing.Point(6, 72);
this.muxBoardNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.muxBoardNrLabel.Name = "muxBoardNrLabel";
this.muxBoardNrLabel.Size = new System.Drawing.Size(131, 16);
this.muxBoardNrLabel.TabIndex = 19;
this.muxBoardNrLabel.Text = "Group 1 (mux. board)";
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(153, 40);
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(160, 22);
this.nameTextBox.TabIndex = 17;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(6, 44);
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(44, 16);
this.nameLabel.TabIndex = 16;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(149, 11);
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(78, 16);
this.classNameLabel.TabIndex = 15;
this.classNameLabel.Text = "ClassName";
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(603, 403);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Test";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.headPortNrTextBox);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Location = new System.Drawing.Point(10, 335);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(552, 50);
this.groupBox2.TabIndex = 26;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Head Communication";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(321, 18);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 16);
this.label2.TabIndex = 7;
this.label2.Text = "Serial port nr.:";
//
// headPortNrTextBox
//
this.headPortNrTextBox.Enabled = false;
this.headPortNrTextBox.Location = new System.Drawing.Point(439, 15);
this.headPortNrTextBox.Margin = new System.Windows.Forms.Padding(4);
this.headPortNrTextBox.Name = "headPortNrTextBox";
this.headPortNrTextBox.Size = new System.Drawing.Size(44, 22);
this.headPortNrTextBox.TabIndex = 8;
//
// IperlHeadCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tabControl1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "IPerlCfgCtrl";
this.Size = new System.Drawing.Size(617, 438);
this.Load += new System.EventHandler(this.WaterMeterCfgCtrl_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.optoDataGroupBox.ResumeLayout(false);
this.optoDataGroupBox.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox comboBoxCommunicationInterface;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox rfidPortNrTextBox;
private System.Windows.Forms.Label rfidSerialPortNrLabel;
private System.Windows.Forms.GroupBox optoDataGroupBox;
private System.Windows.Forms.Label tcpipPortLabel;
private System.Windows.Forms.TextBox tcpipPortTextBox;
private System.Windows.Forms.Label ipAddressLabel;
private System.Windows.Forms.TextBox ipAddressTextBox;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Label optoSerialPortLabel;
private System.Windows.Forms.TextBox optoSerialPortTextBox;
private System.Windows.Forms.TextBox groupTextBox;
private System.Windows.Forms.Label groupLabel;
private System.Windows.Forms.TextBox muxBoardNrTextBox;
private System.Windows.Forms.Label muxBoardNrLabel;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox headPortNrTextBox;
private System.Windows.Forms.Label label2;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,137 @@
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
partial class IperlHeadTestCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.optoTestGroupBox = new System.Windows.Forms.GroupBox();
this.optoListBox = new System.Windows.Forms.ListBox();
this.rfidOutputListBox = new System.Windows.Forms.ListBox();
this.RfidTestGroupBox = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.rfidCommandComboBox = new System.Windows.Forms.ComboBox();
this.commandTestButton = new System.Windows.Forms.Button();
this.optoTestGroupBox.SuspendLayout();
this.RfidTestGroupBox.SuspendLayout();
this.SuspendLayout();
//
// optoTestGroupBox
//
this.optoTestGroupBox.Controls.Add(this.optoListBox);
this.optoTestGroupBox.Location = new System.Drawing.Point(5, 4);
this.optoTestGroupBox.Name = "optoTestGroupBox";
this.optoTestGroupBox.Size = new System.Drawing.Size(591, 161);
this.optoTestGroupBox.TabIndex = 2;
this.optoTestGroupBox.TabStop = false;
this.optoTestGroupBox.Text = "Opto-data";
//
// optoListBox
//
this.optoListBox.FormattingEnabled = true;
this.optoListBox.ItemHeight = 16;
this.optoListBox.Location = new System.Drawing.Point(7, 22);
this.optoListBox.Name = "optoListBox";
this.optoListBox.Size = new System.Drawing.Size(573, 132);
this.optoListBox.TabIndex = 0;
//
// rfidOutputListBox
//
this.rfidOutputListBox.FormattingEnabled = true;
this.rfidOutputListBox.ItemHeight = 16;
this.rfidOutputListBox.Location = new System.Drawing.Point(5, 54);
this.rfidOutputListBox.Name = "rfidOutputListBox";
this.rfidOutputListBox.SelectionMode = System.Windows.Forms.SelectionMode.None;
this.rfidOutputListBox.Size = new System.Drawing.Size(575, 164);
this.rfidOutputListBox.TabIndex = 3;
//
// RfidTestGroupBox
//
this.RfidTestGroupBox.Controls.Add(this.rfidOutputListBox);
this.RfidTestGroupBox.Controls.Add(this.label2);
this.RfidTestGroupBox.Controls.Add(this.rfidCommandComboBox);
this.RfidTestGroupBox.Controls.Add(this.commandTestButton);
this.RfidTestGroupBox.Location = new System.Drawing.Point(5, 171);
this.RfidTestGroupBox.Name = "RfidTestGroupBox";
this.RfidTestGroupBox.Size = new System.Drawing.Size(591, 224);
this.RfidTestGroupBox.TabIndex = 3;
this.RfidTestGroupBox.TabStop = false;
this.RfidTestGroupBox.Text = "RFID / NFC data";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(2, 25);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 16);
this.label2.TabIndex = 2;
this.label2.Text = "Command";
//
// rfidCommandComboBox
//
this.rfidCommandComboBox.FormattingEnabled = true;
this.rfidCommandComboBox.Location = new System.Drawing.Point(86, 19);
this.rfidCommandComboBox.Name = "rfidCommandComboBox";
this.rfidCommandComboBox.Size = new System.Drawing.Size(341, 24);
this.rfidCommandComboBox.TabIndex = 1;
//
// commandTestButton
//
this.commandTestButton.Location = new System.Drawing.Point(449, 19);
this.commandTestButton.Name = "commandTestButton";
this.commandTestButton.Size = new System.Drawing.Size(126, 24);
this.commandTestButton.TabIndex = 0;
this.commandTestButton.Text = "Send command";
this.commandTestButton.UseVisualStyleBackColor = true;
this.commandTestButton.MouseClick += new System.Windows.Forms.MouseEventHandler(this.CommandTestButtonClick);
//
// IperlHeadTestCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.optoTestGroupBox);
this.Controls.Add(this.RfidTestGroupBox);
this.Name = "IperlHeadTestCtrl";
this.Size = new System.Drawing.Size(611, 432);
this.Load += new System.EventHandler(this.UserControl_Load);
this.optoTestGroupBox.ResumeLayout(false);
this.RfidTestGroupBox.ResumeLayout(false);
this.RfidTestGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox optoTestGroupBox;
private System.Windows.Forms.ListBox rfidOutputListBox;
private System.Windows.Forms.GroupBox RfidTestGroupBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox rfidCommandComboBox;
private System.Windows.Forms.Button commandTestButton;
private System.Windows.Forms.ListBox optoListBox;
}
}
@@ -0,0 +1,193 @@
using System;
using System.Threading;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using TBF.Rig.RegisterReaders.CommonRR.IPerl.communication;
using TBF.Rig.RegisterReaders.iPerlReaderUNI.test;
using TBF.Rig.Sequences;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
public partial class IperlHeadTestCtrl : UserControl
{
IPerlCfg config;
IntIPerlReader _iPerlReader;
Thread optoThread;
private bool stopWorkerThread;
public event EventHandler<OptoReceivedEventArgs> OptoReceivedHandler;
public IperlHeadTestCtrl(IPerlCfg config)
{
this.config = config;
InitializeComponent();
if (config == null) return;
//TODO fix possibility set test method in config
//iPerlCommunicationForm.cfg = new TestMethodCfg(null); // default values for iPerlCommunication
foreach(var head in ProcessData.IperlHeadsUni)
{
if (head != null && head.Name == config.Name) { _iPerlReader = head; }
}
rfidCommandComboBox.DisplayMember = "Name";
rfidCommandComboBox.ValueMember = "Value";
var items = new[]
{
new {Name = "Read PCB", Value = "ReadPCB" },
new {Name = "Set Test Mode", Value = "SetTestMode" },
new {Name = "Set Active Mode", Value = "SetActiveMode" },
#if DEBUG
new {Name = "Start Read Opto Data", Value = "ReadOptoData" },
new {Name = "Stop Read Opto Data", Value = "StopReadOptoData" },
#endif
new {Name = " ", Value = "" },
new {Name = "Reset NFC Head", Value = "ResetNfcHead" },
new {Name = "Set NFC Head Interface", Value = "SetNfcHead" },
new {Name = "Set RFID Head interface", Value = "SetRfidHead" }
};
/*
// CTRL+ALT+double click - hidden poweruser menu
if (((Keyboard.ModifierKeys & Keys.Control) == Keys.Control) && ((Keyboard.ModifierKeys & Keys.Alt) == Keys.Alt) && Users.CurrentUser.AuthorizedAs == AuthorizedAs.PowerUser)
{
Array.Resize(ref items, items.Length + 1);
items[items.Length - 1] = new { Name = "Kluc", Value = "Kluc" };
}
*/
rfidCommandComboBox.DataSource = items;
stopWorkerThread = false;
OptoReceivedHandler += (EventHandler<OptoReceivedEventArgs>)((sndr, args) =>
{
if (this.InvokeRequired)
this.Invoke((Delegate)new EventHandler<OptoReceivedEventArgs>(this.OnOptoReceived2), sndr, (object)args);
else
this.OnOptoReceived2(sndr, args);
});
}
public void OnOptoReceived2(object sender, OptoReceivedEventArgs args)
{
optoListBox.Items.Insert(0,args.Data);
}
private void CommandTestButtonClick(object sender, MouseEventArgs e)
{
rfidOutputListBox.Items.Clear();
using (Tools.LogChecker logChecker = new Tools.LogChecker("RfidData", log4net.Core.Level.Debug))
{
ListItem rfidListItem = new ListItem();
rfidListItem.Attributes.Add("style", "font-weight:bold");
switch (rfidCommandComboBox.SelectedValue)
{
case "ReadPCB":
// rfidListItem.Text = $"PCB: {OpticalHeadTest.ReadRequest_PCB(_iPerlReader)}";
break;
case "SetTestMode":
// rfidListItem.Text = OpticalHeadTest.SetTestMode(_iPerlReader);
// optoListBox.Items.Clear();
// stopWorkerThread = false;
// optoThread = new Thread(OptoWorker);
// if (!optoThread.IsAlive)
// {
// _iPerlReader.StartDataStreamProcessing(); // open opto port
// optoThread.Start();
// }
break;
case "SetActiveMode":
// rfidListItem.Text = OpticalHeadTest.SetActiveMode(_iPerlReader);
// stopWorkerThread = true;
// _iPerlReader.StopDataStreamProcessing(); // close opto port
break;
case "ResetNfcHead":
_iPerlReader.ResetNfcInterface();
break;
case "SetNfcHead":
_iPerlReader.SetNfcInterface();
break;
case "SetRfidHead":
_iPerlReader.SetRfidInterface();
break;
case "ReadOptoData":
optoListBox.Items.Clear();
stopWorkerThread = false;
optoThread = new Thread(OptoWorker);
if (optoThread.IsAlive)
{
stopWorkerThread = true;
_iPerlReader.StopDataStreamProcessing(); // close opto port
}
if (!optoThread.IsAlive)
{
_iPerlReader.StartDataStreamProcessing(); // open opto port
optoThread.Start();
}
break;
case "StopReadOptoData":
stopWorkerThread = true;
_iPerlReader.StopDataStreamProcessing(); // close opto port
break;
}
rfidOutputListBox.Items.Add(rfidListItem);
rfidOutputListBox.Items.AddRange(logChecker.Messages.ToArray());
}
}
private void OptoWorker()
{
while (!this.stopWorkerThread)
{
Thread.Sleep(250);
if (this.stopWorkerThread)
break;
try
{
string buffer = _iPerlReader.ReadOptoData();
if (string.IsNullOrEmpty(buffer))
{
this.OnOptoReceived((object)this, new OptoReceivedEventArgs("."));
}
else
OnOptoReceived((object)this, new OptoReceivedEventArgs(buffer));
}
catch (Exception ex)
{
this.OnOptoReceived((object)this, new OptoReceivedEventArgs(ex.Message));
}
}
}
public void OnOptoReceived(object sender, OptoReceivedEventArgs args)
{
if (this.OptoReceivedHandler == null)
return;
try
{
this.OptoReceivedHandler(sender, args);
}
catch (Exception ex)
{
}
}
private void UserControl_Load(object sender, EventArgs e)
{
this.ParentForm.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing);
}
void ParentForm_FormClosing(object sender, FormClosingEventArgs e)
{
//OnHandleDestroyed(new EventArgs());
stopWorkerThread = true;
if (optoThread != null)
{
optoThread.Abort();
}
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,184 @@
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.CommonRR;
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public int WMType_ID;
public MeterType MeterType;
public float CalibTarget; /// Target error after calibration in [%]
public int FactorLimitLo; /// Lower limit for the calibration factor
public int FactorLimitHi; /// Upper limit for the calibration factor
public Counting Counting; /// Initial iPerl counting (Artbitrary, Positive or Negative)
public override void InitializeAll()
{
MeterType = MeterType.AutoDetect;
CalibTarget = 0;
FactorLimitLo = 1000;
FactorLimitHi = 8000;
Counting = Counting.Arbitrary;
}
string[] paramNames = new string[]
{
"iPerl type",
"Calib. target [%]",
"Calib. factor Lo",
"Calib. factor Hi",
"Counting",
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override ICollection<string> ParamValues(int i)
{
if (i == 0)
{
var retVal = new List<string>();
for (MeterType mt = 0; mt < MeterType.Count; mt++) retVal.Add(mt.ToString());
return retVal;
}
else if (i == 5)
{
var retVal = new List<string>();
for (Counting c = 0; c < Counting.Count; c++) retVal.Add(c.ToString());
return retVal;
}
return null;
}
public override string ToString(int i)
{
switch (i)
{
case 0: return MeterType.ToString();
case 1: return CalibTarget.ToString();
case 2: return FactorLimitLo.ToString();
case 3: return FactorLimitHi.ToString();
case 4: return Counting.ToString();
default: return string.Empty;
}
}
//implement IParamsProvider
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int iDummy;
float fDummy;
switch (i)
{
case 0:
for (MeterType mt = 0; mt < MeterType.Count; mt++) if (mt.ToString().Equals(strValue)) return true;
break;
case 1:
if (Utils.TryParseSFloat(strValue, out fDummy) && fDummy >= -10.0f && fDummy <= 10.0f) return true;
break;
case 2:
case 3:
if (int.TryParse(strValue, out iDummy) && iDummy >= 1000 && iDummy <= 8000) return true;
break;
case 4:
for (Counting c = 0; c < Counting.Count; c++) if (c.ToString().Equals(strValue)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
for (MeterType mt = 0; mt < MeterType.Count; mt++)
{
if (mt.ToString().Equals(strValue)) { MeterType = mt; return CfgUpdateFlags.None; }
}
break;
case 1: CalibTarget = Utils.ParseSFloat(strValue); return CfgUpdateFlags.None;
case 2: FactorLimitLo = int.Parse(strValue); return CfgUpdateFlags.None;
case 3: FactorLimitHi = int.Parse(strValue); return CfgUpdateFlags.None;
case 4:
for (Counting c = 0; c < Counting.Count; c++)
{
if (c.ToString().Equals(strValue)) { Counting = c; return CfgUpdateFlags.None; }
}
break;
default: return CfgUpdateFlags.None;
}
return CfgUpdateFlags.None;
}
void CopyContentTo(ProcParams prms)
{
prms.MeterType = this.MeterType;
prms.CalibTarget = this.CalibTarget;
prms.FactorLimitLo = this.FactorLimitLo;
prms.FactorLimitHi = this.FactorLimitHi;
prms.Counting = this.Counting;
}
public IParamsProvider Clone()
{
ProcParams pars = new ProcParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
ProcParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as ProcParams;
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
public ProcParams()
{
}
public ProcParams(bool initialize)
{
if (initialize) InitializeAll();
}
public ProcParams(ComponentProcedure procParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
}
@@ -1,17 +1,19 @@
///
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using System.IO.Ports;
using System.Threading;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.TestMethods.SmartTest;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.TestMethods.iPerlCommunication
namespace TBF.Rig.RegisterReaders.PoseidonReader
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
public class TestMethodCfg : ComponentCfgBase, IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@@ -0,0 +1,245 @@
///
/// Copyright (c) 2015-2020 Sensus Metering Systems
///
using System;
using System.IO;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.PoseidonReader.comminication;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
public class CalibrationStruct
{
public const int Length = 35;
public Byte Version;
public MeterType MeterType;
public UInt16 Calibration;
public VolumeUnits VolumeUnits;
public FlowArrow FlowArrow;
public UInt16 FWVersion;
public UInt16[] TargetField;
public UInt16 RecipMeanCurrent;
public UInt16 ThresholdVolume;
public UInt16 ThresholdTime;
public UInt16 FlowActivationThr;
public UInt16 VolumeArrowThr;
public UInt32 CalibrationTime;
public ulong SerialNumber;
public MeterSealed MeterSealed;
public byte CheckSum;
public CalibrationStruct()
{
TargetField = new UInt16[3];
}
public byte[] ToByteArray()
{
byte[] result = new byte[Length];
result[0] = Version;
result[1] = (byte)MeterType;
result[2] = (byte)(Calibration & 0x00FF);
result[3] = (byte)((Calibration >> 8) & 0x00FF);
result[4] = (byte)VolumeUnits;
result[5] = (byte)FlowArrow;
result[6] = (byte)(FWVersion & 0x00FF);
result[7] = (byte)((FWVersion >> 8) & 0x00FF);
result[8] = (byte)( TargetField[0] & 0x00FF);
result[9] = (byte)((TargetField[0] >> 8) & 0x00FF);
result[10] = (byte)( TargetField[1] & 0x00FF);
result[11] = (byte)((TargetField[1] >> 8) & 0x00FF);
result[12] = (byte)( TargetField[2] & 0x00FF);
result[13] = (byte)((TargetField[2] >> 8) & 0x00FF);
result[14] = (byte)(RecipMeanCurrent & 0x00FF);
result[15] = (byte)((RecipMeanCurrent >> 8) & 0x00FF);
result[16] = (byte)(ThresholdVolume & 0x00FF);
result[17] = (byte)((ThresholdVolume >> 8) & 0x00FF);
result[18] = (byte)(ThresholdTime & 0x00FF);
result[19] = (byte)((ThresholdTime >> 8) & 0x00FF);
result[20] = (byte)(FlowActivationThr & 0x00FF);
result[21] = (byte)((FlowActivationThr >> 8) & 0x00FF);
result[22] = (byte)(VolumeArrowThr & 0x00FF);
result[23] = (byte)((VolumeArrowThr >> 8) & 0x00FF);
result[24] = (byte)(CalibrationTime & 0x000000FF);
result[25] = (byte)((CalibrationTime >> 8) & 0x000000FF);
result[26] = (byte)((CalibrationTime >> 16) & 0x000000FF);
result[27] = (byte)((CalibrationTime >> 24) & 0x000000FF);
result[28] = (byte)(SerialNumber & 0x00000000000000FF);
result[29] = (byte)((SerialNumber >> 8) & 0x00000000000000FF);
result[30] = (byte)((SerialNumber >> 16) & 0x00000000000000FF);
result[31] = (byte)((SerialNumber >> 24) & 0x00000000000000FF);
result[32] = (byte)((SerialNumber >> 32) & 0x00000000000000FF);
result[33] = (byte)MeterSealed;
result[34] = CheckSum;
return result;
}
/// <summary>
/// Create a calibration structure from a complete byte array
/// </summary>
/// <param name="data">A complete byte array data</param>
/// <returns>CalibrationStruct or null when byte array was not complete</returns>
public static CalibrationStruct FromByteArray(byte[] data)
{
if (data.Length != Length) return null;
CalibrationStruct result = new CalibrationStruct();
result.Version = data[0];
result.MeterType = (MeterType)data[1];
result.Calibration = (UInt16)(data[2] + 256 * data[3]);
result.VolumeUnits = (VolumeUnits)data[4];
result.FlowArrow = (FlowArrow)data[5];
result.FWVersion = (UInt16)(data[6] + 256 * data[7]);
result.TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
result.TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
result.TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
result.RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
result.ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
result.ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
result.FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
result.VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
result.CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
result.SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
result.MeterSealed = (MeterSealed)data[33];
result.CheckSum = data[34];
return result;
}
/// <summary>
/// Update the calibration structure from an incomplete byte array
/// </summary>
/// <param name="data">Byte array data</param>
/// <param name="offset">Offset of byte array data in CalibrationStruct</param>
/// <returns>true when successful, false when data are not appropriate</returns>
public bool Update(byte[] data, int offset)
{
if ((data.Length == 2) && (offset == 2))
{
/// Data containing iPerl calibration factor
Calibration = (UInt16)(data[0] + 256 * data[1]);
return true;
}
else if ((data.Length == Length) && (offset == 0))
{
/// Data containing a complete CalibrationStruct
Version = data[0];
MeterType = (MeterType)data[1];
Calibration = (UInt16)(data[2] + 256 * data[3]);
VolumeUnits = (VolumeUnits)data[4];
FlowArrow = (FlowArrow)data[5];
FWVersion = (UInt16)(data[6] + 256 * data[7]);
TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
MeterSealed = (MeterSealed)data[33];
CheckSum = data[34];
return true;
}
else
return false;
}
public string FWVersionStr()
{
int d1 = (FWVersion >> 8) & 0x000F;
int d2 = (FWVersion >> 12) & 0x000F;
int d3 = (FWVersion >> 4) & 0x000F;
int d4 = FWVersion & 0x000F;
return string.Format("{0}.{1}{2}{3}", d1, d2, d3, d4);
}
public override string ToString()
{
return string.Format("Calibration: V{0} Type={1} Cal={2} Units={3} FlowArrow.{4} FW={5} Hi={6} Norm={7} Low={8} RMC={9} ThrVol={10} ThrTime={11} FlActThr={12} VolArrThr={13} CalTm={14} SN={15} MeterSealed={16} Chksum={17}",
Version,
MeterType,
Calibration,
VolumeUnits,
FlowArrow,
FWVersion,
TargetField[0],
TargetField[1],
TargetField[2],
RecipMeanCurrent,
ThresholdVolume,
ThresholdTime,
FlowActivationThr,
VolumeArrowThr,
CalibrationTime,
SerialNumber,
MeterSealed,
CheckSum.ToString("X2"));
}
public virtual void WriteBinary(BinaryWriter writer)
{
writer.Write(Version);
writer.Write((byte)MeterType);
writer.Write(Calibration);
writer.Write((byte)VolumeUnits);
writer.Write((byte)FlowArrow);
writer.Write(FWVersion);
writer.Write(TargetField[0]);
writer.Write(TargetField[1]);
writer.Write(TargetField[2]);
writer.Write(RecipMeanCurrent);
writer.Write(ThresholdVolume);
writer.Write(ThresholdTime);
writer.Write(FlowActivationThr);
writer.Write(VolumeArrowThr);
writer.Write(CalibrationTime);
writer.Write(SerialNumber);
writer.Write((byte)MeterSealed);
writer.Write(CheckSum);
}
public virtual void ReadBinary(BinaryReader reader)
{
Version = reader.ReadByte();
MeterType = (MeterType)reader.ReadByte();
Calibration = reader.ReadUInt16();
VolumeUnits = (VolumeUnits)reader.ReadByte();
FlowArrow = (FlowArrow)reader.ReadByte();
FWVersion = reader.ReadUInt16();
TargetField[0] = reader.ReadUInt16();
TargetField[1] = reader.ReadUInt16();
TargetField[2] = reader.ReadUInt16();
RecipMeanCurrent = reader.ReadUInt16();
ThresholdVolume = reader.ReadUInt16();
ThresholdTime = reader.ReadUInt16();
FlowActivationThr = reader.ReadUInt16();
VolumeArrowThr = reader.ReadUInt16();
CalibrationTime = reader.ReadUInt32();
SerialNumber = reader.ReadUInt64();
MeterSealed = (MeterSealed)reader.ReadByte();
CheckSum = reader.ReadByte();
}
}
}
@@ -0,0 +1,261 @@
///
/// Copyright (c) 2018-2020 Sensus Slovensko a.s.
///
using System;
using System.IO;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.PoseidonReader.comminication;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
public class CalibrationStructV4
{
public const int Length = 37;
public Byte Version;
public MeterType MeterType;
public UInt16 Calibration;
public VolumeUnits VolumeUnits;
public FlowArrow FlowArrow;
public UInt16 FWVersion;
public UInt16[] TargetField;
public UInt16 RecipMeanCurrent;
public UInt16 ThresholdVolume;
public UInt16 ThresholdTime;
public UInt16 FlowActivationThr;
public UInt16 VolumeArrowThr;
public UInt32 CalibrationTime;
public ulong SerialNumber;
public MeterSealed MeterSealed;
public UInt16 CalibrationLNA;
public byte CheckSum;
public CalibrationStructV4()
{
TargetField = new UInt16[3];
}
public byte[] ToByteArray()
{
byte[] result = new byte[Length];
result[0] = Version;
result[1] = (byte)MeterType;
result[2] = (byte)(Calibration & 0x00FF);
result[3] = (byte)((Calibration >> 8) & 0x00FF);
result[4] = (byte)VolumeUnits;
result[5] = (byte)FlowArrow;
result[6] = (byte)(FWVersion & 0x00FF);
result[7] = (byte)((FWVersion >> 8) & 0x00FF);
result[8] = (byte)( TargetField[0] & 0x00FF);
result[9] = (byte)((TargetField[0] >> 8) & 0x00FF);
result[10] = (byte)( TargetField[1] & 0x00FF);
result[11] = (byte)((TargetField[1] >> 8) & 0x00FF);
result[12] = (byte)( TargetField[2] & 0x00FF);
result[13] = (byte)((TargetField[2] >> 8) & 0x00FF);
result[14] = (byte)(RecipMeanCurrent & 0x00FF);
result[15] = (byte)((RecipMeanCurrent >> 8) & 0x00FF);
result[16] = (byte)(ThresholdVolume & 0x00FF);
result[17] = (byte)((ThresholdVolume >> 8) & 0x00FF);
result[18] = (byte)(ThresholdTime & 0x00FF);
result[19] = (byte)((ThresholdTime >> 8) & 0x00FF);
result[20] = (byte)(FlowActivationThr & 0x00FF);
result[21] = (byte)((FlowActivationThr >> 8) & 0x00FF);
result[22] = (byte)(VolumeArrowThr & 0x00FF);
result[23] = (byte)((VolumeArrowThr >> 8) & 0x00FF);
result[24] = (byte)(CalibrationTime & 0x000000FF);
result[25] = (byte)((CalibrationTime >> 8) & 0x000000FF);
result[26] = (byte)((CalibrationTime >> 16) & 0x000000FF);
result[27] = (byte)((CalibrationTime >> 24) & 0x000000FF);
result[28] = (byte)(SerialNumber & 0x00000000000000FF);
result[29] = (byte)((SerialNumber >> 8) & 0x00000000000000FF);
result[30] = (byte)((SerialNumber >> 16) & 0x00000000000000FF);
result[31] = (byte)((SerialNumber >> 24) & 0x00000000000000FF);
result[32] = (byte)((SerialNumber >> 32) & 0x00000000000000FF);
result[33] = (byte)MeterSealed;
result[34] = (byte)(CalibrationLNA & 0x00FF);
result[35] = (byte)((CalibrationLNA >> 8) & 0x00FF);
result[36] = CheckSum;
return result;
}
/// <summary>
/// Create a calibration structure from a complete byte array
/// </summary>
/// <param name="data">A complete byte array data</param>
/// <returns>CalibrationStructV4 or null when byte array was not complete</returns>
public static CalibrationStructV4 FromByteArray(byte[] data)
{
if (data.Length != Length) return null;
CalibrationStructV4 result = new CalibrationStructV4();
result.Version = data[0];
result.MeterType = (MeterType)data[1];
result.Calibration = (UInt16)(data[2] + 256 * data[3]);
result.VolumeUnits = (VolumeUnits)data[4];
result.FlowArrow = (FlowArrow)data[5];
result.FWVersion = (UInt16)(data[6] + 256 * data[7]);
result.TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
result.TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
result.TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
result.RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
result.ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
result.ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
result.FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
result.VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
result.CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
result.SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
result.MeterSealed = (MeterSealed)data[33];
result.CalibrationLNA = (UInt16)(data[34] + 256 * data[35]);
result.CheckSum = data[36];
return result;
}
/// <summary>
/// Update the calibration structure from an incomplete byte array
/// </summary>
/// <param name="data">Byte array data</param>
/// <param name="offset">Offset of byte array data in CalibrationStructV2</param>
/// <returns>true when successful, false when data are not appropriate</returns>
public bool Update(byte[] data, int offset)
{
if ((data.Length == 2) && (offset == 2))
{
/// Data containing iPerl calibration factor
Calibration = (UInt16)(data[0] + 256 * data[1]);
return true;
}
else if ((data.Length == 2) && (offset == 34))
{
/// Data containing iPerl calibration factor
CalibrationLNA = (UInt16)(data[0] + 256 * data[1]);
return true;
}
else if ((data.Length == Length) && (offset == 0))
{
/// Data containing a complete CalibrationStruct
Version = data[0];
MeterType = (MeterType)data[1];
Calibration = (UInt16)(data[2] + 256 * data[3]);
VolumeUnits = (VolumeUnits)data[4];
FlowArrow = (FlowArrow)data[5];
FWVersion = (UInt16)(data[6] + 256 * data[7]);
TargetField[0] = (UInt16)(data[8] + 256 * data[9]);
TargetField[1] = (UInt16)(data[10] + 256 * data[11]);
TargetField[2] = (UInt16)(data[12] + 256 * data[13]);
RecipMeanCurrent = (UInt16)(data[14] + 256 * data[15]);
ThresholdVolume = (UInt16)(data[16] + 256 * data[17]);
ThresholdTime = (UInt16)(data[18] + 256 * data[19]);
FlowActivationThr = (UInt16)(data[20] + 256 * data[21]);
VolumeArrowThr = (UInt16)(data[22] + 256 * data[23]);
CalibrationTime = (((UInt32)data[27] * 256 + data[26]) * 256 + data[25]) * 256 + data[24];
SerialNumber = ((((UInt64)data[32] * 256 + data[31]) * 256 + data[30]) * 256 + data[29]) * 256 + data[28];
MeterSealed = (MeterSealed)data[33];
CalibrationLNA = (UInt16)(data[34] + 256 * data[35]);
CheckSum = data[36];
return true;
}
else
return false;
}
public string FWVersionStr()
{
int d1 = (FWVersion >> 8) & 0x000F;
int d2 = (FWVersion >> 12) & 0x000F;
int d3 = (FWVersion >> 4) & 0x000F;
int d4 = FWVersion & 0x000F;
return string.Format("{0}.{1}{2}{3}", d1, d2, d3, d4);
}
public override string ToString()
{
return string.Format("Calibration: V{0} Type={1} Cal={2} Units={3} FlowArrow.{4} FW={5} Hi={6} Norm={7} Low={8} RMC={9} ThrVol={10} ThrTime={11} FlActThr={12} VolArrThr={13} CalTm={14} SN={15} MeterSealed={16} CalLNA={17} Chksum={18}",
Version,
MeterType,
Calibration,
VolumeUnits,
FlowArrow,
FWVersion,
TargetField[0],
TargetField[1],
TargetField[2],
RecipMeanCurrent,
ThresholdVolume,
ThresholdTime,
FlowActivationThr,
VolumeArrowThr,
CalibrationTime,
SerialNumber,
MeterSealed,
CalibrationLNA,
CheckSum.ToString("X2"));
}
public virtual void WriteBinary(BinaryWriter writer)
{
writer.Write(Version);
writer.Write((byte)MeterType);
writer.Write(Calibration);
writer.Write((byte)VolumeUnits);
writer.Write((byte)FlowArrow);
writer.Write(FWVersion);
writer.Write(TargetField[0]);
writer.Write(TargetField[1]);
writer.Write(TargetField[2]);
writer.Write(RecipMeanCurrent);
writer.Write(ThresholdVolume);
writer.Write(ThresholdTime);
writer.Write(FlowActivationThr);
writer.Write(VolumeArrowThr);
writer.Write(CalibrationTime);
writer.Write(SerialNumber);
writer.Write((byte)MeterSealed);
writer.Write(CalibrationLNA);
writer.Write(CheckSum);
}
public virtual void ReadBinary(BinaryReader reader)
{
Version = reader.ReadByte();
MeterType = (MeterType)reader.ReadByte();
Calibration = reader.ReadUInt16();
VolumeUnits = (VolumeUnits)reader.ReadByte();
FlowArrow = (FlowArrow)reader.ReadByte();
FWVersion = reader.ReadUInt16();
TargetField[0] = reader.ReadUInt16();
TargetField[1] = reader.ReadUInt16();
TargetField[2] = reader.ReadUInt16();
RecipMeanCurrent = reader.ReadUInt16();
ThresholdVolume = reader.ReadUInt16();
ThresholdTime = reader.ReadUInt16();
FlowActivationThr = reader.ReadUInt16();
VolumeArrowThr = reader.ReadUInt16();
CalibrationTime = reader.ReadUInt32();
SerialNumber = reader.ReadUInt64();
MeterSealed = (MeterSealed)reader.ReadByte();
CalibrationLNA = reader.ReadUInt16();
CheckSum = reader.ReadByte();
}
}
}
@@ -0,0 +1,41 @@
///
/// Copyright (c) 2015-2019 Sensus Metering Systems
/// Author: Milan Hanajík
///
using System;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
public class CommCompletedEventArgs : EventArgs
{
public int ThreadId;
public int WMNr0; /// 0-based water meter position
public IPerlReader Ihead;
public Results.Entities.WaterMeter Wm;
public string CommMessage;
public CommErr CommErr;
public CommCompletedEventArgs(int threadId, int wmNr0, IPerlReader ihead, Results.Entities.WaterMeter wm, string commMessage, CommErr commErr)
{
this.ThreadId = threadId;
this.WMNr0 = wmNr0;
this.Ihead = ihead;
this.Wm = wm;
this.CommMessage = commMessage;
this.CommErr = commErr;
}
public override string ToString()
{
return string.Format("Thread={0} WMNr0={1} IHead={2} WM={3} CommMsg={4} CommErr={5}",
ThreadId,
WMNr0,
(Ihead != null) ? Ihead.Name : "null",
Wm.WMPosition,
(CommMessage != null) ? CommMessage : "null",
CommErr);
}
}
}
@@ -0,0 +1,269 @@
///
/// Copyright (c) 2015-2020 Sensus Metering Systems
///
using System;
using System.IO;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.PoseidonReader.comminication;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
public class ConfigStruct
{
public const int Length = 32;
public Byte Version; /// 0: 1 byte
public MeterState MeterState; /// 1: 1 byte
public UInt32 TargetTimeVeryLowBatt; /// 2: 4 bytes in seconds
public UInt32 TargetTimeLowBatt; /// 6: 4 bytes, in seconds
public UInt32 TestModeTime; /// 10: 4 bytes, Max. test mode time in seconds
public UInt16 EmptyPipeThreshold; /// 14: 2 bytes
public byte[] PCBNumber; /// 16: 5 bytes
public byte TestModeConfig; /// 21: 1 byte
public UInt32 RadioAddress; /// 22: 4 bytes
public UInt16 TempCalibration; /// 26: 2 bytes
public UInt16 AlarmMask; /// 28: 2 bytes, Default 0xA3F7
public UInt16 ConfigCheckSum; /// 30: 2 bytes
public ConfigStruct()
{
PCBNumber = new byte[5];
}
public byte[] ToByteArray()
{
byte[] result = new byte[Length];
result[0] = Version;
result[1] = (byte)MeterState;
result[2] = (byte)(TargetTimeVeryLowBatt & 0x000000FF);
result[3] = (byte)((TargetTimeVeryLowBatt >> 8) & 0x000000FF);
result[4] = (byte)((TargetTimeVeryLowBatt >> 16) & 0x000000FF);
result[5] = (byte)((TargetTimeVeryLowBatt >> 24) & 0x000000FF);
result[6] = (byte)(TargetTimeLowBatt & 0x000000FF);
result[7] = (byte)((TargetTimeLowBatt >> 8) & 0x000000FF);
result[8] = (byte)((TargetTimeLowBatt >> 16) & 0x000000FF);
result[9] = (byte)((TargetTimeLowBatt >> 24) & 0x000000FF);
result[10] = (byte)(TestModeTime & 0x000000FF);
result[11] = (byte)((TestModeTime >> 8) & 0x000000FF);
result[12] = (byte)((TestModeTime >> 16) & 0x000000FF);
result[13] = (byte)((TestModeTime >> 24) & 0x000000FF);
result[14] = (byte)(EmptyPipeThreshold & 0x00FF);
result[15] = (byte)((EmptyPipeThreshold >> 8) & 0x00FF);
result[16] = PCBNumber[0];
result[17] = PCBNumber[1];
result[18] = PCBNumber[2];
result[19] = PCBNumber[3];
result[20] = PCBNumber[4];
result[21] = TestModeConfig;
result[22] = (byte)(RadioAddress & 0x000000FF);
result[23] = (byte)((RadioAddress >> 8) & 0x000000FF);
result[24] = (byte)((RadioAddress >> 16) & 0x000000FF);
result[25] = (byte)((RadioAddress >> 24) & 0x000000FF);
result[26] = (byte)(TempCalibration & 0x00FF);
result[27] = (byte)((TempCalibration >> 8) & 0x00FF);
result[28] = (byte)(AlarmMask & 0x00FF);
result[29] = (byte)((AlarmMask >> 8) & 0x00FF);
result[30] = (byte)(ConfigCheckSum & 0x00FF);
result[31] = (byte)((ConfigCheckSum >> 8) & 0x00FF);
return result;
}
/// <summary>
/// Create a configuration structure from a complete byte array
/// </summary>
/// <param name="data">A complete byte array data</param>
/// <returns>ConfigStruct or null when byte array was not complete</returns>
public static ConfigStruct FromByteArray(byte[] data)
{
if (data.Length != Length) return null;
ConfigStruct result = new ConfigStruct();
result.Version = data[0];
result.MeterState = (MeterState)data[1];
result.TargetTimeVeryLowBatt = (((UInt32)data[5] * 256 + data[4]) * 256 + data[3]) * 256 + data[2];
result.TargetTimeLowBatt = (((UInt32)data[9] * 256 + data[8]) * 256 + data[7]) * 256 + data[6];
result.TestModeTime = (((UInt32)data[13] * 256 + data[12]) * 256 + data[11]) * 256 + data[10];
result.EmptyPipeThreshold = (UInt16)(data[15] * 256 + data[14]);
result.PCBNumber[0] = data[16];
result.PCBNumber[1] = data[17];
result.PCBNumber[2] = data[18];
result.PCBNumber[3] = data[19];
result.PCBNumber[4] = data[20];
result.TestModeConfig = data[21];
result.RadioAddress = (((UInt32)data[25] * 256 + data[24]) * 256 + data[23]) * 256 + data[22];
result.TempCalibration = (UInt16)(data[27] * 256 + data[26]);
result.AlarmMask = (UInt16)(data[29] * 256 + data[28]);
result.ConfigCheckSum = (UInt16)(data[31] * 256 + data[30]);
return result;
}
/// <summary>
/// Update the configuration structure from an incomplete byte array
/// </summary>
/// <param name="offset">Offset of byte array data in ConfigStruct</param>
/// <param name="data">Byte array data</param>
/// <returns>true when successful, false when data are not appropriate</returns>
public bool Update(int offset, byte[] data)
{
if (offset == 0 && data.Length == 2)
{
/// iPerl mode of function
Version = data[0];
MeterState = (MeterState)data[1];
return true;
}
else if (offset == 0 && data.Length == 4)
{
/// iPerl mode of function and extra 2 bytes
Version = data[0];
MeterState = (MeterState)data[1];
return true;
}
else if (offset == 21 && data.Length == 1)
{
/// TestModeConfig value
TestModeConfig = data[21 - offset];
return true;
}
else if (offset == 0 && data.Length == Length)
{
/// Complete ConfigStruct
Version = data[0];
MeterState = (MeterState)data[1];
TargetTimeVeryLowBatt = (((UInt32)data[5] * 256 + data[4]) * 256 + data[3]) * 256 + data[2];
TargetTimeLowBatt = (((UInt32)data[9] * 256 + data[8]) * 256 + data[7]) * 256 + data[6];
TestModeTime = (((UInt32)data[13] * 256 + data[12]) * 256 + data[11]) * 256 + data[10];
EmptyPipeThreshold = (UInt16)(data[15] * 256 + data[14]);
PCBNumber[0] = data[16];
PCBNumber[1] = data[17];
PCBNumber[2] = data[18];
PCBNumber[3] = data[19];
PCBNumber[4] = data[20];
TestModeConfig = data[21];
RadioAddress = (((UInt32)data[25] * 256 + data[24]) * 256 + data[23]) * 256 + data[22];
TempCalibration = (UInt16)(data[27] * 256 + data[26]);
AlarmMask = (UInt16)(data[29] * 256 + data[28]);
ConfigCheckSum = (UInt16)(data[31] * 256 + data[30]);
return true;
}
else
return false;
}
/// <summary>
/// Returns PCB number string (12 characters, 12 decimal digits)
/// </summary>
/// <returns>PCB number STRING</returns>
public string GetPcbNrString()
{
return PCBNumber2String(this.PCBNumber);
}
/// <summary>
/// Converts PCBNumber to string (12 characters, 12 decimal digits)
/// </summary>
/// <param name="pcbNumber"></param>
/// <returns>PCB number string</returns>
public static string PCBNumber2String(byte[] pcbNumber)
{
if (pcbNumber.Length != 5) return string.Empty;
Int64 number = 0;
for (int i = 4; i >= 0; i--)
{
number = 256 * number + (Int64)pcbNumber[i];
}
return number.ToString();
}
public override string ToString()
{
return string.Format("Config: V{0} State={1} VLoBattT={2}s LoBattT={3}s TestModeT={4}s EPThld={5} PCB#={6} TMCfg={7} RadioAddr={8} TempCalib={9} AlarmMask={10} CfgCheckSum={11}",
Version,
MeterState,
TargetTimeVeryLowBatt,
TargetTimeLowBatt,
TestModeTime,
EmptyPipeThreshold,
GetPcbNrString(),
TestModeConfig.ToString("X2"),
RadioAddress,
TempCalibration,
AlarmMask.ToString("X4"),
ConfigCheckSum.ToString("X4"));
}
public string ToString(int sel)
{
return string.Format("{1} PCB#={6} TMCfg={7}",
Version,
MeterState,
TargetTimeVeryLowBatt,
TargetTimeLowBatt,
TestModeTime,
EmptyPipeThreshold,
GetPcbNrString(),
TestModeConfig.ToString("X2"),
RadioAddress,
TempCalibration,
AlarmMask.ToString("X4"),
ConfigCheckSum.ToString("X4"));
}
public virtual void WriteBinary(BinaryWriter writer)
{
writer.Write(Version);
writer.Write((byte)MeterState);
writer.Write(TargetTimeVeryLowBatt);
writer.Write(TargetTimeLowBatt);
writer.Write(TestModeTime);
writer.Write(EmptyPipeThreshold);
writer.Write(PCBNumber[0]);
writer.Write(PCBNumber[1]);
writer.Write(PCBNumber[2]);
writer.Write(PCBNumber[3]);
writer.Write(PCBNumber[4]);
writer.Write(TestModeConfig);
writer.Write(RadioAddress);
writer.Write(TempCalibration);
writer.Write(AlarmMask);
writer.Write(ConfigCheckSum);
}
public virtual void ReadBinary(BinaryReader reader)
{
Version = reader.ReadByte();
MeterState = (MeterState)reader.ReadByte();
TargetTimeVeryLowBatt = reader.ReadUInt32();
TargetTimeLowBatt = reader.ReadUInt32();
TestModeTime = reader.ReadUInt32();
EmptyPipeThreshold = reader.ReadUInt16();
PCBNumber[0] = reader.ReadByte();
PCBNumber[1] = reader.ReadByte();
PCBNumber[2] = reader.ReadByte();
PCBNumber[3] = reader.ReadByte();
PCBNumber[4] = reader.ReadByte();
TestModeConfig = reader.ReadByte();
RadioAddress = reader.ReadUInt32();
TempCalibration = reader.ReadUInt16();
AlarmMask = reader.ReadUInt16();
ConfigCheckSum = reader.ReadUInt16();
}
}
}
@@ -0,0 +1,315 @@
using System;
using System.Globalization;
using System.Text;
using System.Threading;
using log4net;
using Sensus.iPerl.NfcHandler;
using Sensus.iPerl.RfidCom.Exceptions;
using static Sensus.iPerl.NfcHandler.MCI_Protocol;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
internal class NfcServices
{
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
internal static int ReadRequest(TestMethodCfg cfg, IPerlReader iperlHead, MCI_Protocol.StructName structName, int offset, int length, out byte[] buffer)
{
for (int i = 0; i < cfg.MaxCommRetries; i++)
{
NfcDataHandler _nfcDataHandler = new NfcDataHandler();
MessageEventHandlers(_nfcDataHandler);
CR95HF_MessageEventHandlers(_nfcDataHandler._CR95HF_Reader);
ST25DV_MessageEventHandlers(_nfcDataHandler._ST25DV_Device);
MCI_MessageEventHandlers(_nfcDataHandler._MCI_Protocol);
NFCHeadConfig_MessageEventHandlers(_nfcDataHandler._NFCHead_Config);
try
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} ReadRequest : {structName}, {offset}, {length}");
OpenConnection(_nfcDataHandler, cfg, iperlHead);
buffer = MciRead(_nfcDataHandler, cfg, structName, (ushort)offset, length);
_nfcDataHandler.RFProtocolOFF(); // turn off rf antenna due to possible interference
CloseComPort(_nfcDataHandler);
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} ReadRequest : {structName}, {offset}, {length} ; Response= {ByteArrayToHexString(buffer)} ; Error: {_nfcDataHandler.LastErrorMessage}");
if (_nfcDataHandler.LastErrorCode != 0)
{
throw new RfidValidationException(_nfcDataHandler.LastErrorMessage);
}
return Convert.ToInt32(_nfcDataHandler.LastErrorCode); //return 0;
}
catch (RfidValidationException)
{
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
catch (Exception ex)
{
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} ReadRequest Error: {ex.Message}");
buffer = new byte[length];
return 3;
}
}
buffer = new byte[length];
return 3;
}
internal static int WriteRequest(TestMethodCfg cfg, IPerlReader iperlHead, MCI_Protocol.StructName structName, int offset, int length, byte[] buffer)
{
NfcDataHandler _nfcDataHandler = new NfcDataHandler();
MessageEventHandlers(_nfcDataHandler);
CR95HF_MessageEventHandlers(_nfcDataHandler._CR95HF_Reader);
ST25DV_MessageEventHandlers(_nfcDataHandler._ST25DV_Device);
MCI_MessageEventHandlers(_nfcDataHandler._MCI_Protocol);
NFCHeadConfig_MessageEventHandlers(_nfcDataHandler._NFCHead_Config);
try
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} WriteRequest : {structName}, {offset}, {length}, {ByteArrayToHexString(buffer)}");
OpenConnection(_nfcDataHandler, cfg, iperlHead);
MciWrite(_nfcDataHandler, cfg, structName, (ushort)offset, length, buffer);
_nfcDataHandler.RFProtocolOFF(); // turn off rf antenna due to possible interference
CloseComPort(_nfcDataHandler);
return 0;
}
catch (Exception ex)
{
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} WriteRequest Error: {ex.Message}");
return 3;
}
}
private static void OpenConnection(NfcDataHandler nfcDataHandler, TestMethodCfg cfg, IPerlReader iperlHead)
{
string comPort = $"COM{iperlHead.RfidComPortNr}";
int retryCount = 0 ;
Open:
nfcDataHandler.Close();
Thread.Sleep(100);
if (nfcDataHandler.OpenConnection(comPort, cfg.BaudRate, cfg.DataBits, cfg.ParityBit, cfg.StopBits))
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} Port Open");
if (nfcDataHandler.ConnectReader())
{
rfidDataLogger.Info($"NFC COM{iperlHead.RfidComPortNr} Reader connected");
if (!nfcDataHandler.ConnectDevice())
{
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} Error connect device.");
for (int i = 0; i < cfg.MaxCommRetries; i++)
{
if (nfcDataHandler.Echo()) break;
}
}
}
else
{
retryCount++;
rfidDataLogger.Error($"NFC COM{iperlHead.RfidComPortNr} Error connect reader. Reconnect comport {retryCount}");
if (retryCount < cfg.MaxCommRetries)
{
nfcDataHandler.Close();
iperlHead.ResetNfcInterface(); // reset NFC head via optoport - switch to RFID and back to NFC interface
goto Open;
}
}
}
else
rfidDataLogger.Error($"Open NFC COM{iperlHead.RfidComPortNr} Port Failed");
}
private static void CloseComPort(NfcDataHandler nfcDataHandler)
{
nfcDataHandler.Close();
}
private static byte[] MciRead(NfcDataHandler nfcDataHandler, TestMethodCfg cfg, StructName structName, ushort offset, int length)
{
bool isReadValues = false;
int retryCount = 0;
Read:
try
{
isReadValues = false;
long num1 = (long)length;
int timeoutMs = 4000;
byte payloadlength = Convert.ToByte(num1.ToString("X2"), 16);
if (nfcDataHandler.MCI_Read(structName, offset, payloadlength, timeoutMs))
{
byte[] lastData = nfcDataHandler.LastData;
if ((long)lastData.Length >= num1)
{
rfidDataLogger.Info($"COM: MciRead ({structName},{offset},{length}) = {ByteArrayToHexString(lastData)}");
return lastData;
}
else
rfidDataLogger.Info($"COM: MciRead ({structName},{offset},{length}) = {ByteArrayToHexString(lastData)}");
}
else if (nfcDataHandler.LastErrorCode == (byte)0)
{
rfidDataLogger.Info($"MCI Error: Unidentified");
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Read;
}
else
{
rfidDataLogger.Info("Last error message: " + nfcDataHandler.LastErrorMessage);
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Read;
}
}
catch (Exception ex)
{
rfidDataLogger.Error("MciRead Last error message: " + ex.Message);
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Read;
}
return new byte[length];
}
private static void MciWrite(NfcDataHandler nfcDataHandler, TestMethodCfg cfg, MCI_Protocol.StructName structName, ushort offset, int length, byte[] payload)
{
int retryCount = 0;
Write:
try
{
long num1 = (long)length;
int timeoutMs = 4000;
byte payloadlength = Convert.ToByte(num1);
if ((int)payloadlength != payload.Length)
rfidDataLogger.Error("Insufficient Payload -- Payload lenth : " + (object)payload.Length);
else if (nfcDataHandler.MCI_Write(structName, offset, payloadlength, payload, timeoutMs))
{
// OK
}
else if (nfcDataHandler.LastErrorCode > (byte)0)
{
rfidDataLogger.Error("Last error message: " + nfcDataHandler.LastErrorMessage);
//int num2 = (int)MessageBox.Show(this._nfcDataHandler.LastErrorMessage);
}
}
catch (Exception ex)
{
rfidDataLogger.Error("MciWrite error message: " + ex.Message);
retryCount++;
if (retryCount < cfg.MaxCommRetries)
goto Write;
}
}
private static void MciWriteCommand(NfcDataHandler nfcDataHandler, byte commandcode)
{
try
{
ushort offset = 0;
int timeoutMs = 4000;
byte payloadlength = 1;
byte[] payload = new byte[1] { commandcode };
if (nfcDataHandler.MCI_Write(MCI_Protocol.StructName.Command, offset, payloadlength, payload, timeoutMs) || nfcDataHandler.LastErrorCode <= (byte)0)
return;
rfidDataLogger.Error("MciWriteCommand Last error message: " + nfcDataHandler.LastErrorMessage);
}
catch (Exception ex)
{
rfidDataLogger.Error("MciWriteCommand Last error message: " + ex.Message);
}
}
public static string ByteArrayToHexString(byte[] data)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (byte num in data)
stringBuilder.Append(num.ToString("X2"));
return stringBuilder.ToString();
}
private static byte[] BuildPayLoad(string strPayLoad, int length)
{
byte[] collection;
if (strPayLoad.Split(':').Length > 1)
{
uint timestamp = ConvertDateTimeToTimestamp(Convert.ToDateTime(DateTime.ParseExact(strPayLoad, "HH:mm:ss dd/MM/yyyy", (IFormatProvider)CultureInfo.InvariantCulture)));
byte[] bytes = BitConverter.GetBytes(timestamp);
return bytes;
}
else if (strPayLoad.Split(',').Length > 1)
{
string[] strArray = strPayLoad.Split(',');
collection = new byte[strArray.Length];
for (int index3 = 0; index3 < strArray.Length; ++index3)
collection[index3] = Convert.ToByte(strArray[index3], 16);
return collection;
}
else
{
//int num = strPayLoad.Split(',').Length;
collection = HexStringToByteArray(strPayLoad.Substring(strPayLoad.Length - length * 2).ToUpper());
Array.Reverse((Array)collection);
return collection;
}
}
public static byte[] HexStringToByteArray(string hexString)
{
int length = hexString.Length;
byte[] byteArray = new byte[length / 2];
for (int startIndex = 0; startIndex < length; startIndex += 2)
byteArray[startIndex / 2] = Convert.ToByte(hexString.Substring(startIndex, 2), 16);
return byteArray;
}
private static uint ConvertDateTimeToTimestamp(DateTime datetime)
{
TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
return (uint)((datetime - new DateTime(2000, 1, 1, 0, 0, 0).ToLocalTime()).TotalSeconds + utcOffset.TotalSeconds);
}
#region EventHandlers
public static void MCI_MessageEventHandlers(MCI_Protocol e)
{
DelNfc_MCI_MessageHandler mciMessageHandler = new DelNfc_MCI_MessageHandler(OnHandler);
e.MessageEvent += mciMessageHandler;
}
public static void ST25DV_MessageEventHandlers(ST25DV_Device e)
{
DelNfc_ST25DV_MessageHandler dvMessageHandler = new DelNfc_ST25DV_MessageHandler(OnHandler);
e.MessageEvent += dvMessageHandler;
}
public static void CR95HF_MessageEventHandlers(CR95HF_Reader e)
{
DelNfc_CR95HF_MessageHandler hfMessageHandler = new DelNfc_CR95HF_MessageHandler(OnHandler);
e.MessageEvent += hfMessageHandler;
}
public static void NFCHeadConfig_MessageEventHandlers(NFCHeadConfig e)
{
DelNfc_NFCHeadConfig_MessageHandler configMessageHandler = new DelNfc_NFCHeadConfig_MessageHandler(OnHandler);
e.MessageEvent += configMessageHandler;
}
public static void MessageEventHandlers(NfcDataHandler e)
{
DelNfcMessageHandler nfcMessageHandler = new DelNfcMessageHandler(OnHandler);
e.MessageEvent += nfcMessageHandler;
}
public static void OnHandler(object sender, NfcMessageEventArgs e)
{
if (e.Message == null)
return;
string message = e.Message.Replace("\n", " ").Replace("\r", "");
rfidDataLogger.Debug(message);
}
#endregion
}
}
@@ -0,0 +1,128 @@
using System;
using Config.Resources;
using log4net;
using Sensus.iPerl.RfidCom.Helper;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
using static Sensus.iPerl.NfcHandler.MCI_Protocol;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
internal class OpticalHeadTest
{
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
internal static string OpenSealing(IPerlReader iHead)
{
if (RfidCommands.OpenSealing($"COM{iHead.RfidComPortNr}")) return "OK";
return "Error Open Sealing";
}
internal static string ReadRequest_PCB(IPerlReader iHead)
{
try
{
byte[] pcb = null;
int readRetVal = IPerlCorrections.ReadRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, CommonRR.MessageID.Configuration, Sensus.iPerl.NfcHandler.MCI_Protocol.StructName.Configuration, 16, 5, out pcb);
if (readRetVal == 0)
{
return RfidHelper.HexLiteral2Unsigned(RfidHelper.SwapHexcode(BitConverter.ToString(pcb).Replace("-", string.Empty))).ToString();
}
rfidDataLogger.Error($"COM{iHead.RfidComPortNr}: ReadRequest_PCB ({CommonRR.MessageID.Configuration},16,5...) <- Error: {readRetVal}");
return "Error";
}
catch (Exception ex)
{
return (ex.Message.ToString());
}
}
internal static string SetActiveMode(IPerlReader iHead)
{
byte[] cmd = new byte[1] { (byte)CommonRR.Command.SetActiveMode };
if (0 == IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, CommonRR.MessageID.Command, StructName.Command, 0, 1, cmd))
{
return "OK";
}
else
{
return "Error Set Active Mode";
}
}
internal static string SetTestMode(IPerlReader iHead)
{
byte[] cmd = new byte[1] { (byte)CommonRR.Command.SetTestMode };
if (0 == IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, CommonRR.MessageID.Command, StructName.Command, 0, 1, cmd))
{
return "OK";
}
else
{
return "Error Set Test Mode";
}
}
#if IPERL
internal static string TurnOffRadio(IPerlReader iHead)
{
try
{
int retValue = IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.RadioPassthrough, StructName.RadioParams, 0x1898, 1, new byte[] { (byte)3 }); // WakeUpInterval
return 0 == retValue ? "OK" : "Error";
}
catch (Exception ex)
{
return (ex.Message.ToString());
}
}
internal static string SetProductionMode(IPerlReader iHead)
{
try
{
int retValue = IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.RadioPassthrough, StructName.RadioInfo, 0x1804, 1, new byte[] { (byte)1 }); // System Status
return 0 == retValue ? "OK" : "Error";
}
catch (Exception ex)
{
return (ex.Message.ToString());
}
}
internal static string WriteRequestPort_u8_Customer_Text(IPerlReader iHead)
{
string custText = "FF0123456789ABCDEF"; // Sample text to test write function
/*try
{
byte[] cmd = RfidHelper.HexStringToByteArray(custText);
if (0 == iPerlCommunicationForm.WriteRequestPort(iHead, MessageID.RadioPassthrough, Sensus.iPerl.NfcHandler.MCI_Protocol.StructName.RadioParams, 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<string>(Params.u8_Customer_Text).ToString();
}
}
catch (Exception ex)
{
return (ex.Message.ToString());
}*/
return $"Error COM{iHead.RfidComPortNr}";
}
internal static string SetRfidMode(IPerlReader iHead)
{
iHead.SetRfidInterface();
iHead.SetCommunicationInterface(CommunicationInterface.RFID);
return ($"OK - {Strings.Program_restart_is_required_to_apply_some_settings}");
}
internal static string SetNfcMode(IPerlReader iHead)
{
iHead.SetNfcInterface();
iHead.SetCommunicationInterface(CommunicationInterface.NFC);
return ($"OK - {Strings.Program_restart_is_required_to_apply_some_settings}");
}
#endif /// IPERL
}
}
@@ -0,0 +1,18 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
namespace TBF.Rig.RegisterReaders.PoseidonReader.communication
{
public class OptoReceivedEventArgs : EventArgs
{
public string Data;
public OptoReceivedEventArgs(string data)
{
this.Data = data;
}
}
}
@@ -0,0 +1,126 @@
using System;
using System.Text.RegularExpressions;
using System.Threading;
using log4net;
using Sensus.iPerl.RfidCom;
using Sensus.iPerl.RfidCom.Exceptions;
using Sensus.iPerl.RfidCom.Helper;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.RegisterReaders.PoseidonReader.comminication
{
internal class RfidServices
{
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
private static readonly ILog log = LogManager.GetLogger(typeof(SmartCommunicationForm));
internal static int ReadRequest(TestMethodCfg cfg, IPerlReader iperlHead, MessageID messageID, int offset, int length, out byte[] buffer)
{
for (int i = 0; i < cfg.MaxCommRetries; i++)
{
rfidDataLogger.Error($"{iperlHead.CommInterface} Start {i} reading: COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},{offset}, {length}... timeout {cfg.CommTimeout})");
using (RfidLogic writer = new RfidLogic($"COM{iperlHead.RfidComPortNr}"))
{
try
{
byte[] response = writer.ReadRequest((byte)messageID, offset, length, cfg.CommTimeout);
string hexString = RfidHelper.ConvertByteArrayToHexString(response);
string swapHexString = RfidHelper.SwapHexcode(hexString);
string decString = RfidHelper.HexLiteral2Unsigned(RfidHelper.SwapHexcode(hexString)).ToString();
if (length > 10)
{
//if the result only contains "00"s we are working on the wrong COM port
// or the module just isn't connected
if (Regex.IsMatch(hexString, @"^(00)\1+$"))
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) <- Error: No RFID signal.");
throw new RfidValidationException("Error_Rfid_NoSignal");
}
//if the result only contains "03"s the meter did not answer.
// Might be due to the module being positioned incorrectly.
if (Regex.IsMatch(hexString, @"^(03)\1+$"))
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) <- Error: No meter signal.");
throw new RfidValidationException("Error_Rfid_NoAnswerFromMeter");
}
}
writer.ClosePort();
buffer = response;
rfidDataLogger.Info($"{iperlHead.Name} ({iperlHead.SerialNr}): ReadRequestPort(COM{iperlHead.RfidComPortNr},...) returned HEX: {hexString}; SwapHexCodeToDecimal: {decString}");
return 0;
}
catch (RfidDataNotAvailableException)
{
if (/*RfidHelper.IsPassThrough(messageID)*/ messageID == MessageID.ASICRegisterReadTest || messageID == MessageID.RadioPassthrough)
{
rfidDataLogger.Info($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) {(i > 0 ? "<- Error: Invalid Pass-Through data." : "<- Info: Wait for Pass-Through data.")}");
Thread.Sleep(cfg.PassThroughWaitTime);
}
else
{
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
}
catch (RfidValidationException)
{
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
catch (Exception ex)
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...) {ex.Message}");
Thread.Sleep(cfg.WaitTimeAfterFailure);
}
}
}
rfidDataLogger.Error($"{iperlHead.CommInterface} reading failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...)");
log.Error($"{iperlHead.CommInterface} reading failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: ReadRequestPort ({messageID},...)");
buffer = new byte[length];
return 3;
}
internal static int WriteRequest(TestMethodCfg cfg, IPerlReader iperlHead, MessageID messageID, int offset, int length, byte[] buffer)
{
RfidLogic writer = new RfidLogic($"COM{iperlHead.RfidComPortNr}");
string payload = RfidHelper.ConvertByteArrayToHexString(buffer);
for (var i = 0; i < cfg.MaxCommRetries; i++)
{
rfidDataLogger.Error($"{iperlHead.CommInterface} Start {i} writting: COM{iperlHead.RfidComPortNr}: WriteRequest ({messageID},{offset}, {length}, {payload}... timeout {cfg.CommTimeout})");
try
{
if (writer.ClosePort()) writer.OpenPort();
writer.WriteRequest((byte)messageID, offset, length, buffer, cfg.CommTimeout, false);
writer.ClosePort();
rfidDataLogger.InfoFormat($"{iperlHead.Name}({iperlHead.SerialNr},COM{iperlHead.RfidComPortNr}): WriteRequestPort({messageID}, {offset}, {length}, {payload})");
return 0;
}
catch (Exception ex)
{
if (messageID == MessageID.RadioPassthrough || messageID == MessageID.ASICRegisterReadTest)
{
Thread.Sleep(1500);
}
else
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: Error: {ex.Message}");
Thread.Sleep(cfg.WaitTimeAfterFailure);
if (i > 1)
{
rfidDataLogger.Error($"COM{iperlHead.RfidComPortNr}: Reopen the com port.");
writer.ClosePort();
}
}
}
}
writer.ClosePort();
rfidDataLogger.Error($"RFID writing failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: WriteRequestPort ({messageID},...) {System.Text.Encoding.UTF8.GetString(buffer)}");
log.Error($"RFID writing failed after {cfg.MaxCommRetries} retries: COM{iperlHead.RfidComPortNr}: WriteRequestPort ({messageID},...) {System.Text.Encoding.UTF8.GetString(buffer)}");
return 2;
}
}
}
@@ -0,0 +1,65 @@
using System;
using System.Linq;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.RegisterReaders.CommonRR.IPerl.communication;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.RegisterReaders.PoseidonReader.comminication
{
internal class SimulationServices
{
const int Q2CorrFactorsAddr = iPerlCommunicationConstants.Q2CorrFactorsAddr;
internal static int ReadRequest(IPerlReader iperlHead, MessageID messageID, int offset, int length, out byte[] buffer)
{
byte[] configurationBuffer = new byte[ConfigStruct.Length] { 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] calibrationBuffer = new byte[CalibrationStructV4.Length] { 3, 0, 150, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 150, 10 };
buffer = new byte[length];
if (messageID == MessageID.Configuration)
{
Array.Copy(GetPCB(iperlHead), 0, configurationBuffer, 16, 5); // set PCB Number according to iPerlHead configuration
Array.Copy(configurationBuffer,offset,buffer,0,length);
}
else if (messageID == MessageID.Calibration)
{
Array.Copy(calibrationBuffer, offset, buffer, 0, length);
}
else if ((messageID == MessageID.MetrologyMemory) && (offset == Q2CorrFactorsAddr) && (length == 2))
{
buffer = new byte[2] { 0, 0 };
}
else
{
buffer = new byte[length];
}
return iperlHead.Name.Equals("iPerl13") ? 2 : 0; /// Simulates an error on position 13
}
internal static int WriteRequest(TestMethodCfg cfg, IPerlReader iperlHead, MessageID messageID, int offset,
int length, byte[] buffer)
{
return 0;
}
private static Array GetPCB(IPerlReader iperlHead)
{
string pcbStr = iperlHead.RfidComPortNr.ToString().PadRight(10,'0') + iperlHead.Position.ToString("D2");
long decVal = Convert.ToInt64(pcbStr);
string nHexStr = decVal.ToString("X4");
string hexStr = "";
for (int a = nHexStr.Length; a >= 1; a = a - 2)
{
hexStr = hexStr + nHexStr.Substring(a - 2, 2);
}
return Enumerable.Range(0, hexStr.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(hexStr.Substring(x, 2), 16))
.ToArray();
}
}
}
@@ -0,0 +1,23 @@
using TBF.Rig.Generic;
using System.Collections.Generic;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
public class Factory: IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new IPerlReader(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new IPerlReader(cfg); }
public IComponentCfg DefaultConfig() { return new IPerlCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(IPerlCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,70 @@
using System.Collections.Generic;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.CommonRR;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
public class IPerlCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(IPerlCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Component> cmpntEntities)
{
return new RegisterReaders.iPerlReaderUNI.IPerlUniCfgCtrl();
}
///
/// Serialized parameters
///
public bool UseTcpIP;
public string OptoIPAddress;
public ushort OptoTcpipPortNr;
public int HeadCommunicationComPortNr;
public int OptoComPortNr;
public int RfidComPortNr; /// 0 = use MuxBoardNr
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4
public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort, 1 .. 10
public CommunicationInterface CommunicationInterface; /// Communication Interface: RFID or NFC
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcParams ProcParams;
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
[XmlIgnore]
public MeterType MeterType { get { return (ProcParams != null) ? ProcParams.MeterType : MeterType.AutoDetect; } }
/// Private parameterless constructor invoked by all other (public) constructors
IPerlCfg()
{
Name = "iPerl";
ParentName = string.Empty;
OptoComPortNr = 10;
RfidComPortNr = 0; /// = use mux. board
MuxBoardNr = 1;
ProcParams = CreateProcParamsProvider() as ProcParams;
CommunicationInterface = CommunicationInterface.RFID;
HeadCommunicationComPortNr = 0;
}
public IPerlCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return $"{Name} Group1 (mux#)={MuxBoardNr}, Group2={Group}, Opto=Com{OptoComPortNr}, {CommunicationInterface}=Com{RfidComPortNr}";
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,163 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
using System.Net;
using System.Windows.Forms;
using Common;
using TBF.Rig.Generic;
using TBF.Resources;
using TBF.Rig.RegisterReaders.CommonRR;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
public partial class IPerlUniCfgCtrl : UserControl, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
IPerlCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as IPerlCfg;
Redraw();
}
}
public IPerlUniCfgCtrl()
{
InitializeComponent();
}
private void WaterMeterCfgCtrl_Load(object sender, EventArgs e)
{
nameLabel.Text = Strings.Name;
classNameLabel.Text = config.Factory.ClassName;
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
nameTextBox.Text = config.Name;
radioButton1.Checked = config.UseTcpIP;
radioButton2.Checked = !config.UseTcpIP;
ipAddressTextBox.Text = (config.OptoIPAddress != null) ? config.OptoIPAddress : "0.0.0.0";
tcpipPortTextBox.Text = config.OptoTcpipPortNr.ToString();
headPortNrTextBox.Text = config.HeadCommunicationComPortNr.ToString();
optoSerialPortTextBox.Text = config.OptoComPortNr.ToString();
rfidPortNrTextBox.Text = config.RfidComPortNr.ToString();
muxBoardNrTextBox.Text = config.MuxBoardNr.ToString();
groupTextBox.Text = config.Group.ToString();
comboBoxCommunicationInterface.SelectedItem = config.CommunicationInterface.ToString();
tabPage2.Controls.Add(new IperlUniHeadTestCtrl(config));
}
public void Unlock()
{
nameTextBox.Enabled = true;
radioButton1.Enabled = true;
radioButton2.Enabled = true;
ipAddressTextBox.Enabled = true;
tcpipPortTextBox.Enabled = true;
optoSerialPortTextBox.Enabled = true;
rfidPortNrTextBox.Enabled = true;
headPortNrTextBox.Enabled = true;
muxBoardNrTextBox.Enabled = true;
groupTextBox.Enabled = true;
comboBoxCommunicationInterface.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
if (radioButton1.Checked)
{
IPAddress dummyIPAddress;
if (!IPAddress.TryParse(ipAddressTextBox.Text, out dummyIPAddress))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'IP address' is not valid";
}
ushort sdummy;
if (!ushort.TryParse(tcpipPortTextBox.Text, out sdummy))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'TCP/IP port nr.' is not valid";
}
}
else
{
if (!int.TryParse(optoSerialPortTextBox.Text, out dummy) || dummy < 1 || dummy > 999)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Opto serial port nr.' is not valid";
}
}
if (!int.TryParse(rfidPortNrTextBox.Text, out dummy) || dummy < 0 || dummy > 999)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'RFID serial port nr.' is not valid";
}
if (!int.TryParse(headPortNrTextBox.Text, out dummy) || dummy < 0 || dummy > 999)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Head communication serial port nr.' is not valid";
}
if (!int.TryParse(muxBoardNrTextBox.Text, out dummy) || dummy < 1 || dummy > 4)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, muxBoardNrLabel.Text);
}
if (!int.TryParse(groupTextBox.Text, out dummy) || dummy < 1 || dummy > 10)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, groupLabel.Text);
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
config.Name = nameTextBox.Text;
if (radioButton1.Checked)
{
config.UseTcpIP = true;
config.OptoIPAddress = ipAddressTextBox.Text;
config.OptoTcpipPortNr = ushort.Parse(tcpipPortTextBox.Text);
}
else
{
config.UseTcpIP = false;
config.OptoComPortNr = int.Parse(optoSerialPortTextBox.Text);
}
config.RfidComPortNr = int.Parse(rfidPortNrTextBox.Text);
config.MuxBoardNr = int.Parse(muxBoardNrTextBox.Text);
config.Group = int.Parse(groupTextBox.Text);
config.CommunicationInterface = (CommunicationInterface)comboBoxCommunicationInterface.SelectedIndex;
config.HeadCommunicationComPortNr = int.Parse(headPortNrTextBox.Text);
return flags;
}
}
}
@@ -0,0 +1,441 @@
///
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
partial class IPerlUniCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.comboBoxCommunicationInterface = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.rfidPortNrTextBox = new System.Windows.Forms.TextBox();
this.rfidSerialPortNrLabel = new System.Windows.Forms.Label();
this.optoDataGroupBox = new System.Windows.Forms.GroupBox();
this.tcpipPortLabel = new System.Windows.Forms.Label();
this.tcpipPortTextBox = new System.Windows.Forms.TextBox();
this.ipAddressLabel = new System.Windows.Forms.Label();
this.ipAddressTextBox = new System.Windows.Forms.TextBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.optoSerialPortLabel = new System.Windows.Forms.Label();
this.optoSerialPortTextBox = new System.Windows.Forms.TextBox();
this.groupTextBox = new System.Windows.Forms.TextBox();
this.groupLabel = new System.Windows.Forms.Label();
this.muxBoardNrTextBox = new System.Windows.Forms.TextBox();
this.muxBoardNrLabel = new System.Windows.Forms.Label();
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.headPortNrTextBox = new System.Windows.Forms.TextBox();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.optoDataGroupBox.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(3, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(611, 432);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.label4);
this.tabPage1.Controls.Add(this.label3);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Controls.Add(this.optoDataGroupBox);
this.tabPage1.Controls.Add(this.groupTextBox);
this.tabPage1.Controls.Add(this.groupLabel);
this.tabPage1.Controls.Add(this.muxBoardNrTextBox);
this.tabPage1.Controls.Add(this.muxBoardNrLabel);
this.tabPage1.Controls.Add(this.nameTextBox);
this.tabPage1.Controls.Add(this.nameLabel);
this.tabPage1.Controls.Add(this.classNameLabel);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(603, 403);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Config";
this.tabPage1.UseVisualStyleBackColor = true;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(208, 101);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 16);
this.label4.TabIndex = 25;
this.label4.Text = "1 .. 10";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(208, 72);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(33, 16);
this.label3.TabIndex = 24;
this.label3.Text = "1 .. 4";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.comboBoxCommunicationInterface);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.rfidPortNrTextBox);
this.groupBox1.Controls.Add(this.rfidSerialPortNrLabel);
this.groupBox1.Location = new System.Drawing.Point(10, 259);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(552, 68);
this.groupBox1.TabIndex = 23;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "RFID / NFC communication (in case mux. board is not used)";
//
// comboBoxCommunicationInterface
//
this.comboBoxCommunicationInterface.Enabled = false;
this.comboBoxCommunicationInterface.FormattingEnabled = true;
this.comboBoxCommunicationInterface.Items.AddRange(new object[] {
"RFID",
"NFC"});
this.comboBoxCommunicationInterface.Location = new System.Drawing.Point(201, 27);
this.comboBoxCommunicationInterface.Name = "comboBoxCommunicationInterface";
this.comboBoxCommunicationInterface.Size = new System.Drawing.Size(71, 24);
this.comboBoxCommunicationInterface.TabIndex = 9;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(41, 30);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(153, 16);
this.label1.TabIndex = 8;
this.label1.Text = "Communication Interface";
//
// rfidPortNrTextBox
//
this.rfidPortNrTextBox.Enabled = false;
this.rfidPortNrTextBox.Location = new System.Drawing.Point(439, 26);
this.rfidPortNrTextBox.Margin = new System.Windows.Forms.Padding(4);
this.rfidPortNrTextBox.Name = "rfidPortNrTextBox";
this.rfidPortNrTextBox.Size = new System.Drawing.Size(44, 22);
this.rfidPortNrTextBox.TabIndex = 7;
//
// rfidSerialPortNrLabel
//
this.rfidSerialPortNrLabel.AutoSize = true;
this.rfidSerialPortNrLabel.Location = new System.Drawing.Point(321, 30);
this.rfidSerialPortNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.rfidSerialPortNrLabel.Name = "rfidSerialPortNrLabel";
this.rfidSerialPortNrLabel.Size = new System.Drawing.Size(88, 16);
this.rfidSerialPortNrLabel.TabIndex = 6;
this.rfidSerialPortNrLabel.Text = "Serial port nr.:";
//
// optoDataGroupBox
//
this.optoDataGroupBox.Controls.Add(this.tcpipPortLabel);
this.optoDataGroupBox.Controls.Add(this.tcpipPortTextBox);
this.optoDataGroupBox.Controls.Add(this.ipAddressLabel);
this.optoDataGroupBox.Controls.Add(this.ipAddressTextBox);
this.optoDataGroupBox.Controls.Add(this.radioButton1);
this.optoDataGroupBox.Controls.Add(this.radioButton2);
this.optoDataGroupBox.Controls.Add(this.optoSerialPortLabel);
this.optoDataGroupBox.Controls.Add(this.optoSerialPortTextBox);
this.optoDataGroupBox.Location = new System.Drawing.Point(10, 131);
this.optoDataGroupBox.Margin = new System.Windows.Forms.Padding(4);
this.optoDataGroupBox.Name = "optoDataGroupBox";
this.optoDataGroupBox.Padding = new System.Windows.Forms.Padding(4);
this.optoDataGroupBox.Size = new System.Drawing.Size(552, 119);
this.optoDataGroupBox.TabIndex = 18;
this.optoDataGroupBox.TabStop = false;
this.optoDataGroupBox.Text = "Opto-data";
//
// tcpipPortLabel
//
this.tcpipPortLabel.AutoSize = true;
this.tcpipPortLabel.Location = new System.Drawing.Point(41, 87);
this.tcpipPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.tcpipPortLabel.Name = "tcpipPortLabel";
this.tcpipPortLabel.Size = new System.Drawing.Size(54, 16);
this.tcpipPortLabel.TabIndex = 4;
this.tcpipPortLabel.Text = "Port nr..:";
//
// tcpipPortTextBox
//
this.tcpipPortTextBox.Enabled = false;
this.tcpipPortTextBox.Location = new System.Drawing.Point(143, 84);
this.tcpipPortTextBox.Margin = new System.Windows.Forms.Padding(4);
this.tcpipPortTextBox.Name = "tcpipPortTextBox";
this.tcpipPortTextBox.Size = new System.Drawing.Size(51, 22);
this.tcpipPortTextBox.TabIndex = 5;
//
// ipAddressLabel
//
this.ipAddressLabel.AutoSize = true;
this.ipAddressLabel.Location = new System.Drawing.Point(41, 59);
this.ipAddressLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.ipAddressLabel.Name = "ipAddressLabel";
this.ipAddressLabel.Size = new System.Drawing.Size(78, 16);
this.ipAddressLabel.TabIndex = 2;
this.ipAddressLabel.Text = "IP address.:";
//
// ipAddressTextBox
//
this.ipAddressTextBox.Enabled = false;
this.ipAddressTextBox.Location = new System.Drawing.Point(143, 55);
this.ipAddressTextBox.Margin = new System.Windows.Forms.Padding(4);
this.ipAddressTextBox.Name = "ipAddressTextBox";
this.ipAddressTextBox.Size = new System.Drawing.Size(129, 22);
this.ipAddressTextBox.TabIndex = 3;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Enabled = false;
this.radioButton1.Location = new System.Drawing.Point(29, 23);
this.radioButton1.Margin = new System.Windows.Forms.Padding(4);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(99, 20);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Use TCP/IP";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Enabled = false;
this.radioButton2.Location = new System.Drawing.Point(312, 23);
this.radioButton2.Margin = new System.Windows.Forms.Padding(4);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(115, 20);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = "Use serial port";
this.radioButton2.UseVisualStyleBackColor = true;
//
// optoSerialPortLabel
//
this.optoSerialPortLabel.AutoSize = true;
this.optoSerialPortLabel.Location = new System.Drawing.Point(321, 55);
this.optoSerialPortLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.optoSerialPortLabel.Name = "optoSerialPortLabel";
this.optoSerialPortLabel.Size = new System.Drawing.Size(88, 16);
this.optoSerialPortLabel.TabIndex = 6;
this.optoSerialPortLabel.Text = "Serial port nr.:";
//
// optoSerialPortTextBox
//
this.optoSerialPortTextBox.Enabled = false;
this.optoSerialPortTextBox.Location = new System.Drawing.Point(439, 52);
this.optoSerialPortTextBox.Margin = new System.Windows.Forms.Padding(4);
this.optoSerialPortTextBox.Name = "optoSerialPortTextBox";
this.optoSerialPortTextBox.Size = new System.Drawing.Size(44, 22);
this.optoSerialPortTextBox.TabIndex = 7;
//
// groupTextBox
//
this.groupTextBox.Enabled = false;
this.groupTextBox.Location = new System.Drawing.Point(153, 97);
this.groupTextBox.Margin = new System.Windows.Forms.Padding(4);
this.groupTextBox.Name = "groupTextBox";
this.groupTextBox.Size = new System.Drawing.Size(44, 22);
this.groupTextBox.TabIndex = 22;
//
// groupLabel
//
this.groupLabel.AutoSize = true;
this.groupLabel.Location = new System.Drawing.Point(6, 101);
this.groupLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.groupLabel.Name = "groupLabel";
this.groupLabel.Size = new System.Drawing.Size(54, 16);
this.groupLabel.TabIndex = 21;
this.groupLabel.Text = "Group 2";
//
// muxBoardNrTextBox
//
this.muxBoardNrTextBox.Enabled = false;
this.muxBoardNrTextBox.Location = new System.Drawing.Point(153, 69);
this.muxBoardNrTextBox.Margin = new System.Windows.Forms.Padding(4);
this.muxBoardNrTextBox.Name = "muxBoardNrTextBox";
this.muxBoardNrTextBox.Size = new System.Drawing.Size(44, 22);
this.muxBoardNrTextBox.TabIndex = 20;
//
// muxBoardNrLabel
//
this.muxBoardNrLabel.AutoSize = true;
this.muxBoardNrLabel.Location = new System.Drawing.Point(6, 72);
this.muxBoardNrLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.muxBoardNrLabel.Name = "muxBoardNrLabel";
this.muxBoardNrLabel.Size = new System.Drawing.Size(131, 16);
this.muxBoardNrLabel.TabIndex = 19;
this.muxBoardNrLabel.Text = "Group 1 (mux. board)";
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(153, 40);
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(160, 22);
this.nameTextBox.TabIndex = 17;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(6, 44);
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(44, 16);
this.nameLabel.TabIndex = 16;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(149, 11);
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(78, 16);
this.classNameLabel.TabIndex = 15;
this.classNameLabel.Text = "ClassName";
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(603, 403);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Test";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.headPortNrTextBox);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Location = new System.Drawing.Point(10, 335);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(552, 50);
this.groupBox2.TabIndex = 26;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Head Communication";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(321, 18);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 16);
this.label2.TabIndex = 7;
this.label2.Text = "Serial port nr.:";
//
// headPortNrTextBox
//
this.headPortNrTextBox.Enabled = false;
this.headPortNrTextBox.Location = new System.Drawing.Point(439, 15);
this.headPortNrTextBox.Margin = new System.Windows.Forms.Padding(4);
this.headPortNrTextBox.Name = "headPortNrTextBox";
this.headPortNrTextBox.Size = new System.Drawing.Size(44, 22);
this.headPortNrTextBox.TabIndex = 8;
//
// IperlHeadCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tabControl1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "IPerlUniCfgCtrl";
this.Size = new System.Drawing.Size(617, 438);
this.Load += new System.EventHandler(this.WaterMeterCfgCtrl_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.optoDataGroupBox.ResumeLayout(false);
this.optoDataGroupBox.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox comboBoxCommunicationInterface;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox rfidPortNrTextBox;
private System.Windows.Forms.Label rfidSerialPortNrLabel;
private System.Windows.Forms.GroupBox optoDataGroupBox;
private System.Windows.Forms.Label tcpipPortLabel;
private System.Windows.Forms.TextBox tcpipPortTextBox;
private System.Windows.Forms.Label ipAddressLabel;
private System.Windows.Forms.TextBox ipAddressTextBox;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Label optoSerialPortLabel;
private System.Windows.Forms.TextBox optoSerialPortTextBox;
private System.Windows.Forms.TextBox groupTextBox;
private System.Windows.Forms.Label groupLabel;
private System.Windows.Forms.TextBox muxBoardNrTextBox;
private System.Windows.Forms.Label muxBoardNrLabel;
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox headPortNrTextBox;
private System.Windows.Forms.Label label2;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,137 @@
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
partial class IperlUniHeadTestCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.optoTestGroupBox = new System.Windows.Forms.GroupBox();
this.optoListBox = new System.Windows.Forms.ListBox();
this.rfidOutputListBox = new System.Windows.Forms.ListBox();
this.RfidTestGroupBox = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.rfidCommandComboBox = new System.Windows.Forms.ComboBox();
this.commandTestButton = new System.Windows.Forms.Button();
this.optoTestGroupBox.SuspendLayout();
this.RfidTestGroupBox.SuspendLayout();
this.SuspendLayout();
//
// optoTestGroupBox
//
this.optoTestGroupBox.Controls.Add(this.optoListBox);
this.optoTestGroupBox.Location = new System.Drawing.Point(5, 4);
this.optoTestGroupBox.Name = "optoTestGroupBox";
this.optoTestGroupBox.Size = new System.Drawing.Size(591, 161);
this.optoTestGroupBox.TabIndex = 2;
this.optoTestGroupBox.TabStop = false;
this.optoTestGroupBox.Text = "Opto-data";
//
// optoListBox
//
this.optoListBox.FormattingEnabled = true;
this.optoListBox.ItemHeight = 16;
this.optoListBox.Location = new System.Drawing.Point(7, 22);
this.optoListBox.Name = "optoListBox";
this.optoListBox.Size = new System.Drawing.Size(573, 132);
this.optoListBox.TabIndex = 0;
//
// rfidOutputListBox
//
this.rfidOutputListBox.FormattingEnabled = true;
this.rfidOutputListBox.ItemHeight = 16;
this.rfidOutputListBox.Location = new System.Drawing.Point(5, 54);
this.rfidOutputListBox.Name = "rfidOutputListBox";
this.rfidOutputListBox.SelectionMode = System.Windows.Forms.SelectionMode.None;
this.rfidOutputListBox.Size = new System.Drawing.Size(575, 164);
this.rfidOutputListBox.TabIndex = 3;
//
// RfidTestGroupBox
//
this.RfidTestGroupBox.Controls.Add(this.rfidOutputListBox);
this.RfidTestGroupBox.Controls.Add(this.label2);
this.RfidTestGroupBox.Controls.Add(this.rfidCommandComboBox);
this.RfidTestGroupBox.Controls.Add(this.commandTestButton);
this.RfidTestGroupBox.Location = new System.Drawing.Point(5, 171);
this.RfidTestGroupBox.Name = "RfidTestGroupBox";
this.RfidTestGroupBox.Size = new System.Drawing.Size(591, 224);
this.RfidTestGroupBox.TabIndex = 3;
this.RfidTestGroupBox.TabStop = false;
this.RfidTestGroupBox.Text = "RFID / NFC data";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(2, 25);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 16);
this.label2.TabIndex = 2;
this.label2.Text = "Command";
//
// rfidCommandComboBox
//
this.rfidCommandComboBox.FormattingEnabled = true;
this.rfidCommandComboBox.Location = new System.Drawing.Point(86, 19);
this.rfidCommandComboBox.Name = "rfidCommandComboBox";
this.rfidCommandComboBox.Size = new System.Drawing.Size(341, 24);
this.rfidCommandComboBox.TabIndex = 1;
//
// commandTestButton
//
this.commandTestButton.Location = new System.Drawing.Point(449, 19);
this.commandTestButton.Name = "commandTestButton";
this.commandTestButton.Size = new System.Drawing.Size(126, 24);
this.commandTestButton.TabIndex = 0;
this.commandTestButton.Text = "Send command";
this.commandTestButton.UseVisualStyleBackColor = true;
this.commandTestButton.MouseClick += new System.Windows.Forms.MouseEventHandler(this.CommandTestButtonClick);
//
// IperlHeadTestCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.optoTestGroupBox);
this.Controls.Add(this.RfidTestGroupBox);
this.Name = "IperlUniHeadTestCtrl";
this.Size = new System.Drawing.Size(611, 432);
this.Load += new System.EventHandler(this.UserControl_Load);
this.optoTestGroupBox.ResumeLayout(false);
this.RfidTestGroupBox.ResumeLayout(false);
this.RfidTestGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox optoTestGroupBox;
private System.Windows.Forms.ListBox rfidOutputListBox;
private System.Windows.Forms.GroupBox RfidTestGroupBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox rfidCommandComboBox;
private System.Windows.Forms.Button commandTestButton;
private System.Windows.Forms.ListBox optoListBox;
}
}
@@ -0,0 +1,193 @@
using System;
using System.Threading;
using System.Web.UI.WebControls;
using System.Windows.Forms;
using TBF.Rig.RegisterReaders.CommonRR.IPerl.communication;
using TBF.Rig.RegisterReaders.iPerlReaderUNI.test;
using TBF.Rig.Sequences;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
public partial class IperlUniHeadTestCtrl : UserControl
{
IPerlCfg config;
IntIPerlReader _iPerlReader;
Thread optoThread;
private bool stopWorkerThread;
public event EventHandler<OptoReceivedEventArgs> OptoReceivedHandler;
public IperlUniHeadTestCtrl(IPerlCfg config)
{
this.config = config;
InitializeComponent();
if (config == null) return;
//TODO fix possibility set test method in config
//iPerlCommunicationForm.cfg = new TestMethodCfg(null); // default values for iPerlCommunication
foreach(var head in ProcessData.IperlHeadsUni)
{
if (head != null && head.Name == config.Name) { _iPerlReader = head; }
}
rfidCommandComboBox.DisplayMember = "Name";
rfidCommandComboBox.ValueMember = "Value";
var items = new[]
{
new {Name = "Read PCB", Value = "ReadPCB" },
new {Name = "Set Test Mode", Value = "SetTestMode" },
new {Name = "Set Active Mode", Value = "SetActiveMode" },
#if DEBUG
new {Name = "Start Read Opto Data", Value = "ReadOptoData" },
new {Name = "Stop Read Opto Data", Value = "StopReadOptoData" },
#endif
new {Name = " ", Value = "" },
new {Name = "Reset NFC Head", Value = "ResetNfcHead" },
new {Name = "Set NFC Head Interface", Value = "SetNfcHead" },
new {Name = "Set RFID Head interface", Value = "SetRfidHead" }
};
/*
// CTRL+ALT+double click - hidden poweruser menu
if (((Keyboard.ModifierKeys & Keys.Control) == Keys.Control) && ((Keyboard.ModifierKeys & Keys.Alt) == Keys.Alt) && Users.CurrentUser.AuthorizedAs == AuthorizedAs.PowerUser)
{
Array.Resize(ref items, items.Length + 1);
items[items.Length - 1] = new { Name = "Kluc", Value = "Kluc" };
}
*/
rfidCommandComboBox.DataSource = items;
stopWorkerThread = false;
OptoReceivedHandler += (EventHandler<OptoReceivedEventArgs>)((sndr, args) =>
{
if (this.InvokeRequired)
this.Invoke((Delegate)new EventHandler<OptoReceivedEventArgs>(this.OnOptoReceived2), sndr, (object)args);
else
this.OnOptoReceived2(sndr, args);
});
}
public void OnOptoReceived2(object sender, OptoReceivedEventArgs args)
{
optoListBox.Items.Insert(0,args.Data);
}
private void CommandTestButtonClick(object sender, MouseEventArgs e)
{
rfidOutputListBox.Items.Clear();
using (Tools.LogChecker logChecker = new Tools.LogChecker("RfidData", log4net.Core.Level.Debug))
{
ListItem rfidListItem = new ListItem();
rfidListItem.Attributes.Add("style", "font-weight:bold");
switch (rfidCommandComboBox.SelectedValue)
{
case "ReadPCB":
rfidListItem.Text = $"PCB: {OpticalHeadTest.ReadRequest_PCB(_iPerlReader)}";
break;
case "SetTestMode":
rfidListItem.Text = OpticalHeadTest.SetTestMode(_iPerlReader);
optoListBox.Items.Clear();
stopWorkerThread = false;
optoThread = new Thread(OptoWorker);
if (!optoThread.IsAlive)
{
_iPerlReader.StartDataStreamProcessing(); // open opto port
optoThread.Start();
}
break;
case "SetActiveMode":
rfidListItem.Text = OpticalHeadTest.SetActiveMode(_iPerlReader);
stopWorkerThread = true;
_iPerlReader.StopDataStreamProcessing(); // close opto port
break;
case "ResetNfcHead":
_iPerlReader.ResetNfcInterface();
break;
case "SetNfcHead":
_iPerlReader.SetNfcInterface();
break;
case "SetRfidHead":
_iPerlReader.SetRfidInterface();
break;
case "ReadOptoData":
optoListBox.Items.Clear();
stopWorkerThread = false;
optoThread = new Thread(OptoWorker);
if (optoThread.IsAlive)
{
stopWorkerThread = true;
_iPerlReader.StopDataStreamProcessing(); // close opto port
}
if (!optoThread.IsAlive)
{
_iPerlReader.StartDataStreamProcessing(); // open opto port
optoThread.Start();
}
break;
case "StopReadOptoData":
stopWorkerThread = true;
_iPerlReader.StopDataStreamProcessing(); // close opto port
break;
}
rfidOutputListBox.Items.Add(rfidListItem);
rfidOutputListBox.Items.AddRange(logChecker.Messages.ToArray());
}
}
private void OptoWorker()
{
while (!this.stopWorkerThread)
{
Thread.Sleep(250);
if (this.stopWorkerThread)
break;
try
{
string buffer = _iPerlReader.ReadOptoData();
if (string.IsNullOrEmpty(buffer))
{
this.OnOptoReceived((object)this, new OptoReceivedEventArgs("."));
}
else
OnOptoReceived((object)this, new OptoReceivedEventArgs(buffer));
}
catch (Exception ex)
{
this.OnOptoReceived((object)this, new OptoReceivedEventArgs(ex.Message));
}
}
}
public void OnOptoReceived(object sender, OptoReceivedEventArgs args)
{
if (this.OptoReceivedHandler == null)
return;
try
{
this.OptoReceivedHandler(sender, args);
}
catch (Exception ex)
{
}
}
private void UserControl_Load(object sender, EventArgs e)
{
this.ParentForm.FormClosing += new FormClosingEventHandler(ParentForm_FormClosing);
}
void ParentForm_FormClosing(object sender, FormClosingEventArgs e)
{
//OnHandleDestroyed(new EventArgs());
stopWorkerThread = true;
if (optoThread != null)
{
optoThread.Abort();
}
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,184 @@
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.CommonRR;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public int WMType_ID;
public MeterType MeterType;
public float CalibTarget; /// Target error after calibration in [%]
public int FactorLimitLo; /// Lower limit for the calibration factor
public int FactorLimitHi; /// Upper limit for the calibration factor
public Counting Counting; /// Initial iPerl counting (Artbitrary, Positive or Negative)
public override void InitializeAll()
{
MeterType = MeterType.AutoDetect;
CalibTarget = 0;
FactorLimitLo = 1000;
FactorLimitHi = 8000;
Counting = Counting.Arbitrary;
}
string[] paramNames = new string[]
{
"iPerl type",
"Calib. target [%]",
"Calib. factor Lo",
"Calib. factor Hi",
"Counting",
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override ICollection<string> ParamValues(int i)
{
if (i == 0)
{
var retVal = new List<string>();
for (MeterType mt = 0; mt < MeterType.Count; mt++) retVal.Add(mt.ToString());
return retVal;
}
else if (i == 5)
{
var retVal = new List<string>();
for (Counting c = 0; c < Counting.Count; c++) retVal.Add(c.ToString());
return retVal;
}
return null;
}
public override string ToString(int i)
{
switch (i)
{
case 0: return MeterType.ToString();
case 1: return CalibTarget.ToString();
case 2: return FactorLimitLo.ToString();
case 3: return FactorLimitHi.ToString();
case 4: return Counting.ToString();
default: return string.Empty;
}
}
//implement IParamsProvider
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int iDummy;
float fDummy;
switch (i)
{
case 0:
for (MeterType mt = 0; mt < MeterType.Count; mt++) if (mt.ToString().Equals(strValue)) return true;
break;
case 1:
if (Utils.TryParseSFloat(strValue, out fDummy) && fDummy >= -10.0f && fDummy <= 10.0f) return true;
break;
case 2:
case 3:
if (int.TryParse(strValue, out iDummy) && iDummy >= 1000 && iDummy <= 8000) return true;
break;
case 4:
for (Counting c = 0; c < Counting.Count; c++) if (c.ToString().Equals(strValue)) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
for (MeterType mt = 0; mt < MeterType.Count; mt++)
{
if (mt.ToString().Equals(strValue)) { MeterType = mt; return CfgUpdateFlags.None; }
}
break;
case 1: CalibTarget = Utils.ParseSFloat(strValue); return CfgUpdateFlags.None;
case 2: FactorLimitLo = int.Parse(strValue); return CfgUpdateFlags.None;
case 3: FactorLimitHi = int.Parse(strValue); return CfgUpdateFlags.None;
case 4:
for (Counting c = 0; c < Counting.Count; c++)
{
if (c.ToString().Equals(strValue)) { Counting = c; return CfgUpdateFlags.None; }
}
break;
default: return CfgUpdateFlags.None;
}
return CfgUpdateFlags.None;
}
void CopyContentTo(ProcParams prms)
{
prms.MeterType = this.MeterType;
prms.CalibTarget = this.CalibTarget;
prms.FactorLimitLo = this.FactorLimitLo;
prms.FactorLimitHi = this.FactorLimitHi;
prms.Counting = this.Counting;
}
public IParamsProvider Clone()
{
ProcParams pars = new ProcParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
ProcParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as ProcParams;
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
public ProcParams()
{
}
public ProcParams(bool initialize)
{
if (initialize) InitializeAll();
}
public ProcParams(ComponentProcedure procParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
}
@@ -0,0 +1,84 @@
///
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
using TBF.Rig.TestMethods.SmartTest;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI
{
public class TestMethodCfg : ComponentCfgBase, ITestMethodCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new TestMethodCfgCtrl(); }
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;
WaitTimeAfterFailure = 2200;
PassThroughWaitTime = 1500;
NrThreads = 2; /// 1, 2 or 4 threads
IperlCheckErrorsToStop = 10;
MciTimeoutMs = 4000; // ms, NFC interface
BaudRate = 57600; // NFC Interface
DataBits = 8; // NFC Interface
ParityBit = Parity.None; // NFC Interface
StopBits = StopBits.Two; // NFC Interface
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}", Name, CommTimeout, MaxCommRetries, NrThreads);
}
public int CommTimeout { get; set; }
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 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; }
/// <summary> Test parameters </summary>
[XmlIgnore]
public iPerlCommunicationParams TestParams;
public bool UseWebService { get; set; }
public string BaseUrl { get; set; }
public string RelativeUrl { get; set; }
}
}
@@ -0,0 +1,129 @@
using Config.Resources;
using log4net;
using Sensus.iPerl.RfidCom.Helper;
using System;
using TBF.Rig.RegisterReaders.CommonRR;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
using static Sensus.iPerl.NfcHandler.MCI_Protocol;
namespace TBF.Rig.RegisterReaders.iPerlReaderUNI.test
{
internal class OpticalHeadTest
{
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
internal static string OpenSealing(IntIPerlReader iHead)
{
if (RfidCommands.OpenSealing($"COM{iHead.RfidComPortNr}")) return "OK";
return "Error Open Sealing";
}
internal static string ReadRequest_PCB(IntIPerlReader iHead)
{
try
{
byte[] pcb = null;
int readRetVal = IPerlCorrections.ReadRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.Configuration, Sensus.iPerl.NfcHandler.MCI_Protocol.StructName.Configuration, 16, 5, out pcb);
if (readRetVal == 0)
{
return RfidHelper.HexLiteral2Unsigned(RfidHelper.SwapHexcode(BitConverter.ToString(pcb).Replace("-", string.Empty))).ToString();
}
rfidDataLogger.Error($"COM{iHead.RfidComPortNr}: ReadRequest_PCB ({MessageID.Configuration},16,5...) <- Error: {readRetVal}");
return "Error";
}
catch (Exception ex)
{
return (ex.Message.ToString());
}
}
internal static string SetActiveMode(IntIPerlReader iHead)
{
byte[] cmd = new byte[1] { (byte)Command.SetActiveMode };
if (0 == IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.Command, StructName.Command, 0, 1, cmd))
{
return "OK";
}
else
{
return "Error Set Active Mode";
}
}
internal static string SetTestMode(IntIPerlReader iHead)
{
byte[] cmd = new byte[1] { (byte)Command.SetTestMode };
if (0 == IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.Command, StructName.Command, 0, 1, cmd))
{
return "OK";
}
else
{
return "Error Set Test Mode";
}
}
#if IPERL
internal static string TurnOffRadio(IntIPerlReader iHead)
{
try
{
int retValue = IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.RadioPassthrough, StructName.RadioParams, 0x1898, 1, new byte[] { (byte)3 }); // WakeUpInterval
return 0 == retValue ? "OK" : "Error";
}
catch (Exception ex)
{
return (ex.Message.ToString());
}
}
internal static string SetProductionMode(IntIPerlReader iHead)
{
try
{
int retValue = IPerlCorrections.WriteRequestPort(SmartCommunicationForm.TestMethodCfg, iHead, MessageID.RadioPassthrough, StructName.RadioInfo, 0x1804, 1, new byte[] { (byte)1 }); // System Status
return 0 == retValue ? "OK" : "Error";
}
catch (Exception ex)
{
return (ex.Message.ToString());
}
}
internal static string WriteRequestPort_u8_Customer_Text(IntIPerlReader iHead)
{
string custText = "FF0123456789ABCDEF"; // Sample text to test write function
/*try
{
byte[] cmd = RfidHelper.HexStringToByteArray(custText);
if (0 == iPerlCommunicationForm.WriteRequestPort(iHead, MessageID.RadioPassthrough, Sensus.iPerl.NfcHandler.MCI_Protocol.StructName.RadioParams, 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<string>(Params.u8_Customer_Text).ToString();
}
}
catch (Exception ex)
{
return (ex.Message.ToString());
}*/
return $"Error COM{iHead.RfidComPortNr}";
}
internal static string SetRfidMode(IntIPerlReader iHead)
{
iHead.SetRfidInterface();
iHead.SetCommunicationInterface(CommunicationInterface.RFID);
return ($"OK - {Strings.Program_restart_is_required_to_apply_some_settings}");
}
internal static string SetNfcMode(IntIPerlReader iHead)
{
iHead.SetNfcInterface();
iHead.SetCommunicationInterface(CommunicationInterface.NFC);
return ($"OK - {Strings.Program_restart_is_required_to_apply_some_settings}");
}
#endif /// IPERL
}
}
+7 -5
View File
@@ -20,6 +20,8 @@ using TBF.Rig.Output.Printers.GroupPrinting.Single;
using TBF.UiBridge;
using SharedComponents;
using System.Text;
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.Sequences
{
@@ -55,19 +57,19 @@ namespace TBF.Rig.Sequences
try
{
/// 1nd argument
TestMethods.iPerlCommunication.TestMethodCfg iPerlCfg = cfg as TestMethods.iPerlCommunication.TestMethodCfg;
ITestMethodCfg iPerlCfgIPerl = cfg as ITestMethodCfg;
/// 2rd argument: as is
/// 3th argument
IList<TestMethods.iPerlCommunication.iPerlCommunicationParams> iPerlCommParams = new List<TestMethods.iPerlCommunication.iPerlCommunicationParams>();
foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as TestMethods.iPerlCommunication.iPerlCommunicationParams);
IList<iPerlCommunicationParams> iPerlCommParams = new List<iPerlCommunicationParams>();
foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as iPerlCommunicationParams);
/*myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(iPerlCfg, tests, iPerlCommParams);
myRef.modelessDlg.Show();*/
myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(
testMethod as TBF.Rig.TestMethods.iPerlCommunication.TestMethod, tests, iPerlCommParams);
myRef.modelessDlg = new SmartCommunicationForm(
testMethod , tests, iPerlCommParams);
myRef.modelessDlg.Show();
}
catch (Exception e)
+29
View File
@@ -11,6 +11,7 @@ using TBF.Rig.GenericDevices;
using TBF.Boxes;
using TBF.Resources;
using Config.Entities;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
namespace TBF.Rig.Sequences
{
@@ -110,6 +111,7 @@ namespace TBF.Rig.Sequences
/// iPERL related state variables to be saved after each completed test
///
public static IList<TestMethods.iPerlCommunication.iPerlHead.IperlHead> IperlHeads;
public static IList<IntIPerlReader> IperlHeadsUni;
public static bool IsQ2PreCorrectionCalculated;
public static int CalculatedQ2PreCorrectionLR;
public static int CalculatedQ2PreCorrectionRL;
@@ -154,6 +156,7 @@ namespace TBF.Rig.Sequences
{
IperlHeads[i].WriteBinary(writer);
}
writer.Write(IsQ2PreCorrectionCalculated);
writer.Write(CalculatedQ2PreCorrectionLR);
@@ -173,6 +176,12 @@ namespace TBF.Rig.Sequences
for (int i = 0; i < CompleteTestInfos.Length; i++) CompleteTestInfos[i].WriteBinary(writer);
}
#endif
/////// IperlHeadsUni - added for support of smart meters
writer.Write(IperlHeadsUni.Count);
for (int i = 0; i < IperlHeadsUni.Count; i++)
{
IperlHeadsUni[i].WriteBinary(writer);
}
log.WarnFormat("Process data succesfully saved to file {0}", PDataFileName);
}
}
@@ -246,6 +255,26 @@ namespace TBF.Rig.Sequences
CompleteTestInfos[i] = ti;
}
#endif
try
{
int iPerlHeadsCountUni = reader.ReadInt32();
for (int i = 0; i < iPerlHeadsCountUni; i++)
{
if (IperlHeadsUni != null && i < IperlHeadsUni.Count)
{
IperlHeadsUni[i].ReadBinary(reader);
}
else
{
new TestMethods.iPerlCommunication.iPerlHead.IperlHead().ReadBinary(reader);
}
}
}
catch (Exception exc)
{
}
log.WarnFormat("Process data succesfully loaded from file {0}", PDataFileName);
return true;
}
+948
View File
@@ -0,0 +1,948 @@
///
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing; /// Point definition
using log4net;
using Common;
using Config.Entities;
using RestClient;
using TBF.Rig.Sequences;
using TBF.Resources;
using TBF.UiBridge;
using Results;
using Results.Entities;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.Sequences
{
public class iPerlCommunicationSeq : SequenceBase
{
private static readonly ILog log = LogManager.GetLogger(typeof(iPerlCommunicationSeq));
System.Windows.Forms.Form modelessDlg;
///
delegate void iPerlCommFormDlgt(iPerlCommunicationSeq myRef, SmartComponentBase smartComponentBase, Test test, iPerlCommunicationParams testParams);
///
void OpenIPerlCommForm(iPerlCommunicationSeq myRef, SmartComponentBase method, Test test, iPerlCommunicationParams testParams)
{
myRef.modelessDlg = new SmartCommunicationForm(method, test, testParams);
myRef.modelessDlg.Show();
}
void CloseIPerlCommForm()
{
UiBridge.Bridge.OnCloseModelessForm(this, null);
modelessDlg = null;
}
/// <summary>
/// Flying start mass collection method sequence
/// </summary>
/// <param name="test">Test entity</param>
/// <returns>
/// Event.Done . . . . . . . OK
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
/// Event.OpArgumentError . Target flow is out of range
/// Event.Error . . . . . . Unspecified error
/// </returns>
public IList<Event> Execute(Test test, int repetitionNr, SmartComponentBase method, iPerlCommunicationParams testParams)
{
TestMethodCfg cfg = method.Cfg as TestMethodCfg;
IList<Event> e; /// Events from currently running operations
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
modelessDlg = null;
processDataLoggingOp = new TBF.Rig.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
string cmd;
if (testParams.Activity.ToLower().Equals(cmd = iPerlCommunicationConstants.GetDefaultQ2CorrectionsStr.ToLower()))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
/// Get 'wmType' from IperlHead procedure parameters
int wmType = 0;
#if IPERL
/*foreach (var wm in ProcessData.BatchRslts.Batch.WaterMeters)
{
if (wm != null && !wm.Disabled && wm.WMTypeId() > 0)
{
wmType = wm.WMTypeId();
break;
}
}*/
#endif
if (cfg.UseWebService)
{
IsQ2PreCorrectionCalculated = GetQ2PreCorrectionsOrBackups(cfg, wmType, out CalculatedQ2PreCorrectionLR, out CalculatedQ2PreCorrectionRL);
}
/// Generate test results
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(test.Name, 0);
if (tstRslt != null)
{
tstRslt.StartTime = DateTime.Now;
tstRslt.TestDone = true;
foreach (var wm in BatchRslts.Batch.WaterMeters)
{
if (!wm.Disabled)
{
foreach(var mtr in wm.MeterTestRslts)
{
if (mtr.TestRslt == tstRslt)
{
mtr.Passed = !cfg.UseWebService || IsQ2PreCorrectionCalculated;
mtr.TestDone = true;
break;
}
}
}
}
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(test.Name, 0)));
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
return new List<Event> { Event.Done };
}
else if (testParams.Activity.ToLower().Contains(cmd = iPerlCommunicationConstants.Q2correctedFromCmd.ToLower()))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
string[] args = testParams.Activity.Substring(cmd.Length).Split(new char[] { ' ' });
string fromTestName = (args.Length >= 1) ? args[0] : string.Empty;
bool isPlus = (args.Length >= 2) ? args[1].ToLower().Contains("plus") : false;
MakeQ2CorrectedFrom(test.Name, fromTestName, isPlus);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(test.Name, 0)));
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
return new List<Event> { Event.Done };
}
else if (testParams.Activity.ToLower().Contains(cmd = iPerlCommunicationConstants.StrictQ2ErrorCheckStr.ToLower()))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
string fromTestName = testParams.Activity.Substring(cmd.Length);
StrictQ2ErrorCheck(test.Name, fromTestName);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(test.Name, 0)));
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
return new List<Event> { Event.Done };
}
else if (testParams.Activity.ToLower().Contains(cmd = iPerlCommunicationConstants.Q2correctionCheckCmd.ToLower()))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
string[] testNames = testParams.Activity.Substring(cmd.Length).Split(new char[] { ' ' });
if (testNames.Length >= 2)
{
CheckQ2Correction(test.Name, testNames[0], testNames[1]);
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(test.Name, 0)));
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
return new List<Event> { Event.Done };
}
else if (testParams.Activity.ToLower().Contains(cmd = iPerlCommunicationConstants.IperlCheckCmd.ToLower()))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
string[] args = testParams.Activity.Substring(cmd.Length).Split(new char[] { ' ' });
//int maxTestIndex = (ProcessData.BenchInfo is TBF.Rig.DataContainer.BenchInfo.Component)
// ? (ProcessData.BenchInfo as TBF.Rig.DataContainer.BenchInfo.Component).MaxTestIndex
// : int.MaxValue;
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(test.Name, 0);
if (tstRslt != null)
{
tstRslt.StartTime = DateTime.Now;
int wrongMetersCount = 0;
string message = string.Empty;
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
{
Results.Entities.WaterMeter wm = BatchRslts.Batch.WaterMeters[i];
Results.Entities.MeterTestRslt mtr = ProcessData.BatchRslts.GetMeterTestRslt(test.Name, i, CompoundMeterId.Single);
///// Reference to iPerl water meter or null:
//TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerlHead = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
// ? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
// : null;
if ((wm != null) && (mtr != null))
{
int errorIndicators = 0;
bool anyErrorOfThisMeter = false;
foreach (var arg in args)
{
#if TURA_SPECIAL
if (arg.ToLower() == "q2factors")
{
if ((wm.ProdQ2CorrRL != wm.Q2CorrRL) || (wm.ProdQ2CorrLR != wm.Q2CorrLR))
{
anyErrorOfThisMeter = true;
message += string.Format("Q2 korekčné faktory vodomera {0} nesedia{1}", wm.WMPosition, Environment.NewLine);
errorIndicators |= (int)ErrorFlagMask.E26; /// Q2 correction factors not valid
}
}
#endif
if (arg.ToLower() == "direction")
{
//if (wm.Pruefindex > maxTestIndex)
//{
// anyErrorOfThisMeter = true;
// message += string.Format("Príliš veľa opakovaní testu vodomera {0}{1}", wm.WMPosition, Environment.NewLine);
// errorIndicators |= (int)ErrorFlagMask.E27; /// Wrong direction (positive/negative counting)
//}
}
if (arg.ToLower() == "prevworkstep")
{
if (wm.LastRecordIsNok)
{
wm.ErrorFlags |= (int)ErrorFlagMask.E28; /// Set E28
}
if ((wm.ErrorFlags & (int)ErrorFlagMask.E28) != 0)
{
anyErrorOfThisMeter = true;
message += string.Format("iPerl{0} : Predchádzajúci krok nebol zaznamenaný{1}", wm.WMPosition, Environment.NewLine);
errorIndicators |= (int)ErrorFlagMask.E28; /// Previous workstep missing or NOK (production tracing)
}
}
}
mtr.TestDone = true;
mtr.ErrorIndicators = errorIndicators;
///
if (anyErrorOfThisMeter)
{
/// This iPerl check did not pass
mtr.Passed = false;
wrongMetersCount++;
}
else
{
/// Check passed OK
mtr.Passed = true;
}
}
}
tstRslt.EndTime = DateTime.Now;
tstRslt.TestDone = true;
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, tstRslt));
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
if (wrongMetersCount >= cfg.IperlCheckErrorsToStop)
{
State.Create("iPerlCommunicationSeq : Show check result")
.AddOperation(new Operations.LargeMessageBoxOp(message))
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
}
while (!e.Contains(Event.Continue) && !e.Contains(Event.Abort));
if (e.Contains(Event.Abort))
{
Bridge.OnError(this, string.Format("Niečo nie je v poriadku !"));
return new List<Event> { Event.UiCmdStop };
}
}
}
return new List<Event> { Event.Done };
}
else if (testParams.Activity.ToLower().Contains(cmd = iPerlCommunicationConstants.SimulateCmd))
{
TestProgressEventArgs.SetEstimatedTimes(new int[] { 0, 0, 0, 30, 0, 30, 0, 0 });
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.JustStarted));
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.FlowSetting));
if (testParams.Activity.ToLower().Contains("q3")) MakeSimulated(test, 1, 0, -0.5f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "q2") MakeSimulated(test, 1, 0, 0.5f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "q1") MakeSimulated(test, 1, 0, -5.1f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound ok") MakeSimulatedCompound(test, 1, 0, 0.7f, 1.0f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound nok") MakeSimulatedCompound(test, 1, 0, 4.7f, 0.9f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound rise") MakeSimulatedCompound(test, 1, 0, 0.7f, 0.0f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "compound fall") MakeSimulatedCompound(test, 1, 0, 0.7f, 0.9f);
else if (testParams.Activity.Substring(cmd.Length).ToLower() == "iperls")
{
string[] pcbNrs = new string[] { "831232435539", "831232435562", "831232435587",
"831232432141", "831232432497", "831232763641" };
TestRslt tstRslt = BatchRslts.GetTestRslt(test.Name, test.Part);
if (tstRslt != null)
{
Results.Utils.GetCounterStates(tstRslt, Program.LocalSettings.Counters);
/// Auxiliary results ... not required
/// Main results
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
tstRslt.TestDone = true;
tstRslt.StartTime = tstRslt.Batch.StartTime;
tstRslt.EndTime = DateTime.Now;
tstRslt.FlowSetTime = 0;
tstRslt.MassOfEvapWater = 0;
tstRslt.TestTime = 1;
for (int i = 0; i < BatchRslts.Batch.WaterMeters.Count; i++)
{
MeterTestRslt meterRslt =
BatchRslts.GetMeterTestRslt(test.Name, i, CompoundMeterId.Single);
if (meterRslt != null)
{
meterRslt.WaterMeter.SerialNr = pcbNrs[i % pcbNrs.Length];
meterRslt.Passed = true;
meterRslt.TestDone = true;
}
//if (iperlHeads[i] != null)
//{
// iperlHeads[i].CommFailed = iperlHeads[i].Disabled = false;
// iperlHeads[i].SerialNr = pcbNrs[i % pcbNrs.Length];
//}
}
}
}
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Common.Utils.GetTestName(test.Name, 1, 1), 0)));
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
//------------------------------------------------
Bridge.OnActivity(this, testParams.Activity);
//------------------------------------------------
State.Create(string.Format("iPerlCommunicationSeq : {0}", testParams.Activity))
.AddOperation(checkUiOp)
.EnterState();
e = StateMachine.WaitRunDevsRunOps();
if (TestAndLogUiCmdStop(test, e))
{
return new List<Event> { Event.UiCmdStop };
}
}
else
{
///
/// Show the modeless dialog with error indication
///
Program.MainWnd.Invoke(new iPerlCommFormDlgt(OpenIPerlCommForm), new object[] { this, method, test, testParams });
//------------------------------------------------
Bridge.OnActivity(this, Strings.iPerl_Communication_in_progress);
//------------------------------------------------
bool stopPressed = false; /// true when STOP button pressed
bool completed = false;
State.Create("iPerlCommunicationSeq : Wait until the entry form is closed")
.AddOperation(checkUiOp)
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
stopPressed = TestAndLogUiCmdStop(test, e);
completed = (modelessDlg is GenericDevices.IHasCompleted)
&& (modelessDlg as GenericDevices.IHasCompleted).Completed;
}
while (!stopPressed && !completed);
if (stopPressed)
{
CloseIPerlCommForm();
return new List<Event> { Event.UiCmdStop };
}
else
{
TBF.UiBridge.Bridge.OnTestProgress(null, new TBF.UiBridge.TestProgressEventArgs(test.Name, Progress.Completed));
}
/// Test 'Quit'
modelessDlg = null; /// Modeless dialog is closed now
}
return new List<Event> { Event.Done };
}
/// <summary>
/// Read default Q2 correction factors from a REST service (= Web service).
/// </summary>
/// <param name="cfg">iPerlCommunication component configuration</param>
/// <param name="wmType">Water meter type (WZ Typ)</param>
/// <param name="q2PreCorrectionLR">Default Q2 correction LR</param>
/// <param name="q2PreCorrectionRL">Default Q2 correction RL</param>
/// <returns>true when successful</returns>
static bool ReadCorrectionsFromWebService(TestMethodCfg cfg, int wmType, out int q2PreCorrectionLR, out int q2PreCorrectionRL)
{
if (wmType == 0)
{
/// No REST service call when wmType == 0, factors are 0
q2PreCorrectionLR = 0;
q2PreCorrectionRL = 0;
return true;
}
try
{
GetQ2PreCorrectionClient client = new GetQ2PreCorrectionClient(cfg.BaseUrl);
client.GetToken("ReadUser", "sensus", "https://deluh1web03.world.fluidtechnology.net/SensusCore/api/v1/Locations/1/Login2").Wait();
Q2PreCorrection response = client.GetQ2Correction(string.Format(cfg.RelativeUrl, wmType)).Result;
if (response != null && response.AreDataCalculated)
{
q2PreCorrectionLR = response.CorrLR;
q2PreCorrectionRL = response.CorrRL;
log.WarnFormat("Q2 corrections from a REST client for WM Type = {0} are: LR = {1}, RL = {2}", wmType, q2PreCorrectionLR, q2PreCorrectionRL);
return true;
}
else
{
log.ErrorFormat("Failed to obtain Q2 corrections from a REST client for WM Type = {0}", wmType);
q2PreCorrectionLR = 0;
q2PreCorrectionRL = 0;
return false;
}
}
catch (Exception exc)
{
log.ErrorFormat("Failed to obtain Q2 corrections from a REST client for WM Type = {0}: {1}", wmType, exc.Message);
q2PreCorrectionLR = 0;
q2PreCorrectionRL = 0;
return false;
}
}
/// <summary>
/// Obtain Q2 correction factors from a REST service or from local settings (stored backup values)
/// </summary>
/// <param name="cfg">iPerlCommunication component configuration</param>
/// <param name="wmType">Water meter type (WZ Typ)</param>
/// <param name="q2PreCorrectionLR">Default Q2 correction LR</param>
/// <param name="q2PreCorrectionRL">Default Q2 correction RL</param>
/// <returns>true when successful</returns>
public static bool GetQ2PreCorrectionsOrBackups(TestMethodCfg cfg, int wmType, out int q2PreCorrectionLR, out int q2PreCorrectionRL)
{
/// Get Q2 pre-correction values from REST service
bool restOK = ReadCorrectionsFromWebService(cfg, wmType, out q2PreCorrectionLR, out q2PreCorrectionRL);
/// Store / load Q2 pre-correction values
Point storedValue;
if (restOK)
{
/// Q2 pre-correction values were successfully obtained from a REST service for the specified wmType
if (!Program.LocalSettings.Q2PreCorrections.TryGetValue(wmType, out storedValue))
{
/// No Q2 pre-correction values in the dictionary for the specified wmType => save them
Program.LocalSettings.Q2PreCorrections.Add(wmType, new Point(q2PreCorrectionLR, q2PreCorrectionRL));
log.WarnFormat("Q2 corrections added to dictionary for WM Type = {0}: LR = {1}, RL = {2}", wmType, q2PreCorrectionLR, q2PreCorrectionRL);
}
else if (storedValue.X != q2PreCorrectionLR || storedValue.Y != q2PreCorrectionRL)
{
/// Different Q2 pre-correction values in the dictionary for the specified wmType => overwrite them with ones from the REST service
Program.LocalSettings.Q2PreCorrections[wmType] = new Point(q2PreCorrectionLR, q2PreCorrectionRL);
log.WarnFormat("Q2 corrections modified in dictionary for WM Type = {0}: LR = {1}, RL = {2}", wmType, q2PreCorrectionLR, q2PreCorrectionRL);
}
else
{
/// Q2 pre-correction values in the dictionary are the same and were not changed
log.WarnFormat("Q2 corrections in dictionary for WM Type = {0} are the same and were not changed", wmType, q2PreCorrectionLR, q2PreCorrectionRL);
}
}
else
{
/// No Q2 pre-correction values from a REST service => read the dictionary
if (Program.LocalSettings.Q2PreCorrections.TryGetValue(wmType, out storedValue))
{
/// Q2 pre-correction values successfully read from the dictionary
q2PreCorrectionLR = storedValue.X;
q2PreCorrectionRL = storedValue.Y;
log.WarnFormat("Q2 corrections loaded from dictionary for WM Type = {0}: LR = {1}, RL = {2}", wmType, q2PreCorrectionLR, q2PreCorrectionRL);
}
else
{
/// Q2 pre-correction values not found in the dictionary => use zeros
q2PreCorrectionLR = 0;
q2PreCorrectionRL = 0;
log.ErrorFormat("Q2 corrections not found in the dictionary for WM Type = {0}, using zeros", wmType, q2PreCorrectionLR, q2PreCorrectionRL);
/// Everything failed => using zero values
return false;
}
}
/// Q2 pre-corections were obtained from REST service or stored backup values were used
return true;
}
/// <summary>
/// Virtually apply Q2 correction to a test used for the correction calculation.
/// </summary>
/// <param name="testName">This test name</param>
/// <param name="oriTestRslt">Name of Q2 test done before Q2 correction (Q2adj)</param>
/// <remarks>Assuming this test does not have multiple parts (part = 0)</remarks>
void MakeQ2CorrectedFrom(string testName, string oriTestName, bool isPlus = false)
{
Results.Entities.TestRslt oriTestRslt = ProcessData.BatchRslts.GetTestRslt(oriTestName, 0);
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, 0);
if (oriTestRslt == null || tstRslt == null) return;
tstRslt.Components = oriTestRslt.Components;
/// Auxiliary results, as in SequenceBase.UpdateTemoPressDensAmb()
tstRslt.AmbTempMean = oriTestRslt.AmbTempMean;
tstRslt.AmbTempStart = oriTestRslt.AmbTempStart;
tstRslt.AmbTempEnd = oriTestRslt.AmbTempEnd;
tstRslt.AmbTempMin = oriTestRslt.AmbTempMin;
tstRslt.AmbTempMax = oriTestRslt.AmbTempMax;
tstRslt.AmbPressMean = oriTestRslt.AmbPressMean;
tstRslt.AmbPressStart = oriTestRslt.AmbPressStart;
tstRslt.AmbPressEnd = oriTestRslt.AmbPressEnd;
tstRslt.AmbPressMin = oriTestRslt.AmbPressMin;
tstRslt.AmbPressMax = oriTestRslt.AmbPressMax;
tstRslt.AmbHumiMean = oriTestRslt.AmbHumiMean;
tstRslt.AmbHumiStart = oriTestRslt.AmbHumiStart;
tstRslt.AmbHumiEnd = oriTestRslt.AmbHumiEnd;
tstRslt.AmbHumiMin = oriTestRslt.AmbHumiMin;
tstRslt.AmbHumiMax = oriTestRslt.AmbHumiMax;
tstRslt.PressUpMean = oriTestRslt.PressUpMean;
tstRslt.PressUpStart = oriTestRslt.PressUpStart;
tstRslt.PressUpEnd = oriTestRslt.PressUpEnd;
tstRslt.PressUpMin = oriTestRslt.PressUpMin;
tstRslt.PressUpMax = oriTestRslt.PressUpMax;
tstRslt.PressDownMean = oriTestRslt.PressDownMean;
tstRslt.PressDownStart = oriTestRslt.PressDownStart;
tstRslt.PressDownEnd = oriTestRslt.PressDownEnd;
tstRslt.PressDownMin = oriTestRslt.PressDownMin;
tstRslt.PressDownMax = oriTestRslt.PressDownMax;
tstRslt.PressDeltaMean = oriTestRslt.PressDeltaMean;
tstRslt.PressDeltaStart = oriTestRslt.PressDeltaStart;
tstRslt.PressDeltaEnd = oriTestRslt.PressDeltaEnd;
tstRslt.PressDeltaMin = oriTestRslt.PressDeltaMin;
tstRslt.PressDeltaMax = oriTestRslt.PressDeltaMax;
tstRslt.ConductMean = oriTestRslt.ConductMean;
tstRslt.ConductStart = oriTestRslt.ConductStart;
tstRslt.ConductEnd = oriTestRslt.ConductEnd;
tstRslt.ConductMin = oriTestRslt.ConductMin;
tstRslt.ConductMax = oriTestRslt.ConductMax;
tstRslt.TempUpMean = oriTestRslt.TempUpMean;
tstRslt.TempUpStart = oriTestRslt.TempUpStart;
tstRslt.TempUpEnd = oriTestRslt.TempUpEnd;
tstRslt.TempUpMin = oriTestRslt.TempUpMin;
tstRslt.TempUpMax = oriTestRslt.TempUpMax;
tstRslt.TempDownMean = oriTestRslt.TempDownMean;
tstRslt.TempDownStart = oriTestRslt.TempDownStart;
tstRslt.TempDownEnd = oriTestRslt.TempDownEnd;
tstRslt.TempDownMin = oriTestRslt.TempDownMin;
tstRslt.TempDownMax = oriTestRslt.TempDownMax;
tstRslt.TempDivMean = oriTestRslt.TempDivMean;
tstRslt.TempDivStart = oriTestRslt.TempDivStart;
tstRslt.TempDivEnd = oriTestRslt.TempDivEnd;
tstRslt.TempDivMin = oriTestRslt.TempDivMin;
tstRslt.TempDivMax = oriTestRslt.TempDivMax;
tstRslt.DensityIn = oriTestRslt.DensityIn;
tstRslt.DensityLine = oriTestRslt.DensityLine;
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
tstRslt.StartTime = oriTestRslt.StartTime;
tstRslt.EndTime = oriTestRslt.EndTime;
tstRslt.FlowSetTime = oriTestRslt.FlowSetTime;
tstRslt.TestTime = oriTestRslt.TestTime;
tstRslt.PulsesMaster = oriTestRslt.PulsesMaster;
tstRslt.ConstMasterRaw = oriTestRslt.ConstMasterRaw;
tstRslt.ConstMaster = oriTestRslt.ConstMaster;
tstRslt.MassStartRaw = oriTestRslt.MassStartRaw;
tstRslt.MassStart = oriTestRslt.MassStart;
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
tstRslt.MassEnd = oriTestRslt.MassEnd;
tstRslt.MassOfEvapWater = oriTestRslt.MassOfEvapWater;
//tstRslt.FlowMass = oriTestRslt.FlowMass;
//tstRslt.FlowVolume = oriTestRslt.FlowVolume;
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
tstRslt.FlowMean = oriTestRslt.FlowMean;
tstRslt.FlowMin = oriTestRslt.FlowMin;
tstRslt.FlowMax = oriTestRslt.FlowMax;
tstRslt.Custom1 = oriTestRslt.Custom1;
tstRslt.Custom2 = oriTestRslt.Custom2;
tstRslt.Custom3 = oriTestRslt.Custom3;
tstRslt.Custom4 = oriTestRslt.Custom4;
tstRslt.Custom5 = oriTestRslt.Custom5;
tstRslt.Custom6 = oriTestRslt.Custom6;
tstRslt.Custom7 = oriTestRslt.Custom7;
tstRslt.Custom8 = oriTestRslt.Custom8;
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
{
// Fix for CS7036: Added the missing 'meterId' argument to the GetMeterTestRslt method call.
var q3mtr = ProcessData.BatchRslts.GetMeterTestRslt("Q3", i, CompoundMeterId.SingleOrCompound);
double q3error = (q3mtr != null) ? q3mtr.Error : 0;
Results.Entities.MeterTestRslt oriMeterRslt = ProcessData.BatchRslts.GetMeterTestRslt(oriTestName, i, CompoundMeterId.SingleOrCompound);
Results.Entities.MeterTestRslt meterRslt = ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.SingleOrCompound);
/// Reference to iPerl water meter or null:
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath != null) && (sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
: null;
if (iPerl != null && meterRslt != null && oriMeterRslt != null)
{
#if ORACLE_DB
meterRslt.ErrorBC = oriMeterRslt.Error;
#endif
meterRslt.PulsesMeter = oriMeterRslt.PulsesMeter;
meterRslt.PulsesMaster = oriMeterRslt.PulsesMaster;
meterRslt.PulsesPerLiter = oriMeterRslt.PulsesPerLiter;
meterRslt.VolumeRef = oriMeterRslt.VolumeRef;
meterRslt.TestTime = oriMeterRslt.TestTime;
if (q3error * oriMeterRslt.Error < 0)
{
/// iPerl with Q2 correction => generate an artificial error equal to +1/10 of the original one (relative to Q2 target error)
meterRslt.Error = 0.1 * oriMeterRslt.Error;
}
else
{
/// iPerl with Q2 correction => generate an artificial error equal to -1/10 of the original one (relative to Q2 target error)
meterRslt.Error = - 0.1 * oriMeterRslt.Error;
}
meterRslt.VolumeMeter = meterRslt.VolumeRef * (100.0 + meterRslt.Error) / 100.0;
double signature = (oriMeterRslt.VolumeEnd > oriMeterRslt.VolumeStart) ? (+1) : (-1);
meterRslt.VolumeStart = oriMeterRslt.VolumeStart;
meterRslt.VolumeEnd = meterRslt.VolumeStart + signature * meterRslt.VolumeMeter;
meterRslt.Passed = (meterRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin()
&& meterRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
meterRslt.TestDone = true;
tstRslt.TestDone = true;
}
}
}
/// <summary>
/// Evaluate a given Q2 test result agains stricter error limits when Oruefindex == 1.
/// </summary>
/// <param name="testName">This test name</param>
/// <param name="oriTestRslt">Name of Q2 test done before Q2 correction (Q2adj)</param>
/// <remarks>Assuming this test does not have multiple parts (part = 0)</remarks>
void StrictQ2ErrorCheck(string testName, string oriTestName)
{
Results.Entities.TestRslt oriTestRslt = ProcessData.BatchRslts.GetTestRslt(oriTestName, 0);
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, 0);
if (oriTestRslt == null || tstRslt == null) return;
tstRslt.Components = oriTestRslt.Components;
/// Auxiliary results, as in SequenceBase.UpdateTemoPressDensAmb()
tstRslt.AmbTempMean = oriTestRslt.AmbTempMean;
tstRslt.AmbTempStart = oriTestRslt.AmbTempStart;
tstRslt.AmbTempEnd = oriTestRslt.AmbTempEnd;
tstRslt.AmbTempMin = oriTestRslt.AmbTempMin;
tstRslt.AmbTempMax = oriTestRslt.AmbTempMax;
tstRslt.AmbPressMean = oriTestRslt.AmbPressMean;
tstRslt.AmbPressStart = oriTestRslt.AmbPressStart;
tstRslt.AmbPressEnd = oriTestRslt.AmbPressEnd;
tstRslt.AmbPressMin = oriTestRslt.AmbPressMin;
tstRslt.AmbPressMax = oriTestRslt.AmbPressMax;
tstRslt.AmbHumiMean = oriTestRslt.AmbHumiMean;
tstRslt.AmbHumiStart = oriTestRslt.AmbHumiStart;
tstRslt.AmbHumiEnd = oriTestRslt.AmbHumiEnd;
tstRslt.AmbHumiMin = oriTestRslt.AmbHumiMin;
tstRslt.AmbHumiMax = oriTestRslt.AmbHumiMax;
tstRslt.PressUpMean = oriTestRslt.PressUpMean;
tstRslt.PressUpStart = oriTestRslt.PressUpStart;
tstRslt.PressUpEnd = oriTestRslt.PressUpEnd;
tstRslt.PressUpMin = oriTestRslt.PressUpMin;
tstRslt.PressUpMax = oriTestRslt.PressUpMax;
tstRslt.PressDownMean = oriTestRslt.PressDownMean;
tstRslt.PressDownStart = oriTestRslt.PressDownStart;
tstRslt.PressDownEnd = oriTestRslt.PressDownEnd;
tstRslt.PressDownMin = oriTestRslt.PressDownMin;
tstRslt.PressDownMax = oriTestRslt.PressDownMax;
tstRslt.PressDeltaMean = oriTestRslt.PressDeltaMean;
tstRslt.PressDeltaStart = oriTestRslt.PressDeltaStart;
tstRslt.PressDeltaEnd = oriTestRslt.PressDeltaEnd;
tstRslt.PressDeltaMin = oriTestRslt.PressDeltaMin;
tstRslt.PressDeltaMax = oriTestRslt.PressDeltaMax;
tstRslt.ConductMean = oriTestRslt.ConductMean;
tstRslt.ConductStart = oriTestRslt.ConductStart;
tstRslt.ConductEnd = oriTestRslt.ConductEnd;
tstRslt.ConductMin = oriTestRslt.ConductMin;
tstRslt.ConductMax = oriTestRslt.ConductMax;
tstRslt.TempUpMean = oriTestRslt.TempUpMean;
tstRslt.TempUpStart = oriTestRslt.TempUpStart;
tstRslt.TempUpEnd = oriTestRslt.TempUpEnd;
tstRslt.TempUpMin = oriTestRslt.TempUpMin;
tstRslt.TempUpMax = oriTestRslt.TempUpMax;
tstRslt.TempDownMean = oriTestRslt.TempDownMean;
tstRslt.TempDownStart = oriTestRslt.TempDownStart;
tstRslt.TempDownEnd = oriTestRslt.TempDownEnd;
tstRslt.TempDownMin = oriTestRslt.TempDownMin;
tstRslt.TempDownMax = oriTestRslt.TempDownMax;
tstRslt.TempDivMean = oriTestRslt.TempDivMean;
tstRslt.TempDivStart = oriTestRslt.TempDivStart;
tstRslt.TempDivEnd = oriTestRslt.TempDivEnd;
tstRslt.TempDivMin = oriTestRslt.TempDivMin;
tstRslt.TempDivMax = oriTestRslt.TempDivMax;
tstRslt.DensityIn = oriTestRslt.DensityIn;
tstRslt.DensityLine = oriTestRslt.DensityLine;
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
tstRslt.StartTime = oriTestRslt.StartTime;
tstRslt.EndTime = oriTestRslt.EndTime;
tstRslt.FlowSetTime = oriTestRslt.FlowSetTime;
tstRslt.TestTime = oriTestRslt.TestTime;
tstRslt.PulsesMaster = oriTestRslt.PulsesMaster;
tstRslt.ConstMasterRaw = oriTestRslt.ConstMasterRaw;
tstRslt.ConstMaster = oriTestRslt.ConstMaster;
tstRslt.MassStartRaw = oriTestRslt.MassStartRaw;
tstRslt.MassStart = oriTestRslt.MassStart;
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
tstRslt.MassEnd = oriTestRslt.MassEnd;
tstRslt.MassOfEvapWater = oriTestRslt.MassOfEvapWater;
//tstRslt.FlowMass = oriTestRslt.FlowMass;
//tstRslt.FlowVolume = oriTestRslt.FlowVolume;
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
tstRslt.FlowMean = oriTestRslt.FlowMean;
tstRslt.FlowMin = oriTestRslt.FlowMin;
tstRslt.FlowMax = oriTestRslt.FlowMax;
tstRslt.Custom1 = oriTestRslt.Custom1;
tstRslt.Custom2 = oriTestRslt.Custom2;
tstRslt.Custom3 = oriTestRslt.Custom3;
tstRslt.Custom4 = oriTestRslt.Custom4;
tstRslt.Custom5 = oriTestRslt.Custom5;
tstRslt.Custom6 = oriTestRslt.Custom6;
tstRslt.Custom7 = oriTestRslt.Custom7;
tstRslt.Custom8 = oriTestRslt.Custom8;
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
{
Results.Entities.MeterTestRslt oriMeterRslt = ProcessData.BatchRslts.GetMeterTestRslt(oriTestName, i, CompoundMeterId.Single);
Results.Entities.MeterTestRslt meterRslt = ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
/// Reference to iPerl water meter or null:
TestMethods.iPerlCommunication.iPerlHead.IperlHead iPerl = ((sensPath != null) && (sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
? (sensPath.RegisterReaders[i] as TestMethods.iPerlCommunication.iPerlHead.IperlHead)
: null;
if (meterRslt != null && oriMeterRslt != null)
{
#if ORACLE_DB
meterRslt.ErrorBC = oriMeterRslt.Error;
#endif
meterRslt.PulsesMeter = oriMeterRslt.PulsesMeter;
meterRslt.PulsesMaster = oriMeterRslt.PulsesMaster;
meterRslt.PulsesPerLiter = oriMeterRslt.PulsesPerLiter;
meterRslt.VolumeRef = oriMeterRslt.VolumeRef;
meterRslt.TestTime = oriMeterRslt.TestTime;
if (iPerl != null && ProcessData.BatchRslts.Batch.WaterMeters[i] != null &&
!ProcessData.BatchRslts.Batch.WaterMeters[i].Disabled)
{
/// Either no iPerl head or no Q2 correction
meterRslt.Error = oriMeterRslt.Error;
meterRslt.VolumeMeter = oriMeterRslt.VolumeMeter;
meterRslt.VolumeStart = oriMeterRslt.VolumeStart;
meterRslt.VolumeEnd = oriMeterRslt.VolumeEnd;
#if ORACLE_DB
if ((ProcessData.BatchRslts.Batch.WaterMeters[i].Pruefindex % 100) == 1)
{
meterRslt.Passed = (oriMeterRslt.Error >= tstRslt.ErrLimLo() + tstRslt.ErrLimMargin()
&& oriMeterRslt.Error <= tstRslt.ErrLimHi() - tstRslt.ErrLimMargin());
}
else
#endif
{
meterRslt.Passed = oriMeterRslt.Passed;
}
meterRslt.TestDone = true;
tstRslt.TestDone = true;
}
}
}
}
/// <summary>
/// Check results of 2 tests: before Q2 correction and after Q2 correction.
/// Evaluate whether Q2 correction works OK.
/// </summary>
/// <param name="testName">This test name</param>
/// <param name="testNameQ2bc">Name of Q2 test done before correction</param>
/// <param name="testNameQ2ac">Name of Q2 test done after correction</param>
/// <remarks>Assuming these tests do not have multiple parts (part = 0)</remarks>
void CheckQ2Correction(string testName, string testNameQ2bc, string testNameQ2ac)
{
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, 0);
Results.Entities.TestRslt testRsltQ2bc = ProcessData.BatchRslts.GetTestRslt(testNameQ2bc, 0);
Results.Entities.TestRslt testRsltQ2ac = ProcessData.BatchRslts.GetTestRslt(testNameQ2ac, 0);
if ((tstRslt == null) || (testRsltQ2bc == null) || (testRsltQ2ac == null)) return;
tstRslt.Components = testRsltQ2ac.Components;
/// Auxiliary results, as in SequenceBase.UpdateTemoPressDensAmb()
tstRslt.AmbTempMean = testRsltQ2ac.AmbTempMean;
tstRslt.AmbTempStart = testRsltQ2ac.AmbTempStart;
tstRslt.AmbTempEnd = testRsltQ2ac.AmbTempEnd;
tstRslt.AmbTempMin = testRsltQ2ac.AmbTempMin;
tstRslt.AmbTempMax = testRsltQ2ac.AmbTempMax;
tstRslt.AmbPressMean = testRsltQ2ac.AmbPressMean;
tstRslt.AmbPressStart = testRsltQ2ac.AmbPressStart;
tstRslt.AmbPressEnd = testRsltQ2ac.AmbPressEnd;
tstRslt.AmbPressMin = testRsltQ2ac.AmbPressMin;
tstRslt.AmbPressMax = testRsltQ2ac.AmbPressMax;
tstRslt.AmbHumiMean = testRsltQ2ac.AmbHumiMean;
tstRslt.AmbHumiStart = testRsltQ2ac.AmbHumiStart;
tstRslt.AmbHumiEnd = testRsltQ2ac.AmbHumiEnd;
tstRslt.AmbHumiMin = testRsltQ2ac.AmbHumiMin;
tstRslt.AmbHumiMax = testRsltQ2ac.AmbHumiMax;
tstRslt.PressUpMean = testRsltQ2ac.PressUpMean;
tstRslt.PressUpStart = testRsltQ2ac.PressUpStart;
tstRslt.PressUpEnd = testRsltQ2ac.PressUpEnd;
tstRslt.PressUpMin = testRsltQ2ac.PressUpMin;
tstRslt.PressUpMax = testRsltQ2ac.PressUpMax;
tstRslt.PressDownMean = testRsltQ2ac.PressDownMean;
tstRslt.PressDownStart = testRsltQ2ac.PressDownStart;
tstRslt.PressDownEnd = testRsltQ2ac.PressDownEnd;
tstRslt.PressDownMin = testRsltQ2ac.PressDownMin;
tstRslt.PressDownMax = testRsltQ2ac.PressDownMax;
tstRslt.PressDeltaMean = testRsltQ2ac.PressDeltaMean;
tstRslt.PressDeltaStart = testRsltQ2ac.PressDeltaStart;
tstRslt.PressDeltaEnd = testRsltQ2ac.PressDeltaEnd;
tstRslt.PressDeltaMin = testRsltQ2ac.PressDeltaMin;
tstRslt.PressDeltaMax = testRsltQ2ac.PressDeltaMax;
tstRslt.ConductMean = testRsltQ2ac.ConductMean;
tstRslt.ConductStart = testRsltQ2ac.ConductStart;
tstRslt.ConductEnd = testRsltQ2ac.ConductEnd;
tstRslt.ConductMin = testRsltQ2ac.ConductMin;
tstRslt.ConductMax = testRsltQ2ac.ConductMax;
tstRslt.TempUpMean = testRsltQ2ac.TempUpMean;
tstRslt.TempUpStart = testRsltQ2ac.TempUpStart;
tstRslt.TempUpEnd = testRsltQ2ac.TempUpEnd;
tstRslt.TempUpMin = testRsltQ2ac.TempUpMin;
tstRslt.TempUpMax = testRsltQ2ac.TempUpMax;
tstRslt.TempDownMean = testRsltQ2ac.TempDownMean;
tstRslt.TempDownStart = testRsltQ2ac.TempDownStart;
tstRslt.TempDownEnd = testRsltQ2ac.TempDownEnd;
tstRslt.TempDownMin = testRsltQ2ac.TempDownMin;
tstRslt.TempDownMax = testRsltQ2ac.TempDownMax;
tstRslt.TempDivMean = testRsltQ2ac.TempDivMean;
tstRslt.TempDivStart = testRsltQ2ac.TempDivStart;
tstRslt.TempDivEnd = testRsltQ2ac.TempDivEnd;
tstRslt.TempDivMin = testRsltQ2ac.TempDivMin;
tstRslt.TempDivMax = testRsltQ2ac.TempDivMax;
tstRslt.DensityIn = testRsltQ2ac.DensityIn;
tstRslt.DensityLine = testRsltQ2ac.DensityLine;
tstRslt.DensityDiv = testRsltQ2ac.DensityDiv;
tstRslt.StartTime = testRsltQ2ac.StartTime;
tstRslt.EndTime = testRsltQ2ac.EndTime;
tstRslt.FlowSetTime = testRsltQ2ac.FlowSetTime;
tstRslt.TestTime = testRsltQ2ac.TestTime;
tstRslt.PulsesMaster = testRsltQ2ac.PulsesMaster;
tstRslt.ConstMasterRaw = testRsltQ2ac.ConstMasterRaw;
tstRslt.ConstMaster = testRsltQ2ac.ConstMaster;
tstRslt.MassStartRaw = testRsltQ2ac.MassStartRaw;
tstRslt.MassStart = testRsltQ2ac.MassStart;
tstRslt.MassEndRaw = testRsltQ2ac.MassEndRaw;
tstRslt.MassEnd = testRsltQ2ac.MassEnd;
tstRslt.MassOfEvapWater = testRsltQ2ac.MassOfEvapWater;
//tstRslt.FlowMass = testRsltQ2ac.FlowMass;
//tstRslt.FlowVolume = testRsltQ2ac.FlowVolume;
tstRslt.VolumeCTV = testRsltQ2ac.VolumeCTV;
tstRslt.VolumeMaster = testRsltQ2ac.VolumeMaster;
tstRslt.ErrorMaster = testRsltQ2ac.ErrorMaster;
tstRslt.FlowMean = testRsltQ2ac.FlowMean;
tstRslt.FlowMin = testRsltQ2ac.FlowMin;
tstRslt.FlowMax = testRsltQ2ac.FlowMax;
tstRslt.Custom1 = testRsltQ2ac.Custom1;
tstRslt.Custom2 = testRsltQ2ac.Custom2;
tstRslt.Custom3 = testRsltQ2ac.Custom3;
tstRslt.Custom4 = testRsltQ2ac.Custom4;
tstRslt.Custom5 = testRsltQ2ac.Custom5;
tstRslt.Custom6 = testRsltQ2ac.Custom6;
tstRslt.Custom7 = testRsltQ2ac.Custom7;
tstRslt.Custom8 = testRsltQ2ac.Custom8;
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
{
Results.Entities.MeterTestRslt meterRslt = ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
Results.Entities.MeterTestRslt meterRsltQ2bc = ProcessData.BatchRslts.GetMeterTestRslt(testNameQ2bc, i, CompoundMeterId.Single);
Results.Entities.MeterTestRslt meterRsltQ2ac = ProcessData.BatchRslts.GetMeterTestRslt(testNameQ2ac, i, CompoundMeterId.Single);
if ((meterRslt != null) && (meterRsltQ2bc != null) && (meterRsltQ2ac != null))
{
meterRslt.PulsesMeter = meterRsltQ2ac.PulsesMeter;
meterRslt.PulsesMaster = meterRsltQ2ac.PulsesMaster;
meterRslt.PulsesPerLiter = meterRsltQ2ac.PulsesPerLiter;
meterRslt.VolumeRef = meterRsltQ2ac.VolumeRef;
meterRslt.TestTime = meterRsltQ2ac.TestTime;
meterRslt.VolumeStart = meterRsltQ2ac.VolumeStart;
meterRslt.VolumeEnd = meterRsltQ2ac.VolumeEnd;
meterRslt.VolumeMeter = meterRsltQ2ac.VolumeMeter;
meterRslt.Error = meterRsltQ2ac.Error;
meterRslt.TestDone = meterRsltQ2ac.TestDone;
tstRslt.TestDone = true;
if (((meterRsltQ2bc.Error < -0.51) && (meterRsltQ2ac.Error < meterRsltQ2bc.Error)) ||
((meterRsltQ2bc.Error > +0.51) && (meterRsltQ2ac.Error > meterRsltQ2bc.Error)))
{
meterRslt.Passed = false; /// Q2 correction check failed
}
else
{
meterRslt.Passed = true; /// Q2 correction check passed
}
}
}
}
}
}
+3
View File
@@ -14,6 +14,8 @@ using TBF.Rig.GenericDevices;
using TBF.Rig.Sequences;
using Dirichlet.Numerics;
using TBF.Resources;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication.common;
namespace TBF.Rig
{
@@ -154,6 +156,7 @@ namespace TBF.Rig
TestMethod2Class = new Dictionary<string, string>();
ProcessData.IperlHeads = new List<TestMethods.iPerlCommunication.iPerlHead.IperlHead>();
ProcessData.IperlHeadsUni = new List<IntIPerlReader>();
SequenceBase.FlowMeters = new List<IFlowMeter>();
SequenceBase.RegVPositions = new List<RegValvePosition>();
SequenceBase.PumpsWithFM = new List<IPumpFM>();
+2 -1
View File
@@ -128,7 +128,8 @@ namespace TBF.Rig
new BuiltIn.PumpTandem.PumpFactory(),
new RegisterReaders.DataStream.MefImport.Factory(), /// 'Interface for data stream stream via MEF'
new RegisterReaders.DataStream.Reader.Factory(), /// 'RegisterReader for data stream stream via MEF'
new RegisterReaders.FrequencyMeterFromUniCB.Factory(), ///
new RegisterReaders.FrequencyMeterFromUniCB.Factory(), ///
new RegisterReaders.iPerlReaderUNI.Factory(), /// 'RegisterReader for Smart Meters'
new RegisterReaders.PulsesFromUniCB.Factory(), /// 'RegisterReader'
new RegisterReaders.StandingStartStop.Factory(), /// 'RegisterReader for standing start/stop'
new TestMethods.iPerlCommunication.iPerlHead.Factory(), /// 'RegisterReader for iPerl'
@@ -0,0 +1,32 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using TBF.Resources;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
namespace TBF.Rig.TestMethods.SmartTest
{
public class SequenceConditionOp : ISequenceConditionOp, IOperation
{
public SequenceConditionOp(TestMethod testMethodComponent, ConditionId id)
: base(testMethodComponent, id)
{
}
public void Start() { }
public Event Run()
{
bool conditionMet = testMethodComponent.IsMeterCommMilestone((int)id);// IperlCommMilestone[(int)id];
return conditionMet ? Event.ConditionMet : Event.ConditionNotMet;
}
public void Stop() { }
public override string ToString()
{
return GetConditionNameFmt(id);
}
}
}
+180
View File
@@ -0,0 +1,180 @@
///
/// Copyright (c) 2015-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Common;
using Config.Entities;
using TBF.Rig.GenericDevices;
using TBF.Rig.Sequences;
using TBF.Rig.Uni.SharedDialogs.SmartMetersCommunication;
using TBF.UiBridge;
using iPerlCommunicationSeq = TBF.Rig.Sequences.iPerlCommunicationSeq;
using TestMethodCfg = TBF.Rig.RegisterReaders.iPerlReaderUNI.TestMethodCfg;
namespace TBF.Rig.TestMethods.SmartTest
{
public class TestMethod : SmartComponentBase, ISimultTestMethod, ISequenceCondition, ISessionDataMngmnt, ISmartTestMethod
{
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
protected static readonly ILog rfidDataLogger = LogManager.GetLogger("RfidData");
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; }
public bool DoTransitions() { return false; }
public bool SimultWithPrevious { get { return testMethodCfg.TestParams.SimultWithPrevious; } }
public bool SimultWithNext { get { return testMethodCfg.TestParams.SimultWithNext; } }
#region Configuration Change Handling
public static void OnCfgChange(object sender, CfgChangeArgs args)
{
if (CfgChangeHandler == null) return;
try { CfgChangeHandler(sender, args); }
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
}
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
public override void StartChangeHandler()
{
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
{
TestMethodCfg tmpCfg = args.Cfg as TestMethodCfg;
if (tmpCfg != null && tmpCfg.Name.Equals(Name))
{
if (args.Command == CfgChangeCmd.CfgChange)
{
testMethodCfg.CommTimeout = tmpCfg.CommTimeout;
testMethodCfg.DelayBetweenRetries = tmpCfg.DelayBetweenRetries;
testMethodCfg.MaxCommRetries = tmpCfg.MaxCommRetries;
testMethodCfg.IperlCheckErrorsToStop = tmpCfg.IperlCheckErrorsToStop;
testMethodCfg.UseWebService = tmpCfg.UseWebService;
testMethodCfg.BaseUrl = tmpCfg.BaseUrl;
testMethodCfg.RelativeUrl = tmpCfg.RelativeUrl;
}
}
};
}
public override void MeterCommMilestone(int iItem, bool bValue)
{
IperlCommMilestone[iItem] = bValue;
}
public override bool IsMeterCommMilestone(int iItem)
{
return IperlCommMilestone[iItem];
}
#endregion Configuration Change Handling
readonly TestMethodCfg testMethodCfg;
public bool[] IperlCommMilestone;
IList<IOperation> sequenceConditionOps;
public TestMethod()
{
CreateMilestonesAndConditions();
}
public TestMethod(Generic.IComponentCfg cfg)
: base(cfg)
{
testMethodCfg = cfg as TestMethodCfg;
CreateMilestonesAndConditions();
}
void CreateMilestonesAndConditions()
{
IperlCommMilestone = new bool[(int)ConditionId.Count];
sequenceConditionOps = new List<IOperation>();
for (ConditionId id = ConditionId.A; id < ConditionId.Count; id++)
{
sequenceConditionOps.Add(new SequenceConditionOp(this, id));
}
}
/// IDevice interface - only Initialize() is used
public override void Initialize()
{
if (DebugLevel == DebugMode.Normal)
{
rfidDataLogger.Fatal("------------------------------------------------------------------------");
rfidDataLogger.FatalFormat("Test Bench Framework ver. {0}", Program.Version);
log.FatalFormat("{0} initialized: {1}", Name, this);
}
else
{
log.FatalFormat("{0} simulated: {1}", Name, this);
}
}
public IList<Event> Execute(Test test, int repetNr, bool isLastRepetition)
{
if (DebugLevel == DebugMode.Normal)
{
return (new iPerlCommunicationSeq()).Execute(test, repetNr, this, testMethodCfg.TestParams);
}
else
{
/// DebugLevel == DebugMode.Simulate
(new iPerlCommunicationSeq()).MakeSimulatedTrivial(test, repetNr, test.Part);
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, 1, Progress.Completed));
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name, ProcessData.BatchRslts.GetTestRslt(Common.Utils.GetTestName(test.Name, 1, 1), 0)));
return new List<Event> { Event.Done };
}
}
public int ConditionsCount { get { return (int)ConditionId.Count; } }
public string ConditionName(int i)
{
return (i >= 0 && i < (int)ConditionId.Count) ? ConditionOp(i).ToString() : string.Empty;
}
public IOperation ConditionOp(int i)
{
return (i >= 0 && i < (int)ConditionId.Count) ? sequenceConditionOps[i] : null;
}
public void StartSession()
{
/// Clear milestones
if (IperlCommMilestone != null)
{
for (int i = 0; i < IperlCommMilestone.Length; i++)
{
IperlCommMilestone[i] = false;
}
}
}
public void SaveMark(object o)
{
/// No marks
}
public void EndSession()
{
/// Nothing at the end of session
}
public bool CheckDeviceCaps(Test test, OutputPath devices, out string message)
{
// Implement the method to satisfy the ITestMethod interface.
// For now, provide a basic implementation.
message = "Device capabilities check not implemented.";
return true;
}
}
}
@@ -0,0 +1,310 @@
///
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Common;
using Config.Entities;
using TBF.Rig.Generic;
using TBF.Resources;
using TBF.Rig.RegisterReaders.CommonRR.IPerl;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
namespace TBF.Rig.TestMethods.SmartTest
{
public partial class TestMethodCfgCtrl : Configs.ConfigCtrlUtils, IComponentCfgCtrl
{
public bool ShowMore { get { return false; } }
ITestMethodCfg config;
public IComponentCfg Config
{
get { return config as IComponentCfg; }
set
{
config = value as TestMethodCfg;
Redraw();
}
}
public TestMethodCfgCtrl()
{
InitializeComponent();
}
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
{
Redraw();
}
public void Closing()
{
}
void Redraw()
{
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
commTimeoutTextBox.Text = config.CommTimeout.ToString();
maxCommRetriesTextBox.Text = config.MaxCommRetries.ToString();
delayBetweenRetriesTextBox.Text = config.DelayBetweenRetries.ToString();
nrThreadsTextBox.Text = config.NrThreads.ToString();
if (config is IiPerlTestMethodCfg cfg)
{
iperlCheckErrorsToStopTextBox.Text = cfg.IperlCheckErrorsToStop.ToString();
textBox15rl.Text = cfg.DfltQ2c_15_rl.ToString();
textBox15lr.Text = cfg.DfltQ2c_15_lr.ToString();
textBox20rl.Text = cfg.DfltQ2c_20_rl.ToString();
textBox20lr.Text = cfg.DfltQ2c_20_lr.ToString();
textBox25_63rl.Text = cfg.DfltQ2c_25_63_rl.ToString();
textBox25_63lr.Text = cfg.DfltQ2c_25_63_lr.ToString();
textBox25_10rl.Text = cfg.DfltQ2c_25_10_rl.ToString();
textBox25_10lr.Text = cfg.DfltQ2c_25_10_lr.ToString();
textBox32rl.Text = cfg.DfltQ2c_32_rl.ToString();
textBox32lr.Text = cfg.DfltQ2c_32_lr.ToString();
textBox40rl.Text = cfg.DfltQ2c_40_rl.ToString();
textBox40lr.Text = cfg.DfltQ2c_40_lr.ToString();
}
useWebServiceCheckBox.Checked = config.UseWebService;
baseUrlTextBox.Text = config.BaseUrl;
relativeUrlTextBox.Text = config.RelativeUrl;
}
public void Unlock()
{
nameTextBox.Enabled = true;
commTimeoutTextBox.Enabled = true;
maxCommRetriesTextBox.Enabled = true;
delayBetweenRetriesTextBox.Enabled = true;
nrThreadsTextBox.Enabled = true;
iperlCheckErrorsToStopTextBox.Enabled = true;
textBox15rl.Enabled = true;
textBox15lr.Enabled = true;
textBox20rl.Enabled = true;
textBox20lr.Enabled = true;
textBox25_63rl.Enabled = true;
textBox25_63lr.Enabled = true;
textBox25_10rl.Enabled = true;
textBox25_10lr.Enabled = true;
textBox32rl.Enabled = true;
textBox32lr.Enabled = true;
textBox40rl.Enabled = true;
textBox40lr.Enabled = true;
useWebServiceCheckBox.Enabled = true;
ManageCheckGroupBox(useWebServiceCheckBox, useWebServiceGroupBox);
baseUrlTextBox.Enabled = useWebServiceCheckBox.Enabled;
relativeUrlTextBox.Enabled = useWebServiceCheckBox.Enabled;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int dummy;
if (!int.TryParse(commTimeoutTextBox.Text, out dummy) || dummy < 500 || dummy > 5000)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Comm. timeout' should be in range 500 .. 5000";
}
if (!int.TryParse(maxCommRetriesTextBox.Text, out dummy) || dummy < 1 || dummy > 10)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Max. retries' should be in range 1 .. 10";
}
if (!int.TryParse(delayBetweenRetriesTextBox.Text, out dummy) || dummy < 0 || dummy > 5000)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Comm. timeout' should be in range 0 .. 5000";
}
if (!int.TryParse(nrThreadsTextBox.Text, out dummy) || (dummy != 1 && dummy != 2 && dummy != 4))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "'Nr. threads' should be 1, 2 or 4";
}
if (!int.TryParse(iperlCheckErrorsToStopTextBox.Text, out dummy) || ((dummy < 1) && (dummy > 40)))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format(Strings.Invalid_0, iperlCheckErrorsToStopLabel.Text);
}
if (!int.TryParse(textBox15rl.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN15 RL should be in range -50 .. 50";
}
if (!int.TryParse(textBox15lr.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN15 LR should be in range -50 .. 50";
}
if (!int.TryParse(textBox20rl.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN20 RL should be in range -50 .. 50";
}
if (!int.TryParse(textBox20lr.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN20 LR should be in range -50 .. 50";
}
if (!int.TryParse(textBox25_63rl.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 6.3 RL should be in range -50 .. 50";
}
if (!int.TryParse(textBox25_63lr.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 6.3 LR should be in range -50 .. 50";
}
if (!int.TryParse(textBox25_10rl.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 10 RL should be in range -50 .. 50";
}
if (!int.TryParse(textBox25_10lr.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN25 Q3 10 LR should be in range -50 .. 50";
}
if (!int.TryParse(textBox32rl.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN32 RL should be in range -50 .. 50";
}
if (!int.TryParse(textBox32lr.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN32 LR should be in range -50 .. 50";
}
if (!int.TryParse(textBox40rl.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN40 RL should be in range -50 .. 50";
}
if (!int.TryParse(textBox40lr.Text, out dummy) || dummy < -50 || dummy > 50)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Default Q2 correction factor DN40 LR should be in range -50 .. 50";
}
return flags;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config.Name != nameTextBox.Text)
{
config.Name = nameTextBox.Text;
flags |= (CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
}
var CommTimeout = config.CommTimeout;
var MaxCommRetries = config.MaxCommRetries;
var DelayBetweenRetries = config.DelayBetweenRetries;
var NrThreads = config.NrThreads;
var UseWebService = config.UseWebService;
var BaseUrl = config.BaseUrl;
var RelativeUrl = config.RelativeUrl;
flags |= UpdateDifferent(ref CommTimeout, commTimeoutTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref MaxCommRetries, maxCommRetriesTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DelayBetweenRetries, delayBetweenRetriesTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref NrThreads, nrThreadsTextBox.Text, CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
if (config is IiPerlTestMethodCfg cfg)
{
var IperlCheckErrorsToStop = cfg.IperlCheckErrorsToStop;
var DfltQ2c_15_rl = cfg.DfltQ2c_15_rl;
var DfltQ2c_15_lr = cfg.DfltQ2c_15_lr;
var DfltQ2c_20_rl = cfg.DfltQ2c_20_rl;
var DfltQ2c_20_lr = cfg.DfltQ2c_20_lr;
var DfltQ2c_25_63_rl = cfg.DfltQ2c_25_63_rl;
var DfltQ2c_25_63_lr = cfg.DfltQ2c_25_63_lr;
var DfltQ2c_25_10_rl = cfg.DfltQ2c_25_10_rl;
var DfltQ2c_25_10_lr = cfg.DfltQ2c_25_10_lr;
var DfltQ2c_32_rl = cfg.DfltQ2c_32_rl;
var DfltQ2c_32_lr = cfg.DfltQ2c_32_lr;
var DfltQ2c_40_rl = cfg.DfltQ2c_40_rl;
var DfltQ2c_40_lr = cfg.DfltQ2c_40_lr;
flags |= UpdateDifferent(ref IperlCheckErrorsToStop, iperlCheckErrorsToStopTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_15_rl, textBox15rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_15_lr, textBox15lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_20_rl, textBox20rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_20_lr, textBox20lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_25_63_rl, textBox25_63rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_25_63_lr, textBox25_63lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_25_10_rl, textBox25_10rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_25_10_lr, textBox25_10lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_32_rl, textBox32rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_32_lr, textBox32lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_40_rl, textBox40rl.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref DfltQ2c_40_lr, textBox40lr.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
cfg.IperlCheckErrorsToStop = IperlCheckErrorsToStop;
cfg.DfltQ2c_15_rl = DfltQ2c_15_rl;
cfg.DfltQ2c_15_lr = DfltQ2c_15_lr;
cfg.DfltQ2c_20_rl = DfltQ2c_20_rl;
cfg.DfltQ2c_20_lr = DfltQ2c_20_lr;
cfg.DfltQ2c_25_63_rl = DfltQ2c_25_63_rl;
cfg.DfltQ2c_25_63_lr = DfltQ2c_25_63_lr;
cfg.DfltQ2c_25_10_rl = DfltQ2c_25_10_rl;
cfg.DfltQ2c_25_10_lr = DfltQ2c_25_10_lr;
cfg.DfltQ2c_32_rl = DfltQ2c_32_rl;
cfg.DfltQ2c_32_lr = DfltQ2c_32_lr;
cfg.DfltQ2c_40_rl = DfltQ2c_40_rl;
cfg.DfltQ2c_40_lr = DfltQ2c_40_lr;
}
flags |= UpdateDifferent(ref UseWebService, useWebServiceCheckBox.Checked, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref BaseUrl, baseUrlTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
flags |= UpdateDifferent(ref RelativeUrl, relativeUrlTextBox.Text, CfgUpdateFlags.InvokeCfgChange | CfgUpdateFlags.AnyChange);
config.CommTimeout = CommTimeout;
config.MaxCommRetries = MaxCommRetries;
config.DelayBetweenRetries = DelayBetweenRetries;
config.NrThreads = NrThreads;
config.UseWebService = UseWebService;
config.BaseUrl = BaseUrl;
config.RelativeUrl = RelativeUrl;
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
{
TestMethod.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
}
return flags;
}
private void ManageCheckGroupBox(CheckBox chk, GroupBox grp)
{
/// Make sure the CheckBox isn't in the GroupBox. This will only happen the first time.
if (chk.Parent == grp)
{
grp.Parent.Controls.Add(chk); /// Reparent the CheckBox so it's not in the GroupBox.
chk.Location = new System.Drawing.Point(chk.Left + grp.Left, chk.Top + grp.Top); /// Adjust the CheckBox's location.
chk.BringToFront(); /// Move the CheckBox to the top of the stacking order.
}
/// Enable or disable the GroupBox.
grp.Enabled = chk.Checked;
}
private void useWebServiceCheckBox_CheckedChanged(object sender, EventArgs e)
{
useWebServiceGroupBox.Enabled = useWebServiceCheckBox.Checked;
}
}
}
@@ -0,0 +1,520 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Author: Milan Hanajík
///
namespace TBF.Rig.TestMethods.SmartTest
{
partial class TestMethodCfgCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.commTimeoutTextBox = new System.Windows.Forms.TextBox();
this.commTimeoutLabel = new System.Windows.Forms.Label();
this.maxCommRetriesTextBox = new System.Windows.Forms.TextBox();
this.maxNrRetriesLabel = new System.Windows.Forms.Label();
this.nrThreadsTextBox = new System.Windows.Forms.TextBox();
this.nrThreadsLabel = new System.Windows.Forms.Label();
this.iperlCheckErrorsToStopTextBox = new System.Windows.Forms.TextBox();
this.iperlCheckErrorsToStopLabel = new System.Windows.Forms.Label();
this.delayBetweenRetriesTextBox = new System.Windows.Forms.TextBox();
this.delayBetweenRetriesLabel = new System.Windows.Forms.Label();
this.relativeUrlTextBox = new System.Windows.Forms.TextBox();
this.relativeUrlLabel = new System.Windows.Forms.Label();
this.baseUrlTextBox = new System.Windows.Forms.TextBox();
this.baseUrlLabel = new System.Windows.Forms.Label();
this.useWebServiceCheckBox = new System.Windows.Forms.CheckBox();
this.useWebServiceGroupBox = new System.Windows.Forms.GroupBox();
this.dfltQ2corrFactorsGroupBox = new System.Windows.Forms.GroupBox();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox40lr = new System.Windows.Forms.TextBox();
this.textBox32lr = new System.Windows.Forms.TextBox();
this.textBox25_10lr = new System.Windows.Forms.TextBox();
this.textBox25_63lr = new System.Windows.Forms.TextBox();
this.textBox20lr = new System.Windows.Forms.TextBox();
this.textBox15lr = new System.Windows.Forms.TextBox();
this.textBox40rl = new System.Windows.Forms.TextBox();
this.textBox32rl = new System.Windows.Forms.TextBox();
this.textBox25_10rl = new System.Windows.Forms.TextBox();
this.textBox25_63rl = new System.Windows.Forms.TextBox();
this.textBox20rl = new System.Windows.Forms.TextBox();
this.textBox15rl = new System.Windows.Forms.TextBox();
this.useWebServiceGroupBox.SuspendLayout();
this.dfltQ2corrFactorsGroupBox.SuspendLayout();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(237, 31);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(130, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(23, 34);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
this.nameLabel.Text = "Name";
//
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(234, 11);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// commTimeoutTextBox
//
this.commTimeoutTextBox.Enabled = false;
this.commTimeoutTextBox.Location = new System.Drawing.Point(237, 53);
this.commTimeoutTextBox.Name = "commTimeoutTextBox";
this.commTimeoutTextBox.Size = new System.Drawing.Size(45, 20);
this.commTimeoutTextBox.TabIndex = 4;
//
// commTimeoutLabel
//
this.commTimeoutLabel.AutoSize = true;
this.commTimeoutLabel.Location = new System.Drawing.Point(23, 56);
this.commTimeoutLabel.Name = "commTimeoutLabel";
this.commTimeoutLabel.Size = new System.Drawing.Size(98, 13);
this.commTimeoutLabel.TabIndex = 3;
this.commTimeoutLabel.Text = "Comm. timeout [ms]";
//
// maxCommRetriesTextBox
//
this.maxCommRetriesTextBox.Enabled = false;
this.maxCommRetriesTextBox.Location = new System.Drawing.Point(237, 75);
this.maxCommRetriesTextBox.Name = "maxCommRetriesTextBox";
this.maxCommRetriesTextBox.Size = new System.Drawing.Size(45, 20);
this.maxCommRetriesTextBox.TabIndex = 6;
//
// maxNrRetriesLabel
//
this.maxNrRetriesLabel.AutoSize = true;
this.maxNrRetriesLabel.Location = new System.Drawing.Point(23, 78);
this.maxNrRetriesLabel.Name = "maxNrRetriesLabel";
this.maxNrRetriesLabel.Size = new System.Drawing.Size(61, 13);
this.maxNrRetriesLabel.TabIndex = 5;
this.maxNrRetriesLabel.Text = "Max. retries";
//
// nrThreadsTextBox
//
this.nrThreadsTextBox.Enabled = false;
this.nrThreadsTextBox.Location = new System.Drawing.Point(237, 119);
this.nrThreadsTextBox.Name = "nrThreadsTextBox";
this.nrThreadsTextBox.Size = new System.Drawing.Size(45, 20);
this.nrThreadsTextBox.TabIndex = 10;
//
// nrThreadsLabel
//
this.nrThreadsLabel.AutoSize = true;
this.nrThreadsLabel.Location = new System.Drawing.Point(23, 122);
this.nrThreadsLabel.Name = "nrThreadsLabel";
this.nrThreadsLabel.Size = new System.Drawing.Size(59, 13);
this.nrThreadsLabel.TabIndex = 9;
this.nrThreadsLabel.Text = "Nr. threads";
//
// iperlCheckErrorsToStopTextBox
//
this.iperlCheckErrorsToStopTextBox.Enabled = false;
this.iperlCheckErrorsToStopTextBox.Location = new System.Drawing.Point(237, 141);
this.iperlCheckErrorsToStopTextBox.Name = "iperlCheckErrorsToStopTextBox";
this.iperlCheckErrorsToStopTextBox.Size = new System.Drawing.Size(45, 20);
this.iperlCheckErrorsToStopTextBox.TabIndex = 13;
//
// iperlCheckErrorsToStopLabel
//
this.iperlCheckErrorsToStopLabel.AutoSize = true;
this.iperlCheckErrorsToStopLabel.Location = new System.Drawing.Point(23, 144);
this.iperlCheckErrorsToStopLabel.Name = "iperlCheckErrorsToStopLabel";
this.iperlCheckErrorsToStopLabel.Size = new System.Drawing.Size(202, 13);
this.iperlCheckErrorsToStopLabel.TabIndex = 12;
this.iperlCheckErrorsToStopLabel.Text = "iperl_check errors count to stop the cycle";
//
// delayBetweenRetriesTextBox
//
this.delayBetweenRetriesTextBox.Enabled = false;
this.delayBetweenRetriesTextBox.Location = new System.Drawing.Point(237, 97);
this.delayBetweenRetriesTextBox.Name = "delayBetweenRetriesTextBox";
this.delayBetweenRetriesTextBox.Size = new System.Drawing.Size(45, 20);
this.delayBetweenRetriesTextBox.TabIndex = 8;
//
// delayBetweenRetriesLabel
//
this.delayBetweenRetriesLabel.AutoSize = true;
this.delayBetweenRetriesLabel.Location = new System.Drawing.Point(23, 100);
this.delayBetweenRetriesLabel.Name = "delayBetweenRetriesLabel";
this.delayBetweenRetriesLabel.Size = new System.Drawing.Size(131, 13);
this.delayBetweenRetriesLabel.TabIndex = 7;
this.delayBetweenRetriesLabel.Text = "Delay between retries [ms]";
//
// relativeUrlTextBox
//
this.relativeUrlTextBox.Enabled = false;
this.relativeUrlTextBox.Location = new System.Drawing.Point(89, 50);
this.relativeUrlTextBox.Name = "relativeUrlTextBox";
this.relativeUrlTextBox.Size = new System.Drawing.Size(298, 20);
this.relativeUrlTextBox.TabIndex = 18;
//
// relativeUrlLabel
//
this.relativeUrlLabel.AutoSize = true;
this.relativeUrlLabel.Location = new System.Drawing.Point(13, 53);
this.relativeUrlLabel.Name = "relativeUrlLabel";
this.relativeUrlLabel.Size = new System.Drawing.Size(71, 13);
this.relativeUrlLabel.TabIndex = 17;
this.relativeUrlLabel.Text = "Relative URL";
//
// baseUrlTextBox
//
this.baseUrlTextBox.Enabled = false;
this.baseUrlTextBox.Location = new System.Drawing.Point(89, 24);
this.baseUrlTextBox.Name = "baseUrlTextBox";
this.baseUrlTextBox.Size = new System.Drawing.Size(298, 20);
this.baseUrlTextBox.TabIndex = 16;
//
// baseUrlLabel
//
this.baseUrlLabel.AutoSize = true;
this.baseUrlLabel.Location = new System.Drawing.Point(13, 27);
this.baseUrlLabel.Name = "baseUrlLabel";
this.baseUrlLabel.Size = new System.Drawing.Size(56, 13);
this.baseUrlLabel.TabIndex = 15;
this.baseUrlLabel.Text = "Base URL";
//
// useWebServiceCheckBox
//
this.useWebServiceCheckBox.AutoSize = true;
this.useWebServiceCheckBox.Enabled = false;
this.useWebServiceCheckBox.Location = new System.Drawing.Point(15, 0);
this.useWebServiceCheckBox.Name = "useWebServiceCheckBox";
this.useWebServiceCheckBox.Size = new System.Drawing.Size(189, 17);
this.useWebServiceCheckBox.TabIndex = 14;
this.useWebServiceCheckBox.Text = "Use web service for default values";
this.useWebServiceCheckBox.UseVisualStyleBackColor = true;
this.useWebServiceCheckBox.CheckedChanged += new System.EventHandler(this.useWebServiceCheckBox_CheckedChanged);
//
// useWebServiceGroupBox
//
this.useWebServiceGroupBox.Controls.Add(this.baseUrlTextBox);
this.useWebServiceGroupBox.Controls.Add(this.useWebServiceCheckBox);
this.useWebServiceGroupBox.Controls.Add(this.relativeUrlTextBox);
this.useWebServiceGroupBox.Controls.Add(this.relativeUrlLabel);
this.useWebServiceGroupBox.Controls.Add(this.baseUrlLabel);
this.useWebServiceGroupBox.Location = new System.Drawing.Point(11, 266);
this.useWebServiceGroupBox.Name = "useWebServiceGroupBox";
this.useWebServiceGroupBox.Size = new System.Drawing.Size(404, 83);
this.useWebServiceGroupBox.TabIndex = 0;
this.useWebServiceGroupBox.TabStop = false;
//
// dfltQ2corrFactorsGroupBox
//
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label8);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label7);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label6);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label5);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label4);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label3);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label2);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.label1);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox40lr);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox32lr);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_10lr);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_63lr);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox20lr);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox15lr);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox40rl);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox32rl);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_10rl);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox25_63rl);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox20rl);
this.dfltQ2corrFactorsGroupBox.Controls.Add(this.textBox15rl);
this.dfltQ2corrFactorsGroupBox.Location = new System.Drawing.Point(11, 175);
this.dfltQ2corrFactorsGroupBox.Name = "dfltQ2corrFactorsGroupBox";
this.dfltQ2corrFactorsGroupBox.Size = new System.Drawing.Size(404, 85);
this.dfltQ2corrFactorsGroupBox.TabIndex = 14;
this.dfltQ2corrFactorsGroupBox.TabStop = false;
this.dfltQ2corrFactorsGroupBox.Text = "Default Q2 correction factors";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(344, 17);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(35, 13);
this.label8.TabIndex = 19;
this.label8.Text = "DN40";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(289, 17);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(35, 13);
this.label7.TabIndex = 18;
this.label7.Text = "DN32";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(233, 17);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(45, 13);
this.label6.TabIndex = 17;
this.label6.Text = "...Q3 10";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(163, 17);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(70, 13);
this.label5.TabIndex = 16;
this.label5.Text = "DN25 Q3 6.3";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(121, 17);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(35, 13);
this.label4.TabIndex = 15;
this.label4.Text = "DN20";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(65, 17);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(35, 13);
this.label3.TabIndex = 14;
this.label3.Text = "DN15";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(22, 57);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(24, 13);
this.label2.TabIndex = 13;
this.label2.Text = "L-R";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(22, 34);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(24, 13);
this.label1.TabIndex = 12;
this.label1.Text = "R-L";
//
// textBox40lr
//
this.textBox40lr.Enabled = false;
this.textBox40lr.Location = new System.Drawing.Point(337, 54);
this.textBox40lr.Name = "textBox40lr";
this.textBox40lr.Size = new System.Drawing.Size(50, 20);
this.textBox40lr.TabIndex = 11;
//
// textBox32lr
//
this.textBox32lr.Enabled = false;
this.textBox32lr.Location = new System.Drawing.Point(281, 54);
this.textBox32lr.Name = "textBox32lr";
this.textBox32lr.Size = new System.Drawing.Size(50, 20);
this.textBox32lr.TabIndex = 10;
//
// textBox25_10lr
//
this.textBox25_10lr.Enabled = false;
this.textBox25_10lr.Location = new System.Drawing.Point(225, 54);
this.textBox25_10lr.Name = "textBox25_10lr";
this.textBox25_10lr.Size = new System.Drawing.Size(50, 20);
this.textBox25_10lr.TabIndex = 9;
//
// textBox25_63lr
//
this.textBox25_63lr.Enabled = false;
this.textBox25_63lr.Location = new System.Drawing.Point(169, 54);
this.textBox25_63lr.Name = "textBox25_63lr";
this.textBox25_63lr.Size = new System.Drawing.Size(50, 20);
this.textBox25_63lr.TabIndex = 8;
//
// textBox20lr
//
this.textBox20lr.Enabled = false;
this.textBox20lr.Location = new System.Drawing.Point(113, 54);
this.textBox20lr.Name = "textBox20lr";
this.textBox20lr.Size = new System.Drawing.Size(50, 20);
this.textBox20lr.TabIndex = 7;
//
// textBox15lr
//
this.textBox15lr.Enabled = false;
this.textBox15lr.Location = new System.Drawing.Point(57, 54);
this.textBox15lr.Name = "textBox15lr";
this.textBox15lr.Size = new System.Drawing.Size(50, 20);
this.textBox15lr.TabIndex = 6;
//
// textBox40rl
//
this.textBox40rl.Enabled = false;
this.textBox40rl.Location = new System.Drawing.Point(337, 31);
this.textBox40rl.Name = "textBox40rl";
this.textBox40rl.Size = new System.Drawing.Size(50, 20);
this.textBox40rl.TabIndex = 5;
//
// textBox32rl
//
this.textBox32rl.Enabled = false;
this.textBox32rl.Location = new System.Drawing.Point(281, 31);
this.textBox32rl.Name = "textBox32rl";
this.textBox32rl.Size = new System.Drawing.Size(50, 20);
this.textBox32rl.TabIndex = 4;
//
// textBox25_10rl
//
this.textBox25_10rl.Enabled = false;
this.textBox25_10rl.Location = new System.Drawing.Point(225, 31);
this.textBox25_10rl.Name = "textBox25_10rl";
this.textBox25_10rl.Size = new System.Drawing.Size(50, 20);
this.textBox25_10rl.TabIndex = 3;
//
// textBox25_63rl
//
this.textBox25_63rl.Enabled = false;
this.textBox25_63rl.Location = new System.Drawing.Point(169, 31);
this.textBox25_63rl.Name = "textBox25_63rl";
this.textBox25_63rl.Size = new System.Drawing.Size(50, 20);
this.textBox25_63rl.TabIndex = 2;
//
// textBox20rl
//
this.textBox20rl.Enabled = false;
this.textBox20rl.Location = new System.Drawing.Point(113, 31);
this.textBox20rl.Name = "textBox20rl";
this.textBox20rl.Size = new System.Drawing.Size(50, 20);
this.textBox20rl.TabIndex = 1;
//
// textBox15rl
//
this.textBox15rl.Enabled = false;
this.textBox15rl.Location = new System.Drawing.Point(57, 31);
this.textBox15rl.Name = "textBox15rl";
this.textBox15rl.Size = new System.Drawing.Size(50, 20);
this.textBox15rl.TabIndex = 0;
//
// TestMethodCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.dfltQ2corrFactorsGroupBox);
this.Controls.Add(this.useWebServiceGroupBox);
this.Controls.Add(this.delayBetweenRetriesTextBox);
this.Controls.Add(this.delayBetweenRetriesLabel);
this.Controls.Add(this.iperlCheckErrorsToStopTextBox);
this.Controls.Add(this.iperlCheckErrorsToStopLabel);
this.Controls.Add(this.nrThreadsTextBox);
this.Controls.Add(this.nrThreadsLabel);
this.Controls.Add(this.maxCommRetriesTextBox);
this.Controls.Add(this.maxNrRetriesLabel);
this.Controls.Add(this.commTimeoutTextBox);
this.Controls.Add(this.commTimeoutLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "TestMethodCfgCtrl";
this.Size = new System.Drawing.Size(427, 363);
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
this.useWebServiceGroupBox.ResumeLayout(false);
this.useWebServiceGroupBox.PerformLayout();
this.dfltQ2corrFactorsGroupBox.ResumeLayout(false);
this.dfltQ2corrFactorsGroupBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.TextBox commTimeoutTextBox;
private System.Windows.Forms.Label commTimeoutLabel;
private System.Windows.Forms.TextBox maxCommRetriesTextBox;
private System.Windows.Forms.Label maxNrRetriesLabel;
private System.Windows.Forms.TextBox nrThreadsTextBox;
private System.Windows.Forms.Label nrThreadsLabel;
private System.Windows.Forms.TextBox iperlCheckErrorsToStopTextBox;
private System.Windows.Forms.Label iperlCheckErrorsToStopLabel;
private System.Windows.Forms.TextBox delayBetweenRetriesTextBox;
private System.Windows.Forms.Label delayBetweenRetriesLabel;
private System.Windows.Forms.TextBox relativeUrlTextBox;
private System.Windows.Forms.Label relativeUrlLabel;
private System.Windows.Forms.TextBox baseUrlTextBox;
private System.Windows.Forms.Label baseUrlLabel;
private System.Windows.Forms.CheckBox useWebServiceCheckBox;
private System.Windows.Forms.GroupBox useWebServiceGroupBox;
private System.Windows.Forms.GroupBox dfltQ2corrFactorsGroupBox;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox40lr;
private System.Windows.Forms.TextBox textBox32lr;
private System.Windows.Forms.TextBox textBox25_10lr;
private System.Windows.Forms.TextBox textBox25_63lr;
private System.Windows.Forms.TextBox textBox20lr;
private System.Windows.Forms.TextBox textBox15lr;
private System.Windows.Forms.TextBox textBox40rl;
private System.Windows.Forms.TextBox textBox32rl;
private System.Windows.Forms.TextBox textBox25_10rl;
private System.Windows.Forms.TextBox textBox25_63rl;
private System.Windows.Forms.TextBox textBox20rl;
private System.Windows.Forms.TextBox textBox15rl;
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,25 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.Rig.Generic;
using TBF.Rig.RegisterReaders.iPerlReaderUNI;
namespace TBF.Rig.TestMethods.SmartTest
{
public class TestMethodFactory : IComponentFactory
{
public string ClassName { get { return GetType().Namespace.Substring(8); } }
public IComponent DummyComponent() { return new TestMethod(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new TestMethod(cfg); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}

Some files were not shown because too many files have changed in this diff Show More