diff --git a/src/AasCore.Aas3_0/constants.cs b/src/AasCore.Aas3_0/constants.cs index 92a9f8c49..f8850da68 100644 --- a/src/AasCore.Aas3_0/constants.cs +++ b/src/AasCore.Aas3_0/constants.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/copying.cs b/src/AasCore.Aas3_0/copying.cs index 431c21f5f..a0aa6d430 100644 --- a/src/AasCore.Aas3_0/copying.cs +++ b/src/AasCore.Aas3_0/copying.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/jsonization.cs b/src/AasCore.Aas3_0/jsonization.cs index e6c576358..0d77a90e0 100644 --- a/src/AasCore.Aas3_0/jsonization.cs +++ b/src/AasCore.Aas3_0/jsonization.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/reporting.cs b/src/AasCore.Aas3_0/reporting.cs index 4024a7ee9..09d7e4b14 100644 --- a/src/AasCore.Aas3_0/reporting.cs +++ b/src/AasCore.Aas3_0/reporting.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/stringification.cs b/src/AasCore.Aas3_0/stringification.cs index b109711e7..eb60e7287 100644 --- a/src/AasCore.Aas3_0/stringification.cs +++ b/src/AasCore.Aas3_0/stringification.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/types.cs b/src/AasCore.Aas3_0/types.cs index 9da0115a8..c90273dca 100644 --- a/src/AasCore.Aas3_0/types.cs +++ b/src/AasCore.Aas3_0/types.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/verification.cs b/src/AasCore.Aas3_0/verification.cs index 86ef278ae..589f42ca6 100644 --- a/src/AasCore.Aas3_0/verification.cs +++ b/src/AasCore.Aas3_0/verification.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/visitation.cs b/src/AasCore.Aas3_0/visitation.cs index 552c5eb7a..42c0ea704 100644 --- a/src/AasCore.Aas3_0/visitation.cs +++ b/src/AasCore.Aas3_0/visitation.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasCore.Aas3_0/xmlization.cs b/src/AasCore.Aas3_0/xmlization.cs index c16b7360f..2f0bb6100 100644 --- a/src/AasCore.Aas3_0/xmlization.cs +++ b/src/AasCore.Aas3_0/xmlization.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * This code has been automatically generated by aas-core-codegen. * Do NOT edit or append. diff --git a/src/AasSecurity/AasSecurityAuthenticationHandler.cs b/src/AasSecurity/AasSecurityAuthenticationHandler.cs index 507fbaf38..7fa8dd507 100644 --- a/src/AasSecurity/AasSecurityAuthenticationHandler.cs +++ b/src/AasSecurity/AasSecurityAuthenticationHandler.cs @@ -1,4 +1,17 @@ -using AasxServerStandardBib.Logging; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasxServerStandardBib.Logging; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/AasSecurity/AasSecurityAuthenticationOptions.cs b/src/AasSecurity/AasSecurityAuthenticationOptions.cs index 5eb74f7f0..a3371cdc1 100644 --- a/src/AasSecurity/AasSecurityAuthenticationOptions.cs +++ b/src/AasSecurity/AasSecurityAuthenticationOptions.cs @@ -1,4 +1,17 @@ -using Microsoft.AspNetCore.Authentication; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using Microsoft.AspNetCore.Authentication; namespace AasSecurity { diff --git a/src/AasSecurity/AasSecurityAuthorizationHandler.cs b/src/AasSecurity/AasSecurityAuthorizationHandler.cs index d4cedc1d1..c8f29a11b 100644 --- a/src/AasSecurity/AasSecurityAuthorizationHandler.cs +++ b/src/AasSecurity/AasSecurityAuthorizationHandler.cs @@ -1,4 +1,17 @@ -using AasSecurity.Models; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Models; using AasxServer; using AdminShellNS.Models; using Microsoft.AspNetCore.Authorization; diff --git a/src/AasSecurity/AasSecurityContext.cs b/src/AasSecurity/AasSecurityContext.cs index 9fe2d9d0e..80dd849c6 100644 --- a/src/AasSecurity/AasSecurityContext.cs +++ b/src/AasSecurity/AasSecurityContext.cs @@ -1,4 +1,17 @@ -using AasSecurity.Exceptions; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Exceptions; using AasSecurity.Models; namespace AasSecurity diff --git a/src/AasSecurity/AssemblyInfo.cs b/src/AasSecurity/AssemblyInfo.cs index 9e0728115..b79ab2850 100644 --- a/src/AasSecurity/AssemblyInfo.cs +++ b/src/AasSecurity/AssemblyInfo.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + using System.Runtime.CompilerServices; [assembly:InternalsVisibleTo("AasSecurityTests")] \ No newline at end of file diff --git a/src/AasSecurity/Exceptions/AuthorizationException.cs b/src/AasSecurity/Exceptions/AuthorizationException.cs index 30fce7f42..0003f715c 100644 --- a/src/AasSecurity/Exceptions/AuthorizationException.cs +++ b/src/AasSecurity/Exceptions/AuthorizationException.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Exceptions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Exceptions { public class AuthorizationException : Exception { diff --git a/src/AasSecurity/Exceptions/NotAllowed.cs b/src/AasSecurity/Exceptions/NotAllowed.cs index 88877ac1a..af3d988c2 100644 --- a/src/AasSecurity/Exceptions/NotAllowed.cs +++ b/src/AasSecurity/Exceptions/NotAllowed.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Exceptions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Exceptions { public class NotAllowed : Exception { diff --git a/src/AasSecurity/GlobalSecurityVariables.cs b/src/AasSecurity/GlobalSecurityVariables.cs index 86d1d415a..4d0fcd685 100644 --- a/src/AasSecurity/GlobalSecurityVariables.cs +++ b/src/AasSecurity/GlobalSecurityVariables.cs @@ -1,4 +1,17 @@ -using AasSecurity.Models; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Models; using System.Security.Cryptography.X509Certificates; namespace AasSecurity diff --git a/src/AasSecurity/ISecurityService.cs b/src/AasSecurity/ISecurityService.cs index eee7ab139..ea6c1e73a 100644 --- a/src/AasSecurity/ISecurityService.cs +++ b/src/AasSecurity/ISecurityService.cs @@ -1,4 +1,17 @@ -using AasSecurity.Models; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Models; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; diff --git a/src/AasSecurity/Models/AccessControl.cs b/src/AasSecurity/Models/AccessControl.cs index 07db47a40..25b2717d6 100644 --- a/src/AasSecurity/Models/AccessControl.cs +++ b/src/AasSecurity/Models/AccessControl.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class AccessControl { diff --git a/src/AasSecurity/Models/AccessControlPolicyPoints.cs b/src/AasSecurity/Models/AccessControlPolicyPoints.cs index 046f9f41c..7bc344cf2 100644 --- a/src/AasSecurity/Models/AccessControlPolicyPoints.cs +++ b/src/AasSecurity/Models/AccessControlPolicyPoints.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class AccessControlPolicyPoints { diff --git a/src/AasSecurity/Models/AccessPermissionRule.cs b/src/AasSecurity/Models/AccessPermissionRule.cs index c481fa721..8b4a10165 100644 --- a/src/AasSecurity/Models/AccessPermissionRule.cs +++ b/src/AasSecurity/Models/AccessPermissionRule.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class AccessPermissionRule { diff --git a/src/AasSecurity/Models/AccessRights.cs b/src/AasSecurity/Models/AccessRights.cs index 7dad1a281..7dd8f1de7 100644 --- a/src/AasSecurity/Models/AccessRights.cs +++ b/src/AasSecurity/Models/AccessRights.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { public enum AccessRights { diff --git a/src/AasSecurity/Models/KindOfPermissionEnum.cs b/src/AasSecurity/Models/KindOfPermissionEnum.cs index a63c6e451..41d17de85 100644 --- a/src/AasSecurity/Models/KindOfPermissionEnum.cs +++ b/src/AasSecurity/Models/KindOfPermissionEnum.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal enum KindOfPermissionEnum { diff --git a/src/AasSecurity/Models/Permission.cs b/src/AasSecurity/Models/Permission.cs index bcc98fc34..1e566b976 100644 --- a/src/AasSecurity/Models/Permission.cs +++ b/src/AasSecurity/Models/Permission.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class Permission { diff --git a/src/AasSecurity/Models/PermissionsPerObject.cs b/src/AasSecurity/Models/PermissionsPerObject.cs index 5b54f1206..f5e8c965c 100644 --- a/src/AasSecurity/Models/PermissionsPerObject.cs +++ b/src/AasSecurity/Models/PermissionsPerObject.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class PermissionsPerObject { diff --git a/src/AasSecurity/Models/PolicyAdministrationPoint.cs b/src/AasSecurity/Models/PolicyAdministrationPoint.cs index 0be8bfbc3..1ec860bc2 100644 --- a/src/AasSecurity/Models/PolicyAdministrationPoint.cs +++ b/src/AasSecurity/Models/PolicyAdministrationPoint.cs @@ -1,4 +1,17 @@ - +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + + namespace AasSecurity.Models { internal class PolicyAdministrationPoint diff --git a/src/AasSecurity/Models/PolicyDecisionPoint.cs b/src/AasSecurity/Models/PolicyDecisionPoint.cs index e892dd05d..562885a71 100644 --- a/src/AasSecurity/Models/PolicyDecisionPoint.cs +++ b/src/AasSecurity/Models/PolicyDecisionPoint.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class PolicyDecisionPoint { diff --git a/src/AasSecurity/Models/PolicyEnforcementPoint.cs b/src/AasSecurity/Models/PolicyEnforcementPoint.cs index df87357c9..a36d10f68 100644 --- a/src/AasSecurity/Models/PolicyEnforcementPoint.cs +++ b/src/AasSecurity/Models/PolicyEnforcementPoint.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { public class PolicyEnforcementPoint { diff --git a/src/AasSecurity/Models/SecurityRight.cs b/src/AasSecurity/Models/SecurityRight.cs index 9d6daeebe..178c9cccc 100644 --- a/src/AasSecurity/Models/SecurityRight.cs +++ b/src/AasSecurity/Models/SecurityRight.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { public class SecurityRight { diff --git a/src/AasSecurity/Models/SecurityRole.cs b/src/AasSecurity/Models/SecurityRole.cs index d01d8f17a..bdef6c6de 100644 --- a/src/AasSecurity/Models/SecurityRole.cs +++ b/src/AasSecurity/Models/SecurityRole.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; namespace AasSecurity.Models { diff --git a/src/AasSecurity/Models/SubjectAttributes.cs b/src/AasSecurity/Models/SubjectAttributes.cs index 3402704aa..1b781065f 100644 --- a/src/AasSecurity/Models/SubjectAttributes.cs +++ b/src/AasSecurity/Models/SubjectAttributes.cs @@ -1,4 +1,17 @@ -namespace AasSecurity.Models +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AasSecurity.Models { internal class SubjectAttributes { diff --git a/src/AasSecurity/SecurityHelper.cs b/src/AasSecurity/SecurityHelper.cs index 65d45769c..7148fb11c 100644 --- a/src/AasSecurity/SecurityHelper.cs +++ b/src/AasSecurity/SecurityHelper.cs @@ -1,4 +1,17 @@ -using AasxServer; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasxServer; using Extensions; using System.Security.Cryptography.X509Certificates; diff --git a/src/AasSecurity/SecurityMetamodelParser.cs b/src/AasSecurity/SecurityMetamodelParser.cs index bf353c560..5a9288d45 100644 --- a/src/AasSecurity/SecurityMetamodelParser.cs +++ b/src/AasSecurity/SecurityMetamodelParser.cs @@ -1,4 +1,17 @@ -using AasSecurity.Models; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Models; using AdminShellNS; using Extensions; diff --git a/src/AasSecurity/SecurityRequirement.cs b/src/AasSecurity/SecurityRequirement.cs index 522f77ab4..1a6f7f438 100644 --- a/src/AasSecurity/SecurityRequirement.cs +++ b/src/AasSecurity/SecurityRequirement.cs @@ -1,4 +1,17 @@ -using Microsoft.AspNetCore.Authorization; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using Microsoft.AspNetCore.Authorization; namespace AasSecurity { diff --git a/src/AasSecurity/SecurityService.cs b/src/AasSecurity/SecurityService.cs index b65a064cd..297dbb8b8 100644 --- a/src/AasSecurity/SecurityService.cs +++ b/src/AasSecurity/SecurityService.cs @@ -1,4 +1,17 @@ -using AasSecurity.Models; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Models; using AasxServer; using AasxServerStandardBib.Logging; using AasxServerStandardBib.Services; diff --git a/src/AasSecurity/SecuritySettingsForServerParser.cs b/src/AasSecurity/SecuritySettingsForServerParser.cs index 530ffd356..43306bfe6 100644 --- a/src/AasSecurity/SecuritySettingsForServerParser.cs +++ b/src/AasSecurity/SecuritySettingsForServerParser.cs @@ -1,4 +1,17 @@ -using AasSecurity.Models; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity.Models; using AasxServer; using AdminShellNS; using System.Security.Cryptography.X509Certificates; diff --git a/src/AasSecurityTests/AasSecurityContextTest.cs b/src/AasSecurityTests/AasSecurityContextTest.cs index 708d66d47..6ae462509 100644 --- a/src/AasSecurityTests/AasSecurityContextTest.cs +++ b/src/AasSecurityTests/AasSecurityContextTest.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + using AasSecurity.Models; namespace AasSecurity; diff --git a/src/AasSecurityTests/GlobalUsings.cs b/src/AasSecurityTests/GlobalUsings.cs index f04fa059b..1094f9f9a 100644 --- a/src/AasSecurityTests/GlobalUsings.cs +++ b/src/AasSecurityTests/GlobalUsings.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + global using Xunit; global using FluentAssertions; global using Moq; diff --git a/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs b/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs index 52f09f025..25969e301 100644 --- a/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs +++ b/src/AasxCsharpLibrary/Display/EnumerationPlacmentBase.cs @@ -1,4 +1,17 @@ -namespace AdminShellNS.Display +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AdminShellNS.Display { public class EnumerationPlacmentBase { diff --git a/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs b/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs index a5b1723f1..f9453f8e2 100644 --- a/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs +++ b/src/AasxCsharpLibrary/Display/EnumerationPlacmentOperationVariable.cs @@ -1,4 +1,17 @@ -namespace AdminShellNS.Display +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AdminShellNS.Display { public class EnumerationPlacmentOperationVariable : EnumerationPlacmentBase { diff --git a/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs b/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs index f9bf1af30..9ac429ede 100644 --- a/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs +++ b/src/AasxCsharpLibrary/Display/OperationVariableDirection.cs @@ -1,4 +1,17 @@ -namespace AdminShellNS.Display +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace AdminShellNS.Display { public enum OperationVariableDirection { diff --git a/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs b/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs index 712e8fb67..f8020794f 100644 --- a/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs +++ b/src/AasxCsharpLibrary/Exceptions/MetamodelVerificationException.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; using static AasCore.Aas3_0.Reporting; diff --git a/src/AasxCsharpLibrary/Exceptions/NullValueException.cs b/src/AasxCsharpLibrary/Exceptions/NullValueException.cs index e6f64e125..8c1c0419a 100644 --- a/src/AasxCsharpLibrary/Exceptions/NullValueException.cs +++ b/src/AasxCsharpLibrary/Exceptions/NullValueException.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; namespace AdminShellNS.Exceptions { diff --git a/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs b/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs index 3f584ac0e..94edb79a2 100644 --- a/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs +++ b/src/AasxCsharpLibrary/Extensions/AasElementSelfDescription.cs @@ -1,4 +1,17 @@ - +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + + namespace Extensions { public class AasElementSelfDescription diff --git a/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs b/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs index 64443446c..8ae0bdd87 100644 --- a/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs +++ b/src/AasxCsharpLibrary/Extensions/ComparerUtils.cs @@ -1,4 +1,17 @@ -using System.Collections.Generic; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Collections.Generic; using System.Globalization; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs index 9a5194ba3..ba1090d4e 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendAnnotatedRelationshipElement.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Display; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Display; using AdminShellNS.Extensions; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs b/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs index 3ce9c2a50..715ed817d 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendAssetAdministrationShell.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using AdminShellNS.Extensions; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs b/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs index 58a3bb164..cc631ef5b 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendAssetInformation.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs b/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs index 94b5f6649..0211f0044 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendBlob.cs @@ -1,4 +1,17 @@ -using System.Text; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Text; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs b/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs index 3acde94a4..7ef18f8f4 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendCollection.cs @@ -1,4 +1,17 @@ -using System.Collections.Generic; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Collections.Generic; namespace AdminShellNS.Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs b/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs index fa5570f6f..eedfa4770 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendConceptDescription.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using System; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs index a36fe71d5..1d830b443 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendDataElement.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { public static class ExtendDataElement { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs index 08af968bd..83e90563b 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendDataSpecificationIEC61360.cs @@ -1,4 +1,17 @@ -using System.Collections.Generic; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Collections.Generic; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs b/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs index 231e45238..f2d6ded7b 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendEmbeddedDataSpecification.cs @@ -1,4 +1,17 @@ -using System.Collections.Generic; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Collections.Generic; // using DataSpecificationContent = HasDataSpecification.DataSpecificationContent; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs b/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs index 7404cd28a..d974d514a 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendEntity.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Display; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Display; using AdminShellNS.Extensions; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs b/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs index 07ee1d084..a0d0cb478 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendEnvironment.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using AdminShellNS.Extensions; using Newtonsoft.Json; using System; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendFile.cs b/src/AasxCsharpLibrary/Extensions/ExtendFile.cs index 9e1d8b117..0677eb214 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendFile.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendFile.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { public static class ExtendFile { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs b/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs index 4f2c51692..3f2454894 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendHasDataSpecification.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { public static class ExtendHasDataSpecification { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs b/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs index e23d87eec..49bbdbc2f 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendIDataSpecificationContent.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using System.Collections.Generic; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs b/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs index 82b78da52..cc75fd722 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendIIdentifiable.cs @@ -1,4 +1,17 @@ -using System.Collections.Generic; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Collections.Generic; using System.Linq; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs index 20fe4e37e..e34884ae6 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendILangStringDefinitionTypeIec61360.cs @@ -1,4 +1,17 @@ -using System.Collections.Generic; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.Collections.Generic; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs index 8c26016d9..e659ab2c6 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendILangStringPreferredNameTypeIec61360.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs b/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs index 6c83b0695..b94a60549 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendILangStringShortNameTypeIec61360.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs b/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs index b12f21cb4..4687fb0f2 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendIReferable.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using AdminShellNS.Display; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs index fa9996722..8f8a1c00a 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendISubmodelElement.cs @@ -1,4 +1,17 @@ -using AasxCompatibilityModels; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasxCompatibilityModels; using AdminShellNS; using AdminShellNS.Display; using AdminShellNS.Extensions; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendKey.cs b/src/AasxCsharpLibrary/Extensions/ExtendKey.cs index 681029a4c..c363bd1b3 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendKey.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendKey.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using System; using System.Collections.Generic; using System.Text.RegularExpressions; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs b/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs index 32db72e81..3ed5a045c 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendKeyList.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using Extensions; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs b/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs index 060933a55..ae0c82666 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendKeyTypes.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { public static class ExtendKeyTypes { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs b/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs index 8209a7e64..27108b86d 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendLangString.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { // TODO (jtikekar, 2023-09-04):Remove public static class ExtendLangString diff --git a/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs b/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs index d40315f1d..cf5bb1b4b 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendLangStringSet.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Extensions; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Extensions; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs b/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs index dc1d50bb2..81c761143 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendModelKind.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs b/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs index 2c6a3ffbe..c729070fc 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendMultiLanguageProperty.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendObject.cs b/src/AasxCsharpLibrary/Extensions/ExtendObject.cs index 32501dbbc..dd7fff7e7 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendObject.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendObject.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; using System.Reflection; using Extensions.ArrayExtensions; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs b/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs index 9e68c0f7f..f35fbb5ea 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendOperation.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Display; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Display; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs b/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs index fc59f3180..17d7a429e 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendProperty.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs b/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs index 766f79718..d7eb6518f 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendQualifier.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; using System.Text.RegularExpressions; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendRange.cs b/src/AasxCsharpLibrary/Extensions/ExtendRange.cs index 8f61a233f..e370a6e12 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendRange.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendRange.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using AAS = AasCore.Aas3_0; namespace Extensions diff --git a/src/AasxCsharpLibrary/Extensions/ExtendReference.cs b/src/AasxCsharpLibrary/Extensions/ExtendReference.cs index b96d5d7ae..50c8658df 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendReference.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendReference.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Exceptions; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Exceptions; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs index e20c08216..8b61269a3 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendReferenceElement.cs @@ -1,4 +1,17 @@ -using AAS = AasCore.Aas3_0; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AAS = AasCore.Aas3_0; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs b/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs index 3cface08f..e4eabf321 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendRelationshipElement.cs @@ -1,4 +1,17 @@ -using AAS = AasCore.Aas3_0; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AAS = AasCore.Aas3_0; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs b/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs index c432debc2..4fa0f8ea7 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendSpecificAssetId.cs @@ -1,4 +1,17 @@ -using Extensions; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using Extensions; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendStream.cs b/src/AasxCsharpLibrary/Extensions/ExtendStream.cs index 2e0ea17c5..f01b94fc0 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendStream.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendStream.cs @@ -1,4 +1,17 @@ -using System.IO; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System.IO; namespace Extensions { diff --git a/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs b/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs index 56be60109..823ab4ed0 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendStringification.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs b/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs index 533a2cbb6..1719605ad 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendSubmodel.cs @@ -1,4 +1,17 @@ -using AdminShellNS; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS; using AdminShellNS.Display; using AdminShellNS.Extensions; using System; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs b/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs index 223bef4fc..976f9babb 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementCollection.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Display; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Display; using AdminShellNS.Extensions; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs b/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs index d8f6f97d9..08a3e60aa 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtendSubmodelElementList.cs @@ -1,4 +1,17 @@ -using AdminShellNS.Display; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AdminShellNS.Display; using System; using System.Collections.Generic; using System.Linq; diff --git a/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs b/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs index 3a0a0b96a..5652eff85 100644 --- a/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs +++ b/src/AasxCsharpLibrary/Extensions/ExtensionsUtil.cs @@ -1,4 +1,17 @@ -using AasxCompatibilityModels; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasxCompatibilityModels; using AdminShellNS.Extensions; using System; using System.Collections.Generic; diff --git a/src/AasxCsharpLibrary/Extensions/LocatedReference.cs b/src/AasxCsharpLibrary/Extensions/LocatedReference.cs index a99558b3e..ea3e86a93 100644 --- a/src/AasxCsharpLibrary/Extensions/LocatedReference.cs +++ b/src/AasxCsharpLibrary/Extensions/LocatedReference.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { public class LocatedReference { diff --git a/src/AasxCsharpLibrary/Extensions/MatchMode.cs b/src/AasxCsharpLibrary/Extensions/MatchMode.cs index d67579028..1ad82d879 100644 --- a/src/AasxCsharpLibrary/Extensions/MatchMode.cs +++ b/src/AasxCsharpLibrary/Extensions/MatchMode.cs @@ -1,4 +1,17 @@ -namespace Extensions +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +namespace Extensions { public enum MatchMode { diff --git a/src/AasxCsharpLibrary/Models/PackageDescription.cs b/src/AasxCsharpLibrary/Models/PackageDescription.cs index a8be18c67..743e98cc9 100644 --- a/src/AasxCsharpLibrary/Models/PackageDescription.cs +++ b/src/AasxCsharpLibrary/Models/PackageDescription.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + /* * DotAAS Part 2 | HTTP/REST | AASX File Server Service Specification * diff --git a/src/AasxServerAspNetCore/Program.cs b/src/AasxServerAspNetCore/Program.cs index b24b2632f..cce3af6e3 100644 --- a/src/AasxServerAspNetCore/Program.cs +++ b/src/AasxServerAspNetCore/Program.cs @@ -1,3 +1,16 @@ +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + //var builder = WebApplication.CreateBuilder(args); //var app = builder.Build(); diff --git a/src/AasxServerAspNetCore/Startup.cs b/src/AasxServerAspNetCore/Startup.cs index 2676d8b57..e0e614284 100644 --- a/src/AasxServerAspNetCore/Startup.cs +++ b/src/AasxServerAspNetCore/Startup.cs @@ -1,4 +1,17 @@ -//var builder = WebApplication.CreateBuilder(args); +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +//var builder = WebApplication.CreateBuilder(args); //var app = builder.Build(); using AasSecurity; diff --git a/src/AasxServerAspNetCore/startForDemo.bat b/src/AasxServerAspNetCore/startForDemo.bat index f215a2857..bd5cb6bef 100644 --- a/src/AasxServerAspNetCore/startForDemo.bat +++ b/src/AasxServerAspNetCore/startForDemo.bat @@ -1 +1,15 @@ +@echo off +REM ******************************************************************************* +REM * Copyright (c) {2024} Contributors to the Eclipse Foundation +REM * +REM * See the NOTICE file(s) distributed with this work for additional +REM * information regarding copyright ownership. +REM * +REM * This program and the accompanying materials are made available under the +REM * terms of the Apache License Version 2.0 which is available at +REM * https://www.apache.org/licenses/LICENSE-2.0 +REM * +REM * SPDX-License-Identifier: Apache-2.0 +REM ******************************************************************************* + AasxServerAspNetCore.exe --no-security --data-path aasxs diff --git a/src/AasxServerBlazor/App.razor b/src/AasxServerBlazor/App.razor index 408fc6e99..9c36b202d 100644 --- a/src/AasxServerBlazor/App.razor +++ b/src/AasxServerBlazor/App.razor @@ -1,4 +1,17 @@ - + + + diff --git a/src/AasxServerBlazor/BlazorServerStarter.cs b/src/AasxServerBlazor/BlazorServerStarter.cs index bed2878a9..83666e120 100644 --- a/src/AasxServerBlazor/BlazorServerStarter.cs +++ b/src/AasxServerBlazor/BlazorServerStarter.cs @@ -1,4 +1,17 @@ -using AasSecurity; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity; using AasxServer; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; diff --git a/src/AasxServerBlazor/Configuration/DependencyRegistry.cs b/src/AasxServerBlazor/Configuration/DependencyRegistry.cs index 8ee4a4aaa..eb6ec5821 100644 --- a/src/AasxServerBlazor/Configuration/DependencyRegistry.cs +++ b/src/AasxServerBlazor/Configuration/DependencyRegistry.cs @@ -1,4 +1,17 @@ -using AasSecurity; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasSecurity; using AasxServerBlazor.Data; using AasxServerStandardBib.Interfaces; using AasxServerStandardBib.Logging; diff --git a/src/AasxServerBlazor/Configuration/ServerConfiguration.cs b/src/AasxServerBlazor/Configuration/ServerConfiguration.cs index 9e7ee2ddc..7bf1a2ec3 100644 --- a/src/AasxServerBlazor/Configuration/ServerConfiguration.cs +++ b/src/AasxServerBlazor/Configuration/ServerConfiguration.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; using System.IO; using AasSecurity; diff --git a/src/AasxServerBlazor/Data/AASService.cs b/src/AasxServerBlazor/Data/AASService.cs index 837246007..43500eadd 100644 --- a/src/AasxServerBlazor/Data/AASService.cs +++ b/src/AasxServerBlazor/Data/AASService.cs @@ -1,4 +1,17 @@ -using AasxServer; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using AasxServer; using Extensions; using Microsoft.IdentityModel.Tokens; using System; diff --git a/src/AasxServerBlazor/Data/BlazorSessionService.cs b/src/AasxServerBlazor/Data/BlazorSessionService.cs index e82cbc154..c5550cc76 100644 --- a/src/AasxServerBlazor/Data/BlazorSessionService.cs +++ b/src/AasxServerBlazor/Data/BlazorSessionService.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; namespace AasxServerBlazor.Data { diff --git a/src/AasxServerBlazor/Data/CredentialService.cs b/src/AasxServerBlazor/Data/CredentialService.cs index 460702857..2ae52af96 100644 --- a/src/AasxServerBlazor/Data/CredentialService.cs +++ b/src/AasxServerBlazor/Data/CredentialService.cs @@ -1,4 +1,17 @@ -using System; +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +using System; using System.Collections.Generic; namespace AasxServerBlazor.Data diff --git a/src/AasxServerBlazor/Data/TreeStyle.cs b/src/AasxServerBlazor/Data/TreeStyle.cs index 7c254a0f6..d30fa63dc 100644 --- a/src/AasxServerBlazor/Data/TreeStyle.cs +++ b/src/AasxServerBlazor/Data/TreeStyle.cs @@ -1,4 +1,17 @@ - +/******************************************************************************** +* Copyright (c) {2024} Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0 +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + + namespace MW.Blazor { public class TreeStyle diff --git a/src/AasxServerBlazor/Pages/About.razor b/src/AasxServerBlazor/Pages/About.razor index 1984a5f03..d178beda6 100644 --- a/src/AasxServerBlazor/Pages/About.razor +++ b/src/AasxServerBlazor/Pages/About.razor @@ -1,4 +1,17 @@ -@page "/About" + + +@page "/About"

Metamodel Version V3.0

AAS API Version V3.0.1

diff --git a/src/AasxServerBlazor/Pages/Assetid.razor b/src/AasxServerBlazor/Pages/Assetid.razor index 8cc572db3..96a820c24 100644 --- a/src/AasxServerBlazor/Pages/Assetid.razor +++ b/src/AasxServerBlazor/Pages/Assetid.razor @@ -1,4 +1,17 @@ -@page "/assetid" + + +@page "/assetid"
diff --git a/src/AasxServerBlazor/Pages/Atex.razor b/src/AasxServerBlazor/Pages/Atex.razor index 3588dc48e..72c9340bb 100644 --- a/src/AasxServerBlazor/Pages/Atex.razor +++ b/src/AasxServerBlazor/Pages/Atex.razor @@ -1,3 +1,16 @@ + + @page "/atex"; @using AasxServer @using Microsoft.AspNetCore.Html; diff --git a/src/AasxServerBlazor/Pages/Atex2.razor b/src/AasxServerBlazor/Pages/Atex2.razor index 943e3afd3..d48d87aeb 100644 --- a/src/AasxServerBlazor/Pages/Atex2.razor +++ b/src/AasxServerBlazor/Pages/Atex2.razor @@ -1,2021 +1,2034 @@ -@page "/atex2"; -@using AasxRestServerLibrary; -@using AasxServer -@using Microsoft.AspNetCore.Html; -@using Microsoft.IdentityModel.Tokens; -@using Extensions; -@using System.Globalization; -@inject Data.AASService SubmodelService -@inject NavigationManager NavMan - - - -
- @if (Program.isLoadingDB) - { - Loading... - } - else - { - string url = NavMan.Uri; - string filter = ""; - var s = url.Split("?"); - if (s.Length == 2) - { - filter = s[1]; - } - Program.loadAllPackages(); - collectData(); - - for (int p = 0; p < countProject; p++) - { - if (filter != "" && filter != projectName[p]) - continue; - - int iOut = -1; - int iIn = -1; - for (int i = 0; i < count; i++) - { - if (eigensicheresbetriebsmittel[p] == ManufacturerProductType[i] - && (eigensicheresbetriebsmittelSeriennummer[p] == "" || eigensicheresbetriebsmittelSeriennummer[p] == SerialNumber[i])) - iIn = i; - if (zugehoerigesbetriebsmittel[p] == ManufacturerProductType[i] - && (zugehoerigesbetriebsmittelSeriennummer[p] == "" || zugehoerigesbetriebsmittelSeriennummer[p] == SerialNumber[i])) - iOut = i; - } - if (iOut == -1 || iIn == -1) - { - @projectName[p] can not be shown!
- Type: @zugehoerigesbetriebsmittel[p] SerialNumber: @zugehoerigesbetriebsmittelSeriennummer[p]
- Type: @eigensicheresbetriebsmittel[p] SerialNumber: @eigensicheresbetriebsmittelSeriennummer[p] - -
-
- continue; - } - - if (certifiedBy[iOut] == "" && pCertifiedBy[p] != null) - certifiedBy[iOut] = pCertifiedBy[p].Value; - if (certifiedAt[iOut] == "" && pCertifiedAt[p] != null) - certifiedAt[iOut] = pCertifiedAt[p].Value; - - double Lo = L[iOut]; - double Co = C[iOut]; - bool LCgreater = false; - if (L[iIn] >= L[iOut] / 100 && C[iIn] >= C[iOut] / 100) - { - LCgreater = true; - Lo = 0.5 * Lo; - Co = 0.5 * Co; - } - - double cl = cableLength[p]; - if (inputLength[iOut] == Double.MinValue) - inputLength[iOut] = cl; - else - cl = inputLength[iOut]; - double Lc = cl / 1000.0 * 1; - double Cc = cl / 1000.0 * 110; - // 0,5 * Lo >= Li + Lc => 0,5 * Lo >= Li + cl / 1000 => clMax = (0,5 * Lo - Li) * 1000; - // double clMax1 = (0.5 * L[iOut] - L[iIn]) * 1000; - double clMax1 = (Lo - L[iIn]) * 1000; - // 0,5 * Co >= Ci + Cc => 0,5 * Co >= Ci + cl * 0.11 => clMax = (0,5 * Co - Ci) / 0.11; - // double clMax2 = (0.5 * C[iOut] - C[iIn]) / 0.11; - double clMax2 = (Co - C[iIn]) / 0.11; - if (clMax2 < clMax1) - clMax1 = clMax2; - if (clMax1 < 0) - clMax1 = 0; - else - clMax1 = Math.Round(clMax1, 2, MidpointRounding.AwayFromZero); - double sumLiLc = L[iIn] + Lc; - sumLiLc = Math.Round(sumLiLc, 2, MidpointRounding.AwayFromZero); - double sumCiCc = C[iIn] + Cc; - sumCiCc = Math.Round(sumCiCc, 2, MidpointRounding.AwayFromZero); - Lc = Math.Round(Lc, 2, MidpointRounding.AwayFromZero); - Cc = Math.Round(Cc, 2, MidpointRounding.AwayFromZero); - string color = "red"; - string ok = "NO"; - - - - - - - - - - - - - - - - - - - - -
- - - - - - - @{ - if (init == 0) - { - string logo = AasxHttpContextHelper.DataPath + "/logo.png"; - if (System.IO.File.Exists(logo)) - { - if (!System.IO.File.Exists("wwwroot/logo.png")) - System.IO.File.Copy(logo, "wwwroot/logo.png"); - init = 1; - } - } - if (init == 1) - { - - } - } - -
-
-  Proof of intrinsic safety showcase -
-
-
- - - - - - - -
- - - - - - - - - - - - - -
- Project name: - - @projectName[p] -
- Certified by: - - - - -
- Certified at: - - - - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Non-Ex Zone
-
-   - - -   - - Ex Zone
-
- Associated Apparatus
-
- - - - Intrinsically safe apparatus / field device
-
- @{ - bool svg = false; - string detailsImage = createDetailsImage(envIndex[iOut], ProductImage[iOut], out svg); - - @if (detailsImage != "") - { - if (!svg) - { - Details Image - } - else - { - Details Image - } - } - } - - -
- - Ex i Cable -
- - @{ - svg = false; - detailsImage = createDetailsImage(envIndex[iIn], ProductImage[iIn], out svg); - - @if (detailsImage != "") - { - if (!svg) - { - Details Image - } - else - { - Details Image - } - } - } -
- - @Identification[iOut] - - - - - - @Identification[iIn] -
Uo - ≤ - - - Ui
Io - ≤ - - - Ii
Po - ≤ - - - Pi
Lo - ≥ - - Li - - + - Lc
Co - ≥ - - Ci - - + - Cc
-
- - - - - -
- - Comparison of the safety data
-
- Proof of intrinsic safety (simple intrinsically safe circuit)
- In a simple intrinsically safe circuit without external concentrated capacitances (Ci) and without external concentrated inductances (Li), the full values of Co and Lo can be exploited.
-
- Proof of intrinsic safety (mixed intrinsically safe circuit)
- Condition for the mixed intrinsically safe circuit with external concentrated capacitances (Ci) and/or external concentrated inductances (Li).
- Li < 1% of Lo or Ci < 1% of Co
- Here, the full values of Co and Lo can also be exploited.
- Li ≥ 1% of Lo and Ci ≥ 1% of Co
- Values of 50% of Co and Lo are to be used here:
- Ci + Cc ≤ 0.5 Co
- Li + Lc ≤ 0.5 Lo
-
- @{ - if (LCgreater) - { - Li ≥ 1% of Lo - -
- Ci ≥ 1% of Co - -
- } - } -
-
-
- - - - - - - -
- - - - -
- Associated Apparatus -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Type - - SerialNumber - - Manufacturer - - Certificate - - Identification - - Uo [V] - - Io [mA] - - Po [mW] - - Lo [mH] - - Co [nF] -
- @ManufacturerProductDesignation[iOut] - - @{ - int iProductOut = iOut; - int pProductOut = p; - List optionsProductOut = new List(); - for (int loopProductOut = 0; loopProductOut < ManufacturerProductType.Count; loopProductOut++) - { - var tProductOut = ManufacturerProductType[loopProductOut]; - if (tProductOut != "" && isOutput[loopProductOut] && !optionsProductOut.Contains(tProductOut)) - { - optionsProductOut.Add(tProductOut); - } - } - - - - } - - @{ - int iSerialNumberOut = iOut; - int pSerialNumberOut = p; - - - - } - - @ManufacturerName[iOut] - - @{ - if (PreviewFileUrl[iOut] != "") - { -   - @TypeOfApproval[iOut] - } - else - { - @TypeOfApproval[iOut] - } - } - - @Identification[iOut] - - @U[iOut].ToString(CultureInfo.InvariantCulture) - - @I[iOut].ToString(CultureInfo.InvariantCulture) - - @P[iOut].ToString(CultureInfo.InvariantCulture) - - @L[iOut].ToString(CultureInfo.InvariantCulture) - - @C[iOut].ToString(CultureInfo.InvariantCulture) -
-
-
- - - - - - - -
- - - - -
- Intrinsically safe apparatus / field device -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Name - - Type - - SerialNumber - - Manufacturer - - Certificate - - Identification - - Ui [V] - - Ii [mA] - - Pi [mW] - - Li [mH] - - Ci [nF] -
- @ManufacturerProductDesignation[iIn] - - @{ - var iProductIn = iIn; - var pProductIn = p; - List optionsProductIn = new List(); - for (int loopProductIn = 0; loopProductIn < ManufacturerProductType.Count; loopProductIn++) - { - var tProductIn = ManufacturerProductType[loopProductIn]; - if (tProductIn != "" && !isOutput[loopProductIn] && !optionsProductIn.Contains(tProductIn)) - { - optionsProductIn.Add(tProductIn); - } - } - - - - } - - @{ - int iSerialNumberIn = iIn; - int pSerialNumberIn = p; - - - - } - - @ManufacturerName[iIn] - - @{ - if (PreviewFileUrl[iIn] != "") - { -   - @TypeOfApproval[iIn] - } - else - { - @TypeOfApproval[iIn] - } - } - - @Identification[iIn] - - @U[iIn].ToString(CultureInfo.InvariantCulture) - - @I[iIn].ToString(CultureInfo.InvariantCulture) - - @P[iIn].ToString(CultureInfo.InvariantCulture) - - @L[iIn].ToString(CultureInfo.InvariantCulture) - - @C[iIn].ToString(CultureInfo.InvariantCulture) -
-
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Cable capacities and inductance - - Manufacturer - - Cable length - - Cable Lc - - Cable Cc - - Maximum cable length - - Lc - - Cc -
- - STANDARD - - [m] - - [mH/km] - - [nF/km] - - [m] - - [mH] - - [nF] -
- (Manufacturer specification (Datasheet) or
- Lc = 1 mH/km, Cc = 110 nF/km) -
- - - - - - 1 - - 110 - - @clMax1.ToString(CultureInfo.InvariantCulture) - - @Lc.ToString(CultureInfo.InvariantCulture) - - @Cc.ToString(CultureInfo.InvariantCulture) -
-
- - - - - - - - - - - - - - - - -
- - Li + Lc - - Ci + Cc -
- - [mH] - - [nF] -
- Inductance (Li + Lc) and capacities (Ci + Cc) - - @sumLiLc.ToString(CultureInfo.InvariantCulture) - - @sumCiCc.ToString(CultureInfo.InvariantCulture) -
-
-
- - - - -
- - - - - - - @{ - color = "red"; - ok = "NO"; - if (U[iOut] <= U[iIn]) - { - color = "green"; - ok = "YES"; - } - } - - - - - - @{ - color = "red"; - ok = "NO"; - if (I[iOut] <= I[iIn]) - { - color = "green"; - ok = "YES"; - } - } - - - - - - @{ - color = "red"; - ok = "NO"; - if (P[iOut] <= P[iIn]) - { - color = "green"; - ok = "YES"; - } - } - - - - - - @{ - color = "red"; - ok = "NO"; - if (Lo >= sumLiLc) - { - color = "green"; - ok = "YES"; - } - } - - - - - - @{ - color = "red"; - ok = "NO"; - if (Co >= sumCiCc) - { - color = "green"; - ok = "YES"; - } - } - - - - - -
- Condition / Verification for intrinsic safety - - Intrinsic safety ok - - Additional condition -
- - - - - - - -
- Uo ≤ Ui - - @U[iOut].ToString(CultureInfo.InvariantCulture) - - - - @U[iIn].ToString(CultureInfo.InvariantCulture) -
-
- @ok - - Zone at the installation: Zone 0/1 -
- - - - - - - -
- Io ≤ Ii - - @I[iOut].ToString(CultureInfo.InvariantCulture) - - - - @I[iIn].ToString(CultureInfo.InvariantCulture) -
-
- @ok - - Ex Group: IIC -
- - - - - - - -
- Po ≤ Pi - - @P[iOut].ToString(CultureInfo.InvariantCulture) - - - - @P[iIn].ToString(CultureInfo.InvariantCulture) -
-
- @ok - - max. ambient temperature: -
- - - - - - - -
- - @{ - if (LCgreater) - { - 0.5 * - } - } - Lo ≥ Li + Lc - - - @Lo.ToString(CultureInfo.InvariantCulture) - - - - @sumLiLc.ToString(CultureInfo.InvariantCulture) -
-
- @ok - - Mixed IS circuit: -
- - - - - - - -
- - @{ - if (LCgreater) - { - 0.5 * - } - } - Co ≥ Ci + Cc - - - @Co.ToString(CultureInfo.InvariantCulture) - - - - @sumCiCc.ToString(CultureInfo.InvariantCulture) -
-
- @ok - - (with concentrated Li (≥ 1% Lo) and concentrated Ci (≥ 1% Co): YES -
-
-
- - if (inputLength[iOut] != Double.MinValue && inputLength[iOut] != cableLength[p]) - { - cableLength[p] = inputLength[iOut]; - } - /* - if (pCertifiedBy[p] != null) - pCertifiedBy[p].Value = certifiedBy[p]; - if (pCertifiedAt[p] != null) - certifiedAt[p] = pCertifiedAt[p].Value; - */ - -
-
- } - } - - - -
- -@code + + +@page "/atex2"; +@using AasxRestServerLibrary; +@using AasxServer +@using Microsoft.AspNetCore.Html; +@using Microsoft.IdentityModel.Tokens; +@using Extensions; +@using System.Globalization; +@inject Data.AASService SubmodelService +@inject NavigationManager NavMan + + + +
+ @if (Program.isLoadingDB) + { + Loading... + } + else + { + string url = NavMan.Uri; + string filter = ""; + var s = url.Split("?"); + if (s.Length == 2) + { + filter = s[1]; + } + Program.loadAllPackages(); + collectData(); + + for (int p = 0; p < countProject; p++) + { + if (filter != "" && filter != projectName[p]) + continue; + + int iOut = -1; + int iIn = -1; + for (int i = 0; i < count; i++) + { + if (eigensicheresbetriebsmittel[p] == ManufacturerProductType[i] + && (eigensicheresbetriebsmittelSeriennummer[p] == "" || eigensicheresbetriebsmittelSeriennummer[p] == SerialNumber[i])) + iIn = i; + if (zugehoerigesbetriebsmittel[p] == ManufacturerProductType[i] + && (zugehoerigesbetriebsmittelSeriennummer[p] == "" || zugehoerigesbetriebsmittelSeriennummer[p] == SerialNumber[i])) + iOut = i; + } + if (iOut == -1 || iIn == -1) + { + @projectName[p] can not be shown!
+ Type: @zugehoerigesbetriebsmittel[p] SerialNumber: @zugehoerigesbetriebsmittelSeriennummer[p]
+ Type: @eigensicheresbetriebsmittel[p] SerialNumber: @eigensicheresbetriebsmittelSeriennummer[p] + +
+
+ continue; + } + + if (certifiedBy[iOut] == "" && pCertifiedBy[p] != null) + certifiedBy[iOut] = pCertifiedBy[p].Value; + if (certifiedAt[iOut] == "" && pCertifiedAt[p] != null) + certifiedAt[iOut] = pCertifiedAt[p].Value; + + double Lo = L[iOut]; + double Co = C[iOut]; + bool LCgreater = false; + if (L[iIn] >= L[iOut] / 100 && C[iIn] >= C[iOut] / 100) + { + LCgreater = true; + Lo = 0.5 * Lo; + Co = 0.5 * Co; + } + + double cl = cableLength[p]; + if (inputLength[iOut] == Double.MinValue) + inputLength[iOut] = cl; + else + cl = inputLength[iOut]; + double Lc = cl / 1000.0 * 1; + double Cc = cl / 1000.0 * 110; + // 0,5 * Lo >= Li + Lc => 0,5 * Lo >= Li + cl / 1000 => clMax = (0,5 * Lo - Li) * 1000; + // double clMax1 = (0.5 * L[iOut] - L[iIn]) * 1000; + double clMax1 = (Lo - L[iIn]) * 1000; + // 0,5 * Co >= Ci + Cc => 0,5 * Co >= Ci + cl * 0.11 => clMax = (0,5 * Co - Ci) / 0.11; + // double clMax2 = (0.5 * C[iOut] - C[iIn]) / 0.11; + double clMax2 = (Co - C[iIn]) / 0.11; + if (clMax2 < clMax1) + clMax1 = clMax2; + if (clMax1 < 0) + clMax1 = 0; + else + clMax1 = Math.Round(clMax1, 2, MidpointRounding.AwayFromZero); + double sumLiLc = L[iIn] + Lc; + sumLiLc = Math.Round(sumLiLc, 2, MidpointRounding.AwayFromZero); + double sumCiCc = C[iIn] + Cc; + sumCiCc = Math.Round(sumCiCc, 2, MidpointRounding.AwayFromZero); + Lc = Math.Round(Lc, 2, MidpointRounding.AwayFromZero); + Cc = Math.Round(Cc, 2, MidpointRounding.AwayFromZero); + string color = "red"; + string ok = "NO"; + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + @{ + if (init == 0) + { + string logo = AasxHttpContextHelper.DataPath + "/logo.png"; + if (System.IO.File.Exists(logo)) + { + if (!System.IO.File.Exists("wwwroot/logo.png")) + System.IO.File.Copy(logo, "wwwroot/logo.png"); + init = 1; + } + } + if (init == 1) + { + + } + } + +
+
+  Proof of intrinsic safety showcase +
+
+
+ + + + + + + +
+ + + + + + + + + + + + + +
+ Project name: + + @projectName[p] +
+ Certified by: + + + + +
+ Certified at: + + + + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Non-Ex Zone
+
+   + + +   + + Ex Zone
+
+ Associated Apparatus
+
+ + + + Intrinsically safe apparatus / field device
+
+ @{ + bool svg = false; + string detailsImage = createDetailsImage(envIndex[iOut], ProductImage[iOut], out svg); + + @if (detailsImage != "") + { + if (!svg) + { + Details Image + } + else + { + Details Image + } + } + } + + +
+ + Ex i Cable +
+ + @{ + svg = false; + detailsImage = createDetailsImage(envIndex[iIn], ProductImage[iIn], out svg); + + @if (detailsImage != "") + { + if (!svg) + { + Details Image + } + else + { + Details Image + } + } + } +
+ + @Identification[iOut] + + + + + + @Identification[iIn] +
Uo + ≤ + + + Ui
Io + ≤ + + + Ii
Po + ≤ + + + Pi
Lo + ≥ + + Li + + + + Lc
Co + ≥ + + Ci + + + + Cc
+
+ + + + + +
+ + Comparison of the safety data
+
+ Proof of intrinsic safety (simple intrinsically safe circuit)
+ In a simple intrinsically safe circuit without external concentrated capacitances (Ci) and without external concentrated inductances (Li), the full values of Co and Lo can be exploited.
+
+ Proof of intrinsic safety (mixed intrinsically safe circuit)
+ Condition for the mixed intrinsically safe circuit with external concentrated capacitances (Ci) and/or external concentrated inductances (Li).
+ Li < 1% of Lo or Ci < 1% of Co
+ Here, the full values of Co and Lo can also be exploited.
+ Li ≥ 1% of Lo and Ci ≥ 1% of Co
+ Values of 50% of Co and Lo are to be used here:
+ Ci + Cc ≤ 0.5 Co
+ Li + Lc ≤ 0.5 Lo
+
+ @{ + if (LCgreater) + { + Li ≥ 1% of Lo + +
+ Ci ≥ 1% of Co + +
+ } + } +
+
+
+ + + + + + + +
+ + + + +
+ Associated Apparatus +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Type + + SerialNumber + + Manufacturer + + Certificate + + Identification + + Uo [V] + + Io [mA] + + Po [mW] + + Lo [mH] + + Co [nF] +
+ @ManufacturerProductDesignation[iOut] + + @{ + int iProductOut = iOut; + int pProductOut = p; + List optionsProductOut = new List(); + for (int loopProductOut = 0; loopProductOut < ManufacturerProductType.Count; loopProductOut++) + { + var tProductOut = ManufacturerProductType[loopProductOut]; + if (tProductOut != "" && isOutput[loopProductOut] && !optionsProductOut.Contains(tProductOut)) + { + optionsProductOut.Add(tProductOut); + } + } + + + + } + + @{ + int iSerialNumberOut = iOut; + int pSerialNumberOut = p; + + + + } + + @ManufacturerName[iOut] + + @{ + if (PreviewFileUrl[iOut] != "") + { +   + @TypeOfApproval[iOut] + } + else + { + @TypeOfApproval[iOut] + } + } + + @Identification[iOut] + + @U[iOut].ToString(CultureInfo.InvariantCulture) + + @I[iOut].ToString(CultureInfo.InvariantCulture) + + @P[iOut].ToString(CultureInfo.InvariantCulture) + + @L[iOut].ToString(CultureInfo.InvariantCulture) + + @C[iOut].ToString(CultureInfo.InvariantCulture) +
+
+
+ + + + + + + +
+ + + + +
+ Intrinsically safe apparatus / field device +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Type + + SerialNumber + + Manufacturer + + Certificate + + Identification + + Ui [V] + + Ii [mA] + + Pi [mW] + + Li [mH] + + Ci [nF] +
+ @ManufacturerProductDesignation[iIn] + + @{ + var iProductIn = iIn; + var pProductIn = p; + List optionsProductIn = new List(); + for (int loopProductIn = 0; loopProductIn < ManufacturerProductType.Count; loopProductIn++) + { + var tProductIn = ManufacturerProductType[loopProductIn]; + if (tProductIn != "" && !isOutput[loopProductIn] && !optionsProductIn.Contains(tProductIn)) + { + optionsProductIn.Add(tProductIn); + } + } + + + + } + + @{ + int iSerialNumberIn = iIn; + int pSerialNumberIn = p; + + + + } + + @ManufacturerName[iIn] + + @{ + if (PreviewFileUrl[iIn] != "") + { +   + @TypeOfApproval[iIn] + } + else + { + @TypeOfApproval[iIn] + } + } + + @Identification[iIn] + + @U[iIn].ToString(CultureInfo.InvariantCulture) + + @I[iIn].ToString(CultureInfo.InvariantCulture) + + @P[iIn].ToString(CultureInfo.InvariantCulture) + + @L[iIn].ToString(CultureInfo.InvariantCulture) + + @C[iIn].ToString(CultureInfo.InvariantCulture) +
+
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Cable capacities and inductance + + Manufacturer + + Cable length + + Cable Lc + + Cable Cc + + Maximum cable length + + Lc + + Cc +
+ + STANDARD + + [m] + + [mH/km] + + [nF/km] + + [m] + + [mH] + + [nF] +
+ (Manufacturer specification (Datasheet) or
+ Lc = 1 mH/km, Cc = 110 nF/km) +
+ + + + + + 1 + + 110 + + @clMax1.ToString(CultureInfo.InvariantCulture) + + @Lc.ToString(CultureInfo.InvariantCulture) + + @Cc.ToString(CultureInfo.InvariantCulture) +
+
+ + + + + + + + + + + + + + + + +
+ + Li + Lc + + Ci + Cc +
+ + [mH] + + [nF] +
+ Inductance (Li + Lc) and capacities (Ci + Cc) + + @sumLiLc.ToString(CultureInfo.InvariantCulture) + + @sumCiCc.ToString(CultureInfo.InvariantCulture) +
+
+
+ + + + +
+ + + + + + + @{ + color = "red"; + ok = "NO"; + if (U[iOut] <= U[iIn]) + { + color = "green"; + ok = "YES"; + } + } + + + + + + @{ + color = "red"; + ok = "NO"; + if (I[iOut] <= I[iIn]) + { + color = "green"; + ok = "YES"; + } + } + + + + + + @{ + color = "red"; + ok = "NO"; + if (P[iOut] <= P[iIn]) + { + color = "green"; + ok = "YES"; + } + } + + + + + + @{ + color = "red"; + ok = "NO"; + if (Lo >= sumLiLc) + { + color = "green"; + ok = "YES"; + } + } + + + + + + @{ + color = "red"; + ok = "NO"; + if (Co >= sumCiCc) + { + color = "green"; + ok = "YES"; + } + } + + + + + +
+ Condition / Verification for intrinsic safety + + Intrinsic safety ok + + Additional condition +
+ + + + + + + +
+ Uo ≤ Ui + + @U[iOut].ToString(CultureInfo.InvariantCulture) + + + + @U[iIn].ToString(CultureInfo.InvariantCulture) +
+
+ @ok + + Zone at the installation: Zone 0/1 +
+ + + + + + + +
+ Io ≤ Ii + + @I[iOut].ToString(CultureInfo.InvariantCulture) + + + + @I[iIn].ToString(CultureInfo.InvariantCulture) +
+
+ @ok + + Ex Group: IIC +
+ + + + + + + +
+ Po ≤ Pi + + @P[iOut].ToString(CultureInfo.InvariantCulture) + + + + @P[iIn].ToString(CultureInfo.InvariantCulture) +
+
+ @ok + + max. ambient temperature: +
+ + + + + + + +
+ + @{ + if (LCgreater) + { + 0.5 * + } + } + Lo ≥ Li + Lc + + + @Lo.ToString(CultureInfo.InvariantCulture) + + + + @sumLiLc.ToString(CultureInfo.InvariantCulture) +
+
+ @ok + + Mixed IS circuit: +
+ + + + + + + +
+ + @{ + if (LCgreater) + { + 0.5 * + } + } + Co ≥ Ci + Cc + + + @Co.ToString(CultureInfo.InvariantCulture) + + + + @sumCiCc.ToString(CultureInfo.InvariantCulture) +
+
+ @ok + + (with concentrated Li (≥ 1% Lo) and concentrated Ci (≥ 1% Co): YES +
+
+
+ + if (inputLength[iOut] != Double.MinValue && inputLength[iOut] != cableLength[p]) + { + cableLength[p] = inputLength[iOut]; + } + /* + if (pCertifiedBy[p] != null) + pCertifiedBy[p].Value = certifiedBy[p]; + if (pCertifiedAt[p] != null) + certifiedAt[p] = pCertifiedAt[p].Value; + */ + +
+
+ } + } + + + +
+ +@code { - void OnChangeProductOut(ChangeEventArgs args, int iOut, int loop) - { - if (args.Value != null) - { - var a = args.Value.ToString(); - - zugehoerigesbetriebsmittel[loop] = a; - pZugehoerigesbetriebsmittel[loop].Value = a; - for (int j = 0; j < ManufacturerProductType.Count; j++) - { - if (a == ManufacturerProductType[j]) - { - zugehoerigesbetriebsmittelSeriennummer[loop] = SerialNumber[j]; - if (pZugehoerigesbetriebsmittelSeriennummer[loop] != null) - { - pZugehoerigesbetriebsmittelSeriennummer[loop].Value = SerialNumber[j]; - } - break; - } + void OnChangeProductOut(ChangeEventArgs args, int iOut, int loop) + { + if (args.Value != null) + { + var a = args.Value.ToString(); + + zugehoerigesbetriebsmittel[loop] = a; + pZugehoerigesbetriebsmittel[loop].Value = a; + for (int j = 0; j < ManufacturerProductType.Count; j++) + { + if (a == ManufacturerProductType[j]) + { + zugehoerigesbetriebsmittelSeriennummer[loop] = SerialNumber[j]; + if (pZugehoerigesbetriebsmittelSeriennummer[loop] != null) + { + pZugehoerigesbetriebsmittelSeriennummer[loop].Value = SerialNumber[j]; + } + break; + } } AasxServer.Program.env[envProject].setWrite(true); - Program.signalNewData(0); - } - } - - void OnChangeProductIn(ChangeEventArgs args, int iIn, int loop) - { - if (args.Value != null) - { - var a = args.Value.ToString(); - - eigensicheresbetriebsmittel[loop] = a; - pEigensicheresbetriebsmittel[loop].Value = a; - for (int j = 0; j < ManufacturerProductType.Count; j++) - { - if (a == ManufacturerProductType[j]) - { - eigensicheresbetriebsmittelSeriennummer[loop] = SerialNumber[j]; - if (pEigensicheresbetriebsmittelSeriennummer[loop] != null) - { - pEigensicheresbetriebsmittelSeriennummer[loop].Value = SerialNumber[j]; - } - break; - } + Program.signalNewData(0); + } + } + + void OnChangeProductIn(ChangeEventArgs args, int iIn, int loop) + { + if (args.Value != null) + { + var a = args.Value.ToString(); + + eigensicheresbetriebsmittel[loop] = a; + pEigensicheresbetriebsmittel[loop].Value = a; + for (int j = 0; j < ManufacturerProductType.Count; j++) + { + if (a == ManufacturerProductType[j]) + { + eigensicheresbetriebsmittelSeriennummer[loop] = SerialNumber[j]; + if (pEigensicheresbetriebsmittelSeriennummer[loop] != null) + { + pEigensicheresbetriebsmittelSeriennummer[loop].Value = SerialNumber[j]; + } + break; + } } AasxServer.Program.env[envProject].setWrite(true); Program.signalNewData(0); - } - } - - void OnChangeSerialNumberOut(ChangeEventArgs args, int iOut, int loop) - { - if (args.Value != null) - { - var a = args.Value.ToString(); - zugehoerigesbetriebsmittelSeriennummer[loop] = a; - if (pZugehoerigesbetriebsmittelSeriennummer[loop] != null) - { - pZugehoerigesbetriebsmittelSeriennummer[loop].Value = a; + } + } + + void OnChangeSerialNumberOut(ChangeEventArgs args, int iOut, int loop) + { + if (args.Value != null) + { + var a = args.Value.ToString(); + zugehoerigesbetriebsmittelSeriennummer[loop] = a; + if (pZugehoerigesbetriebsmittelSeriennummer[loop] != null) + { + pZugehoerigesbetriebsmittelSeriennummer[loop].Value = a; } AasxServer.Program.env[envProject].setWrite(true); Program.signalNewData(0); - } - } - - void OnChangeSerialNumberIn(ChangeEventArgs args, int iIn, int loop) - { - if (args.Value != null) - { - var a = args.Value.ToString(); - eigensicheresbetriebsmittelSeriennummer[loop] = a; - if (pEigensicheresbetriebsmittelSeriennummer[loop] != null) - { - pEigensicheresbetriebsmittelSeriennummer[loop].Value = a; + } + } + + void OnChangeSerialNumberIn(ChangeEventArgs args, int iIn, int loop) + { + if (args.Value != null) + { + var a = args.Value.ToString(); + eigensicheresbetriebsmittelSeriennummer[loop] = a; + if (pEigensicheresbetriebsmittelSeriennummer[loop] != null) + { + pEigensicheresbetriebsmittelSeriennummer[loop].Value = a; } AasxServer.Program.env[envProject].setWrite(true); Program.signalNewData(0); - } - } - - int newDataMode = 1; - object lockNewDataMode = new object(); - static int init = 0; + } + } + + int newDataMode = 1; + object lockNewDataMode = new object(); + static int init = 0; int countProject = 0; int envProject = -1; - List project = null; - List projectName = null; - List cableLength = null; - List pCableLength = null; - List certifiedBy = null; - List pCertifiedBy = null; - List certifiedAt = null; - List pCertifiedAt = null; - List eigensicheresbetriebsmittel = null; - List pEigensicheresbetriebsmittel = null; - List eigensicheresbetriebsmittelSeriennummer = null; - List pEigensicheresbetriebsmittelSeriennummer = null; - List zugehoerigesbetriebsmittel = null; - List pZugehoerigesbetriebsmittel = null; - List zugehoerigesbetriebsmittelSeriennummer = null; - List pZugehoerigesbetriebsmittelSeriennummer = null; - - int count = 0; - List isOutput = null; - List envIndex = null; - List Nameplate = null; - List TechnicalData = null; - List ManufacturerProductDesignation = null; - List ManufacturerProductType = null; - List SerialNumber = null; - List ManufacturerName = null; - List ManufacturerLogo = null; - List ProductImage = null; - List DesignationOfCertificateOrApproval = null; - List PreviewFile = null; - List PreviewFileUrl = null; - List TypeOfApproval = null; - List Identification = null; - List SafetyRelatedPropertiesForActiveBehaviour = null; - List SafetyRelatedPropertiesForPassiveBehaviour = null; - List U = null; - List I = null; - List P = null; - List L = null; - List C = null; - List Alternatives = null; - List inputLength = null; - - void collectData() - { - int dataMode = 0; - lock (lockNewDataMode) - { - if (newDataMode != 0) - { - dataMode = newDataMode; - newDataMode = 0; - } - } - + List project = null; + List projectName = null; + List cableLength = null; + List pCableLength = null; + List certifiedBy = null; + List pCertifiedBy = null; + List certifiedAt = null; + List pCertifiedAt = null; + List eigensicheresbetriebsmittel = null; + List pEigensicheresbetriebsmittel = null; + List eigensicheresbetriebsmittelSeriennummer = null; + List pEigensicheresbetriebsmittelSeriennummer = null; + List zugehoerigesbetriebsmittel = null; + List pZugehoerigesbetriebsmittel = null; + List zugehoerigesbetriebsmittelSeriennummer = null; + List pZugehoerigesbetriebsmittelSeriennummer = null; + + int count = 0; + List isOutput = null; + List envIndex = null; + List Nameplate = null; + List TechnicalData = null; + List ManufacturerProductDesignation = null; + List ManufacturerProductType = null; + List SerialNumber = null; + List ManufacturerName = null; + List ManufacturerLogo = null; + List ProductImage = null; + List DesignationOfCertificateOrApproval = null; + List PreviewFile = null; + List PreviewFileUrl = null; + List TypeOfApproval = null; + List Identification = null; + List SafetyRelatedPropertiesForActiveBehaviour = null; + List SafetyRelatedPropertiesForPassiveBehaviour = null; + List U = null; + List I = null; + List P = null; + List L = null; + List C = null; + List Alternatives = null; + List inputLength = null; + + void collectData() + { + int dataMode = 0; + lock (lockNewDataMode) + { + if (newDataMode != 0) + { + dataMode = newDataMode; + newDataMode = 0; + } + } + countProject = 0; - project = new List(); - projectName = new List(); - cableLength = new List(); - pCableLength = new List(); - if (dataMode != 0) - { - certifiedBy = new List(); - pCertifiedBy = new List(); - certifiedAt = new List(); - pCertifiedAt = new List(); - eigensicheresbetriebsmittel = new List(); - pEigensicheresbetriebsmittel = new List(); - eigensicheresbetriebsmittelSeriennummer = new List(); - pEigensicheresbetriebsmittelSeriennummer = new List(); - zugehoerigesbetriebsmittel = new List(); - pZugehoerigesbetriebsmittel = new List(); - zugehoerigesbetriebsmittelSeriennummer = new List(); - pZugehoerigesbetriebsmittelSeriennummer = new List(); - } - count = 0; - isOutput = new List(); - envIndex = new List(); - Nameplate = new List(); - TechnicalData = new List(); - ManufacturerProductDesignation = new List(); - if (dataMode != 0) - { - ManufacturerProductType = new List(); - SerialNumber = new List(); - } - ManufacturerName = new List(); - ManufacturerLogo = new List(); - ProductImage = new List(); - DesignationOfCertificateOrApproval = new List(); - PreviewFile = new List(); - PreviewFileUrl = new List(); - TypeOfApproval = new List(); - Identification = new List(); - SafetyRelatedPropertiesForActiveBehaviour = new List(); - SafetyRelatedPropertiesForPassiveBehaviour = new List(); - U = new List(); - I = new List(); - P = new List(); - L = new List(); - C = new List(); - if (dataMode != 0) - Alternatives = new List(); - if (dataMode != 0) - inputLength = new List(); - - int aascount = AasxServer.Program.env.Length; - - for (int i = 0; i < aascount; i++) - { - bool found = false; - var env = AasxServer.Program.env[i]; - if (env != null) - { - var aas = env.AasEnv.AssetAdministrationShells[0]; - - if (aas.Submodels != null && aas.Submodels.Count > 0) - { - foreach (var smr in aas.Submodels) - { - var sm = env.AasEnv.FindSubmodel(smr); - { - if (sm != null && sm.IdShort != null) - { - if ((sm.IdShort.ToLower() == "nachweiseigensicherheit" || sm.IdShort.ToLower() == "proofofintrinsicsafety") && sm.SubmodelElements != null) - { - foreach (var s in sm.SubmodelElements) - { - if (s.IdShort.ToLower().Contains("projekt") || s.IdShort.ToLower().Contains("loop")) - { - if (s != null && s is SubmodelElementCollection smc) + project = new List(); + projectName = new List(); + cableLength = new List(); + pCableLength = new List(); + if (dataMode != 0) + { + certifiedBy = new List(); + pCertifiedBy = new List(); + certifiedAt = new List(); + pCertifiedAt = new List(); + eigensicheresbetriebsmittel = new List(); + pEigensicheresbetriebsmittel = new List(); + eigensicheresbetriebsmittelSeriennummer = new List(); + pEigensicheresbetriebsmittelSeriennummer = new List(); + zugehoerigesbetriebsmittel = new List(); + pZugehoerigesbetriebsmittel = new List(); + zugehoerigesbetriebsmittelSeriennummer = new List(); + pZugehoerigesbetriebsmittelSeriennummer = new List(); + } + count = 0; + isOutput = new List(); + envIndex = new List(); + Nameplate = new List(); + TechnicalData = new List(); + ManufacturerProductDesignation = new List(); + if (dataMode != 0) + { + ManufacturerProductType = new List(); + SerialNumber = new List(); + } + ManufacturerName = new List(); + ManufacturerLogo = new List(); + ProductImage = new List(); + DesignationOfCertificateOrApproval = new List(); + PreviewFile = new List(); + PreviewFileUrl = new List(); + TypeOfApproval = new List(); + Identification = new List(); + SafetyRelatedPropertiesForActiveBehaviour = new List(); + SafetyRelatedPropertiesForPassiveBehaviour = new List(); + U = new List(); + I = new List(); + P = new List(); + L = new List(); + C = new List(); + if (dataMode != 0) + Alternatives = new List(); + if (dataMode != 0) + inputLength = new List(); + + int aascount = AasxServer.Program.env.Length; + + for (int i = 0; i < aascount; i++) + { + bool found = false; + var env = AasxServer.Program.env[i]; + if (env != null) + { + var aas = env.AasEnv.AssetAdministrationShells[0]; + + if (aas.Submodels != null && aas.Submodels.Count > 0) + { + foreach (var smr in aas.Submodels) + { + var sm = env.AasEnv.FindSubmodel(smr); + { + if (sm != null && sm.IdShort != null) + { + if ((sm.IdShort.ToLower() == "nachweiseigensicherheit" || sm.IdShort.ToLower() == "proofofintrinsicsafety") && sm.SubmodelElements != null) + { + foreach (var s in sm.SubmodelElements) + { + if (s.IdShort.ToLower().Contains("projekt") || s.IdShort.ToLower().Contains("loop")) + { + if (s != null && s is SubmodelElementCollection smc) { if (envProject == -1) { envProject = i; - } - project.Add(s as SubmodelElementCollection); - projectName.Add(""); - cableLength.Add(0); - pCableLength.Add(null); - if (pCertifiedBy.Count <= countProject) - { - pCertifiedBy.Add(null); - pCertifiedAt.Add(null); - } - if (eigensicheresbetriebsmittel.Count <= countProject) - eigensicheresbetriebsmittel.Add(""); - if (pEigensicheresbetriebsmittel.Count <= countProject) - pEigensicheresbetriebsmittel.Add(null); - if (eigensicheresbetriebsmittelSeriennummer.Count <= countProject) - eigensicheresbetriebsmittelSeriennummer.Add(""); - if (pEigensicheresbetriebsmittelSeriennummer.Count <= countProject) - pEigensicheresbetriebsmittelSeriennummer.Add(null); - if (zugehoerigesbetriebsmittel.Count <= countProject) - zugehoerigesbetriebsmittel.Add(""); - if (pZugehoerigesbetriebsmittel.Count <= countProject) - pZugehoerigesbetriebsmittel.Add(null); - if (zugehoerigesbetriebsmittelSeriennummer.Count <= countProject) - zugehoerigesbetriebsmittelSeriennummer.Add(""); - if (pZugehoerigesbetriebsmittelSeriennummer.Count <= countProject) - pZugehoerigesbetriebsmittelSeriennummer.Add(null); - - var sme = findeSME(smc: project[countProject], idShortPath: "projektbezeichnung", ignore: true); - if (sme != null) - projectName[countProject] = sme.ValueAsText(); - sme = findeSME(smc: project[countProject], idShortPath: "projectname", ignore: true); - if (sme != null) - projectName[countProject] = sme.ValueAsText(); - sme = findeSME(smc: project[countProject], idShortPath: "eigensicheresbetriebsmittel", ignore: true); - if (sme != null) - { - if (eigensicheresbetriebsmittel[countProject] == "") - eigensicheresbetriebsmittel[countProject] = sme.ValueAsText(); - if (pEigensicheresbetriebsmittel[countProject] == null) - pEigensicheresbetriebsmittel[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "intrinsicallysafeapparatus", ignore: true); - if (sme != null) - { - if (eigensicheresbetriebsmittel[countProject] == "") - eigensicheresbetriebsmittel[countProject] = sme.ValueAsText(); - if (pEigensicheresbetriebsmittel[countProject] == null) - pEigensicheresbetriebsmittel[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "eigensicheresbetriebsmittelSeriennummer", ignore: true); - if (sme != null) - { - if (eigensicheresbetriebsmittelSeriennummer[countProject] == "") - eigensicheresbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); - if (pEigensicheresbetriebsmittelSeriennummer[countProject] == null) - pEigensicheresbetriebsmittelSeriennummer[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "intrinsicallysafeapparatusserialnumber", ignore: true); - if (sme != null) - { - if (eigensicheresbetriebsmittelSeriennummer[countProject] == "") - eigensicheresbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); - if (pEigensicheresbetriebsmittelSeriennummer[countProject] == null) - pEigensicheresbetriebsmittelSeriennummer[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "zugehoerigesbetriebsmittel", ignore: true); - if (sme != null) - { - if (zugehoerigesbetriebsmittel[countProject] == "") - zugehoerigesbetriebsmittel[countProject] = sme.ValueAsText(); - if (pZugehoerigesbetriebsmittel[countProject] == null) - pZugehoerigesbetriebsmittel[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "associatedapparatus", ignore: true); - if (sme != null) - { - if (zugehoerigesbetriebsmittel[countProject] == "") - zugehoerigesbetriebsmittel[countProject] = sme.ValueAsText(); - if (pZugehoerigesbetriebsmittel[countProject] == null) - pZugehoerigesbetriebsmittel[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "zugehoerigesbetriebsmittelSeriennummer", ignore: true); - if (sme != null) - { - if (zugehoerigesbetriebsmittelSeriennummer[countProject] == "") - zugehoerigesbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); - if (pZugehoerigesbetriebsmittelSeriennummer[countProject] == null) - pZugehoerigesbetriebsmittelSeriennummer[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "associatedapparatusserialnumber", ignore: true); - if (sme != null) - { - if (zugehoerigesbetriebsmittelSeriennummer[countProject] == "") - zugehoerigesbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); - if (pZugehoerigesbetriebsmittelSeriennummer[countProject] == null) - pZugehoerigesbetriebsmittelSeriennummer[countProject] = sme as Property; - } - sme = findeSME(smc: project[countProject], idShortPath: "leitungslaenge", ignore: true); - if (sme != null) - { - try - { - cableLength[countProject] = Convert.ToDouble(sme.ValueAsText(), CultureInfo.InvariantCulture); - pCableLength[countProject] = sme as Property; - } - catch { } - } - sme = findeSME(smc: project[countProject], idShortPath: "cablelength", ignore: true); - if (sme != null) - { - try - { - cableLength[countProject] = Convert.ToDouble(sme.ValueAsText(), CultureInfo.InvariantCulture); - pCableLength[countProject] = sme as Property; - } - catch { } - } - sme = findeSME(smc: project[countProject], idShortPath: "CertifiedBy", ignore: true); - if (sme != null) - { - if (pCertifiedBy[countProject] == null) - { - pCertifiedBy[countProject] = sme as Property; - } - } - sme = findeSME(smc: project[countProject], idShortPath: "CertifiedAt", ignore: true); - if (sme != null) - { - if (pCertifiedAt[countProject] == null) - { - pCertifiedAt[countProject] = sme as Property; - } - } - countProject++; - } - } - } - } - if (sm.IdShort.ToLower() == "nameplate") - { - found = true; - isOutput.Add(false); - envIndex.Add(i); - Nameplate.Add(sm as Submodel); - ManufacturerProductDesignation.Add(""); - ManufacturerName.Add(""); - DesignationOfCertificateOrApproval.Add(""); - PreviewFile.Add(""); - PreviewFileUrl.Add(""); - TypeOfApproval.Add(""); - Identification.Add(""); - SafetyRelatedPropertiesForActiveBehaviour.Add(null); - SafetyRelatedPropertiesForPassiveBehaviour.Add(null); - U.Add(0); - I.Add(0); - P.Add(0); - L.Add(0); - C.Add(0); - if (C.Count > ManufacturerProductType.Count) - ManufacturerProductType.Add(""); - if (C.Count > SerialNumber.Count) - SerialNumber.Add(""); - if (C.Count > Alternatives.Count) - Alternatives.Add(""); - if (C.Count > inputLength.Count) - inputLength.Add(Double.MinValue); - if (C.Count > certifiedBy.Count) - certifiedBy.Add(""); - if (C.Count > certifiedAt.Count) - certifiedAt.Add(""); - - var sme = findeSME(sm: sm, idShortPath: "ManufacturerProductDesignation", ignore: true); - if (sme != null) - { - if (sme is Property p) - ManufacturerProductDesignation[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - ManufacturerProductDesignation[count] = mlp.Value[0].Text; - } - } - - if (ManufacturerProductType[count] == "") - { - sme = findeSME(sm: sm, idShortPath: "ManufacturerProductType", ignore: true); - if (sme != null) - { - if (sme is Property p) - ManufacturerProductType[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - ManufacturerProductType[count] = mlp.Value[0].Text; - } - } - } - - if (SerialNumber[count] == "") - { - sme = findeSME(sm: sm, idShortPath: "SerialNumber", ignore: true); - if (sme != null) - { - if (sme is Property p) - SerialNumber[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - SerialNumber[count] = mlp.Value[0].Text; - } - } - } - - sme = findeSME(sm: sm, idShortPath: "ManufacturerName", ignore: true); - if (sme != null) - { - if (sme is Property p) - ManufacturerName[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - ManufacturerName[count] = mlp.Value[0].Text; - } - } - - sme = findeSME(sm: sm, - idShortPath: "Markings.Marking.ExplosionSafeties.ExplosionSafety", - ignore: true, contains: true); - if (sme != null) - { - var s = sme as SubmodelElementCollection; - - sme = findeSME(smc: s, idShortPath: "DesignationOfCertificateOrApproval", ignore: true); - if (sme != null) - { - if (sme is Property p) - DesignationOfCertificateOrApproval[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - DesignationOfCertificateOrApproval[count] = mlp.Value[0].Text; - } - } - - sme = findeSME(smc: s, idShortPath: "PreviewFile", ignore: true); - if (sme != null) - { - if (sme is File f) - { - PreviewFile[count] = f.Value; - } - } - - sme = findeSME(smc: s, idShortPath: "DigitalFile", ignore: true); - if (sme != null) - { - if (sme is File f) - { - var path = getPath(sme); - if (path != null) - { - PreviewFileUrl[count] = path; - } - } - } - - sme = findeSME(smc: s, idShortPath: "TypeOfApproval", ignore: true); - if (sme != null) - { - if (sme is Property p) - TypeOfApproval[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - TypeOfApproval[count] = mlp.Value[0].Text; - } - } - - sme = findeSME(smc: s, idShortPath: "Identification", ignore: true); - if (sme != null) - { - if (sme is Property p) - Identification[count] = p.Value; - if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) - { - Identification[count] = mlp.Value[0].Text; - } - } - } - - sme = findeSME(sm: sm, - idShortPath: "Markings.Marking.ExplosionSafeties.ExplosionSafety.ExternalElectricalCircuit.SafetyRelatedPropertiesForActiveBehaviour", - ignore: true, contains: true); - if (sme != null) - { - var s = sme as SubmodelElementCollection; - isOutput[count] = true; - SafetyRelatedPropertiesForActiveBehaviour[count] = s; - - sme = findeSME(smc: s, idShortPath: "MaxOutputPower", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - P[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxOutputVoltage", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - U[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxOutputCurrent", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - I[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxExternalCapacitance", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - string v = p.Value; - // fix generator bug - if (v.Contains(" nF")) - v = v.Replace(" nF", ""); - C[count] = Convert.ToDouble(v, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxExternalInductance", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - L[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - } - else - { - sme = findeSME(sm: sm, - idShortPath: "Markings.Marking.ExplosionSafeties.ExplosionSafety.ExternalElectricalCircuit.SafetyRelatedPropertiesForPassiveBehaviour", - ignore: true, contains: true); - if (sme != null) - { - var s = sme as SubmodelElementCollection; - SafetyRelatedPropertiesForPassiveBehaviour[count] = s as SubmodelElementCollection; - - sme = findeSME(smc: s, idShortPath: "MaxInputPower", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - P[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxInputVoltage", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - U[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxInputCurrent", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - I[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxInternalCapacitance", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - C[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - - sme = findeSME(smc: s, idShortPath: "MaxInternalInductance", ignore: true); - if (sme != null) - { - if (sme is Property p) - { - try - { - L[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); - } - catch { } - } - } - } - } - } - if (sm.IdShort.ToLower() == "handoverdocumentation") - { - found = true; - if (PreviewFile[count] != "") - { - var sme = findeSMEValue(sm: sm, value: PreviewFile[count]); - if (sme != null) - { - var path = getPath(sme); - if (path != null) - { - PreviewFileUrl[count] = path.Replace("PreviewFile", "DigitalFile"); - } - } - } - foreach (var se in sm.SubmodelElements) - { - if (se is SubmodelElementCollection smc) - { - var sme = findeSME(smc: smc, - idShortPath: "DocumentVersion.PreviewFile", - ignore: true, contains: true); - if (sme != null) - { - if (sme is File f) - { - if (f.Value.ToLower().Contains("atex")) - { - PreviewFile[count] = f.Value; - var path = getPath(f); - if (path != null) - { - PreviewFileUrl[count] = path.Replace("PreviewFile", "DigitalFile"); - } - if (TypeOfApproval[count] == "") - TypeOfApproval[count] = "ATEX"; - } - if (f.Value.ToLower().Contains("iecex") && TypeOfApproval[count] == "") - { - PreviewFile[count] = f.Value; - var path = getPath(f); - if (path != null) - { - PreviewFileUrl[count] = path.Replace("PreviewFile", "DigitalFile"); - } - if (TypeOfApproval[count] == "") - TypeOfApproval[count] = "IECEX"; - } - } - } - } - } - } - if (sm.IdShort.ToLower() == "technicaldata") - { - found = true; - TechnicalData.Add(sm as Submodel); - ManufacturerLogo.Add(""); - ProductImage.Add(""); - - var sme = findeSME(sm: sm, idShortPath: "GeneralInformation", ignore: true); - if (sme != null) - { - var g = sme as SubmodelElementCollection; - sme = findeSME(smc: g, idShortPath: "ManufacturerLogo", ignore: true); - if (sme != null) - { - if (sme is File f) - ManufacturerLogo[count] = f.Value; - } - sme = findeSME(smc: g, idShortPath: "ProductImage", ignore: true); - if (sme != null) - { - if (sme is File f) - ProductImage[count] = f.Value; - } - } - } - } - } - } - - } - } - - if (found) - { - count++; - } - } - } - - string getPath(ISubmodelElement sme) - { - string path = sme.IdShort; - var p = sme.Parent; - while (p != null && !(p is Submodel)) - { - path = (p as ISubmodelElement).IdShort + "." + path; - p = (p as ISubmodelElement).Parent; - } - if (p == null) - return null; - - var idEncoded = Base64UrlEncoder.Encode((p as Submodel).Id); - path = Program.externalBlazor + "/submodels/" + idEncoded + "/submodel-elements/" + path + "/attachment"; - return path; - } - - ISubmodelElement findeSME(ISubmodel sm = null, ISubmodelElementCollection smc = null, string idShortPath = null, - bool ignore = false, bool contains = false) - { - if (idShortPath == null) - return null; - var path = idShortPath.Split("."); - - int level = 0; - List[] levelSMEs = new List[path.Length]; - int[] iLevel = new int[path.Length]; - iLevel[0] = 0; - - if (sm != null) - { - levelSMEs[0] = sm.SubmodelElements; - } - else if (smc != null) - { - levelSMEs[0] = smc.Value; - } - else - return null; - - while (level >= 0 && level < path.Length && levelSMEs[level] != null && levelSMEs[level].Count != 0) - { - while (level >= 0 && iLevel[level] < levelSMEs[level].Count) - { - ISubmodelElement sme = levelSMEs[level][iLevel[level]]; - string id1 = sme.IdShort; - string id2 = path[level]; - if (ignore) - { - id1 = id1.ToLower(); - id2 = id2.ToLower(); - } - if (id1 == id2 || (contains && id1.Contains(id2))) - { - if (level == path.Count() - 1) - return sme; - if (sme is SubmodelElementCollection smc2) - { - iLevel[level]++; - levelSMEs[level + 1] = smc2.Value; - iLevel[level + 1] = 0; - level++; - continue; - } - } - iLevel[level]++; - while (level >= 0 && iLevel[level] == levelSMEs[level].Count) - { - level--; - } - } - } - - return null; - } - - ISubmodelElement findeSMEValue(ISubmodel sm = null, ISubmodelElementCollection smc = null, string value = null) - { - if (value == null) - return null; - - int level = 0; - List> levelSMEs = new List>(); - List iLevel = new List(); - iLevel.Add(0); - - if (sm != null) - { - levelSMEs.Add(sm.SubmodelElements); - } - else if (smc != null) - { - levelSMEs.Add(smc.Value); - } - else - return null; - - while (level >= 0 && levelSMEs[level] != null && levelSMEs[level].Count != 0) - { - while (level >= 0 && iLevel[level] < levelSMEs[level].Count) - { - ISubmodelElement sme = levelSMEs[level][iLevel[level]]; - - if (sme.ValueAsText() == value) - return sme; - if (sme is SubmodelElementCollection smc2) - { - iLevel[level]++; - levelSMEs.Add(smc2.Value); - iLevel.Add(0); - level++; - continue; - } - iLevel[level]++; - while (level >= 0 && iLevel[level] == levelSMEs[level].Count) - { - levelSMEs.RemoveAt(level); - iLevel.RemoveAt(level); - level--; - } - } - } - - return null; - } - - public static string createDetailsImage(int envIndex, string filePath, out bool svg) - { - svg = false; - - if (!string.IsNullOrEmpty(filePath)) - { - string[] split = filePath.Split(new Char[] { '/' }); - if (split.Length == 2 || split.Length > 1 && split[1].ToLower() == "aasx") - { - split = filePath.Split(new Char[] { '.' }); - switch (split.Last().ToLower()) - { - case "jpg": - case "bmp": - case "png": - case "svg": - try - { - using (System.IO.Stream s = Program.env[envIndex].GetLocalStreamFromPackage(filePath)) - { - if (s != null) - { - using (var m = new System.IO.MemoryStream()) - { - if (split.Last().ToLower() == "svg") - { - svg = true; - } - s.CopyTo(m); - return System.Convert.ToBase64String(m.ToArray()); - } - } - } - } - catch { } - break; - } - } - } - - return ""; - } - - protected override void OnInitialized() - { - SubmodelService.NewDataAvailable += NewData; - } - - public void Dispose() - { - SubmodelService.NewDataAvailable -= NewData; - } - - void NewData(object source, EventArgs args) - { - if (Program.isLoading) - return; - - if (args is Program.NewDataAvailableArgs newArgs) - { - lock (lockNewDataMode) - { - if (newDataMode == 0) - newDataMode = newArgs.signalNewDataMode; - } - InvokeAsync(() => this.StateHasChanged()); - } - } + } + project.Add(s as SubmodelElementCollection); + projectName.Add(""); + cableLength.Add(0); + pCableLength.Add(null); + if (pCertifiedBy.Count <= countProject) + { + pCertifiedBy.Add(null); + pCertifiedAt.Add(null); + } + if (eigensicheresbetriebsmittel.Count <= countProject) + eigensicheresbetriebsmittel.Add(""); + if (pEigensicheresbetriebsmittel.Count <= countProject) + pEigensicheresbetriebsmittel.Add(null); + if (eigensicheresbetriebsmittelSeriennummer.Count <= countProject) + eigensicheresbetriebsmittelSeriennummer.Add(""); + if (pEigensicheresbetriebsmittelSeriennummer.Count <= countProject) + pEigensicheresbetriebsmittelSeriennummer.Add(null); + if (zugehoerigesbetriebsmittel.Count <= countProject) + zugehoerigesbetriebsmittel.Add(""); + if (pZugehoerigesbetriebsmittel.Count <= countProject) + pZugehoerigesbetriebsmittel.Add(null); + if (zugehoerigesbetriebsmittelSeriennummer.Count <= countProject) + zugehoerigesbetriebsmittelSeriennummer.Add(""); + if (pZugehoerigesbetriebsmittelSeriennummer.Count <= countProject) + pZugehoerigesbetriebsmittelSeriennummer.Add(null); + + var sme = findeSME(smc: project[countProject], idShortPath: "projektbezeichnung", ignore: true); + if (sme != null) + projectName[countProject] = sme.ValueAsText(); + sme = findeSME(smc: project[countProject], idShortPath: "projectname", ignore: true); + if (sme != null) + projectName[countProject] = sme.ValueAsText(); + sme = findeSME(smc: project[countProject], idShortPath: "eigensicheresbetriebsmittel", ignore: true); + if (sme != null) + { + if (eigensicheresbetriebsmittel[countProject] == "") + eigensicheresbetriebsmittel[countProject] = sme.ValueAsText(); + if (pEigensicheresbetriebsmittel[countProject] == null) + pEigensicheresbetriebsmittel[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "intrinsicallysafeapparatus", ignore: true); + if (sme != null) + { + if (eigensicheresbetriebsmittel[countProject] == "") + eigensicheresbetriebsmittel[countProject] = sme.ValueAsText(); + if (pEigensicheresbetriebsmittel[countProject] == null) + pEigensicheresbetriebsmittel[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "eigensicheresbetriebsmittelSeriennummer", ignore: true); + if (sme != null) + { + if (eigensicheresbetriebsmittelSeriennummer[countProject] == "") + eigensicheresbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); + if (pEigensicheresbetriebsmittelSeriennummer[countProject] == null) + pEigensicheresbetriebsmittelSeriennummer[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "intrinsicallysafeapparatusserialnumber", ignore: true); + if (sme != null) + { + if (eigensicheresbetriebsmittelSeriennummer[countProject] == "") + eigensicheresbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); + if (pEigensicheresbetriebsmittelSeriennummer[countProject] == null) + pEigensicheresbetriebsmittelSeriennummer[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "zugehoerigesbetriebsmittel", ignore: true); + if (sme != null) + { + if (zugehoerigesbetriebsmittel[countProject] == "") + zugehoerigesbetriebsmittel[countProject] = sme.ValueAsText(); + if (pZugehoerigesbetriebsmittel[countProject] == null) + pZugehoerigesbetriebsmittel[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "associatedapparatus", ignore: true); + if (sme != null) + { + if (zugehoerigesbetriebsmittel[countProject] == "") + zugehoerigesbetriebsmittel[countProject] = sme.ValueAsText(); + if (pZugehoerigesbetriebsmittel[countProject] == null) + pZugehoerigesbetriebsmittel[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "zugehoerigesbetriebsmittelSeriennummer", ignore: true); + if (sme != null) + { + if (zugehoerigesbetriebsmittelSeriennummer[countProject] == "") + zugehoerigesbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); + if (pZugehoerigesbetriebsmittelSeriennummer[countProject] == null) + pZugehoerigesbetriebsmittelSeriennummer[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "associatedapparatusserialnumber", ignore: true); + if (sme != null) + { + if (zugehoerigesbetriebsmittelSeriennummer[countProject] == "") + zugehoerigesbetriebsmittelSeriennummer[countProject] = sme.ValueAsText(); + if (pZugehoerigesbetriebsmittelSeriennummer[countProject] == null) + pZugehoerigesbetriebsmittelSeriennummer[countProject] = sme as Property; + } + sme = findeSME(smc: project[countProject], idShortPath: "leitungslaenge", ignore: true); + if (sme != null) + { + try + { + cableLength[countProject] = Convert.ToDouble(sme.ValueAsText(), CultureInfo.InvariantCulture); + pCableLength[countProject] = sme as Property; + } + catch { } + } + sme = findeSME(smc: project[countProject], idShortPath: "cablelength", ignore: true); + if (sme != null) + { + try + { + cableLength[countProject] = Convert.ToDouble(sme.ValueAsText(), CultureInfo.InvariantCulture); + pCableLength[countProject] = sme as Property; + } + catch { } + } + sme = findeSME(smc: project[countProject], idShortPath: "CertifiedBy", ignore: true); + if (sme != null) + { + if (pCertifiedBy[countProject] == null) + { + pCertifiedBy[countProject] = sme as Property; + } + } + sme = findeSME(smc: project[countProject], idShortPath: "CertifiedAt", ignore: true); + if (sme != null) + { + if (pCertifiedAt[countProject] == null) + { + pCertifiedAt[countProject] = sme as Property; + } + } + countProject++; + } + } + } + } + if (sm.IdShort.ToLower() == "nameplate") + { + found = true; + isOutput.Add(false); + envIndex.Add(i); + Nameplate.Add(sm as Submodel); + ManufacturerProductDesignation.Add(""); + ManufacturerName.Add(""); + DesignationOfCertificateOrApproval.Add(""); + PreviewFile.Add(""); + PreviewFileUrl.Add(""); + TypeOfApproval.Add(""); + Identification.Add(""); + SafetyRelatedPropertiesForActiveBehaviour.Add(null); + SafetyRelatedPropertiesForPassiveBehaviour.Add(null); + U.Add(0); + I.Add(0); + P.Add(0); + L.Add(0); + C.Add(0); + if (C.Count > ManufacturerProductType.Count) + ManufacturerProductType.Add(""); + if (C.Count > SerialNumber.Count) + SerialNumber.Add(""); + if (C.Count > Alternatives.Count) + Alternatives.Add(""); + if (C.Count > inputLength.Count) + inputLength.Add(Double.MinValue); + if (C.Count > certifiedBy.Count) + certifiedBy.Add(""); + if (C.Count > certifiedAt.Count) + certifiedAt.Add(""); + + var sme = findeSME(sm: sm, idShortPath: "ManufacturerProductDesignation", ignore: true); + if (sme != null) + { + if (sme is Property p) + ManufacturerProductDesignation[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + ManufacturerProductDesignation[count] = mlp.Value[0].Text; + } + } + + if (ManufacturerProductType[count] == "") + { + sme = findeSME(sm: sm, idShortPath: "ManufacturerProductType", ignore: true); + if (sme != null) + { + if (sme is Property p) + ManufacturerProductType[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + ManufacturerProductType[count] = mlp.Value[0].Text; + } + } + } + + if (SerialNumber[count] == "") + { + sme = findeSME(sm: sm, idShortPath: "SerialNumber", ignore: true); + if (sme != null) + { + if (sme is Property p) + SerialNumber[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + SerialNumber[count] = mlp.Value[0].Text; + } + } + } + + sme = findeSME(sm: sm, idShortPath: "ManufacturerName", ignore: true); + if (sme != null) + { + if (sme is Property p) + ManufacturerName[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + ManufacturerName[count] = mlp.Value[0].Text; + } + } + + sme = findeSME(sm: sm, + idShortPath: "Markings.Marking.ExplosionSafeties.ExplosionSafety", + ignore: true, contains: true); + if (sme != null) + { + var s = sme as SubmodelElementCollection; + + sme = findeSME(smc: s, idShortPath: "DesignationOfCertificateOrApproval", ignore: true); + if (sme != null) + { + if (sme is Property p) + DesignationOfCertificateOrApproval[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + DesignationOfCertificateOrApproval[count] = mlp.Value[0].Text; + } + } + + sme = findeSME(smc: s, idShortPath: "PreviewFile", ignore: true); + if (sme != null) + { + if (sme is File f) + { + PreviewFile[count] = f.Value; + } + } + + sme = findeSME(smc: s, idShortPath: "DigitalFile", ignore: true); + if (sme != null) + { + if (sme is File f) + { + var path = getPath(sme); + if (path != null) + { + PreviewFileUrl[count] = path; + } + } + } + + sme = findeSME(smc: s, idShortPath: "TypeOfApproval", ignore: true); + if (sme != null) + { + if (sme is Property p) + TypeOfApproval[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + TypeOfApproval[count] = mlp.Value[0].Text; + } + } + + sme = findeSME(smc: s, idShortPath: "Identification", ignore: true); + if (sme != null) + { + if (sme is Property p) + Identification[count] = p.Value; + if (sme is MultiLanguageProperty mlp && mlp.Value != null && mlp.Value.Count > 0) + { + Identification[count] = mlp.Value[0].Text; + } + } + } + + sme = findeSME(sm: sm, + idShortPath: "Markings.Marking.ExplosionSafeties.ExplosionSafety.ExternalElectricalCircuit.SafetyRelatedPropertiesForActiveBehaviour", + ignore: true, contains: true); + if (sme != null) + { + var s = sme as SubmodelElementCollection; + isOutput[count] = true; + SafetyRelatedPropertiesForActiveBehaviour[count] = s; + + sme = findeSME(smc: s, idShortPath: "MaxOutputPower", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + P[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxOutputVoltage", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + U[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxOutputCurrent", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + I[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxExternalCapacitance", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + string v = p.Value; + // fix generator bug + if (v.Contains(" nF")) + v = v.Replace(" nF", ""); + C[count] = Convert.ToDouble(v, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxExternalInductance", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + L[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + } + else + { + sme = findeSME(sm: sm, + idShortPath: "Markings.Marking.ExplosionSafeties.ExplosionSafety.ExternalElectricalCircuit.SafetyRelatedPropertiesForPassiveBehaviour", + ignore: true, contains: true); + if (sme != null) + { + var s = sme as SubmodelElementCollection; + SafetyRelatedPropertiesForPassiveBehaviour[count] = s as SubmodelElementCollection; + + sme = findeSME(smc: s, idShortPath: "MaxInputPower", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + P[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxInputVoltage", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + U[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxInputCurrent", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + I[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxInternalCapacitance", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + C[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + + sme = findeSME(smc: s, idShortPath: "MaxInternalInductance", ignore: true); + if (sme != null) + { + if (sme is Property p) + { + try + { + L[count] = Convert.ToDouble(p.Value, CultureInfo.InvariantCulture); + } + catch { } + } + } + } + } + } + if (sm.IdShort.ToLower() == "handoverdocumentation") + { + found = true; + if (PreviewFile[count] != "") + { + var sme = findeSMEValue(sm: sm, value: PreviewFile[count]); + if (sme != null) + { + var path = getPath(sme); + if (path != null) + { + PreviewFileUrl[count] = path.Replace("PreviewFile", "DigitalFile"); + } + } + } + foreach (var se in sm.SubmodelElements) + { + if (se is SubmodelElementCollection smc) + { + var sme = findeSME(smc: smc, + idShortPath: "DocumentVersion.PreviewFile", + ignore: true, contains: true); + if (sme != null) + { + if (sme is File f) + { + if (f.Value.ToLower().Contains("atex")) + { + PreviewFile[count] = f.Value; + var path = getPath(f); + if (path != null) + { + PreviewFileUrl[count] = path.Replace("PreviewFile", "DigitalFile"); + } + if (TypeOfApproval[count] == "") + TypeOfApproval[count] = "ATEX"; + } + if (f.Value.ToLower().Contains("iecex") && TypeOfApproval[count] == "") + { + PreviewFile[count] = f.Value; + var path = getPath(f); + if (path != null) + { + PreviewFileUrl[count] = path.Replace("PreviewFile", "DigitalFile"); + } + if (TypeOfApproval[count] == "") + TypeOfApproval[count] = "IECEX"; + } + } + } + } + } + } + if (sm.IdShort.ToLower() == "technicaldata") + { + found = true; + TechnicalData.Add(sm as Submodel); + ManufacturerLogo.Add(""); + ProductImage.Add(""); + + var sme = findeSME(sm: sm, idShortPath: "GeneralInformation", ignore: true); + if (sme != null) + { + var g = sme as SubmodelElementCollection; + sme = findeSME(smc: g, idShortPath: "ManufacturerLogo", ignore: true); + if (sme != null) + { + if (sme is File f) + ManufacturerLogo[count] = f.Value; + } + sme = findeSME(smc: g, idShortPath: "ProductImage", ignore: true); + if (sme != null) + { + if (sme is File f) + ProductImage[count] = f.Value; + } + } + } + } + } + } + + } + } + + if (found) + { + count++; + } + } + } + + string getPath(ISubmodelElement sme) + { + string path = sme.IdShort; + var p = sme.Parent; + while (p != null && !(p is Submodel)) + { + path = (p as ISubmodelElement).IdShort + "." + path; + p = (p as ISubmodelElement).Parent; + } + if (p == null) + return null; + + var idEncoded = Base64UrlEncoder.Encode((p as Submodel).Id); + path = Program.externalBlazor + "/submodels/" + idEncoded + "/submodel-elements/" + path + "/attachment"; + return path; + } + + ISubmodelElement findeSME(ISubmodel sm = null, ISubmodelElementCollection smc = null, string idShortPath = null, + bool ignore = false, bool contains = false) + { + if (idShortPath == null) + return null; + var path = idShortPath.Split("."); + + int level = 0; + List[] levelSMEs = new List[path.Length]; + int[] iLevel = new int[path.Length]; + iLevel[0] = 0; + + if (sm != null) + { + levelSMEs[0] = sm.SubmodelElements; + } + else if (smc != null) + { + levelSMEs[0] = smc.Value; + } + else + return null; + + while (level >= 0 && level < path.Length && levelSMEs[level] != null && levelSMEs[level].Count != 0) + { + while (level >= 0 && iLevel[level] < levelSMEs[level].Count) + { + ISubmodelElement sme = levelSMEs[level][iLevel[level]]; + string id1 = sme.IdShort; + string id2 = path[level]; + if (ignore) + { + id1 = id1.ToLower(); + id2 = id2.ToLower(); + } + if (id1 == id2 || (contains && id1.Contains(id2))) + { + if (level == path.Count() - 1) + return sme; + if (sme is SubmodelElementCollection smc2) + { + iLevel[level]++; + levelSMEs[level + 1] = smc2.Value; + iLevel[level + 1] = 0; + level++; + continue; + } + } + iLevel[level]++; + while (level >= 0 && iLevel[level] == levelSMEs[level].Count) + { + level--; + } + } + } + + return null; + } + + ISubmodelElement findeSMEValue(ISubmodel sm = null, ISubmodelElementCollection smc = null, string value = null) + { + if (value == null) + return null; + + int level = 0; + List> levelSMEs = new List>(); + List iLevel = new List(); + iLevel.Add(0); + + if (sm != null) + { + levelSMEs.Add(sm.SubmodelElements); + } + else if (smc != null) + { + levelSMEs.Add(smc.Value); + } + else + return null; + + while (level >= 0 && levelSMEs[level] != null && levelSMEs[level].Count != 0) + { + while (level >= 0 && iLevel[level] < levelSMEs[level].Count) + { + ISubmodelElement sme = levelSMEs[level][iLevel[level]]; + + if (sme.ValueAsText() == value) + return sme; + if (sme is SubmodelElementCollection smc2) + { + iLevel[level]++; + levelSMEs.Add(smc2.Value); + iLevel.Add(0); + level++; + continue; + } + iLevel[level]++; + while (level >= 0 && iLevel[level] == levelSMEs[level].Count) + { + levelSMEs.RemoveAt(level); + iLevel.RemoveAt(level); + level--; + } + } + } + + return null; + } + + public static string createDetailsImage(int envIndex, string filePath, out bool svg) + { + svg = false; + + if (!string.IsNullOrEmpty(filePath)) + { + string[] split = filePath.Split(new Char[] { '/' }); + if (split.Length == 2 || split.Length > 1 && split[1].ToLower() == "aasx") + { + split = filePath.Split(new Char[] { '.' }); + switch (split.Last().ToLower()) + { + case "jpg": + case "bmp": + case "png": + case "svg": + try + { + using (System.IO.Stream s = Program.env[envIndex].GetLocalStreamFromPackage(filePath)) + { + if (s != null) + { + using (var m = new System.IO.MemoryStream()) + { + if (split.Last().ToLower() == "svg") + { + svg = true; + } + s.CopyTo(m); + return System.Convert.ToBase64String(m.ToArray()); + } + } + } + } + catch { } + break; + } + } + } + + return ""; + } + + protected override void OnInitialized() + { + SubmodelService.NewDataAvailable += NewData; + } + + public void Dispose() + { + SubmodelService.NewDataAvailable -= NewData; + } + + void NewData(object source, EventArgs args) + { + if (Program.isLoading) + return; + + if (args is Program.NewDataAvailableArgs newArgs) + { + lock (lockNewDataMode) + { + if (newDataMode == 0) + newDataMode = newArgs.signalNewDataMode; + } + InvokeAsync(() => this.StateHasChanged()); + } + } } diff --git a/src/AasxServerBlazor/Pages/Db.razor b/src/AasxServerBlazor/Pages/Db.razor index d1dab1069..620f57954 100644 --- a/src/AasxServerBlazor/Pages/Db.razor +++ b/src/AasxServerBlazor/Pages/Db.razor @@ -1,959 +1,972 @@ -@page "/db"; -@page "/db/aasx"; -@page "/db/aas"; -@page "/db/sm"; -@page "/db/smjson"; -@page "/db/sme"; -@page "/db/svalue"; -@page "/db/ivalue"; -@page "/db/dvalue"; -@using AasxServer -@using AasxServerDB -@using Microsoft.AspNetCore.Html; -@using AasxRestServerLibrary; -@using Microsoft.IdentityModel.Tokens; -@using AasxServerDB.Entities; -@using TimeStamp; -@inject NavigationManager NavMan - -
-@{ - if (!Program.withDb) - { - This is a in memory server! - } - else - { - // get parameters - var url = NavMan.Uri; - var splitUrl = url.Split("?"); - url = splitUrl[ 0 ].ToLower(); - var sUrl = url.Split("/"); - var shorturl = url.Substring(0, url.Length - ($"/{sUrl[ sUrl.Length - 1 ]}").Length); - if (splitUrl.Length == 2) - { - var query = System.Web.HttpUtility.ParseQueryString(splitUrl[ 1 ]); - var list = query.Get("size"); - if (!list.IsNullOrEmpty()) - size = Convert.ToInt32(list); - list = query.Get("search"); - if (!list.IsNullOrEmpty()) - search = list; - list = query.Get("aasxid"); - if (!list.IsNullOrEmpty()) - aasxid = Convert.ToInt32(list); - list = query.Get("aasid"); - if (!list.IsNullOrEmpty()) - aasid = Convert.ToInt32(list); - list = query.Get("smid"); - if (!list.IsNullOrEmpty()) - smid = Convert.ToInt32(list); - list = query.Get("smeid"); - if (!list.IsNullOrEmpty()) - smeid = Convert.ToInt32(list); - list = query.Get("smidentifier"); - if (!list.IsNullOrEmpty()) - smidentifier = list; - } - - // change parameters to input window - if (url.EndsWith("/aasx") || url.EndsWith("/aas") || url.EndsWith("/sm") - || url.EndsWith("/sme") || url.EndsWith("/svalue") || url.EndsWith("/ivalue") || url.EndsWith("/dvalue")) - { - - @code { - private string CurrentValue { get; set; } - } - if (!CurrentValue.IsNullOrEmpty()) - { - var splitCur = CurrentValue.Split("="); - if (splitCur.Count() == 2) - { - switch (splitCur[ 0 ]) - { - case "size": - size = 1000; - if (!splitCur[ 1 ].IsNullOrEmpty()) - size = Convert.ToInt32(splitCur[ 1 ]); - break; - case "search": - search = splitCur[ 1 ]; - break; - case "aasxid": - aasxid = 0; - if (!splitCur[ 1 ].IsNullOrEmpty()) - aasxid = Convert.ToInt32(splitCur[ 1 ]); - break; - case "aasid": - aasid = 0; - if (!splitCur[ 1 ].IsNullOrEmpty()) - aasid = Convert.ToInt32(splitCur[ 1 ]); - break; - case "smid": - smid = 0; - if (!splitCur[ 1 ].IsNullOrEmpty()) - smid = Convert.ToInt32(splitCur[ 1 ]); - break; - case "smeid": - smeid = 0; - if (!splitCur[ 1 ].IsNullOrEmpty()) - smeid = Convert.ToInt32(splitCur[ 1 ]); - break; - } - } - - CurrentValue = string.Empty; - } - } - - string searchLower = search.ToLower(); - var watch = System.Diagnostics.Stopwatch.StartNew(); - - using (AasContext db = new AasContext()) - { - if (!(url.EndsWith("/aasx") || url.EndsWith("/aas") || url.EndsWith("/sm") || url.EndsWith("/smjson") - || url.EndsWith("/sme") || url.EndsWith("/svalue") || url.EndsWith("/ivalue") || url.EndsWith("/dvalue"))) - { - if (AasContext.IsPostgres) - { - PostgreSQL database -
- } - else - { - SQLite database -
- } - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TabelCountLinks
- AASX#: - - @db.AASXSets.Count() - - aasx -
- AAS#: - - @db.AASSets.Count() - - aas -
- SM#: - - @db.SMSets.Count() - - sm -
- SME#: - - @db.SMESets.Count() - - sme -
- IValue#: - - @db.IValueSets.Count() - - ivalue -
- SValue#: - - @db.SValueSets.Count() - - svalue -
- DValue#: - - @db.DValueSets.Count() - - dvalue -
-
- Database structure: -
- - } - - if (url.EndsWith("/aasx")) - { - List data = PageRetriever.GetPageAASXData(size, searchLower, aasxid); -   @($"AASX#: {data.Count}/{db.AASXSets.Count()} size={size} search={search} aasxid={aasxid}") -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var aasxDB = data[ i ]; - - - - - - } - -
AASX#AASXLinks
- @aasxDB.Id - @aasxDB.AASX - aas - sm -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var aasxDB = data[ i ]; -   - - @aasxDB.Id - -   - @aasxDB.AASX -   - aas - sm -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - if (url.EndsWith("/aas")) + + +@page "/db"; +@page "/db/aasx"; +@page "/db/aas"; +@page "/db/sm"; +@page "/db/smjson"; +@page "/db/sme"; +@page "/db/svalue"; +@page "/db/ivalue"; +@page "/db/dvalue"; +@using AasxServer +@using AasxServerDB +@using Microsoft.AspNetCore.Html; +@using AasxRestServerLibrary; +@using Microsoft.IdentityModel.Tokens; +@using AasxServerDB.Entities; +@using TimeStamp; +@inject NavigationManager NavMan + +
+@{ + if (!Program.withDb) + { + This is a in memory server! + } + else + { + // get parameters + var url = NavMan.Uri; + var splitUrl = url.Split("?"); + url = splitUrl[ 0 ].ToLower(); + var sUrl = url.Split("/"); + var shorturl = url.Substring(0, url.Length - ($"/{sUrl[ sUrl.Length - 1 ]}").Length); + if (splitUrl.Length == 2) + { + var query = System.Web.HttpUtility.ParseQueryString(splitUrl[ 1 ]); + var list = query.Get("size"); + if (!list.IsNullOrEmpty()) + size = Convert.ToInt32(list); + list = query.Get("search"); + if (!list.IsNullOrEmpty()) + search = list; + list = query.Get("aasxid"); + if (!list.IsNullOrEmpty()) + aasxid = Convert.ToInt32(list); + list = query.Get("aasid"); + if (!list.IsNullOrEmpty()) + aasid = Convert.ToInt32(list); + list = query.Get("smid"); + if (!list.IsNullOrEmpty()) + smid = Convert.ToInt32(list); + list = query.Get("smeid"); + if (!list.IsNullOrEmpty()) + smeid = Convert.ToInt32(list); + list = query.Get("smidentifier"); + if (!list.IsNullOrEmpty()) + smidentifier = list; + } + + // change parameters to input window + if (url.EndsWith("/aasx") || url.EndsWith("/aas") || url.EndsWith("/sm") + || url.EndsWith("/sme") || url.EndsWith("/svalue") || url.EndsWith("/ivalue") || url.EndsWith("/dvalue")) + { + + @code { + private string CurrentValue { get; set; } + } + if (!CurrentValue.IsNullOrEmpty()) { - List data = PageRetriever.GetPageAASData(size, TimeStamp.StringToDateTime(searchLower), searchLower, aasxid, aasid); -   @($"AAS#: {data.Count}/{db.AASSets.Count()} size={size} search={search} aasxid={aasxid} aasid={aasid}") -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var aasDB = data[ i ]; - string aas64 = Base64UrlEncoder.Encode(aasDB.Identifier); - string link = $"{AasxServer.Program.externalBlazor}/shells/{aas64}"; - - - - - - - - - - - - } - -
AASX#AAS#IdIdShortAssetKindGlobalAssetIdTimeStampLinksAPI
@aasDB.AASXId - @aasDB.Id - @aasDB.Identifier@aasDB.IdShort@aasDB.AssetKind@aasDB.GlobalAssetId - @($"UPDATE {TimeStamp.DateTimeToString(aasDB.TimeStamp)}")
- @($"CREATE {TimeStamp.DateTimeToString(aasDB.TimeStampCreate)}")
- @($"TREE {TimeStamp.DateTimeToString(aasDB.TimeStampTree)}") -
- aasx - sm - - @link -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var aasDB = data[ i ]; - string aas64 = Base64UrlEncoder.Encode(aasDB.Identifier); - string link = $"{AasxServer.Program.externalBlazor}/shells/{aas64}"; -   - @aasDB.AASXId -   - - @aasDB.Id - -   - @aasDB.Identifier -   - @aasDB.IdShort -   - @aasDB.AssetKind -   - @aasDB.GlobalAssetId -   - @($"UPDATE {TimeStamp.DateTimeToString(aasDB.TimeStamp)}") - @($"CREATE {TimeStamp.DateTimeToString(aasDB.TimeStampCreate)}") - @($"TREE {TimeStamp.DateTimeToString(aasDB.TimeStampTree)}") -   - aasx - sm -   - @link -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - if (url.EndsWith("/sm")) + var splitCur = CurrentValue.Split("="); + if (splitCur.Count() == 2) + { + switch (splitCur[ 0 ]) + { + case "size": + size = 1000; + if (!splitCur[ 1 ].IsNullOrEmpty()) + size = Convert.ToInt32(splitCur[ 1 ]); + break; + case "search": + search = splitCur[ 1 ]; + break; + case "aasxid": + aasxid = 0; + if (!splitCur[ 1 ].IsNullOrEmpty()) + aasxid = Convert.ToInt32(splitCur[ 1 ]); + break; + case "aasid": + aasid = 0; + if (!splitCur[ 1 ].IsNullOrEmpty()) + aasid = Convert.ToInt32(splitCur[ 1 ]); + break; + case "smid": + smid = 0; + if (!splitCur[ 1 ].IsNullOrEmpty()) + smid = Convert.ToInt32(splitCur[ 1 ]); + break; + case "smeid": + smeid = 0; + if (!splitCur[ 1 ].IsNullOrEmpty()) + smeid = Convert.ToInt32(splitCur[ 1 ]); + break; + } + } + + CurrentValue = string.Empty; + } + } + + string searchLower = search.ToLower(); + var watch = System.Diagnostics.Stopwatch.StartNew(); + + using (AasContext db = new AasContext()) + { + if (!(url.EndsWith("/aasx") || url.EndsWith("/aas") || url.EndsWith("/sm") || url.EndsWith("/smjson") + || url.EndsWith("/sme") || url.EndsWith("/svalue") || url.EndsWith("/ivalue") || url.EndsWith("/dvalue"))) { - List data = PageRetriever.GetPageSMData(size, TimeStamp.StringToDateTime(searchLower), searchLower, aasxid, aasid, smid); - -   @($"SM#: {data.Count}/{db.SMSets.Count()} size={size} search={search} aasxid={aasxid} aasid={aasid} smid={smid}") - -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var smDB = data[ i ]; - string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); - string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}"; - int smeCount = db.SMESets.Where(sme => sme.SMId == smDB.Id).Count(); - - - - - - - - - - - - - } - -
AASX#AAS#SM#IdIdShortSemanticIdTimeStampLinksAPI
@smDB.AASXId@smDB.AASId - @smDB.Id - @smDB.Identifier@smDB.IdShort@smDB.SemanticId - @($"UPDATE {TimeStamp.DateTimeToString(smDB.TimeStamp)}")
- @($"CREATE {TimeStamp.DateTimeToString(smDB.TimeStampCreate)}")
- @($"TREE {TimeStamp.DateTimeToString(smDB.TimeStampTree)}") -
- aasx - aas - sme:@(smeCount) - - @link -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var smDB = data[ i ]; - string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); - string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}"; - int smeCount = db.SMESets.Where(sme => sme.SMId == smDB.Id).Count(); -   - @smDB.AASXId -   - @smDB.AASId -   - - @smDB.Id - -   - @smDB.Identifier -   - @smDB.IdShort -   - @smDB.SemanticId -   - @($"UPDATE {TimeStamp.DateTimeToString(smDB.TimeStamp)}") - @($"CREATE {TimeStamp.DateTimeToString(smDB.TimeStampCreate)}") - @($"TREE {TimeStamp.DateTimeToString(smDB.TimeStampTree)}") -   - aasx - aas - sme:@(smeCount) -   - @link -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - if (url.EndsWith("/smjson") && !smidentifier.IsNullOrEmpty()) - { - var smDBList = db.SMSets.Where(s => s.Identifier.Equals(smidentifier)).ToList(); - if (smDBList.Any()) - { - var smDB = smDBList.First(); - var submodel = Converter.GetSubmodel(smDB: smDB); - - string json = string.Empty; - if (submodel != null) - { - var j = Jsonization.Serialize.ToJsonObject(submodel); - json = j.ToJsonString(); - } - - @json -
- } - } - - if (url.EndsWith("/sme")) + if (AasContext.IsPostgres) + { + PostgreSQL database +
+ } + else + { + SQLite database +
+ } + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TabelCountLinks
+ AASX#: + + @db.AASXSets.Count() + + aasx +
+ AAS#: + + @db.AASSets.Count() + + aas +
+ SM#: + + @db.SMSets.Count() + + sm +
+ SME#: + + @db.SMESets.Count() + + sme +
+ IValue#: + + @db.IValueSets.Count() + + ivalue +
+ SValue#: + + @db.SValueSets.Count() + + svalue +
+ DValue#: + + @db.DValueSets.Count() + + dvalue +
+
+ Database structure: +
+ + } + + if (url.EndsWith("/aasx")) { - List data = PageRetriever.GetPageSMEData(size, TimeStamp.StringToDateTime(searchLower), searchLower, smid, smeid); - -   @($"SME#: {data.Count}/{db.SMESets.Count()} size={size} search={search} smid={smid} smeid={smeid}") - -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var smeDB = data[ i ]; - string path = smeDB.IdShort; - int? pnum = smeDB.ParentSMEId; - while (pnum != null) - { - var smeDBP = db.SMESets.Where(s => s.Id == pnum).First(); - path = $"{smeDBP.IdShort}.{path}"; - pnum = smeDBP.ParentSMEId; - } - - var smDB = db.SMSets.Where(s => s.Id == smeDB.SMId).First(); - string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); - string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}/submodel-elements/{path}"; - - - - - - - - - - - - - - } - -
SM#Par#SME#TypeIdShortSemanticIdValueValueTypeTimeStampLinksAPI
@smeDB.SMId@smeDB.ParentSMEId - @smeDB.Id - @smeDB.SMEType@smeDB.IdShort@smeDB.SemanticId - @if (smeDB.SMEType.Equals("MLP")) - { - List list = smeDB.getMLPValue(); -
    - @for (int z = 0; z + 1 < list.Count; z++) - { -
  • - [@list[ z ]] @list[ z + 1 ] -
  • - z++; - } -
- } - else - { - @smeDB.getValue() - } -
@smeDB.ValueType - @($"UPDATE {TimeStamp.DateTimeToString(smeDB.TimeStamp)}")
- @($"CREATE {TimeStamp.DateTimeToString(smeDB.TimeStampCreate)}")
- @($"TREE {TimeStamp.DateTimeToString(smeDB.TimeStampTree)}") -
- sm - @if (smeDB.ParentSMEId != null) - { - par - } - @if (smeDB.ValueType.Equals("S")) - { - svalue - } - @if (smeDB.ValueType.Equals("I")) - { - ivalue - } - @if (smeDB.ValueType.Equals("F")) - { - fvalue - } - - @link -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var smeDB = data[ i ]; - string path = smeDB.IdShort; - int? pnum = smeDB.ParentSMEId; - while (pnum != null) - { - var smeDBP = db.SMESets.Where(s => s.Id == pnum).First(); - path = $"{smeDBP.IdShort}.{path}"; - pnum = smeDBP.ParentSMEId; - } - - var smDB = db.SMSets.Where(s => s.Id == smeDB.SMId).First(); - string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); - string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}/submodel-elements/{path}"; - - @smeDB.SMId -   - @smeDB.ParentSMEId -   - - @smeDB.Id - -   - @smeDB.SMEType -   - @smeDB.IdShort -   - @smeDB.SemanticId -   - - @if (smeDB.SMEType.Equals("MLP")) - { - List list = smeDB.getMLPValue(); - if (list.Count > 0) - { - string mlp = string.Empty; - string seperateString = " | "; - @for (int z = 0; z + 1 < list.Count; z++) - { - mlp += $"[{list[ z ]}] {list[ z + 1 ]}{seperateString}"; - z++; - } - - @mlp.Substring(0, mlp.Length - seperateString.Length) - } - } - else - { - @smeDB.getValue() - } - -   - @smeDB.ValueType -   - @($"UPDATE {TimeStamp.DateTimeToString(smeDB.TimeStamp)}") - @($"CREATE {TimeStamp.DateTimeToString(smeDB.TimeStampCreate)}") - @($"TREE {TimeStamp.DateTimeToString(smeDB.TimeStampTree)}") -   - sm - @if (smeDB.ParentSMEId != null) - { - par - } - - @if (smeDB.SMEType.Equals("MLP")) - { - mlp - } - -   - @link -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - if (url.EndsWith("/svalue")) - { - List data = PageRetriever.GetPageSValueData(size, searchLower, smeid); - -   @($"SValue#: {data.Count}/{db.SValueSets.Count()} size={size} search={search} smeid={smeid}") - -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var smeDB = data[ i ]; - - - - - - - } - -
Par#ValueAnnotationLinks
@smeDB.SMEId@smeDB.Value@smeDB.Annotation - @if (smeDB.SMEId != null) - { - par - } -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var smeDB = data[ i ]; -   - @smeDB.SMEId -   - @smeDB.Value -   - @smeDB.Annotation -   - @if (smeDB.SMEId != null) - { - par - } - -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - if (url.EndsWith("/ivalue")) - { - List data = PageRetriever.GetPageIValueData(size, searchLower, smeid); - -   @($"IValue#: {data.Count}/{db.IValueSets.Count()} size={size} search={search} smeid={smeid}") - -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var smeDB = data[ i ]; - - - - - - - } - -
Par#ValueAnnotationLinks
@smeDB.SMEId@smeDB.Value@smeDB.Annotation - @if (smeDB.SMEId != null) - { - par - } -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var smeDB = data[ i ]; -   - @smeDB.SMEId -   - @smeDB.Value -   - @smeDB.Annotation -   - @if (smeDB.SMEId != null) - { - par - } - -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - if (url.EndsWith("/dvalue")) - { - List data = PageRetriever.GetPageDValueData(size, searchLower, smeid); - -   @($"DValue#: {data.Count}/{db.DValueSets.Count()} size={size} search={search} smeid={smeid}") - -
-
- @if (size > 1000 && data.Count > 1000) - { - - First 1000 as TABLE - -
- } - - - - - - - - - - - - @for (int i = 0; i < data.Count && i < 1000; i++) - { - var smeDB = data[ i ]; - - - - - - - } - -
Par#ValueAnnotationLinks
@smeDB.SMEId@smeDB.Value@smeDB.Annotation - @if (smeDB.SMEId != null) - { - par - } -
- @if (size > 1000 && data.Count > 1000) - { - - All other as text - -
- @for (int i = 1000; i < data.Count; i++) - { - var smeDB = data[ i ]; -   - @smeDB.SMEId -   - @smeDB.Value -   - @smeDB.Annotation -   - @if (smeDB.SMEId != null) - { - par - } - -
- } - -
- } - - @($"Count: {data.Count}") -
- } - - watch.Stop(); - @($"Elapsed ms: {watch.ElapsedMilliseconds}") - } - -
-
- } -} -
- -@code { - int size = 1000; - string search = string.Empty; - long aasxid = 0; - long aasid = 0; - long smid = 0; - long smeid = 0; - string smidentifier = string.Empty; -} + List data = PageRetriever.GetPageAASXData(size, searchLower, aasxid); +   @($"AASX#: {data.Count}/{db.AASXSets.Count()} size={size} search={search} aasxid={aasxid}") +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var aasxDB = data[ i ]; + + + + + + } + +
AASX#AASXLinks
+ @aasxDB.Id + @aasxDB.AASX + aas + sm +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var aasxDB = data[ i ]; +   + + @aasxDB.Id + +   + @aasxDB.AASX +   + aas + sm +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + if (url.EndsWith("/aas")) + { + List data = PageRetriever.GetPageAASData(size, TimeStamp.StringToDateTime(searchLower), searchLower, aasxid, aasid); +   @($"AAS#: {data.Count}/{db.AASSets.Count()} size={size} search={search} aasxid={aasxid} aasid={aasid}") +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var aasDB = data[ i ]; + string aas64 = Base64UrlEncoder.Encode(aasDB.Identifier); + string link = $"{AasxServer.Program.externalBlazor}/shells/{aas64}"; + + + + + + + + + + + + } + +
AASX#AAS#IdIdShortAssetKindGlobalAssetIdTimeStampLinksAPI
@aasDB.AASXId + @aasDB.Id + @aasDB.Identifier@aasDB.IdShort@aasDB.AssetKind@aasDB.GlobalAssetId + @($"UPDATE {TimeStamp.DateTimeToString(aasDB.TimeStamp)}")
+ @($"CREATE {TimeStamp.DateTimeToString(aasDB.TimeStampCreate)}")
+ @($"TREE {TimeStamp.DateTimeToString(aasDB.TimeStampTree)}") +
+ aasx + sm + + @link +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var aasDB = data[ i ]; + string aas64 = Base64UrlEncoder.Encode(aasDB.Identifier); + string link = $"{AasxServer.Program.externalBlazor}/shells/{aas64}"; +   + @aasDB.AASXId +   + + @aasDB.Id + +   + @aasDB.Identifier +   + @aasDB.IdShort +   + @aasDB.AssetKind +   + @aasDB.GlobalAssetId +   + @($"UPDATE {TimeStamp.DateTimeToString(aasDB.TimeStamp)}") + @($"CREATE {TimeStamp.DateTimeToString(aasDB.TimeStampCreate)}") + @($"TREE {TimeStamp.DateTimeToString(aasDB.TimeStampTree)}") +   + aasx + sm +   + @link +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + if (url.EndsWith("/sm")) + { + List data = PageRetriever.GetPageSMData(size, TimeStamp.StringToDateTime(searchLower), searchLower, aasxid, aasid, smid); + +   @($"SM#: {data.Count}/{db.SMSets.Count()} size={size} search={search} aasxid={aasxid} aasid={aasid} smid={smid}") + +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var smDB = data[ i ]; + string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); + string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}"; + int smeCount = db.SMESets.Where(sme => sme.SMId == smDB.Id).Count(); + + + + + + + + + + + + + } + +
AASX#AAS#SM#IdIdShortSemanticIdTimeStampLinksAPI
@smDB.AASXId@smDB.AASId + @smDB.Id + @smDB.Identifier@smDB.IdShort@smDB.SemanticId + @($"UPDATE {TimeStamp.DateTimeToString(smDB.TimeStamp)}")
+ @($"CREATE {TimeStamp.DateTimeToString(smDB.TimeStampCreate)}")
+ @($"TREE {TimeStamp.DateTimeToString(smDB.TimeStampTree)}") +
+ aasx + aas + sme:@(smeCount) + + @link +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var smDB = data[ i ]; + string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); + string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}"; + int smeCount = db.SMESets.Where(sme => sme.SMId == smDB.Id).Count(); +   + @smDB.AASXId +   + @smDB.AASId +   + + @smDB.Id + +   + @smDB.Identifier +   + @smDB.IdShort +   + @smDB.SemanticId +   + @($"UPDATE {TimeStamp.DateTimeToString(smDB.TimeStamp)}") + @($"CREATE {TimeStamp.DateTimeToString(smDB.TimeStampCreate)}") + @($"TREE {TimeStamp.DateTimeToString(smDB.TimeStampTree)}") +   + aasx + aas + sme:@(smeCount) +   + @link +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + if (url.EndsWith("/smjson") && !smidentifier.IsNullOrEmpty()) + { + var smDBList = db.SMSets.Where(s => s.Identifier.Equals(smidentifier)).ToList(); + if (smDBList.Any()) + { + var smDB = smDBList.First(); + var submodel = Converter.GetSubmodel(smDB: smDB); + + string json = string.Empty; + if (submodel != null) + { + var j = Jsonization.Serialize.ToJsonObject(submodel); + json = j.ToJsonString(); + } + + @json +
+ } + } + + if (url.EndsWith("/sme")) + { + List data = PageRetriever.GetPageSMEData(size, TimeStamp.StringToDateTime(searchLower), searchLower, smid, smeid); + +   @($"SME#: {data.Count}/{db.SMESets.Count()} size={size} search={search} smid={smid} smeid={smeid}") + +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var smeDB = data[ i ]; + string path = smeDB.IdShort; + int? pnum = smeDB.ParentSMEId; + while (pnum != null) + { + var smeDBP = db.SMESets.Where(s => s.Id == pnum).First(); + path = $"{smeDBP.IdShort}.{path}"; + pnum = smeDBP.ParentSMEId; + } + + var smDB = db.SMSets.Where(s => s.Id == smeDB.SMId).First(); + string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); + string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}/submodel-elements/{path}"; + + + + + + + + + + + + + + } + +
SM#Par#SME#TypeIdShortSemanticIdValueValueTypeTimeStampLinksAPI
@smeDB.SMId@smeDB.ParentSMEId + @smeDB.Id + @smeDB.SMEType@smeDB.IdShort@smeDB.SemanticId + @if (smeDB.SMEType.Equals("MLP")) + { + List list = smeDB.getMLPValue(); +
    + @for (int z = 0; z + 1 < list.Count; z++) + { +
  • + [@list[ z ]] @list[ z + 1 ] +
  • + z++; + } +
+ } + else + { + @smeDB.getValue() + } +
@smeDB.ValueType + @($"UPDATE {TimeStamp.DateTimeToString(smeDB.TimeStamp)}")
+ @($"CREATE {TimeStamp.DateTimeToString(smeDB.TimeStampCreate)}")
+ @($"TREE {TimeStamp.DateTimeToString(smeDB.TimeStampTree)}") +
+ sm + @if (smeDB.ParentSMEId != null) + { + par + } + @if (smeDB.ValueType.Equals("S")) + { + svalue + } + @if (smeDB.ValueType.Equals("I")) + { + ivalue + } + @if (smeDB.ValueType.Equals("F")) + { + fvalue + } + + @link +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var smeDB = data[ i ]; + string path = smeDB.IdShort; + int? pnum = smeDB.ParentSMEId; + while (pnum != null) + { + var smeDBP = db.SMESets.Where(s => s.Id == pnum).First(); + path = $"{smeDBP.IdShort}.{path}"; + pnum = smeDBP.ParentSMEId; + } + + var smDB = db.SMSets.Where(s => s.Id == smeDB.SMId).First(); + string submodel64 = Base64UrlEncoder.Encode(smDB.Identifier); + string link = $"{AasxServer.Program.externalBlazor}/submodels/{submodel64}/submodel-elements/{path}"; + + @smeDB.SMId +   + @smeDB.ParentSMEId +   + + @smeDB.Id + +   + @smeDB.SMEType +   + @smeDB.IdShort +   + @smeDB.SemanticId +   + + @if (smeDB.SMEType.Equals("MLP")) + { + List list = smeDB.getMLPValue(); + if (list.Count > 0) + { + string mlp = string.Empty; + string seperateString = " | "; + @for (int z = 0; z + 1 < list.Count; z++) + { + mlp += $"[{list[ z ]}] {list[ z + 1 ]}{seperateString}"; + z++; + } + + @mlp.Substring(0, mlp.Length - seperateString.Length) + } + } + else + { + @smeDB.getValue() + } + +   + @smeDB.ValueType +   + @($"UPDATE {TimeStamp.DateTimeToString(smeDB.TimeStamp)}") + @($"CREATE {TimeStamp.DateTimeToString(smeDB.TimeStampCreate)}") + @($"TREE {TimeStamp.DateTimeToString(smeDB.TimeStampTree)}") +   + sm + @if (smeDB.ParentSMEId != null) + { + par + } + + @if (smeDB.SMEType.Equals("MLP")) + { + mlp + } + +   + @link +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + if (url.EndsWith("/svalue")) + { + List data = PageRetriever.GetPageSValueData(size, searchLower, smeid); + +   @($"SValue#: {data.Count}/{db.SValueSets.Count()} size={size} search={search} smeid={smeid}") + +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var smeDB = data[ i ]; + + + + + + + } + +
Par#ValueAnnotationLinks
@smeDB.SMEId@smeDB.Value@smeDB.Annotation + @if (smeDB.SMEId != null) + { + par + } +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var smeDB = data[ i ]; +   + @smeDB.SMEId +   + @smeDB.Value +   + @smeDB.Annotation +   + @if (smeDB.SMEId != null) + { + par + } + +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + if (url.EndsWith("/ivalue")) + { + List data = PageRetriever.GetPageIValueData(size, searchLower, smeid); + +   @($"IValue#: {data.Count}/{db.IValueSets.Count()} size={size} search={search} smeid={smeid}") + +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var smeDB = data[ i ]; + + + + + + + } + +
Par#ValueAnnotationLinks
@smeDB.SMEId@smeDB.Value@smeDB.Annotation + @if (smeDB.SMEId != null) + { + par + } +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var smeDB = data[ i ]; +   + @smeDB.SMEId +   + @smeDB.Value +   + @smeDB.Annotation +   + @if (smeDB.SMEId != null) + { + par + } + +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + if (url.EndsWith("/dvalue")) + { + List data = PageRetriever.GetPageDValueData(size, searchLower, smeid); + +   @($"DValue#: {data.Count}/{db.DValueSets.Count()} size={size} search={search} smeid={smeid}") + +
+
+ @if (size > 1000 && data.Count > 1000) + { + + First 1000 as TABLE + +
+ } + + + + + + + + + + + + @for (int i = 0; i < data.Count && i < 1000; i++) + { + var smeDB = data[ i ]; + + + + + + + } + +
Par#ValueAnnotationLinks
@smeDB.SMEId@smeDB.Value@smeDB.Annotation + @if (smeDB.SMEId != null) + { + par + } +
+ @if (size > 1000 && data.Count > 1000) + { + + All other as text + +
+ @for (int i = 1000; i < data.Count; i++) + { + var smeDB = data[ i ]; +   + @smeDB.SMEId +   + @smeDB.Value +   + @smeDB.Annotation +   + @if (smeDB.SMEId != null) + { + par + } + +
+ } + +
+ } + + @($"Count: {data.Count}") +
+ } + + watch.Stop(); + @($"Elapsed ms: {watch.ElapsedMilliseconds}") + } + +
+
+ } +} +
+ +@code { + int size = 1000; + string search = string.Empty; + long aasxid = 0; + long aasid = 0; + long smid = 0; + long smeid = 0; + string smidentifier = string.Empty; +} diff --git a/src/AasxServerBlazor/Pages/Error.razor b/src/AasxServerBlazor/Pages/Error.razor index 79929d783..2ab7375d1 100644 --- a/src/AasxServerBlazor/Pages/Error.razor +++ b/src/AasxServerBlazor/Pages/Error.razor @@ -1,4 +1,17 @@ -@page "/error" + + +@page "/error"

Error.

diff --git a/src/AasxServerBlazor/Pages/Index.razor b/src/AasxServerBlazor/Pages/Index.razor index 1ee7195df..4eaf29c08 100644 --- a/src/AasxServerBlazor/Pages/Index.razor +++ b/src/AasxServerBlazor/Pages/Index.razor @@ -1,3 +1,16 @@ -@page "/Index" + + +@page "/Index" diff --git a/src/AasxServerBlazor/Pages/Pcf.razor b/src/AasxServerBlazor/Pages/Pcf.razor index e0eb475a0..0697fc98b 100644 --- a/src/AasxServerBlazor/Pages/Pcf.razor +++ b/src/AasxServerBlazor/Pages/Pcf.razor @@ -1,4 +1,17 @@ -@page "/pcf"; + + +@page "/pcf"; @using AasCore.Aas3_0 @using Data diff --git a/src/AasxServerBlazor/Pages/Pcf2.razor b/src/AasxServerBlazor/Pages/Pcf2.razor index 3cb2e615e..b19a8accf 100644 --- a/src/AasxServerBlazor/Pages/Pcf2.razor +++ b/src/AasxServerBlazor/Pages/Pcf2.razor @@ -1,4 +1,17 @@ -@page "/pcf2"; + + +@page "/pcf2"; @using AasCore.Aas3_0 @using Data diff --git a/src/AasxServerBlazor/Pages/Submodels.razor b/src/AasxServerBlazor/Pages/Submodels.razor index 5bb43db63..21d3fe750 100644 --- a/src/AasxServerBlazor/Pages/Submodels.razor +++ b/src/AasxServerBlazor/Pages/Submodels.razor @@ -1,4 +1,17 @@ -@page "/submodels" + + +@page "/submodels" @using AasCore.Aas3_0 @using AasxServerBlazor.Data diff --git a/src/AasxServerBlazor/Pages/Tree.razor b/src/AasxServerBlazor/Pages/Tree.razor index daefd307b..f3d347dc8 100644 --- a/src/AasxServerBlazor/Pages/Tree.razor +++ b/src/AasxServerBlazor/Pages/Tree.razor @@ -1,4 +1,17 @@ -@* + + +@* https://github.com/mwinkler/Blazor.Components/blob/master/LICENSE *@ diff --git a/src/AasxServerBlazor/Pages/TreePage.razor b/src/AasxServerBlazor/Pages/TreePage.razor index 03c75cdca..632fff515 100644 --- a/src/AasxServerBlazor/Pages/TreePage.razor +++ b/src/AasxServerBlazor/Pages/TreePage.razor @@ -1,2427 +1,2440 @@ -@page "/" -@inject AASService SubmodelService -@inject NavigationManager NavigationManager -@inject ISecurityService SecService -@using AasCore.Aas3_0 -@using AasSecurity; -@using AasSecurity.Models; -@using Extensions -@using Microsoft.IdentityModel.Tokens; -@using System.Net; -@using QRCoder; -@using AasxServerBlazor.Data -@using TimeStamp -@using static AasxServerStandardBib.TimeSeriesPlotting; -@using Range = AasCore.Aas3_0.Range - -@implements IDisposable - -
-
-
- @updateVisibleTree(Items, SelectedNode) - @if (Program.isLoading) - { - Loading... - } - else - { - AasxRestServerLibrary.AasxRestServer.TestResource.initListOfRepositories(); - } - - - @{ - var getPolicy = string.Empty; - @if (GlobalSecurityVariables.WithAuthentication) - { - var display = false; - var access = false; - var withAllow = false; - switch (context.Tag) - { - case Submodel sm: - { - // check, if access to submodel is allowed - withAllow = false; - access = SecService.AuthorizeRequest(null, "/submodels", AccessRights.READ, - out _, out withAllow, out getPolicy, sm.IdShort!, "submodel", sm); - display = true; - break; - } - case ISubmodelElement sme: - { - var path = sme.IdShort; - var p = sme.Parent; - while (p is not Submodel) - { - path = $"{(p as ISubmodelElement).IdShort}.{path}"; - p = (p as ISubmodelElement).Parent; - } - - path = $"{(p as Submodel).IdShort}.{path}"; - var error = string.Empty; - access = SecService.AuthorizeRequest(null, "/submodel-elements", AccessRights.READ, - out error, out withAllow, out getPolicy, path, string.Empty, p); - display = true; - break; - } - } - - if (display) - { - if (context.Children == null || !context.Children.Any()) - withAllow = false; - if (access) - { -    - } - else - { - if (!withAllow) - { -    - } - else - { -   -   - } - } - } - } - - @ViewNodeType(context) - @ViewNodeID(context)@ViewNodeInfo(context) - @if (Program.withPolicy && !string.IsNullOrEmpty(getPolicy)) - { - @getPolicy - } - - @GetSymbols(context) - @ViewTimeStamp(context) - } - - -
-
-
- @{ - if (SelectedNode != null) - { - if (SelectedNode.Tag is not string) - { - @ViewNodeType(SelectedNode) - @ViewNodeID(SelectedNode) -
- } - else - { - if (SelectedNode.Tag is string && SelectedNode.Text.Contains("/readme")) - { - var text = System.IO.File.ReadAllText(SelectedNode.Text); - text = text.Replace("%BLAZOR%", Program.externalBlazor); - if (text.Contains("%ACCESSRULES%")) - { - var accessRules = SecService.GetSecurityRules(); - - - - - - - - - - - - - - - @{ - var lines = accessRules.Split('\n'); - foreach (var l in lines) - { - - @{ - var cols = l.Split('\t'); - for (var c = 0; c < cols.Count(); c++) - { - if (c != 1 && c != 2) - { - - } - else - { - - } - } - } - - } - } - -
NameKindPermissionTypeAPIPathSemanticIDSee
@cols[c]@cols[c]
- } - else - { - @((MarkupString) text) - } - } - } - } - - for (var line = 0; line < 20; line++) - { - var nodeDetails0 = ViewNodeDetails(SelectedNode, line, 0); - var nodeDetails1 = ViewNodeDetails(SelectedNode, line, 1); - var nodeDetails2 = ViewNodeDetails(SelectedNode, line, 2); - if (nodeDetails0 != "" && nodeDetails1 != "") - { - var detailsId = "SelectedNodeDetailsLeft_" + line; - @nodeDetails0 - detailsId = "SelectedNodeDetailsRight_" + line; -  @nodeDetails1 @nodeDetails2 -
- } - } - - if (SelectedNode != null && SelectedNode.Tag is IReferable r) - { - UPDATE @TimeStamp.DateTimeToString(r.TimeStamp) -
- -
- CREATE @TimeStamp.DateTimeToString(r.TimeStampCreate) -
- TREE @TimeStamp.DateTimeToString(r.TimeStampTree) -
- @code { - - private void SetTimeStamp() - { - (SelectedNode.Tag as IReferable).SetTimeStamp(DateTime.UtcNow); - Program.env[SelectedNode.envIndex].setWrite(true); - } - - } - } - - var externalLink = false; - var link = GetLink(SelectedNode, out externalLink); - if (SelectedNode != null && !string.IsNullOrEmpty(link)) - { - @link -
- - if (SelectedNode != null && SelectedNode.Tag is Submodel && !string.IsNullOrEmpty(Program.connectServer)) - { - var toPublish = Program.submodelsToPublish.Contains(SelectedNode.Tag); - var toSubscribe = Program.submodelsToSubscribe.Contains(SelectedNode.Tag); - if (toPublish) - { - - } - else - { - - } - - if (toSubscribe) - { - - } - else - { - - } - @code { - - private void ResetSubmodelToPublish() - { - Program.submodelsToPublish.Remove(SelectedNode.Tag); - } - - private void SetSubmodelToPublish() - { - var toSubscribe = Program.submodelsToSubscribe.Contains(SelectedNode.Tag); - if (!toSubscribe) - Program.submodelsToPublish.Add(SelectedNode.Tag); - } - - private void ResetSubmodelToSubscribe() - { - Program.submodelsToSubscribe.Remove(SelectedNode.Tag); - } - - private void SetSubmodelToSubscribe() - { - var toPublish = Program.submodelsToPublish.Contains(SelectedNode.Tag); - if (!toPublish) - Program.submodelsToSubscribe.Add(SelectedNode.Tag); - } - - } - } - } - - if (SelectedNode is {Tag: Property} && Program.edit) - { - - @CurrentValue -
- @code { private string CurrentValue { get; set; } } - if (!string.IsNullOrEmpty(CurrentValue)) - { - if (SelectedNode.Tag is Property) - { - if (CurrentValue == " ") - CurrentValue = string.Empty; - (SelectedNode.Tag as Property).Value = CurrentValue; - (SelectedNode.Tag as Property).SetTimeStamp(DateTime.UtcNow); - Program.env[SelectedNode.envIndex].setWrite(true); - Program.signalNewData(0); - } - - CurrentValue = string.Empty; - } - } - - if (SelectedNode is {Tag: (AssetAdministrationShell or File) and AssetAdministrationShell}) - @code { - - private void runCreateQRCodeImage() - { - CreateQRCodeImage(SelectedNode); - } - - } - { - -
- var qrcodeLink = GetQRCodeLink(SelectedNode); - if (Program.generatedQrCodes.ContainsKey(SelectedNode.Tag)) - { - var qrcodeImage = GetQRCodeImage(SelectedNode); - if (qrcodeImage != "") - { - -
- Qrcode Image -
-
- } - } - else - { - @qrcodeLink - @:
- } - } - - if (SelectedNode is {Tag: Submodel sm}) - { - var idEncoded = Base64UrlEncoder.Encode(sm.Id); - var path = Program.externalBlazor + "/submodels/" + idEncoded; - URL: - @path -
- } - - if (SelectedNode != null && SelectedNode.Tag is ISubmodelElement sme) - { - var path = sme.IdShort; - var parent = sme.Parent as IReferable; - while (parent is not Submodel) - { - if (parent is ISubmodelElementList parentList) - { - if (path.Equals(sme.IdShort)) - { - var index = parentList.Value?.IndexOf(sme); - path = $"[{index}]"; - } - - path = parentList.IdShort + path; - } - else if (parent.Parent is ISubmodelElementList prevParentList) - { - var index = prevParentList.Value?.IndexOf(parent as ISubmodelElement); - path = $"[{index}].{path}"; - } - else - { - path = $"{parent.IdShort}.{path}"; - } - - parent = (IReferable) parent.Parent; - } - - var idEncoded = Base64UrlEncoder.Encode((parent as Submodel).Id); - path = Program.externalBlazor + "/submodels/" + idEncoded + "/submodel-elements/" + path; - URL: - @path -
- } - - if (SelectedNode != null && SelectedNode.Tag is SubmodelElementCollection smc) - { - var semanticId = string.Empty; - - try - { - semanticId = smc.SemanticId?.GetAsIdentifier(); - } - catch - { - } - - if (semanticId == "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeries/1/0" || - semanticId == "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeriesSegment/1/0") - { - var diff = smc.TimeStamp - timeStampPlot; - - if (smc != collectionPlot || diff.TotalSeconds < 0 || diff.TotalSeconds >= 5) - { - watchTimeToProcessImage = System.Diagnostics.Stopwatch.StartNew(); - - collectionPlot = smc; - timeStampPlot = smc.TimeStampTree; - - _timeSeriesData.Clear(); - - // make initial data for time series - var tsd = new TimeSeriesData() {SourceTimeSeries = smc}; - _timeSeriesData.Add(tsd); - - // plot arguments for time series - tsd.Args = PlotArguments.Parse(smc.FindQualifierOfType("TimeSeries.Args")?.Value); - - // TODO: info - ZveiTimeSeriesDataV10 is currently hardcoded as JSON string in code - var pcts = ZveiTimeSeriesDataV10.Static; - - var tssReferenceKey = new Key(KeyTypes.ConceptDescription, "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeriesSegment/1/0"); - - // is it a segment - if (semanticId == "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeriesSegment/1/0") - { - TimeSeriesAddSegmentData(pcts, tsd, smc); - } - else - { - // search for segments on current level - var smcAllValues = smc.Value.FindAllSemanticIdAs(tssReferenceKey, MatchMode.Relaxed); - - if (smcAllValues.Count() != 0) - { - foreach (var smcseg in smcAllValues) - { - TimeSeriesAddSegmentData(pcts, tsd, smcseg); - } - } - } - - _timeSeriesData?.RenderTimeSeries(defPlotHeight: 200, "en", bi.sessionNumber, plotFilter.combinedFromDate, plotFilter.combinedToDate); - watchTimeToProcessImage.Stop(); - } - - var timeSeriesImageBase64 = string.Empty; - var scottplotImgPath = $"wwwroot/images/scottplot/smc_timeseries_clientid{bi.sessionNumber}.png"; - - if (System.IO.File.Exists(scottplotImgPath)) - { - var imageArray = System.IO.File.ReadAllBytes(scottplotImgPath); - timeSeriesImageBase64 = Convert.ToBase64String(imageArray); - } - - var elapsedMsToProcessImage = watchTimeToProcessImage.ElapsedMilliseconds; - - if (System.IO.File.Exists(scottplotImgPath)) - { - - - - - - - -
- - - - - - -
-
- -
- Visualization of time series - - Image processing took @elapsedMsToProcessImage ms (Last update: @TimeStamp.DateTimeToString(timeStampPlot)) - -
- - - } - else - { -
Rendering time series...
- } - } - else - { - collectionPlot = null; - } - } - } - - @{ - var detailsImage = CreateDetailsImage(SelectedNode, out var url, out var svg); - if (!string.IsNullOrEmpty(detailsImage)) - { - if (!svg) - { - if (!url) - { -
-
- Details Image -
- } - else - { -
-
- Details Image -
- } - } - else - { - if (!url) - { -
-
- Details Image -
- } - else - { -
-
- Details Image -
- } - } - } - - if (SelectedNode is {Tag: BasicEventElement be} && be.Observed != null) - { - var observedSingleKey = be.Observed.GetAsExactlyOneKey().ToStringExtended(); - Observed - @($" {observedSingleKey}") -
+ + +@page "/" +@inject AASService SubmodelService +@inject NavigationManager NavigationManager +@inject ISecurityService SecService +@using AasCore.Aas3_0 +@using AasSecurity; +@using AasSecurity.Models; +@using Extensions +@using Microsoft.IdentityModel.Tokens; +@using System.Net; +@using QRCoder; +@using AasxServerBlazor.Data +@using TimeStamp +@using static AasxServerStandardBib.TimeSeriesPlotting; +@using Range = AasCore.Aas3_0.Range + +@implements IDisposable + +
+
+
+ @updateVisibleTree(Items, SelectedNode) + @if (Program.isLoading) + { + Loading... + } + else + { + AasxRestServerLibrary.AasxRestServer.TestResource.initListOfRepositories(); + } + + + @{ + var getPolicy = string.Empty; + @if (GlobalSecurityVariables.WithAuthentication) + { + var display = false; + var access = false; + var withAllow = false; + switch (context.Tag) + { + case Submodel sm: + { + // check, if access to submodel is allowed + withAllow = false; + access = SecService.AuthorizeRequest(null, "/submodels", AccessRights.READ, + out _, out withAllow, out getPolicy, sm.IdShort!, "submodel", sm); + display = true; + break; + } + case ISubmodelElement sme: + { + var path = sme.IdShort; + var p = sme.Parent; + while (p is not Submodel) + { + path = $"{(p as ISubmodelElement).IdShort}.{path}"; + p = (p as ISubmodelElement).Parent; + } + + path = $"{(p as Submodel).IdShort}.{path}"; + var error = string.Empty; + access = SecService.AuthorizeRequest(null, "/submodel-elements", AccessRights.READ, + out error, out withAllow, out getPolicy, path, string.Empty, p); + display = true; + break; + } + } + + if (display) + { + if (context.Children == null || !context.Children.Any()) + withAllow = false; + if (access) + { +    + } + else + { + if (!withAllow) + { +    + } + else + { +   +   + } + } + } + } + + @ViewNodeType(context) + @ViewNodeID(context)@ViewNodeInfo(context) + @if (Program.withPolicy && !string.IsNullOrEmpty(getPolicy)) + { + @getPolicy + } + + @GetSymbols(context) + @ViewTimeStamp(context) + } + + +
+
+
+ @{ + if (SelectedNode != null) + { + if (SelectedNode.Tag is not string) + { + @ViewNodeType(SelectedNode) + @ViewNodeID(SelectedNode) +
+ } + else + { + if (SelectedNode.Tag is string && SelectedNode.Text.Contains("/readme")) + { + var text = System.IO.File.ReadAllText(SelectedNode.Text); + text = text.Replace("%BLAZOR%", Program.externalBlazor); + if (text.Contains("%ACCESSRULES%")) + { + var accessRules = SecService.GetSecurityRules(); + + + + + + + + + + + + + + + @{ + var lines = accessRules.Split('\n'); + foreach (var l in lines) + { + + @{ + var cols = l.Split('\t'); + for (var c = 0; c < cols.Count(); c++) + { + if (c != 1 && c != 2) + { + + } + else + { + + } + } + } + + } + } + +
NameKindPermissionTypeAPIPathSemanticIDSee
@cols[c]@cols[c]
+ } + else + { + @((MarkupString) text) + } + } + } + } + + for (var line = 0; line < 20; line++) + { + var nodeDetails0 = ViewNodeDetails(SelectedNode, line, 0); + var nodeDetails1 = ViewNodeDetails(SelectedNode, line, 1); + var nodeDetails2 = ViewNodeDetails(SelectedNode, line, 2); + if (nodeDetails0 != "" && nodeDetails1 != "") + { + var detailsId = "SelectedNodeDetailsLeft_" + line; + @nodeDetails0 + detailsId = "SelectedNodeDetailsRight_" + line; +  @nodeDetails1 @nodeDetails2 +
+ } + } + + if (SelectedNode != null && SelectedNode.Tag is IReferable r) + { + UPDATE @TimeStamp.DateTimeToString(r.TimeStamp) +
+ +
+ CREATE @TimeStamp.DateTimeToString(r.TimeStampCreate) +
+ TREE @TimeStamp.DateTimeToString(r.TimeStampTree) +
+ @code { + + private void SetTimeStamp() + { + (SelectedNode.Tag as IReferable).SetTimeStamp(DateTime.UtcNow); + Program.env[SelectedNode.envIndex].setWrite(true); + } + + } + } + + var externalLink = false; + var link = GetLink(SelectedNode, out externalLink); + if (SelectedNode != null && !string.IsNullOrEmpty(link)) + { + @link +
+ + if (SelectedNode != null && SelectedNode.Tag is Submodel && !string.IsNullOrEmpty(Program.connectServer)) + { + var toPublish = Program.submodelsToPublish.Contains(SelectedNode.Tag); + var toSubscribe = Program.submodelsToSubscribe.Contains(SelectedNode.Tag); + if (toPublish) + { + + } + else + { + + } + + if (toSubscribe) + { + + } + else + { + + } + @code { + + private void ResetSubmodelToPublish() + { + Program.submodelsToPublish.Remove(SelectedNode.Tag); + } + + private void SetSubmodelToPublish() + { + var toSubscribe = Program.submodelsToSubscribe.Contains(SelectedNode.Tag); + if (!toSubscribe) + Program.submodelsToPublish.Add(SelectedNode.Tag); + } + + private void ResetSubmodelToSubscribe() + { + Program.submodelsToSubscribe.Remove(SelectedNode.Tag); + } + + private void SetSubmodelToSubscribe() + { + var toPublish = Program.submodelsToPublish.Contains(SelectedNode.Tag); + if (!toPublish) + Program.submodelsToSubscribe.Add(SelectedNode.Tag); + } + + } + } + } + + if (SelectedNode is {Tag: Property} && Program.edit) + { + + @CurrentValue +
+ @code { private string CurrentValue { get; set; } } + if (!string.IsNullOrEmpty(CurrentValue)) + { + if (SelectedNode.Tag is Property) + { + if (CurrentValue == " ") + CurrentValue = string.Empty; + (SelectedNode.Tag as Property).Value = CurrentValue; + (SelectedNode.Tag as Property).SetTimeStamp(DateTime.UtcNow); + Program.env[SelectedNode.envIndex].setWrite(true); + Program.signalNewData(0); + } + + CurrentValue = string.Empty; + } + } + + if (SelectedNode is {Tag: (AssetAdministrationShell or File) and AssetAdministrationShell}) + @code { + + private void runCreateQRCodeImage() + { + CreateQRCodeImage(SelectedNode); + } + + } + { + +
+ var qrcodeLink = GetQRCodeLink(SelectedNode); + if (Program.generatedQrCodes.ContainsKey(SelectedNode.Tag)) + { + var qrcodeImage = GetQRCodeImage(SelectedNode); + if (qrcodeImage != "") + { + +
+ Qrcode Image +
+
+ } + } + else + { + @qrcodeLink + @:
+ } + } + + if (SelectedNode is {Tag: Submodel sm}) + { + var idEncoded = Base64UrlEncoder.Encode(sm.Id); + var path = Program.externalBlazor + "/submodels/" + idEncoded; + URL: + @path +
+ } + + if (SelectedNode != null && SelectedNode.Tag is ISubmodelElement sme) + { + var path = sme.IdShort; + var parent = sme.Parent as IReferable; + while (parent is not Submodel) + { + if (parent is ISubmodelElementList parentList) + { + if (path.Equals(sme.IdShort)) + { + var index = parentList.Value?.IndexOf(sme); + path = $"[{index}]"; + } + + path = parentList.IdShort + path; + } + else if (parent.Parent is ISubmodelElementList prevParentList) + { + var index = prevParentList.Value?.IndexOf(parent as ISubmodelElement); + path = $"[{index}].{path}"; + } + else + { + path = $"{parent.IdShort}.{path}"; + } + + parent = (IReferable) parent.Parent; + } + + var idEncoded = Base64UrlEncoder.Encode((parent as Submodel).Id); + path = Program.externalBlazor + "/submodels/" + idEncoded + "/submodel-elements/" + path; + URL: + @path +
+ } + + if (SelectedNode != null && SelectedNode.Tag is SubmodelElementCollection smc) + { + var semanticId = string.Empty; + + try + { + semanticId = smc.SemanticId?.GetAsIdentifier(); + } + catch + { + } + + if (semanticId == "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeries/1/0" || + semanticId == "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeriesSegment/1/0") + { + var diff = smc.TimeStamp - timeStampPlot; + + if (smc != collectionPlot || diff.TotalSeconds < 0 || diff.TotalSeconds >= 5) + { + watchTimeToProcessImage = System.Diagnostics.Stopwatch.StartNew(); + + collectionPlot = smc; + timeStampPlot = smc.TimeStampTree; + + _timeSeriesData.Clear(); + + // make initial data for time series + var tsd = new TimeSeriesData() {SourceTimeSeries = smc}; + _timeSeriesData.Add(tsd); + + // plot arguments for time series + tsd.Args = PlotArguments.Parse(smc.FindQualifierOfType("TimeSeries.Args")?.Value); + + // TODO: info - ZveiTimeSeriesDataV10 is currently hardcoded as JSON string in code + var pcts = ZveiTimeSeriesDataV10.Static; + + var tssReferenceKey = new Key(KeyTypes.ConceptDescription, "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeriesSegment/1/0"); + + // is it a segment + if (semanticId == "https://admin-shell.io/sandbox/zvei/TimeSeriesData/TimeSeriesSegment/1/0") + { + TimeSeriesAddSegmentData(pcts, tsd, smc); + } + else + { + // search for segments on current level + var smcAllValues = smc.Value.FindAllSemanticIdAs(tssReferenceKey, MatchMode.Relaxed); + + if (smcAllValues.Count() != 0) + { + foreach (var smcseg in smcAllValues) + { + TimeSeriesAddSegmentData(pcts, tsd, smcseg); + } + } + } + + _timeSeriesData?.RenderTimeSeries(defPlotHeight: 200, "en", bi.sessionNumber, plotFilter.combinedFromDate, plotFilter.combinedToDate); + watchTimeToProcessImage.Stop(); + } + + var timeSeriesImageBase64 = string.Empty; + var scottplotImgPath = $"wwwroot/images/scottplot/smc_timeseries_clientid{bi.sessionNumber}.png"; + + if (System.IO.File.Exists(scottplotImgPath)) + { + var imageArray = System.IO.File.ReadAllBytes(scottplotImgPath); + timeSeriesImageBase64 = Convert.ToBase64String(imageArray); + } + + var elapsedMsToProcessImage = watchTimeToProcessImage.ElapsedMilliseconds; + + if (System.IO.File.Exists(scottplotImgPath)) + { + + + + + + + +
+ + + + + + +
+
+ +
+ Visualization of time series + + Image processing took @elapsedMsToProcessImage ms (Last update: @TimeStamp.DateTimeToString(timeStampPlot)) + +
+ + + } + else + { +
Rendering time series...
+ } + } + else + { + collectionPlot = null; + } + } + } + + @{ + var detailsImage = CreateDetailsImage(SelectedNode, out var url, out var svg); + if (!string.IsNullOrEmpty(detailsImage)) + { + if (!svg) + { + if (!url) + { +
+
+ Details Image +
+ } + else + { +
+
+ Details Image +
+ } + } + else + { + if (!url) + { +
+
+ Details Image +
+ } + else + { +
+
+ Details Image +
+ } + } + } + + if (SelectedNode is {Tag: BasicEventElement be} && be.Observed != null) + { + var observedSingleKey = be.Observed.GetAsExactlyOneKey().ToStringExtended(); + Observed + @($" {observedSingleKey}") +
var refsme = Program.env[0].AasEnv.FindReferableByReference(be.Observed); if (refsme != null) - { - UPDATE @TimeStamp.DateTimeToString(refsme.TimeStamp) -
- CREATE @TimeStamp.DateTimeToString(refsme.TimeStampCreate) -
+ { + UPDATE @TimeStamp.DateTimeToString(refsme.TimeStamp) +
+ CREATE @TimeStamp.DateTimeToString(refsme.TimeStampCreate) +
} else - { - Referenced element does not exist! -
- } - } - } -
-
-
- - -@inject IJSRuntime js -@inject BlazorSessionService bi; -@using AasxServer; - -@code { - System.Diagnostics.Stopwatch watchTimeToProcessImage = new(); - DateTime timeStampPlot = new(); - PlotFilter plotFilter = new(); - SubmodelElementCollection collectionPlot = null; - bool showImageModal = false; - ListOfTimeSeriesData _timeSeriesData = new(); - int plotFilterTsdOffset = 0; - - private class PlotFilter - { - public DateTime fromDate { get; set; } - public DateTime fromTime { get; set; } - public DateTime toDate { get; set; } - public DateTime toTime { get; set; } - public DateTime combinedFromDate { get; set; } - public DateTime combinedToDate { get; set; } - - public PlotFilter() - { - SetInitialFilterState(); - } - - public void SetInitialFilterState() - { - ResetTimeOfDates(); - var initialFromDate = DateTime.Now.AddYears(-3); - var initialToDate = DateTime.Now.AddYears(3); - fromDate = initialFromDate; - toDate = initialToDate; - combinedFromDate = initialFromDate; - combinedToDate = initialToDate; - } - - public void SetFilterStateDay(int offset) - { - ResetTimeOfDates(); - var day = DateTime.Today.AddDays(offset); - var midnight = new TimeSpan(0, 23, 59, 59); - var endOfDay = day.Add(midnight); - - fromDate = day; - fromTime = day; - toDate = endOfDay; - toTime = endOfDay; - combinedFromDate = day; - combinedToDate = endOfDay; - } - - public void ResetTimeOfDates() - { -// Reset to 0 AM - fromDate = new DateTime(fromDate.Year, fromDate.Month, fromDate.Day, 0, 0, 0); - toDate = new DateTime(toDate.Year, toDate.Month, toDate.Day, 0, 0, 0); - } - - public void UpdateFilter(ListOfTimeSeriesData tsd, int sessionNumber) - { - ResetTimeOfDates(); - var fromTimeSpan = fromTime.TimeOfDay; - var toTimeSpan = toTime.TimeOfDay; - combinedFromDate = fromDate.Add(fromTimeSpan); - combinedToDate = toDate.Add(toTimeSpan); - tsd?.RenderTimeSeries(defPlotHeight: 200, "en", sessionNumber, combinedFromDate, combinedToDate); - } - } - - async Task DownloadFile() - { - StateHasChanged(); - if (SelectedNode.Tag is File f) - { - var fileName = System.IO.Path.GetFileName(f.Value); - if (!string.IsNullOrEmpty(fileName)) - { - try - { - byte[] data; - using (var ms = new System.IO.MemoryStream()) - { - await Program.env[SelectedNode.envIndex].GetLocalStreamFromPackage(f.Value).CopyToAsync(ms); - data = ms.ToArray(); - } - - await SaveAs(js, fileName, data); - } - catch - { - } - } - } - } - - async Task SaveAs(IJSRuntime js, string filename, byte[] data) - { - ; - await js.InvokeAsync( - "saveAsFile", - filename, - data - ); - } - - public class Item - { - public string Text { get; set; } - public IEnumerable Children { get; set; } - - public object parent { get; set; } - public string Type { get; set; } - public object Tag { get; set; } - public int envIndex { get; set; } - } - - List Items = null; - - IList ExpandedNodes = new List(); - - private Item SelectedNode { get; set; } - - static ulong dataVersion = 0; - - public static void checkDataVersion() - { - if (Program.getDataVersion() != dataVersion) - { - dataVersion = Program.getDataVersion(); - } - } - - System.Threading.Timer refresh = null; - - protected override void OnInitialized() - { -// OnInitialized() always called twice - SubmodelService.NewDataAvailable += NewData; - Program.signalNewData(1); - } - - public void Dispose() - { - SubmodelService.NewDataAvailable -= NewData; - } - - int newDataMode = 0; - - void NewData(object source, EventArgs args) - { - if (Program.isLoading) - return; - - if (newDataMode != 0 || args is not Program.NewDataAvailableArgs newArgs) - { - return; - } - - newDataMode = newArgs.signalNewDataMode; - InvokeAsync(StateHasChanged); - } - - bool update = true; - - string updateVisibleTree(List viewItems, Item selectedNode) - { - if (!update) - { - return string.Empty; - } - - switch (newDataMode) - { - case 0: - break; - case 1: - case 2: - var isSelected = selectedNode != null; - var isExpanded = ExpandedNodes.Count != 0; - var expandedNodesPath = new List[ExpandedNodes.Count + 1]; - var selectedNodePath = GetPath(selectedNode); - if (isExpanded) - { - for (var j = 0; j < ExpandedNodes.Count; j++) - { - expandedNodesPath[j] = GetPath(ExpandedNodes[j]); - } - } - - SubmodelService.BuildTree(); - Items = SubmodelService.GetTree(selectedNode, ExpandedNodes); - ExpandedNodes.Clear(); - selectedNode = null; - if (isSelected) - { - selectedNode = FindPath(selectedNodePath); - } - - if (isExpanded) - { - foreach (var path in expandedNodesPath) - { - var p = FindPath(path); - if (p != null) - ExpandedNodes.Add(p); - } - } - - newDataMode = 0; - break; -// 3 == build new tree, all nodes closed - case 3: - SubmodelService.BuildTree(); - Items = SubmodelService.GetTree(selectedNode, ExpandedNodes); - ExpandedNodes.Clear(); - selectedNode = null; - newDataMode = 0; - break; - } - - SelectedNode = selectedNode; - - return string.Empty; - } - - List GetPath(Item i) - { - if (i == null) - return null; - - var upPath = new List {i.Text}; - while (i.parent != null) - { - i = (Item) i.parent; - upPath.Add(i.Text); - } - - var downPath = new List(); - var j = upPath.Count - 1; - while (j >= 0) - { - downPath.Add(upPath[j--]); - } - - return downPath; - } - - Item FindPath(List path) - { - switch (path) - { - case {Count: > 0}: - { - var k = 0; - while (k < Items.Count) - { - var i = Items[k]; - if (i.Text != path[0]) - { - k++; - continue; - } - - var j = 0; - var found = i; - while (++j < path.Count) - { - if (i.Children != null) - { - found = i.Children.FirstOrDefault(c => c.Text == path[j]); - } - - if (found == null) - { - return null; - } - - i = found; - } - - return found; - } - - break; - } - } - - return null; - } - - void UpdateNode(Item i) - { - var clist = i.Children as List; - var listIdshort = new List(); - var done = false; - if (i.Tag is Submodel sm) - { - listIdshort.AddRange(sm.SubmodelElements.Select(smew1 => smew1.IdShort)); - - done = true; - } - - if (!done && i.Tag is SubmodelElementCollection smec) - { - listIdshort.AddRange(smec.Value.Select(smew2 => smew2.IdShort)); - - done = true; - } - - if (!done && i.Tag is ISubmodelElement sme) - { - listIdshort.Add(sme.IdShort); - done = true; - } - -// check if child name exists in data children idshorts, if not delete - if (done) - { - var toDelete = new List(); - if (clist != null) - { - toDelete.AddRange(clist.Where(c => !listIdshort.Contains(c.Text))); - } - else - { - if (!listIdshort.Contains(i.Text)) - { - toDelete.Add(i); - } - } - - foreach (var c in toDelete) - { - if (c.parent is Item parent) - { - (parent.Children as List)?.Remove(c); - } - } - } - -// check if data children idshorts exist in child names, if not insert - if (clist == null) - { - return; - } - - foreach (var c in clist) - { - UpdateNode(c); - } - } - - public static string CreateDetailsImage(Item item, out bool url, out bool svg) - { - svg = false; - url = false; - - if (item == null) - { - return string.Empty; - } - - var itemTag = item.Tag; - - switch (itemTag) - { - case AssetAdministrationShell tag: - { - var aas = tag; - lock (Program.changeAasxFile) - { - try - { - { - if (Program.env[item.envIndex] == null) - return string.Empty; - - using var s = Program.env[item.envIndex].GetLocalThumbnailStream(); - if (s != null) - { - using var m = new System.IO.MemoryStream(); - s.CopyTo(m); - return Convert.ToBase64String(m.ToArray()); - } - } - } - catch - { - } - } - - break; - } - case AasCore.Aas3_0.File f: - { -// Test for /aasx/ - if (!string.IsNullOrEmpty(f.Value)) - { - var split = f.Value.Split(new[] {'/'}); - if (split.Length == 2 || split.Length > 1 && split[1].ToLower() == "aasx") - { - split = f.Value.Split(new[] {'.'}); - switch (split.Last().ToLower()) - { - case "jpg": - case "bmp": - case "png": - case "svg": - try - { - using var s = Program.env[item.envIndex].GetLocalStreamFromPackage(f.Value); - if (s != null) - { - using var m = new System.IO.MemoryStream(); - if (split.Last().ToLower().Equals("svg")) - { - svg = true; - } - - s.CopyTo(m); - return Convert.ToBase64String(m.ToArray()); - } - } - catch - { - } - - break; - } - } - else - { - url = true; - return f.Value; - } - } - - break; - } - } - - return string.Empty; - } - - string GetQRCodeLink(Item item) - { - if (item == null) - { - return string.Empty; - } - - var prefix = "http://"; - - - var itemTag = item.Tag; - - if (itemTag is not AssetAdministrationShell aas) - { - return string.Empty; - } - - var asset = aas.AssetInformation; - var url = asset.GlobalAssetId; - - return url; - } - - string GetQRCodeImage(Item item) - { - var itemTag = item.Tag; - - if (itemTag is not AssetAdministrationShell) - { - return string.Empty; - } - - var image = Program.generatedQrCodes[item.Tag]; - - return image ?? string.Empty; - } - - void CreateQRCodeImage(Item item) - { - if (item == null) - { - return; - } - - var prefix = "http://"; - - var itemTag = item.Tag; - - if (itemTag is not AssetAdministrationShell aas) - { - return; - } - - if (Program.generatedQrCodes.ContainsKey(item.Tag)) - { - Program.generatedQrCodes.Remove(item.Tag); - return; - } - - var asset = aas.AssetInformation; - var url = asset.GlobalAssetId; - - var qrGenerator = new QRCodeGenerator(); - var qrCodeData = qrGenerator.CreateQrCode(url, QRCodeGenerator.ECCLevel.Q); - var qrCode = new QRCode(qrCodeData); - var qrCodeImage = qrCode.GetGraphic(20); - using var memory = new System.IO.MemoryStream(); - qrCodeImage.Save(memory, System.Drawing.Imaging.ImageFormat.Bmp); - var base64 = Convert.ToBase64String(memory.ToArray()); - - Program.generatedQrCodes.Add(item.Tag, base64); - } - - bool HasDownloadFile(Item item) - { - return false; - } - - string GetLink(Item item, out bool external) - { - external = false; - - if (item == null) - { - return string.Empty; - } - - var itemTag = item.Tag; - - switch (itemTag) - { - case null when Program.envSymbols[item.envIndex] == "L": - return $"{Program.externalRest}/server/getaasx/{Convert.ToString(SelectedNode.envIndex)}"; - case AssetAdministrationShell: - return $"{Program.externalBlazor}/packages/{Base64UrlEncoder.Encode(Convert.ToString(SelectedNode.envIndex))}"; - case File: - case Property: - { - var value = itemTag switch - { - AasCore.Aas3_0.File file => file.Value, - Property property => property.Value, - _ => string.Empty - }; - - if (string.IsNullOrEmpty(value)) - return string.Empty; - - var split = value.Split(new[] {':'}); - if (split[0].ToLower() == "http" || split[0].ToLower() == "https") - { - external = true; - return value; - } - -// Test for /aasx/ - split = value.Split(new[] {'/'}); - if (split.Length > 1) - { - if (split.Length == 2 || split[1].ToLower() == "aasx") - { - var sme = item.Tag as ISubmodelElement; - var path = sme.IdShort; - var parent = sme.Parent as IReferable; - while (parent is not Submodel) - { - if (parent is ISubmodelElementList parentList) - { - if (path.Equals(sme.IdShort)) - { - var index = parentList.Value?.IndexOf(sme); - path = $"[{index}]"; - } - - path = parentList.IdShort + path; - } - else if (parent.Parent is ISubmodelElementList prevParentList) - { - var index = prevParentList.Value?.IndexOf(parent as ISubmodelElement); - path = $"[{index}].{path}"; - } - else - { - path = $"{parent.IdShort}.{path}"; - } - - parent = (IReferable) parent.Parent; - } - - - var currentUrl = $"{Program.externalBlazor}/"; - - return $"{currentUrl}submodels/{Base64UrlEncoder.Encode((parent as Submodel).Id)}/submodel-elements/{path}/attachment"; - } - } - - break; - } - } - - return string.Empty; - } - - string GetSymbols(Item item) - { - if (item == null) - { - return string.Empty; - } - - var ret = string.Empty; - var o = item.Tag; - - if (o is not AssetAdministrationShell) - { - return ret; - } - - var symbols = Program.envSymbols[item.envIndex]; - - if (symbols == null) - { - return ret; - } - - var s = symbols.Split(';'); - - foreach (var t in s) - { - switch (t) - { - case "L": - ret += "ENCRYPTED "; - break; - case "S": - ret += "SIGNED "; - break; - case "V": - ret += "VALIDATED "; - break; - } - } - - return ret; - } - - /// - /// This method list added to check if Node is only SubmodelElementCollection (from V2) - /// - /// - /// - /// - bool IsSmColl(Item item) - { - if (item == null) - { - return false; - } - - return item.Tag switch - { - SubmodelElementList => false, - SubmodelElementCollection => true, - _ => false - }; - } - - string ViewNodeType(Item item) - { - if (item == null) - { - return string.Empty; - } - - var ret = string.Empty; - - if (item.Type != null) - { - ret = $"{item.Type} "; - } - - var itemTag = item.Tag; - - - switch (itemTag) - { - case string when item.Text.Contains("/readme"): - ret += item.Text; - break; - case null when Program.envSymbols[item.envIndex] == "L": - ret += "AASX2"; - break; - case AssetAdministrationShell: - ret += "AAS"; - break; - case Submodel: - ret += "Sub"; - break; - case ISubmodelElement: - { - switch (itemTag) - { - case SubmodelElementList: - ret += "SML"; - break; - case SubmodelElementCollection: - ret += "Coll"; - break; - case Property: - ret += "Prop"; - break; - } - - break; - } - } - - switch (itemTag) - { - case Operation: - ret += "Opr"; - break; - case File: - ret += "File"; - break; - case Blob: - ret += "Blob"; - break; - case Range: - ret += "Range"; - break; - case MultiLanguageProperty: - ret += "Lang"; - break; - case RelationshipElement: - ret += "Rel"; - break; - case ReferenceElement: - ret += "Ref"; - break; - case Entity: - ret += "Ent"; - break; - case BasicEventElement: - ret += "Evt"; - break; - case AnnotatedRelationshipElement: - ret += "RelA"; - break; - case Capability: - ret += "Cap"; - break; - } - - return (ret); - } - - string ViewTimeStamp(Item item) - { - if (item == null) - { - return string.Empty; - } - - var ret = string.Empty; - - var itemTag = item.Tag; - - if (itemTag is IReferable r) - ret += $" ({TimeStamp.DateTimeToString(r.TimeStampTree)}) "; - - return ret; - } - - string ViewNodeID(Item item) - { - if (item == null) - { - return string.Empty; - } - - var ret = "NULL"; - - var itemTag = item.Tag; - - switch (itemTag) - { - case null when Program.envSymbols[item.envIndex] == "L": - ret = item.Text; - break; - case string when item.Text.Contains("/readme"): - ret = " "; - break; - case AssetAdministrationShell tag: - { - ret = tag.IdShort; - break; - } - case Submodel tag: - { - ret = string.Empty; - if (tag.Kind is ModellingKind.Template) - ret += " "; - ret += tag.IdShort; - break; - } - case ISubmodelElement tag: - { - ret = string.Empty; - ret += tag.IdShort; - break; - } - } - - switch (itemTag) - { - case AasCore.Aas3_0.File f: - ret = string.Empty; - ret += f.IdShort; - break; - case Blob tag: - { - ret = string.Empty; - ret += tag.IdShort; - break; - } - case Range tag: - { - ret = string.Empty; - ret += tag.IdShort; - break; - } - case MultiLanguageProperty tag: - { - ret = string.Empty; - ret += tag.IdShort; - break; - } - } - - return (ret); - } - - string GetHtmlId(Item item) - { - var ret = ViewNodeID(item); - if (item.parent != null) - { - ret = $"{GetHtmlId(item.parent as Item)}.{ret}"; - } - - return (ret); - } - - string ViewNodeInfo(Item item) - { - if (item == null) - { - return string.Empty; - } - - var ret = string.Empty; - - var itemTag = item.Tag; - - switch (itemTag) - { - case AssetAdministrationShell tag: - { - var aas = tag; - break; - } - case Submodel tag: - { - if (tag.Qualifiers is {Count: > 0}) - { - ret += " @QUALIFIERS"; - } - - break; - } - case SubmodelElementCollection tag: - { - if (tag.Value != null && tag.Value.Count > 0) - { - ret += $" #{tag.Value.Count}"; - } - - if (tag.Qualifiers != null && tag.Qualifiers.Count > 0) - { - ret += " @QUALIFIERS"; - } - - break; - } - } - - if (itemTag is ISubmodelElement) - { - switch (itemTag) - { - case Property prop: - { - if (!string.IsNullOrEmpty(prop.Value)) - { - var v = prop.Value; - if (v.Length > 100) - v = v[..100] + " .."; - ret = $" = {v}"; - } - - if (prop.Qualifiers != null && prop.Qualifiers.Count > 0) - { - ret += " @QUALIFIERS"; - } - - break; - } - case AasCore.Aas3_0.File f: - { - if (f.Value != null) - ret = $" = {f.Value}"; - if (f.Qualifiers is {Count: > 0}) - { - ret += " @QUALIFIERS"; - } - - break; - } - } - } - - switch (itemTag) - { - case AasCore.Aas3_0.Range range: - { - if (range.Min != null && range.Max != null) - ret = $" = {range.Min} .. {range.Max}"; - if (range.Qualifiers is {Count: > 0}) - { - ret += " @QUALIFIERS"; - } - - break; - } - case MultiLanguageProperty tag: - { - var ls = tag.Value; - if (ls != null) - { - ret = " = "; - for (var i = 0; i < ls.Count; i++) - { - ret += $"{ls[i].Language} "; - if (i == 0) - ret += $"{ls[i].Text} "; - } - } - - if (tag.Qualifiers != null && tag.Qualifiers.Count > 0) - { - ret += " @QUALIFIERS"; - } - - break; - } - } - - return (ret); - } - - string ViewNodeDetails(Item item, int line, int col) - { - if (item == null) - { - return string.Empty; - } - - var ret = string.Empty; - - var itemTag = item.Tag; - - switch (itemTag) - { - case null: - return string.Empty; - case AssetAdministrationShell tag: - { - ret = string.Empty; - - var asset = tag.AssetInformation; - - switch (line) - { - case 0: - ret = col switch - { - 0 => "ID", - 1 => $"{tag.Id}", - 2 => $" ==> {Base64UrlEncoder.Encode(tag.Id)}", - _ => ret - }; - break; - case 1: - if (asset != null) - { - ret = col switch - { - 0 => "ASSET", - 1 => asset.GlobalAssetId, - _ => ret - }; - } - - break; - case 2: - switch (col) - { - case 0: - ret = "ASSETID"; - break; - case 1: - ret = $"{asset.GlobalAssetId}"; - break; - case 2: - { - if (asset.GlobalAssetId != null) - { - ret = $" ==> {Base64UrlEncoder.Encode(asset.GlobalAssetId)}"; - } - - break; - } - } - - break; - case 3: - switch (col) - { - case 0: - ret = "ASSETID URLENCODED"; - break; - case 1: - { - var url = WebUtility.UrlEncode(asset.GlobalAssetId); - ret = url; - break; - } - } - - break; - - case 4: - if (tag.Extensions != null) - { - ret = col switch - { - 0 => "Extensions", - 1 => tag.Extensions.Aggregate(string.Empty, (current, e) => current + ($"{e.Name} : {e.Value}; ")), - _ => ret - }; - } - - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case Submodel tag: - { - ret = string.Empty; - switch (line) - { - case 0: - ret = col switch - { - 0 => "ID", - 1 => $"{tag.Id}", - 2 => $" ==> {Base64UrlEncoder.Encode(tag.Id)}", - _ => ret - }; - break; - case 1: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 2: - ret = GetQualifiers(tag.Qualifiers, col); - break; - case 3: - if (tag.Extensions != null) - { - switch (col) - { - case 0: - ret = "Extensions"; - break; - case 1: - { - ret = tag.Extensions.Aggregate(string.Empty, (current, e) => current + $"{e.Name} : {e.Value}; "); - - break; - } - } - } - - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case Property tag: - { - ret = string.Empty; - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - ret = col switch - { - 0 => "Value Type", - 1 => $"{tag.ValueType}", - _ => ret - }; - break; - case 2: - ret = col switch - { - 0 => "Value", - 1 => $"{tag.Value}", - _ => ret - }; - break; - case 3: - ret = GetQualifiers(tag.Qualifiers, col); - break; - case 4: - if (col == 0) - ret = GetUnit(tag); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case Entity tag: - { - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - ret = col switch - { - 0 => "Entity Type", - 1 => $"{tag.EntityType}", - _ => ret - }; - break; - case 2: - ret = string.Empty; - if (tag.EntityType == EntityType.SelfManagedEntity) - { - if (tag.GlobalAssetId != null) - { - switch (col) - { - case 0: - ret = "Asset"; - break; - case 1: - { - var k = tag.GlobalAssetId; - break; - } - } - } - - if (tag.SpecificAssetIds != null) - { - switch (col) - { - case 0: - ret = "Asset"; - break; - case 1: - { - foreach (var k in tag.SpecificAssetIds.Select(specificAssetId => specificAssetId.Value).Where(k => !string.IsNullOrEmpty(k))) - { - ret = $"[{k}]"; - } - - break; - } - } - } - } - - break; - case 3: - ret = GetQualifiers(tag.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case AasCore.Aas3_0.File f: - ret += $", {f.Value}"; - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = f.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - ret = col switch - { - 0 => "Value", - 1 => f.Value, - _ => ret - }; - break; - case 2: - ret = GetQualifiers(f.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - case Blob b: - ret = string.Empty; - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = b.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - ret = col switch - { - 0 => "ContentType", - 1 => b.ContentType, - _ => ret - }; - break; - case 2: - ret = col switch - { - 0 => "Value", - 1 => System.Text.Encoding.ASCII.GetString(b.Value), - _ => ret - }; - break; - case 3: - ret = GetQualifiers(b.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - case Range tag: - { - ret = tag.IdShort; - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - ret = col switch - { - 0 => "Min", - 1 => $"{tag.Min}", - _ => ret - }; - break; - case 2: - ret = col switch - { - 0 => "Max", - 1 => $"{tag.Max}", - _ => ret - }; - break; - case 3: - ret = GetQualifiers(tag.Qualifiers, col); - break; - case 4: - if (col == 0) - ret = GetUnit(tag); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case Operation tag: - { - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - switch (col) - { - case 0: - ret = "CountInputs"; - break; - case 1: - { - ret = "0"; - if (tag.InputVariables != null) - { - ret = $"{tag.InputVariables.Count}"; - } - - break; - } - } - - break; - case 2: - switch (col) - { - case 0: - ret = "CountOutputs"; - break; - case 1: - { - ret = "0"; - if (tag.OutputVariables != null) - { - ret = $"{tag.OutputVariables.Count}"; - } - - break; - } - } - - break; - case 3: - ret = GetQualifiers(tag.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case AnnotatedRelationshipElement tag: - { - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - switch (col) - { - case 0: - ret = "First"; - break; - case 1: - { - var k = tag.First; - ret = k.Keys.ToStringExtended(); - break; - } - } - - break; - case 2: - switch (col) - { - case 0: - ret = "Second"; - break; - case 1: - { - var k = tag.Second; - ret = k.Keys.ToStringExtended(); - break; - } - } - - break; - case 3: - if (col == 0) - ret = GetQualifiers(tag.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case RelationshipElement tag: - { - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - switch (col) - { - case 0: - ret = "First"; - break; - case 1: - { - var k = tag.First; - ret = k.Keys.ToStringExtended(); - - break; - } - } - - break; - case 2: - switch (col) - { - case 0: - ret = "Second"; - break; - case 1: - { - var k = tag.Second; - ret = k.Keys.ToStringExtended(); - - - break; - } - } - - break; - case 3: - ret = GetQualifiers(tag.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case ReferenceElement tag: - { - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = tag.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - switch (col) - { - case 0: - ret = "Value"; - break; - case 1: - { - ret = "NULL"; - var k = tag.Value?.Keys; - if (k != null) - { - ret = k.ToStringExtended(); - } - - break; - } - } - - break; - case 2: - ret = GetQualifiers(tag.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - case MultiLanguageProperty multiLanguageProperty: - { - var ls = multiLanguageProperty.Value; - if (ls == null) - { - return ret; - } - - ret = ls.Aggregate(ret, (current, t) => current + $"{t.Language} "); - - switch (line) - { - case 0: - { - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = multiLanguageProperty.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - } - case 1: - ret = GetQualifiers(multiLanguageProperty.Qualifiers, col); - break; - default: - ret = string.Empty; - if (ls.Count > line - 2) - { - ret = col switch - { - 0 => ls[line - 2].Language, - 1 => $"{ls[line - 2].Text}", - _ => ret - }; - } - - break; - } - - return ret; - } - } - - if (itemTag is not ISubmodelElement sme) - { - return (ret); - } - - switch (line) - { - case 0: - switch (col) - { - case 0: - ret = "Semantic ID"; - break; - case 1: - { - ret = "NULL"; - var k = sme.SemanticId?.GetAsExactlyOneKey(); - if (k != null) - { - ret = $"[{k.Type}, {k.Value}]"; - } - - break; - } - } - - break; - case 1: - ret = GetQualifiers(sme.Qualifiers, col); - break; - default: - ret = string.Empty; - break; - } - - return ret; - } - - static string GetQualifiers(List q, int col) - { - var ret = string.Empty; - - if (q is not {Count: > 0}) - { - return ret; - } - - switch (col) - { - case 0: - ret = "Qualifiers"; - break; - case 1: - { - ret = string.Empty; - for (var i = 0; i < q.Count; i++) - { - if (i != 0) - ret += ", "; - if (q[i].Type != null && q[i].Type != "") - { - ret += $"{q[i].Type} "; - } - - if (!string.IsNullOrEmpty(q[i].Value)) - { - ret += $"= {q[i].Value}"; - } - } - - break; - } - } - - return ret; - } - - private string GetUnit(ISubmodelElement se) - { - var ret = string.Empty; - if (se.SemanticId == null || se.SemanticId.Keys != null || se.SemanticId.Keys.Count != 0) - { - return ret; - } - - - return ret; - } - -} - - diff --git a/src/AasxServerBlazor/Shared/MainLayout.razor b/src/AasxServerBlazor/Shared/MainLayout.razor index e3721743c..767c2ad97 100644 --- a/src/AasxServerBlazor/Shared/MainLayout.razor +++ b/src/AasxServerBlazor/Shared/MainLayout.razor @@ -1,4 +1,17 @@ -@inherits LayoutComponentBase + + +@inherits LayoutComponentBase @inject NavigationManager NavMan @inject Data.AASService SubmodelService @using AasCore.Aas3_0; diff --git a/src/AasxServerBlazor/Shared/NavMenu.razor b/src/AasxServerBlazor/Shared/NavMenu.razor index f7e5220d3..c1815255e 100644 --- a/src/AasxServerBlazor/Shared/NavMenu.razor +++ b/src/AasxServerBlazor/Shared/NavMenu.razor @@ -1,4 +1,17 @@ -