diff --git a/Common/Common.sln b/Common/Common.sln
index 7a228079..51e1d99f 100644
--- a/Common/Common.sln
+++ b/Common/Common.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.14.36310.24
+# Visual Studio 15
+VisualStudioVersion = 15.0.33423.255
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{7A0EE7B8-6B7E-41E9-B679-319C8CA48CF1}"
EndProject
@@ -344,7 +344,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaPackages.Features.Cordon
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaPackages.Extensions", "LaaPackages\LaaPackages.Extensions\LaaPackages.Extensions.csproj", "{15A06398-ECB6-49C9-ACB4-52A495A886A6}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaProductionWeb.Resources", "LaaPackages\LaaProductionWeb.Resources\LaaProductionWeb.Resources.csproj", "{DA65E376-3D35-4D96-913A-7197FCA6DF48}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaProductionWeb.Resources", "LaaPackages\LaaProductionWeb.Resources\LaaProductionWeb.Resources.csproj", "{9E070488-15DE-418A-8606-5B79056C6E9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserAccessCtrl", "Utils\UserAccessCtrl\UserAccessCtrl.csproj", "{2D55BBD1-5373-484C-8781-C6ECEAFC2A90}"
EndProject
@@ -365,6 +365,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SIRT", "SIRT", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
_MANUAL_CONTROL|Any CPU = _MANUAL_CONTROL|Any CPU
_MANUAL_CONTROL|Mixed Platforms = _MANUAL_CONTROL|Mixed Platforms
@@ -5547,14 +5550,14 @@ Global
{F90B940C-9A83-496D-AAE0-11CD02CE0A22}.ReleaseTest|x64.Build.0 = Release|Any CPU
{F90B940C-9A83-496D-AAE0-11CD02CE0A22}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{F90B940C-9A83-496D-AAE0-11CD02CE0A22}.ReleaseTest|x86.Build.0 = Release|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Any CPU.ActiveCfg = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Any CPU.Build.0 = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Mixed Platforms.ActiveCfg = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Mixed Platforms.Build.0 = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x64.ActiveCfg = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x64.Build.0 = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x86.ActiveCfg = VPN_Debug|Any CPU
- {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x86.Build.0 = VPN_Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x64.Build.0 = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU
+ {F90B940C-9A83-496D-AAE0-11CD02CE0A22}.VPN_Debug|x86.Build.0 = Debug|Any CPU
{F90B940C-9A83-496D-AAE0-11CD02CE0A22}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{F90B940C-9A83-496D-AAE0-11CD02CE0A22}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{F90B940C-9A83-496D-AAE0-11CD02CE0A22}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -5619,14 +5622,14 @@ Global
{C9816412-7752-4F7A-8BD2-765DB6D58B3C}.ReleaseTest|x64.Build.0 = Release|Any CPU
{C9816412-7752-4F7A-8BD2-765DB6D58B3C}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{C9816412-7752-4F7A-8BD2-765DB6D58B3C}.ReleaseTest|x86.Build.0 = Release|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Any CPU.ActiveCfg = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Any CPU.Build.0 = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Mixed Platforms.ActiveCfg = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Mixed Platforms.Build.0 = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x64.ActiveCfg = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x64.Build.0 = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x86.ActiveCfg = VPN_Debug|Any CPU
- {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x86.Build.0 = VPN_Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x64.Build.0 = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU
+ {C9816412-7752-4F7A-8BD2-765DB6D58B3C}.VPN_Debug|x86.Build.0 = Debug|Any CPU
{C9816412-7752-4F7A-8BD2-765DB6D58B3C}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{C9816412-7752-4F7A-8BD2-765DB6D58B3C}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{C9816412-7752-4F7A-8BD2-765DB6D58B3C}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -5763,14 +5766,14 @@ Global
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.ReleaseTest|x64.Build.0 = Release|Any CPU
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.ReleaseTest|x86.Build.0 = Release|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Any CPU.ActiveCfg = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Any CPU.Build.0 = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Mixed Platforms.ActiveCfg = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Mixed Platforms.Build.0 = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x64.ActiveCfg = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x64.Build.0 = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x86.ActiveCfg = VPN_Debug|Any CPU
- {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x86.Build.0 = VPN_Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x64.Build.0 = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU
+ {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.VPN_Debug|x86.Build.0 = Debug|Any CPU
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -5835,14 +5838,14 @@ Global
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.ReleaseTest|x64.Build.0 = Release|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.ReleaseTest|x86.Build.0 = Release|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Any CPU.ActiveCfg = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Any CPU.Build.0 = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Mixed Platforms.ActiveCfg = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Mixed Platforms.Build.0 = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x64.ActiveCfg = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x64.Build.0 = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x86.ActiveCfg = VPN_Debug|Any CPU
- {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x86.Build.0 = VPN_Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x64.Build.0 = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU
+ {15A06398-ECB6-49C9-ACB4-52A495A886A6}.VPN_Debug|x86.Build.0 = Debug|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -5851,78 +5854,78 @@ Global
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.XP32bit|x64.Build.0 = Release|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.XP32bit|x86.ActiveCfg = Release|Any CPU
{15A06398-ECB6-49C9-ACB4-52A495A886A6}.XP32bit|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x64.ActiveCfg = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x64.Build.0 = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x86.ActiveCfg = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x86.Build.0 = Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x86.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Any CPU.ActiveCfg = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Any CPU.Build.0 = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Mixed Platforms.ActiveCfg = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Mixed Platforms.Build.0 = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x64.ActiveCfg = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x64.Build.0 = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x86.ActiveCfg = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x86.Build.0 = VPN_Debug|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Any CPU.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x64.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x64.Build.0 = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x86.ActiveCfg = Release|Any CPU
- {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x64.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x86.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x86.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x64.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x86.Build.0 = Debug|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Any CPU.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x64.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x64.Build.0 = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x86.ActiveCfg = Release|Any CPU
+ {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x86.Build.0 = Release|Any CPU
{2D55BBD1-5373-484C-8781-C6ECEAFC2A90}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{2D55BBD1-5373-484C-8781-C6ECEAFC2A90}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{2D55BBD1-5373-484C-8781-C6ECEAFC2A90}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -6490,7 +6493,7 @@ Global
{F69A79FA-548D-4E21-887E-01FABDAD9E73} = {696A94BE-7237-4AE2-9E36-6059DE519971}
{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB} = {2E31C385-4FFC-473E-9C00-D7DC48140704}
{15A06398-ECB6-49C9-ACB4-52A495A886A6} = {2E31C385-4FFC-473E-9C00-D7DC48140704}
- {DA65E376-3D35-4D96-913A-7197FCA6DF48} = {2E31C385-4FFC-473E-9C00-D7DC48140704}
+ {9E070488-15DE-418A-8606-5B79056C6E9F} = {2E31C385-4FFC-473E-9C00-D7DC48140704}
{2D55BBD1-5373-484C-8781-C6ECEAFC2A90} = {7A0EE7B8-6B7E-41E9-B679-319C8CA48CF1}
{30BF7357-0B6C-498D-8123-5AACC66B3E5F} = {7A0EE7B8-6B7E-41E9-B679-319C8CA48CF1}
{4928FC37-15EC-4872-8514-EA4ADCC4139D} = {AE29BDE3-843C-4B9B-8B02-D3C4814028AC}
@@ -6503,9 +6506,6 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164}
EndGlobalSection
- GlobalSection(SharedMSBuildProjectFiles) = preSolution
- Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4
- EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
diff --git a/Common/CommonConsole/CommonConsole.csproj b/Common/CommonConsole/CommonConsole.csproj
index 2d2e99d3..01f48e13 100644
--- a/Common/CommonConsole/CommonConsole.csproj
+++ b/Common/CommonConsole/CommonConsole.csproj
@@ -45,6 +45,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -56,5 +70,8 @@
Common.Hardware.WaterMeter.eRegister
+
+
+
\ No newline at end of file
diff --git a/Common/CommonConsole/Program.cs b/Common/CommonConsole/Program.cs
index 8c7e648f..c3597dbc 100644
--- a/Common/CommonConsole/Program.cs
+++ b/Common/CommonConsole/Program.cs
@@ -1,23 +1,24 @@
using System;
-using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams;
namespace CommonConsole
{
public static class Program
{
- //static void Main()
- //{
- // var epoch20000101 = new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc).AddSeconds(50000);
-
- // Console.WriteLine(BitConverter.ToInt32(new byte[] { 0xF5, 0xFF, 0xFF, 0xFF }, 0));
- //}
+ static void Main()
+ {
+ SIRTServer.StartServer(Console.WriteLine, Console.WriteLine, 6);
+ SIRTServer.StartProgramming(868, 402001154, "0E9FACC6A0E1EF1C3B27A49BAC216535");
+ }
public static void MainRF(params string[] args)
{
- var pam03 = new PAM03();
+ //var pam03 = new PAM03();
- // pam03.Run("COM6", "402010030", "E6C88800DEB868C0D6A84880CE982840");
- pam03.Run("COM6", "402010027", "D9C154DC274966AB71AD5D804A322178");
+ //pam03.Run("COM6", "402010030", "E6C88800DEB868C0D6A84880CE982840");
+ //pam03.Run("COM6", "402010027", "D9C154DC274966AB71AD5D804A322178");
//return pam03.Run("COM7", "412004190", "0E9FACC6A0E1EF1C3B27A49BAC216535");
// 10402010030 E6C88800DEB868C0D6A84880CE982840
@@ -79,10 +80,14 @@ namespace CommonConsole
public const byte ALARM_METROLOGY_PARAMS = 14;
public const byte ALARM_METROLOGY_MEASURE = 15;
public const byte ALARM_MAX = 16;
- };
+ }; // ' CSD ', IIF(i.CSD_Wert IS NULL, i.CSD_Charcode, 'mit neue konfiguration')
- public static void Main()
+ public static void Main1()
{
+ Console.WriteLine(BitConverter.ToInt32(new byte[] { 0xE9, 0xFF, 0xFF, 0xFF }, 0));
+ Console.WriteLine(BitConverter.ToInt32(new byte[] { 0xAD, 0xFF, 0xFF, 0xFF }, 0));
+ Console.WriteLine(BitConverter.ToInt32(new byte[] { 0xE6, 0xFF, 0xFF, 0xFF }, 0));
+ Console.WriteLine(BitConverter.ToInt32(new byte[] { 0x03, 0x00, 0x00, 0x00 }, 0));
//var alarmMask = 1 << AlarmMask.ALARM_REBOOT
// | 1 << AlarmMask.ALARM_LOW_BATTERY
// | 0 << AlarmMask.ALARM_VERY_LOW_BATTERY
@@ -162,31 +167,32 @@ namespace CommonConsole
//Array.Reverse(fixDateReadingBytes);
//Console.WriteLine($"FDR_LOGGER: {fixDateReading} - {BitConverter.ToString(fixDateReadingBytes).Replace("-", "")}");
- var x1 = 0xD29F;
- var x2 = 0xD39F;
- Console.WriteLine(new string('=', 50));
- Console.WriteLine($"ALARM_REBOOT: [{(int)AlarmMask.ALARM_REBOOT,2}] {(x1 >> AlarmMask.ALARM_REBOOT) % 2} {(x2 >> AlarmMask.ALARM_REBOOT) % 2} ");
- Console.WriteLine($"ALARM_LOW_BATTERY: [{(int)AlarmMask.ALARM_LOW_BATTERY,2}] {(x1 >> AlarmMask.ALARM_LOW_BATTERY) % 2} {(x2 >> AlarmMask.ALARM_LOW_BATTERY) % 2} ");
- Console.WriteLine($"ALARM_VERY_LOW_BATTERY: [{(int)AlarmMask.ALARM_VERY_LOW_BATTERY,2}] {(x1 >> AlarmMask.ALARM_VERY_LOW_BATTERY) % 2} {(x2 >> AlarmMask.ALARM_VERY_LOW_BATTERY) % 2} ");
- Console.WriteLine($"ALARM_CONFIG_ERROR: [{(int)AlarmMask.ALARM_CONFIG_ERROR,2}] {(x1 >> AlarmMask.ALARM_CONFIG_ERROR) % 2} {(x2 >> AlarmMask.ALARM_CONFIG_ERROR) % 2} ");
- Console.WriteLine($"ALARM_EMPTY_PIPE: [{(int)AlarmMask.ALARM_EMPTY_PIPE,2}] {(x1 >> AlarmMask.ALARM_EMPTY_PIPE) % 2} {(x2 >> AlarmMask.ALARM_EMPTY_PIPE) % 2} ");
- Console.WriteLine($"ALARM_MAGNETIC_TAMPER: [{(int)AlarmMask.ALARM_MAGNETIC_TAMPER,2}] {(x1 >> AlarmMask.ALARM_MAGNETIC_TAMPER) % 2} {(x2 >> AlarmMask.ALARM_MAGNETIC_TAMPER) % 2} ");
- Console.WriteLine($"ALARM_REVERSE_FLOW: [{(int)AlarmMask.ALARM_REVERSE_FLOW,2}] {(x1 >> AlarmMask.ALARM_REVERSE_FLOW) % 2} {(x2 >> AlarmMask.ALARM_REVERSE_FLOW) % 2} ");
- Console.WriteLine($"ALARM_SUSPECT_LEAK: [{(int)AlarmMask.ALARM_SUSPECT_LEAK,2}] {(x1 >> AlarmMask.ALARM_SUSPECT_LEAK) % 2} {(x2 >> AlarmMask.ALARM_SUSPECT_LEAK) % 2} ");
- Console.WriteLine($"ALARM_BROKEN_PIPE: [{(int)AlarmMask.ALARM_BROKEN_PIPE,2}] {(x1 >> AlarmMask.ALARM_BROKEN_PIPE) % 2} {(x2 >> AlarmMask.ALARM_BROKEN_PIPE) % 2} ");
- Console.WriteLine($"ALARM_LOW_PRESSURE: [{(int)AlarmMask.ALARM_LOW_PRESSURE,2}] {(x1 >> AlarmMask.ALARM_LOW_PRESSURE) % 2} {(x2 >> AlarmMask.ALARM_LOW_PRESSURE) % 2} ");
- Console.WriteLine($"ALARM_HIGH_PRESSURE: [{(int)AlarmMask.ALARM_HIGH_PRESSURE,2}] {(x1 >> AlarmMask.ALARM_HIGH_PRESSURE) % 2} {(x2 >> AlarmMask.ALARM_HIGH_PRESSURE) % 2} ");
- Console.WriteLine($"ALARM_LOW_TEMPERATURE: [{(int)AlarmMask.ALARM_LOW_TEMPERATURE,2}] {(x1 >> AlarmMask.ALARM_LOW_TEMPERATURE) % 2} {(x2 >> AlarmMask.ALARM_LOW_TEMPERATURE) % 2} ");
- Console.WriteLine($"ALARM_HIGH_TEMPERATURE: [{(int)AlarmMask.ALARM_HIGH_TEMPERATURE,2}] {(x1 >> AlarmMask.ALARM_HIGH_TEMPERATURE) % 2} {(x2 >> AlarmMask.ALARM_HIGH_TEMPERATURE) % 2} ");
- Console.WriteLine($"ALARM_RADIO_ERROR: [{(int)AlarmMask.ALARM_RADIO_ERROR,2}] {(x1 >> AlarmMask.ALARM_RADIO_ERROR) % 2} {(x2 >> AlarmMask.ALARM_RADIO_ERROR) % 2} ");
- Console.WriteLine($"ALARM_METROLOGY_PARAMS: [{(int)AlarmMask.ALARM_METROLOGY_PARAMS,2}] {(x1 >> AlarmMask.ALARM_METROLOGY_PARAMS) % 2} {(x2 >> AlarmMask.ALARM_METROLOGY_PARAMS) % 2} ");
- Console.WriteLine($"ALARM_METROLOGY_MEASURE: [{(int)AlarmMask.ALARM_METROLOGY_MEASURE,2}] {(x1 >> AlarmMask.ALARM_METROLOGY_MEASURE) % 2} {(x2 >> AlarmMask.ALARM_METROLOGY_MEASURE) % 2}");
- Console.WriteLine($"ALARM_MAX: [{(int)AlarmMask.ALARM_MAX,2}] {(x1 >> AlarmMask.ALARM_MAX) % 2} {(x2 >> AlarmMask.ALARM_MAX) % 2} ");
+ //var x1 = 0xD29F;
+ //var x2 = 0xD39F;
+
+ //Console.WriteLine(new string('=', 50));
+ //Console.WriteLine($"ALARM_REBOOT: [{(int)AlarmMask.ALARM_REBOOT,2}] {(x1 >> AlarmMask.ALARM_REBOOT) % 2} {(x2 >> AlarmMask.ALARM_REBOOT) % 2} ");
+ //Console.WriteLine($"ALARM_LOW_BATTERY: [{(int)AlarmMask.ALARM_LOW_BATTERY,2}] {(x1 >> AlarmMask.ALARM_LOW_BATTERY) % 2} {(x2 >> AlarmMask.ALARM_LOW_BATTERY) % 2} ");
+ //Console.WriteLine($"ALARM_VERY_LOW_BATTERY: [{(int)AlarmMask.ALARM_VERY_LOW_BATTERY,2}] {(x1 >> AlarmMask.ALARM_VERY_LOW_BATTERY) % 2} {(x2 >> AlarmMask.ALARM_VERY_LOW_BATTERY) % 2} ");
+ //Console.WriteLine($"ALARM_CONFIG_ERROR: [{(int)AlarmMask.ALARM_CONFIG_ERROR,2}] {(x1 >> AlarmMask.ALARM_CONFIG_ERROR) % 2} {(x2 >> AlarmMask.ALARM_CONFIG_ERROR) % 2} ");
+ //Console.WriteLine($"ALARM_EMPTY_PIPE: [{(int)AlarmMask.ALARM_EMPTY_PIPE,2}] {(x1 >> AlarmMask.ALARM_EMPTY_PIPE) % 2} {(x2 >> AlarmMask.ALARM_EMPTY_PIPE) % 2} ");
+ //Console.WriteLine($"ALARM_MAGNETIC_TAMPER: [{(int)AlarmMask.ALARM_MAGNETIC_TAMPER,2}] {(x1 >> AlarmMask.ALARM_MAGNETIC_TAMPER) % 2} {(x2 >> AlarmMask.ALARM_MAGNETIC_TAMPER) % 2} ");
+ //Console.WriteLine($"ALARM_REVERSE_FLOW: [{(int)AlarmMask.ALARM_REVERSE_FLOW,2}] {(x1 >> AlarmMask.ALARM_REVERSE_FLOW) % 2} {(x2 >> AlarmMask.ALARM_REVERSE_FLOW) % 2} ");
+ //Console.WriteLine($"ALARM_SUSPECT_LEAK: [{(int)AlarmMask.ALARM_SUSPECT_LEAK,2}] {(x1 >> AlarmMask.ALARM_SUSPECT_LEAK) % 2} {(x2 >> AlarmMask.ALARM_SUSPECT_LEAK) % 2} ");
+ //Console.WriteLine($"ALARM_BROKEN_PIPE: [{(int)AlarmMask.ALARM_BROKEN_PIPE,2}] {(x1 >> AlarmMask.ALARM_BROKEN_PIPE) % 2} {(x2 >> AlarmMask.ALARM_BROKEN_PIPE) % 2} ");
+ //Console.WriteLine($"ALARM_LOW_PRESSURE: [{(int)AlarmMask.ALARM_LOW_PRESSURE,2}] {(x1 >> AlarmMask.ALARM_LOW_PRESSURE) % 2} {(x2 >> AlarmMask.ALARM_LOW_PRESSURE) % 2} ");
+ //Console.WriteLine($"ALARM_HIGH_PRESSURE: [{(int)AlarmMask.ALARM_HIGH_PRESSURE,2}] {(x1 >> AlarmMask.ALARM_HIGH_PRESSURE) % 2} {(x2 >> AlarmMask.ALARM_HIGH_PRESSURE) % 2} ");
+ //Console.WriteLine($"ALARM_LOW_TEMPERATURE: [{(int)AlarmMask.ALARM_LOW_TEMPERATURE,2}] {(x1 >> AlarmMask.ALARM_LOW_TEMPERATURE) % 2} {(x2 >> AlarmMask.ALARM_LOW_TEMPERATURE) % 2} ");
+ //Console.WriteLine($"ALARM_HIGH_TEMPERATURE: [{(int)AlarmMask.ALARM_HIGH_TEMPERATURE,2}] {(x1 >> AlarmMask.ALARM_HIGH_TEMPERATURE) % 2} {(x2 >> AlarmMask.ALARM_HIGH_TEMPERATURE) % 2} ");
+ //Console.WriteLine($"ALARM_RADIO_ERROR: [{(int)AlarmMask.ALARM_RADIO_ERROR,2}] {(x1 >> AlarmMask.ALARM_RADIO_ERROR) % 2} {(x2 >> AlarmMask.ALARM_RADIO_ERROR) % 2} ");
+ //Console.WriteLine($"ALARM_METROLOGY_PARAMS: [{(int)AlarmMask.ALARM_METROLOGY_PARAMS,2}] {(x1 >> AlarmMask.ALARM_METROLOGY_PARAMS) % 2} {(x2 >> AlarmMask.ALARM_METROLOGY_PARAMS) % 2} ");
+ //Console.WriteLine($"ALARM_METROLOGY_MEASURE: [{(int)AlarmMask.ALARM_METROLOGY_MEASURE,2}] {(x1 >> AlarmMask.ALARM_METROLOGY_MEASURE) % 2} {(x2 >> AlarmMask.ALARM_METROLOGY_MEASURE) % 2}");
+ //Console.WriteLine($"ALARM_MAX: [{(int)AlarmMask.ALARM_MAX,2}] {(x1 >> AlarmMask.ALARM_MAX) % 2} {(x2 >> AlarmMask.ALARM_MAX) % 2} ");
- Console.WriteLine(int.MaxValue);
- Console.WriteLine(uint.MaxValue);
- Console.WriteLine(long.MaxValue);
+ //Console.WriteLine(int.MaxValue);
+ //Console.WriteLine(uint.MaxValue);
+ //Console.WriteLine(long.MaxValue);
}
diff --git a/Common/CommonConsole/RFTelegrams/AppCode.cs b/Common/CommonConsole/RFTelegrams/AppCode.cs
new file mode 100644
index 00000000..4ce6d158
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/AppCode.cs
@@ -0,0 +1,13 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ public enum AppCode
+ {
+ BUP = 0x00,
+ LAT = 0x01,
+ SEMI = 0x08,
+ LoggerTelegram = 0x09,
+ TestTelegram = 0x0A,
+ DEBUG = 0x0B,
+ EncapsulatedFlexNet = 0x10
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/DisplayUnits.cs b/Common/CommonConsole/RFTelegrams/DisplayUnits.cs
new file mode 100644
index 00000000..8414e6d5
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/DisplayUnits.cs
@@ -0,0 +1,11 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ public enum DisplayUnits
+ {
+ NA = 0,
+ m3 = 19,
+ CF = 35,
+ GAL = 24,
+ IGAL = 144,
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/Epoch20000101.cs b/Common/CommonConsole/RFTelegrams/Epoch20000101.cs
new file mode 100644
index 00000000..0bdbe9b4
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/Epoch20000101.cs
@@ -0,0 +1,35 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ using System;
+
+ public class Epoch20000101
+ {
+ private static readonly DateTime epoch = new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc);
+
+ private readonly byte[] bytes;
+
+ public Epoch20000101(DateTimeKind dateTimeKind = DateTimeKind.Utc)
+ => this.bytes = new byte[4];
+
+ public Epoch20000101(uint secondsSince, DateTimeKind dateTimeKind = DateTimeKind.Utc) : this(dateTimeKind)
+ => this.SecondsSince = secondsSince;
+
+ public uint SecondsSince
+ {
+ get => BitConverter.ToUInt32(this.bytes, 0);
+ set => BitConverter.GetBytes(value).CopyTo(this.bytes, 0);
+ }
+
+ public DateTime DateTime
+ {
+ get => epoch.AddSeconds(this.SecondsSince);
+ set => this.SecondsSince = (uint)(value - epoch).TotalSeconds;
+ }
+
+ public static uint UTCNow => new Epoch20000101 { DateTime = DateTime.UtcNow }.SecondsSince;
+
+ public static implicit operator DateTime(Epoch20000101 epoch) => epoch.DateTime;
+
+ public static implicit operator uint(Epoch20000101 epoch) => epoch.SecondsSince;
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/Extensions.cs b/Common/CommonConsole/RFTelegrams/Extensions.cs
new file mode 100644
index 00000000..055ad21b
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/Extensions.cs
@@ -0,0 +1,623 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ using System;
+ using System.Collections.Generic;
+
+ public static class Extensions
+ {
+ private const int ByteSize = 8;
+ private const int SByteSize = 16;
+ private const int Int16Size = 16;
+ private const int UInt16Size = 16;
+ private const int Int32Size = 32;
+ private const int UInt32Size = 32;
+ private const int Int64Size = 64;
+ private const int UInt64Size = 64;
+
+ public static byte[] GetBitsBE(this byte value)
+ {
+ var bits = new byte[ByteSize];
+
+ for (int i = 7, x = 0; i >= 0; i--, x++)
+ {
+ bits[x] = (byte)((value >> i) & 1);
+ }
+
+ return bits;
+ }
+
+ public static byte[] GetBitsLE(this byte value)
+ {
+ var bits = new byte[ByteSize];
+
+ for (var i = 0; i < ByteSize; i++)
+ {
+ bits[i] = (byte)((value >> i) & 1);
+ }
+
+ return bits;
+ }
+
+ public static byte[] GetBitsLE(this ushort value)
+ {
+ var bits = new byte[UInt16Size];
+
+ for (var i = 0; i < UInt16Size; i++)
+ {
+ bits[i] = (byte)((value >> i) & 1);
+ }
+
+ return bits;
+ }
+
+ public static byte GetByteLE(this byte[] bits)
+ {
+ if (bits is null)
+ {
+ return default(byte);
+ }
+
+ var value = default(byte);
+
+ for (var i = 0; i < ByteSize; i++)
+ {
+ value ^= (byte)(bits[i] << i);
+ }
+
+ return value;
+ }
+
+ public static byte GetByteLE(this byte[] bits, int start = 0, int count = 0)
+ {
+ if (bits is null)
+ {
+ return default(byte);
+ }
+
+ if (count == 0)
+ {
+ count = bits.Length;
+ }
+
+ var length = start + count;
+ var _byte = default(byte);
+
+ for (int i = start, x = 0; i < length; i++, x++)
+ {
+ _byte ^= (byte)(bits[i] << x);
+ }
+
+ return _byte;
+ }
+
+ public static void SetBitsLE(this byte value, byte[] bits, int start = 0, int count = 0)
+ {
+ if (bits is null)
+ {
+ return;
+ }
+
+ if (count == 0 || count > bits.Length)
+ {
+ count = bits.Length;
+ }
+
+ for (int i = start, x = 0; i < count; i++, x++)
+ {
+ bits[i] = (byte)((value >> x) % 2);
+ }
+ }
+
+ public static byte[] GetBytesBE(this sbyte value)
+ {
+ var bytes = new byte[2];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesBE(this short value)
+ {
+ var bytes = new byte[2];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesBE(this int value)
+ {
+ var bytes = new byte[4];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 24);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesBE(this long value)
+ {
+ var bytes = new byte[8];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 56);
+ bytes[index++] = (byte)(value >> 48);
+ bytes[index++] = (byte)(value >> 40);
+ bytes[index++] = (byte)(value >> 32);
+ bytes[index++] = (byte)(value >> 24);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesBE(this ushort value)
+ {
+ var bytes = new byte[2];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesBE(this uint value)
+ {
+ var bytes = new byte[4];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 24);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesBE(this ulong value)
+ {
+ var bytes = new byte[8];
+ var index = 0;
+
+ bytes[index++] = (byte)(value >> 56);
+ bytes[index++] = (byte)(value >> 48);
+ bytes[index++] = (byte)(value >> 40);
+ bytes[index++] = (byte)(value >> 32);
+ bytes[index++] = (byte)(value >> 24);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index] = (byte)value;
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this sbyte value)
+ {
+ var bytes = new byte[2];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index] = (byte)(value >> 8);
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this short value)
+ {
+ var bytes = new byte[2];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index] = (byte)(value >> 8);
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this int value)
+ {
+ var bytes = new byte[4];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index] = (byte)(value >> 24);
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this long value)
+ {
+ var bytes = new byte[8];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index++] = (byte)(value >> 24);
+ bytes[index++] = (byte)(value >> 32);
+ bytes[index++] = (byte)(value >> 40);
+ bytes[index++] = (byte)(value >> 48);
+ bytes[index] = (byte)(value >> 56);
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this ushort value)
+ {
+ var bytes = new byte[2];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index] = (byte)(value >> 8);
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this uint value)
+ {
+ var bytes = new byte[4];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index] = (byte)(value >> 24);
+
+ return bytes;
+ }
+
+ public static byte[] GetBytesLE(this ulong value)
+ {
+ var bytes = new byte[8];
+ var index = 0;
+
+ bytes[index++] = (byte)value;
+ bytes[index++] = (byte)(value >> 8);
+ bytes[index++] = (byte)(value >> 16);
+ bytes[index++] = (byte)(value >> 24);
+ bytes[index++] = (byte)(value >> 32);
+ bytes[index++] = (byte)(value >> 40);
+ bytes[index++] = (byte)(value >> 48);
+ bytes[index] = (byte)(value >> 56);
+
+ return bytes;
+ }
+
+ public static sbyte ToSByteBE(this byte[] bytes, int start = 0)
+ {
+ var value = default(sbyte);
+
+ value ^= (sbyte)(bytes[start++] << 8);
+ value ^= (sbyte)bytes[start];
+
+ return value;
+ }
+
+ public static short ToInt16BE(this byte[] bytes, int start = 0)
+ {
+ var value = default(short);
+
+ value ^= (short)(bytes[start++] << 8);
+ value ^= bytes[start];
+
+ return value;
+ }
+
+ public static int ToInt32BE(this byte[] bytes, int start = 0)
+ {
+ var value = default(int);
+
+ value ^= bytes[start++] << 24;
+ value ^= bytes[start++] << 16;
+ value ^= bytes[start++] << 8;
+ value ^= bytes[start];
+
+ return value;
+ }
+
+ public static long ToInt64BE(this byte[] bytes, int start = 0)
+ {
+ var value = default(long);
+
+ value ^= bytes[start++] << 56;
+ value ^= bytes[start++] << 48;
+ value ^= bytes[start++] << 40;
+ value ^= bytes[start++] << 32;
+ value ^= bytes[start++] << 24;
+ value ^= bytes[start++] << 16;
+ value ^= bytes[start++] << 8;
+ value ^= bytes[start];
+
+ return value;
+ }
+
+ public static ushort ToUInt16BE(this byte[] bytes, int start = 0)
+ {
+ var value = default(ushort);
+
+ value ^= (ushort)(bytes[start++] << 8);
+ value ^= bytes[start];
+
+ return value;
+ }
+
+ public static uint ToUInt32BE(this byte[] bytes, int start = 0)
+ {
+ var value = default(uint);
+
+ value ^= (uint)(bytes[start++] << 24);
+ value ^= (uint)(bytes[start++] << 16);
+ value ^= (uint)(bytes[start++] << 8);
+ value ^= bytes[start];
+
+ return value;
+ }
+
+ public static ulong ToUInt64BE(this byte[] bytes, int start = 0)
+ {
+ var value = default(ulong);
+
+ value ^= (ulong)(bytes[start++] << 56);
+ value ^= (ulong)(bytes[start++] << 48);
+ value ^= (ulong)(bytes[start++] << 40);
+ value ^= (ulong)(bytes[start++] << 32);
+ value ^= (ulong)(bytes[start++] << 24);
+ value ^= (ulong)(bytes[start++] << 16);
+ value ^= (ulong)(bytes[start++] << 8);
+ value ^= bytes[start];
+
+ return value;
+ }
+
+ public static sbyte ToSByteLE(this byte[] bytes, int start = 0)
+ {
+ var value = default(sbyte);
+
+ value ^= (sbyte)bytes[start++];
+ value ^= (sbyte)(bytes[start] << 8);
+
+ return value;
+ }
+
+ public static short ToInt16LE(this byte[] bytes, int start = 0)
+ {
+ var value = default(short);
+
+ value ^= bytes[start++];
+ value ^= (short)(bytes[start] << 8);
+
+ return value;
+ }
+
+ public static int ToInt32LE(this byte[] bytes, int start = 0)
+ {
+ var value = default(int);
+
+ value ^= bytes[start++];
+ value ^= bytes[start++] << 8;
+ value ^= bytes[start++] << 16;
+ value ^= bytes[start] << 24;
+
+ return value;
+ }
+
+ public static long ToInt64LE(this byte[] bytes, int start = 0)
+ {
+ var value = default(long);
+
+ value ^= bytes[start++];
+ value ^= bytes[start++] << 8;
+ value ^= bytes[start++] << 16;
+ value ^= bytes[start++] << 24;
+ value ^= bytes[start++] << 32;
+ value ^= bytes[start++] << 40;
+ value ^= bytes[start++] << 48;
+ value ^= bytes[start] << 56;
+
+ return value;
+ }
+
+ public static ushort ToUInt16LE(this byte[] bytes, int start = 0)
+ {
+ var value = default(ushort);
+
+ value ^= bytes[start++];
+ value ^= (ushort)(bytes[start] << 8);
+
+ return value;
+ }
+
+ public static ushort ToUIint16LEFromBits(this byte[] bits)
+ {
+ if (bits is null)
+ {
+ bits = new byte[UInt16Size];
+ }
+
+ Array.Resize(ref bits, UInt16Size);
+
+ ushort value = 0;
+
+ for (var i = 0; i < UInt16Size; i++)
+ {
+ value ^= (ushort)(bits[i] << i);
+ }
+
+ return value;
+ }
+
+ public static uint ToUInt32LE(this byte[] bytes, int start = 0)
+ {
+ var value = default(uint);
+
+ value ^= bytes[start++];
+ value ^= (uint)(bytes[start++] << 8);
+ value ^= (uint)(bytes[start++] << 16);
+ value ^= (uint)(bytes[start] << 24);
+
+ return value;
+ }
+
+ public static ulong ToUInt64LE(this byte[] bytes, int start = 0)
+ {
+ var value = default(ulong);
+
+ value ^= bytes[start++];
+ value ^= (ulong)(bytes[start++] << 8);
+ value ^= (ulong)(bytes[start++] << 16);
+ value ^= (ulong)(bytes[start++] << 24);
+ value ^= (ulong)(bytes[start++] << 32);
+ value ^= (ulong)(bytes[start++] << 40);
+ value ^= (ulong)(bytes[start++] << 48);
+ value ^= (ulong)(bytes[start] << 56);
+
+ return value;
+ }
+
+ public static ushort CRCCCITT(this byte[] bytes, int start = 0, int length = 0)
+ {
+ if (length == 0)
+ {
+ length = bytes.Length;
+ }
+
+ var crc = (ushort)0xFFFF;
+
+ for (var b = start; b < length; b++)
+ {
+ var _byte = bytes[b];
+ var token = (ushort)((_byte << 8) & 0xFF00);
+
+ for (var i = 0; i < 8; i++)
+ {
+ if (0x8000 == ((crc ^ token) & 0x8000))
+ {
+ crc <<= 1;
+ crc ^= 0x1021;
+ }
+ else
+ {
+ crc <<= 1;
+ }
+
+ token <<= 1;
+ }
+ }
+
+ return crc;
+ }
+
+ public static byte[] GetBytes(this string hexString)
+ {
+ var bytes = new List();
+
+ if (!string.IsNullOrWhiteSpace(hexString))
+ {
+ // not needed, only valid hex bytes are processed // hexString = Regex.Replace(hexString, "[^a-fA-F0-9]*", string.Empty);
+
+ var first = true;
+ var x = 0;
+
+ foreach (var hex in hexString)
+ {
+ if ('0' <= hex && hex <= '9')
+ {
+ x += hex - '0';
+ }
+ else if ('A' <= hex && hex <= 'F')
+ {
+ x += hex - 'A' + 10;
+ }
+ else if ('a' <= hex && hex <= 'f')
+ {
+ x = hex - 'a' + 10;
+ }
+ else
+ {
+ continue;
+ }
+
+ if (first)
+ {
+ x *= 16;
+ }
+ else
+ {
+ bytes.Add((byte)x);
+
+ x = 0;
+ }
+
+ first = !first;
+ }
+ }
+
+ return bytes.ToArray();
+ }
+
+ public static byte[] GetEncryptionKey(this string hexString, int requiredLength = 16)
+ {
+ var bytes = hexString.GetBytes();
+
+ if (bytes?.Length != requiredLength)
+ {
+ return default(byte[]);
+ }
+
+ return bytes;
+ }
+
+ public static uint GetAddress(this byte[] bytes, int index)
+ {
+ var value = default(uint);
+ var _index = index;
+
+ value ^= (uint)(bytes[_index++] << 24);
+ value ^= (uint)(bytes[_index++] << 16);
+ value ^= (uint)(bytes[_index++] << 8);
+ value ^= bytes[_index];
+
+ return value;
+ }
+
+ public static ushort GetCrc(this byte[] bytes, int index)
+ {
+ var value = default(ushort);
+ var _index = index;
+
+ value ^= (ushort)(bytes[_index++] << 8);
+ value ^= bytes[_index];
+
+ return value;
+ }
+
+ public static void SetAddress(this byte[] bytes, int index, uint address)
+ {
+ var _index = index;
+
+ bytes[_index++] = (byte)(address >> 24);
+ bytes[_index++] = (byte)(address >> 16);
+ bytes[_index++] = (byte)(address >> 8);
+ bytes[_index] = (byte)address;
+ }
+
+ public static void SetCrc(this byte[] bytes, int index, ushort crc)
+ {
+ var _index = index;
+
+ bytes[_index++] = (byte)(crc >> 8);
+ bytes[_index] = (byte)crc;
+ }
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/LogContent.cs b/Common/CommonConsole/RFTelegrams/LogContent.cs
new file mode 100644
index 00000000..9748bd7d
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/LogContent.cs
@@ -0,0 +1,97 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ public class LogContent
+ {
+ private readonly byte[] bits = new byte[16];
+
+ public LogContent(ushort value = 0)
+ => this.bits = value.GetBitsLE();
+
+ public bool ForwardCounter
+ {
+ get => this.bits[12] == 1;
+ set => this.bits[12] = (byte)(value ? 1 : 0);
+ }
+
+ public bool TimeOfMinimumFlow
+ {
+ get => this.bits[11] == 1;
+ set => this.bits[11] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MinimumFlow
+ {
+ get => this.bits[10] == 1;
+ set => this.bits[10] = (byte)(value ? 1 : 0);
+ }
+
+ public bool TimeOfBrokenPipe
+ {
+ get => this.bits[9] == 1;
+ set => this.bits[9] = (byte)(value ? 1 : 0);
+ }
+
+ public bool BrokenPipeFlow
+ {
+ get => this.bits[8] == 1;
+ set => this.bits[8] = (byte)(value ? 1 : 0);
+ }
+
+ public bool CurrentFlow
+ {
+ get => this.bits[7] == 1;
+ set => this.bits[7] = (byte)(value ? 1 : 0);
+ }
+
+ public bool TimeOfPeakFlow
+ {
+ get => this.bits[6] == 1;
+ set => this.bits[6] = (byte)(value ? 1 : 0);
+ }
+
+ public bool PeakFlow
+ {
+ get => this.bits[5] == 1;
+ set => this.bits[5] = (byte)(value ? 1 : 0);
+ }
+
+ public bool TimeOfMaximumFlow
+ {
+ get => this.bits[4] == 1;
+ set => this.bits[4] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MaximumFlow
+ {
+ get => this.bits[3] == 1;
+ set => this.bits[3] = (byte)(value ? 1 : 0);
+ }
+
+ public bool BackwardVolume
+ {
+ get => this.bits[2] == 1;
+ set => this.bits[2] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Counter
+ {
+ get => this.bits[1] == 1;
+ set => this.bits[1] = (byte)(value ? 1 : 0);
+ }
+
+ public bool AlarmState
+ {
+ get => this.bits[0] == 1;
+ set => this.bits[0] = (byte)(value ? 1 : 0);
+ }
+
+ public override string ToString()
+ => string.Join(string.Empty, this.bits);
+
+ public static implicit operator LogContent(ushort value)
+ => new LogContent(value);
+
+ public static implicit operator ushort(LogContent value)
+ => value.bits.ToUIint16LEFromBits();
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/MeterTypes.cs b/Common/CommonConsole/RFTelegrams/MeterTypes.cs
new file mode 100644
index 00000000..8c4d7484
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/MeterTypes.cs
@@ -0,0 +1,11 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ public enum MeterTypes : byte
+ {
+ Residential = 0,
+ CandI = 1,
+ Cordonel = 0x09,
+ Residential__0x0B = 11,
+ CandI__0x0C = 12,
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/PAMStatus.cs b/Common/CommonConsole/RFTelegrams/PAMStatus.cs
new file mode 100644
index 00000000..4f452230
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/PAMStatus.cs
@@ -0,0 +1,62 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ public class PAMStatus
+ {
+ private readonly byte[] bits;
+
+ public PAMStatus(byte _byte)
+ => this.bits = _byte.GetBitsLE();
+
+ public bool CMD_UNKNOWN => this.bits[0] == 1;
+
+ public bool WRONG_AUTH => this.bits[1] == 1;
+
+ public bool EXPIRED_AUTH => this.bits[2] == 1;
+
+ public bool MIXED_TYPES => this.bits[3] == 1;
+
+ public bool OUT_OF_RANGE => this.bits[4] == 1;
+
+ public override string ToString()
+ {
+ if (this.bits.GetByteLE() == 0)
+ {
+ return nameof(OK);
+ }
+ if (this.OUT_OF_RANGE)
+ {
+ return nameof(this.OUT_OF_RANGE);
+ }
+ else if (this.MIXED_TYPES)
+ {
+ return nameof(this.MIXED_TYPES);
+ }
+ else if (this.CMD_UNKNOWN)
+ {
+ return nameof(this.CMD_UNKNOWN);
+ }
+ else if (this.EXPIRED_AUTH)
+ {
+ return nameof(this.EXPIRED_AUTH);
+ }
+ else if (this.WRONG_AUTH)
+ {
+ return nameof(this.WRONG_AUTH);
+ }
+ else
+ {
+ return string.Join(string.Empty, this.bits);
+ }
+ }
+
+ public static byte OK = 0;
+
+ public static byte EXPIREDAUTH = 4;
+
+ public static implicit operator byte(PAMStatus status)
+ => status?.bits?.GetByteLE() ?? 0xFF;
+
+ public static implicit operator string(PAMStatus status)
+ => status?.ToString();
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/Pams/AlarmMask.cs b/Common/CommonConsole/RFTelegrams/Pams/AlarmMask.cs
new file mode 100644
index 00000000..e52e6876
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/Pams/AlarmMask.cs
@@ -0,0 +1,79 @@
+namespace CommonConsole.RFTelegrams.Pams
+{
+ using Common.Hardware.SIRT;
+
+ using System.Text;
+
+ public class AlarmMask
+ {
+ protected readonly byte[] bits;
+
+ public AlarmMask(byte value) => this.bits = value.GetBitsLE();
+
+ public bool SpecificError
+ {
+ get => this.bits[0] == 1;
+ set => this.bits[0] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MediumAbsent
+ {
+ get => this.bits[1] == 1;
+ set => this.bits[1] = (byte)(value ? 1 : 0);
+ }
+
+ public bool BrokenPipe
+ {
+ get => this.bits[2] == 1;
+ set => this.bits[2] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Backflow
+ {
+ get => this.bits[3] == 1;
+ set => this.bits[3] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MetrologyUnavailable
+ {
+ get => this.bits[4] == 1;
+ set => this.bits[4] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MagneticTamper
+ {
+ get => this.bits[5] == 1;
+ set => this.bits[5] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Leak
+ {
+ get => this.bits[6] == 1;
+ set => this.bits[6] = (byte)(value ? 1 : 0);
+ }
+
+ public bool LowBattery
+ {
+ get => this.bits[7] == 1;
+ set => this.bits[7] = (byte)(value ? 1 : 0);
+ }
+
+ public override string ToString()
+ {
+ var alarmMaskBuilder = new StringBuilder();
+
+ alarmMaskBuilder.AppendLine($"{nameof(this.SpecificError),20}: {this.SpecificError}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.MediumAbsent),20}: {this.MediumAbsent}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.BrokenPipe),20}: {this.BrokenPipe}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.Backflow),20}: {this.Backflow}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.MetrologyUnavailable),20}: {this.MetrologyUnavailable}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.MagneticTamper),20}: {this.MagneticTamper}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.Leak),20}: {this.Leak}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.LowBattery),20}: {this.LowBattery}");
+
+ return alarmMaskBuilder.ToString();
+ }
+
+ public static implicit operator byte(AlarmMask alarmMask) => alarmMask.bits.GetByteLE();
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/Pams/DummyPam.cs b/Common/CommonConsole/RFTelegrams/Pams/DummyPam.cs
new file mode 100644
index 00000000..9e33b84c
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/Pams/DummyPam.cs
@@ -0,0 +1,7 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams.Pams
+{
+ public class DummyPam
+ {
+ public static implicit operator byte[](DummyPam dummyPam) => new byte[0];
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/Pams/ResetAlarms.cs b/Common/CommonConsole/RFTelegrams/Pams/ResetAlarms.cs
new file mode 100644
index 00000000..b4d3e53a
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/Pams/ResetAlarms.cs
@@ -0,0 +1,70 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams.Pams
+{
+ public class ResetAlarms
+ {
+ private readonly byte[] bits;
+
+ public ResetAlarms(byte _byte = 0xFF)
+ => this.bits = _byte.GetBitsLE();
+
+ public bool SpecificError
+ {
+ get => this.bits[0] == 1;
+ set => this.bits[0] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MediumAbsent
+ {
+ get => this.bits[1] == 1;
+ set => this.bits[1] = (byte)(value ? 1 : 0);
+ }
+
+ public bool BrokenPipe
+ {
+ get => this.bits[2] == 1;
+ set => this.bits[2] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Backflow
+ {
+ get => this.bits[3] == 1;
+ set => this.bits[3] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MetrologyUnavailable
+ {
+ get => this.bits[4] == 1;
+ set => this.bits[4] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MagneticTamper
+ {
+ get => this.bits[5] == 1;
+ set => this.bits[5] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Leak
+ {
+ get => this.bits[6] == 1;
+ set => this.bits[6] = (byte)(value ? 1 : 0);
+ }
+
+ public bool LowBattery
+ {
+ get => this.bits[7] == 1;
+ set => this.bits[7] = (byte)(value ? 1 : 0);
+ }
+
+ public static implicit operator byte[] (ResetAlarms resetAlarms) => new byte[]
+ {
+ 0x03,
+ resetAlarms.bits.GetByteLE(),
+ 0x43,
+ 0x01,
+ 0x14,
+ 0x30,
+ 0x68,
+ 0xD0
+ };
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/RFTask.cs b/Common/CommonConsole/RFTelegrams/RFTask.cs
new file mode 100644
index 00000000..1728137b
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/RFTask.cs
@@ -0,0 +1,91 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ using global::Common.Hardware.SIRT;
+ using global::Common.Hardware.SIRT.Tasks;
+
+ using System;
+ using System.Collections.Generic;
+
+ public class RFTask : WritePamTask
+ {
+ private readonly Stack messages = new Stack();
+
+ public SIRTMessage AKN { get; private set; }
+
+ public SIRTMessage BUP { get; private set; }
+
+ public SIRTMessage LAT { get; private set; }
+
+ public SIRTMessage DEBUG { get; private set; }
+
+ public SIRTMessage SEMI { get; private set; }
+
+ public SIRTMessage LastOrDefault()
+ => this.messages.Count > 0
+ ? this.messages.Peek()
+ : new SIRTMessage();
+
+ public override string ToString()
+ => BitConverter.ToString(this.request.Payload);
+
+ protected override void OnMessageSent(SIRTMessage request)
+ => this.messages.Push(request);
+
+ protected override void OnUnknownReceived(SIRTMessage unknown)
+ => this.messages.Push(unknown);
+
+ protected override void OnAKNReceived(SIRTMessage akn)
+ {
+ this.AKN = akn;
+
+ this.messages.Push(akn);
+ }
+
+ protected override void OnBUPReceived(SIRTMessage bup)
+ {
+ this.BUP = bup;
+
+ this.messages.Push(bup);
+ }
+
+ protected override void OnLATReceived(SIRTMessage lat)
+ {
+ this.LAT = lat;
+
+ this.messages.Push(lat);
+ }
+
+ protected override void OnDEBUGReceived(SIRTMessage debug)
+ {
+ this.DEBUG = debug;
+
+ this.messages.Push(debug);
+ }
+
+ protected override void OnSEMIReceived(SIRTMessage semi)
+ {
+ if (semi is null || semi.Payload is null || semi.Payload.Length < 11)
+ {
+ this.SetPending();
+
+ return;
+ }
+
+ // PAM Status: [11]
+ var pamStatus = new PAMStatus(semi.Payload[11]);
+
+ if (pamStatus != PAMStatus.OK)
+ {
+ this.SetPending();
+
+ return;
+ }
+
+ base.OnSEMIReceived(semi);
+
+ this.SEMI = semi;
+
+ this.messages.Push(semi);
+ }
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/RSSI.cs b/Common/CommonConsole/RFTelegrams/RSSI.cs
new file mode 100644
index 00000000..e5b337e0
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/RSSI.cs
@@ -0,0 +1,42 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ public class RSSI
+ {
+ public RSSI(byte value, int mhz)
+ {
+ this.Value = value;
+
+ if (mhz == 433)
+ {
+ this.Dbm = value * 0.5 - 140;
+ this.Percent = value * 0.7333 - 57.6667;
+ }
+ else if (mhz == 868)
+ {
+ this.Dbm = value * 0.5 - 131.3;
+ this.Percent = value * 0.66 - 40.316;
+ }
+
+ if (this.Percent > 100)
+ {
+ this.Percent = 100;
+ }
+ else if (this.Percent < 0)
+ {
+ this.Percent = 0;
+ }
+ }
+
+ public byte Value { get; }
+
+ public double Dbm { get; }
+
+ public double Percent { get; }
+
+ public override string ToString() => $"{this.Dbm}dBm ({this.Percent:0.0}%)";
+
+ public static implicit operator byte(RSSI rssi) => rssi?.Value ?? 0;
+
+ public static implicit operator string(RSSI rssi) => rssi?.ToString();
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/SEMI.cs b/Common/CommonConsole/RFTelegrams/SEMI.cs
new file mode 100644
index 00000000..abf03f0c
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/SEMI.cs
@@ -0,0 +1,176 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ using Pams;
+
+ using System;
+ using System.Text;
+
+ ///
+ /// TODO: SEMI from the SirtDLL is not complete,
+ ///
+ public class SEMI
+ {
+ //public const int MIN_LENGTH = 120;
+ public const int MIN_LENGTH = 97;
+
+ public SEMI(byte[] payload, int mhz)
+ {
+ this.AppCode = (AppCode)payload[0];
+ this.Counter = payload[1];
+ this.Address = payload.ToUInt32BE(2);
+ this.Reading = payload.ToInt32BE(6);
+ this.MainAlarmByte = new ResetAlarms(payload[10]);
+ this.PAMStatus = new PAMStatus(payload[11]);
+ this.RSSI = new RSSI(payload[12], mhz);
+ this.MeterType = (MeterTypes)payload[13];
+ this.TransmissionInterval = payload.ToUInt16BE(14);
+ this.LATInterval = payload[16];
+ this.ActualFlow = payload.ToUInt16BE(17);
+ this.BackwardVolume = payload.ToUInt32BE(19);
+ this.Units = (DisplayUnits)payload[23];
+ this.MBusStatus = payload[24];
+ this.MBusTransmissionInterval = payload.ToUInt16BE(25);
+ this.MainAlarmMask = new ResetAlarms(payload[27]);
+ this.LeakageDetectionParameters = payload[28];
+ this.BrokenPipeDetectionParameters = payload[29];
+ this.BatteryRemainingYears = payload.ToUInt16BE(30) / (4D * 365);
+ this.ReminingBatteryCapacity = payload[32];
+ this.MaximumFlow = payload.ToUInt16BE(33);
+ this.TimeSinceMaximumFlow = payload.ToUInt16BE(35);
+ this.TimeSinceLowBattery = payload.ToUInt16BE(37);
+ this.AlarmLeakage = new Epoch20000101(payload.ToUInt32BE(39), DateTimeKind.Local);
+ this.AlarmAirInPipe = new Epoch20000101(payload.ToUInt32BE(43), DateTimeKind.Local);
+ this.AlarmReverseFlow = new Epoch20000101(payload.ToUInt32BE(47), DateTimeKind.Local);
+ this.AlarmBrokenPipe = new Epoch20000101(payload.ToUInt32BE(51), DateTimeKind.Local);
+ this.DataLogContent = payload.ToUInt16BE(55);
+ this.DataLoggingInterval = payload.ToUInt16BE(57);
+ this.FDRContent = payload.ToUInt16BE(59);
+ this.FDRDayOfMonth = payload[61];
+ this.ActualDateTime = new Epoch20000101(payload.ToUInt32BE(62), DateTimeKind.Local);
+ this.HistoricalErrorDays = payload[66];
+ this.CustomerSpecificText = Encoding.ASCII.GetString(payload, 67, 9);
+ this.TimeOfFDRReset = payload.ToUInt16BE(76);
+ this.TimeOfLogReset = payload.ToUInt16BE(78);
+ this.ActualPressure = payload.ToUInt16BE(80);
+ this.ActualTemperature = payload[82];
+ this.PressureParameter = Encoding.ASCII.GetString(payload, 83, 7);
+ this.TemperatureParameter = payload.ToInt32BE(90);
+ this.PulseOutParameter = payload[94];
+ this.AlarmByteExtended = payload[95];
+ this.AlarmMaskExtended = payload[96];
+ //this.AlarmMaxPressureTime = payload.ToUInt32BE(97);
+ //this.AlarmMinPressureTime = payload.ToUInt32BE(101);
+ //this.AlarmMaxTemperatureTime = payload.ToUInt32BE(105);
+ //this.AlarmMinTemperatureTime = payload.ToUInt32BE(109);
+ //this.LogContentPressureTemperature = payload.ToUInt16BE(113);
+ //this.FDRContentPressureTemperature = payload.ToUInt16BE(115);
+ //this.UnitExtraFlags = payload[117];
+ //this.MeterSize = payload[118];
+ //this.PressureCalibrationOffset = payload[119];
+ }
+
+ public AppCode AppCode { get; }
+
+ public byte Counter { get; }
+
+ public uint Address { get; }
+
+ public int Reading { get; }
+
+ public ResetAlarms MainAlarmByte { get; }
+
+ public PAMStatus PAMStatus { get; }
+
+ public RSSI RSSI { get; }
+
+ public MeterTypes MeterType { get; }
+
+ public ushort TransmissionInterval { get; }
+
+ public byte LATInterval { get; }
+
+ public ushort ActualFlow { get; }
+
+ public uint BackwardVolume { get; }
+
+ public DisplayUnits Units { get; }
+
+ public byte MBusStatus { get; }
+
+ public ushort MBusTransmissionInterval { get; }
+
+ public ResetAlarms MainAlarmMask { get; }
+
+ public byte LeakageDetectionParameters { get; }
+
+ public byte BrokenPipeDetectionParameters { get; }
+
+ public double BatteryRemainingYears { get; }
+
+ public byte ReminingBatteryCapacity { get; }
+
+ public ushort MaximumFlow { get; }
+
+ public ushort TimeSinceMaximumFlow { get; }
+
+ public ushort TimeSinceLowBattery { get; }
+
+ public DateTime AlarmLeakage { get; }
+
+ public DateTime AlarmAirInPipe { get; }
+
+ public DateTime AlarmReverseFlow { get; }
+
+ public DateTime AlarmBrokenPipe { get; }
+
+ public LogContent DataLogContent { get; }
+
+ public ushort DataLoggingInterval { get; }
+
+ public LogContent FDRContent { get; }
+
+ public byte FDRDayOfMonth { get; }
+
+ public DateTime ActualDateTime { get; }
+
+ public byte HistoricalErrorDays { get; }
+
+ public string CustomerSpecificText { get; }
+
+ public ushort TimeOfFDRReset { get; }
+
+ public ushort TimeOfLogReset { get; }
+
+ public ushort ActualPressure { get; }
+
+ public byte ActualTemperature { get; }
+
+ public string PressureParameter { get; }
+
+ public int TemperatureParameter { get; }
+
+ public byte PulseOutParameter { get; }
+
+ public byte AlarmByteExtended { get; }
+
+ public byte AlarmMaskExtended { get; }
+
+ //public uint AlarmMaxPressureTime { get; }
+
+ //public uint AlarmMinPressureTime { get; }
+
+ //public uint AlarmMaxTemperatureTime { get; }
+
+ //public uint AlarmMinTemperatureTime { get; }
+
+ //public ushort LogContentPressureTemperature { get; }
+
+ //public ushort FDRContentPressureTemperature { get; }
+
+ //public byte UnitExtraFlags { get; }
+
+ //public byte MeterSize { get; }
+
+ //public byte PressureCalibrationOffset { get; }
+ }
+}
diff --git a/Common/CommonConsole/RFTelegrams/SIRTServer.cs b/Common/CommonConsole/RFTelegrams/SIRTServer.cs
new file mode 100644
index 00000000..0ba192c7
--- /dev/null
+++ b/Common/CommonConsole/RFTelegrams/SIRTServer.cs
@@ -0,0 +1,173 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ using CommonConsole.RFTelegrams.Pams;
+
+ using global::Common.Hardware.SIRT;
+ using global::Common.Hardware.SIRT.Tasks;
+
+ using Pams;
+
+ using System;
+
+ internal class SIRTServer
+ {
+ private static Action messageCallback;
+ private static Action errorMessageCallback;
+ private static readonly SIRTHub sirtHub = new SIRTHub();
+
+ ///
+ /// Connects SIRT's globaly for the application
+ ///
+ /// Action that receives info messages
+ /// Action that receives error messages
+ /// The COM-Ports to be connected
+ /// true - if all ports connected otherwise false
+ public static bool StartServer(Action messageHandler, Action errorMessageHandler, params int[] comPorts)
+ {
+ string sirtId;
+ int frequency;
+ bool succeeded = true;
+
+ messageHandler?.Invoke(new string('-', 100));
+
+ foreach (var comport in comPorts)
+ {
+ succeeded = ConnectSIRT(comport, out sirtId, out frequency);
+
+ if (succeeded)
+ {
+ messageHandler?.Invoke($"COM{comport}|{sirtId}|{frequency}MHz - connected");
+ messageHandler?.Invoke(new string('-', 100));
+ }
+ else
+ {
+ errorMessageHandler?.Invoke($"SIRT at COM{comport} not connected!");
+ errorMessageHandler?.Invoke(new string('-', 100));
+
+ break;
+ }
+ }
+
+ if (succeeded)
+ {
+ messageCallback = messageHandler;
+ errorMessageCallback = errorMessageHandler;
+ }
+
+ return succeeded;
+ }
+
+ public static bool StartProgramming(int frequency, uint address, string encryptionKey, int repeatsCount = 3)
+ {
+ var succeeded = true;
+
+ if (succeeded)
+ {
+ succeeded = SendPAM(task =>
+ {
+ task.WakeUpCmd = true;
+ task.DelPamSemi = true;
+ task.WakeUpModul = true;
+ task.Frequency = frequency;
+ task.RequestAddress = address;
+ task.EncryptionKey = encryptionKey.GetEncryptionKey();
+ task.Data = new DummyPam();
+ }
+ , repeatsCount);
+ }
+
+ if (succeeded)
+ {
+ succeeded = SendPAM(task =>
+ {
+ task.DelPamSemi = true;
+ task.Frequency = frequency;
+ task.RequestAddress = address;
+ task.EncryptionKey = encryptionKey.GetEncryptionKey();
+ task.Data = new ResetAlarms(0xFF);
+ }
+ , repeatsCount);
+ }
+
+ if (succeeded)
+ {
+ succeeded = SendPAM(task =>
+ {
+ task.DelPamSemi = true;
+ task.Frequency = frequency;
+ task.RequestAddress = address;
+ task.EncryptionKey = encryptionKey.GetEncryptionKey();
+ task.Data = new ResetAlarms(0xFE);
+ }
+ , repeatsCount);
+ }
+
+ return succeeded;
+ }
+
+ ///
+ /// Dispose all SIRT's globaly for the application.
+ ///
+ public static void Dispose()
+ {
+ void LogState(object state) => messageCallback?.Invoke(state?.ToString());
+
+ sirtHub.StateLogging += LogState;
+ sirtHub.Stop();
+ sirtHub.StateLogging -= LogState;
+
+ messageCallback = null;
+ errorMessageCallback = null;
+ }
+
+ private static bool ConnectSIRT(int portno, out string sirtId, out int frequency)
+ => sirtHub.TryOpen($"COM{portno}", out sirtId, out frequency);
+
+ private static bool SendPAM(Action taskOpetions, int repeatsCount = 3)
+ {
+ void LogMessage(SIRTMessage message) => messageCallback?.Invoke(message.ToString());
+
+ var cordonelTask = new RFTask();
+ var succeeded = false;
+
+ taskOpetions(cordonelTask);
+
+ cordonelTask.MessageSent += LogMessage;
+ cordonelTask.MessageReceived += LogMessage;
+
+ for (var i = 1; i <= repeatsCount && cordonelTask.State != SIRTTaskState.Completed && cordonelTask.State != SIRTTaskState.Cancelled; i++)
+ {
+ if (sirtHub.Start(cordonelTask))
+ {
+ cordonelTask.Wait();
+ }
+ }
+
+ cordonelTask.MessageReceived -= LogMessage;
+ cordonelTask.MessageSent -= LogMessage;
+
+ if (cordonelTask.State == SIRTTaskState.Completed)
+ {
+ succeeded = true;
+
+ messageCallback?.Invoke($"{"CMD",20}: {cordonelTask}");
+ messageCallback?.Invoke($"{"State",20}: {cordonelTask.State}");
+
+ var pam = new PAMStatus(cordonelTask.SEMI.Payload[11]);
+ messageCallback?.Invoke($"{"PAM Status",20}: {pam}");
+
+ var alarm = new AlarmMask(cordonelTask.SEMI.Payload[10]);
+ messageCallback?.Invoke(alarm.ToString());
+
+ messageCallback?.Invoke(new string('-', 100));
+ }
+ else
+ {
+ errorMessageCallback?.Invoke($"{cordonelTask.State} - CMD|{cordonelTask}");
+ errorMessageCallback?.Invoke(new string('-', 100));
+ }
+
+ return succeeded;
+ }
+ }
+}
diff --git a/Common/Hardware/Common.Hardware.SIRT/Common.Hardware.SIRT.csproj b/Common/Hardware/Common.Hardware.SIRT/Common.Hardware.SIRT.csproj
index 2f1e3699..00d9d18a 100644
--- a/Common/Hardware/Common.Hardware.SIRT/Common.Hardware.SIRT.csproj
+++ b/Common/Hardware/Common.Hardware.SIRT/Common.Hardware.SIRT.csproj
@@ -65,7 +65,6 @@
-
diff --git a/Common/Hardware/Common.Hardware.SIRT/SIRTChannel.cs b/Common/Hardware/Common.Hardware.SIRT/SIRTChannel.cs
deleted file mode 100644
index 4426839f..00000000
--- a/Common/Hardware/Common.Hardware.SIRT/SIRTChannel.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace Common.Hardware.SIRT
-{
- using Common.Hardware.SIRT.Tasks;
-
- using System;
-
- public class SIRTChannel
- {
- public event Action MessageReceived;
-
- public uint RequestAddress { get; set; }
-
- public uint ResponseAddress { get; set; }
-
- public Action WriteHandler { get; set; }
-
- internal void Enqueue(SIRTMessage message)
- => this.MessageReceived?.Invoke(message);
- }
-}
diff --git a/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs b/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs
index 785cc27f..9d6ccf35 100644
--- a/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs
+++ b/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs
@@ -97,7 +97,7 @@
{
this.AnyTelegramReceived = true;
- if (response.Command == SIRTConstants.ACKN_ANSW) // status of the modul, ping
+ if (response.Command == SIRTConstants.ACKN_ANSW) // command sent
{
this.DecriptResponse(response);
this.AKNReceived?.Invoke(response);
@@ -110,12 +110,12 @@
{
var type = payload[0];
- if (type == SIRTConstants.BUP) // just bubble up message
+ if (type == SIRTConstants.BUP) // bubble up message
{
this.DecriptResponse(response, payload);
this.BUPReceived?.Invoke(response);
}
- else if (type == SIRTConstants.LAT) // module ready for receiving commands
+ else if (type == SIRTConstants.LAT) // command received
{
this.latReceived = true;
this.DecriptResponse(response, payload);
diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache
index 39b3fdf8..8865d283 100644
--- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache
+++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-b03dfbada453427a2bb1275645a5f1b525f29900
+89102b0142e574de38a9f47d370f3334e5e6c268
diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs
index c0deeed6..eaaaa0c0 100644
--- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs
+++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs
@@ -76,18 +76,6 @@
this.LoadProgrammingParameters(features);
- // The last checked DEBUG telegram
- this.runningTasks.Enqueue(new EregisterCheckFinalizationTask(this.parameters, features.Frequency)
- {
- SlotNr = features.SlotNr,
- PoNr = features.PoNr,
- SerialNr = features.SerialNr,
- RequestAddress = features.ResponseAddress,
- ResponseAddress = features.ResponseAddress,
- EncryptionKey = features.EncryptionKey,
- IsEncrypted = this.parameters.IsEncrypted,
- });
-
// Setting all transmision intervals at the end
this.runningTasks.Enqueue(new EregisterTask(features.Frequency)
{
@@ -106,6 +94,18 @@
Name = "0, 2, 16, 17",
});
+ // The last checked DEBUG telegram
+ this.runningTasks.Enqueue(new EregisterCheckFinalizationTask(this.parameters, features.Frequency)
+ {
+ SlotNr = features.SlotNr,
+ PoNr = features.PoNr,
+ SerialNr = features.SerialNr,
+ RequestAddress = features.ResponseAddress,
+ ResponseAddress = features.ResponseAddress,
+ EncryptionKey = features.EncryptionKey,
+ IsEncrypted = this.parameters.IsEncrypted,
+ });
+
return this.runningTasks.AsEnumerable();
}
@@ -264,25 +264,6 @@
IsEncrypted = this.parameters.IsEncrypted,
});
- if (this.executionType == nameof(LoadInspectionFinalizationTasks))
- {
- this.runningTasks.Enqueue(new EregisterTask(features.Frequency)
- {
- SlotNr = features.SlotNr,
- PoNr = features.PoNr,
- SerialNr = features.SerialNr,
- RequestAddress = features.ResponseAddress,
- ResponseAddress = features.ResponseAddress,
- EncryptionKey = features.EncryptionKey,
- Data = new ChangeWakeUp()
- .Append(new ChangeNumberOfLatWindows()
- .Append(new ChangeTransmissionInterval(3))
- .Append(new OpenMeteringTransmitionIntervalWMBus(this.parameters.OMS_Interval))
- .Append(new ProvidePin(AuthLevel.II))),
- Name = "0, 2, 16, 17",
- });
- }
-
foreach (var pam in features.BuildPams())
{
this.runningTasks.Enqueue(new EregisterTask(frequency)
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/AlarmMask.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/AlarmMask.cs
new file mode 100644
index 00000000..8d5dc35f
--- /dev/null
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/AlarmMask.cs
@@ -0,0 +1,79 @@
+namespace Xylem.Common.Production.ProductionUiCordonel.ProductionProcesses.RFTelegrams
+{
+ using Common.Hardware.SIRT;
+
+ using System.Text;
+
+ public class AlarmMask
+ {
+ protected readonly byte[] bits;
+
+ public AlarmMask(byte value) => this.bits = value.GetBitsLE();
+
+ public bool SpecificError
+ {
+ get => this.bits[0] == 1;
+ set => this.bits[0] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MediumAbsent
+ {
+ get => this.bits[1] == 1;
+ set => this.bits[1] = (byte)(value ? 1 : 0);
+ }
+
+ public bool BrokenPipe
+ {
+ get => this.bits[2] == 1;
+ set => this.bits[2] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Backflow
+ {
+ get => this.bits[3] == 1;
+ set => this.bits[3] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MetrologyUnavailable
+ {
+ get => this.bits[4] == 1;
+ set => this.bits[4] = (byte)(value ? 1 : 0);
+ }
+
+ public bool MagneticTamper
+ {
+ get => this.bits[5] == 1;
+ set => this.bits[5] = (byte)(value ? 1 : 0);
+ }
+
+ public bool Leak
+ {
+ get => this.bits[6] == 1;
+ set => this.bits[6] = (byte)(value ? 1 : 0);
+ }
+
+ public bool LowBattery
+ {
+ get => this.bits[7] == 1;
+ set => this.bits[7] = (byte)(value ? 1 : 0);
+ }
+
+ public override string ToString()
+ {
+ var alarmMaskBuilder = new StringBuilder();
+
+ alarmMaskBuilder.AppendLine($"{nameof(this.SpecificError),20}: {this.SpecificError}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.MediumAbsent),20}: {this.MediumAbsent}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.BrokenPipe),20}: {this.BrokenPipe}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.Backflow),20}: {this.Backflow}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.MetrologyUnavailable),20}: {this.MetrologyUnavailable}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.MagneticTamper),20}: {this.MagneticTamper}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.Leak),20}: {this.Leak}");
+ alarmMaskBuilder.AppendLine($"{nameof(this.LowBattery),20}: {this.LowBattery}");
+
+ return alarmMaskBuilder.ToString();
+ }
+
+ public static implicit operator byte(AlarmMask alarmMask) => alarmMask.bits.GetByteLE();
+ }
+}
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/Extensions.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/Extensions.cs
index 6187842b..055ad21b 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/Extensions.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/Extensions.cs
@@ -2,7 +2,6 @@
{
using System;
using System.Collections.Generic;
- using System.Text.RegularExpressions;
public static class Extensions
{
@@ -525,7 +524,7 @@
if (!string.IsNullOrWhiteSpace(hexString))
{
- hexString = Regex.Replace(hexString, "[^a-fA-F0-9]*", string.Empty);
+ // not needed, only valid hex bytes are processed // hexString = Regex.Replace(hexString, "[^a-fA-F0-9]*", string.Empty);
var first = true;
var x = 0;
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/RFTask.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/RFTask.cs
index e6544bf6..e3ff955e 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/RFTask.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/RFTask.cs
@@ -66,6 +66,21 @@
{
base.OnSEMIReceived(semi);
+ if (semi is null || semi.Payload is null || semi.Payload.Length < 11)
+ {
+ this.SetPending();
+ }
+ else
+ {
+ // PAM Status: [11]
+ var pamStatus = new PAMStatus(semi.Payload[11]);
+
+ if (pamStatus != PAMStatus.OK)
+ {
+ this.SetPending();
+ }
+ }
+
this.SEMI = semi;
this.messages.Push(semi);
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SEMI.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SEMI.cs
index 7926d6ed..abf03f0c 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SEMI.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SEMI.cs
@@ -5,6 +5,9 @@
using System;
using System.Text;
+ ///
+ /// TODO: SEMI from the SirtDLL is not complete,
+ ///
public class SEMI
{
//public const int MIN_LENGTH = 120;
diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs
index 6d5ea3b3..0345bafa 100644
--- a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs
+++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs
@@ -13,6 +13,13 @@
private static Action errorMessageCallback;
private static readonly SIRTHub sirtHub = new SIRTHub();
+ ///
+ /// Connects SIRT's globaly for the application
+ ///
+ /// Action that receives info messages
+ /// Action that receives error messages
+ /// The COM-Ports to be connected
+ /// true - if all ports connected otherwise false
public static bool StartServer(Action messageHandler, Action errorMessageHandler, params int[] comPorts)
{
string sirtId;
@@ -99,6 +106,21 @@
return succeeded;
}
+ ///
+ /// Dispose all SIRT's globaly for the application.
+ ///
+ public static void Dispose()
+ {
+ void LogState(object state) => messageCallback?.Invoke(state?.ToString());
+
+ sirtHub.StateLogging += LogState;
+ sirtHub.Stop();
+ sirtHub.StateLogging -= LogState;
+
+ messageCallback = null;
+ errorMessageCallback = null;
+ }
+
private static bool ConnectSIRT(int portno, out string sirtId, out int frequency)
=> sirtHub.TryOpen($"COM{portno}", out sirtId, out frequency);
@@ -106,6 +128,7 @@
{
void LogMessage(SIRTMessage message) => messageCallback?.Invoke(message.ToString());
+ var dashes = new string('-', 100);
var cordonelTask = new RFTask();
var succeeded = false;
@@ -129,13 +152,21 @@
{
succeeded = true;
- messageCallback?.Invoke($"{cordonelTask.State} - CMD|{cordonelTask}");
- messageCallback?.Invoke(new string('-', 100));
+ messageCallback?.Invoke($"{"CMD",20}: {cordonelTask}");
+ messageCallback?.Invoke($"{"State",20}: {cordonelTask.State}");
+
+ var pam = new PAMStatus(cordonelTask.SEMI.Payload[11]);
+ messageCallback?.Invoke($"{"PAM Status",20}: {pam}");
+
+ var alarm = new AlarmMask(cordonelTask.SEMI.Payload[10]);
+ messageCallback?.Invoke(alarm.ToString());
+
+ messageCallback?.Invoke(dashes);
}
else
{
errorMessageCallback?.Invoke($"{cordonelTask.State} - CMD|{cordonelTask}");
- errorMessageCallback?.Invoke(new string('-', 100));
+ errorMessageCallback?.Invoke(dashes);
}
return succeeded;
diff --git a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
index 47fdd36f..0882a251 100644
--- a/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
+++ b/Common/Production/ProductionUiCordonel/ProductionUiCordonel.csproj
@@ -211,6 +211,7 @@
+
diff --git a/Common/Service/MeterProcessState/MeterProcessState.csproj.user b/Common/Service/MeterProcessState/MeterProcessState.csproj.user
index bd491786..8aa3bc33 100644
--- a/Common/Service/MeterProcessState/MeterProcessState.csproj.user
+++ b/Common/Service/MeterProcessState/MeterProcessState.csproj.user
@@ -2,7 +2,7 @@
Debug|Any CPU
- E:\REPO\lab\la_operations\laa_production\Common\Service\MeterProcessState\Properties\PublishProfiles\a.pubxml
+ a
true
diff --git a/Common/Ui/Common.UI/MainWindow.xaml b/Common/Ui/Common.UI/MainWindow.xaml
index d9df9c04..050ddd42 100644
--- a/Common/Ui/Common.UI/MainWindow.xaml
+++ b/Common/Ui/Common.UI/MainWindow.xaml
@@ -2,6 +2,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShowsNavigationUI="False"
- Source="Pages/SetMetrologyParameters.xaml"
+ Source="Pages/EregisterFinalize.xaml"
Title="PAM 146: Set metrology parameters">
diff --git a/Common/Ui/Common.UI/Models/AuftragDbContext.cs b/Common/Ui/Common.UI/Models/AuftragDbContext.cs
index 34b199f8..7471a7af 100644
--- a/Common/Ui/Common.UI/Models/AuftragDbContext.cs
+++ b/Common/Ui/Common.UI/Models/AuftragDbContext.cs
@@ -31,8 +31,7 @@
sqlConnection
.CreateCommand($@"
UPDATE eRegister
- SET Fabrikationsnummer = @{nameof(state.Fabrikationsnummer)}
- , Bemerkung = @{nameof(state.Bemerkung)}
+ SET Bemerkung = @{nameof(state.Bemerkung)}
, BUP = @{nameof(state.BUP)}
, SEMI = @{nameof(state.SEMI)}
, DEBUG = @{nameof(state.DEBUG)}
@@ -41,7 +40,6 @@
, FunkadresseDatum = @{nameof(state.FunkadresseDatum)}
, TempAdresse = @{nameof(state.TempAdresse)}
WHERE Seriennummer = @{nameof(state.Seriennummer)}")
- .SetParameter(nameof(state.Fabrikationsnummer), state.Fabrikationsnummer)
.SetParameter(nameof(state.Bemerkung), state.Bemerkung)
.SetParameter(nameof(state.BUP), state.BUP)
.SetParameter(nameof(state.SEMI), state.SEMI)