Skip to content

Commit

Permalink
Instantiate Submodel List
Browse files Browse the repository at this point in the history
  • Loading branch information
juileetikekar committed Aug 13, 2024
1 parent bdcc80b commit f6427f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AasxPackageLogic/DispEditHelperEntities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ public void DisplayOrEditAasEntityAasEnv(
{
// new
var asset = itsm.Copy();
env.Submodels ??= new List<ISubmodel>();
env.Submodels.Add(itsm);
this.AddDiaryEntry(itsm, new DiaryEntryStructChange(
StructuralChangeReason.Create));
Expand Down Expand Up @@ -1251,6 +1252,7 @@ public void DisplayOrEditAasEntityAas(
if (item?.smref == null)
return null;
aas.Submodels ??= new List<IReference>();
// duplicate
foreach (var x in aas.Submodels)
if (x?.Matches(item.smref, MatchMode.Identification) == true)
Expand Down Expand Up @@ -1327,6 +1329,7 @@ public void DisplayOrEditAasEntityAas(
// create ref
//var smr = new Aas.Reference(Aas.ReferenceTypes.ExternalReference, new List<Aas.IKey>(ks));
var smr = new Aas.Reference(Aas.ReferenceTypes.ModelReference, new List<Aas.IKey>(ks));
aas.Submodels ??= new List<IReference>();
aas.Submodels.Add(smr);
// event for AAS
Expand Down

0 comments on commit f6427f2

Please sign in to comment.