Skip to content

Commit

Permalink
Merge branch 'main' into mf/dep
Browse files Browse the repository at this point in the history
  • Loading branch information
martafullen authored Sep 2, 2024
2 parents 90e151b + 877397b commit 3a45ce0
Show file tree
Hide file tree
Showing 443 changed files with 32,913 additions and 33,799 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* core.autocrlf=true

*.cs text eol=crlf
.xaml diff
.xaml diff
Binary file removed .vs/AASXPackageExplorer/v17/.wsuo
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
> Current development of AASX Package Explorer only supports AAS V3.
> If you need to view AAS V2 files, see the branch [here](https://github.com/eclipse-aaspe/aaspe/tree/V2).
# Eclipse AASX Package Explorer
# Eclipse AASX Package Explorer

![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/eclipse-aaspe/package-explorer/total)
[![Contributors](https://img.shields.io/github/contributors/eclipse-aaspe/package-explorer)](https://github.com/badges/eclipse-aaspe/package-explorer/contributors)
Expand All @@ -23,7 +23,7 @@
[![Release](https://img.shields.io/github/v/release/eclipse-aaspe/package-explorer?include_prereleases)](https://github.com/eclipse-aaspe/package-explorer/releases)
[![Status](https://img.shields.io/github/checks-status/eclipse-aaspe/package-explorer/v2024-05-08.alpha)]()

Eclipse AASX Package Explorer is a C# based viewer and editor for the
Eclipse AASX Package Explorer is a C# based viewer and editor for the
Asset Administration Shell.

![screenshot](screenshot.png)
Expand Down
21 changes: 11 additions & 10 deletions src/AasxAmlImExport/AmlExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This source code may use other Open Source software components (see LICENSE.txt)
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
using Aas = AasCore.Aas3_0;

namespace AasxAmlImExport
{
Expand Down Expand Up @@ -313,7 +314,7 @@ private static void SetQualifiers(
}

private static void ExportReferenceWithSme(
AasCore.Aas3_0.Environment env,
Aas.IEnvironment env,
List<AmlInternalLinkEntity> internalLinksToCreate,
InternalElementType ie,
IReferable referable,
Expand Down Expand Up @@ -376,7 +377,7 @@ private static void ExportReferenceWithSme(

private static void ExportListOfSme(
AasAmlMatcher matcher, List<AmlInternalLinkEntity> internalLinksToCreate,
SystemUnitClassType parent, AasCore.Aas3_0.Environment env,
SystemUnitClassType parent, Aas.IEnvironment env,
List<ISubmodelElement> wrappers, bool tryUseCompactProperties = false,
bool aasStyleAttributes = false, bool amlStyleAttributes = true)
{
Expand Down Expand Up @@ -647,7 +648,7 @@ private static void ExportListOfSme(
private static void ExportSubmodelIntoElement(
AasAmlMatcher matcher, List<AmlInternalLinkEntity> internalLinksToCreate,
SystemUnitClassType parent,
AasCore.Aas3_0.Environment env,
IEnvironment env,
ISubmodel sm,
bool tryUseCompactProperties = false,
bool exportShallow = false)
Expand Down Expand Up @@ -678,7 +679,7 @@ private static void ExportSubmodelIntoElement(
private static InternalElementType ExportSubmodel(
AasAmlMatcher matcher,
List<AmlInternalLinkEntity> internalLinksToCreate, InternalElementSequence ieseq,
AasCore.Aas3_0.Environment env,
Aas.IEnvironment env,
ISubmodel sm,
bool tryUseCompactProperties = false,
bool exportShallow = false)
Expand All @@ -698,7 +699,7 @@ private static InternalElementType ExportSubmodel(
}

private static void ExportAsset(
InternalElementSequence ieseq, AasCore.Aas3_0.Environment env, IAssetInformation asset)
InternalElementSequence ieseq, Aas.IEnvironment env, Aas.IAssetInformation asset)
{
if (ieseq == null || env == null || asset == null)
return;
Expand Down Expand Up @@ -776,7 +777,7 @@ private static void ExportAsset(
// dead-csharp on
private static void ExportAAS(
AasAmlMatcher matcher, InstanceHierarchyType insthier, SystemUnitClassLibType suchier,
AasCore.Aas3_0.Environment env, IAssetAdministrationShell aas,
IEnvironment env, IAssetAdministrationShell aas,
bool tryUseCompactProperties = false)
{
// access
Expand Down Expand Up @@ -816,7 +817,7 @@ private static void ExportAAS(
//
// Submodels can be of kind Type/ Instance
//
foreach (var smref in aas.Submodels)
foreach (var smref in aas.AllSubmodels())
{
// ref -> Submodel
var sm = env.FindSubmodel(smref);
Expand Down Expand Up @@ -1026,14 +1027,14 @@ private static void SetAttributesForConceptDescription(


private static void ExportConceptDescriptionsWithExtraContentToIHT(
InstanceHierarchyType lib, AasCore.Aas3_0.Environment env)
InstanceHierarchyType lib, Aas.IEnvironment env)
{
// acceess
if (lib == null || env == null)
return;

// over CDs
foreach (var cd in env.ConceptDescriptions)
foreach (var cd in env.AllConceptDescriptions())
{
// make IE for CD itself (outer IE)
string name = "TODO-CD";
Expand Down Expand Up @@ -1164,7 +1165,7 @@ public static bool ExportTo(AdminShellPackageEnv package, string amlfn, bool try
var matcher = new AasAmlMatcher();

// over all AAS
foreach (var aas in package.AasEnv.AssetAdministrationShells)
foreach (var aas in package.AasEnv.AllAssetAdministrationShells())
{
ExportAAS(matcher, insthier, suchier, package.AasEnv, aas, tryUseCompactProperties);
}
Expand Down
30 changes: 9 additions & 21 deletions src/AasxAmlImExport/AmlImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ public void ParseInternalElementsForAasEntities(
Debug(indentation, " AAS with required attributes recognised. Starting new AAS..");

// make temporary object official
this.package.AasEnv.AssetAdministrationShells.Add(aas);
this.package.AasEnv.Add(aas);
currentAas = aas;
matcher.AddMatch(aas, ie);
}
Expand Down Expand Up @@ -1173,12 +1173,8 @@ public void ParseInternalElementsForAasEntities(
// Remark: add only, if not a SM with the same ID is existing. This could have the
// consequences that additional properties in the 2nd SM with the same SM get lost!
if (null == this.package.AasEnv.FindSubmodelById(sm.Id))
this.package.AasEnv.Submodels.Add(sm);
if (currentAas.Submodels == null)
{
currentAas.Submodels = new List<IReference>();
}
currentAas.Submodels.Add(sm.GetReference());
this.package.AasEnv.Add(sm);
currentAas.Add(sm.GetReference());
currentSmeCollection = sm;
}
else
Expand All @@ -1195,13 +1191,9 @@ public void ParseInternalElementsForAasEntities(
{
// try use Identification to find existing Submodel
var existSm = package.AasEnv.FindSubmodelById(targetSm.Id);
if (currentAas.Submodels == null)
{
currentAas.Submodels = new List<IReference>();
}

// if so, add a SubmodelRef
currentAas.Submodels.Add(existSm.GetReference());
currentAas.Add(existSm.GetReference());
}
}

Expand Down Expand Up @@ -1448,7 +1440,7 @@ public void ParseSystemUnits(
aas = existAas;
else
// add
this.package.AasEnv.AssetAdministrationShells.Add(aas);
this.package.AasEnv.Add(aas);

// remember
currentAas = aas;
Expand Down Expand Up @@ -1481,12 +1473,8 @@ public void ParseSystemUnits(
currentSubmodel = sm;

// this will be the parent for child elements
this.package.AasEnv.Submodels.Add(sm);
if (currentAas.Submodels == null)
{
currentAas.Submodels = new List<IReference>();
}
currentAas.Submodels.Add(sm.GetReference());
this.package.AasEnv.Add(sm);
currentAas.Add(sm.GetReference());
currentSmeCollection = sm;
}
else
Expand Down Expand Up @@ -1530,7 +1518,7 @@ public void ParseIEsForConceptDescriptions(
{
// add
Debug(indentation, " .. added as {0}", cd.Id);
this.package.AasEnv.ConceptDescriptions.Add(cd);
this.package.AasEnv.Add(cd);

// look for direct descendants = Data Specifcations
if (ie.InternalElement != null)
Expand Down Expand Up @@ -1671,7 +1659,7 @@ public static void ImportInto(AdminShellPackageEnv package, string amlfn)
parser.ParseSystemUnits(x.SystemUnitClass);

// the following steps will require valid parent information
foreach (var sm in package.AasEnv.Submodels)
foreach (var sm in package.AasEnv.AllSubmodels())
sm.SetAllParents();

// do the late population of views
Expand Down
2 changes: 1 addition & 1 deletion src/AasxBammRdfImExport/AasxBammRdfImExport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="dotNetRDF" Version="2.7.5" />
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" />
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/AasxBammRdfImExport/RDFimport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class BAMMRDFimport
public static AdminShellNS.AdminShellPackageEnv thePackageEnv;

public static void ImportInto(
string rdffn, Aas.Environment env, Aas.ISubmodel sm,
string rdffn, Aas.IEnvironment env, Aas.ISubmodel sm,
Aas.Reference smref)
{
thePackageEnv = new AdminShellNS.AdminShellPackageEnv();
Expand Down Expand Up @@ -75,7 +75,7 @@ public static void ImportInto(

var msemanticID = ExtendReference.CreateFromKey(Aas.KeyTypes.GlobalReference, t.Subject.ToString());
sm.SemanticId = msemanticID;
thePackageEnv.AasEnv.Submodels.Add(sm);
thePackageEnv.AasEnv.Add(sm);
}
}

Expand Down Expand Up @@ -373,7 +373,7 @@ public static void ImportInto(

{
var cd = new Aas.ConceptDescription(idShort: property_Name, id: semantic);
env.ConceptDescriptions.Add(cd);
env.Add(cd);
cd.SetIEC61360Spec(
preferredNames: new[] { "EN", property_PreferredName },
shortName: null,
Expand Down Expand Up @@ -445,7 +445,7 @@ public static void ImportInto(

{
var cd = new Aas.ConceptDescription(idShort: "" + name, id: semantic);
env.ConceptDescriptions.Add(cd);
env.Add(cd);
cd.SetIEC61360Spec(
preferredNames: new[] { "EN", preferred_name },
shortName: null,
Expand Down
17 changes: 17 additions & 0 deletions src/AasxCore.Samm2_2_0/AasxCore.Samm2_2_0.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>AasCore.Samm</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AasCore.Aas3_0\AasCore.Aas3_0.csproj" />
<ProjectReference Include="..\AasxCsharpLibrary\AasxCsharpLibrary.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 3a45ce0

Please sign in to comment.