VSFM omni+ 02-07-2024

This commit is contained in:
Stoyan Zlatev
2024-07-03 10:35:45 +02:00
parent dc0c0cacc7
commit 926676931e
130 changed files with 1327 additions and 4257 deletions
+71 -138
View File
@@ -201,10 +201,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InspectionUI.Abstraction",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InspectionUI.RemoteControl", "OmniPlus\InspectionUI.RemoteControl\InspectionUI.RemoteControl.csproj", "{41E949AD-FBF6-47A3-AC1D-7E17AB7F1252}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InspectionUI.Plugins.Controls", "OmniPlus\InspectionUI.Plugins.Controls\InspectionUI.Plugins.Controls.csproj", "{EBF13D20-08C9-4984-8B21-6FB7419A622A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InspectionUI.Plugins.Eregister", "OmniPlus\InspectionUI.Plugins.Eregister\InspectionUI.Plugins.Eregister.csproj", "{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Hardware.Interfaces.Ports", "Hardware\Interfaces\Ports\Common.Hardware.Interfaces.Ports\Common.Hardware.Interfaces.Ports.csproj", "{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.UI.SIRTBroadcaster", "Ui\Common.UI.SIRTBroadcaster\Common.UI.SIRTBroadcaster.csproj", "{8D3B1C46-B23E-46CC-9B59-24E34DE60510}"
@@ -221,6 +217,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logic.Extensions.SQL
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logic.Extensions.Http", "Logic\Common.Logic.Extensions.Http\Common.Logic.Extensions.Http.csproj", "{57DDAE1E-FD6B-47E0-AD5E-8CCFAD07F1D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Hardware.Interfaces.Ports.SIRT", "Hardware\Interfaces\Ports\Common.Hardware.Interfaces.Ports.SIRT\Common.Hardware.Interfaces.Ports.SIRT.csproj", "{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Utils\DateTimeServerShared\DateTimeServerShared.projitems*{4806d89a-fbfb-41bc-aaa7-2242444bf55a}*SharedItemsImports = 4
@@ -4559,10 +4557,10 @@ Global
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.COM|x64.Build.0 = Release|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.COM|x86.ActiveCfg = Release|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.COM|x86.Build.0 = Release|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Any CPU.ActiveCfg = Development|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Any CPU.Build.0 = Development|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Mixed Platforms.ActiveCfg = Development|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|Mixed Platforms.Build.0 = Development|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|x64.ActiveCfg = Debug|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|x64.Build.0 = Debug|Any CPU
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -4735,134 +4733,6 @@ Global
{41E949AD-FBF6-47A3-AC1D-7E17AB7F1252}.XP32bit|x64.Build.0 = Release|Any CPU
{41E949AD-FBF6-47A3-AC1D-7E17AB7F1252}.XP32bit|x86.ActiveCfg = Release|Any CPU
{41E949AD-FBF6-47A3-AC1D-7E17AB7F1252}.XP32bit|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.COM|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|x64.ActiveCfg = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|x64.Build.0 = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|x86.ActiveCfg = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Debug|x86.Build.0 = Debug|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.PerformTest|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.Release|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.ReleaseTest|x86.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|x64.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|x64.Build.0 = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|x86.ActiveCfg = Release|Any CPU
{EBF13D20-08C9-4984-8B21-6FB7419A622A}.XP32bit|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.COM|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|x64.Build.0 = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Debug|x86.Build.0 = Debug|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.PerformTest|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.Release|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.ReleaseTest|x86.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|x64.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|x64.Build.0 = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|x86.ActiveCfg = Release|Any CPU
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}.XP32bit|x86.Build.0 = Release|Any CPU
{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
@@ -5311,6 +5181,70 @@ Global
{57DDAE1E-FD6B-47E0-AD5E-8CCFAD07F1D7}.XP32bit|x64.Build.0 = Release|Any CPU
{57DDAE1E-FD6B-47E0-AD5E-8CCFAD07F1D7}.XP32bit|x86.ActiveCfg = Release|Any CPU
{57DDAE1E-FD6B-47E0-AD5E-8CCFAD07F1D7}.XP32bit|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}._MANUAL_CONTROL|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.COM|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|x64.ActiveCfg = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|x64.Build.0 = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|x86.ActiveCfg = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Debug|x86.Build.0 = Debug|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.GenesisDisplayTool_V01|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.PerformTest|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.Release|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.ReleaseTest|x86.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|Any CPU.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|Any CPU.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|Mixed Platforms.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|Mixed Platforms.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|x64.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|x64.Build.0 = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|x86.ActiveCfg = Release|Any CPU
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}.XP32bit|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -5401,8 +5335,6 @@ Global
{8E1431E9-9B14-4BC2-8B65-47357C97B1FC} = {68323534-4337-4E3A-89BC-11D8BB55343A}
{C6BFAC88-5647-4131-90B1-4D6265E08348} = {68323534-4337-4E3A-89BC-11D8BB55343A}
{41E949AD-FBF6-47A3-AC1D-7E17AB7F1252} = {68323534-4337-4E3A-89BC-11D8BB55343A}
{EBF13D20-08C9-4984-8B21-6FB7419A622A} = {68323534-4337-4E3A-89BC-11D8BB55343A}
{8E5F013D-B8FC-41C7-BB12-702DC71C86CA} = {68323534-4337-4E3A-89BC-11D8BB55343A}
{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6} = {B9444AB7-1EB1-484A-8DE6-4EEE03498CD7}
{8D3B1C46-B23E-46CC-9B59-24E34DE60510} = {03D4F23E-7E4A-4091-BC96-036C996D351A}
{9C1C5522-E986-4FD6-8F2F-19821D704A88} = {03D4F23E-7E4A-4091-BC96-036C996D351A}
@@ -5411,6 +5343,7 @@ Global
{6480CC2A-AB54-4A26-8413-D5141431C080} = {68A1B84B-B38F-4BD1-94A8-DB18600457FF}
{62490923-CD17-45A6-B79F-A027927C75B5} = {57AA2731-BFD9-40A5-820F-E943FBC75D91}
{57DDAE1E-FD6B-47E0-AD5E-8CCFAD07F1D7} = {57AA2731-BFD9-40A5-820F-E943FBC75D91}
{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD} = {B9444AB7-1EB1-484A-8DE6-4EEE03498CD7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BCB7B69-696C-436A-86F7-C91EA5588164}
@@ -61,6 +61,10 @@
<Project>{D0C8D887-ED52-40AB-A069-90BCE0E801E2}</Project>
<Name>CordonelPreadjustmentUi</Name>
</ProjectReference>
<ProjectReference Include="..\Hardware\Interfaces\Ports\Common.Hardware.Interfaces.Ports.SIRT\Common.Hardware.Interfaces.Ports.SIRT.csproj">
<Project>{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}</Project>
<Name>Common.Hardware.Interfaces.Ports.SIRT</Name>
</ProjectReference>
<ProjectReference Include="..\Hardware\Interfaces\Ports\Common.Hardware.Interfaces.Ports\Common.Hardware.Interfaces.Ports.csproj">
<Project>{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6}</Project>
<Name>Common.Hardware.Interfaces.Ports</Name>
+23
View File
@@ -1,9 +1,32 @@
namespace CommonConsole
{
using Common.Hardware.Interfaces.Ports;
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public static class Program
{
public static void Main()
{
var broadcaster = new SirtBroadcaster(new SerialPortSettings
{
BaudRate = SerialPortBaudRate.X115200,
DataBits = SerialPortDataBits.X8,
Parity = SerialPortParity.None,
PortName = "COM6",
StopBits = SerialPortStopBits.One,
RWTimeout = -1
});
broadcaster.Open();
Console.WriteLine($"READY: {broadcaster.Ready}");
Console.WriteLine($"SIRT-ID: {broadcaster.SirtId}");
Console.WriteLine($"FREQUENCY: {broadcaster.Frequency:0 MHz}");
Console.ReadKey();
broadcaster.Close();
}
}
}
@@ -40,29 +40,34 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Messages\Parameters\BluetoothOperating.cs" />
<Compile Include="Messages\Parameters\ByteExtensions.cs" />
<Compile Include="Messages\Parameters\OperatingModes.cs" />
<Compile Include="Messages\Parameters\P11.cs" />
<Compile Include="Messages\Parameters\P12.cs" />
<Compile Include="Messages\Parameters\P811.cs" />
<Compile Include="Messages\Parameters\PamTimeout.cs" />
<Compile Include="Messages\Parameters\RFModuleOperating.cs" />
<Compile Include="Messages\Parameters\SirtOperating.cs" />
<Compile Include="Messages\Requests\ReadPamRequest.cs" />
<Compile Include="Messages\Requests\ReadRegRequest.cs" />
<Compile Include="Messages\Requests\SirtRequest.cs" />
<Compile Include="Messages\Requests\WritePamRequest.cs" />
<Compile Include="Messages\Requests\WriteRegRequest.cs" />
<Compile Include="Messages\Responses\AckOrAnswerResponse.cs" />
<Compile Include="Messages\Responses\FromAirResponse.cs" />
<Compile Include="Messages\Responses\MessageType.cs" />
<Compile Include="Messages\Responses\SirtResponse.cs" />
<Compile Include="Messages\SirtMessage.cs" />
<Compile Include="Messages\SirtMessageStructure.cs" />
<Compile Include="SirtFixed.cs" />
<Compile Include="SirtPort.cs" />
<Compile Include="Parameters\AuthLevel.cs" />
<Compile Include="Parameters\BluetoothOperating.cs" />
<Compile Include="Parameters\ByteExtensions.cs" />
<Compile Include="Parameters\CRC1021.cs" />
<Compile Include="Parameters\OperatingModes.cs" />
<Compile Include="Parameters\P11.cs" />
<Compile Include="Parameters\P12.cs" />
<Compile Include="Parameters\P811.cs" />
<Compile Include="Parameters\PamTimeout.cs" />
<Compile Include="Parameters\RFModuleOperating.cs" />
<Compile Include="Parameters\SirtOperating.cs" />
<Compile Include="Messages\Payloads\Ack.cs" />
<Compile Include="Messages\Payloads\Answer.cs" />
<Compile Include="Messages\Payloads\Bup.cs" />
<Compile Include="Messages\Payloads\Debug.cs" />
<Compile Include="Messages\Payloads\Lat.cs" />
<Compile Include="Messages\Payloads\Semi.cs" />
<Compile Include="Requests\ReadPamRequest.cs" />
<Compile Include="Requests\ReadRegRequest.cs" />
<Compile Include="Requests\WritePamRequest.cs" />
<Compile Include="Requests\WriteRegRequest.cs" />
<Compile Include="Responses\AckOrAnswerResponse.cs" />
<Compile Include="Responses\FromAirResponse.cs" />
<Compile Include="SirtMessage.cs" />
<Compile Include="SirtBroadcaster.cs" />
<Compile Include="SirtConstants.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SirtTask.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common.Hardware.Interfaces.Ports\Common.Hardware.Interfaces.Ports.csproj">
@@ -0,0 +1,10 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Payloads
{
public class Ack
{
//public Ack(AckOrAnswerResponse response) : base(response)
//{
//}
}
}
@@ -0,0 +1,10 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Payloads
{
public class Answer
{
//public Answer(AckOrAnswerResponse response) : base(response)
//{
//}
}
}
@@ -0,0 +1,29 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Payloads
{
using System;
public class Bup
{
//public Bup(FromAirResponse response) : base(response)
//{
// var payload = response.Payload;
// var index = 0;
// this.AppCode = payload[index++];
// this.Counter = payload[index++];
// this.Serial = BitConverter.ToUInt32(payload, index += 4);
// this.Reading = BitConverter.ToUInt32(payload, index += 4);
// this.Alarm = payload[index++];
//}
public Byte AppCode { get; }
public Byte Counter { get; }
public UInt32 Serial { get; }
public UInt32 Reading { get; }
public Byte Alarm { get; }
}
}
@@ -1,48 +1,47 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT.Payloads
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Payloads
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters;
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
using Common.Hardware.Interfaces.Ports.SIRT.Parameters;
using System;
public class Debug : FromAirResponse
public class Debug
{
public Debug(FromAirResponse response) : base(response)
{
var payload = this.Payload;
var index = 0;
//public Debug(FromAirResponse response) : base(response)
//{
// var payload = response.Payload;
// var index = 0;
this.AppCode = payload[index++];
this.FlexNetCounter = payload[index++];
this.ModuleAddress = BitConverter.ToUInt32(payload, index += 4);
this.OxOO = payload[index++];
this.MeterType = payload[index++];
this.RadioFirmwareVersion = this.VersionString(payload[index++], payload[index++]);
this.MetrologyFirmwareVersion = this.VersionString(payload[index++], payload[index++]);
this.HrdwareVersion = payload[index++];
this.FactoryState = payload[index++];
this.PCBID = BitConverter.ToUInt32(payload, index += 4);
this.BoardTemperature = payload[index++];
this.BoardVoltage = BitConverter.ToUInt16(payload, index += 2);
this.WakeupInterval = payload[index++];
this.SensusRFSetting = payload[index++];
this.FlexNetRFSetting = payload[index++];
this.FrequencyOffset = BitConverter.ToUInt32(payload, index += 4);
this.ResetCount = payload[index++];
this.WatchdogReset = payload[index++];
this.BatterySeconds = BitConverter.ToUInt32(payload, index += 4);
this.MeterSampleRate = payload[index++];
this.HistoryScale = payload[index++];
this.RegisterMode = payload[index++];
this.HistorySize = payload[index++];
this.FactoryCalibration = payload[index++];
this.MeterSize = payload[index++];
this.VolumePerLedPulse = BitConverter.ToUInt32(payload, index += 4);
this.VolumePerPulse = BitConverter.ToUInt32(payload, index += 4);
this.OffsetFactor = BitConverter.ToUInt32(payload, index += 4);
this.OffsetTime = payload[index++];
this.ActivationByFlowThreshold = payload[index++];
}
// this.AppCode = payload[index++];
// this.FlexNetCounter = payload[index++];
// this.ModuleAddress = BitConverter.ToUInt32(payload, index += 4);
// this.OxOO = payload[index++];
// this.MeterType = payload[index++];
// this.RadioFirmwareVersion = this.VersionString(payload[index++], payload[index++]);
// this.MetrologyFirmwareVersion = this.VersionString(payload[index++], payload[index++]);
// this.HrdwareVersion = payload[index++];
// this.FactoryState = payload[index++];
// this.PCBID = BitConverter.ToUInt32(payload, index += 4);
// this.BoardTemperature = payload[index++];
// this.BoardVoltage = BitConverter.ToUInt16(payload, index += 2);
// this.WakeupInterval = payload[index++];
// this.SensusRFSetting = payload[index++];
// this.FlexNetRFSetting = payload[index++];
// this.FrequencyOffset = BitConverter.ToUInt32(payload, index += 4);
// this.ResetCount = payload[index++];
// this.WatchdogReset = payload[index++];
// this.BatterySeconds = BitConverter.ToUInt32(payload, index += 4);
// this.MeterSampleRate = payload[index++];
// this.HistoryScale = payload[index++];
// this.RegisterMode = payload[index++];
// this.HistorySize = payload[index++];
// this.FactoryCalibration = payload[index++];
// this.MeterSize = payload[index++];
// this.VolumePerLedPulse = BitConverter.ToUInt32(payload, index += 4);
// this.VolumePerPulse = BitConverter.ToUInt32(payload, index += 4);
// this.OffsetFactor = BitConverter.ToUInt32(payload, index += 4);
// this.OffsetTime = payload[index++];
// this.ActivationByFlowThreshold = payload[index++];
//}
public Byte AppCode { get; }
@@ -0,0 +1,9 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Payloads
{
public class Lat : Bup
{
//public Lat(FromAirResponse response) : base(response)
//{
//}
}
}
@@ -0,0 +1,143 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Payloads
{
using System;
public class Semi
{
//public Semi(FromAirResponse response) : base(response)
//{
// var payload = response.Payload;
// var index = 0;
// this.ModuleAddress = BitConverter.ToUInt32(payload, index += 4);
// this.DisplayVolume = BitConverter.ToUInt32(payload, index += 4);
// this.Alarms = payload[index++];
// this.PamStatus = payload[index++];
// this.PamRssi = payload[index++];
// this.MeterType = payload[index++];
// this.TransmissionInterval = BitConverter.ToUInt16(payload, index += 2);
// this.LATInterval = BitConverter.ToUInt16(payload, index += 2);
// this.CurrentFlow = BitConverter.ToUInt16(payload, index += 2);
// this.BackwardVolume = BitConverter.ToUInt32(payload, index += 4);
// this.NumberOfDials = payload[index++];
// this.Units = payload[index++];
// this.MeterID = BitConverter.ToUInt32(payload, index += 4);
// this.MBusStatus = payload[index++];
// this.MBusTransmissionInterval = BitConverter.ToUInt16(payload, index += 2);
// this.AlarmActiveInformation = payload[index++];
// this.LeakageDetectionParameters = payload[index++];
// this.BrokenPipeDetectionParameters = payload[index++];
// this.BatteryRemaining = BitConverter.ToUInt16(payload, index += 2);
// this.BatteryEndDetected = BitConverter.ToUInt16(payload, index += 2);
// this.MaximumFlow = BitConverter.ToUInt16(payload, index += 2);
// this.TimeOfMaximumFlow = BitConverter.ToUInt16(payload, index += 2);
// this.LowBatteryDetected = BitConverter.ToUInt16(payload, index += 2);
// this.LeakStart = BitConverter.ToUInt16(payload, index += 2);
// this.LeakEnd = BitConverter.ToUInt16(payload, index += 2);
// this.MagneticTamperStart = BitConverter.ToUInt16(payload, index += 2);
// this.MagneticTamperEnd = BitConverter.ToUInt16(payload, index += 2);
// this.ModuleRemoveStart = BitConverter.ToUInt16(payload, index += 2);
// this.ModuleRemoveEnd = BitConverter.ToUInt16(payload, index += 2);
// this.BackflowStart = BitConverter.ToUInt16(payload, index += 2);
// this.BackflowEnd = BitConverter.ToUInt16(payload, index += 2);
// this.BrokenPipeStart = BitConverter.ToUInt16(payload, index += 2);
// this.BrokenPipeEnd = BitConverter.ToUInt16(payload, index += 2);
// this.LogContent = BitConverter.ToUInt16(payload, index += 2);
// this.LoggingInterval = BitConverter.ToUInt16(payload, index += 2);
// this.FixedDateReadingContent = BitConverter.ToUInt16(payload, index += 2);
// this.DayOfMonth = payload[index++];
// this.ActualDateTime = BitConverter.ToUInt32(payload, index += 4);
// this.HistoricalErrorLimit = payload[index++];
// this.CustomerSpecificText = Encoding.ASCII.GetString(payload, index += 9, 9);
// this.TimeOfFDRReset = BitConverter.ToUInt16(payload, index += 2);
// this.TimeOfLogReset = BitConverter.ToUInt16(payload, index += 2);
// this.MeterSize = payload[index++];
//}
public UInt32 ModuleAddress { get; }
public UInt32 DisplayVolume { get; }
public Byte Alarms { get; }
public Byte PamStatus { get; }
public Byte PamRssi { get; }
public Byte MeterType { get; }
public UInt16 TransmissionInterval { get; }
public UInt16 LATInterval { get; }
public UInt16 CurrentFlow { get; }
public UInt32 BackwardVolume { get; }
public Byte NumberOfDials { get; }
public Byte Units { get; }
public UInt32 MeterID { get; }
public Byte MBusStatus { get; }
public UInt16 MBusTransmissionInterval { get; }
public Byte AlarmActiveInformation { get; }
public Byte LeakageDetectionParameters { get; }
public Byte BrokenPipeDetectionParameters { get; }
public UInt16 BatteryRemaining { get; }
public UInt16 BatteryEndDetected { get; }
public UInt16 MaximumFlow { get; }
public UInt16 TimeOfMaximumFlow { get; }
public UInt16 LowBatteryDetected { get; }
public UInt16 LeakStart { get; }
public UInt16 LeakEnd { get; }
public UInt16 MagneticTamperStart { get; }
public UInt16 MagneticTamperEnd { get; }
public UInt16 ModuleRemoveStart { get; }
public UInt16 ModuleRemoveEnd { get; }
public UInt16 BackflowStart { get; }
public UInt16 BackflowEnd { get; }
public UInt16 BrokenPipeStart { get; }
public UInt16 BrokenPipeEnd { get; }
public UInt16 LogContent { get; }
public UInt16 LoggingInterval { get; }
public UInt16 FixedDateReadingContent { get; }
public Byte DayOfMonth { get; }
public UInt32 ActualDateTime { get; }
public Byte HistoricalErrorLimit { get; }
public String CustomerSpecificText { get; }
public UInt16 TimeOfFDRReset { get; }
public UInt16 TimeOfLogReset { get; }
public Byte MeterSize { get; }
}
}
@@ -1,24 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Requests
{
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public class ReadRegRequest : SirtRequest
{
public Byte ReadLength
{
get => this.message.P2;
set => this.message.P2 = value;
}
protected override Byte[] ToByteArray()
{
this.message.Start = SirtFixed.Pc2Sirt;
this.message.Cmd = SirtFixed.ReadReg;
this.message.P2 = this.ReadLength;
return base.ToByteArray();
}
}
}
@@ -1,10 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Requests
{
using System;
public abstract class SirtRequest : SirtMessage
{
public static implicit operator Byte[](SirtRequest request)
=> request.ToByteArray();
}
}
@@ -1,24 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Requests
{
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public class WriteRegRequest : SirtRequest
{
public Byte ReadLength
{
get => this.message.P2;
set => this.message.P2 = value;
}
protected override Byte[] ToByteArray()
{
this.message.Start = SirtFixed.Pc2Sirt;
this.message.Cmd = SirtFixed.WriteReg;
this.message.P2 = this.message.Length;
return base.ToByteArray();
}
}
}
@@ -1,14 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses
{
public enum MessageTypes
{
Bup = 0x00,
Lat = 0x01,
Semi = 0x08,
Logger = 0x09,
Test = 0x0A,
Debug = 0x0B,
EncFlexNet = 0x10,
Pam = 0x20,
}
}
@@ -1,23 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses
{
using System;
public abstract class SirtResponse : SirtMessage
{
protected SirtResponse(Byte[] bytes) : base(bytes)
=> this.MatchCRC = this.CheckWhetherTelegramMatchCheckSum();
public Boolean MatchCRC { get; }
public override String ToString() => BitConverter.ToString(this.Payload);
private Boolean CheckWhetherTelegramMatchCheckSum()
{
var existingCRC = this.message.CRC;
var calculatedCRC = this.message.CalculateCRC();
return existingCRC[0] == calculatedCRC[1]
&& existingCRC[1] == calculatedCRC[0];
}
}
}
@@ -1,51 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages
{
using System;
public class SirtMessage
{
protected readonly SirtMessageStructure message = new SirtMessageStructure();
public SirtMessage()
{
}
public SirtMessage(Byte[] bytes) => this.message = bytes;
public Int32 Length => this.message.BytesCount;
public Byte Cmd => this.message.Cmd;
public UInt32 Address
{
get
{
var address = this.message.Address;
Array.Reverse(address);
return BitConverter.ToUInt32(address, 0);
}
set
{
var address = BitConverter.GetBytes(value);
Array.Reverse(address);
this.message.Address = address;
}
}
public Byte[] Payload
{
get => this.message.Payload;
set => this.message.Payload = value;
}
protected virtual Byte[] ToByteArray()
=> this.message;
public static implicit operator Byte[] (SirtMessage message)
=> message.ToByteArray();
}
}
@@ -1,152 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages
{
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public class SirtMessageStructure
{
private Byte[] bytes;
public SirtMessageStructure() => this.bytes = new Byte[SirtFixed.MinLength];
private SirtMessageStructure(Byte[] bytes) => this.bytes = bytes;
public Int32 BytesCount => this.bytes.Length;
public Byte Start
{
get => this.bytes[0];
set => this.bytes[0] = value;
}
public Byte Cmd
{
get => this.bytes[1];
set => this.bytes[1] = value;
}
public Byte P1
{
get => this.bytes[2];
set => this.bytes[2] = value;
}
public Byte P2
{
get => this.bytes[3];
set => this.bytes[3] = value;
}
public Byte[] Address
{
get
{
var address = new Byte[4];
Array.Copy(this.bytes, 4, address, 0, 4);
return address;
}
set => Array.Copy(value, 0, this.bytes, 4, 4);
}
public Byte Length
{
get => this.bytes[8];
set => this.bytes[8] = value;
}
public Byte[] Payload
{
get
{
var payload = new Byte[this.Length];
Array.Copy(this.bytes, 9, payload, 0, this.Length);
return payload;
}
set
{
if (value is null)
{
value = new Byte[0];
}
this.Length = (Byte)value.Length;
var newLength = SirtFixed.MinLength + this.Length;
Array.Resize(ref this.bytes, newLength);
Array.Copy(value, 0, this.bytes, 9, this.Length);
}
}
public Byte[] CRC
{
get
{
var crc = new Byte[2];
Array.Copy(this.bytes, this.bytes.Length - 3, crc, 0, 2);
return crc;
}
set => Array.Copy(value, 0, this.bytes, this.bytes.Length - 3, 2);
}
public Byte Stop => this.bytes[this.bytes.Length - 1];
public Byte[] CalculateCRC()
{
var crcSum = default(UInt16);
var length = this.bytes.Length - 3;
crcSum = 0xFFFF;
for (int index = 1; index < length; index++)
{
var @byte = bytes[index];
for (int bit = 0; bit < 8; bit++)
{
var test = default(Byte);
if ((crcSum & 0x8000) != 0)
{
test = 0x80;
}
crcSum <<= 1;
if (((@byte & 0x80) ^ test) != 0)
{
crcSum ^= 0x1021;
}
@byte <<= 1;
}
}
return BitConverter.GetBytes(crcSum);
}
private Byte[] ToByteArray()
{
var crc = this.CalculateCRC();
var length = this.bytes.Length;
this.bytes[length - 3] = crc[1];
this.bytes[length - 2] = crc[0];
this.bytes[length - 1] = SirtFixed.StopByte;
return this.bytes;
}
public static implicit operator SirtMessageStructure(Byte[] bytes)
=> new SirtMessageStructure(bytes);
public static implicit operator Byte[](SirtMessageStructure message)
=> message.ToByteArray();
}
}
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -0,0 +1,52 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
public struct CRC1021
{
private CRC1021(Byte[] crc)
{
this.MSB = crc[1];
this.LSB = crc[0];
}
public Byte MSB { get; }
public Byte LSB { get; }
public static CRC1021 CalculateCRC1021(Byte[] bytes, Int32 start, Int32 length)
{
var crc = default(UInt16);
crc = 0xFFFF;
for (var index = start; index < length; index++)
{
var @byte = bytes[index];
for (var bit = 0; bit < 8; bit++)
{
var test = default(Byte);
if ((crc & 0x8000) != 0)
{
test = 0x80;
}
crc <<= 1;
if (((@byte & 0x80) ^ test) != 0)
{
crc ^= 0x1021;
}
@byte <<= 1;
}
}
return BitConverter.GetBytes(crc);
}
public static implicit operator CRC1021(Byte[] crc) => new CRC1021(crc);
}
}
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
public enum OperatingModes
{
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,4 +1,4 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters
namespace Common.Hardware.Interfaces.Ports.SIRT.Parameters
{
using System;
@@ -1,10 +1,10 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Requests
namespace Common.Hardware.Interfaces.Ports.SIRT.Requests
{
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public class ReadPamRequest : SirtRequest
public class ReadPamRequest : SirtMessage
{
/// <summary>
/// <list>
@@ -20,14 +20,14 @@
/// </summary>
public Boolean PamStruct
{
get => this.message.P1 == 1;
set => this.message.P1 = (Byte)(value ? 1 : 0);
get => this.P1 == 1;
set => this.P1 = (Byte)(value ? 1 : 0);
}
protected override Byte[] ToByteArray()
{
this.message.Start = SirtFixed.Pc2Sirt;
this.message.Cmd = SirtFixed.ReadPam;
this.Start = SirtConstants.Pc2Sirt;
this.Cmd = SirtConstants.ReadPam;
return base.ToByteArray();
}
@@ -0,0 +1,24 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Requests
{
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public class ReadRegRequest : SirtMessage
{
public Byte ReadLength
{
get => this.P2;
set => this.P2 = value;
}
protected override Byte[] ToByteArray()
{
this.Start = SirtConstants.Pc2Sirt;
this.Cmd = SirtConstants.ReadReg;
this.P2 = this.ReadLength;
return base.ToByteArray();
}
}
}
@@ -1,11 +1,11 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Requests
namespace Common.Hardware.Interfaces.Ports.SIRT.Requests
{
using Common.Hardware.Interfaces.Ports.SIRT;
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters;
using Common.Hardware.Interfaces.Ports.SIRT.Parameters;
using System;
public class WritePamRequest : SirtRequest
public class WritePamRequest : SirtMessage
{
private readonly P811 parameter811 = default(Byte);
@@ -74,9 +74,9 @@
protected override Byte[] ToByteArray()
{
this.message.Start = SirtFixed.Pc2Sirt;
this.message.Cmd = SirtFixed.WritePam;
this.message.P1 = this.parameter811;
this.Start = SirtConstants.Pc2Sirt;
this.Cmd = SirtConstants.WritePam;
this.P1 = this.parameter811;
return base.ToByteArray();
}
@@ -0,0 +1,18 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Requests
{
using Common.Hardware.Interfaces.Ports.SIRT;
using System;
public class WriteRegRequest : SirtMessage
{
protected override Byte[] ToByteArray()
{
this.Start = SirtConstants.Pc2Sirt;
this.Cmd = SirtConstants.WriteReg;
this.P2 = this.Length;
return base.ToByteArray();
}
}
}
@@ -1,15 +1,15 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses
namespace Common.Hardware.Interfaces.Ports.SIRT.Responses
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters;
using Common.Hardware.Interfaces.Ports.SIRT.Parameters;
using System;
public class AckOrAnswerResponse : SirtResponse
public class AckOrAnswerResponse : SirtMessage
{
private readonly P12 parameterP12;
public AckOrAnswerResponse(Byte[] bytes) : base(bytes)
=> this.parameterP12 = this.message.P1;
=> this.parameterP12 = this.P1;
/// <summary>
/// <inheritdoc cref="P12.BufFull"/>
@@ -51,6 +51,6 @@
/// </summary>
public Boolean WildCardAddr => this.parameterP12.WildCardAddr;
public Byte LastCmd => this.message.P2;
public Byte LastCmd => this.P2;
}
}
@@ -1,17 +1,17 @@
namespace Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses
namespace Common.Hardware.Interfaces.Ports.SIRT.Responses
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters;
using Common.Hardware.Interfaces.Ports.SIRT.Parameters;
using System;
public class FromAirResponse : SirtResponse
public class FromAirResponse : SirtMessage
{
private readonly P11 parameterP11;
private Int32 mhz;
public FromAirResponse(Byte[] bytes) : base(bytes)
=> this.parameterP11 = this.message.P1;
=> this.parameterP11 = this.P1;
/// <summary>
/// <inheritdoc cref="P11.SrcChannel"/>
@@ -53,16 +53,14 @@
/// </summary>
public Boolean ModeSensus => this.parameterP11.ModeSensus;
public MessageTypes MessageType => (MessageTypes)this.Payload[0];
public Int32 MHz
{
get => this.mhz;
set
{
this.mhz = value;
this.ReceivePowerDbm = this.CalculateReceivePowerDbm(this.mhz, this.message.P2);
this.ReceivePowerPer = this.CalculateReceivePowerPer(this.mhz, this.message.P2);
this.ReceivePowerDbm = this.CalculateReceivePowerDbm(this.mhz, this.P2);
this.ReceivePowerPer = this.CalculateReceivePowerPer(this.mhz, this.P2);
}
}
@@ -1,124 +0,0 @@
namespace Common.Hardware.Interfaces.Ports.SIRT
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
public class SirtPort : SerialPort
{
private readonly List<Byte> buffer;
public SirtPort(String serialPortName)
: base(new SerialPortSettings
{
BaudRate = SerialPortBaudRate.X115200,
DataBits = SerialPortDataBits.X8,
Parity = SerialPortParity.None,
PortName = serialPortName,
StopBits = SerialPortStopBits.One
})
=> this.buffer = new List<Byte>();
public event Action<AckOrAnswerResponse> AckOrAnswerReceived;
public event Action<FromAirResponse> FromAirReceived;
public override void Open()
{
base.Open();
Task.Factory
.StartNew(this.StartParsing, this, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default)
.ContinueWith(task =>
{
if (task.Exception != null)
{
this.NotifyInfoMessage(task.Exception.ToString());
}
this.Close();
});
}
public void Write(Byte[] bytes)
=> base.Write(bytes, 0, bytes.Length);
private void StartParsing(Object state)
{
var port = state as SirtPort;
if (port is null)
{
return;
}
var buffer = port.buffer;
while (true)
{
var bytes = port.Read();
if (bytes.Length > 0)
{
buffer.AddRange(bytes);
}
while (true)
{
var bufferLength = buffer.Count;
if (bufferLength < SirtFixed.MinLength)
{
break;
}
var start = buffer.IndexOf(SirtFixed.Sirt2Pc);
if (start < 0)
{
buffer.RemoveRange(0, bufferLength);
break;
}
var lengthIndex = start + SirtFixed.LengthIndex;
if (lengthIndex >= bufferLength)
{
break;
}
var length = buffer[lengthIndex];
var dataLength = length + SirtFixed.MinLength;
if (start + dataLength > bufferLength)
{
break;
}
var data = new Byte[dataLength];
buffer.CopyTo(start, data, 0, dataLength);
buffer.RemoveRange(0, start + dataLength);
var cmd = data[SirtFixed.CmdIndex];
if (cmd == SirtFixed.FromAir)
{
this.FromAirReceived?.Invoke(new FromAirResponse(data));
}
else if (cmd == SirtFixed.AckOrAnswer)
{
this.AckOrAnswerReceived?.Invoke(new AckOrAnswerResponse(data));
}
else
{
this.NotifyInfoMessage(BitConverter.ToString(data));
}
}
}
}
}
}
@@ -0,0 +1,137 @@
namespace Common.Hardware.Interfaces.Ports.SIRT
{
using Common.Hardware.Interfaces.Ports.SIRT.Parameters;
using Common.Hardware.Interfaces.Ports.SIRT.Requests;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
public class SirtBroadcaster : SirtSerialPort
{
private static readonly ConcurrentDictionary<UInt32, Queue<SirtTask>> tasks
= new ConcurrentDictionary<UInt32, Queue<SirtTask>>();
public SirtBroadcaster(SerialPortSettings settings) : base(settings)
=> this.DataReceived += this.SirtBroadcaster_DataReceived;
public String SirtId { get; private set; }
public Int32 Frequency { get; private set; }
public Boolean Ready { get; private set; }
public override void Open()
{
base.Open();
_ = this.Write(new WriteRegRequest
{
Address = 0x20000000,
Payload = new Byte[]
{
new SirtOperating
{
// standard
},
new BluetoothOperating
{
BtOff = true,
},
new RFModuleOperating
{
RfOff = true
},
new RFModuleOperating
{
OpMode = OperatingModes.ReceiveF1TransmitSensusRFF3
},
new PamTimeout
{
Minutes = 1
}
}
});
var manuelResetEventSlim = new ManualResetEventSlim();
var sirtTask = this.Write(new ReadRegRequest
{
ReadLength = 8,
Address = 0x11001820
});
sirtTask.Done += task =>
{
var payload = task.Last.Payload;
if (payload?.Length > 0)
{
this.SirtId = BitConverter.ToString(task.Last.Payload);
if (this.SirtId.Length >= 11)
{
this.Frequency = this.SirtId[10] == '1' ? 433 : 868;
this.Ready = true;
}
}
manuelResetEventSlim.Set();
};
manuelResetEventSlim.Wait();
if (!this.Ready)
{
this.Close();
}
}
public SirtTask Write(SirtMessage request)
{
var task = new SirtTask(request);
task.Done += Task_Done;
var queue = tasks
.GetOrAdd(task.Address, new Queue<SirtTask>());
queue.Enqueue(task);
if (queue.Count == 1)
{
base.Write(task);
}
return task;
}
private void Task_Done(SirtTask task)
{
if (tasks.TryGetValue(task.Address, out var queue))
{
if (queue.Count > 0)
{
queue.Dequeue();
}
if (queue.Count > 0)
{
this.Write(queue.Peek());
}
else
{
tasks.TryRemove(task.Address, out var _);
}
}
}
private void SirtBroadcaster_DataReceived(Byte[] data)
{
var response = new SirtMessage(data);
if (tasks.TryGetValue(response.Address, out var queue) && queue.Count > 0)
{
queue.Peek().AddResponse(response);
}
}
}
}
@@ -2,13 +2,14 @@
{
using System;
public static class SirtFixed
public static class SirtConstants
{
public const Byte AckOrAnswer = 0x12;
public const Int32 CmdIndex = 1;
public const Byte FromAir = 0x11;
public const Int32 LengthIndex = 0x08;
public const Int32 LengthIndex = 8;
public const Int32 MinLength = 12;
public const Byte AckOrAnswer = 0x12;
public const Byte FromAir = 0x11;
public const Byte Pc2Sirt = 0x55;
public const Byte ReadPam = 0x82;
public const Byte ReadReg = 0x87;
@@ -16,5 +17,14 @@
public const Byte StopByte = 0x16;
public const Byte WritePam = 0x81;
public const Byte WriteReg = 0x84;
public const Byte Bup = 0x00;
public const Byte Lat = 0x01;
public const Byte Semi = 0x08;
public const Byte Logger = 0x09;
public const Byte Test = 0x0A;
public const Byte Debug = 0x0B;
public const Byte EncFlexNet = 0x10;
public const Byte Pam = 0x20;
}
}
@@ -0,0 +1,139 @@
namespace Common.Hardware.Interfaces.Ports.SIRT
{
using Common.Hardware.Interfaces.Ports.SIRT.Parameters;
using System;
public class SirtMessage
{
private Byte[] bytes;
private Int32 bytesLength;
public SirtMessage()
{
this.bytes = new Byte[SirtConstants.MinLength];
this.bytesLength = this.bytes.Length;
}
public SirtMessage(Byte[] bytes)
{
this.bytes = bytes;
this.bytesLength = this.bytes.Length;
}
public Byte Start
{
get => this.bytes[0];
set => this.bytes[0] = value;
}
public Byte Cmd
{
get => this.bytes[1];
set => this.bytes[1] = value;
}
public Byte P1
{
get => this.bytes[2];
set => this.bytes[2] = value;
}
public Byte P2
{
get => this.bytes[3];
set => this.bytes[3] = value;
}
public UInt32 Address
{
get
{
var address = new Byte[4];
Array.Copy(this.bytes, 4, address, 0, 4);
Array.Reverse(address);
return BitConverter.ToUInt32(address, 0);
}
set
{
var address = BitConverter.GetBytes(value);
Array.Reverse(address);
Array.Copy(address, 0, this.bytes, 4, 4);
}
}
public Byte Length
{
get => this.bytes[8];
set
{
this.bytes[8] = value;
var newLength = SirtConstants.MinLength + value;
Array.Resize(ref this.bytes, newLength);
this.bytesLength = this.bytes.Length;
}
}
public Byte[] Payload
{
get
{
var payload = new Byte[this.Length];
Array.Copy(this.bytes, 9, payload, 0, this.Length);
return payload;
}
set
{
if (value is null)
{
value = new Byte[0];
}
this.Length = (Byte)value.Length;
var newLength = SirtConstants.MinLength + this.Length;
Array.Resize(ref this.bytes, newLength);
Array.Copy(value, 0, this.bytes, 9, this.Length);
this.bytesLength = this.bytes.Length;
}
}
public Byte[] CRC => new Byte[]
{
this.bytes[this.bytesLength - 3],
this.bytes[this.bytesLength - 2],
};
public Byte Stop => this.bytes[this.bytesLength - 1];
public override String ToString()
=> BitConverter.ToString(this.ToByteArray());
protected virtual Byte[] ToByteArray()
{
var crc = CRC1021.CalculateCRC1021(this.bytes, 1, this.bytesLength - 3);
this.bytes[this.bytesLength - 3] = crc.MSB;
this.bytes[this.bytesLength - 2] = crc.LSB;
this.bytes[this.bytesLength - 1] = SirtConstants.StopByte;
return this.bytes;
}
public static implicit operator SirtMessage(Byte[] bytes)
=> new SirtMessage(bytes);
public static implicit operator Byte[](SirtMessage message)
=> message.ToByteArray();
public static implicit operator String (SirtMessage message)
=> message.ToString();
}
}
@@ -0,0 +1,47 @@
namespace Common.Hardware.Interfaces.Ports.SIRT
{
using System;
using System.Collections.Generic;
public class SirtTask
{
private readonly SirtMessage request;
private readonly ICollection<SirtMessage> responses;
public SirtTask(SirtMessage request)
{
this.request = request;
this.Address = this.request.Address;
this.responses = new List<SirtMessage>();
}
public event Action<SirtTask> Done;
public UInt32 Address { get; }
public Boolean IsDone { get; private set; }
public SirtMessage Last { get; private set; }
internal void AddResponse(SirtMessage response)
{
if (!this.IsDone)
{
this.Last = response;
}
this.responses.Add(response);
if ((response.Cmd == SirtConstants.FromAir && response.Payload[0] == SirtConstants.Semi)
|| (response.Cmd == SirtConstants.AckOrAnswer && response.Payload.Length > 0))
{
this.IsDone = true;
this.Done?.Invoke(this);
}
}
public static implicit operator Byte[](SirtTask task)
=> task.request;
}
}
@@ -46,11 +46,11 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SerialPortBaudRate.cs" />
<Compile Include="SerialPortDataBits.cs" />
<Compile Include="SerialPortDataEncoder.cs" />
<Compile Include="SerialPortEncoding.cs" />
<Compile Include="SerialPortExtensions.cs" />
<Compile Include="SerialPortParity.cs" />
<Compile Include="SerialPortSettings.cs" />
<Compile Include="SerialPortStopBits.cs" />
<Compile Include="SirtSerialPort.cs" />
<Compile Include="UniProSerialPort.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -23,7 +23,7 @@
this.serialPortBase.Write(bytes, 0, bytes.Length);
var timeout = 10;
var timeout = 3;
var answerd = false;
var buffer = new Byte[0];
@@ -35,12 +35,12 @@
var bytesLength = _bytes.Length;
var bufferLength = buffer.Length;
Array.Resize(ref buffer, bufferLength + bytesLength);
Thread.Sleep(50);
Array.Resize(ref buffer, bufferLength + bytesLength);
Thread.Sleep(50);
Array.Copy(_bytes, 0, buffer, bufferLength, bytesLength);
Thread.Sleep(50);
if (buffer.TryParseFromIrda(out _data))
@@ -17,9 +17,9 @@
public Boolean IsOpen => this.serialPortBase.IsOpen;
public void Close() => this.serialPortBase.Close();
public virtual void Close() => this.serialPortBase.Close();
public void EnsureConnected()
public virtual void EnsureConnected()
{
if (!this.serialPortBase.IsOpen)
{
@@ -28,7 +28,7 @@
}
}
public void Open() => this.serialPortBase.Open();
public virtual void Open() => this.serialPortBase.Open();
public abstract Byte[] Write(params Byte[] data);
}
@@ -76,7 +76,7 @@
Parity = this.settings.Parity,
PortName = this.PortName,
StopBits = this.settings.StopBits,
ReadTimeout = 3000,
ReadTimeout = this.settings.RWTimeout,
};
if (serialPorts.TryAdd(this.PortName, serialPort))
@@ -143,7 +143,12 @@
{
try
{
serialPort.Write(bytes, start, length);
var lock_obj = new object();
lock (lock_obj)
{
serialPort.Write(bytes, start, length);
}
this.NotifyInfoMessage($"TX|{BitConverter.ToString(bytes)}");
}
@@ -1,11 +0,0 @@
namespace Common.Hardware.Interfaces.Ports
{
using System;
public abstract class SerialPortDataEncoder
{
public abstract bool TryDecode(Byte[] bytes, out Byte[] data);
public abstract bool TryEncode(Byte[] data, out Byte[] bytes);
}
}
@@ -2,7 +2,7 @@
{
using System;
public static class SerialPortEncoding
public static class SerialPortExtensions
{
public const Byte UNIPRO_START = 0x53;
public const Byte UNIPRO_PC2REG = 0x57;
@@ -13,5 +13,7 @@
public String PortName { get; set; }
public SerialPortStopBits StopBits { get; set; }
public Int32 RWTimeout { get; set; } = 3000;
}
}
@@ -0,0 +1,144 @@
namespace Common.Hardware.Interfaces.Ports
{
using System;
using System.Threading;
using System.Threading.Tasks;
public class SirtSerialPort : SerialPort
{
private CancellationTokenSource cancellationTokenSource;
private CancellationToken cancellationToken;
private Task listener;
private bool listening;
public SirtSerialPort(SerialPortSettings settings) : base(settings)
{
}
protected event Action<Byte[]> DataReceived;
public override void Close()
{
this.StopListening();
base.Close();
}
public override void EnsureConnected()
{
base.EnsureConnected();
if (!this.listening)
{
this.StopListening();
this.StartListening();
}
}
public override void Open()
{
base.Open();
this.StartListening();
}
public override Byte[] Write(params Byte[] data)
{
this.serialPortBase.Write(data, 0, data.Length);
return data;
}
private void StartListening()
{
this.cancellationTokenSource = new CancellationTokenSource();
this.cancellationToken = this.cancellationTokenSource.Token;
this.listener = Task.Factory.StartNew(asyncState =>
{
if (asyncState is SirtSerialPort sirtSerialPort)
{
sirtSerialPort.listening = true;
const Byte SIRT2PC = 0xFF;
const Byte LENINDEX = 8;
const Byte MINLEN = 12;
var buffer = new Byte[0];
while (true)
{
var bytesIn = sirtSerialPort.serialPortBase.Read();
var bytesInLength = bytesIn.Length;
var bufferLength = buffer.Length;
Array.Resize(ref buffer, bufferLength + bytesInLength);
Array.Copy(bytesIn, 0, buffer, bufferLength, bytesInLength);
var start = Array.IndexOf(buffer, SIRT2PC);
if (start < 0)
{
Array.Resize(ref buffer, 0);
continue;
}
bufferLength = buffer.Length;
var lengthIndex = start + LENINDEX;
if (lengthIndex >= bufferLength)
{
continue;
}
var dataLength = buffer[lengthIndex] + MINLEN;
var holeLength = start + dataLength;
if (holeLength > bufferLength)
{
continue;
}
var data = new Byte[dataLength];
Array.Copy(buffer, start, data, 0, dataLength);
var _buffer = new Byte[bufferLength - dataLength];
Array.Copy(buffer, holeLength, _buffer, 0, bufferLength - holeLength);
buffer = _buffer;
sirtSerialPort?.DataReceived(data);
}
}
}, this, this.cancellationToken)
.ContinueWith(task =>
{
if (task.AsyncState is SirtSerialPort sirtSerialPort)
{
if (task.Exception != null)
{
sirtSerialPort.serialPortBase.NotifyInfoMessage(task.Exception.ToString());
}
sirtSerialPort.listening = false;
sirtSerialPort.StopListening();
}
}, this.cancellationToken);
}
private void StopListening()
{
try
{
this.cancellationTokenSource?.Cancel();
}
catch (Exception e)
{
this.serialPortBase.NotifyInfoMessage(e.ToString());
}
}
}
}
@@ -21,7 +21,7 @@
Thread.Sleep(100);
var timeout = 10;
var timeout = 3;
var answerd = false;
var buffer = new Byte[0];
@@ -36,11 +36,9 @@
Thread.Sleep(100);
Array.Resize(ref buffer, bufferLength + bytesLength);
Thread.Sleep(100);
Array.Copy(_bytes, 0, buffer, bufferLength, bytesLength);
Thread.Sleep(100);
if (buffer.TryParseFromUniPro(out _data))
@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DE225BDD-7DCD-4F4F-9E3F-348589DFE93C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common.Hardware.Interfaces.Protocols.SIRT</RootNamespace>
<AssemblyName>Common.Hardware.Interfaces.Protocols.SIRT</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AuthLevel.cs" />
<Compile Include="CompilerServices.cs" />
<Compile Include="Payloads\Ack.cs" />
<Compile Include="Payloads\Answer.cs" />
<Compile Include="Payloads\Bup.cs" />
<Compile Include="Payloads\Debug.cs" />
<Compile Include="Payloads\Lat.cs" />
<Compile Include="Payloads\Semi.cs" />
<Compile Include="SirtAddresses.cs" />
<Compile Include="SirtTask.cs" />
<Compile Include="SirtBroadcaster.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Ports\Common.Hardware.Interfaces.Ports.SIRT\Common.Hardware.Interfaces.Ports.SIRT.csproj">
<Project>{B23BFAF9-08AE-4311-8C08-FB2BB49EA2AD}</Project>
<Name>Common.Hardware.Interfaces.Ports.SIRT</Name>
</ProjectReference>
<ProjectReference Include="..\..\Ports\Common.Hardware.Interfaces.Ports\Common.Hardware.Interfaces.Ports.csproj">
<Project>{9AE071C0-DB12-4E09-A3C7-43F6DCD518D6}</Project>
<Name>Common.Hardware.Interfaces.Ports</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,17 +0,0 @@
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class CallerMemberNameAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class CallerFilePathAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
public class CallerLineNumberAttribute : Attribute
{
}
}
@@ -1,12 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT.Payloads
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
internal class Ack
{
private readonly AckOrAnswerResponse response;
public Ack(AckOrAnswerResponse response)
=> this.response = response;
}
}
@@ -1,12 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT.Payloads
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
internal class Answer
{
private readonly AckOrAnswerResponse response;
public Answer(AckOrAnswerResponse response)
=> this.response = response;
}
}
@@ -1,31 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT.Payloads
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
using System;
public class Bup : FromAirResponse
{
public Bup(FromAirResponse response) : base(response)
{
var payload = response.Payload;
var index = 0;
this.AppCode = payload[index++];
this.Counter = payload[index++];
this.Serial = BitConverter.ToUInt32(payload, index += 4);
this.Reading = BitConverter.ToUInt32(payload, index += 4);
this.Alarm = payload[index++];
}
public Byte AppCode { get; }
public Byte Counter { get; }
public UInt32 Serial { get; }
public UInt32 Reading { get; }
public Byte Alarm { get; }
}
}
@@ -1,11 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT.Payloads
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
public class Lat : Bup
{
public Lat(FromAirResponse response) : base(response)
{
}
}
}
@@ -1,146 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT.Payloads
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
using System;
using System.Text;
public class Semi : FromAirResponse
{
public Semi(FromAirResponse response) : base(response)
{
var payload = this.Payload;
var index = 0;
this.ModuleAddress = BitConverter.ToUInt32(payload, index += 4);
this.DisplayVolume = BitConverter.ToUInt32(payload, index += 4);
this.Alarms = payload[index++];
this.PamStatus = payload[index++];
this.PamRssi = payload[index++];
this.MeterType = payload[index++];
this.TransmissionInterval = BitConverter.ToUInt16(payload, index += 2);
this.LATInterval = BitConverter.ToUInt16(payload, index += 2);
this.CurrentFlow = BitConverter.ToUInt16(payload, index += 2);
this.BackwardVolume = BitConverter.ToUInt32(payload, index += 4);
this.NumberOfDials = payload[index++];
this.Units = payload[index++];
this.MeterID = BitConverter.ToUInt32(payload, index += 4);
this.MBusStatus = payload[index++];
this.MBusTransmissionInterval = BitConverter.ToUInt16(payload, index += 2);
this.AlarmActiveInformation = payload[index++];
this.LeakageDetectionParameters = payload[index++];
this.BrokenPipeDetectionParameters = payload[index++];
this.BatteryRemaining = BitConverter.ToUInt16(payload, index += 2);
this.BatteryEndDetected = BitConverter.ToUInt16(payload, index += 2);
this.MaximumFlow = BitConverter.ToUInt16(payload, index += 2);
this.TimeOfMaximumFlow = BitConverter.ToUInt16(payload, index += 2);
this.LowBatteryDetected = BitConverter.ToUInt16(payload, index += 2);
this.LeakStart = BitConverter.ToUInt16(payload, index += 2);
this.LeakEnd = BitConverter.ToUInt16(payload, index += 2);
this.MagneticTamperStart = BitConverter.ToUInt16(payload, index += 2);
this.MagneticTamperEnd = BitConverter.ToUInt16(payload, index += 2);
this.ModuleRemoveStart = BitConverter.ToUInt16(payload, index += 2);
this.ModuleRemoveEnd = BitConverter.ToUInt16(payload, index += 2);
this.BackflowStart = BitConverter.ToUInt16(payload, index += 2);
this.BackflowEnd = BitConverter.ToUInt16(payload, index += 2);
this.BrokenPipeStart = BitConverter.ToUInt16(payload, index += 2);
this.BrokenPipeEnd = BitConverter.ToUInt16(payload, index += 2);
this.LogContent = BitConverter.ToUInt16(payload, index += 2);
this.LoggingInterval = BitConverter.ToUInt16(payload, index += 2);
this.FixedDateReadingContent = BitConverter.ToUInt16(payload, index += 2);
this.DayOfMonth = payload[index++];
this.ActualDateTime = BitConverter.ToUInt32(payload, index += 4);
this.HistoricalErrorLimit = payload[index++];
this.CustomerSpecificText = Encoding.ASCII.GetString(payload, index += 9, 9);
this.TimeOfFDRReset = BitConverter.ToUInt16(payload, index += 2);
this.TimeOfLogReset = BitConverter.ToUInt16(payload, index += 2);
this.MeterSize = payload[index++];
}
public UInt32 ModuleAddress { get; }
public UInt32 DisplayVolume { get; }
public Byte Alarms { get; }
public Byte PamStatus { get; }
public Byte PamRssi { get; }
public Byte MeterType { get; }
public UInt16 TransmissionInterval { get; }
public UInt16 LATInterval { get; }
public UInt16 CurrentFlow { get; }
public UInt32 BackwardVolume { get; }
public Byte NumberOfDials { get; }
public Byte Units { get; }
public UInt32 MeterID { get; }
public Byte MBusStatus { get; }
public UInt16 MBusTransmissionInterval { get; }
public Byte AlarmActiveInformation { get; }
public Byte LeakageDetectionParameters { get; }
public Byte BrokenPipeDetectionParameters { get; }
public UInt16 BatteryRemaining { get; }
public UInt16 BatteryEndDetected { get; }
public UInt16 MaximumFlow { get; }
public UInt16 TimeOfMaximumFlow { get; }
public UInt16 LowBatteryDetected { get; }
public UInt16 LeakStart { get; }
public UInt16 LeakEnd { get; }
public UInt16 MagneticTamperStart { get; }
public UInt16 MagneticTamperEnd { get; }
public UInt16 ModuleRemoveStart { get; }
public UInt16 ModuleRemoveEnd { get; }
public UInt16 BackflowStart { get; }
public UInt16 BackflowEnd { get; }
public UInt16 BrokenPipeStart { get; }
public UInt16 BrokenPipeEnd { get; }
public UInt16 LogContent { get; }
public UInt16 LoggingInterval { get; }
public UInt16 FixedDateReadingContent { get; }
public Byte DayOfMonth { get; }
public UInt32 ActualDateTime { get; }
public Byte HistoricalErrorLimit { get; }
public String CustomerSpecificText { get; }
public UInt16 TimeOfFDRReset { get; }
public UInt16 TimeOfLogReset { get; }
public Byte MeterSize { get; }
}
}
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common.Hardware.Interfaces.Protocols.SIRT")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Common.Hardware.Interfaces.Protocols.SIRT")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("de225bdd-7dcd-4f4f-9e3f-348589dfe93c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,11 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT
{
using System;
public class SirtAddresses
{
public const UInt32 Wildcard = 0xFFFFFFFF;
public const UInt32 IdNumberA = 0x11001820;
public const UInt32 SirtOperating = 0x20000000;
}
}
@@ -1,157 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT
{
using Common.Hardware.Interfaces.Ports.SIRT;
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Parameters;
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Requests;
using Common.Hardware.Interfaces.Ports.SIRT.Messages.Responses;
using Common.Hardware.Interfaces.Protocols.SIRT.Payloads;
using System;
using System.Collections.Concurrent;
public class SirtBroadcaster
{
private readonly SirtPort sirtPort;
private readonly ConcurrentDictionary<UInt32, Bup> availableAddresses;
private readonly ConcurrentDictionary<UInt32, ConcurrentQueue<SirtTask>> sirtTasks;
public SirtBroadcaster(string comport)
{
this.sirtPort = new SirtPort(comport);
this.sirtPort.AckOrAnswerReceived += this.AckOrAnswerReceived;
this.availableAddresses = new ConcurrentDictionary<UInt32, Bup>();
this.sirtTasks = new ConcurrentDictionary<UInt32, ConcurrentQueue<SirtTask>>();
}
public void Connect()
{
this.sirtPort.Logging += Console.WriteLine;
this.sirtPort.FromAirReceived += this.FromAirReceived;
this.availableAddresses.Clear();
this.sirtTasks.Clear();
this.sirtPort.Open();
this.sirtPort.Write(new WriteRegRequest
{
Address = SirtAddresses.SirtOperating,
Payload = new Byte[]
{
new SirtOperating
{
// standard
},
new BluetoothOperating
{
BtOff = true,
},
new RFModuleOperating
{
RfOff = true
},
new RFModuleOperating
{
OpMode = OperatingModes.ReceiveF1TransmitSensusRFF3
},
new PamTimeout
{
Minutes = 1,
}
}
});
}
public void Disconnect()
{
this.sirtPort.Logging -= Console.WriteLine;
this.sirtPort.FromAirReceived -= this.FromAirReceived;
this.availableAddresses.Clear();
this.sirtTasks.Clear();
this.sirtPort.Close();
}
private SirtTask SirtTask(SirtRequest request)
{
var task = new SirtTask(request);
this.sirtTasks
.GetOrAdd(task, new ConcurrentQueue<SirtTask>())
.Enqueue(task);
return task;
}
private void FromAirReceived(FromAirResponse response)
{
var address = response.Address;
if (this.sirtTasks.TryGetValue(address, out var queue) && queue.TryPeek(out var task))
{
if (response.MessageType == MessageTypes.Bup)
{
task.Add(new Bup(response));
}
else if (response.MessageType == MessageTypes.Lat)
{
task.Add(new Lat(response));
}
else if (response.MessageType == MessageTypes.Semi)
{
task.Add(new Semi(response));
}
else if (response.MessageType == MessageTypes.Debug)
{
task.Add(new Debug(response));
}
else if (response.MessageType == MessageTypes.Logger)
{
// TODO: TBD
// TODO: logging
}
else if (response.MessageType == MessageTypes.Test)
{
// TODO: TBD
// TODO: logging
}
else if (response.MessageType == MessageTypes.EncFlexNet)
{
// TODO: TBD
// TODO: logging
}
else if (response.MessageType == MessageTypes.Pam)
{
// TODO: TBD
// TODO: logging
}
}
else
{
// TODO: logging
}
}
private void AckOrAnswerReceived(AckOrAnswerResponse response)
{
var address = response.Address;
if (this.sirtTasks.TryGetValue(address, out var queue) && queue.TryPeek(out var task))
{
var payloadLength = response.Payload.Length;
if (payloadLength == 0)
{
task.Add(new Ack(response));
}
else
{
task.Add(new Answer(response));
}
}
else
{
// TODO: logging
}
}
}
}
@@ -1,86 +0,0 @@
namespace Common.Hardware.Interfaces.Protocols.SIRT
{
using Common.Hardware.Interfaces.Ports.SIRT.Messages;
using Common.Hardware.Interfaces.Protocols.SIRT.Payloads;
using System;
public class SirtTask
{
private static UInt64 taskNr;
private readonly SirtMessage request;
public SirtTask(SirtMessage request)
{
this.request = request;
this.Nr = ++taskNr;
}
public event Action<SirtTask> Done;
public UInt64 Nr { get; }
public UInt32 Address => this.request.Address;
public Boolean IsRunning { get; private set; }
public override Boolean Equals(object other)
=> other is SirtTask task
&& task.Address == this.Address;
public override Int32 GetHashCode()
=> (Int32)this.Address;
public override String ToString()
=> this.Address.ToString();
internal void Add(Bup bup)
{
Console.WriteLine(bup);
}
internal void Add(Lat lat)
{
Console.WriteLine(lat);
}
internal void Add(Semi semi)
{
this.IsRunning = false;
this.Done?.Invoke(this);
Console.WriteLine(semi);
}
internal void Add(Debug debug)
{
Console.WriteLine(debug);
}
internal void Add(Ack ack)
{
Console.WriteLine(ack);
}
internal void Add(Answer answer)
{
this.IsRunning = false;
this.Done?.Invoke(this);
Console.WriteLine(answer);
}
public static implicit operator SirtMessage(SirtTask task)
{
task.IsRunning = true;
return task.request;
}
public static implicit operator UInt32(SirtTask task)
=> task.Address;
}
}
@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{88F2CD0A-1391-4848-8912-CB6938E84839}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common.Hardware.WaterMeter.Omni</RootNamespace>
<AssemblyName>Common.Hardware.WaterMeter.Omni</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Contracts\IMeter.cs" />
<Compile Include="Contracts\IMeterBatch.cs" />
<Compile Include="OmniBatch.cs" />
<Compile Include="OmniMeter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,10 +0,0 @@
namespace Common.Hardware.WaterMeter.Omni.Contracts
{
using System.Threading;
using System.Threading.Tasks;
public interface IMeter
{
Task ConnectAsync(CancellationToken cancellationToken);
}
}
@@ -1,9 +0,0 @@
namespace Common.Hardware.WaterMeter.Omni.Contracts
{
using System;
public interface IMeterBatch
{
IMeter AddMeter(String portName);
}
}
@@ -1,43 +0,0 @@
namespace Common.Hardware.WaterMeter.Omni
{
using Common.Hardware.WaterMeter.Omni.Contracts;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
public class OmniBatch : IMeterBatch
{
private readonly ICollection<IMeter> meters = new HashSet<IMeter>();
public IMeter AddMeter(String portName)
{
//var slotno = this.meters.Count + 1;
//var meter = new OmniMeter(slotno, portName);
//this.meters.Add(meter);
return null;
}
public Task ConnectMetersAsync(CancellationToken cancellationToken)
=> Task.Factory.ContinueWhenAll(
tasks: this.Call(x => x.ConnectAsync(cancellationToken)),
continuationAction: _ => { },
cancellationToken: cancellationToken);
protected Task[] Call(Func<IMeter, Task> executable)
{
var tasks = new Task[this.meters.Count];
var i = 0;
foreach (var meter in this.meters)
{
tasks[i++] = executable?.Invoke(meter);
}
return tasks;
}
}
}
@@ -1,18 +0,0 @@
namespace Common.Hardware.WaterMeter.Omni
{
using Common.Hardware.WaterMeter.Omni.Contracts;
using System;
public class OmniMeter //: IMeter
{
private Int32 slotno;
private String portName;
public OmniMeter(Int32 slotno, String portName)
{
this.slotno = slotno;
this.portName = portName;
}
}
}
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common.Hardware.WaterMeter.Omni")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Common.Hardware.WaterMeter.Omni")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("88f2cd0a-1391-4848-8912-cb6938e84839")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -10,7 +10,7 @@
this.bytes[1] = 0x01;
}
public EheadPCB(Byte[] bytes) : base(bytes)
public EheadPCB(Byte[] bytes) : base(bytes, bytes.Length)
{
}
@@ -31,7 +31,9 @@
public EheadPCB ViewEheadPCB()
{
return this.connection.Send();
var response = this.connection.Send(0xFA, 0x01);
return new EheadPCB(response);
}
public FactoryID ViewFactoryID()
@@ -119,6 +119,14 @@
return this;
}
public IHttpRequest WithPlainBody(String body)
{
this.message.Content = new StringContent(body);
this.message.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
return this;
}
private HttpRequestMessage GetHttpRequestMessage()
{
var requestURL = this.url;
@@ -7,8 +7,10 @@
IHttpRequest AddQueryParameter(String name, Object value);
IHttpResponse<T> GetResponse<T>();
IHttpRequest WithJsonBody(object body);
void Send();
IHttpRequest WithJsonBody(Object body);
IHttpRequest WithPlainBody(String body);
}
}
@@ -1,292 +0,0 @@
namespace SignalR
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
[Guid("C563D998-1B4C-46D7-8F44-05DD9D31C38F")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IDataDictionary
{
int Count { get; }
void AddBool(string property, bool value);
void AddByte(string property, byte value);
void AddDictionary(string property, DataDictionary value);
void AddDouble(string property, double value);
void AddInt(string property, int value);
void AddLong(string property, long value);
void AddString(string property, string value);
void AddValue(string property, object value);
bool GetBool(string property);
byte GetByte(string property);
DataDictionary GetDictionary(string property);
double GetDouble(string property);
float GetFloat(string property);
int GetInt(string property);
long GetLong(string property);
string GetProperty(int index);
string GetString(string property, string format = "{0}");
object GetValue(string property);
}
[Guid("7C27758C-784B-49C6-BED7-394F1D90AA74")]
[ComSourceInterfaces(typeof(IDataDictionary))]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("SignalR.DataDictionary")]
public class DataDictionary : IDataDictionary
{
private readonly IDictionary<string, object> data;
public DataDictionary()
{
this.data = new Dictionary<string, object>();
}
internal DataDictionary(Dictionary<string, object> data)
{
this.data = data;
}
public int Count
{
get => this.data.Count;
}
public void AddBool(string property, bool value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public void AddByte(string property, byte value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public void AddDictionary(string property, DataDictionary value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public void AddDouble(string property, double value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public void AddInt(string property, int value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public void AddLong(string property, long value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public void AddString(string property, string value)
{
this.ToLower(ref property);
this.data[property] = value;
}
internal Dictionary<string, object> Generic()
{
return this.data as Dictionary<string, object>;
}
public bool GetBool(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return this.Cast<bool>(value);
}
return default(bool);
}
public byte GetByte(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return this.Cast<byte>(value);
}
return default(byte);
}
public DataDictionary GetDictionary(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value) && value is DataDictionary _value)
{
return _value;
}
return default(DataDictionary);
}
public double GetDouble(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return this.Cast<double>(value);
}
return default(double);
}
public float GetFloat(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return this.Cast<float>(value);
}
return default(float);
}
public int GetInt(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return this.Cast<int>(value);
}
return default(int);
}
public long GetLong(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return this.Cast<long>(value);
}
return default(long);
}
public string GetProperty(int index)
{
var properties = this.data.Keys.ToArray();
var length = properties.Length;
if (0 <= index && index < length)
{
return properties[index];
}
return default(string);
}
public string GetString(string property, string format = "{0}")
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
try
{
return string.Format(format, value?.ToString());
}
catch (Exception e)
{
this.AddString(nameof(Exception), e.ToString());
}
}
return default(string);
}
private void ToLower(ref string property)
{
if (string.IsNullOrWhiteSpace(property))
{
property = string.Empty;
}
property = property.ToLower();
}
private T Cast<T>(object value)
{
try
{
value = Convert.ChangeType(value, typeof(T));
}
catch (Exception e)
{
this.AddString(nameof(Exception), e.ToString());
}
if (value is T _value)
{
return _value;
}
return default(T);
}
public void AddValue(string property, object value)
{
this.ToLower(ref property);
this.data[property] = value;
}
public object GetValue(string property)
{
this.ToLower(ref property);
if (this.data.TryGetValue(property, out var value))
{
return value;
}
return default(object);
}
}
}
-167
View File
@@ -1,167 +0,0 @@
namespace SignalR
{
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Client;
public delegate void DataReceivedHandler(DataDictionary data);
public delegate void StateHandler(string state);
[Guid("26CA0187-06E4-4A6E-B7EB-A57996365FEF")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IDataHub
{
void DataReceived(DataDictionary data);
void StateChanged(string state);
}
[Guid("B126CD14-DF35-4D56-B3B3-97D9FE606D61")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IDataHubClient
{
bool IsConnected { get; }
void Connect(string url);
void Disconnect();
void Send(DataDictionary dictionary);
}
[Guid("BBF1EDDB-84BC-4FA0-85E8-1B16BD331C42")]
[ComSourceInterfaces(typeof(IDataHub))]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("SignalR.DataHub")]
public class DataHub : IDataHubClient
{
private HubConnection connection;
private IDisposable disposable;
private IHubProxy proxy;
public DataHub()
{
}
public event DataReceivedHandler DataReceived;
public event StateHandler StateChanged;
public bool IsConnected
{
get
{
try
{
return this.connection?.State == ConnectionState.Connected;
}
catch (Exception e)
{
this.NotifyStateChanged(e);
return false;
}
}
}
public void Connect(string url)
{
this.connection = new HubConnection(url, queryString: $"key={Environment.MachineName}");
this.connection.Closed += this.Connection_Closed;
this.connection.ConnectionSlow += this.Connection_ConnectionSlow;
this.connection.Error += this.Connection_Error;
this.connection.Received += this.Connection_Received;
this.connection.Reconnected += this.Connection_Reconnected;
this.connection.Reconnecting += this.Connection_Reconnecting;
this.connection.StateChanged += this.Connection_StateChanged;
this.proxy = this.connection.CreateHubProxy("DataHub");
this.disposable = this.proxy.On<Dictionary<string, object>>(nameof(this.Send), this.Receive);
try
{
this.connection
.Start()
.Wait();
}
catch (Exception e)
{
this.NotifyStateChanged(e.ToString());
}
}
public void Disconnect()
{
Task.Factory.StartNew(() =>
{
try
{
this.disposable.Dispose();
}
catch (Exception e)
{
this.NotifyStateChanged(e);
}
try
{
this.connection.Stop();
}
catch (Exception e)
{
this.NotifyStateChanged(e);
}
});
}
public void Send(DataDictionary dictionary)
=> this.proxy.Invoke(nameof(this.Send), dictionary.Generic());
private void Connection_Closed()
{
this.NotifyStateChanged("Connection closed.");
}
private void Connection_ConnectionSlow()
{
this.NotifyStateChanged("Connection slow.");
}
private void Connection_Error(Exception exception)
{
this.NotifyStateChanged(exception);
}
private void Connection_Received(string data)
{
this.NotifyStateChanged(data);
}
private void Connection_Reconnected()
{
this.NotifyStateChanged("Connection reconnected.");
}
private void Connection_Reconnecting()
{
this.NotifyStateChanged("Connection reconnecting.");
}
private void Connection_StateChanged(StateChange state)
{
this.NotifyStateChanged(state);
}
private void NotifyStateChanged(object state)
{
this.StateChanged?.Invoke($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] {state}");
}
private void Receive(Dictionary<string, object> data)
{
this.DataReceived?.Invoke(new DataDictionary(data));
}
}
}
@@ -1,15 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("SignalR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SignalR")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(true)]
[assembly: Guid("abf3ec64-1257-4ca2-ad62-8a27a5f1edcc")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ABF3EC64-1257-4CA2-AD62-8A27A5F1EDCC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SignalR</RootNamespace>
<AssemblyName>SignalR</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNet.SignalR.Client, Version=2.4.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.AspNet.SignalR.Client.2.4.3\lib\net40\Microsoft.AspNet.SignalR.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataDictionary.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DataHub.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup></configuration>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.SignalR.Client" version="2.4.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net40" />
</packages>
@@ -1,10 +0,0 @@
namespace ExchangeHub.Contracts
{
public delegate void VoidEventHandler(string groupName);
public delegate void IntEventHandler(int value, string groupName);
public delegate void DoubleEventHandler(double value, string groupName);
public delegate void StringEventHandler(string value, string groupName);
}
@@ -1,43 +0,0 @@
namespace ExchangeHub.Contracts
{
using System;
using System.Runtime.InteropServices;
/// <summary>
/// Only for COM usage.
/// Exposes event handlers for the (VB6) master.
/// </summary>
[Guid("9FAA6100-E33F-46F7-9151-C85903472388")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IExchangeEvents
{
/// <summary>
/// On received: VB6 should stop all running tasks.
/// </summary>
void Disposed(string groupName);
/// <summary>
/// On received: VB6 should start given flow.
/// On sent: VB6 notifies that the flow is reached.
/// </summary>
void StartFlow(double valueM3H, string groupName);
/// <summary>
/// On received: VB6 should stop any flow.
/// On sent: VB6 notifies that the flow is stopped.
/// </summary>
void StopFlow(string groupName);
/// <summary>
/// On received: VB6 should start reference volume messuring.
/// On sent: VB6 notifies that the reference messuring has started.
/// </summary>
void StartReferenceMessurement(int durationSeconds, string groupName);
/// <summary>
/// On received: VB6 should stop reference volume messuring.
/// On sent: VB6 sends the volume messured.
/// </summary>
void StopReferenceMessurement(double valueM3, string groupName);
}
}
@@ -1,10 +0,0 @@
namespace ExchangeHub.Contracts
{
/// <summary>
/// <para>Only for the SignalR host.</para>
/// <para>Exposes used events as methods.</para>
/// </summary>
public interface IExchangeHub : IExchangeEvents
{
}
}
@@ -1,22 +0,0 @@
namespace ExchangeHub.Contracts
{
using System;
using System.Runtime.InteropServices;
[Guid("21EA6C57-A004-456E-8D99-7DCAD3481205")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IExchangeHubMaster : IExchangeHubSlave
{
void Connect(string url);
void SendDisposed(string _ = "");
void SendStartFlow(double volumeM3H, string _ = "");
void SendStopFlow(string _ = "");
void SendStartReferenceMessurement(int durationSeconds, string _ = "");
void SendStopReferenceMessurement(double volumeM3 = 0D, string _ = "");
}
}
@@ -1,15 +0,0 @@
namespace ExchangeHub.Contracts
{
public interface IExchangeHubSlave
{
event VoidEventHandler Disposed;
event DoubleEventHandler StartFlow;
event VoidEventHandler StopFlow;
event IntEventHandler StartReferenceMessurement;
event DoubleEventHandler StopReferenceMessurement;
}
}
@@ -1,236 +0,0 @@
namespace ExchangeHub
{
using ExchangeHub.Contracts;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Client;
[ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(IExchangeEvents))]
[Guid("2ABFAC6C-9F3C-4702-9E08-4979A26577EF")]
[ProgId("ExchangeHub.ExchangeConnection")]
public class ExchangeConnection : IExchangeHubMaster
{
public const string GROUP_KEY = "GroupNameKey";
public const string HUB_NAME = "ExchangeHub";
public const string STR_EMPTY = "";
private static readonly string GroupName = Environment.MachineName;
private readonly ICollection<IDisposable> disposables;
private HubConnection connection;
private IHubProxy proxy;
public ExchangeConnection()
=> this.disposables = new List<IDisposable>();
public event VoidEventHandler Disposed;
public event DoubleEventHandler StartFlow;
public event VoidEventHandler StopFlow;
public event IntEventHandler StartReferenceMessurement;
public event DoubleEventHandler StopReferenceMessurement;
public event StringEventHandler StateChanged;
public void Connect(string url)
{
this.connection = new HubConnection(url, queryString: $"{GROUP_KEY}={Environment.MachineName}");
this.connection.Closed += this.Connection_Closed;
this.connection.ConnectionSlow += this.Connection_ConnectionSlow;
this.connection.Error += this.Connection_Error;
this.connection.Received += this.Connection_Received;
this.connection.Reconnected += this.Connection_Reconnected;
this.connection.Reconnecting += this.Connection_Reconnecting;
this.connection.StateChanged += this.Connection_StateChanged;
this.proxy = this.connection.CreateHubProxy(HUB_NAME);
this.disposables.Add(this.proxy.On<string>( nameof(this.Disposed), this.ReceiveDisposed));
this.disposables.Add(this.proxy.On<double, string>( nameof(this.StartFlow), this.FlowStarted));
this.disposables.Add(this.proxy.On<string>( nameof(this.StopFlow), this.FlowStopped));
this.disposables.Add(this.proxy.On<int, string>( nameof(this.StartReferenceMessurement), this.MessurementStarted));
this.disposables.Add(this.proxy.On<double, string>( nameof(this.StopReferenceMessurement), this.MessurementStopped));
try
{
this.connection
.Start()
.Wait();
}
catch (Exception e)
{
this.NotifyStateChanged(e.ToString());
}
}
public void Disconnect()
{
try
{
this.SendDisposed();
this.connection.Closed -= this.Connection_Closed;
this.connection.ConnectionSlow -= this.Connection_ConnectionSlow;
this.connection.Error -= this.Connection_Error;
this.connection.Received -= this.Connection_Received;
this.connection.Reconnected -= this.Connection_Reconnected;
this.connection.Reconnecting -= this.Connection_Reconnecting;
this.connection.StateChanged -= this.Connection_StateChanged;
foreach (var disposable in this.disposables)
{
disposable.Dispose();
}
Task.Factory.StartNew(this.connection.Dispose);
this.NotifyStateChanged($"Connection disconnected.");
}
catch (Exception e)
{
this.NotifyStateChanged(e.ToString());
}
}
public void SendDisposed(string _ = STR_EMPTY)
{
if (this.connection?.State == ConnectionState.Connected)
{
this.proxy.Invoke<string>(nameof(this.Disposed), GroupName);
this.NotifyStateChanged($"{nameof(SendDisposed)}");
}
}
public void SendStartFlow(double volumeM3H, string _ = STR_EMPTY)
{
if (this.connection?.State == ConnectionState.Connected)
{
this.proxy.Invoke(nameof(this.StartFlow), volumeM3H, GroupName);
this.NotifyStateChanged($"{nameof(SendStartFlow)}");
}
}
public void SendStopFlow(string _ = STR_EMPTY)
{
if (this.connection?.State == ConnectionState.Connected)
{
this.proxy.Invoke(nameof(this.StopFlow), GroupName);
this.NotifyStateChanged($"{nameof(SendStopFlow)}");
}
}
public void SendStartReferenceMessurement(int durationSeconds, string _ = STR_EMPTY)
{
if (this.connection?.State == ConnectionState.Connected)
{
this.proxy.Invoke(nameof(this.StartReferenceMessurement), durationSeconds, GroupName);
this.NotifyStateChanged($"{nameof(SendStartReferenceMessurement)}");
}
}
public void SendStopReferenceMessurement(double volumeM3H = 0D, string _ = STR_EMPTY)
{
if (this.connection?.State == ConnectionState.Connected)
{
this.proxy.Invoke(nameof(this.StopReferenceMessurement), volumeM3H, GroupName);
this.NotifyStateChanged($"{nameof(SendStopReferenceMessurement)}");
}
}
private void ReceiveDisposed(string groupName)
{
if (GroupName == groupName)
{
this.Disposed?.Invoke(groupName);
this.NotifyStateChanged($"{nameof(Disposed)}");
}
}
private void FlowStarted(double volumeM3H, string groupName)
{
if (GroupName == groupName)
{
this.StartFlow?.Invoke(volumeM3H, groupName);
this.NotifyStateChanged($"{nameof(FlowStarted)} -> {volumeM3H}m³/h");
}
}
private void FlowStopped(string groupName)
{
if (GroupName == groupName)
{
this.StopFlow?.Invoke(groupName);
this.NotifyStateChanged($"{nameof(FlowStopped)}");
}
}
private void MessurementStarted(int seconds, string groupName)
{
if (GroupName == groupName)
{
this.StartReferenceMessurement?.Invoke(seconds, groupName);
this.NotifyStateChanged($"{nameof(MessurementStarted)} -> {seconds}s");
}
}
private void MessurementStopped(double volumeMessured, string groupName)
{
if (GroupName == groupName)
{
this.StopReferenceMessurement?.Invoke(volumeMessured, groupName);
this.NotifyStateChanged($"{nameof(MessurementStopped)} -> {volumeMessured}m³/h");
}
}
private void Connection_Closed()
{
this.NotifyStateChanged("HubConnection closed!");
}
private void Connection_ConnectionSlow()
{
this.NotifyStateChanged("HubConnection is about to timeout!");
}
private void Connection_Error(Exception e)
{
this.NotifyStateChanged(e.ToString());
}
private void Connection_Received(string data)
{
this.NotifyStateChanged(data);
}
private void Connection_Reconnected()
{
this.NotifyStateChanged("HubConnection reconnected!");
}
private void Connection_Reconnecting()
{
this.NotifyStateChanged("HubConnection reconnecting!");
}
private void Connection_StateChanged(StateChange state)
{
this.NotifyStateChanged($"{state.OldState} -> {state.NewState}");
}
private void NotifyStateChanged(string text)
{
try
{
this.StateChanged?.Invoke(text, GroupName);
}
catch (Exception e)
{
this.StateChanged?.Invoke(e.ToString(), GroupName);
}
}
}
}
@@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6033FF0C-CF32-4BC5-8EFE-4774CCDC663D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExchangeHub</RootNamespace>
<AssemblyName>ExchangeHub</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNet.SignalR.Client">
<HintPath>..\..\packages\Microsoft.AspNet.SignalR.Client.2.4.3\lib\net40\Microsoft.AspNet.SignalR.Client.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Contracts\EventHandlers.cs" />
<Compile Include="Contracts\IExchangeEvents.cs" />
<Compile Include="Contracts\IExchangeHub.cs" />
<Compile Include="Contracts\IExchangeHubMaster.cs" />
<Compile Include="Contracts\IExchangeHubSlave.cs" />
<Compile Include="ExchangeConnection.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ExchangeHub")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExchangeHub")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6033ff0c-cf32-4bc5-8efe-4774ccdc663d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.SignalR.Client" version="2.4.3" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net40" />
</packages>
@@ -1,176 +0,0 @@
namespace HttpExtensions
{
using HttpExtensions.Interfaces;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web;
public class HttpClient : IHttpClient
{
private static readonly System.Net.Http.HttpClient http = new System.Net.Http.HttpClient();
private Uri baseURL;
public HttpClient()
{
}
public HttpClient(string baseURL)
=> this.BaseURL(baseURL);
public void BaseURL(string baseURL)
=> this.baseURL = new Uri(baseURL, UriKind.RelativeOrAbsolute);
public HttpResponse<T> DELETE<T>(string url, string bearer = null)
=> this.HttpRequestHandler<T>(HttpMethod.Delete, url, bearer: bearer);
public HttpResponse<T> DELETE<T>(string url)
=> this.HttpRequestHandler<T>(HttpMethod.Delete, url);
public HttpResponse<T> GET<T>(string url, string bearer = null)
=> this.HttpRequestHandler<T>(HttpMethod.Get, url, bearer: bearer);
public HttpResponse<T> GET<T>(string url)
=> this.HttpRequestHandler<T>(HttpMethod.Get, url);
public HttpResponse<T> GET<T>(String url, IDictionary<String, Object> queryParameters)
{
if (queryParameters != null)
{
url = $"{url}?{string.Join("&", queryParameters.Select(x => $"{x.Key.ToLower()}={HttpUtility.UrlEncode($"{x.Value}")}"))}";
}
return this.GET<T>(url);
}
public HttpResponse<T> POST<T>(string url, string bearer = null, object body = null)
=> this.HttpRequestHandler<T>(HttpMethod.Post, url, bearer: bearer, body: body);
public HttpResponse<T> POST<T>(string url)
=> this.HttpRequestHandler<T>(HttpMethod.Post, url);
public HttpResponse<T> POST<T>(string url, object body)
=> this.HttpRequestHandler<T>(HttpMethod.Post, url, body: body);
public HttpResponse<T> POST<T>(string url, string bearer)
=> this.HttpRequestHandler<T>(HttpMethod.Post, url, bearer: bearer);
public HttpResponse<T> PUT<T>(string url, string bearer = null, object body = null)
=> this.HttpRequestHandler<T>(HttpMethod.Put, url, bearer: bearer, body: body);
public HttpResponse<T> PUT<T>(string url)
=> this.HttpRequestHandler<T>(HttpMethod.Post, url);
public HttpResponse PUT(string url, object body)
=> this.HttpRequestHandler(HttpMethod.Put, url, body: body);
public HttpResponse<T> PUT<T>(string url, object body)
=> this.HttpRequestHandler<T>(HttpMethod.Put, url, body: body);
public HttpResponse<T> PUT<T>(string url, string bearer)
=> this.HttpRequestHandler<T>(HttpMethod.Put, url, bearer: bearer);
private HttpResponse<T> HttpRequestHandler<T>(HttpMethod method, string url, string bearer = null, object body = null)
{
var result = default(HttpResponse<T>);
try
{
var uri = new Uri(this.baseURL, new Uri(url, UriKind.Relative));
using (var request = new HttpRequestMessage(method, uri))
{
if (body != null)
{
request.Content = new StringContent(JsonConvert.SerializeObject(body));
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
}
if (!string.IsNullOrWhiteSpace(bearer))
{
http.DefaultRequestHeaders
.Authorization = new AuthenticationHeaderValue("Bearer", bearer);
}
using (var response = http.SendAsync(request).Result)
{
using (var content = response.Content)
{
var text = content.ReadAsStringAsync().Result;
if (response.IsSuccessStatusCode)
{
result = JsonConvert.DeserializeObject<T>(text);
}
else
{
result = JsonConvert.DeserializeObject<Dictionary<string, string>>(text);
}
}
}
}
}
catch (Exception e)
{
result = e;
}
return result;
}
private HttpResponse HttpRequestHandler(HttpMethod method, string url, string bearer = null, object body = null)
{
var result = default(HttpResponse);
try
{
var uri = new Uri(this.baseURL, new Uri(url, UriKind.Relative));
using (var request = new HttpRequestMessage(method, uri))
{
if (body != null)
{
request.Content = new StringContent(JsonConvert.SerializeObject(body));
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
}
if (!string.IsNullOrWhiteSpace(bearer))
{
http.DefaultRequestHeaders
.Authorization = new AuthenticationHeaderValue("Bearer", bearer);
}
using (var response = http.SendAsync(request).Result)
{
using (var content = response.Content)
{
var text = content.ReadAsStringAsync().Result;
if (response.IsSuccessStatusCode)
{
result = true;
}
else
{
result = JsonConvert.DeserializeObject<Dictionary<string, string>>(text);
}
}
}
}
}
catch (Exception e)
{
result = e;
}
return result;
}
}
}
@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DC78FF93-86FE-4099-8ACC-41B6B0533B69}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HttpExtensions</RootNamespace>
<AssemblyName>HttpExtensions</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http">
<HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HttpClient.cs" />
<Compile Include="HttpResponse.cs" />
<Compile Include="HttpResponse[T].cs" />
<Compile Include="Interfaces\IHttpClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,40 +0,0 @@
namespace HttpExtensions
{
using System;
using System.Collections.Generic;
public class HttpResponse
{
private Exception exception;
private HttpResponse(bool succeeded)
=> this.Succeeded = succeeded;
private HttpResponse(Dictionary<string, string> errors) : this(false)
=> this.Errors = errors;
public HttpResponse(Exception exception) : this(false)
=> this.exception = exception;
public bool Succeeded { get; }
public Exception Exception { get; }
public Dictionary<string, string> Errors { get; }
public static implicit operator HttpResponse(bool succeeded)
=> new HttpResponse(succeeded);
public static implicit operator HttpResponse(Dictionary<string, string> errors)
=> new HttpResponse(errors);
public static implicit operator HttpResponse(Exception exception)
=> new HttpResponse(exception);
public static implicit operator bool(HttpResponse result)
=> result?.Succeeded ?? false;
public static implicit operator Dictionary<string, string>(HttpResponse result)
=> result?.Errors ?? new Dictionary<string, string>();
}
}
@@ -1,51 +0,0 @@
namespace HttpExtensions
{
using System;
using System.Collections.Generic;
public class HttpResponse<T>
{
private Exception exception;
private HttpResponse(bool succeeded)
=> this.Succeeded = succeeded;
private HttpResponse(T value) : this(true)
=> this.Value = value;
private HttpResponse(Dictionary<string, string> errors) : this(false)
=> this.Errors = errors;
public HttpResponse(Exception exception) : this(false)
=> this.exception = exception;
public bool Succeeded { get; }
public T Value { get; }
public Exception Exception { get; }
public Dictionary<string, string> Errors { get; }
public static implicit operator HttpResponse<T>(bool succeeded)
=> new HttpResponse<T>(succeeded);
public static implicit operator HttpResponse<T>(T value)
=> new HttpResponse<T>(value);
public static implicit operator HttpResponse<T>(Dictionary<string, string> errors)
=> new HttpResponse<T>(errors);
public static implicit operator HttpResponse<T>(Exception exception)
=> new HttpResponse<T>(exception);
public static implicit operator bool(HttpResponse<T> result)
=> result?.Succeeded ?? false;
public static implicit operator T(HttpResponse<T> result)
=> result is null ? default(T) : result.Value;
public static implicit operator Dictionary<string, string>(HttpResponse<T> result)
=> result?.Errors ?? new Dictionary<string, string>();
}
}
@@ -1,37 +0,0 @@
using System.Collections.Generic;
namespace HttpExtensions.Interfaces
{
public interface IHttpClient
{
void BaseURL(string baseURL);
HttpResponse<T> DELETE<T>(string uri);
HttpResponse<T> DELETE<T>(string uri, string bearer);
HttpResponse<T> GET<T>(string uri);
HttpResponse<T> GET<T>(string url, IDictionary<string, object> queryParameters);
HttpResponse<T> GET<T>(string uri, string bearer);
HttpResponse<T> POST<T>(string uri);
HttpResponse<T> POST<T>(string uri, object body);
HttpResponse<T> POST<T>(string uri, string bearer);
HttpResponse<T> POST<T>(string uri, string bearer, object body);
HttpResponse<T> PUT<T>(string uri);
HttpResponse PUT(string uri, object body);
HttpResponse<T> PUT<T>(string uri, object body);
HttpResponse<T> PUT<T>(string uri, string bearer);
HttpResponse<T> PUT<T>(string uri, string bearer, object body);
}
}
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HttpExtensions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HttpExtensions")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("dc78ff93-86fe-4099-8acc-41b6b0533b69")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,94 +0,0 @@
namespace InspectionUI.Plugins.Controls
{
using InspectionUI.Abstraction;
using InspectionUI.Abstraction.Interfaces;
[TestBatch("Controls overview")]
public class ControlsBatch : TestBatchBase
{
public ControlsBatch(ITestBench testBench, IAppsettings appsettings) : base(testBench, appsettings)
{
}
public override void Initialize()
{
var layout = this.testBench.Layout;
layout.Clear();
layout.Refresh();
var columnDefinitions = layout.AddRow();
columnDefinitions.AddHeader();
columnDefinitions.AddHeader();
columnDefinitions.AddHeader();
var headers = layout.AddRow();
var controlsH = headers.AddHeader();
controlsH.Text = "Controls";
var actionsH = headers.AddHeader();
actionsH.Text = "Actions";
var resultsH = headers.AddHeader();
resultsH.Text = "Results";
var textRow = layout.AddRow();
var txt = textRow.AddTextBlock();
txt.Text = "Just text block";
var txt1 = textRow.AddTextBlock();
txt1.Text = "Just text block";
txt1.Foreground = Brushes.Green;
txt1.HorisontalAlignment = Alignment.Left;
var txt2 = textRow.AddTextBlock();
txt2.Text = "Just text block";
txt2.Foreground = Brushes.Red;
txt2.HorisontalAlignment = Alignment.Right;
var inputRow = layout.AddRow();
var input = inputRow.AddTextBox();
var txt3 = inputRow.AddTextBlock();
txt3.Text = "Just click hier after your input.";
var txt4 = inputRow.AddTextBlock();
input.TextChanged += text => txt4.Text = text;
var checkboxRow = layout.AddRow();
var checkbox = checkboxRow.AddCheckbox();
var counter = 1;
checkbox.Text = "Check me!";
var txt5 = checkboxRow.AddTextBlock();
txt5.Text = "Just click on the checkbox.";
var txt6 = checkboxRow.AddTextBlock();
checkbox.Executable = () =>
{
txt6.Text = $"{counter++}";
checkbox.Text = checkbox.IsChecked ? "Uncheck me!" : "Check me!";
};
var dropdownRow = layout.AddRow();
var dropdown = dropdownRow.AddDropdown();
dropdown.ItemsSource.Add("AAAAAA");
dropdown.ItemsSource.Add("BBBBBB");
dropdown.ItemsSource.Add("CCCCCC");
var txt7 = dropdownRow.AddTextBlock();
txt7.Text = "Just select item.";
var txt8 = dropdownRow.AddTextBlock();
dropdown.ItemSelected = () =>
{
txt8.Text = $"[{dropdown.SelectedIndex}] = {dropdown.SelectedItem}";
};
var btncounter = 0;
var buttonRow = layout.AddRow();
var button = buttonRow.AddCommand();
button.Text = "The button";
var txt9 = buttonRow.AddTextBlock();
txt9.Text = "Click the button!";
var txt10 = buttonRow.AddTextBlock();
txt10.Text = "Not yet clicked!";
button.Executable = () =>
{
txt10.Text = $"{++btncounter}";
};
layout.Refresh();
}
}
}
@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EBF13D20-08C9-4984-8B21-6FB7419A622A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>InspectionUI.Plugins.Controls</RootNamespace>
<AssemblyName>InspectionUI.Plugins.Controls</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>false</RegisterForComInterop>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ControlsBatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\InspectionUI.Abstraction\InspectionUI.Abstraction.csproj">
<Project>{C6BFAC88-5647-4131-90B1-4D6265E08348}</Project>
<Name>InspectionUI.Abstraction</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("InspectionUI.Plugins.Controls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InspectionUI.Plugins.Controls")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ebf13d20-08c9-4984-8b21-6fb7419a622a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -1,15 +0,0 @@
namespace InspectionUI.Plugins.Eregister
{
using InspectionUI.Abstraction;
using InspectionUI.Abstraction.Interfaces;
[TestBatch("E-Register Prüfung")]
public class EregisterBatch : TestBatchBase
{
public EregisterBatch(ITestBench testBench, IAppsettings appsettings) : base(testBench, appsettings)
{
}
}
}
@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8E5F013D-B8FC-41C7-BB12-702DC71C86CA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>InspectionUI.Plugins.Eregister</RootNamespace>
<AssemblyName>InspectionUI.Plugins.Eregister</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="EregisterBatch.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\InspectionUI.Abstraction\InspectionUI.Abstraction.csproj">
<Project>{C6BFAC88-5647-4131-90B1-4D6265E08348}</Project>
<Name>InspectionUI.Abstraction</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("InspectionUI.Plugins.Eregister")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InspectionUI.Plugins.Eregister")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8e5f013d-b8fc-41c7-bb12-702dc71c86ca")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>InspectionUI.Plugins.Omni.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -34,6 +35,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>InspectionUI.Plugins.Omni.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
@@ -41,6 +43,19 @@
<PropertyGroup>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Development|AnyCPU'">
<OutputPath>bin\Development\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>none</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>InspectionUI.Plugins.Omni.ruleset</CodeAnalysisRuleSet>
<RegisterForComInterop>false</RegisterForComInterop>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
<DebugSymbols>false</DebugSymbols>
<NoWarn>IDE0003;IDE0049;</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\packages\NLog.5.3.2\lib\net35\NLog.dll</HintPath>
@@ -82,6 +97,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="InspectionUI.Plugins.Omni.ruleset" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -90,7 +106,8 @@
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PostBuildEvent>if $(ConfigurationName) == Development rmdir "Z:\Programme_Sensus\plugins\omni" /s
if $(ConfigurationName) == Development mkdir "Z:\Programme_Sensus\plugins\omni" /s
if $(ConfigurationName) == Development xcopy $(TargetDir) "Z:\Programme_Sensus\plugins\omni" /s /y</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Rules for InspectionUI.Plugins.Omni" Description="Code analysis rules for InspectionUI.Plugins.Omni.csproj." ToolsVersion="15.0">
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<Rule Id="CA1301" Action="Warning" />
<Rule Id="CA1400" Action="Warning" />
<Rule Id="CA1401" Action="Warning" />
<Rule Id="CA1403" Action="Warning" />
<Rule Id="CA1404" Action="Warning" />
<Rule Id="CA1405" Action="Warning" />
<Rule Id="CA1410" Action="Warning" />
<Rule Id="CA1415" Action="Warning" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA1901" Action="Warning" />
<Rule Id="CA2002" Action="Warning" />
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2101" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
<Rule Id="CA2200" Action="Warning" />
<Rule Id="CA2202" Action="Warning" />
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2212" Action="Warning" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2220" Action="Warning" />
<Rule Id="CA2229" Action="Warning" />
<Rule Id="CA2231" Action="Warning" />
<Rule Id="CA2232" Action="Warning" />
<Rule Id="CA2235" Action="Warning" />
<Rule Id="CA2236" Action="Warning" />
<Rule Id="CA2237" Action="Warning" />
<Rule Id="CA2238" Action="Warning" />
<Rule Id="CA2240" Action="Warning" />
<Rule Id="CA2241" Action="Warning" />
<Rule Id="CA2242" Action="Warning" />
</Rules>
</RuleSet>

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