diff --git a/.gitignore b/.gitignore index e0f815c3..cb7cc46b 100644 --- a/.gitignore +++ b/.gitignore @@ -401,3 +401,4 @@ FodyWeavers.xsd /Common/Common.v3.ncrunchsolution /TBF_V2/Sources/TBF/TBF/BenchControl/TestMethods/GenesisCommunication.zip /Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration2013.json +/LaaProductionWeb/LaaPackages diff --git a/Common/.vs/Common/config/applicationhost.config b/Common/.vs/Common/config/applicationhost.config index 8f2db308..1e872a0b 100644 --- a/Common/.vs/Common/config/applicationhost.config +++ b/Common/.vs/Common/config/applicationhost.config @@ -176,6 +176,14 @@ + + + + + + + + diff --git a/Common/Common.Services.LaserImport/Common.Services.LaserImport.csproj b/Common/Common.Services.LaserImport/Common.Services.LaserImport.csproj index de15ea70..074510b1 100644 --- a/Common/Common.Services.LaserImport/Common.Services.LaserImport.csproj +++ b/Common/Common.Services.LaserImport/Common.Services.LaserImport.csproj @@ -12,6 +12,21 @@ 512 true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -50,5 +65,12 @@ + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/Common/Common.Services.LaserImport/Program.cs b/Common/Common.Services.LaserImport/Program.cs index 99c3c2ad..e36d54df 100644 --- a/Common/Common.Services.LaserImport/Program.cs +++ b/Common/Common.Services.LaserImport/Program.cs @@ -31,6 +31,11 @@ clientWhatcher.IncludeSubdirectories = false; clientWhatcher.EnableRaisingEvents = true; + WaithLaserReady(); + } + + private static void WaithLaserReady() + { var fg = ConsoleColor.DarkGray; Console.ForegroundColor = fg; @@ -40,7 +45,7 @@ awaiter.Wait(); Console.ForegroundColor = ConsoleColor.White; - Console.Write($"FERTIGMELDEN"); + Console.Write($"LASERUNG BESTÄTIGEN"); Console.ReadLine(); Console.ForegroundColor = fg; @@ -59,6 +64,8 @@ Thread.Sleep(100); } } + + Console.Clear(); } } @@ -73,9 +80,9 @@ if (!File.Exists(fileToDelete)) { - fileToDelete = string.Empty; - Console.WriteLine($"{fileToDelete} - dose not exists!"); + + fileToDelete = string.Empty; } else { @@ -93,6 +100,8 @@ var sourceFilePath = args.FullPath; var destinationFilePath = Path.Combine(localFolder, args.Name); + Thread.Sleep(1000); + if (File.Exists(sourceFilePath)) { while (true) diff --git a/Common/Common.sln b/Common/Common.sln index cfd1744d..c3ba97fe 100644 --- a/Common/Common.sln +++ b/Common/Common.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.6.33717.318 +# Visual Studio 15 +VisualStudioVersion = 15.0.33423.255 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{7A0EE7B8-6B7E-41E9-B679-319C8CA48CF1}" EndProject @@ -354,7 +354,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SIRT", "SIRT", "{02EA681E-C EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LaaPackages", "LaaPackages", "{7B7EC9A1-2091-4CCD-9F01-C579ABD9241D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaProductionWeb.Resources", "LaaPackages\LaaProductionWeb.Resources\LaaProductionWeb.Resources.csproj", "{DA65E376-3D35-4D96-913A-7197FCA6DF48}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaProductionWeb.Resources", "LaaPackages\LaaProductionWeb.Resources\LaaProductionWeb.Resources.csproj", "{9E070488-15DE-418A-8606-5B79056C6E9F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaaPackages.Features.Cordonel", "LaaPackages\LaaPackages.Features.Cordonel\LaaPackages.Features.Cordonel.csproj", "{8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}" EndProject @@ -376,9 +376,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FM2014Core", "Hardware\Wate EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Services.LaserImport", "Common.Services.LaserImport\Common.Services.LaserImport.csproj", "{6746517C-BE89-4637-A283-0A932A50497A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SapImport", "Service\SapImport\SapImport.csproj", "{9D4082BA-B62A-4AB5-A89D-21404A598693}" -EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution _MANUAL_CONTROL|Any CPU = _MANUAL_CONTROL|Any CPU _MANUAL_CONTROL|Mixed Platforms = _MANUAL_CONTROL|Mixed Platforms @@ -6005,78 +6006,78 @@ Global {AFC428F5-0141-4A3F-BEF2-470A89D972F6}.XP32bit|x64.Build.0 = Release|Any CPU {AFC428F5-0141-4A3F-BEF2-470A89D972F6}.XP32bit|x86.ActiveCfg = Release|Any CPU {AFC428F5-0141-4A3F-BEF2-470A89D972F6}.XP32bit|x86.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Any CPU.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Any CPU.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|Mixed Platforms.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x64.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x64.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x86.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.COM|x86.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x64.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x64.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x86.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Debug|x86.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Any CPU.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x64.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x64.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x86.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.GenesisDisplayTool_V01|x86.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Any CPU.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Any CPU.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|Mixed Platforms.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x64.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x64.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x86.ActiveCfg = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.PerformTest|x86.Build.0 = Debug|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Any CPU.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x64.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x64.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x86.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.Release|x86.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x64.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x64.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x86.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.ReleaseTest|x86.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Any CPU.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Any CPU.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Mixed Platforms.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|Mixed Platforms.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x64.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x64.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x86.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.VPN_Debug|x86.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Any CPU.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x64.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x64.Build.0 = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x86.ActiveCfg = Release|Any CPU - {DA65E376-3D35-4D96-913A-7197FCA6DF48}.XP32bit|x86.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Any CPU.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Any CPU.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|Mixed Platforms.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x64.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x64.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x86.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.COM|x86.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x64.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x64.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x86.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Debug|x86.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Any CPU.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x64.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x64.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x86.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.GenesisDisplayTool_V01|x86.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Any CPU.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Any CPU.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|Mixed Platforms.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x64.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x64.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x86.ActiveCfg = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.PerformTest|x86.Build.0 = Debug|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Any CPU.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x64.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x64.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x86.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.Release|x86.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x64.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x64.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x86.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.ReleaseTest|x86.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Any CPU.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Any CPU.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Mixed Platforms.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|Mixed Platforms.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x64.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x64.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x86.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.VPN_Debug|x86.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Any CPU.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x64.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x64.Build.0 = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x86.ActiveCfg = Release|Any CPU + {9E070488-15DE-418A-8606-5B79056C6E9F}.XP32bit|x86.Build.0 = Release|Any CPU {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -6581,78 +6582,6 @@ Global {6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x64.Build.0 = Release|Any CPU {6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x86.ActiveCfg = Release|Any CPU {6746517C-BE89-4637-A283-0A932A50497A}.XP32bit|x86.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}._MANUAL_CONTROL|x86.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.COM|x86.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Debug|x86.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.GenesisDisplayTool_V01|x86.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.PerformTest|x86.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|Any CPU.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|x64.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|x64.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|x86.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.Release|x86.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|x64.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|x64.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|x86.ActiveCfg = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.ReleaseTest|x86.Build.0 = Release|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.VPN_Debug|x86.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|Any CPU.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|Any CPU.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|Mixed Platforms.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|x64.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|x64.Build.0 = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|x86.ActiveCfg = Debug|Any CPU - {9D4082BA-B62A-4AB5-A89D-21404A598693}.XP32bit|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -6796,7 +6725,7 @@ Global {D7A7E1FF-D024-407F-B30D-4C519CFA7BF1} = {A6B3AB5A-A567-4C77-80FB-1E1E19A00713} {AFC428F5-0141-4A3F-BEF2-470A89D972F6} = {C17363DF-A043-4F25-8EBA-2B3B078227DC} {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {99B23EE9-CE50-4924-A055-C39EFA038721} - {DA65E376-3D35-4D96-913A-7197FCA6DF48} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} + {9E070488-15DE-418A-8606-5B79056C6E9F} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} {8BEFD3AC-BB21-4B62-8D9A-CF8CBFD439EB} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} {15A06398-ECB6-49C9-ACB4-52A495A886A6} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} {F90B940C-9A83-496D-AAE0-11CD02CE0A22} = {7B7EC9A1-2091-4CCD-9F01-C579ABD9241D} @@ -6807,14 +6736,10 @@ Global {3862D89C-E32D-4182-BB58-38777D43EDD9} = {5DFED68B-2113-4E5A-98ED-9DC07D3D39C8} {0B205BE7-90CD-4C3A-8EBD-1E414E39528A} = {5DFED68B-2113-4E5A-98ED-9DC07D3D39C8} {6746517C-BE89-4637-A283-0A932A50497A} = {696A94BE-7237-4AE2-9E36-6059DE519971} - {9D4082BA-B62A-4AB5-A89D-21404A598693} = {696A94BE-7237-4AE2-9E36-6059DE519971} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164} EndGlobalSection - GlobalSection(SharedMSBuildProjectFiles) = preSolution - Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4 - EndGlobalSection GlobalSection(Performance) = preSolution HasPerformanceSessions = true EndGlobalSection diff --git a/Common/CommonConsole/CommonConsole.csproj b/Common/CommonConsole/CommonConsole.csproj index 2d2e99d3..37154e77 100644 --- a/Common/CommonConsole/CommonConsole.csproj +++ b/Common/CommonConsole/CommonConsole.csproj @@ -44,7 +44,6 @@ - @@ -55,6 +54,10 @@ {4e8bb839-d40a-488c-88ce-f21811f1f476} Common.Hardware.WaterMeter.eRegister + + {F90B940C-9A83-496D-AAE0-11CD02CE0A22} + LaaPackages.SqlClient + \ No newline at end of file diff --git a/Common/CommonConsole/PAM03.cs b/Common/CommonConsole/PAM03.cs deleted file mode 100644 index 215a6f22..00000000 --- a/Common/CommonConsole/PAM03.cs +++ /dev/null @@ -1,201 +0,0 @@ -namespace CommonConsole -{ - using Common.Hardware.SIRT; - using Common.Hardware.SIRT.Parameters; - using Common.Hardware.SIRT.Tasks; - using Common.Hardware.WaterMeter.eRegister; - using Common.Hardware.WaterMeter.eRegister.Features; - - using System; - using System.IO.Ports; - using System.Linq; - using System.Text.RegularExpressions; - using System.Threading; - - public class PAM03 - { - private string portName; - private uint address; - private byte[] key; - - public int Run(params string[] args) - { - /// - /// Process.ExitCode: - /// 0 - OK - /// 1 - Execution Error - /// 2 - Connection Error - /// 3 - Invalid Arguments - /// - var exitCode = this.ParseArguments(args); - - if (exitCode == 0) - { - var processAwaiter = new ManualResetEventSlim(); - var sirtBroadcaster = new SIRTBroadcaster(this.portName); - var pinI = new ProvidePin { AuthLevel = AuthLevel.I }; - - void SIRTBroadcaster_Connected(SIRTBroadcaster sirt) - { - var task = new CordonelTask(sirt.Frequency) - { - DelPamSemi = true, - WakeUpCmd = true, - WakeUpModul = true, - RequestAddress = address, - EncryptionKey = key, - IsEncrypted = true - }; - - task.SetPending(); - sirt.Start(task); - task.Wait(); - - void ResetAlarms(byte alarmMask) - { - if (exitCode != 0) - { - return; - } - - task.WakeUpCmd = false; - task.WakeUpModul = false; - task.Data = new ResetAlarms(alarmMask).Append(pinI); - task.SetPending(); - sirt.Start(task); - task.Wait(); - - if (task.State != SIRTTaskState.Completed) - { - Console.WriteLine($"{nameof(SIRTTaskState)}.{task.State}"); - - exitCode = 1; - } - - exitCode = 0; - } - - task.SetPending(); - sirt.Start(task); - task.Wait(); - - if (task.State != SIRTTaskState.Completed) - { - exitCode = 1; - } - - ResetAlarms(new AlarmsMask(0xFF) - { - MediumAbsent = false - }); - ResetAlarms(0xFE); - processAwaiter.Set(); - } - - void SIRTBroadcaster_Disconnected(SIRTBroadcaster _) - => processAwaiter.Set(); - - sirtBroadcaster.Connected += SIRTBroadcaster_Connected; - sirtBroadcaster.Disconnected += SIRTBroadcaster_Disconnected; - - sirtBroadcaster.Open(); - processAwaiter.Wait(); - sirtBroadcaster.Close(); - - sirtBroadcaster.Disconnected -= SIRTBroadcaster_Disconnected; - sirtBroadcaster.Connected -= SIRTBroadcaster_Connected; - } - - return exitCode; - } - - public int ParseArguments(string[] args) - { - if (args.Length != 3) - { - Console.WriteLine($"Falsche anzahl an parameter: '{string.Join("', '", args)}'"); - Console.WriteLine($"Expected: [COM..n as string] [Address as uint] [EncryptionKey as string]"); - - return 3; - } - - this.portName = args[0]; - - if (Regex.IsMatch($"{this.portName}", "[Cc][Oo][Mm][0-9]+")) - { - this.portName = this.portName.ToUpper(); - } - else if (SerialPort.GetPortNames().Any(x => x.Equals(this.portName, StringComparison.CurrentCultureIgnoreCase))) - { - Console.WriteLine($"COM Port: '{this.portName}' - nicht vorhanden"); - - return 3; - } - else - { - Console.WriteLine($"Falsche COM PortName: '{this.portName}' - erwartet: [Cc][Oo][Mm][0-9]+"); - - return 3; - } - - if (!uint.TryParse($"{args[1]}", out this.address)) - { - Console.WriteLine($"Ungültige Funkadresse: '{args[1]}'"); - - return 3; - } - - this.key = $"{args[2]}".GetBytes(); - - if (this.key.Length != 16) - { - Console.WriteLine($"Ungültige Funkschlüssel: '{BitConverter.ToString(this.key)}'"); - - return 3; - } - - return 0; - } - - public class CordonelTask : EregisterTask - { - public CordonelTask(int frequency) : base(frequency) - { - } - - public override Byte[] Start() - { - Console.WriteLine($"TX|{BitConverter.ToString(this.request)}"); - - return base.Start(); - } - - public override void Receive(SIRTMessage response) - { - base.Receive(response); - - Console.WriteLine($"RX|{BitConverter.ToString(response)}"); - - try - { - if (this.SEMIMessage != null) - { - Console.WriteLine($"========================================="); - Console.WriteLine($"AlarmsMask"); - Console.WriteLine($"-----------------------------------------"); - Console.WriteLine($"{new AlarmsMask(response.Payload[10])}"); - Console.WriteLine($"========================================="); - Console.WriteLine($"RSSI.PAM {response.P2}"); - Console.WriteLine($"RSSI.SEMI {response.Payload[12]}"); - Console.WriteLine($"PAMStatus {new PAMStatus(response.Payload[11])}"); - Console.WriteLine($"========================================="); - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - } - } - } - } -} diff --git a/Common/CommonConsole/Program.cs b/Common/CommonConsole/Program.cs index d0cbeb2a..4c06270c 100644 --- a/Common/CommonConsole/Program.cs +++ b/Common/CommonConsole/Program.cs @@ -1,11 +1,36 @@ namespace CommonConsole { using System; - using System.Collections; - public static class Program + public static partial class Program { static void Main() + { + + } + + + + + + + + + + + + + + + + + + + + + + + static void Main_ProgrammingParameters_Cordonel() { var alarmMask = 0 << AlarmMask.ALARM_REBOOT | 1 << AlarmMask.ALARM_LOW_BATTERY @@ -19,7 +44,7 @@ | 0 << AlarmMask.ALARM_LOW_PRESSURE | 0 << AlarmMask.ALARM_HIGH_PRESSURE | 0 << AlarmMask.ALARM_LOW_TEMPERATURE - | 1 << AlarmMask.ALARM_HIGH_TEMPERATURE + | 0 << AlarmMask.ALARM_HIGH_TEMPERATURE | 0 << AlarmMask.ALARM_RADIO_ERROR | 0 << AlarmMask.ALARM_METROLOGY_PARAMS | 0 << AlarmMask.ALARM_METROLOGY_MEASURE @@ -28,9 +53,11 @@ Array.Reverse(alarmBytes); Console.WriteLine($"{"ALARMS:",11} {alarmMask,11} - {BitConverter.ToString(alarmBytes).Replace("-", "")}"); - uint content = (uint)1 << LogContentBits.AlarmStatus // ALWAYS ON - | (uint)1 << LogContentBits.BillingCounter // ALWAYS ON - | (uint)0 << LogContentBits.ReverseCounter // + + + uint content = // (uint)1 << LogContentBits.AlarmStatus // ALWAYS ON + //| (uint)1 << LogContentBits.BillingCounter // ALWAYS ON + (uint)0 << LogContentBits.ReverseCounter // | (uint)0 << LogContentBits.MaxFlow // | (uint)0 << LogContentBits.MaxFlowTime // | (uint)0 << LogContentBits.PeakFlow // @@ -41,9 +68,9 @@ | (uint)0 << LogContentBits.MinFlow // | (uint)0 << LogContentBits.MinFlowTime // | (uint)0 << LogContentBits.ForwardCounter // - | (uint)1 << LogContentBits._UTC32 // ALWAYS ON - | (uint)0 << LogContentBits._MaskSelector_1_1 // - | (uint)0 << LogContentBits._MaskSelector_1_2 // + | (uint)0 << LogContentBits._UTC32 // ALWAYS ON + //| (uint)0 << LogContentBits._MaskSelector_1_1 // + //| (uint)0 << LogContentBits._MaskSelector_1_2 // | (uint)0 << LogContentBits.MinPress // | (uint)0 << LogContentBits.MinPressTime // | (uint)0 << LogContentBits.MaxPress // @@ -53,17 +80,17 @@ | (uint)0 << LogContentBits.MaxTemp // | (uint)0 << LogContentBits.MaxTempTime // | (uint)0 << LogContentBits.CurrentPress // - | (uint)0 << LogContentBits.CurrentTemp // - | (uint)1 << LogContentBits.ExtendedAlarm // ALWAYS ON - | (uint)1 << LogContentBits._RecordCheckSum; // ALWAYS ON - er - 10319033731 + | (uint)0 << LogContentBits.CurrentTemp; // + //| (uint)1 << LogContentBits.ExtendedAlarm // ALWAYS ON + //| (uint)1 << LogContentBits._RecordCheckSum; // ALWAYS ON var contentBytes = BitConverter.GetBytes(content); Array.Reverse(contentBytes); Console.WriteLine($"{"DATALOGGER:",11} {content,11} - {BitConverter.ToString(contentBytes).Replace("-", "")}"); - uint fdr = (uint)1 << LogContentBits.AlarmStatus // ALWAYS ON - | (uint)1 << LogContentBits.BillingCounter // ALWAYS ON - | (uint)0 << LogContentBits.ReverseCounter // + uint fdr = // (uint)1 << LogContentBits.AlarmStatus // ALWAYS ON + //| (uint)1 << LogContentBits.BillingCounter // ALWAYS ON + (uint)0 << LogContentBits.ReverseCounter // | (uint)0 << LogContentBits.MaxFlow // | (uint)0 << LogContentBits.MaxFlowTime // | (uint)0 << LogContentBits.PeakFlow // @@ -71,12 +98,12 @@ | (uint)0 << LogContentBits.AvgFlow // | (uint)0 << LogContentBits.BrokenPipe // | (uint)0 << LogContentBits.BrokenPipeTime // - | (uint)1 << LogContentBits.MinFlow // + | (uint)0 << LogContentBits.MinFlow // | (uint)0 << LogContentBits.MinFlowTime // | (uint)0 << LogContentBits.ForwardCounter // - | (uint)1 << LogContentBits._UTC32 // ALWAYS ON - | (uint)0 << LogContentBits._MaskSelector_1_1 // - | (uint)0 << LogContentBits._MaskSelector_1_2 // + | (uint)0 << LogContentBits._UTC32 // ALWAYS ON + //| (uint)0 << LogContentBits._MaskSelector_1_1 // + //| (uint)0 << LogContentBits._MaskSelector_1_2 // | (uint)0 << LogContentBits.MinPress // | (uint)0 << LogContentBits.MinPressTime // | (uint)0 << LogContentBits.MaxPress // @@ -86,9 +113,9 @@ | (uint)0 << LogContentBits.MaxTemp // | (uint)0 << LogContentBits.MaxTempTime // | (uint)0 << LogContentBits.CurrentPress // - | (uint)0 << LogContentBits.CurrentTemp // - | (uint)1 << LogContentBits.ExtendedAlarm // ALWAYS ON - | (uint)1 << LogContentBits._RecordCheckSum; // ALWAYS ON + | (uint)0 << LogContentBits.CurrentTemp; // + //| (uint)1 << LogContentBits.ExtendedAlarm // ALWAYS ON + //| (uint)1 << LogContentBits._RecordCheckSum; // ALWAYS ON var fdrBytes = BitConverter.GetBytes(fdr); Array.Reverse(fdrBytes); @@ -96,14 +123,14 @@ Console.WriteLine(); - uint min = 201344787; - uint def = 206906379; - uint max = 4294967295; + //uint min = 201344787; + //uint def = 206906379; + //uint max = 4294967295; - for (byte i = 0; i < LogContentBits.BitMask.Length; i++) - { - Console.WriteLine($"Min: {(min >> i) % 2} - Def: {(def >> i) % 2} - Max: {(max >> i) % 2} - {LogContentBits.BitMask[i]}"); - } + //for (byte i = 0; i < LogContentBits.BitMask.Length; i++) + //{ + // Console.WriteLine($"Min: {(min >> i) % 2} - Def: {(def >> i) % 2} - Max: {(max >> i) % 2} - {LogContentBits.BitMask[i]}"); + //} } // CONTENT: 67110031 - 04-00-04-8F => 0400048F <-> 8F040004 04000C03 diff --git a/Common/CommonCore.Configuration/ServiceUrlsBackUp_New.cs b/Common/CommonCore.Configuration/ServiceUrlsBackUp_New.cs index d726eca2..3ca26f06 100644 --- a/Common/CommonCore.Configuration/ServiceUrlsBackUp_New.cs +++ b/Common/CommonCore.Configuration/ServiceUrlsBackUp_New.cs @@ -9,18 +9,20 @@ namespace Xylem.Common.CommonCore.Configuration /// public static class ServiceUrls { -//#if URI_OLD_DNS // this is defined in build configuration 'VPN_Debug' as the new DNS cannot be reached via VPN -// private const String ServerDns = "http://sla12iis01.emea.sensus.net"; -//#else + //#if URI_OLD_DNS // this is defined in build configuration 'VPN_Debug' as the new DNS cannot be reached via VPN + // private const String ServerDns = "http://sla12iis01.emea.sensus.net"; + // private const String ProductionUiServerDns = "http://sla12iis01.emea.sensus.net"; + //#else private const String ServerDns = "http://delaz1web01.world.fluidtechnology.net"; -//#endif + private const String ProductionUiServerDns = "http://delaz1web01.world.fluidtechnology.net/LaaProductionWeb"; + //#endif private static readonly String DefaultInspectCordonelRequirementInfoUrl = - $"http://sla12iis01.emea.sensus.net/LaaProductionWeb/"; + $"{ProductionUiServerDns}/"; // return code: 404 not found, 400 Error with text, 200 okay private static readonly String DefaultEolDataForSentinelServiceUrl = - $"http://sla12iis01.emea.sensus.net/LaaProductionWeb/api/cordonel/eolprogress/"; + $"{ProductionUiServerDns}/api/cordonel/eolprogress/"; private static readonly String DefaultGetPcbIdsFromSafeServiceUrl = $"{ServerDns}/MeterProcessState/GetPcbIdsFromSafe?ContainerDbId="; @@ -62,7 +64,7 @@ namespace Xylem.Common.CommonCore.Configuration $"{ServerDns}/MeterProcessState/api/ProccesState/SetCordonelProgress?PcbId="; private static readonly String DefaultGetCordonelRequirementInfoUrl = - "http://sla12iis01.emea.sensus.net/LaaProductionWeb/api/cordonel/requirements/pcbid/"; + $"{ProductionUiServerDns}/api/cordonel/requirements/pcbid/"; private static readonly String DefaultGetCordonelAppVersionServiceUrl = $"{ServerDns}/MeterProcessState/api/ProccesState/GetCordonelAppVersion?PcbId="; @@ -188,7 +190,7 @@ namespace Xylem.Common.CommonCore.Configuration $"{ServerDns}/MeterProcessState/api/FileUpToDate/GetCordonelFw"; private static readonly String DefaultDbDataAtEolServiceUrl = - $"http://sla12iis01.emea.sensus.net/MeterProcessState/api/fwupdate/databaseateol/"; + $"{ServerDns}/MeterProcessState/api/fwupdate/databaseateol/"; public static readonly String PressureSensorTestURL_GetTestSpec = $"{ServerDns}/MeterProcessState/api/CordonelPressureSensorTest/GetTestSpec"; @@ -196,6 +198,11 @@ namespace Xylem.Common.CommonCore.Configuration public static readonly String PressureSensorTestURL_PostTestResults = $"{ServerDns}/MeterProcessState/api/CordonelPressureSensorTest/PostTestResults"; + + public static readonly String PickingURL_GetPcbInfoPicking + = $"{ServerDns}/MeterProcessState/api/LuController/GetPcbInfoPicking?PcbId="; + + /// /// usage: string.Format(CordonelPressureSensorTestURL_GetTestResults, pcbId); /// @@ -206,7 +213,7 @@ namespace Xylem.Common.CommonCore.Configuration #if DEBUG == false // when false uses always the production url. = "http://localhost:52822"; #else - = "http://sla12iis01.emea.sensus.net"; + = "http://delaz1web01.world.fluidtechnology.net/"; #endif @@ -473,7 +480,7 @@ namespace Xylem.Common.CommonCore.Configuration /// public static String GetCordonelRequirementByFANrInfoServiceUrl(String ponr) { - return $"http://sla12iis01.emea.sensus.net/LaaProductionWeb/api/cordonel/requirements/pono/{ponr}"; + return $"{ProductionUiServerDns}/api/cordonel/requirements/pono/{ponr}"; } /// @@ -486,7 +493,7 @@ namespace Xylem.Common.CommonCore.Configuration /// public static String GetCordonelRequirementByMeterSizeInfoServiceUrl(Int32 size) { - return $"http://sla12iis01.emea.sensus.net/LaaProductionWeb/api/cordonel/requirements/isize/{size}"; + return $"{ProductionUiServerDns}/api/cordonel/requirements/isize/{size}"; } /// diff --git a/Common/CordoPlot/App.xaml b/Common/CordoPlot/App.xaml index 60149e7c..6b991c7c 100644 --- a/Common/CordoPlot/App.xaml +++ b/Common/CordoPlot/App.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:CordoPlot" - StartupUri="MainWindow.xaml"> + StartupUri="StartDialog.xaml"> diff --git a/Common/CordoPlot/CordoPlot.csproj b/Common/CordoPlot/CordoPlot.csproj index 41b51618..3423efe9 100644 --- a/Common/CordoPlot/CordoPlot.csproj +++ b/Common/CordoPlot/CordoPlot.csproj @@ -116,6 +116,13 @@ MSBuild:Compile Designer + + StartDialog.xaml + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -124,10 +131,17 @@ App.xaml Code + + GridCopy.xaml + MainWindow.xaml Code + + Designer + MSBuild:Compile + diff --git a/Common/CordoPlot/GridCopy.xaml b/Common/CordoPlot/GridCopy.xaml new file mode 100644 index 00000000..6edf3c56 --- /dev/null +++ b/Common/CordoPlot/GridCopy.xaml @@ -0,0 +1,13 @@ + + + + + diff --git a/Common/CordoPlot/GridCopy.xaml.cs b/Common/CordoPlot/GridCopy.xaml.cs new file mode 100644 index 00000000..9c27e6cd --- /dev/null +++ b/Common/CordoPlot/GridCopy.xaml.cs @@ -0,0 +1,40 @@ +using ScottPlot.WPF; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace CordoPlot +{ + /// + /// Interaktionslogik für GridCopy.xaml + /// + public partial class GridCopy : Window + { + public GridCopy() + { + InitializeComponent(); + } + + public WpfPlot Chart { get; internal set; } + + public void ShowChart(List lastListOfIndex, List lastListOfValues,string title) + { + WpfPlot1.Plot.Add.Scatter(lastListOfIndex.ToArray(), lastListOfValues.ToArray(), ScottPlot.Colors.Blue); + WpfPlot1.Plot.Title(title); + WpfPlot1.Plot.Axes.AutoScale(); + WpfPlot1.Refresh(); + + + } + } +} diff --git a/Common/CordoPlot/MainWindow.xaml b/Common/CordoPlot/MainWindow.xaml index ca4a9b4a..3d798e67 100644 --- a/Common/CordoPlot/MainWindow.xaml +++ b/Common/CordoPlot/MainWindow.xaml @@ -6,13 +6,14 @@ xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF" xmlns:local="clr-namespace:CordoPlot" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> + Title="MainWindow" Height="1000" Width="1000"> - - - - + + + + + @@ -24,15 +25,15 @@ - - - - - - + - + + + + + + @@ -42,53 +43,57 @@ - - - - - - - - - - - - + + + - Serialnr - TestRunNr - TestBenchNr - Date - MeterSize - AirTempC - AirPressure - AirHumanity - WaterTempC - TotalMeters - Remark - - - - - - - - - - - - - - + x:Name="dataGridInfo" + Grid.Row="1" + Grid.Column="1" Grid.ColumnSpan="2" ItemsSource="{Binding}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/Common/CordonelAssemblyLine/Resources/sensus.png b/Common/CordonelAssemblyLine/Resources/sensus.png new file mode 100644 index 00000000..3e9d6ed4 Binary files /dev/null and b/Common/CordonelAssemblyLine/Resources/sensus.png differ diff --git a/Common/CordonelAssemblyLine/sensus.ico b/Common/CordonelAssemblyLine/sensus.ico new file mode 100644 index 00000000..fd3c4f71 Binary files /dev/null and b/Common/CordonelAssemblyLine/sensus.ico differ diff --git a/Common/CordonelPreadjustmentUi/CordonelPreadjustmentUi.csproj b/Common/CordonelPreadjustmentUi/CordonelPreadjustmentUi.csproj index 39e39463..565bf67d 100644 --- a/Common/CordonelPreadjustmentUi/CordonelPreadjustmentUi.csproj +++ b/Common/CordonelPreadjustmentUi/CordonelPreadjustmentUi.csproj @@ -5,7 +5,7 @@ Debug AnyCPU {D0C8D887-ED52-40AB-A069-90BCE0E801E2} - WinExe + Library Properties Xylem.Common.Ui.CordonelPreadjustmentUi Xylem.Common.Ui.CordonelPreadjustmentUi @@ -149,6 +149,7 @@ prompt MinimumRecommendedRules.ruleset + ..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/Common/CordonelPreadjustmentUi/Parameters/FlushParams.cs b/Common/CordonelPreadjustmentUi/Parameters/FlushParams.cs index 8f8a1ae1..d902cc61 100644 --- a/Common/CordonelPreadjustmentUi/Parameters/FlushParams.cs +++ b/Common/CordonelPreadjustmentUi/Parameters/FlushParams.cs @@ -32,11 +32,12 @@ namespace Xylem.Common.Ui.CordonelPreadjustmentUi.Parameters DurationS = 120; break; case MeterSize.DN100: + case MeterSize.DN125: case MeterSize.US4: FlowrateQmH = 140; DurationS = 120; break; - case MeterSize.DN125: + case MeterSize.US6: FlowrateQmH = 400; DurationS = 60; diff --git a/Common/CordonelPreadjustmentUi/Processes/Actions/LoginProcess.cs b/Common/CordonelPreadjustmentUi/Processes/Actions/LoginProcess.cs index 7fc5dcd2..8516bc80 100644 --- a/Common/CordonelPreadjustmentUi/Processes/Actions/LoginProcess.cs +++ b/Common/CordonelPreadjustmentUi/Processes/Actions/LoginProcess.cs @@ -14,11 +14,11 @@ using static CordonelPreadjustmentUi.PreAdjustmentControl; namespace CordonelPreadjustmentUi.Processes.Actions { - public class OfflinePaswordItem + public class TempFlanschPaswordItem { - public OfflinePaswordItem() + public TempFlanschPaswordItem() { } - public OfflinePaswordItem(String pcbID, String password) + public TempFlanschPaswordItem(String pcbID, String password) { PcbID = pcbID; Password = password; @@ -29,7 +29,7 @@ namespace CordonelPreadjustmentUi.Processes.Actions public String Password { get; set; } - public int? Slot { get; set; } + public int Slot { get; set; } } public class LoginProcess : BaseProcess @@ -60,11 +60,11 @@ namespace CordonelPreadjustmentUi.Processes.Actions if (pp.Setting.GetTempUseTempFlansh()) { - String CurrentConfigDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ProgramConfig.GenesisBaseFolder, ProgramConfig.OfflineInfoFile); + String CurrentConfigDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ProgramConfig.GenesisBaseFolder, "TempFlansch.json"); if (File.Exists(CurrentConfigDir)) { - var listOfOfflinePasswords = JsonConvert.DeserializeObject>( + var listOfOfflinePasswords = JsonConvert.DeserializeObject>( File.ReadAllText(CurrentConfigDir)); if (listOfOfflinePasswords != null) { diff --git a/Common/Hardware/Common.Hardware.SIRT/Parameters/PAMStatus.cs b/Common/Hardware/Common.Hardware.SIRT/Parameters/PAMStatus.cs index 7afeecea..79bf2298 100644 --- a/Common/Hardware/Common.Hardware.SIRT/Parameters/PAMStatus.cs +++ b/Common/Hardware/Common.Hardware.SIRT/Parameters/PAMStatus.cs @@ -7,7 +7,10 @@ namespace Common.Hardware.SIRT.Parameters private readonly byte[] bits; public PAMStatus(byte _byte) - => this.bits = _byte.GetBits(); + { + this.IsValid = _byte <= 31; + this.bits = _byte.GetBits(); + } public bool CMD_UNKNOWN => this.bits[0] == 1; @@ -19,6 +22,8 @@ namespace Common.Hardware.SIRT.Parameters public bool OUT_OF_RANGE => this.bits[4] == 1; + public bool IsValid { get; } + public override string ToString() { if (this.bits.GetByte() == 0) diff --git a/Common/Hardware/Common.Hardware.SIRT/SIRTExtensions.cs b/Common/Hardware/Common.Hardware.SIRT/SIRTExtensions.cs index 996bf806..9a81998c 100644 --- a/Common/Hardware/Common.Hardware.SIRT/SIRTExtensions.cs +++ b/Common/Hardware/Common.Hardware.SIRT/SIRTExtensions.cs @@ -229,6 +229,11 @@ public static ushort CRCCCITT(this byte[] bytes, int start = 0, int length = 0) { + if (bytes.Length <= 0) + { + return default(ushort); + } + if (length == 0) { length = bytes.Length; diff --git a/Common/Hardware/Common.Hardware.SIRT/SIRTHub.cs b/Common/Hardware/Common.Hardware.SIRT/SIRTHub.cs index 37dada32..bd191b39 100644 --- a/Common/Hardware/Common.Hardware.SIRT/SIRTHub.cs +++ b/Common/Hardware/Common.Hardware.SIRT/SIRTHub.cs @@ -138,23 +138,6 @@ return broadcaster.IsOpen; } - public static void OnMessageReceived(Action messageReceivedDelegate) - { - if (messageReceivedDelegate != null) - { - messageReceiveDelegates.Add(messageReceivedDelegate); - - foreach (var broadcaster in broadcasters.Values.ToArray()) - { - foreach (var @delegate in messageReceiveDelegates) - { - broadcaster.MessageReceived -= @delegate; - broadcaster.MessageReceived += @delegate; - } - } - } - } - private void LogMessage(object message) => SIRTLogger.LogMessage($"{nameof(SIRTHub)}|{message}"); } diff --git a/Common/Hardware/Common.Hardware.SIRT/SIRTMessage.cs b/Common/Hardware/Common.Hardware.SIRT/SIRTMessage.cs index 7c164f02..cead4f1c 100644 --- a/Common/Hardware/Common.Hardware.SIRT/SIRTMessage.cs +++ b/Common/Hardware/Common.Hardware.SIRT/SIRTMessage.cs @@ -7,15 +7,31 @@ public class SIRTMessage { private byte[] bytes; + private bool buildCRC; public SIRTMessage() { this.bytes = new byte[MIN_LEN]; this.bytes[0] = PC_SIRT; + this.buildCRC = true; } - public SIRTMessage(byte[] bytes) - => this.bytes = bytes; + public SIRTMessage(byte[] bytes) + { + if (bytes is null) + { + bytes = Array.Empty(); + } + + var length = Math.Max(MIN_LEN, bytes.Length); + + this.bytes = new byte[length]; + + if (bytes.Length > 0) + { + Array.Copy(bytes, 0, this.bytes, 0, bytes.Length); + } + } public byte Direction { @@ -96,7 +112,11 @@ public byte[] GetBytes() { - this.Crc = this.bytes.CRCCCITT(1, this.bytes.Length - 3); + if (this.buildCRC) + { + this.Crc = this.bytes.CRCCCITT(1, this.bytes.Length - 3); + } + this.End = MSG_END; return this.bytes; diff --git a/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs b/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs index 4dd3deae..37e8d0d5 100644 --- a/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs +++ b/Common/Hardware/Common.Hardware.SIRT/Tasks/WritePamTask.cs @@ -3,6 +3,7 @@ using Common.Hardware.SIRT.Parameters; using System; + using System.Collections.Generic; public class WritePamTask : SIRTTask { @@ -29,6 +30,9 @@ this.SEMIReceived += this.OnSEMIReceived; this.UnknownReceived += this.OnUnknownReceived; this.RequireLAT = true; + this.PamStatusIX = 11; + this.DebugLength = 52; + this.SemiLength = 91; } public event Action MessageSent; @@ -40,7 +44,18 @@ public bool IsEncrypted { get; set; } - public byte[] EncryptionKey { get; set; } + public byte[] EncryptionKeyI { get; set; } + + private byte[] encryptionKeyII; + public byte[] EncryptionKeyII + { + get => this.encryptionKeyII; + set + { + this.encryptionKeyII = value; + this.IsEncrypted = true; + } + } public bool WakeUpModul { @@ -90,24 +105,33 @@ set => this.request.Payload = value; } + public byte DebugLength { get; set; } + + public byte SemiLength { get; set; } + + public byte PamStatusIX { get; set; } + public bool AnyTelegramReceived { get; set; } + public Queue MessageQueue { get; set; } = new Queue(); + public override void Receive(SIRTMessage response) { - if (response.Command == SIRTConstants.ACKN_ANSW) + if (this.UseEncryption(response)) { this.DecriptResponse(response); + } + + this.MessageQueue.Enqueue(response); + + if (response.Command == SIRTConstants.ACKN_ANSW) + { this.AKNReceived?.Invoke(response); } else if (response.Command == SIRTConstants.FROM_AIR) { var payload = response?.Payload; - if (this.UseEncryption(response)) - { - this.DecriptResponse(response); - } - if (payload != null && payload.Length > 0) { var type = payload[0]; @@ -156,6 +180,8 @@ { this.latReceived = false; this.debugReceived = false; + + var payload = this.EncryptRequest(); var message = new SIRTMessage { Direction = this.request.Direction, @@ -163,7 +189,7 @@ P1 = this.request.P1, P2 = this.request.P2, Address = this.request.Address, - Payload = this.EncryptRequest(), + Payload = payload, Frequency = this.Frequency, SirtId = this.SirtId, }; @@ -206,7 +232,7 @@ protected virtual void OnSEMIReceived(SIRTMessage semi) { - if ((this.RequireLAT && !this.latReceived) || (this.RequireDEBUG && !this.debugReceived)) + if ((this.RequireLAT && !this.latReceived) || (this.RequireDEBUG && !this.debugReceived) || semi.Payload[this.PamStatusIX] != 0) { this.SetPending(); } @@ -223,7 +249,7 @@ protected virtual bool UseEncryption(SIRTMessage response) { - if (response is null) + if (response is null || this.EncryptionKeyI is null) { return false; } @@ -235,14 +261,24 @@ return false; } - var payloadLength = payload.Length; + var length = payload.Length; - if (payloadLength == 0) + if (length <= 0) { - return false; + this.IsEncrypted = false; + } + else if (length >= this.SemiLength) + { + this.IsEncrypted = length > this.SemiLength; + } + else if (length >= this.DebugLength) + { + this.IsEncrypted = length > this.DebugLength; + } + else + { + this.IsEncrypted = payload.GetCrc() != 0; } - - this.IsEncrypted = payload.GetCrc() != 0; return this.IsEncrypted; } @@ -259,7 +295,7 @@ if (this.IsEncrypted) { - payload = payload.EncryptRequest(this.EncryptionKey, this.RequestAddress); + payload = payload.EncryptRequest(this.EncryptionKeyI, this.RequestAddress); } } @@ -268,9 +304,43 @@ private void DecriptResponse(SIRTMessage response) { - this.IsEncrypted = true; + var payloadLength = response.Length; - response.Payload = response.Payload.DecryptResponse(this.EncryptionKey); + if (payloadLength <= 0) + { + return; + } + + var payload = new byte[payloadLength]; + Array.Copy(response.Payload, 0, payload, 0, payloadLength); + + if (this.IsEncrypted) + { + response.Payload = payload.DecryptResponse(this.EncryptionKeyI); + + // Check if SEMI received + if (payloadLength > this.SemiLength) + { + var pamStatus = new PAMStatus(response.Payload[this.PamStatusIX]); + + // when pam status > 31 - try decrypt with the other key + if (!pamStatus.IsValid && this.EncryptionKeyII != null) + { + var _payload = payload.DecryptResponse(this.EncryptionKeyII); + pamStatus = new PAMStatus(_payload[this.PamStatusIX]); + + // when pam status OK then switch the keys + if (pamStatus == PAMStatus.OK) + { + response.Payload = _payload; + + var _encryptionKey = this.EncryptionKeyI; + this.EncryptionKeyI = this.encryptionKeyII; + this.encryptionKeyII = _encryptionKey; + } + } + } + } } private void SetP811(Action p811Setter) diff --git a/Common/Hardware/PLC/Siemens/Stack/Core/Schema/SecuredApplicationHelpers.cs b/Common/Hardware/PLC/Siemens/Stack/Core/Schema/SecuredApplicationHelpers.cs index 9c441b23..cc5f1a7b 100644 --- a/Common/Hardware/PLC/Siemens/Stack/Core/Schema/SecuredApplicationHelpers.cs +++ b/Common/Hardware/PLC/Siemens/Stack/Core/Schema/SecuredApplicationHelpers.cs @@ -452,7 +452,7 @@ namespace Opc.Ua.Security public System.Security.Cryptography.X509Certificates.X509Certificate2 Find(bool needPrivateKey) { Opc.Ua.CertificateIdentifier output = SecuredApplication.FromCertificateIdentifier(this); - return output.Find(needPrivateKey); + return output.Find(false); } /// diff --git a/Common/Hardware/PLC/Siemens/Stack/Core/Security/Certificates/CertificateFactory.cs b/Common/Hardware/PLC/Siemens/Stack/Core/Security/Certificates/CertificateFactory.cs index 08c431ba..004f8e95 100644 --- a/Common/Hardware/PLC/Siemens/Stack/Core/Security/Certificates/CertificateFactory.cs +++ b/Common/Hardware/PLC/Siemens/Stack/Core/Security/Certificates/CertificateFactory.cs @@ -40,7 +40,7 @@ namespace Opc.Ua { if (useCache) { - return Load(new X509Certificate2(encodedData), false); + return Load(new X509Certificate2(encodedData), false, X509KeyStorageFlags.Exportable ); } return new X509Certificate2(encodedData); diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json b/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json index 35026198..66a2b2a2 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/configuration.json @@ -12087,7 +12087,7 @@ "responsible": [ "roland.drabesch@xylem.com" ], - "remarks": "Display should be sealed at end of manufacture (EMEA only). 251210 FieldTool modification enabled: The guidance was that CustTool is allowed to change legally relevant configuration in the field. So we do not require all legally relevant registers to be in the blacklist. This is because the restriction on changing legally relevant configuration in the field is only applied to customer-facing tools. CustTool is considered an internal ‘repair tool’ that must be allowed to make such repairs to legally relevant configuration in the field.", + "remarks": "Display should be sealed at end of manufacture (EMEA only). 251210 FieldTool modification enabled: The guidance was that CustTool is allowed to change legally relevant configuration in the field. So we do not require all legally relevant registers to be in the blacklist. This is because the restriction on changing legally relevant configuration in the field is only applied to customer-facing tools. CustTool is considered an internal �repair tool� that must be allowed to make such repairs to legally relevant configuration in the field.", "region": { "emea": { "values": { diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs index b1f95bc2..3e0e75d0 100644 --- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs +++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Eregister.cs @@ -16,7 +16,9 @@ public class Eregister { - private readonly ConcurrentQueue runningTasks; + const string SENSUS_STANDARD = "E6C88800DEB868C0D6A84880CE982840"; + + private readonly ICollection runningTasks; private readonly EregisterProgrammingParameters parameters; private readonly EregisterHistory history; private readonly EregisterState state; @@ -34,23 +36,19 @@ this.sirtHub = sirtHub; this.state = new EregisterState(); this.history = new EregisterHistory(); - this.runningTasks = new ConcurrentQueue(); + this.runningTasks = new List(); } - public void Clear() - { - // Just clear the queue - while (this.runningTasks.TryDequeue(out var _)) ; - } + public void Clear() => this.runningTasks.Clear(); internal IEnumerable LoadInspectionInitializationTasks() { this.executionType = nameof(LoadInspectionInitializationTasks); - if (this.parameters.Completed) - { - return new EregisterTask[] { }; - } + //if (this.parameters.Completed) + //{ + // return new EregisterTask[] { }; + //} var features = this.parameters.LoadInspectionInitializationFeatures(); @@ -60,14 +58,15 @@ if (this.runningTasks.Any()) { - this.runningTasks.Enqueue(new EregisterChangeMeterTypeTask(features.Frequency) + this.runningTasks.Add(new EregisterChangeMeterTypeTask(features.Frequency) { SlotNr = features.SlotNr, PoNr = features.PoNr, SerialNr = features.SerialNr, RequestAddress = features.RequestAddress, ResponseAddress = features.ResponseAddress, - EncryptionKey = features.EncryptionKey, + EncryptionKeyI = features.EncryptionKey, + EncryptionKeyII = SENSUS_STANDARD.GetEncryptionKey(), Name = "Change Meter Type" }); } @@ -87,7 +86,7 @@ if (this.parameters.StatusFertigung == 30) { - this.runningTasks.Enqueue(new EregisterCheckFinalizationTask(this.parameters, features.Frequency) + this.runningTasks.Add(new EregisterCheckFinalizationTask(this.parameters, features.Frequency) { WakeUpModul = true, SlotNr = features.SlotNr, @@ -95,10 +94,11 @@ SerialNr = features.SerialNr, RequestAddress = features.RequestAddress, ResponseAddress = features.ResponseAddress, - EncryptionKey = features.EncryptionKey, + EncryptionKeyI = features.EncryptionKey, + EncryptionKeyII = SENSUS_STANDARD.GetEncryptionKey(), }); - this.runningTasks.Enqueue(new EregisterTask(this.parameters.Frequency) + this.runningTasks.Add(new EregisterTask(this.parameters.Frequency) { Name = "0, 2, 16", SlotNr = features.SlotNr, @@ -106,7 +106,8 @@ SerialNr = features.SerialNr, RequestAddress = features.RequestAddress, ResponseAddress = features.ResponseAddress, - EncryptionKey = features.EncryptionKey, + EncryptionKeyI = features.EncryptionKey, + EncryptionKeyII = SENSUS_STANDARD.GetEncryptionKey(), Data = new ChangeWakeUp((WakeUpMode)this.parameters.Wake_Up_Interval) .Append(new ChangeNumberOfLatWindows(this.parameters.LAT_Interval)) .Append(new ChangeTransmissionInterval(this.parameters.Transmission_Intervall)) @@ -122,33 +123,31 @@ internal EregisterState GetState() => this.state; - internal void StartProgrammingAsync(CancellationToken cancellationToken) + internal void StartProgramming(CancellationToken cancellationToken) { this.history.SerienNr = this.parameters.SerienNr; this.history.Adresse = this.parameters.Adresse; this.history.TempAdresse = this.parameters.TempAdresse; - var stopProgramming = false; + var tasks = new ConcurrentQueue(this.runningTasks); var factoryState = FactoryState.Production; - var task = default(EregisterTask); var lat = default(LAT); var debug = default(DEBUG); var semi = default(SEMI); - while (this.runningTasks.TryPeek(out task) && task.State != SIRTTaskState.Cancelled && !cancellationToken.IsCancellationRequested) + while (!cancellationToken.IsCancellationRequested && tasks.TryDequeue(out var task)) { task.MessageReceived += this.history.Push; - while (task.State != SIRTTaskState.Completed && task.State != SIRTTaskState.Cancelled && !cancellationToken.IsCancellationRequested) + var next = 0; + + while (task.State != SIRTTaskState.Completed && task.State != SIRTTaskState.Cancelled && !cancellationToken.IsCancellationRequested && next < 30) { if (this.sirtHub.Start(task)) { this.history.Push(task); task.Wait(); - } - else - { - continue; + next++; } if (task.ErrorMessage != null) @@ -160,47 +159,32 @@ task.MessageReceived -= this.history.Push; - if (stopProgramming) + if (task.State != SIRTTaskState.Completed) { break; } this.UpdateTasksStateInTheQueue(task); - if (task.State == SIRTTaskState.Completed) + lat = task.LATMessage ?? lat; + debug = task.DEBUGMessage ?? debug; + semi = task.SEMIMessage ?? semi; + factoryState = task.FactoryState; + + if (task.DEBUGMessage != null) { - if (task.DEBUGMessage != null) - { - lat = task.LATMessage; - debug = task.DEBUGMessage; - semi = task.SEMIMessage; - factoryState = task.FactoryState; - this.state.SemiDebugDatum = DateTime.Now; - } - - if (task.RequestAddress == this.parameters.Adresse) - { - this.state.FunkadresseDatum = DateTime.Now; - } - - if (!this.runningTasks.TryDequeue(out task)) - { - stopProgramming = true; - - break; - } + this.state.SemiDebugDatum = DateTime.Now; } - else if (task.State == SIRTTaskState.Cancelled) + + if (task.RequestAddress == this.parameters.Adresse) { - stopProgramming = true; - - break; + this.state.FunkadresseDatum = DateTime.Now; } - } - if (stopProgramming) - { - return; + if (factoryState == FactoryState.Shipment) + { + this.state.GeschlossenDatum = DateTime.Now; + } } this.state.ShouldUpdate = true; @@ -211,13 +195,6 @@ this.state.SEMI = semi?.ToString()?.Replace('-', '\t'); this.state.Seriennummer = this.parameters.SerienNr; this.state.TempAdresse = this.parameters.TempAdresse; - - if (this.executionType == nameof(LoadInspectionFinalizationTasks) - && this.parameters.StatusFertigung == 30 - && factoryState == FactoryState.Shipment) - { - this.state.GeschlossenDatum = DateTime.Now; - } } private void UpdateTasksStateInTheQueue(EregisterTask task) @@ -241,6 +218,8 @@ eregisterTask.ResponseAddress = task.ResponseAddress; eregisterTask.FactoryState = task.FactoryState; eregisterTask.IsEncrypted = task.IsEncrypted; + eregisterTask.EncryptionKeyI = task.EncryptionKeyI; + eregisterTask.EncryptionKeyII = task.EncryptionKeyII; if (task.DEBUGMessage != null) { @@ -260,7 +239,7 @@ var frequency = this.parameters.Frequency; - this.runningTasks.Enqueue(new EregisterTask(frequency) + this.runningTasks.Add(new EregisterTask(frequency) { Name = "WUP", WakeUpCmd = true, @@ -270,33 +249,38 @@ SerialNr = features.SerialNr, RequestAddress = features.RequestAddress, ResponseAddress = features.ResponseAddress, - EncryptionKey = features.EncryptionKey, + EncryptionKeyI = features.EncryptionKey, + EncryptionKeyII = SENSUS_STANDARD.GetEncryptionKey(), Data = new ChangeWakeUp(WakeUpMode.StayAwake) .Append(new ChangeNumberOfLatWindows(this.parameters.LatWindowsInitialization)) .Append(new ChangeTransmissionInterval(this.parameters.TransmissionIntervalInitialization)) + // .Append(new ChangeSensusRFEncryptionKey(features.EncryptionKey)) .Append(new ProvidePin(AuthLevel.II)), + Timeout = 10_000 }); - this.runningTasks.Enqueue(new EregisterCheckInitializationTask(this.parameters, frequency) + this.runningTasks.Add(new EregisterCheckInitializationTask(this.parameters, frequency) { SlotNr = features.SlotNr, PoNr = features.PoNr, SerialNr = features.SerialNr, RequestAddress = features.RequestAddress, ResponseAddress = features.ResponseAddress, - EncryptionKey = features.EncryptionKey, + EncryptionKeyI = features.EncryptionKey, + EncryptionKeyII = SENSUS_STANDARD.GetEncryptionKey(), }); foreach (var pam in features.BuildPams()) { - this.runningTasks.Enqueue(new EregisterTask(frequency) + this.runningTasks.Add(new EregisterTask(frequency) { SlotNr = features.SlotNr, PoNr = features.PoNr, SerialNr = features.SerialNr, RequestAddress = features.RequestAddress, ResponseAddress = features.ResponseAddress, - EncryptionKey = features.EncryptionKey, + EncryptionKeyI = features.EncryptionKey, + EncryptionKeyII = SENSUS_STANDARD.GetEncryptionKey(), Data = pam.Value, Name = pam.Key }); diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterBatch.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterBatch.cs index b1702bfe..97973208 100644 --- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterBatch.cs +++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterBatch.cs @@ -47,15 +47,15 @@ } } - public void StartProgrammingAsync(CancellationToken cancellationToken) + public void StartProgramming(CancellationToken cancellationToken) { var eregisters = new ConcurrentQueue(this.eregisters); Parallel.For(0, 5, _ => { - while (!cancellationToken.IsCancellationRequested && eregisters.TryDequeue(out var eregister)) + while (eregisters.TryDequeue(out var eregister)) { - eregister.StartProgrammingAsync(cancellationToken); + eregister.StartProgramming(cancellationToken); } }); } diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterChangeMeterTypeTask.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterChangeMeterTypeTask.cs index 18f38034..10effa3c 100644 --- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterChangeMeterTypeTask.cs +++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterChangeMeterTypeTask.cs @@ -13,14 +13,14 @@ { var numberStyles = NumberStyles.HexNumber | NumberStyles.AllowHexSpecifier; var cultureInfo = CultureInfo.InvariantCulture; - var meterTypeCmd = new SetMeterType { Type = MeterTypes.CandI }; + var meterTypeCmd = new SetMeterType { Type = MeterTypes.CandI__0x0C }; this.Name = $"FW: {this.RadioFWHex} - C & I"; if (int.TryParse($"1108", numberStyles, cultureInfo, out var minFWVersion) && int.TryParse($"110B", numberStyles, cultureInfo, out var exceptFWVersion)) { if (this.RadioFWVersion < minFWVersion || this.RadioFWVersion == exceptFWVersion) { - meterTypeCmd.Type = MeterTypes.Residential; + meterTypeCmd.Type = MeterTypes.Residential__0x0B; this.Name = $"FW: {this.RadioFWHex} - Residential"; } } diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterExtensions.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterExtensions.cs index 3b9f590f..334eb131 100644 --- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterExtensions.cs +++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterExtensions.cs @@ -143,87 +143,87 @@ return bytes; } - public static byte[] DecryptResponse(this byte[] encryptedData, byte[] encryptionKey) - { - if (encryptionKey?.Length != 16) - { - return encryptedData; - } + //public static byte[] DecryptResponse(this byte[] encryptedData, byte[] encryptionKey) + //{ + // if (encryptionKey?.Length != 16) + // { + // return encryptedData; + // } - var length = encryptedData?.Length ?? 0; + // var length = encryptedData?.Length ?? 0; - if (length == 0) - { - return encryptedData; - } + // if (length == 0) + // { + // return encryptedData; + // } - var decryptedData = new byte[length]; + // var decryptedData = new byte[length]; - Array.Copy(encryptedData, 0, decryptedData, 0, length); + // Array.Copy(encryptedData, 0, decryptedData, 0, length); - var token = decryptedData[1]; + // var token = decryptedData[1]; - for (var x = 6; x < length; x++) - { - token += (byte)(decryptedData[x - (token & 0x3) - 1] >> ((token >> 6) & 0x1)); + // for (var x = 6; x < length; x++) + // { + // token += (byte)(decryptedData[x - (token & 0x3) - 1] >> ((token >> 6) & 0x1)); - decryptedData[x] ^= encryptionKey[(token >> 2) & 0x0F]; + // decryptedData[x] ^= encryptionKey[(token >> 2) & 0x0F]; - if (token >= 0x80) - { - decryptedData[x] = (byte)~decryptedData[x]; - } - } + // if (token >= 0x80) + // { + // decryptedData[x] = (byte)~decryptedData[x]; + // } + // } - return decryptedData; - } + // return decryptedData; + //} - public static byte[] EncryptRequest(this byte[] plainData, byte[] encryptionKey, uint address) - { - if (plainData?.Length <= 0 || encryptionKey?.Length != 16 || address <= 0) - { - return plainData; - } + //public static byte[] EncryptRequest(this byte[] plainData, byte[] encryptionKey, uint address) + //{ + // if (plainData?.Length <= 0 || encryptionKey?.Length != 16 || address <= 0) + // { + // return plainData; + // } - var dataLength = plainData.Length; - var telegramLength = dataLength + 2; - var encryptedData = new byte[telegramLength]; + // var dataLength = plainData.Length; + // var telegramLength = dataLength + 2; + // var encryptedData = new byte[telegramLength]; - Array.Copy(plainData, 0, encryptedData, 0, dataLength); + // Array.Copy(plainData, 0, encryptedData, 0, dataLength); - var telegramForCRCLength = telegramLength + 4; - var telegramForCRC = new byte[telegramForCRCLength]; + // var telegramForCRCLength = telegramLength + 4; + // var telegramForCRC = new byte[telegramForCRCLength]; - telegramForCRC[0] = (byte)(address >> 24); - telegramForCRC[1] = (byte)(address >> 16); - telegramForCRC[2] = (byte)(address >> 8); - telegramForCRC[3] = (byte)(address >> 0); + // telegramForCRC[0] = (byte)(address >> 24); + // telegramForCRC[1] = (byte)(address >> 16); + // telegramForCRC[2] = (byte)(address >> 8); + // telegramForCRC[3] = (byte)(address >> 0); - Array.Copy(encryptedData, 0, telegramForCRC, 4, telegramLength); + // Array.Copy(encryptedData, 0, telegramForCRC, 4, telegramLength); - var telegramCRC = telegramForCRC.CRCCCITT(1, telegramForCRCLength - 2); - encryptedData[telegramLength - 2] = (byte)(telegramCRC >> 8); - encryptedData[telegramLength - 1] = (byte)(telegramCRC >> 0); + // var telegramCRC = telegramForCRC.CRCCCITT(1, telegramForCRCLength - 2); + // encryptedData[telegramLength - 2] = (byte)(telegramCRC >> 8); + // encryptedData[telegramLength - 1] = (byte)(telegramCRC >> 0); - var reference = address; - var token = (byte)0xFF; + // var reference = address; + // var token = (byte)0xFF; - for (var i = 0; i < telegramLength; i++) - { - token += (byte)(((reference >> ((token & 0x3) << 3)) & 0xFF) >> ((token >> 6) & 1)); + // for (var i = 0; i < telegramLength; i++) + // { + // token += (byte)(((reference >> ((token & 0x3) << 3)) & 0xFF) >> ((token >> 6) & 1)); - reference <<= 8; - reference += encryptedData[i]; + // reference <<= 8; + // reference += encryptedData[i]; - encryptedData[i] ^= encryptionKey[(token >> 2) & 0x0F]; + // encryptedData[i] ^= encryptionKey[(token >> 2) & 0x0F]; - if (token >= 0x80) - { - encryptedData[i] = (byte)~encryptedData[i]; - } - } + // if (token >= 0x80) + // { + // encryptedData[i] = (byte)~encryptedData[i]; + // } + // } - return encryptedData; - } + // return encryptedData; + //} } } \ No newline at end of file diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterTask.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterTask.cs index 63f30424..c24cb353 100644 --- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterTask.cs +++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/EregisterTask.cs @@ -46,8 +46,6 @@ } } - public string Info { get; private set; } - public string RSSI { get; private set; } public P11 P11 { get; private set; } diff --git a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Models/EregisterProgrammingParameters.cs b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Models/EregisterProgrammingParameters.cs index 56fa974e..000f56e3 100644 --- a/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Models/EregisterProgrammingParameters.cs +++ b/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Models/EregisterProgrammingParameters.cs @@ -270,7 +270,6 @@ // return features; //} - ///////////////////////////////////////////////////// features.Debug = new EregisterDebugFeatures(); features.ChangeMeterReading = this.DisplayVolume; diff --git a/Common/LaaPackages b/Common/LaaPackages index 8bda7ec6..e7aa3e27 160000 --- a/Common/LaaPackages +++ b/Common/LaaPackages @@ -1 +1 @@ -Subproject commit 8bda7ec658f56be11f53f97ddf6616447d1abf36 +Subproject commit e7aa3e2723a435f0a714df661dc5d86dfd45a71c diff --git a/Common/Logic/ProductionOrderCore/OrderData/OrderProgrammingParameters.cs b/Common/Logic/ProductionOrderCore/OrderData/OrderProgrammingParameters.cs index f2c2485e..52d9e1be 100644 --- a/Common/Logic/ProductionOrderCore/OrderData/OrderProgrammingParameters.cs +++ b/Common/Logic/ProductionOrderCore/OrderData/OrderProgrammingParameters.cs @@ -190,65 +190,68 @@ namespace Xylem.Common.Logic.ProductionOrderCore.OrderData - - if (radioParams.RadioAddress != 0) + if (orderNr != 3249279) { - if (vakoData.KeyValues.Any(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL"))) + + + if (radioParams.RadioAddress != 0) { - var KeyInfo = vakoData.KeyValues.FirstOrDefault(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL")); - var keyList = ret.FindAll(f => f.RegisterName == "SENSUSRADIO_EncryptionKey"); - var heightstKey = keyList.OrderByDescending(o => o.Source).First(); //desc - - var defEncryptionKey = new List(); - defEncryptionKey.AddRange(new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }.ToArray()); - defEncryptionKey.AddRange(new Byte[] { 0xA0, 0xE1, 0xEF, 0x1C }.ToArray()); - defEncryptionKey.AddRange(new Byte[] { 0x3B, 0x27, 0xA4, 0x9B }.ToArray()); - defEncryptionKey.AddRange(new Byte[] { 0xAC, 0x21, 0x65, 0x35 }.ToArray()); - - - switch (KeyInfo.Charcode) + if (vakoData.KeyValues.Any(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL"))) { - //1 Standard - case "1": - - if (ByteStyler.ToString(heightstKey.RegisterValue) != ByteStyler.ToString(defEncryptionKey.ToArray())) - { - throw new ApplicationException("Order placed with default encryption, but the datasource has a diffrent key"); - } + var KeyInfo = vakoData.KeyValues.FirstOrDefault(f => f.Name.Contains("C_GEN_FUNKSCHLUESSEL")); + var keyList = ret.FindAll(f => f.RegisterName == "SENSUSRADIO_EncryptionKey"); + var heightstKey = keyList.OrderByDescending(o => o.Source).First(); //desc - break; - //2 Zufallszahl - case "2": - //notdef - - if (ByteStyler.ToString(heightstKey.RegisterValue) == ByteStyler.ToString(defEncryptionKey.ToArray())) - { - throw new ApplicationException("Order placed with radom encryption, but the datasource has a default key"); - } - //not csd - else if (heightstKey.Source == ProgrammingSource.Csd) - { - throw new ApplicationException("Order placed with radom encryption, but the datasource has a customer key"); - } - break; - //3 nach CSD - case "3": - if (heightstKey.Source != ProgrammingSource.Csd) - { - throw new ApplicationException("Order placed with Customer encryption but the datasource has no Customer key"); - } - break; - default: - throw new ApplicationException("No Vako Key for Radiokey found, unkown parameter"); + var defEncryptionKey = new List(); + defEncryptionKey.AddRange(new Byte[] { 0x0E, 0x9F, 0xAC, 0xC6 }.ToArray()); + defEncryptionKey.AddRange(new Byte[] { 0xA0, 0xE1, 0xEF, 0x1C }.ToArray()); + defEncryptionKey.AddRange(new Byte[] { 0x3B, 0x27, 0xA4, 0x9B }.ToArray()); + defEncryptionKey.AddRange(new Byte[] { 0xAC, 0x21, 0x65, 0x35 }.ToArray()); + + + switch (KeyInfo.Charcode) + { + //1 Standard + case "1": + + if (ByteStyler.ToString(heightstKey.RegisterValue) != ByteStyler.ToString(defEncryptionKey.ToArray())) + { + throw new ApplicationException("Order placed with default encryption, but the datasource has a diffrent key"); + } + + break; + //2 Zufallszahl + case "2": + //notdef + + if (ByteStyler.ToString(heightstKey.RegisterValue) == ByteStyler.ToString(defEncryptionKey.ToArray())) + { + throw new ApplicationException("Order placed with radom encryption, but the datasource has a default key"); + } + //not csd + else if (heightstKey.Source == ProgrammingSource.Csd) + { + throw new ApplicationException("Order placed with radom encryption, but the datasource has a customer key"); + } + break; + //3 nach CSD + case "3": + if (heightstKey.Source != ProgrammingSource.Csd) + { + throw new ApplicationException("Order placed with Customer encryption but the datasource has no Customer key"); + } + break; + default: + throw new ApplicationException("No Vako Key for Radiokey found, unkown parameter"); + } } + else + { + throw new ApplicationException("No Vako Key for Radiokey found"); + } + } - else - { - throw new ApplicationException("No Vako Key for Radiokey found"); - } - } - StringBuilder csv = new StringBuilder(); foreach (var item in ret) diff --git a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs index 156e6f8c..81782f37 100644 --- a/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs +++ b/Common/Production/ProductionUiCordonel/ProductionProcesses/RFTelegrams/SIRTServer.cs @@ -82,7 +82,7 @@ task.IsEncrypted = true; task.Frequency = frequency; task.RequestAddress = address; - task.EncryptionKey = encryptionBytes; + task.EncryptionKeyI = encryptionBytes; task.Data = new DummyPam(); } , repeatsCount); @@ -96,7 +96,7 @@ task.IsEncrypted = true; task.Frequency = frequency; task.RequestAddress = address; - task.EncryptionKey = encryptionBytes; + task.EncryptionKeyI = encryptionBytes; task.Data = new ResetAlarms(0xFF); } , repeatsCount); @@ -110,7 +110,7 @@ task.IsEncrypted = true; task.Frequency = frequency; task.RequestAddress = address; - task.EncryptionKey = encryptionBytes; + task.EncryptionKeyI = encryptionBytes; task.Data = new ResetAlarms(0xFE); } , repeatsCount); diff --git a/Common/Service/MeterProcessState/Controllers/LUControler.cs b/Common/Service/MeterProcessState/Controllers/LUControler.cs index 8fd79e7b..3d582276 100644 --- a/Common/Service/MeterProcessState/Controllers/LUControler.cs +++ b/Common/Service/MeterProcessState/Controllers/LUControler.cs @@ -14,6 +14,8 @@ using System.Text; using System.Threading.Tasks; using System.Web.Helpers; using System.Web.Http; +using System.Web.UI.WebControls; +using Xylem.Common.Cryptology.Security; using Xylem.Common.Logic.ServiceCore; @@ -132,7 +134,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers public async Task SyncKitronData() { - + StringBuilder query = new StringBuilder(); @@ -233,7 +235,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers } [Route("SyncKitronDataByPbc")] - public async Task SyncKitronDataByPbc(int PcbId) + public async Task SyncKitronDataByPbc(int PcbId) { using (var dataAccess = new SqlDataAccess(GlobalConfig.connectionString.Value)) @@ -326,150 +328,229 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers } - public async Task getLastProductionDateByPcb(string Seriennumer = "") + public class PickingInfo { - DateTime lastProdDate = DateTime.MinValue; + public string Error { get; set; } - try + public string Warning { get; set; } + + public string Info { get; set; } + } + [Route("GetPcbInfoPicking")] + public async Task GetPcbInfoPicking(int PcbId) + { + + return await Task.Run(() => { - - var sb = new StringBuilder(); - - - sb.AppendLine(" SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [DELTACHEF].[GENESIS_PCBFUNCTIONALTEST_PD] "); - sb.AppendLine($" where [ID_PCB] = '{Seriennumer}' "); - sb.AppendLine(" order by ID_TEST desc "); - - - - - - - // create connection - using (OracleConnection con = new OracleConnection()) + try { - // create connection string using builder - OracleConnectionStringBuilder ocsb = new OracleConnectionStringBuilder(); - ocsb.Password = "senspi2012"; - ocsb.UserID = "prima_ro"; - ocsb.DataSource = "//SLUORADB:1521/DT01"; - - // connect - con.ConnectionString = ocsb.ConnectionString; - con.Open(); - - - OracleCommand command = con.CreateCommand(); - - command.CommandText = sb.ToString(); - - OracleDataReader reader = command.ExecuteReader(); - while (reader.Read()) + PickingInfo ret = null; + using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value)) { - var St = ((string)reader["JSON"]); - var startInex = St.IndexOf("\"StartDT\":\"") + "\"StartDT\":\"".Length; - var datestring = St.Substring(startInex, "29.07.2022 06:47:27".Length); - DateTime.ParseExact(datestring, "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture); + var sb = new StringBuilder(); + sb.AppendLine($" SELECT prim.PcbId, prim.ProdDate, prim.BlockedDate, prim.BlockedRemark, kd.MaterialNumber, count (kd.ID) as CountOlderRegister , min(kd.ProdDate) as CountOlderFrom, max(kd.ProdDate) as CountOlderTo "); + sb.AppendLine($" FROM dbo.Cordonel_KitronData prim "); + sb.AppendLine($" inner join dbo.Cordonel_KitronData AS kd on prim.MaterialNumber = kd.MaterialNumber left OUTER JOIN "); + sb.AppendLine($" dbo.Cordonel_AssignedPicking AS ap ON kd.PcbId = ap.CordonelAssignedPicking_PcbId AND ap.CordonelAssignedPicking_IsDeleted = 0 LEFT OUTER JOIN "); + sb.AppendLine($" dbo.MapPcbIdToSerialNumber AS map ON kd.PcbId = map.MapPcbIdToSerialNumber_PcbId AND map.MapPcbIdToSerialNumber_Deleted = 0 LEFT OUTER JOIN "); + sb.AppendLine($" dbo.Cordonel_EOL_Progress AS eol ON kd.PcbId = eol.PcbId LEFT OUTER JOIN "); + sb.AppendLine($" dbo.AuftragPositionSerienNr AS aps ON aps.SerienNr = map.MapPcbIdToSerialNumber_SerialNumber AND aps.Wiederholungen = - 1 "); + sb.AppendLine($" WHERE prim.PcbId = {PcbId} and ap.CordonelAssignedPicking_FertigungsAuftragsNr is null "); + sb.AppendLine($" and prim.ProdDate >= kd.ProdDate and kd.BlockedDate is null and kd.SignedOutDate is null "); + sb.AppendLine($" "); + sb.AppendLine($" group by prim.PcbId, prim.ProdDate, prim.BlockedDate, prim.BlockedRemark , kd.MaterialNumber "); + + var dbResult = dataacces.ExecuteQuery(sb.ToString()); + foreach (DataRow row in dbResult.Rows) + { + + DateTime? CheckBlockedDate =( row["BlockedDate"].GetType() == typeof(System.DBNull) ? null : (DateTime?)row["BlockedDate"]); + var CheckProdDate = (DateTime)row["ProdDate"]; + var blockText = (row["BlockedRemark"].GetType() == typeof(System.DBNull) ? "" : (String)row["BlockedRemark"]); + var matNr = (int)row["MaterialNumber"]; + + + DateTime? CountOlderFrom = (row["CountOlderFrom"].GetType() == typeof(System.DBNull) ? null : (DateTime?)row["CountOlderFrom"]); + DateTime? CountOlderTo = (row["CountOlderTo"].GetType() == typeof(System.DBNull) ? null : (DateTime?)row["CountOlderTo"]); + var CountOlder = (int)row["CountOlderRegister"]; + + + ret = new PickingInfo() { Info = $"{PcbId} ist von Materialnummer: {matNr} und dem Produktiondatum: {CheckProdDate} " }; + + if (CheckBlockedDate.HasValue) + { + ret.Error = $"Gesperrt am {CheckBlockedDate.Value} wegen. {blockText}"; + } + if (CountOlder >= 2) + { + ret.Warning = $"Es gibt {CountOlder} ältere Register mit der Materialnummer: {matNr}. Produktionsdatum von {CountOlderFrom.Value} bis {CountOlderTo.Value} "; + } + + } + } + return Request.CreateResponse(HttpStatusCode.OK, ret); + + + + //return Request.CreateResponse(HttpStatusCode.OK, getUserList(LogInName, Id)); } - } - catch (Exception ex) - { - - throw ex; - } - return lastProdDate; - + catch (Exception ex) + { + return Request.CreateResponse(HttpStatusCode.InternalServerError, ex); + } + }); } - //connect + + public async Task getLastProductionDateByPcb(string Seriennumer = "") + { + DateTime lastProdDate = DateTime.MinValue; + + try + { + + var sb = new StringBuilder(); + + + sb.AppendLine(" SELECT top 1 [DS_ID] ,[ID_PCB] ,[ID_TEST] ,[JSON] FROM [DELTACHEF].[GENESIS_PCBFUNCTIONALTEST_PD] "); + sb.AppendLine($" where [ID_PCB] = '{Seriennumer}' "); + sb.AppendLine(" order by ID_TEST desc "); - //If Not rs.EOF Then + + // create connection + using (OracleConnection con = new OracleConnection()) + { + + // create connection string using builder + OracleConnectionStringBuilder ocsb = new OracleConnectionStringBuilder(); + ocsb.Password = "senspi2012"; + ocsb.UserID = "prima_ro"; + ocsb.DataSource = "//SLUORADB:1521/DT01"; + + // connect + con.ConnectionString = ocsb.ConnectionString; + con.Open(); + + + OracleCommand command = con.CreateCommand(); + + command.CommandText = sb.ToString(); + + OracleDataReader reader = command.ExecuteReader(); + while (reader.Read()) + { + var St = ((string)reader["JSON"]); + var startInex = St.IndexOf("\"StartDT\":\"") + "\"StartDT\":\"".Length; + var datestring = St.Substring(startInex, "29.07.2022 06:47:27".Length); + DateTime.ParseExact(datestring, "dd.MM.yyyy HH:mm:ss", CultureInfo.InvariantCulture); + + + + } + } + } + catch (Exception ex) + { + + throw ex; + } + return lastProdDate; + + } + + //connect - // If lngSerial = 0 Then - // StatusBar1.SimpleText = "LU: " & lngCount & "/" & ProgressBar1.Max & " " & strSerial & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 & " " & rsSQL("AnlageDatum") - // Else - // StatusBar1.SimpleText = "LU: " & lngCount & "/" & ProgressBar1.Max & " " & Format(lngSerial, "00000000") & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 & " " & rsSQL("AnlageDatum") - // End If - - // 'Debug.Print Format(lngSerial, "00000000") & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 - // DoEvents - - // If Not rsSQL Is Nothing Then - - - // ' Reihenfolge wieder zurückgesetzt Q1 < Q2 2018-04-19 - // If Q1 Tauschen - // rsSQL("Q1_SOLL") = Q2 - // rsSQL("FEHLER_Q1") = F2 - - - // rsSQL("Q2_SOLL") = Q1 - // rsSQL("FEHLER_Q2") = F1 - // End If - - - // Debug.Print rs("ZAEHLERNUMMER") - - // If Val(rsSQL("SerienNrNebenzaehlerLU") &"") = 0 And lngSerial > 0 Then - // rsSQL("SerienNrNebenzaehlerLU") = lngSerial - // End If - - - // rsSQL("Herkunft") = "L" - // rsSQL("ErgaenzungDatum") = Now - - - // rsSQL.Update - // Debug.Print lngCount &"/" & ProgressBar1.Max & " OK " & lngSerial & " / " & strSerial - // End If - //Else + //If Not rs.EOF Then - // StatusBar1.SimpleText = lngCount & "/" & ProgressBar1.Max & " unbekannte SNr: " & lngSerial & " / " & strSerial - // Debug.Print StatusBar1.SimpleText & " " & Now - // 'Debug.Print lngCount & "/" & ProgressBar1.Max & " unbekannt " & Format(lngSerial, "00000000") & " / " & strSerial - // DoEvents + + // If lngSerial = 0 Then + // StatusBar1.SimpleText = "LU: " & lngCount & "/" & ProgressBar1.Max & " " & strSerial & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 & " " & rsSQL("AnlageDatum") + // Else + // StatusBar1.SimpleText = "LU: " & lngCount & "/" & ProgressBar1.Max & " " & Format(lngSerial, "00000000") & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 & " " & rsSQL("AnlageDatum") + // End If - // 'rsSQL("Q1_SOLL") = 0 - // 'rsSQL("Herkunft") = "u" - // 'rsSQL("Info") = "unbekannt in LU" - // 'rsSQL.Update + // 'Debug.Print Format(lngSerial, "00000000") & " " & Q1 & "=" & F1 & ", " & Q2 & " =" & F2 + // DoEvents + + // If Not rsSQL Is Nothing Then - //End If - //Exit Sub - //Errorhandler: - // Dim errnum As Long - // Dim errdesc As String - // errnum = Err.Number - // errdesc = Err.Description - // PrintStatus "Fehler " & errnum & " in Ergaenze(): " & errdesc & " SQL=" & strSQL - //End Sub + // ' Reihenfolge wieder zurückgesetzt Q1 < Q2 2018-04-19 + // If Q1 Tauschen + // rsSQL("Q1_SOLL") = Q2 + // rsSQL("FEHLER_Q1") = F2 + + + // rsSQL("Q2_SOLL") = Q1 + // rsSQL("FEHLER_Q2") = F1 + // End If + + + // Debug.Print rs("ZAEHLERNUMMER") + + // If Val(rsSQL("SerienNrNebenzaehlerLU") &"") = 0 And lngSerial > 0 Then + // rsSQL("SerienNrNebenzaehlerLU") = lngSerial + // End If + + + // rsSQL("Herkunft") = "L" + // rsSQL("ErgaenzungDatum") = Now + + + // rsSQL.Update + // Debug.Print lngCount &"/" & ProgressBar1.Max & " OK " & lngSerial & " / " & strSerial + // End If + //Else + + + + // StatusBar1.SimpleText = lngCount & "/" & ProgressBar1.Max & " unbekannte SNr: " & lngSerial & " / " & strSerial + // Debug.Print StatusBar1.SimpleText & " " & Now + // 'Debug.Print lngCount & "/" & ProgressBar1.Max & " unbekannt " & Format(lngSerial, "00000000") & " / " & strSerial + // DoEvents + + + // 'rsSQL("Q1_SOLL") = 0 + // 'rsSQL("Herkunft") = "u" + // 'rsSQL("Info") = "unbekannt in LU" + // 'rsSQL.Update + + + //End If + //Exit Sub + //Errorhandler: + // Dim errnum As Long + // Dim errdesc As String + // errnum = Err.Number + // errdesc = Err.Description + // PrintStatus "Fehler " & errnum & " in Ergaenze(): " & errdesc & " SQL=" & strSQL + //End Sub + + + } + } \ No newline at end of file diff --git a/Common/Service/MeterProcessState/Controllers/PasswordController.cs b/Common/Service/MeterProcessState/Controllers/PasswordController.cs index 75cbb096..abf05472 100644 --- a/Common/Service/MeterProcessState/Controllers/PasswordController.cs +++ b/Common/Service/MeterProcessState/Controllers/PasswordController.cs @@ -45,7 +45,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers { StringBuilder sb = new StringBuilder(); - sb.AppendLine($"update auftrag.dbo.Genesis_PcbPassword set [password] ='{password}' where PcbId='{PcbId}'"); + sb.AppendLine($"update auftrag.dbo.Genesis_PcbPassword set [password] ='{password}' where PcbId='{PcbId}' "); var dt = dataAccess.ExecuteQuery(sb.ToString()); diff --git a/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs b/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs index 3bbd066f..802b9b19 100644 --- a/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs +++ b/Common/Service/MeterProcessState/Controllers/ProccesStateController.cs @@ -28,7 +28,7 @@ namespace Service.MeterProcessState.Controllers } [Route("SetPressureStateDetailed"), HttpPost] - public async Task SetPressureStateDetailed([FromBody]PressureResultData testResult) + public async Task SetPressureStateDetailed([FromBody] PressureResultData testResult) { try { @@ -128,7 +128,7 @@ namespace Service.MeterProcessState.Controllers var dt = dataacces.ExecuteQuery(query.ToString()); return "1"; - + // return ((int)dt.Rows[0]["PressuretestNeeded"]).ToString(); } @@ -289,7 +289,7 @@ namespace Service.MeterProcessState.Controllers } [Route("SetPressureState"), HttpPost] - public async Task SetPressureState(String PcbId, Int32 FertigungsauftragsNr, [FromBody]PressureTestResult testResult) + public async Task SetPressureState(String PcbId, Int32 FertigungsauftragsNr, [FromBody] PressureTestResult testResult) { try { @@ -315,7 +315,7 @@ namespace Service.MeterProcessState.Controllers query.AppendLine(" ) "); query.AppendLine(" VALUES "); query.AppendLine($" ({PcbId} "); - query.AppendLine($",{ FertigungsauftragsNr} "); + query.AppendLine($",{FertigungsauftragsNr} "); query.AppendLine($" ,GETUTCDATE() "); query.AppendLine($" ,{ResultText} "); query.AppendLine($" ,0 "); @@ -406,66 +406,78 @@ namespace Service.MeterProcessState.Controllers { using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value)) { - var dt = dataacces.ExecuteQuery($"Insert into dbo.MeterProcessState (ProcessState_PcbId, [ProcessState_State],ProcessState_DateUtc ) values ({PcbId}, {code.GetHashCode()}, GETUTCDATE())"); - } - if (!string.IsNullOrEmpty(version)) - { - try + if (version.ToLower() == "sentinel") { - var fixDisplaycode = DisplayCodes.None; - var SapCode = 0; - if (Enum.TryParse(code.ToString(), out fixDisplaycode)) + SaveSapState(PcbId, 310, version); + SaveSapState(PcbId, 400, version); + SaveSapState(PcbId, 997, version); + SaveSapState(PcbId, 998, version); + } + else + { + + var dt = dataacces.ExecuteQuery($"Insert into dbo.MeterProcessState (ProcessState_PcbId, [ProcessState_State],ProcessState_DateUtc ) values ({PcbId}, {code.GetHashCode()}, GETUTCDATE())"); + } + if (!string.IsNullOrEmpty(version)) + { + try { - switch (fixDisplaycode) + var fixDisplaycode = DisplayCodes.None; + var SapCode = 0; + if (Enum.TryParse(code.ToString(), out fixDisplaycode)) { - case DisplayCodes.None: - case DisplayCodes.Error: - case DisplayCodes.PressureTestedFailed: - case DisplayCodes.PickingFailed: - case DisplayCodes.FwUpdateActive: - case DisplayCodes.FwUpdateFailed: - case DisplayCodes.FwUpToDate: - case DisplayCodes.FlowTestFailed: - case DisplayCodes.FinalTestFailed: - case DisplayCodes.PickingStarted: - case DisplayCodes.FlowCalibrationOurOfRange: - case DisplayCodes.ZeroFlowFailed: - case DisplayCodes.FlowCalibrated: - case DisplayCodes.PickingTested: - default: - break; + switch (fixDisplaycode) + { + case DisplayCodes.None: + case DisplayCodes.Error: + case DisplayCodes.PressureTestedFailed: + case DisplayCodes.PickingFailed: + case DisplayCodes.FwUpdateActive: + case DisplayCodes.FwUpdateFailed: + case DisplayCodes.FwUpToDate: + case DisplayCodes.FlowTestFailed: + case DisplayCodes.FinalTestFailed: + case DisplayCodes.PickingStarted: + case DisplayCodes.FlowCalibrationOurOfRange: + case DisplayCodes.ZeroFlowFailed: + case DisplayCodes.FlowCalibrated: + case DisplayCodes.PickingTested: + default: + break; - case DisplayCodes.PressureTested: - SapCode = 110; - break; - case DisplayCodes.Mounted: - SapCode = 300; - break; - case DisplayCodes.ZeroFlow: - SapCode = 120; - break; - case DisplayCodes.FlowTested: - SapCode = 200; - break; + case DisplayCodes.PressureTested: + SapCode = 110; + break; + case DisplayCodes.Mounted: + SapCode = 300; + break; + case DisplayCodes.ZeroFlow: + SapCode = 120; + break; + case DisplayCodes.FlowTested: + SapCode = 200; + break; + + } + if (SapCode != 0) + { + SaveSapState(PcbId, SapCode, version); + } - } - if (SapCode != 0) - { - SaveSapState(PcbId, SapCode, version); } } + catch (Exception) + { + + throw; + } } - catch (Exception) - { - - throw; - } - + return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return "store"; })); } - return Request.CreateResponse(HttpStatusCode.OK, await Task.Run(() => { return "store"; })); + } catch (Exception ex) { @@ -569,12 +581,12 @@ namespace Service.MeterProcessState.Controllers sb.AppendLine($" inner join [Auftrag].[dbo].[Fortschrittsrueckmeldung] "); sb.AppendLine($" sap on sap.FertigungsauftragNr = @order "); sb.AppendLine($" and c.ProgressFeedbackID = sap.id "); - sb.AppendLine($" and sap.Vorgangsnr = @ProgressNr "); - sb.AppendLine($" if @count =0 "); - sb.AppendLine($" begin "); - sb.AppendLine($" insert into [Auftrag].[dbo].[Fortschrittsrueckmeldung] "); + sb.AppendLine($" and sap.Vorgangsnr = @ProgressNr and c.PcbID = @PcbID "); + sb.AppendLine($" if @count =0 "); + sb.AppendLine($" begin "); + sb.AppendLine($" insert into [Auftrag].[dbo].[Fortschrittsrueckmeldung] "); sb.AppendLine($" select 'GNS', @order, 1, CURRENT_TIMESTAMP, @ProgressNr,null,0,null,0,'{version}','webrequest'; "); - sb.AppendLine($" insert into Cordonel_ProgressFeedback "); + sb.AppendLine($" insert into Cordonel_ProgressFeedback "); sb.AppendLine($" select @PcbID ,@@IDENTITY "); sb.AppendLine($" end "); sb.AppendLine($" select @count "); diff --git a/Common/Service/MeterProcessState/Controllers/TestBenchController.cs b/Common/Service/MeterProcessState/Controllers/TestBenchController.cs index 80f114e5..736b5c57 100644 --- a/Common/Service/MeterProcessState/Controllers/TestBenchController.cs +++ b/Common/Service/MeterProcessState/Controllers/TestBenchController.cs @@ -347,12 +347,20 @@ tr.Date = Convert.ToDateTime(dr["Datum"]); tr.MeterType = dt.Rows[0]["Typ"].ToString(); tr.MeterSize = Convert.ToInt32(dr["Nennweite"]); - tr.AirTempC = Convert.ToDouble(dr["Lufttemperatur"]); - tr.AirPressure = Convert.ToDouble(dr["LuftDruck"]); - tr.AirHumanity = Convert.ToDouble(dr["RelativeFeuchte"]); - tr.WaterTempC = Convert.ToDouble(dr["Vorlauftemperatur"]); - tr.TotalMeters = Convert.ToInt32(dr["Anzahl"]); - tr.Remark = dr["Bemerkung"].ToString(); + try + { + tr.AirTempC = Convert.ToDouble(dr["Lufttemperatur"]); + tr.AirPressure = Convert.ToDouble(dr["LuftDruck"]); + tr.AirHumanity = Convert.ToDouble(dr["RelativeFeuchte"]); + tr.WaterTempC = Convert.ToDouble(dr["Vorlauftemperatur"]); + tr.TotalMeters = Convert.ToInt32(dr["Anzahl"]); + tr.Remark = dr["Bemerkung"].ToString(); + } + catch (Exception) + { + tr.Remark = "temp nicht lesbar"; + } + tr.Details = new List(); tr.TestPointsChannels = new List(); diff --git a/Common/Service/MeterProcessState/MeterProcessState.csproj.user b/Common/Service/MeterProcessState/MeterProcessState.csproj.user index 9b1bfe9a..e98e99f7 100644 --- a/Common/Service/MeterProcessState/MeterProcessState.csproj.user +++ b/Common/Service/MeterProcessState/MeterProcessState.csproj.user @@ -45,7 +45,7 @@ True 56011 / - http://localhost:50075/ + http://localhost:50076/ False False diff --git a/Common/Ui/Common.UI/App.config b/Common/Ui/Common.UI/App.config index 27cd2dde..6cf404ce 100644 --- a/Common/Ui/Common.UI/App.config +++ b/Common/Ui/Common.UI/App.config @@ -7,7 +7,7 @@ - + diff --git a/Common/Ui/Common.UI/Infrastructure/VMLocator.cs b/Common/Ui/Common.UI/Infrastructure/VMLocator.cs index 229fe6fe..d2fc09b1 100644 --- a/Common/Ui/Common.UI/Infrastructure/VMLocator.cs +++ b/Common/Ui/Common.UI/Infrastructure/VMLocator.cs @@ -4,7 +4,7 @@ public class VMLocator { - public SIRTBroadcastersVM SIRTBroadcasterVM { get; } = new SIRTBroadcastersVM(); + public SIRTBroadcastersVM SIRTBroadcasterVM => new SIRTBroadcastersVM(); public EregisterHistoryVM EregisterHistoryVM { get; } = new EregisterHistoryVM(); diff --git a/Common/Ui/Common.UI/Models/AuftragDbContext.cs b/Common/Ui/Common.UI/Models/AuftragDbContext.cs index fc80c860..bcbedbfb 100644 --- a/Common/Ui/Common.UI/Models/AuftragDbContext.cs +++ b/Common/Ui/Common.UI/Models/AuftragDbContext.cs @@ -29,14 +29,13 @@ sqlConnection .CreateCommand($@" UPDATE eRegister - SET Bemerkung = ISNULL(@{nameof(state.Bemerkung)}, er.Bemerkung) + SET Bemerkung = ISNULL(er.Bemerkung, @{nameof(state.Bemerkung)}) , BUP = ISNULL(@{nameof(state.BUP)}, er.BUP) , SEMI = ISNULL(@{nameof(state.SEMI)}, er.SEMI) , DEBUG = ISNULL(@{nameof(state.DEBUG)}, er.DEBUG) , SemiDebugDatum = ISNULL(@{nameof(state.SemiDebugDatum)}, er.SemiDebugDatum) - , GeschlossenDatum = ISNULL(@{nameof(state.GeschlossenDatum)}, er.GeschlossenDatum) - , FunkadresseDatum = ISNULL(@{nameof(state.FunkadresseDatum)}, er.FunkadresseDatum) - , TempAdresse = ISNULL(@{nameof(state.TempAdresse)}, er.TempAdresse) + , GeschlossenDatum = ISNULL(er.GeschlossenDatum, @{nameof(state.GeschlossenDatum)}) + , FunkadresseDatum = ISNULL(er.FunkadresseDatum, @{nameof(state.FunkadresseDatum)}) FROM eRegister AS er JOIN AuftragPositionSerienNr AS aps ON er.Seriennummer = aps.SerienNr @@ -49,7 +48,6 @@ .SetParameter(nameof(state.SemiDebugDatum), state.SemiDebugDatum) .SetParameter(nameof(state.GeschlossenDatum), state.GeschlossenDatum) .SetParameter(nameof(state.FunkadresseDatum), state.FunkadresseDatum) - .SetParameter(nameof(state.TempAdresse), state.TempAdresse) .SetParameter(nameof(state.Seriennummer), state.Seriennummer) .ExecuteNonQuery(); } @@ -82,7 +80,7 @@ } } - internal class Eregister_Shared + internal class eRegister_Shared { internal static List LoadActions(int sharedId) => sqlConnection.LoadActions(sharedId); @@ -101,50 +99,9 @@ SELECT CAST((SELECT DISTINCT * FROM VieweRegisterProgrammingParameters WHERE SharedId = @{nameof(sharedId)} - -- AND Completed = @{nameof(completed)} - -- AND SlotNr > 0 FOR XML PATH('{nameof(EregisterProgrammingParameters)}') - , ROOT('{nameof(EregisterProgrammingParametersList)}')) - AS XML)") + , ROOT('{nameof(EregisterProgrammingParametersList)}')) AS XML)") .SetParameter(nameof(sharedId), sharedId) - .SetParameter(nameof(completed), completed) - .FirstOrDefault(x => x.GetValue(0)); - var xmlDeserialized = default(object); - - if (!string.IsNullOrWhiteSpace(xmlList)) - { - var xmlSerializer = new XmlSerializer(typeof(EregisterProgrammingParametersList)); - var xmlReader = new StringReader(xmlList); - - try - { - xmlDeserialized = xmlSerializer.Deserialize(xmlReader); - } - catch (Exception e) - { - AppHost.NLogger.Error(e.ToString()); - } - } - - return xmlDeserialized as EregisterProgrammingParametersList ?? new EregisterProgrammingParametersList(); - } - - internal static EregisterProgrammingParametersList LoadEregisterProgrammingParametersListForSerialNr(int serialNr) - { - var xmlList = sqlConnection - .CreateCommand($@" - SELECT CAST((SELECT ersh.P2000_Shared_Id - , ersh.Slotno - , erpp.* - FROM eRegister_Shared AS ersh - JOIN VieweRegisterProgrammingParameters AS erpp - ON ersh.Serialno = erpp.SerienNr - WHERE ersh.Serialno = @{nameof(serialNr)} - AND ersh.Completed = 0 - FOR XML PATH('{nameof(EregisterProgrammingParameters)}') - , ROOT('{nameof(EregisterProgrammingParametersList)}')) - AS XML)") - .SetParameter(nameof(serialNr), serialNr) .FirstOrDefault(x => x.GetValue(0)); var xmlDeserialized = default(object); diff --git a/Common/Ui/Common.UI/Models/Eregister_Shared.cs b/Common/Ui/Common.UI/Models/Eregister_Shared.cs index 1a46cdb5..04ca86d3 100644 --- a/Common/Ui/Common.UI/Models/Eregister_Shared.cs +++ b/Common/Ui/Common.UI/Models/Eregister_Shared.cs @@ -27,7 +27,8 @@ internal static List LoadActions(this SqlConnection sqlConnection, int sharedId) => sqlConnection .CreateCommand($@" - SELECT Id + SELECT DISTINCT + Id , P2000_Shared_Id , Slotno , Serialno diff --git a/Common/Ui/Common.UI/Models/SQLiteKeyStore.cs b/Common/Ui/Common.UI/Models/SQLiteKeyStore.cs index dc57ee91..6c6dc0c3 100644 --- a/Common/Ui/Common.UI/Models/SQLiteKeyStore.cs +++ b/Common/Ui/Common.UI/Models/SQLiteKeyStore.cs @@ -25,6 +25,18 @@ public bool TryGetKey(uint address1, uint address2, out string encryptionKey) { + //var existing = this.connection + // .Table() + // .Where(x => x.Address == 4291535650) + // .FirstOrDefault(); + + //if (existing != null) + //{ + // existing.EncryptionKey = "5DD3EF5233B4DAA6836721F2866182DA"; + + // this.connection.Update(existing); + //} + encryptionKey = this.connection .Table() .FirstOrDefault(x => x.Address == address1 || x.Address == address2) diff --git a/Common/Ui/Common.UI/ViewModels/EregisterInitializeVM.cs b/Common/Ui/Common.UI/ViewModels/EregisterInitializeVM.cs index 517b5f6f..1db2eb1e 100644 --- a/Common/Ui/Common.UI/ViewModels/EregisterInitializeVM.cs +++ b/Common/Ui/Common.UI/ViewModels/EregisterInitializeVM.cs @@ -228,7 +228,7 @@ } this.timer.Start(); - this.eregisterFactory.StartProgrammingAsync(this.cancellationToken); + this.eregisterFactory.StartProgramming(this.cancellationToken); this.StopProgrammingCommandHandler(); this.prepeared = false; diff --git a/Common/Ui/Common.UI/ViewModels/HomeVM.cs b/Common/Ui/Common.UI/ViewModels/HomeVM.cs index ae0679d7..1238716b 100644 --- a/Common/Ui/Common.UI/ViewModels/HomeVM.cs +++ b/Common/Ui/Common.UI/ViewModels/HomeVM.cs @@ -23,7 +23,6 @@ this.timer = new Timer(3000); this.timer.Elapsed += this.Timer_Elapsed; this.sirtHub = new SIRTHub(); - // TODO: this.sirtHub.MessageProcessed += this.SirtHub_MessageProcessed; this.StartScanning = new Command(this.StartScanning_Command); this.Addresses433 = new ObservableCollection(); this.Addresses868 = new ObservableCollection(); @@ -40,8 +39,6 @@ this.InvokeTaskAsync(() => { this.timer.Start(); - //this.sirtHub.Open("COM6"); - //this.sirtHub.Open("COM8"); }); } diff --git a/Common/Ui/Common.UI/ViewModels/ManualProgrammingVM.cs b/Common/Ui/Common.UI/ViewModels/ManualProgrammingVM.cs index 8ae9154c..0f8204b2 100644 --- a/Common/Ui/Common.UI/ViewModels/ManualProgrammingVM.cs +++ b/Common/Ui/Common.UI/ViewModels/ManualProgrammingVM.cs @@ -84,7 +84,7 @@ DelPamSemi = true, WakeUpModul = true, RequestAddress = this.Address.Value, - EncryptionKey = encryptionKey, + EncryptionKeyI = encryptionKey, Data = new ChangeFactoryState { FactoryState = FactoryState.Production diff --git a/Common/Ui/GenesisToolBox/FrmQsTool.cs b/Common/Ui/GenesisToolBox/FrmQsTool.cs index a1bef8c2..e3f6e9f1 100644 --- a/Common/Ui/GenesisToolBox/FrmQsTool.cs +++ b/Common/Ui/GenesisToolBox/FrmQsTool.cs @@ -703,6 +703,9 @@ namespace Xylem.Common.Ui.GenesisToolBox try { + _currentGenesis.WriteRegister(Register.Powermon.BatteryQuantity, 2, true, true); + + // var requirements = new CordonelRequirements(); // TODO THW Just display lifetime as is in Low Level Tools as Order is not assigned and meter size is unknown (ROLAND) diff --git a/LaaProductionWeb/LaaPackages b/LaaProductionWeb/LaaPackages index a9ef9051..e7aa3e27 160000 --- a/LaaProductionWeb/LaaPackages +++ b/LaaProductionWeb/LaaPackages @@ -1 +1 @@ -Subproject commit a9ef9051cabb74806a4ce0293794cf95756883e6 +Subproject commit e7aa3e2723a435f0a714df661dc5d86dfd45a71c diff --git a/SPSLogger/UA_Client_1500/UAClientHelperAPI.cs b/SPSLogger/UA_Client_1500/UAClientHelperAPI.cs index aab39812..e99d941e 100644 --- a/SPSLogger/UA_Client_1500/UAClientHelperAPI.cs +++ b/SPSLogger/UA_Client_1500/UAClientHelperAPI.cs @@ -37,7 +37,7 @@ namespace Siemens.UAClientHelper public UAClientHelperAPI() { // Creats the application configuration (containing the certificate) on construction - mApplicationConfig = CreateClientConfiguration(); + // mApplicationConfig = CreateClientConfiguration(); } #endregion