This commit is contained in:
Thomas Wiedebusch 2023-12-11 14:00:44 +01:00
commit 64f13fa9b2
92 changed files with 4168 additions and 180 deletions

View File

@ -155,7 +155,7 @@
</site>
<site name="MeterProcessState" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Projekte\SENSUS_GitLab\laa_production\Common\Service\MeterProcessState" />
<virtualDirectory path="/" physicalPath="C:\Users\drabesch_ro\Repo\lab\la_operations\laa_production\Common\Service\MeterProcessState" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:56011:localhost" />

View File

@ -188,6 +188,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonConsole", "CommonCons
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "modbus_master_csharp", "modbus_master_csharp\modbus_master_csharp.csproj", "{F14940F8-3C86-4BB7-A915-B021E4B3052D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eRegister", "eRegister", "{FBF162DF-A4C6-41D1-9324-5517C13C658B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Protocols", "Protocols", "{1B519B0D-5E1C-4400-A8CE-F7B3CC045745}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamingProtocol", "Hardware\WaterMeter\eRegister\Protocols\StreamingProtocol.csproj", "{B6A19B80-0F0F-434C-A754-A7712FC208B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataPackages", "Hardware\WaterMeter\eRegister\DataPackages\DataPackages.csproj", "{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eRegisterCore", "Hardware\WaterMeter\eRegister\eRegisterCore\eRegisterCore.csproj", "{A83696BF-D8A2-4809-8424-CFE172AED5B6}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4
@ -4382,6 +4392,198 @@ Global
{F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x64.Build.0 = Release|Any CPU
{F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x86.ActiveCfg = Release|Any CPU
{F14940F8-3C86-4BB7-A915-B021E4B3052D}.XP32bit|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.COM|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|x64.ActiveCfg = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|x64.Build.0 = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|x86.ActiveCfg = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Debug|x86.Build.0 = Debug|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.PerformTest|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.Release|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.ReleaseTest|x86.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|x64.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|x64.Build.0 = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|x86.ActiveCfg = Release|Any CPU
{B6A19B80-0F0F-434C-A754-A7712FC208B2}.XP32bit|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.COM|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|x64.ActiveCfg = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|x64.Build.0 = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|x86.ActiveCfg = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Debug|x86.Build.0 = Debug|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.PerformTest|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.Release|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.ReleaseTest|x86.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|x64.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|x64.Build.0 = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|x86.ActiveCfg = Release|Any CPU
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}.XP32bit|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.COM|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|x64.ActiveCfg = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|x64.Build.0 = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|x86.ActiveCfg = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Debug|x86.Build.0 = Debug|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.PerformTest|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.Release|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.ReleaseTest|x86.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|x64.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|x64.Build.0 = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|x86.ActiveCfg = Release|Any CPU
{A83696BF-D8A2-4809-8424-CFE172AED5B6}.XP32bit|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -4467,6 +4669,11 @@ Global
{FD30EB7A-7809-4E62-9374-791D31877D6D} = {696A94BE-7237-4AE2-9E36-6059DE519971}
{AFC428F5-0141-4A3F-BEF2-470A89D972F6} = {C17363DF-A043-4F25-8EBA-2B3B078227DC}
{F14940F8-3C86-4BB7-A915-B021E4B3052D} = {B4F8545B-F379-42A5-BDE9-763FD7B79598}
{FBF162DF-A4C6-41D1-9324-5517C13C658B} = {5563DD3B-2287-4BED-97BF-F0389FF505AF}
{1B519B0D-5E1C-4400-A8CE-F7B3CC045745} = {FBF162DF-A4C6-41D1-9324-5517C13C658B}
{B6A19B80-0F0F-434C-A754-A7712FC208B2} = {1B519B0D-5E1C-4400-A8CE-F7B3CC045745}
{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478} = {FBF162DF-A4C6-41D1-9324-5517C13C658B}
{A83696BF-D8A2-4809-8424-CFE172AED5B6} = {FBF162DF-A4C6-41D1-9324-5517C13C658B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164}

View File

@ -46,6 +46,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ProgramLogFileHelper.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@ -53,6 +54,19 @@
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\Logic\ServiceCore\ServiceCore.csproj">
<Project>{F7E3DF42-4D35-4A0C-9182-90438F9956E1}</Project>
<Name>ServiceCore</Name>
</ProjectReference>
<ProjectReference Include="..\Service\MeterProcessState\MeterProcessState.csproj">
<Project>{1057AD21-BA22-4CAB-B3FE-88C5C9980E6A}</Project>
<Name>MeterProcessState</Name>
</ProjectReference>
<ProjectReference Include="..\Utils\ByteArrayStyle\ByteArrayStyle.csproj">
<Project>{8A619CD5-6C8D-420C-A132-7946C6F13E6E}</Project>
<Name>ByteArrayStyle</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -106,6 +106,9 @@
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<PropertyGroup />
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>

View File

@ -87,6 +87,7 @@
// nUD_TempField_Celsius
//
this.nUD_TempField_Celsius.Anchor = System.Windows.Forms.AnchorStyles.None;
this.nUD_TempField_Celsius.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.nUD_TempField_Celsius.DecimalPlaces = 1;
this.nUD_TempField_Celsius.Increment = new decimal(new int[] {
1,

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.Common.Ui.CordonelPreadjustmentUi.Helper.Extensions;
@ -292,7 +293,7 @@ namespace CordonelPreadjustmentUi
}
private TempMode MeterTempMode;
public TempMode MeterTempMode;
private List<Tuple<double, double>> TempFromTofLUT;
internal void StartTempWatch(TempMode tempMode = TempMode.Hand)
{
@ -308,40 +309,24 @@ namespace CordonelPreadjustmentUi
var pcbid = "notFound";
try
{
pcbid = Meter.GetPcbId();
if (string.IsNullOrEmpty(pcbid))
if (Meter.Slot == 11)
{
pcbid = Meter.GetPcbId();
if (string.IsNullOrEmpty(pcbid))
{
if (Meter.Slot == 11)
{
pcbid = "193400550";
Meter.WriteLog($"Fake pcbid {pcbid} for 2016 slot 11");
}
else if (Meter.Slot == 12)
{
pcbid = "193400388";
Meter.WriteLog($"Fake pcbid {pcbid} for 2016 slot 12");
}
}
pcbid = "193400032";
OverridePassword = "42133FF3682D";
Meter.WriteLog($"Fake pcbid {pcbid} for 2015 slot 11");
}
if (string.IsNullOrEmpty(pcbid) || pcbid.Length < 5 || pcbid.Length == "1934193400388".Length)
else if (Meter.Slot == 12)
{
if (Meter.Slot == 11)
{
pcbid = "193400550";
Meter.WriteLog($"Fake pcbid {pcbid} for 2016 slot 11");
}
else if (Meter.Slot == 12)
{
pcbid = "193400388";
Meter.WriteLog($"Fake pcbid {pcbid} for 2016 slot 12");
}
pcbid = "193400550";
OverridePassword = "42133FF37D41";
Meter.WriteLog($"Fake pcbid {pcbid} for 2015 slot 12");
}
//Meter.Login(OverridePassword);
//Meter.WriteRegister(Register.Genesisflow.TriggerIdle, 0);
//Meter.WriteRegister(Register.Genesisflow.LedMode, 6);
//Meter.WriteRegister(Register.Genesisflow.SampleRate, 10);
var resp = LocalWebRequest.GetRequest($"http://10.49.40.25/MeterProcessState/api/TempFlange/GetLut?PcbId={pcbid}", 50000);

View File

@ -576,6 +576,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.Controls.Add(this.lblBuildDate);
this.Controls.Add(this.cb_Metersize);
this.Controls.Add(this.l_SettingsPreparationMetersize);

View File

@ -88,6 +88,7 @@ namespace CordonelPreadjustmentUi
TempMeterStateCtls.Add(ctl);
gB_TempMeters.Controls.Add(ctl);
ctl.OnRequestDetails += Ctl_MouseEnter;
ctl.DoubleClick += Clt_ReConnect;
tmpI = tmpI + 1;
ctl.Enabled = true;
@ -126,7 +127,6 @@ namespace CordonelPreadjustmentUi
{
}
private void Ctl_MouseEnter(object sender, EventArgs e)
{
if (sender is MeterStateControl meterStateCtl)
@ -146,6 +146,22 @@ namespace CordonelPreadjustmentUi
}
private void Clt_ReConnect(object sender, EventArgs e)
{
if (sender is TempMeterStateControl meterStateCtl)
{
if (this.InvokeRequired)
{
this.Invoke((Action<object, EventArgs>)Clt_ReConnect, sender, e);
return;
}
meterStateCtl.StartTempWatch(meterStateCtl.MeterTempMode);
}
}
public void SetTestBenchTemp(double temp)
{
if (pp != null)
@ -1686,7 +1702,7 @@ namespace CordonelPreadjustmentUi
listOfProgrammParts.Add(new FlushProcess("First Flush", StatusPanelItems.Detect, PredefinedMessages.WaitUntilFlushFinished(pp.Setting.Culture), string.Empty, 2 * 60));
listOfProgrammParts.Add(new PressureTestProcess("PreussureTest", StatusPanelItems.Prepare, PredefinedMessages.WaitUntilPreparationFinished(pp.Setting.Culture), PredefinedMessages.PreparationFailed(pp.Setting.Culture), 1 * 60));
//listOfProgrammParts.Add(new PressureTestProcess("PreussureTest", StatusPanelItems.Prepare, PredefinedMessages.WaitUntilPreparationFinished(pp.Setting.Culture), PredefinedMessages.PreparationFailed(pp.Setting.Culture), 1 * 60));
listOfProgrammParts.Add(new PreparationProcess("Preparation", StatusPanelItems.Prepare, PredefinedMessages.WaitUntilPreparationFinished(pp.Setting.Culture), PredefinedMessages.PreparationFailed(pp.Setting.Culture), 1 * 60));

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using static CordonelPreadjustmentUi.PreAdjustmentControl;
namespace CordonelPreadjustmentUi.Processes.Actions
@ -34,8 +35,40 @@ namespace CordonelPreadjustmentUi.Processes.Actions
if (pp.Setting.GetTempUseTempFlansh())
{
pp.DebugMessage($"Load Temp {tempmeterctl.Slot} with {MeterStateControl.TempMode.CalcTof}\n");
if (tempmeterctl.Meter.Slot == 11)
{
tempmeterctl.OverridePassword = "42133FF3682D";
}
else if (tempmeterctl.Meter.Slot == 12)
{
tempmeterctl.OverridePassword = "42133FF37D41";
}
var Result = string.IsNullOrEmpty(tempmeterctl.OverridePassword)
? tempmeterctl.Meter.Login()
: tempmeterctl.Meter.Login(tempmeterctl.OverridePassword);
if (!Result)
{
if (!tempmeterctl.Meter.Login(tempmeterctl.OverridePassword))
{
pp.DebugMessage($"Login to Flansch failed");
pp.Aborted = true;
}
}
Thread.Sleep(100);
pp.DebugMessage($"Load Temp {tempmeterctl.Slot} with {MeterStateControl.TempMode.CalcTof}\n");
tempmeterctl.Meter.WriteRegister(Register.Genesisflow.TriggerIdle, 0);
tempmeterctl.Meter.WriteRegister(Register.Genesisflow.LedMode, 6);
tempmeterctl.Meter.WriteRegister(Register.Genesisflow.SampleRate, 10);
try
{
tempmeterctl.StartTempWatch(MeterStateControl.TempMode.CalcTof);
@ -104,6 +137,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
meterctl.Failed = !Result;
if (!Result)
{
pp.DebugMessage($"{ProcessName} procedure failed", meterctl.Slot, "APP", meterctl.Meter.PcbId);
//pp.GenerateReturnNote(PredefinedMessages.LoginFailed(pp.Setting.Culture), meterctl);
}

View File

@ -51,7 +51,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions
foreach (var avgTempCtls in listOFEnabledTempMeters)
{
var check = avgTempCtls.GetTemperature();
if (check > 2 || ((double)check) != 25.0d )
if (check > 5 && (double)check != 25.0d )
{
avgTemp = avgTemp + avgTempCtls.GetTemperature();
TempFlanshCount = TempFlanshCount + 1;
@ -61,7 +61,11 @@ namespace CordonelPreadjustmentUi.Processes.Actions
}
if (TempFlanshCount == 0)
{
System.Windows.Forms.MessageBox.Show("Fehler beim auslesen der TemperaturFlansche. Bitte per Hand eingeben");
skipMan = false;
pp.RequestTempretureSelection();
}
else
{
@ -80,12 +84,12 @@ namespace CordonelPreadjustmentUi.Processes.Actions
//manual input
foreach (var meterctl in MetersToProcess)
{
meterctl.SetTemperature((decimal)25.0);
meterctl.SetTemperature((decimal)0);
}
pp.RequestTemperatur();
foreach (var meterctl in TempMeterStateCtls)
{
meterctl.SetTemperature((decimal)25.0);
meterctl.SetTemperature((decimal)0);
meterctl.OnTempretureChangedHandler += delegate (Object sender, EventArgsDecimal d)
{
decimal avgTemp = 0;
@ -144,6 +148,11 @@ namespace CordonelPreadjustmentUi.Processes.Actions
{
var originTemp = putTempIntoMeter.GetTemperature();
if (originTemp == (decimal)25.0 || originTemp == (decimal)1 || originTemp == (decimal)0)
{
pp.DebugMessage($"Temperature check failed - default", putTempIntoMeter.Meter.Slot, "APP", putTempIntoMeter.Meter.PcbId);
return false;
}
UInt32 TempToRegister = (UInt32)(originTemp * 4096);
#region Set temperature calibration register

View File

@ -102,7 +102,7 @@ namespace CordonelPreadjustmentUi.Processes.Itinerary
public event EventHandler<EventArgsBool> OnBubblesChanged;
public event EventHandler<EventArgsBool> OnRequestTempretureSelection;
internal void RequestTempretureSelection()
public void RequestTempretureSelection()
{
if (OnRequestTempretureSelection == null)
{

View File

@ -36,6 +36,12 @@ namespace Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol
_receiveBufferFlushThreshold);
}
public TransmitPortSettings GetTransmitPortSettings(UInt32 baudRate)
{
return new TransmitPortSettings(_protSyncByte, _protLengthIndex, ProtAddLength, _responseTimeoutMs, baudRate,
_receiveBufferFlushThreshold);
}
/// <inheritdoc />
public override List<Byte> DecodeDataForPhysicalLayer(String ident, Byte command, Byte[] payload, Boolean hideDataInLog = false)
{

View File

@ -2051,7 +2051,10 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
try
{
Logout();
//todo only from Bench
//WriteRegister<Byte>(Register.Genesisflow.SampleRate, 2, checkRegister: true);
//WriteRegister(Register.Genesisflow.LedMode, 0, checkRegister: true);
//Logout();
}
catch (Exception)
{
@ -2431,6 +2434,14 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
}
}
}
public void TestBenchDispose()
{
if (IsLoggedOn)
{
}
}
#endregion
}
}

View File

@ -47,7 +47,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
{
if (!SkipPreparationForTestBench)
{
SkipPreparationForTestBench = true;
//SkipPreparationForTestBench = true;
//TODO set display unit
//TODO calculated overflow volume for display
WriteRegister<Byte>(Register.Genesisflow.SampleRate, 16, checkRegister: true);

View File

@ -103,7 +103,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd
{
var url = ServiceUrls.GenesisGetPasswordContainerServiceUrl();
var requestResponse = LocalWebRequest.GetRequestWithError(url + pcbId, out var errorCode, 20000, isRetry: true);
var requestResponse = LocalWebRequest.GetRequestWithError(url + pcbId, out var errorCode, 30000, isRetry: true);
if (errorCode == HttpStatusCode.OK.GetHashCode())
{
passwordContainer = JsonConvert.DeserializeObject<MeterPwdDb>(requestResponse);

View File

@ -123,5 +123,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
/// Date of approval.
/// </summary>
public DateTime ApprovalDate;
public Double UNTLimit { get; internal set; } = 0;
public Boolean UNTStatus { get; internal set; } = false;
}
}

View File

@ -136,6 +136,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus
// convert the seconds to years
status.RemainingLifeTimeYears = remainingLifetime_s / 3600 / 24 / 365.25;
status.UNTLimit = 1368000000 + (status.ExceededLifeTime_s * 77.7);
status.UNTStatus = status.UNTLimit >= status.DrainedBatteryLoad_uAs;
return retVal;
}
}

View File

@ -1232,6 +1232,11 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
}
}
}
public void TestBenchDispose()
{
//nothing to do
}
#endregion
}
}

View File

@ -34,7 +34,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
/// </summary>
private readonly MagFluxRecord _dataMagFluxDefault = new MagFluxRecord
{
VolumeCm = 0.0,
VolumeCm = 0.0,
ForwardVolumeCm = 0.0,
NegativeReverseVolumeCm = 0.0,
TimeS = 0.0,
@ -43,7 +43,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
UniqueId = "?",
SensorId = "?",
Crc = 0xFFFF,
OverflowVolumeCm = DefaultMagFluxOverflowVolumeCm,
OverflowVolumeCm = DefaultMagFluxOverflowVolumeCm,
OverflowTimeS = CpuTimeOverflowS,
IsValid = false
};
@ -158,7 +158,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
}
break;
}
}
}
catch (Exception)
{
@ -201,7 +201,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
// parse the floating point value of the flow rate which is a string containing the hex value as 32 bit
var hex = UInt32.Parse(fields[(Int32)ProtLsubString.FlowRate], NumberStyles.AllowHexSpecifier);
var floatValues = BitConverter.GetBytes(hex);
dataMagFluxRec.FlowRateCmPh = BitConverter.ToSingle(floatValues, 0) *
dataMagFluxRec.FlowRateCmPh = BitConverter.ToSingle(floatValues, 0) *
LitersPerSecondToCmPerHourFactor;
// get status and identifiers
@ -230,4 +230,4 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol
Crc
}
}
}
}

View File

@ -0,0 +1,12 @@
namespace Xylem.Common.Hardware.WaterMeter.WaterMeterCore.BatchActions
{
/// <inheritdoc />
public class BatchCallTestBenchDispose: BatchCall
{
/// <inheritdoc />
public override void DoSingleAction(IMeter meter)
{
meter.TestBenchDispose();
}
}
}

View File

@ -282,6 +282,6 @@ namespace Xylem.Common.Hardware.WaterMeter.WaterMeterCore
/// Clear all object set up on runtime
/// </summary>
void DisposeMeter();
void TestBenchDispose();
}
}

View File

@ -247,5 +247,11 @@ namespace Xylem.Common.Hardware.WaterMeter.WaterMeterCore
}
}
public void DisposeTestBench()
{
_logger.Info("Dispose batch make sure green LED is off");
var batchCall = new BatchCallStopMeasurement();
batchCall.RunAction(ListOfMeters);
}
}
}

View File

@ -254,6 +254,7 @@
<Compile Include="BatchActions\BatchCallStartCalibration.cs" />
<Compile Include="BatchActions\BatchCallStartMeasurement.cs" />
<Compile Include="BatchActions\BatchCallStopCalibration.cs" />
<Compile Include="BatchActions\BatchCallTestBenchDispose.cs" />
<Compile Include="BatchActions\BatchCallStopMeasurement.cs" />
<Compile Include="Consts\DisplayCodes.cs" />
<Compile Include="DataPackages\FlowDeviations.cs" />

View File

@ -1 +1 @@
bf6bb8fceb3db5a9977dadc407cf576684bf7127
c43c40a030005a8f189e6179faf40a6d42bfef5c

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages</RootNamespace>
<AssemblyName>Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ERegisterFlowDataEventArgs.cs" />
<Compile Include="MeasurementRecords.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\CommonCore\CommonCore.csproj">
<Project>{1B02C79E-0B19-43E2-8F6B-71EF0C786C97}</Project>
<Name>CommonCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Metrology\Measurements\Measurements.csproj">
<Project>{6CCDB656-C676-4360-BABA-C4596AAD175D}</Project>
<Name>Measurements</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Protocols\ProtocolCore\ProtocolCore.csproj">
<Project>{8bdd2789-96d4-43ea-aad7-0f49d0347998}</Project>
<Name>ProtocolCore</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,20 @@
using System;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
namespace Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages.EventArguments
{
/// <inheritdoc />
public class ERegisterFlowDataEventArgs : BaseDataEventArgs
{
/// <summary>
/// new record from Stream
/// </summary>
public MeasurementRecords.ERegisterRecord NewData;
/// <inheritdoc />
public override Object GetEventData()
{
return NewData;
}
}
}

View File

@ -0,0 +1,55 @@
using System;
using System.Text;
using Xylem.Common.Metrology.Measurements;
namespace Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages.MeasurementRecords
{
/// <inheritdoc />
/// <summary>
/// struct to hold Led record for protocol L (contains measurement record)
/// </summary>
public class ERegisterRecord : MeasurementRecord
{
/// <summary>
/// Serial number of MagFlux
/// </summary>
public String UniqueId;
/// <summary>
/// Status of sensor and electronics
/// </summary>
public UInt32 StatusBits;
/// <summary>
/// String delimiter to separate elements in ToString() routine
/// </summary>
private const String StringDelimiter = "; \n";
/// <summary>
/// Get result as string
/// </summary>
/// <returns></returns>
public override String ToString()
{
var sb = new StringBuilder();
sb = sb.Append($"Volume [m³]: {VolumeCm}").Append(StringDelimiter)
.Append($"Negative Reverse Volume [m³]: {NegativeReverseVolumeCm}").Append(StringDelimiter)
.Append($"CPU Time [s]: {TimeS}").Append(StringDelimiter)
.Append($"FlowRate [m³/h]: {FlowRateCmPh}").Append(StringDelimiter)
.Append($"Status: 0x{StatusBits:X8}").Append(StringDelimiter)
.Append($"UniqueId: {UniqueId}").Append(StringDelimiter)
.Append($"CRC: 0x{Crc:X4}").Append(StringDelimiter)
.Append($"OverflowVolume [m³]: {OverflowVolumeCm}").Append(StringDelimiter)
.Append($"OverflowTime [s]: {OverflowTimeS}").Append(StringDelimiter)
.Append($"IsValid: {IsValid}").Append(StringDelimiter)
.Append($"ReceivedTime [UTC]: {ReceivedTime}").Append(StringDelimiter)
.Append($"DecodedTime [UTC]: {DecodedTime}").Append(StringDelimiter)
.Append($"SyncMarkRecord: {SyncMarkRecord}");
return sb.ToString();
}
public long PcbID { get; set; }
public long Radio { get; set; }
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DataPackages")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataPackages")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c2808a8e-c0ba-44ec-b7b1-1c66ad3d8478")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net40" requireReinstallation="true" />
</packages>

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xylem")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright © Xylem 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d6b81c60-2763-4c4d-989f-90822f53b01a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,219 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages.MeasurementRecords;
using Xylem.Common.Utils.Crc16Ccitt;
namespace Xylem.Common.Hardware.WaterMeter.eRegister.Protocols.StreamingProtocol
{
/// <summary>
/// Data fields and definitions for GENESIS streaming protocol
/// </summary>
public class StreamingDecoder
{
private const Double MilliLitersToCmFactor = 1.0E-6;
private const Double CpuTimeToSecondsFactor = 1.0 / 0x10000;
private const Double CpuTimeOverflowS = 0x100000000 * CpuTimeToSecondsFactor;
private const Double LitersPerSecondToCmPerHourFactor = 3600.0 / 1000.0;
private const Double DefaultVolumeScaleRawPerMl = 1024.0;
private const Double DefaultVolumeFactorRawToCm = MilliLitersToCmFactor / DefaultVolumeScaleRawPerMl;
private const Double MaxGenesisAccuVolumeRaw = UInt32.MaxValue; //0x100000000; //2^32
private const Double DefaultAccuDutOverflowVolumeCm = MaxGenesisAccuVolumeRaw * DefaultVolumeFactorRawToCm;
private const Double DisplayMlSetupDutOverflowVolumeCm = 1000.0; //overflow of LCD if set to ml
private const Double TofToSecondsFactor38Bit = 1.0 / 0x4000000000; // 2^38
private const Double AmplitudeToVoltFactor = 1.0 / 0x400000 / 1000.0; // 2^22 100 0000 0000 0000 0000 0000b
private const Double PulseWidthToRelFactor = 1.0 / 0x100; // 2^8
//// protocol 'l' MagFlux
private const Double MaxMagFluxVolumeRaw = UInt64.MaxValue;//0x10000000000000000; //2^64
private const Double DefaultMagFluxOverflowVolumeCm = MaxMagFluxVolumeRaw / MilliLitersToCmFactor;
///// <summary>
///// Default data for
///// </summary>
private readonly ERegisterRecord _dataeRegisterDefault = new ERegisterRecord
{
VolumeCm = 0.0,
ForwardVolumeCm = 0.0,
NegativeReverseVolumeCm = 0.0,
TimeS = 0.0,
FlowRateCmPh = 0.0,
StatusBits = 0,
UniqueId = "?",
Crc = 0xFFFF,
OverflowVolumeCm = DefaultMagFluxOverflowVolumeCm,
OverflowTimeS = CpuTimeOverflowS,
IsValid = false
};
private ERegisterRecord _dataERegisterRec;
private readonly Boolean _ignoreCorruptedData;
private String _pcbIdMask;
private String _uniqueIdMask;
/// <summary>
/// Constructor initializes all decoded members with default values
/// </summary>
public StreamingDecoder(Boolean ignoreCorruptedData = true)
{
_dataERegisterRec = _dataeRegisterDefault;
_ignoreCorruptedData = ignoreCorruptedData;
}
/// <summary>
/// Data of MagFlux
/// </summary>
public ERegisterRecord dataERegister
{
get; private set;
}
/// <summary>
/// Set decoding mask for streaming protocol, wipes out all not matching records:
/// - PcbIdMask equals the sensor serial no
/// - UniqueIdMask
/// </summary>
/// <param name="pcbIdMask"></param>
/// <param name="uniqueIdMask"></param>
/// <returns>true if decoding was successful and data has been validated</returns>
/// <remarks date="2023-Mai-30" author="T.Wiedebusch">
/// - Initial.
/// </remarks>
public void SetDecodingMask(String pcbIdMask, String uniqueIdMask)
{
// the pcbId equals the sensorSn
_pcbIdMask = pcbIdMask;
_uniqueIdMask = uniqueIdMask;
}
////' Berechnung der Checksumme vom eRegister Optotelegramm
////' Input "Val 1] \t [Val 2] \t [Val 3] \t [Val 4] \t" ohne "CS" und CrLf !!
////' Output 2-Byte Hex Wert:
//private string CalculateCheckSum(strBytes)
// Dim i As Integer
// Dim iChecksum As Long
// iChecksum = 0
// ' Bytesum([ Val 1 ] \t [ Val 2] \t [ Val 3] \t [ Val 4] \t) & 0xFF
// For i = 1 To Len(strBytes) - 2
// ''Debug.Print i & ": " & Mid(strBytes, i, 1) & " = " & Asc(Mid(strBytes, i, 1)) & " sum=" & iChecksum
// iChecksum = iChecksum + Asc(Mid(strBytes, i, 1))
// Next
// ' (only one byte, higher bits will be cut off).
// iChecksum = iChecksum And 255
// ' This binary 1-byte value is then converted into two ASCII bytes
// CalculateCheckSum = Right("0" & Hex(iChecksum), 2)
//End Function
/// <summary>
/// Decoding the raw message
/// </summary>
/// <param name="rawMsg">message received as one line delimited with LF</param>
/// <returns>true if decoding was successful and data has been validated</returns>
/// <remarks date="2023-Mar-09" author="T.Wiedebusch">
/// - Modified using common CRC check before branching to the protocol specific decoder.
/// </remarks>
/// <remarks date="2023-May-25" author="T.Wiedebusch">
/// - Introduced reverse volume.
/// </remarks>
public Boolean DecodeMsg(String rawMsg)
{
var rawRecordIsValid = false;
try
{
//MagFlux test string:
//rawMsg = "@l 1bd911f 0 95b8d4 40cf9b5c 0 26004f5232500120373235 0 5863"
//Protocol version, DUT:Vol FWD [mL], DUT: Vol REV [ml], DUT:Time [s], DUT:Flow_LPS, DUT:StatusBitsHex,
//l, 29200671, 0, 149.7219849, 6.487714767, 0,
//DUT:UniqueId, DUT:SensorId, DUT:CRC
//4.59406E+25, 0, 22627 (0x5863)
// The received message is a string with a line delimiter.
rawMsg = rawMsg.Replace('\t', ' ');
//// The raw message fields are the separated values from the received string with a blank as field separator
var rawMsgFields = rawMsg.Split(' ');
dataERegister = new ERegisterRecord();
if (rawMsgFields.Length == 5)
{
dataERegister.PcbID = long.Parse(rawMsgFields[0]);
dataERegister.Radio = long.Parse(rawMsgFields[1]);
dataERegister.VolumeCm = double.Parse(rawMsgFields[2]) / 1000 / 1000;
dataERegister.TimeS = double.Parse(rawMsgFields[3]) / 1000;
dataERegister.Crc = ushort.Parse(rawMsgFields[4]);
rawRecordIsValid = true;
dataERegister.IsValid = rawRecordIsValid;
return rawRecordIsValid;
}
else
{
return rawRecordIsValid;
}
// PCB ID - RADIO - Vol - Time -CS
//// The last element is the CRC, the CRC can be separated, calculated and validated before trying to decode the content
//var rawRecordForCrc = "";
//// get all fields excluding the CRC (length - 1)
//for (var x = 0; x < rawMsgFields.Length - 1; x++)
//{
// rawRecordForCrc += rawMsgFields[x];
// // add the field delimiter from raw data
// rawRecordForCrc += " ";
//}
//// extract bytes of raw message for CRC calculation each character, CRC field is already removed
//var byteArraySize = rawRecordForCrc.Length;
//var byteArray = new Byte[byteArraySize];
//for (var i = 0; i < byteArraySize; i++)
//{
// byteArray[i] = (Byte)rawRecordForCrc[i];
//}
//// calculate the CRC from the received data
//var calculatedCrc = Crc16Ccitt.CalculateMsb1021(byteArray);
//// extract received CRC
//var receivedCrc = UInt16.Parse(rawMsgFields[rawMsgFields.Length - 1], NumberStyles.HexNumber);
//// compare received with calculated CRC and remind valid decoding
//rawRecordIsValid = calculatedCrc == receivedCrc;
//switch (rawMsgFields[0])
//{
// case "@l":
// if (rawRecordIsValid || !_ignoreCorruptedData)
// {
// DecodeProtocolL(ref _dataMagFluxRec, rawMsgFields);
// if (string.Equals(_uniqueIdMask, _dataMagFluxRec.UniqueId) &&
// string.Equals(_pcbIdMask, _dataMagFluxRec.SensorId))
// {
// DataMagFlux = _dataMagFluxRec;
// _dataMagFluxRec.IsValid = rawRecordIsValid;
// }
// }
// break;
// }
}
catch (Exception)
{
// ignored
}
return rawRecordIsValid;
}
}
}

View File

@ -0,0 +1,82 @@
using System;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
using Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages;
namespace Xylem.Common.Hardware.WaterMeter.eRegister.Protocols.StreamingProtocol
{
/// <inheritdoc />
/// <summary>
/// Layer between <see cref="StreamingDecoder" /> CRC16CCITT handler and Events
/// block trashy telegrams
/// </summary>
public class StreamingProtocol : BaseProtocol
{
/// <summary>
/// Decode data and hold results
/// </summary>
private StreamingDecoder _streamingDecode;
private readonly Boolean _ignoreCorruptedData;
private String _pcbIdMask;
private String _uniqueIdMask;
/// <inheritdoc />
public override event EventHandler<BaseDataEventArgs> OnRecordIsDecoded;
/// <summary>
/// Set decoding mask for streaming protocol, wipes out all not matching records:
/// - PcbIdMask equals the sensor serial no
/// - UniqueIdMask
/// </summary>
/// <param name="pcbIdMask"></param>
/// <param name="uniqueIdMask"></param>
/// <returns>true if decoding was successful and data has been validated</returns>
/// <remarks date="2023-Mai-30" author="T.Wiedebusch">
/// - Initial.
/// </remarks>
public void SetDecodingMask(String pcbIdMask, String uniqueIdMask)
{
// the pcbId equals the sensorSn
_pcbIdMask = pcbIdMask;
_uniqueIdMask = uniqueIdMask;
}
/// <inheritdoc />
protected override void DecodeRecord(IPortDataEventArgs dataArgs)
{
var data = (String)dataArgs.GetData();
//Data decoding
_streamingDecode = new StreamingDecoder(_ignoreCorruptedData);
_streamingDecode.DecodeMsg(data);
//Event for new data
if (_streamingDecode.dataERegister != null)
{
_streamingDecode.dataERegister.SyncMarkRecord = dataArgs.GetSyncMarkRecord();
_streamingDecode.dataERegister.ReceivedTime = dataArgs.GetReceivedTime();
if (_streamingDecode.dataERegister.IsValid)
{
OnRecordIsDecoded?.Invoke(this,
new ERegister.DataPackages.EventArguments.ERegisterFlowDataEventArgs { NewData = _streamingDecode.dataERegister, RawData = data });
}
else if (!_ignoreCorruptedData)
{
OnRecordIsDecoded?.Invoke(this,
new ERegister.DataPackages.EventArguments.ERegisterFlowDataEventArgs { NewData = _streamingDecode.dataERegister, RawData = data });
}
}
//toDo: handle trashy telegrams
}
/// <inheritdoc />
public StreamingProtocol(String ident, Boolean ignoreCorruptedData = true) : base(ident)
{
_ignoreCorruptedData = ignoreCorruptedData;
}
}
}

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B6A19B80-0F0F-434C-A754-A7712FC208B2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol</RootNamespace>
<AssemblyName>Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.StreamingProtocol</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\..\..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StreamingDecoder.cs" />
<Compile Include="StreamingProtocol.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\CommonCore\CommonCore.csproj">
<Project>{1B02C79E-0B19-43E2-8F6B-71EF0C786C97}</Project>
<Name>CommonCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Metrology\Measurements\Measurements.csproj">
<Project>{6CCDB656-C676-4360-BABA-C4596AAD175D}</Project>
<Name>Measurements</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Utils\Crc16Ccitt\Crc16Ccitt.csproj">
<Project>{91DEF0C0-AA4F-40AE-8F18-CB717FDE7E7F}</Project>
<Name>Crc16Ccitt</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Ports\PortCore\PortCore.csproj">
<Project>{2E139F63-B6FE-4EA9-A098-85364FE9B26C}</Project>
<Name>PortCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Protocols\ProtocolCore\ProtocolCore.csproj">
<Project>{8BDD2789-96D4-43EA-AAD7-0F49D0347998}</Project>
<Name>ProtocolCore</Name>
</ProjectReference>
<ProjectReference Include="..\DataPackages\DataPackages.csproj">
<Project>{c2808a8e-c0ba-44ec-b7b1-1c66ad3d8478}</Project>
<Name>DataPackages</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="NLog" version="5.2.2" targetFramework="net48" />
</packages>

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("eRegisterCore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("eRegisterCore")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a83696bf-d8a2-4809-8424-cfe172aed5b6")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A83696BF-D8A2-4809-8424-CFE172AED5B6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore</RootNamespace>
<AssemblyName>Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\NLog.5.2.2\lib\net35\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="eRegisterMeter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\CommonCore\CommonCore.csproj">
<Project>{1B02C79E-0B19-43E2-8F6B-71EF0C786C97}</Project>
<Name>CommonCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Metrology\Measurements\Measurements.csproj">
<Project>{6CCDB656-C676-4360-BABA-C4596AAD175D}</Project>
<Name>Measurements</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\SoftwareAccessHelper\SoftwareAccessHelper.csproj">
<Project>{a33e3c6d-eaae-4a20-a0ee-f9e6922fd029}</Project>
<Name>SoftwareAccessHelper</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Utils\Logging\Logging.csproj">
<Project>{4b88b0d3-e791-4774-9521-eabeacdc420e}</Project>
<Name>Logging</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Ports\PortCore\PortCore.csproj">
<Project>{2E139F63-B6FE-4EA9-A098-85364FE9B26C}</Project>
<Name>PortCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Ports\SerialPorts\SerialPorts.csproj">
<Project>{72037e89-4f63-4b3f-beff-4138e578ce99}</Project>
<Name>SerialPorts</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Protocols\ProtocolCore\ProtocolCore.csproj">
<Project>{8BDD2789-96D4-43EA-AAD7-0F49D0347998}</Project>
<Name>ProtocolCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Interfaces\Protocols\TransmitProtocol\TransmitProtocol.csproj">
<Project>{63E0AC5E-B7C8-4363-A2FE-BE489E648FF0}</Project>
<Name>TransmitProtocol</Name>
</ProjectReference>
<ProjectReference Include="..\..\WaterMeterCore\WaterMeterCore.csproj">
<Project>{8203abb8-38e5-472e-a742-33f38b7a74a6}</Project>
<Name>WaterMeterCore</Name>
</ProjectReference>
<ProjectReference Include="..\DataPackages\DataPackages.csproj">
<Project>{C2808A8E-C0BA-44EC-B7B1-1C66AD3D8478}</Project>
<Name>DataPackages</Name>
</ProjectReference>
<ProjectReference Include="..\Protocols\StreamingProtocol.csproj">
<Project>{b6a19b80-0f0f-434c-a754-a7712fc208b2}</Project>
<Name>StreamingProtocol</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,693 @@
using Newtonsoft.Json;
using NLog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Ports.SerialPorts;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore;
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
using Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol;
using Xylem.Common.Hardware.WaterMeter.eRegister.Protocols.StreamingProtocol;
using Xylem.Common.Hardware.WaterMeter.ERegister.DataPackages.MeasurementRecords;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
using Xylem.Common.Metrology.Measurements;
using Xylem.Common.Metrology.Measurements.Consts;
using Xylem.Common.Utils.Logging;
namespace Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore
{
public class eRegisterMeter : WaterMeterCore.IMeter, WaterMeterCore.IMeterEvents
{
public String SerialNumber
{
get; set;
}
/// <inheritdoc />
public Int32 Slot
{
get; set;
}
/// <inheritdoc />
public Int32 IntermediateUpdateTimeS
{
get;
set;
} = 10;
/// <summary>
/// to reduce the IrdA communication in test bench, preparation will be done once (when SkipPreparationForTestBench is true)
/// </summary>
public Boolean SkipPreparationForTestBench
{
get; set;
}
private String _currentActionText = "";
/// <summary>
/// Hold the current process name e.g. FlowTest, Preadjustment for logging
/// </summary>
public String CurrentActionText
{
get => _currentActionText;
set
{
_currentActionText = value;
SetLogger();
}
}
private ILogger _logger;
/// <summary>
/// streaming port assignment/info
/// </summary>
private IPort StreamingPort
{
get;
set;
}
/// <summary>
/// streaming protocol assignment/info
/// </summary>
private StreamingProtocol StreamingProtocol;
/// <summary>
/// List of ongoing measurements, base- and calibration-measurements
/// </summary>
private List<IMeasurement> _listOfIMeasurement = new List<IMeasurement>();
/// <summary>
/// Enable raw record logging, if set every incoming package will be logged
/// </summary>
private Boolean _enableRawDataLogging;
public event EventHandler OnProcessStatusChanged;
public event EventHandler OnErrorStatusChanged;
public event EventHandler OnInitCompleted;
public event EventHandler OnMeasurementInitCompleted;
public event EventHandler OnMeasurementCompleted;
public event EventHandler OnCalibInitCompleted;
public event EventHandler OnCalibCompleted;
public event EventHandler OnDisposeCompleted;
/// <summary>
/// do not use it to set ProcessStatus
/// if you want to change ProcessStatus of this genesis use <see cref="ProcessStatus" />
/// <see cref="_myProcessStatus" /> is just store for some routines
/// </summary>
private ProcessState _myProcessStatus;
/// <inheritdoc />
/// if state is change
/// <see cref="OnProcessStatusChanged" />
/// will be invoked.
/// on some states other events will be invoke as well
public ProcessState ProcessStatus
{
get => _myProcessStatus;
private set
{
if (_myProcessStatus == value)
{
return;
}
_myProcessStatus = value;
Invoker(OnProcessStatusChanged);
switch (value)
{
case ProcessState.InitIsActive:
Invoker(OnInitCompleted);
break;
case ProcessState.MeasurementIsActive:
Invoker(OnMeasurementInitCompleted);
break;
case ProcessState.MeasurementIsDone:
Invoker(OnMeasurementCompleted);
break;
case ProcessState.CalibrationIsActive:
Invoker(OnCalibInitCompleted);
break;
case ProcessState.CalibrationIsDone:
Invoker(OnCalibCompleted);
break;
case ProcessState.QRefDone:
case ProcessState.WaitForQRef:
case ProcessState.WaitForCalibration:
case ProcessState.WaitForMeasurement:
case ProcessState.IsNotInit:
//no extra event needed
break;
default:
throw new OverflowException("MagFlux measurement unknown process status");
}
}
}
public void BuildAndCheckCalibFactorsAllChannels(Double refVolumeCm, Double? refTimeS = null, Double reqDeviationPercent = 0, Double maxCalibFactorTolerancePercent = 0)
{
//no calibration
}
public Boolean CheckStateAfterMeasurement()
{
return true;
}
/// <summary>
/// A helper to invoke events only if someone is listening, otherwise nothing will happen
/// </summary>
/// <param name="handler">Event handler to call</param>
/// <param name="sender">Sender (can be null)</param>
/// <param name="e">Event arguments (can be null)</param>
private void Invoker(EventHandler handler, Object sender = null, EventArgs e = null)
{
if (handler != null)
{
if (sender == null)
{
sender = this;
}
if (e == null)
{
e = new EventArgs();
}
handler.Invoke(sender, e);
}
// ReSharper disable once RedundantIfElseBlock
else
{
//nobody is listening
}
}
/// <inheritdoc />
/// <summary>
/// Start Event listening, has to be called after <see cref="SetupGenesisMeter" />
/// </summary>
public void ConnectMeter()
{
if (StreamingPort != null && StreamingPort.GetPortName() != BaseSerialPort.PortNotAssigned)
{
LinkPortToProtocol(StreamingPort, StreamingProtocol);
_logger.Trace($"Slot:{Slot} - StreamingPort and StreamingProtocol linked");
StreamingProtocol.OnRecordIsDecoded += StreamingProtocol_ApplyDecodedRecord;
}
_logger.Debug($"Slot:{Slot} - Connected and communication started");
}
/// <summary>
/// Add a port to working queue
/// </summary>
/// <param name="port">On <see cref="IPort" /> should one once added in runtime</param>
/// <param name="protocol"></param>
public void LinkPortToProtocol(IPort port, IProtocol protocol)
{
//for streaming mode only
if (port == null)
{
return;
}
port.OnRawRecordReceived += delegate (Object o, BasePortDataEventArgs rawMsg)
{
protocol.FillDecodingBuffer(rawMsg);
};
try
{
if (!port.IsOpen())
{
port.Open();
}
}
catch (Exception ex)
{
throw new ApplicationException($"Cannot Open Comport. Check TaskManager for other Genesis relevant programs and close them. Also check if the comport is valid! { Environment.NewLine }{ ex.Message}");
}
protocol.OnRecordReadyToSend += delegate (Object o, BasePortDataEventArgs dataToSend)
{
var data = (List<Byte>)dataToSend.GetData();
port.PortWrite(data.ToArray());
};
}
/// <summary>
/// Track all incoming led record packages (Calibration and Flow)
/// </summary>
/// <param name="sender"></param>
/// <param name="e">
/// I should be <see cref="MagFluxRecord" />
/// otherwise this method does nothing
/// </param>
private void StreamingProtocol_ApplyDecodedRecord(Object sender, BaseDataEventArgs e)
{
var result = e.GetEventData();
if (result is IMeasurementRecord measurementRecord)
{
if (measurementRecord is ERegisterRecord record)
{
if (!record.IsValid)
{
return;
}
}
AddData(measurementRecord);
}
}
public void Dispose()
{
_logger.Trace($"Slot:{Slot} - Start to dispose");
StreamingProtocol.OnRecordIsDecoded -= StreamingProtocol_ApplyDecodedRecord;
LogRawData(false);
LogManager.Flush();
//isPart of Logout
StreamingPort?.Dispose();
StreamingProtocol?.Dispose();
_logger.Trace($"Slot:{Slot} - Dispose is finished");
}
public void DisposeMeter()
{
Dispose();
}
public List<MeasurementResults> GetAllMeasurementResults(Double? refVolume, Double? refTimeS, Boolean intermediateMeasurement = false, Int32? channel = null, MeasurementDirection dir = MeasurementDirection.TakeBoth)
{
if (!intermediateMeasurement && GetMeasurementState(channel) != MeasurementStates.IsCompleted)
{
throw new ApplicationException("Measurement is not completed");
}
var mainMeasurement = _listOfIMeasurement.FirstOrDefault(m => m.GetType() == typeof(ERegisterRecord));
if (mainMeasurement == null)
{
throw new ApplicationException("Can not find an ongoing measurement");
}
mainMeasurement.FlowDirectionforCalculatingVol = MeasurementDirection.TakeBoth;
var results = new List<MeasurementResults>();
var mainResult = intermediateMeasurement
? mainMeasurement.GetIntermediateMeasurementResult(refVolume, refTimeS)
: mainMeasurement.GetFinalMeasurementResult(refVolume, refTimeS);
results.Add(mainResult);
_logger.Info($"Slot:{Slot}, Channel:{mainMeasurement.GetChannel()} - MeasuredTime({mainResult.DutTimeS}s), " +
$"MeasuredVolume({mainResult.DutVolumeCm}Qm)");
foreach (var otherMeasurement in _listOfIMeasurement.Where(m => m.GetType() != typeof(ERegisterRecord)))
{
try
{
var otherResults = intermediateMeasurement
? otherMeasurement.GetIntermediateMeasurementResult(refVolume, refTimeS)
: otherMeasurement.GetFinalMeasurementResult(refVolume, refTimeS);
_logger.Info($"Slot:{Slot}, Channel:{otherMeasurement.GetChannel()} - ChannelTime({otherResults.DutTimeS}s), " +
$"ChannelVolume({otherResults.DutVolumeCm}Qm)");
results.Add(otherResults);
}
catch (Exception ex)
{
_logger.Warn($"Slot:{Slot}, No Results for channel:{otherMeasurement.GetChannel()} Ex: {ex.Message}");
if (channel == null)
{
throw new ApplicationException($"Can not read result from channel:{otherMeasurement.GetChannel() } Ex: {ex.Message}");
}
}
}
return results;
}
public MeasurementStates GetCalibrationState()
{
return GetMeasurementState();
}
public DisplayCodes GetLastProcessState()
{
throw new NotImplementedException();
}
public MeasurementResults GetMainMeasurementResult(Double? refVolume, Double? refTimeS, Boolean intermediateMeasurement = false, MeasurementDirection dir = MeasurementDirection.TakeBoth)
{
if (!intermediateMeasurement && GetMeasurementState(0) != MeasurementStates.IsCompleted)
{
throw new ApplicationException("Measurement is not completed");
}
if (dir != MeasurementDirection.TakeOnlyBackward)
{
_logger.Info($"Slot:{Slot} - Wrong MeasurementDirection no backwards volume for eRegister");
}
return GetAllMeasurementResults(refVolume, refTimeS, intermediateMeasurement, 0).First();
}
public MeasurementStates GetMeasurementState(Int32? onlyChannelNr = null)
{
_logger.Trace($"Slot:{Slot} - Get measurement state");
if (!_listOfIMeasurement.Any())
{
return MeasurementStates.NotStarted;
}
if (onlyChannelNr.HasValue)
{
var measurement = _listOfIMeasurement.First(f => f.GetChannel() == onlyChannelNr.Value);
return measurement.GetMeasurementState();
}
return _listOfIMeasurement.Min(m => m.MeasurementState);
}
public String GetPcbId()
{
return "1";
}
public void InitCalibration()
{
_logger.Info($"Slot:{Slot} - Init measurement");
PreMeasurement();
}
public void InitMeasurement()
{
_logger.Info($"Slot:{Slot} - Init measurement");
PreMeasurement();
}
private void PreMeasurement()
{
if (!SkipPreparationForTestBench)
{
SkipPreparationForTestBench = true;
}
else
{
WriteLog("Wait on measurement start");
}
ProcessStatus = ProcessState.WaitForMeasurement;
}
public Boolean Login()
{
return true;
}
public Boolean Login(String password, Boolean runImmediately = true, Boolean skipReadMeterFwAndAssignRegisters = false)
{
return true;
}
public Boolean Logout()
{
return true;
}
public void LogRawData(Boolean on)
{
_enableRawDataLogging = on;
if (StreamingPort is Interfaces.Ports.SerialPorts.LedSerialPort port)
{
port.RecordStreamingRawData = _enableRawDataLogging;
}
}
public Boolean RequestIntermediateMeasurementState(Int32? onlyChannelNr = null)
{
_logger.Trace($"Slot:{Slot} - Get measurement state");
if (!_listOfIMeasurement.Any())
{
return false;
}
Boolean? ret = null;
foreach (var item in _listOfIMeasurement)
{
if (!onlyChannelNr.HasValue || item.GetChannel() == onlyChannelNr.Value)
{
var measurement = _listOfIMeasurement.First(f => onlyChannelNr != null && f.GetChannel() == onlyChannelNr.Value);
if ((measurement.MeasurementState == MeasurementStates.IsRunning
|| measurement.MeasurementState == MeasurementStates.IsWaitingForIntermediateData))
{
measurement.RequestIntermediateRecord();
if (!ret.HasValue)
{
ret = true;
}
}
else
{
ret = false;
}
}
}
return ret.HasValue ? ret.Value : false;
}
public void SetCalibFactorsAllChannels(Boolean justLog = false)
{
throw new NotImplementedException();
}
public void SetLcdText(Boolean release, Byte[] textInHex)
{
//
}
public void SetProcessState(DisplayCodes newState, Boolean webRequest = true)
{
//
}
public void SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData = true, Boolean useRequest = true, Boolean useStreaming = true)
{
Slot = slot;
var configFile = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Genesis", ProgramConfig.SerialConfigFileName);
if (!System.IO.File.Exists(configFile))
{
configFile = Path.Combine(ProgramConfig.SerialConfigFileName);
if (!File.Exists(configFile))
{
throw new ApplicationException($"Configuration file {configFile} not found ");
}
}
var tr = new StreamReader(configFile);
var slotConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(tr.ReadToEnd());
if (slotConfigList != null)
{
var slotConfig = slotConfigList.FirstOrDefault(t => t.Slot == slot);
if (slotConfig == null)
{
throw new ApplicationException($"Slot:{slot} - File " +
$"{ProgramConfig.SerialConfigFileName} does not contain valid configuration");
}
SetupMagFluxMeter(slot, null, slotConfig.Streaming, ignoreCorruptedData);
}
_logger.Debug($"Slot:{slot} - Configuration loaded");
}
/// <summary>
/// just internal setup. called on ctor or from vb6 setup function
/// </summary>
/// <param name="slot">Slot Number for test-bench </param>
/// <param name="requestPort"><see cref="PortConfig" /> for RFID/UART/IrDA Port</param>
/// <param name="streamingPort"><see cref="PortConfig" /> for LED Port</param>
/// <param name="ignoreCorruptedData">don´t send CRC error or telegrams with error flag to caller</param>
/// <param name="password">
/// If you have a password for highest access level you need, if you don't want to access the meter
/// (just read led record) than you can leave it nullS
/// </param>
private void SetupMagFluxMeter(Int32 slot, PortConfig? requestPort, PortConfig? streamingPort,
Boolean ignoreCorruptedData = true, String password = "")
{
Slot = slot;
//_password = password;
if (streamingPort != null)
{
var ledTransmit = new LedTransmitProtocol(streamingPort.Value.PortName);
var streamingIdent = $"Slot:{Slot}, Port:{streamingPort.Value.PortName}, Protocol:LED";
StreamingPort = new LedSerialPort(streamingIdent, streamingPort.Value.GetSerialPort(),
ledTransmit.GetTransmitPortSettings(9600));
StreamingProtocol = new StreamingProtocol(streamingIdent, ignoreCorruptedData);
}
SetLogger();
_logger.Debug($"Slot:{Slot} - Setup done");
}
public void StartCalibration()
{
StartMeasurement();
}
private void Measurement_ActionStateHasChanged(Object sender, EventArgs e)
{
SyncStreamingBuffer(SyncMarkRecord.DecodeIntermediate);
}
public void StartMeasurement()
{
_listOfIMeasurement = new List<IMeasurement>
{
new BaseMeasurement(Slot, typeof(ERegisterRecord), IntermediateUpdateTimeS)
};
foreach (var measurement in _listOfIMeasurement)
{
measurement.OnActionStateHasChanged += Measurement_ActionStateHasChanged;
}
_logger.Info($"Slot:{Slot} - Start measurement");
ProcessStatus = ProcessState.MeasurementIsActive;
_listOfIMeasurement.ForEach(m => m.MeasurementState = MeasurementStates.IsWaitingForStartData);
SyncStreamingBuffer(SyncMarkRecord.SyncStart);
}
public void StopCalibration()
{
StopMeasurement();
}
public void StopMeasurement()
{
_logger.Info($"Slot:{Slot} - Stop measurement");
ProcessStatus = ProcessState.MeasurementIsDone;
_listOfIMeasurement.ForEach(m => m.MeasurementState = MeasurementStates.IsWaitingForEndData);
SyncStreamingBuffer(SyncMarkRecord.SyncEnd);
}
private void AddData(IMeasurementRecord newRecord)
{
foreach (var measurement in _listOfIMeasurement)
{
if (measurement.GetType() != newRecord.GetType())
{
continue;
}
if (measurement.GetChannel() == newRecord.GetChannel())
{
measurement.AddData(newRecord);
}
}
// when every measurement has state IsRunning or every measurement has state IsCompleted, the streaming buffer set to skip decoding
if (_listOfIMeasurement.All(m => m.MeasurementState == MeasurementStates.IsRunning)
|| _listOfIMeasurement.All(m => m.MeasurementState == MeasurementStates.IsCompleted))
{
SyncStreamingBuffer(SyncMarkRecord.DecodeIntermediateQuality);
}
}
/// <summary>
/// Synchronization of the record for the streaming interface
/// </summary>
/// <param name="markRecord"></param>
/// <exception cref="ApplicationException"></exception>
private void SyncStreamingBuffer(SyncMarkRecord markRecord)
{
if (StreamingPort == null)
{
throw new ApplicationException("Synchronization not possible due to undefined streaming port");
}
StreamingPort.SynchronizeReceiveBuffer(markRecord);
}
public void TestBenchDispose()
{
//nothing todo
}
public void WriteLog(String text)
{
_logger.Info($"Slot:{Slot} - {text}");
}
#region logging
private void SetLogger()
{
if (_logger != null)
{
LogManager.Flush();
}
// the id is a combination of UniqueId stored in PcbId and SensorSN (SensorId)
var id = !string.IsNullOrEmpty(SerialNumber) ? $"_SN{SerialNumber}" : "?";
var fileName = $"eRegister_Slot_{Slot}";
if (string.IsNullOrEmpty(CurrentActionText))
{
_logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}", $"", "Meter", "MeterBase", "MeterBase");
}
else
{
_logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}_{id}_{CurrentActionText}", "Slot", "Meter", "MeterBase", "MeterBase");
//TODO check with roland
if (StreamingPort is LedSerialPort)
{
var streamingIdent = $"LedRawData_Slot_{Slot}_{id}_{CurrentActionText}";
((LedSerialPort)StreamingPort).Ident = streamingIdent;
((LedSerialPort)StreamingPort).RefreshLogger();
if (!string.IsNullOrEmpty(SerialNumber) && CurrentActionText.Contains("PG"))
{
//var pathMain = NLogHelper.GetPath(_logger);
//var pathRaw = NLogHelper.GetPath(((LedSerialPort)StreamingPort).GetRawLogger());
//var basePath = Path.GetDirectoryName(pathMain);
//var testRunString = CurrentActionText.Replace("PG", "");
//var lastChat = pathMain.LastIndexOf('\\');
//pathMain = pathMain.Substring(lastChat + 1);
//pathRaw = Path.GetFileName(pathRaw);
//var tmpUrl = $"http://10.49.40.25/MeterProcessState/api/TestBench/SetMeterLogPathInfo?SerialNumber={SerialNumber}&TestRunId={testRunString}&BasePath={basePath}&MainLogName={pathMain}&LEDName={pathRaw}";
//_logger.Debug($"Request Url: { tmpUrl}");
////ToDO: Update to service URl
//LocalWebRequest.GetRequest(tmpUrl);
}
}
}
}
#endregion
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net40" requireReinstallation="true" />
<package id="NLog" version="5.2.2" targetFramework="net40" requireReinstallation="true" />
</packages>

View File

@ -36,7 +36,7 @@
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>LaaProduction_SigningKey.snk</AssemblyOriginatorKeyFile>

View File

@ -49,11 +49,11 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
if (radioParams.RadioAddress != 0)
{
ret.Add(new ProgrammingParameters("SENSUSRADIO_RadioAddress", BitConverter.GetBytes(radioParams.RadioAddress).Reverse().ToArray(), ProgrammingSource.Order, (UInt32)radioParams.RadioAddress, typeof(UInt32).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_RadioAddress", BitConverter.GetBytes(radioParams.RadioAddress).Reverse().ToArray(), ProgrammingSource.Vako, (UInt32)radioParams.RadioAddress, typeof(UInt32).ToString(), ReadCompare.Equal));
if (radioParams.FrqOffset.HasValue)
{
ret.Add(new ProgrammingParameters("SENSUSRADIO_FrequencyOffset", BitConverter.GetBytes(radioParams.FrqOffset.Value).Reverse().ToArray(), ProgrammingSource.Order, (Int16)radioParams.FrqOffset.Value, typeof(Int16).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_FrequencyOffset", BitConverter.GetBytes(radioParams.FrqOffset.Value).Reverse().ToArray(), ProgrammingSource.Vako, (Int16)radioParams.FrqOffset.Value, typeof(Int16).ToString(), ReadCompare.Equal));
}
@ -63,10 +63,10 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
if (radioParams.PowerLevel > 0 && radioParams.PowerLevelOption > 0 && radioParams.ImpedanceCodeNew > 0 && radioParams.ImpedanceCodeOption > 0)
{
ret.Add(new ProgrammingParameters("SENSUSRADIO_PowerLevel", BitConverter.GetBytes(radioParams.PowerLevel).Reverse().ToArray(),ProgrammingSource.Order, (ushort)radioParams.PowerLevel, typeof(ushort).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_PowerLevelOption", BitConverter.GetBytes(radioParams.PowerLevelOption).Reverse().ToArray(), ProgrammingSource.Order, (ushort)radioParams.PowerLevelOption, typeof(ushort).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_ImpedanceCodeNew", BitConverter.GetBytes(radioParams.ImpedanceCodeNew).Reverse().ToArray(), ProgrammingSource.Order, (UInt16)radioParams.ImpedanceCodeNew, typeof(UInt16).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_ImpedanceCodeOption", BitConverter.GetBytes(radioParams.ImpedanceCodeOption).Reverse().ToArray(), ProgrammingSource.Order, (UInt16)radioParams.ImpedanceCodeOption, typeof(UInt16).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_PowerLevel", BitConverter.GetBytes(radioParams.PowerLevel).Reverse().ToArray(),ProgrammingSource.Vako, (ushort)radioParams.PowerLevel, typeof(ushort).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_PowerLevelOption", BitConverter.GetBytes(radioParams.PowerLevelOption).Reverse().ToArray(), ProgrammingSource.Vako, (ushort)radioParams.PowerLevelOption, typeof(ushort).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_ImpedanceCodeNew", BitConverter.GetBytes(radioParams.ImpedanceCodeNew).Reverse().ToArray(), ProgrammingSource.Vako, (UInt16)radioParams.ImpedanceCodeNew, typeof(UInt16).ToString(), ReadCompare.Equal));
ret.Add(new ProgrammingParameters("SENSUSRADIO_ImpedanceCodeOption", BitConverter.GetBytes(radioParams.ImpedanceCodeOption).Reverse().ToArray(), ProgrammingSource.Vako, (UInt16)radioParams.ImpedanceCodeOption, typeof(UInt16).ToString(), ReadCompare.Equal));
}
}
var rawVako = VakoDbAdapter.GetRawVako(connectionString, orderNr);

View File

@ -1,4 +1,5 @@
using System;
using System.Linq;
namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
{
@ -45,6 +46,31 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData
customerSr = scan.Substring(2, 9);
return true;
}
if (scan.Count( a => a == ',') == 2)
{
customerSr = scan.Split(',')[1] + ',';// 0, scan.IndexOf(",", StringComparison.Ordinal));
}
if (customerSr.StartsWith(prefix))
{
customerSr = customerSr.Substring(prefix.Length, length);
if (!customerSr.EndsWith(","))
{
throw new ApplicationException("Could not parse serial number");
}
customerSr = customerSr.TrimEnd(',');
}
if (int.TryParse(customerSr, out var retCustom))
{
internalSerialNr = retCustom;
return true;
}
throw new ApplicationException("Could not parse serial number");
}

View File

@ -72,6 +72,9 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
@ -83,7 +86,6 @@
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>

View File

@ -113,7 +113,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
// this calculates all life time values
if (!GenesisStatusHandler.BuildLifeTimeInformation(Meter, genesisStatus))
{
UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() =>
{
@ -132,13 +132,37 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
return;
}
if (!genesisStatus.UNTStatus)
{
//currentProcessState = ProductionProcessState.Error;
UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() =>
{
UserControl.MessageBox($"UNT Limit überschritten Limit{genesisStatus.UNTLimit} vs {genesisStatus.DrainedBatteryLoad_uAs}");
UserControl.lblText.Content = $"UNT Limit überschritten Limit{genesisStatus.UNTLimit} vs {genesisStatus.DrainedBatteryLoad_uAs}";
}
));
Meter.WriteLog($"UNT Limit überschritten Limit{genesisStatus.UNTLimit} vs {genesisStatus.DrainedBatteryLoad_uAs}");
}
if (genesisStatus.RemainingLifeTimeYears < 20)
{
if (genesisStatus.DrainedBatteryLoadPercent > 8)
{
currentProcessState = ProductionProcessState.Error;
UserControl.lblText.Content = "Batterie über 10% entladen";
UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() =>
{
UserControl.MessageBox($"EMEA Limit überschritten Limit 8% vs {genesisStatus.DrainedBatteryLoadPercent}");
UserControl.lblText.Content = "Batterie über 10% entladen";
}
));
Meter.WriteLog("Batterie über 10% entladen");
}
@ -158,7 +182,15 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (Meter.LutCrc != $@"0x{int.Parse(res[8]):X4}")
{
currentProcessState = ProductionProcessState.Error;
UserControl.lblText.Content = "Lut not correct";
UserControl.lblText.Dispatcher.Invoke(DispatcherPriority.Send,
new Action(() =>
{
UserControl.lblText.Content = "Lut not correct";
}
));
}

View File

@ -66,6 +66,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
try
{
var a = LocalWebRequest.GetRequest($"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetSingleVakoKey?ProductionOrderNumber={OrderNumber}&KeyName=C_GEN_PULS");
var myJsonResponse = JsonConvert.DeserializeObject<VakoKeyValue>(a);
if (myJsonResponse.Value.ToLower() == "q" || myJsonResponse.Value.ToLower() == "k")

View File

@ -1,10 +1,10 @@
using System;
using Newtonsoft.Json;
using ProductionUiCordonel.ProductionProcesses.Enum;
using ProductionUiCordonel.UserControls.FinalTest;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Controls;
using Newtonsoft.Json;
using ProductionUiCordonel.ProductionProcesses.Enum;
using ProductionUiCordonel.UserControls.FinalTest;
using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
@ -60,7 +60,24 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
if (!Meter.IsLoggedOn)
{
NewStatus("Login wird gestartet");
Meter.Login();
if (!Meter.Login())
{
var url = ServiceUrls.GenesisGetPasswordContainerServiceUrl();
var requestResponse = LocalWebRequest.GetRequestWithError(url + Meter.PcbId, out var errorCode, 30000, isRetry: true);
if (errorCode == System.Net.HttpStatusCode.OK.GetHashCode())
{
var passwordContainer = JsonConvert.DeserializeObject<Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.MeterPwdDb>(requestResponse);
if (Meter.Login(System.Text.Encoding.UTF8.GetString(passwordContainer.ListOfPasswords[7])))
{
Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd.MeterPwdHandlerDb.SetPwdFromSkeletonToLvl8inDd(Meter.PcbId, passwordContainer);
}
}
}
}
Meter.WriteRegister(Register.Genesisflow.SampleRate, 2);
Meter.WriteRegister(Register.Genesisflow.LedMode, 0);
@ -83,11 +100,11 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
var url = $"{ServiceUrls.GenesisFinalCheckServiceUrl()}GetProgrammingParameters?PcbID={base.Meter.PcbId}";
var csdRet = LocalWebRequest.GetRequest(url, 80000);
return JsonConvert.DeserializeObject<IList<ProgrammingParameters>>(csdRet);
}
catch (Exception )
catch (Exception)
{
return new List<ProgrammingParameters>
{

View File

@ -129,7 +129,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
{
throw new ApplicationException("Radio inconsistent between meter and programmingparameters");
}
foreach (var item in myJsonResponse.Where(m => m.Source == ProgrammingSource.Vako))
foreach (var item in myJsonResponse.Where(m => m.Source == ProgrammingSource.Vako || m.Source == ProgrammingSource.Order ))
{
if (item.RegisterName == "CUSTOMER_LeakFlowThreshold")

View File

@ -7,6 +7,7 @@ using System.Threading;
using System.Windows.Controls;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
namespace ProductionUiCordonel.ProductionProcesses.Actions
{
@ -50,7 +51,10 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
hasRadio = Meter.RadioFrequencyMhz.HasValue;
if (doRestart)
{
}
if (hasRadio)
{
@ -74,7 +78,7 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
};
var rebootSucceeded = _meterResetPsu.MeterResetPsuExecute();
Thread.Sleep(10000);
Thread.Sleep(16000);
if (!Meter.Login())
{
@ -86,7 +90,15 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
currentProcessState = ProductionProcessState.Error;
}
}
Meter.WriteRegister("SYSTEM_ExitReason", 21, true, false);
var exitResult = RegisterConverter.ConvertTo<Int16>(Meter.ReadRegister("SYSTEM_ExitReason"));
if (exitResult != 0)
{
Meter.WriteLog("PasswordFile incorrect");
currentProcessState = ProductionProcessState.Error;
return;
}
Boolean? hasDiffrences = null;
foreach (var item in CheckValuesAfterBoot)
@ -206,10 +218,17 @@ namespace ProductionUiCordonel.ProductionProcesses.Actions
};
var rebootSucceeded = _meterResetPsu.MeterResetPsuExecute();
Thread.Sleep(10000);
Thread.Sleep(16000);
Meter.Login();
Meter.WriteRegister("SYSTEM_ExitReason", 21, true, false);
var exitResult = RegisterConverter.ConvertTo<Int16>(Meter.ReadRegister("SYSTEM_ExitReason"));
if (exitResult != 0)
{
Meter.WriteLog("PasswordFile incorrect");
currentProcessState = ProductionProcessState.Error;
return;
}
Boolean? hasDiffrences = null;
foreach (var item in CheckValuesAufterBoot)
{

View File

@ -1,4 +1,5 @@
using System.Windows.Controls;
using System;
using System.Windows.Controls;
namespace ProductionUiCordonel.UserControls.FinalTest
{
@ -11,5 +12,10 @@ namespace ProductionUiCordonel.UserControls.FinalTest
{
InitializeComponent();
}
internal void MessageBox(String v)
{
System.Windows.Forms.MessageBox.Show(v);
}
}
}

View File

@ -230,7 +230,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
query.AppendLine(" from [Auftrag].[dbo].[AuftragPositionSerienNr] apsn ");
query.AppendLine(" inner join [Auftrag].[dbo].[AuftragPosition_Gesamt] apg on apg.AuftragNr = apsn.AuftragNr and apg.PositionNr = apsn.PositionNr and apg.Ort = 'L2' ");
query.AppendLine(" inner join [Auftrag].[dbo].[Pruefgang] pg on apsn.[Pruefgangnr] = pg.PruefgangNr and pg.PruefstationNr = 2016 ");
query.AppendLine(" inner join [Auftrag].[dbo].[Pruefgang] pg on apsn.[Pruefgangnr] = pg.PruefgangNr and pg.PruefstationNr in (2016,2015) ");
query.AppendLine(" inner join [Auftrag].[dbo].Prueffehler pf on pg.[Pruefgangnr] = pf.PruefgangNr and pf.SerienNr = apsn.SerienNr ");
@ -242,6 +242,10 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
query.AppendLine(" left outer join Identnr idt on idt.IdentNr = apg.Identnr ");
//query.AppendLine(" left outer join [MapPcbIdToSerialNumber] map on map.MapPcbIdToSerialNumber_SerialNumber = apsn.SerienNr ");
query.AppendLine($" where pg.Datum >= '{Start}' and pg.Datum <= '{End}' ");
@ -254,7 +258,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
query.AppendLine(" inner join [Auftrag].[dbo].[AuftragPositionSerienNr] apsn on apsn.SerienNr = [MapPcbIdToSerialNumber_SerialNumber] and apsn.SerienNr not in (20702497,20702499,20717438) ");
query.AppendLine(" ");
query.AppendLine(" inner join[Auftrag].[dbo].[AuftragPosition_Gesamt] apg on apg.AuftragNr = apsn.AuftragNr and apg.PositionNr = apsn.PositionNr and apg.Ort = 'L2' ");
query.AppendLine(" inner join[Auftrag].[dbo].[Pruefgang] pg on apsn.[Pruefgangnr] = pg.PruefgangNr and pg.PruefstationNr = 2016 ");
query.AppendLine(" inner join[Auftrag].[dbo].[Pruefgang] pg on apsn.[Pruefgangnr] = pg.PruefgangNr and pg.PruefstationNr in (2016,2015) ");
query.AppendLine(" inner join[Auftrag].[dbo].Prueffehler pf on pg.[Pruefgangnr] = pf.PruefgangNr and pf.SerienNr = [MapPcbIdToSerialNumber_SerialNumber] ");
query.AppendLine(" ");
query.AppendLine($" where pg.Datum >= '{Start}' and pg.Datum <= '{End}' ");

View File

@ -652,7 +652,10 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
SkipRadioCheck = (Boolean)dt.Rows[0]["SkipRadioParameters"];
}
if (FrequencyIndicator == 0)
{
SkipRadioCheck = true;
}
sb = new StringBuilder();
@ -941,6 +944,54 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
// return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return listOfDnParams; }));
//}
[Route("SetMeterEOLState"), HttpPost]
public async Task<HttpResponseMessage> SetMeterEOLState(int PcbID,int OrderNumber)
{
try
{
var sb = new StringBuilder();
sb.AppendLine($" UPDATE [dbo].[CordonelEol] ");
sb.AppendLine($" SET ");
sb.AppendLine($" [CordonelEolPcbId] = {PcbID} ");
sb.AppendLine($" ,[CordonelEolOrderNumber] = {OrderNumber} ");
sb.AppendLine($" ,[CordonelEolDate] = CURRENT_TIMESTAMP ");
sb.AppendLine($" ,[CordonelEolPublishAction] = null ");
sb.AppendLine($" ,[CordonelEolSAPFeedback] = null ");
sb.AppendLine($" WHERE [CordonelEolPcbId] = {PcbID} ");
sb.AppendLine($" and [CordonelEolOrderNumber] = {OrderNumber} ");
sb.AppendLine($"IF @@ROWCOUNT = 0 ");
sb.AppendLine($" BEGIN ");
sb.AppendLine($" INSERT INTO [dbo].[CordonelEol] ");
sb.AppendLine($" ([CordonelEolPcbId] ");
sb.AppendLine($" ,[CordonelEolOrderNumber] ");
sb.AppendLine($" ,[CordonelEolDate] ");
sb.AppendLine($" ,[CordonelEolPublishAction] ");
sb.AppendLine($" ,[CordonelEolSAPFeedback]) ");
sb.AppendLine($" VALUES ");
sb.AppendLine($" ( {PcbID} ");
sb.AppendLine($" ,{OrderNumber} ");
sb.AppendLine($" ,CURRENT_TIMESTAMP ");
sb.AppendLine($" ,null ");
sb.AppendLine($" ,null) ");
sb.AppendLine($" END ");
using (var dataacces = new SqlDataAccess(GlobalConfig.ConnectionString.Value))
{
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return dataacces.ExecuteQuery(sb.ToString()) != null; }));
}
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex);
}
}
[Route("SetMetersizeProgrammingData"), HttpPost]
public async Task<HttpResponseMessage> SetMetersizeProgrammingData(MeterSize ParameterMeterSize, [FromBody] String listOfDnParamsRaw)
{

View File

@ -707,6 +707,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
addOBJ.FileId = (Int32)row["FWUpdateReport_ID"];
addOBJ.Date = (DateTime)row["FWUpdateReport_Date"];
ret.Add(addOBJ);
//help to download all file to local store
//File.WriteAllText($"E:\\bat\\report\\{addOBJ.PcbId}_{addOBJ.FileId}.txt", addOBJ.Content);
}
}
return Request.CreateResponse(HttpStatusCode.OK, ret);

View File

@ -174,7 +174,12 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
sb.AppendLine($" select distinct kunden.KundenNr as CustomerNumber, kunden.Name as CustomerName, kunden.Ort as CustomerLocation ");
sb.AppendLine($" from Identnr ident ");
sb.AppendLine($" inner join Statistik_auftrag auftrag on auftrag.IdentNr = ident.IdentNr ");
// sb.AppendLine($" inner join Statistik_auftrag auftrag on auftrag.IdentNr = ident.IdentNr ");
sb.AppendLine($" inner join AuftragPosition_Gesamt auftragPOS on auftragPOS.IdentNr = ident.IdentNr ");
sb.AppendLine($" inner join Auftrag_Gesamt auftrag on auftrag.AuftragNr = auftragPOS.AuftragNr ");
sb.AppendLine($" inner join Kunde kunden on auftrag.KundenNr = kunden.KundenNr ");
sb.AppendLine($" where ident.Typ = 'GNS' ");
@ -207,9 +212,13 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
StringBuilder sb = new StringBuilder();
sb.AppendLine($" select AuftragNr as CustomerOrderNumber, PositionNr as CustomerOrderPos ,Menge as Quantity, Katalognummer as CatalogNumber, Nennweite as Diameter,Baulaenge as Length from ");
sb.AppendLine($" select auftrag.AuftragNr as CustomerOrderNumber, PositionNr as CustomerOrderPos ,Menge as Quantity, Katalognummer as CatalogNumber, Nennweite as Diameter,Baulaenge as Length from ");
sb.AppendLine($" Identnr ident ");
sb.AppendLine($" inner join Statistik_auftrag auftrag on auftrag.IdentNr = ident.IdentNr ");
//sb.AppendLine($" inner join Statistik_auftrag auftrag on auftrag.IdentNr = ident.IdentNr ");
sb.AppendLine($" inner join AuftragPosition_Gesamt auftragPOS on auftragPOS.IdentNr = ident.IdentNr ");
sb.AppendLine($" inner join Auftrag_Gesamt auftrag on auftrag.AuftragNr = auftragPOS.AuftragNr ");
sb.AppendLine($" where ident.Typ = 'GNS' and auftrag.KundenNr = {CustomerNumber} ");

View File

@ -373,12 +373,150 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
}
[Route("GetPasswordHashFileContentDebug")]
public async Task<HttpResponseMessage> GetPasswordHashFileContentDebug(String PcbId)
{
try
{
var sbKeys = new StringBuilder();
var listOfHashes = new List<Byte[]>();
var sbOutPut = new StringBuilder();
var sbQuery = new StringBuilder();
sbQuery.AppendLine($" SELECT ");
sbQuery.AppendLine($" [Seriennummer] ");
sbQuery.AppendLine($" ,mps.MapPcbIdToSerialNumber_PcbId ");
sbQuery.AppendLine($" ,[Adresse] ");
sbQuery.AppendLine($" ,AuftragPosSNr.AuftragNr ");
sbQuery.AppendLine($" ,Auftrag.FertigungsauftragNr ");
sbQuery.AppendLine($" ,[GeschlossenDatum] ");
sbQuery.AppendLine($" ,[Vergabe_am] ");
sbQuery.AppendLine($" ,passwordtbl.KeySetId ");
sbQuery.AppendLine($" ,passwordtbl.orderNumber ");
sbQuery.AppendLine($" ,passwordtbl.Password ");
sbQuery.AppendLine($" ,passwordtbl.KitronSkeletonKey as Skeleton ");
sbQuery.AppendLine($" ,passwordtbl.ProcessorID as ProcessorUid ");
sbQuery.AppendLine($" FROM [Auftrag].[dbo].[Genesis_Meter] meter ");
sbQuery.AppendLine($" inner join MapPcbIdToSerialNumber mps" +
$" on mps.MapPcbIdToSerialNumber_SerialNumber = meter.Seriennummer and mps.MapPcbIdToSerialNumber_Deleted = 0 ");
sbQuery.AppendLine($" inner join[Auftrag].[dbo].[AuftragPositionSerienNr] AuftragPosSNr " +
$" on AuftragPosSNr.SerienNr = meter.Seriennummer and [Pruefgangnr] = 0 ");
sbQuery.AppendLine($" inner join[Auftrag].[dbo].[AlleAuftragPositionen] Auftrag" +
$" on Auftrag.AuftragNr = AuftragPosSNr.AuftragNr and AuftragPosSNr.PositionNr = Auftrag.PositionNr ");
sbQuery.AppendLine($" left outer join[dbo].[Genesis_PcbPassword] passwordtbl" +
$" on passwordtbl.PcbId = mps.MapPcbIdToSerialNumber_PcbId ");
sbQuery.AppendLine($" where mps.MapPcbIdToSerialNumber_PcbId = '{PcbId}' ");
var result = new MeterPwdDb();
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var dt = dataAccess.ExecuteQuery(sbQuery.ToString());
foreach (var item in dt.Select())
{
result.OrderNumber = (Int32)item["FertigungsauftragNr"];
result.RadioAddress = (Int64)item["Adresse"];
result.Skeleton = (String)item["Skeleton"];
result.Password = (String)item["Password"];
result.PasswordFileIdent = (result.RadioAddress.HasValue && result.RadioAddress.Value != 0) ? result.RadioAddress.Value.ToString() : PcbId;
if (item["KeySetId"].GetType() != typeof(System.DBNull))
{
result.KeySetId = (String)item["KeySetId"];
}
sbKeys.AppendLine($"PcbId:{PcbId}");
sbKeys.AppendLine($"ProcessorUid:{(String)item["ProcessorUid"]}");
sbKeys.AppendLine($"Skeleton:{(String)item["Skeleton"]}");
sbKeys.AppendLine($"Password:{(String)item["Password"]}");
}
}
if (!result.OrderNumber.HasValue)
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, new PcbIdNotException(new Guid("160B4C44-6EF7-41DC-A48D-4B4105B4779B")));
}
Request.Headers.Add("X-Node-Token", "d5b8c0b2-81f6-4421-80d0-44eb2093e616");
if (!Request.Headers.Contains("X-Node-Token"))
{
return Request.CreateResponse(HttpStatusCode.InternalServerError, new TokenRequiredException(new Guid("77895D13-CA58-48AB-8C5E-9CDB7F80C69D")));
}
if (string.IsNullOrEmpty(result.KeySetId))
{
result.KeySetId = CreateKeySet(Request.Headers.GetValues("X-Node-Token").First(), 7);
//mapp keyset
MapKeySet(Request.Headers.GetValues("X-Node-Token").First(), result.KeySetId, result.OrderNumber.Value, result.PasswordFileIdent);
using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value))
{
var dt = dataAccess.ExecuteQuery(
$"update auftrag.[dbo].[Genesis_PcbPassword] set KeySetId = '{result.KeySetId}', [orderNumber] = {result.OrderNumber.Value}, [radioAdress] = {result.PasswordFileIdent} where PcbId = '{PcbId}'; select * from auftrag.[dbo].[Genesis_PcbPassword] where PcbId = '{PcbId}'");
}
}
var passwords = getKeys(Request.Headers.GetValues("X-Node-Token").First(), result.OrderNumber.Value.ToString(), result.PasswordFileIdent);
//pw lvl
passwords.Keys.Insert(2, new Key() { Index = 2, KeyKey = result.Skeleton });
var pwdLVL8 = "";
if (passwords.Keys.Count > 7)
{
pwdLVL8 = passwords.Keys[7].KeyKey.Substring(0, 12);
}
foreach (var keyLVL in passwords.Keys)
{
using (System.Security.Cryptography.SHA1Managed sha1 = new System.Security.Cryptography.SHA1Managed())
{
var rawKey = keyLVL.KeyKey;
if (rawKey.Length > 12)
{
rawKey = rawKey.Substring(0, 12);
}
if (result.ListOfPasswords.Count <= 7)
{
result.ListOfPasswords.Add(Encoding.UTF8.GetBytes(rawKey));
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(rawKey));
result.ListOfHashes.Add(hash);
}
}
}
sbKeys.AppendLine("passwords:");
foreach (var item in result.ListOfPasswords)
{
sbKeys.AppendLine(BitConverter.ToString(item));
}
sbKeys.AppendLine("hashes:");
foreach (var item in result.ListOfHashes)
{
sbKeys.AppendLine(BitConverter.ToString(item));
}
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
{
return result;
}));
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex.ToString() + "<br >" + ex.InnerException.ToString());
}
}
[Route("GetPasswordHashFileContent")]
public async Task<HttpResponseMessage> GetPasswordHashFileContent(String PcbId)
{
try
{
var sbKeys = new StringBuilder();
var listOfHashes = new List<Byte[]>();
var sbOutPut = new StringBuilder();
@ -429,9 +567,14 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
result.KeySetId = (String)item["KeySetId"];
}
}
}
if (result.OrderNumber == 3219628)
{
result.PasswordFileIdent = "1" + result.PasswordFileIdent;
}
if (!result.OrderNumber.HasValue)
{
@ -465,7 +608,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
{
pwdLVL8 = passwords.Keys[7].KeyKey.Substring(0, 12);
}
foreach (var keyLVL in passwords.Keys)
{
using (System.Security.Cryptography.SHA1Managed sha1 = new System.Security.Cryptography.SHA1Managed())
@ -478,16 +621,25 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
if (result.ListOfPasswords.Count <= 7)
{
result.ListOfPasswords.Add(Encoding.UTF8.GetBytes(rawKey));
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(rawKey));
result.ListOfHashes.Add(hash);
}
}
}
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
sbKeys.AppendLine($"PcbiD: {PcbId}");
sbKeys.AppendLine("passwords:");
foreach (var item in result.ListOfPasswords)
{
sbKeys.AppendLine(BitConverter.ToString(item));
}
sbKeys.AppendLine("hashes:");
foreach (var item in result.ListOfHashes)
{
sbKeys.AppendLine(BitConverter.ToString(item));
}
return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() =>
{
return result;
}));

View File

@ -58,8 +58,7 @@ namespace Service.MeterProcessState.Controllers
PcbId = PcbId,
RefTempC = RefTempC,
AvgTof = AvgTof,
Active = true,
Timestamp = dt == default(DateTime) ? null : (DateTime?)dt
Active = true
});
return await ctx.SaveChangesAsync() > 0;

View File

@ -65,6 +65,46 @@
[Route("GetMeterInfoForTestBench"), HttpGet]
public IHttpActionResult GetMeterInfoForTestBench(String PcbID)
{
var str = $@"
SELECT DISTINCT
[MapPcbIdToSerialNumber_SerialNumber] AS [SerialNr]
, [MapOrder].[CordonelAssignedPicking_FertigungsAuftragsNr] AS [FertigungsNr]
, [Meter].[Adresse] AS [RadioAddress]
, [KundeneigeneSerienNr] AS [CustomerSerialNr]
, (SELECT TOP 1 [ID]
FROM [CordonelMeterCalibrationResults]
WHERE [PcbId] = @{nameof(PcbID)}
ORDER BY [Date] DESC) AS [CalibrationRunID]
, (SELECT TOP 1 [StatusFertigung]
FROM [AuftragPositionSerienNr]
WHERE [SerienNr] = [MapPcbIdToSerialNumber_SerialNumber]
ORDER BY [AnlageDatum] DESC) AS [LastProcessState]
, [Nennweite] AS [Dn]
, (SELECT TOP 1 [Dn_InternalId]
FROM [CordonelMeterSizes]
WHERE [Dn_VakoID] = SUBSTRING([Identnr].[VakoCode], 4, 2)) AS [NewNennweiteID]
, [lut].[FileCrc] AS [LutCrc]
FROM [Cordonel_AssignedPicking] AS [MapOrder]
LEFT OUTER JOIN [MapPcbIdToSerialNumber] AS [map]
ON [MapOrder].[CordonelAssignedPicking_PcbId] = [map].[MapPcbIdToSerialNumber_PcbId]
AND [map].[MapPcbIdToSerialNumber_Deleted] = 0
LEFT OUTER JOIN [AuftragPositionSerienNr] AS [mapSrn]
ON [map].[MapPcbIdToSerialNumber_SerialNumber] = [mapSrn].[SerienNr]
AND [mapSrn].[Pruefgangnr] = 0
LEFT OUTER JOIN [AuftragPosition_gesamt] AS [auftraginfo]
ON [auftraginfo].[AuftragNr] = [mapSrn].[AuftragNr]
AND [auftraginfo].[PositionNr] = [mapSrn].[PositionNr]
LEFT OUTER JOIN [Genesis_Meter] AS [Meter]
ON [Meter].[Seriennummer] = [map].[MapPcbIdToSerialNumber_SerialNumber]
LEFT OUTER JOIN [Identnr]
ON [auftraginfo].[Identnr] = [Identnr].[IdentNr]
LEFT OUTER JOIN [Cordonel_Lut] AS [lut]
ON [lut].[MeterSize] = (SELECT TOP 1 [Dn_InternalId]
FROM [CordonelMeterSizes]
WHERE [Dn_VakoID] = SUBSTRING([Identnr].[VakoCode], 4, 2))
AND [lut].[CurrentVersionForProd] = 1
WHERE [MapOrder].[CordonelAssignedPicking_IsDeleted] = 0
AND [MapOrder].[CordonelAssignedPicking_PcbId] = @{nameof(PcbID)} ";
var results = SQLConnection
.CreateSQLConnection(ConnectionString.Value)
.CreateCommand($@"
@ -113,12 +153,12 @@
$"{x.GetInt()}", // SerialNr,
$"{x.GetInt()}", // FertigungsNr,
$"{x.GetLong()}", // RadioAddress,
$"{x.GetString()}", // CustomerSerialNr,
$"{x.GetInt()}", // CalibrationRunID,
$"{x.GetValue<int?>()}", // CustomerSerialNr,
$"{x.GetString()}", // CalibrationRunID,
$"{x.GetValue<byte>()}", // LastProcessState,
$"{x.GetInt()}", // Dn,
$"{x.GetInt()}", // NewNennweiteID,
$"{x.GetInt()}", // LutCrc
$"{x.GetValue<int?>()}", // LutCrc
});
if (results.Count() == 1)

View File

@ -16,6 +16,5 @@
public Boolean Active { get; set; }
public DateTime? Timestamp { get; set; }
}
}

View File

@ -9,6 +9,10 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -60,8 +60,8 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0-preview.18571.3\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Xml.Linq" />

View File

@ -7,5 +7,5 @@
<package id="System.Diagnostics.DiagnosticSource" version="4.7.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0-preview.18571.3" targetFramework="net461" />
</packages>

View File

@ -1 +1 @@
247396738e2c5d26ac00f9df05c0cc5c61d7f33a
65d75c3322f8a137c69963cfdc0cb6f1ffacf62a

View File

@ -66,6 +66,7 @@
this.btnAddReleaseConfig = new System.Windows.Forms.Button();
this.txtUpdateSW = new System.Windows.Forms.TextBox();
this.txtReleaseConfig = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvFiles)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.filePartBindingSource)).BeginInit();
@ -429,11 +430,22 @@
this.txtReleaseConfig.Size = new System.Drawing.Size(225, 20);
this.txtReleaseConfig.TabIndex = 37;
//
// button3
//
this.button3.Location = new System.Drawing.Point(857, 28);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 38;
this.button3.Text = "button3";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click_1);
//
// FrmFileCURD
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(971, 815);
this.Controls.Add(this.button3);
this.Controls.Add(this.txtReleaseConfig);
this.Controls.Add(this.txtUpdateSW);
this.Controls.Add(this.btnAddReleaseConfig);
@ -504,5 +516,6 @@
private System.Windows.Forms.Button btnAddReleaseConfig;
private System.Windows.Forms.TextBox txtUpdateSW;
private System.Windows.Forms.TextBox txtReleaseConfig;
private System.Windows.Forms.Button button3;
}
}

View File

@ -11,7 +11,7 @@ using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Logic.ProductionOrderCore.FW;
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
using Xylem.Common.Logic.SoftwareAccessHelper;
using Xylem.ServiceFwUpdate.Common.FwUpdateDb;
namespace Xylem.Common.Ui.GenesisToolBox
{
@ -568,5 +568,40 @@ namespace Xylem.Common.Ui.GenesisToolBox
{
}
private void button3_Click_1(Object sender, EventArgs e)
{
//var fwUpdRpt = new List<FwUpdateReportDb>();
//try
//{
// var url = ServiceUrls.DownloadFwUpdateReportServiceUrl();
// if (pcbId > 0)
// {
// url += $"PcbId={pcbId}";
// if (userId > 0) url += $"&UserId={userId}";
// if (orderNr > 0) url += $"&OrderNr={orderNr}";
// }
// else if (userId > 0)
// {
// url += $"UserId={userId}";
// if (orderNr > 0) url += $"&OrderNr={orderNr}";
// }
// else if (orderNr > 0)
// {
// url += $"OrderNr={orderNr}";
// }
// url += $"&readContent={readContent}";
// var requestResponse = LocalWebRequest.GetRequest(url, 20000);
// if (string.IsNullOrEmpty(requestResponse))
// {
// DbIsConnected = false;
// return false;
// }
// DbIsConnected = true;
// fwUpdRpt = JsonConvert.DeserializeObject<List<FwUpdateReportDb>>(requestResponse);
}
}
}

View File

@ -80,6 +80,7 @@
this.label3 = new System.Windows.Forms.Label();
this.tbxFileToEraseDrive = new System.Windows.Forms.TextBox();
this.btnEraseFile = new System.Windows.Forms.Button();
this.btnUploadPWFile = new System.Windows.Forms.Button();
this.grpSetup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
@ -488,6 +489,7 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.btnUploadPWFile);
this.groupBox2.Controls.Add(this.ddlLocation);
this.groupBox2.Controls.Add(this.btnReadBatAndLog);
this.groupBox2.Controls.Add(this.btnListFileDetails);
@ -495,7 +497,7 @@
this.groupBox2.Controls.Add(this.btnUploadConfig);
this.groupBox2.Location = new System.Drawing.Point(417, 69);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(136, 150);
this.groupBox2.Size = new System.Drawing.Size(136, 183);
this.groupBox2.TabIndex = 37;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Log";
@ -605,6 +607,16 @@
this.btnEraseFile.UseVisualStyleBackColor = true;
this.btnEraseFile.Click += new System.EventHandler(this.btnEraseFile_Click);
//
// btnUploadPWFile
//
this.btnUploadPWFile.Location = new System.Drawing.Point(10, 145);
this.btnUploadPWFile.Name = "btnUploadPWFile";
this.btnUploadPWFile.Size = new System.Drawing.Size(116, 25);
this.btnUploadPWFile.TabIndex = 42;
this.btnUploadPWFile.Text = "Upload Config";
this.btnUploadPWFile.UseVisualStyleBackColor = true;
this.btnUploadPWFile.Click += new System.EventHandler(this.btnUploadPWFile_Click);
//
// FrmLowLevelTools
//
this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound;
@ -701,5 +713,6 @@
private System.Windows.Forms.Button btnPulseModeOff;
private System.Windows.Forms.ComboBox ddlLocation;
private System.Windows.Forms.Button btnReadBatAndLog;
private System.Windows.Forms.Button btnUploadPWFile;
}
}

View File

@ -1267,6 +1267,65 @@ namespace Xylem.Common.Ui.GenesisToolBox
});
}
/// <summary>
/// Read config file from meter and store it to disk.
/// </summary>
/// <remarks date="2023-Jan-02" author="Thomas Wiedebusch">
/// - Initial
/// </remarks>
private void btnUploadPWFile_Click(Object sender, EventArgs e)
{
if (_currentGenesis == null)
{
return;
}
if (_meterFile == null)
{
_meterFile = new MeterFile(_currentGenesis);
}
//reset timer
_startTime = DateTimeOffset.UtcNow;
LowLevelActionControl(true);
var msg = @"Upload configuration file from meter";
LogText(msg);
lblOverall.Text = msg;
lblActualProcess.Text = @"Read config file";
var rawData = new List<Byte>();
Task.Factory.StartNew(() =>
{
_currentGenesis.ReLogin();
_meterFile.ReadMeterFile("0\\password", out var data);
rawData.AddRange(data);
}).ContinueWith(delegate
{
Invoke(new Action(() =>
{
if (saveConfigFile.ShowDialog() == DialogResult.OK)
{
var fs = new FileStream(saveConfigFile.FileName, FileMode.OpenOrCreate);
var bw = new BinaryWriter(fs);
foreach (var t in rawData)
{
bw.Write(t);
}
fs.Close();
}
}));
//add a blank line to separate next operation
LogText("");
_currentGenesis.Logout();
LowLevelActionControl(false);
});
}
/// <summary>
/// Set date and time from PC to Cordonel
/// </summary>

View File

@ -0,0 +1,137 @@
namespace Xylem.Common.Ui.GenesisToolBox
{
partial class FrmQsTool
{
/// <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 Windows Form 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.lblState = new System.Windows.Forms.Label();
this.btnConnect = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.cbComSlot = new System.Windows.Forms.ComboBox();
this.btnWrite = new System.Windows.Forms.Button();
this.btnRead = new System.Windows.Forms.Button();
this.btnLogout = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblState
//
this.lblState.AutoSize = true;
this.lblState.Location = new System.Drawing.Point(12, 51);
this.lblState.Name = "lblState";
this.lblState.Size = new System.Drawing.Size(78, 13);
this.lblState.TabIndex = 9;
this.lblState.Text = "Not connected";
//
// btnConnect
//
this.btnConnect.Location = new System.Drawing.Point(212, 8);
this.btnConnect.Name = "btnConnect";
this.btnConnect.Size = new System.Drawing.Size(85, 30);
this.btnConnect.TabIndex = 8;
this.btnConnect.Text = "Connect";
this.btnConnect.UseVisualStyleBackColor = true;
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(25, 13);
this.label1.TabIndex = 7;
this.label1.Text = "Slot";
//
// cbComSlot
//
this.cbComSlot.FormattingEnabled = true;
this.cbComSlot.Location = new System.Drawing.Point(83, 12);
this.cbComSlot.Name = "cbComSlot";
this.cbComSlot.Size = new System.Drawing.Size(104, 21);
this.cbComSlot.TabIndex = 6;
this.cbComSlot.Text = "1";
//
// btnWrite
//
this.btnWrite.Location = new System.Drawing.Point(24, 164);
this.btnWrite.Name = "btnWrite";
this.btnWrite.Size = new System.Drawing.Size(129, 53);
this.btnWrite.TabIndex = 1;
this.btnWrite.Text = "Led Off";
this.btnWrite.UseVisualStyleBackColor = true;
this.btnWrite.Click += new System.EventHandler(this.btnWrite_Click);
//
// btnRead
//
this.btnRead.Location = new System.Drawing.Point(24, 105);
this.btnRead.Name = "btnRead";
this.btnRead.Size = new System.Drawing.Size(129, 53);
this.btnRead.TabIndex = 0;
this.btnRead.Text = "Lifetime Read";
this.btnRead.UseVisualStyleBackColor = true;
this.btnRead.Click += new System.EventHandler(this.btnRead_Click);
//
// btnLogout
//
this.btnLogout.Location = new System.Drawing.Point(303, 8);
this.btnLogout.Name = "btnLogout";
this.btnLogout.Size = new System.Drawing.Size(85, 30);
this.btnLogout.TabIndex = 12;
this.btnLogout.Text = "Logout";
this.btnLogout.UseVisualStyleBackColor = true;
this.btnLogout.Click += new System.EventHandler(this.btnLogout_Click);
//
// FrmQsTool
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(587, 450);
this.Controls.Add(this.btnLogout);
this.Controls.Add(this.lblState);
this.Controls.Add(this.btnConnect);
this.Controls.Add(this.label1);
this.Controls.Add(this.cbComSlot);
this.Controls.Add(this.btnRead);
this.Controls.Add(this.btnWrite);
this.Name = "FrmQsTool";
this.Text = "FrmConfigurations";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmConfigurations_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblState;
private System.Windows.Forms.Button btnConnect;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox cbComSlot;
private System.Windows.Forms.Button btnLogout;
private System.Windows.Forms.Button btnWrite;
private System.Windows.Forms.Button btnRead;
}
}

View File

@ -0,0 +1,242 @@
using Newtonsoft.Json;
using NLog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Xylem.Common.CommonCore.Consts;
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisStatus;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
using Xylem.Common.Utils.Logging;
namespace Xylem.Common.Ui.GenesisToolBox
{
public partial class FrmQsTool : Form
{
private GenesisMeter _currentGenesis;
private String _currentPcbId;
private MeterBatch _meterBatch = new MeterBatch();
private readonly ILogger logger = NLogHelper.CreateOrGetLogger("GenesisConfigurator");
public FrmQsTool()
{
InitializeComponent();
_meterBatch = new MeterBatch();
var configfile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Xylem.Common.Hardware.WaterMeter.Genesis), ProgramConfig.SerialConfigFileName);
if (!File.Exists(configfile))
{
throw new ApplicationException($"Configuration file {configfile} not found ");
}
var tr = new StreamReader(configfile);
var meterConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(tr.ReadToEnd());
cbComSlot.Items.Clear();
var listSlots = new List<Int32>();
foreach (var item in meterConfigList)
{
cbComSlot.Items.Add(item.Slot);
listSlots.Add(item.Slot);
}
if (cbComSlot.Items.Count >= 1)
{
cbComSlot.SelectedItem = cbComSlot.Items[0];
}
//foreach (var info in typeof(Register).GetNestedTypes())
//{
// cbPreselection.Items.Add(info.Name);
//}
}
private void btnLogout_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
_currentGenesis.Logout();
}
_currentPcbId = "";
}
private void btnConnect_Click(Object sender, EventArgs e)
{
if (cbComSlot.SelectedItem != null) // && cbComSlot.SelectedValue is ListBoxItem)
{
Int32 slotNR = 0;
if (!string.IsNullOrEmpty(cbComSlot.SelectedItem.ToString()) &&
int.TryParse(cbComSlot.SelectedItem.ToString(), out slotNR))
{
conntect(slotNR);
}
}
}
private void btnRead_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
if (cbComSlot.SelectedItem == null)
{
return;
}
if (string.IsNullOrEmpty(cbComSlot.SelectedItem.ToString()) ||
!int.TryParse(cbComSlot.SelectedItem.ToString(), out var slotNR))
{
return;
}
try
{
//conntect(slotNR);
foreach (var me in _meterBatch.ListOfMeters)
{
if (me is GenesisMeter)
{
if (((GenesisMeter)me).IsLoggedOn)
{
_currentGenesis = ((GenesisMeter)me);
var genesisStatus = new GenesisStatus();
if (GenesisStatusHandler.BuildLifeTimeInformation(_currentGenesis, genesisStatus))
{
var sbMSG = new StringBuilder();
sbMSG.AppendLine($"Pcb = {_currentGenesis.PcbId}");
sbMSG.AppendLine($"POWERMON_TotalUsedSeconds = {genesisStatus.ExceededLifeTime_s}");
sbMSG.AppendLine($"POWERMON_TotalUsedCharge = {genesisStatus.DrainedBatteryLoad_uAs}");
sbMSG.AppendLine($"POWERMON_BatteryQuantity = {genesisStatus.BatteryQuantity}");
sbMSG.AppendLine($"POWERMON_BatteryMilliAHrRating = {genesisStatus.InitialBatteryLoad_mAh}");
sbMSG.AppendLine("");
sbMSG.AppendLine($"Remaining life time in years {genesisStatus.RemainingLifeTimeYears:F2}");
sbMSG.AppendLine($"Totally drained battery load in % {genesisStatus.DrainedBatteryLoadPercent:F2}");
MessageBox.Show(sbMSG.ToString(), $"Battery for {_currentGenesis.PcbId} has remaining life " +
$"time of {genesisStatus.RemainingLifeTimeYears:F2} years");
}
else
{
MessageBox.Show("Failed to get life time information");
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
private void btnWrite_Click(Object sender, EventArgs e)
{
if (cbComSlot.SelectedItem == null)
{
return;
}
if (string.IsNullOrEmpty(cbComSlot.SelectedItem.ToString()) ||
!int.TryParse(cbComSlot.SelectedItem.ToString(), out var slotNR))
{
return;
}
if (!_currentGenesis.IsLoggedOn)
{
_currentGenesis.Login();
}
_currentGenesis.WriteRegister(Register.Genesisflow.SampleRate, 2);
_currentGenesis.WriteRegister(Register.Genesisflow.LedMode, 0);
_currentGenesis.WriteRegister(Register.Genesisflow.TriggerActive, 1);
}
private void conntect(Int32 slotNR)
{
try
{
_meterBatch.RemoveAllMeters();
_currentGenesis = new GenesisMeter();
//_currentGenesis.IsDevelopmentUsage = true; //Make sure to set this before login
try
{
_currentGenesis.SetupFromConfigFile(slotNR);
_currentGenesis.EnableAutoLogon();
_meterBatch.AddMeter(_currentGenesis);
}
catch (Exception ex)
{
logger.Error(ex, $"Slot #{slotNR} failed: {ex.Message}");
lblState.Text = "Failed";
}
_currentGenesis.Login();
_currentPcbId = _currentGenesis.PcbId;
if (_currentGenesis.IsLoggedOn)
{
lblState.Text = _currentGenesis.PcbId;
}
else
{
lblState.Text = "Failed";
}
}
catch (Exception ex)
{
logger.Error(ex, ex.Message);
}
}
private void btnDisplayDefault_Click(Object sender, EventArgs e)
{
if (_currentGenesis != null && _currentGenesis.IsLoggedOn)
{
_currentGenesis.WriteRegister("GENESISFLOW_SealDisplay", 0);
_currentGenesis.WriteRegister("CUSTOMER_Locale", 0);
_currentGenesis.WriteRegister("GENESISFLOW_DisplayPow10", 253);
_currentGenesis.WriteRegister("GENESISFLOW_DisplayUnits", 0);
_currentGenesis.WriteRegister("METROLOGYASST_FlowUnits", 1);
_currentGenesis.StoreAllConfigurations();
_currentGenesis.WriteRegister("SENSUSRADIO_SYSTEMSTATE", 0xFF, true, false);
}
}
private void FrmConfigurations_FormClosing(Object sender, FormClosingEventArgs e)
{
_meterBatch.Dispose();
}
}
}

View File

@ -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>

View File

@ -224,6 +224,12 @@
<Compile Include="FrmCalibrationResults.Designer.cs">
<DependentUpon>FrmCalibrationResults.cs</DependentUpon>
</Compile>
<Compile Include="FrmQsTool.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmQsTool.Designer.cs">
<DependentUpon>FrmQsTool.cs</DependentUpon>
</Compile>
<Compile Include="FrmConfigurations.cs">
<SubType>Form</SubType>
</Compile>
@ -461,6 +467,9 @@
<EmbeddedResource Include="FrmCalibrationResults.resx">
<DependentUpon>FrmCalibrationResults.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmQsTool.resx">
<DependentUpon>FrmQsTool.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmConfigurations.resx">
<DependentUpon>FrmConfigurations.cs</DependentUpon>
</EmbeddedResource>
@ -628,6 +637,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\ServiceFwUpdate\Common\FwUpdateDb\FwUpdateDb.csproj">
<Project>{4806D89A-FBFB-41BC-AAA7-2242444BF55A}</Project>
<Name>FwUpdateDb</Name>
</ProjectReference>
<ProjectReference Include="..\..\CommonCore.Configuration\CommonCore.Configuration.csproj">
<Project>{9EB1F659-6F73-4F65-BCAB-4114FD94F5FC}</Project>
<Name>CommonCore.Configuration</Name>

View File

@ -428,12 +428,13 @@ namespace GenesisToolBox
container.meterTestSettings[i].FlowTesting = true;
container.meterTestSettings[i].PreAdjustment = false;
container.meterTestSettings[i].SerialNr = $"450000{slotNr}";
container.meterTestSettings[i].meterType = MeterTypes.MagFlux;
container.meterTestSettings[i].meterType = MeterTypes.eRegister;
}
i++;
}
ctlBatch.SetTestSetupContainer(container);

View File

@ -42,7 +42,7 @@
this.gpLAA = new System.Windows.Forms.GroupBox();
this.button5 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.btnPara = new System.Windows.Forms.Button();
this.btnQsTool = new System.Windows.Forms.Button();
this.btnRegHistory = new System.Windows.Forms.Button();
this.btnPassword = new System.Windows.Forms.Button();
this.btnLowLevelTools = new System.Windows.Forms.Button();
@ -190,13 +190,13 @@
//
this.gpLAA.Controls.Add(this.button5);
this.gpLAA.Controls.Add(this.button2);
this.gpLAA.Controls.Add(this.btnPara);
this.gpLAA.Controls.Add(this.btnQsTool);
this.gpLAA.Controls.Add(this.btnRegHistory);
this.gpLAA.Controls.Add(this.btnPassword);
this.gpLAA.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gpLAA.Location = new System.Drawing.Point(186, 27);
this.gpLAA.Name = "gpLAA";
this.gpLAA.Size = new System.Drawing.Size(168, 235);
this.gpLAA.Size = new System.Drawing.Size(168, 245);
this.gpLAA.TabIndex = 20;
this.gpLAA.TabStop = false;
this.gpLAA.Text = "Production LAA";
@ -225,17 +225,17 @@
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click_1);
//
// btnPara
// btnQsTool
//
this.btnPara.Enabled = false;
this.btnPara.Location = new System.Drawing.Point(5, 103);
this.btnPara.Name = "btnPara";
this.btnPara.Size = new System.Drawing.Size(156, 40);
this.btnPara.TabIndex = 19;
this.btnPara.Text = "Parameterization";
this.btnPara.UseMnemonic = false;
this.btnPara.UseVisualStyleBackColor = true;
this.btnPara.Click += new System.EventHandler(this.btnPara_Click);
this.btnQsTool.Enabled = false;
this.btnQsTool.Location = new System.Drawing.Point(5, 103);
this.btnQsTool.Name = "btnQsTool";
this.btnQsTool.Size = new System.Drawing.Size(156, 40);
this.btnQsTool.TabIndex = 19;
this.btnQsTool.Text = "QS Tool";
this.btnQsTool.UseMnemonic = false;
this.btnQsTool.UseVisualStyleBackColor = true;
this.btnQsTool.Click += new System.EventHandler(this.btnQsTool_Click);
//
// btnRegHistory
//
@ -261,7 +261,7 @@
//
// btnLowLevelTools
//
this.btnLowLevelTools.Location = new System.Drawing.Point(4, 158);
this.btnLowLevelTools.Location = new System.Drawing.Point(4, 153);
this.btnLowLevelTools.Name = "btnLowLevelTools";
this.btnLowLevelTools.Size = new System.Drawing.Size(157, 40);
this.btnLowLevelTools.TabIndex = 22;
@ -277,9 +277,9 @@
this.gbDeveloper.Controls.Add(this.btnFiles);
this.gbDeveloper.Controls.Add(this.btnLegacyTestApp);
this.gbDeveloper.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.gbDeveloper.Location = new System.Drawing.Point(186, 282);
this.gbDeveloper.Location = new System.Drawing.Point(186, 293);
this.gbDeveloper.Name = "gbDeveloper";
this.gbDeveloper.Size = new System.Drawing.Size(168, 204);
this.gbDeveloper.Size = new System.Drawing.Size(168, 193);
this.gbDeveloper.TabIndex = 21;
this.gbDeveloper.TabStop = false;
this.gbDeveloper.Text = "Developer";
@ -288,7 +288,7 @@
// BtnFileSplit
//
this.BtnFileSplit.Enabled = false;
this.BtnFileSplit.Location = new System.Drawing.Point(4, 114);
this.BtnFileSplit.Location = new System.Drawing.Point(4, 111);
this.BtnFileSplit.Name = "BtnFileSplit";
this.BtnFileSplit.Size = new System.Drawing.Size(157, 40);
this.BtnFileSplit.TabIndex = 18;
@ -300,7 +300,7 @@
// btnFiles
//
this.btnFiles.Enabled = false;
this.btnFiles.Location = new System.Drawing.Point(4, 68);
this.btnFiles.Location = new System.Drawing.Point(4, 65);
this.btnFiles.Name = "btnFiles";
this.btnFiles.Size = new System.Drawing.Size(157, 40);
this.btnFiles.TabIndex = 16;
@ -311,7 +311,7 @@
// btnLegacyTestApp
//
this.btnLegacyTestApp.Enabled = false;
this.btnLegacyTestApp.Location = new System.Drawing.Point(4, 24);
this.btnLegacyTestApp.Location = new System.Drawing.Point(4, 19);
this.btnLegacyTestApp.Name = "btnLegacyTestApp";
this.btnLegacyTestApp.Size = new System.Drawing.Size(157, 40);
this.btnLegacyTestApp.TabIndex = 15;
@ -343,14 +343,14 @@
// loginMenuItem
//
this.loginMenuItem.Name = "loginMenuItem";
this.loginMenuItem.Size = new System.Drawing.Size(180, 22);
this.loginMenuItem.Size = new System.Drawing.Size(112, 22);
this.loginMenuItem.Text = "Login";
this.loginMenuItem.Click += new System.EventHandler(this.OnLoginClick);
//
// logoutMenuItem
//
this.logoutMenuItem.Name = "logoutMenuItem";
this.logoutMenuItem.Size = new System.Drawing.Size(180, 22);
this.logoutMenuItem.Size = new System.Drawing.Size(112, 22);
this.logoutMenuItem.Text = "Logout";
this.logoutMenuItem.Click += new System.EventHandler(this.OnLogoutClick);
//
@ -392,7 +392,7 @@
private System.Windows.Forms.Button btnAlarm;
private System.Windows.Forms.Button btnSetup;
private System.Windows.Forms.GroupBox gpLAA;
private System.Windows.Forms.Button btnPara;
private System.Windows.Forms.Button btnQsTool;
private System.Windows.Forms.Button btnRegHistory;
private System.Windows.Forms.Button btnPassword;
private System.Windows.Forms.GroupBox gbDeveloper;

View File

@ -419,7 +419,7 @@
btnPassword.Tag = SoftwareFunctions.LAA_PASSWORD;
btnRegHistory.Tag = SoftwareFunctions.LAA_REGISTER_HISTORY;
btnPara.Tag = SoftwareFunctions.LAA_PARAMETERIZATION;
btnQsTool.Tag = SoftwareFunctions.LAA_PARAMETERIZATION;
button2.Tag = SoftwareFunctions.LAA_PROCESS_PARAMETER;
button5.Tag = SoftwareFunctions.LAA_MAPPING_NA;
@ -550,5 +550,13 @@
}
#endregion Form initialization
private void btnQsTool_Click(Object sender, EventArgs e)
{
var form = new FrmQsTool();
form.Show();
form.Closed += Form_Closed;
Hide();
}
}
}

View File

@ -120,4 +120,7 @@
<metadata name="menu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>

View File

@ -30,7 +30,6 @@
{
this.components = new System.ComponentModel.Container();
this.btnGet = new System.Windows.Forms.Button();
this.btnSet = new System.Windows.Forms.Button();
this.txtPcbID = new System.Windows.Forms.TextBox();
this.txtSkeletonKey = new System.Windows.Forms.TextBox();
this.lblPcbID = new System.Windows.Forms.Label();
@ -52,6 +51,8 @@
this.barProgressDb = new System.Windows.Forms.ProgressBar();
this.tmrProgressPcb = new System.Windows.Forms.Timer(this.components);
this.tmrProgressDb = new System.Windows.Forms.Timer(this.components);
this.label4 = new System.Windows.Forms.Label();
this.txtProductionPassword = new System.Windows.Forms.TextBox();
this.grpSetup.SuspendLayout();
this.grpDataBase.SuspendLayout();
this.SuspendLayout();
@ -66,16 +67,6 @@
this.btnGet.UseVisualStyleBackColor = true;
this.btnGet.Click += new System.EventHandler(this.btnGet_Click);
//
// btnSet
//
this.btnSet.Location = new System.Drawing.Point(291, 64);
this.btnSet.Name = "btnSet";
this.btnSet.Size = new System.Drawing.Size(54, 25);
this.btnSet.TabIndex = 1;
this.btnSet.Text = "Set";
this.btnSet.UseVisualStyleBackColor = true;
this.btnSet.Click += new System.EventHandler(this.btnSet_Click);
//
// txtPcbID
//
this.txtPcbID.Location = new System.Drawing.Point(9, 67);
@ -194,6 +185,8 @@
//
// grpDataBase
//
this.grpDataBase.Controls.Add(this.label4);
this.grpDataBase.Controls.Add(this.txtProductionPassword);
this.grpDataBase.Controls.Add(this.label3);
this.grpDataBase.Controls.Add(this.txtLvl8);
this.grpDataBase.Controls.Add(this.btnErasePwdFile);
@ -205,7 +198,6 @@
this.grpDataBase.Controls.Add(this.lblPcbID);
this.grpDataBase.Controls.Add(this.txtSkeletonKey);
this.grpDataBase.Controls.Add(this.txtPcbID);
this.grpDataBase.Controls.Add(this.btnSet);
this.grpDataBase.Controls.Add(this.btnGet);
this.grpDataBase.Location = new System.Drawing.Point(7, 101);
this.grpDataBase.Name = "grpDataBase";
@ -279,6 +271,24 @@
this.barProgressDb.TabIndex = 24;
this.barProgressDb.Visible = false;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(121, 129);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(50, 13);
this.label4.TabIndex = 32;
this.label4.Text = "Prod PW";
//this.label4.Click += new System.EventHandler(this.label4_Click);
//
// txtProductionPassword
//
this.txtProductionPassword.Location = new System.Drawing.Point(116, 145);
this.txtProductionPassword.Name = "txtProductionPassword";
this.txtProductionPassword.Size = new System.Drawing.Size(102, 20);
this.txtProductionPassword.TabIndex = 31;
//this.txtProductionPassword.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// FrmPassword
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -301,7 +311,6 @@
#endregion
private System.Windows.Forms.Button btnGet;
private System.Windows.Forms.Button btnSet;
private System.Windows.Forms.TextBox txtPcbID;
private System.Windows.Forms.TextBox txtSkeletonKey;
private System.Windows.Forms.Label lblPcbID;
@ -323,5 +332,7 @@
private System.Windows.Forms.Button btnErasePwdFile;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtLvl8;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtProductionPassword;
}
}

View File

@ -253,7 +253,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
txtPcbID.Text = "";
txtSkeletonKey.Text = "";
btnGet.Enabled = false;
btnSet.Enabled = false;
//btnSet.Enabled = false;
if (!string.IsNullOrEmpty(cbComSlot.SelectedItem.ToString()) &&
int.TryParse(cbComSlot.SelectedItem.ToString(), out slotNr))
{
@ -327,7 +327,7 @@ namespace Xylem.Common.Ui.GenesisToolBox
txtPcbID.Text = "";
txtSkeletonKey.Text = "";
btnGet.Enabled = false;
btnSet.Enabled = false;
btnWritePwdFile.Enabled = false;
}
@ -353,11 +353,11 @@ namespace Xylem.Common.Ui.GenesisToolBox
if (txtPcbID.Text.Length > 7 && txtSkeletonKey.Text.Length == 12
&& lblConnectPcb.Text == StrNotConnected)
{
btnSet.Enabled = true;
//btnSet.Enabled = true;
}
else
{
btnSet.Enabled = false;
//btnSet.Enabled = false;
}
}

View File

@ -123,4 +123,7 @@
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>26</value>
</metadata>
</root>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ConfigurationJson" version="1.0.2" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="NLog" version="5.2.2" targetFramework="net48" />
<package id="QRCoder" version="1.4.3" targetFramework="net40" />

View File

@ -38,7 +38,7 @@ namespace XylemCommonUiLegacyGenCtl
void SetMeterTestSettings(int Slot, string SerialNr, bool FlowAdjustment, double FlowAdjustmentTarget, bool PreAdjustment, bool FlowTesting, bool MagFlux, bool Cordonel, bool ReversFlow);
void SetMeterTestSettings(int Slot, string SerialNr, bool FlowAdjustment, double FlowAdjustmentTarget, bool PreAdjustment, bool FlowTesting, bool MagFlux, bool Cordonel,bool eRegister, bool ReversFlow);
string GetMeterSerialNr(int Slot);
bool GetFlowAdjustment(int Slot);
bool GetPreAdjustment(int Slot);

View File

@ -205,6 +205,10 @@
<Project>{8BDD2789-96D4-43EA-AAD7-0F49D0347998}</Project>
<Name>ProtocolCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\Hardware\WaterMeter\eRegister\eRegisterCore\eRegisterCore.csproj">
<Project>{A83696BF-D8A2-4809-8424-CFE172AED5B6}</Project>
<Name>eRegisterCore</Name>
</ProjectReference>
<ProjectReference Include="..\..\Hardware\WaterMeter\Genesis\DataPackages\DataPackages.csproj">
<Project>{0E524D43-7B66-45CD-AA74-41D51AFC3D99}</Project>
<Name>DataPackages</Name>

View File

@ -300,7 +300,7 @@ namespace XylemCommonUiLegacyGenCtl
var c = TestsetuptContainer.meterTestSettings.Count();
TestsetuptContainer.meterTestResults = new MeterTestResults[c];
TestsetuptContainer.meterTestResults = new MeterTestResults[10];
int WaitTimeM = 5;
wrappedControl.StatusLabel("MagFlux Zeroflow is running");

View File

@ -178,7 +178,7 @@ namespace XylemCommonUiLegacyGenCtl
#region MeterStuff
public void SetMeterTestSettings(int Slot, string SerialNr, bool FlowAdjustment, double FlowAdjustmentTarget, bool PreAdjustment, bool FlowTesting, bool MagFlux, bool Cordonel,bool ReversFlow)
public void SetMeterTestSettings(int Slot, string SerialNr, bool FlowAdjustment, double FlowAdjustmentTarget, bool PreAdjustment, bool FlowTesting, bool MagFlux, bool Cordonel,bool eRegister,bool ReversFlow)
{
HanldWrongInputMeters(Slot);
@ -208,6 +208,11 @@ namespace XylemCommonUiLegacyGenCtl
{
testSetup.meterTestSettings[Slot - 1].meterType = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.Cordonel;
}
if (eRegister)
{
testSetup.meterTestSettings[Slot - 1].meterType = Xylem.Common.Hardware.WaterMeter.WaterMeterCore.MeterTypes.eRegister;
}
testSetup.meterTestSettings[Slot - 1].FlowTestingOnlyForward = true;
testSetup.meterTestSettings[Slot - 1].FlowTestingOnlyRevers = false;

View File

@ -17,6 +17,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Xylem.Common.CommonCore.Configuration;
using Xylem.Common.Hardware.WaterMeter.eRegister.eRegisterCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore;
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers;
using Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore;
@ -760,6 +761,10 @@ namespace XylemCommonUiLegacyGenCtl
case MeterTypes.MagFlux:
meter = new MagFluxMeter();
break;
case MeterTypes.eRegister:
meter = new eRegisterMeter();
break;
default:
meter = new GenesisMeter();
break;
@ -892,8 +897,8 @@ namespace XylemCommonUiLegacyGenCtl
if (!TestSetupContainer.meterTestSettings.Any(f => f != null && f.Slot == slot))
{
TestSetupContainer.meterTestSettings[slot] = new MeterTestSettings() { SerialNr = serialNumber, Slot = slot, FlowAdjustment = true, FlowTesting = true };
TestSetupContainer.meterTestResults[slot] = new MeterTestResults() { SerialNr = serialNumber, Slot = slot, meterType = MeterTypes.MagFlux, Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>() };
TestSetupContainer.meterTestSettings[slot - 1] = new MeterTestSettings() { SerialNr = serialNumber, Slot = slot, FlowAdjustment = true, FlowTesting = true };
TestSetupContainer.meterTestResults[slot - 1] = new MeterTestResults() { SerialNr = serialNumber, Slot = slot, meterType = MeterTypes.MagFlux, Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>() };
}
AddMeter(serialNumber, slot, true);
@ -1001,7 +1006,7 @@ namespace XylemCommonUiLegacyGenCtl
//FF-55-00-00
var meter = batch.ListOfMeters.First(f => f.Slot == slot);
var state = DisplayCodes.FlowTested;
if (meter is MagFluxMeter mag)
{
@ -1027,11 +1032,11 @@ namespace XylemCommonUiLegacyGenCtl
mag.WriteCalibrationTestBench(result.Results);
}
}
catch (Exception ex )
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
@ -1546,7 +1551,7 @@ namespace XylemCommonUiLegacyGenCtl
}
catch (Exception ex)
{
_logger.Error(ex, $"error on GetResults Slot={Slot},Chnnl={Chnnl},refVolQm={refVolQm},refTimeS={refTimeS}");
return null;
}
@ -1576,6 +1581,14 @@ namespace XylemCommonUiLegacyGenCtl
{
t = MeasurementDirection.TakeOnlyForward;
}
if (testset.meterType == MeterTypes.eRegister)
{
t = MeasurementDirection.TakeBoth;
}
}
else
{
_logger.Warn($"No TestSetupContainer found ({TestSetupContainer != null}) or no MeterTestsetting found ({TestSetupContainer.meterTestSettings != null}) or no Testsettings for Slot {Slot} found ({TestSetupContainer.meterTestSettings.Any(ts => ts != null && ts.Slot == Slot)}) ");
}
}
catch (Exception ex)
@ -1583,8 +1596,8 @@ namespace XylemCommonUiLegacyGenCtl
_logger.Error(ex, $"error on GetResults find Testcontainer Slot={Slot},Chnnl={Chnnl},refVolQm={refVolQm},refTimeS={refTimeS}");
throw;
}
result = GetMeasurementResult(Slot, Chnnl, refVolQm, refTimeS,t);
result = GetMeasurementResult(Slot, Chnnl, refVolQm, refTimeS, t);
if (!result.HasValue)
{
@ -1618,32 +1631,38 @@ namespace XylemCommonUiLegacyGenCtl
try
{
if (TestSetupContainer.meterTestResults == null)
if (TestSetupContainer != null)
{
// MessageBox.Show("meterTestResults emtpty on getresults");
var countMeters = TestSetupContainer.meterTestSettings?.Count() ?? 10;
TestSetupContainer.meterTestResults = new MeterTestResults[countMeters];
}
if (!TestSetupContainer.meterTestResults.Any(f => f != null && f.Slot == Slot))
{
// MessageBox.Show("meterTestResults not found on getresults");
TestSetupContainer.meterTestResults[Slot - 1].Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>();
}
var results = TestSetupContainer.meterTestResults[Slot - 1].Results;
if (!results.Any(f => f.MeasuredRefFlowQmPerH == result.Value.RefFlowRateCmPh))
{
results.Add(new Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations()
if (TestSetupContainer.meterTestResults == null)
{
MeasuredRefFlowQmPerH = result.Value.RefFlowRateCmPh ?? 0,
RefTimeS = result.Value.RefTimeS ?? 0,
RequierdFlowQmPerH = result.Value.RefFlowRateCmPh ?? 0,
RequierdTimeS = result.Value.RefTimeS ?? 0,
MeasuredDutFlowQmPerH = result.Value.DutFlowRateCmPh ?? 0,
DutTimeS = result.Value.DutTimeS,
});
TestSetupContainer.meterTestResults = new MeterTestResults[10];
}
if (!TestSetupContainer.meterTestResults.Any(f => f != null && f.Slot == Slot))
{
TestSetupContainer.meterTestResults[Slot - 1] = new MeterTestResults();
TestSetupContainer.meterTestResults[Slot - 1].Slot = Slot;
TestSetupContainer.meterTestResults[Slot - 1].Results = new List<Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations>();
}
var results = TestSetupContainer.meterTestResults[Slot - 1].Results;
if (!results.Any(f => f.MeasuredRefFlowQmPerH == result.Value.RefFlowRateCmPh))
{
results.Add(new Xylem.Common.Hardware.WaterMeter.DataPackages.MeasurementRecords.FlowDeviations()
{
MeasuredRefFlowQmPerH = result.Value.RefFlowRateCmPh ?? 0,
RefTimeS = result.Value.RefTimeS ?? 0,
RequierdFlowQmPerH = result.Value.RefFlowRateCmPh ?? 0,
RequierdTimeS = result.Value.RefTimeS ?? 0,
MeasuredDutFlowQmPerH = result.Value.DutFlowRateCmPh ?? 0,
DutTimeS = result.Value.DutTimeS,
});
}
}
else
{
_logger.Error($"error no TestSetupcontainer on GetResults add testresult Slot={Slot},Chnnl={Chnnl},refVolQm={refVolQm},refTimeS={refTimeS}");
}
}
catch (Exception ex)
@ -2310,6 +2329,7 @@ namespace XylemCommonUiLegacyGenCtl
{
if (batch != null)
{
batch.DisposeTestBench();
batch.RemoveAllMeters();
batch.Dispose();
}

View File

@ -462,6 +462,11 @@ namespace XylemCommonUiLegacyGenCtl
{
meter.WriteRegister(Register.Genesisflow.TriggerIdle, 0, true, true);
}
meter.WriteRegister("GENESISFLOW_SealDisplay", 0, true, true);
meter.WriteRegister("GENESISFLOW_DisplayPow10", new Byte[] { 0x00, 0x00, 0x00, 0xFA }, true, true);
meter.WriteRegister("GENESISFLOW_DisplayUnits", 0, true, true);
meter.InitMeasurement();

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
</configuration>

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xylem.Common.Hardware.Plc.Siemens.Client.TestbenchAdapter;
namespace SPSCheck
{
class Program
{
static void Main(string[] args)
{
try
{
var c = new Vb6Testbench();
Console.WriteLine("URL:");
c.Connect(Console.ReadLine());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message)
; }
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SPSCheck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SPSCheck")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1903344f-7ba5-4c38-b672-3ca81aa62b51")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1903344F-7BA5-4C38-B672-3CA81AA62B51}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SPSCheck</RootNamespace>
<AssemblyName>SPSCheck</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Hardware\PLC\Siemens\Client\TestbenchAdapter\TestbenchAdapter.csproj">
<Project>{494AB06C-10C4-43F8-BC8A-92088EB35867}</Project>
<Name>TestbenchAdapter</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -67,7 +67,7 @@
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
@ -75,7 +75,7 @@
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
<HintPath>..\..\packages\NLog.5.0.0\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@ -141,8 +141,6 @@
<DependentUpon>Resources.de.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="FwUpdateLoader_1_TemporaryKey.pfx" />
<None Include="FwUpdateLoader_4_TemporaryKey.pfx" />
<None Include="FwUpdateLoader_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
<package id="NLog" version="5.0.0" targetFramework="net472" />
</packages>

View File

@ -77,13 +77,14 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.2.2\lib\net46\NLog.dll</HintPath>
<HintPath>..\..\packages\NLog.5.0.0\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="NLog" version="5.2.2" targetFramework="net472" />
<package id="NLog" version="5.0.0" targetFramework="net472" />
<package id="NLog.Config" version="4.6.7" targetFramework="net472" />
<package id="NLog.Schema" version="4.6.7" targetFramework="net472" />
</packages>