Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • PyI40AAS PyI40AAS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Lehrstuhl für Informations- und AutomatisierungssystemeLehrstuhl für Informations- und Automatisierungssysteme
  • PyI40AASPyI40AAS
  • Merge requests
  • !81

model.base: add method for adding objects to namespaces

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Leon Mauritz Möller requested to merge feature/namespace_add_objects into improve/V30RC01 Jul 31, 2021
  • Overview 1
  • Commits 2
  • Pipelines 3
  • Changes 3

This MR implements this feature by adding a method to each relevant namespace, that iterates over the respective NamespaceSets and adds the object to the first NamespaceSet with a matching attribute_name, such as id_short, type or name.

The SubmodelElement collections SubmodelElementCollectionOrderedUniqueSemanticId and SubmodelElementCollectionUnorderedUniqueSemanticId both inherit from SubmodelElementCollectionOrdered and SubmodelElementCollectionUnordered respectively. Both __init__ methods call super().__init__ (e.g. SubmodelElementCollectionOrdered.__init__), which creates a NamespaceSet for self.value. self.value is then overwritten by a new NamespaceSet for the unique semantic_id functionality, leaving an unused NamespaceSet in self.namespace_element_sets.

The functionality implemented in this MR would add new Referable objects to the first NamespaceSet in self.namespace_element_sets, that has id_short in its attribute_name_list. For the SubmodelElementCollections with a UniqueSemanticId namespace, this would be the unused NamespaceSet. Thus, this unused NamespaceSet has to be removed first in the respective __init__ function.

Alongside, this MR also fixes some docstrings and shortens some code.

Edited Jul 31, 2021 by Leon Mauritz Möller
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/namespace_add_objects