From 09c9eb1b00d133d1267b8f066094926210909ec3 Mon Sep 17 00:00:00 2001 From: AlexanderWollbrink Date: Wed, 7 Feb 2024 16:58:19 +0100 Subject: [PATCH] added error bubble for duplicate GlobalAssetIds --- src/AasxPackageLogic/DispEditHelperEntities.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/AasxPackageLogic/DispEditHelperEntities.cs b/src/AasxPackageLogic/DispEditHelperEntities.cs index 63a7969e..72087a06 100644 --- a/src/AasxPackageLogic/DispEditHelperEntities.cs +++ b/src/AasxPackageLogic/DispEditHelperEntities.cs @@ -65,6 +65,19 @@ public void DisplayOrEditAasEntityAssetInformation( "found on its name plate. " + "This attribute is required as soon as the AAS is exchanged via partners in " + "the life cycle of the asset.", + severityLevel: HintCheck.Severity.High), + new HintCheck( + () => + { + int count = 0; + foreach(var aas in env.AssetAdministrationShells) + { + if(aas.AssetInformation.GlobalAssetId == asset.GlobalAssetId) + count++; + } + return (count>=2?true:false); + }, + "It is not allowed to have duplicate GlobalAssetIds in the same file. This will break functionality and we strongly encoure to make the Id unique!", severityLevel: HintCheck.Severity.High) });