diff --git a/src/AasxPluginProductChangeNotifications/PcnAnyUiControl.cs b/src/AasxPluginProductChangeNotifications/PcnAnyUiControl.cs index c6222c86..2cea22eb 100644 --- a/src/AasxPluginProductChangeNotifications/PcnAnyUiControl.cs +++ b/src/AasxPluginProductChangeNotifications/PcnAnyUiControl.cs @@ -26,6 +26,7 @@ This source code may use other Open Source software components (see LICENSE.txt) using System.Globalization; using System.Windows.Controls; using AasxIntegrationBaseGdi; +using System.Windows; namespace AasxPluginProductChangeNotifications { @@ -374,6 +375,51 @@ protected void InnerDocAddText( wrap: (wrapText != AnyUiTextWrapping.Wrap) ? null : (new[] { 1 })); } + protected void InnerDocAddGridCells( + AnyUiSmallWidgetToolkit uitk, + AnyUiGrid grid, + string[] cell, + int[] bold = null, + int[] wrap = null, + int[] centered = null) + { + // access and add row + if (grid == null || cell == null) + return; + int row = InnerDocGetNewRow(grid); + + // text(s) + for (int i = 0; i < cell.Length; i++) + { + // make the border + var brd = uitk.AddSmallBorderTo(grid, row, i, + margin: (i == 0) ? new AnyUiThickness(0, -1, 0, 0) + : new AnyUiThickness(-1, -1, 0, 0), + borderThickness: new AnyUiThickness(1.0), + borderBrush: AnyUiBrushes.Black); + + var stb = new AnyUiSelectableTextBlock() + { + Text = "" + cell[i], + Padding = new AnyUiThickness(1), + FontWeight = (bold != null && bold.Contains(i)) + ? AnyUiFontWeight.Bold : null, + TextWrapping = (wrap != null && wrap.Contains(i)) + ? AnyUiTextWrapping.Wrap : null, + VerticalAlignment = AnyUiVerticalAlignment.Center, + VerticalContentAlignment = AnyUiVerticalAlignment.Center + }; + + brd.Child = stb; + + if (centered != null && centered.Contains(i)) + { + stb.HorizontalAlignment = AnyUiHorizontalAlignment.Center; + stb.HorizontalContentAlignment = AnyUiHorizontalAlignment.Center; + } + } + } + protected void InnerDocAddLifeCycleMilestones( AnyUiSmallWidgetToolkit uitk, AnyUiGrid grid, int col, @@ -656,6 +702,30 @@ protected void InnerDocAddAdditionalInfo( } } + protected void InnerDocAddTechnicalDataChanges( + AnyUiSmallWidgetToolkit uitk, + AnyUiGrid grid, int col, + AasClassMapperInfo info) + { + // access and add row + if (grid == null + || !(info?.Referable is Aas.ISubmodelElementCollection smc)) + return; + int row = InnerDocGetNewRow(grid); + + // make inner grid + var inner = uitk.Set( + uitk.AddSmallGridTo(grid, row, col, + rows: 0, cols: 3, + colWidths: new[] { "#", "*", "#" }), + colSpan: _innerDocumentCols - col); + + // add head line + InnerDocAddGridCells(uitk, inner, + cell: new[] { "IdShort", "SemanticId", "New value" }, + bold: new[] { 0, 1, 2 }); + } + protected void RenderPanelInner( AnyUiStackPanel view, AnyUiSmallWidgetToolkit uitk, PcnOptionsRecord rec, @@ -871,6 +941,15 @@ protected void RenderPanelInner( } } + + // technical data - changes + if (data.ItemOfChange?.TechnicalData_Changes != null) + { + InnerDocAddHeadline(uitk, grid, 0, "Given changes of technical data for the item of change", 2); + + InnerDocAddTechnicalDataChanges(uitk, grid, 0, + data.ItemOfChange.TechnicalData_Changes.__Info__); + } } #endregion diff --git a/src/AasxPredefinedConcepts/PackageExplorer.cs b/src/AasxPredefinedConcepts/DefinitionsPackageExplorer.cs similarity index 100% rename from src/AasxPredefinedConcepts/PackageExplorer.cs rename to src/AasxPredefinedConcepts/DefinitionsPackageExplorer.cs diff --git a/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesDescription.cs b/src/AasxPredefinedConcepts/MappingsAssetInterfacesDescription.cs similarity index 100% rename from src/AasxPredefinedConcepts/DefinitionsAssetInterfacesDescription.cs rename to src/AasxPredefinedConcepts/MappingsAssetInterfacesDescription.cs diff --git a/src/AasxPredefinedConcepts/DefinitionsAssetInterfacesMapping.cs b/src/AasxPredefinedConcepts/MappingsAssetInterfacesMapping.cs similarity index 100% rename from src/AasxPredefinedConcepts/DefinitionsAssetInterfacesMapping.cs rename to src/AasxPredefinedConcepts/MappingsAssetInterfacesMapping.cs diff --git a/src/AasxPredefinedConcepts/DefinitionsProductChangeNotifications.cs b/src/AasxPredefinedConcepts/MappingsProductChangeNotifications.cs similarity index 100% rename from src/AasxPredefinedConcepts/DefinitionsProductChangeNotifications.cs rename to src/AasxPredefinedConcepts/MappingsProductChangeNotifications.cs diff --git a/src/AasxPredefinedConcepts/README/Overview.md b/src/AasxPredefinedConcepts/README/Overview.md new file mode 100644 index 00000000..d26e15ae --- /dev/null +++ b/src/AasxPredefinedConcepts/README/Overview.md @@ -0,0 +1,65 @@ +# Overview on organization of AASPE predefined concepts + +## General + +This projects hold a wealth of classes defining concepts, in particular +semanticIds and class structures. These concepts could be used on +*source code level* to avoid having semanticIds as sttring constants. + +Nearly everything here was produced by the export function: +AASPE / File / Export / Export predefined concepts + +## Programmers note + +As many (!) classes and attributes are declared, these classes seem contribute +significantly to the loading time of AASPE in general. Basically, these classes +seem to be loaded on demand by the class loader. + +However, when using "Add predefined .." button in References dialogue, the user +has to wait some 8sec for the first results, as *ALL* classes are firstly +instantiated for this scan. + +## Concept model + +(Deprecated) approach to provide a switcher between different sets of concepts, +here for some ZVEI models. + +## Convert + +Classes used to allow (automatic) converting between different versions of +Submodels. Useful to define, when a large user basis is known to use an old +version of a Submodel. + +## Definitions and Resources + +Classes providing `CD_xxx` references having constant semanticId in it. + +In newer versions of these files, a reflection approach stores the full +ConceptDescriptions (CDs) in the Resource JSON files and the source code +links against it. + +This is the *preferred approach* to realize predefined data for the AASPE, +as many functions ("Add predefined ..", "New Submodel ..") can use these +data automatically. + +In order the be properly linked, the classes need to be listed in +`DefinitionsPool.cs`. + +Note: It is recommended, to *NOT* include all symbols by +`using AasxPredefinedConcepts`, but to refer to specific classes. + +Note: For the sake of shorter source code symbols, the classes in the +`DefinitionsXXX` are cut to `XXX` because preferable preceded by +`AasxPredefinedConcepts.`. + +## Mapping + +These classes support an automatic mapping of Submodel structures +to C# class hierarchies. These classes are 1:1 mapping of the +SMT structure and contain C# attributes with explicit semanticIds +to allow functionality of `PredefinedConceptsClassMapper.cs`. + +## Qualifers + +These classes pre-define names, semanticIds and functions for +handling `Qualifiers`. \ No newline at end of file