diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8307775..16913ff 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,11 +1,12 @@ -# Copyright DB InfraGO AG and contributors +# SPDX-FileCopyrightText: Copyright DB InfraGO AG # SPDX-License-Identifier: CC0-1.0 name: Docs on: + workflow_dispatch: push: - branches: ["master"] + branches: [master] jobs: sphinx: @@ -13,25 +14,36 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: "3.10" + cache: pip + cache-dependency-path: pyproject.toml + python-version: "3.12" - name: Upgrade pip - run: | - python -m pip install -U pip + run: python -m pip install -U pip - name: Install dependencies run: | + sudo apt-get install -y pandoc python -m pip install '.[docs]' - name: Auto-generate APIDOC sources - run: |- - sphinx-apidoc --output-dir docs/source/code --force . + run: make -C docs apidoc - name: Create docs - run: | - make -C docs html + run: make -C docs html + - name: Archive the docs + # https://github.com/actions/upload-artifact#too-many-uploads-resulting-in-429-responses + run: (cd docs/build/html && zip -Xr ../html.zip .) + - name: Upload built docs as artifact + uses: actions/upload-artifact@v3 + with: + name: Documentation + path: docs/build/html.zip + if-no-files-found: error + retention-days: 5 - name: Deploy + if: github.ref == 'refs/heads/master' uses: peaceiris/actions-gh-pages@v3 with: force_orphan: true diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index b2e01b9..0000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: CC0-1.0 - -[submodule "common_interfaces"] - path = capella_ros_tools/msg_to_capella/ros_interfaces/common_interfaces - url = https://github.com/ros2/common_interfaces.git -[submodule "rcl_interfaces"] - path = capella_ros_tools/msg_to_capella/ros_interfaces/rcl_interfaces - url = https://github.com/ros2/rcl_interfaces.git diff --git a/LICENSES/.license_header.txt b/LICENSES/.license_header.txt index dfb50dd..02c8c23 100644 --- a/LICENSES/.license_header.txt +++ b/LICENSES/.license_header.txt @@ -1,6 +1,2 @@ -<<<<<<< HEAD -Copyright DB Netz AG and contributors -======= Copyright DB InfraGO AG and contributors ->>>>>>> 40ef464 (feat: Make tree view draggable) SPDX-License-Identifier: Apache-2.0 diff --git a/capella_ros_tools/capella2msg.py b/capella_ros_tools/capella2msg.py deleted file mode 100644 index f176d9a..0000000 --- a/capella_ros_tools/capella2msg.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""CLI for importing .msg to capella model.""" -import sys -from pathlib import Path - -import click - -import capella_ros_tools -from capella_ros_tools.modules import BASIC_TYPES, ROS_INTERFACES -from capella_ros_tools.modules.parse_capella import ParseCapella -from capella_ros_tools.modules.serialize_message import ( - SerializeMessageDef, - SerializeMessagesPkg, -) - - -class Capella2Msg: - """Class for converting capella model to .msg files.""" - - def __init__(self, path_to_capella_model, layer, overlap) -> None: - self.parser = ParseCapella(path_to_capella_model, layer) - self.overlap = overlap - - def add_package(self, current_root): - """Add package to message package.""" - out = SerializeMessagesPkg({}, {}) - - messages = self.parser.get_classes(current_root) - types = self.parser.get_types(current_root) - - out.messages = { - msg_name: SerializeMessageDef(msg_name, desc, props) - for msg_name, (desc, props) in (messages | types).items() - } - out.packages = { - pkg_name: self.add_package(current_root.packages.by_name(pkg_name)) - for pkg_name in self.parser.get_packages(current_root) - } - return out - - -@click.command() -@click.version_option( - version=capella_ros_tools.__version__, - prog_name="capella-ros-tools", - message="%(prog)s %(version)s", -) -@click.argument( - "path-to-msgs-root", - type=click.Path( - file_okay=False, - readable=True, - resolve_path=True, - path_type=Path, - ), - required=True, -) -@click.argument( - "path-to-capella-model", - type=click.Path( - exists=True, - readable=True, - resolve_path=True, - path_type=str, - ), - required=True, -) -@click.argument( - "layer", - type=click.Choice(["oa", "sa", "la", "pa"], case_sensitive=False), - required=True, -) -@click.option( - "-o", - "--overlap", - type=click.Choice( - ["keep", "overwrite", "ask", "abort"], case_sensitive=False - ), - default="ask" if sys.stdin.isatty() else "abort", -) -@click.option("--debug", is_flag=True) -def capella2msg( - path_to_msgs_root, path_to_capella_model, layer, overlap, debug -): - """Convert capella model to .msg files.""" - converter = Capella2Msg(path_to_capella_model, layer, overlap) - current_root = converter.parser.data - - messages = converter.parser.get_classes(current_root) - types = converter.parser.get_types(current_root) - - packages = converter.parser.get_packages(current_root) - packages.discard(BASIC_TYPES) - packages.discard(ROS_INTERFACES) - - root = SerializeMessagesPkg({}, {}) - root.messages = { - msg_name: SerializeMessageDef(msg_name, desc, props) - for msg_name, (desc, props) in (messages | types).items() - } - - root.packages = { - pkg_name: converter.add_package( - current_root.packages.by_name(pkg_name) - ) - for pkg_name in packages - } - - if debug: - click.echo(root) - else: - root.to_msg_folder(path_to_msgs_root) diff --git a/capella_ros_tools/display/__init__.py b/capella_ros_tools/display/__init__.py deleted file mode 100644 index 317c020..0000000 --- a/capella_ros_tools/display/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""Module for displaying data from the Capella ROS Tools.""" diff --git a/capella_ros_tools/display/app.py b/capella_ros_tools/display/app.py deleted file mode 100644 index c2ad343..0000000 --- a/capella_ros_tools/display/app.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""FastAPI app for displaying Capella model.""" -import typing as t -from pathlib import Path - -import uvicorn -from fastapi import FastAPI, Request -from fastapi.responses import HTMLResponse -from fastapi.staticfiles import StaticFiles -from fastapi.templating import Jinja2Templates - -PATH = Path(__file__).parent - - -app = FastAPI(title="Capella ROS Tools") -app.mount( - "/static", StaticFiles(directory=PATH.joinpath("static")), name="static" -) -templates = Jinja2Templates(directory=PATH.joinpath("templates")) - - -def get_type(xtype: str) -> str: - """Get type from xtype.""" - return xtype.rpartition(":")[2] - - -templates.env.globals.update(get_type=get_type) - - -@app.get("/", response_class=HTMLResponse) -def root(request: Request): - """Root page.""" - element = app.state.data_package - context = { - "request": request, - "element": element, - "get_type": get_type, - } - response = templates.TemplateResponse("package.html", context) - return response - - -@app.get("/{type}/{uuid}", response_class=HTMLResponse) -def view(request: Request, type: str, uuid: str): - """View page.""" - element = app.state.model.by_uuid(uuid) - template = type + ".html" - - context = { - "request": request, - "element": element, - "get_type": get_type, - } - response = templates.TemplateResponse(template, context) - return response - - -def start(model: t.Any, layer: str, port: int = 5000): - """Start the app.""" "" - app.state.model = model - app.state.data_package = getattr(model, layer).data_package - uvicorn.run( - app, - host="0.0.0.0", - port=port, - ) diff --git a/capella_ros_tools/display/static/icons/favicon.ico b/capella_ros_tools/display/static/icons/favicon.ico deleted file mode 100644 index a0c9c57..0000000 Binary files a/capella_ros_tools/display/static/icons/favicon.ico and /dev/null differ diff --git a/capella_ros_tools/display/static/icons/favicon.ico.license b/capella_ros_tools/display/static/icons/favicon.ico.license deleted file mode 100644 index 95e8b6e..0000000 --- a/capella_ros_tools/display/static/icons/favicon.ico.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/capella_ros_tools/display/static/styles.css b/capella_ros_tools/display/static/styles.css deleted file mode 100644 index cfaca88..0000000 --- a/capella_ros_tools/display/static/styles.css +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright DB Netz AG and contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -/* color palette from */ -:root { - --vt-c-white: #ffffff; - --vt-c-white-soft: #f8f8f8; - --vt-c-white-mute: #f2f2f2; - - --vt-c-indigo: #2c3e50; - - --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); - --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); - - --vt-c-text-light-1: var(--vt-c-indigo); - --vt-c-text-light-2: rgba(60, 60, 60, 0.66); - --pink: #ffaccd; - --pink-dark: rgb(255, 0, 153); -} - -/* semantic color variables for this project */ -:root { - --color-background: var(--vt-c-white); - --color-background-soft: var(--vt-c-white-soft); - --color-background-mute: var(--vt-c-white-mute); - - --color-border: var(--vt-c-divider-light-2); - --color-border-hover: var(--vt-c-divider-light-1); - - --color-heading: var(--vt-c-text-light-1); - --color-text: var(--vt-c-text-light-1); - - --color-accent: var(--pink); - --color-accent-hover: var(--pink-dark); - - --section-gap: 160px; -} - -*, -*::before, -*::after { - box-sizing: border-box; - margin: 0; - font-weight: normal; -} - -html, -body { - width: 100vw; - height: 100vh; - margin: 0; - padding: 0; -} - -body { - display: flex; - flex-direction: row; - color: var(--color-text); - background: var(--color-background-soft); - line-height: 1.6; - font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", - sans-serif; - font-size: 15px; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a { - color: inherit; - text-decoration: none; - border-bottom: 3px solid var(--color-accent); -} - -a:hover { - border-bottom-color: var(--color-accent-hover); -} - -span { - white-space: pre-wrap; - display: inline-flex; - opacity: 0.75; -} - -strong { - font-weight: 500; -} - -main { - padding: 0.5rem 1rem; -} - -main, -aside { - max-height: 100%; - overflow-y: auto; - flex: 1; - display: flex; - flex-direction: column; -} - -aside { - background-color: white; -} - -aside > div { - height: 100%; - width: 100%; -} - -table { - border-spacing: 0 1.5rem; -} -tr > td:first-child { - font-weight: bold; - text-align: right; - padding-right: 2rem; - white-space: nowrap; - width: 1%; -} - -tr > td:last-child { - text-align: left; -} - -ol { - padding: 0; - counter-reset: list; -} -ol > li { - list-style: none; - display: flex; -} -ol > li:before { - content: "[" counter(list) "] "; - counter-increment: list; - margin-right: 0.5em; -} - -::-webkit-scrollbar { - display: none; -} - -/* Media query for landscape mode */ -@media screen and (orientation: portrait) { - body { - display: flex; - flex-direction: column; - } -} diff --git a/capella_ros_tools/display/templates/class.html b/capella_ros_tools/display/templates/class.html deleted file mode 100644 index f22e83b..0000000 --- a/capella_ros_tools/display/templates/class.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - {{ element.name }} - Overview - - - - -
-

- {{ element.name }} - ({{ element.xtype }}) -

- - - - - - - - - - - - - - - - - -
uuid{{ element.uuid }}
parent{{ element.parent._short_html_() }}
description - {{ element.description }} -
properties -
    - {% for prop in element.properties %} -
  1. -

    - Property "{{ prop.name - }}": {{prop.type.name}} - {{ prop.description }} -

    -
  2. - {% endfor %} -
-
-
- - - diff --git a/capella_ros_tools/display/templates/enum.html b/capella_ros_tools/display/templates/enum.html deleted file mode 100644 index a3c218e..0000000 --- a/capella_ros_tools/display/templates/enum.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - {{ element.name }} - Overview - - - - -
-

- {{ element.name }} - ({{ element.xtype }}) -

- - - - - - - - - - - - - - - - - -
uuid{{ element.uuid }}
parent{{ element.parent._short_html_() }}
description - {{ element.description }} -
literals -
    - {% for lit in element.literals %} -
  1. - EnumerationLiteral "{{ - lit.name }}": {{lit.value.type.name}} = - {{lit.value.value}} -
  2. - {% endfor %} -
-
-
- - diff --git a/capella_ros_tools/display/templates/package.html b/capella_ros_tools/display/templates/package.html deleted file mode 100644 index 9850811..0000000 --- a/capella_ros_tools/display/templates/package.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - {{ element.name }} - Overview - - - -
-

- {{ element.name }} - ({{ element.xtype }}) -

- - - - - - - - - - - - - - - - - - - - - - - - - -
uuid{{ element.uuid }}
parent{{ element.parent._short_html_() }}
classes -
    - {% for cls in element.classes %} -
  1. - {{ cls._short_html_() }} -
  2. - {% endfor %} -
-
datatypes -
    - {% for datatype in element.datatypes %} {% if - get_type(datatype.xtype) != 'Enumeration' %} -
  1. - {{ datatype._short_html_() }} -
  2. - {% endif %} {% endfor %} -
-
enumeration -
    - {% for enum in element.enumerations %} -
  1. - {{ enum._short_html_() }} -
  2. - {% endfor %} -
-
packages -
    - {% for pkg in element.packages %} -
  1. - {{ pkg._short_html_() }} -
  2. - {% endfor %} -
-
-
- - diff --git a/capella_ros_tools/modules/parse_capella.py b/capella_ros_tools/modules/parse_capella.py deleted file mode 100644 index ba24f27..0000000 --- a/capella_ros_tools/modules/parse_capella.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""Class definition for Capella model parser.""" -import typing as t - -from . import ROS_INTERFACES, BaseCapella, EnumProp, MsgProp - - -class ParseCapella(BaseCapella): - """Parser for Capella model.""" - - def get_packages(self, package: t.Any) -> set[str]: - """Get packages in Capella model.""" - return {pkg.name for pkg in package.packages} - - def get_classes(self, package: t.Any) -> dict[str, t.Any]: - """Get classes in Capella model.""" - classes: dict = {} - for cls in package.classes: - props = [] - for prop in cls.owned_properties: - type = ( - prop.type.name - if prop.type.__class__.__name__ != "Enumeration" - else "uint8" - ) - typedir = ( - prop.type.parent.name - if prop.type.parent.parent.name == ROS_INTERFACES - else "" - ) - props.append( - MsgProp( - prop.name, - type, - typedir, - prop.min_card.value, - prop.max_card.value, - prop.description, - ) - ) - classes[cls.name] = (cls.description, props) - return classes - - def get_types(self, package: t.Any) -> dict[str, t.Any]: - """Get types in Capella model.""" - types: dict = {} - for type in package.datatypes: - props = [ - EnumProp( - prop.name, - prop.value.type.name if prop.value.type else "uint8", - prop.value.value, - prop.description, - ) - for prop in type.owned_literals - ] - types[type.name] = (type.description, props) - return types diff --git a/capella_ros_tools/modules/parse_message.py b/capella_ros_tools/modules/parse_message.py deleted file mode 100644 index 4cf607e..0000000 --- a/capella_ros_tools/modules/parse_message.py +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""Parser for ROS messages.""" -import os -import re -from pathlib import Path - -from . import EnumProp, MessageDef, MessagesPkg, MsgProp - -RE_TNC = re.compile(r"^([A-Za-z0-9\[\]\/_]+)\s+(\w+)(?:\s+#\s*(.+))?$") -RE_ENUM = re.compile(r"^(\w+)\s+(\w+)\s*=\s*(\d+)\s*(?:#\s*(.+))?$") -RE_COMMENT = re.compile(r"cf.\s+(\w+)(?:,\s+(\w+))?") - - -class ParseMessageDef(MessageDef): - """Parser for message files.""" - - @property - def as_struct(self) -> tuple: - """Return message definition as struct.""" - return (self.description, self.props) - - @classmethod - def from_msg_file(cls, file: Path) -> list: - """Create message definition from message file.""" - raw_msg = file.read_text() - lines = raw_msg.split("\n") - for i, line in enumerate(lines): - if not line.startswith("#"): - break - else: - i = 0 - description = "\n".join(l.lstrip("#").strip() for l in lines[:i]) - props = [] - for line in lines[i:]: - for prop_type_raw, prop_name, comment in RE_TNC.findall(line): - p = prop_type_raw.split("[", 1) - min_card = "0" if len(p) > 1 else "1" - max_card = p[1].replace("]", "") if len(p) > 1 else "1" - match = RE_COMMENT.search(comment) - filename, commonprefix = ( - match.groups() if match else (None, None) - ) - type_path = list(p[0].split("/", 1)) - if commonprefix: - prop_type = re.sub("_XXX$", "", commonprefix) - else: - prop_type = filename if filename else type_path[-1] - type_pkg = type_path[0] if len(type_path) > 1 else "" - props.append( - MsgProp( - prop_name, - prop_type, - type_pkg, - min_card, - max_card, - comment, - ) - ) - - return [cls(file.stem, description, props)] - - @classmethod - def from_type_file(cls, file: Path) -> list: - """Create message definition from type file.""" - raw_msg = file.read_text() - lines = raw_msg.split("\n") - for i, line in enumerate(lines): - if not line.startswith("#"): - break - else: - i = 0 - description = "\n".join(l.lstrip("#").strip() for l in lines[:i]) - blocks = "\n".join(lines[i:]).split("\n\n") - out = [] - for block in blocks: - lines = block.split("\n") - props = [ - (n, t, v, c) - for line in lines - for (t, n, v, c) in RE_ENUM.findall(line) - ] - if not props: - continue - commonprefix = os.path.commonprefix([prop[0] for prop in props]) - name = commonprefix.rpartition("_")[0] - props = [ - EnumProp(prop[0].replace(commonprefix, ""), *prop[1:]) - for prop in props - ] - out.append(cls(name, description, props)) - return out - - -class ParseMessagesPkg(MessagesPkg): - """Parse messages package.""" - - @property - def as_structs(self) -> tuple: - """Return package as structs.""" - messages = {k: v.as_struct for k, v in self.messages.items()} - packages = {k: v.as_structs for k, v in self.packages.items()} - return (messages, packages) - - @classmethod - def from_msg_folder(cls, path_to_pkg_root: Path): - """Create package package from message folder.""" - out = cls({}, {}) - func = ( - ParseMessageDef.from_type_file - if "types" in path_to_pkg_root.parts - else ParseMessageDef.from_msg_file - ) - for f in path_to_pkg_root.iterdir(): - if f.name.endswith(".msg"): - msg = func(f) - for m in msg: - out.messages[m.name] = m - elif f.is_dir(): - out.packages[f.name] = cls.from_msg_folder(f) - - return out - - @classmethod - def from_pkg_folders(cls, path_to_root: Path): - """Create package from package folder.""" - out = cls({}, {}) - for dir in path_to_root.rglob("msg/"): - out.packages[dir.parent.name] = ParseMessagesPkg.from_msg_folder( - dir - ) - return out diff --git a/capella_ros_tools/modules/serialize_capella.py b/capella_ros_tools/modules/serialize_capella.py deleted file mode 100644 index 73d20ba..0000000 --- a/capella_ros_tools/modules/serialize_capella.py +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""Class definition for Capella model serializer.""" -import typing as t - -import capellambse - -from . import BASIC_TYPES, ROS_INTERFACES, BaseCapella, MsgProp - - -class SerializeCapella(BaseCapella): - """Serializer for Capella model.""" - - def __init__(self, path_to_capella_model: str, layer: str) -> None: - super().__init__(path_to_capella_model, layer) - self.create_packages({BASIC_TYPES}, self.data) - self.basic_types = self.data.packages.by_name(BASIC_TYPES) - - def create_packages(self, packages: set[str], package: t.Any) -> None: - """Create packages in Capella model.""" - for package_name in packages: - try: - package.packages.by_name(package_name) - except KeyError: - package.packages.create("DataPkg", name=package_name) - - def create_classes( - self, - classes: dict[str, tuple[str, list]], - package: t.Any, - ) -> list: - """Create classes in Capella model.""" - overlap = [] - for class_name, info in classes.items(): - try: - overlap.append(package.classes.by_name(class_name)) - except KeyError: - description, _ = info - package.classes.create( - name=class_name, description=description - ) - return overlap - - def delete_classes(self, classes: list, package: t.Any) -> None: - """Delete classes in Capella model.""" - for cls in classes: - try: - package.classes.remove(cls) - except KeyError: - pass - - def create_types( - self, types: dict[str, tuple[str, list]], package: t.Any - ) -> list: - """Create types in Capella model.""" - overlap = [] - for type_name, info in types.items(): - try: - overlap.append(package.datatypes.by_name(type_name)) - except KeyError: - description, properties = info - type = package.datatypes.create( - "Enumeration", name=type_name, description=description - ) - for prop in properties: - property = type.owned_literals.create( - "EnumerationLiteral", - name=prop.name, - description=prop.comment, - ) - self.create_basic_types({prop.type}) - property.value = capellambse.new_object( - "LiteralNumericValue", - value=float(prop.value), - type=self.basic_types.datatypes.by_name(prop.type), - ) - return overlap - - def delete_types(self, types: list, package: t.Any) -> None: - """Delete types in Capella model.""" - for type in types: - try: - package.datatypes.remove(type) - except KeyError: - pass - - def create_basic_types(self, basic_types: set[str]) -> list: - """Create basic types in Capella model.""" - overlap = [] - for basic_type in basic_types: - try: - overlap.append(self.basic_types.datatypes.by_name(basic_type)) - except KeyError: - if basic_type in ["string", "char"]: - type = "StringType" - elif basic_type == "bool": - type = "BooleanType" - else: - type = "NumericType" - self.basic_types.datatypes.create(type, name=basic_type) - return overlap - - def create_composition( - self, - class_name: str, - prop: MsgProp, - package: t.Any, - ) -> bool: - """Create composition in Capella model.""" - superclass = package.classes.by_name(class_name) - try: - partclass = ( - ( - self.data.packages.by_name(ROS_INTERFACES) - .packages.by_name(prop.typedir) - .classes.by_name(prop.type) - ) - if prop.typedir - else self.model.search("Class", below=package).by_name( - prop.type - ) - ) - except KeyError: - return False - try: - p = superclass.owned_properties.by_name(prop.name) - superclass.owned_properties.remove(p) - except KeyError: - pass - composition = superclass.owned_properties.create( - name=prop.name, - type=partclass, - kind="COMPOSITION", - description=prop.comment, - ) - association = package.owned_associations.create( - navigable_members=[composition] - ) - association.members.create( - "Property", - type=superclass, - kind="ASSOCIATION", - min_card=capellambse.new_object("LiteralNumericValue", value=1), - max_card=capellambse.new_object("LiteralNumericValue", value=1), - ) - composition.min_card = capellambse.new_object( - "LiteralNumericValue", value=float(prop.min) - ) - composition.max_card = capellambse.new_object( - "LiteralNumericValue", value=float(prop.max or "inf") - ) - return True - - def _find_type(self, type_name: str, package: t.Any) -> t.Any: - """Find type in Capella model.""" - try: - return self.model.search("Enumeration", below=package).by_name( - type_name - ) - except KeyError: - pass - try: - return self.basic_types.datatypes.by_name(type_name) - except KeyError: - self.create_basic_types({type_name}) - return self.basic_types.datatypes.by_name(type_name) - - def create_attribute( - self, - class_name: str, - prop: MsgProp, - package: t.Any, - ) -> None: - """Create attribute in Capella model.""" - superclass = package.classes.by_name(class_name) - property_type = self._find_type(prop.type, package) - try: - p = superclass.owned_properties.by_name(prop.name) - superclass.owned_properties.remove(p) - except KeyError: - pass - attribute = superclass.owned_properties.create( - name=prop.name, - type=property_type, - kind="COMPOSITION", - description=prop.comment, - ) - attribute.min_card = capellambse.new_object( - "LiteralNumericValue", value=float(prop.min) - ) - attribute.max_card = capellambse.new_object( - "LiteralNumericValue", value=float(prop.max or "inf") - ) - - def save_changes(self) -> None: - """Save changes to Capella model.""" - self.model.save() diff --git a/capella_ros_tools/modules/serialize_message.py b/capella_ros_tools/modules/serialize_message.py deleted file mode 100644 index 177106e..0000000 --- a/capella_ros_tools/modules/serialize_message.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""Serializer for ROS messages.""" - -from pathlib import Path - -from . import MessageDef, MessagesPkg - - -class SerializeMessageDef(MessageDef): - """Serializer for message files.""" - - def to_msg_file(self, file: Path) -> None: - """Write message definition to message file.""" - description = "# " + self.description.replace("\n", "\n# ") + "\n" - props = "\n".join( - f"{p.typedir+'/' if p.typedir else ''}{p.type}" - f"{'[]' if p.min != p.max else ''} {p.name}\t" - f"{'# ' if p.comment else ''}{p.comment}" - for p in self.props - ) - file.write_text(description + "\n" + props) - - def to_type_file(self, file: Path) -> None: - """Write message definition to message file.""" - description = "# " + self.description.replace("\n", "\n# ") + "\n" - props = "\n".join( - f"{p.type} {file.stem + '_' + p.name}\t= {p.value}\t" - f"{'# ' if p.comment else ''}{p.comment}" - for p in self.props - ) - file.write_text(description + "\n" + props) - - -class SerializeMessagesPkg(MessagesPkg): - """Serializer for message packages.""" - - def to_msg_folder(self, path_to_pkg_root: Path) -> None: - """Write message package to message package.""" - path_to_pkg_root.mkdir(parents=True, exist_ok=True) - for msg_name, msg in self.messages.items(): - msg_file = path_to_pkg_root.joinpath(msg_name + ".msg") - if path_to_pkg_root.name == "types": - msg.to_type_file(msg_file) - else: - msg.to_msg_file(msg_file) - - for pkg_name, pkg in self.packages.items(): - new_path = path_to_pkg_root.joinpath(pkg_name) - new_path.mkdir(parents=True, exist_ok=True) - pkg.to_msg_folder(new_path) diff --git a/capella_ros_tools/msg2capella.py b/capella_ros_tools/msg2capella.py deleted file mode 100644 index 2d67ea9..0000000 --- a/capella_ros_tools/msg2capella.py +++ /dev/null @@ -1,165 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""CLI for importing .msg to capella model.""" -import sys -from pathlib import Path - -import click - -import capella_ros_tools -from capella_ros_tools.modules import ROS_INTERFACES -from capella_ros_tools.modules.parse_message import ParseMessagesPkg -from capella_ros_tools.modules.serialize_capella import SerializeCapella - -PATH = Path(__file__).parent - - -class Msg2Capella: - """Class for importing .msg to capella model.""" - - def __init__(self, path_to_capella_model, layer, overlap): - self.serializer = SerializeCapella(path_to_capella_model, layer) - self.overlap = overlap - - def add_objects(self, current_root_struct, current_root): - """Add objects to capella model.""" - messages = current_root_struct.messages - packages = current_root_struct.packages - - self.serializer.create_packages(set(packages.keys()), current_root) - - func = ( - (self.serializer.create_types, self.serializer.delete_types) - if current_root.name == "types" - else ( - self.serializer.create_classes, - self.serializer.delete_classes, - ) - ) - - overlap = func[0]( - {msg_name: msg.as_struct for msg_name, msg in messages.items()}, - current_root, - ) - - if overlap and self.overlap == "abort": - click.echo( - "Items already exist. Use --overlap=overwrite to overwrite." - ) - raise click.Abort() - for cls in overlap: - if self.overlap in ["ask", "overwrite"]: - if self.overlap == "ask": - confirm = click.prompt( - f"{cls.name} already exists. Do you want to overwrite?", - type=click.Choice( - ["y", "Y", "n", "N"], - case_sensitive=True, - ), - ) - match confirm: - case "n": - continue - case "N": - self.overlap = "keep" - case "Y": - self.overlap = "overwrite" - - func[1]([cls], current_root) - func[0]({cls.name: messages[cls.name].as_struct}, current_root) - - for pkg_name, pkg in packages.items(): - new_root = current_root.packages.by_name(pkg_name) - self.add_objects(pkg, new_root) - - def add_relations(self, current_root_struct, current_root): - """Add relations to capella model.""" - messages = current_root_struct.messages - packages = current_root_struct.packages - - if current_root.name == "types": - return - for class_name, cls in messages.items(): - for prop in cls.props: - if not self.serializer.create_composition( - class_name, prop, current_root - ): - self.serializer.create_attribute( - class_name, prop, current_root - ) - for pkg_name, pkg in packages.items(): - new_root = current_root.packages.by_name(pkg_name) - self.add_relations(pkg, new_root) - - -@click.command() -@click.version_option( - version=capella_ros_tools.__version__, - prog_name="capella-ros-tools", - message="%(prog)s %(version)s", -) -@click.argument( - "path-to-msgs-root", - type=click.Path( - exists=True, - file_okay=False, - readable=True, - resolve_path=True, - path_type=Path, - ), - required=True, -) -@click.argument( - "path-to-capella-model", - type=click.Path( - exists=True, - readable=True, - resolve_path=True, - path_type=str, - ), - required=True, -) -@click.argument( - "layer", - type=click.Choice(["oa", "sa", "la", "pa"], case_sensitive=False), - required=True, -) -@click.option( - "-o", - "--overlap", - type=click.Choice( - ["keep", "overwrite", "ask", "abort"], case_sensitive=False - ), - default="ask" if sys.stdin.isatty() else "abort", -) -@click.option("--debug", is_flag=True) -def msg2capella( - path_to_msgs_root: Path, - path_to_capella_model: str, - layer: str, - overlap: str, - debug: bool, -): - """Parse .msg files and import them to capella model.""" - - converter = Msg2Capella(path_to_capella_model, layer, "keep") - current_root = converter.serializer.data - - ros_interfaces = ParseMessagesPkg.from_pkg_folders( - PATH.joinpath("ros_interfaces") - ) - current_root_struct = ParseMessagesPkg( - {}, {ROS_INTERFACES: ros_interfaces} - ) - - converter.add_objects(current_root_struct, current_root) - - converter.overlap = overlap - current_root_struct = ParseMessagesPkg.from_pkg_folders(path_to_msgs_root) - converter.add_objects(current_root_struct, current_root) - converter.add_relations(current_root_struct, current_root) - - if debug: - click.echo(converter.serializer.data) - else: - converter.serializer.save_changes() diff --git a/docs/examples/data/empty_model/.project b/docs/examples/data/empty_model/.project deleted file mode 100644 index 6c740f9..0000000 --- a/docs/examples/data/empty_model/.project +++ /dev/null @@ -1,12 +0,0 @@ - - - empty_model - - - - - - - org.polarsys.capella.project.nature - - diff --git a/docs/examples/data/empty_model/.project.license b/docs/examples/data/empty_model/.project.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/empty_model/.project.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/empty_model/empty_model.afm b/docs/examples/data/empty_model/empty_model.afm deleted file mode 100644 index d019bfb..0000000 --- a/docs/examples/data/empty_model/empty_model.afm +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/docs/examples/data/empty_model/empty_model.afm.license b/docs/examples/data/empty_model/empty_model.afm.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/empty_model/empty_model.afm.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/empty_model/empty_model.aird b/docs/examples/data/empty_model/empty_model.aird deleted file mode 100644 index 2fc68e9..0000000 --- a/docs/examples/data/empty_model/empty_model.aird +++ /dev/null @@ -1,26 +0,0 @@ - - - empty_model.afm - empty_model.capella - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/data/empty_model/empty_model.aird.license b/docs/examples/data/empty_model/empty_model.aird.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/empty_model/empty_model.aird.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/empty_model/empty_model.capella b/docs/examples/data/empty_model/empty_model.capella deleted file mode 100644 index c1771c1..0000000 --- a/docs/examples/data/empty_model/empty_model.capella +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/data/empty_model/empty_model.capella.license b/docs/examples/data/empty_model/empty_model.capella.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/empty_model/empty_model.capella.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/model/.project b/docs/examples/data/model/.project deleted file mode 100644 index 89f6904..0000000 --- a/docs/examples/data/model/.project +++ /dev/null @@ -1,12 +0,0 @@ - - - model - - - - - - - org.polarsys.capella.project.nature - - diff --git a/docs/examples/data/model/.project.license b/docs/examples/data/model/.project.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/model/.project.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/model/model.afm b/docs/examples/data/model/model.afm deleted file mode 100644 index 66ba63f..0000000 --- a/docs/examples/data/model/model.afm +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/docs/examples/data/model/model.afm.license b/docs/examples/data/model/model.afm.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/model/model.afm.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/model/model.aird b/docs/examples/data/model/model.aird deleted file mode 100644 index 2ee1f82..0000000 --- a/docs/examples/data/model/model.aird +++ /dev/null @@ -1,26 +0,0 @@ - - - model.afm - model.capella - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/data/model/model.aird.license b/docs/examples/data/model/model.aird.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/model/model.aird.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/model/model.capella b/docs/examples/data/model/model.capella deleted file mode 100644 index b2055e1..0000000 --- a/docs/examples/data/model/model.capella +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/examples/data/model/model.capella.license b/docs/examples/data/model/model.capella.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/data/model/model.capella.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/data/model_msgs/msg/MultiArrayLayout.msg b/docs/examples/data/model_msgs/msg/MultiArrayLayout.msg deleted file mode 100644 index c9aac7b..0000000 --- a/docs/examples/data/model_msgs/msg/MultiArrayLayout.msg +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -# -# The multiarray declares a generic multi-dimensional array of a -# particular data type. Dimensions are ordered from outer most -# to inner most. - -MultiArrayDimension[] dim # Array of dimension properties -uint8 data_offset # cf. ObjectTypes, OBJECT_MOTION_TYPE_XXX - -# Accessors should ALWAYS be written in terms of dimension stride -# and specified outer-most dimension first. -# -# multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k] -# -# A standard, 3-channel 640x480 image with interleaved color channels -# would be specified as: -# -# dim[0].label = "height" -# dim[0].size = 480 -# dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) -# dim[1].label = "width" -# dim[1].size = 640 -# dim[1].stride = 3*640 = 1920 -# dim[2].label = "channel" -# dim[2].size = 3 -# dim[2].stride = 3 -# -# multiarray(i,j,k) refers to the ith row, jth column, and kth channel. diff --git a/docs/examples/data/model_msgs/msg/UInt64MultiArray.msg b/docs/examples/data/model_msgs/msg/UInt64MultiArray.msg deleted file mode 100644 index 3f2aa22..0000000 --- a/docs/examples/data/model_msgs/msg/UInt64MultiArray.msg +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -# -# Please look at the MultiArrayLayout message definition for -# documentation on all multiarrays. - -MultiArrayLayout layout # specification of data layout -uint64[] data # array of data diff --git a/docs/examples/data/model_msgs/msg/sub_msgs/MultiArrayDimension.msg b/docs/examples/data/model_msgs/msg/sub_msgs/MultiArrayDimension.msg deleted file mode 100644 index 0beece4..0000000 --- a/docs/examples/data/model_msgs/msg/sub_msgs/MultiArrayDimension.msg +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 - -string label # label of given dimension -uint32 size # size of given dimension (in type units) -uint32 stride # stride of given dimension diff --git a/docs/examples/data/model_msgs/msg/types/ObjectTypes.msg b/docs/examples/data/model_msgs/msg/types/ObjectTypes.msg deleted file mode 100644 index 52fb5cd..0000000 --- a/docs/examples/data/model_msgs/msg/types/ObjectTypes.msg +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-FileCopyrightText: Copyright DB Netz AG -# SPDX-License-Identifier: Apache-2.0 -# -# ObjectTypes -# -# Created: 2020-04-15 -# Modified: 2020-04-22 -# Version: 2.0 -# -# Description: List of object motion types, classes, types, and subtypes. - -uint8 OBJECT_MOTION_TYPE_UNDEFINED = 0 # undefined -uint8 OBJECT_MOTION_TYPE_STATIC = 1 -uint8 OBJECT_MOTION_TYPE_DYNAMIC = 2 diff --git a/docs/examples/example_parse_capella.ipynb b/docs/examples/example_parse_capella.ipynb deleted file mode 100644 index 2d039fe..0000000 --- a/docs/examples/example_parse_capella.ipynb +++ /dev/null @@ -1,418 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Cannot load PVMT extension: ValueError: Provided model does not have a PropertyValuePkg\n", - "Property values are not available in this model\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datatype' already registered with URI 'http://www.polarsys.org/capella/core/information/datatype/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datatype' already registered with URI 'http://www.polarsys.org/capella/core/information/datatype/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datatype' already registered with URI 'http://www.polarsys.org/capella/core/information/datatype/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datatype' already registered with URI 'http://www.polarsys.org/capella/core/information/datatype/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datatype' already registered with URI 'http://www.polarsys.org/capella/core/information/datatype/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n" - ] - } - ], - "source": [ - "! python -m capella_ros_tools --overlap=overwrite data/model_msgs data/model la" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [], - "source": [ - "from capella_ros_tools.modules.parse_capella import ParseCapella" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Cannot load PVMT extension: ValueError: Provided model does not have a PropertyValuePkg\n", - "Property values are not available in this model\n" - ] - } - ], - "source": [ - "model = ParseCapella(\"data/model\", \"la\")" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'basic_types', 'model_msgs', 'ros_interfaces'}" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.get_packages(model.data)" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'sub_msgs', 'types'}" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model_msgs = model.data.packages.by_name(\"model_msgs\")\n", - "model.get_packages(model_msgs)" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'UInt64MultiArray': (Markup('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nPlease look at the MultiArrayLayout message definition for\\ndocumentation on all multiarrays.'),\n", - " [MsgProp(name='layout', type='MultiArrayLayout', typedir='', min=1, max=1, comment=Markup('specification of data layout')),\n", - " MsgProp(name='data', type='uint64', typedir='', min=0, max=inf, comment=Markup('array of data'))]),\n", - " 'MultiArrayLayout': (Markup('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nThe multiarray declares a generic multi-dimensional array of a\\nparticular data type. Dimensions are ordered from outer most\\nto inner most.'),\n", - " [MsgProp(name='dim', type='MultiArrayDimension', typedir='', min=0, max=inf, comment=Markup('Array of dimension properties')),\n", - " MsgProp(name='data_offset', type='uint8', typedir='', min=1, max=1, comment=Markup('cf. ObjectTypes, OBJECT_MOTION_TYPE_XXX'))])}" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.get_classes(model_msgs)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'action_msgs',\n", - " 'actionlib_msgs',\n", - " 'builtin_interfaces',\n", - " 'diagnostic_msgs',\n", - " 'geometry_msgs',\n", - " 'lifecycle_msgs',\n", - " 'nav_msgs',\n", - " 'rcl_interfaces',\n", - " 'rosgraph_msgs',\n", - " 'sensor_msgs',\n", - " 'service_msgs',\n", - " 'shape_msgs',\n", - " 'statistics_msgs',\n", - " 'std_msgs',\n", - " 'stereo_msgs',\n", - " 'test_msgs',\n", - " 'trajectory_msgs',\n", - " 'type_description_interfaces',\n", - " 'visualization_msgs'}" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ros_interfaces = model.data.packages.by_name(\"ros_interfaces\")\n", - "model.get_packages(ros_interfaces)" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'OBJECT_MOTION_TYPE': (Markup('SPDX-FileCopyrightText: Copyright DB Netz AG\\nSPDX-License-Identifier: Apache-2.0\\n\\nObjectTypes\\n\\nCreated: 2020-04-15\\nModified: 2020-04-22\\nVersion: 2.0\\n\\nDescription: List of object motion types, classes, types, and subtypes.'),\n", - " [EnumProp(name='UNDEFINED', type='uint8', value=0, comment=Markup('undefined')),\n", - " EnumProp(name='STATIC', type='uint8', value=1, comment=''),\n", - " EnumProp(name='DYNAMIC', type='uint8', value=2, comment='')])}" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model_types = model_msgs.packages.by_name(\"types\")\n", - "model.get_types(model_types)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/examples/example_parse_capella.ipynb.license b/docs/examples/example_parse_capella.ipynb.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/example_parse_capella.ipynb.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/example_parse_message.ipynb b/docs/examples/example_parse_message.ipynb deleted file mode 100644 index bd131c7..0000000 --- a/docs/examples/example_parse_message.ipynb +++ /dev/null @@ -1,155 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "from capella_ros_tools.modules.parse_message import ParseMessagesPkg, ParseMessageDef\n", - "from pathlib import Path" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "({},\n", - " {'model_msgs': ({'UInt64MultiArray': ('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nPlease look at the MultiArrayLayout message definition for\\ndocumentation on all multiarrays.',\n", - " [MsgProp(name='layout', type='MultiArrayLayout', typedir='', min='1', max='1', comment='specification of data layout'),\n", - " MsgProp(name='data', type='uint64', typedir='', min='0', max='', comment='array of data')]),\n", - " 'MultiArrayLayout': ('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nThe multiarray declares a generic multi-dimensional array of a\\nparticular data type. Dimensions are ordered from outer most\\nto inner most.',\n", - " [MsgProp(name='dim', type='MultiArrayDimension', typedir='', min='0', max='', comment='Array of dimension properties'),\n", - " MsgProp(name='data_offset', type='OBJECT_MOTION_TYPE', typedir='', min='1', max='1', comment='cf. ObjectTypes, OBJECT_MOTION_TYPE_XXX')])},\n", - " {'sub_msgs': ({'MultiArrayDimension': ('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0',\n", - " [MsgProp(name='label', type='string', typedir='', min='1', max='1', comment='label of given dimension'),\n", - " MsgProp(name='size', type='uint32', typedir='', min='1', max='1', comment='size of given dimension (in type units)'),\n", - " MsgProp(name='stride', type='uint32', typedir='', min='1', max='1', comment='stride of given dimension')])},\n", - " {}),\n", - " 'types': ({'OBJECT_MOTION_TYPE': ('SPDX-FileCopyrightText: Copyright DB Netz AG\\nSPDX-License-Identifier: Apache-2.0\\n\\nObjectTypes\\n\\nCreated: 2020-04-15\\nModified: 2020-04-22\\nVersion: 2.0\\n\\nDescription: List of object motion types, classes, types, and subtypes.',\n", - " [EnumProp(name='UNDEFINED', type='uint8', value='0', comment='undefined'),\n", - " EnumProp(name='STATIC', type='uint8', value='1', comment=''),\n", - " EnumProp(name='DYNAMIC', type='uint8', value='2', comment='')])},\n", - " {})})})" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "folders = ParseMessagesPkg.from_pkg_folders(Path(\"data/model_msgs\"))\n", - "folders.as_structs" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "({'UInt64MultiArray': ('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nPlease look at the MultiArrayLayout message definition for\\ndocumentation on all multiarrays.',\n", - " [MsgProp(name='layout', type='MultiArrayLayout', typedir='', min='1', max='1', comment='specification of data layout'),\n", - " MsgProp(name='data', type='uint64', typedir='', min='0', max='', comment='array of data')]),\n", - " 'MultiArrayLayout': ('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nThe multiarray declares a generic multi-dimensional array of a\\nparticular data type. Dimensions are ordered from outer most\\nto inner most.',\n", - " [MsgProp(name='dim', type='MultiArrayDimension', typedir='', min='0', max='', comment='Array of dimension properties'),\n", - " MsgProp(name='data_offset', type='OBJECT_MOTION_TYPE', typedir='', min='1', max='1', comment='cf. ObjectTypes, OBJECT_MOTION_TYPE_XXX')])},\n", - " {'sub_msgs': ({'MultiArrayDimension': ('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0',\n", - " [MsgProp(name='label', type='string', typedir='', min='1', max='1', comment='label of given dimension'),\n", - " MsgProp(name='size', type='uint32', typedir='', min='1', max='1', comment='size of given dimension (in type units)'),\n", - " MsgProp(name='stride', type='uint32', typedir='', min='1', max='1', comment='stride of given dimension')])},\n", - " {}),\n", - " 'types': ({'OBJECT_MOTION_TYPE': ('SPDX-FileCopyrightText: Copyright DB Netz AG\\nSPDX-License-Identifier: Apache-2.0\\n\\nObjectTypes\\n\\nCreated: 2020-04-15\\nModified: 2020-04-22\\nVersion: 2.0\\n\\nDescription: List of object motion types, classes, types, and subtypes.',\n", - " [EnumProp(name='UNDEFINED', type='uint8', value='0', comment='undefined'),\n", - " EnumProp(name='STATIC', type='uint8', value='1', comment=''),\n", - " EnumProp(name='DYNAMIC', type='uint8', value='2', comment='')])},\n", - " {})})" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "folder = ParseMessagesPkg.from_msg_folder(Path(\"data/model_msgs/msg\"))\n", - "folder.as_structs" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "('Copyright DB Netz AG and contributors\\nSPDX-License-Identifier: Apache-2.0\\n\\nThe multiarray declares a generic multi-dimensional array of a\\nparticular data type. Dimensions are ordered from outer most\\nto inner most.',\n", - " [MsgProp(name='dim', type='MultiArrayDimension', typedir='', min='0', max='', comment='Array of dimension properties'),\n", - " MsgProp(name='data_offset', type='OBJECT_MOTION_TYPE', typedir='', min='1', max='1', comment='cf. ObjectTypes, OBJECT_MOTION_TYPE_XXX')])" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "msg_file = ParseMessageDef.from_msg_file(Path(\"data/model_msgs/msg/MultiArrayLayout.msg\"))\n", - "msg_file[0].as_struct" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "('SPDX-FileCopyrightText: Copyright DB Netz AG\\nSPDX-License-Identifier: Apache-2.0\\n\\nObjectTypes\\n\\nCreated: 2020-04-15\\nModified: 2020-04-22\\nVersion: 2.0\\n\\nDescription: List of object motion types, classes, types, and subtypes.',\n", - " [EnumProp(name='UNDEFINED', type='uint8', value='0', comment='undefined'),\n", - " EnumProp(name='STATIC', type='uint8', value='1', comment=''),\n", - " EnumProp(name='DYNAMIC', type='uint8', value='2', comment='')])" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "type_file = ParseMessageDef.from_type_file(Path(\"data/model_msgs/msg/types/ObjectTypes.msg\"))\n", - "type_file[0].as_struct" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/examples/example_parse_message.ipynb.license b/docs/examples/example_parse_message.ipynb.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/example_parse_message.ipynb.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/example_serialize_capella.ipynb b/docs/examples/example_serialize_capella.ipynb deleted file mode 100644 index 70d5a26..0000000 --- a/docs/examples/example_serialize_capella.ipynb +++ /dev/null @@ -1,382 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from capella_ros_tools.modules.serialize_capella import SerializeCapella\n", - "from capella_ros_tools.modules import MsgProp" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Cannot load PVMT extension: ValueError: Provided model does not have a PropertyValuePkg\n", - "Property values are not available in this model\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n" - ] - } - ], - "source": [ - "model = SerializeCapella(\"data/empty_model\", \"la\")" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
  1. DataPkg "basic_types" (9b3009e8-fad5-4b3b-9f8e-25d2da9d8709)
" - ], - "text/plain": [ - "[0] " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.data.packages" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n" - ] - } - ], - "source": [ - "packages = {\"test\", \"test2\"}\n", - "model.create_packages(packages, model.data)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
  1. DataPkg "basic_types" (9b3009e8-fad5-4b3b-9f8e-25d2da9d8709)
  2. DataPkg "test2" (0bb61f0f-a3d2-42e4-85f2-6a3b8b7c74df)
  3. DataPkg "test" (9a44dc40-b7be-479d-a5e7-3d7cb1537d1c)
" - ], - "text/plain": [ - "[0] \n", - "[1] \n", - "[2] " - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.data.packages" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n" - ] - }, - { - "data": { - "text/plain": [ - "[]" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "classes = {\n", - " \"class1\": (\"desc1\", []),\n", - " \"class2\": (\"desc2\", []),\n", - "}\n", - "model.create_classes(classes, model.data)" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
  1. Class "class1" (2ab1170f-981a-4758-bc1f-a4e9a0b7733d)
  2. Class "class2" (c1629904-002a-47b7-8f33-935cbea6efb8)
" - ], - "text/plain": [ - "[0] \n", - "[1] " - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.data.classes" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If we try creating the same classes again, instead of creating duplicates we get a list of the overlapping classes." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [], - "source": [ - "overlap = model.create_classes(classes, model.data)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "When we call delete_classes with the overlap, we can see that the classes are deleted." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "

(Empty list)

" - ], - "text/plain": [ - "[]" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.delete_classes(overlap, model.data)\n", - "model.data.classes" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "But let's create them again, because we still need them." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n" - ] - }, - { - "data": { - "text/plain": [ - "[]" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.create_classes(classes, model.data)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Right now our classes don't have any properties. So let's create them.\\\n", - "For compositions use create_composition:" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n" - ] - }, - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.create_composition(\"class1\", MsgProp(\"prop1\", \"class2\", \"\", \"1\", \"1\", \"prop_desc1\"), model.data)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For attributes use create_attribute:" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Namespace 'org.polarsys.capella.core.data.information.datatype' already registered with URI 'http://www.polarsys.org/capella/core/information/datatype/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information' already registered with URI 'http://www.polarsys.org/capella/core/information/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n", - "Namespace 'org.polarsys.capella.core.data.information.datavalue' already registered with URI 'http://www.polarsys.org/capella/core/information/datavalue/6.0.0'\n" - ] - } - ], - "source": [ - "model.create_attribute(\"class2\", MsgProp(\"prop2\", \"uint8\", \"\", \"1\", \"1\", \"prop_desc2\"), model.data)" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "

prop1 (org.polarsys.capella.core.data.information:Property)

applied_property_value_groups

(Empty list)

applied_property_values

(Empty list)

associationBackreference to Association - omitted: can be slow to compute. Display this property directly to show.
constraints

(Empty list)

default_valueNone
descriptionprop_desc1
filtering_criteria

(Empty list)

is_abstractFalse
is_derivedFalse
is_orderedFalse
is_part_of_keyFalse
is_read_onlyFalse
is_staticFalse
is_uniqueFalse
kind<AggregationKind.COMPOSITION: 4>
maxNone
max_cardLiteralNumericValue "": 1 (a6d6b4a4-861f-4b77-9e03-46b99e45c9c3)
minNone
min_cardLiteralNumericValue "": 1 (265e184c-106b-4038-977b-95893741487d)
nameprop1
null_valueNone
parentClass "class1" (7950d11b-6012-4bee-96bf-539f1adf1815)
progress_statusNOT_SET
property_value_groups

(Empty list)

property_values

(Empty list)

requirements

(Empty list)

summaryNone
traces

(Empty list)

typeClass "class2" (7b4a44d0-2257-49a4-9d3c-39828d3589bb)
uuid7aacd84a-8f22-416b-ac88-d21ed8dc1abf
visibility<VisibilityKind.UNSET: 1>
xtypeorg.polarsys.capella.core.data.information:Property
" - ], - "text/plain": [ - "\n", - ".applied_property_value_groups = []\n", - ".applied_property_values = []\n", - ".association = ... # backreference to Association - omitted: can be slow to compute\n", - ".constraints = []\n", - ".default_value = None\n", - ".description = Markup('prop_desc1')\n", - ".filtering_criteria = []\n", - ".is_abstract = False\n", - ".is_derived = False\n", - ".is_ordered = False\n", - ".is_part_of_key = False\n", - ".is_read_only = False\n", - ".is_static = False\n", - ".is_unique = False\n", - ".kind = \n", - ".max = None\n", - ".max_card = \n", - ".min = None\n", - ".min_card = \n", - ".name = 'prop1'\n", - ".null_value = None\n", - ".parent = \n", - ".progress_status = 'NOT_SET'\n", - ".property_value_groups = []\n", - ".property_values = []\n", - ".requirements = []\n", - ".summary = None\n", - ".traces = []\n", - ".type = \n", - ".uuid = '7aacd84a-8f22-416b-ac88-d21ed8dc1abf'\n", - ".visibility = \n", - ".xtype = 'org.polarsys.capella.core.data.information:Property'" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.data.classes[0].owned_properties[0]" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/examples/example_serialize_capella.ipynb.license b/docs/examples/example_serialize_capella.ipynb.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/example_serialize_capella.ipynb.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/examples/example_serialize_message.ipynb b/docs/examples/example_serialize_message.ipynb deleted file mode 100644 index 8a49d86..0000000 --- a/docs/examples/example_serialize_message.ipynb +++ /dev/null @@ -1,76 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from capella_ros_tools.modules.serialize_message import SerializeMessagesPkg, SerializeMessageDef\n", - "from capella_ros_tools.modules import MsgProp, EnumProp\n", - "from pathlib import Path" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "messages = {\n", - " \"class1\": SerializeMessageDef(\n", - " \"class1\", \"desc1\", [MsgProp(\"prop1\", \"class2\", \"\", \"1\", \"1\", \"prop_desc1\")]\n", - " ),\n", - " \"class2\": SerializeMessageDef(\n", - " \"class2\", \"desc2\", [MsgProp(\"prop2\", \"uint8\", \"\", \"1\", \"1\", \"prop_desc2\")]\n", - " ),\n", - "}\n", - "types = {\n", - " \"type1\": SerializeMessageDef(\"type1\", \"type_desc1\", [EnumProp(\"value1\", \"uint8\", \"12\", \"enum value desc\")]),\n", - "}\n", - "packages = {\n", - " \"types\": SerializeMessagesPkg(types, {}),\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "folder = SerializeMessagesPkg(messages, packages)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "folder.to_msg_folder(Path(\"data/test\"))" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/examples/example_serialize_message.ipynb.license b/docs/examples/example_serialize_message.ipynb.license deleted file mode 100644 index 95e8b6e..0000000 --- a/docs/examples/example_serialize_message.ipynb.license +++ /dev/null @@ -1,2 +0,0 @@ -Copyright DB Netz AG and contributors -SPDX-License-Identifier: CC0-1.0 diff --git a/docs/source/examples/Convert messages.ipynb b/docs/source/examples/Convert messages.ipynb deleted file mode 100644 index b3a19dd..0000000 --- a/docs/source/examples/Convert messages.ipynb +++ /dev/null @@ -1,118 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "import capellambse\n", - "from capella_ros_tools.scripts import msg2capella\n", - "from pathlib import Path" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "msg_path = capellambse.filehandler.get_filehandler(\"git+https://github.com/DSD-DBS/dsd-ros-msg-definitions-oss\").rootdir\n", - "capella_path = Path(\"data/empty_project_52\")\n", - "layer = \"la\"" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m converter \u001b[38;5;241m=\u001b[39m \u001b[43mmsg2capella\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mConverter\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcapella_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlayer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mo\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/scripts/msg2capella.py:55\u001b[0m, in \u001b[0;36mConverter.__init__\u001b[0;34m(self, msg_path, capella_path, layer, action, no_deps)\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 49\u001b[0m msg_path: t\u001b[38;5;241m.\u001b[39mAny,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 53\u001b[0m no_deps: \u001b[38;5;28mbool\u001b[39m,\n\u001b[1;32m 54\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m---> 55\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmsgs \u001b[38;5;241m=\u001b[39m \u001b[43mMessagePkgDef\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_pkg_folder\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg_path\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 56\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmodel \u001b[38;5;241m=\u001b[39m CapellaModel(capella_path, layer)\n\u001b[1;32m 57\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maction \u001b[38;5;241m=\u001b[39m action\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:326\u001b[0m, in \u001b[0;36mMessagePkgDef.from_pkg_folder\u001b[0;34m(cls, root_dir, root_dir_name)\u001b[0m\n\u001b[1;32m 323\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m, [], [])\n\u001b[1;32m 324\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m \u001b[38;5;28mdir\u001b[39m \u001b[38;5;129;01min\u001b[39;00m root_dir\u001b[38;5;241m.\u001b[39mrglob(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmsg\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 325\u001b[0m out\u001b[38;5;241m.\u001b[39mpackages\u001b[38;5;241m.\u001b[39mappend(\n\u001b[0;32m--> 326\u001b[0m \u001b[43mMessagePkgDef\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_msg_folder\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 327\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mdir\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparent\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mroot_dir_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mdir\u001b[39;49m\n\u001b[1;32m 328\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 329\u001b[0m )\n\u001b[1;32m 330\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m out\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:316\u001b[0m, in \u001b[0;36mMessagePkgDef.from_msg_folder\u001b[0;34m(cls, package_name, msg_pkg_dir)\u001b[0m\n\u001b[1;32m 313\u001b[0m msg_pkg\u001b[38;5;241m.\u001b[39mmessages\u001b[38;5;241m.\u001b[39mappend(MessageDef\u001b[38;5;241m.\u001b[39mfrom_msg_file(msg_file))\n\u001b[1;32m 314\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m msg_file\u001b[38;5;241m.\u001b[39mis_dir():\n\u001b[1;32m 315\u001b[0m msg_pkg\u001b[38;5;241m.\u001b[39mpackages\u001b[38;5;241m.\u001b[39mappend(\n\u001b[0;32m--> 316\u001b[0m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_msg_folder\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg_file\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmsg_file\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 317\u001b[0m )\n\u001b[1;32m 318\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m msg_pkg\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:313\u001b[0m, in \u001b[0;36mMessagePkgDef.from_msg_folder\u001b[0;34m(cls, package_name, msg_pkg_dir)\u001b[0m\n\u001b[1;32m 311\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m msg_file \u001b[38;5;129;01min\u001b[39;00m msg_pkg_dir\u001b[38;5;241m.\u001b[39miterdir():\n\u001b[1;32m 312\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m msg_file\u001b[38;5;241m.\u001b[39msuffix \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.msg\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m--> 313\u001b[0m msg_pkg\u001b[38;5;241m.\u001b[39mmessages\u001b[38;5;241m.\u001b[39mappend(\u001b[43mMessageDef\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_msg_file\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg_file\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 314\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m msg_file\u001b[38;5;241m.\u001b[39mis_dir():\n\u001b[1;32m 315\u001b[0m msg_pkg\u001b[38;5;241m.\u001b[39mpackages\u001b[38;5;241m.\u001b[39mappend(\n\u001b[1;32m 316\u001b[0m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39mfrom_msg_folder(msg_file\u001b[38;5;241m.\u001b[39mname, msg_file)\n\u001b[1;32m 317\u001b[0m )\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:110\u001b[0m, in \u001b[0;36mMessageDef.from_msg_file\u001b[0;34m(cls, msg_file)\u001b[0m\n\u001b[1;32m 108\u001b[0m msg_name \u001b[38;5;241m=\u001b[39m msg_file\u001b[38;5;241m.\u001b[39mstem\n\u001b[1;32m 109\u001b[0m message_string \u001b[38;5;241m=\u001b[39m msg_file\u001b[38;5;241m.\u001b[39mread_text()\n\u001b[0;32m--> 110\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_msg_string\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmessage_string\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:184\u001b[0m, in \u001b[0;36mMessageDef.from_msg_string\u001b[0;34m(cls, msg_name, message_string)\u001b[0m\n\u001b[1;32m 181\u001b[0m last_element \u001b[38;5;241m=\u001b[39m msg\u001b[38;5;241m.\u001b[39mfields[\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m]\n\u001b[1;32m 183\u001b[0m \u001b[38;5;66;03m# condense and rename enums\u001b[39;00m\n\u001b[0;32m--> 184\u001b[0m \u001b[43m_process_enums\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmsg\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 186\u001b[0m \u001b[38;5;66;03m# condense comment lines, extract special annotations\u001b[39;00m\n\u001b[1;32m 187\u001b[0m _process_comments(msg)\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:227\u001b[0m, in \u001b[0;36m_process_enums\u001b[0;34m(msg)\u001b[0m\n\u001b[1;32m 225\u001b[0m msg\u001b[38;5;241m.\u001b[39menums[i \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues \u001b[38;5;241m=\u001b[39m enum\u001b[38;5;241m.\u001b[39mvalues \u001b[38;5;241m+\u001b[39m msg\u001b[38;5;241m.\u001b[39menums[i \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n\u001b[1;32m 226\u001b[0m to_delete\u001b[38;5;241m.\u001b[39madd(i)\n\u001b[0;32m--> 227\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 228\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m:\n\u001b[1;32m 229\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/capella_ros_tools/modules/messages/parser.py:227\u001b[0m, in \u001b[0;36m_process_enums\u001b[0;34m(msg)\u001b[0m\n\u001b[1;32m 225\u001b[0m msg\u001b[38;5;241m.\u001b[39menums[i \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues \u001b[38;5;241m=\u001b[39m enum\u001b[38;5;241m.\u001b[39mvalues \u001b[38;5;241m+\u001b[39m msg\u001b[38;5;241m.\u001b[39menums[i \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n\u001b[1;32m 226\u001b[0m to_delete\u001b[38;5;241m.\u001b[39madd(i)\n\u001b[0;32m--> 227\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 228\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m:\n\u001b[1;32m 229\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n", - "File \u001b[0;32m_pydevd_bundle/pydevd_cython.pyx:1457\u001b[0m, in \u001b[0;36m_pydevd_bundle.pydevd_cython.SafeCallWrapper.__call__\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m_pydevd_bundle/pydevd_cython.pyx:701\u001b[0m, in \u001b[0;36m_pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m_pydevd_bundle/pydevd_cython.pyx:1395\u001b[0m, in \u001b[0;36m_pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m_pydevd_bundle/pydevd_cython.pyx:1344\u001b[0m, in \u001b[0;36m_pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m_pydevd_bundle/pydevd_cython.pyx:312\u001b[0m, in \u001b[0;36m_pydevd_bundle.pydevd_cython.PyDBFrame.do_wait_suspend\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/.venv/lib/python3.10/site-packages/debugpy/_vendored/pydevd/pydevd.py:2070\u001b[0m, in \u001b[0;36mPyDB.do_wait_suspend\u001b[0;34m(self, thread, frame, event, arg, exception_type)\u001b[0m\n\u001b[1;32m 2067\u001b[0m from_this_thread\u001b[38;5;241m.\u001b[39mappend(frame_custom_thread_id)\n\u001b[1;32m 2069\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_threads_suspended_single_notification\u001b[38;5;241m.\u001b[39mnotify_thread_suspended(thread_id, thread, stop_reason):\n\u001b[0;32m-> 2070\u001b[0m keep_suspended \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_do_wait_suspend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mthread\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mframe\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mevent\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43marg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msuspend_type\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfrom_this_thread\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mframes_tracker\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2072\u001b[0m frames_list \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 2074\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m keep_suspended:\n\u001b[1;32m 2075\u001b[0m \u001b[38;5;66;03m# This means that we should pause again after a set next statement.\u001b[39;00m\n", - "File \u001b[0;32m~/Documents/capella-ros-tools/.venv/lib/python3.10/site-packages/debugpy/_vendored/pydevd/pydevd.py:2106\u001b[0m, in \u001b[0;36mPyDB._do_wait_suspend\u001b[0;34m(self, thread, frame, event, arg, suspend_type, from_this_thread, frames_tracker)\u001b[0m\n\u001b[1;32m 2103\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_call_input_hook()\n\u001b[1;32m 2105\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprocess_internal_commands()\n\u001b[0;32m-> 2106\u001b[0m \u001b[43mtime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msleep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0.01\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2108\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcancel_async_evaluation(get_current_thread_id(thread), \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28mid\u001b[39m(frame)))\n\u001b[1;32m 2110\u001b[0m \u001b[38;5;66;03m# process any stepping instructions\u001b[39;00m\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " - ] - } - ], - "source": [ - "converter = msg2capella.Converter(msg_path, capella_path, layer, \"o\", False)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Traceback (most recent call last):\n", - " File \"_pydevd_bundle/pydevd_cython.pyx\", line 577, in _pydevd_bundle.pydevd_cython.PyDBFrame._handle_exception\n", - " File \"_pydevd_bundle/pydevd_cython.pyx\", line 312, in _pydevd_bundle.pydevd_cython.PyDBFrame.do_wait_suspend\n", - " File \"/home/huyenngn/Documents/capella-ros-tools/.venv/lib/python3.10/site-packages/debugpy/_vendored/pydevd/pydevd.py\", line 2070, in do_wait_suspend\n", - " keep_suspended = self._do_wait_suspend(thread, frame, event, arg, suspend_type, from_this_thread, frames_tracker)\n", - " File \"/home/huyenngn/Documents/capella-ros-tools/.venv/lib/python3.10/site-packages/debugpy/_vendored/pydevd/pydevd.py\", line 2106, in _do_wait_suspend\n", - " time.sleep(0.01)\n", - "KeyboardInterrupt\n" - ] - }, - { - "ename": "NameError", - "evalue": "name 'converter' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mconverter\u001b[49m\u001b[38;5;241m.\u001b[39mconvert()\n", - "\u001b[0;31mNameError\u001b[0m: name 'converter' is not defined" - ] - } - ], - "source": [ - "converter.convert()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": ".venv", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.12" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/docs/source/examples/Convert messages.ipynb.license b/docs/source/examples/Convert messages.ipynb.license deleted file mode 100644 index 6605644..0000000 --- a/docs/source/examples/Convert messages.ipynb.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: Copyright DB Netz AG and the capellambse contributors -SPDX-License-Identifier: Apache-2.0 diff --git a/docs/source/examples/Parse messages.ipynb b/docs/source/examples/Parse messages.ipynb index bec90e7..8a15a66 100644 --- a/docs/source/examples/Parse messages.ipynb +++ b/docs/source/examples/Parse messages.ipynb @@ -29,7 +29,7 @@ "

CameraInfo

# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0
#
# This message defines meta information for a camera. It should be in a
# camera namespace on topic \"camera_info\" and accompanied by up to five
# image topics named:
#
# image_raw - raw data from the camera driver, possibly Bayer encoded
# image - monochrome, distorted
# image_color - color, distorted
# image_rect - monochrome, rectified
# image_rect_color - color, rectified
#
# The image_pipeline contains packages (image_proc, stereo_image_proc)
# for producing the four processed image topics from image_raw and
# camera_info. The meaning of the camera parameters are described in
# detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
#
# The image_geometry package provides a user-friendly interface to
# common operations using this meta information. If you want to, e.g.,
# project a 3d point into image coordinates, we strongly recommend
# using image_geometry.
#
# If the camera is uncalibrated, the matrices D, K, R, P should be left
# zeroed out. In particular, clients may assume that K[0] == 0.0
# indicates an uncalibrated camera.
#######################################################################
# Image acquisition info #
#######################################################################
#######################################################################
# Calibration Parameters #
#######################################################################
# These are fixed during camera calibration. Their values will be the #
# same in all messages until the camera is recalibrated. Note that #
# self-calibrating systems may \"recalibrate\" frequently. #
# #
# The internal parameters can be used to warp a raw (distorted) image #
# to: #
# 1. An undistorted image (requires D and K) #
# 2. A rectified image (requires D, K, R) #
# The projection matrix P projects 3D points into the rectified image.#
#######################################################################
#######################################################################
# Operational Parameters #
#######################################################################
# These define the image region actually captured by the camera #
# driver. Although they affect the geometry of the output image, they #
# may be changed freely without recalibrating the camera. #
#######################################################################

Fields

  1. std_msgs/Header header
    # Time of image acquisition, camera coordinate frame ID
    # Header timestamp should be acquisition time of image
    # Header frame_id should be optical frame of camera
    # origin of frame should be optical center of camera
    # +x should point to the right in the image
    # +y should point down in the image
    # +z should point into the plane of the image
  2. uint32 height
    # The image dimensions with which the camera was calibrated.
    # Normally this will be the full camera resolution in pixels.
  3. uint32 width
    # The image dimensions with which the camera was calibrated.
    # Normally this will be the full camera resolution in pixels.
  4. string distortion_model
    # The distortion model used. Supported models are listed in
    # sensor_msgs/distortion_models.hpp. For most cameras, \"plumb_bob\" - a
    # simple model of radial and tangential distortion - is sufficent.
  5. float64[] d
    # The distortion parameters, size depending on the distortion model.
    # For \"plumb_bob\", the 5 parameters are: (k1, k2, t1, t2, k3).
  6. float64[9] k
    # Intrinsic camera matrix for the raw (distorted) images.
    # [fx 0 cx]
    # K = [ 0 fy cy]
    # [ 0 0 1]
    # Projects 3D points in the camera coordinate frame to 2D pixel
    # coordinates using the focal lengths (fx, fy) and principal point
    # (cx, cy).
    # 3x3 row-major matrix
  7. float64[9] r
    # Rectification matrix (stereo cameras only)
    # A rotation matrix aligning the camera coordinate system to the ideal
    # stereo image plane so that epipolar lines in both stereo images are
    # parallel.
    # 3x3 row-major matrix
  8. float64[12] p
    # Projection/camera matrix
    # [fx' 0 cx' Tx]
    # P = [ 0 fy' cy' Ty]
    # [ 0 0 1 0]
    # By convention, this matrix specifies the intrinsic (camera) matrix
    # of the processed (rectified) image. That is, the left 3x3 portion
    # is the normal camera intrinsic matrix for the rectified image.
    # It projects 3D points in the camera coordinate frame to 2D pixel
    # coordinates using the focal lengths (fx', fy') and principal point
    # (cx', cy') - these may differ from the values in K.
    # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
    # also have R = the identity and P[1:3,1:3] = K.
    # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
    # position of the optical center of the second camera in the first
    # camera's frame. We assume Tz = 0 so both cameras are in the same
    # stereo image plane. The first camera always has Tx = Ty = 0. For
    # the right (second) camera of a horizontal stereo pair, Ty = 0 and
    # Tx = -fx' * B, where B is the baseline between the cameras.
    # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
    # the rectified image is given by:
    # [u v w]' = P * [X Y Z 1]'
    # x = u / w
    # y = v / w
    # This holds for both images of a stereo pair.
    # 3x4 row-major matrix
  9. uint32 binning_x
    # Binning refers here to any camera setting which combines rectangular
    # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
    # resolution of the output image to
    # (width / binning_x) x (height / binning_y).
    # The default values binning_x = binning_y = 0 is considered the same
    # as binning_x = binning_y = 1 (no subsampling).
  10. uint32 binning_y
    # Binning refers here to any camera setting which combines rectangular
    # neighborhoods of pixels into larger \"super-pixels.\" It reduces the
    # resolution of the output image to
    # (width / binning_x) x (height / binning_y).
    # The default values binning_x = binning_y = 0 is considered the same
    # as binning_x = binning_y = 1 (no subsampling).
  11. RegionOfInterest roi
    # Region of interest (subwindow of full camera resolution), given in
    # full resolution (unbinned) image coordinates. A particular ROI
    # always denotes the same window of pixels on the camera sensor,
    # regardless of binning settings.
    # The default setting of roi (all values 0) is considered the same as
    # full resolution (roi.width = width, roi.height = height).

Enums

    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -52,7 +52,7 @@ "

    DiagnosticStatus

    # Copyright DB InfraGO AG and contributors
    # SPDX-License-Identifier: CC0-1.0
    #
    # This message holds the status of an individual component of the robot.

    Fields

    1. DiagnosticStatusLevel level
      # Level of operation enumerated above.
    2. string name
      # A description of the test/component reporting.
    3. string message
      # A description of the status.
    4. string hardware_id
      # A hardware unique string.
    5. KeyValue[] values
      # An array of values associated with the status.

    Enums

    1. DiagnosticStatusLevel
      # Possible levels of operations.
      • byte OK = 0
      • byte WARN = 1
      • byte ERROR = 2
      • byte STALE = 3
    " ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -75,7 +75,7 @@ "

    PointCloud2

    # Copyright DB InfraGO AG and contributors
    # SPDX-License-Identifier: CC0-1.0
    #
    # This message holds a collection of N-dimensional points, which may
    # contain additional information such as normals, intensity, etc. The
    # point data is stored as a binary blob, its layout described by the
    # contents of the \"fields\" array.
    #
    # The point cloud data may be organized 2d (image-like) or 1d (unordered).
    # Point clouds organized as 2d images may be produced by camera depth sensors
    # such as stereo or time-of-flight.

    Fields

    1. std_msgs/Header header
      # Time of sensor data acquisition, and the coordinate frame ID (for 3d points).
    2. uint32 height
      # 2D structure of the point cloud. If the cloud is unordered, height is
      # 1 and width is the length of the point cloud.
    3. uint32 width
      # 2D structure of the point cloud. If the cloud is unordered, height is
      # 1 and width is the length of the point cloud.
    4. PointField[] fields
      # Describes the channels and their layout in the binary data blob.
    5. bool is_bigendian
      # Is this data bigendian?
    6. uint32 point_step
      # Length of a point in bytes
    7. uint32 row_step
      # Length of a row in bytes
    8. uint8[] data
      # Actual point data, size is (row_step*height)
    9. bool is_dense
      # True if there are no invalid points

    Enums

      " ], "text/plain": [ - "" + "" ] }, "metadata": {}, diff --git a/docs/source/examples/data/empty_project_52/empty_project_52.capella.license b/docs/source/examples/data/empty_project_52/empty_project_52.capella.license index 1efec84..02c8c23 100644 --- a/docs/source/examples/data/empty_project_52/empty_project_52.capella.license +++ b/docs/source/examples/data/empty_project_52/empty_project_52.capella.license @@ -1,6 +1,2 @@ -<<<<<<< HEAD -SPDX-FileCopyrightText: Copyright DB Netz AG and the capellambse contributors -======= Copyright DB InfraGO AG and contributors ->>>>>>> 40ef464 (feat: Make tree view draggable) SPDX-License-Identifier: Apache-2.0 diff --git a/docs/source/howtos/howtos.rst b/docs/source/howtos/howtos.rst index 4d5e4ad..0d82cd1 100644 --- a/docs/source/howtos/howtos.rst +++ b/docs/source/howtos/howtos.rst @@ -4,9 +4,9 @@ .. _howtos: -******* +******** Examples -******* +******** This section contains a collection of examples that demonstrate how to use the library. @@ -14,25 +14,25 @@ Using the CLI ============= Import ROS2 Messages: ------------------------- +--------------------- .. code-block:: bash $ python -m capella_ros_tools -i messages docs/source/examples/data/example_msgs -o capella docs/source/examples/data/empty_project_52 -l la --port 5000 --exists-action=k --no-deps Import ROS2 Messages from Git Repository: ------------------------- +----------------------------------------- .. code-block:: bash $ python -m capella_ros_tools -i messages git+https://github.com/DSD-DBS/dsd-ros-msg-definitions-oss -o capella docs/source/examples/data/empty_project_52 -l la --port 5000 --exists-action=k -Export Capella Model ---------------------- +Export Capella Model (experimental): +------------------------------------ .. code-block:: bash $ python -m capella_ros_tools -i capella docs/source/examples/data/melody_model_60 -l la -o messages docs/source/examples/data/example_msgs --port 5000 -Export Capella Model from Git Repository: ------------------------- +Export Capella Model from Git Repository (experimental): +-------------------------------------------------------- .. code-block:: bash $ python -m capella_ros_tools -i capella git+https://github.com/DSD-DBS/coffee-machine -l la -o messages docs/source/examples/data/coffee_msgs --port 5000 diff --git a/docs/source/index.rst b/docs/source/index.rst index 52eade7..ccdd1eb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,16 +3,13 @@ SPDX-License-Identifier: Apache-2.0 -***************************** +*********************************************** Welcome to the Capella ROS Tools documentation! -***************************** +*********************************************** Overview ======== -.. image:: https://img.shields.io/badge/license-Apache%202-blue.svg - :target: - .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Black @@ -42,8 +39,8 @@ If you want a quickstart at how to use this tool, head right into the .. toctree:: + :maxdepth: 3 :caption: Examples - :titlesonly: howtos/howtos diff --git a/docs/source/usage/usage.rst b/docs/source/usage/usage.rst index 1c980f3..7568906 100644 --- a/docs/source/usage/usage.rst +++ b/docs/source/usage/usage.rst @@ -2,7 +2,7 @@ Copyright DB InfraGO AG and contributors SPDX-License-Identifier: Apache-2.0 -.. _howtos: +.. _usage: ***** Usage @@ -11,13 +11,25 @@ Usage This section describes how to use the Capella ROS Tools CLI. Import ROS2 Messages: ------------------------- +---------------------- .. code-block:: bash $ python -m capella_ros_tools -i messages -o capella -l --port= --exists-action= --no-deps -Export Capella Model ---------------------- +* "-i messages ", import ROS2 messages from +* "-o capella ", export to Capella model +* "-l ", use Capella model layer +* "--port=", start Capella model server at +* "--exists-action=", action to take if a Capella element already exists +* "--no-deps", do not import ROS2 dependencies (e.g. std_msgs) + +Export Capella Model (experimental): +------------------------------------ .. code-block:: bash $ python -m capella_ros_tools -i capella -l -o messages --port + +* "-i capella ", import Capella model from +* "-l ", use Capella model layer +* "-o messages ", export ROS2 messages to +* "--port=", start Capella model server at diff --git a/git-conventional-commits.json.license b/git-conventional-commits.json.license index 95e8b6e..b689e74 100644 --- a/git-conventional-commits.json.license +++ b/git-conventional-commits.json.license @@ -1,2 +1,2 @@ -Copyright DB Netz AG and contributors +Copyright DB InfraGO AG and contributors SPDX-License-Identifier: CC0-1.0 diff --git a/tests/test_rosidl2capella.py b/tests/test_rosidl2capella.py deleted file mode 100644 index 17bcb5d..0000000 --- a/tests/test_rosidl2capella.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 - -import capella_ros_tools - - -def test_add_some_tests_here(): - ...