diff --git a/.DS_Store b/.DS_Store new file mode 100755 index 000000000..a403536d2 Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100755 index 000000000..5008ddfcf Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/AasxAmlImExport/AasxAmlImExport.csproj b/src/AasxAmlImExport/AasxAmlImExport.csproj index 24af1f382..84793ecdd 100644 --- a/src/AasxAmlImExport/AasxAmlImExport.csproj +++ b/src/AasxAmlImExport/AasxAmlImExport.csproj @@ -6,7 +6,7 @@ false - + @@ -15,7 +15,7 @@ - + diff --git a/src/AasxPackageExplorer.sln b/src/AasxPackageExplorer.sln index 286b0978e..6cc15bb6f 100644 --- a/src/AasxPackageExplorer.sln +++ b/src/AasxPackageExplorer.sln @@ -12,10 +12,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxToolkit", "AasxToolkit\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxWpfControlLibrary", "AasxWpfControlLibrary\AasxWpfControlLibrary.csproj", "{EBAE658A-3ECE-4C98-89BC-F79809AB4A5E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxRestServerLibrary", "AasxRestServerLibrary\AasxRestServerLibrary.csproj", "{967E60E3-D668-42A3-AA0B-1A031C20D871}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxRestConsoleServer", "AasxRestConsoleServer\AasxRestConsoleServer.csproj", "{6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxIntegrationBase", "AasxIntegrationBase\AasxIntegrationBase.csproj", "{5A05DF78-216B-4A0B-9E30-7B2557C7E867}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxIntegrationEmptySample", "AasxIntegrationEmptySample\AasxIntegrationEmptySample.csproj", "{7B8F763F-39FE-4947-B0E6-B9D97A3B6F8B}" @@ -46,12 +42,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginTechnicalData", " EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9264D68F-5269-420F-A486-6B8F39BEEB8B}" ProjectSection(SolutionItems) = preProject - Notes_V3.md = Notes_V3.md - README-packages.md = README-packages.md ..\CHANGELOG.md = ..\CHANGELOG.md ..\CODE_OF_CONDUCT.md = ..\CODE_OF_CONDUCT.md ..\CONTRIBUTING.md = ..\CONTRIBUTING.md ..\CONTRIBUTORS.md = ..\CONTRIBUTORS.md + Notes_V3.md = Notes_V3.md + README-packages.md = README-packages.md ..\README.md = ..\README.md EndProjectSection EndProject @@ -77,22 +73,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProgsUserInterface", "Progs EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataStore", "DataStore", "{9490C085-8FDC-4EDE-BDCF-280FC19E43FF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfMtpControl", "WpfMtpControl\WpfMtpControl.csproj", "{F6CF3948-C67A-40FC-812A-3733F673EA21}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginMtpViewer", "AasxPluginMtpViewer\AasxPluginMtpViewer.csproj", "{7A612803-BAE2-4FED-BBCE-56079EDB8594}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfMtpVisuViewer", "WpfMtpVisuViewer\WpfMtpVisuViewer.csproj", "{1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FunctionalUiLibs", "FunctionalUiLibs", "{C1752DB5-0157-4666-A25D-2666089457BB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxUaNetServer", "AasxUaNetServer\AasxUaNetServer.csproj", "{C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginUaNetServer", "AasxPluginUaNetServer\AasxPluginUaNetServer.csproj", "{32EEDE14-8622-42E6-81AE-33941B7A6EFC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxPluginUaNetClient", "AasxPluginUaNetClient\AasxPluginUaNetClient.csproj", "{9EB71E8B-EC41-4054-BAB4-F419B4D13A36}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AasxUaNetConsoleServer", "AasxUaNetConsoleServer\AasxUaNetConsoleServer.csproj", "{232852C2-358B-4577-9D29-1E48ED75C342}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UserSpecific", "UserSpecific", "{4FD813E9-EC97-4E85-BAFC-5280BC07C302}" ProjectSection(SolutionItems) = preProject MIHO.NUnit.runsettings = MIHO.NUnit.runsettings @@ -264,66 +246,6 @@ Global {EBAE658A-3ECE-4C98-89BC-F79809AB4A5E}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {EBAE658A-3ECE-4C98-89BC-F79809AB4A5E}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {EBAE658A-3ECE-4C98-89BC-F79809AB4A5E}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|Any CPU.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x64.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x64.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x86.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Debug|x86.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugSlow|x64.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugSlow|x86.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Release|Any CPU.ActiveCfg = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Release|Any CPU.Build.0 = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Release|x64.ActiveCfg = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Release|x64.Build.0 = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Release|x86.ActiveCfg = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.Release|x86.Build.0 = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {967E60E3-D668-42A3-AA0B-1A031C20D871}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x64.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x64.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x86.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Debug|x86.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugSlow|x64.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugSlow|x86.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Release|Any CPU.Build.0 = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Release|x64.ActiveCfg = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Release|x64.Build.0 = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Release|x86.ActiveCfg = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.Release|x86.Build.0 = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {5A05DF78-216B-4A0B-9E30-7B2557C7E867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5A05DF78-216B-4A0B-9E30-7B2557C7E867}.Debug|Any CPU.Build.0 = Debug|Any CPU {5A05DF78-216B-4A0B-9E30-7B2557C7E867}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -892,216 +814,6 @@ Global {B540EBF4-C026-45A4-9721-909AF0CC14C1}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {B540EBF4-C026-45A4-9721-909AF0CC14C1}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {B540EBF4-C026-45A4-9721-909AF0CC14C1}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Debug|x64.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Debug|x64.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Debug|x86.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Debug|x86.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugSlow|x64.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugSlow|x86.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Release|Any CPU.Build.0 = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Release|x64.ActiveCfg = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Release|x64.Build.0 = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Release|x86.ActiveCfg = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.Release|x86.Build.0 = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {F6CF3948-C67A-40FC-812A-3733F673EA21}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Debug|x64.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Debug|x86.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Debug|x86.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugSlow|x64.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugSlow|x86.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Release|Any CPU.Build.0 = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Release|x64.ActiveCfg = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Release|x64.Build.0 = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Release|x86.ActiveCfg = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.Release|x86.Build.0 = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {7A612803-BAE2-4FED-BBCE-56079EDB8594}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Debug|x64.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Debug|x64.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Debug|x86.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Debug|x86.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugSlow|x64.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugSlow|x86.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Release|Any CPU.Build.0 = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Release|x64.ActiveCfg = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Release|x64.Build.0 = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Release|x86.ActiveCfg = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.Release|x86.Build.0 = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Debug|x64.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Debug|x64.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Debug|x86.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Debug|x86.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugSlow|x64.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugSlow|x86.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Release|Any CPU.Build.0 = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Release|x64.ActiveCfg = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Release|x64.Build.0 = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Release|x86.ActiveCfg = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.Release|x86.Build.0 = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Debug|x64.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Debug|x64.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Debug|x86.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Debug|x86.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugSlow|x64.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugSlow|x86.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Release|Any CPU.Build.0 = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Release|x64.ActiveCfg = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Release|x64.Build.0 = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Release|x86.ActiveCfg = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.Release|x86.Build.0 = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {32EEDE14-8622-42E6-81AE-33941B7A6EFC}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Debug|x64.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Debug|x64.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Debug|x86.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Debug|x86.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugSlow|x64.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugSlow|x86.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Release|Any CPU.Build.0 = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Release|x64.ActiveCfg = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Release|x64.Build.0 = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Release|x86.ActiveCfg = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.Release|x86.Build.0 = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|Any CPU.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x64.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x64.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x86.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Debug|x86.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugSlow|Any CPU.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugSlow|Any CPU.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugSlow|x64.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugSlow|x64.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugSlow|x86.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugSlow|x86.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugWithoutCEF|Any CPU.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugWithoutCEF|x64.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugWithoutCEF|x64.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugWithoutCEF|x86.ActiveCfg = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.DebugWithoutCEF|x86.Build.0 = Debug|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Release|Any CPU.ActiveCfg = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Release|Any CPU.Build.0 = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Release|x64.ActiveCfg = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Release|x64.Build.0 = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Release|x86.ActiveCfg = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.Release|x86.Build.0 = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.ReleaseWithoutCEF|Any CPU.Build.0 = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.ReleaseWithoutCEF|x64.ActiveCfg = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU - {232852C2-358B-4577-9D29-1E48ED75C342}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU {96FBCF5F-BBF3-4076-8DB6-BF9D8420F3DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {96FBCF5F-BBF3-4076-8DB6-BF9D8420F3DC}.Debug|Any CPU.Build.0 = Debug|Any CPU {96FBCF5F-BBF3-4076-8DB6-BF9D8420F3DC}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1702,30 +1414,6 @@ Global {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x64.Build.0 = Release|Any CPU {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x86.ActiveCfg = Release|Any CPU {AB60370B-DC87-414D-8A6C-7B095F940A1B}.ReleaseWithoutCEF|x86.Build.0 = Release|Any CPU - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|Any CPU.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x64.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x86.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Debug|x86.Build.0 = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugSlow|Any CPU.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugSlow|x64.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugSlow|x86.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|Any CPU.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|Any CPU.Build.0 = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x64.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x64.Build.0 = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x86.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.DebugWithoutCEF|x86.Build.0 = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|Any CPU.ActiveCfg = Release|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|Any CPU.Build.0 = Release|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|x64.ActiveCfg = Release|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|x86.ActiveCfg = Release|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.Release|x86.Build.0 = Release|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|Any CPU.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|Any CPU.Build.0 = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x64.ActiveCfg = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x64.Build.0 = Debug|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x86.ActiveCfg = Release|x86 - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34}.ReleaseWithoutCEF|x86.Build.0 = Release|x86 {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {4EB64F40-1A01-46BB-BEED-D1A75313C7F8}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1944,8 +1632,6 @@ Global {569B369E-9393-4F57-994E-6B84398FD7CC} = {98C89299-C429-4F0B-9938-4B7775943393} {294FC59A-5645-412F-8216-702FB66528C1} = {1A282279-9375-4714-96B6-89A00985C9DC} {EBAE658A-3ECE-4C98-89BC-F79809AB4A5E} = {98C89299-C429-4F0B-9938-4B7775943393} - {967E60E3-D668-42A3-AA0B-1A031C20D871} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} - {6C45112D-B7F0-4463-BE6D-A8A2B5A547BF} = {1A282279-9375-4714-96B6-89A00985C9DC} {5A05DF78-216B-4A0B-9E30-7B2557C7E867} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {7B8F763F-39FE-4947-B0E6-B9D97A3B6F8B} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} {6D1A03B2-EBA7-4CE2-9237-DF9AD7128947} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} @@ -1965,13 +1651,6 @@ Global {7788AC2B-7F97-4755-B343-C4196FA90198} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {2F21FEFF-F0EF-40B5-BA05-09FC9F499AE9} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} {B540EBF4-C026-45A4-9721-909AF0CC14C1} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} - {F6CF3948-C67A-40FC-812A-3733F673EA21} = {C1752DB5-0157-4666-A25D-2666089457BB} - {7A612803-BAE2-4FED-BBCE-56079EDB8594} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} - {1E2E9A75-3C8C-4CD9-BE11-32190FD4313C} = {98C89299-C429-4F0B-9938-4B7775943393} - {C1E3F0D9-2BEA-4668-AFF4-454FDF527A58} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} - {32EEDE14-8622-42E6-81AE-33941B7A6EFC} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} - {9EB71E8B-EC41-4054-BAB4-F419B4D13A36} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} - {232852C2-358B-4577-9D29-1E48ED75C342} = {1A282279-9375-4714-96B6-89A00985C9DC} {4FD813E9-EC97-4E85-BAFC-5280BC07C302} = {9264D68F-5269-420F-A486-6B8F39BEEB8B} {96FBCF5F-BBF3-4076-8DB6-BF9D8420F3DC} = {98C89299-C429-4F0B-9938-4B7775943393} {8D09D103-1B97-4D54-BAA9-841B2F93FF36} = {66D730EB-B9D7-4C3A-8954-0F86240AD612} @@ -1992,7 +1671,6 @@ Global {00F5EA49-F66D-4104-A621-AF668DD58C05} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {A713E962-38FB-4FD0-9687-30F530E95E91} = {98C89299-C429-4F0B-9938-4B7775943393} {AB60370B-DC87-414D-8A6C-7B095F940A1B} = {98C89299-C429-4F0B-9938-4B7775943393} - {8E42C60A-2576-47C2-B0EE-B40BBDDA0F34} = {5BA4D327-1907-4F5A-BC90-5EA939497BFC} {4EB64F40-1A01-46BB-BEED-D1A75313C7F8} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {BE68E42C-28CB-4298-9F34-A18AF92FC4DE} = {F9AE9D23-200C-455B-B14E-2EF20B13432E} {6A1F717C-8F43-4260-98A6-49345F983EFC} = {DDA9C372-F8ED-4099-A53C-01B9333FD985} diff --git a/src/AasxPackageLogic/ExplorerMenuFactory.cs b/src/AasxPackageLogic/ExplorerMenuFactory.cs index 9cde2ad03..62b5dc072 100644 --- a/src/AasxPackageLogic/ExplorerMenuFactory.cs +++ b/src/AasxPackageLogic/ExplorerMenuFactory.cs @@ -99,7 +99,7 @@ public static AasxMenu CreateMainMenu() .AddSeparator() .AddMenu(header: "Further connect options ", childs: (new AasxMenu()) .AddWpfBlazor(name: "ConnectSecure", header: "Secure Connect ", inputGesture: "Ctrl+Shift+S") - .AddWpfBlazor(name: "ConnectOpcUa", header: "Connect via OPC-UA ") + //.AddWpfBlazor(name: "ConnectOpcUa", header: "Connect via OPC-UA ") .AddWpfBlazor(name: "ConnectRest", header: "Connect via REST ", inputGesture: "F6")) .AddSeparator() .AddMenu(header: "AASX File Repository ", childs: (new AasxMenu()) @@ -158,8 +158,8 @@ public static AasxMenu CreateMainMenu() help: "Import OPC UA nodeset.xml into an existing Submodel.", args: new AasxMenuListOfArgDefs() .Add("File", "OPC UA Nodeset file.")) - .AddWpfBlazor(name: "OPCRead", header: "Read OPC values into SubModel ", - help: "Use Qualifiers attributed in a Submodel to read actual OPC UA values.") + /*.AddWpfBlazor(name: "OPCRead", header: "Read OPC values into SubModel ", + help: "Use Qualifiers attributed in a Submodel to read actual OPC UA values.")*/ .AddWpfBlazor(name: "RDFRead", header: "Import BAMM RDF into AASX ", help: "Import BAMM RDF into AASX.", args: new AasxMenuListOfArgDefs() @@ -195,13 +195,13 @@ public static AasxMenu CreateMainMenu() args: new AasxMenuListOfArgDefs() .Add("File", "OPC UA Nodeset2.xml file to write.") .Add("Location", "Location selection", hidden: true)) - .AddWpfBlazor(name: "OpcUaExportNodeSetUaPlugin", + /*.AddWpfBlazor(name: "OpcUaExportNodeSetUaPlugin", header: "Export OPC UA Nodeset2.xml (via UA server plug-in) ", help: "Export OPC UA Nodeset2.xml format by starting OPC UA server in plugin and " + "execute a post-process command.", args: new AasxMenuListOfArgDefs() .Add("File", "OPC UA Nodeset2.xml file to write.") - .Add("Location", "Location selection", hidden: true)) + .Add("Location", "Location selection", hidden: true))*/ .AddWpfBlazor(name: "CopyClipboardElementJson", header: "Copy selected element JSON to clipboard", inputGesture: "Shift+Ctrl+C") .AddWpfBlazor(name: "ExportGenericForms", @@ -233,7 +233,7 @@ public static AasxMenu CreateMainMenu() .AddWpf(name: "MQTTPub", header: "Publish AAS via MQTT ") .AddSeparator() .AddWpf(name: "ServerPluginEmptySample", header: "Plugin: Empty Sample ") - .AddWpf(name: "ServerPluginOPCUA", header: "Plugin: OPC UA ") + //.AddWpf(name: "ServerPluginOPCUA", header: "Plugin: OPC UA ") .AddWpf(name: "ServerPluginMQTT", header: "Plugin: MQTT ")) .AddSeparator(filter: AasxMenuFilter.NotBlazor) .AddMenu(header: "System ", filter: AasxMenuFilter.NotBlazor, diff --git a/src/AasxPluginMtpViewer/AasxPluginMtpViewer.csproj b/src/AasxPluginMtpViewer/AasxPluginMtpViewer.csproj deleted file mode 100644 index 16174b82f..000000000 --- a/src/AasxPluginMtpViewer/AasxPluginMtpViewer.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - net6.0-windows - library - false - true - - - - true - false - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - PreserveNewest - - - - - - diff --git a/src/AasxPluginMtpViewer/AasxPluginMtpViewer.options.json b/src/AasxPluginMtpViewer/AasxPluginMtpViewer.options.json deleted file mode 100644 index 5cba39956..000000000 --- a/src/AasxPluginMtpViewer/AasxPluginMtpViewer.options.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "Records": [ - { - "RecordType": 0, - "AllowSubmodelSemanticId": [ - { - "type": "Submodel", - "local": false, - "value": "http://www.admin-shell.io/mtp/v1/submodel", - "index": 0, - "idType": "IRI" - } - ] - }, - { - "RecordType": 1, - "AllowSubmodelSemanticId": [ - { - "type": "Submodel", - "local": false, - "value": "http://www.admin-shell.io/mtp/v1/mtp-instance-submodel", - "index": 0, - "idType": "IRI" - } - ] - } - ], - "SymbolMappings": [ - { - "EClassVersions": null, - "EClassClasses": "37010201", - "EClassIRDIs": null, - "SymbolDefault": "PNID_Festo.manual_valve_active-u-nozzled", - "SymbolActive": null, - "SymbolIntermediate": null, - "Comment": "V003,45fd1be7-d9fe-426a-aec7-ca16a09cb64b" - } - ], - "VisuOptions": { - "Background": "#707070", - "StateColorActive": "#2020ff", - "StateColorNonActive": "#202020", - "StateColorForward": "#2020ff", - "StateColorReverse": "#20ff20" - } -} \ No newline at end of file diff --git a/src/AasxPluginMtpViewer/AasxPluginMtpViewer.plugin b/src/AasxPluginMtpViewer/AasxPluginMtpViewer.plugin deleted file mode 100644 index 3beebdf2d..000000000 --- a/src/AasxPluginMtpViewer/AasxPluginMtpViewer.plugin +++ /dev/null @@ -1 +0,0 @@ -This file tags the according .ddl to be a plug-in for AasxPackageExplorer. \ No newline at end of file diff --git a/src/AasxPluginMtpViewer/LICENSE.TXT b/src/AasxPluginMtpViewer/LICENSE.TXT deleted file mode 100644 index 21bf04b1f..000000000 --- a/src/AasxPluginMtpViewer/LICENSE.TXT +++ /dev/null @@ -1,244 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -This software is licensed under the Apache Public License 2.0 (APL-2.0) -(see below). -The AutomationML.Engine is licensed under the MIT license (MIT) -(see below). - -This application is a sample application for demonstration of the features -of the Administration Shell. -It is not allowed for productive use. The implementation uses the concepts -of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - diff --git a/src/AasxPluginMtpViewer/MtpViewerOptions.cs b/src/AasxPluginMtpViewer/MtpViewerOptions.cs deleted file mode 100644 index 66086a5ca..000000000 --- a/src/AasxPluginMtpViewer/MtpViewerOptions.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using WpfMtpControl; -using AasxIntegrationBase; - -namespace AasxPluginMtpViewer -{ - public class MtpViewerOptionsRecord : AasxPluginOptionsLookupRecordBase - { - public enum MtpRecordType { MtpType, MtpInstance } - - public MtpRecordType RecordType = MtpRecordType.MtpType; - } - - public class MtpViewerOptions : AasxPluginLookupOptionsBase - { - public List Records = new List(); - - public WpfMtpControl.MtpSymbolMapRecordList SymbolMappings = new WpfMtpControl.MtpSymbolMapRecordList(); - - public MtpVisuOptions VisuOptions = new MtpVisuOptions(); - - /// - /// Create a set of minimal options - /// - public static MtpViewerOptions CreateDefault() - { - var defs = new DefinitionsMTP.ModuleTypePackage(); - - var rec1 = new MtpViewerOptionsRecord(); - rec1.RecordType = MtpViewerOptionsRecord.MtpRecordType.MtpType; - rec1.AllowSubmodelSemanticId = defs.SEM_MtpSubmodel.Keys.ToKeyList(); - - var rec2 = new MtpViewerOptionsRecord(); - rec2.RecordType = MtpViewerOptionsRecord.MtpRecordType.MtpInstance; - rec2.AllowSubmodelSemanticId = defs.SEM_MtpInstanceSubmodel.Keys.ToKeyList(); - - var opt = new MtpViewerOptions(); - opt.Records.Add(rec1); - opt.Records.Add(rec2); - - return opt; - } - } -} diff --git a/src/AasxPluginMtpViewer/Opc.Ua.SampleClient.Config.xml b/src/AasxPluginMtpViewer/Opc.Ua.SampleClient.Config.xml deleted file mode 100644 index 8c8ea824f..000000000 --- a/src/AasxPluginMtpViewer/Opc.Ua.SampleClient.Config.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - UA Core Sample Client - urn:localhost:OPCFoundation:CoreSampleClient - http://opcfoundation.org/UA/CoreSampleClient - Client_1 - - - - - - X509Store - CurrentUser\My - CN=UA Core Sample Client, C=US, S=Arizona, O=OPC Foundation, DC=localhost - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/issuer - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/trusted - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/rejected - - - - false - - - - - - - 600000 - 1048576 - 4194304 - 65535 - 4194304 - 65535 - 300000 - 3600000 - - - - - - - 600000 - - - - opc.tcp://{0}:4840/UADiscovery - - - - - - - 10000 - - - - %LocalApplicationData%/Logs/Opc.Ua.CoreSampleClient.log.txt - true - - - - - - - - - - - - - - - - true - - \ No newline at end of file diff --git a/src/AasxPluginMtpViewer/Plugin.cs b/src/AasxPluginMtpViewer/Plugin.cs deleted file mode 100644 index b88929648..000000000 --- a/src/AasxPluginMtpViewer/Plugin.cs +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using Newtonsoft.Json; -using AasxPluginMtpViewer; - -namespace AasxIntegrationBase // the namespace has to be: AasxIntegrationBase -{ - // the class names has to be: AasxPlugin and subclassing IAasxPluginInterface - // ReSharper disable UnusedType.Global - public class AasxPlugin : AasxPluginBase - // ReSharper enable UnusedType.Global - { - private AasxPluginMtpViewer.MtpViewerOptions _options = new AasxPluginMtpViewer.MtpViewerOptions(); - - private AasxPluginMtpViewer.WpfMtpControlWrapper _viewerControl - = new AasxPluginMtpViewer.WpfMtpControlWrapper(); - - public new void InitPlugin(string[] args) - { - // start .. - PluginName = "AasxPluginMtpViewer"; - _log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args)); - - // .. with built-in options - _options = AasxPluginMtpViewer.MtpViewerOptions.CreateDefault(); - - // try load defaults options from assy directory - try - { - var newOpt = - AasxPluginOptionsBase.LoadDefaultOptionsFromAssemblyDir( - this.GetPluginName(), Assembly.GetExecutingAssembly()); - if (newOpt != null) - this._options = newOpt; - } - catch (Exception ex) - { - _log.Error(ex, "Exception when reading default options {1}"); - } - - // index them! - _options.IndexListOfRecords(_options.Records); - } - - public new AasxPluginActionDescriptionBase[] ListActions() - { - _log.Info("ListActions() called"); - var res = new List(); - // for speed reasons, have the most often used at top! - res.Add(new AasxPluginActionDescriptionBase("call-check-visual-extension", - "When called with Referable, returns possibly visual extension for it.")); - // rest follows - res.Add(new AasxPluginActionDescriptionBase("set-json-options", - "Sets plugin-options according to provided JSON string.")); - res.Add(new AasxPluginActionDescriptionBase("get-json-options", "Gets plugin-options as a JSON string.")); - res.Add(new AasxPluginActionDescriptionBase("get-licenses", "Reports about used licenses.")); - res.Add(new AasxPluginActionDescriptionBase("get-events", - "Pops and returns the earliest event from the event stack.")); - res.Add(new AasxPluginActionDescriptionBase("get-check-visual-extension", - "Returns true, if plug-ins checks for visual extension.")); - res.Add(new AasxPluginActionDescriptionBase("fill-panel-visual-extension", - "When called, fill given WPF panel with control for graph display.")); - return res.ToArray(); - } - - public new AasxPluginResultBase ActivateAction(string action, params object[] args) - { - // for speed reasons, have the most often used at top! - if (action == "call-check-visual-extension") - { - // arguments - if (args.Length < 1) - return null; - - // looking only for Submodels - var sm = args[0] as Aas.Submodel; - if (sm == null) - return null; - - // check for a record in options, that matches Submodel - var found = false; - // ReSharper disable once UnusedVariable - foreach (var rec in _options.LookupAllIndexKey( - sm.SemanticId?.GetAsExactlyOneKey())) - found = true; - if (!found) - return null; - - // success prepare record - var cve = new AasxPluginResultVisualExtension("MTP", "Module Type Package - View"); - - // ok - return cve; - } - - // can basic helper help to reduce lines of code? - var help = ActivateActionBasicHelper(action, ref _options, args, - disableDefaultLicense: true, - enableGetCheckVisuExt: true); - if (help != null) - return help; - - // rest follows - - if (action == "get-licenses") - { - var lic = new AasxPluginResultLicense(); - lic.shortLicense = "The AutomationML.Engine is licensed under the MIT license (MIT) (see below)."; - - lic.isStandardLicense = true; - lic.longLicense = AasxPluginHelper.LoadLicenseTxtFromAssemblyDir( - "LICENSE.txt", Assembly.GetExecutingAssembly()); - - return lic; - } - - if (action == "fill-panel-visual-extension" && this._viewerControl != null) - { - // arguments - if (args?.Length < 3) - return null; - - // call - var resobj = AasxPluginMtpViewer.WpfMtpControlWrapper.FillWithWpfControls(args?[0], args?[1], - this._options, this._eventStack, this._log, args?[2]); - - // give object back - var res = new AasxPluginResultBaseObject(); - res.obj = resobj; - return res; - } - - // default - return null; - } - - } -} diff --git a/src/AasxPluginMtpViewer/Properties/AssemblyInfo.cs b/src/AasxPluginMtpViewer/Properties/AssemblyInfo.cs deleted file mode 100644 index e6987bb2d..000000000 --- a/src/AasxPluginMtpViewer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxPluginMtpViewer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxPluginMtpViewer")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie -//ImCodeVerwendeteKultur in der .csproj-Datei -//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch -//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung -//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, -//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher - //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, - // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) - ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs - //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, - // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) -)] - - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxPluginMtpViewer/Properties/Resources.Designer.cs b/src/AasxPluginMtpViewer/Properties/Resources.Designer.cs deleted file mode 100644 index c9b1f962f..000000000 --- a/src/AasxPluginMtpViewer/Properties/Resources.Designer.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion: 4.0.30319.42000 -// -// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn -// der Code neu generiert wird. -// -//------------------------------------------------------------------------------ - -namespace AasxPluginMtpViewer.Properties { - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse - // über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AasxPluginMtpViewer.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/src/AasxPluginMtpViewer/Properties/Resources.resx b/src/AasxPluginMtpViewer/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/src/AasxPluginMtpViewer/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/AasxPluginMtpViewer/Properties/Settings.Designer.cs b/src/AasxPluginMtpViewer/Properties/Settings.Designer.cs deleted file mode 100644 index ef16259b6..000000000 --- a/src/AasxPluginMtpViewer/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace AasxPluginMtpViewer.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/AasxPluginMtpViewer/Properties/Settings.settings b/src/AasxPluginMtpViewer/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/src/AasxPluginMtpViewer/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/AasxPluginMtpViewer/Resources/LICENSE.TXT b/src/AasxPluginMtpViewer/Resources/LICENSE.TXT deleted file mode 100644 index fc70527e2..000000000 --- a/src/AasxPluginMtpViewer/Resources/LICENSE.TXT +++ /dev/null @@ -1,651 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG , author: Michael Hoffmeister -Copyright (c) 2019 PHOENIX CONTACT GmbH & Co. KG , author: Andreas Orzelski -This software is licensed under the Eclipse Public License 2.0 (EPL-2.0) (see below) -The browser functionality is licensed under the cefSharp license (see below) -The Newtonsoft.JSON serialization is licensed under the MIT License (MIT) (see below) -The QR code generation is licensed under the MIT license (MIT) (see below) -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under the Apache License 2.0 (Apache-2.0) (see below) -The Grapevine REST server framework is licensed under Apache License 2.0 (Apache-2.0) (see below) -The AutomationML.Engine is licensed under the MIT license (MIT) (see below) -The MQTT server and client is licensed under the MIT license (MIT) (see below) - -This application is a sample application for demonstration of the features of the Administration Shell. -It is not allowed for productive use. The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed under Creative Commons CC BY-ND 3.0 DE. - -Eclipse Public License 2.0 (EPL-2.0) -==================================== - -(https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt) - - THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE - PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION - OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - - a) in the case of the initial Contributor, the initial content - Distributed under this Agreement, and - - b) in the case of each subsequent Contributor: - i) changes to the Program, and - ii) additions to the Program; - where such changes and/or additions to the Program originate from - and are Distributed by that particular Contributor. A Contribution - "originates" from a Contributor if it was added to the Program by - such Contributor itself or anyone acting on such Contributor's behalf. - Contributions do not include changes or additions to the Program that - are not Modified Works. - -"Contributor" means any person or entity that Distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which -are necessarily infringed by the use or sale of its Contribution alone -or when combined with the Program. - -"Program" means the Contributions Distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this Agreement -or any Secondary License (as applicable), including Contributors. - -"Derivative Works" shall mean any work, whether in Source Code or other -form, that is based on (or derived from) the Program and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. - -"Modified Works" shall mean any work in Source Code or other form that -results from an addition to, deletion from, or modification of the -contents of the Program, including, for purposes of clarity any new file -in Source Code form that contains any contents of the Program. Modified -Works shall not include works that contain only declarations, -interfaces, types, classes, structures, or files of the Program solely -in each case in order to link to, bind by name, or subclass the Program -or Modified Works thereof. - -"Distribute" means the acts of a) distributing or b) making available -in any manner that enables the transfer of a copy. - -"Source Code" means the form of a Program preferred for making -modifications, including but not limited to software source code, -documentation source, and configuration files. - -"Secondary License" means either the GNU General Public License, -Version 2.0, or any later versions of that license, including any -exceptions or additional permissions as identified by the initial -Contributor. - -2. GRANT OF RIGHTS - - a) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free copyright - license to reproduce, prepare Derivative Works of, publicly display, - publicly perform, Distribute and sublicense the Contribution of such - Contributor, if any, and such Derivative Works. - - b) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free patent - license under Licensed Patents to make, use, sell, offer to sell, - import and otherwise transfer the Contribution of such Contributor, - if any, in Source Code or other form. This patent license shall - apply to the combination of the Contribution and the Program if, at - the time the Contribution is added by the Contributor, such addition - of the Contribution causes such combination to be covered by the - Licensed Patents. The patent license shall not apply to any other - combinations which include the Contribution. No hardware per se is - licensed hereunder. - - c) Recipient understands that although each Contributor grants the - licenses to its Contributions set forth herein, no assurances are - provided by any Contributor that the Program does not infringe the - patent or other intellectual property rights of any other entity. - Each Contributor disclaims any liability to Recipient for claims - brought by any other entity based on infringement of intellectual - property rights or otherwise. As a condition to exercising the - rights and licenses granted hereunder, each Recipient hereby - assumes sole responsibility to secure any other intellectual - property rights needed, if any. For example, if a third party - patent license is required to allow Recipient to Distribute the - Program, it is Recipient's responsibility to acquire that license - before distributing the Program. - - d) Each Contributor represents that to its knowledge it has - sufficient copyright rights in its Contribution, if any, to grant - the copyright license set forth in this Agreement. - - e) Notwithstanding the terms of any Secondary License, no - Contributor makes additional grants to any Recipient (other than - those set forth in this Agreement) as a result of such Recipient's - receipt of the Program under the terms of a Secondary License - (if permitted under the terms of Section 3). - -3. REQUIREMENTS - -3.1 If a Contributor Distributes the Program in any form, then: - - a) the Program must also be made available as Source Code, in - accordance with section 3.2, and the Contributor must accompany - the Program with a statement that the Source Code for the Program - is available under this Agreement, and informs Recipients how to - obtain it in a reasonable manner on or through a medium customarily - used for software exchange; and - - b) the Contributor may Distribute the Program under a license - different than this Agreement, provided that such license: - i) effectively disclaims on behalf of all other Contributors all - warranties and conditions, express and implied, including - warranties or conditions of title and non-infringement, and - implied warranties or conditions of merchantability and fitness - for a particular purpose; - - ii) effectively excludes on behalf of all other Contributors all - liability for damages, including direct, indirect, special, - incidental and consequential damages, such as lost profits; - - iii) does not attempt to limit or alter the recipients' rights - in the Source Code under section 3.2; and - - iv) requires any subsequent distribution of the Program by any - party to be under a license that satisfies the requirements - of this section 3. - -3.2 When the Program is Distributed as Source Code: - - a) it must be made available under this Agreement, or if the - Program (i) is combined with other material in a separate file or - files made available under a Secondary License, and (ii) the initial - Contributor attached to the Source Code the notice described in - Exhibit A of this Agreement, then the Program may be made available - under the terms of such Secondary Licenses, and - - b) a copy of this Agreement must be included with each copy of - the Program. - -3.3 Contributors may not remove or alter any copyright, patent, -trademark, attribution notices, disclaimers of warranty, or limitations -of liability ("notices") contained within the Program from any copy of -the Program which they Distribute, provided that Contributors may add -their own appropriate notices. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities -with respect to end users, business partners and the like. While this -license is intended to facilitate the commercial use of the Program, -the Contributor who includes the Program in a commercial product -offering should do so in a manner which does not create potential -liability for other Contributors. Therefore, if a Contributor includes -the Program in a commercial product offering, such Contributor -("Commercial Contributor") hereby agrees to defend and indemnify every -other Contributor ("Indemnified Contributor") against any losses, -damages and costs (collectively "Losses") arising from claims, lawsuits -and other legal actions brought by a third party against the Indemnified -Contributor to the extent caused by the acts or omissions of such -Commercial Contributor in connection with its distribution of the Program -in a commercial product offering. The obligations in this section do not -apply to any claims or Losses relating to any actual or alleged -intellectual property infringement. In order to qualify, an Indemnified -Contributor must: a) promptly notify the Commercial Contributor in -writing of such claim, and b) allow the Commercial Contributor to control, -and cooperate with the Commercial Contributor in, the defense and any -related settlement negotiations. The Indemnified Contributor may -participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those performance -claims and warranties, and if a court requires any other Contributor to -pay any damages as a result, the Commercial Contributor must pay -those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT -PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" -BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR -IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF -TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR -PURPOSE. Each Recipient is solely responsible for determining the -appropriateness of using and distributing the Program and assumes all -risks associated with its exercise of rights under this Agreement, -including but not limited to the risks and costs of program errors, -compliance with applicable laws, damage to or loss of data, programs -or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT -PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS -SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST -PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE -EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that the -Program itself (excluding combinations of the Program with other software -or hardware) infringes such Recipient's patent(s), then such Recipient's -rights granted under Section 2(b) shall terminate as of the date such -litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign the -responsibility to serve as the Agreement Steward to a suitable separate -entity. Each new version of the Agreement will be given a distinguishing -version number. The Program (including Contributions) may always be -Distributed subject to the version of the Agreement under which it was -received. In addition, after a new version of the Agreement is published, -Contributor may elect to Distribute the Program (including its -Contributions) under the new version. - -Except as expressly stated in Sections 2(a) and 2(b) above, Recipient -receives no rights or licenses to the intellectual property of any -Contributor under this Agreement, whether expressly, by implication, -estoppel or otherwise. All rights in the Program not expressly granted -under this Agreement are reserved. Nothing in this Agreement is intended -to be enforceable by any entity that is not a Contributor or Recipient. -No third-party beneficiary rights are created under this Agreement. - -Exhibit A - Form of Secondary Licenses Notice - -"This Source Code may also be made available under the following -Secondary Licenses when the conditions for such availability set forth -in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), -version(s), and exceptions or additional permissions here}." - - Simply including a copy of this Agreement, including this Exhibit A - is not sufficient to license the Source Code under Secondary Licenses. - - If it is not possible or desirable to put the notice in a particular - file, then You may include the notice in a location (such as a LICENSE - file in a relevant directory) where a recipient would be likely to - look for such a notice. - - You may add additional accurate notices of copyright ownership. - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -// Copyright © The CefSharp Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// * Neither the name of Google Inc. nor the name Chromium Embedded -// Framework nor the name CefSharp nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/src/AasxPluginMtpViewer/WpfMtpControlWrapper.xaml b/src/AasxPluginMtpViewer/WpfMtpControlWrapper.xaml deleted file mode 100644 index 413575130..000000000 --- a/src/AasxPluginMtpViewer/WpfMtpControlWrapper.xaml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (c) 2019 by Michael Hoffmeister, Festo AG & Co. KG - - - diff --git a/src/AasxPluginMtpViewer/WpfMtpControlWrapper.xaml.cs b/src/AasxPluginMtpViewer/WpfMtpControlWrapper.xaml.cs deleted file mode 100644 index 2e2d3592e..000000000 --- a/src/AasxPluginMtpViewer/WpfMtpControlWrapper.xaml.cs +++ /dev/null @@ -1,505 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using AasxIntegrationBase; -using AasxPredefinedConcepts; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using Newtonsoft.Json; -using WpfMtpControl; -using WpfMtpControl.DataSources; - -namespace AasxPluginMtpViewer -{ - public partial class WpfMtpControlWrapper : UserControl - { - // internal members - - private LogInstance theLog = null; - private AdminShellPackageEnv thePackage = null; - private Aas.Submodel theSubmodel = null; - private AasxPluginMtpViewer.MtpViewerOptions theOptions = null; - private PluginEventStack theEventStack = null; - - private AasxPredefinedConcepts.DefinitionsExperimental.InteropRelations defsInterop = null; - private DefinitionsMTP.ModuleTypePackage defsMtp = null; - - public MtpDataSourceOpcUaPreLoadInfo thePreLoadInfo = new MtpDataSourceOpcUaPreLoadInfo(); - - private WpfMtpControl.MtpSymbolLib theSymbolLib = null; - private WpfMtpControl.MtpVisualObjectLib activeVisualObjectLib = null; - private WpfMtpControl.MtpData activeMtpData = null; - - private Aas.File activeMtpFileElem = null; - private string activeMtpFileFn = null; - - public WpfMtpControl.MtpVisuOpcUaClient client = new WpfMtpControl.MtpVisuOpcUaClient(); - - private MtpDataSourceSubscriber activeSubscriber = null; - - private MtpSymbolMapRecordList hintsForConfigRecs = null; - - // window / plugin mechanics - - public WpfMtpControlWrapper() - { - InitializeComponent(); - - // use pre-definitions - this.defsInterop = new AasxPredefinedConcepts.DefinitionsExperimental.InteropRelations(); - this.defsMtp = new DefinitionsMTP.ModuleTypePackage(); - } - - public void Start( - AdminShellPackageEnv thePackage, - Aas.Submodel theSubmodel, - AasxPluginMtpViewer.MtpViewerOptions theOptions, - PluginEventStack eventStack, - LogInstance log) - { - this.thePackage = thePackage; - this.theSubmodel = theSubmodel; - this.theOptions = theOptions; - this.theEventStack = eventStack; - this.theLog = log; - } - - public static WpfMtpControlWrapper FillWithWpfControls( - object opackage, object osm, - AasxPluginMtpViewer.MtpViewerOptions options, - PluginEventStack eventStack, - LogInstance log, - object masterDockPanel) - { - // access - var package = opackage as AdminShellPackageEnv; - var sm = osm as Aas.Submodel; - var master = masterDockPanel as DockPanel; - if (package == null || sm == null || master == null) - return null; - - // the Submodel elements need to have parents - sm.SetAllParents(); - - // create TOP control - var wrapperCntl = new WpfMtpControlWrapper(); - wrapperCntl.Start(package, sm, options, eventStack, log); - master.Children.Add(wrapperCntl); - - // return shelf - return wrapperCntl; - } - - private void UserControl_Loaded(object sender, RoutedEventArgs e) - { - // initialize symbol library - this.theSymbolLib = new MtpSymbolLib(); - - var ISO10628 = new ResourceDictionary(); - ISO10628.Source = new Uri( - "pack://application:,,,/WpfMtpControl;component/Resources/PNID_DIN_EN_ISO_10628.xaml"); - this.theSymbolLib.ImportResourceDicrectory("PNID_ISO10628", ISO10628); - - var FESTO = new ResourceDictionary(); - FESTO.Source = new Uri( - "pack://application:,,,/WpfMtpControl;component/Resources/PNID_Festo.xaml"); - this.theSymbolLib.ImportResourceDicrectory("PNID_Festo", FESTO); - - // initialize visual object libraries - activeVisualObjectLib = new WpfMtpControl.MtpVisualObjectLib(); - activeVisualObjectLib.LoadStatic(this.theSymbolLib); - - // gather infos - var ok = GatherMtpInfos(this.thePreLoadInfo); - if (ok && this.activeMtpFileFn != null) - { - // access file - var inputFn = this.activeMtpFileFn; - if (CheckIfPackageFile(inputFn)) - inputFn = thePackage.MakePackageFileAvailableAsTempFile(inputFn); - - // load file - LoadFile(inputFn); - - // fit it - this.mtpVisu.ZoomToFitCanvas(); - - // double click handler - this.mtpVisu.MtpObjectDoubleClick += MtpVisu_MtpObjectDoubleClick; - } - - // Timer for status - System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); - // ReSharper disable once RedundantDelegateCreation - dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); - dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100); - dispatcherTimer.Start(); - } - - private void dispatcherTimer_Tick(object sender, EventArgs e) - { - if (this.client == null) - textBoxDataSourceStatus.Text = "(no OPC UA client enabled)"; - else - { - this.client.Tick(100); - textBoxDataSourceStatus.Text = this.client.GetStatus(); - } - } - - // handle Submodel data - - private bool GatherMtpInfos(MtpDataSourceOpcUaPreLoadInfo preLoadInfo) - { - // access - var env = this.thePackage?.AasEnv; - if (this.theSubmodel?.SemanticId == null || this.theSubmodel.SubmodelElements == null - || this.defsMtp == null - || env?.AssetAdministrationShells == null - || this.thePackage.AasEnv.Submodels == null) - return false; - - // need to find the type Submodel - Aas.ISubmodel mtpTypeSm = null; - - // check, if the user pointed to the instance submodel - if (this.theSubmodel.SemanticId.Matches(this.defsMtp.SEM_MtpInstanceSubmodel)) - { - // Source list - foreach (var srcLst in this.theSubmodel.SubmodelElements - .FindAllSemanticIdAs( - this.defsMtp.CD_SourceList?.GetReference(), MatchMode.Relaxed)) - { - // found a source list, might contain sources - if (srcLst?.Value == null) - continue; - - // UA Server? - foreach (var src in srcLst.Value.FindAllSemanticIdAs( - this.defsMtp.CD_SourceOpcUaServer?.GetReference(), MatchMode.Relaxed)) - if (src?.Value != null) - { - // UA server - var ep = src.Value.FindFirstSemanticIdAs( - this.defsMtp.CD_Endpoint.GetReference(), MatchMode.Relaxed)?.Value; - - // add - if (preLoadInfo?.EndpointMapping != null) - preLoadInfo.EndpointMapping.Add( - new MtpDataSourceOpcUaEndpointMapping( - "" + ep, ForName: ("" + src.IdShort).Trim())); - } - } - - // Identifier renaming? - foreach (var ren in theSubmodel.SubmodelElements - .FindAllSemanticIdAs( - this.defsMtp.CD_IdentifierRenaming?.GetReference(), MatchMode.Relaxed)) - if (ren?.Value != null) - { - var oldtxt = ren.Value.FindFirstSemanticIdAs( - this.defsMtp.CD_RenamingOldText?.GetReference(), MatchMode.Relaxed)?.Value; - var newtxt = ren.Value.FindFirstSemanticIdAs( - this.defsMtp.CD_RenamingNewText?.GetReference(), MatchMode.Relaxed)?.Value; - if (oldtxt.HasContent() && newtxt.HasContent() && - preLoadInfo?.IdentifierRenaming != null) - preLoadInfo.IdentifierRenaming.Add(new MtpDataSourceStringReplacement(oldtxt, newtxt)); - } - - // Namespace renaming? - foreach (var ren in theSubmodel.SubmodelElements - .FindAllSemanticIdAs( - this.defsMtp.CD_NamespaceRenaming?.GetReference(), MatchMode.Relaxed)) - if (ren?.Value != null) - { - var oldtxt = ren?.Value.FindFirstSemanticIdAs( - this.defsMtp.CD_RenamingOldText?.GetReference(), MatchMode.Relaxed)?.Value; - var newtxt = ren?.Value.FindFirstSemanticIdAs( - this.defsMtp.CD_RenamingNewText?.GetReference(), MatchMode.Relaxed)?.Value; - if (oldtxt.HasContent() && newtxt.HasContent() && - preLoadInfo?.NamespaceRenaming != null) - preLoadInfo.NamespaceRenaming.Add(new MtpDataSourceStringReplacement(oldtxt, newtxt)); - } - - // according spec from Sten Gruener, the derivedFrom relationship shall be exploited. - // How to get from subModel to AAS? - var instanceAas = env.FindAasWithSubmodelId(this.theSubmodel.Id); - var typeAas = env.FindReferableByReference(instanceAas?.DerivedFrom) as Aas.AssetAdministrationShell; - if (instanceAas?.DerivedFrom != null && typeAas != null) - foreach (var msm in env.FindAllSubmodelGroupedByAAS((aas, sm) => - { - return aas == typeAas && true == sm?.SemanticId?.Matches(this.defsMtp.SEM_MtpSubmodel); - })) - { - mtpTypeSm = msm; - break; - } - - // another possibility: direct reference - var dirLink = this.theSubmodel.SubmodelElements - .FindFirstSemanticIdAs( - this.defsMtp.CD_MtpTypeSubmodel?.GetReference(), MatchMode.Relaxed); - var dirLinkSm = env.FindReferableByReference(dirLink?.Value) as Aas.Submodel; - if (mtpTypeSm == null) - mtpTypeSm = dirLinkSm; - - } - - // other (not intended) case: user points to type submodel directly - if (mtpTypeSm == null - && this.theSubmodel.SemanticId.Matches(this.defsMtp.SEM_MtpSubmodel)) - mtpTypeSm = this.theSubmodel; - - // ok, is there a type submodel? - if (mtpTypeSm == null) - return false; - - // find file, remember Submodel element for it, find filename - // (ConceptDescription)(no-local)[IRI]http://www.admin-shell.io/mtp/v1/MTPSUCLib/ModuleTypePackage - this.activeMtpFileElem = mtpTypeSm.SubmodelElements? - .FindFirstSemanticIdAs(this.defsMtp.CD_MtpFile.GetReference(), - MatchMode.Relaxed); - var inputFn = this.activeMtpFileElem?.Value; - if (inputFn == null) - return false; - this.activeMtpFileFn = inputFn; - - return true; - } - - // MTP handlings - - private bool CheckIfPackageFile(string fn) - { - return fn.StartsWith(@"/"); - } - - private void LoadFile(string fn) - { - if (!".aml .zip .mtp".Contains(System.IO.Path.GetExtension(fn.Trim().ToLower()))) - return; - - this.client = new WpfMtpControl.MtpVisuOpcUaClient(); - this.client.ItemChanged += Client_ItemChanged; - this.activeSubscriber = new MtpDataSourceSubscriber(); - this.hintsForConfigRecs = new MtpSymbolMapRecordList(); - - this.activeMtpData = new WpfMtpControl.MtpData(); - this.activeMtpData.LoadAmlOrMtp(activeVisualObjectLib, - this.client, this.thePreLoadInfo, this.activeSubscriber, fn); - - if (this.activeMtpData.PictureCollection.Count > 0) - mtpVisu.SetPicture(this.activeMtpData.PictureCollection.Values.ElementAt(0)); - mtpVisu.RedrawMtp(); - } - - private void Client_ItemChanged(WpfMtpControl.DataSources.IMtpDataSourceStatus dataSource, - MtpVisuOpcUaClient.DetailItem itemRef, MtpVisuOpcUaClient.ItemChangeType changeType) - { - if (dataSource == null || itemRef == null || itemRef.MtpSourceItemId == null - || this.activeSubscriber == null) - return; - - if (changeType == MtpVisuOpcUaClient.ItemChangeType.Value) - this.activeSubscriber.Invoke(itemRef.MtpSourceItemId, MtpDataSourceSubscriber.ChangeType.Value, - itemRef.Value); - } - - private void MtpVisu_MtpObjectDoubleClick(MtpData.MtpBaseObject source) - { - // access - var sme = this.theSubmodel?.SubmodelElements; - var first = this.activeMtpFileElem.GetReference(); - if (source == null || this.activeMtpFileElem == null || sme == null || first == null) - return; - - // for the active file, find a Reference for it - - foreach (var searchId in new[] { source.Name, source.RefID }) - { - // access - if (searchId == null) - continue; - // - // Search for FileToNavigateElement - // - - var firstFtn = first.Add(new Aas.Key(Aas.KeyTypes.GlobalReference, searchId)); - this.theLog?.Info($"DblClick MTP .. search reference: {firstFtn.ToStringExtended(1)}"); - - foreach (var fileToNav in sme.FindAllSemanticIdAs( - this.defsInterop?.CD_FileToNavigateElement?.GetReference(), MatchMode.Relaxed)) - if (fileToNav.First?.Matches(firstFtn, MatchMode.Relaxed) == true) - { - // try activate - var ev = new AasxIntegrationBase.AasxPluginResultEventNavigateToReference(); - ev.targetReference = fileToNav.Second.Copy(); - this.theEventStack?.PushEvent(ev); - return; - } - - // - // Search for FileToEntity - // - - var firstFte = first.Add(new Aas.Key(Aas.KeyTypes.GlobalReference, searchId)); - this.theLog?.Info($"DblClick MTP .. search reference: {firstFte.ToStringExtended(1)}"); - - foreach (var fileToEnt in sme.FindAllSemanticIdAs( - this.defsInterop?.CD_FileToEntity?.GetReference(), MatchMode.Relaxed)) - if (fileToEnt.First?.Matches(firstFte, MatchMode.Relaxed) == true) - { - // debug - this.theLog?.Info($"try find Entity {"" + fileToEnt.Second} .."); - - // find Entity, check if self-contained - var foundRef = this.thePackage?.AasEnv?.FindReferableByReference(fileToEnt.Second); - if (foundRef is Aas.Entity foundEnt - && foundEnt.EntityType == Aas.EntityType.SelfManagedEntity - && foundEnt.GlobalAssetId != null) - { - // try activate - var ev = new AasxIntegrationBase.AasxPluginResultEventNavigateToReference(); - ev.targetReference = new Aas.Reference(Aas.ReferenceTypes.ExternalReference, - new Aas.IKey[] { new Aas.Key(Aas.KeyTypes.GlobalReference, foundEnt.GlobalAssetId) } - .ToList()); - this.theEventStack?.PushEvent(ev); - return; - } - } - } - } - - // visual window handling - - private int overlayPanelMode = 0; - - private void SetOverlayPanelMode(int newMode) - { - this.overlayPanelMode = newMode; - - switch (this.overlayPanelMode) - { - case 2: - this.ScrollViewerDataSources.Visibility = Visibility.Visible; - DataGridDataSources.ItemsSource = this.client.Items; - this.RichTextReport.Visibility = Visibility.Collapsed; - break; - - case 1: - this.ScrollViewerDataSources.Visibility = Visibility.Collapsed; - DataGridDataSources.ItemsSource = null; - this.RichTextReport.Visibility = Visibility.Visible; - ReportOnConfiguration(this.RichTextReport); - break; - - default: - this.ScrollViewerDataSources.Visibility = Visibility.Collapsed; - DataGridDataSources.ItemsSource = null; - this.RichTextReport.Visibility = Visibility.Collapsed; - break; - } - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - if (sender == buttonDataSourceDetails) - { - if (this.overlayPanelMode != 2) - SetOverlayPanelMode(2); - else - SetOverlayPanelMode(0); - } - - if (sender == buttonConfig) - { - if (this.overlayPanelMode != 1) - SetOverlayPanelMode(1); - else - SetOverlayPanelMode(0); - } - } - - private void AddToRichTextBox(RichTextBox rtb, string text, bool bold = false, double? fontSize = null, - bool monoSpaced = false) - { - var p = new Paragraph(); - if (bold) - p.FontWeight = FontWeights.Bold; - if (fontSize.HasValue) - p.FontSize = fontSize.Value; - if (monoSpaced) - p.FontFamily = new System.Windows.Media.FontFamily("Courier New"); - p.Inlines.Add(new Run(text)); - rtb.Document.Blocks.Add(p); - } - - private void ReportOnConfiguration(RichTextBox rtb) - { - // access - if (rtb == null) - return; - - rtb.Document.Blocks.Clear(); - - // - // Report on available library symbols - // - - if (this.theSymbolLib != null) - { - - AddToRichTextBox(rtb, "Library symbols", bold: true, fontSize: 18); - - AddToRichTextBox(rtb, "The following lists shows available symbol full names."); - - foreach (var x in this.theSymbolLib.Values) - { - AddToRichTextBox(rtb, "" + x.FullName, monoSpaced: true); - } - - AddToRichTextBox(rtb, ""); - } - - // - // Hints for configurations - // - - if (this.hintsForConfigRecs != null) - { - AddToRichTextBox(rtb, "Preformatted configuration records", bold: true, fontSize: 18); - AddToRichTextBox(rtb, - "The following JSON elements could be pasted into the options file named " + "" + - "'AasxPluginMtpViewer.options.json'. " + - "Prior to pasting, an appropriate symbol full name needs to be chosen from above list. " + - "For the eClass strings, multiples choices can be delimited by ';'. " + - "For EClassVersions, 'null' disables version checking. " + - "Either EClassClasses or EClassIRDIs shall be different to 'null'."); - - foreach (var x in this.hintsForConfigRecs) - { - var txt = JsonConvert.SerializeObject(x, Formatting.None); - AddToRichTextBox(rtb, "" + txt, monoSpaced: true); - } - - AddToRichTextBox(rtb, ""); - } - } - } -} diff --git a/src/AasxPluginUaNetClient/AasxPluginUaNetClient.csproj b/src/AasxPluginUaNetClient/AasxPluginUaNetClient.csproj deleted file mode 100644 index 2b60de449..000000000 --- a/src/AasxPluginUaNetClient/AasxPluginUaNetClient.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - net6.0-windows - Library - AasxIntegrationBase - false - true - false - - - - PreserveNewest - - - - - - - - PreserveNewest - - - - - - - - diff --git a/src/AasxPluginUaNetClient/AasxPluginUaNetClient.plugin b/src/AasxPluginUaNetClient/AasxPluginUaNetClient.plugin deleted file mode 100644 index 3beebdf2d..000000000 --- a/src/AasxPluginUaNetClient/AasxPluginUaNetClient.plugin +++ /dev/null @@ -1 +0,0 @@ -This file tags the according .ddl to be a plug-in for AasxPackageExplorer. \ No newline at end of file diff --git a/src/AasxPluginUaNetClient/ExitCode.cs b/src/AasxPluginUaNetClient/ExitCode.cs deleted file mode 100644 index 539d7b9db..000000000 --- a/src/AasxPluginUaNetClient/ExitCode.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SampleClient -{ - - public enum ExitCode - { - Ok = 0, - ErrorCreateApplication = 0x11, - ErrorDiscoverEndpoints = 0x12, - ErrorCreateSession = 0x13, - ErrorBrowseNamespace = 0x14, - ErrorCreateSubscription = 0x15, - ErrorMonitoredItem = 0x16, - ErrorAddSubscription = 0x17, - ErrorRunning = 0x18, - ErrorNoKeepAlive = 0x30, - ErrorInvalidCommandLine = 0x100 - }; -} diff --git a/src/AasxPluginUaNetClient/LICENSE.txt b/src/AasxPluginUaNetClient/LICENSE.txt deleted file mode 100644 index e41b57159..000000000 --- a/src/AasxPluginUaNetClient/LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -Please see LICENSE.txt of the AASX Package Explorer main application. \ No newline at end of file diff --git a/src/AasxPluginUaNetClient/Plugin.cs b/src/AasxPluginUaNetClient/Plugin.cs deleted file mode 100644 index 0334c6902..000000000 --- a/src/AasxPluginUaNetClient/Plugin.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG , -Author: Michael Hoffmeister. - -Copyright (c) 2019 Phoenix Contact GmbH & Co. KG <> -Author: Andreas Orzelski - -For OPC Content: - -Copyright (c) 1996-2016, OPC Foundation. All rights reserved. -The source code in this file is covered under a dual-license scenario: - - RCL: for OPC Foundation members in good-standing - - GPL V2: everybody else -RCL license terms accompanied with this source code. See http://opcfoundation.org/License/RCL/1.00/ -GNU General Public License as published by the Free Software Foundation -version 2 of the License are accompanied with this source code. See http://opcfoundation.org/License/GPLv2 -This source code is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace AasxIntegrationBase // the namespace has to be: AasxIntegrationBase -{ - // the class names has to be: AasxPlugin and subclassing IAasxPluginInterface - // ReSharper disable once UnusedType.Global - public class AasxPlugin : AasxPluginBase - { - public new void InitPlugin(string[] args) - { - PluginName = "AasxPluginOpcUaClient"; - _log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args)); - } - - public AasxPluginActionDescriptionBase[] ListActions() - { - var res = ListActionsBasicHelper( - enableCheckVisualExt: false, - enableLicenses: true); - res.Add(new AasxPluginActionDescriptionBase("create-client", - "Creates a OPC UA client and returns as plain object. Arguments: (string _endpointURL, " - + "bool _autoAccept, int _stopTimeout, string _userName, string _password).")); - res.Add(new AasxPluginActionDescriptionBase("read-sme-value", - "Reads a value and returns as plain object. Arguments: (UASampleClient client, string nodeName, " - + "int index).")); - return res.ToArray(); - } - - public new AasxPluginResultBase ActivateAction(string action, params object[] args) - { - if (action == "get-licenses") - { - var lic = new AasxPluginResultLicense(); - lic.shortLicense = - "This application uses the OPC Foundation .NET Standard stack. See: OPC REDISTRIBUTABLES " - + "Agreement of Use." + Environment.NewLine + - "The OPC UA Example Code of OPC UA Standard is licensed under the MIT license (MIT)."; - - lic.isStandardLicense = true; - lic.longLicense = AasxPluginHelper.LoadLicenseTxtFromAssemblyDir( - "LICENSE.txt", Assembly.GetExecutingAssembly()); - - return lic; - } - - if (action == "create-client") - { - // OPC Copyright - MessageBox.Show( - "Copyright (c) 2018-2023 PHOENIX CONTACT GmbH & Co. KG , " + - "author: Andreas Orzelski\n\n" + - "Portions copyright (c) by OPC Foundation, Inc. and licensed under the Reciprocal Community " + - "License (RCL)\n" + "see https://opcfoundation.org/license/rcl.html", - "Plugin Notice" - ); - - // check for arguments - if (args == null || args.Length != 5 || !(args[0] is string && args[1] is bool && args[2] is int - && args[3] is string && args[4] is string)) - { - _log.Info("create-client() call with wrong arguments. Expected: (string _endpointURL, " - + "bool _autoAccept, int _stopTimeout, string _userName, string _password)"); - return null; - } - - // re-establish arguments - var _endpointURL = args[0] as string; - var _autoAccept = (bool)args[1]; - var _stopTimeout = (int)args[2]; - var _userName = args[3] as string; - var _password = args[4] as string; - - // make client - var client = new SampleClient.UASampleClient(_endpointURL, _autoAccept, _stopTimeout, - _userName, _password); - client.ConsoleSampleClient().Wait(); - - // return as plain object - var res = new AasxPluginResultBaseObject(); - res.strType = "UASampleClient"; - res.obj = client; - return res; - } - - if (action == "read-sme-value") - { - // check for arguments - if (args == null || args.Length != 3 || !(args[0] is SampleClient.UASampleClient - && args[1] is string && args[2] is int)) - { - _log.Info("read-sme-value() call with wrong arguments. Expected: (UASampleClient client, " - + "string nodeName, int index)"); - return null; - } - - // re-establish arguments - var client = args[0] as SampleClient.UASampleClient; - var nodeName = args[1] as string; - var Namespace = (int)args[2]; - - // make the call - var value = client?.ReadSubmodelElementValue(nodeName, Namespace); - - // return as plain object - var res = new AasxPluginResultBaseObject(); - res.strType = "value object"; - res.obj = value; - return res; - } - - return null; - } - } -} diff --git a/src/AasxPluginUaNetClient/Properties/AssemblyInfo.cs b/src/AasxPluginUaNetClient/Properties/AssemblyInfo.cs deleted file mode 100644 index 08be6b047..000000000 --- a/src/AasxPluginUaNetClient/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxPluginOpcUaClient")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxPluginOpcUaClient")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("9eb71e8b-ec41-4054-bab4-f419b4d13a36")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// indem Sie "*" wie unten gezeigt eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxPluginUaNetClient/Properties/Settings.Designer.cs b/src/AasxPluginUaNetClient/Properties/Settings.Designer.cs deleted file mode 100644 index f16feb8a0..000000000 --- a/src/AasxPluginUaNetClient/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace AasxIntegrationBase.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/src/AasxPluginUaNetClient/Properties/Settings.settings b/src/AasxPluginUaNetClient/Properties/Settings.settings deleted file mode 100644 index 049245f40..000000000 --- a/src/AasxPluginUaNetClient/Properties/Settings.settings +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/AasxPluginUaNetClient/UASampleClient.cs b/src/AasxPluginUaNetClient/UASampleClient.cs deleted file mode 100644 index 0fe1261bd..000000000 --- a/src/AasxPluginUaNetClient/UASampleClient.cs +++ /dev/null @@ -1,206 +0,0 @@ -// TODO (MIHO, 2020-08-06): lookup SOURCE! - -/* Copyright (c) 1996-2016, OPC Foundation. All rights reserved - The source code in this file is covered under a dual-license scenario - - RCL: for OPC Foundation members in good-standing - - GPL V2: everybody else - RCL license terms accompanied with this source code. See http://opcfoundation.org/License/RCL/1.00/ - GNU General Public License as published by the Free Software Foundation - version 2 of the License are accompanied with this source code. See http://opcfoundation.org/License/GPLv2 - This source code is distributed in the hope that it will be useful - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE -*/ - -using System; -using System.Threading; -using System.Threading.Tasks; -using AdminShellNS; -using Opc.Ua; -using Opc.Ua.Client; -using Opc.Ua.Configuration; - -namespace SampleClient -{ - public class UASampleClient - { - const int ReconnectPeriod = 10; - ISession session; - SessionReconnectHandler reconnectHandler; - string endpointURL; - int clientRunTime = Timeout.Infinite; - static bool autoAccept = true; - static ExitCode exitCode; - string userName; - string password; - - public UASampleClient(string _endpointURL, bool _autoAccept, int _stopTimeout, - string _userName, string _password) - { - endpointURL = _endpointURL; - autoAccept = _autoAccept; - clientRunTime = _stopTimeout <= 0 ? Timeout.Infinite : _stopTimeout * 1000; - userName = _userName; - password = _password; - } - - public void Run() - { - try - { - ConsoleSampleClient().Wait(); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - return; - } - - ManualResetEvent quitEvent = new ManualResetEvent(false); - try - { - Console.CancelKeyPress += (sender, eArgs) => - { - quitEvent.Set(); - eArgs.Cancel = true; - }; - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - - // wait for timeout or Ctrl-C - quitEvent.WaitOne(clientRunTime); - - // return error conditions - if (session.KeepAliveStopped) - { - exitCode = ExitCode.ErrorNoKeepAlive; - return; - } - - exitCode = ExitCode.Ok; - } - - public static ExitCode ExitCode { get => exitCode; } - - public async Task ConsoleSampleClient() - { - Console.WriteLine("1 - Create an Application Configuration."); - exitCode = ExitCode.ErrorCreateApplication; - - ApplicationInstance application = new ApplicationInstance - { - ApplicationName = "UA Core Sample Client", - ApplicationType = ApplicationType.Client, - ConfigSectionName = Utils.IsRunningOnMono() ? "Opc.Ua.MonoSampleClient" : "Opc.Ua.SampleClient" - }; - - // load the application configuration. - ApplicationConfiguration config = await application.LoadApplicationConfiguration(false); - - // check the application certificate. - bool haveAppCertificate = await application.CheckApplicationInstanceCertificate(false, 0); - if (!haveAppCertificate) - { - throw new Exception("Application instance certificate invalid!"); - } - - config.ApplicationUri = X509Utils.GetApplicationUriFromCertificate( - config.SecurityConfiguration.ApplicationCertificate.Certificate); - if (config.SecurityConfiguration.AutoAcceptUntrustedCertificates) - { - autoAccept = true; - } - config.CertificateValidator.CertificateValidation += - // ReSharper disable once RedundantDelegateCreation - new CertificateValidationEventHandler(CertificateValidator_CertificateValidation); - - Console.WriteLine("2 - Discover endpoints of {0}.", endpointURL); - exitCode = ExitCode.ErrorDiscoverEndpoints; - var selectedEndpoint = CoreClientUtils.SelectEndpoint(endpointURL, true, 15000); - Console.WriteLine(" Selected endpoint uses: {0}", - selectedEndpoint.SecurityPolicyUri.Substring(selectedEndpoint.SecurityPolicyUri.LastIndexOf('#') + 1)); - - Console.WriteLine("3 - Create a session with OPC UA server."); - exitCode = ExitCode.ErrorCreateSession; - var endpointConfiguration = EndpointConfiguration.Create(config); - var endpoint = new ConfiguredEndpoint(null, selectedEndpoint, endpointConfiguration); - - session = await Session.Create(config, endpoint, false, "OPC UA Console Client", 60000, - new UserIdentity(userName, password), null); - - // register keep alive handler - session.KeepAlive += Client_KeepAlive; - } - - private void Client_KeepAlive(ISession sender, KeepAliveEventArgs e) - { - if (e.Status != null && ServiceResult.IsNotGood(e.Status)) - { - Console.WriteLine("{0} {1}/{2}", e.Status, sender.OutstandingRequestCount, sender.DefunctRequestCount); - - if (reconnectHandler == null) - { - Console.WriteLine("--- RECONNECTING ---"); - reconnectHandler = new SessionReconnectHandler(); - reconnectHandler.BeginReconnect(sender, ReconnectPeriod * 1000, Client_ReconnectComplete); - } - } - } - - private void Client_ReconnectComplete(object sender, EventArgs e) - { - // ignore callbacks from discarded objects. - if (!Object.ReferenceEquals(sender, reconnectHandler)) - { - return; - } - - if (reconnectHandler != null) - { - session = reconnectHandler.Session; - reconnectHandler.Dispose(); - } - - reconnectHandler = null; - - Console.WriteLine("--- RECONNECTED ---"); - } - - private static void OnNotification(MonitoredItem item, MonitoredItemNotificationEventArgs e) - { - foreach (var value in item.DequeueValues()) - { - Console.WriteLine("{0}: {1}, {2}, {3}", item.DisplayName, value.Value, value.SourceTimestamp, - value.StatusCode); - } - } - - private static void CertificateValidator_CertificateValidation(CertificateValidator validator, - CertificateValidationEventArgs e) - { - if (e.Error.StatusCode == StatusCodes.BadCertificateUntrusted) - { - e.Accept = autoAccept; - if (autoAccept) - { - Console.WriteLine("Accepted Certificate: {0}", e.Certificate.Subject); - } - else - { - Console.WriteLine("Rejected Certificate: {0}", e.Certificate.Subject); - } - } - } - - public string ReadSubmodelElementValue(string nodeName, int index) - - { - NodeId node = new NodeId(nodeName, (ushort)index); - return (session.ReadValue(node).ToString()); - } - - } -} diff --git a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.Config.xml b/src/AasxPluginUaNetServer/AasxPluginUaNetServer.Config.xml deleted file mode 100644 index bd5e13525..000000000 --- a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.Config.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - UA Core Sample Server - urn:localhost:OPCFoundation:CoreSampleServer - http://opcfoundation.org/UA/CoreSampleServer - Server_0 - - - - - - X509Store - CurrentUser\My - CN=UA Core Sample Server, C=US, S=Arizona, O=IDTA, DC=localhost - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/issuer - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/trusted - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/rejected - - - - true - - - - - - - 600000 - 1048576 - 4194304 - 65535 - 4194304 - 65535 - 300000 - 3600000 - - - - - opc.tcp://localhost:51210/UA/SampleServer - - - - - - - - - SignAndEncrypt_3 - http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256 - - - - None_1 - http://opcfoundation.org/UA/SecurityPolicy#None - - - Sign_2 - - - - SignAndEncrypt_3 - - - - - 5 - 100 - 2000 - - - - Anonymous_0 - http://opcfoundation.org/UA/SecurityPolicy#None - - - UserName_1 - - - Certificate_2 - - - - false - 100 - 10000 - 3600000 - 10 - 10 - 100 - 600000 - 100 - 3600000 - 50 - 3600000 - 100 - 100 - 1000 - 1000 - - - - opc.tcp://localhost:4840 - - opc.tcp://localhost:4840 - DiscoveryServer_3 - - opc.tcp://localhost:48400 - - - SignAndEncrypt_3 - - - - - 30000 - Opc.Ua.Server.nodes.xml - - 20 - 100 - 10000 - 10000 - - - - Standard UA Server Profile - Data Access Server Facet - Method Server Facet - - 2 - - DA - - - PFX - PEM - - 0 - false - - - - - - - - - UInt32 - 100 - UInt32 - - - Double - 100 - Double - - - - - - - - %LocalApplicationData%/Logs/Opc.Ua.CoreSampleServer.log.txt - true - - - - - - - - - - - - - - - - true - - \ No newline at end of file diff --git a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.csproj b/src/AasxPluginUaNetServer/AasxPluginUaNetServer.csproj deleted file mode 100644 index baad25d03..000000000 --- a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - net6.0-windows - Library - false - - true - false - - - - - true - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - PreserveNewest - - - - - - - diff --git a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.options.json b/src/AasxPluginUaNetServer/AasxPluginUaNetServer.options.json deleted file mode 100644 index e54e27db3..000000000 --- a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.options.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - /* This plug-ins comes with this sample options to show, how multiple Submodel semantic ids can - be matched. This could be used, e.g., to enable a general "operational data" with this feature. */ - "Args": [ - "-single-nodeids", // recommended for SiOME & Open62541 - "-single-keys", // recommended for SiOME & Open62541 - // "-add-root-item", // do not use! - "-link-root-as-component", // recommended for SiOME & Open62541 - "-simple-data-types", - "-ns", - "2", - "-ns", - "3" - ] -} \ No newline at end of file diff --git a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.plugin b/src/AasxPluginUaNetServer/AasxPluginUaNetServer.plugin deleted file mode 100644 index 3beebdf2d..000000000 --- a/src/AasxPluginUaNetServer/AasxPluginUaNetServer.plugin +++ /dev/null @@ -1 +0,0 @@ -This file tags the according .ddl to be a plug-in for AasxPackageExplorer. \ No newline at end of file diff --git a/src/AasxPluginUaNetServer/LICENSE.txt b/src/AasxPluginUaNetServer/LICENSE.txt deleted file mode 100644 index e41b57159..000000000 --- a/src/AasxPluginUaNetServer/LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -Please see LICENSE.txt of the AASX Package Explorer main application. \ No newline at end of file diff --git a/src/AasxPluginUaNetServer/Plugin.cs b/src/AasxPluginUaNetServer/Plugin.cs deleted file mode 100644 index 4ae0164a4..000000000 --- a/src/AasxPluginUaNetServer/Plugin.cs +++ /dev/null @@ -1,277 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using AasOpcUaServer; -using AasxUaNetServer; -using AdminShellNS; -using Newtonsoft.Json; -using Opc.Ua; -using Opc.Ua.Configuration; -using Opc.Ua.Server; - -namespace AasxIntegrationBase // the namespace has to be: AasxIntegrationBase -{ - // the class names has to be: AasxPlugin and subclassing IAasxPluginInterface - // ReSharper disable once UnusedType.Global - public class AasxPlugin : AasxPluginBase - { - #region // Plug In - private AasxUaNetServer.UaNetServerOptions _options = new AasxUaNetServer.UaNetServerOptions(); - private bool _stop = false; - private UaServerWrapper _server = null; - // dead-csharp off - /* TODO (MIHO, 2021-11-17): damned, weird dependency reasons between - * - * .net6.0 and .net472 seem NOT TO ALLOW referring to AasxIntegrationBase. - * Fix */ - //private static T LoadDefaultOptionsFromAssemblyDirXXXX( - // string pluginName, Assembly assy = null, - // JsonSerializerSettings settings = null) where T : AasxPluginOptionsBase - //{ - // // expand assy? - // if (assy == null) - // assy = Assembly.GetExecutingAssembly(); - // if (pluginName == null || pluginName == "") - // return null; - - // // build fn - // var optfn = System.IO.Path.Combine( - // System.IO.Path.GetDirectoryName(assy.Location), - // pluginName + ".options.json"); - - // if (File.Exists(optfn)) - // { - // var optText = File.ReadAllText(optfn); - - // return Newtonsoft.Json.JsonConvert.DeserializeObject(optText, settings); - // } - - // // no - // return null; - //} - // dead-csharp on - - public new void InitPlugin(string[] args) - { - PluginName = "AasxPluginUaNetServer"; - _log.Info("InitPlugin() called with args = {0}", (args == null) ? "" : string.Join(", ", args)); - - // .. with built-in options - _options = AasxUaNetServer.UaNetServerOptions.CreateDefault(); - - // try load defaults options from assy directory - try - { - var newOpt = - AasxPluginOptionsBase - .LoadDefaultOptionsFromAssemblyDir( - this.GetPluginName(), Assembly.GetExecutingAssembly()); - if (newOpt != null) - this._options = newOpt; - } - catch (Exception ex) - { - _log?.Error(ex, "Exception when reading default options {1}"); - } - - // index them! - _options.IndexListOfRecords(_options.Records); - } - - public new AasxPluginActionDescriptionBase[] ListActions() - { - var res = ListActionsBasicHelper( - enableCheckVisualExt: false, - enableLicenses: true); - res.Add(new AasxPluginActionDescriptionBase("server-start", "Start OPC UA Server for AASX.")); - res.Add(new AasxPluginActionDescriptionBase("server-stop", "Stops server function.")); - return res.ToArray(); - } - - public new AasxPluginResultBase ActivateAction(string action, params object[] args) - { - if (action == "get-licenses") - { - var lic = new AasxPluginResultLicense(); - lic.shortLicense = - "This application uses the OPC Foundation .NET Standard stack. See: OPC REDISTRIBUTABLES " - + "Agreement of Use." + Environment.NewLine + - "The OPC UA Example Code of OPC UA Standard is licensed under the MIT license (MIT)."; - - lic.isStandardLicense = true; - lic.longLicense = AasxPluginHelper.LoadLicenseTxtFromAssemblyDir( - "LICENSE.txt", Assembly.GetExecutingAssembly()); - - return lic; - } - - if (action == "server-stop") - this._stop = true; - - if (action == "server-start") - { - // init - this._stop = false; - _log.Info("Starting OPC UA AASX Server. Based on the OPC Foundation UA Net Standard stack."); - _log.Info("Copyright (c) 2018-2023 Festo SE & Co. KG " + - ", author: Michael Hoffmeister."); - _log.Info("Portions copyright (c) by OPC Foundation, Inc. and licensed under the Reciprocal " - + "Community License (RCL)."); - _log.Info("See https://opcfoundation.org/license/rcl.html."); - - // access AASX - if (args == null || args.Length < 1) - { - _log.Info("No AASX package environment passed to plug-in. Stopping..."); - System.Threading.Thread.Sleep(5000); - return null; - } - - var package = args[0] as AdminShellPackageEnv; - if (package == null) - { - _log.Info("No AASX package environment passed to plug-in. Stopping..."); - System.Threading.Thread.Sleep(5000); - return null; - } - _log.Info("AASX package env has filename {0}", package.Filename); - - // configure UA here a little bit - ApplicationInstance.MessageDlg = new ApplicationMessageDlg(_log); - - // arguments - var externalOptions = new List(); - if (_options?.Args != null) - foreach (var o1 in _options.Args) - externalOptions.Add(o1); - - if (args.Length >= 2 && args[1] is string[]) - { - var pluginArgs = args[1] as string[]; - if (pluginArgs != null && pluginArgs.Length > 0) - { - foreach (var o2 in pluginArgs) - externalOptions.Add(o2); - } - } - - // debug - var lstr = $"Taking over {externalOptions.Count} arguments: "; - foreach (var ls in externalOptions) - lstr += ls + " "; - _log.Info("{0}", lstr); - - // parse - var internalOptions = new AasOpcUaServer.AasxUaServerOptions(); - internalOptions.ParseArgs(externalOptions.ToArray()); - - // run the server - try - { - this._server = new UaServerWrapper(_stopTimeout: 0, _aasxEnv: package, logger: _log, _serverOptions: internalOptions); - this._server.Run(); - } - catch (Exception ex) - { - _log.Info("Exception whenn running server: {0}", ex.Message); - } - - // do as long as user wants - int i = 0; - while (true) - { - if (this._stop) - { - _log.Info("Stopping ..."); - if (this._server != null) - this._server.Stop(); - break; - } - - //TODO (MIHO, 0000-00-00): Temporary disabled - // seems not to work anymore - ////if (this.server != null && this.server.IsNotRunningAnymore()) - //// break; - - // new option - if (true == this._server?.FinallyStopped) - break; - - System.Threading.Thread.Sleep(50); - if (i % 200 == 0) - _log.Info("Heartbeat {0} x 50ms ..", i); - i++; - } - _log.Info("Stopped."); - } - - var res = new AasxPluginResultBase(); - return res; - } - - } - - #endregion - - #region // taken form Net46 Console Server - // - // - // - - public class ApplicationMessageDlg : IApplicationMessageDlg - { - private LogInstance logger = null; - private string message = string.Empty; - private bool ask = false; - - public ApplicationMessageDlg(LogInstance logger) - { - this.logger = logger; - } - - public override void Message(string text, bool ask = false) - { - this.message = text; - this.ask = ask; - } - - public override async Task ShowAsync() - { - if (ask) - { - message += " (y/n, default y): "; - logger.Info("{0}", message); - Console.Write(message); - } - else - { - logger.Info("{0}", message); - Console.WriteLine(message); - } - if (ask) - { - // always say yes! - return await Task.FromResult(true); - } - return await Task.FromResult(true); - } - } - - - - #endregion -} diff --git a/src/AasxPluginUaNetServer/Properties/AssemblyInfo.cs b/src/AasxPluginUaNetServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 754b62d7b..000000000 --- a/src/AasxPluginUaNetServer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxPluginUaNetServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxPluginUaNetServer")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("32eede14-8622-42e6-81ae-33941b7a6efc")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// indem Sie "*" wie unten gezeigt eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxPluginUaNetServer/UaNetServerOptions.cs b/src/AasxPluginUaNetServer/UaNetServerOptions.cs deleted file mode 100644 index f3f9ac144..000000000 --- a/src/AasxPluginUaNetServer/UaNetServerOptions.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aas = AasCore.Aas3_0; -using AdminShellNS; -using AasxIntegrationBase; - -// ReSharper disable ClassNeverInstantiated.Global -// ReSharper disable UnassignedField.Global - -namespace AasxUaNetServer -{ - public class UaNetServerOptionsRecord : AasxPluginOptionsLookupRecordBase - { - } - - public class UaNetServerOptions : AasxPluginLookupOptionsBase - { - public string[] Args; - - public List Records = new List(); - - /// - /// Create a set of minimal options - /// - public static UaNetServerOptions CreateDefault() - { - var opt = new UaNetServerOptions(); - return opt; - } - } -} diff --git a/src/AasxRestConsoleServer/AasxRestConsoleServer.csproj b/src/AasxRestConsoleServer/AasxRestConsoleServer.csproj deleted file mode 100644 index 436479c9b..000000000 --- a/src/AasxRestConsoleServer/AasxRestConsoleServer.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - net6.0 - Exe - false - false - - - - - - - PreserveNewest - - - diff --git a/src/AasxRestConsoleServer/LICENSE.txt b/src/AasxRestConsoleServer/LICENSE.txt deleted file mode 100644 index 75f36a4ff..000000000 --- a/src/AasxRestConsoleServer/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo AG & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxRestConsoleServer/Program.cs b/src/AasxRestConsoleServer/Program.cs deleted file mode 100644 index 56e5cadf0..000000000 --- a/src/AasxRestConsoleServer/Program.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxRestServerLibrary; -using AdminShellNS; - -namespace AasxRestConsoleServer -{ - public static class Program - { - static void Main(string[] args) - { - Console.Error.WriteLine( - "AAS Console Server. (c) 2019 Michael Hoffmeister, Festo AG & Co. KG. See LICENSE.TXT."); - - // default command line options - var fn = "usb-stick-REST-demo.aasx"; - var host = "localhost"; - var port = "1111"; - - // parse - int i = 0; - while (i < args.Length) - { - var x = args[i].Trim().ToLower(); - - // real option? - if (i < args.Length - 1) - { - if (x == "-host") - { - host = args[i + 1]; - i += 2; - continue; - } - - if (x == "-port") - { - port = args[i + 1]; - i += 2; - continue; - } - } - - // last?? - fn = args[i]; - i += 1; - } - - // load? - var package = new AdminShellPackageEnv(fn); - AasxRestServer.Start(package, host, port, new GrapevineLoggerToConsole()); - - // wait for RETURN - Console.ReadLine(); - AasxRestServer.Stop(); - } - } -} diff --git a/src/AasxRestConsoleServer/Properties/AssemblyInfo.cs b/src/AasxRestConsoleServer/Properties/AssemblyInfo.cs deleted file mode 100644 index d3b5e5d78..000000000 --- a/src/AasxRestConsoleServer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxRestConsoleServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxRestConsoleServer")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("6c45112d-b7f0-4463-be6d-a8a2b5a547bf")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -//// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxRestServerLibrary/AasxHttpContextHelper.cs b/src/AasxRestServerLibrary/AasxHttpContextHelper.cs deleted file mode 100644 index 4f229061a..000000000 --- a/src/AasxRestServerLibrary/AasxHttpContextHelper.cs +++ /dev/null @@ -1,1611 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using AasxCompatibilityModels; -using AdminShellNS; -using Grapevine.Interfaces.Server; -using Grapevine.Server; -using Grapevine.Server.Attributes; -using Grapevine.Shared; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -/* -Please notice: -The API and REST routes implemented in this version of the source code are not specified and standardised by the -specification Details of the Administration Shell. The hereby stated approach is solely the opinion of its author(s). -*/ - -namespace AasxRestServerLibrary -{ - public class AasxHttpContextHelper - { - - public AdminShellPackageEnv Package = null; - - public AasxHttpHandleStore IdRefHandleStore = new AasxHttpHandleStore(); - - #region // Path helpers - - public bool PathEndsWith(string path, string tag) - { - return path.Trim().ToLower().TrimEnd('/').EndsWith(tag); - } - - public bool PathEndsWith(IHttpContext context, string tag) - { - return PathEndsWith(context.Request.PathInfo, tag); - } - - // see also: https://stackoverflow.com/questions/33619469/ - // how-do-i-write-a-regular-expression-to-route-traffic-with-grapevine-when-my-requ - - public Match PathInfoRegexMatch(MethodBase methodWithRestRoute, string input) - { - if (methodWithRestRoute == null) - return null; - string piRegex = null; - foreach (var attr in methodWithRestRoute.GetCustomAttributes()) - if (attr.PathInfo != null) - piRegex = attr.PathInfo; - if (piRegex == null) - return null; - var m = Regex.Match(input, piRegex); - return m; - } - - public List CreateHandlesFromQueryString( - System.Collections.Specialized.NameValueCollection queryStrings) - { - // start - var res = new List(); - if (queryStrings == null) - return res; - - // over all query strings - foreach (var kr in queryStrings.AllKeys) - { - try - { - var k = kr.Trim().ToLower(); - var v = queryStrings[k]; - if (k.StartsWith("q") && k.Length > 1 && v.Contains(',')) - { - var vl = v.Split(','); - if (vl.Length == 2) - { - var id = new AdminShell.Identification(vl[0], vl[1]); - var h = new AasxHttpHandleIdentification(id, "@" + k); - res.Add(h); - } - } - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - - // done - return res; - } - - public List CreateHandlesFromRawUrl(string rawUrl) - { - // start - var res = new List(); - if (rawUrl == null) - return res; - - // un-escape - var url = System.Uri.UnescapeDataString(rawUrl); - - // split for query string traditional - var i = url.IndexOf('?'); - if (i < 0 || i == url.Length - 1) - return res; - var query = url.Substring(i + 1); - - // try make a Regex wonder, again - var m = Regex.Match(query, @"(\s*([^&]+)(&|))+"); - if (m.Success && m.Groups.Count >= 3) - foreach (var cp in m.Groups[2].Captures) - { - var m2 = Regex.Match(cp.ToString(), @"\s*(\w+)\s*=\s*([^,]+),(.+)$"); - if (m2.Success && m2.Groups.Count >= 4) - { - var k = m2.Groups[1].ToString(); - var idt = m2.Groups[2].ToString(); - var ids = m2.Groups[3].ToString(); - - var id = new AdminShell.Identification(idt, ids); - var h = new AasxHttpHandleIdentification(id, "@" + k); - res.Add(h); - } - } - - // done - return res; - } - - #endregion - - #region // Access package structures - - public AdminShell.AdministrationShell FindAAS( - string aasid, System.Collections.Specialized.NameValueCollection queryStrings = null, string rawUrl = null) - { - // trivial - if (Package == null || Package.AasEnv == null || Package.AasEnv.AdministrationShells == null || - Package.AasEnv.AdministrationShells.Count < 1) - return null; - - // default aas? - if (aasid == null || aasid.Trim() == "" || aasid.Trim().ToLower() == "id") - return Package.AasEnv.AdministrationShells[0]; - - // resolve an ID? - var specialHandles = this.CreateHandlesFromRawUrl(rawUrl); - var handleId = IdRefHandleStore.ResolveSpecific(aasid, specialHandles); - if (handleId != null && handleId.identification != null) - return Package.AasEnv.FindAAS(handleId.identification); - - // no, iterate over idShort - return Package.AasEnv.FindAAS(aasid); - } - - public AdminShell.SubmodelRef FindSubmodelRefWithinAas( - AdminShell.AdministrationShell aas, string smid, - System.Collections.Specialized.NameValueCollection queryStrings = null, string rawUrl = null) - { - // trivial - if (Package == null || Package.AasEnv == null || aas == null || smid == null || smid.Trim() == "") - return null; - - // via handle - var specialHandles = this.CreateHandlesFromRawUrl(rawUrl); - var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); - - // no, iterate & find - foreach (var smref in aas.submodelRefs) - { - if (handleId != null && handleId.identification != null) - { - if (smref.Matches(handleId.identification)) - return smref; - } - else - { - var sm = this.Package.AasEnv.FindSubmodel(smref); - if (sm != null && sm.idShort != null && sm.idShort.Trim().ToLower() == smid.Trim().ToLower()) - return smref; - } - } - - // no - return null; - } - - public AdminShell.Submodel FindSubmodelWithinAas( - AdminShell.AdministrationShell aas, string smid, - System.Collections.Specialized.NameValueCollection queryStrings = null, string rawUrl = null) - { - // trivial - if (Package == null || Package.AasEnv == null || aas == null || smid == null || smid.Trim() == "") - return null; - - // via handle - var specialHandles = this.CreateHandlesFromRawUrl(rawUrl); - var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); - if (handleId != null && handleId.identification != null) - return Package.AasEnv.FindSubmodel(handleId.identification); - - // no, iterate & find - foreach (var smref in aas.submodelRefs) - { - var sm = this.Package.AasEnv.FindSubmodel(smref); - if (sm != null && sm.idShort != null && sm.idShort.Trim().ToLower() == smid.Trim().ToLower()) - return sm; - } - - // no - return null; - } - - public AdminShell.Submodel FindSubmodelWithoutAas( - string smid, System.Collections.Specialized.NameValueCollection queryStrings = null, - string rawUrl = null) - { - // trivial - if (Package == null || Package.AasEnv == null || smid == null || smid.Trim() == "") - return null; - - // via handle - var specialHandles = this.CreateHandlesFromRawUrl(rawUrl); - var handleId = IdRefHandleStore.ResolveSpecific(smid, specialHandles); - if (handleId != null && handleId.identification != null) - return Package.AasEnv.FindSubmodel(handleId.identification); - - // no, iterate & find - foreach (var sm in this.Package.AasEnv.Submodels) - { - if (sm != null && sm.idShort != null && sm.idShort.Trim().ToLower() == smid.Trim().ToLower()) - return sm; - } - - // no - return null; - } - - public AdminShell.ConceptDescription FindCdWithoutAas( - AdminShell.AdministrationShell aas, string cdid, - System.Collections.Specialized.NameValueCollection queryStrings = null, string rawUrl = null) - { - // trivial - if (Package == null || Package.AasEnv == null || aas == null || cdid == null || cdid.Trim() == "") - return null; - - // via handle - var specialHandles = this.CreateHandlesFromRawUrl(rawUrl); - var handleId = IdRefHandleStore.ResolveSpecific(cdid, specialHandles); - if (handleId != null && handleId.identification != null) - return Package.AasEnv.FindConceptDescription(handleId.identification); - - // no, iterate & find - foreach (var cd in Package.AasEnv.ConceptDescriptions) - { - if (cd.idShort != null && cd.idShort.Trim().ToLower() == cdid.Trim().ToLower()) - return cd; - } - - // no - return null; - } - - - public class FindSubmodelElementResult - { - public AdminShell.Referable elem = null; - public AdminShell.SubmodelElementWrapper wrapper = null; - public AdminShell.Referable parent = null; - - public FindSubmodelElementResult( - AdminShell.Referable elem = null, AdminShell.SubmodelElementWrapper wrapper = null, - AdminShell.Referable parent = null) - { - this.elem = elem; - this.wrapper = wrapper; - this.parent = parent; - } - } - - public FindSubmodelElementResult FindSubmodelElement( - AdminShell.Referable parent, List wrappers, - string[] elemids, int elemNdx = 0) - { - // trivial - if (wrappers == null || elemids == null || elemNdx >= elemids.Length) - return null; - - // dive into each - foreach (var smw in wrappers) - if (smw.submodelElement != null) - { - // idShort need to match - if (smw.submodelElement.idShort.Trim().ToLower() != elemids[elemNdx].Trim().ToLower()) - continue; - - // leaf - if (elemNdx == elemids.Length - 1) - { - return new FindSubmodelElementResult(elem: smw.submodelElement, wrapper: smw, parent: parent); - } - else - { - // recurse into? - var xsmc = smw.submodelElement as AdminShell.SubmodelElementCollection; - if (xsmc != null) - { - var r = FindSubmodelElement(xsmc, xsmc.value, elemids, elemNdx + 1); - if (r != null) - return r; - } - - var xop = smw.submodelElement as AdminShell.Operation; - if (xop != null) - { - var w2 = new List(); - for (int i = 0; i < 2; i++) - foreach (var opv in xop[i]) - if (opv.value != null) - w2.Add(opv.value); - - var r = FindSubmodelElement(xop, w2, elemids, elemNdx + 1); - if (r != null) - return r; - } - } - } - - // nothing - return null; - } - - #endregion - - #region // Generate responses - - - protected static void SendJsonResponse( - IHttpContext context, object obj, IContractResolver contractResolver = null) - { - var settings = new JsonSerializerSettings(); - if (contractResolver != null) - settings.ContractResolver = contractResolver; - var json = JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - var buffer = context.Request.ContentEncoding.GetBytes(json); - var length = buffer.Length; - - context.Response.ContentType = ContentType.JSON; - context.Response.ContentEncoding = Encoding.UTF8; - context.Response.ContentLength64 = length; - context.Response.SendResponse(buffer); - } - - protected static void SendTextResponse(IHttpContext context, string txt, string mimeType = null) - { - context.Response.ContentType = ContentType.TEXT; - if (mimeType != null) - context.Response.Advanced.ContentType = mimeType; - context.Response.ContentEncoding = Encoding.UTF8; - context.Response.ContentLength64 = txt.Length; - context.Response.SendResponse(txt); - } - - protected static void SendStreamResponse( - IHttpContext context, Stream stream, string headerAttachmentFileName = null) - { - context.Response.ContentType = ContentType.APPLICATION; - context.Response.ContentLength64 = stream.Length; - context.Response.SendChunked = true; - - if (headerAttachmentFileName != null) - context.Response.AddHeader("Content-Disposition", $"attachment; filename={headerAttachmentFileName}"); - - stream.CopyTo(context.Response.Advanced.OutputStream); - context.Response.Advanced.Close(); - } - - #endregion - - #region AAS and Asset - - public void EvalGetAasAndAsset(IHttpContext context, string aasid, bool deep = false, bool complete = false) - { - // access the first AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with id '{aasid}' found."); - return; - } - - // try to get the asset as well - var asset = this.Package.AasEnv.FindAsset(aas.assetRef); - - // result - dynamic res = new ExpandoObject(); - res.AAS = aas; - res.Asset = asset; - - // return as JSON - var cr = new AdminShellConverters.AdaptiveFilterContractResolver(deep: deep, complete: complete); - SendJsonResponse(context, res, cr); - } - - public void EvalGetAasEnv(IHttpContext context, string aasid) - { - if (this.Package == null || this.Package.AasEnv == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, $"Error accessing internal data structures."); - return; - } - - // access the first AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with id '{aasid}' found."); - return; - } - - // create a new, filtered AasEnv - AdminShell.AdministrationShellEnv copyenv = null; - try - { - copyenv = AdminShell.AdministrationShellEnv.CreateFromExistingEnv( - this.Package.AasEnv, filterForAas: new List(new[] { aas })); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot filter aas envioronment: {ex.Message}."); - return; - } - - // return as FILE - try - { - using (var ms = new MemoryStream()) - { - // build a file name - var fn = "aasenv.json"; - if (aas.idShort != null) - fn = aas.idShort + "." + fn; - // serialize via helper - var jsonwriter = copyenv.SerialiazeJsonToStream(new StreamWriter(ms), leaveJsonWriterOpen: true); - // write out again - ms.Position = 0; - SendStreamResponse(context, ms, Path.GetFileName(fn)); - // bit ugly - jsonwriter.Close(); - } - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Cannot serialize and send aas envioronment: {ex.Message}."); - } - } - - - public void EvalGetAasThumbnail(IHttpContext context, string aasid) - { - if (this.Package == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, $"Error accessing internal data structures."); - return; - } - - // access the first AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with id '{aasid}' found."); - return; - } - - // access the thumbnail - // Note: in this version, the thumbnail is not specific to the AAS, but maybe in later versions ;-) - Uri thumbUri = null; - var thumbStream = this.Package.GetLocalThumbnailStream(ref thumbUri); - if (thumbStream == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No thumbnail available in package."); - return; - } - - // return as FILE - SendStreamResponse(context, thumbStream, Path.GetFileName(thumbUri?.ToString() ?? "")); - thumbStream.Close(); - } - - public void EvalPutAas(IHttpContext context) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // list of Identification - AdminShell.AdministrationShell aas = null; - try - { - aas = Newtonsoft.Json.JsonConvert.DeserializeObject( - context.Request.Payload); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - - // need id for idempotent behaviour - if (aas.identification == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Identification of entity is (null); PUT cannot be performed."); - return; - } - - // datastructure update - if (this.Package == null || this.Package.AasEnv == null || - this.Package.AasEnv.AdministrationShells == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, $"Error accessing internal data structures."); - return; - } - context.Server.Logger.Debug( - $"Putting AdministrationShell with idShort {aas.idShort ?? "--"} and " + - $"id {aas.identification.ToString()}"); - var existingAas = this.Package.AasEnv.FindAAS(aas.identification); - if (existingAas != null) - this.Package.AasEnv.AdministrationShells.Remove(existingAas); - this.Package.AasEnv.AdministrationShells.Add(aas); - - // simple OK - SendTextResponse(context, "OK" + ((existingAas != null) ? " (updated)" : " (new)")); - } - - public void EvalDeleteAasAndAsset(IHttpContext context, string aasid, bool deleteAsset = false) - { - // datastructure update - if (this.Package == null || this.Package.AasEnv == null || - this.Package.AasEnv.AdministrationShells == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, $"Error accessing internal data structures."); - return; - } - - // access the AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with idShort '{aasid}' found."); - return; - } - - // find the asset - var asset = this.Package.AasEnv.FindAsset(aas.assetRef); - - // delete - context.Server.Logger.Debug( - $"Deleting AdministrationShell with idShort {aas.idShort ?? "--"} and " + - $"id {aas.identification?.ToString() ?? "--"}"); - this.Package.AasEnv.AdministrationShells.Remove(aas); - - if (deleteAsset && asset != null) - { - context.Server.Logger.Debug( - $"Deleting Asset with idShort {asset.idShort ?? "--"} and " + - $"id {asset.identification?.ToString() ?? "--"}"); - this.Package.AasEnv.Assets.Remove(asset); - } - - // simple OK - SendTextResponse(context, "OK"); - } - - #endregion - - #region // Asset links - - public void EvalGetAssetLinks(IHttpContext context, string assetid) - { - // trivial - if (assetid == null) - return; - - // do a manual search - var res = new List(); - var specialHandles = this.CreateHandlesFromQueryString(context.Request.QueryString); - var handle = IdRefHandleStore.ResolveSpecific(assetid, specialHandles); - if (handle != null && handle.identification != null) - { - foreach (var aas in this.Package.AasEnv.AdministrationShells) - if (aas.assetRef != null && aas.assetRef.Matches(handle.identification)) - { - dynamic o = new ExpandoObject(); - o.identification = aas.identification; - o.idShort = aas.idShort; - res.Add(o); - } - } - else - { - foreach (var aas in this.Package.AasEnv.AdministrationShells) - if (aas.idShort != null && aas.idShort.Trim() != "" && - aas.idShort.Trim().ToLower() == assetid.Trim().ToLower()) - { - dynamic o = new ExpandoObject(); - o.identification = aas.identification; - o.idShort = aas.idShort; - res.Add(o); - } - } - - // return as JSON - SendJsonResponse(context, res); - } - - public void EvalPutAsset(IHttpContext context) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // de-serialize asset - AdminShell.Asset asset = null; - try - { - asset = Newtonsoft.Json.JsonConvert.DeserializeObject(context.Request.Payload); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - - // need id for idempotent behaviour - if (asset.identification == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Identification of entity is (null); PUT cannot be performed."); - return; - } - - // datastructure update - if (this.Package == null || this.Package.AasEnv == null || this.Package.AasEnv.Assets == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, - $"Error accessing internal data structures."); - return; - } - context.Server.Logger.Debug($"Adding Asset with idShort {asset.idShort ?? "--"}"); - var existingAsset = this.Package.AasEnv.FindAsset(asset.identification); - if (existingAsset != null) - this.Package.AasEnv.Assets.Remove(existingAsset); - this.Package.AasEnv.Assets.Add(asset); - - // simple OK - SendTextResponse(context, "OK" + ((existingAsset != null) ? " (updated)" : " (new)")); - } - #endregion - - #region // List of Submodels - - public class GetSubmodelsItem - { - public AdminShell.Identification id = new AdminShell.Identification(); - public string idShort = ""; - public string kind = ""; - - public GetSubmodelsItem() { } - - public GetSubmodelsItem(AdminShell.Identification id, string idShort, string kind) - { - this.id = id; - this.idShort = idShort; - this.kind = kind; - } - - public GetSubmodelsItem(AdminShell.Identifiable idi, string kind) - { - this.id = idi.identification; - this.idShort = idi.idShort; - this.kind = kind; - } - } - - public void EvalGetSubmodels(IHttpContext context, string aasid) - { - // access the AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with idShort '{aasid}' found."); - return; - } - - // build a list of results - var res = new List(); - - // get all submodels - foreach (var smref in aas.submodelRefs) - { - var sm = this.Package.AasEnv.FindSubmodel(smref); - if (sm != null) - res.Add(new GetSubmodelsItem(sm, sm.kind.kind)); - } - - // return as JSON - SendJsonResponse(context, res); - } - - public void EvalPutSubmodel(IHttpContext context, string aasid) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // access the AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with idShort '{aasid}' found."); - return; - } - - // de-serialize Submodel - AdminShell.Submodel submodel = null; - try - { - submodel = Newtonsoft.Json.JsonConvert.DeserializeObject(context.Request.Payload); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - - // need id for idempotent behaviour - if (submodel.identification == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Identification of entity is (null); PUT cannot be performed."); - return; - } - - // datastructure update - if (this.Package == null || this.Package.AasEnv == null || this.Package.AasEnv.Assets == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, $"Error accessing internal data structures."); - return; - } - - // add Submodel - context.Server.Logger.Debug( - $"Adding Submodel with idShort {submodel.idShort ?? "--"} and " + - $"id {submodel.identification?.ToString()}"); - var existingSm = this.Package.AasEnv.FindSubmodel(submodel.identification); - if (existingSm != null) - this.Package.AasEnv.Submodels.Remove(existingSm); - this.Package.AasEnv.Submodels.Add(submodel); - - // add SubmodelRef to AAS - var newsmr = AdminShell.SubmodelRef.CreateNew( - "Submodel", true, submodel.identification.idType, submodel.identification.id); - var existsmr = aas.HasSubmodelRef(newsmr); - if (!existsmr) - { - context.Server.Logger.Debug( - $"Adding SubmodelRef to AAS with idShort {aas.idShort ?? "--"} and " + - $"id {aas.identification?.ToString() ?? "--"}"); - aas.AddSubmodelRef(newsmr); - } - - // simple OK - SendTextResponse(context, "OK" + ((existingSm != null) ? " (updated)" : " (new)")); - } - - public void EvalDeleteSubmodel(IHttpContext context, string aasid, string smid) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // access the AAS (absolutely mandatory) - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with idShort '{aasid}' found."); - return; - } - - // delete SubmodelRef 1st - var smref = this.FindSubmodelRefWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (smref != null) - { - context.Server.Logger.Debug( - $"Removing SubmodelRef {smid} from AAS with idShort {aas.idShort ?? "--"} and " + - $"id {aas.identification?.ToString() ?? "--"}"); - aas.submodelRefs.Remove(smref); - } - - // delete Submodel 2nd - var sm = this.FindSubmodelWithoutAas(smid, context.Request.QueryString, context.Request.RawUrl); - if (sm != null) - { - context.Server.Logger.Debug($"Removing Submodel {smid} from data structures."); - this.Package.AasEnv.Submodels.Remove(sm); - } - - // simple OK - var cmt = ""; - if (smref == null && sm == null) - cmt += " (nothing deleted)"; - cmt += ((smref != null) ? " (SubmodelRef deleted)" : "") + ((sm != null) ? " (Submodel deleted)" : ""); - SendTextResponse(context, "OK" + cmt); - } - - #endregion - - #region // Submodel Complete - - public void EvalGetSubmodelContents( - IHttpContext context, string aasid, string smid, bool deep = false, bool complete = false) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // return as JSON - var cr = new AdminShellConverters.AdaptiveFilterContractResolver(deep: deep, complete: complete); - SendJsonResponse(context, sm, cr); - } - - public void EvalGetSubmodelContentsAsTable(IHttpContext context, string aasid, string smid) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // AAS ENV - if (this.Package == null || this.Package.AasEnv == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, - $"Error accessing internal data structures."); - return; - } - - // make a table - var table = new List(); - sm.RecurseOnSubmodelElements(null, (o, parents, sme) => - { - // start a row - dynamic row = new ExpandoObject(); - - // defaults - row.idShorts = ""; - row.typeName = ""; - row.semIdType = ""; - row.semId = ""; - row.shortName = ""; - row.unit = ""; - row.value = ""; - - // idShort is a concatenation - var path = ""; - foreach (var p in parents) - path += p.idShort + "/"; - - // SubnmodelElement general - row.idShorts = path + (sme.idShort ?? "(-)"); - row.typeName = sme.GetElementName(); - if (sme.semanticId == null || sme.semanticId.Keys == null) - { } - else if (sme.semanticId.Keys.Count > 1) - { - row.semId = "(complex)"; - } - else - { - row.semIdType = sme.semanticId.Keys[0].idType; - row.semId = sme.semanticId.Keys[0].value; - } - - // try find a concept description - if (sme.semanticId != null) - { - var cd = this.Package.AasEnv.FindConceptDescription(sme.semanticId.Keys); - if (cd != null) - { - var ds = cd.GetIEC61360(); - if (ds != null) - { - row.shortName = (ds.shortName == null ? "" : ds.shortName.GetDefaultStr()); - row.unit = ds.unit ?? ""; - } - } - } - - // try add a value - if (sme is AdminShell.Property) - { - var p = sme as AdminShell.Property; - row.value = "" + (p.value ?? "") + ((p.valueId != null) ? p.valueId.ToString() : ""); - } - - if (sme is AdminShell.File) - { - var p = sme as AdminShell.File; - row.value = "" + p.value; - } - - if (sme is AdminShell.Blob) - { - var p = sme as AdminShell.Blob; - if (p.value.Length < 128) - row.value = "" + p.value; - else - row.value = "(" + p.value.Length + " bytes)"; - } - - if (sme is AdminShell.ReferenceElement) - { - var p = sme as AdminShell.ReferenceElement; - row.value = "" + p.value.ToString(); - } - - if (sme is AdminShell.RelationshipElement) - { - var p = sme as AdminShell.RelationshipElement; - row.value = "" + (p.first?.ToString() ?? "(-)") + " <-> " + (p.second?.ToString() ?? "(-)"); - } - - // now, add the row - table.Add(row); - - // recurse - return true; - }); - - // return as JSON - SendJsonResponse(context, table); - } - - #endregion - - #region // Submodel Elements - - public void EvalGetSubmodelElementContents( - IHttpContext context, string aasid, string smid, string[] elemids, bool deep = false, - bool complete = false) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // find the right SubmodelElement - var sme = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - if (sme == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No matching element in Submodel found."); - return; - } - - // return as JSON - var cr = new AdminShellConverters.AdaptiveFilterContractResolver(deep: deep, complete: complete); - SendJsonResponse(context, sme, cr); - } - - public void EvalGetSubmodelElementsBlob(IHttpContext context, string aasid, string smid, string[] elemids) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // find the right SubmodelElement - var fse = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - var smeb = fse?.elem as AdminShell.Blob; - if (smeb == null || smeb.value == null || smeb.value == "") - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No matching Blob element in Submodel found."); - return; - } - - // return as TEXT - SendTextResponse(context, smeb.value, mimeType: smeb.mimeType); - } - - public void EvalGetSubmodelElementsProperty(IHttpContext context, string aasid, string smid, string[] elemids) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // find the right SubmodelElement - var fse = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - var smep = fse?.elem as AdminShell.Property; - if (smep == null || smep.value == null || smep.value == "") - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No matching Property element in Submodel found."); - return; - } - - // a little bit of demo - string strval = smep.value; - if (smep.HasQualifierOfType("DEMO") != null && smep.value != null && smep.valueType != null && - smep.valueType.Trim().ToLower() == "double" && - double.TryParse(smep.value, NumberStyles.Any, CultureInfo.InvariantCulture, out double dblval)) - { - dblval += Math.Sin((0.001 * DateTime.UtcNow.Millisecond) * 6.28); - strval = dblval.ToString(CultureInfo.InvariantCulture); - } - - // return as little dynamic object - dynamic res = new ExpandoObject(); - res.value = strval; - if (smep.valueId != null) - res.valueId = smep.valueId; - - // send - SendJsonResponse(context, res); - } - - public void EvalGetSubmodelElementsFile(IHttpContext context, string aasid, string smid, string[] elemids) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // find the right SubmodelElement - var fse = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - var smef = fse?.elem as AdminShell.File; - if (smef == null || smef.value == null || smef.value == "") - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No matching File element in Submodel found."); - return; - } - - // access - var packageStream = this.Package.GetLocalStreamFromPackage(smef.value); - if (packageStream == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No file contents available in package."); - return; - } - - // return as FILE - SendStreamResponse(context, packageStream, Path.GetFileName(smef.value)); - packageStream.Close(); - } - - public void EvalPutSubmodelElementContents(IHttpContext context, string aasid, string smid, string[] elemids) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // de-serialize SubmodelElement - AdminShell.SubmodelElement sme = null; - try - { - sme = Newtonsoft.Json.JsonConvert.DeserializeObject( - context.Request.Payload, new AdminShellConverters.JsonAasxConverter("modelType", "name")); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - - // need id for idempotent behaviour - if (sme?.idShort == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"entity or idShort of entity is (null); PUT cannot be performed."); - return; - } - - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // special case: parent is Submodel itself - var updated = false; - if (elemids == null || elemids.Length < 1) - { - var existsmw = sm.FindSubmodelElementWrapper(sme.idShort); - if (existsmw != null) - { - updated = true; - context.Server.Logger.Debug($"Removing old SubmodelElement {sme.idShort} from Submodel {smid}."); - sm.submodelElements.Remove(existsmw); - } - - context.Server.Logger.Debug($"Adding new SubmodelElement {sme.idShort} to Submodel {smid}."); - sm.Add(sme); - } - else - { - // find the right SubmodelElement - var parent = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - if (parent == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No matching element in Submodel found."); - return; - } - - if (parent.elem != null && parent.elem is AdminShell.SubmodelElementCollection parentsmc) - { - var existsmw = parentsmc.FindFirstIdShort(sme.idShort); - if (existsmw != null) - { - updated = true; - context.Server.Logger.Debug( - $"Removing old SubmodelElement {sme.idShort} from SubmodelCollection."); - parentsmc.value.Remove(existsmw); - } - - context.Server.Logger.Debug($"Adding new SubmodelElement {sme.idShort} to SubmodelCollection."); - parentsmc.Add(sme); - } - else - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Matching SubmodelElement in Submodel {smid} is not suitable to add childs."); - return; - } - - } - - // simple OK - SendTextResponse(context, "OK" + (updated ? " (with updates)" : "")); - } - - public void EvalDeleteSubmodelElementContents( - IHttpContext context, string aasid, string smid, string[] elemids) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null || elemids == null || elemids.Length < 1) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found or " + - $"no elements to delete specified."); - return; - } - - // OK, Submodel and Element existing - var fse = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - if (fse == null || fse.elem == null || fse.parent == null || fse.wrapper == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No matching element in Submodel found."); - return; - } - - // where to delete? - var deleted = false; - var elinfo = string.Join(".", elemids); - if (fse.parent == sm) - { - context.Server.Logger.Debug($"Deleting specified SubmodelElement {elinfo} from Submodel {smid}."); - sm.submodelElements.Remove(fse.wrapper); - deleted = true; - } - - if (fse.parent is AdminShell.SubmodelElementCollection smc) - { - context.Server.Logger.Debug( - $"Deleting specified SubmodelElement {elinfo} from SubmodelElementCollection {smc.idShort}."); - smc.value.Remove(fse.wrapper); - deleted = true; - } - - // simple OK - SendTextResponse(context, "OK" + (!deleted ? " (but nothing deleted)" : "")); - } - - public void EvalInvokeSubmodelElementOperation( - IHttpContext context, string aasid, string smid, string[] elemids) - { - // access AAS and Submodel - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var sm = this.FindSubmodelWithinAas(aas, smid, context.Request.QueryString, context.Request.RawUrl); - if (sm == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no Submodel with idShort '{smid}' found."); - return; - } - - // find the right SubmodelElement - var fse = this.FindSubmodelElement(sm, sm.submodelElements, elemids); - var smep = fse?.elem as AdminShell.Operation; - if (smep == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No matching Operation element in Submodel found."); - return; - } - - // make 1st expectation - int numExpectedInputArgs = smep.inputVariable?.Count ?? 0; - int numGivenInputArgs = 0; - int numExpectedOutputArgs = smep.outputVariable?.Count ?? 0; - var inputArguments = (new int[numExpectedInputArgs]).Select(x => "").ToList(); - var outputArguments = (new int[numExpectedOutputArgs]).Select(x => "my value").ToList(); - - // is a payload required? Always, if at least one input argument required - - if (smep.inputVariable != null && smep.inputVariable.Count > 0) - { - // payload present - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"No payload for Operation input argument or content type is not JSON."); - return; - } - - // de-serialize SubmodelElement - try - { - // serialize - var input = Newtonsoft.Json.JsonConvert.DeserializeObject>(context.Request.Payload); - - // set inputs - if (input != null && input.Count > 0) - { - numGivenInputArgs = input.Count; - for (int i = 0; i < numGivenInputArgs; i++) - inputArguments[i] = input[i]; - } - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - } - - // do a check - if (numExpectedInputArgs != numGivenInputArgs) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Number of input arguments in payload does not fit expected input arguments of Operation."); - return; - } - - // just a test - if (smep.HasQualifierOfType("DEMO") != null) - { - for (int i = 0; i < Math.Min(numExpectedInputArgs, numExpectedOutputArgs); i++) - outputArguments[i] = "CALC on " + inputArguments[i]; - } - - // return as little dynamic object - SendJsonResponse(context, outputArguments); - } - - public void EvalGetAllCds(IHttpContext context, string aasid) - { - // access the AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with idShort '{aasid}' found."); - return; - } - - // build a list of results - var res = new List(); - - // create a new, filtered AasEnv - // (this is expensive, but delivers us with a list of CDs which are in relation to the respective AAS) - var copyenv = AdminShell.AdministrationShellEnv.CreateFromExistingEnv( - this.Package.AasEnv, filterForAas: new List(new[] { aas })); - - // get all CDs and describe them - foreach (var cd in copyenv.ConceptDescriptions) - { - // describe - dynamic o = new ExpandoObject(); - o.idShort = cd.idShort; - o.shortName = cd.GetDefaultShortName(); - o.identification = cd.identification; - o.isCaseOf = cd.IsCaseOf; - - // add - res.Add(o); - } - - // return as JSON - SendJsonResponse(context, res); - } - - public void EvalGetCdContents(IHttpContext context, string aasid, string cdid) - { - // access AAS and CD - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var cd = this.FindCdWithoutAas(aas, cdid, context.Request.QueryString, context.Request.RawUrl); - if (cd == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no ConceptDescription with id '{cdid}' found."); - return; - } - - // return as JSON - SendJsonResponse(context, cd); - } - - public void EvalDeleteSpecificCd(IHttpContext context, string aasid, string cdid) - { - // access AAS and CD - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - var cd = this.FindCdWithoutAas(aas, cdid, context.Request.QueryString, context.Request.RawUrl); - if (cd == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, - $"No AAS '{aasid}' or no ConceptDescription with id '{cdid}' found."); - return; - } - - // delete ?! - var deleted = false; - if (this.Package != null && this.Package.AasEnv != null && - this.Package.AasEnv.ConceptDescriptions.Contains(cd)) - { - this.Package.AasEnv.ConceptDescriptions.Remove(cd); - deleted = true; - } - - // return as JSON - SendTextResponse(context, "OK" + (!deleted ? " (but nothing deleted)" : "")); - } - - #endregion - - #region // GET + POST handles/identification - - public void EvalGetHandlesIdentification(IHttpContext context) - { - // get the list - var res = IdRefHandleStore.FindAll(); - - // return this list - SendJsonResponse(context, res); - } - - public void EvalPostHandlesIdentification(IHttpContext context) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // list of Identification - List ids = null; - try - { - ids = Newtonsoft.Json.JsonConvert.DeserializeObject>( - context.Request.Payload); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - if (ids == null || ids.Count < 1) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No Identification entities in payload."); - return; - } - - // turn these list into a list of Handles - var res = new List(); - foreach (var id in ids) - { - var h = new AasxHttpHandleIdentification(id); - IdRefHandleStore.Add(h); - res.Add(h); - } - - // return this list - SendJsonResponse(context, res); - } - - #endregion - - #region // Server profile .. - - public void EvalGetServerProfile(IHttpContext context) - { - // get the list - dynamic res = new ExpandoObject(); - var capabilities = new List(new ulong[]{ - 80,81,82,10,11,12,13,15,16,20,21,30,31,40,41,42,43,50,51,52,53,54,55,56,57,58,59,60,61,70,71,72,73 - }); - res.apiversion = 1; - res.capabilities = capabilities; - - // return this list - SendJsonResponse(context, res); - } - - #endregion - - #region // Concept Descriptions - - public void EvalPutCd(IHttpContext context, string aasid) - { - // first check - if (context.Request.Payload == null || context.Request.ContentType != ContentType.JSON) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"No payload or content type is not JSON."); - return; - } - - // access the AAS - var aas = this.FindAAS(aasid, context.Request.QueryString, context.Request.RawUrl); - if (aas == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotFound, $"No AAS with idShort '{aasid}' found."); - return; - } - - // de-serialize CD - AdminShell.ConceptDescription cd = null; - try - { - cd = Newtonsoft.Json.JsonConvert.DeserializeObject( - context.Request.Payload); - } - catch (Exception ex) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, $"Cannot deserialize payload: {ex.Message}."); - return; - } - - // need id for idempotent behaviour - if (cd.identification == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.BadRequest, - $"Identification of entity is (null); PUT cannot be performed."); - return; - } - - // datastructure update - if (this.Package == null || this.Package.AasEnv == null || this.Package.AasEnv.Assets == null) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.InternalServerError, $"Error accessing internal data structures."); - return; - } - - // add Submodel - context.Server.Logger.Debug( - $"Adding ConceptDescription with idShort {cd.idShort ?? "--"} and " + - $"id {cd.identification.ToString()}"); - var existingCd = this.Package.AasEnv.FindConceptDescription(cd.identification); - if (existingCd != null) - this.Package.AasEnv.ConceptDescriptions.Remove(existingCd); - this.Package.AasEnv.ConceptDescriptions.Add(cd); - - // simple OK - SendTextResponse(context, "OK" + ((existingCd != null) ? " (updated)" : " (new)")); - } - - #endregion - } -} diff --git a/src/AasxRestServerLibrary/AasxHttpHandleStore.cs b/src/AasxRestServerLibrary/AasxHttpHandleStore.cs deleted file mode 100644 index 271c92065..000000000 --- a/src/AasxRestServerLibrary/AasxHttpHandleStore.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AasxCompatibilityModels; -using AdminShellNS; -using Newtonsoft.Json; - -/* -Please notice: -The API and REST routes implemented in this version of the source code are not specified and standardised by the -specification Details of the Administration Shell. The hereby stated approach is solely the opinion of its author(s). -*/ - -namespace AasxRestServerLibrary -{ - /// - /// Describes a handle to a Identification or Reference to be used in HTTP REST APIs - /// - public abstract class AasxHttpHandle - { - [JsonProperty(PropertyName = "key")] - public string Key; - [JsonIgnore] - public DateTime ExpiresInternal; - [JsonProperty(PropertyName = "expires")] - // http-date, see https://stackoverflow.com/questions/21120882/the-date-time-format-used-in-http-headers - public string Expires; - } - - /// - /// Describes a handle to a Identification to be used in HTTP REST APIs - /// - public class AasxHttpHandleIdentification : AasxHttpHandle - { - private static int counter = 1; - - public AdminShell.Identification identification = null; - - public AasxHttpHandleIdentification(AdminShell.Identification src, string keyPreset = null) - { - if (keyPreset == null) - this.Key = $"@ID{counter++:00000000}"; - else - this.Key = keyPreset; - this.ExpiresInternal = DateTime.UtcNow.AddMinutes(60); - this.Expires = this.ExpiresInternal.ToString("R"); - this.identification = new AdminShell.Identification(src); - } - } - - /// - /// This store stores AasxHttpHandle items in order to provide 'shortcuts' to AAS Identifications and - /// References in HTTP REST APIs - /// - public class AasxHttpHandleStore - { - private Dictionary storeItems = new Dictionary(); - - public void Add(AasxHttpHandle handle) - { - if (handle == null) - return; - storeItems.Add(handle.Key, handle); - } - - public AasxHttpHandle Resolve(string Key) - { - if (storeItems.ContainsKey(Key)) - return storeItems[Key]; - return null; - } - - public T ResolveSpecific(string Key, List specialHandles = null) where T : AasxHttpHandle - { - // trivial - if (Key == null) - return null; - Key = Key.Trim(); - if (Key == "" || !Key.StartsWith("@")) - return null; - - // search in specialHandles - if (specialHandles != null) - foreach (var sh in specialHandles) - if (sh.Key.Trim().ToLower() == Key.Trim().ToLower()) - return sh; - - // search in store - if (storeItems.ContainsKey(Key)) - return storeItems[Key] as T; - return null; - } - - public List FindAll() where T : class - { - var res = new List(); - foreach (var x in storeItems.Values) - if (x is T) - res.Add(x as T); - return res; - } - } -} diff --git a/src/AasxRestServerLibrary/AasxRestClient.cs b/src/AasxRestServerLibrary/AasxRestClient.cs deleted file mode 100644 index 6cf3b0f42..000000000 --- a/src/AasxRestServerLibrary/AasxRestClient.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using AasxIntegrationBase; -using AdminShellNS; -using Grapevine.Client; -using Newtonsoft.Json.Linq; - -namespace AasxRestServerLibrary -{ - public class AasxRestClient : IAasxOnlineConnection - { - // Instance management - - private Uri uri = null; - private RestClient client = null; - private WebProxy proxy = null; - - public AasxRestClient(string hostpart) - { - this.uri = new Uri(hostpart.TrimEnd('/')); - this.client = new RestClient(); - this.client.Host = this.uri.Host; - this.client.Port = this.uri.Port; - if (File.Exists("C:\\dat\\proxy.dat")) - { - string proxyAddress = ""; - string username = ""; - string password = ""; - try - { // Open the text file using a stream reader. - using (StreamReader sr = new StreamReader("C:\\dat\\proxy.dat")) - { - proxyAddress = sr.ReadLine(); - username = sr.ReadLine(); - password = sr.ReadLine(); - } - } - catch (IOException e) - { - Console.WriteLine("The file C:\\dat\\proxy.dat could not be read:"); - Console.WriteLine(e.Message); - } - this.proxy = new WebProxy(); - Uri newUri = new Uri(proxyAddress); - this.proxy.Address = newUri; - this.proxy.Credentials = new NetworkCredential(username, password); - } - } - - // interface - - public bool IsValid() { return this.uri != null; } // assume validity - public bool IsConnected() { return true; } // always, as there is no open connection by principle - public string GetInfo() { return uri.ToString(); } - - public Stream GetThumbnailStream() - { - var request = new RestRequest("/aas/id/thumbnail"); - if (this.proxy != null) - request.Proxy = this.proxy; - var response = client.Execute(request); - if (response.StatusCode != Grapevine.Shared.HttpStatusCode.Ok) - throw new Exception( - $"REST {response.ResponseUri} response {response.StatusCode} with {response.StatusDescription}"); - - // Note: the normal response.GetContent() internally reads ContentStream as a string and - // screws up binary data. - // Necessary to access the real implementing object - var rr = response as RestResponse; - if (rr != null) - { - return rr.Advanced.GetResponseStream(); - } - return null; - } - - public string ReloadPropertyValue() - { - return ""; - } - - // utilities - - string BuildUriQueryPartId(string tag, AdminShell.Identifiable entity) - { - if (entity == null || entity.identification == null) - return ""; - var res = ""; - if (tag != null) - res += tag.Trim() + "="; - res += entity.identification.idType.Trim() + "," + entity.identification.id.Trim(); - return res; - } - - string BuildUriQueryString(params string[] parts) - { - if (parts == null) - return ""; - var res = "?"; - foreach (var p in parts) - { - if (res.Length > 1) - res += "&"; - res += p; - } - return res; - } - - // individual functions - - public AdminShellPackageEnv OpenPackageByAasEnv() - { - var request = new RestRequest("/aas/id/aasenv"); - if (this.proxy != null) - request.Proxy = this.proxy; - var respose = client.Execute(request); - if (respose.StatusCode != Grapevine.Shared.HttpStatusCode.Ok) - throw new Exception( - $"REST {respose.ResponseUri} response {respose.StatusCode} with {respose.StatusDescription}"); - var res = new AdminShellPackageEnv(); - res.LoadFromAasEnvString(respose.GetContent()); - return res; - } - - public string GetSubmodel(string name) - { - string fullname = "/aas/id/submodels/" + name + "/complete"; - var request = new RestRequest(fullname); - if (this.proxy != null) - request.Proxy = this.proxy; - var response = client.Execute(request); - if (response.StatusCode != Grapevine.Shared.HttpStatusCode.Ok) - throw new Exception( - $"REST {response.ResponseUri} response {response.StatusCode} with {response.StatusDescription}"); - return response.GetContent(); - } - - public async void PutSubmodelAsync(string payload) - { - string fullname = "/aas/id/submodels/"; - - var handler = new HttpClientHandler(); - handler.DefaultProxyCredentials = CredentialCache.DefaultCredentials; - handler.AllowAutoRedirect = false; - - var hClient = new HttpClient(handler) - { - BaseAddress = uri - }; - StringContent queryString = new StringContent(payload); - await hClient.PutAsync(fullname, queryString); - } - - public string UpdatePropertyValue( - AdminShell.AdministrationShellEnv env, AdminShell.Submodel submodel, AdminShell.SubmodelElement sme) - { - // trivial fails - if (env == null || sme == null) - return null; - - // need AAS, indirect - var aas = env.FindAASwithSubmodel(submodel.identification); - if (aas == null) - return null; - - // build path - var aasId = aas.idShort; - var submodelId = submodel.idShort; - var elementId = sme.CollectIdShortByParent(); - var reqpath = "./aas/" + aasId + "/submodels/" + submodelId + "/elements/" + elementId + "/property"; - - // request - var request = new RestRequest(reqpath); - if (this.proxy != null) - request.Proxy = this.proxy; - var respose = client.Execute(request); - if (respose.StatusCode != Grapevine.Shared.HttpStatusCode.Ok) - throw new Exception( - $"REST {respose.ResponseUri} response {respose.StatusCode} with {respose.StatusDescription}"); - - var json = respose.GetContent(); - var parsed = JObject.Parse(json); - var value = parsed.SelectToken("value").Value(); - return value; - } - } -} diff --git a/src/AasxRestServerLibrary/AasxRestServer.cs b/src/AasxRestServerLibrary/AasxRestServer.cs deleted file mode 100644 index 244e24a9c..000000000 --- a/src/AasxRestServerLibrary/AasxRestServer.cs +++ /dev/null @@ -1,418 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using AdminShellNS; -using Grapevine.Interfaces.Server; -using Grapevine.Interfaces.Shared; -using Grapevine.Server; -using Grapevine.Server.Attributes; -using Grapevine.Shared; -using Newtonsoft.Json; - -/* -Please notice: -The API and REST routes implemented in this version of the source code are not specified and standardised by the -specification Details of the Administration Shell. The hereby stated approach is solely the opinion of its author(s). -*/ - -// ReSharper disable ClassNeverInstantiated.Global -//.. motivation: unsure what happens to reflection, when making class static .. - -namespace AasxRestServerLibrary -{ - public class AasxRestServer - { - [RestResource] - public class TestResource - { - public static AasxHttpContextHelper helper = null; - - // Basic AAS + Asset - - [RestRoute( - HttpMethod = HttpMethod.GET, - PathInfo = "^/aas/(id|([^/]+))(|/core|/complete|/thumbnail|/aasenv)(/|)$")] - public IHttpContext GetAasAndAsset(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - if (helper.PathEndsWith(context, "thumbnail")) - { - helper.EvalGetAasThumbnail(context, m.Groups[1].ToString()); - } - else - if (helper.PathEndsWith(context, "aasenv")) - { - helper.EvalGetAasEnv(context, m.Groups[1].ToString()); - } - else - { - var complete = helper.PathEndsWith(context, "complete"); - helper.EvalGetAasAndAsset(context, m.Groups[1].ToString(), complete: complete); - } - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.PUT, PathInfo = "^/aas(/|)$")] - public IHttpContext PutAas(IHttpContext context) - { - helper.EvalPutAas(context); - return context; - } - - [RestRoute(HttpMethod = HttpMethod.DELETE, PathInfo = "^/aas/([^/]+)(/|)$")] - public IHttpContext DeleteAasAndAsset(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - helper.EvalDeleteAasAndAsset(context, m.Groups[1].ToString(), deleteAsset: true); - } - return context; - } - - // Handles - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/handles/identification(/|)$")] - public IHttpContext GetHandlesIdentification(IHttpContext context) - { - helper.EvalGetHandlesIdentification(context); - return context; - } - - [RestRoute(HttpMethod = HttpMethod.POST, PathInfo = "^/handles/identification(/|)$")] - public IHttpContext PostHandlesIdentification(IHttpContext context) - { - helper.EvalPostHandlesIdentification(context); - return context; - } - - // Server - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/server/profile(/|)$")] - public IHttpContext GetServerProfile(IHttpContext context) - { - helper.EvalGetServerProfile(context); - return context; - } - - // Assets - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/assets/([^/]+)(/|)$")] - public IHttpContext GetAssets(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - helper.EvalGetAssetLinks(context, m.Groups[1].ToString()); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.PUT, PathInfo = "^/assets(/|)$")] - public IHttpContext PutAssets(IHttpContext context) - { - helper.EvalPutAsset(context); - return context; - } - - // List of Submodels - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/aas/(id|([^/]+))/submodels(/|)$")] - public IHttpContext GetSubmodels(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - helper.EvalGetSubmodels(context, m.Groups[1].ToString()); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.PUT, PathInfo = "^/aas/(id|([^/]+))/submodels(/|)$")] - public IHttpContext PutSubmodel(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - helper.EvalPutSubmodel(context, m.Groups[1].ToString()); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.DELETE, PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)(/|)$")] - public IHttpContext DeleteSubmodel(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 4) - { - helper.EvalDeleteSubmodel(context, m.Groups[1].ToString(), m.Groups[3].ToString()); - } - return context; - } - - // Contents of a Submodel - - [RestRoute( - HttpMethod = HttpMethod.GET, - PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)(|/core|/deep|/complete)(/|)$")] - public IHttpContext GetSubmodelContents(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 4) - { - var deep = helper.PathEndsWith(context, "deep"); - var complete = helper.PathEndsWith(context, "complete"); - helper.EvalGetSubmodelContents( - context, m.Groups[1].ToString(), m.Groups[3].ToString(), - deep: deep || complete, complete: complete); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)/table(/|)$")] - public IHttpContext GetSubmodelContentsAsTable(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 4) - { - helper.EvalGetSubmodelContentsAsTable(context, m.Groups[1].ToString(), m.Groups[3].ToString()); - } - return context; - } - - // Contents of SubmodelElements - - [RestRoute( - HttpMethod = HttpMethod.GET, - PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)/elements(/([^/]+)){1,99}?" + - "(|/core|/complete|/deep|/file|/blob|/events|/property)(/|)$")] - public IHttpContext GetSubmodelElementsContents(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 6 && m.Groups[5].Captures.Count >= 1) - { - var aasid = m.Groups[1].ToString(); - var smid = m.Groups[3].ToString(); - var elemids = new List(); - for (int i = 0; i < m.Groups[5].Captures.Count; i++) - elemids.Add(m.Groups[5].Captures[i].ToString()); - - // special case?? - if (helper.PathEndsWith(context, "file")) - { - helper.EvalGetSubmodelElementsFile(context, aasid, smid, elemids.ToArray()); - } - else - if (helper.PathEndsWith(context, "blob")) - { - helper.EvalGetSubmodelElementsBlob(context, aasid, smid, elemids.ToArray()); - } - else - if (helper.PathEndsWith(context, "property")) - { - helper.EvalGetSubmodelElementsProperty(context, aasid, smid, elemids.ToArray()); - } - else - if (helper.PathEndsWith(context, "events")) - { - context.Response.SendResponse( - Grapevine.Shared.HttpStatusCode.NotImplemented, $"Events currently not implented."); - } - else - { - // more options - bool complete = false, deep = false; - if (helper.PathEndsWith(context, "deep")) - deep = true; - if (helper.PathEndsWith(context, "complete")) - { - deep = true; - complete = true; - } - - helper.EvalGetSubmodelElementContents(context, aasid, smid, elemids.ToArray(), deep, complete); - } - } - return context; - } - - [RestRoute( - HttpMethod = HttpMethod.POST, - PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)/elements(/([^/]+)){1,99}?/invoke(/|)$")] - public IHttpContext PostSubmodelElementsContents(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 6 && m.Groups[5].Captures.Count >= 1) - { - var aasid = m.Groups[1].ToString(); - var smid = m.Groups[3].ToString(); - var elemids = new List(); - for (int i = 0; i < m.Groups[5].Captures.Count; i++) - elemids.Add(m.Groups[5].Captures[i].ToString()); - - // special case?? - if (helper.PathEndsWith(context, "invoke")) - { - helper.EvalInvokeSubmodelElementOperation(context, aasid, smid, elemids.ToArray()); - } - } - return context; - } - - [RestRoute( - HttpMethod = HttpMethod.PUT, - PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)/elements(/([^/]+)){0,99}?(/|)$")] - public IHttpContext PutSubmodelElementsContents(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 6) - { - var aasid = m.Groups[1].ToString(); - var smid = m.Groups[3].ToString(); - var elemids = new List(); - for (int i = 0; i < m.Groups[5].Captures.Count; i++) - elemids.Add(m.Groups[5].Captures[i].ToString()); - - helper.EvalPutSubmodelElementContents(context, aasid, smid, elemids.ToArray()); - } - return context; - } - - [RestRoute( - HttpMethod = HttpMethod.DELETE, - PathInfo = "^/aas/(id|([^/]+))/submodels/([^/]+)/elements(/([^/]+)){0,99}?(/|)$")] - public IHttpContext DeleteSubmodelElementsContents(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 6) - { - var aasid = m.Groups[1].ToString(); - var smid = m.Groups[3].ToString(); - var elemids = new List(); - for (int i = 0; i < m.Groups[5].Captures.Count; i++) - elemids.Add(m.Groups[5].Captures[i].ToString()); - - helper.EvalDeleteSubmodelElementContents(context, aasid, smid, elemids.ToArray()); - } - return context; - } - - // concept descriptions - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/aas/(id|([^/]+))/cds(/|)$")] - public IHttpContext GetCds(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - helper.EvalGetAllCds(context, m.Groups[1].ToString()); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.PUT, PathInfo = "^/aas/(id|([^/]+))/cds(/|)$")] - public IHttpContext PutConceptDescription(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 2) - { - helper.EvalPutCd(context, m.Groups[1].ToString()); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.GET, PathInfo = "^/aas/(id|([^/]+))/cds/([^/]+)(/|)$")] - public IHttpContext GetSpecificCd(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 4) - { - helper.EvalGetCdContents(context, m.Groups[1].ToString(), m.Groups[3].ToString()); - } - return context; - } - - [RestRoute(HttpMethod = HttpMethod.DELETE, PathInfo = "^/aas/(id|([^/]+))/cds/([^/]+)(/|)$")] - public IHttpContext DeleteSpecificCd(IHttpContext context) - { - var m = helper.PathInfoRegexMatch(MethodBase.GetCurrentMethod(), context.Request.PathInfo); - if (m.Success && m.Groups.Count >= 4) - { - helper.EvalDeleteSpecificCd(context, m.Groups[1].ToString(), m.Groups[3].ToString()); - } - return context; - } - - } - - private static RestServer startedRestServer = null; - - public static void Start( - AdminShellPackageEnv package, string host, string port, GrapevineLoggerSuper logger = null) - { - // if running, stop old server - Stop(); - - var helper = new AasxHttpContextHelper(); - helper.Package = package; - TestResource.helper = helper; - - var serverSettings = new ServerSettings(); - serverSettings.Host = host; - serverSettings.Port = port; - - if (logger != null) - logger.Warn( - "Please notice: the API and REST routes implemented in this version " + - "of the source code are not specified and standardised by the" + - "specification Details of the Administration Shell. " + - "The hereby stated approach is solely the opinion of its author(s)."); - - startedRestServer = new RestServer(serverSettings); - { - if (logger != null) - startedRestServer.Logger = logger; - startedRestServer.Start(); - } - - // tail of the messages, again - if (logger != null) - logger.Warn( - "Please notice: the API and REST routes implemented in this version " + - "of the source code are not specified and standardised by the" + - "specification Details of the Administration Shell. " + - "The hereby stated approach is solely the opinion of its author(s)."); - } - - public static void Stop() - { - if (startedRestServer != null) - try - { - startedRestServer.Stop(); - startedRestServer = null; - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - } -} diff --git a/src/AasxRestServerLibrary/AasxRestServerLibrary.csproj b/src/AasxRestServerLibrary/AasxRestServerLibrary.csproj deleted file mode 100644 index 7e653816d..000000000 --- a/src/AasxRestServerLibrary/AasxRestServerLibrary.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - net6.0 - Library - false - false - - - - - - - - - diff --git a/src/AasxRestServerLibrary/Docs/REST_routes.xlsx b/src/AasxRestServerLibrary/Docs/REST_routes.xlsx deleted file mode 100644 index b3fd53dd2..000000000 Binary files a/src/AasxRestServerLibrary/Docs/REST_routes.xlsx and /dev/null differ diff --git a/src/AasxRestServerLibrary/GrapevineLoggerConsumers.cs b/src/AasxRestServerLibrary/GrapevineLoggerConsumers.cs deleted file mode 100644 index 6bc4d4423..000000000 --- a/src/AasxRestServerLibrary/GrapevineLoggerConsumers.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Grapevine.Interfaces.Shared; - -/* -Please notice: -The API and REST routes implemented in this version of the source code are not specified and standardised by the -specification Details of the Administration Shell. The hereby stated approach is solely the opinion of its author(s). -*/ - -namespace AasxRestServerLibrary -{ - public class GrapevineLoggerSuper : IGrapevineLogger - { - // IGrapevineLogger side - - private LogLevel level = LogLevel.Trace; - - public LogLevel Level { get { return level; } set { level = value; } } - - public void Debug(object obj) { if (this.level >= LogLevel.Debug) this.Append("DBG: {0}", obj); } - public void Debug(string message) { if (this.level >= LogLevel.Debug) this.Append("DBG: {0}", message); } - public void Debug(string message, Exception ex) - { - if (this.level >= LogLevel.Debug) - this.Append("DBG: Exception when {0}: {1}", message, ex.ToString()); - } - public void Error(string message, Exception ex) - { - if (this.level >= LogLevel.Error) - this.Append("ERR: Exception when {0}: {1}", message, ex.ToString()); - } - public void Error(string message) { if (this.level >= LogLevel.Error) this.Append("ERR: {0}", message); } - public void Error(object obj) { if (this.level >= LogLevel.Error) this.Append("ERR: {0}", obj); } - public void Fatal(string message) { if (this.level >= LogLevel.Fatal) this.Append("FTL: {0}", message); } - public void Fatal(object obj) { if (this.level >= LogLevel.Fatal) this.Append("FTL: {0}", obj); } - public void Fatal(string message, Exception ex) - { - if (this.level >= LogLevel.Fatal) - this.Append("FTL: Exception when {0}: {1}", message, ex.ToString()); - } - public void Info(string message, Exception ex) - { - if (this.level >= LogLevel.Info) this.Append("INF: Exception when {0}: {1}", message, ex.ToString()); - } - public void Info(string message) - { - if (this.level >= LogLevel.Info) this.Append("INF: {0}", message); - } - public void Info(object obj) { if (this.level >= LogLevel.Info) this.Append("INF: {0}", obj); } - public void Log(LogEvent evt) { if (this.level >= evt.Level) this.Append("{0}", evt.Message); } - public void Trace(string message, Exception ex) - { - if (this.level >= LogLevel.Debug) this.Append("TRC: Exception when {0}: {1}", message, ex.ToString()); - } - public void Trace(string message) { if (this.level >= LogLevel.Trace) this.Append("TRC: {0}", message); } - public void Trace(object obj) { if (this.level >= LogLevel.Trace) this.Append("TRC: {0}", obj); } - public void Warn(string message) { if (this.level >= LogLevel.Warn) this.Append("WRN: {0}", message); } - public void Warn(string message, Exception ex) - { - if (this.level >= LogLevel.Warn) this.Append("WRN: Exception when {0}: {1}", message, ex.ToString()); - } - public void Warn(object obj) { if (this.level >= LogLevel.Warn) this.Append("WRN: {0}", obj); } - - // Consumer side - - public virtual void Append(string msg, params object[] args) - { - } - - } - - public class GrapevineLoggerToConsole : GrapevineLoggerSuper - { - public override void Append(string msg, params object[] args) - { - Console.Error.WriteLine(msg, args); - Console.Error.Flush(); - } - } - - public class GrapevineLoggerToListOfStrings : GrapevineLoggerSuper - { - private List list = new List(); - - public override void Append(string msg, params object[] args) - { - lock (list) - { - list.Add(string.Format(msg, args)); - } - } - - public string Pop() - { - if (list == null) - return null; - - lock (list) - { - if (list.Count < 1) - return null; - - var res = list[0]; - list.RemoveAt(0); - return res; - } - } - } - -} diff --git a/src/AasxRestServerLibrary/LICENSE.txt b/src/AasxRestServerLibrary/LICENSE.txt deleted file mode 100644 index 75f36a4ff..000000000 --- a/src/AasxRestServerLibrary/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo AG & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxRestServerLibrary/Properties/AssemblyInfo.cs b/src/AasxRestServerLibrary/Properties/AssemblyInfo.cs deleted file mode 100644 index edad697fd..000000000 --- a/src/AasxRestServerLibrary/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxRestServerLibrary")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxRestServerLibrary")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("967e60e3-d668-42a3-aa0b-1a031c20d871")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// indem Sie "*" wie unten gezeigt eingeben: -//// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxUaNetConsoleServer/AasxUaNetConsoleServer.csproj b/src/AasxUaNetConsoleServer/AasxUaNetConsoleServer.csproj deleted file mode 100644 index 6e6bb5d45..000000000 --- a/src/AasxUaNetConsoleServer/AasxUaNetConsoleServer.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - net6.0 - Exe - false - false - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - diff --git a/src/AasxUaNetConsoleServer/LICENSE.txt b/src/AasxUaNetConsoleServer/LICENSE.txt deleted file mode 100644 index 75f36a4ff..000000000 --- a/src/AasxUaNetConsoleServer/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo AG & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxUaNetConsoleServer/Net46AasxServerPlugin.Config.xml b/src/AasxUaNetConsoleServer/Net46AasxServerPlugin.Config.xml deleted file mode 100644 index 096d2c34c..000000000 --- a/src/AasxUaNetConsoleServer/Net46AasxServerPlugin.Config.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - UA Core Sample Server - urn:localhost:OPCFoundation:CoreSampleServer - http://opcfoundation.org/UA/CoreSampleServer - Server_0 - - - - - - X509Store - CurrentUser\My - CN=UA Core Sample Server, C=US, S=Arizona, O=OPC Foundation, DC=localhost - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/issuer - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/trusted - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/rejected - - - - true - - - - - - - 600000 - 1048576 - 4194304 - 65535 - 4194304 - 65535 - 300000 - 3600000 - - - - - opc.tcp://localhost:51210/UA/SampleServer - https://localhost:51212/UA/SampleServer/ - - - - - - - - SignAndEncrypt_3 - http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256 - - - - None_1 - http://opcfoundation.org/UA/SecurityPolicy#None - - - Sign_2 - - - - SignAndEncrypt_3 - - - - - 5 - 100 - 2000 - - - - Anonymous_0 - http://opcfoundation.org/UA/SecurityPolicy#None - - - UserName_1 - - - Certificate_2 - - - - false - 100 - 10000 - 3600000 - 10 - 10 - 100 - 600000 - 100 - 3600000 - 50 - 3600000 - 100 - 100 - 1000 - 1000 - - - 0 - Opc.Ua.Server.nodes.xml - - 20 - 100 - 10000 - 10000 - - - - Standard UA Server Profile - Data Access Server Facet - Method Server Facet - - 5 - - DA - - - PFX - PEM - - 0 - false - - - - - - - - - UInt32 - 100 - UInt32 - - - Double - 100 - Double - - - - - - - - %LocalApplicationData%/Logs/Opc.Ua.CoreSampleServer.log.txt - true - - - - - - - - - - - - - - - - true - - \ No newline at end of file diff --git a/src/AasxUaNetConsoleServer/Opc.Ua.SampleServer.Config.xml b/src/AasxUaNetConsoleServer/Opc.Ua.SampleServer.Config.xml deleted file mode 100644 index b60a351b1..000000000 --- a/src/AasxUaNetConsoleServer/Opc.Ua.SampleServer.Config.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - UA Core Sample Server - urn:localhost:OPCFoundation:CoreSampleServer - http://opcfoundation.org/UA/CoreSampleServer - Server_0 - - - - - - X509Store - CurrentUser\My - CN=UA Core Sample Server, C=US, S=Arizona, O=OPC Foundation, DC=localhost - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/issuer - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/trusted - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/rejected - - - - false - - - - - - - 600000 - 1048576 - 4194304 - 65535 - 4194304 - 65535 - 300000 - 3600000 - - - - - opc.tcp://localhost:51210/UA/SampleServer - https://localhost:51212/UA/SampleServer/ - - - - - - - - SignAndEncrypt_3 - http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256 - - - - None_1 - http://opcfoundation.org/UA/SecurityPolicy#None - - - Sign_2 - - - - SignAndEncrypt_3 - - - - - 5 - 100 - 2000 - - - - Anonymous_0 - http://opcfoundation.org/UA/SecurityPolicy#None - - - UserName_1 - - - Certificate_2 - - - - false - 100 - 10000 - 3600000 - 10 - 10 - 100 - 600000 - 100 - 3600000 - 50 - 3600000 - 100 - 100 - 1000 - 1000 - - - 0 - Opc.Ua.Server.nodes.xml - - 20 - 100 - 10000 - 10000 - - - - Standard UA Server Profile - Data Access Server Facet - Method Server Facet - - 5 - - DA - - - PFX - PEM - - 0 - false - - - - - - - - - UInt32 - 100 - UInt32 - - - Double - 100 - Double - - - - - - - - %LocalApplicationData%/Logs/Opc.Ua.CoreSampleServer.log.txt - true - - - - - - - - - - - - - - - - true - - \ No newline at end of file diff --git a/src/AasxUaNetConsoleServer/Program.cs b/src/AasxUaNetConsoleServer/Program.cs deleted file mode 100644 index 052b5a1f3..000000000 --- a/src/AasxUaNetConsoleServer/Program.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo AG & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -// TODO (MIHO, 2020-08-03): check SOURCE - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using AasOpcUaServer; -using AasxIntegrationBase; -using AasxUaNetServer; -using AdminShellNS; -using Opc.Ua; -using Opc.Ua.Configuration; -using Opc.Ua.Server; - -namespace Net46ConsoleServer -{ - // ReSharper disable once ClassNeverInstantiated.Global - class Program - { - static void Main(string[] args) - { - // start - Console.Error.WriteLine( - "AAS OPC UA Server. (c) 2019 Michael Hoffmeister, Festo AG & Co. KG. See LICENSE.TXT."); - - // arguments - var options = new AasOpcUaServer.AasxUaServerOptions(); - options.ParseArgs(args); - - // load aasx - if (options.AasxToLoad == null) - { - Console.Error.WriteLine("No .aasx-file to load given. Exiting!"); - return; - } - Console.Error.WriteLine($"loading: {options.AasxToLoad} .."); - var env = new AdminShellPackageEnv(options.AasxToLoad); - - // ReSharper disable HeuristicUnreachableCode - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (env == null) - { - Console.Error.WriteLine($"Cannot open {options.AasxToLoad}. Aborting.."); - } - - // configure UA here a little bit - ApplicationInstance.MessageDlg = new ApplicationMessageDlg(); - - // logger - var logger = new LogInstance(); - - // start - Console.WriteLine("Starting server ..."); - Console.WriteLine("Press 'x' to exit."); - UaServerWrapper server = new UaServerWrapper(_stopTimeout: 0, _aasxEnv: env, logger: logger, _serverOptions: options); - server.Run(); - - // loop - while (true) - { - StoredPrint sp; - while ((sp = logger.PopLastShortTermPrint()) != null) - Console.WriteLine(sp.ToString()); - - Thread.Sleep(10); - - if (Console.KeyAvailable) - { - var cki = Console.ReadKey(true); - if (cki.Key == ConsoleKey.X) - { - Console.WriteLine("Stopping initiated ..."); - break; - } - } - } - - // stop - server.Stop(); - } - } - - public class ApplicationMessageDlg : IApplicationMessageDlg - { - private string message = string.Empty; - private bool ask = false; - - public override void Message(string text, bool ask = false) - { - this.message = text; - this.ask = ask; - } - - public override async Task ShowAsync() - { - if (ask) - { - message += " (y/n, default y): "; - Console.Write(message); - } - else - { - Console.WriteLine(message); - } - if (ask) - { - try - { - ConsoleKeyInfo result = Console.ReadKey(); - Console.WriteLine(); - return await Task.FromResult((result.KeyChar == 'y') || (result.KeyChar == 'Y') - || (result.KeyChar == '\r')); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - return await Task.FromResult(true); - } - } - - // ReSharper disable once UnusedType.Global - public enum ExitCode - { - Ok = 0, - ErrorServerNotStarted = 0x80, - ErrorServerRunning = 0x81, - ErrorServerException = 0x82, - ErrorInvalidCommandLine = 0x100 - }; - -} diff --git a/src/AasxUaNetConsoleServer/Properties/AssemblyInfo.cs b/src/AasxUaNetConsoleServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 3e2a26c49..000000000 --- a/src/AasxUaNetConsoleServer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxUaNetConsoleServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxUaNetConsoleServer")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("232852c2-358b-4577-9d29-1e48ed75c342")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxUaNetConsoleServer/Properties/launchSettings.json b/src/AasxUaNetConsoleServer/Properties/launchSettings.json deleted file mode 100644 index 7393c7127..000000000 --- a/src/AasxUaNetConsoleServer/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "AasxUaNetConsoleServer": { - "commandName": "Project", - "commandLineArgs": "D:\\Code\\aasx-server\\src\\AasxServerBlazor\\erich-repo.aasx" - } - } -} \ No newline at end of file diff --git a/src/AasxUaNetServer/AasxServer/AasEntityBuilder.cs b/src/AasxUaNetServer/AasxServer/AasEntityBuilder.cs deleted file mode 100644 index cf1955f18..000000000 --- a/src/AasxUaNetServer/AasxServer/AasEntityBuilder.cs +++ /dev/null @@ -1,716 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using AdminShellNS; -using AdminShell_V20; -using Opc.Ua; -using Extensions; -using Aas = AasCore.Aas3_0; - -namespace AasOpcUaServer -{ - public class AasEntityBuilder - { - //// Static singleton for AAS entity builders - // ugly, but simple: the singleton variables gives access to information - // - public static AasNodeManager nodeMgr = null; - - public AdminShellPackageEnv package = null; - - public AasxUaServerOptions theServerOptions = null; - - public IDictionary> nodeMgrExternalReferences = null; - - /// - /// Root of AASes - /// - public NodeState RootAAS = null; - - /// - /// Root for CDs - /// - public NodeState RootConceptDescriptions = null; - - /// - /// Root for DataSpecifications - /// - public NodeState RootDataSpecifications = null; - - /// - /// Provide a root node, if semantic ids shall create missing dictionary entry (targets), - /// which can not be found in the AAS environment. - /// - public NodeState RootMissingDictionaryEntries = null; - - public AasEntityBuilder(AasNodeManager nodeMgr, AdminShellPackageEnv package, - IDictionary> externalReferences, AasxUaServerOptions options) - { - AasEntityBuilder.nodeMgr = nodeMgr; - this.package = package; - this.nodeMgrExternalReferences = externalReferences; - this.aasTypes = new AasTypeEntities(); - this.theServerOptions = options; - this.aasTypes.BuildEntites(this); - } - - public class NodeRecord - { - public NodeState uanode = null; - public Aas.IReferable referable = null; - public string id = ""; - - public NodeRecord() { } - public NodeRecord(NodeState uanode, Aas.IReferable referable) - { - this.uanode = uanode; - this.referable = referable; - } - public NodeRecord(NodeState uanode, string id) - { - this.uanode = uanode; - this.id = id; - } - } - - private Dictionary NodeRecordFromReferable - = new Dictionary(); - private Dictionary NodeRecordFromIdentificationHash - = new Dictionary(); - - /// - /// Use this function always to remeber new node records. - /// - /// - public void AddNodeRecord(NodeRecord nr) - { - if (nr.referable != null && !NodeRecordFromReferable.ContainsKey(nr.referable)) - NodeRecordFromReferable.Add(nr.referable, nr); - - if (nr.id != null) - { - var hash = "" + nr.id.Trim().ToUpper(); - if (!NodeRecordFromIdentificationHash.ContainsKey(hash)) - NodeRecordFromIdentificationHash.Add(hash, nr); - } - } - - /// - /// Use this always to lookup node records from Referable - /// - /// - /// - public NodeRecord LookupNodeRecordFromReferable(Aas.IReferable referable) - { - if (NodeRecordFromReferable == null || !NodeRecordFromReferable.ContainsKey(referable)) - return null; - return NodeRecordFromReferable[referable]; - } - - /// - /// Use this always to lookup node records from Indentifiable - /// - /// - /// - public NodeRecord LookupNodeRecordFromIdentification(Aas.IIdentifiable identification) - { - var hash = "" + identification.Id.Trim().ToUpper(); - if (NodeRecordFromReferable == null || !NodeRecordFromIdentificationHash.ContainsKey(hash)) - return null; - return NodeRecordFromIdentificationHash[hash]; - } - - /// - /// Use this always to lookup node records from Indentifiable - /// - /// - /// - public NodeRecord LookupNodeRecordFromId(string id) - { - var hash = "" + id?.Trim().ToUpper(); - if (NodeRecordFromReferable == null || !NodeRecordFromIdentificationHash.ContainsKey(hash)) - return null; - return NodeRecordFromIdentificationHash[hash]; - } - - /// - /// Base class for actions, which shall be done on the 2nd pass of the information model building - /// - public class NodeLateAction - { - public NodeState uanode = null; - } - - /// - /// Make a late reference to another node identified by a AAS reference information - /// - public class NodeLateActionLinkToReference : NodeLateAction - { - public enum ActionType { None, SetAasReference, SetDictionaryEntry } - - public Aas.IReference targetReference = null; - public ActionType actionType = ActionType.None; - - public NodeLateActionLinkToReference(NodeState uanode, Aas.IReference targetReference, - ActionType actionType) - { - this.uanode = uanode; - this.targetReference = targetReference; - this.actionType = actionType; - } - } - - private List noteLateActions = new List(); - - /// - /// Add a late action, which will be processed as 2nd phase of info model preparation - /// - /// - public void AddNodeLateAction(NodeLateAction la) - { - this.noteLateActions.Add(la); - } - - /// - /// Top level creation functions. Uses the definitions of RootAAS, RootConceptDescriptions, - /// RootDataSpecifications to synthesize information model - /// - public void CreateAddInstanceObjects(Aas.Environment env) - { - if (RootAAS == null) - return; - - // CDs (build 1st to be "remembered" as targets for "HasDictionaryEntry") - if (env.ConceptDescriptions != null && this.RootConceptDescriptions != null) - foreach (var cd in env.ConceptDescriptions) - { - this.AasTypes.ConceptDescription.CreateAddElements(this.RootConceptDescriptions, - AasUaBaseEntity.CreateMode.Instance, cd); - } - - // AAS - if (env.AssetAdministrationShells != null) - foreach (var aas in env.AssetAdministrationShells) - this.AasTypes.AAS.CreateAddInstanceObject(RootAAS, env, aas); - - // go through late actions - foreach (var la in this.noteLateActions) - { - // make a Reference ?? - var lax = la as NodeLateActionLinkToReference; - - // more simple case: AasReference between known entities - if (lax != null && lax.actionType == NodeLateActionLinkToReference.ActionType.SetAasReference - && lax.uanode != null - && this.package != null && this.package.AasEnv != null) - { - // 1st, take reference and turn it into Referable - var targetReferable = this.package.AasEnv.FindReferableByReference(lax.targetReference); - if (targetReferable == null) - continue; - - // 2nd, try to lookup the Referable and turn it into a uanode - var targetNodeRec = this.LookupNodeRecordFromReferable(targetReferable); - if (targetNodeRec == null || targetNodeRec.uanode == null) - continue; - - // now, we have everything to formulate a reference - lax.uanode.AddReference(this.AasTypes.HasAasReference.GetTypeNodeId(), false, - targetNodeRec.uanode.NodeId); - } - - // a bit more complicated: could include a "empty reference" to outside concept - if (lax != null && lax.actionType == NodeLateActionLinkToReference.ActionType.SetDictionaryEntry - && lax.uanode != null - && this.package != null && this.package.AasEnv != null) - { - // tracking - var foundAtAll = false; - - // 1st, take reference and turn it into Referable - var targetReferable = this.package.AasEnv.FindReferableByReference(lax.targetReference); - if (targetReferable != null) - { - // 2nd, try to lookup the Referable and turn it into a uanode - var targetNodeRec = this.LookupNodeRecordFromReferable(targetReferable); - if (targetNodeRec != null && targetNodeRec.uanode != null) - { - // simple case: have a target node, just make a link - lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false, - targetNodeRec.uanode.NodeId); - foundAtAll = true; - } - } - - // make "empty reference"?? - // by definition, this makes only sense if the targetReference has exactly 1 key, as we could - // only have one key in a dictionary entry - if (!foundAtAll && lax.targetReference.Keys.Count == 1) - { - // can turn the targetReference to a simple identification - var targetId = "" + lax.targetReference.Keys[0].Value; - - // we might have such an (empty) target already available as uanode - var nr = this.LookupNodeRecordFromId(targetId); - if (nr != null) - { - // just create the missing link - lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false, - nr.uanode?.NodeId); - } - else - { - // create NEW empty reference? - if (this.RootMissingDictionaryEntries != null) - { - // create missing object - var miss = this.CreateAddObject( - this.RootMissingDictionaryEntries, - AasUaBaseEntity.CreateMode.Instance, - targetId, - ReferenceTypeIds.HasComponent, - this.AasTypes.ConceptDescription.GetTypeObjectFor(targetId)?.NodeId); - - // add the reference - lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false, - miss?.NodeId); - - // put it into the NodeRecords, that it can be re-used?? no!! - this.AddNodeRecord(new AasEntityBuilder.NodeRecord(miss, targetId)); - } - else - { - // just create the missing link - // TODO (MIHO, 2020-08-06): check, which namespace shall be used - var missingTarget = new ExpandedNodeId("" + targetId, 99); - lax.uanode.AddReference(this.AasTypes.HasDictionaryEntry.GetTypeNodeId(), false, - missingTarget); - } - } - } - } - - } - } - - public ReferenceTypeState CreateAddReferenceType(string browseDisplayName, string inverseName, uint preferredNumId = 0, bool useZeroNS = false, NodeId sourceId = null, ExpandedNodeId extraSubtype = null) - { - // create node itself - var x = new ReferenceTypeState(); - x.BrowseName = browseDisplayName; - x.DisplayName = browseDisplayName; - x.InverseName = inverseName; - x.Symmetric = false; - x.IsAbstract = false; - x.NodeId = nodeMgr.NewType(nodeMgr.SystemContext, x, preferredNumId); - - // set Subtype reference - if (sourceId == null) - sourceId = new NodeId(32, 0); - - if (extraSubtype != null) - x.AddReference(ReferenceTypeIds.HasSubtype, isInverse: true, extraSubtype); - - // done - return x; - } - - public DataTypeState CreateAddDataType( - string browseDisplayName, NodeId superTypeId, uint preferredNumId = 0) - { - var x = new DataTypeState(); - x.BrowseName = "" + browseDisplayName; - x.DisplayName = "" + browseDisplayName; - x.Description = new LocalizedText("en", browseDisplayName); - x.SuperTypeId = superTypeId; - x.NodeId = nodeMgr.NewType(nodeMgr.SystemContext, x, preferredNumId); - - return x; - } - - /// - /// Helper to create an ObjectType-Node and it to the information model. - /// - /// Name displayed in the node tree - /// Base class or similar - /// Numerical id of the node in the default name space to be set fixed - /// Lookup a Description on AAS literal/ refSemantics - /// Modeling Rule, if not None - public BaseObjectTypeState CreateAddObjectType( - string browseDisplayName, - NodeId superTypeId, - uint preferredNumId = 0, - string descriptionKey = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - var x = AasUaNodeHelper.CreateObjectType(browseDisplayName, superTypeId, descriptionKey: descriptionKey); - - x.NodeId = nodeMgr.NewType(nodeMgr.SystemContext, x, preferredNumId); - - return x; - } - - /// - /// Helper to create an Object-Node. Note: __NO__ NodeId is created by the default! Must be done by outer - /// functionality!! - /// - /// Parent node - /// Type or instance - /// Name displayed in the node tree - /// - /// Type of the Object - /// Modeling Rule, if not None - /// - /// The node - public BaseObjectState CreateAddObject( - NodeState parent, - AasUaBaseEntity.CreateMode mode, - string browseDisplayName, - NodeId referenceTypeFromParentId = null, - NodeId typeDefinitionId = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None, - string extraName = null) - { - BaseObjectState baseObject = AasUaNodeHelper.CreateObject(parent, browseDisplayName, typeDefinitionId, modellingRule, extraName); - - baseObject.NodeId = nodeMgr.New(nodeMgr.SystemContext, mode, baseObject); - - parent?.AddChild(baseObject); - - if (referenceTypeFromParentId != null) - { - if (parent != null) - { - parent.AddReference(referenceTypeFromParentId, false, baseObject.NodeId); - - if (referenceTypeFromParentId == ReferenceTypeIds.HasComponent) - { - baseObject.AddReference(referenceTypeFromParentId, true, parent.NodeId); - } - - if (referenceTypeFromParentId == ReferenceTypeIds.HasProperty) - { - baseObject.AddReference(referenceTypeFromParentId, true, parent.NodeId); - } - } - } - - return baseObject; - } - - //// Properties - // - - /// - /// Helper to create an PropertyState-Node for a certain type and add it to the information model. - /// Note: __NO__ NodeId is created by the default! Must be done by outer functionality!! - /// - /// C# type of the proprty - /// Parent node - /// Type or instance - /// Name displayed in the node tree - /// Data type, such as String.. Given by DataTypeIds... - /// Value of the type T or Null - /// - /// Type definition; independent from DataType! - /// -1 or e.g. 1 for array - /// Apply default settings for a normal Property - /// Modeling Rule, if not None - /// NodeState - public PropertyState CreateAddPropertyState( - NodeState parent, AasUaBaseEntity.CreateMode mode, - string browseDisplayName, - NodeId dataTypeId, T value, - NodeId referenceTypeFromParentId = null, - NodeId typeDefinitionId = null, - int valueRank = -2, - bool defaultSettings = false, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - // apply cumulative settings - if (defaultSettings) - { - referenceTypeFromParentId = ReferenceTypeIds.HasProperty; - typeDefinitionId = VariableTypeIds.PropertyType; - - if (valueRank == -2) - { - valueRank = -1; - } - } - - // make Property - var x = new PropertyState(parent); - x.BrowseName = "" + browseDisplayName; - x.DisplayName = "" + browseDisplayName; - x.Description = new LocalizedText("en", browseDisplayName); - x.DataType = dataTypeId; - if (valueRank > -2) - x.ValueRank = valueRank; - // ReSharper disable once RedundantCast - x.Value = (T)value; - AasUaNodeHelper.CheckSetModellingRule(modellingRule, x); - x.NodeId = nodeMgr.New(nodeMgr.SystemContext, mode, x); - - // add Node - if (parent != null) - parent.AddChild(x); - - // set relations - if (referenceTypeFromParentId != null) - { - if (parent != null) - { - parent.AddReference(referenceTypeFromParentId, false, x.NodeId); - - if (referenceTypeFromParentId == ReferenceTypeIds.HasComponent) - x.AddReference(referenceTypeFromParentId, true, parent.NodeId); - - if (referenceTypeFromParentId == ReferenceTypeIds.HasProperty) - x.AddReference(referenceTypeFromParentId, true, parent.NodeId); - } - } - - if (typeDefinitionId != null) - { - x.TypeDefinitionId = typeDefinitionId; - } - - x.AccessLevel = AccessLevels.CurrentReadOrWrite; - x.UserAccessLevel = AccessLevels.CurrentReadOrWrite; - - return x; - } - - public MethodState CreateAddMethodState( - NodeState parent, AasUaBaseEntity.CreateMode mode, - string browseDisplayName, - Argument[] inputArgs = null, Argument[] outputArgs = null, NodeId referenceTypeFromParentId = null, - NodeId methodDeclarationId = null, GenericMethodCalledEventHandler onCalled = null) - { - // method node - var m = new MethodState(parent); - m.BrowseName = "" + browseDisplayName; - m.DisplayName = "" + browseDisplayName; - m.Description = new LocalizedText("en", browseDisplayName); - m.NodeId = nodeMgr.New(nodeMgr.SystemContext, mode, m); - if (methodDeclarationId != null) - m.MethodDeclarationId = methodDeclarationId; - - m.Executable = true; - m.UserExecutable = true; - - if (parent != null) - parent.AddChild(m); - - if (referenceTypeFromParentId != null) - { - if (parent != null) - { - parent.AddReference(referenceTypeFromParentId, false, m.NodeId); - - if (referenceTypeFromParentId == ReferenceTypeIds.HasComponent) - m.AddReference(referenceTypeFromParentId, true, parent.NodeId); - - if (referenceTypeFromParentId == ReferenceTypeIds.HasProperty) - m.AddReference(referenceTypeFromParentId, true, parent.NodeId); - } - } - - // can have inputs, outputs - for (int i = 0; i < 2; i++) - { - // pretty argument list - var arguments = (i == 0) ? inputArgs : outputArgs; - if (arguments == null || arguments.Length < 1) - continue; - - // make a property for this - var prop = CreateAddPropertyState( - m, mode, - (i == 0) ? "InputArguments" : "OutputArguments", - DataTypeIds.Argument, - arguments, - ReferenceTypeIds.HasProperty, - typeDefinitionId: VariableTypeIds.PropertyType, - valueRank: 1); - - // explicitely add arguments ass well? - if (i == 0) - m.InputArguments = prop; - - if (i == 1) - m.OutputArguments = prop; - - } - - // event handler - if (onCalled != null) - m.OnCallMethod = onCalled; - - - return m; - } - - - //// Entities - // - - public class AasTypeEntities - { - public AasUaEntityPathType PathType; - public AasUaEntityMimeType MimeType; - - public AasUaEntityIdentification Identification; - public AasUaEntityAdministration Administration; - public AasUaEntityQualifier Qualifier; - public AasUaEntityAssetKind AssetKind; - public AasUaEntityModelingKind ModelingKind; - public AasUaEntityReferable Referable; - public AasUaEntityReferenceBase ReferenceBase; - public AasUaEntityReference Reference; - public AasUaEntitySemanticId SemanticId; - public AasUaEntitySubmodel Submodel; - public AasUaEntityProperty Property; - public AasUaEntityCollection Collection; - public AasUaEntitySmeList SmeList; - public AasUaEntitySubmodelElement SubmodelElement; - public AasUaEntitySubmodelWrapper SubmodelWrapper; - public AasUaEntityFile File; - public AasUaEntityFileType FileType; - public AasUaEntityBlob Blob; - public AasUaEntityReferenceElement ReferenceElement; - public AasUaEntityRelationshipElement RelationshipElement; - public AasUaEntityOperationVariable OperationVariable; - public AasUaEntityOperation Operation; - public AasUaEntityConceptDescription ConceptDescription; - public AasUaEntityAsset Asset; - public AasUaEntityAAS AAS; - - public AasUaEntityDataSpecification DataSpecification; - public AasUaEntityDataSpecificationIEC61360 DataSpecificationIEC61360; - - public AasUaInterfaceAASIdentifiableType IAASIdentifiableType; - public AasUaInterfaceAASReferableType IAASReferableType; - - public AasUaNamespaceZeroEntity BaseInterfaceType; - - public AasUaNamespaceZeroReference HasDictionaryEntry; - public AasUaReferenceHasAasReference HasAasReference; - public AasUaNamespaceZeroReference HasInterface; - public AasUaNamespaceZeroReference HasAddIn; - public AasUaNamespaceZeroEntity DictionaryEntryType; - public AasUaNamespaceZeroEntity UriDictionaryEntryType; - public AasUaNamespaceZeroEntity IrdiDictionaryEntryType; - public AasUaNamespaceZeroEntity DictionaryFolderType; - - public void BuildEntites(AasEntityBuilder builder) - { - // build up entities, which are in the UA specs, but not in this Stack - BaseInterfaceType = new AasUaNamespaceZeroEntity(builder, 17602); - HasDictionaryEntry = new AasUaNamespaceZeroReference(builder, 17597); - HasInterface = new AasUaNamespaceZeroReference(builder, 17603); - HasAddIn = new AasUaNamespaceZeroReference(builder, 17604); - DictionaryEntryType = new AasUaNamespaceZeroEntity(builder, 17589); - UriDictionaryEntryType = new AasUaNamespaceZeroEntity(builder, 17600); - IrdiDictionaryEntryType = new AasUaNamespaceZeroEntity(builder, 17598); - DictionaryFolderType = new AasUaNamespaceZeroEntity(builder, 17591); - - // AAS DataTypes - PathType = new AasUaEntityPathType(builder); - MimeType = new AasUaEntityMimeType(builder); - - // first entities - Referable = new AasUaEntityReferable(builder, 1004); - Identification = new AasUaEntityIdentification(builder, 1000); - Administration = new AasUaEntityAdministration(builder, 1001); - - // interfaces - IAASReferableType = new AasUaInterfaceAASReferableType( - builder, 2001); // dependencies: Referable - IAASIdentifiableType = new AasUaInterfaceAASIdentifiableType( - builder, 2000); // dependencies: IAASReferable - - // AAS References - ReferenceBase = new AasUaEntityReferenceBase(builder, 0); - Reference = new AasUaEntityReference(builder, 1005); - SemanticId = new AasUaEntitySemanticId(builder, 1006); // dependecies: Reference - HasAasReference = new AasUaReferenceHasAasReference(builder, 4000); // dependencies: Referable - - // Data Specifications - DataSpecification = new AasUaEntityDataSpecification(builder, 3000); - DataSpecificationIEC61360 = new AasUaEntityDataSpecificationIEC61360( - builder, 3001); // dependencies: Reference, Identification, Administration - - // rest - Qualifier = new AasUaEntityQualifier(builder, 1002); // dependencies: SemanticId, Reference - AssetKind = new AasUaEntityAssetKind(builder, 1025); - ModelingKind = new AasUaEntityModelingKind(builder, 1003); - SubmodelElement = new AasUaEntitySubmodelElement(builder, 1008); - SubmodelWrapper = new AasUaEntitySubmodelWrapper(builder, 1012); // dependencies: SubmodelElement - Submodel = new AasUaEntitySubmodel(builder, 1007); // dependencies: SubmodelWrapper - Property = new AasUaEntityProperty(builder, 1009); - Collection = new AasUaEntityCollection(builder, 1010); // needs 2 ids! - SmeList = new AasUaEntitySmeList(builder, 1028); // needs 2 ids! - FileType = new AasUaEntityFileType(builder, 1014); - File = new AasUaEntityFile(builder, 1013); // dependencies: FileType - Blob = new AasUaEntityBlob(builder, 1015); - ReferenceElement = new AasUaEntityReferenceElement(builder, 1016); - RelationshipElement = new AasUaEntityRelationshipElement(builder, 1017); - OperationVariable = new AasUaEntityOperationVariable(builder, 1018); - Operation = new AasUaEntityOperation(builder, 1019); - ConceptDescription = new AasUaEntityConceptDescription(builder, 1021); - Asset = new AasUaEntityAsset(builder, 1023); - AAS = new AasUaEntityAAS(builder, 1024); - } - } - - private AasTypeEntities aasTypes = null; - public AasTypeEntities AasTypes { get { return aasTypes; } } - - //// Annotations - // - - private Dictionary> nodeStateAnnotations = new Dictionary>(); - - public void AddNodeStateAnnotation(NodeState nodeState, object businessObject) - { - if (!nodeStateAnnotations.ContainsKey(nodeState)) - nodeStateAnnotations[nodeState] = new List(); - nodeStateAnnotations[nodeState].Add(businessObject); - } - - public void RemoveNodeStateAnnotation(NodeState nodeState, object businessObject) - { - if (!nodeStateAnnotations.ContainsKey(nodeState)) - return; - if (nodeStateAnnotations[nodeState].Contains(businessObject)) - nodeStateAnnotations[nodeState].Remove(businessObject); - } - - public T FindNoteStateAnnotation(NodeState nodeState) where T : class - { - if (nodeState == null) - return null; - if (!nodeStateAnnotations.ContainsKey(nodeState)) - return null; - foreach (var bo in nodeStateAnnotations[nodeState]) - if (bo is T) - return bo as T; - return null; - } - - } - -} diff --git a/src/AasxUaNetServer/AasxServer/AasEntityDescriptions.cs b/src/AasxUaNetServer/AasxServer/AasEntityDescriptions.cs deleted file mode 100644 index 29a5bfdc0..000000000 --- a/src/AasxUaNetServer/AasxServer/AasEntityDescriptions.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace AasOpcUaServer -{ - // ReSharper disable once ClassNeverInstantiated.Global - public class AasEntityDescriptions - { - private static Dictionary keyToDescription = new Dictionary(); - - static AasEntityDescriptions() - { - AddDescription("AAS:Asset", - @"An Asset describes meta data of an asset that is represented by an AAS. - The asset may either represent an asset type or an asset instance. - The asset has a globally unique identifier plus – if needed – additional domain specific(proprietary) - identifiers. "); - - AddDescription("AAS:Identifier", - @"Used to uniquely identify an entity by using an identifier."); - - AddDescription("AAS:AdministrativeInformation", - @"Administrative metainformation for an element like version information."); - - AddDescription("AAS:AssetAdministrationShell", - @"An AssetAdministration Shell."); - - AddDescription("AAS:Submodel", - @"A Submodel defines a specific aspect of the asset represented by the AAS. - A submodel is used to structure the digital representation and technical functionality of an - Administration Shell into distinguishable parts. - Each submodel refers to a well-defined domain or subject matter. Submodels can become standardized - and thus become submodels types. Submodels can have different life-cycles. "); - - AddDescription("AAS:SubmodelElement", - @"A data element is a submodel element that is not further composed out of other submodel elements. - A data element is a submodel element that has a value. The type of value differs for different - subtypes of data elements."); - - AddDescription("AAS:Property", - @"A property is a data element that has a single value."); - - AddDescription("AAS:SubmodelElementCollection", - @"A submodel element collection is a set or list of submodel elements."); - - AddDescription("AAS:SubmodelElementCollection", - @"A submodel element collection is a set or list of submodel elements."); - - AddDescription("AAS:File", - @"A File is a data element that represents an address to a file. The value is an URI that can - represent an absolute or relative path."); - - AddDescription("AAS:Blob", - @"A BLOB is a data element that represents a file that is contained with its source code in the - value attribute."); - - AddDescription("AAS:ReferenceElement", - @"A reference element is a data element that defines a logical reference to another element within - the same or another AAS or a reference to an external object or entity."); - - AddDescription("AAS:RelationshipElement", - @"A relationship element is used to define a relationship between two referable elements."); - - AddDescription("AAS:OperationVariable", - @"An operation variable is a submodel element that is used as input or output variable of an - operation."); - - AddDescription("AAS:Operation", - @"An operation is a submodel element with input and output variables."); - - AddDescription("AAS:View", - @"A view is a collection of referable elements w.r.t. to a specific viewpoint of one or more - stakeholders."); - - AddDescription("AAS:ConceptDictionary", - @"A dictionary contains elements that can be reused. - The concept dictionary contains concept descriptions. - Typically a concept description dictionary of an AAS contains only concept descriptions of - elements used within submodels of the AAS"); - - AddDescription("AAS:DataSpecification", - @"A data specification template defines the additional attributes an element may or shall have."); - - AddDescription("AAS:DataSpecificationIEC61360", - @"Data Specification Template conformant to IEC61360."); - - AddDescription("AAS:ConceptDescription", - @"The semantics of a property or other elements that may have a semantic description is defined by a - concept description. The description of the concept should follow a standardized schema - (realized as data specification template)."); - - AddDescription("AAS:Identifiable", - @"An element that has a globally unique identifier. "); - - AddDescription("AAS:Referable", - @"An element that is referable but has no globally unique. The id of the element is unique within the - name space of the element."); - - } - - static void AddDescription(string key, string description) - { - if (key == null) - return; - keyToDescription[key.Trim().ToLower()] = description; - } - - public static string LookupDescription(string key) - { - if (key == null || !keyToDescription.ContainsKey(key.Trim().ToLower())) - return null; - var desc = keyToDescription[key.Trim().ToLower()]; - desc = Regex.Replace(desc, @"\s+", " "); - return desc; - } - - } -} diff --git a/src/AasxUaNetServer/AasxServer/AasNodeManager.cs b/src/AasxUaNetServer/AasxServer/AasNodeManager.cs deleted file mode 100644 index ecbae3a56..000000000 --- a/src/AasxUaNetServer/AasxServer/AasNodeManager.cs +++ /dev/null @@ -1,335 +0,0 @@ -/* ======================================================================== - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - * ======================================================================*/ - -using AdminShellNS; -using Opc.Ua; -using Opc.Ua.Server; -using Org.BouncyCastle.Asn1.X509; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; - -namespace AasOpcUaServer -{ - /// - /// A node manager the diagnostic information exposed by the server. - /// - public class AasNodeManager : CustomNodeManager2 - { - private AdminShellPackageEnv thePackageEnv = null; - private AasxUaServerOptions theServerOptions = null; - - #region Constructors - /// - /// Initializes the node manager. - /// - public AasNodeManager( - IServerInternal server, - ApplicationConfiguration configuration, - AdminShellPackageEnv env, - AasxUaServerOptions serverOptions = null) - : - base(server, configuration) - { - thePackageEnv = env; - theServerOptions = serverOptions; - - List namespaceUris = new List(); - namespaceUris.Add("http://opcfoundation.org/UA/i4aas/"); - namespaceUris.Add("http://admin-shell.io/samples/i4aas/instance/"); - // ReSharper disable once VirtualMemberCallInConstructor - NamespaceUris = namespaceUris; - - m_typeNamespaceIndex = Server.NamespaceUris.GetIndexOrAppend(namespaceUris[0]); - m_instanceNamespaceIndex = Server.NamespaceUris.GetIndexOrAppend(namespaceUris[1]); - - m_lastUsedId = 0; - } - #endregion - - #region INodeIdFactory Members - /// - /// Creates the NodeId for the specified node. - /// - /// The context. - /// Type or instance - /// The node. - /// The new NodeId. - public NodeId New(ISystemContext context, AasUaBaseEntity.CreateMode mode, NodeState node) - { - uint id = Utils.IncrementIdentifier(ref m_lastUsedId); - - if (mode == AasUaBaseEntity.CreateMode.Type) - { - return new NodeId(id, m_typeNamespaceIndex); - } - else - { - return new NodeId(id, m_instanceNamespaceIndex); - } - } - #endregion - - public NodeId NewType(ISystemContext context, NodeState node, uint preferredNumId) - { - uint id = preferredNumId; - - if (id == 0) - { - id = Utils.IncrementIdentifier(ref m_lastUsedTypeId); - } - - return new NodeId(id, m_typeNamespaceIndex); - } - - public void SaveNodestateCollectionAsNodeSet2(ISystemContext context, NodeStateCollection nsc, Stream stream, bool filterSingleNodeIds, NodeState rootItem = null) - { - Opc.Ua.Export.UANodeSet nodeSet = new Opc.Ua.Export.UANodeSet(); - nodeSet.LastModified = DateTime.UtcNow; - nodeSet.LastModifiedSpecified = true; - - Utils.Trace(Utils.TraceMasks.Operation, "Exporting {0} nodes ..", nsc.Count); - int i = 0; - foreach (var n in nsc) - { - nodeSet.Export(context, n); - if ((i++) % 500 == 0) - Utils.Trace(Utils.TraceMasks.Operation, " .. exported already {0} nodes ..", nodeSet.Items.Length); - } - - if (filterSingleNodeIds) - { - Utils.Trace(Utils.TraceMasks.Operation, "Filtering single node ids.."); - - var nodup = new List(); - - var visitedNodeIds = new Dictionary(); - - foreach (var it in nodeSet.Items) - { - if (visitedNodeIds.ContainsKey(it.NodeId)) - continue; - visitedNodeIds.Add(it.NodeId, 1); - - // try to remove double references - if (it.References != null) - { - var newrefs = new List(); - foreach (var oldref in it.References) - { - // trivial - if (oldref == null) - continue; - - // brute force check if already there - var found = false; - foreach (var nr in newrefs) - if (oldref.ReferenceType == nr.ReferenceType - && oldref.IsForward == nr.IsForward - && oldref.Value == nr.Value) - { - found = true; - break; - } - - // if not, add - if (!found) - newrefs.Add(oldref); - } - // only change when necessary (reduce the impact) - if (it.References.Length != newrefs.Count) - it.References = newrefs.ToArray(); - } - - nodup.Add(it); - } - - nodeSet.Items = nodup.ToArray(); - } - - // - // write - // - - Utils.Trace(Utils.TraceMasks.Operation, "Writing stream .."); - nodeSet.Write(stream); - } - - #region INodeManager Members - - private FolderState CreateAASFolder(IList objectsFolder) - { - string name = "AssetAdminShell"; - - FolderState folder = new FolderState(null) - { - SymbolicName = name, - ReferenceTypeId = ReferenceTypes.Organizes, - TypeDefinitionId = ObjectTypeIds.FolderType, - NodeId = new NodeId(name, m_instanceNamespaceIndex), - BrowseName = new QualifiedName(name, m_instanceNamespaceIndex), - DisplayName = new LocalizedText("en", name), - WriteMask = AttributeWriteMask.None, - UserWriteMask = AttributeWriteMask.None, - EventNotifier = EventNotifiers.None - }; - - objectsFolder?.Add(new NodeStateReference(ReferenceTypes.Organizes, false, folder.NodeId)); - - return folder; - } - - /// - /// Does any initialization required before the address space can be used. - /// - /// - /// The externalReferences is an out parameter that allows the node manager to link to nodes - /// in other node managers. For example, the 'Objects' node is managed by the CoreNodeManager and - /// should have a reference to the root folder node(s) exposed by this node manager. - /// - public override void CreateAddressSpace(IDictionary> externalReferences) - { - lock (Lock) - { - var builder = new AasEntityBuilder(this, thePackageEnv, null, theServerOptions); - - // get a reference to the objects folder - IList objectsFolder = null; - if (!externalReferences.TryGetValue(ObjectIds.ObjectsFolder, out objectsFolder)) - { - externalReferences[ObjectIds.ObjectsFolder] = objectsFolder = new List(); - } - - // create AAS folder under objects folder - FolderState root = CreateAASFolder(objectsFolder); - builder.RootAAS = root; - - // ceate dictionaries folder - BaseObjectState topOfDict = builder.CreateAddObject( - root, - AasUaBaseEntity.CreateMode.Instance, - "Dictionaries", - null, - builder.AasTypes.DictionaryFolderType.GetTypeNodeId()); - - // create a folder for Concept Descriptions - builder.RootConceptDescriptions = builder.CreateAddObject( - topOfDict, - AasUaBaseEntity.CreateMode.Instance, - "ConceptDescriptions", - ReferenceTypeIds.HasComponent, - builder.AasTypes.DictionaryFolderType.GetTypeNodeId()); - - // create dictionary entries - builder.RootMissingDictionaryEntries = builder.CreateAddObject( - topOfDict, - AasUaBaseEntity.CreateMode.Instance, - "DictionaryEntries", - ReferenceTypeIds.HasComponent, - builder.AasTypes.DictionaryFolderType.GetTypeNodeId()); - - builder.CreateAddInstanceObjects(thePackageEnv.AasEnv); - - AddPredefinedNode(SystemContext, root); - AddReverseReferences(externalReferences); - - // write nodeset2.xml file, if required - if (theServerOptions != null && theServerOptions.SpecialJob == AasxUaServerOptions.JobType.ExportNodesetXml) - { - try - { - // empty list - var nodesToExport = new NodeStateCollection(); - - // apply filter criteria - foreach (var y in this.PredefinedNodes) - { - var node = y.Value; - - if (theServerOptions.ExportFilterNamespaceIndex != null - && !theServerOptions.ExportFilterNamespaceIndex.Contains( - node.NodeId.NamespaceIndex)) - continue; - - nodesToExport.Add(node); - } - - // export - Utils.Trace(Utils.TraceMasks.Operation, - "Writing export file: " + theServerOptions.ExportFilename); - var stream = new StreamWriter(theServerOptions.ExportFilename); - - SaveNodestateCollectionAsNodeSet2(this.SystemContext, nodesToExport, stream.BaseStream, - filterSingleNodeIds: theServerOptions != null - && theServerOptions.FilterForSingleNodeIds, - builder.RootAAS); - - try - { - stream.Close(); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - - Utils.Trace(Utils.TraceMasks.Operation, - "Export file *** completely written! ***"); - - // stop afterwards - if (theServerOptions.FinalizeAction != null) - { - Utils.Trace(Utils.TraceMasks.Operation, - "Requesting to shut down application.."); - theServerOptions.FinalizeAction(); - } - - } - catch (Exception ex) - { - Utils.Trace(ex, "When exporting to {0}", "" + theServerOptions.ExportFilename); - } - } - - Debug.WriteLine("Done creating custom address space!"); - Utils.Trace(Utils.TraceMasks.Operation, "Done creating custom address space!"); - } - } - - #endregion - - #region Private Fields - private ushort m_instanceNamespaceIndex; - private ushort m_typeNamespaceIndex; - private long m_lastUsedId; - private long m_lastUsedTypeId; - #endregion - } -} diff --git a/src/AasxUaNetServer/AasxServer/AasUaEntities.cs b/src/AasxUaNetServer/AasxServer/AasUaEntities.cs deleted file mode 100644 index a7a8332ae..000000000 --- a/src/AasxUaNetServer/AasxServer/AasUaEntities.cs +++ /dev/null @@ -1,1951 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using AasCore.Aas3_0; -using AdminShellNS; -using Extensions; -using Opc.Ua; -using Aas = AasCore.Aas3_0; -using AasxIntegrationBase; - -// TODO (MIHO, 2020-08-29): The UA mapping needs to be overworked in order to comply the joint aligment with I4AAS -// TODO (MIHO, 2020-08-29): The UA mapping needs to be checked for the "new" HasDataSpecification strcuture of V2.0.1 - -namespace AasOpcUaServer -{ - public class AasUaBaseEntity - { - public enum CreateMode { Type, Instance }; - - /// - /// Reference back to the entity builder - /// - protected AasEntityBuilder entityBuilder = null; - - public AasUaBaseEntity(AasEntityBuilder entityBuilder) - { - this.entityBuilder = entityBuilder; - } - - /// - /// Typically the node of the entity in the AAS type object space - /// - protected NodeState typeObject = null; - - /// - /// If the entitiy does not have a direct type object, the object id instead (for pre-defined objects) - /// - protected NodeId typeObjectId = null; - - /// - /// Getter of the type object - /// - public NodeState GetTypeObject() - { - return typeObject; - } - - /// - /// Getter of the type object id, either directly or via the type object (if avilable) - /// - /// - public NodeId GetTypeNodeId() - { - if (typeObjectId != null) - return typeObjectId; - if (typeObject == null) - return null; - return typeObject.NodeId; - } - } - - public class AasUaEntityPathType : AasUaBaseEntity - { - public AasUaEntityPathType(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type elements - this.typeObject = this.entityBuilder.CreateAddDataType("AASPathType", DataTypeIds.String); - } - } - - public class AasUaEntityMimeType : AasUaBaseEntity - { - public AasUaEntityMimeType(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type elements - this.typeObject = this.entityBuilder.CreateAddDataType("AASMimeType", DataTypeIds.String); - } - } - - public class AasUaEntityIdentification : AasUaBaseEntity - { - public AasUaEntityIdentification(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASIdentifierType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:Identifier"); - // add some elements - - if (true == entityBuilder.theServerOptions?.SimpleDataTypes) - { - this.entityBuilder.CreateAddDataType("IdType", DataTypeIds.String); - this.entityBuilder.CreateAddDataType("Id", DataTypeIds.String); - } - else - { - // this is the original code, which gets not imported by SiOME - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "IdType", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Id", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, - string id = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - - var o = this.entityBuilder.CreateAddObject(parent, mode, "Identification", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId, modellingRule: modellingRule); - - if (mode == CreateMode.Instance) - { - if (id != null) - { - this.entityBuilder.CreateAddPropertyState(o, mode, "Id", - DataTypeIds.String, "" + "" + id, defaultSettings: true); - } - } - - return o; - } - } - - public class AasUaEntityAdministration : AasUaBaseEntity - { - public AasUaEntityAdministration(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASAdministrativeInformationType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:AdministrativeInformation"); - // add some elements - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Version", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Revision", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, - Aas.IAdministrativeInformation administration = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - // Create whole object only if required - if (mode == CreateMode.Instance && administration == null) - return null; - - var o = this.entityBuilder.CreateAddObject(parent, mode, "Administration", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId, modellingRule: modellingRule); - - if (mode == CreateMode.Instance) - { - if (administration == null) - return null; - this.entityBuilder.CreateAddPropertyState(o, mode, "Version", - DataTypeIds.String, "" + "" + administration.Version, defaultSettings: true); - this.entityBuilder.CreateAddPropertyState(o, mode, "Revision", - DataTypeIds.String, "" + "" + administration.Revision, defaultSettings: true); - } - - return o; - } - } - - public class AasUaEntityQualifier : AasUaBaseEntity - { - public AasUaEntityQualifier(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASQualifierType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, "AAS:Qualifier"); - - // add some elements - this.entityBuilder.AasTypes.SemanticId.CreateAddInstanceObject(this.typeObject, - CreateMode.Type, null, "SemanticId", modellingRule: AasUaNodeHelper.ModellingRule.Optional); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Type", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Value", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, - null, "ValueId", AasUaNodeHelper.ModellingRule.Optional); - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.IQualifier qualifier = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - // Create whole object only if required - if (mode == CreateMode.Instance && qualifier == null) - return null; - - if (mode == CreateMode.Type) - { - // plain - var o = this.entityBuilder.CreateAddObject(parent, mode, "Qualifier", ReferenceTypeIds.HasComponent, - GetTypeObject().NodeId, modellingRule: modellingRule); - return o; - } - else - { - // need data - if (qualifier == null) - return null; - - // do a little extra? - string extraName = null; - if (qualifier.Type != null && qualifier.Type.Length > 0) - { - extraName = "Qualifier:" + qualifier.Type; - if (qualifier.Value != null && qualifier.Value.Length > 0) - extraName += "=" + qualifier.Value; - } - - var o = this.entityBuilder.CreateAddObject(parent, mode, "Qualifier", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId, modellingRule: modellingRule, - extraName: extraName); - - this.entityBuilder.AasTypes.SemanticId.CreateAddInstanceObject(o, - CreateMode.Instance, qualifier.SemanticId, "SemanticId"); - this.entityBuilder.CreateAddPropertyState(o, mode, "Type", - DataTypeIds.String, "" + qualifier.Type, defaultSettings: true); - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.String, "" + qualifier.Value, defaultSettings: true); - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, - CreateMode.Instance, qualifier.ValueId, "ValueId"); - - return o; - } - - } - } - - public class AasUaEntityAssetKind : AasUaBaseEntity - { - public AasUaEntityAssetKind(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - // no special type here (is a string) - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.AssetKind? kind = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (mode == CreateMode.Instance && kind == null) - return null; - - var o = this.entityBuilder.CreateAddPropertyState(parent, mode, "Kind", - DataTypeIds.String, - (mode == CreateMode.Type) - ? null - : "" + (kind != null ? Stringification.ToString(kind.Value) : ""), - defaultSettings: true, - modellingRule: modellingRule); - - return o; - } - } - - public class AasUaEntityModelingKind : AasUaBaseEntity - { - public AasUaEntityModelingKind(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - // no special type here (is a string) - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.ModellingKind? kind = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (mode == CreateMode.Instance && kind == null) - return null; - - var o = this.entityBuilder.CreateAddPropertyState(parent, mode, "Kind", - DataTypeIds.String, - (mode == CreateMode.Type) - ? null - : "" + (kind != null ? Stringification.ToString(kind) : ""), - defaultSettings: true, - modellingRule: modellingRule); - - return o; - } - } - - public class AasUaEntityReferable : AasUaBaseEntity - { - public AasUaEntityReferable(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // NO type object required - // see IAASReferable interface - } - - /// - /// This adds all Referable attributes to the parent and re-defines the descriptons - /// - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.IReferable refdata = null) - { - if (parent == null) - return null; - if (mode == CreateMode.Instance && refdata == null) - return null; - - if (mode == CreateMode.Type || refdata?.Category != null) - this.entityBuilder.CreateAddPropertyState(parent, mode, "Category", - DataTypeIds.String, (mode == CreateMode.Type) ? null : "" + refdata?.Category, - defaultSettings: true, modellingRule: AasUaNodeHelper.ModellingRule.Optional); - - // No idShort as typically in the DisplayName of the node - - if (mode == CreateMode.Instance) - { - // now, re-set the description on the parent - // ISSUE: only ONE language supported! - parent.Description = AasUaUtils.GetBestUaDescriptionFromAasDescription(refdata?.Description); - } - - return null; - } - } - - public class AasUaEntityReferenceBase : AasUaBaseEntity - { - public AasUaEntityReferenceBase(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // nothing, only used to share code - } - - /// - /// Sets the "Keys" value information of an AAS Reference. This is especially important for referencing - /// outwards of the AAS (environment). - /// - public void CreateAddKeyElements(NodeState parent, CreateMode mode, Aas.IReference rf = null) - { - if (parent == null) - return; - - // MIHO: open62541 does not to process Values as string[], therefore change it temporarily - - if (this.entityBuilder != null && this.entityBuilder.theServerOptions != null - && this.entityBuilder.theServerOptions.ReferenceKeysAsSingleString) - { - // fix for open62541 - - var typeo = this.entityBuilder.CreateAddPropertyState(parent, mode, "Type", - DataTypeIds.String, null, defaultSettings: true); - - var keyo = this.entityBuilder.CreateAddPropertyState(parent, mode, "Keys", - DataTypeIds.String, null, defaultSettings: true); - - if (mode == CreateMode.Instance && keyo != null) - { - typeo.Value = Stringification.ToString(rf.Type); - keyo.Value = AasUaUtils.ToOpcUaReference(rf); - } - } - else - { - // default behaviour - var keyo = this.entityBuilder?.CreateAddPropertyState(parent, mode, "Keys", - DataTypeIds.Structure, null, defaultSettings: true); - - if (mode == CreateMode.Instance && keyo != null) - { - keyo.Value = AasUaUtils.ToOpcUaReferenceList(rf)?.ToArray(); - } - } - } - - /// - /// Sets the UA relation of an AAS Reference. This is especially important for reference within an AAS node - /// structure, to be - /// in the style of OPC UA - /// - public void CreateAddReferenceElements(NodeState parent, CreateMode mode, List keys = null) - { - if (parent == null) - return; - - if (mode == CreateMode.Type) - { - // makes no sense - } - else - { - // would make sense, but is replaced by the code in "CreateAddInstanceObjects" directly. - } - } - } - - public class AasUaEntityReference : AasUaEntityReferenceBase - { - public AasUaEntityReference(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASReferenceType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId); - // with some elements - this.CreateAddKeyElements(this.typeObject, CreateMode.Type); - this.CreateAddReferenceElements(this.typeObject, CreateMode.Type); - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, - Aas.IReference reference, string browseDisplayName = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - - if (mode == CreateMode.Type) - { - var o = this.entityBuilder.CreateAddObject(parent, mode, browseDisplayName ?? "Reference", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId, modellingRule: modellingRule); - return o; - } - else - { - if (reference == null) - return null; - - var o = this.entityBuilder.CreateAddObject(parent, mode, browseDisplayName ?? "Reference", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // explicit strings? - this.CreateAddKeyElements(o, mode, reference); - - // find a matching concept description or other referable? - // as we do not have all other nodes realized, store a late action - this.entityBuilder.AddNodeLateAction( - new AasEntityBuilder.NodeLateActionLinkToReference( - o, - reference, - AasEntityBuilder.NodeLateActionLinkToReference.ActionType.SetAasReference - )); - - // OK - return o; - } - } - } - - public class AasUaEntitySemanticId : AasUaEntityReferenceBase - { - public AasUaEntitySemanticId(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // re-use AASReferenceType for this - this.typeObject = this.entityBuilder.AasTypes.Reference.GetTypeObject(); - // with some elements - this.CreateAddReferenceElements(this.typeObject, CreateMode.Type); - } - - public NodeState CreateAddInstanceObject(NodeState parent, CreateMode mode, - Aas.IReference semid = null, string browseDisplayName = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - - if (mode == CreateMode.Type) - { - var o = this.entityBuilder.CreateAddObject(parent, mode, browseDisplayName ?? "SemanticId", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId, modellingRule: modellingRule); - return o; - } - else - { - if (semid == null) - return null; - - var o = this.entityBuilder.CreateAddObject(parent, mode, browseDisplayName ?? "SemanticId", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // explicit strings? - this.CreateAddKeyElements(o, mode, semid); - - // find a matching concept description or other referable? - // as we do not have all other nodes realized, store a late action - this.entityBuilder.AddNodeLateAction( - new AasEntityBuilder.NodeLateActionLinkToReference( - parent, - semid.Copy(), - AasEntityBuilder.NodeLateActionLinkToReference.ActionType.SetDictionaryEntry - )); - - // OK - return o; - } - } - } - - public class AasUaEntityAsset : AasUaBaseEntity - { - public AasUaEntityAsset(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASAssetType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:Asset"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObject, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - - // add necessary type information - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements(this.typeObject, CreateMode.Type); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Administration.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // HasKind - this.entityBuilder.AasTypes.AssetKind.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - // HasDataSpecification - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, - null, "DataSpecification", modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - // own attributes - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, - null, "AssetIdentificationModel", modellingRule: AasUaNodeHelper.ModellingRule.Optional); - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.IAssetInformation asset = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - // Create whole object only if required - if (mode == CreateMode.Instance && asset == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, mode, "Asset", ReferenceTypeIds.HasComponent, - GetTypeObject().NodeId, modellingRule: modellingRule); - - if (mode == CreateMode.Instance) - { - // access - if (asset == null) - return null; - - // register node record - this.entityBuilder.AddNodeRecord(new AasEntityBuilder.NodeRecord(o, asset.GlobalAssetId)); - // dead-csharp off - // Referable - // this.entityBuilder.AasTypes.Referable.CreateAddElements(o, CreateMode.Instance, asset); - // Identifiable (V3.0: not anymore) - // this.entityBuilder.AasTypes.Identification.CreateAddElements( - // o, CreateMode.Instance, asset.identification); - // this.entityBuilder.AasTypes.Administration.CreateAddElements( - // o, CreateMode.Instance, asset.administration); - - // HasKind - this.entityBuilder.AasTypes.AssetKind.CreateAddElements(o, CreateMode.Instance, asset.AssetKind); - - // own attributes - //this.entityBuilder.AasTypes.Reference.CreateAddElements( - // o, CreateMode.Instance, asset.assetIdentificationModelRef, "AssetIdentificationModel"); - // dead-csharp on - } - - return o; - } - } - - public class AasUaEntityAAS : AasUaBaseEntity - { - public AasUaEntityAAS(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASAssetAdministrationShellType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:AssetAdministrationShell"); - - // interface - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObject, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - - // add necessary type information - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements(this.typeObject, CreateMode.Type); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Administration.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // HasDataSpecification - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "DataSpecification", modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - - // own attributes - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "DerivedFrom", modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // assets - this.entityBuilder.AasTypes.Asset.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - // associated submodels - this.entityBuilder.AasTypes.Submodel.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - } - - public NodeState CreateAddInstanceObject(NodeState parent, - Aas.Environment env, Aas.IAssetAdministrationShell aas) - { - // access - if (env == null || aas == null) - return null; - - // containing element - string extraName = null; - string browseName = "AssetAdministrationShell"; - if (aas.IdShort != null && aas.IdShort.Trim().Length > 0) - { - extraName = "AssetAdministrationShell:" + aas.IdShort; - browseName = aas.IdShort; - } - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, - browseName, ReferenceTypeIds.HasComponent, - GetTypeObject().NodeId, extraName: extraName); - - // register node record - this.entityBuilder.AddNodeRecord(new AasEntityBuilder.NodeRecord(o, aas)); - - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements(o, CreateMode.Instance, aas); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements( - o, CreateMode.Instance, aas.Id); - this.entityBuilder.AasTypes.Administration.CreateAddElements( - o, CreateMode.Instance, aas.Administration); - // HasDataSpecification - if (aas.EmbeddedDataSpecifications != null) - foreach (var ds in aas.EmbeddedDataSpecifications) - this.entityBuilder.AasTypes.Reference.CreateAddElements( - o, CreateMode.Instance, ds?.DataSpecification, "DataSpecification"); - // own attributes - this.entityBuilder.AasTypes.Reference.CreateAddElements( - o, CreateMode.Instance, aas.DerivedFrom, "DerivedFrom"); - - // associated asset - // TODO (??, 0000-00-00): AssetInformation - // dead-csharp off - //if (aas.assetRef != null) - //{ - // var asset = env.FindAsset(aas.assetRef); - // if (asset != null) - // this.entityBuilder.AasTypes.Asset.CreateAddElements( - // o, CreateMode.Instance, asset); - //} - // dead-csharp on - // associated submodels - if (aas.Submodels != null) - foreach (var smr in aas.Submodels) - { - var sm = env.FindSubmodel(smr); - if (sm != null) - this.entityBuilder.AasTypes.Submodel.CreateAddElements( - o, CreateMode.Instance, sm); - } - - // results - return o; - } - } - - public class AasUaEntitySubmodel : AasUaBaseEntity - { - public AasUaEntitySubmodel(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASSubmodelType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:Submodel"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObject, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - - // add some elements - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements(this.typeObject, CreateMode.Type); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Administration.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // HasSemantics - this.entityBuilder.AasTypes.SemanticId.CreateAddInstanceObject(this.typeObject, CreateMode.Type, null, - "SemanticId", modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // HasKind - this.entityBuilder.AasTypes.ModelingKind.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - // HasDataSpecification - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "DataSpecification", modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - // Qualifiable - this.entityBuilder.AasTypes.Qualifier.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - // SubmodelElements - this.entityBuilder.AasTypes.SubmodelWrapper.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.ISubmodel sm = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - - if (mode == CreateMode.Type) - { - // create only containing element with generic name - var o = this.entityBuilder.CreateAddObject(parent, mode, "Submodel", ReferenceTypeIds.HasComponent, - this.GetTypeNodeId(), modellingRule: modellingRule); - return o; - } - else - { - // access - if (sm == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, mode, - "" + sm.IdShort, ReferenceTypeIds.HasComponent, - GetTypeObject().NodeId, extraName: "Submodel:" + sm.IdShort); - - // register node record - this.entityBuilder.AddNodeRecord(new AasEntityBuilder.NodeRecord(o, sm)); - - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements( - o, CreateMode.Instance, sm); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements( - o, CreateMode.Instance, sm.Id); - this.entityBuilder.AasTypes.Administration.CreateAddElements( - o, CreateMode.Instance, sm.Administration); - // HasSemantics - this.entityBuilder.AasTypes.SemanticId.CreateAddInstanceObject( - o, CreateMode.Instance, sm.SemanticId, "SemanticId"); - // HasKind - this.entityBuilder.AasTypes.ModelingKind.CreateAddElements( - o, CreateMode.Instance, sm.Kind); - // HasDataSpecification - if (sm.EmbeddedDataSpecifications != null) - foreach (var ds in sm.EmbeddedDataSpecifications) - this.entityBuilder.AasTypes.Reference.CreateAddElements( - o, CreateMode.Instance, ds?.DataSpecification, "DataSpecification"); - // Qualifiable - if (sm.Qualifiers != null) - foreach (var q in sm.Qualifiers) - this.entityBuilder.AasTypes.Qualifier.CreateAddElements( - o, CreateMode.Instance, q); - - // SubmodelElements - if (sm.SubmodelElements != null) - foreach (var smw in sm.SubmodelElements) - this.entityBuilder.AasTypes.SubmodelWrapper.CreateAddElements( - o, CreateMode.Instance, smw); - - // result - return o; - } - } - } - - /// - /// This class is for the representation if SME in UA namespace - /// - public class AasUaEntitySubmodelElement : AasUaBaseEntity - { - public AasUaEntitySubmodelElement(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASSubmodelElementType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:SubmodelElement"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObject, false, - this.entityBuilder.AasTypes.IAASReferableType.GetTypeNodeId()); - - // add some elements to the type - // Note: in this special case, the instance elements are populated by AasUaEntitySubmodelElementBase, - // while the elements - // for the type are populated here - - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements(this.typeObject, CreateMode.Type); - // HasSemantics - this.entityBuilder.AasTypes.SemanticId.CreateAddInstanceObject(this.typeObject, CreateMode.Type, null, - "SemanticId", modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // HasKind - this.entityBuilder.AasTypes.ModelingKind.CreateAddElements(this.typeObject, CreateMode.Type, null, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - // HasDataSpecification - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "DataSpecification", modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - // Qualifiable - this.entityBuilder.AasTypes.Qualifier.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - } - } - - /// - /// This class is the base class of derived properties - /// - public class AasUaEntitySubmodelElementBase : AasUaBaseEntity - { - public AasUaEntitySubmodelElementBase(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // do NOT create type object, as this is done by sub-class - } - - public NodeState PopulateInstanceObject(NodeState o, Aas.ISubmodelElement sme) - { - // access - if (o == null || sme == null) - return null; - - // take this as perfect opportunity to register node record - this.entityBuilder.AddNodeRecord(new AasEntityBuilder.NodeRecord(o, sme)); - - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements( - o, CreateMode.Instance, sme); - // HasSemantics - this.entityBuilder.AasTypes.SemanticId.CreateAddInstanceObject( - o, CreateMode.Instance, sme.SemanticId, "SemanticId"); - // HasDataSpecification - if (sme.EmbeddedDataSpecifications != null) - foreach (var ds in sme.EmbeddedDataSpecifications) - this.entityBuilder.AasTypes.Reference.CreateAddElements( - o, CreateMode.Instance, ds?.DataSpecification, "DataSpecification"); - // Qualifiable - if (sme.Qualifiers != null) - foreach (var q in sme.Qualifiers) - this.entityBuilder.AasTypes.Qualifier.CreateAddElements( - o, CreateMode.Instance, q); - - // result - return o; - } - } - - /// - /// This class will automatically instantiate the correct SubmodelElement entity. - /// - public class AasUaEntitySubmodelWrapper : AasUaBaseEntity - { - public AasUaEntitySubmodelWrapper(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // do NOT create type object, as this is done by sub-class - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, - Aas.ISubmodelElement smw = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - // access - if (parent == null) - return null; - - if (mode == CreateMode.Type) - { - // create only containing element (base type) with generic name - var o = this.entityBuilder.CreateAddObject(parent, mode, - "SubmodelElement", ReferenceTypeIds.HasComponent, - this.entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), modellingRule: modellingRule); - return o; - } - else - { - if (smw == null) - return null; - - if (smw is Aas.ISubmodelElementCollection coll) - return this.entityBuilder.AasTypes.Collection.CreateAddInstanceObject(parent, coll); - else if (smw is Aas.ISubmodelElementList list) - return this.entityBuilder.AasTypes.SmeList.CreateAddInstanceObject(parent, list); - else if (smw is Aas.IProperty) - return this.entityBuilder.AasTypes.Property.CreateAddInstanceObject( - parent, smw as Aas.IProperty); - else if (smw is Aas.IFile) - return this.entityBuilder.AasTypes.File.CreateAddInstanceObject( - parent, smw as Aas.IFile); - else if (smw is Aas.IBlob) - return this.entityBuilder.AasTypes.Blob.CreateAddInstanceObject( - parent, smw as Aas.IBlob); - else if (smw is Aas.IReferenceElement) - return this.entityBuilder.AasTypes.ReferenceElement.CreateAddInstanceObject( - parent, smw as Aas.IReferenceElement); - else if (smw is Aas.IRelationshipElement) - return this.entityBuilder.AasTypes.RelationshipElement.CreateAddInstanceObject( - parent, smw as Aas.IRelationshipElement); - else if (smw is Aas.IOperation) - return this.entityBuilder.AasTypes.Operation.CreateAddInstanceObject( - parent, smw as Aas.IOperation); - - // nope - return null; - } - } - } - - public class AasUaEntityProperty : AasUaEntitySubmodelElementBase - { - public AasUaEntityProperty(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType( - "AASPropertyType", entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:Property"); - - // elements not in the base type - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Instance, null, - "ValueId", modellingRule: AasUaNodeHelper.ModellingRule.Optional); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "ValueType", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Value", - DataTypeIds.BaseDataType, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IProperty prop) - { - // access - if (prop == null) - return null; - - // for all - var mode = CreateMode.Instance; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, mode, "" + prop.IdShort, ReferenceTypeIds.HasComponent, - GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, prop); - - // TODO (MIHO, 2020-08-06): not sure if to add these - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, CreateMode.Instance, prop.ValueId, "ValueId"); - this.entityBuilder.CreateAddPropertyState(o, mode, "ValueType", - DataTypeIds.String, "" + prop.ValueType, defaultSettings: true); - - // aim is to support many types natively - - if (prop.ValueType == DataTypeDefXsd.Boolean) - { - var x = (prop.Value ?? "").ToLower().Trim(); - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Boolean, x == "true", defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.DateTime - || prop.ValueType == DataTypeDefXsd.Date - || prop.ValueType == DataTypeDefXsd.Time) - { - if (DateTime.TryParse(prop.Value, CultureInfo.InvariantCulture, - DateTimeStyles.AssumeUniversal, out var dt)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.DateTime, dt.ToFileTimeUtc(), defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.Decimal - || prop.ValueType == DataTypeDefXsd.Integer - || prop.ValueType == DataTypeDefXsd.Long - || prop.ValueType == DataTypeDefXsd.NegativeInteger) - { - if (Int64.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Int64, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.Int) - { - if (Int32.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Int32, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.Short) - { - if (Int16.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Int16, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.Byte) - { - if (SByte.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Byte, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.NonNegativeInteger - || prop.ValueType == DataTypeDefXsd.PositiveInteger - || prop.ValueType == DataTypeDefXsd.UnsignedLong) - { - if (UInt64.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.UInt64, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.UnsignedInt) - { - if (UInt32.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.UInt32, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.UnsignedShort) - { - if (UInt16.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.UInt16, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.UnsignedByte) - { - if (Byte.TryParse(prop.Value, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Byte, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.Double) - { - if (double.TryParse(prop.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Double, v, defaultSettings: true); - } - else if (prop.ValueType == DataTypeDefXsd.Float) - { - if (float.TryParse(prop.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var v)) - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.Float, v, defaultSettings: true); - } - else - { - // leave in string - this.entityBuilder.CreateAddPropertyState(o, mode, "Value", - DataTypeIds.String, prop.Value, defaultSettings: true); - } - - // result - return o; - } - } - - public class AasUaEntityCollection : AasUaEntitySubmodelElementBase - { - public NodeState typeObjectOrdered = null; - - public AasUaEntityCollection(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - // TODO (MIHO, 2020-08-06): use the collection element of UA? - this.typeObject = this.entityBuilder.CreateAddObjectType("AASSubmodelElementCollectionType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:SubmodelElementCollection"); - this.typeObjectOrdered = this.entityBuilder.CreateAddObjectType("AASSubmodelElementOrderedCollectionType", - this.GetTypeNodeId(), preferredTypeNumId + 1, - descriptionKey: "AAS:SubmodelElementCollection"); - - // some elements - // ReSharper disable once RedundantExplicitArrayCreation - foreach (var o in new NodeState[] { this.typeObject /* , this.typeObjectOrdered */ }) - { - this.entityBuilder.CreateAddPropertyState(o, CreateMode.Type, "AllowDuplicates", - DataTypeIds.Boolean, false, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - } - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.ISubmodelElementCollection coll) - { - // access - if (coll == null) - return null; - // dead-csharp off - // containing element - var to = GetTypeObject().NodeId; - //if (coll.ordered && this.typeObjectOrdered != null) - // to = this.typeObjectOrdered.NodeId; - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, - "" + coll.IdShort, ReferenceTypeIds.HasComponent, to); - - // populate common attributes - base.PopulateInstanceObject(o, coll); - - // own attributes - //this.entityBuilder.CreateAddPropertyState(o, CreateMode.Instance, "AllowDuplicates", - // DataTypeIds.Boolean, coll.AllowDuplicates, defaultSettings: true); - // dead-csharp on - // values - if (coll.Value != null) - foreach (var smw in coll.Value) - this.entityBuilder.AasTypes.SubmodelWrapper.CreateAddElements( - o, CreateMode.Instance, smw); - - // result - return o; - } - } - - public class AasUaEntitySmeList : AasUaEntitySubmodelElementBase - { - public NodeState typeObjectOrdered = null; - - public AasUaEntitySmeList(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASSubmodelElementListType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:SubmodelElementList"); - this.typeObjectOrdered = this.entityBuilder.CreateAddObjectType("AASSubmodelElementOrderedListType", - this.GetTypeNodeId(), preferredTypeNumId + 1, - descriptionKey: "AAS:SubmodelElementList"); - - // some elements - // ReSharper disable once RedundantExplicitArrayCreation - foreach (var o in new NodeState[] { this.typeObject /* , this.typeObjectOrdered */ }) - { - this.entityBuilder.CreateAddPropertyState(o, CreateMode.Type, "AllowDuplicates", - DataTypeIds.Boolean, false, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - } - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.ISubmodelElementList list) - { - // access - if (list == null) - return null; - - // containing element - var to = GetTypeObject().NodeId; - if (list.OrderRelevant.HasValue && list.OrderRelevant.Value && this.typeObjectOrdered != null) - to = this.typeObjectOrdered.NodeId; - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, - "" + list.IdShort, ReferenceTypeIds.HasComponent, to); - - // populate common attributes - base.PopulateInstanceObject(o, list); - - // own attributes - // dead-csharp off - //this.entityBuilder.CreateAddPropertyState(o, CreateMode.Instance, "AllowDuplicates", - // DataTypeIds.Boolean, coll.AllowDuplicates, defaultSettings: true); - // dead-csharp on - // values - if (list.Value != null) - foreach (var smw in list.Value) - this.entityBuilder.AasTypes.SubmodelWrapper.CreateAddElements( - o, CreateMode.Instance, smw); - - // result - return o; - } - } - - public class AasUaEntityFile : AasUaEntitySubmodelElementBase - { - public AasUaEntityFile(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASFileType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), - preferredTypeNumId, descriptionKey: "AAS:File"); - - // some elements - this.entityBuilder.CreateAddPropertyState( - this.typeObject, CreateMode.Type, "MimeType", - (this.entityBuilder.theServerOptions?.SimpleDataTypes == true) - ? DataTypeIds.String - : this.entityBuilder.AasTypes.MimeType.GetTypeNodeId(), - null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - - this.entityBuilder.CreateAddPropertyState( - this.typeObject, CreateMode.Type, "Value", - (true == this.entityBuilder?.theServerOptions?.SimpleDataTypes) - ? DataTypeIds.String - : this.entityBuilder.AasTypes.PathType.GetTypeNodeId(), - null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - - this.entityBuilder.AasTypes.FileType.CreateAddElements(this.typeObject, CreateMode.Type); - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IFile file) - { - // access - if (file == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, "" + file.IdShort, - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, file); - - // own attributes - this.entityBuilder.CreateAddPropertyState( - o, CreateMode.Instance, "MimeType", - (this.entityBuilder.theServerOptions?.SimpleDataTypes == true) - ? DataTypeIds.String - : this.entityBuilder.AasTypes.MimeType.GetTypeNodeId(), - file.ContentType, defaultSettings: true); - this.entityBuilder.CreateAddPropertyState( - o, CreateMode.Instance, "Value", - (true == this.entityBuilder?.theServerOptions?.SimpleDataTypes) - ? DataTypeIds.String - : this.entityBuilder.AasTypes.PathType.GetTypeNodeId(), - file.Value, defaultSettings: true); - - // wonderful working - if (this.entityBuilder.AasTypes.FileType.CheckSuitablity(this.entityBuilder.package, file)) - this.entityBuilder.AasTypes.FileType.CreateAddElements( - o, CreateMode.Instance, this.entityBuilder.package, file); - - // result - return o; - } - } - - public class AasUaEntityBlob : AasUaEntitySubmodelElementBase - { - public AasUaEntityBlob(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASBlobType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:Blob"); - - // some elements - this.entityBuilder.CreateAddPropertyState( - this.typeObject, CreateMode.Type, "MimeType", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, "Value", - DataTypeIds.String, null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IBlob blob) - { - // access - if (blob == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, "" + blob.IdShort, - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, blob); - - // own attributes - this.entityBuilder.CreateAddPropertyState( - o, CreateMode.Instance, "ContentType", - DataTypeIds.String, blob.ContentType, defaultSettings: true); - this.entityBuilder.CreateAddPropertyState(o, CreateMode.Instance, "Value", - DataTypeIds.String, System.Text.Encoding.UTF8.GetString(blob.Value), defaultSettings: true); - - // result - return o; - } - } - - public class AasUaEntityReferenceElement : AasUaEntitySubmodelElementBase - { - public AasUaEntityReferenceElement(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASReferenceElementType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:ReferenceElement"); - - // some elements - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, "Value", - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IReferenceElement refElem) - { - // access - if (refElem == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, "" + refElem.IdShort, - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, refElem); - - // own attributes - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, CreateMode.Instance, refElem.Value, "Value"); - - // result - return o; - } - } - - public class AasUaEntityRelationshipElement : AasUaEntitySubmodelElementBase - { - public AasUaEntityRelationshipElement(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASRelationshipElementType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:RelationshipElement"); - - // some elements - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "First", modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "Second", modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IRelationshipElement relElem) - { - // access - if (relElem == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, "" + relElem.IdShort, - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, relElem); - - // own attributes - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, CreateMode.Instance, relElem.First, "First"); - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, CreateMode.Instance, relElem.Second, "Second"); - - // result - return o; - } - } - - public class AasUaEntityOperationVariable : AasUaEntitySubmodelElementBase - { - public AasUaEntityOperationVariable(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("OperationVariableType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:OperationVariable"); - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IOperationVariable opvar) - { - // access - if (opvar == null || opvar.Value == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, - "" + opvar.Value.IdShort, - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, opvar.Value); - - // own attributes - this.entityBuilder.AasTypes.SubmodelWrapper.CreateAddElements(o, CreateMode.Instance, opvar.Value); - - // result - return o; - } - } - - public class AasUaEntityOperation : AasUaEntitySubmodelElementBase - { - public AasUaEntityOperation(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASOperationType", - entityBuilder.AasTypes.SubmodelElement.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:Operation"); - - // indicate the Operation - this.entityBuilder.CreateAddMethodState(this.typeObject, CreateMode.Type, "Operation", - inputArgs: null, - outputArgs: null, - referenceTypeFromParentId: ReferenceTypeIds.HasComponent); - - // some elements - for (int i = 0; i < 2; i++) - { - var o2 = this.entityBuilder.CreateAddObject(this.typeObject, CreateMode.Type, (i == 0) ? "in" : "out", - ReferenceTypeIds.HasComponent, - this.entityBuilder.AasTypes.OperationVariable.GetTypeObject().NodeId); - this.entityBuilder.AasTypes.OperationVariable.CreateAddInstanceObject(o2, null); - } - } - - public NodeState CreateAddInstanceObject(NodeState parent, Aas.IOperation op) - { - // access - if (op == null) - return null; - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, CreateMode.Instance, - "" + op.IdShort, - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - - // populate common attributes - base.PopulateInstanceObject(o, op); - - // own AAS attributes (in/out op vars) - for (int i = 0; i < 2; i++) - { - var opvarList = op.GetVars((OperationVariableDirection)i); - if (opvarList != null && opvarList.Count > 0) - { - var o2 = this.entityBuilder.CreateAddObject(o, - CreateMode.Instance, - (i == 0) ? "OperationInputVariables" : "OperationOutputVariables", - ReferenceTypeIds.HasComponent, GetTypeObject().NodeId); - foreach (var opvar in opvarList) - if (opvar != null && opvar.Value != null) - this.entityBuilder.AasTypes.SubmodelWrapper.CreateAddElements( - o2, CreateMode.Instance, opvar.Value); - } - } - - // create a method? - if (true) - { - // ReSharper disable once RedundantExplicitArrayCreation - var args = new List[] { new List(), new List() }; - for (int i = 0; i < 2; i++) - { - var opList = op.GetVars((OperationVariableDirection)i); - if (opList != null) - foreach (var opvar in opList) - { - // TODO (MIHO, 2020-08-06): decide to from where the name comes - var name = "noname"; - - // TODO (MIHO, 2020-08-06): description: get "en" version which is appropriate? - LocalizedText desc = new LocalizedText(""); - - // TODO (MIHO, 2020-08-06): parse UA data type out .. OK? - NodeId dataType = null; - if (opvar.Value != null) - { - // better name .. but not best (see below) - if (opvar.Value.IdShort != null - && opvar.Value.IdShort.Trim() != "") - name = "" + opvar.Value.IdShort; - - // TODO (MIHO, 2020-08-06): description: get "en" version is appropriate? - desc = AasUaUtils.GetBestUaDescriptionFromAasDescription( - opvar.Value.Description); - - // currenty, only accept properties as in/out arguments. - // Only these have an XSD value type!! - var prop = opvar.Value as Aas.IProperty; - if (prop != null) - { - // TODO (MIHO, 2020-08-06): this any better? - if (prop.IdShort != null && prop.IdShort.Trim() != "") - name = "" + prop.IdShort; - - // TODO (MIHO, 2020-08-06): description: get "en" version is appropriate? - if (desc.Text == null || desc.Text == "") - desc = AasUaUtils.GetBestUaDescriptionFromAasDescription( - opvar.Value.Description); - - // try convert type - if (!AasUaUtils.AasValueTypeToUaDataType( - prop.ValueType, out var dummy, out dataType)) - dataType = null; - } - } - if (dataType == null) - continue; - - var a = new Argument(name, dataType, -1, desc.Text ?? ""); - args[i].Add(a); - } - } - - var unused = this.entityBuilder.CreateAddMethodState(o, CreateMode.Instance, "Operation", - inputArgs: args[0].ToArray(), - outputArgs: args[1].ToArray(), - referenceTypeFromParentId: ReferenceTypeIds.HasComponent); - } - - // result - return o; - } - } - - public class AasUaEntityDataSpecification : AasUaBaseEntity - { - public AasUaEntityDataSpecification(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASDataSpecificationType", - ObjectTypeIds.BaseObjectType, preferredTypeNumId, descriptionKey: "AAS:DataSpecification"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObject, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - } - - } - - public class AasUaEntityDataSpecificationIEC61360 : AasUaBaseEntity - { - public AasUaEntityDataSpecificationIEC61360(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("AASDataSpecificationIEC61360Type", - this.entityBuilder.AasTypes.DataSpecification.GetTypeNodeId(), preferredTypeNumId, - descriptionKey: "AAS:DataSpecificationIEC61360"); - - // very special rule here for the Identifiable - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObject, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - this.entityBuilder.AasTypes.Referable.CreateAddElements(this.typeObject, CreateMode.Type); - this.entityBuilder.AasTypes.Identification.CreateAddElements(this.typeObject, CreateMode.Instance, - "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360", - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Administration.CreateAddElements(this.typeObject, CreateMode.Instance, - new Aas.AdministrativeInformation(version: "1", revision: "0"), - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - - // add some more elements - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "PreferredName", - DataTypeIds.LocalizedText, - value: null, defaultSettings: true, valueRank: 1, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "ShortName", - DataTypeIds.String, value: null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "Unit", - DataTypeIds.String, value: null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - - this.entityBuilder.AasTypes.Reference.CreateAddElements(this.typeObject, CreateMode.Type, null, - "UnitId", - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "SourceOfDefinition", - DataTypeIds.LocalizedText, - value: null, defaultSettings: true, valueRank: 1, - modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "Symbol", DataTypeIds.String, - value: null, defaultSettings: true, modellingRule: AasUaNodeHelper.ModellingRule.Optional); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "DataType", DataTypeIds.String, - value: null, defaultSettings: true, modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "Definition", - DataTypeIds.LocalizedText, value: null, defaultSettings: true, valueRank: 1, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - - this.entityBuilder.CreateAddPropertyState(this.typeObject, CreateMode.Type, - "ValueFormat", - DataTypeIds.String, value: null, defaultSettings: true, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, - Aas.IDataSpecificationIec61360 ds = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - - // for the sake of clarity, we're directly splitting cases - if (mode == CreateMode.Type) - { - // containing element (only) - var o = this.entityBuilder.CreateAddObject(parent, mode, "DataSpecificationIec61360", - this.entityBuilder.AasTypes.HasAddIn.GetTypeNodeId(), GetTypeObject().NodeId, - modellingRule: modellingRule); - return o; - } - else - { - // access - if (ds == null) - return null; - - // we can only provide minimal unique naming - var name = "DataSpecificationIEC61360"; - if (ds.PreferredName != null && this.entityBuilder.RootDataSpecifications != null) - name += "_" + ds.PreferredName; - - // containing element (depending on root folder) - NodeState o = null; - if (this.entityBuilder.RootDataSpecifications != null) - { - // under common folder - o = this.entityBuilder.CreateAddObject(this.entityBuilder.RootDataSpecifications, mode, name, - ReferenceTypeIds.Organizes, GetTypeObject().NodeId); - // link to this object - parent.AddReference(this.entityBuilder.AasTypes.HasAddIn.GetTypeNodeId(), false, o.NodeId); - } - else - { - // under parent - o = this.entityBuilder.CreateAddObject(parent, mode, name, - this.entityBuilder.AasTypes.HasAddIn.GetTypeNodeId(), GetTypeObject().NodeId); - } - - // add some elements - if (ds.PreferredName != null && ds.PreferredName.Count > 0) - this.entityBuilder.CreateAddPropertyState(o, mode, "PreferredName", - DataTypeIds.LocalizedText, - value: AasUaUtils.GetUaLocalizedTexts(ds.PreferredName), - defaultSettings: true, valueRank: 1); - - if (ds.ShortName != null && ds.ShortName.Count > 0) - this.entityBuilder.CreateAddPropertyState(o, mode, "ShortName", - DataTypeIds.LocalizedText, - value: AasUaUtils.GetUaLocalizedTexts(ds.ShortName), - defaultSettings: true, valueRank: 1); - - if (ds.Unit != null) - this.entityBuilder.CreateAddPropertyState(o, mode, "Unit", - DataTypeIds.String, value: ds.Unit, defaultSettings: true); - - if (ds.UnitId != null) - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, mode, - ds.UnitId, "UnitId"); - - if (ds.SourceOfDefinition != null) - this.entityBuilder.CreateAddPropertyState(o, mode, "SourceOfDefinition", - DataTypeIds.String, value: ds.SourceOfDefinition, defaultSettings: true); - - if (ds.Symbol != null) - this.entityBuilder.CreateAddPropertyState(o, mode, "Symbol", - DataTypeIds.String, value: ds.Symbol, defaultSettings: true); - - if (ds.DataType != null) - this.entityBuilder.CreateAddPropertyState(o, mode, "DataType", - DataTypeIds.String, value: Stringification.ToString(ds.DataType.Value), - defaultSettings: true); - - if (ds.Definition != null && ds.Definition.Count > 0) - this.entityBuilder.CreateAddPropertyState(o, mode, "Definition", - DataTypeIds.LocalizedText, value: AasUaUtils.GetUaLocalizedTexts(ds.Definition), - defaultSettings: true, valueRank: 1); - - if (ds.ValueFormat != null) - this.entityBuilder.CreateAddPropertyState(o, mode, "ValueFormat", - DataTypeIds.String, value: ds.ValueFormat, defaultSettings: true); - - // return - return o; - } - } - } - - public class AasUaEntityConceptDescription : AasUaBaseEntity - { - public NodeState typeObjectIrdi; - public NodeState typeObjectUri; - public NodeState typeObjectCustom; - - - public AasUaEntityConceptDescription(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - // TODO (MIHO, 2020-08-06): check, if to make super classes for UriDictionaryEntryType? - this.typeObjectIrdi = this.entityBuilder.CreateAddObjectType("AASIrdiConceptDescriptionType", - this.entityBuilder.AasTypes.IrdiDictionaryEntryType.GetTypeNodeId(), 0, - descriptionKey: "AAS:ConceptDescription"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObjectIrdi, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - - this.typeObjectUri = this.entityBuilder.CreateAddObjectType("AASUriConceptDescriptionType", - this.entityBuilder.AasTypes.UriDictionaryEntryType.GetTypeNodeId(), 0, - descriptionKey: "AAS:ConceptDescription"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObjectUri, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - - this.typeObjectCustom = this.entityBuilder.CreateAddObjectType("AASCustomConceptDescriptionType", - this.entityBuilder.AasTypes.DictionaryEntryType.GetTypeNodeId(), 0, - descriptionKey: "AAS:ConceptDescription"); - this.entityBuilder.AasTypes.HasInterface.CreateAddInstanceReference(this.typeObjectCustom, false, - this.entityBuilder.AasTypes.IAASIdentifiableType.GetTypeNodeId()); - - // for each of them, add some elements - // ReSharper disable once RedundantExplicitArrayCreation - foreach (var o in new NodeState[] { this.typeObjectIrdi, this.typeObjectUri, this.typeObjectCustom }) - { - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements(o, CreateMode.Type); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements(o, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Administration.CreateAddElements(o, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // IsCaseOf - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, CreateMode.Type, null, "IsCaseOf", - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - // HasDataSpecification - this.entityBuilder.AasTypes.Reference.CreateAddElements(o, CreateMode.Type, null, "DataSpecification", - modellingRule: AasUaNodeHelper.ModellingRule.OptionalPlaceholder); - - // data specification is a child - this.entityBuilder.AasTypes.DataSpecificationIEC61360.CreateAddElements(o, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.MandatoryPlaceholder); - } - } - - public NodeState GetTypeObjectFor(string id) - { - var to = this.typeObject; // shall be NULL - if (id?.HasContent() != true) - return to; - - var idt = ExtendKey.GuessIdType(id); - if (idt == ExtendKey.IdType.IRI) - to = this.typeObjectUri; - else if (idt == ExtendKey.IdType.IRDI) - to = this.typeObjectIrdi; - else - to = this.typeObjectCustom; - return to; - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, Aas.IConceptDescription cd = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None) - { - if (parent == null) - return null; - - // split directly because of complexity - if (mode == CreateMode.Type) - { - // not sure, if this will required, ever - return null; - } - else - { - // access - if (cd == null) - return null; - - // makeup name - var name = "ConceptDescription_" + Guid.NewGuid().ToString(); - - if (false) -#pragma warning disable 162 - // ReSharper disable HeuristicUnreachableCode - { - // Conventional approach: build up a speaking name - // but: shall be target of "HasDictionaryEntry", therefore the __PURE__ identifications - // need to be the name! - if (cd.GetIEC61360() != null) - { - var ds = cd.GetIEC61360(); - if (ds.ShortName != null) - name = ds.ShortName.GetDefaultString(); - if (cd.Id != null) - name += "_" + cd.Id; - } - name = AasUaUtils.ToOpcUaName(name); - } - // ReSharper enable HeuristicUnreachableCode -#pragma warning restore 162 - else - { - // only identification (the type object will distinct between the id type) - if (cd.Id != null) - name = cd.Id; - } - - // containing element - var o = this.entityBuilder.CreateAddObject(parent, mode, name, - ReferenceTypeIds.HasComponent, this.GetTypeObjectFor(cd.Id)?.NodeId, - modellingRule: modellingRule); - - // Referable - this.entityBuilder.AasTypes.Referable.CreateAddElements( - o, CreateMode.Instance, cd); - // Identifiable - this.entityBuilder.AasTypes.Identification.CreateAddElements( - o, CreateMode.Instance, cd.Id); - this.entityBuilder.AasTypes.Administration.CreateAddElements( - o, CreateMode.Instance, cd.Administration); - // IsCaseOf - if (cd.IsCaseOf != null) - foreach (var ico in cd.IsCaseOf) - this.entityBuilder.AasTypes.Reference.CreateAddElements( - o, CreateMode.Instance, ico, "IsCaseOf"); - - // HasDataSpecification solely under the viewpoint of IEC61360 - var eds = cd.EmbeddedDataSpecifications?.FindFirstIEC61360Spec(); - if (eds != null) - this.entityBuilder.AasTypes.Reference.CreateAddElements( - o, CreateMode.Instance, eds.DataSpecification, "DataSpecification"); - - // data specification is a child - var ds61360 = cd.EmbeddedDataSpecifications?.GetIEC61360Content(); - if (ds61360 != null) - { - var unused = this.entityBuilder.AasTypes.DataSpecificationIEC61360.CreateAddElements( - o, CreateMode.Instance, - ds61360); - } - - // remember CD as NodeRecord - this.entityBuilder.AddNodeRecord(new AasEntityBuilder.NodeRecord(o, cd.Id)); - - return o; - } - } - } - - // - // Elements from the UA spc - // - - public class AasUaNamespaceZeroEntity : AasUaBaseEntity - { - public AasUaNamespaceZeroEntity(AasEntityBuilder entityBuilder, uint presetNumId = 0) - : base(entityBuilder) - { - // just set node id based on existing knowledge - this.typeObjectId = new NodeId(presetNumId, 0); - } - } - - public class AasUaNamespaceZeroReference : AasUaBaseEntity - { - public AasUaNamespaceZeroReference(AasEntityBuilder entityBuilder, uint presetNumId = 0) - : base(entityBuilder) - { - // just set node id based on existing knowledge - this.typeObjectId = new NodeId(presetNumId, 0); - } - - public void CreateAddInstanceReference(NodeState source, bool isInverse, ExpandedNodeId target) - { - if (source != null && target != null && this.GetTypeNodeId() != null) - source.AddReference(this.GetTypeNodeId(), isInverse, target); - } - } - - // - // References - // - - public class AasUaReferenceHasAasReference : AasUaBaseEntity - { - public AasUaReferenceHasAasReference(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddReferenceType("AASReference", "AASReferencedBy", preferredTypeNumId, useZeroNS: false, extraSubtype: new NodeId(31, 0) /* request Florian */); - } - - public NodeState CreateAddInstanceReference(NodeState parent) - { - return null; - } - } - - - // - // Interfaces - // - - public class AasUaInterfaceAASIdentifiableType : AasUaBaseEntity - { - public AasUaInterfaceAASIdentifiableType(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("IAASIdentifiableType", - this.entityBuilder.AasTypes.IAASReferableType.GetTypeNodeId() /* ObjectTypeIds.BaseObjectType */, - preferredTypeNumId, descriptionKey: "AAS:Identifiable"); - - // add some elements - this.entityBuilder.AasTypes.Identification.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Mandatory); - this.entityBuilder.AasTypes.Administration.CreateAddElements(this.typeObject, CreateMode.Type, - modellingRule: AasUaNodeHelper.ModellingRule.Optional); - } - } - - public class AasUaInterfaceAASReferableType : AasUaBaseEntity - { - public AasUaInterfaceAASReferableType(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // create type object - this.typeObject = this.entityBuilder.CreateAddObjectType("IAASReferableType", - this.entityBuilder.AasTypes.BaseInterfaceType.GetTypeNodeId() /* ObjectTypeIds.BaseObjectType */, - preferredTypeNumId, descriptionKey: "AAS:Referable"); - - // some elements - this.entityBuilder.AasTypes.Referable.CreateAddElements(this.typeObject, CreateMode.Type); - } - } -} diff --git a/src/AasxUaNetServer/AasxServer/AasUaEntityFileType.cs b/src/AasxUaNetServer/AasxServer/AasUaEntityFileType.cs deleted file mode 100644 index 37f71d0c9..000000000 --- a/src/AasxUaNetServer/AasxServer/AasUaEntityFileType.cs +++ /dev/null @@ -1,392 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using AdminShellNS; -using Opc.Ua; -using System; -using System.Collections.Generic; -using System.IO; -using Aas = AasCore.Aas3_0; - -namespace AasOpcUaServer -{ - public class AasUaPackageFileHandler - { - private AdminShellPackageEnv _package = null; - private Aas.IFile _file = null; - - private class PackageFileHandle - { - public UInt32 handle = 0; - public UInt64 filepos = 0; - public Stream packStream = null; - - public int UaMode = 0; - public bool IsRead = true; - public bool IsWrite = true; - - public PackageFileHandle() { } - public PackageFileHandle(UInt32 handle) - { - this.handle = handle; - } - } - - private Dictionary handles = new Dictionary(); - - public AasUaPackageFileHandler(AdminShellPackageEnv package, Aas.IFile file) - { - this._package = package; - this._file = file; - } - - private UInt32 GetMaxHandle() - { - UInt32 mh = 0; - foreach (var x in handles.Keys) - mh = Math.Max(x, mh); - return mh; - } - - public UInt32 Open(Byte mode) - { - // access file handle - if (this._package == null || this._file == null) - throw new InvalidOperationException("no admin-shell package or file"); - var nh = GetMaxHandle() + 1; - var fh = new PackageFileHandle(nh); - fh.packStream = _package.GetLocalStreamFromPackage(_file.Value); - if (fh.packStream == null) - throw new InvalidOperationException("no admin-shell package or file"); - handles.Add(nh, fh); - - // care about the particularities of write - fh.UaMode = mode; - fh.IsRead = ((mode & 0x01) > 0); - fh.IsWrite = ((mode & 0x02) > 0); - if ((mode & 0x04) > 0) - { - // Erase existing - fh.packStream.Seek(0, SeekOrigin.Begin); - fh.packStream.SetLength(0); - fh.packStream.Flush(); - } - if ((mode & 0x08) > 0) - { - // Append - fh.packStream.Seek(0, SeekOrigin.End); - fh.packStream.Flush(); - } - - // done - return nh; - } - - public long GetLength(UInt32 handle) - { - if (!handles.ContainsKey(handle)) - throw new InvalidOperationException("handle is unknown"); - var h = handles[handle]; - return h.packStream.Length; - } - - public void Close(UInt32 handle) - { - if (!handles.ContainsKey(handle)) - throw new InvalidOperationException("handle is unknown"); - handles.Remove(handle); - } - - public void SetPosition(UInt32 handle, UInt64 pos) - { - if (!handles.ContainsKey(handle)) - throw new InvalidOperationException("handle is unknown"); - var h = handles[handle]; - h.filepos = pos; - } - - public UInt64 GetPosition(UInt32 handle) - { - if (!handles.ContainsKey(handle)) - throw new InvalidOperationException("handle is unknown"); - if (this._package == null || this._file == null) - throw new InvalidOperationException("no admin-shell package or file"); - var h = handles[handle]; - return h.filepos; - } - - public Byte[] Read(UInt32 handle, UInt32 readlen) - { - if (!handles.ContainsKey(handle)) - throw new InvalidOperationException("handle is unknown"); - if (this._package == null || this._file == null) - throw new InvalidOperationException("no admin-shell package or file"); - var h = handles[handle]; - if (h.packStream == null) - throw new InvalidOperationException("no open stream"); - if (h.filepos >= (ulong)h.packStream.Length) - throw new InvalidOperationException("invalid file position"); - - // Finding: 4.194.304 Bytes as requested by the UA Expert is too much - // Reduce zu 16bit Size, to show suitablility also for small devices - readlen = Math.Min(readlen, (2 << 15) - 1); - - byte[] res = new byte[readlen]; - h.packStream.Seek((long)h.filepos, SeekOrigin.Begin); - var redd = h.packStream.Read(res, 0, (int)readlen); - h.filepos += (UInt64)redd; - return res; - } - - public void Write(UInt32 handle, Byte[] data) - { - if (!handles.ContainsKey(handle)) - throw new InvalidOperationException("handle is unknown"); - if (this._package == null || this._file == null) - throw new InvalidOperationException("no admin-shell package or file"); - var h = handles[handle]; - if (h.packStream == null) - throw new InvalidOperationException("no open stream"); - - h.packStream.Write(data, 0, data.Length); - h.filepos += (ulong)data.Length; - } - } - - public class AasUaEntityFileType : AasUaBaseEntity - { - private class InstanceData - { - public AasUaPackageFileHandler packHandler = null; - public MethodState mOpen, mClose, mRead, mWrite, mSetPosition, mGetPosition; - public PropertyState nodeOpenCount = null; - public PropertyState nodeSize = null; - - public void UpdateSize(UInt64 size) - { - if (nodeSize != null) - nodeSize.Value = size; - } - } - - public AasUaEntityFileType(AasEntityBuilder entityBuilder, uint preferredTypeNumId = 0) - : base(entityBuilder) - { - // do NOT create type object, as they shall be all there in the UA constants - } - - /// - /// Checks, if a FileType node is advisable for representing an AASX file .. - /// Shall be TRUE for local, existing files .. - /// - /// - public bool CheckSuitablity(AdminShellPackageEnv package, Aas.IFile file) - { - // trivial - if (package == null || file == null) - return false; - - // try get a stream .. - Stream s = null; - try - { - s = package.GetLocalStreamFromPackage(file.Value); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - return false; - } - - // ok? - return s != null; - } - - public NodeState CreateAddElements(NodeState parent, CreateMode mode, - AdminShellPackageEnv package = null, Aas.IFile file = null) - { - // access - if (parent == null) - return null; - - // for sake of complexity, differentiate early - if (mode == CreateMode.Type) - { - var o = this.entityBuilder.CreateAddObject( - parent, mode, "File", ReferenceTypeIds.HasComponent, ObjectTypeIds.FileType); - return o; - } - else - { - if (package == null || file == null) - return null; - - var instData = new InstanceData(); - instData.packHandler = new AasUaPackageFileHandler(package, file); - - // containing element - var o = this.entityBuilder.CreateAddObject( - parent, mode, "File", ReferenceTypeIds.HasComponent, ObjectTypeIds.FileType); - - - // this first information is to provide a "off-the-shelf" size information; a Open() will re-new this - var fileLen = Convert.ToUInt64(package.GetStreamSizeFromPackage(file.Value)); - - // populate attributes from the spec - this.entityBuilder.CreateAddPropertyState(o, mode, "MimeType", - DataTypeIds.String, file.ContentType, ReferenceTypeIds.HasProperty, VariableTypeIds.PropertyType); - instData.nodeOpenCount = this.entityBuilder.CreateAddPropertyState(o, mode, "OpenCount", - DataTypeIds.UInt16, 0, ReferenceTypeIds.HasProperty, VariableTypeIds.PropertyType); - instData.nodeSize = this.entityBuilder.CreateAddPropertyState(o, mode, "Size", - DataTypeIds.UInt64, fileLen, ReferenceTypeIds.HasProperty, VariableTypeIds.PropertyType, - valueRank: -1); - this.entityBuilder.CreateAddPropertyState(o, mode, "UserWritable", - DataTypeIds.Boolean, true, ReferenceTypeIds.HasProperty, VariableTypeIds.PropertyType); - this.entityBuilder.CreateAddPropertyState(o, mode, "Writable", - DataTypeIds.Boolean, true, ReferenceTypeIds.HasProperty, VariableTypeIds.PropertyType); - - // Open - instData.mOpen = this.entityBuilder.CreateAddMethodState(o, mode, "Open", - inputArgs: new[] { - new Argument("Mode", DataTypeIds.Byte, -1, "") - }, - outputArgs: new[] { - new Argument("FileHandle", DataTypeIds.UInt32, -1, "") - }, referenceTypeFromParentId: ReferenceTypeIds.HasComponent, - methodDeclarationId: MethodIds.FileType_Open, onCalled: this.OnMethodCalled); - - this.entityBuilder.AddNodeStateAnnotation(instData.mOpen, instData); - - // Close - instData.mClose = this.entityBuilder.CreateAddMethodState(o, mode, "Close", - inputArgs: new[] { - new Argument("FileHandle", DataTypeIds.UInt32, -1, "") - }, - outputArgs: null, - referenceTypeFromParentId: ReferenceTypeIds.HasComponent, - methodDeclarationId: MethodIds.FileType_Close, onCalled: this.OnMethodCalled); - - this.entityBuilder.AddNodeStateAnnotation(instData.mClose, instData); - - // Read - instData.mRead = this.entityBuilder.CreateAddMethodState(o, mode, "Read", - inputArgs: new[] { - new Argument("FileHandle", DataTypeIds.UInt32, -1, ""), - new Argument("Length", DataTypeIds.Int32, -1, "") - }, - outputArgs: new[] { - new Argument("Data", DataTypeIds.ByteString, -1, "") - }, referenceTypeFromParentId: ReferenceTypeIds.HasComponent, - methodDeclarationId: MethodIds.FileType_Read, onCalled: this.OnMethodCalled); - - this.entityBuilder.AddNodeStateAnnotation(instData.mRead, instData); - - // Write - instData.mWrite = this.entityBuilder.CreateAddMethodState(o, mode, "Write", - inputArgs: new[] { - new Argument("FileHandle", DataTypeIds.UInt32, -1, ""), - new Argument("Data", DataTypeIds.ByteString, -1, "") - }, - outputArgs: null, - referenceTypeFromParentId: ReferenceTypeIds.HasComponent, - methodDeclarationId: MethodIds.FileType_Write, onCalled: this.OnMethodCalled); - - this.entityBuilder.AddNodeStateAnnotation(instData.mWrite, instData); - - // GetPosition - instData.mGetPosition = this.entityBuilder.CreateAddMethodState(o, mode, "GetPosition", - inputArgs: new[] { - new Argument("FileHandle", DataTypeIds.UInt32, -1, ""), - }, - outputArgs: new[] { - new Argument("Position", DataTypeIds.UInt64, -1, "") - }, - referenceTypeFromParentId: ReferenceTypeIds.HasComponent, - methodDeclarationId: MethodIds.FileType_GetPosition, onCalled: this.OnMethodCalled); - - this.entityBuilder.AddNodeStateAnnotation(instData.mGetPosition, instData); - - // SetPosition - instData.mSetPosition = this.entityBuilder.CreateAddMethodState(o, mode, "SetPosition", - inputArgs: new[] { - new Argument("FileHandle", DataTypeIds.UInt32, -1, ""), - new Argument("Position", DataTypeIds.UInt64, -1, "") - }, - outputArgs: null, - referenceTypeFromParentId: ReferenceTypeIds.HasComponent, - methodDeclarationId: MethodIds.FileType_SetPosition, onCalled: this.OnMethodCalled); - - this.entityBuilder.AddNodeStateAnnotation(instData.mSetPosition, instData); - - // result - return o; - } - } - - private ServiceResult OnMethodCalled( - ISystemContext context, - MethodState method, - IList inputArguments, - IList outputArguments) - { - var instData = this.entityBuilder.FindNoteStateAnnotation(method); - if (instData == null || instData.packHandler == null) - return new ServiceResult(StatusCodes.BadInvalidArgument); - - try - { - if (method == instData.mOpen) - { - var fh = instData.packHandler.Open((byte)inputArguments[0]); - instData.UpdateSize(Convert.ToUInt64(instData.packHandler.GetLength(fh))); - outputArguments[0] = fh; - } - - if (method == instData.mClose) - { - instData.packHandler.Close((UInt32)inputArguments[0]); - } - - if (method == instData.mSetPosition) - { - instData.packHandler.SetPosition((UInt32)inputArguments[0], (UInt64)inputArguments[1]); - } - - if (method == instData.mGetPosition) - { - outputArguments[0] = instData.packHandler.GetPosition((UInt32)inputArguments[0]); - } - - if (method == instData.mRead) - { - var data = instData.packHandler.Read( - Convert.ToUInt32(inputArguments[0]), Convert.ToUInt32(inputArguments[1])); - outputArguments[0] = data; - } - - if (method == instData.mWrite) - { - var fh = Convert.ToUInt32(inputArguments[0]); - instData.packHandler.Write(fh, (byte[])inputArguments[1]); - instData.UpdateSize(Convert.ToUInt64(instData.packHandler.GetLength(fh))); - } - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.Error(ex, "The method could not be executed."); - - // treat every exception the same - return new ServiceResult(StatusCodes.BadInvalidArgument); - } - - return new ServiceResult(StatusCodes.Good); - } - - } -} diff --git a/src/AasxUaNetServer/AasxServer/AasUaNodeHelper.cs b/src/AasxUaNetServer/AasxServer/AasUaNodeHelper.cs deleted file mode 100644 index 98c498f5e..000000000 --- a/src/AasxUaNetServer/AasxServer/AasUaNodeHelper.cs +++ /dev/null @@ -1,179 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using Opc.Ua; - -namespace AasOpcUaServer -{ - // ReSharper disable once ClassNeverInstantiated.Global - public class AasUaNodeHelper - { - /// - /// 4. The cardinality of an association or aggregation is specified via OPC Modelling rules. - /// The OPC modelling rule “Optional” is used if the cardinality is Zero or 1. - /// The OPC modelling rule “Mandatory” is used if the cardinality is One. - /// The OPC Modelling rule “OptionalPlaceholder” is used if the cardinality is zero, - /// one or more than one element. - /// The OPC Modelling rule “MandatoryPlaceholder” ” is used if the cardinality is one or more than one element. - /// - public enum ModellingRule { None, Optional, OptionalPlaceholder, Mandatory, MandatoryPlaceholder } - - /// - /// Try find out the Description for a certain AAS literal/ refSemantics - /// - public static LocalizedText SetLocalizedTextWithDescription(LocalizedText l, string key) - { - var dk = AasEntityDescriptions.LookupDescription(key); - - if (key != null) - { - l = new LocalizedText("en", dk); - } - - return l; - } - - /// - /// Appply modelling rule to an arbitrary node - /// - public static NodeState CheckSetModellingRule(ModellingRule modellingRule, NodeState o) - { - if (o == null || modellingRule == ModellingRule.None) - { - return o; - } - - if (modellingRule == ModellingRule.Optional) - { - o.AddReference(ReferenceTypeIds.HasModellingRule, false, ObjectIds.ModellingRule_Optional); - } - - if (modellingRule == ModellingRule.OptionalPlaceholder) - { - o.AddReference(ReferenceTypeIds.HasModellingRule, false, ObjectIds.ModellingRule_OptionalPlaceholder); - } - - if (modellingRule == ModellingRule.Mandatory) - { - o.AddReference(ReferenceTypeIds.HasModellingRule, false, ObjectIds.ModellingRule_Mandatory); - } - - if (modellingRule == ModellingRule.MandatoryPlaceholder) - { - o.AddReference(ReferenceTypeIds.HasModellingRule, false, ObjectIds.ModellingRule_MandatoryPlaceholder); - } - - return o; - } - - /// - /// Helper to create an ObjectType-Node. Note: __NO__ NodeId is created by the default! - /// Must be done by outer functionality!! - /// - /// Name displayed in the node tree - /// Base class or similar - /// Preset the NodeId - /// Lookup a Description on AAS literal/ refSemantics - /// Modeling Rule, if not None - /// THe node - public static BaseObjectTypeState CreateObjectType( - string browseDisplayName, - NodeId superTypeId, - NodeId presetNodeId = null, - string descriptionKey = null, - ModellingRule modellingRule = ModellingRule.None) - { - BaseObjectTypeState baseObjectType = new() - { - BrowseName = "" + browseDisplayName, - DisplayName = "" + browseDisplayName, - Description = SetLocalizedTextWithDescription(new LocalizedText("en", browseDisplayName), descriptionKey), - SuperTypeId = superTypeId - }; - - if (presetNodeId != null) - { - baseObjectType.NodeId = presetNodeId; - } - - CheckSetModellingRule(modellingRule, baseObjectType); - - return baseObjectType; - } - - /// - /// Helper to create an ReferenceType-Node. Note: __NO__ NodeId is created by the default! - /// Must be done by outer functionality!! - /// - /// Name displayed in the node tree - /// - /// Preset the NodeId - /// Preset the NodeId - /// - public static ReferenceTypeState CreateReferenceType( - string browseDisplayName, - string inverseName, - NodeId superTypeId, - NodeId presetNodeId = null) - { - ReferenceTypeState referenceType = new() - { - BrowseName = browseDisplayName, - DisplayName = browseDisplayName, - InverseName = inverseName, - Symmetric = false, - IsAbstract = false, - SuperTypeId = superTypeId - }; - - if (presetNodeId != null) - { - referenceType.NodeId = presetNodeId; - } - - return referenceType; - } - - /// - /// Helper to create an Object-Node. Note: __NO__ NodeId is created by the default! - /// Must be done by outer functionality!! - /// - /// Parent node - /// Name displayed in the node tree - /// Type of the Object - /// Modeling Rule, if not None - /// - /// The node - public static BaseObjectState CreateObject( - NodeState parent, - string browseDisplayName, - NodeId typeDefinitionId = null, - AasUaNodeHelper.ModellingRule modellingRule = AasUaNodeHelper.ModellingRule.None, - string extraName = null) - { - BaseObjectState baseObject = new(parent) - { - BrowseName = string.Empty + browseDisplayName, - DisplayName = string.Empty + browseDisplayName, - Description = new LocalizedText("en", string.Empty + browseDisplayName), - TypeDefinitionId = typeDefinitionId - }; - - if (extraName != null) - { - baseObject.DisplayName = extraName; - } - - CheckSetModellingRule(modellingRule, baseObject); - - return baseObject; - } - - } -} diff --git a/src/AasxUaNetServer/AasxServer/AasUaUtils.cs b/src/AasxUaNetServer/AasxServer/AasUaUtils.cs deleted file mode 100644 index 7f1867d38..000000000 --- a/src/AasxUaNetServer/AasxServer/AasUaUtils.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using AdminShellNS; -using Extensions; -using Opc.Ua; -using Aas = AasCore.Aas3_0; - -namespace AasOpcUaServer -{ - // ReSharper disable once ClassNeverInstantiated.Global - public class AasUaUtils - { - public static string ToOpcUaName(string input) - { - var clean = Regex.Replace(input, @"[^a-zA-Z0-9\-_]", "_"); - while (true) - { - var len0 = clean.Length; - clean = clean.Replace("__", "_"); - if (len0 == clean.Length) - break; - } - return clean; - } - - public static string ToOpcUaReference(Aas.IReference refid) - { - if (refid == null || refid.IsEmpty()) - return null; - - var semstr = ""; - foreach (var k in refid.Keys) - { - if (semstr != "") - semstr += ","; - semstr += String.Format("({0}){1}", k.Type, k.Value); - } - - return semstr; - } - - public static List ToOpcUaReferenceList(Aas.IReference refid) - { - if (refid == null || refid.IsEmpty()) - return null; - - var res = new List(); - foreach (var k in refid.Keys) - { - res.Add(String.Format("({0}){1}", k.Type, k.Value)); - } - - return res; - } - - public static LocalizedText[] GetUaLocalizedTexts(IList ls) - { - if (ls == null || ls.Count < 1) - return new[] { new LocalizedText("", "") }; - var res = new LocalizedText[ls.Count]; - for (int i = 0; i < ls.Count; i++) - res[i] = new LocalizedText(ls[i].Language, ls[i].Text); - return res; - } - - public static LocalizedText[] GetUaLocalizedTexts(IList ls) - { - if (ls == null || ls.Count < 1) - return new[] { new LocalizedText("", "") }; - var res = new LocalizedText[ls.Count]; - for (int i = 0; i < ls.Count; i++) - res[i] = new LocalizedText(ls[i].Language, ls[i].Text); - return res; - } - - public static LocalizedText[] GetUaLocalizedTexts(IList ls) - { - if (ls == null || ls.Count < 1) - return new[] { new LocalizedText("", "") }; - var res = new LocalizedText[ls.Count]; - for (int i = 0; i < ls.Count; i++) - res[i] = new LocalizedText(ls[i].Language, ls[i].Text); - return res; - } - - public static LocalizedText[] GetUaLocalizedTexts(IList ls) - { - if (ls == null || ls.Count < 1) - return new[] { new LocalizedText("", "") }; - var res = new LocalizedText[ls.Count]; - for (int i = 0; i < ls.Count; i++) - res[i] = new LocalizedText(ls[i].Language, ls[i].Text); - return res; - } - - public static LocalizedText GetBestUaDescriptionFromAasDescription(List desc) - { - var res = new LocalizedText("", ""); - if (desc != null) - { - var found = false; - foreach (var ls in desc) - if (!found || ls.Language.Trim().ToLower().StartsWith("en")) - { - found = true; - res = new LocalizedText(ls.Language, ls.Text); - } - } - return res; - } - - public static bool AasValueTypeToUaDataType( - Aas.DataTypeDefXsd valueType, out Type sharpType, out NodeId dataTypeId) - { - // defaults - sharpType = "".GetType(); - dataTypeId = DataTypeIds.String; - - // parse - if (valueType == Aas.DataTypeDefXsd.Boolean) - { - sharpType = typeof(bool); - dataTypeId = DataTypeIds.Boolean; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.DateTime - || valueType == Aas.DataTypeDefXsd.Date - || valueType == Aas.DataTypeDefXsd.Time) - { - sharpType = typeof(Int64); - dataTypeId = DataTypeIds.DateTime; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.Decimal - || valueType == Aas.DataTypeDefXsd.Integer - || valueType == Aas.DataTypeDefXsd.Long - || valueType == Aas.DataTypeDefXsd.NonPositiveInteger - || valueType == Aas.DataTypeDefXsd.NegativeInteger) - { - sharpType = typeof(Int64); - dataTypeId = DataTypeIds.Int64; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.Int) - { - sharpType = typeof(Int32); - dataTypeId = DataTypeIds.Int32; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.Short) - { - sharpType = typeof(Int16); - dataTypeId = DataTypeIds.Int16; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.Byte) - { - sharpType = typeof(SByte); - dataTypeId = DataTypeIds.Byte; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.NonNegativeInteger - || valueType == Aas.DataTypeDefXsd.PositiveInteger - || valueType == Aas.DataTypeDefXsd.UnsignedLong) - { - sharpType = typeof(UInt64); - dataTypeId = DataTypeIds.UInt64; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.UnsignedInt) - { - sharpType = typeof(UInt32); - dataTypeId = DataTypeIds.UInt32; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.UnsignedShort) - { - sharpType = typeof(UInt16); - dataTypeId = DataTypeIds.UInt16; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.UnsignedByte) - { - sharpType = typeof(Byte); - dataTypeId = DataTypeIds.Byte; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.Double) - { - sharpType = typeof(double); - dataTypeId = DataTypeIds.Double; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.Float) - { - sharpType = typeof(float); - dataTypeId = DataTypeIds.Float; - return true; - } - else if (valueType == Aas.DataTypeDefXsd.String) - { - sharpType = typeof(string); - dataTypeId = DataTypeIds.String; - return true; - } - - return false; - } - } -} diff --git a/src/AasxUaNetServer/AasxServer/AasxUaServerOptions.cs b/src/AasxUaNetServer/AasxServer/AasxUaServerOptions.cs deleted file mode 100644 index 22b4196c0..000000000 --- a/src/AasxUaNetServer/AasxServer/AasxUaServerOptions.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AasOpcUaServer -{ - public class AasxUaServerOptions - { - public enum JobType { None, ExportNodesetXml } - - /// - /// This file shall be loaded at start of application - /// - public string AasxToLoad = null; - - /// - /// Set special action/ job to be executed by server - /// - public JobType SpecialJob = JobType.None; - - /// - /// File Name for exporting - /// - public string ExportFilename = ""; - - /// - /// If not Null, the Namespace index of exported nodes need to be in the list. - /// - public List ExportFilterNamespaceIndex = null; - - /// - /// Serialize reference as single string object instead of list of strings. - /// Note: set to TRUE for open62541 node-set-compiler - /// - public bool ReferenceKeysAsSingleString = false; - - /// - /// Filter duplicated node-ids in th export. - /// Note: set to TRUE for open62541 node-set-compiler - /// - public bool FilterForSingleNodeIds = false; - - /// - /// If not null, then executed after finalizing special jobs. Will be set-up during initialization of server. - /// - public Action FinalizeAction = null; - - /// - /// If true, usage of customised data types will be reduced - /// - public bool SimpleDataTypes = false; - - /// - /// Set true, if descendants from "Object" (AASROOT, CDs) shall be linked as components, not - /// via Organizes - relationship. - /// - public bool LinkRootAsComponent = false; - - /// - /// Seemingly, in older versions, the dictionaries folder was missing - /// - public bool CeateDictionariesFolder = true; - - /// - /// Parse args given by command line or plug-in arguments - /// - public void ParseArgs(string[] args) - { - if (args == null) - return; - - for (int index = 0; index < args.Length; index++) - { - var arg = args[index].Trim().ToLower(); - var morearg = (args.Length - 1) - index; - - // flags - if (arg == "-single-keys") - { - ReferenceKeysAsSingleString = true; - continue; - } - - if (arg == "-single-nodeids") - { - FilterForSingleNodeIds = true; - continue; - } - - if (arg == "-simple-data-types") - { - SimpleDataTypes = true; - continue; - } - - if (arg == "-link-root-as-component") - { - LinkRootAsComponent = true; - continue; - } - - // options - if (arg == "-ns" && morearg > 0) - { - if (Int32.TryParse(args[index + 1], out var i)) - { - if (this.ExportFilterNamespaceIndex == null) - this.ExportFilterNamespaceIndex = new List(); - this.ExportFilterNamespaceIndex.Add((ushort)i); - } - index++; - continue; - } - if (arg == "-export-nodeset" && morearg > 0) - { - this.SpecialJob = JobType.ExportNodesetXml; - this.ExportFilename = args[index + 1]; - index++; - continue; - } - - // tail. last argument shall be file to load - if (System.IO.File.Exists(args[index])) - this.AasxToLoad = args[index]; - break; - } - } - } -} diff --git a/src/AasxUaNetServer/AasxUaNetServer.csproj b/src/AasxUaNetServer/AasxUaNetServer.csproj deleted file mode 100644 index 8ab6cade6..000000000 --- a/src/AasxUaNetServer/AasxUaNetServer.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - net6.0 - Library - true - false - false - - - - - - - - - - - - PreserveNewest - - - diff --git a/src/AasxUaNetServer/LICENSE.txt b/src/AasxUaNetServer/LICENSE.txt deleted file mode 100644 index 01f9cb5eb..000000000 --- a/src/AasxUaNetServer/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/AasxUaNetServer/Properties/AssemblyInfo.cs b/src/AasxUaNetServer/Properties/AssemblyInfo.cs deleted file mode 100644 index b50330fe2..000000000 --- a/src/AasxUaNetServer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("AasxUaNetServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AasxUaNetServer")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("c1e3f0d9-2bea-4668-aff4-454fdf527a58")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/AasxUaNetServer/SampleServer.cs b/src/AasxUaNetServer/SampleServer.cs deleted file mode 100644 index 91f3cca99..000000000 --- a/src/AasxUaNetServer/SampleServer.cs +++ /dev/null @@ -1,105 +0,0 @@ -// SOURCE: https://github.com/OPCFoundation/UA-.NETStandard/blob/1.4.355.26/SampleApplications/ -// Samples/Opc.Ua.Sample/SampleServer.cs - -/* ======================================================================== - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - * ======================================================================*/ - -// ReSharper disable all - -using System.Collections.Generic; -using System.Diagnostics; -using AdminShellNS; -using Opc.Ua; -using Opc.Ua.Server; - -namespace AasOpcUaServer -{ - /// - /// A class which implements an instance of a UA server. - /// - public partial class SampleServer : StandardServer - { - private AdminShellPackageEnv thePackageEnv = null; - private AasxUaServerOptions theServerOptions = null; - - public SampleServer(AdminShellPackageEnv env, AasxUaServerOptions serverOptions = null) - : base() - { - thePackageEnv = env; - theServerOptions = serverOptions; - } - - /// - /// Creates the node managers for the server. - /// - /// - /// This method allows the sub-class create any additional node managers which it uses. The SDK - /// always creates a CoreNodeManager which handles the built-in nodes defined by the specification. - /// Any additional NodeManagers are expected to handle application specific nodes. - /// - /// Applications with small address spaces do not need to create their own NodeManagers and can add any - /// application specific nodes to the CoreNodeManager. Applications should use custom NodeManagers when - /// the structure of the address space is stored in another system or when the address space is too large - /// to keep in memory. - /// - protected override MasterNodeManager CreateMasterNodeManager( - IServerInternal server, ApplicationConfiguration configuration) - { - Debug.WriteLine("Creating the Node Managers."); - - List nodeManagers = new() - { - new AasNodeManager(server, configuration, thePackageEnv, theServerOptions) - }; - - return new MasterNodeManager(server, configuration, null, nodeManagers.ToArray()); - } - - /// - /// Loads the non-configurable properties for the application. - /// - /// - /// These properties are exposed by the server but cannot be changed by administrators. - /// - protected override ServerProperties LoadServerProperties() - { - ServerProperties properties = new() - { - ManufacturerName = "OPC Foundation", - ProductName = "OPC UA SDK Samples", - ProductUri = "http://opcfoundation.org/UA/Samples/v1.0", - SoftwareVersion = Utils.GetAssemblySoftwareVersion(), - BuildNumber = Utils.GetAssemblyBuildNumber(), - BuildDate = Utils.GetAssemblyTimestamp() - }; - - return properties; - } - } -} diff --git a/src/AasxUaNetServer/UaServerWrapper.cs b/src/AasxUaNetServer/UaServerWrapper.cs deleted file mode 100644 index eb8851381..000000000 --- a/src/AasxUaNetServer/UaServerWrapper.cs +++ /dev/null @@ -1,282 +0,0 @@ -// SOURCE: https://github.com/OPCFoundation/UA-.NETStandard/blob/1.4.355.26/ -// SampleApplications/Samples/NetCoreConsoleServer/Program.cs -// heavily modified -// the (actual) Source is this: https://github.com/OPCFoundation/UA-.NETStandard/blob/master/Applications/ -// ConsoleReferenceServer/Program.cs -// it now features the MIT license! - -/* ======================================================================== - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - * ======================================================================*/ - -using AasOpcUaServer; -using AasxIntegrationBase; -using AdminShellNS; -using Opc.Ua; -using Opc.Ua.Configuration; -using Opc.Ua.Server; -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; - -namespace AasxUaNetServer -{ - - public enum ExitCode - { - Ok = 0, - ErrorServerNotStarted = 0x80, - ErrorServerRunning = 0x81, - ErrorServerException = 0x82, - ErrorInvalidCommandLine = 0x100 - }; - - public class UaServerWrapper - { - private LogInstance Log = null; - SampleServer server; - Task status; - DateTime lastEventTime; - int serverRunTime = Timeout.Infinite; - static ExitCode exitCode; - static AdminShellPackageEnv aasxEnv = null; - static AasxUaServerOptions aasxServerOptions = null; - - public bool IgnoreFurtherErrors = false; - public bool AllowFinallyStopped = true; - public bool FinallyStopped = false; - - public UaServerWrapper(int _stopTimeout, AdminShellPackageEnv _aasxEnv, LogInstance logger = null, AasxUaServerOptions _serverOptions = null) - { - aasxEnv = _aasxEnv; - aasxServerOptions = _serverOptions; - serverRunTime = _stopTimeout == 0 ? Timeout.Infinite : _stopTimeout * 1000; - this.Log = logger; - } - - public void Run() - { - - try - { - exitCode = ExitCode.ErrorServerNotStarted; - Log.Info("will start.........."); - ConsoleSampleServer().Wait(); - Console.WriteLine("Server started."); - exitCode = ExitCode.Ok; - } - catch (Exception ex) - { - var st = ex.Message; - if (!(IgnoreFurtherErrors && (st.Contains("Mindestens ein") || st.Contains("At least")))) - { - Utils.Trace("ServiceResultException:" + st); - Log.Error(ex, "starting server"); - Console.WriteLine("Exception: {0}", ex.Message); - exitCode = ExitCode.ErrorServerException; - Stop(); - FinallyStopped = AllowFinallyStopped; - } - } - } - - public void Stop() - { - if (server != null) - { - Console.WriteLine("Server stopped. Waiting for exit..."); - - using (SampleServer _server = server) - { - // Stop status thread - server = null; - if (status != null) - status.Wait(); - // Stop server and dispose - if (_server != null) - _server.Stop(); - - FinallyStopped = AllowFinallyStopped; - - Log.Info("End of Server stopping!"); - } - } - } - - private static bool _traceHandleAttached = false; - - private async Task ConsoleSampleServer() - { - ApplicationInstance application = new ApplicationInstance(); - - application.ApplicationName = "OPC UA AASX Server plugin"; - application.ApplicationType = ApplicationType.Server; - application.ConfigSectionName = Utils.IsRunningOnMono() ? "MonoAasxServerPlugin" : "AasxPluginUaNetServer"; - - // modify ConfigSectionName with absoluet file? - if (true) - { - string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - application.ConfigSectionName = Path.Combine(assemblyFolder, application.ConfigSectionName); - } - - // load the application configuration. - ApplicationConfiguration config = await application.LoadApplicationConfiguration(false); - - // check the application certificate. - if (!await application.CheckApplicationInstanceCertificate(false, 0)) - { - throw new Exception("Application instance certificate invalid!"); - } - - // Important: set appropriate trace mask - Utils.SetTraceMask(Utils.TraceMasks.Error - | Utils.TraceMasks.Information - | Utils.TraceMasks.StartStop - | Utils.TraceMasks.StackTrace); - - // attach tracing? - if (!_traceHandleAttached) - { - _traceHandleAttached = true; - Utils.Tracing.TraceEventHandler += (sender, args) => - { - if (this.Log != null) - { - // bad hack - if (args == null) - return; - if (args.TraceMask == Utils.TraceMasks.Information - || args.TraceMask == Utils.TraceMasks.Service - || args.TraceMask == Utils.TraceMasks.ServiceDetail) - return; - - var st = String.Format(args.Format, - // ReSharper disable once CoVariantArrayConversion - // ReSharper disable once RedundantExplicitArrayCreation - (args.Arguments != null ? args.Arguments : new string[] { "" })); - - // supports specially knows errors - if (true == args.Exception?.InnerException?.Message?.Contains("libuv")) - return; - - // suppress more errors? - if (st.Contains("Mindestens ein") || st.Contains("At least")) - { - if (IgnoreFurtherErrors) - return; - } - - // errors lead to not automatically close window? - if (!IgnoreFurtherErrors && args.TraceMask == Utils.TraceMasks.Error) - AllowFinallyStopped = false; - - this.Log.Info("[{0}] {1} {2} {3} {4}", - args.TraceMask, st, args.Message, "" + args.Exception?.Message, - "" + args.Exception?.StackTrace); - } - }; - } - - // allow stopping after finalizing special jobs - if (aasxServerOptions != null) - aasxServerOptions.FinalizeAction += () => - { - //// server.Stop(); - // changed to the following to close the window, as well - Stop(); - IgnoreFurtherErrors = true; - }; - - // start the server. - server = new SampleServer(aasxEnv, aasxServerOptions); - await application.Start(server); - - // start the status thread - // ReSharper disable once RedundantDelegateCreation - status = Task.Run(new Action(StatusThread)); - - // print notification on session events - server.CurrentInstance.SessionManager.SessionActivated += EventStatus; - server.CurrentInstance.SessionManager.SessionClosing += EventStatus; - server.CurrentInstance.SessionManager.SessionCreated += EventStatus; - - } - - private void EventStatus(Session session, SessionEventReason reason) - { - lastEventTime = DateTime.UtcNow; - PrintSessionStatus(session, reason.ToString()); - } - - void PrintSessionStatus(Session session, string reason, bool lastContact = false) - { - lock (session.DiagnosticsLock) - { - string item = String.Format("{0,9}:{1,20}:", reason, session.SessionDiagnostics.SessionName); - if (lastContact) - { - item += String.Format("Last Event:{0:HH:mm:ss}", - session.SessionDiagnostics.ClientLastContactTime.ToLocalTime()); - } - else - { - if (session.Identity != null) - { - item += String.Format(":{0,20}", session.Identity.DisplayName); - } - item += String.Format(":{0}", session.Id); - } - Console.WriteLine(item); - } - } - - private async void StatusThread() - { - while (server != null) - { - if (DateTime.UtcNow - lastEventTime > TimeSpan.FromMilliseconds(6000)) - { - IList sessions = server.CurrentInstance.SessionManager.GetSessions(); - // ReSharper disable once ForCanBeConvertedToForeach - for (int ii = 0; ii < sessions.Count; ii++) - { - Session session = sessions[ii]; - PrintSessionStatus(session, "-Status-", true); - } - lastEventTime = DateTime.UtcNow; - } - await Task.Delay(1000); - } - } - - } -} diff --git a/src/WpfMtpControl/AasOpcUaClient.cs b/src/WpfMtpControl/AasOpcUaClient.cs deleted file mode 100644 index 4eeb2a812..000000000 --- a/src/WpfMtpControl/AasOpcUaClient.cs +++ /dev/null @@ -1,325 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Opc.Ua; -using Opc.Ua.Client; -using Opc.Ua.Configuration; - -namespace WpfMtpControl -{ - public enum AasOpcUaClientStatus - { - Ok = 0, - ErrorCreateApplication = 0x11, - ErrorDiscoverEndpoints = 0x12, - ErrorCreateSession = 0x13, - ErrorBrowseNamespace = 0x14, - ErrorCreateSubscription = 0x15, - ErrorMonitoredItem = 0x16, - ErrorAddSubscription = 0x17, - ErrorRunning = 0x18, - ErrorReadConfigFile = 0x19, - ErrorNoKeepAlive = 0x30, - ErrorInvalidCommandLine = 0x100, - Running = 0x1000, - Quitting = 0x8000, - Quitted = 0x8001 - }; - - public class AasOpcUaClient - { - const int ReconnectPeriod = 10; - Session session; - SessionReconnectHandler reconnectHandler; - string endpointURL; - int clientRunTime = Timeout.Infinite; - static bool autoAccept = true; - static AasOpcUaClientStatus exitCode; - string userName; - string password; - - public AasOpcUaClient(string _endpointURL, bool _autoAccept, - int _stopTimeout, string _userName, string _password) - { - endpointURL = _endpointURL; - autoAccept = _autoAccept; - clientRunTime = _stopTimeout <= 0 ? Timeout.Infinite : _stopTimeout * 1000; - userName = _userName; - password = _password; - } - - private BackgroundWorker worker = null; - - public void Run() - { - // start server as a worker (will start in the background) - // ReSharper disable once LocalVariableHidesMember - var worker = new BackgroundWorker(); - worker.WorkerSupportsCancellation = true; - worker.DoWork += (s1, e1) => - { - try - { - while (true) - { - StartClientAsync().Wait(); - - // keep running - if (exitCode == AasOpcUaClientStatus.Running) - while (true) - Thread.Sleep(200); - - // restart - Thread.Sleep(200); - } - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - }; - worker.RunWorkerCompleted += (s1, e1) => - { - ; - }; - worker.RunWorkerAsync(); - } - - public void Cancel() - { - if (worker != null && worker.IsBusy) - try - { - worker.CancelAsync(); - worker.Dispose(); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - - public void Close() - { - if (session == null) - return; - session.Close(1); - session = null; - } - - public AasOpcUaClientStatus StatusCode { get => exitCode; } - - public async Task StartClientAsync() - { - Console.WriteLine("1 - Create an Application Configuration."); - exitCode = AasOpcUaClientStatus.ErrorCreateApplication; - - ApplicationInstance application = new ApplicationInstance - { - ApplicationName = "UA Core Sample Client", - ApplicationType = ApplicationType.Client, - ConfigSectionName = Utils.IsRunningOnMono() ? "Opc.Ua.MonoSampleClient" : "Opc.Ua.SampleClient" - }; - - // load the application configuration. - ApplicationConfiguration config = null; - try - { - config = await application.LoadApplicationConfiguration(false); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.Error(ex, "Error reading the config file"); - exitCode = AasOpcUaClientStatus.ErrorReadConfigFile; - return; - } - - // check the application certificate. - bool haveAppCertificate = await application.CheckApplicationInstanceCertificate(false, 0); - if (!haveAppCertificate) - { - throw new Exception("Application instance certificate invalid!"); - } - - // ReSharper disable HeuristicUnreachableCode - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (haveAppCertificate) - { - config.ApplicationUri = X509Utils.GetApplicationUriFromCertificate( - config.SecurityConfiguration.ApplicationCertificate.Certificate); - - if (config.SecurityConfiguration.AutoAcceptUntrustedCertificates) - { - autoAccept = true; - } - // ReSharper disable once RedundantDelegateCreation - config.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler( - CertificateValidator_CertificateValidation); - } - else - { - Console.WriteLine(" WARN: missing application certificate, using unsecure connection."); - } - // ReSharper enable HeuristicUnreachableCode - - Console.WriteLine("2 - Discover endpoints of {0}.", endpointURL); - exitCode = AasOpcUaClientStatus.ErrorDiscoverEndpoints; - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - var selectedEndpoint = CoreClientUtils.SelectEndpoint(endpointURL, haveAppCertificate, 15000); - Console.WriteLine(" Selected endpoint uses: {0}", - selectedEndpoint.SecurityPolicyUri.Substring(selectedEndpoint.SecurityPolicyUri.LastIndexOf('#') + 1)); - - Console.WriteLine("3 - Create a session with OPC UA server."); - exitCode = AasOpcUaClientStatus.ErrorCreateSession; - var endpointConfiguration = EndpointConfiguration.Create(config); - var endpoint = new ConfiguredEndpoint(null, selectedEndpoint, endpointConfiguration); - - session = await Session.Create(config, endpoint, false, "OPC UA Console Client", 60000, - new UserIdentity(userName, password), null); - - // register keep alive handler - session.KeepAlive += Client_KeepAlive; - - // ok - exitCode = AasOpcUaClientStatus.Running; - } - - private void Client_KeepAlive(Session sender, KeepAliveEventArgs e) - { - if (e.Status != null && ServiceResult.IsNotGood(e.Status)) - { - Console.WriteLine("{0} {1}/{2}", e.Status, sender.OutstandingRequestCount, sender.DefunctRequestCount); - - if (reconnectHandler == null) - { - Console.WriteLine("--- RECONNECTING ---"); - reconnectHandler = new SessionReconnectHandler(); - reconnectHandler.BeginReconnect(sender, ReconnectPeriod * 1000, Client_ReconnectComplete); - } - } - } - - private void Client_ReconnectComplete(object sender, EventArgs e) - { - // ignore callbacks from discarded objects. - if (!Object.ReferenceEquals(sender, reconnectHandler)) - { - return; - } - - if (reconnectHandler != null) - { - session = reconnectHandler.Session; - reconnectHandler.Dispose(); - } - - reconnectHandler = null; - - Console.WriteLine("--- RECONNECTED ---"); - } - - private static void OnNotification(MonitoredItem item, MonitoredItemNotificationEventArgs e) - { - // ReSharper disable once UnusedVariable - foreach (var value in item.DequeueValues()) - { - //// Console.WriteLine("{0}: {1}, {2}, {3}", item.DisplayName, value.Value, - //// value.SourceTimestamp, value.StatusCode); - } - } - - private static void CertificateValidator_CertificateValidation( - CertificateValidator validator, CertificateValidationEventArgs e) - { - if (e.Error.StatusCode == StatusCodes.BadCertificateUntrusted) - { - e.Accept = autoAccept; - if (autoAccept) - { - Console.WriteLine("Accepted Certificate: {0}", e.Certificate.Subject); - } - else - { - Console.WriteLine("Rejected Certificate: {0}", e.Certificate.Subject); - } - } - } - - public NodeId CreateNodeId(string nodeName, int index) - { - return new NodeId(nodeName, (ushort)index); - } - - private Dictionary nsDict = null; - - public NodeId CreateNodeId(string nodeName, string ns) - { - if (session == null || session.NamespaceUris == null) - return null; - - // build up? - if (nsDict == null) - { - nsDict = new Dictionary(); - for (ushort i = 0; i < session.NamespaceUris.Count; i++) - nsDict.Add(session.NamespaceUris.GetString(i), i); - } - - // find? - if (nsDict == null || !nsDict.ContainsKey(ns)) - return null; - - return new NodeId(nodeName, nsDict[ns]); - } - - public string ReadSubmodelElementValueAsString(string nodeName, int index) - { - if (session == null) - return ""; - - NodeId node = new NodeId(nodeName, (ushort)index); - return (session.ReadValue(node).ToString()); - } - - public DataValue ReadNodeId(NodeId nid) - { - if (session == null || nid == null || !session.Connected) - return null; - return (session.ReadValue(nid)); - } - - public void SubscribeNodeIds(NodeId[] nids, MonitoredItemNotificationEventHandler handler, - int publishingInteral = 1000) - { - if (session == null || nids == null || !session.Connected || handler == null) - return; - - var subscription = new Subscription(session.DefaultSubscription) - { PublishingInterval = publishingInteral }; - - foreach (var nid in nids) - { - var mi = new MonitoredItem(subscription.DefaultItem); - mi.StartNodeId = nid; - mi.Notification += handler; - subscription.AddItem(mi); - } - - session.AddSubscription(subscription); - subscription.Create(); - } - } -} diff --git a/src/WpfMtpControl/CanvasClickObject.cs b/src/WpfMtpControl/CanvasClickObject.cs deleted file mode 100644 index 00a65c034..000000000 --- a/src/WpfMtpControl/CanvasClickObject.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WpfMtpControl -{ - - public class CanvasClickObjectBase - { - public int Zlevel = 0; - public object Tag; - - public virtual double Area { get { return 0.0; } } - public virtual bool CheckClick(double x, double y) { return false; } - } - - // ReSharper disable once UnusedType.Global - public class CanvasClickObjectBox : CanvasClickObjectBase - { - public double X0, Y0, Width, Height; - public override double Area { get { return X0 * Y0; } } - public override bool CheckClick(double x, double y) - { - return (x >= X0 && x <= X0 + Width && y >= Y0 && y <= Y0 + Height); - } - - public CanvasClickObjectBox() { } - public CanvasClickObjectBox(double X0, double Y0, double Width, double Height, int Zlevel, object Tag) - { - this.X0 = X0; - this.Y0 = Y0; - this.Width = Width; - this.Height = Height; - this.Zlevel = Zlevel; - this.Tag = Tag; - } - } - - // ReSharper disable once UnusedType.Global - public class CanvasClickObjectList : List - { - private static int CompareCanvasClickObject(CanvasClickObjectBase x, CanvasClickObjectBase y) - { - if (x == null) - return +1; - if (y == null) - return -1; - if (x.Zlevel < y.Zlevel) - return +1; - if (x.Zlevel > y.Zlevel) - return -1; - if (x.Area < y.Area) - return -1; - if (x.Area > y.Area) - return +1; - return 0; - } - - public void FinalizeForUse() - { - this.Sort(CompareCanvasClickObject); - } - - public CanvasClickObjectBase FindClick(double x, double y) - { - foreach (var co in this) - if (co.CheckClick(x, y)) - return co; - return null; - } - } -} diff --git a/src/WpfMtpControl/DataSources/MtpDataSourceOpcUa.cs b/src/WpfMtpControl/DataSources/MtpDataSourceOpcUa.cs deleted file mode 100644 index 3672c4ef7..000000000 --- a/src/WpfMtpControl/DataSources/MtpDataSourceOpcUa.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using AasxIntegrationBase; - -namespace WpfMtpControl.DataSources -{ - /// - /// This class is expected to be sub-classed by a specufic OPC UA client implementation - /// - public class MtpDataSourceOpcUaServer - { - public string Endpoint = ""; - public string User = ""; - public string Password = ""; - } - - /// - /// This class is expected to be sub-classed by a specufic OPC UA client implementation - /// - public class MtpDataSourceOpcUaItem - { - public enum AccessType { Undefined, ReadOnly, WriteOnly, ReadWrite } - - public string Identifier = ""; - public string Namespace = ""; - public AccessType Access = AccessType.ReadWrite; - - public string MtpSourceItemId = ""; - } - - /// - /// This class holds information to manage renaming of endpoints for different MTP instances - /// - public class MtpDataSourceOpcUaEndpointMapping - { - public string NewEndpoint = null; - public string ForName = null; - public string ForId = null; - - public MtpDataSourceOpcUaEndpointMapping() { } - - public MtpDataSourceOpcUaEndpointMapping(string NewEndpoint, string ForName = null, string ForId = null) - { - this.ForName = ForName; - this.ForId = ForId; - this.NewEndpoint = NewEndpoint; - } - - public bool IsValid - { - get - { - return NewEndpoint.HasContent() - && (ForName.HasContent() || ForId.HasContent()); - } - } - } - - /// - /// This class allows for string replacement of information given on data sources - /// - public class MtpDataSourceStringReplacement - { - public string OldText = null; - public string NewText = null; - - public MtpDataSourceStringReplacement() { } - - public MtpDataSourceStringReplacement(string OldText, string NewText) - { - this.OldText = OldText; - this.NewText = NewText; - } - - public bool IsValid - { - get - { - return this.OldText.HasContent() && this.NewText.HasContent(); - } - } - - public string DoReplacement(string input) - { - if (input == null) - return null; - if (!this.IsValid) - return input; - return Regex.Replace(input, this.OldText, this.NewText); - } - } - - /// - /// This class holds information, which is to be used prior to load / setup MTP data acqusition. - /// - public class MtpDataSourceOpcUaPreLoadInfo - { - public List EndpointMapping = new List(); - public List IdentifierRenaming = new List(); - public List NamespaceRenaming = new List(); - } - - /// - /// This interface is expected from every OPC UA client to be implemented - /// - public interface IMtpDataSourceFactoryOpcUa - { - MtpDataSourceOpcUaServer CreateOrUseUaServer(string Endpoint, bool allowReUse = false); - MtpDataSourceOpcUaItem CreateOrUseItem(MtpDataSourceOpcUaServer server, - string Identifier, string Namespace, string Access, string mtpSourceItemId, bool allowReUse = false); - void Tick(int ms); - } - - /// - /// Interfaces for a graphical status display of a data source factory - /// - public interface IMtpDataSourceStatus - { - string GetStatus(); - void ViewDetails(); - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpDynamicInstance.cs b/src/WpfMtpControl/DynamicInstances/MtpDynamicInstance.cs deleted file mode 100644 index 0fe95dc52..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpDynamicInstance.cs +++ /dev/null @@ -1,1493 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; -using System.Windows.Threading; -using AasxIntegrationBase; -using Aml.Engine.CAEX; -using WpfMtpControl; - -namespace Mtp.DynamicInstances -{ - // see: https://stackoverflow.com/questions/25522218/wpf-binding-not-updating-the-view - public abstract class ObservableObject : INotifyPropertyChanged - { - #region INotifyPropertyChanged Members - - /// - /// Raises the PropertyChange event for the property specified - /// - /// Property name to update. Is case-sensitive. - public virtual void RaisePropertyChanged(string propertyName) - { - OnPropertyChanged(propertyName); - } - - /// - /// Raised when a property on this object has a new value. - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Raises this object's PropertyChanged event. - /// - /// The property that has a new value. - protected virtual void OnPropertyChanged(string propertyName) - { - - PropertyChangedEventHandler handler = this.PropertyChanged; - if (handler != null) - { - var e = new PropertyChangedEventArgs(propertyName); - handler(this, e); - } - } - - #endregion // INotifyPropertyChanged Members - } - - public class MtpDynamicInstanceBase : ObservableObject - { - // - // Important Members, Methods - // - - /// - /// An overloaded object might request drawing the MTP symbol on top of the dynamic instance. - /// - public bool DrawSymbolAsWell; - - /// - /// If MTP symbol is drawn, hold the Canvas object of it - /// - public FrameworkElement SymbolElement; - - /// - /// Called, if the state of the object has been changed or firstly initialized - /// - public virtual void RedrawSymbol(MtpVisuOptions visuOptions = null) - { - } - - /// - /// Internal flag for redrawing - /// - private bool doRedrawOnTick = false; - - /// - /// Flag for this instance to demand a redraw next time b ythe UI thread. - /// - /// - public void DemandRedrawOnTick() - { - this.doRedrawOnTick = true; - } - - /// - /// Will be called by the UI thread each 100ms - /// - public virtual void Tick(MtpVisuOptions visuOptions = null) - { - if (this.doRedrawOnTick) - { - this.doRedrawOnTick = false; - this.RedrawSymbol(visuOptions); - } - } - - public virtual void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - } - - public virtual UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - return null; - } - - // - // Symbol manipulation - // - - public void SymbolSetStateColor(Brush stateColor) - { - // access - if (this.SymbolElement == null) - return; - - // fill - foreach (var c in AasxWpfBaseUtils.LogicalTreeFindAllChildsWithRegexTag( - this.SymbolElement, "StateToFill")) - if (c != null) - { - c.Fill = stateColor; - } - - // stroke - foreach (var c in AasxWpfBaseUtils.LogicalTreeFindAllChildsWithRegexTag( - this.SymbolElement, "StateToStroke")) - if (c != null) - { - c.Stroke = stateColor; - } - } - - // - // Demo stuff - // - private int DemoIndex = 1; - - public virtual bool Demo(int mode) - { - return false; - } - - public void IncDemo() - { - if (!this.Demo(DemoIndex)) - { - this.Demo(1); - DemoIndex = 2; - } - else - DemoIndex++; - } - - protected void ButtonGo_Click(object sender, System.Windows.RoutedEventArgs e) - { - IncDemo(); - } - - // - // Units - // - - public class UnitRec - { - public int Id; - public string ShortText; - public string LongText; - - public UnitRec() { } - public UnitRec(int Id, string ShortText, string LongText) - { - this.Id = Id; - this.ShortText = ShortText; - this.LongText = LongText; - } - } - - private static UnitRec[] unitRecords = { - new UnitRec(1000, "K", "Kelvin"), - new UnitRec(1001, "°C", "Grad Celsius"), - new UnitRec(1002, "°F", "Grad Fahrenheit"), - new UnitRec(1005, "°", "Grad"), - new UnitRec(1006, "'", "Minute"), - new UnitRec(1007, "''", "Sekunde"), - new UnitRec(1010, "m", "Meter"), - new UnitRec(1013, "mm", "Millimeter"), - new UnitRec(1018, "ft", "Fuß"), - new UnitRec(1023, "m 2", " Quadratmeter"), - new UnitRec(1038, "l", "Liter"), - new UnitRec(1041, "hl", "Hektoliter"), - new UnitRec(1054, "s", "Sekunde"), - new UnitRec(1058, "min", "Minute"), - new UnitRec(1059, "h", "Stunde"), - new UnitRec(1060, "d", "Tag"), - new UnitRec(1061, "m/s", "Meter pro Sekunde"), - new UnitRec(1077, "Hz", "Hertz"), - new UnitRec(1081, "kHz", "Kilohertz"), - new UnitRec(1082, "1/s", "pro Sekunde"), - new UnitRec(1083, "1/min", "pro Minute"), - new UnitRec(1088, "kg", "Kilogramm"), - new UnitRec(1092, "t", "metrische Tonne"), - new UnitRec(1100, "g/cm 3", " Gramm pro Kubikzentimeter"), - new UnitRec(1105, "g/l", "Gramm pro Liter"), - new UnitRec(1120, "N", "Newton"), - new UnitRec(1123, "mN", "Millinewton"), - new UnitRec(1130, "Pa", "Pascal"), - new UnitRec(1133, "kPa", "Kilopascal"), - new UnitRec(1137, "bar", "Bar"), - new UnitRec(1138, "mbar", "Millibar"), - new UnitRec(1149, "mmH 2 O", "Millimeter Wassersäule"), - new UnitRec(1175, "Wh", "Wattstunde"), - new UnitRec(1179, "kWh", "Kilowattstunde"), - new UnitRec(1181, "kcalth", "Kilokalorien"), - new UnitRec(1190, "kW", "Kilowatt"), - new UnitRec(1209, "A", "Ampere"), - new UnitRec(1211, "mA", "Milliampere"), - new UnitRec(1221, "Ah", "Amperestunde"), - new UnitRec(1240, "V", "Volt"), - new UnitRec(1342, "%", "Prozent"), - new UnitRec(1349, "m3/h", "Kubikmeter pro Stunde"), - new UnitRec(1353, "l/h", "Liter pro Stunde"), - new UnitRec(1384, "mol", "Mol"), - new UnitRec(1422, "pH", "pH-Wert") - }; - - private static Dictionary unitIdToText = new Dictionary(); - - static MtpDynamicInstanceBase() - { - // initialize the patch tables - foreach (var ur in unitRecords) - unitIdToText.Add(ur.Id, ur); - } - - public UnitRec FindUnitById(int id) - { - if (unitIdToText.ContainsKey(id)) - return unitIdToText[id]; - return null; - } - - public string FindUnitTextById(int id) - { - var ur = FindUnitById(id); - if (ur == null) - return ""; - return ur.ShortText; - } - } - - public class MtpDiDataAssembly : MtpDynamicInstanceBase - { - // Remark: important to articulate all the properties with Get/Set for having Data Binding in place!! - // TagName - private string tagName = ""; - public string TagName - { - get { return tagName; } - set { tagName = value; RaisePropertyChanged("TagName"); } - } - - // TagDescription - private string tagDescription = ""; - public string TagDescription - { - get { return tagDescription; } - set { tagDescription = value; RaisePropertyChanged("TagDescription"); } - } - } - - public class MtpDiIndicatorElement : MtpDiDataAssembly - { - // WorstQualityCode - private byte wqc = 0xff; - public byte WorstQualityCode - { - get { return wqc; } - set - { - wqc = value; RaisePropertyChanged("WorstQualityCode"); - RaisePropertyChanged("WorstQualityCodeText"); RaisePropertyChanged("WorstQualityCodeBrush"); - } - } - public string WorstQualityCodeText - { - get { return String.Format("#{0:X02}", wqc); } - } - public Brush WorstQualityCodeBrush - { - get - { - if (wqc == 96) return Brushes.DarkBlue; // Simulation - if (wqc == 128) return Brushes.Green; // Good - if (wqc == 164) return Brushes.Yellow; // Maintenance - - if (wqc <= 40) return Brushes.Red; // Bad - if (wqc < 128) return Brushes.DarkOrange; // Uncertain - if (wqc < 255) return Brushes.Green; // also good? - return Brushes.Transparent; - } - } - } - - public class MtpDiAnaView : MtpDiIndicatorElement - { - // Value - private double valuex = 0.0; - public virtual double Value - { - // ReSharper disable once UnusedMemberHierarchy.Global - get { return valuex; } - set - { - valuex = value; RaisePropertyChanged("Value"); RaisePropertyChanged("ValuePercent"); - RaisePropertyChanged("ValueText"); - } - } - public double ValuePercent - { - get - { - return (valuex - valueScaleLowLimit) - / Math.Max(0.001, ValueScaleHighLimit - valueScaleLowLimit) * 100.0; - } - } - public string ValueText - { - get - { - var st = Value.ToString(CultureInfo.InvariantCulture); - // check the number of digits / decimal places - var dpi = st.IndexOf('.'); - if (st.Length >= 8 && st.Length - dpi > 4) - { - st = st.Substring(0, dpi + 4); - } - return st; - } - } - - // ValueScaleLowLimit - private double valueScaleLowLimit = 0.0; - public double ValueScaleLowLimit - { - get { return valueScaleLowLimit; } - set - { - valueScaleLowLimit = value; RaisePropertyChanged("ValueScaleLowLimit"); - RaisePropertyChanged("ValuePercent"); - } - } - - // ValueScaleHighLimit - private double valueScaleHighLimit = 0.0; - public double ValueScaleHighLimit - { - get { return valueScaleHighLimit; } - set - { - valueScaleHighLimit = value; RaisePropertyChanged("ValueScaleHighLimit"); - RaisePropertyChanged("ValuePercent"); - } - } - - // ValueUnit - private int valueUnit = 0; - public int ValueUnit - { - get { return valueUnit; } - set { valueUnit = value; RaisePropertyChanged("ValueUnit"); RaisePropertyChanged("ValueUnitText"); } - } - public string ValueUnitText { get { return this.FindUnitTextById(valueUnit); } } - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - if (ie == null || subscriber == null) - return; - this.TagName = "" + Name; - - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "V", - (ct, o) => { this.Value = (double)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "WQC", - (ct, o) => { this.WorstQualityCode = (byte)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "VSclMin", - (ct, o) => { this.ValueScaleLowLimit = (double)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "VSclMax", - (ct, o) => { this.ValueScaleHighLimit = (double)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "VUnit", - (ct, o) => { this.ValueUnit = (int)o; }); - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - UserControl c = null; - if (mtpWidth <= 50 || mtpHeight <= 40) - { - var bvt = new MtpViewAnaViewTiny(); - c = bvt; - c.Width = 80; - c.Height = 30; - c.DataContext = this; - bvt.ButtonGo.Click += ButtonGo_Click; - } - else - { - var bvl = new MtpViewAnaViewLarge(); - c = bvl; - c.Width = 130; - c.Height = 96; - c.DataContext = this; - bvl.ButtonGo.Click += ButtonGo_Click; - } - Demo(2); - return c; - } - - public override bool Demo(int mode) - { - if (mode == 1) - { - TagDescription = "This is a very long description of everything and even more"; - WorstQualityCode = 0xff; - Value = 345.678; - ValueUnit = 1001; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - if (mode == 2) - { - TagDescription = "Another description"; - WorstQualityCode = 0xa5; - Value = 23.45; - ValueUnit = 1001; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - if (mode == 3) - { - TagDescription = "Another description"; - WorstQualityCode = 0xa5; - Value = 390; - ValueUnit = 1001; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - if (mode == 4) - { - TagDescription = "Former description"; - WorstQualityCode = 0x5a; - Value = 720.1111; - ValueUnit = 1002; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - return false; - } - } - - public class MtpDiAnaMon : MtpDiAnaView - { - // Members - // basically 3 Limit Bands Tolerance, Warning, Alarm each with individual limit values and enables - - public class LimitBand - { - public double LimitValueLow, LimitValueHigh; - public bool LimitEnableLow, LimitEnableHigh; - public bool LimitActiveLow, LimitActiveHigh; - - public LimitBand() { } - - public LimitBand(double LimitValueLow, double LimitValueHigh, - bool LimitEnableLow, bool LimitEnableHigh, - bool LimitActiveLow, bool LimitActiveHigh) - { - this.LimitValueLow = LimitValueLow; - this.LimitValueHigh = LimitValueHigh; - this.LimitEnableLow = LimitEnableLow; - this.LimitEnableHigh = LimitEnableHigh; - this.LimitActiveLow = LimitActiveLow; - this.LimitActiveHigh = LimitActiveHigh; - } - - public bool EvalValueForLimitViolation(double value) - { - this.LimitActiveLow = this.LimitEnableLow && value < this.LimitValueLow; - this.LimitActiveHigh = this.LimitEnableHigh && value > this.LimitValueHigh; - return this.LimitActiveLow || this.LimitActiveHigh; - } - } - - public const int BandNone = -1; - public const int BandTolerance = 0; - public const int BandWarning = 1; - public const int BandAlarm = 2; - - public LimitBand[] Band = new LimitBand[] { new LimitBand(), new LimitBand(), new LimitBand() }; - - // concept of violatedBand - - private int violatedBand = BandNone; - public int ViolatedBand { get { return violatedBand; } } - - private string[] violatedBandText = new string[] { "TOL", "WARN", "ALRM" }; - public string ViolatedBandText - { - get - { - if (violatedBand < BandTolerance || violatedBand > BandAlarm) - return "none"; - return violatedBandText[violatedBand]; - } - } - - private Brush[] violatedBandBrush = new Brush[] { Brushes.DarkOrange, Brushes.OrangeRed, Brushes.Red }; - public Brush ViolatedBandBrush - { - get - { - if (violatedBand < BandTolerance || violatedBand > BandAlarm) - return Brushes.Transparent; - return violatedBandBrush[violatedBand]; - } - } - - // now: OVERIDE the getter/setter - - public override double Value - { - get - { - return base.Value; - } - set - { - base.Value = value; - - violatedBand = BandNone; - if (this.Band[BandTolerance].EvalValueForLimitViolation(value)) - violatedBand = BandTolerance; - if (this.Band[BandWarning].EvalValueForLimitViolation(value)) - violatedBand = BandWarning; - if (this.Band[BandAlarm].EvalValueForLimitViolation(value)) - violatedBand = BandAlarm; - - RaisePropertyChanged("ViolatedBand"); - RaisePropertyChanged("ViolatedBandText"); - RaisePropertyChanged("ViolatedBandBrush"); - } - } - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - // call AnaView - base.PopulateFromAml(Name, ie, subscriber); - - // some more - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VAHEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitEnableHigh = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VAHLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitValueHigh = (double)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VAHAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitActiveHigh = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWHEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitEnableHigh = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWHLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitValueHigh = (double)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWHAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitActiveHigh = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTHEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitEnableHigh = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTHLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitValueHigh = (double)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTHAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitActiveHigh = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VALEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitEnableLow = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VALLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitValueLow = (double)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VALAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitActiveLow = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWLEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitEnableLow = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWLLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitValueLow = (double)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWLAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitActiveLow = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTLEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitEnableLow = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTLLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitValueLow = (double)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTLAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitActiveLow = (bool)o; }); - - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - UserControl c = null; - if (mtpWidth <= 50 || mtpHeight <= 40) - { - var bvt = new MtpViewAnaMonTiny(); - c = bvt; - c.Width = 80; - c.Height = 30; - c.DataContext = this; - bvt.ButtonGo.Click += ButtonGo_Click; - } - else - { - var bvl = new MtpViewAnaViewLarge(); - c = bvl; - c.Width = 130; - c.Height = 96; - c.DataContext = this; - bvl.ButtonGo.Click += ButtonGo_Click; - } - Demo(2); - return c; - } - - public override bool Demo(int mode) - { - // most functionality is already in base class - base.Demo(mode); - - // often have the same limits - this.Band[BandTolerance] = new LimitBand(320, 380, true, true, true, true); - this.Band[BandWarning] = new LimitBand(200, 600, true, true, true, true); - this.Band[BandAlarm] = new LimitBand(100, 800, true, true, true, true); - - // some more tweaks? - if (mode == 1) - { - return true; - } - if (mode == 2) - { - return true; - } - if (mode == 3) - { - return true; - } - if (mode == 4) - { - return true; - } - return false; - } - } - - - - - - - - - - - public class MtpDiDIntView : MtpDiIndicatorElement - { - // Value - private int valuex = 0; - public virtual int Value - { - // ReSharper disable once UnusedMemberHierarchy.Global - get { return valuex; } - set - { - valuex = value; RaisePropertyChanged("Value"); RaisePropertyChanged("ValuePercent"); - RaisePropertyChanged("ValueText"); - } - } - public double ValuePercent - { - get - { - return (valuex - valueScaleLowLimit) - / Math.Max(0.001, ValueScaleHighLimit - valueScaleLowLimit) * 100.0; - } - } - public string ValueText - { - get - { - var st = Value.ToString(CultureInfo.InvariantCulture); - return st; - } - } - - // ValueScaleLowLimit - private int valueScaleLowLimit = 0; - public int ValueScaleLowLimit - { - get { return valueScaleLowLimit; } - set - { - valueScaleLowLimit = value; RaisePropertyChanged("ValueScaleLowLimit"); - RaisePropertyChanged("ValuePercent"); - } - } - - // ValueScaleHighLimit - private int valueScaleHighLimit = 0; - public int ValueScaleHighLimit - { - get { return valueScaleHighLimit; } - set - { - valueScaleHighLimit = value; RaisePropertyChanged("ValueScaleHighLimit"); - RaisePropertyChanged("ValuePercent"); - } - } - - // ValueUnit - private int valueUnit = 0; - public int ValueUnit - { - get { return valueUnit; } - set { valueUnit = value; RaisePropertyChanged("ValueUnit"); RaisePropertyChanged("ValueUnitText"); } - } - public string ValueUnitText { get { return this.FindUnitTextById(valueUnit); } } - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - if (ie == null || subscriber == null) - return; - this.TagName = "" + Name; - - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "V", - (ct, o) => { this.Value = (int)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "WQC", - (ct, o) => { this.WorstQualityCode = (byte)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "VSclMin", - (ct, o) => { this.ValueScaleLowLimit = (int)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "VSclMax", - (ct, o) => { this.ValueScaleHighLimit = (int)o; }); - subscriber.SubscribeToAmlIdRefWith(ie.Attribute, "VUnit", - (ct, o) => { this.ValueUnit = (int)o; }); - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - UserControl c = null; - if (mtpWidth <= 50 || mtpHeight <= 40) - { - var bvt = new MtpViewAnaViewTiny(); - c = bvt; - c.Width = 80; - c.Height = 30; - c.DataContext = this; - bvt.ButtonGo.Click += ButtonGo_Click; - } - else - { - var bvl = new MtpViewAnaViewLarge(); - c = bvl; - c.Width = 130; - c.Height = 96; - c.DataContext = this; - bvl.ButtonGo.Click += ButtonGo_Click; - } - Demo(2); - return c; - } - - public override bool Demo(int mode) - { - if (mode == 1) - { - TagDescription = "This is a very long description of everything and even more"; - WorstQualityCode = 0xff; - Value = 345; - ValueUnit = 1001; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - if (mode == 2) - { - TagDescription = "Another description"; - WorstQualityCode = 0xa5; - Value = 23; - ValueUnit = 1001; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - if (mode == 3) - { - TagDescription = "Another description"; - WorstQualityCode = 0xa5; - Value = 390; - ValueUnit = 1001; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - if (mode == 4) - { - TagDescription = "Former description"; - WorstQualityCode = 0x5a; - Value = 720; - ValueUnit = 1002; - ValueScaleLowLimit = -23; - ValueScaleHighLimit = 960; - return true; - } - return false; - } - } - - public class MtpDiDIntMon : MtpDiDIntView - { - // Members - // basically 3 Limit Bands Tolerance, Warning, Alarm each with individual limit values and enables - - public class LimitBand - { - public int LimitValueLow, LimitValueHigh; - public bool LimitEnableLow, LimitEnableHigh; - public bool LimitActiveLow, LimitActiveHigh; - - public LimitBand() { } - - public LimitBand(int LimitValueLow, int LimitValueHigh, - bool LimitEnableLow, bool LimitEnableHigh, - bool LimitActiveLow, bool LimitActiveHigh) - { - this.LimitValueLow = LimitValueLow; - this.LimitValueHigh = LimitValueHigh; - this.LimitEnableLow = LimitEnableLow; - this.LimitEnableHigh = LimitEnableHigh; - this.LimitActiveLow = LimitActiveLow; - this.LimitActiveHigh = LimitActiveHigh; - } - - public bool EvalValueForLimitViolation(int value) - { - this.LimitActiveLow = this.LimitEnableLow && value < this.LimitValueLow; - this.LimitActiveHigh = this.LimitEnableHigh && value > this.LimitValueHigh; - return this.LimitActiveLow || this.LimitActiveHigh; - } - } - - public const int BandNone = -1; - public const int BandTolerance = 0; - public const int BandWarning = 1; - public const int BandAlarm = 2; - - public LimitBand[] Band = new LimitBand[] { new LimitBand(), new LimitBand(), new LimitBand() }; - - // concept of violatedBand - - private int violatedBand = BandNone; - public int ViolatedBand { get { return violatedBand; } } - - private string[] violatedBandText = new string[] { "TOL", "WARN", "ALRM" }; - public string ViolatedBandText - { - get - { - if (violatedBand < BandTolerance || violatedBand > BandAlarm) - return "none"; - return violatedBandText[violatedBand]; - } - } - - private Brush[] violatedBandBrush = new Brush[] { Brushes.DarkOrange, Brushes.OrangeRed, Brushes.Red }; - public Brush ViolatedBandBrush - { - get - { - if (violatedBand < BandTolerance || violatedBand > BandAlarm) - return Brushes.Transparent; - return violatedBandBrush[violatedBand]; - } - } - - // now: OVERIDE the getter/setter - - public override int Value - { - get - { - return base.Value; - } - set - { - base.Value = value; - - violatedBand = BandNone; - if (this.Band[BandTolerance].EvalValueForLimitViolation(value)) - violatedBand = BandTolerance; - if (this.Band[BandWarning].EvalValueForLimitViolation(value)) - violatedBand = BandWarning; - if (this.Band[BandAlarm].EvalValueForLimitViolation(value)) - violatedBand = BandAlarm; - - RaisePropertyChanged("ViolatedBand"); - RaisePropertyChanged("ViolatedBandText"); - RaisePropertyChanged("ViolatedBandBrush"); - } - } - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - // call AnaView - base.PopulateFromAml(Name, ie, subscriber); - - // some more - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VAHEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitEnableHigh = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VAHLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitValueHigh = (int)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VAHAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitActiveHigh = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWHEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitEnableHigh = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWHLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitValueHigh = (int)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWHAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitActiveHigh = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTHEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitEnableHigh = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTHLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitValueHigh = (int)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTHAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitActiveHigh = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VALEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitEnableLow = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VALLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitValueLow = (int)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VALAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandAlarm].LimitActiveLow = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWLEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitEnableLow = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWLLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitValueLow = (int)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VWLAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandWarning].LimitActiveLow = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTLEn", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitEnableLow = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTLLim", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitValueLow = (int)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VTLAct", - (ct, o) => { if (this.Band?[BandAlarm] != null) this.Band[BandTolerance].LimitActiveLow = (bool)o; }); - - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - UserControl c = null; - if (mtpWidth <= 50 || mtpHeight <= 40) - { - var bvt = new MtpViewAnaMonTiny(); - c = bvt; - c.Width = 80; - c.Height = 30; - c.DataContext = this; - bvt.ButtonGo.Click += ButtonGo_Click; - } - else - { - var bvl = new MtpViewAnaViewLarge(); - c = bvl; - c.Width = 130; - c.Height = 96; - c.DataContext = this; - bvl.ButtonGo.Click += ButtonGo_Click; - } - Demo(2); - return c; - } - - public override bool Demo(int mode) - { - // most functionality is already in base class - base.Demo(mode); - - // often have the same limits - this.Band[BandTolerance] = new LimitBand(320, 380, true, true, true, true); - this.Band[BandWarning] = new LimitBand(200, 600, true, true, true, true); - this.Band[BandAlarm] = new LimitBand(100, 800, true, true, true, true); - - // some more tweaks? - if (mode == 1) - { - return true; - } - if (mode == 2) - { - return true; - } - if (mode == 3) - { - return true; - } - if (mode == 4) - { - return true; - } - return false; - } - } - - public class MtpDiBinView : MtpDiIndicatorElement - { - // Value - private bool valState = false; - public bool Value - { - get { return valState; } - set - { - valState = value; - RaisePropertyChanged("Value"); - RaisePropertyChanged("ValueTinyText"); - RaisePropertyChanged("ValueText"); - RaisePropertyChanged("MoreText"); - RaisePropertyChanged("ValueFalseText"); - RaisePropertyChanged("ValueTrueText"); - RaisePropertyChanged("ValueFalseBrush"); - RaisePropertyChanged("ValueTrueBrush"); - RaisePropertyChanged("ValueBrush"); - } - } - - public string ValueTinyText - { - get - { - if (!valState) - { - return "FALSE"; - } - else - { - return "TRUE"; - } - } - } - - public string ValueText - { - get - { - if (!valState) - { - if (valState0 != null && valState0.Trim().Length > 0) - return valState0; - else - return "FALSE"; - } - else - { - if (valState1 != null && valState1.Trim().Length > 0) - return valState1; - else - return "TRUE"; - } - } - } - - public string MoreText - { - get - { - if (!valState) - { - if (valState0 != null && valState0.Trim().Length > 0) - return valState0; - else - return ""; - } - else - { - if (valState1 != null && valState1.Trim().Length > 0) - return valState1; - else - return ""; - } - } - } - - public string ValueFalseText - { - get { if (!valState) { return "FALSE"; } else { return ""; } } - } - public string ValueTrueText - { - get { if (!valState) { return ""; } else { return "TRUE"; } } - } - - public Brush ValueFalseBrush - { - get { if (!valState) { return Brushes.Red; } else { return Brushes.Transparent; } } - } - public Brush ValueTrueBrush - { - get { if (!valState) { return Brushes.Transparent; } else { return Brushes.Green; } } - } - public Brush ValueBrush - { - get { if (valState) { return Brushes.Green; } else { return Brushes.Red; } } - } - - // String replacements - private string valState0 = ""; - public string ValState0 - { - get { return valState0; } - set { valState0 = value; RaisePropertyChanged("ValState0"); } - } - - private string valState1 = ""; - public string ValState1 - { - get { return valState1; } - set { valState1 = value; RaisePropertyChanged("ValState1"); } - } - - // Construct - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - this.TagName = "" + Name; - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "V", - (ct, o) => { this.Value = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "WQC", - (ct, o) => { this.WorstQualityCode = (byte)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VState0", - (ct, o) => { this.ValState0 = (string)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VState1", - (ct, o) => { this.ValState1 = (string)o; }); - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - UserControl c = null; - if (mtpWidth <= 50 || mtpHeight <= 40) - { - var bvt = new MtpViewBinViewTiny(); - c = bvt; - c.Width = 40; - c.Height = 30; - c.DataContext = this; - bvt.ButtonGo.Click += ButtonGo_Click; - } - else - { - var bvl = new MtpViewBinViewLarge(); - c = bvl; - c.Width = 130; - c.Height = 96; - c.DataContext = this; - bvl.ButtonGo.Click += ButtonGo_Click; - } - Demo(2); - return c; - } - - public override bool Demo(int mode) - { - if (mode == 1) - { - TagDescription = "This is a very long description of everything and even more"; - WorstQualityCode = 0xff; - Value = true; - ValState0 = "Falsch ist leer"; - ValState1 = "Wahr ist klar"; - return true; - } - if (mode == 2) - { - TagDescription = "Another description"; - WorstQualityCode = 0xa5; - Value = false; - ValState0 = "Falsch ist leer"; - ValState1 = "Wahr ist klar"; - return true; - } - return false; - } - } - - public class MtpDiBinMon : MtpDiBinView - { - public bool EnableFlutterRecog; - public double FlutterTimeInterval; - public int FlutterCounts; - public bool FlutterIsActive; - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - // call AnaView - base.PopulateFromAml(Name, ie, subscriber); - - // some more - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VFlutEn", - (ct, o) => { this.EnableFlutterRecog = (bool)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VFlutTi", - (ct, o) => { this.FlutterTimeInterval = (double)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VFlutCnt", - (ct, o) => { this.FlutterCounts = (int)o; }); - - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "VFlutAct", - (ct, o) => { this.FlutterIsActive = (bool)o; }); - } - } - - public class MtpDiActiveElement : MtpDiIndicatorElement - { - // Note: now spec, yet - // therefore not sure, what common elements are - } - - public class MtpDiBinValve : MtpDiActiveElement - { - public bool Ctrl; - - public MtpDiBinValve() : base() - { - this.DrawSymbolAsWell = true; - } - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - // call AnaView - base.PopulateFromAml(Name, ie, subscriber); - - // some more - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "Ctrl", - (ct, o) => { this.Ctrl = (bool)o; DemandRedrawOnTick(); }); - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - var c = new MtpViewBinValve(); - c.Width = mtpWidth; - c.Height = mtpHeight; - c.DataContext = this; - return c; - } - - public override void RedrawSymbol(MtpVisuOptions visuOptions = null) - { - // what color? - Brush color = null; - if (this.Ctrl) - { - color = (visuOptions?.StateColorActiveBrush != null) - ? visuOptions.StateColorActiveBrush : Brushes.Red; - } - else - { - color = (visuOptions?.StateColorNonActiveBrush != null) - ? visuOptions.StateColorNonActiveBrush : Brushes.Black; - } - - // set - if (color != null) - this.SymbolSetStateColor(color); - } - - } - - public class MtpDiMonBinValve : MtpDiBinValve - { - // members only selected, a lot of "unnecessary" memebrs - public bool ErrorActiveStatic; - public bool ErrorActiveDynamic; - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - // call MtpDiBinValve - base.PopulateFromAml(Name, ie, subscriber); - - // some more - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "MonStatErr", - (ct, o) => { this.ErrorActiveStatic = (bool)o; }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "MonDynErr", - (ct, o) => { this.ErrorActiveDynamic = (bool)o; }); - } - - } - - public class MtpDiBinDrive : MtpDiActiveElement - { - public bool ForwardCtrl; - public bool ReverseCtrl; - - public MtpDiBinDrive() : base() - { - this.DrawSymbolAsWell = true; - } - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - // call AnaView - base.PopulateFromAml(Name, ie, subscriber); - - // some more - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "FwdCtrl", - (ct, o) => { this.ForwardCtrl = (bool)o; DemandRedrawOnTick(); }); - subscriber?.SubscribeToAmlIdRefWith(ie.Attribute, "RevCtrl", - (ct, o) => { this.ReverseCtrl = (bool)o; DemandRedrawOnTick(); }); - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - var c = new MtpViewBinDrive(); - c.Width = mtpWidth; - c.Height = mtpHeight; - c.DataContext = this; - return c; - } - - public override void RedrawSymbol(MtpVisuOptions visuOptions = null) - { - // what color? - Brush color = null; - if (this.ForwardCtrl && !this.ReverseCtrl) - { - color = (visuOptions?.StateColorForwardBrush != null) - ? visuOptions.StateColorForwardBrush : Brushes.Blue; - } - else if (!this.ForwardCtrl && this.ReverseCtrl) - { - color = (visuOptions?.StateColorReverseBrush != null) - ? visuOptions.StateColorReverseBrush : Brushes.Red; - } - else - { - color = (visuOptions?.StateColorNonActiveBrush != null) - ? visuOptions.StateColorNonActiveBrush : Brushes.Black; - } - - // set - if (color != null) - this.SymbolSetStateColor(color); - } - - } - - public class MtpDiPIDCntl : MtpDiActiveElement - { - // Not sure which members to expose here - - public enum OpState { Off = 0, Op, Aut } - public string[] OpStateText = new string[] { "Off", "Op", "Aut" }; - public Brush[] OpStateBrush = new Brush[] { Brushes.DarkGray, Brushes.Gold, Brushes.Green }; - - // Value - private OpState valState = OpState.Aut; - public OpState Value - { - get { return valState; } - set - { - valState = value; - RaisePropertyChanged("Value"); - RaisePropertyChanged("ValueText"); - RaisePropertyChanged("ValueBrush"); - } - } - - public string ValueText - { - get - { - var i = (int)valState; - if (i >= 0 && i < OpStateText.Length) - return OpStateText[i]; - return "?"; - } - } - - public Brush ValueBrush - { - get - { - var i = (int)valState; - if (i >= 0 && i < OpStateBrush.Length) - return OpStateBrush[i]; - return Brushes.Red; - } - } - - // Construct - - public override void PopulateFromAml(string Name, InternalElementType ie, MtpDataSourceSubscriber subscriber) - { - this.TagName = "" + Name; - } - - public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) - { - UserControl c = null; - // ReSharper disable HeuristicUnreachableCode - // ReSharper disable once ConditionIsAlwaysTrueOrFalse -#pragma warning disable 162 - if (true || mtpWidth <= 50 || mtpHeight <= 40) -#pragma warning restore 162 - { - var bvt = new MtpViewPIDCntlTiny(); - c = bvt; - c.Width = 40; - c.Height = 30; - c.DataContext = this; - bvt.ButtonGo.Click += ButtonGo_Click; - } - else - -#pragma warning disable 162 - { - // ReSharper disable once HeuristicUnreachableCode - var bvl = new MtpViewBinViewLarge(); - c = bvl; - c.Width = 130; - c.Height = 96; - c.DataContext = this; - bvl.ButtonGo.Click += ButtonGo_Click; - } -#pragma warning restore 162 - Demo(2); - // ReSharper enable HeuristicUnreachableCode - return c; - } - - public override bool Demo(int mode) - { - if (mode == 1) - { - TagDescription = "This is a very long description of everything and even more"; - WorstQualityCode = 0xff; - Value = OpState.Off; - return true; - } - if (mode == 2) - { - TagDescription = "Another description"; - WorstQualityCode = 0xa5; - Value = OpState.Aut; - return true; - } - if (mode == 3) - { - TagDescription = "Yet Another description"; - WorstQualityCode = 0x55; - Value = OpState.Op; - return true; - } - return false; - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewAnaMonTiny.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewAnaMonTiny.xaml deleted file mode 100644 index 546a78548..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewAnaMonTiny.xaml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewAnaMonTiny.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewAnaMonTiny.xaml.cs deleted file mode 100644 index 5bc480c65..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewAnaMonTiny.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewAnaMonTiny : UserControl - { - public MtpViewAnaMonTiny() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewLarge.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewLarge.xaml deleted file mode 100644 index 9ae8fedb4..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewLarge.xaml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewLarge.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewLarge.xaml.cs deleted file mode 100644 index 7e3baafa6..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewLarge.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewAnaViewLarge : UserControl - { - public MtpViewAnaViewLarge() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewTiny.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewTiny.xaml deleted file mode 100644 index 4ee454d59..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewTiny.xaml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewTiny.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewTiny.xaml.cs deleted file mode 100644 index 8e9961d47..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewAnaViewTiny.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewAnaViewTiny : UserControl - { - public MtpViewAnaViewTiny() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinDrive.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewBinDrive.xaml deleted file mode 100644 index 8c331ff21..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinDrive.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinDrive.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewBinDrive.xaml.cs deleted file mode 100644 index d3b3f2af1..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinDrive.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewBinDrive : UserControl - { - public MtpViewBinDrive() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinValve.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewBinValve.xaml deleted file mode 100644 index 62b279a99..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinValve.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinValve.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewBinValve.xaml.cs deleted file mode 100644 index 8e9fbec88..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinValve.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewBinValve : UserControl - { - public MtpViewBinValve() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewLarge.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewBinViewLarge.xaml deleted file mode 100644 index 44bfc5b4e..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewLarge.xaml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewLarge.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewBinViewLarge.xaml.cs deleted file mode 100644 index 1ee000019..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewLarge.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewBinViewLarge : UserControl - { - public MtpViewBinViewLarge() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewTiny.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewBinViewTiny.xaml deleted file mode 100644 index c91260680..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewTiny.xaml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewTiny.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewBinViewTiny.xaml.cs deleted file mode 100644 index 364be0923..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewBinViewTiny.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewBinViewTiny : UserControl - { - public MtpViewBinViewTiny() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewPIDCntlTiny.xaml b/src/WpfMtpControl/DynamicInstances/MtpViewPIDCntlTiny.xaml deleted file mode 100644 index b2a146176..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewPIDCntlTiny.xaml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/DynamicInstances/MtpViewPIDCntlTiny.xaml.cs b/src/WpfMtpControl/DynamicInstances/MtpViewPIDCntlTiny.xaml.cs deleted file mode 100644 index e87dbe568..000000000 --- a/src/WpfMtpControl/DynamicInstances/MtpViewPIDCntlTiny.xaml.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Mtp.DynamicInstances -{ - public partial class MtpViewPIDCntlTiny : UserControl - { - public MtpViewPIDCntlTiny() - { - InitializeComponent(); - } - } -} diff --git a/src/WpfMtpControl/LICENSE.txt b/src/WpfMtpControl/LICENSE.txt deleted file mode 100644 index 01f9cb5eb..000000000 --- a/src/WpfMtpControl/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/WpfMtpControl/MtpAmlHelper.cs b/src/WpfMtpControl/MtpAmlHelper.cs deleted file mode 100644 index 66ad55942..000000000 --- a/src/WpfMtpControl/MtpAmlHelper.cs +++ /dev/null @@ -1,285 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media; -using AasxIntegrationBase; -using Aml.Engine.CAEX; -using WpfMtpControl.DataSources; - -namespace WpfMtpControl -{ - // ReSharper disable once ClassNeverInstantiated.Global - public class MtpAmlHelper - { - public static bool CheckForRole(CAEXSequence seq, string refRoleClassPath) - { - if (seq == null) - return false; - foreach (var src in seq) - if (src.RefRoleClassPath != null && src.RefRoleClassPath.Trim() != "") - if (src.RefRoleClassPath.Trim().ToLower() == refRoleClassPath.Trim().ToLower()) - return true; - return false; - } - - public static bool CheckForRole(CAEXSequence seq, string refBaseRoleClassPath) - { - if (seq == null) - return false; - foreach (var src in seq) - if (src.RefBaseRoleClassPath != null && src.RefBaseRoleClassPath.Trim() != "") - if (src.RefBaseRoleClassPath.Trim().ToLower() == refBaseRoleClassPath.Trim().ToLower()) - return true; - return false; - } - - public static bool CheckForRoleClassOrRoleRequirements(SystemUnitClassType ie, string classPath) - { - // HACK (MIHO, 2020-08-03): see equivalent function in AmlImport.cs; may be re-use - if (ie is InternalElementType) - if (CheckForRole((ie as InternalElementType).RoleRequirements, classPath)) - return true; - - return - CheckForRole(ie.SupportedRoleClass, classPath); - } - - public static bool CheckAttributeFoRefSemantic(AttributeType a, string correspondingAttributePath) - { - if (a.RefSemantic != null) - foreach (var rf in a.RefSemantic) - if (rf.CorrespondingAttributePath != null && rf.CorrespondingAttributePath.Trim() != "" - && rf.CorrespondingAttributePath.Trim().ToLower() - == correspondingAttributePath.Trim().ToLower()) - // found! - return true; - return false; - } - - public static AttributeType FindAttributeByRefSemantic( - AttributeSequence aseq, string correspondingAttributePath) - { - foreach (var a in aseq) - { - // check attribute itself - if (CheckAttributeFoRefSemantic(a, correspondingAttributePath)) - // found! - return a; - - // could be childs - var x = FindAttributeByRefSemantic(a.Attribute, correspondingAttributePath); - if (x != null) - return x; - } - return null; - } - - public static string FindAttributeValueByRefSemantic( - AttributeSequence aseq, string correspondingAttributePath) - { - var a = FindAttributeByRefSemantic(aseq, correspondingAttributePath); - return a?.Value; - } - - public static AttributeType FindAttributeByName(AttributeSequence aseq, string name) - { - if (aseq != null) - foreach (var a in aseq) - if (a.Name.Trim() == name.Trim()) - return a; - return null; - } - - public static string FindAttributeValueByName(AttributeSequence aseq, string name) - { - var a = FindAttributeByName(aseq, name); - return a?.Value; - } - - public static Nullable FindAttributeValueByNameFromInt(AttributeSequence aseq, string name) - { - var astr = FindAttributeValueByName(aseq, name); - if (astr == null) - return (null); - return Convert.ToInt32(astr); - } - - public static Nullable FindAttributeValueByNameFromDouble(AttributeSequence aseq, string name) - { - var astr = FindAttributeValueByName(aseq, name); - if (astr == null) - return (null); - if (!double.TryParse(astr, NumberStyles.Any, CultureInfo.InvariantCulture, out var res)) - return null; - return res; - } - - public static List> FindAllMtpPictures(CAEXFileType aml) - { - // start - var res = new List>(); - - // assumption: all pictures are on the 1st level of a instance hierarchy .. - foreach (var ih in aml.InstanceHierarchy) - foreach (var ie in ih.InternalElement) - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/Picture") - res.Add(new Tuple(ie.Name, ie)); - - // ok - return res; - } - - public static Dictionary FindAllDynamicInstances(CAEXFileType aml) - { - // start - var res = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - if (aml == null) - return res; - - // assumption: all instances are on a fixed level of a instance hierarchy .. - foreach (var ih in aml.InstanceHierarchy) // e.g.: ModuleTypePackage - foreach (var ie in ih.InternalElement) // e.g. Class = ModuleTypePackage - foreach (var ie2 in ie.InternalElement) // e.g. CommunicationSet - foreach (var ie3 in ie2.InternalElement) // e.g. InstanceList - if (ie3.RefBaseSystemUnitPath.Trim() == "MTPSUCLib/CommunicationSet/InstanceList") - foreach (var ie4 in ie3.InternalElement) // now ALWAYS an dynamic instance - { - var refID = MtpAmlHelper.FindAttributeValueByName(ie4.Attribute, "RefID"); - if (refID != null && refID.Length > 0) - res.Add(refID, ie4); - } - - // ok - return res; - } - - public static void CreateDataSources( - IMtpDataSourceFactoryOpcUa dataSourceFactory, - MtpDataSourceOpcUaPreLoadInfo preLoadInfo, - CAEXFileType aml) - { - // access - if (dataSourceFactory == null || aml == null) - return; - - // assumption: all instances are on a fixed level of a instance hierarchy .. - foreach (var ih in aml.InstanceHierarchy) // e.g.: ModuleTypePackage - foreach (var ie in ih.InternalElement) // e.g. Class = ModuleTypePackage - foreach (var ie2 in ie.InternalElement) // e.g. CommunicationSet - foreach (var ie3 in ie2.InternalElement) // e.g. InstanceList - if (ie3.RefBaseSystemUnitPath.Trim() == "MTPSUCLib/CommunicationSet/SourceList") - foreach (var server in ie3.InternalElement) // now on server - { - // check if server valid - if (server.RefBaseSystemUnitPath.Trim() != - "MTPCommunicationSUCLib/ServerAssembly/OPCUAServer") - continue; - if (!server.Name.HasContent()) - continue; - - // get attributes - var ep = FindAttributeValueByName(server.Attribute, "Endpoint"); - - // mapping?? - if (preLoadInfo?.EndpointMapping != null) - foreach (var epm in preLoadInfo.EndpointMapping) - if (epm?.IsValid == true && - (server.Name.Trim() == epm.ForName?.Trim() - || server.ID.Trim() == epm.ForId?.Trim())) - { - ep = epm.NewEndpoint?.Trim(); - } - - // check endpoint - if (!ep.HasContent()) - continue; - - // make server - var serv = dataSourceFactory.CreateOrUseUaServer(ep); - if (serv == null) - continue; - - // go into items - foreach (var item in server.ExternalInterface) - { - // check to item - // TODO (MIHO, 2020-08-06): spec/example files seem not to be in a final state - // check for the final role/class names to be used - if (!item.RefBaseClassPath.Trim().Contains("OPCUAItem")) - continue; - - // get attributes - var id = FindAttributeValueByName(item.Attribute, "Identifier"); - var ns = FindAttributeValueByName(item.Attribute, "Namespace"); - var ac = FindAttributeValueByName(item.Attribute, "Access"); - - // potential renaming? - if (preLoadInfo?.IdentifierRenaming != null) - foreach (var ren in preLoadInfo.IdentifierRenaming) - id = ren.DoReplacement(id); - - if (preLoadInfo?.NamespaceRenaming != null) - foreach (var ren in preLoadInfo.NamespaceRenaming) - ns = ren.DoReplacement(ns); - - // create - // ReSharper disable once UnusedVariable - var it = dataSourceFactory.CreateOrUseItem(serv, id, ns, ac, item.ID); - } - } - - } - - public static double[] ConvertStringToDoubleArray(string input, char[] separator) - { - var pieces = input.Split(separator, StringSplitOptions.RemoveEmptyEntries); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (pieces == null) - // ReSharper disable once HeuristicUnreachableCode - return null; - var res = new List(); - foreach (var p in pieces) - { - if (!double.TryParse(p.Trim(), NumberStyles.Any, CultureInfo.InvariantCulture, out var num)) - // fail immediately - return null; - res.Add(num); - } - return res.ToArray(); - } - - /// - /// Edges delimited by ';', coordinates by ','. Example: "1,2;3,4;5,6". - /// - public static PointCollection PointCollectionFromString(string edgepath) - { - var edges = edgepath.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (edges == null || edges.Length < 2) - return null; - - var pc = new PointCollection(); - foreach (var e in edges) - { - var coord = ConvertStringToDoubleArray(e, new[] { ',' }); - if (coord != null && coord.Length == 2) - pc.Add(new Point(coord[0], coord[1])); - } - return pc; - } - - } -} diff --git a/src/WpfMtpControl/MtpData.cs b/src/WpfMtpControl/MtpData.cs deleted file mode 100644 index fce2e3b5e..000000000 --- a/src/WpfMtpControl/MtpData.cs +++ /dev/null @@ -1,408 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media; -using Aml.Engine.CAEX; -using Mtp.DynamicInstances; -using WpfMtpControl.DataSources; - -namespace WpfMtpControl -{ - public class MtpData - { - public Dictionary PictureCollection = new Dictionary(); - - public class MtpBaseObject - { - public string Name = ""; - public string RefID = null; - public int ObjClass = 0; - } - - public class MtpConnectionObject : MtpBaseObject - { - public PointCollection points = null; - } - - public class MtpPortedObject : MtpBaseObject - { - public PointCollection logicalPorts = null, nozzlePoints = null, measurementPoints = null; - } - - public class MtpVisualObject : MtpPortedObject - { - public double? x, y, width, height, rotation; - public string viewType, eVer, eClass, eIrdi, refID; - - public MtpVisualObjectRecord visObj = null; - - public MtpDynamicInstanceBase dynInstance = null; - - public void Parse(InternalElementType ie) - { - x = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "X"); - y = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "Y"); - width = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "Width"); - height = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "Height"); - rotation = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "Rotation"); - viewType = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "ViewType"); - eVer = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "eClassVersion"); - eClass = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "eClassClassificationClass"); - eIrdi = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "eClassIRDI"); - refID = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "RefID"); - } - - public bool IsValid() - { - // because of PxC temporarily disable check eVer == null - if (x == null || y == null || width == null || height == null - || (eClass == null && eIrdi == null)) - return false; - return true; - } - } - - public class MtpTopologyObject : MtpPortedObject - { - public double? x, y; - public string refID; - - public MtpVisualObjectRecord visObj = null; - - public void Parse(InternalElementType ie) - { - x = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "X"); - y = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie.Attribute, "Y"); - refID = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "RefID"); - } - - public bool IsValid() - { - if (x == null || y == null) - return false; - return true; - } - } - - public class MtpPicture - { - public string Name = ""; - public SystemUnitClassType Picture = null; - - public Size TotalSize = new Size(0, 0); - - public List Objects = new List(); - - public static MtpPicture ParsePicture( - MtpVisualObjectLib objectLib, - MtpDataSourceSubscriber subscriber, - Dictionary refIdToDynamicInstance, - SystemUnitClassType picture, - MtpSymbolMapRecordList makeUpConfigRecs = null) - { - // result - var res = new MtpPicture(); - res.Picture = picture; - - // first, set up the canvas - if (true) - { - var width = MtpAmlHelper.FindAttributeValueByNameFromDouble(picture.Attribute, "Width"); - var height = MtpAmlHelper.FindAttributeValueByNameFromDouble(picture.Attribute, "Height"); - if (width == null || height == null || width < 1 || height < 1) - return null; - res.TotalSize = new Size(width.Value, height.Value); - } - - // assume, that the elements below are in a list - foreach (var ie in picture.InternalElement) - { - // the check described in VDI2658 rely on RefBaseSystemUnitPath - if (ie == null || ie.Name == null || ie.RefBaseSystemUnitPath == null) - continue; - - var refID = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "RefID"); - - // do a classification based on numbers to easily comapre - var ec = 0; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/Connection/Pipe") ec = 100; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/Connection/FunctionLine") ec = 101; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/Connection/MeasurementLine") ec = 102; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/VisualObject") ec = 200; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/TopologyObject/Termination/Nozzle") ec = 300; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/TopologyObject/Termination/Source") ec = 301; - if (ie.RefBaseSystemUnitPath.Trim() == "MTPHMISUCLib/TopologyObject/Termination/Sink") ec = 302; - - // - // Pipe, FunctionLine, MeasurementLine - // - if (ec >= 100 && ec <= 199) - { - // access (still string) information - var edgepath = MtpAmlHelper.FindAttributeValueByName(ie.Attribute, "Edgepath"); - if (edgepath == null) - continue; - var points = MtpAmlHelper.PointCollectionFromString(edgepath); - if (points == null || points.Count < 2) - continue; - - var co = new MtpConnectionObject(); - co.Name = ie.Name; - co.RefID = refID; - co.ObjClass = ec; - co.points = points; - res.Objects.Add(co); - } - - // - // Nozzle information? - // - var nozzlePoints = new PointCollection(); - var measurementPoints = new PointCollection(); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (ec >= 200 && ec <= 399) - { - foreach (var ie2 in ie.InternalElement) - { - if (ie2 != null - && ie2.RefBaseSystemUnitPath?.Trim() == "MTPHMISUCLib/PortObject/Nozzle") - { - // found nozzle with valid information? - var nx = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie2.Attribute, "X"); - var ny = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie2.Attribute, "Y"); - if (nx != null && ny != null) - // add - nozzlePoints.Add(new Point(nx.Value, ny.Value)); - } - - if (ie2 != null - && ie2.RefBaseSystemUnitPath?.Trim() == "MTPHMISUCLib/PortObject/MeasurementPoint") - { - // found measurement point with valid information? - var nx = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie2.Attribute, "X"); - var ny = MtpAmlHelper.FindAttributeValueByNameFromDouble(ie2.Attribute, "Y"); - if (nx != null && ny != null) - // add - measurementPoints.Add(new Point(nx.Value, ny.Value)); - } - } - } - - if (ie.Name == "V001") - { - ; - } - - // - // VisualObject - // - if (ec >= 200 && ec <= 299) - { - // create object and parse - var vo = new MtpVisualObject(); - vo.Name = ie.Name; - vo.RefID = refID; - vo.ObjClass = ec; - vo.Parse(ie); - if (!vo.IsValid()) - continue; - res.Objects.Add(vo); - - // add ports - vo.logicalPorts = null; - vo.measurementPoints = measurementPoints; - vo.nozzlePoints = nozzlePoints; - - // try find an XAML object - vo.visObj = objectLib.FindVisualObjectByClass(vo.eVer, vo.eClass, vo.eIrdi); - - // help improving this search - if (makeUpConfigRecs != null) - { - makeUpConfigRecs.Add(new MtpSymbolMapRecord( - vo.eVer, vo.eClass, vo.eIrdi, SymbolDefault: "{to be set}", - Comment: "" + vo.Name + "," + vo.RefID)); - } - - // try find dynamic instances - if (vo.refID != null && refIdToDynamicInstance != null - && refIdToDynamicInstance.ContainsKey(vo.refID)) - { - // try get the dynamic instance - var ieDI = refIdToDynamicInstance[vo.refID] as InternalElementType; - - if (ieDI != null && ieDI.RefBaseSystemUnitPath != null - && ieDI.RefBaseSystemUnitPath.Trim().Length > 0) - { - var bsup = ieDI.RefBaseSystemUnitPath.Trim(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/AnaView" - || bsup == "MTPDataObjectSUCLib/DataAssembly/IndicatorElement/AnaView") - vo.dynInstance = new MtpDiAnaView(); - if (bsup == "MTPDataObjectSUCLib/DataAssembly/AnaView/AnaMon" - || bsup == "MTPDataObjectSUCLib/DataAssembly/IndicatorElement/AnaView/AnaMon") - vo.dynInstance = new MtpDiAnaMon(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/DIntiew" - || bsup == "MTPDataObjectSUCLib/DataAssembly/IndicatorElement/DIntView") - vo.dynInstance = new MtpDiDIntView(); - if (bsup == "MTPDataObjectSUCLib/DataAssembly/AnaView/DIntMon" - || bsup == "MTPDataObjectSUCLib/DataAssembly/IndicatorElement/AnaView/DIntMon") - vo.dynInstance = new MtpDiDIntMon(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/BinView" - || bsup == "MTPDataObjectSUCLib/DataAssembly/IndicatorElement/BinView") - vo.dynInstance = new MtpDiBinView(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/BinMon" - || bsup == "MTPDataObjectSUCLib/DataAssembly/IndicatorElement/BinMon") - vo.dynInstance = new MtpDiBinMon(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/BinVlv") - vo.dynInstance = new MtpDiBinValve(); - if (bsup == "MTPDataObjectSUCLib/DataAssembly/MonBinVlv") - vo.dynInstance = new MtpDiMonBinValve(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/BinDrv") - vo.dynInstance = new MtpDiBinDrive(); - - if (bsup == "MTPDataObjectSUCLib/DataAssembly/ActiveElement/PIDCtrl") - vo.dynInstance = new MtpDiPIDCntl(); - } - - // found? - if (vo.dynInstance != null) - { - vo.dynInstance.PopulateFromAml(ie.Name, ieDI, subscriber); - } - } - } - - // - // Topology Object - // - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (ec >= 300 && ec <= 309) - { - // create object and parse - var to = new MtpTopologyObject(); - to.Name = ie.Name; - to.RefID = refID; - to.ObjClass = ec; - to.Parse(ie); - if (!to.IsValid()) - continue; - res.Objects.Add(to); - - // add ports - to.logicalPorts = null; - to.measurementPoints = measurementPoints; - to.nozzlePoints = nozzlePoints; - - // draw source / sink? - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (ec >= 301 && ec <= 302) - { - // get visual object - to.visObj = objectLib.FindVisualObjectByName( - new[] { "Source_general", "Sink_general" }[ec - 301]); - } - } - } - - // return picture - return res; - } - } - - public void LoadStream( - MtpVisualObjectLib objectLib, IMtpDataSourceFactoryOpcUa dataSourceFactory, - MtpDataSourceOpcUaPreLoadInfo preLoadInfo, - MtpDataSourceSubscriber subscriber, Stream stream, - MtpSymbolMapRecordList makeUpConfigRecs = null) - { - // check - if (stream == null) - return; - - // try open file - var doc = CAEXDocument.LoadFromStream(stream); - if (doc == null) - return; - - // load dynamic Instances - var refIdToDynamicInstance = MtpAmlHelper.FindAllDynamicInstances(doc.CAEXFile); - - // load data sources - if (dataSourceFactory != null) - MtpAmlHelper.CreateDataSources(dataSourceFactory, preLoadInfo, doc.CAEXFile); - - // index pictures - var pl = MtpAmlHelper.FindAllMtpPictures(doc.CAEXFile); - foreach (var pi in pl) - { - var p = MtpPicture.ParsePicture(objectLib, subscriber, refIdToDynamicInstance, - pi.Item2, makeUpConfigRecs); - if (p != null) - this.PictureCollection.Add(pi.Item1, p); - } - } - - public void LoadAmlOrMtp( - MtpVisualObjectLib objectLib, IMtpDataSourceFactoryOpcUa dataSourceFactory, - MtpDataSourceOpcUaPreLoadInfo preLoadInfo, - MtpDataSourceSubscriber subscriber, string fn, - MtpSymbolMapRecordList makeUpConfigRecs = null) - { - // check - if (fn == null) - return; - - // check if we have a mtp-file, which needs to be unzipped - bool unzip = fn.ToLower().EndsWith(".mtp") || fn.ToLower().EndsWith(".zip"); - - // easy? - if (!unzip) - { - using (var stream = File.OpenRead(fn)) - { - LoadStream(objectLib, dataSourceFactory, preLoadInfo, subscriber, stream, makeUpConfigRecs); - } - return; - } - - // not easy .. - using (var file = File.OpenRead(fn)) - using (var zip = new ZipArchive(file, ZipArchiveMode.Read)) - { - // simply take the first .aml file - foreach (var entry in zip.Entries) - { - // take the 1st *.anl file; should be only one on the root level, even for MultiFileMTP - if (entry.FullName.ToLower().EndsWith(".aml")) - { - using (var stream = entry.Open()) - { - LoadStream(objectLib, dataSourceFactory, preLoadInfo, subscriber, stream, makeUpConfigRecs); - } - break; - } - } - } - } - } -} diff --git a/src/WpfMtpControl/MtpDataSourceSubscriber.cs b/src/WpfMtpControl/MtpDataSourceSubscriber.cs deleted file mode 100644 index d68f46b66..000000000 --- a/src/WpfMtpControl/MtpDataSourceSubscriber.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WpfMtpControl -{ - public class MtpDataSourceSubscriber - { - public enum ChangeType { Value } - - public class SubscriberItem - { - public string DataSourceItemId = null; - public Type ConvertToType = null; - public Action ActionLambda = null; - } - - private Dictionary items = new Dictionary(); - - public void Subscribe(string dataSourceItemId, Action action) - { - if (items.ContainsKey(dataSourceItemId)) - items.Remove(dataSourceItemId); - - var si = new SubscriberItem(); - si.DataSourceItemId = dataSourceItemId; - si.ConvertToType = typeof(T); - si.ActionLambda = action; - - items[dataSourceItemId] = si; - } - - public void SubscribeToAmlIdRefWith( - Aml.Engine.CAEX.AttributeSequence aseq, string attrName, Action action) - { - var idRef = MtpAmlHelper.FindAttributeValueByName(aseq, attrName); - if (idRef != null && idRef.Length > 0) - this.Subscribe(idRef, action); - } - - public void Invoke(string dataSourceItemId, ChangeType change, object o) - { - if (items.ContainsKey(dataSourceItemId)) - { - var si = items[dataSourceItemId]; - if (si != null) - { - // try to convert? - try - { - if (si.ConvertToType == typeof(double)) - o = Convert.ToDouble(o); - if (si.ConvertToType == typeof(float)) - o = Convert.ToSingle(o); - if (si.ConvertToType == typeof(int)) - o = Convert.ToInt32(o); - if (si.ConvertToType == typeof(uint)) - o = Convert.ToUInt32(o); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - - // on any error, simply do not call lambda - return; - } - - if (si.ActionLambda != null) - si.ActionLambda(change, o); - } - } - } - } -} diff --git a/src/WpfMtpControl/MtpSymbolLib.cs b/src/WpfMtpControl/MtpSymbolLib.cs deleted file mode 100644 index 5605568ee..000000000 --- a/src/WpfMtpControl/MtpSymbolLib.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; - -namespace WpfMtpControl -{ - public class MtpSymbol - { - /// - /// Different strategies of dealing with a geometric object - /// - public enum SymbolPlaceType { StretchToBoundingBox, FitNozzles } - - /// - /// Symbolic name / ID of the library, as given by static initialization of the symbol lib - /// - public string LibName = ""; - - /// - /// Symbolic name of the symbol, as derived from the Xaml.Key property - /// - public string SymbolName = ""; - - /// - /// Getter for the full name, composed from LibName and "." and SymbolName - /// - public string FullName { get { return LibName + "." + SymbolName; } } - - /// - /// Preffered placement type - /// - public SymbolPlaceType PreferredPlacement = SymbolPlaceType.StretchToBoundingBox; - - /// - /// Preferred label alignment - /// - public UIElementHelper.DrawToCanvasAlignment PreferredLabelAlignment - = UIElementHelper.DrawToCanvasAlignment.Centered; - - /// - /// Object data of the symbol, expected to be XAML Canvas element. - /// - /// - private object symbolData = null; - public object SymbolData - { - get { return this.symbolData; } - set { this.SetSymbol(value); } - } - - // - // Constructors - // - - public MtpSymbol() { } - - public MtpSymbol(string LibName, string SymbolName, object Symbol) - { - this.LibName = LibName; - this.SymbolName = SymbolName; - this.SymbolData = Symbol; - } - - public MtpSymbol(MtpSymbol other) - { - this.LibName = "" + other?.LibName; - this.SymbolName = "" + other?.SymbolName; - this.SymbolData = other?.SymbolData; - } - - public MtpSymbol(string LibName, ResourceDictionary rd, string SymbolName) - { - this.LibName = LibName; - this.SymbolName = SymbolName; - this.SymbolData = rd[SymbolName]; - } - - // - // Evaluation of derived properties - // - - /// - /// Nozzle positions found in the XAML shape - /// - public Point[] NozzlePos = null; - - /// - /// Found label positions for the shape. Top=0, Right=1, Bottom=2, Left=3 - /// - public Point[] LabelPos = null; - - public void SetSymbol(object XamlContent) - { - // assume to be a canvas - var canvasContent = XamlContent as Canvas; - if (canvasContent == null) - return; - - // clone the canvas, as later accessing functionality shall not see Nozzles, Labels artifiacts in XAML - var clonedCanvas = UIElementHelper.cloneElement(canvasContent) as Canvas; - if (clonedCanvas == null) - return; - - // remember this as Symbol! - this.symbolData = clonedCanvas; - - // find named nozzles and remove artifacts! - this.NozzlePos = UIElementHelper.FindNozzlesViaTags(clonedCanvas, "Nozzle", extractShapes: true); - - // find label positions and remove artifacts! - this.LabelPos = UIElementHelper.FindNozzlesViaTags(clonedCanvas, "Label", extractShapes: true); - } - } - - public class MtpSymbolLib : Dictionary - { - public object GetSymbol(string Fullname) - { - if (this.ContainsKey(Fullname)) - return this[Fullname].SymbolData; - return null; - } - - public void ImportResourceDicrectory(string LibName, ResourceDictionary rd) - { - // access - if (rd == null) - return; - - // over all - foreach (var key in rd.Keys) - { - // only take Canvas as symbol root element - if (rd[key] is Canvas) - { - // symbol - var sym = new MtpSymbol(LibName, rd, "" + key); - - // use name to figure out some options - if (("" + key).ToLower().Contains("nozzled")) - sym.PreferredPlacement = MtpSymbol.SymbolPlaceType.FitNozzles; - - // add - this.Add(sym.FullName, sym); - } - } - } - } -} diff --git a/src/WpfMtpControl/MtpVisuOpcUaClient.cs b/src/WpfMtpControl/MtpVisuOpcUaClient.cs deleted file mode 100644 index cf8b11f9b..000000000 --- a/src/WpfMtpControl/MtpVisuOpcUaClient.cs +++ /dev/null @@ -1,312 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WpfMtpControl.DataSources; - -namespace WpfMtpControl -{ - /// - /// Simple client, implementing the Interface IMtpDataSourceOpcUaFactory and all necessary details - /// - public class MtpVisuOpcUaClient : IMtpDataSourceFactoryOpcUa, IMtpDataSourceStatus - { - public enum ItemChangeType { Value } - public delegate void ItemChangedDelegate( - IMtpDataSourceStatus dataSource, DetailItem itemRef, ItemChangeType changeType); - public event ItemChangedDelegate ItemChanged = null; - - public ObservableCollection Items = new ObservableCollection(); - - // ReSharper disable once ClassWithVirtualMembersNeverInherited.Global - public class DetailItem : MtpDataSourceOpcUaItem, IEquatable, INotifyPropertyChanged - { - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void OnPropertyChanged(string propertyName) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new PropertyChangedEventArgs(propertyName)); - } - - public DetailServer Server = null; - - public Opc.Ua.NodeId nid = null; - - public bool Equals(DetailItem other) - { - if (other == null || this.Server == null || other.Server == null) - return false; - - return this.Server == other.Server - && this.Identifier == other.Identifier - && this.Namespace == other.Namespace - && this.Access == other.Access; - } - - public string DisplayEndpoint { get { return "" + this.Server?.Endpoint; } } - public string DisplayNamespace { get { return "" + this.Namespace; } } - public string DisplayIdentifier { get { return "" + this.Identifier; } } - - public bool ValueTouched = true; - public object Value = null; - - private string displayValue = null; - public string DisplayValue - { - get { return displayValue; } - set { displayValue = value; OnPropertyChanged("DisplayValue"); } - } - } - - public class DetailServer : DataSources.MtpDataSourceOpcUaServer, IEquatable - { - MtpVisuOpcUaClient ParentRef = null; - - public int msToNextState = 3000; - public int state = 0; - - public List ItemRefs = new List(); - - public Dictionary nodeIdToItemRef = new Dictionary(); - - private AasOpcUaClient uaClient = null; - public AasOpcUaClient UaClient { get { return uaClient; } } - - public DetailServer(MtpVisuOpcUaClient parentRef) - { - this.ParentRef = parentRef; - } - - public void Tick(int ms) - { - // next state? - msToNextState -= ms; - if (msToNextState < 0) - { - msToNextState = 3000; - var nextState = -1; - - // starting server - if (state == 0) - { - // try to initialize OPC UA server - this.uaClient = new AasOpcUaClient( - this.Endpoint, _autoAccept: true, _stopTimeout: 10, _userName: this.User, - _password: this.Password); - this.uaClient.Run(); - // go on for a checking state - nextState = 1; - } - - // starting subscription - if (state == 1) - { - // good connection - if (this.uaClient != null && this.uaClient.StatusCode == AasOpcUaClientStatus.Running) - { - // add subscriptions for all nodes - var nids = new List(); - foreach (var ir in this.ItemRefs) - { - ir.DisplayValue = null; - try - { - // make node id? - ir.nid = this.uaClient.CreateNodeId(ir.Identifier, ir.Namespace); - if (ir.nid == null) - continue; - - // inital read possible? - var dv = this.uaClient.ReadNodeId(ir.nid); - ir.DisplayValue = "" + dv.Value; - ir.Value = dv.Value; - - // send event - if (this.ParentRef?.ItemChanged != null) - this.ParentRef.ItemChanged.Invoke(this.ParentRef, ir, ItemChangeType.Value); - - // try subscribe! - nids.Add(ir.nid); - this.nodeIdToItemRef.Add(ir.nid, ir); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - - // try add these - this.uaClient.SubscribeNodeIds(nids.ToArray(), OnNotification, publishingInteral: 200); - - // go on - nextState = 2; - } - } - - // stable running - if (state == 2) - { - ; - } - - // move? - if (nextState >= 0) - this.state = nextState; - } - } - - private void OnNotification( - Opc.Ua.Client.MonitoredItem item, Opc.Ua.Client.MonitoredItemNotificationEventArgs e) - { - foreach (var value in item.DequeueValues()) - { - if (this.nodeIdToItemRef != null && this.nodeIdToItemRef.ContainsKey(item.StartNodeId)) - { - // get item ref - var ir = this.nodeIdToItemRef[item.StartNodeId]; - - // change data (and notify ObservableCollection) - ir.DisplayValue = "" + value.Value; - ir.Value = value.Value; - ir.ValueTouched = true; - - // business logic event - if (this.ParentRef?.ItemChanged != null) - this.ParentRef.ItemChanged.Invoke(this.ParentRef, ir, ItemChangeType.Value); - } - } - } - - public bool Equals(DetailServer other) - { - if (other == null) - return false; - - return this.Endpoint == other.Endpoint; - } - } - - private List servers = new List(); - - // - // Interface: IMtpDataSourceFactoryOpcUa - // - - public MtpDataSourceOpcUaServer CreateOrUseUaServer(string Endpoint, bool allowReUse = false) - { - if (Endpoint == null) - return null; - - // make one - var s = new DetailServer(this); - s.Endpoint = Endpoint; - - // or try re-use? - var doAdd = true; - if (allowReUse && servers.Contains(s)) - { - s = servers.Find(x => x.Equals(s)); - doAdd = false; - } - - // add? - if (doAdd) - servers.Add(s); - return s; - } - - public MtpDataSourceOpcUaItem CreateOrUseItem( - MtpDataSourceOpcUaServer server, - string Identifier, string Namespace, string Access, string mtpSourceItemId, - bool allowReUse = false) - { - // need server - if (!servers.Contains(server) || Identifier == null || Namespace == null || Access == null) - return null; - var ds = (server as DetailServer); - - // TODO (MIHO, 2020-08-06): remove this, if not required anymore - var allowedIds = new[] { "L001", "L002", "L003", "F001", "M001", "V001", "V002", "V003", "P001" }; - var allowedFound = false; - foreach (var ai in allowedIds) - if (Identifier.Contains("." + ai + ".")) - allowedFound = true; - if (!allowedFound) - return null; - - // directly use server - var i = new DetailItem(); - i.Server = ds; - i.Identifier = Identifier; - i.Namespace = Namespace; - i.Access = MtpDataSourceOpcUaItem.AccessType.ReadWrite; - i.MtpSourceItemId = mtpSourceItemId; - - // try re-use? - var doAdd = true; - if (allowReUse && this.Items.Contains(i)) - { - foreach (var it in this.Items) - if (it.Equals(i)) - { - i = it; - break; - } - doAdd = false; - } - - // add? - if (doAdd) - { - this.Items.Add(i); - ds?.ItemRefs.Add(i); - } - return i; - } - - public void Tick(int ms) - { - foreach (var s in this.servers) - s.Tick(ms); - } - - // - // Interface IMtpDataSourceStatus - // - - public string GetStatus() - { - var numit = this.Items.Count; - // ReSharper disable once NotAccessedVariable - var servinfo = ""; - var i = 0; - foreach (var s in this.servers) - { - servinfo += $"(se={i} st={s.state} t={s.msToNextState,5}ms, " + - $"code={"" + s.UaClient?.StatusCode.ToString()}) "; - i++; - } - return $"{this.servers.Count} servers, {numit} items | {servinfo}"; - } - - public void ViewDetails() - { - ; - } - - } -} diff --git a/src/WpfMtpControl/MtpVisuOptions.cs b/src/WpfMtpControl/MtpVisuOptions.cs deleted file mode 100644 index a8323b318..000000000 --- a/src/WpfMtpControl/MtpVisuOptions.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using AasxIntegrationBase; -using Newtonsoft.Json; - -namespace WpfMtpControl -{ - public class MtpVisuOptions - { - // original input - - public string Background = "#e0e0e0"; - - public string StateColorActive = "#0000ff"; - public string StateColorNonActive = "#000000"; - - public string StateColorForward = "#0000ff"; - public string StateColorReverse = "#00ff00"; - - // prepared - - [JsonIgnore] - public Brush BackgroundBrush = new SolidColorBrush(Color.FromRgb(224, 224, 255)); - - [JsonIgnore] - public Brush StateColorActiveBrush = Brushes.Blue; - [JsonIgnore] - public Brush StateColorNonActiveBrush = Brushes.Black; - - [JsonIgnore] - public Brush StateColorForwardBrush = Brushes.Blue; - [JsonIgnore] - public Brush StateColorReverseBrush = Brushes.Green; - - private static void PrepareColor(string preset, ref Brush color) - { - // going mad about this .. - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - // ReSharper disable once PossibleNullReferenceException - if (preset.HasContent()) - try - { - var c = (Color)ColorConverter.ConvertFromString(preset); - if (c != null) - color = new SolidColorBrush(c); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - - public void Prepare() - { - PrepareColor(this.Background, ref this.BackgroundBrush); - - PrepareColor(this.StateColorActive, ref this.StateColorActiveBrush); - PrepareColor(this.StateColorNonActive, ref this.StateColorNonActiveBrush); - - PrepareColor(this.StateColorForward, ref this.StateColorForwardBrush); - PrepareColor(this.StateColorReverse, ref this.StateColorReverseBrush); - } - } -} diff --git a/src/WpfMtpControl/MtpVisuViewer.xaml b/src/WpfMtpControl/MtpVisuViewer.xaml deleted file mode 100644 index 530427e01..000000000 --- a/src/WpfMtpControl/MtpVisuViewer.xaml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - Handle Points - Bounding Boxes - - - - - - - - - - - - - - - diff --git a/src/WpfMtpControl/MtpVisuViewer.xaml.cs b/src/WpfMtpControl/MtpVisuViewer.xaml.cs deleted file mode 100644 index 6a80456e3..000000000 --- a/src/WpfMtpControl/MtpVisuViewer.xaml.cs +++ /dev/null @@ -1,668 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Xml; -using Aml.Engine.CAEX; -using Mtp.DynamicInstances; -using WpfMtpControl.DataSources; -using static WpfMtpControl.MtpData; - -namespace WpfMtpControl -{ - public partial class MtpVisuViewer : UserControl - { - // - // External properties - // - - public delegate void MtpObjectDoubleClickHandler(MtpData.MtpBaseObject source); - public event MtpObjectDoubleClickHandler MtpObjectDoubleClick; - - public MtpVisuOptions VisuOptions = new MtpVisuOptions(); - - // - // Internal properties - // - - public MtpVisuViewer() - { - InitializeComponent(); - } - - private void Canvas_Loaded(object sender, RoutedEventArgs e) - { - // Timer for loading - System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); - dispatcherTimer.Tick += DispatcherTimer_Tick; - dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100); - dispatcherTimer.Start(); - } - - public UIElementHelper.FontSettings LabelFontSettings = new UIElementHelper.FontSettings( - new FontFamily("Arial"), FontStyles.Normal, FontWeights.Normal, FontStretches.Condensed, 18.0); - - public void SetLineStyle(Shape l, int elementClass) - { - if (elementClass == 100) - { - } - if (elementClass == 101) - { - DoubleCollection dashes = new DoubleCollection(); - dashes.Add(2); - dashes.Add(2); - l.StrokeDashArray = dashes; - } - if (elementClass == 102) - { - DoubleCollection dashes = new DoubleCollection(); - dashes.Add(4); - dashes.Add(2); - dashes.Add(1); - dashes.Add(2); - l.StrokeDashArray = dashes; - } - } - - public Rectangle ConstructRect(Brush stroke, double strokeThickness, Brush fill = null) - { - var res = new Rectangle(); - res.Stroke = stroke; - res.StrokeThickness = strokeThickness; - if (fill != null) - res.Fill = fill; - return res; - } - - public Ellipse ConstructEllipse(Nullable strokeThickness = null, Brush stroke = null, Brush fill = null) - { - var res = new Ellipse(); - if (stroke != null) - res.Stroke = stroke; - if (strokeThickness != null) - res.StrokeThickness = strokeThickness.Value; - if (fill != null) - res.Fill = fill; - return res; - } - - public Canvas ConstructContentObject(MtpVisualObjectRecord xaml) - { - var contentObject = xaml?.Symbol?.SymbolData as Canvas; - contentObject = UIElementHelper.cloneElement(contentObject) as Canvas; - return contentObject; - } - - public Viewbox ConstructViewboxVO(FrameworkElement contentObject, double rotation) - { - // trivial - if (contentObject == null) - return null; - - // make such object - var viso = new ContentControl(); - viso.Content = contentObject; - - // rotation in degree, mathematically positive == anti clock wise - var rt = new RotateTransform(-rotation, contentObject.Width / 2, contentObject.Height / 2); - viso.RenderTransform = rt; - - var vb = new Viewbox(); - vb.Child = viso; - vb.Stretch = Stretch.Fill; - - // ok - return vb; - } - - public ContentControl ConstructDirectVO( - FrameworkElement contentObject, double scale, double rotation, Point center) - { - // trivial - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (contentObject == null || center == null) - return null; - - // rotation in degree, mathematically positive == anti clock wise - var tg = new TransformGroup(); - tg.Children.Add(new RotateTransform(-rotation, center.X, center.Y)); - tg.Children.Add(new ScaleTransform(scale, scale, center.X, center.Y)); - // Note: the following was disabled by MIHO at same stage: - //// tg.Children.Add(new ScaleTransform(scale, scale, 0 - //// .0 * center.X + contentObject.Width / 2, 0.0 * center.Y + contentObject.Height / 2)); - contentObject.RenderTransform = tg; - - // make such object - var viso = new ContentControl(); - viso.Content = contentObject; - viso.Width = contentObject.Width; - viso.Height = contentObject.Height; - - // ok - return viso; - } - - public void DrawToCanvasAtPositionSize( - Canvas canvas, double x, double y, double width, double height, FrameworkElement fe) - { - if (canvas == null || fe == null) - return; - fe.Width = width; - fe.Height = height; - canvas.Children.Add(fe); - Canvas.SetLeft(fe, x); - Canvas.SetTop(fe, y); - } - - public void DrawHandlePoint(Canvas canvas, double x, double y, bool draw = true, Brush handleBrush = null) - { - if (!draw) - return; - var hb = (handleBrush == null) ? Brushes.Blue : handleBrush; - var p = ConstructEllipse(fill: hb); - DrawToCanvasAtPositionSize(canvas, x - 4.0, y - 4.0, 8.0, 8.0, p); - } - - public void DrawMtpPictureIntoCanvas( - Canvas canvas, MtpData.MtpPicture pic, - bool drawHandlePoints = true, bool drawBoundingBoxes = true) - { - // clear access - if (canvas == null || pic == null) - return; - canvas.Children.Clear(); - - // prepare options correctly - this.VisuOptions?.Prepare(); - - // for some tests, we need randomness -#if _only_testing - var rnd = new Random(); -#endif - // first, set up the canvas - if (true) - { - if (pic.TotalSize.Width < 1 || pic.TotalSize.Height < 1) - return; - canvas.Width = pic.TotalSize.Width; - canvas.Height = pic.TotalSize.Height; - - if (this.VisuOptions?.BackgroundBrush != null) - { - canvas.Background = this.VisuOptions.BackgroundBrush; - scrollViewerVisu.Background = this.VisuOptions.BackgroundBrush; - } - } - - // assume, that the elements below are in a list - foreach (var obj in pic.Objects) - { - // the check described in VDI2658 rely on RefBaseSystemUnitPath - if (obj == null || obj.Name == null) - continue; - - // - // Pipe, FunctionLine, MeasurementLine - // - if (obj is MtpData.MtpConnectionObject conn) - { - // make appropriate poly line - var l = new Polyline(); - l.Stroke = Brushes.Black; - l.StrokeThickness = 1; - l.Points = conn.points; - - // line style - SetLineStyle(l, obj.ObjClass); - - // draw - l.Tag = conn; - canvas.Children.Add(l); - } - - // - // VisualObject - // - if (obj is MtpData.MtpVisualObject vo) - { - // debug? - if (obj.Name == "V001") - { - ; - } - - // search - var symbol = vo?.visObj?.Symbol; - if (symbol?.SymbolData == null) - { - // make missing bounding box - if (drawBoundingBoxes && vo.x.HasValue && vo.y.HasValue - && vo.width.HasValue && vo.height.HasValue) - { - // box - DrawToCanvasAtPositionSize(canvas, vo.x.Value, vo.y.Value, vo.width.Value, - vo.height.Value, ConstructRect(Brushes.Red, 2.0)); - - // label? - var labeltb = UIElementHelper.CreateStickyLabel(this.LabelFontSettings, "" + vo.Name); - UIElementHelper.DrawToCanvasAtPositionAligned(canvas, - vo.x.Value + vo.width.Value / 2, - vo.y.Value + vo.height.Value / 2, - UIElementHelper.DrawToCanvasAlignment.Centered, labeltb); - } - - continue; - } - - // make a NEW content object to display & manipulate - var contentObject = symbol.SymbolData as Canvas; - if (contentObject == null) - continue; - - contentObject = UIElementHelper.cloneElement(contentObject) as Canvas; - - // delete not necessary artifacts in the XAML - UIElementHelper.FindNozzlesViaTags(contentObject, "Nozzle", extractShapes: true); - UIElementHelper.FindNozzlesViaTags(contentObject, "Label", extractShapes: true); - - // same logic for potential dynamic instance - var dynInstanceVO = vo.dynInstance?.CreateVisualObject(vo.width.Value, vo.height.Value); - - // - // how to draw content? - // - if (dynInstanceVO != null) - { - // draw an dynamic instance object - - // make bounding box Rect - if (drawBoundingBoxes) - DrawToCanvasAtPositionSize(canvas, vo.x.Value, vo.y.Value, vo.width.Value, - vo.height.Value, ConstructRect(Brushes.Violet, 1.0)); - - // draw it - var vb = ConstructViewboxVO(dynInstanceVO, 0.0 /* vo.rotation.Value */); - vb.Stretch = Stretch.Uniform; - vb.Tag = vo; - DrawToCanvasAtPositionSize(canvas, vo.x.Value, vo.y.Value, vo.width.Value, vo.height.Value, vb); - } - - if (vo.dynInstance == null || vo.dynInstance.DrawSymbolAsWell) - { - if (vo.visObj != null && contentObject != null) - { - // how to draw based on valid vis obj information - if (vo.visObj.Placement == MtpSymbol.SymbolPlaceType.FitNozzles && vo.nozzlePoints.Count > 0 - && symbol.NozzlePos != null && symbol.NozzlePos.Length > 0) - { - // magnetically snap in - // COG of "surrounding" nozzles, and distance - var npArr = vo.nozzlePoints.ToArray(); - var npCOG = UIElementHelper.ComputeCOG(npArr); - var npRadius = UIElementHelper.ComputeRadiusForCenterPointer(npArr, npCOG.Value); - - // COG of content nozzles, and distance - var contentCOG = UIElementHelper.ComputeCOG(symbol.NozzlePos); - var contentRadius = UIElementHelper.ComputeRadiusForCenterPointer( - symbol.NozzlePos, contentCOG.Value); - - // compute the delta between visual object's mid an its nozzle COG - var contentCogToMid = new Point( - contentCOG.Value.X - contentObject.Width / 2.0, - contentCOG.Value.Y - contentObject.Height / 2.0); - - if (npArr == null || npCOG == null || npRadius == null - || contentCOG == null || contentRadius == null) - continue; - - // based on the radius and COG information, construct a start vector - // FIX: radius could be 0! - var start = new UIElementHelper.Transformation2D( - (contentRadius.Value < 0.01) ? 1.0 : npRadius.Value / contentRadius.Value, - vo.rotation.Value, - npCOG.Value.X, npCOG.Value.Y - ); - - // disturb it? -#if _only_testing -#pragma warning disable 162 - // ReSharper disable once HeuristicUnreachableCode - { - // ReSharper disable once HeuristicUnreachableCode - start.Rot += -15.0 + 30.0 * rnd.NextDouble(); - start.Scale *= 0.8 + 0.4 * rnd.NextDouble(); - start.OfsX += -5.0 + 10.0 * rnd.NextDouble(); - start.OfsY += -5.0 + 10.0 * rnd.NextDouble(); - } -#pragma warning restore 162 -#endif - // improve it - var better = UIElementHelper.FindBestFitForFieldOfPoints( - symbol.NozzlePos, npArr, start, 0.3, 30.0, 10.0, 10, 3); - if (better != null) - start = better; - - // draw it - UIElementHelper.ApplyMultiLabel(contentObject, - new[] { - new Tuple("%TAG%", "" + vo.Name) - }); - - - if (obj.Name == "P001") - { - } - - var shape = ConstructDirectVO(contentObject, 1.0 * start.Scale, 1.0 * start.Rot, - contentCOG.Value); - shape.Width *= start.Scale; - shape.Height *= start.Scale; - - var sr = new Rect( - start.OfsX - shape.Width / 2, - start.OfsY - shape.Height / 2, - shape.Width, - shape.Height); - - if (drawBoundingBoxes) - DrawToCanvasAtPositionSize(canvas, sr.X, sr.Y, sr.Width, sr.Height, - ConstructRect(Brushes.Blue, 1.0)); - - // Correct position for drawing the shape for some IRRATIONAL offset and the delta - // between shape's mid and the COG of the nozzles - - sr.Location = new Point( - sr.X - 2.0 - contentCogToMid.X * start.Scale, - sr.Y - 2.0 - contentCogToMid.Y * start.Scale); - - // for debugging? - //// DrawHandlePoint(canvas, sr.X, sr.Y, drawHandlePoints); - - // draw - shape.Tag = vo; - shape.BorderThickness = new Thickness(2); - shape.BorderBrush = Brushes.Orange; - DrawToCanvasAtPositionSize(canvas, sr.X, sr.Y, sr.Width, sr.Height, shape); - - // register in dynInstance? - if (vo.dynInstance != null) - { - vo.dynInstance.SymbolElement = shape; - vo.dynInstance.RedrawSymbol(); - } - - // draw the label at mid of bounding box - var labeltb = UIElementHelper.CreateStickyLabel(this.LabelFontSettings, "" + vo.Name); - labeltb.Tag = vo; - UIElementHelper.DrawToCanvasAtPositionAligned(canvas, - vo.x.Value + vo.width.Value / 2, - vo.y.Value + vo.height.Value / 2, - UIElementHelper.TranslateRotToAlignemnt(start.Rot), labeltb); - - } - else - if (vo.visObj.Placement == MtpSymbol.SymbolPlaceType.StretchToBoundingBox) - { - // make bounding box Rect - if (drawBoundingBoxes) - DrawToCanvasAtPositionSize(canvas, - vo.x.Value, vo.y.Value, - vo.width.Value, vo.height.Value, ConstructRect(Brushes.Blue, 1.0)); - - // draw it - UIElementHelper.ApplyMultiLabel(contentObject, new[] { - new Tuple("%TAG%", "" + vo.Name) - }); - var vb = ConstructViewboxVO(contentObject, vo.rotation.Value); - vb.Tag = vo; - DrawToCanvasAtPositionSize(canvas, - vo.x.Value, vo.y.Value, - vo.width.Value, vo.height.Value, vb); - } - else - { - // right now, impossible! - } - } - else - { - // make missing part Rect - if (drawBoundingBoxes) - DrawToCanvasAtPositionSize(canvas, - vo.x.Value, vo.y.Value, - vo.width.Value, vo.height.Value, ConstructRect(Brushes.Red, 2.0)); - } - } - - // handle in the mid - DrawHandlePoint(canvas, - vo.x.Value + vo.width.Value / 2, vo.y.Value + vo.height.Value / 2, - drawHandlePoints); - } - - // - // Topology Object - // - if (obj is MtpData.MtpTopologyObject to) - { - // draw source / sink? - if (to.ObjClass >= 301 && to.ObjClass <= 302 && to.x != null && to.y != null) - { - // get visual object - var contentObject = ConstructContentObject(to.visObj); - UIElementHelper.ApplyMultiLabel(contentObject, new[] { - new Tuple("%TAG%", "" + to.Name) - }); - - if (to.visObj != null && contentObject != null) - { - // determine XY - // Note: still not knowing, if to use nozzle or measurement - Nullable targetPos = null; - if (to.nozzlePoints != null && to.nozzlePoints.Count > 0 - && to.nozzlePoints[0].X > 0.001 && to.nozzlePoints[0].Y > 0.001) - targetPos = to.nozzlePoints[0]; - if (to.measurementPoints != null && to.measurementPoints.Count > 0 - && to.measurementPoints[0].X > 0.001 && to.measurementPoints[0].Y > 0.001) - targetPos = to.measurementPoints[0]; - if (targetPos == null) - targetPos = new Point(to.x.Value, to.y.Value); - - // draw nozzle based - if (to.visObj.Placement == MtpSymbol.SymbolPlaceType.FitNozzles - && to.visObj.Symbol?.NozzlePos != null && to.visObj.Symbol?.NozzlePos.Length > 0) - { - // draw centered to nozzle pos in fixed size - var vb = ConstructViewboxVO(contentObject, rotation: 0.0); - vb.Height = 40; - vb.Width = 40; - vb.Stretch = Stretch.UniformToFill; - vb.Tag = to; - UIElementHelper.DrawToCanvasAtPositionAligned(canvas, - targetPos.Value.X, targetPos.Value.Y, - UIElementHelper.DrawToCanvasAlignment.Centered, vb); - - // make bounding box Rect - if (drawBoundingBoxes) - DrawToCanvasAtPositionSize(canvas, - targetPos.Value.X - vb.Width / 2, targetPos.Value.Y - vb.Height / 2, - vb.Width, vb.Height, ConstructRect(Brushes.Blue, 1.0)); - - // draw a nice label - var labelPos = UIElementHelper.RescalePointsByRatioOfFEs(contentObject, - vb, to.visObj.Symbol?.LabelPos); - - // draw the label - var pos = new Point(targetPos.Value.X, targetPos.Value.Y); - var li = (int)to.visObj.LabelAlignment; - if (li >= 0 && labelPos != null && li < labelPos.Length) - pos = pos + (Vector)labelPos[li]; - var labeltb = UIElementHelper.CreateStickyLabel(this.LabelFontSettings, "" + to.Name); - labeltb.Tag = to; - UIElementHelper.DrawToCanvasAtPositionAligned(canvas, - pos.X, pos.Y, - to.visObj.LabelAlignment, labeltb); - } - else - { - // draw square-sized symbol in fixed size over (x/y) - var size = 50; - - // make bounding box Rect - if (drawBoundingBoxes) - DrawToCanvasAtPositionSize(canvas, - // ReSharper disable PossibleLossOfFraction - to.x.Value - size / 2, to.y.Value - size / 2, - size, size, ConstructRect(Brushes.DarkOrange, 1.0)); - - // all helpers are NULL-invariant - var vb = ConstructViewboxVO(contentObject, rotation: 0.0); - vb.Tag = to; - DrawToCanvasAtPositionSize(canvas, - to.x.Value - size / 2, to.y.Value - size / 2, - size, size, vb); - } - - // handle - DrawHandlePoint(canvas, targetPos.Value.X, targetPos.Value.Y, drawHandlePoints); - } - } - } - } - } - - private MtpData.MtpPicture activePicture = null; - - public void SetPicture(MtpData.MtpPicture picture) - { - this.activePicture = picture; - } - - public void RedrawMtp() - { - // check - if (this.activePicture == null) - return; - - // draw & collect click objects - this.DrawMtpPictureIntoCanvas(canvasVisu, this.activePicture, - drawHandlePoints: checkboxDrawHP.IsChecked == true, - drawBoundingBoxes: checkboxDrawBB.IsChecked == true); - } - - // - // Callback handling - // - - private double zoomFactor = 1.0; - - public void ApplyCanvasZoom(double newZoom) - { - if (canvasVisu == null) - return; - this.zoomFactor = newZoom; - ScaleTransform scale = new ScaleTransform(this.zoomFactor, this.zoomFactor); - canvasVisu.LayoutTransform = scale; - } - - public void ZoomToFitCanvas() - { - if (canvasVisu == null || gridOuter == null) - return; - try - { - var ratioX = canvasVisu.Width / (gridOuter.ActualWidth - 15); - var ratioY = canvasVisu.Height / (gridOuter.ActualHeight - 2 * 15); - var ratio = Math.Max(ratioX, ratioY); - if (ratio > 0.05) - ApplyCanvasZoom(1.0f / ratio); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - ApplyCanvasZoom(1.0f); - } - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - if (sender == buttonZoomIn) - { - ApplyCanvasZoom(this.zoomFactor * 1.15f); - } - if (sender == buttonZoomOut) - { - ApplyCanvasZoom(this.zoomFactor * 0.9f); - } - if (sender == buttonZoomFit) - { - ZoomToFitCanvas(); - } - if (sender == checkboxDrawBB || sender == checkboxDrawHP) - { - RedrawMtp(); - } - } - - // doubts? see: https://stackoverflow.com/questions/5000228/how-can-you-get-the-parent-of-a-uielement - - private object FindTagOfFrameworkElementParents(FrameworkElement fe) - { - if (fe.Tag != null) - return fe.Tag; - if (fe.Parent is FrameworkElement fep) - return FindTagOfFrameworkElementParents(fep); - return null; - } - - private void CanvasVisu_MouseDown(object sender, MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Left && e.ClickCount == 2 && e.Source is FrameworkElement fe) - { - ; - - // fe could be a fine-detail FrameworkElement; check if some father hat a Tag - var tag = FindTagOfFrameworkElementParents(fe); - if (tag is MtpData.MtpBaseObject mbo) - { - MtpObjectDoubleClick?.Invoke(mbo); - } - } - } - - // - // Timer - // - - private void DispatcherTimer_Tick(object sender, EventArgs e) - { - if (this.activePicture?.Objects != null) - foreach (var mo in this.activePicture.Objects) - if (mo is MtpVisualObject vo && vo.dynInstance != null) - vo.dynInstance.Tick(this.VisuOptions); - } - } -} diff --git a/src/WpfMtpControl/MtpVisualObjectLib.cs b/src/WpfMtpControl/MtpVisualObjectLib.cs deleted file mode 100644 index ea3bb54ea..000000000 --- a/src/WpfMtpControl/MtpVisualObjectLib.cs +++ /dev/null @@ -1,383 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Markup; -using System.Windows.Shapes; -using System.Xml; - -namespace WpfMtpControl -{ - public class MtpSymbolMapRecord - { - /// - /// Applicable eClass Versions, delimited by ";". If empty, then any! - /// - public string EClassVersions = ""; - - /// - /// Applicable eClass Classes, delimited by ";". Only digits allow ("01024455"), - /// If empty, then eClassIRDI shall be set. - /// - public string EClassClasses = null; - - /// - /// Applicable eClass IRIDs, delimited by ";". If empty, then eClassClass shall be set. - /// - public string EClassIRDIs = null; - - /// - /// For the default (off) state. Full name of the symbol, that is "LibName"."SymbolName", - /// - public string SymbolDefault = null; - - /// - /// For the active (on) state. Full name of the symbol, that is "LibName"."SymbolName", - /// - public string SymbolActive = null; - - /// - /// For the intermediate (transitioning) state. Full name of the symbol, that is "LibName"."SymbolName", - /// - public string SymbolIntermediate = null; - - /// - /// Free use. - /// - public string Comment = null; - - /// - /// Priority for finding best match. Increasing is higher prio. - /// - public int Priority = 1; - - // - // Constructors - // - - public MtpSymbolMapRecord() { } - - public MtpSymbolMapRecord(string EClassVersions, string EClassClasses, string EClassIRDIs, - string SymbolDefault, string SymbolActive = null, string SymbolIntermediate = null, - string Comment = null, int Priority = 1) - { - this.EClassVersions = EClassVersions; - this.EClassClasses = EClassClasses; - this.EClassIRDIs = EClassIRDIs; - this.SymbolDefault = SymbolDefault; - this.SymbolActive = SymbolActive; - this.SymbolIntermediate = SymbolIntermediate; - this.Comment = Comment; - this.Priority = Priority; - } - } - - public class MtpSymbolMapRecordList : List - { - } - - public class MtpVisualObjectRecord - { - /// - /// Helpful name - /// - public string Name = ""; - - /// - /// Applicable eClass Versions. If empty, then any! - /// - public Dictionary eClassVersions = null; - - /// - /// Applicable eClass Classes. Only digits allow ("01024455"), If empty, then eClassIRDI shall be set. - /// - public Dictionary eClassClasses = null; - - /// - /// Applicable eClass IRIDs. If empty, then eClassClass shall be set. - /// - public Dictionary eClassIRDIs = null; - - /// - /// Reference to symbol, which is used - /// - public MtpSymbol Symbol = null; - - /// - /// Preffered placement type - /// - public MtpSymbol.SymbolPlaceType Placement = MtpSymbol.SymbolPlaceType.StretchToBoundingBox; - - /// - /// Preferred label alignment - /// - public UIElementHelper.DrawToCanvasAlignment LabelAlignment = UIElementHelper.DrawToCanvasAlignment.Centered; - - /// - /// Priority for finding best match. Increasing is higher prio. - /// - public int Priority = 1; - - public MtpVisualObjectRecord() { } - - /// - /// Initialize a record. - /// - /// Name. Not used for matching. - /// - /// Applicable eClass Versions, delimited by ";". If empty, then any! - /// Applicable eClass Classes, delimited by ";". Only digits allow ("01024455"), - /// If empty, then eClassIRDI shall be set. - /// Applicable eClass IRIDs, delimited by ";". If empty, then eClassClass shall - /// be set. - /// - /// - /// - public MtpVisualObjectRecord( - string Name, - MtpSymbol Symbol, - string eClassVersions = null, - string eClassClasses = null, - string eClassIRDIs = null, - Nullable placement = null, - UIElementHelper.DrawToCanvasAlignment labelAlignment = UIElementHelper.DrawToCanvasAlignment.Centered, - int prio = 1) - { - this.Name = Name; - this.Symbol = Symbol; - this.eClassVersions = PrepDict(eClassVersions); - this.eClassClasses = PrepDict(eClassClasses); - this.eClassIRDIs = PrepDict(eClassIRDIs); - if (placement != null) - this.Placement = placement.Value; - this.LabelAlignment = labelAlignment; - this.Priority = prio; - } - - public MtpVisualObjectRecord(MtpSymbolLib symbolLib, MtpSymbolMapRecord config) - { - if (config != null) - { - this.Name = config.SymbolDefault; - this.eClassVersions = PrepDict(config.EClassVersions); - this.eClassClasses = PrepDict(config.EClassClasses); - this.eClassIRDIs = PrepDict(config.EClassIRDIs); - - if (symbolLib != null && symbolLib.ContainsKey(config.SymbolDefault)) - { - var symbol = symbolLib[config.SymbolDefault]; - this.Symbol = symbol; - this.Placement = symbol.PreferredPlacement; - this.LabelAlignment = symbol.PreferredLabelAlignment; - } - - this.Priority = config.Priority; - } - - } - - public static Dictionary PrepDict(string str) - { - if (str == null) - return null; - var arr = str.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (arr == null || arr.Length < 1) - return null; - var res = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - foreach (var a in arr) - res.Add(a, a); - return res; - } - - public static string FilterEclassClass(string input) - { - if (input == null) - return null; - var justNumbers = new String(input.Where(Char.IsDigit).ToArray()); - return justNumbers; - } - - } - - public class MtpVisualObjectLib - { - private List records = new List(); - - /// - /// Call once to load the static definitions, which are contained in the resources. - /// - public void LoadStatic(MtpSymbolLib syms) - { - - // add elements - records.Add(new MtpVisualObjectRecord("Pressurized_vessel_horizontal", - syms["PNID_ISO10628.Pressurized_vessel_horizontal"], - eClassVersions: "10.1", eClassClasses: "99999999", prio: 0)); - - records.Add(new MtpVisualObjectRecord("Pressurized_vessel_vertical", - syms["PNID_ISO10628.Pressurized_vessel_vertical"], - eClassClasses: "36020190;36030101", prio: 0)); - - records.Add(new MtpVisualObjectRecord("Shutoff_Valve", - syms["PNID_ISO10628.Shutoff_Valve_nozzled"], - eClassVersions: "10.1", eClassClasses: "37010201", - placement: MtpSymbol.SymbolPlaceType.FitNozzles, prio: 0)); - - //// records.Add(new MtpVisualObjectRecord("Pump_general", - //// syms["PNID_ISO10628.Pump_general_nozzled"], - //// eClassClasses: "36419090;3641", placement: MtpSymbol.SymbolPlaceType.FitNozzles, prio: 0)); - - records.Add(new MtpVisualObjectRecord("Sensor_general", - syms["PNID_ISO10628.Sensor_general"], - eClassClasses: "27209090;27143121;27200492;27200600;27200200;27200589", prio: 0)); - - records.Add(new MtpVisualObjectRecord("Controller_general", - syms["PNID_ISO10628.Sensor_general"], - eClassClasses: "27210790;27210101", prio: 0)); - - records.Add(new MtpVisualObjectRecord("Source_general", - syms["PNID_ISO10628.Source_tagged"], - placement: MtpSymbol.SymbolPlaceType.FitNozzles, - labelAlignment: UIElementHelper.DrawToCanvasAlignment.North, prio: 0)); - - records.Add(new MtpVisualObjectRecord("Sink_general", - syms["PNID_ISO10628.Sink_tagged"], - placement: MtpSymbol.SymbolPlaceType.FitNozzles, - labelAlignment: UIElementHelper.DrawToCanvasAlignment.South, prio: 0)); - - // access resource dictionaries FESTO - - records.Add(new MtpVisualObjectRecord("Control_Valve", - syms["PNID_Festo.control_valve_tagged-u-nozzled"], - eClassClasses: "37010203", placement: MtpSymbol.SymbolPlaceType.FitNozzles, prio: 0)); - - records.Add(new MtpVisualObjectRecord("Manual_Valve", - syms["PNID_Festo.manual_valve_default-u-nozzled"], - eClassClasses: "37010201", placement: MtpSymbol.SymbolPlaceType.FitNozzles, prio: 0)); - - records.Add(new MtpVisualObjectRecord("Stirrer", - syms["PNID_Festo.stirrer_active-u"], - eClassClasses: "36090590", placement: MtpSymbol.SymbolPlaceType.StretchToBoundingBox, prio: 0)); - - records.Add(new MtpVisualObjectRecord("Pump_general", - syms["PNID_Festo.pump_active-r-nozzled"], - eClassClasses: "36419090;3641", placement: MtpSymbol.SymbolPlaceType.FitNozzles, prio: 0)); - } - - public void LoadFromSymbolMappings(MtpSymbolLib symbolLib, IEnumerable mappings) - { - // access - if (symbolLib == null | mappings == null) - return; - - // each .. - foreach (var map in mappings) - records.Add(new MtpVisualObjectRecord(symbolLib, map)); - } - - public MtpVisualObjectRecord FindVisualObjectByName(string name) - { - // try find - foreach (var rec in records) - { - // try to find negative events! - if (name != null && name.Length > 0 && rec.Name.ToLower() != name.Trim().ToLower()) - continue; - // ok - return rec; - } - - // end of search - return null; - } - - public static bool MatchEclassClass(Dictionary recClasses, string thisClass) - { - // specified in record? .. if not, default: True - if (recClasses == null || recClasses.Count < 1) - return true; - if (thisClass == null || thisClass.Length < 1) - return false; - - // split rec classes - foreach (var rc in recClasses.Values) - { - // require to be formally valid - var rcc = rc.Trim(); - - // ok, if partially match - if (thisClass.StartsWith(rcc)) - return true; - } - - // ok, not - return false; - } - - public MtpVisualObjectRecord FindVisualObjectByClass( - string eClassVersion = null, string eClassClass = null, string eClassIRDI = null) - { - // prepare input - eClassClass = MtpVisualObjectRecord.FilterEclassClass(eClassClass); - - // minimal match - if (eClassClass != null) - eClassClass = eClassClass.Trim(); - if (eClassIRDI != null) - eClassIRDI = eClassIRDI.Trim(); - if ((eClassClass == null || eClassClass.Length < 1) - && (eClassIRDI == null || eClassIRDI.Length < 1)) - return null; - - // try find - MtpVisualObjectRecord foundRec = null; - int foundPrio = -1; - - foreach (var rec in records) - { - // record either needs to have class or irdi - if ((rec.eClassClasses == null || rec.eClassClasses.Count < 1) - && (rec.eClassIRDIs == null || rec.eClassIRDIs.Count < 1)) - continue; - - // try to find negative events! - if (eClassVersion != null && eClassVersion.Length > 0 && rec.eClassVersions != null - && !rec.eClassVersions.ContainsKey(eClassVersion)) - continue; - //// if (eClassClass != null && eClassClass.Length > 0 && rec.eClassClasses != null - //// && !rec.eClassClasses.ContainsKey(eClassClass)) - //// continue; - if (!MatchEclassClass(rec.eClassClasses, eClassClass)) - continue; - if (eClassIRDI != null && eClassIRDI.Length > 0 && rec.eClassIRDIs != null - && !rec.eClassIRDIs.ContainsKey(eClassIRDI)) - continue; - - // check if better? - if (rec.Priority >= foundPrio) - { - foundRec = rec; - foundPrio = rec.Priority; - } - } - - // end of search - return foundRec; - } - } -} diff --git a/src/WpfMtpControl/Properties/AssemblyInfo.cs b/src/WpfMtpControl/Properties/AssemblyInfo.cs deleted file mode 100644 index 05f930c80..000000000 --- a/src/WpfMtpControl/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("WpfMtpControl")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WpfMtpControl")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie -//ImCodeVerwendeteKultur in der .csproj-Datei -//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch -//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung -//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, -//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher - //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, - // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) - ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs - //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, - // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) -)] - - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/WpfMtpControl/Properties/Resources.Designer.cs b/src/WpfMtpControl/Properties/Resources.Designer.cs deleted file mode 100644 index a78a97c8e..000000000 --- a/src/WpfMtpControl/Properties/Resources.Designer.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion: 4.0.30319.42000 -// -// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn -// der Code neu generiert wird. -// -//------------------------------------------------------------------------------ - -namespace WpfMtpControl.Properties { - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse - // über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfMtpControl.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/src/WpfMtpControl/Properties/Resources.resx b/src/WpfMtpControl/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/src/WpfMtpControl/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/WpfMtpControl/Properties/Settings.Designer.cs b/src/WpfMtpControl/Properties/Settings.Designer.cs deleted file mode 100644 index 368052671..000000000 --- a/src/WpfMtpControl/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WpfMtpControl.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/WpfMtpControl/Properties/Settings.settings b/src/WpfMtpControl/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/src/WpfMtpControl/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/WpfMtpControl/Resources/PNID_DIN_EN_ISO_10628.xaml b/src/WpfMtpControl/Resources/PNID_DIN_EN_ISO_10628.xaml deleted file mode 100644 index c58ba25f2..000000000 --- a/src/WpfMtpControl/Resources/PNID_DIN_EN_ISO_10628.xaml +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/WpfMtpControl/Resources/PNID_Festo.xaml b/src/WpfMtpControl/Resources/PNID_Festo.xaml deleted file mode 100644 index 54a1fa9ef..000000000 --- a/src/WpfMtpControl/Resources/PNID_Festo.xaml +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/WpfMtpControl/UiElementHelper.cs b/src/WpfMtpControl/UiElementHelper.cs deleted file mode 100644 index 05179e94c..000000000 --- a/src/WpfMtpControl/UiElementHelper.cs +++ /dev/null @@ -1,497 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Shapes; -using System.Xml; - -namespace WpfMtpControl -{ - // ReSharper disable once ClassNeverInstantiated.Global - public class UIElementHelper - { - public static UIElement cloneElement(UIElement orig) - { - if (orig == null) - return (null); - - string s = XamlWriter.Save(orig); - StringReader stringReader = new StringReader(s); - XmlReader xmlReader = XmlTextReader.Create(stringReader, new XmlReaderSettings()); - return (UIElement)XamlReader.Load(xmlReader); - - } - - public static Label FindLabelWithText(System.Windows.DependencyObject parent, string textToFind) - { - // trivial - if (parent == null) - return null; - - // recurse visual tree - int childrenCount = System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); - for (int i = 0; i < childrenCount; i++) - { - var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i); - - // deep inspect? - var childLabel = child as Label; - if (childLabel != null && childLabel.Content != null) - { - var childLabelText = childLabel.Content as string; - if (childLabelText != null && childLabelText.Trim() == textToFind.Trim()) - return childLabel; - } - - // recurse? - var childFound = FindLabelWithText(child, textToFind); - if (childFound != null) - return childFound; - } - - // no - return null; - } - - public static void ApplyMultiLabel(FrameworkElement contentObject, Tuple[] labelTexts = null) - { - // trivial - if (contentObject == null) - return; - - // can name labels? - if (labelTexts != null) - foreach (var lt in labelTexts) - { - var tagLebel = UIElementHelper.FindLabelWithText(contentObject, lt.Item1); - if (tagLebel != null) - tagLebel.Content = "" + lt.Item2; - } - } - - private static void FindNozzlesViaTagsIntern( - System.Windows.DependencyObject parent, Dictionary namedNozzles, - string matchHead, bool extractShapes = false) - { - // trivial - if (parent == null || namedNozzles == null) - return; - - var toExtract = new List(); - - // recurse visual tree - int childrenCount = System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); - for (int i = 0; i < childrenCount; i++) - { - var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i); - - // deep inspect? - var childEllipse = child as Ellipse; - if (childEllipse != null) - { - var childEllipseTagText = childEllipse.Tag as string; - if (childEllipseTagText != null && childEllipseTagText.Trim() != "") - { - var m = Regex.Match(childEllipseTagText, matchHead + @"#(\d+)"); - if (m.Success) - { - var nid = Convert.ToInt32(m.Groups[1].ToString()); - - var x = Canvas.GetLeft(childEllipse) + childEllipse.Width / 2; - var y = Canvas.GetTop(childEllipse) + childEllipse.Height / 2; - if (nid > 0 && nid < 99) - namedNozzles[nid] = new Point(x, y); - - // extract? - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (extractShapes && child is UIElement) - toExtract.Add(child as UIElement); - } - } - } - - // recurse? - FindNozzlesViaTagsIntern(child, namedNozzles, matchHead, extractShapes); - } - - if (extractShapes && parent is Canvas) - foreach (var te in toExtract) - (parent as Canvas).Children.Remove(te); - - } - - public static Point[] FindNozzlesViaTags( - System.Windows.DependencyObject parent, string matchHead, bool extractShapes = false) - { - // find named nozzles - var namedNozzles = new Dictionary(); - UIElementHelper.FindNozzlesViaTagsIntern(parent, namedNozzles, matchHead, extractShapes: extractShapes); - - // integrity check - for (int i = 0; i < namedNozzles.Count; i++) - if (!namedNozzles.ContainsKey(1 + i)) - { - namedNozzles = null; - break; - } - - // still there - Point[] res = null; - if (namedNozzles != null) - { - res = new Point[namedNozzles.Count]; - for (int i = 0; i < namedNozzles.Count; i++) - res[i] = namedNozzles[1 + i]; - } - - return res; - } - - /// - /// Computes center of gravity, returns null in case of any error. - /// - public static Nullable ComputeCOG(Point[] pts) - { - if (pts == null || pts.Length < 1) - return null; - - var sum = pts[0]; - for (int i = 1; i < pts.Length; i++) - sum.Offset(pts[i].X, pts[i].Y); - sum.X /= 1.0 * pts.Length; - sum.Y /= 1.0 * pts.Length; - - return sum; - } - - /// - /// Computes the maximum distance of each point to a given center point. Returns null in case of any error. - /// - public static Nullable ComputeRadiusForCenterPointer(Point[] pts, Point cog) - { - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (pts == null || pts.Length < 1 || cog == null) - return null; - - var r = 0.0; - for (int i = pts.Length - 1; i >= 0; i--) - { - var xd = pts[i].X - cog.X; - var yd = pts[i].Y - cog.Y; - var d = Math.Sqrt(xd * xd + yd * yd); - if (d > r) - r = d; - } - - return r; - } - - public static Point[] RescalePointsByRatioOfFEs( - FrameworkElement original, FrameworkElement scaled, Point[] ptsOriginal) - { - if (original == null || scaled == null || ptsOriginal == null || ptsOriginal.Length < 1) - return null; - var scaleFac = Math.Min(scaled.Width / original.Width, scaled.Height / original.Height); - var ptsScaled = new Point[ptsOriginal.Length]; - for (int i = 0; i < ptsOriginal.Length; i++) - { - var x = (ptsOriginal[i].X - original.Width / 2) * scaleFac; - var y = (ptsOriginal[i].Y - original.Height / 2) * scaleFac; - ptsScaled[i] = new Point(x, y); - } - return ptsScaled; - } - - public class Transformation2D - { - public double Scale, Rot, OfsX, OfsY; - public Transformation2D() { } - public Transformation2D(double Scale, double Rot, double OfsX, double OfsY) - { - this.Scale = Scale; - this.Rot = Rot; - this.OfsX = OfsX; - this.OfsY = OfsY; - } - } - - public static Point[] ApplyTransformation(Transformation2D trans, Point center, Point[] pts) - { - // setup - if (pts == null || pts.Length < 1) - return null; - var res = new Point[pts.Length]; - - // 1 for 1 - for (int i = 0; i < pts.Length; i++) - { - // around center .. - var x = pts[i].X - center.X; - var y = pts[i].Y - center.Y; - - // scale - x = x * trans.Scale; - y = y * trans.Scale; - - // rotate (mathematically positive!) - var radian = -trans.Rot * (Math.PI / 180); - double cosTheta = Math.Cos(radian); - double sinTheta = Math.Sin(radian); - var nx = cosTheta * x - sinTheta * y; - var ny = sinTheta * x + cosTheta * y; - - // move - nx += trans.OfsX; - ny += trans.OfsY; - - // store - res[i] = new Point(nx, ny); - } - - // ok - return res; - } - - public static Nullable CumulatedErrorToFieldOfPoints(Point[] pts, Point[] field) - { - // setup - if (pts == null || field == null || pts.Length < 1 || field.Length < 1) - return null; - double res = 0; - - // we're striking through the field of points - var strike = new bool[field.Length]; - - // pts are leading - // ReSharper disable once ForCanBeConvertedToForeach - for (int pi = 0; pi < pts.Length; pi++) - { - // find neareast neighbour - var nd = Double.MaxValue; - var nfi = -1; - for (int fi = 0; fi < field.Length; fi++) - if (!strike[fi]) - { - var dx = field[fi].X - pts[pi].X; - var dy = field[fi].Y - pts[pi].Y; - var d = Math.Sqrt(dx * dx + dy * dy); - if (d < nd) - { - nd = d; - nfi = fi; - } - } - - // there is no room for uups! - if (nfi < 0) - return null; - - // compute - res += nd; - strike[nfi] = true; - } - - // ok - return res; - } - - public static Transformation2D FindBestFitForFieldOfPoints( - Point[] pts, Point[] field, - Transformation2D start, - double rangeScale, double rangeRot, double rangeXY, - int steps, int iterations) - { - // setup - if (pts == null || field == null || pts.Length < 1 || field.Length < 1 || start == null || iterations < 0) - return null; - - // systematicall apply disturbances - // on the hierarchy: scale, rot (in degrees), ofsX, ofsY - - var bestTrans = start; - double bestError = Double.MaxValue; - var be = CumulatedErrorToFieldOfPoints(pts, field); - if (be != null) - bestError = be.Value; - - var center = ComputeCOG(pts); - if (center == null) - return null; - - for (int iScale = 0; iScale <= steps; iScale++) - for (int iRot = 0; iRot <= steps; iRot++) - for (int iY = 0; iY <= steps; iY++) - for (int iX = 0; iX <= steps; iX++) - { - // current point - var currTrans = new Transformation2D( - start.Scale - rangeScale + (2 * rangeScale * iScale / steps), - start.Rot - rangeRot + (2 * rangeRot * iRot / steps), - start.OfsX - rangeXY + (2 * rangeXY * iX / steps), - start.OfsY - rangeXY + (2 * rangeXY * iY / steps)); - - // some parts of the vectorroom are "taboo" - if (currTrans.Scale <= 0.000) - continue; - - // transform - var currPts = ApplyTransformation(currTrans, center.Value, pts); - - // evaluate - var error = CumulatedErrorToFieldOfPoints(currPts, field); - if (error != null && error.Value < bestError) - { - bestError = error.Value; - bestTrans = currTrans; - } - } - - // go into "recursion" - var rm = 1.0 / steps; - // ReSharper disable once UnusedVariable - var betterTrans = FindBestFitForFieldOfPoints(pts, field, bestTrans, - rm * rangeScale, rm * rangeRot, rm * rangeXY, steps, iterations - 1); - - // result - return bestTrans; - } - - public class FontSettings - { - public FontFamily FontFamily; - public FontStyle Style; - public FontWeight Weight; - public FontStretch Stretch; - public double EmSize; - - public FontSettings() { } - - public FontSettings( - FontFamily fontFamily, FontStyle style, FontWeight weight, FontStretch stretch, double EmSize) - { - this.FontFamily = fontFamily; - this.Style = style; - this.Weight = weight; - this.Stretch = stretch; - this.EmSize = EmSize; - } - - public Size MeasureString(string candidate) - { - var formattedText = new FormattedText( - candidate, - CultureInfo.CurrentCulture, - FlowDirection.LeftToRight, - new Typeface(this.FontFamily, this.Style, this.Weight, this.Stretch), - this.EmSize, - Brushes.Black, - new NumberSubstitution(), - TextFormattingMode.Display, - /* - * (mristin, 2020-12-04) - * The following argument, pixelsPerDip, is a complicated one. We set it here to value 1.0 - * since we are simply upgrading NET Framework from 4.6.1 to 4.7.2. - * - * See https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI, - * https://stackoverflow.com/questions/40277388 and - * https://social.msdn.microsoft.com/Forums/vstudio/en-US/ef99bb56-df57-411a-a158-cad1eaa63850 - */ - 1.0 - ); - - return new Size(formattedText.Width, formattedText.Height); - } - } - - public static TextBlock CreateStickyLabel(FontSettings fontSettings, string text, double padding = 2.0) - { - var size = fontSettings.MeasureString(text); - // TODO (MICHA, 2020-10-04): check if font is set correctly .. - // TODO (MICHA, 2020-10-04): seems, that for Textblock the alignement DOES NOT WORK! - var tb = new TextBlock(); - tb.Height = size.Height + 2 * padding; - tb.Width = size.Width + 2 * padding; - tb.HorizontalAlignment = HorizontalAlignment.Center; - tb.VerticalAlignment = VerticalAlignment.Center; - tb.Text = text; - return tb; - } - - public enum DrawToCanvasAlignment { North = 0, East = 1, South = 2, West = 3, Centered = 4 }; - - public static DrawToCanvasAlignment TranslateRotToAlignemnt(double rot) - { - // modulo - var pi = Math.PI; - rot = rot % (2 * pi); - - // 4 segments for now - if (rot > -0.25 * pi && rot <= 0.25 * pi) - return DrawToCanvasAlignment.North; - if (rot > 0.25 * pi && rot <= 0.75 * pi) - return DrawToCanvasAlignment.East; - if (rot > 0.75 * pi && rot <= 1.25 * pi) - return DrawToCanvasAlignment.South; - if (rot > 1.25 * pi && rot <= 1.75 * pi) - return DrawToCanvasAlignment.North; - // ups - return DrawToCanvasAlignment.Centered; - } - - public static void DrawToCanvasAtPositionAligned( - Canvas canvas, double x, double y, DrawToCanvasAlignment alignment, FrameworkElement fe) - { - if (canvas == null || fe == null) - return; - canvas.Children.Add(fe); - - if (alignment == DrawToCanvasAlignment.North) - { - Canvas.SetLeft(fe, x - fe.Width / 2); - Canvas.SetTop(fe, y - fe.Height); - } - - if (alignment == DrawToCanvasAlignment.South) - { - Canvas.SetLeft(fe, x - fe.Width / 2); - Canvas.SetTop(fe, y); - } - - if (alignment == DrawToCanvasAlignment.West) - { - Canvas.SetLeft(fe, x - fe.Width); - Canvas.SetTop(fe, y - fe.Height / 2); - } - - if (alignment == DrawToCanvasAlignment.East) - { - Canvas.SetLeft(fe, x); - Canvas.SetTop(fe, y - fe.Height / 2); - } - - if (alignment == DrawToCanvasAlignment.Centered) - { - Canvas.SetLeft(fe, x - fe.Width / 2); - Canvas.SetTop(fe, y - fe.Height / 2); - } - } - - } -} diff --git a/src/WpfMtpControl/WpfMtpControl.csproj b/src/WpfMtpControl/WpfMtpControl.csproj deleted file mode 100644 index c6a3b9f5a..000000000 --- a/src/WpfMtpControl/WpfMtpControl.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - net6.0-windows - library - false - true - false - - - - - - - - PreserveNewest - - - - - - - - diff --git a/src/WpfMtpVisuViewer/App.xaml b/src/WpfMtpVisuViewer/App.xaml deleted file mode 100644 index 766a3efb2..000000000 --- a/src/WpfMtpVisuViewer/App.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/src/WpfMtpVisuViewer/App.xaml.cs b/src/WpfMtpVisuViewer/App.xaml.cs deleted file mode 100644 index 56f34d750..000000000 --- a/src/WpfMtpVisuViewer/App.xaml.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace WpfMtpVisuViewer -{ - public partial class App : Application - { - } -} diff --git a/src/WpfMtpVisuViewer/LICENSE.txt b/src/WpfMtpVisuViewer/LICENSE.txt deleted file mode 100644 index 01f9cb5eb..000000000 --- a/src/WpfMtpVisuViewer/LICENSE.txt +++ /dev/null @@ -1,1475 +0,0 @@ -Copyright (c) 2018-2023 Festo SE & Co. KG -, -author: Michael Hoffmeister - -Copyright (c) 2019-2021 PHOENIX CONTACT GmbH & Co. KG -, -author: Andreas Orzelski - -Copyright (c) 2019-2020 Fraunhofer IOSB-INA Lemgo, - eine rechtlich nicht selbstaendige Einrichtung der Fraunhofer-Gesellschaft - zur Foerderung der angewandten Forschung e.V. - -Copyright (c) 2020 Schneider Electric Automation GmbH -, -author: Marco Mendes - -Copyright (c) 2020 SICK AG - -Copyright (c) 2021 KEB Automation KG - -Copyright (c) 2021 Lenze SE -author: Jonas Grote, Denis Göllner, Sebastian Bischof - -The AASX Package Explorer is licensed under the Apache License 2.0 -(Apache-2.0, see below). - -The AASX Package Explorer is a sample application for demonstration of the -features of the Asset Administration Shell. -The implementation uses the concepts of the document "Details of the Asset -Administration Shell" published on www.plattform-i40.de which is licensed -under Creative Commons CC BY-ND 3.0 DE. - -When using eCl@ss or IEC CDD data, please check the corresponding license -conditions. - -------------------------------------------------------------------------------- - -The components below are used in AASX Package Explorer. -The related licenses are listed for information purposes only. -Some licenses may only apply to their related plugins. - -The browser functionality is licensed under the cefSharp license (see below). - -The Newtonsoft.JSON serialization is licensed under the MIT License -(MIT, see below). - -The QR code generation is licensed under the MIT license (MIT, see below). - -The Zxing.Net Dot Matrix Code (DMC) generation is licensed under -the Apache License 2.0 (Apache-2.0, see below). - -The Grapevine REST server framework is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The AutomationML.Engine is licensed under the MIT license (MIT, see below). - -The MQTT server and client is licensed under the MIT license (MIT, see below). - -The ClosedXML Excel reader/writer is licensed under the MIT license (MIT, -see below). - -The CountryFlag WPF control is licensed under the Code Project Open License -(CPOL, see below). - -The DocumentFormat.OpenXml SDK is licensed under the MIT license (MIT, -see below). - -The ExcelNumberFormat number parser is licensed under the MIT license (MIT, -see below). - -The FastMember reflection access is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The IdentityModel OpenID client is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The jose-jwt object signing and encryption is licensed under the -MIT license (MIT, see below). - -The ExcelDataReader is licensed under the MIT license (MIT, see below). - -Portions copyright (c) by OPC Foundation, Inc. and licensed under the -Reciprocal Community License (RCL, see below) - -The OPC UA Example Code of OPC UA Standard is licensed under the MIT license -(MIT, see below). - -The MSAGL (Microsoft Automatic Graph Layout) is licensed under the MIT license -(MIT, see below) - -Glob (https://www.nuget.org/packages/Glob/) is licensed under the MIT license -(MIT, see below). - -The Magick.NET library is licensed under Apache License 2.0 -(Apache-2.0, see below). - -The SSharp.NET library (https://github.com/PetroProtsyk/SSharp) is licensed -under Apache License 2.0 (Apache-2.0, see below). - -------------------------------------------------------------------------------- - - -With respect to AASX Package Explorer -===================================== - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to cefSharp -======================== - -(https://raw.githubusercontent.com/cefsharp/CefSharp/master/LICENSE) - -Copyright © The CefSharp Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google Inc. nor the name Chromium Embedded - Framework nor the name CefSharp nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -With respect to Newtonsoft.Json -=============================== - -(https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md) - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to QRcoder -======================= - -(https://github.com/codebude/QRCoder/blob/master/LICENSE.txt) - -The MIT License (MIT) - -Copyright (c) 2013-2018 Raffael Herrmann - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to ZXing.Net -========================= -With respect to Grapevine -========================= -With respect to FastMember -========================== -With respect to IdentityModel -============================= - -(http://www.apache.org/licenses/LICENSE-2.0) - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -With respect to AutomationML.Engine -=================================== - -(https://raw.githubusercontent.com/AutomationML/AMLEngine2.1/master/license.txt) - -The MIT License (MIT) - -Copyright 2017 AutomationML e.V. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - -With respect to MQTTnet -======================= - -(https://github.com/chkr1011/MQTTnet/blob/master/LICENSE) - -MIT License - -MQTTnet Copyright (c) 2016-2019 Christian Kratky - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to ClosedXML -========================= - -(https://github.com/ClosedXML/ClosedXML/blob/develop/LICENSE) - -MIT License - -Copyright (c) 2016 ClosedXML - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepct to CountryFlag -=========================== - -(https://www.codeproject.com/Articles/190722/WPF-CountryFlag-Control) - -The Code Project Open License (CPOL) 1.02 - -Copyright © 2017 Meshack Musundi - -Preamble - -This License governs Your use of the Work. This License is intended to allow -developers to use the Source Code and Executable Files provided as part of -the Work in any application in any form. - -The main points subject to the terms of the License are: - - Source Code and Executable Files can be used in commercial applications; - Source Code and Executable Files can be redistributed; and - Source Code can be modified to create derivative works. - No claim of suitability, guarantee, or any warranty whatsoever is provided. - The software is provided "as-is". - The Article(s) accompanying the Work may not be distributed or republished - without the Author's consent - -This License is entered between You, the individual or other entity reading or -otherwise making use of the Work licensed pursuant to this License and the -individual or other entity which offers the Work under the terms of this -License ("Author"). - -License - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS -CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT -AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED -UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS -CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND -CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS -LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK. - -Definitions. - "Articles" means, collectively, all articles written by Author which -describes how the Source Code and Executable Files for the Work may -be used by a user. - "Author" means the individual or entity that offers the Work under -the terms of this License. - "Derivative Work" means a work based upon the Work or upon the Work -and other pre-existing works. - "Executable Files" refer to the executables, binary files, -configuration and any required data files included in the Work. - "Publisher" means the provider of the website, magazine, CD-ROM, -DVD or other medium from or by which the Work is obtained by You. - "Source Code" refers to the collection of source code and -configuration files used to create the Executable Files. - "Standard Version" refers to such a Work if it has not been modified, -or has been modified in accordance with the consent of the Author, -such consent being in the full discretion of the Author. - "Work" refers to the collection of files distributed by the Publisher, -including the Source Code, Executable Files, binaries, data files, -documentation, whitepapers and the Articles. - "You" is you, an individual or entity wishing to use the Work and -exercise your rights under this License. - -Fair Use/Fair Use Rights. Nothing in this License is intended to reduce, -limit, or restrict any rights arising from fair use, fair dealing, -first sale or other limitations on the exclusive rights of the -copyright owner under copyright law or other applicable laws. - -License Grant. Subject to the terms and conditions of this License, the -Author hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license -to exercise the rights in the Work as stated below: - You may use the standard version of the Source Code or Executable -Files in Your own applications. - You may apply bug fixes, portability fixes and other modifications -obtained from the Public Domain or from the Author. A Work modified -in such a way shall still be considered the standard version and will -be subject to this License. - You may otherwise modify Your copy of this Work (excluding the Articles) -in any way to create a Derivative Work, provided that You insert a prominent -notice in each changed file stating how, when and where You changed that file. - You may distribute the standard version of the Executable Files and Source -Code or Derivative Work in aggregate with other (possibly commercial) -programs as part of a larger (possibly commercial) software distribution. - The Articles discussing the Work published in any form by the author may -not be distributed or republished without the Author's consent. The author -retains copyright to any such Articles. You may use the Executable Files and -Source Code pursuant to this License but you may not repost or republish or -otherwise distribute or make available the Articles, without the prior written -consent of the Author. - -Any subroutines or modules supplied by You and linked into the Source Code -or Executable Files of this Work shall not be considered part of this Work -and will not be subject to the terms of this License. - -Patent License. Subject to the terms and conditions of this License, each -Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, -royalty-free, irrevocable (except as stated in this section) patent license -to make, have made, use, import, and otherwise transfer the Work. - -Restrictions. The license granted in Section 3 above is expressly made subject -to and limited by the following restrictions: - You agree not to remove any of the original copyright, patent, trademark, -and attribution notices and associated disclaimers that may appear in the -Source Code or Executable Files. - You agree not to advertise or in any way imply that this Work is a product -of Your own. - The name of the Author may not be used to endorse or promote products -derived from the Work without the prior written consent of the Author. - You agree not to sell, lease, or rent any part of the Work. This does -not restrict you from including the Work or any part of the Work inside -a larger software distribution that itself is being sold. The Work by itself, -though, cannot be sold, leased or rented. - You may distribute the Executable Files and Source Code only under the terms -of this License, and You must include a copy of, or the Uniform Resource -Identifier for, this License with every copy of the Executable Files or -Source Code You distribute and ensure that anyone receiving such Executable -Files and Source Code agrees that the terms of this License apply to such -Executable Files and/or Source Code. You may not offer or impose any terms -on the Work that alter or restrict the terms of this License or the -recipients' exercise of the rights granted hereunder. You may not sublicense -the Work. You must keep intact all notices that refer to this License and to -the disclaimer of warranties. You may not distribute the Executable Files or -Source Code with any technological measures that control access or use of the -Work in a manner inconsistent with the terms of this License. - You agree not to use the Work for illegal, immoral or improper -purposes, or on pages containing illegal, immoral or improper material. -The Work is subject to applicable export laws. You agree to comply with all -such laws and regulations that may apply to the Work after Your receipt of -the Work. - -Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS", -"WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR -CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, -INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. -AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES -OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS -OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR -PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK -(OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. -YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE -WORKS. - -Indemnity. You agree to defend, indemnify and hold harmless the Author and the -Publisher from and against any claims, suits, losses, damages, liabilities, -costs, and expenses (including reasonable legal or attorneys’ fees) -resulting from or relating to any use of the Work by You. - -Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, -IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, -EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH DAMAGES. - -Termination. - This License and the rights granted hereunder will terminate -automatically upon any breach by You of any term of this License. -Individuals or entities who have received Derivative Works from You under -this License, however, will not have their licenses terminated provided such -individuals or entities remain in full compliance with those licenses. -Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of -this License. - If You bring a copyright, trademark, patent or any other infringement -claim against any contributor over infringements You claim are made by the -Work, your License from such contributor to the Work ends automatically. - Subject to the above terms and conditions, this License is perpetual -(for the duration of the applicable copyright in the Work). -Notwithstanding the above, the Author reserves the right to release the Work -under different license terms or to stop distributing the Work at any time; -provided, however that any such election will not serve to withdraw this -License (or any other license that has been, or is required to be, -granted under the terms of this License), and this License will continue -in full force and effect unless terminated as stated above. - -Publisher. The parties hereby confirm that the Publisher shall not, under -any circumstances, be responsible for and shall not have any liability -in respect of the subject matter of this License. The Publisher makes no -warranty whatsoever in connection with the Work and shall not be liable -to You or any party on any legal theory for any damages whatsoever, including -without limitation any general, special, incidental or consequential damages -arising in connection to this license. The Publisher reserves the right to -cease making the Work available to You at any time without notice - -Miscellaneous - This License shall be governed by the laws of the location of the head -office of the Author or if the Author is an individual, the laws of -location of the principal place of residence of the Author. - If any provision of this License is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of the -remainder of the terms of this License, and without further action by the -parties to this License, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable. - No term or provision of this License shall be deemed waived and no -breach consented to unless such waiver or consent shall be in writing -and signed by the party to be charged with such waiver or consent. - This License constitutes the entire agreement between the parties -with respect to the Work licensed herein. There are no understandings, -agreements or representations with respect to the Work not specified herein. -The Author shall not be bound by any additional provisions that may appear -in any communication from You. This License may not be modified without -the mutual written agreement of the Author and You. - - -With respect to DocumentFormat.OpenXml -====================================== - -(https://github.com/OfficeDev/Open-XML-SDK/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to ExcelNumberFormat -================================= - -(https://github.com/andersnm/ExcelNumberFormat/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2017 andersnm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With respect to jose-jwt -======================== - -(https://github.com/dvsekhvalnov/jose-jwt/blob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014-2019 dvsekhvalnov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With resepect to ExcelDataReader -================================ - -(https://github.com/ExcelDataReader/ExcelDataReader/blob/develop/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2014 ExcelDataReader - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -With resepect to OPC UA Example Code -==================================== - - * Copyright (c) 2005-2019 The OPC Foundation, Inc. All rights reserved. - * - * OPC Foundation MIT License 1.00 - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * The complete license agreement can be found here: - * http://opcfoundation.org/License/MIT/1.00/ - - -With respect to OPC Foundation -============================== - -RCL License -Reciprocal Community License 1.00 (RCL1.00) -Version 1.00, June 24, 2009 -Copyright (C) 2008,2009 OPC Foundation, Inc., All Rights Reserved. - -https://opcfoundation.org/license/rcl.html - -Remark: PHOENIX CONTACT GmbH & Co. KG and Festo SE & Co. KG are members -of OPC foundation. - -With respect to MSAGL (Microsoft Automatic Graph Layout) -======================================================== -(see: https://github.com/microsoft/automatic-graph-layout/blob/master/LICENSE) - -Microsoft Automatic Graph Layout, MSAGL - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -With respect to Glob (https://www.nuget.org/packages/Glob/) -=========================================================== -(see: https://raw.githubusercontent.com/kthompson/glob/master/LICENSE) - -The MIT License (MIT) - -Copyright (c) 2013-2019 Kevin Thompson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -With respect to Magick.NET -========================== - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -With respect to SSharp.NET library -================================== - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/WpfMtpVisuViewer/MainWindow.xaml b/src/WpfMtpVisuViewer/MainWindow.xaml deleted file mode 100644 index b8750c709..000000000 --- a/src/WpfMtpVisuViewer/MainWindow.xaml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (c) 2019 by Michael Hoffmeister, Festo AG & Co. KG - - - diff --git a/src/WpfMtpVisuViewer/MainWindow.xaml.cs b/src/WpfMtpVisuViewer/MainWindow.xaml.cs deleted file mode 100644 index dd1c72647..000000000 --- a/src/WpfMtpVisuViewer/MainWindow.xaml.cs +++ /dev/null @@ -1,365 +0,0 @@ -/* -Copyright (c) 2018-2023 Festo SE & Co. KG -Author: Michael Hoffmeister - -This source code is licensed under the Apache License 2.0 (see LICENSE.txt). - -This source code may use other Open Source software components (see LICENSE.txt). -*/ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using AasxIntegrationBase; -using Newtonsoft.Json; -using WpfMtpControl; -using WpfMtpControl.DataSources; - -namespace WpfMtpVisuViewer -{ - public partial class MainWindow : Window - { - public WpfMtpControl.MtpVisuOpcUaClient client = new WpfMtpControl.MtpVisuOpcUaClient(); - - public AasOpcUaClient testOpcUaClient = null; - - public MainWindow() - { - // start - InitializeComponent(); - - // Timer for status - System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); - // ReSharper disable once RedundantDelegateCreation - dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); - dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100); - dispatcherTimer.Start(); - - // explicit - //// textOpcUaClient = new AasOpcUaClient("opc.tcp://127.0.0.1:4840" /* "localhost:4840" */, - //// _autoAccept: true, _stopTimeout : 99, _userName: "", _password: ""); - //// textOpcUaClient.Run(); - } - - public void SetMessage(string fmt, params object[] args) - { - var st = string.Format(fmt, args); - this.labelMessages.Text = st; - } - - private int opcCounter = 0; - - private void dispatcherTimer_Tick(object sender, EventArgs e) - { - if (this.client == null) - textBoxDataSourceStatus.Text = "(no OPC UA client enabled)"; - else - { - this.client.Tick(100); - textBoxDataSourceStatus.Text = this.client.GetStatus(); - } - - - // TODO (MIHO, 2020-09-18): remove this test code - opcCounter++; - if (testOpcUaClient != null && opcCounter % 20 == 0) - try - { - // ReSharper disable once UnusedVariable - var x = testOpcUaClient.ReadSubmodelElementValueAsString( - "|var|CODESYS Control Win V3.Application.SENSORS.L001.V", 2); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - - if (testOpcUaClient != null && opcCounter % 100 == 0) - try - { - testOpcUaClient.Cancel(); - testOpcUaClient.Close(); - } - catch (Exception ex) - { - AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex); - } - } - - private WpfMtpControl.MtpData activeMtpData = null; - - private MtpDataSourceSubscriber activeSubscriber = null; - - private MtpSymbolMapRecordList hintsForConfigRecs = null; - - private void LoadFile(string fn) - { - if (!".aml .zip .mtp".Contains(System.IO.Path.GetExtension(fn.Trim().ToLower()))) - return; - this.client = new WpfMtpControl.MtpVisuOpcUaClient(); - this.client.ItemChanged += Client_ItemChanged; - this.activeSubscriber = new MtpDataSourceSubscriber(); - this.activeMtpData = new WpfMtpControl.MtpData(); - this.hintsForConfigRecs = new MtpSymbolMapRecordList(); - - mtpVisu.VisuOptions = this.theOptions.VisuOptions; - this.activeMtpData.LoadAmlOrMtp(activeVisualObjectLib, this.client, this.theOptions.PreLoadInfo, - this.activeSubscriber, fn, makeUpConfigRecs: hintsForConfigRecs); - if (this.activeMtpData.PictureCollection.Count > 0) - mtpVisu.SetPicture(this.activeMtpData.PictureCollection.Values.ElementAt(0)); - mtpVisu.RedrawMtp(); - this.Title = "WPF MTP Viewer prototype - " + fn; - } - - private void Client_ItemChanged(WpfMtpControl.DataSources.IMtpDataSourceStatus dataSource, - MtpVisuOpcUaClient.DetailItem itemRef, MtpVisuOpcUaClient.ItemChangeType changeType) - { - if (dataSource == null || itemRef == null || itemRef.MtpSourceItemId == null - || this.activeSubscriber == null) - return; - - if (changeType == MtpVisuOpcUaClient.ItemChangeType.Value) - this.activeSubscriber.Invoke(itemRef.MtpSourceItemId, MtpDataSourceSubscriber.ChangeType.Value, - itemRef.Value); - } - - private WpfMtpControl.MtpSymbolLib theSymbolLib = null; - - private WpfMtpControl.MtpVisualObjectLib activeVisualObjectLib = null; - - // ReSharper disable once ClassNeverInstantiated.Global - public class MtpViewerStandaloneOptions : AasxIntegrationBase.AasxPluginOptionsBase - { - public WpfMtpControl.MtpSymbolMapRecordList SymbolMappings = new WpfMtpControl.MtpSymbolMapRecordList(); - public MtpDataSourceOpcUaPreLoadInfo PreLoadInfo = new MtpDataSourceOpcUaPreLoadInfo(); - public MtpVisuOptions VisuOptions = new MtpVisuOptions(); - } - - private MtpViewerStandaloneOptions theOptions = null; - - private void Window_Loaded(object sender, RoutedEventArgs e) - { - // start - SetMessage("Application started."); - - // initialize symbol library - this.theSymbolLib = new MtpSymbolLib(); - - var ISO10628 = new ResourceDictionary(); - ISO10628.Source = new Uri( - "pack://application:,,,/WpfMtpControl;component/Resources/PNID_DIN_EN_ISO_10628.xaml"); - this.theSymbolLib.ImportResourceDicrectory("PNID_ISO10628", ISO10628); - - var FESTO = new ResourceDictionary(); - FESTO.Source = new Uri( - "pack://application:,,,/WpfMtpControl;component/Resources/PNID_Festo.xaml"); - this.theSymbolLib.ImportResourceDicrectory("PNID_Festo", FESTO); - - // initialize visual object libraries - activeVisualObjectLib = new WpfMtpControl.MtpVisualObjectLib(); - activeVisualObjectLib.LoadStatic(this.theSymbolLib); - - // to find options - this.theOptions = AasxPluginOptionsBase.LoadDefaultOptionsFromAssemblyDir( - "WpfMtpVisuViewer", Assembly.GetExecutingAssembly()); - if (this.theOptions != null && this.theOptions.SymbolMappings != null) - { - activeVisualObjectLib.LoadFromSymbolMappings(this.theSymbolLib, this.theOptions.SymbolMappings); - SetMessage("Options loaded."); - } - - // load file - try - { - //// LoadFile("Dosing.mtp"); - //// LoadFile("Manifest_PxC_Dosing.aml"); - LoadFile("Manifest_V18.10.31_3_better_name_win3.aml"); - //// LoadFile("Manifest_Sten1.aml"); - //// LoadFile("Manifest_ChemiReaktor_MIHO.aml"); - - SetMessage("MTP file loaded."); - } - catch (Exception ex) - { - SetMessage("Exception: {0}", ex.Message); - } - - // fit it - this.mtpVisu.ZoomToFitCanvas(); - - // double click handler - this.mtpVisu.MtpObjectDoubleClick += MtpVisu_MtpObjectDoubleClick; - } - - private void MtpVisu_MtpObjectDoubleClick(MtpData.MtpBaseObject source) - { - if (source == null) - return; - SetMessage("DblClick name {0} RefID {1}", source.Name, source.RefID); - } - - private void Window_DragEnter(object sender, DragEventArgs e) - { - if (!e.Data.GetDataPresent("myFormat") || sender == e.Source) - { - e.Effects = DragDropEffects.None; - } - } - - private void Window_Drop(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop, true)) - { - // Note that you can have more than one file. - string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); - - // Assuming you have one file that you care about, pass it off to whatever - // handling code you have defined. - if (files != null && files.Length > 0) - { - try - { - LoadFile(files[0]); - } - catch (Exception ex) - { - SetMessage("Exception: {0}", ex.Message); - } - } - } - } - - private void Window_SizeChanged(object sender, SizeChangedEventArgs e) - { - // fit it - this.mtpVisu?.ZoomToFitCanvas(); - } - - private int overlayPanelMode = 0; - - private void SetOverlayPanelMode(int newMode) - { - this.overlayPanelMode = newMode; - - switch (this.overlayPanelMode) - { - case 2: - this.ScrollViewerDataSources.Visibility = Visibility.Visible; - DataGridDataSources.ItemsSource = this.client.Items; - this.RichTextReport.Visibility = Visibility.Collapsed; - break; - - case 1: - this.ScrollViewerDataSources.Visibility = Visibility.Collapsed; - DataGridDataSources.ItemsSource = null; - this.RichTextReport.Visibility = Visibility.Visible; - ReportOnConfiguration(this.RichTextReport); - break; - - default: - this.ScrollViewerDataSources.Visibility = Visibility.Collapsed; - DataGridDataSources.ItemsSource = null; - this.RichTextReport.Visibility = Visibility.Collapsed; - break; - } - } - - private void Button_Click(object sender, RoutedEventArgs e) - { - if (sender == buttonDataSourceDetails) - { - if (this.overlayPanelMode != 2) - SetOverlayPanelMode(2); - else - SetOverlayPanelMode(0); - } - - if (sender == buttonConfig) - { - if (this.overlayPanelMode != 1) - SetOverlayPanelMode(1); - else - SetOverlayPanelMode(0); - } - } - - private void AddToRichTextBox(RichTextBox rtb, string text, bool bold = false, double? fontSize = null, - bool monoSpaced = false) - { - var p = new Paragraph(); - if (bold) - p.FontWeight = FontWeights.Bold; - if (fontSize.HasValue) - p.FontSize = fontSize.Value; - if (monoSpaced) - p.FontFamily = new FontFamily("Courier New"); - p.Inlines.Add(new Run(text)); - rtb.Document.Blocks.Add(p); - } - - private void ReportOnConfiguration(RichTextBox rtb) - { - // access - if (rtb == null) - return; - - rtb.Document.Blocks.Clear(); - - // - // Report on available library symbols - // - - if (this.theSymbolLib != null) - { - - AddToRichTextBox(rtb, "Library symbols", bold: true, fontSize: 18); - - AddToRichTextBox(rtb, "The following lists shows available symbol full names."); - - foreach (var x in this.theSymbolLib.Values) - { - AddToRichTextBox(rtb, "" + x.FullName, monoSpaced: true); - } - - AddToRichTextBox(rtb, ""); - } - - // - // Hints for configurations - // - - if (this.hintsForConfigRecs != null) - { - AddToRichTextBox(rtb, "Preformatted configuration records", bold: true, fontSize: 18); - AddToRichTextBox(rtb, - "The following JSON elements could be pasted into the options file named " + "" + - "'AasxPluginMtpViewer.options.json'. " + - "Prior to pasting, an appropriate symbol full name needs to be chosen from above list. " + - "For the eClass strings, multiples choices can be delimited by ';'. " + - "For EClassVersions, 'null' disables version checking. " + - "Either EClassClasses or EClassIRDIs shall be different to 'null'."); - - foreach (var x in this.hintsForConfigRecs) - { - var txt = JsonConvert.SerializeObject(x, Formatting.None); - AddToRichTextBox(rtb, "" + txt, monoSpaced: true); - } - - AddToRichTextBox(rtb, ""); - } - } - } -} diff --git a/src/WpfMtpVisuViewer/Opc.Ua.SampleClient.Config.xml b/src/WpfMtpVisuViewer/Opc.Ua.SampleClient.Config.xml deleted file mode 100644 index 8c8ea824f..000000000 --- a/src/WpfMtpVisuViewer/Opc.Ua.SampleClient.Config.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - UA Core Sample Client - urn:localhost:OPCFoundation:CoreSampleClient - http://opcfoundation.org/UA/CoreSampleClient - Client_1 - - - - - - X509Store - CurrentUser\My - CN=UA Core Sample Client, C=US, S=Arizona, O=OPC Foundation, DC=localhost - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/issuer - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/trusted - - - - - Directory - %LocalApplicationData%/OPC Foundation/pki/rejected - - - - false - - - - - - - 600000 - 1048576 - 4194304 - 65535 - 4194304 - 65535 - 300000 - 3600000 - - - - - - - 600000 - - - - opc.tcp://{0}:4840/UADiscovery - - - - - - - 10000 - - - - %LocalApplicationData%/Logs/Opc.Ua.CoreSampleClient.log.txt - true - - - - - - - - - - - - - - - - true - - \ No newline at end of file diff --git a/src/WpfMtpVisuViewer/Properties/AssemblyInfo.cs b/src/WpfMtpVisuViewer/Properties/AssemblyInfo.cs deleted file mode 100644 index a0aac0e74..000000000 --- a/src/WpfMtpVisuViewer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("WpfMtpVisuViewer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WpfMtpVisuViewer")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly -// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von -// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. -[assembly: ComVisible(false)] - -//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie -//ImCodeVerwendeteKultur in der .csproj-Datei -//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch -//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung -//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, -//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher - //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, - // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) - ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs - //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, - // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) -)] - - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/WpfMtpVisuViewer/Properties/Resources.Designer.cs b/src/WpfMtpVisuViewer/Properties/Resources.Designer.cs deleted file mode 100644 index 6be4c80c5..000000000 --- a/src/WpfMtpVisuViewer/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion: 4.0.30319.42000 -// -// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn -// der Code neu generiert wird. -// -//------------------------------------------------------------------------------ - -namespace WpfMtpVisuViewer.Properties -{ - - - /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse - // über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfMtpVisuViewer.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/src/WpfMtpVisuViewer/Properties/Resources.resx b/src/WpfMtpVisuViewer/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/src/WpfMtpVisuViewer/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/WpfMtpVisuViewer/Properties/Settings.Designer.cs b/src/WpfMtpVisuViewer/Properties/Settings.Designer.cs deleted file mode 100644 index c4fe9e2f4..000000000 --- a/src/WpfMtpVisuViewer/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WpfMtpVisuViewer.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/WpfMtpVisuViewer/Properties/Settings.settings b/src/WpfMtpVisuViewer/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/src/WpfMtpVisuViewer/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/WpfMtpVisuViewer/WpfMtpVisuViewer.csproj b/src/WpfMtpVisuViewer/WpfMtpVisuViewer.csproj deleted file mode 100644 index 79ec97e63..000000000 --- a/src/WpfMtpVisuViewer/WpfMtpVisuViewer.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - net6.0-windows - WinExe - false - true - false - - - - PreserveNewest - - - - - - - - - PreserveNewest - - - - - PreserveNewest - - - - - - diff --git a/src/WpfMtpVisuViewer/WpfMtpVisuViewer.options.json b/src/WpfMtpVisuViewer/WpfMtpVisuViewer.options.json deleted file mode 100644 index 72df7574b..000000000 --- a/src/WpfMtpVisuViewer/WpfMtpVisuViewer.options.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "SymbolMappings": [ - { - "EClassVersions": null, - "EClassClasses": "37010201", - "EClassIRDIs": null, - "SymbolDefault": "PNID_Festo.manual_valve_default-u-nozzled" - } - ], - "PreLoadInfo": { - "EndpointMapping": [ - { - "ForName": "CPX1_CEC", - "NewEndpoint": "opc.tcp://127.0.0.1:4841" - } - ], - "IdentifierRenaming": [ - { - "OldText": "\\|var\\|CODESYS Control Win V31.Application.SERVICE.Dosing_duration.WQC", - "NewText": "|var|CODESYS Control Win V31.Application.SERVICE.Dosing_duration.WQC" - } - ], - "NamespaceRenaming": [] - }, - "VisuOptions": { - "Background": "#707070", - "StateColorActive": "#2020ff", - "StateColorNonActive": "#202020", - "StateColorForward": "#2020ff", - "StateColorReverse": "#20ff20" - } -} \ No newline at end of file