From db857614a8bb6b8f9858333c1b1de924a3f1f35b Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Wed, 29 Jan 2025 20:41:45 +0100 Subject: [PATCH 01/16] [GH Action] Release page as external sphinx Project (#1965) - Created Sphinx Project that builds the release page (Release list and individual Download Pages) independent from the eCAL Documentation - The files are now generated with Jinja2 (not empy anymore) - The Release Page is not linked anywhere, yet - The GH Action uploads the release page as .zip file (always) and publishes it to GH Pages (for master builds only) --- .../workflows/documentation-release-page.yml | 77 ++++ .gitignore | 4 + doc/_static/css/bignums.css | 188 ++++++++ .../css/sphinx-book-theme-1.1.2-ecaladdon.css | 12 + doc/_static/css/tabs-3.4.5-ecaladdon.css | 93 ++++ doc/_static/img/ecal-logo.svg | 214 +++++++++ doc/_static/img/favicon.png | Bin 0 -> 1360 bytes doc/_templates/footer.html | 26 ++ doc/extensions/generate_release_page.py | 431 ++++++++++++++++++ .../resource/release_page.rst.jinja | 206 +++++++++ .../resource/release_page_index.rst.jinja | 44 ++ doc/include.txt | 78 ++++ doc/release_page/conf.py | 126 +++++ .../__init__.py | 431 ++++++++++++++++++ .../resource/release_page.rst.jinja | 206 +++++++++ .../resource/release_page_index.rst.jinja | 49 ++ 16 files changed, 2185 insertions(+) create mode 100644 .github/workflows/documentation-release-page.yml create mode 100644 doc/_static/css/bignums.css create mode 100644 doc/_static/css/sphinx-book-theme-1.1.2-ecaladdon.css create mode 100644 doc/_static/css/tabs-3.4.5-ecaladdon.css create mode 100644 doc/_static/img/ecal-logo.svg create mode 100644 doc/_static/img/favicon.png create mode 100644 doc/_templates/footer.html create mode 100644 doc/extensions/generate_release_page.py create mode 100644 doc/extensions/resource/release_page.rst.jinja create mode 100644 doc/extensions/resource/release_page_index.rst.jinja create mode 100644 doc/include.txt create mode 100644 doc/release_page/conf.py create mode 100644 doc/release_page/generate_release_documentation/__init__.py create mode 100644 doc/release_page/resource/release_page.rst.jinja create mode 100644 doc/release_page/resource/release_page_index.rst.jinja diff --git a/.github/workflows/documentation-release-page.yml b/.github/workflows/documentation-release-page.yml new file mode 100644 index 0000000000..6472ad3255 --- /dev/null +++ b/.github/workflows/documentation-release-page.yml @@ -0,0 +1,77 @@ +name: Documentation Release Page + +on: + push: + + release: + types: + - released + - unpublished + - deleted + +jobs: + documentation-release-page: + runs-on: ubuntu-latest + + steps: + + - name: Get current branch name + id: branch + run: | + # Get the branch name + branch=$(echo ${GITHUB_REF#refs/heads/}) + + # only publish documentation for master branch + if [[ $branch == master ]]; then + echo "publish_doc=true" >> $GITHUB_ENV + else + echo "publish_doc=false" >> $GITHUB_ENV + fi + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: 'false' + fetch-depth: 0 + + + - name: Install Python + run: | + sudo apt update + sudo apt-get -y install python3-dev python3-venv + + - name: Install Python dependencies + run: | + mkdir ".venv" + python3 -m venv ".venv" + source ".venv/bin/activate" + pip install --upgrade pip + pip install -r "$GITHUB_WORKSPACE/doc/requirements.txt" + + - name: Build Release page with Sphinx + env: + ECAL_GH_API_KEY: ${{ secrets.GITHUB_TOKEN }} + run: | + source ".venv/bin/activate" + sphinx-build -b html doc/release_page build/html + + - name: Zip Release Page + run: | + cd build/html + zip -r ../release-page.zip . + + - name: Upload documentation + uses: actions/upload-artifact@v4 + with: + name: release-page + path: build/release-page.zip + + - name: Deploy Release Page + uses: peaceiris/actions-gh-pages@v3 + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: build/html + destination_dir: releases + if: env.publish_doc == 'true' + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5a4805c230..b1ced1794c 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,10 @@ doc/rst/_download_main_page doc/extensions/_autogen doc/rst/getting_started/**/*_pb2.py doc/rst/.venv +doc/release_page/index.rst +doc/release_page/ecal_*.rst +doc/release_page/changelog_*.txt +doc/release_page/_build .venv/ *.pyc diff --git a/doc/_static/css/bignums.css b/doc/_static/css/bignums.css new file mode 100644 index 0000000000..f4084cbd53 --- /dev/null +++ b/doc/_static/css/bignums.css @@ -0,0 +1,188 @@ +.bignums, +.bignums-hint, +.bignums-note, +.bignums-caution, +.bignums-warning, +.bignums-attention, +.bignums-important, +.bignums-seealso, +.bignums-tip, +.bignums-danger, +.bignums-error, +.bignums-xxl { + padding: 0; + counter-reset: li-counter +} + +.bignums>li, +.bignums-hint>li, +.bignums-note>li, +.bignums-caution>li, +.bignums-warning>li, +.bignums-attention>li, +.bignums-important>li, +.bignums-seealso>li, +.bignums-tip>li, +.bignums-danger>li, +.bignums-error>li, +.bignums-xxl>li { + list-style: none; + position: relative; + padding: 1rem; + padding-left: 3.875rem; + padding-top: 1.2875rem; + background-color: #e6e6e6; + min-height: 4.3rem; + border-radius: .25rem +} + +.bignums>li>.first, +.bignums-hint>li>.first, +.bignums-note>li>.first, +.bignums-caution>li>.first, +.bignums-warning>li>.first, +.bignums-attention>li>.first, +.bignums-important>li>.first, +.bignums-seealso>li>.first, +.bignums-tip>li>.first, +.bignums-danger>li>.first, +.bignums-error>li>.first, +.bignums-xxl>li>.first { + font-weight: 600; + font-size: 1.15rem +} + +.bignums>li *:last-child, +.bignums-hint>li *:last-child, +.bignums-note>li *:last-child, +.bignums-caution>li *:last-child, +.bignums-warning>li *:last-child, +.bignums-attention>li *:last-child, +.bignums-important>li *:last-child, +.bignums-seealso>li *:last-child, +.bignums-tip>li *:last-child, +.bignums-danger>li *:last-child, +.bignums-error>li *:last-child, +.bignums-xxl>li *:last-child { + margin-bottom: 0 +} + +.bignums>li:before, +.bignums-hint>li:before, +.bignums-note>li:before, +.bignums-caution>li:before, +.bignums-warning>li:before, +.bignums-attention>li:before, +.bignums-important>li:before, +.bignums-seealso>li:before, +.bignums-tip>li:before, +.bignums-danger>li:before, +.bignums-error>li:before, +.bignums-xxl>li:before { + font-size: 1.15rem; + display: block; + position: absolute; + top: 1rem; + left: 1rem; + height: 2em; + width: 2em; + line-height: 2em; + text-align: center; + background-color: #313131; + color: #fff; + border-radius: 50%; + content: counter(li-counter, decimal); + counter-increment: li-counter; + font-weight: 600 +} + +.bignums>li+li, +.bignums-hint>li+li, +.bignums-note>li+li, +.bignums-caution>li+li, +.bignums-warning>li+li, +.bignums-attention>li+li, +.bignums-important>li+li, +.bignums-seealso>li+li, +.bignums-tip>li+li, +.bignums-danger>li+li, +.bignums-error>li+li, +.bignums-xxl>li+li { + margin-top: 1rem +} + +.bignums-hint>li, +.bignums-note>li { + background-color: #ebf7fb +} + +.bignums-hint>li:before, +.bignums-note>li:before { + background-color: #5bc0de; + color: #212121 +} + +.bignums-caution>li, +.bignums-warning>li, +.bignums-attention>li { + background-color: #fdf5ea +} + +.bignums-caution>li:before, +.bignums-warning>li:before, +.bignums-attention>li:before { + background-color: #f0ad4e; + color: #212121 +} + +.bignums-important>li, +.bignums-seealso>li, +.bignums-tip>li { + background-color: #ebf6eb +} + +.bignums-important>li:before, +.bignums-seealso>li:before, +.bignums-tip>li:before { + background-color: #5cb85c; + color: #fff +} + +.bignums-danger>li, +.bignums-error>li { + background-color: #faeaea +} + +.bignums-danger>li:before, +.bignums-error>li:before { + background-color: #d9534f; + color: #fff +} + +.bignums-xxl>li { + padding: 0; + padding-left: 3.75rem; + padding-top: .375rem; + background-color: transparent; + min-height: 3rem +} + +.bignums-xxl>li>.first { + font-size: 1.5rem +} + +.bignums-xxl>li:before { + font-size: 1.5rem; + top: 0; + left: 0 +} + +.bignums-xxl>li+li { + border-top: 1px solid rgba(0, 0, 0, 0.15); + margin-top: 1.375rem; + padding-top: 1.375rem +} + +.bignums-xxl>li+li:before { + top: 1rem +} \ No newline at end of file diff --git a/doc/_static/css/sphinx-book-theme-1.1.2-ecaladdon.css b/doc/_static/css/sphinx-book-theme-1.1.2-ecaladdon.css new file mode 100644 index 0000000000..0ff1c1d2c1 --- /dev/null +++ b/doc/_static/css/sphinx-book-theme-1.1.2-ecaladdon.css @@ -0,0 +1,12 @@ +html[data-theme=dark], +html[data-theme=light] { + --pst-color-primary: #ffa500; +} + +html[data-theme=light] { + --pst-color-secondary: #CC8400; +} + +html[data-theme=dark] { + --pst-color-secondary: #FFC04D; +} \ No newline at end of file diff --git a/doc/_static/css/tabs-3.4.5-ecaladdon.css b/doc/_static/css/tabs-3.4.5-ecaladdon.css new file mode 100644 index 0000000000..07065503ea --- /dev/null +++ b/doc/_static/css/tabs-3.4.5-ecaladdon.css @@ -0,0 +1,93 @@ +.sphinx-tabs { + margin-bottom: 1rem; +} + +[role="tablist"] { + border-bottom: 1px solid #a0a0a0; +} + +.sphinx-tabs-tab { + position: relative; + font-family: Lato,'Helvetica Neue',Arial,Helvetica,sans-serif; + color: var(--pst-color-muted); + line-height: 24px; + margin: 0; + font-size: 16px; + font-weight: 400; + background-color: var(--pst-color-background); + border-radius: 5px 5px 0 0; + border: 0; + padding: 1rem 1.5rem; + margin-bottom: 0; +} + +.sphinx-tabs-tab[aria-selected="true"] { + font-weight: 700; + border: 1px solid #a0a0a0; + border-bottom: 1px solid var(--pst-color-background); + margin: -1px; + background-color: var(--pst-color-background); + + box-shadow: 0 9px 0px -1px var(--pst-color-background), 0 3px 3px 0 var(--pst-color-shadow); +} + +.sphinx-tabs-tab:focus { + z-index: 1; + outline-offset: 1px; +} + +.sphinx-tabs-panel { + position: relative; + padding: 1rem; + border: 1px solid #a0a0a0; + margin: 0px -1px -1px -1px; + border-radius: 0 0 5px 5px; + border-top: 0; + background: var(--pst-color-background); + + box-shadow: 0 3px 3px 0px var(--pst-color-shadow); +} + +.sphinx-tabs-panel.code-tab { + padding: 0.4rem; +} + +.sphinx-tab img { + margin-bottom: 24 px; +} + +/* Dark theme preference styling */ + +@media (prefers-color-scheme: dark) { + body[data-theme="auto"] .sphinx-tabs-panel { + color: white; + background-color: rgb(50, 50, 50); + } + + body[data-theme="auto"] .sphinx-tabs-tab { + color: white; + background-color: rgba(255, 255, 255, 0.05); + } + + body[data-theme="auto"] .sphinx-tabs-tab[aria-selected="true"] { + border-bottom: 1px solid rgb(50, 50, 50); + background-color: rgb(50, 50, 50); + } +} + +/* Explicit dark theme styling */ + +body[data-theme="dark"] .sphinx-tabs-panel { + color: white; + background-color: rgb(50, 50, 50); +} + +body[data-theme="dark"] .sphinx-tabs-tab { + color: white; + background-color: rgba(255, 255, 255, 0.05); +} + +body[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] { + border-bottom: 2px solid rgb(50, 50, 50); + background-color: rgb(50, 50, 50); +} diff --git a/doc/_static/img/ecal-logo.svg b/doc/_static/img/ecal-logo.svg new file mode 100644 index 0000000000..3dd4b18c12 --- /dev/null +++ b/doc/_static/img/ecal-logo.svg @@ -0,0 +1,214 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/_static/img/favicon.png b/doc/_static/img/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..fe298c679a304a19215b7dd60aa3ba03fac51c7a GIT binary patch literal 1360 zcmV-W1+V&vP)tQ zK~z|UwU=vbR7DiWe{*-&ZGm=$VpouWm|`#jNonndr~#_Nhe8l67{dpm0etX`NW()& zLkegk1X`m32?mYv0R$=_BB2cmK`3nyP%BhW5ok+V(iSM)TkiG4*~{K#?{>R@|Kw!m z&YhWaX3m-anNiqKwSp{DV>TwaDEa^%?hka}5>SDnG7NS+TScRg%YWp8y z0L57yELDXVZh&extAPTgz@G|fDd6=)S`yTucn@qpD&P45C>RGGcYKW|(5^#cE7Uim znXstJg$XQCp>3~J3YFo9)MV#Ligv=s`y<?5=$&$V zuF>jv5kbH+e4umm-PB?ER`}v@^gk6cMk#o9FuXPro*M#MoG>hl2TZbC=RX-sWB zyuJx)EVm>huo9QgbYe02nV{9R-~ZD!3I9n%eUN?*%4%0_NS#|X3Ie8&ujAg*yU!tR20Wami z>Q|uK1J26rFibdb8a5wBbu7&}brn$>7oXouGW{nFsO6Hs*?nyy9n z3F>l0GZ#bF5;*oJeD(%ZybBYu!R_GNZ8lw<(#TC6*6odKOHGEy(&5pEL{46S^3&n} zAMJFl`j!1s+CBwH1A;S-P2Nds)oOeN< zLl9;SjK5uWIP!xDC>Svaw$1N+e3kG(I0zF#Z9U`_i*m0UMm_<4AN1-WQGc`+%75+J zTyb;Romp^be>idmZUkkEH%y1YeZ&1rzK8dB!CRYQ*FqQ+gF7t5-GSmg!Ve8CA_q>3 z^86gwyC_mQz?`u#K1;}H`bH`5$p9yQ@O6Xr)11jkDOfWV2KNzH&D#=9L7NEA(%F2>F&~zOR{swuO(9Ij$h=J*F=nwd}NsjIHcBniDx*-7!cfkXVtuUoT z(sG6$w$2yEi-pX^(YxjM!6!4Mo^TALrNB3HCHiaYVe&d>cNiw@u7<1EJD;x$cUos7 zzMcy&ub1oC^DD*IO2MQYxi^&lAXM!HdoGB3CF=~0tuU&{IZcDaz??B~rVe&gN}H7n zPDw7%-N=h&Kzk69x^U^RBP|77A*=1#(Bpy+rozOhz!h@xvWekwZNb~siyBY?&=_MC z@t{Hm*t21;9&&tLF(S;;rJ!6xQ3@FK&64XAg~byuu7OEwr9Q=hJ1n%cK|?bDhB7E| zZ7k>V%v_RzXRcm@TP8f<2A8XAF=6M49!c=(NV!MYS8qMd>YCv~V<>Bztjb!>m*K~$ zo0UKTcS+9)z%b#x><*TxLX3z-R<0mZ)0k~SF7OEV_j!I1IAAC~%vs6_>&Jf~n71f7 SaNHIE0000 + .links-container ul { + list-style-type: none; + padding: 0; + } + + .links-container ul li { + display: inline; + margin-right: 10px; + } + + .links-container ul li:last-child { + margin-right: 0; + } + + diff --git a/doc/extensions/generate_release_page.py b/doc/extensions/generate_release_page.py new file mode 100644 index 0000000000..48ca6a4a23 --- /dev/null +++ b/doc/extensions/generate_release_page.py @@ -0,0 +1,431 @@ +import os + +import sys +import re +import github +import jinja2 +import semantic_version +from collections import OrderedDict + +ubuntu_default_python_version_dict = \ +{ + semantic_version.Version("18.4.0"): semantic_version.Version("3.6.0"), + semantic_version.Version("20.4.0"): semantic_version.Version("3.8.0"), + semantic_version.Version("22.4.0"): semantic_version.Version("3.10.0"), + semantic_version.Version("24.4.0"): semantic_version.Version("3.12.0"), +} + +ubuntu_codename_dict = \ +{ + "noble": semantic_version.Version("24.4.0"), + "jammy": semantic_version.Version("22.4.0"), + "focal": semantic_version.Version("20.4.0"), + "bionic": semantic_version.Version("18.4.0"), + "xenial": semantic_version.Version("16.4.0"), + "trusty": semantic_version.Version("14.4.0"), +} + +""" +Retrieves a dictionary of release branches and their corresponding releases from the GitHub repository. +Args: + gh_repo (github.Github): An authenticated GitHub instance. +Returns: + dict: A dictionary where the keys are minor relase numbers (-> patch level + set to 0) and Values are Dictionaries of + {specific_release : gh_release_object} +Example: + { + Version('5.8.0'): { + Version('5.8.0'): , + Version('5.8.1'): + }, + Version('5.9.0'): { + Version('5.9.0'): + } + } +""" +def get_releases_dict(gh_repo): + gh_releases = gh_repo.get_releases() + + gh_release_branches_dict = OrderedDict() + + for gh_release in gh_releases: + if gh_release.prerelease or gh_release.draft: + continue + + version_string = gh_release.tag_name + + if version_string.startswith("v") or version_string.startswith("V"): + version_string = version_string[1:] + if version_string.startswith("."): + version_string = version_string[1:] + + # Fix format, so it can be parsed by semantic_version: + dot_components = version_string.split(".") + if len(dot_components) == 4: + version_string = '.'.join(dot_components[:-1]) + "+" + dot_components[3] + elif len(dot_components) == 5: + version_string = '.'.join(dot_components[:-2]) + "-" + dot_components[3] + "+" + dot_components[4] + + try: + version = semantic_version.Version(version_string) + except: + sys.stderr.write("Warning: eCAL Release \"" + gh_release.tag_name + "\" is not parsable to a proper version.\n") + continue + + version = semantic_version.Version(version_string) + release_branch = semantic_version.Version(major = version.major, minor = version.minor, patch = 0) + + if not release_branch in gh_release_branches_dict: + # Initialize dicitonary for this branch + gh_release_branches_dict[release_branch] = OrderedDict() + + gh_release_branches_dict[release_branch][version] = gh_release + + # Sort the minor eCAL Release branches by version + gh_release_branches_dict = OrderedDict(sorted(gh_release_branches_dict.items(), key = lambda x: x[0], reverse = True)) + + # Sort the specific releases by version + for release_branch in gh_release_branches_dict: + gh_release_branches_dict[release_branch] = OrderedDict(sorted(gh_release_branches_dict[release_branch].items(), key = lambda x: x[0], reverse = True)) + + return gh_release_branches_dict + +""" +Retrieves the properties of a given GitHub asset. + +Args: + ecal_version (semantic_version.Version): The version of eCAL. + gh_asset (github.Asset): The GitHub asset object. + +Returns: + dict: A dictionary containing the properties of the asset, including: + + { + 'filename' : 'actual filename', + 'download_link': 'browser download link', + 'type' : 'source / ecal_installer / python_binding', + 'properties' : SEE BELOW, + } + + Properties for "source": + {} + + Properties for "ecal_installer": + { + 'os': 'windows / macos / ubuntu', + 'os_version': Semver('0.0.0') (Only for Ubuntu specific installers), + 'cpu': 'amd64 / arm64' + } + + Properties for "python_binding": + { + 'os': 'manylinux / macos / windows / ubuntu', + 'os_version': Semver('0.0.0') (Only for Ubuntu specific bindings), + 'cpu': 'amd64 / arm64', + 'python_version': Semver('3.6.0') (example) + 'python_implementation': 'cp / pp etc.' (i.e. CPython or PyPy) + } +""" +def get_asset_properties(ecal_version, gh_asset): + asset_properties = { + 'filename' : '', + 'download_link': '', + 'type' : '', + 'properties' : {}, + } + + asset_properties['filename'] = gh_asset.name + asset_properties['download_link'] = gh_asset.browser_download_url + + # Source + if asset_properties['filename'].endswith('tar.gz'): + asset_properties['type'] = 'source' + + # eCAL Installer for Windows + elif asset_properties['filename'].endswith('.msi') or asset_properties['filename'].endswith('.exe'): + asset_properties['type'] = 'ecal_installer' + asset_properties['properties']['os'] = 'windows' + asset_properties['properties']['cpu'] = 'amd64' + + # eCAL installer for macOS + elif asset_properties['filename'].endswith('.dmg'): + asset_properties['type'] = 'ecal_installer' + asset_properties['properties']['os'] = 'macos' + asset_properties['properties']['cpu'] = 'amd64' + + # eCAL Installer for Linux + elif asset_properties['filename'].endswith('.deb'): + asset_properties['type'] = 'ecal_installer' + asset_properties['properties']['os'] = 'ubuntu' + asset_properties['properties']['os_version'] = semantic_version.Version('0.0.0') + asset_properties['properties']['cpu'] = 'amd64' + + if ecal_version <= semantic_version.Version("5.7.2"): + # Special case for old releases. They only had Ubuntu 20.04 releases that were just named "linux". + asset_properties['properties']['os_version'] = semantic_version.Version("20.4.0") + else: + for codename, version in ubuntu_codename_dict.items(): + if codename in asset_properties['filename']: + asset_properties['properties']['os_version'] = version + break + + if ecal_version <= semantic_version.Version("5.7.2"): + # Special case for old releases. They only had Ubuntu 20.04 releases that were just named "linux". + asset_properties['properties']['os_version'] = semantic_version.Version("20.4.0") + + # Python binding (whl) + elif asset_properties['filename'].endswith('.whl'): + asset_properties['type'] = 'python_binding' + + # Get Operating system + if 'manylinux' in asset_properties['filename']: + asset_properties['properties']['os'] = 'manylinux' + elif 'darwin' in asset_properties['filename'] or 'macos' in asset_properties['filename']: + asset_properties['properties']['os'] = 'macos' + elif "win64" in asset_properties['filename'] or "win_amd64" in asset_properties['filename']: + asset_properties['properties']['os'] = 'windows' + elif 'linux' in asset_properties['filename']: + # Old eCAL 5.x wheels were Ubuntu specific + asset_properties['properties']['os'] = 'ubuntu' + for codename, version in ubuntu_codename_dict.items(): + if codename in asset_properties['filename']: + asset_properties['properties']['os_version'] = version + break + else: + sys.stderr.write("Warning: Unable to determine OS of python binding: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + # Get Python CPU Architecture + filename_without_extension = os.path.splitext(asset_properties['filename'])[0] + if filename_without_extension.endswith('amd64') or filename_without_extension.endswith('x86_64') or filename_without_extension.endswith('win64'): + asset_properties['properties']['cpu'] = 'amd64' + elif filename_without_extension.endswith('arm64') or filename_without_extension.endswith('aarch64'): + asset_properties['properties']['cpu'] = 'arm64' + else: + sys.stderr.write("Warning: Unable to determine CPU Architecture of python binding: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + # Get Python version + python_version = semantic_version.Version("0.0.0") + python_implementation = '' + components = asset_properties['filename'][:-4].split('-') + # The python version is either index 2 or 3, depending on whether the optional build tag is used. + for index in range(2,4): + if re.match(r"[a-z]{2}[0-9]+", components[index]): + python_implementation = components[index][:2] + python_version_major_string = components[index][2] + python_verstion_minor_string = "0" + if len(components[index]) > 3: + python_verstion_minor_string = components[index][3:] + python_version = semantic_version.Version(python_version_major_string + "." + python_verstion_minor_string + ".0") + break + + if python_version == semantic_version.Version("0.0.0"): + sys.stderr.write("Warning: Unable to determine python version: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + if not python_implementation: + sys.stderr.write("Warning: Unable to determine python implementation: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + asset_properties['properties']['python_version'] = python_version + asset_properties['properties']['python_implementation'] = python_implementation + + # Python binding (.egg) + elif asset_properties['filename'].endswith('.egg'): + asset_properties['type'] = 'python_binding' + + # Get Operating system + if 'darwin' in asset_properties['filename'] or 'macos' in asset_properties['filename']: + asset_properties['properties']['os'] = 'macos' + elif "win64" in asset_properties['filename'] or "win_amd64" in asset_properties['filename']: + asset_properties['properties']['os'] = 'windows' + elif 'linux' in asset_properties['filename'] or 'bionic' in asset_properties['filename'] or 'focal' in asset_properties['filename']: + asset_properties['properties']['os'] = 'ubuntu' + if ecal_version <= semantic_version.Version("5.7.2"): + # Special case for old releases. They only had Ubuntu 20.04 releases that were just named "linux". + asset_properties['properties']['os_version'] = semantic_version.Version("20.4.0") + else: + for codename, version in ubuntu_codename_dict.items(): + if codename in asset_properties['filename']: + asset_properties['properties']['os_version'] = version + break + + if not asset_properties['properties'].get('os'): + sys.stderr.write("Warning: Unable to determine OS of python binding: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + # Get python version + python_version = semantic_version.Version("0.0.0") + python_match_result = re.findall(r"py[0-9]+\.[0-9]+", asset_properties['filename']) + if len(python_match_result) > 0: + python_version = semantic_version.Version(python_match_result[0][2:] + ".0") + + if python_version == semantic_version.Version("0.0.0"): + sys.stderr.write("Warning: Unable to determine python version: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + asset_properties['properties']['python_version'] = python_version + asset_properties['properties']['python_implementation'] = 'cp' # The eggs were all CPython + + # CPU Architecture was always amd64 back then + asset_properties['properties']['cpu'] = 'amd64' + + # Warning, as we have no idea what this file is for + else: + sys.stderr.write("Warning: Unknown asset type: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + return asset_properties + +def generate_release_index_page(releases_dict, list_of_supported_minor_versions, output_filename): + # Create the output directory if it does not exist + output_dir = os.path.dirname(output_filename) + if output_dir and not os.path.exists(output_dir): + os.makedirs(output_dir) + + # Load the Jinja2 template + template_loader = jinja2.FileSystemLoader(searchpath="resource/") + template_env = jinja2.Environment(loader=template_loader) + template_file = "release_page_index.rst.jinja" + template = template_env.get_template(template_file) + + # Render the template with the context + context = { + 'releases_dict': releases_dict, + 'list_of_supported_minor_versions': list_of_supported_minor_versions, + 'group_asset_list_by_os_and_arch': group_asset_list_by_os_and_arch, + 'get_rst_release_page_label': get_rst_release_page_label, + } + output = template.render(context) + + # Save the rendered template to a file + with open(output_filename, "w") as f: + f.write(output) + +def generate_release_page(gh_release, + ecal_version, + asset_list, + minor_is_supported, + latest_version_of_minor, + output_dir): + ecal_version_string = str(ecal_version).replace('.', '_').replace('-', '_').replace('+', '_') + output_filename = "ecal_" + ecal_version_string + ".rst" + changelog_file = "changelog_ecal_" + ecal_version_string + ".txt" + + # Create the output directory if it does not exist + if output_dir and not os.path.exists(output_dir): + os.makedirs(output_dir) + + # Save the changelog to a file + changelog = gh_release.body + changelog = changelog.replace('\r\n', '\n') + with open(os.path.join(output_dir, changelog_file), "w") as f: + f.write(changelog) + + # Load the Jinja2 template + template_loader = jinja2.FileSystemLoader(searchpath="resource/") + template_env = jinja2.Environment(loader=template_loader) + template_file = "release_page.rst.jinja" + template = template_env.get_template(template_file) + + # Render the template with the context + context = { + 'gh_release': gh_release, + 'ecal_version': ecal_version, + 'asset_list': asset_list, + 'changelog_file_path': changelog_file, + 'minor_is_supported': minor_is_supported, + 'latest_version_of_minor': latest_version_of_minor, + 'ubuntu_default_python_version_dict': ubuntu_default_python_version_dict, + 'group_asset_list_by_os_and_arch': group_asset_list_by_os_and_arch, + 'get_rst_release_page_label': get_rst_release_page_label, + } + output = template.render(context) + + # Save the rendered template to a file + path = os.path.join(output_dir, output_filename) + with open(path, "w") as f: + f.write(output) + +""" +Groups a list of assets by their OS, OS version, and CPU architecture. +Args: + asset_list (list): A list of asset properties dictionaries. +Returns: + dict: A dictionary where the keys are tuples of (os, os_version, cpu) and + the values are lists of asset properties dictionaries. +""" +def group_asset_list_by_os_and_arch(asset_list): + os_arch_dict = OrderedDict() + + for asset_properties in asset_list: + os = asset_properties['properties'].get('os', 'unknown') + os_version = asset_properties['properties'].get('os_version', semantic_version.Version('0.0.0')) + cpu = asset_properties['properties'].get('cpu', 'unknown') + + key = (os, os_version, cpu) + if key not in os_arch_dict: + os_arch_dict[key] = [] + os_arch_dict[key].append(asset_properties) + + return os_arch_dict + +def get_rst_release_page_label(ecal_version): + return "ecal_release_page_" + str(ecal_version).replace('.', '_').replace('-', '_').replace('+', '_') + +def generate_release_documentation(gh_api_key, index_filepath, release_dir_path): + gh = github.Github(gh_api_key) + gh_repo = gh.get_repo("eclipse-ecal/ecal") + releases_dict = get_releases_dict(gh_repo) + + list_of_supported_minor_versions = list(releases_dict.keys())[:2] + + generate_release_index_page(releases_dict, + list_of_supported_minor_versions, + index_filepath) + + for minor_version in releases_dict: + + # Get the latest eCAL Version of this release branch + latest_release_for_this_minor = list(releases_dict[minor_version].keys())[0] + this_minor_is_supported = minor_version in list_of_supported_minor_versions + + for ecal_version in releases_dict[minor_version]: + + # Check the support status of this release + + gh_release = releases_dict[minor_version][ecal_version] + gh_asset_list = gh_release.get_assets() + + asset_list = [] + + for gh_asset in gh_asset_list: + asset_properties = get_asset_properties(ecal_version, gh_asset) + asset_list.append(asset_properties) + + # Sort the asset list by: + # 1. OS (windows > manylinux > ubuntu > macos) + # 2. OS version (descending) + # 3. CPU (amd64 > arm64) + # 4. Python version (descending) + + asset_list.sort(key = lambda x: x['properties'].get('python_version', semantic_version.Version("0.0.0")), reverse = True) + asset_list.sort(key = lambda x: x['properties'].get('os_version', semantic_version.Version("0.0.0")), reverse = True) + asset_list.sort(key = lambda x: x['properties'].get('cpu', 'unknown')) + asset_list.sort(key = lambda x: ['windows', 'manylinux', 'ubuntu', 'macos'].index(x['properties'].get('os', 'unknown')) if x['properties'].get('os', 'unknown') in ['windows', 'manylinux', 'ubuntu', 'macos'] else float('inf')) + + generate_release_page(gh_release, + ecal_version, + asset_list, + this_minor_is_supported, + latest_release_for_this_minor, + release_dir_path) + +if __name__=="__main__": + gh_api_key = os.getenv("ECAL_GH_API_KEY") + if gh_api_key: + generate_release_documentation(gh_api_key, "index.rst", "release") + else: + sys.stderr.write("ERROR: Environment variable ECAL_GH_API_KEY not set. Without an API key, GitHub will not provide enough API calls to generate the download tables.\n") + exit(1) + + + + + + + diff --git a/doc/extensions/resource/release_page.rst.jinja b/doc/extensions/resource/release_page.rst.jinja new file mode 100644 index 0000000000..4411a39b01 --- /dev/null +++ b/doc/extensions/resource/release_page.rst.jinja @@ -0,0 +1,206 @@ +{% set ecal_version_string = ecal_version | string -%} + +{# Makro for properly naming the OS, possibly with icon. e.g. "|fa-windows| Windows" (-> capitalized) or |fa-ubuntu| Ubuntu 24.04 (-> with Version number) -#} +{% macro get_os_string(asset, with_icon) -%} + {% if asset['properties']['os'] == 'windows' -%} + {% set os_string = (with_icon and '|fa-windows| ' or '') ~ 'Windows' -%} + {% elif asset['properties']['os'] == 'macos' -%} + {% set os_string = (with_icon and '|fa-apple| ' or '') ~ 'macOS' -%} + {% elif asset['properties']['os'] == 'ubuntu' -%} + {% set os_version_padded = asset['properties']['os_version'].major ~ '.' ~ '%02d' | format(asset['properties']['os_version'].minor) -%} + {% set os_string = (with_icon and '|fa-Ubuntu| ' or '') ~ 'Ubuntu ' ~ os_version_padded -%} + {% elif asset['properties']['os'] == 'manylinux' -%} + {% set os_string = (with_icon and '|fa-linux| ' or '') ~ 'Linux (All)' -%} + {% elif asset['properties']['os'] == '' -%} + {% set os_string = 'Unknown' -%} + {% else -%} + {% set os_string = asset['properties']['os'].capitalize() -%} + {% endif -%} + {{ os_string -}} +{% endmacro -%} + +{# Makro for naming the CPU Architecture. Mainly to make amd64 to x64, so the user can more easily distinguish it from arm64 #} +{% macro get_cpu_string(asset) -%} + {% if asset['properties']['cpu'] == 'amd64' -%} + {% set cpu_string = 'x64' -%} + {% elif asset['properties']['cpu'] == 'arm64' -%} + {% set cpu_string = 'ARM64' -%} + {% else -%} + {% set cpu_string = asset['properties']['cpu'] -%} + {% endif -%} + {{ cpu_string -}} +{% endmacro -%} +:orphan: + +.. include:: /../include.txt + +.. _{{ get_rst_release_page_label(ecal_version) }}: + +=============== +eCAL {{ ecal_version_string }} +=============== + +{% if not minor_is_supported %} +.. warning:: + + eCAL {{ ecal_version.major }}.{{ ecal_version.minor }} is not supported anymore. Please consider upgrading to a newer version. +{% endif %} + +- Release Date: {{ gh_release.published_at.strftime('%Y-%m-%d') }} +- GitHub Release Page: {{ gh_release.html_url }} + +Changelog +========= + +.. literalinclude:: {{ changelog_file_path }} + :language: text + +Downloads +========= + +{% if ecal_version < latest_version_of_minor %} +.. note:: + + A more recent version of eCAL {{ ecal_version.major }}.{{ ecal_version.minor }} is available: :ref:`eCAL {{ latest_version_of_minor }} <{{ get_rst_release_page_label(latest_version_of_minor) }}>`. +{% endif %} + +{# Get the ecal_installers from the list and remove them from the main list. -#} +{% set ecal_installer_list = asset_list | selectattr('type', 'equalto', 'ecal_installer') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'ecal_installer') | list -%} + +{% if ecal_installer_list %} +eCAL Installer +-------------- + +.. list-table:: + :widths: 2 2 6 + :header-rows: 1 + + * - OS + + - Architecture + + - Files + + {% for asset in ecal_installer_list -%} + + * - {{ get_os_string(asset, true) }} + + - {{ get_cpu_string(asset) }} + + - `{{ asset['filename'] }} <{{ asset['download_link'] }}>`__ + + {% endfor -%} + +{% endif -%} + +{# Get the python bindings from the list -#} +{% set python_binding_list = asset_list | selectattr('type', 'equalto', 'python_binding') | selectattr('properties.python_implementation', 'equalto', 'cp') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'python_binding') | list -%} + +{% if python_binding_list %} +|fa-python| Python Binding +-------------------------- + +.. list-table:: + :widths: 2 2 6 + :header-rows: 1 + + * - OS + + - Architecture + + - Files + + {% set python_binding_grouped_dict = group_asset_list_by_os_and_arch(python_binding_list) -%} + + {% for key, value in python_binding_grouped_dict.items() -%} + {% if value[0]['properties']['os'] == 'ubuntu' -%} + {% set default_python_version = ubuntu_default_python_version_dict[value[0]['properties']['os_version']] -%} + {% endif %} + * - {{ get_os_string(value[0], true) }} + + - {{ get_cpu_string(value[0]) }} + + - {% for asset in value -%} + `Python {{ asset['properties']['python_version'].major }}.{{ asset['properties']['python_version'].minor }} (.{{ asset['filename'].split('.')[-1] }}) <{{ asset['download_link'] }}>`__ {% if asset['properties']['python_version'] == default_python_version %} (Default){% endif %} + + {% endfor -%} + + {% endfor -%} + +{% endif -%} + +{# Get the PyPy bindings from the list -#} +{% set pypy_binding_list = asset_list | selectattr('type', 'equalto', 'python_binding') | selectattr('properties.python_implementation', 'equalto', 'pp') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'python_binding') | list -%} + +{% if pypy_binding_list %} +|fa-python| PyPy Binding +------------------------ + +*PyPy bindings are not compatibly with the regular Python implementation.* + +.. list-table:: + :widths: 2 2 6 + :header-rows: 1 + + * - OS + + - Architecture + + - Files + + {% set pypy_binding_grouped_dict = group_asset_list_by_os_and_arch(pypy_binding_list) -%} + + {% for key, value in pypy_binding_grouped_dict.items() %} + * - {{ get_os_string(value[0], true) }} + + - {{ get_cpu_string(value[0]) }} + + - {% for asset in value -%} + `PyPy {{ asset['properties']['python_version'].major }}.{{ asset['properties']['python_version'].minor }} (.{{ asset['filename'].split('.')[-1] }}) <{{ asset['download_link'] }}>`__ + + {% endfor -%} + + {% endfor -%} + +{% endif -%} + +{# Get the source files from the list -#} +{% set source_file_list = asset_list | selectattr('type', 'equalto', 'source') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'source') | list -%} + +{% if source_file_list %} +|fa-code| Source +---------------- + +.. list-table:: + :widths: 1 + + {% for asset in source_file_list -%} + + * - `{{ asset['filename'] }} <{{ asset['download_link'] }}>`__ + + {% endfor -%} + +{% endif %} + +{# Get the other files from the list -#} +{% if asset_list %} +Other Downloads +--------------- + +.. list-table:: + :widths: 1 + :header-rows: 1 + + * - Files + + {% for asset in asset_list -%} + + * - `{{ asset['filename'] }} <{{ asset['download_link'] }}>`__ + + {% endfor -%} + +{% endif -%} \ No newline at end of file diff --git a/doc/extensions/resource/release_page_index.rst.jinja b/doc/extensions/resource/release_page_index.rst.jinja new file mode 100644 index 0000000000..4b3deac6b5 --- /dev/null +++ b/doc/extensions/resource/release_page_index.rst.jinja @@ -0,0 +1,44 @@ +.. include:: /../include.txt + +.. _all_releases: + +============ +All releases +============ + +Here you can find a list of all eCAL Versions ever released on GitHub. + +{% for minor_version, releases_dict in releases_dict.items() %} +eCAL {{ minor_version.major }}.{{ minor_version.minor }} +=========== + +{% if minor_version not in list_of_supported_minor_versions -%} + +*eCAL {{ minor_version.major }}.{{ minor_version.minor }} has reached its end of life.* + +{% endif -%} + +.. list-table:: + :widths: 3 3 4 + :header-rows: 1 + + * - Release + + - Release Date + + - Support Status + +{% for ecal_version, gh_release in releases_dict.items() -%} +{% set is_latest_release_in_this_minor = (ecal_version == releases_dict.keys()|list|first) %} + * - :ref:`eCAL {{ gh_release.tag_name }} <{{ get_rst_release_page_label(ecal_version) }}>` + + - {{ gh_release.published_at.strftime("%Y-%m-%d") }} + + - {% if (minor_version in list_of_supported_minor_versions) and is_latest_release_in_this_minor -%} + Supported + {% else -%} + EOL + {% endif -%} +{% endfor -%} + +{% endfor -%} \ No newline at end of file diff --git a/doc/include.txt b/doc/include.txt new file mode 100644 index 0000000000..0907e80e11 --- /dev/null +++ b/doc/include.txt @@ -0,0 +1,78 @@ + +.. |fa-windows| raw:: html + + + +.. |fa-linux| raw:: html + + + +.. |fa-ubuntu| raw:: html + + + +.. |fa-apple| raw:: html + + + +.. |fa-folder-open| raw:: html + + + +.. |fa-folder| raw:: html + + + +.. |fa-file| raw:: html + + + +.. |fa-file-alt| raw:: html + + + +.. |fa-download| raw:: html + + + +.. |fa-github| raw:: html + + + +.. |fa-book| raw:: html + + + +.. |fa-copy| raw:: html + + + +.. |fa-python| raw:: html + + + +.. |fa-pencil-alt| raw:: html + + + +.. |fa-code| raw:: html + + + + +.. |ecalini-path-windows| replace:: :file:`C:\\ProgramData\\eCAL\\ecal.yaml` +.. |ecalini-path-ubuntu| replace:: :file:`/etc/ecal/ecal.yaml` + +.. |ecalini-path-windows-old| replace:: :file:`C:\\eCAL\\cfg\\ecal.yaml` +.. |ecalini-path-ubuntu-old| replace:: :file:`/usr/etc/ecal/ecal.yaml` + + +.. |person_snd-path-windows| replace:: :file:`C:\\eCAL\\samples\\bin\\ecal_sample_person_snd.exe` +.. |person_rec-path-windows| replace:: :file:`C:\\eCAL\\samples\\bin\\ecal_sample_person_rec.exe` +.. |service_server_c-path-windows| replace:: :file:`C:\\eCAL\\samples\\bin\\ecal_sample_minimal_server_c.exe` +.. |service_client_c-pathwindows| replace:: :file:`C:\\eCAL\\samples\\bin\\ecal_sample_minimal_client_c.exe` + +.. |ecal_mon-start-menu-path-windows| replace:: :file:`Start / eCAL / eCAL Monitor` +.. |ecal_rec-start-menu-path-windows| replace:: :file:`Start / eCAL / eCAL Recorder` +.. |ecal_play-start-menu-path-windows| replace:: :file:`Start / eCAL / eCAL Player` +.. |ecal_sys-start-menu-path-windows| replace:: :file:`Start / eCAL / eCAL Sys` diff --git a/doc/release_page/conf.py b/doc/release_page/conf.py new file mode 100644 index 0000000000..4c6132a61b --- /dev/null +++ b/doc/release_page/conf.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +import os +import sys + +# -- Generate download archive and tables for the homepage -------------------- +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import generate_release_documentation + +gh_api_key = os.getenv("ECAL_GH_API_KEY") +if gh_api_key: + release_page_dir = "." + index_file_path = "./index.rst" + generate_release_documentation.generate_release_documentation(gh_api_key, index_file_path, release_page_dir) +else: + print("ERROR: Environment variable ECAL_GH_API_KEY not set. Skipping generating download tables.") + exit(1) + +# -- Project information ----------------------------------------------------- + +project = u'Eclipse eCAL™' +copyright = u'2023, Continental' +#author = u'Continental' + +# The short X.Y version +# version = u'' +# The full version, including alpha/beta/rc tags +# release = u'' + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx_book_theme', + 'sphinx_tabs.tabs', + 'sphinx.ext.githubpages', +] + +# Tell sphinx what the primary language being documented is. +#primary_domain = 'cpp' + +# Tell sphinx what the pygments highlight language should be. +#highlight_language = 'cpp' + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['../_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +# pygments_style = 'sphinx' + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'sphinx_book_theme' + + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['../_static'] + +html_css_files = [ + 'css/bignums.css', # Enable the bignum feature from the sphinx-typo3-theme + 'css/sphinx-book-theme-1.1.2-ecaladdon.css', # Change colors of the sphinx-book-theme + 'css/tabs-3.4.5-ecaladdon.css', # Change colors of the sphinx-tabs +] + +html_title = "Eclipse eCAL™" +html_logo = "../_static/img/ecal-logo.svg" +html_favicon = "../_static/img/favicon.png" + +html_theme_options = { + "logo_only": True, + "show_navbar_depth": 1, + "show_toc_level": 2, + "repository_url": "https://github.com/eclipse-ecal/ecal/", + "use_repository_button": False, + "use_issues_button": False, + "use_edit_page_button": False, + "repository_branch": "master", + "path_to_docs": "doc/rst/", + "extra_navbar": "", # => Remove the default text + "footer_start": ["footer.html"], + "extra_footer": '', +} + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'eCALdoc' + +# C++ defines used in function definitions +cpp_id_attributes = ['ECAL_API', 'ECALTIME_API'] diff --git a/doc/release_page/generate_release_documentation/__init__.py b/doc/release_page/generate_release_documentation/__init__.py new file mode 100644 index 0000000000..48ca6a4a23 --- /dev/null +++ b/doc/release_page/generate_release_documentation/__init__.py @@ -0,0 +1,431 @@ +import os + +import sys +import re +import github +import jinja2 +import semantic_version +from collections import OrderedDict + +ubuntu_default_python_version_dict = \ +{ + semantic_version.Version("18.4.0"): semantic_version.Version("3.6.0"), + semantic_version.Version("20.4.0"): semantic_version.Version("3.8.0"), + semantic_version.Version("22.4.0"): semantic_version.Version("3.10.0"), + semantic_version.Version("24.4.0"): semantic_version.Version("3.12.0"), +} + +ubuntu_codename_dict = \ +{ + "noble": semantic_version.Version("24.4.0"), + "jammy": semantic_version.Version("22.4.0"), + "focal": semantic_version.Version("20.4.0"), + "bionic": semantic_version.Version("18.4.0"), + "xenial": semantic_version.Version("16.4.0"), + "trusty": semantic_version.Version("14.4.0"), +} + +""" +Retrieves a dictionary of release branches and their corresponding releases from the GitHub repository. +Args: + gh_repo (github.Github): An authenticated GitHub instance. +Returns: + dict: A dictionary where the keys are minor relase numbers (-> patch level + set to 0) and Values are Dictionaries of + {specific_release : gh_release_object} +Example: + { + Version('5.8.0'): { + Version('5.8.0'): , + Version('5.8.1'): + }, + Version('5.9.0'): { + Version('5.9.0'): + } + } +""" +def get_releases_dict(gh_repo): + gh_releases = gh_repo.get_releases() + + gh_release_branches_dict = OrderedDict() + + for gh_release in gh_releases: + if gh_release.prerelease or gh_release.draft: + continue + + version_string = gh_release.tag_name + + if version_string.startswith("v") or version_string.startswith("V"): + version_string = version_string[1:] + if version_string.startswith("."): + version_string = version_string[1:] + + # Fix format, so it can be parsed by semantic_version: + dot_components = version_string.split(".") + if len(dot_components) == 4: + version_string = '.'.join(dot_components[:-1]) + "+" + dot_components[3] + elif len(dot_components) == 5: + version_string = '.'.join(dot_components[:-2]) + "-" + dot_components[3] + "+" + dot_components[4] + + try: + version = semantic_version.Version(version_string) + except: + sys.stderr.write("Warning: eCAL Release \"" + gh_release.tag_name + "\" is not parsable to a proper version.\n") + continue + + version = semantic_version.Version(version_string) + release_branch = semantic_version.Version(major = version.major, minor = version.minor, patch = 0) + + if not release_branch in gh_release_branches_dict: + # Initialize dicitonary for this branch + gh_release_branches_dict[release_branch] = OrderedDict() + + gh_release_branches_dict[release_branch][version] = gh_release + + # Sort the minor eCAL Release branches by version + gh_release_branches_dict = OrderedDict(sorted(gh_release_branches_dict.items(), key = lambda x: x[0], reverse = True)) + + # Sort the specific releases by version + for release_branch in gh_release_branches_dict: + gh_release_branches_dict[release_branch] = OrderedDict(sorted(gh_release_branches_dict[release_branch].items(), key = lambda x: x[0], reverse = True)) + + return gh_release_branches_dict + +""" +Retrieves the properties of a given GitHub asset. + +Args: + ecal_version (semantic_version.Version): The version of eCAL. + gh_asset (github.Asset): The GitHub asset object. + +Returns: + dict: A dictionary containing the properties of the asset, including: + + { + 'filename' : 'actual filename', + 'download_link': 'browser download link', + 'type' : 'source / ecal_installer / python_binding', + 'properties' : SEE BELOW, + } + + Properties for "source": + {} + + Properties for "ecal_installer": + { + 'os': 'windows / macos / ubuntu', + 'os_version': Semver('0.0.0') (Only for Ubuntu specific installers), + 'cpu': 'amd64 / arm64' + } + + Properties for "python_binding": + { + 'os': 'manylinux / macos / windows / ubuntu', + 'os_version': Semver('0.0.0') (Only for Ubuntu specific bindings), + 'cpu': 'amd64 / arm64', + 'python_version': Semver('3.6.0') (example) + 'python_implementation': 'cp / pp etc.' (i.e. CPython or PyPy) + } +""" +def get_asset_properties(ecal_version, gh_asset): + asset_properties = { + 'filename' : '', + 'download_link': '', + 'type' : '', + 'properties' : {}, + } + + asset_properties['filename'] = gh_asset.name + asset_properties['download_link'] = gh_asset.browser_download_url + + # Source + if asset_properties['filename'].endswith('tar.gz'): + asset_properties['type'] = 'source' + + # eCAL Installer for Windows + elif asset_properties['filename'].endswith('.msi') or asset_properties['filename'].endswith('.exe'): + asset_properties['type'] = 'ecal_installer' + asset_properties['properties']['os'] = 'windows' + asset_properties['properties']['cpu'] = 'amd64' + + # eCAL installer for macOS + elif asset_properties['filename'].endswith('.dmg'): + asset_properties['type'] = 'ecal_installer' + asset_properties['properties']['os'] = 'macos' + asset_properties['properties']['cpu'] = 'amd64' + + # eCAL Installer for Linux + elif asset_properties['filename'].endswith('.deb'): + asset_properties['type'] = 'ecal_installer' + asset_properties['properties']['os'] = 'ubuntu' + asset_properties['properties']['os_version'] = semantic_version.Version('0.0.0') + asset_properties['properties']['cpu'] = 'amd64' + + if ecal_version <= semantic_version.Version("5.7.2"): + # Special case for old releases. They only had Ubuntu 20.04 releases that were just named "linux". + asset_properties['properties']['os_version'] = semantic_version.Version("20.4.0") + else: + for codename, version in ubuntu_codename_dict.items(): + if codename in asset_properties['filename']: + asset_properties['properties']['os_version'] = version + break + + if ecal_version <= semantic_version.Version("5.7.2"): + # Special case for old releases. They only had Ubuntu 20.04 releases that were just named "linux". + asset_properties['properties']['os_version'] = semantic_version.Version("20.4.0") + + # Python binding (whl) + elif asset_properties['filename'].endswith('.whl'): + asset_properties['type'] = 'python_binding' + + # Get Operating system + if 'manylinux' in asset_properties['filename']: + asset_properties['properties']['os'] = 'manylinux' + elif 'darwin' in asset_properties['filename'] or 'macos' in asset_properties['filename']: + asset_properties['properties']['os'] = 'macos' + elif "win64" in asset_properties['filename'] or "win_amd64" in asset_properties['filename']: + asset_properties['properties']['os'] = 'windows' + elif 'linux' in asset_properties['filename']: + # Old eCAL 5.x wheels were Ubuntu specific + asset_properties['properties']['os'] = 'ubuntu' + for codename, version in ubuntu_codename_dict.items(): + if codename in asset_properties['filename']: + asset_properties['properties']['os_version'] = version + break + else: + sys.stderr.write("Warning: Unable to determine OS of python binding: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + # Get Python CPU Architecture + filename_without_extension = os.path.splitext(asset_properties['filename'])[0] + if filename_without_extension.endswith('amd64') or filename_without_extension.endswith('x86_64') or filename_without_extension.endswith('win64'): + asset_properties['properties']['cpu'] = 'amd64' + elif filename_without_extension.endswith('arm64') or filename_without_extension.endswith('aarch64'): + asset_properties['properties']['cpu'] = 'arm64' + else: + sys.stderr.write("Warning: Unable to determine CPU Architecture of python binding: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + # Get Python version + python_version = semantic_version.Version("0.0.0") + python_implementation = '' + components = asset_properties['filename'][:-4].split('-') + # The python version is either index 2 or 3, depending on whether the optional build tag is used. + for index in range(2,4): + if re.match(r"[a-z]{2}[0-9]+", components[index]): + python_implementation = components[index][:2] + python_version_major_string = components[index][2] + python_verstion_minor_string = "0" + if len(components[index]) > 3: + python_verstion_minor_string = components[index][3:] + python_version = semantic_version.Version(python_version_major_string + "." + python_verstion_minor_string + ".0") + break + + if python_version == semantic_version.Version("0.0.0"): + sys.stderr.write("Warning: Unable to determine python version: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + if not python_implementation: + sys.stderr.write("Warning: Unable to determine python implementation: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + asset_properties['properties']['python_version'] = python_version + asset_properties['properties']['python_implementation'] = python_implementation + + # Python binding (.egg) + elif asset_properties['filename'].endswith('.egg'): + asset_properties['type'] = 'python_binding' + + # Get Operating system + if 'darwin' in asset_properties['filename'] or 'macos' in asset_properties['filename']: + asset_properties['properties']['os'] = 'macos' + elif "win64" in asset_properties['filename'] or "win_amd64" in asset_properties['filename']: + asset_properties['properties']['os'] = 'windows' + elif 'linux' in asset_properties['filename'] or 'bionic' in asset_properties['filename'] or 'focal' in asset_properties['filename']: + asset_properties['properties']['os'] = 'ubuntu' + if ecal_version <= semantic_version.Version("5.7.2"): + # Special case for old releases. They only had Ubuntu 20.04 releases that were just named "linux". + asset_properties['properties']['os_version'] = semantic_version.Version("20.4.0") + else: + for codename, version in ubuntu_codename_dict.items(): + if codename in asset_properties['filename']: + asset_properties['properties']['os_version'] = version + break + + if not asset_properties['properties'].get('os'): + sys.stderr.write("Warning: Unable to determine OS of python binding: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + # Get python version + python_version = semantic_version.Version("0.0.0") + python_match_result = re.findall(r"py[0-9]+\.[0-9]+", asset_properties['filename']) + if len(python_match_result) > 0: + python_version = semantic_version.Version(python_match_result[0][2:] + ".0") + + if python_version == semantic_version.Version("0.0.0"): + sys.stderr.write("Warning: Unable to determine python version: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + asset_properties['properties']['python_version'] = python_version + asset_properties['properties']['python_implementation'] = 'cp' # The eggs were all CPython + + # CPU Architecture was always amd64 back then + asset_properties['properties']['cpu'] = 'amd64' + + # Warning, as we have no idea what this file is for + else: + sys.stderr.write("Warning: Unknown asset type: \"" + asset_properties['filename'] + "\" (from eCAL " + str(ecal_version) + ")\n") + + return asset_properties + +def generate_release_index_page(releases_dict, list_of_supported_minor_versions, output_filename): + # Create the output directory if it does not exist + output_dir = os.path.dirname(output_filename) + if output_dir and not os.path.exists(output_dir): + os.makedirs(output_dir) + + # Load the Jinja2 template + template_loader = jinja2.FileSystemLoader(searchpath="resource/") + template_env = jinja2.Environment(loader=template_loader) + template_file = "release_page_index.rst.jinja" + template = template_env.get_template(template_file) + + # Render the template with the context + context = { + 'releases_dict': releases_dict, + 'list_of_supported_minor_versions': list_of_supported_minor_versions, + 'group_asset_list_by_os_and_arch': group_asset_list_by_os_and_arch, + 'get_rst_release_page_label': get_rst_release_page_label, + } + output = template.render(context) + + # Save the rendered template to a file + with open(output_filename, "w") as f: + f.write(output) + +def generate_release_page(gh_release, + ecal_version, + asset_list, + minor_is_supported, + latest_version_of_minor, + output_dir): + ecal_version_string = str(ecal_version).replace('.', '_').replace('-', '_').replace('+', '_') + output_filename = "ecal_" + ecal_version_string + ".rst" + changelog_file = "changelog_ecal_" + ecal_version_string + ".txt" + + # Create the output directory if it does not exist + if output_dir and not os.path.exists(output_dir): + os.makedirs(output_dir) + + # Save the changelog to a file + changelog = gh_release.body + changelog = changelog.replace('\r\n', '\n') + with open(os.path.join(output_dir, changelog_file), "w") as f: + f.write(changelog) + + # Load the Jinja2 template + template_loader = jinja2.FileSystemLoader(searchpath="resource/") + template_env = jinja2.Environment(loader=template_loader) + template_file = "release_page.rst.jinja" + template = template_env.get_template(template_file) + + # Render the template with the context + context = { + 'gh_release': gh_release, + 'ecal_version': ecal_version, + 'asset_list': asset_list, + 'changelog_file_path': changelog_file, + 'minor_is_supported': minor_is_supported, + 'latest_version_of_minor': latest_version_of_minor, + 'ubuntu_default_python_version_dict': ubuntu_default_python_version_dict, + 'group_asset_list_by_os_and_arch': group_asset_list_by_os_and_arch, + 'get_rst_release_page_label': get_rst_release_page_label, + } + output = template.render(context) + + # Save the rendered template to a file + path = os.path.join(output_dir, output_filename) + with open(path, "w") as f: + f.write(output) + +""" +Groups a list of assets by their OS, OS version, and CPU architecture. +Args: + asset_list (list): A list of asset properties dictionaries. +Returns: + dict: A dictionary where the keys are tuples of (os, os_version, cpu) and + the values are lists of asset properties dictionaries. +""" +def group_asset_list_by_os_and_arch(asset_list): + os_arch_dict = OrderedDict() + + for asset_properties in asset_list: + os = asset_properties['properties'].get('os', 'unknown') + os_version = asset_properties['properties'].get('os_version', semantic_version.Version('0.0.0')) + cpu = asset_properties['properties'].get('cpu', 'unknown') + + key = (os, os_version, cpu) + if key not in os_arch_dict: + os_arch_dict[key] = [] + os_arch_dict[key].append(asset_properties) + + return os_arch_dict + +def get_rst_release_page_label(ecal_version): + return "ecal_release_page_" + str(ecal_version).replace('.', '_').replace('-', '_').replace('+', '_') + +def generate_release_documentation(gh_api_key, index_filepath, release_dir_path): + gh = github.Github(gh_api_key) + gh_repo = gh.get_repo("eclipse-ecal/ecal") + releases_dict = get_releases_dict(gh_repo) + + list_of_supported_minor_versions = list(releases_dict.keys())[:2] + + generate_release_index_page(releases_dict, + list_of_supported_minor_versions, + index_filepath) + + for minor_version in releases_dict: + + # Get the latest eCAL Version of this release branch + latest_release_for_this_minor = list(releases_dict[minor_version].keys())[0] + this_minor_is_supported = minor_version in list_of_supported_minor_versions + + for ecal_version in releases_dict[minor_version]: + + # Check the support status of this release + + gh_release = releases_dict[minor_version][ecal_version] + gh_asset_list = gh_release.get_assets() + + asset_list = [] + + for gh_asset in gh_asset_list: + asset_properties = get_asset_properties(ecal_version, gh_asset) + asset_list.append(asset_properties) + + # Sort the asset list by: + # 1. OS (windows > manylinux > ubuntu > macos) + # 2. OS version (descending) + # 3. CPU (amd64 > arm64) + # 4. Python version (descending) + + asset_list.sort(key = lambda x: x['properties'].get('python_version', semantic_version.Version("0.0.0")), reverse = True) + asset_list.sort(key = lambda x: x['properties'].get('os_version', semantic_version.Version("0.0.0")), reverse = True) + asset_list.sort(key = lambda x: x['properties'].get('cpu', 'unknown')) + asset_list.sort(key = lambda x: ['windows', 'manylinux', 'ubuntu', 'macos'].index(x['properties'].get('os', 'unknown')) if x['properties'].get('os', 'unknown') in ['windows', 'manylinux', 'ubuntu', 'macos'] else float('inf')) + + generate_release_page(gh_release, + ecal_version, + asset_list, + this_minor_is_supported, + latest_release_for_this_minor, + release_dir_path) + +if __name__=="__main__": + gh_api_key = os.getenv("ECAL_GH_API_KEY") + if gh_api_key: + generate_release_documentation(gh_api_key, "index.rst", "release") + else: + sys.stderr.write("ERROR: Environment variable ECAL_GH_API_KEY not set. Without an API key, GitHub will not provide enough API calls to generate the download tables.\n") + exit(1) + + + + + + + diff --git a/doc/release_page/resource/release_page.rst.jinja b/doc/release_page/resource/release_page.rst.jinja new file mode 100644 index 0000000000..4411a39b01 --- /dev/null +++ b/doc/release_page/resource/release_page.rst.jinja @@ -0,0 +1,206 @@ +{% set ecal_version_string = ecal_version | string -%} + +{# Makro for properly naming the OS, possibly with icon. e.g. "|fa-windows| Windows" (-> capitalized) or |fa-ubuntu| Ubuntu 24.04 (-> with Version number) -#} +{% macro get_os_string(asset, with_icon) -%} + {% if asset['properties']['os'] == 'windows' -%} + {% set os_string = (with_icon and '|fa-windows| ' or '') ~ 'Windows' -%} + {% elif asset['properties']['os'] == 'macos' -%} + {% set os_string = (with_icon and '|fa-apple| ' or '') ~ 'macOS' -%} + {% elif asset['properties']['os'] == 'ubuntu' -%} + {% set os_version_padded = asset['properties']['os_version'].major ~ '.' ~ '%02d' | format(asset['properties']['os_version'].minor) -%} + {% set os_string = (with_icon and '|fa-Ubuntu| ' or '') ~ 'Ubuntu ' ~ os_version_padded -%} + {% elif asset['properties']['os'] == 'manylinux' -%} + {% set os_string = (with_icon and '|fa-linux| ' or '') ~ 'Linux (All)' -%} + {% elif asset['properties']['os'] == '' -%} + {% set os_string = 'Unknown' -%} + {% else -%} + {% set os_string = asset['properties']['os'].capitalize() -%} + {% endif -%} + {{ os_string -}} +{% endmacro -%} + +{# Makro for naming the CPU Architecture. Mainly to make amd64 to x64, so the user can more easily distinguish it from arm64 #} +{% macro get_cpu_string(asset) -%} + {% if asset['properties']['cpu'] == 'amd64' -%} + {% set cpu_string = 'x64' -%} + {% elif asset['properties']['cpu'] == 'arm64' -%} + {% set cpu_string = 'ARM64' -%} + {% else -%} + {% set cpu_string = asset['properties']['cpu'] -%} + {% endif -%} + {{ cpu_string -}} +{% endmacro -%} +:orphan: + +.. include:: /../include.txt + +.. _{{ get_rst_release_page_label(ecal_version) }}: + +=============== +eCAL {{ ecal_version_string }} +=============== + +{% if not minor_is_supported %} +.. warning:: + + eCAL {{ ecal_version.major }}.{{ ecal_version.minor }} is not supported anymore. Please consider upgrading to a newer version. +{% endif %} + +- Release Date: {{ gh_release.published_at.strftime('%Y-%m-%d') }} +- GitHub Release Page: {{ gh_release.html_url }} + +Changelog +========= + +.. literalinclude:: {{ changelog_file_path }} + :language: text + +Downloads +========= + +{% if ecal_version < latest_version_of_minor %} +.. note:: + + A more recent version of eCAL {{ ecal_version.major }}.{{ ecal_version.minor }} is available: :ref:`eCAL {{ latest_version_of_minor }} <{{ get_rst_release_page_label(latest_version_of_minor) }}>`. +{% endif %} + +{# Get the ecal_installers from the list and remove them from the main list. -#} +{% set ecal_installer_list = asset_list | selectattr('type', 'equalto', 'ecal_installer') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'ecal_installer') | list -%} + +{% if ecal_installer_list %} +eCAL Installer +-------------- + +.. list-table:: + :widths: 2 2 6 + :header-rows: 1 + + * - OS + + - Architecture + + - Files + + {% for asset in ecal_installer_list -%} + + * - {{ get_os_string(asset, true) }} + + - {{ get_cpu_string(asset) }} + + - `{{ asset['filename'] }} <{{ asset['download_link'] }}>`__ + + {% endfor -%} + +{% endif -%} + +{# Get the python bindings from the list -#} +{% set python_binding_list = asset_list | selectattr('type', 'equalto', 'python_binding') | selectattr('properties.python_implementation', 'equalto', 'cp') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'python_binding') | list -%} + +{% if python_binding_list %} +|fa-python| Python Binding +-------------------------- + +.. list-table:: + :widths: 2 2 6 + :header-rows: 1 + + * - OS + + - Architecture + + - Files + + {% set python_binding_grouped_dict = group_asset_list_by_os_and_arch(python_binding_list) -%} + + {% for key, value in python_binding_grouped_dict.items() -%} + {% if value[0]['properties']['os'] == 'ubuntu' -%} + {% set default_python_version = ubuntu_default_python_version_dict[value[0]['properties']['os_version']] -%} + {% endif %} + * - {{ get_os_string(value[0], true) }} + + - {{ get_cpu_string(value[0]) }} + + - {% for asset in value -%} + `Python {{ asset['properties']['python_version'].major }}.{{ asset['properties']['python_version'].minor }} (.{{ asset['filename'].split('.')[-1] }}) <{{ asset['download_link'] }}>`__ {% if asset['properties']['python_version'] == default_python_version %} (Default){% endif %} + + {% endfor -%} + + {% endfor -%} + +{% endif -%} + +{# Get the PyPy bindings from the list -#} +{% set pypy_binding_list = asset_list | selectattr('type', 'equalto', 'python_binding') | selectattr('properties.python_implementation', 'equalto', 'pp') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'python_binding') | list -%} + +{% if pypy_binding_list %} +|fa-python| PyPy Binding +------------------------ + +*PyPy bindings are not compatibly with the regular Python implementation.* + +.. list-table:: + :widths: 2 2 6 + :header-rows: 1 + + * - OS + + - Architecture + + - Files + + {% set pypy_binding_grouped_dict = group_asset_list_by_os_and_arch(pypy_binding_list) -%} + + {% for key, value in pypy_binding_grouped_dict.items() %} + * - {{ get_os_string(value[0], true) }} + + - {{ get_cpu_string(value[0]) }} + + - {% for asset in value -%} + `PyPy {{ asset['properties']['python_version'].major }}.{{ asset['properties']['python_version'].minor }} (.{{ asset['filename'].split('.')[-1] }}) <{{ asset['download_link'] }}>`__ + + {% endfor -%} + + {% endfor -%} + +{% endif -%} + +{# Get the source files from the list -#} +{% set source_file_list = asset_list | selectattr('type', 'equalto', 'source') | list -%} +{% set asset_list = asset_list | rejectattr('type', 'equalto', 'source') | list -%} + +{% if source_file_list %} +|fa-code| Source +---------------- + +.. list-table:: + :widths: 1 + + {% for asset in source_file_list -%} + + * - `{{ asset['filename'] }} <{{ asset['download_link'] }}>`__ + + {% endfor -%} + +{% endif %} + +{# Get the other files from the list -#} +{% if asset_list %} +Other Downloads +--------------- + +.. list-table:: + :widths: 1 + :header-rows: 1 + + * - Files + + {% for asset in asset_list -%} + + * - `{{ asset['filename'] }} <{{ asset['download_link'] }}>`__ + + {% endfor -%} + +{% endif -%} \ No newline at end of file diff --git a/doc/release_page/resource/release_page_index.rst.jinja b/doc/release_page/resource/release_page_index.rst.jinja new file mode 100644 index 0000000000..30f6c6d4bc --- /dev/null +++ b/doc/release_page/resource/release_page_index.rst.jinja @@ -0,0 +1,49 @@ +.. include:: /../include.txt + +.. _all_releases: + +============= +eCAL Releases +============= + +Here you can find a list of all eCAL Versions ever released on GitHub. + +{% for minor_version, releases_dict in releases_dict.items() %} +eCAL {{ minor_version.major }}.{{ minor_version.minor }} +=========== + +{% if minor_version not in list_of_supported_minor_versions -%} + +*eCAL {{ minor_version.major }}.{{ minor_version.minor }} has reached its end of life.* + +{% endif -%} + +.. list-table:: + :widths: 3 3 4 + :header-rows: 1 + + * - Release + + - Release Date + + - Support Status + +{% for ecal_version, gh_release in releases_dict.items() -%} +{% set is_latest_release_in_this_minor = (ecal_version == releases_dict.keys()|list|first) %} + * - :ref:`eCAL {{ gh_release.tag_name }} <{{ get_rst_release_page_label(ecal_version) }}>` + + - {{ gh_release.published_at.strftime("%Y-%m-%d") }} + + - {% if (minor_version in list_of_supported_minor_versions) and is_latest_release_in_this_minor -%} + Supported + {% else -%} + EOL + {% endif -%} +{% endfor -%} + +{% endfor %} + +.. toctree:: + :hidden: + + eCAL Documentation \ No newline at end of file From 6359a4e02176b17da745f4591ecf8acffe927417 Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:09:22 +0100 Subject: [PATCH 02/16] [clang-tidy] Disabled performance-avoid-endl warning (#1966) --- .clang-tidy | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-tidy b/.clang-tidy index d8de2e21d3..915afc9169 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -52,6 +52,7 @@ Checks: "-*, -modernize-avoid-bind, performance-*, + -performance-avoid-endl, readability-*, -readability-braces-around-statements, From 41c163931e5402e841ee000da9fb753b828a6bd6 Mon Sep 17 00:00:00 2001 From: Peguen <73380451+Peguen@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:20:46 +0100 Subject: [PATCH 03/16] [core] More verbose naming of structs & protos (#1956) --- .../src/ecal/app/pb/rec/client_state.proto | 6 +- .../src/ecal/app/pb/sys/client_service.proto | 12 +- app/app_pb/src/ecal/app/pb/sys/state.proto | 4 +- app/mon/mon_cli/src/ecal_mon_cli.cpp | 112 +++--- .../ecalmon_tree_widget/host_widget.cpp | 14 +- .../ecalmon_tree_widget/process_widget.cpp | 16 +- .../ecalmon_tree_widget/service_widget.cpp | 22 +- .../ecalmon_tree_widget/topic_widget.cpp | 42 +- .../src/widgets/log_widget/log_widget.h | 4 +- .../src/widgets/models/host_tree_item.cpp | 8 +- .../src/widgets/models/host_tree_model.cpp | 4 +- .../mon_gui/src/widgets/models/log_model.cpp | 16 +- .../mon_gui/src/widgets/models/log_model.h | 8 +- .../src/widgets/models/process_tree_item.cpp | 76 ++-- .../src/widgets/models/process_tree_item.h | 14 +- .../src/widgets/models/process_tree_model.cpp | 4 +- .../src/widgets/models/process_tree_model.h | 18 +- .../src/widgets/models/service_tree_item.h | 86 ++-- .../src/widgets/models/service_tree_model.h | 20 +- .../src/widgets/models/topic_tree_item.cpp | 126 +++--- .../src/widgets/models/topic_tree_item.h | 24 +- .../src/widgets/models/topic_tree_model.cpp | 4 +- .../src/widgets/models/topic_tree_model.h | 28 +- .../visualisation_widget.cpp | 6 +- app/mon/mon_tui/src/model/data/process.hpp | 4 +- app/mon/mon_tui/src/model/data/service.hpp | 4 +- app/mon/mon_tui/src/model/data/topic.hpp | 4 +- app/mon/mon_tui/src/model/log.hpp | 10 +- app/mon/mon_tui/src/model/monitor.hpp | 78 ++-- app/mon/mon_tui/src/tui/view/log_details.hpp | 4 +- .../mon_tui/src/tui/view/topic_details.hpp | 10 +- .../mon_tui/src/tui/viewmodel/processes.hpp | 4 +- .../play_core/src/state_publisher_thread.cpp | 4 +- .../widgets/channel_widget/channel_widget.cpp | 6 +- .../rec_client_core/src/monitoring_thread.cpp | 28 +- app/rec/rec_client_core/src/proto_helpers.cpp | 14 +- .../recordermanager_widget/recorder_model.cpp | 6 +- .../recordermanager_widget/recorder_model.h | 6 +- .../job_history_model.cpp | 16 +- .../job_history_model.h | 6 +- .../job_history_recorderitem.cpp | 14 +- .../job_history_recorderitem.h | 10 +- .../rec_server_cli/src/commands/status.cpp | 98 ++--- .../rec_server_core/rec_server_types.h | 4 +- .../rec_server_core/src/monitoring_thread.cpp | 30 +- .../rec_server_core/src/rec_server_impl.cpp | 8 +- .../src/recorder/remote_recorder.cpp | 2 +- .../rec_rpc_tests/src/external_ecal_rec.cpp | 14 +- .../rec_rpc_tests/src/external_ecal_rec.h | 4 +- .../src/ecal_sys_client_service.cpp | 12 +- .../include/sys_client_core/proto_helpers.h | 8 +- .../include/sys_client_core/task.h | 4 +- .../sys_client_core/src/ecal_sys_client.cpp | 34 +- app/sys/sys_client_core/src/proto_helpers.cpp | 38 +- .../src/connection/remote_connection.cpp | 2 +- app/sys/sys_core/src/ecal_sys.cpp | 8 +- app/sys/sys_core/src/ecal_sys_monitor.cpp | 28 +- app/sys/sys_core/src/proto_helpers.cpp | 12 +- .../src/task/ecal_sys_task_helper.cpp | 2 +- .../start_task_list_thread.cpp | 10 +- .../stop_task_list_thread.cpp | 4 +- .../src/widgets/treemodels/task_tree_item.cpp | 4 +- app/util/stop/src/ecal_stop.cpp | 40 +- .../src/ecal/ecaltime/pb/sim_time.proto | 4 +- .../simtime/src/ecal_time_simtime.cpp | 4 +- contrib/mma/include/windows/processes.h | 4 +- contrib/mma/src/windows/processes.cpp | 6 +- contrib/mma/src/zombie_instance_killer.cpp | 36 +- doc/rst/advanced/ecal_in_docker.rst | 8 +- ecal/core/include/ecal/types/logging.h | 8 +- ecal/core/include/ecal/types/monitoring.h | 114 +++--- ecal/core/include/ecal/v5/ecal_callback.h | 4 +- ecal/core/src/ecal_descgate.cpp | 18 +- ecal/core/src/ecal_process.cpp | 16 +- ecal/core/src/ecal_util.cpp | 56 +-- ecal/core/src/logging/ecal_log_provider.cpp | 8 +- ecal/core/src/logging/ecal_log_receiver.cpp | 2 +- .../src/monitoring/ecal_monitoring_impl.cpp | 188 ++++----- ecal/core/src/pubsub/ecal_pubgate.cpp | 14 +- ecal/core/src/pubsub/ecal_publisher_impl.cpp | 38 +- ecal/core/src/pubsub/ecal_subgate.cpp | 20 +- ecal/core/src/pubsub/ecal_subscriber_impl.cpp | 56 +-- .../src/readwrite/shm/ecal_reader_shm.cpp | 10 +- .../src/readwrite/tcp/ecal_writer_tcp.cpp | 6 +- .../src/readwrite/udp/ecal_writer_udp.cpp | 10 +- .../ecal_process_registration.cpp | 26 +- .../ecal_registration_sample_applier.cpp | 4 +- .../ecal_registration_timeout_provider.cpp | 28 +- .../serialization/ecal_serialize_common.cpp | 42 +- .../serialization/ecal_serialize_logging.cpp | 32 +- .../ecal_serialize_monitoring.cpp | 370 +++++++++--------- .../ecal_serialize_sample_payload.cpp | 32 +- .../ecal_serialize_sample_registration.cpp | 326 +++++++-------- .../serialization/ecal_serialize_service.cpp | 66 ++-- .../ecal_struct_sample_payload.h | 8 +- .../ecal_struct_sample_registration.h | 122 +++--- .../src/serialization/ecal_struct_service.h | 106 ++--- .../nanopb/ecal/core/pb/datatype.npb.h | 6 +- .../nanopb/ecal/core/pb/host.npb.h | 12 +- .../nanopb/ecal/core/pb/layer.npb.c | 2 +- .../nanopb/ecal/core/pb/layer.npb.h | 56 +-- .../nanopb/ecal/core/pb/logging.npb.h | 24 +- .../nanopb/ecal/core/pb/process.npb.h | 70 ++-- .../nanopb/ecal/core/pb/service.npb.h | 142 +++---- .../nanopb/ecal/core/pb/topic.npb.h | 96 ++--- ecal/core/src/service/ecal_clientgate.cpp | 6 +- .../src/service/ecal_service_client_impl.cpp | 40 +- .../src/service/ecal_service_server_impl.cpp | 70 ++-- ecal/core_pb/src/ecal/core/pb/datatype.proto | 8 +- ecal/core_pb/src/ecal/core/pb/host.proto | 6 +- ecal/core_pb/src/ecal/core/pb/layer.proto | 16 +- ecal/core_pb/src/ecal/core/pb/logging.proto | 10 +- ecal/core_pb/src/ecal/core/pb/process.proto | 34 +- ecal/core_pb/src/ecal/core/pb/service.proto | 60 +-- ecal/core_pb/src/ecal/core/pb/topic.proto | 30 +- .../src/many_connections_rec.cpp | 6 +- .../src/many_connections_snd.cpp | 8 +- .../massive_pub_sub/src/massive_pub_sub.cpp | 12 +- .../multiple_rec/src/multiple_rec.cpp | 8 +- .../multiple_snd/src/multiple_snd.cpp | 8 +- ecal/samples/cpp/misc/process/src/process.cpp | 4 +- .../monitoring_rec/src/monitoring_rec.cpp | 124 +++--- .../src/descgate_getentities.cpp | 48 +-- .../cpp/logging_test/src/logging_test.cpp | 8 +- .../src/registration_timout_provider_test.cpp | 70 ++-- .../src/registration_getpublisherids.cpp | 24 +- .../src/registration_getsubscriberids.cpp | 24 +- .../src/logging_compare.cpp | 16 +- .../src/logging_generate.cpp | 14 +- .../src/monitoring_compare.cpp | 116 +++--- .../src/monitoring_generate.cpp | 104 ++--- .../src/payload_compare.cpp | 10 +- .../src/payload_generate.cpp | 8 +- .../src/registration_generate.cpp | 96 ++--- .../src/service_compare.cpp | 16 +- .../src/service_generate.cpp | 16 +- .../include/ecal/cimpl/ecal_callback_cimpl.h | 10 +- lang/c/core/src/ecal_publisher_cimpl.cpp | 14 +- lang/c/core/src/ecal_subscriber_cimpl.cpp | 14 +- lang/python/core/ecal/core/service.py | 2 +- lang/python/core/src/ecal_clang.cpp | 28 +- lang/python/core/src/ecal_wrap.cxx | 120 +++--- 142 files changed, 2338 insertions(+), 2338 deletions(-) diff --git a/app/app_pb/src/ecal/app/pb/rec/client_state.proto b/app/app_pb/src/ecal/app/pb/rec/client_state.proto index 8400549eef..49ba95d010 100644 --- a/app/app_pb/src/ecal/app/pb/rec/client_state.proto +++ b/app/app_pb/src/ecal/app/pb/rec/client_state.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,8 +130,8 @@ message State reserved 22; // eCAL Rec 2.0 field // repeated WriterState buffer_writer_states = 22; - string hostname = 11; - int32 pid = 12; + string host_name = 11; + int32 process_id = 12; bool initialized = 13; int64 pre_buffer_length_frames_count = 20; diff --git a/app/app_pb/src/ecal/app/pb/sys/client_service.proto b/app/app_pb/src/ecal/app/pb/sys/client_service.proto index 851302753b..6c6912f380 100644 --- a/app/app_pb/src/ecal/app/pb/sys/client_service.proto +++ b/app/app_pb/src/ecal/app/pb/sys/client_service.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ message StartTaskParameters message StopTaskParameters { - int32 pid = 1; // The PID of the process to stop (preferred) + int32 process_id = 1; // The PID of the process to stop (preferred) Task task = 2; // The description of the process to stop (if no PID was given) bool ecal_shutdown = 3; // Whether the task shall be gently stopped via eCAL (they are hard killed otherwise!) } @@ -98,7 +98,7 @@ message SingleTaskResponse { eServiceResult result = 1; string error = 2; - int32 pid = 3; + int32 process_id = 3; } message TaskResponse @@ -106,14 +106,14 @@ message TaskResponse repeated SingleTaskResponse responses = 1; } -message PidList +message ProcessIdList { - repeated int32 pids = 1; + repeated int32 process_ids = 1; } message MatchTaskResponse { - repeated PidList pid_lists = 1; + repeated ProcessIdList process_id_lists = 1; } /////////////////////////////////////////////////////// diff --git a/app/app_pb/src/ecal/app/pb/sys/state.proto b/app/app_pb/src/ecal/app/pb/sys/state.proto index 80dc60ec6d..78dcd20006 100644 --- a/app/app_pb/src/ecal/app/pb/sys/state.proto +++ b/app/app_pb/src/ecal/app/pb/sys/state.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ message State string name = 2; string target_host = 3; // The configured target host ProcessState state = 4; - repeated int32 pids = 5; // pid; field is repeated because the task can be started multiple times + repeated int32 process_ids = 5; // process_id; field is repeated because the task can be started multiple times uint32 launch_order = 6; reserved 7; // Runner diff --git a/app/mon/mon_cli/src/ecal_mon_cli.cpp b/app/mon/mon_cli/src/ecal_mon_cli.cpp index 7534a7e463..ca48cf9da2 100644 --- a/app/mon/mon_cli/src/ecal_mon_cli.cpp +++ b/app/mon/mon_cli/src/ecal_mon_cli.cpp @@ -260,7 +260,7 @@ int main(int argc, char** argv) } catch (TCLAP::ArgException &e) // catch any exceptions { - std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; + std::cerr << "error: " << e.error() << " for arg " << e.argId() << "\n"; return EXIT_FAILURE; } @@ -272,7 +272,7 @@ int main(int argc, char** argv) ////////////////////////////////////////// void ProcBandwidth(const std::string& topic_name) { - std::cout << "display bandwidth for topic " << topic_name << std::endl << std::endl; + std::cout << "display bandwidth for topic " << topic_name << "\n" << "\n"; // monitoring instance to store complete snapshot eCAL::pb::Monitoring monitoring; @@ -294,11 +294,11 @@ void ProcBandwidth(const std::string& topic_name) for(const auto& topic : monitoring.topics()) { // check topic name - if(topic.tname() != topic_name) continue; + if(topic.topic_name() != topic_name) continue; found = true; std::string unit = "Byte/s"; - auto bw = topic.tsize() * (topic.dfreq()/1000.0); + auto bw = topic.topic_size() * (topic.data_frequency()/1000.0); if (bw > _10MB) { bw /= _1MB; @@ -312,11 +312,11 @@ void ProcBandwidth(const std::string& topic_name) unit = "kByte/s"; } } - std::cout << int(bw) << " " << unit << " (" << topic.hname() << ":" << topic.direction() << ")" << std::endl; + std::cout << int(bw) << " " << unit << " (" << topic.host_name() << ":" << topic.direction() << ")" << "\n"; } - if(!found) std::cout << "." << std::endl; - else std::cout << std::endl; + if(!found) std::cout << "." << "\n"; + else std::cout << "\n"; // sleep std::this_thread::sleep_for(std::chrono::milliseconds(pause_val)); @@ -328,12 +328,12 @@ void ProcBandwidth(const std::string& topic_name) ////////////////////////////////////////// void ProcEcho(const std::string& topic_name, int msg_count) { - std::cout << "echo string message output for topic " << topic_name << std::endl << std::endl;; + std::cout << "echo string message output for topic " << topic_name << "\n" << "\n"; // create string subscriber for topic topic_name_ and assign callback eCAL::string::CSubscriber sub(topic_name); std::atomic cnt(msg_count); - auto msg_cb = [&cnt](const std::string& msg_) { if (cnt != 0) { std::cout << msg_ << std::endl; if (cnt > 0) cnt--; } }; + auto msg_cb = [&cnt](const std::string& msg_) { if (cnt != 0) { std::cout << msg_ << "\n"; if (cnt > 0) cnt--; } }; sub.SetReceiveCallback(std::bind(msg_cb, std::placeholders::_2)); while(eCAL::Ok() && (cnt != 0)) @@ -348,7 +348,7 @@ void ProcEcho(const std::string& topic_name, int msg_count) ////////////////////////////////////////// void ProcProto(const std::string& topic_name, int msg_count) { - std::cout << "echo protobuf message output for topic " << topic_name << std::endl << std::endl;; + std::cout << "echo protobuf message output for topic " << topic_name << "\n" << "\n"; // sleep 1000 ms std::this_thread::sleep_for(std::chrono::milliseconds(1000)); @@ -393,17 +393,17 @@ void ProcFind(const std::string& topic_type_name) for(const auto& topic : monitoring.topics()) { // check topic name - if(topic.tdatatype().name() != topic_type_name) continue; + if(topic.datatype_information().name() != topic_type_name) continue; // print topic details - std::cout << "tname : " << topic.tname() << std::endl; // topic name - std::cout << "ttype name : " << topic.tdatatype().name() << std::endl; // topic type name - std::cout << "ttype enc. : " << topic.tdatatype().encoding() << std::endl; // topic type encoding - std::cout << "direction : " << topic.direction() << std::endl; // direction (publisher, subscriber) - std::cout << "hname : " << topic.hname() << std::endl; // host name - std::cout << "pid : " << topic.pid() << std::endl; // process id - std::cout << "tid : " << topic.tid() << std::endl; // topic id - std::cout << std::endl; + std::cout << "topic name : " << topic.topic_name() << "\n"; // topic name + std::cout << "ttype name : " << topic.datatype_information().name() << "\n"; // topic type name + std::cout << "ttype enc. : " << topic.datatype_information().encoding() << "\n"; // topic type encoding + std::cout << "direction : " << topic.direction() << "\n"; // direction (publisher, subscriber) + std::cout << "host name : " << topic.host_name() << "\n"; // host name + std::cout << "process id : " << topic.process_id() << "\n"; // process id + std::cout << "topic id : " << topic.topic_id() << "\n"; // topic id + std::cout << "\n"; } // sleep @@ -416,7 +416,7 @@ void ProcFind(const std::string& topic_type_name) ////////////////////////////////////////// void ProcRate(const std::string& topic_name) { - std::cout << "display data rate [Hz] for topic " << topic_name << std::endl << std::endl;; + std::cout << "display data rate [Hz] for topic " << topic_name << "\n" << "\n"; // monitoring instance to store complete snapshot eCAL::pb::Monitoring monitoring; @@ -437,8 +437,8 @@ void ProcRate(const std::string& topic_name) for(const auto& topic : monitoring.topics()) { // check topic name - if(topic.tname() != topic_name) continue; - std::cout << topic.dfreq()/1000.0 << std::endl; // data frequency (send / receive samples per second * 1000) + if(topic.topic_name() != topic_name) continue; + std::cout << topic.data_frequency()/1000.0 << std::endl; // data frequency (send / receive samples per second * 1000) } // sleep @@ -472,20 +472,20 @@ void ProcInfo(const std::string& topic_name) for(const auto& topic : monitoring.topics()) { // check topic name - if(topic.tname() != topic_name) continue; + if(topic.topic_name() != topic_name) continue; // print topic details - std::cout << "tname : " << topic.tname() << std::endl; // topic name - std::cout << "ttype name : " << topic.tdatatype().name() << std::endl; // topic type name - std::cout << "ttype enc. : " << topic.tdatatype().encoding() << std::endl; // topic type encoding - std::cout << "direction : " << topic.direction() << std::endl; // direction (publisher, subscriber) - std::cout << "hname : " << topic.hname() << std::endl; // host name - std::cout << "pid : " << topic.pid() << std::endl; // process id - std::cout << "tid : " << topic.tid() << std::endl; // topic id - std::cout << "tsize : " << topic.tsize() << std::endl; // topic size - std::cout << "dclock : " << topic.dclock() << std::endl; // data clock (send / receive action) - std::cout << "dfreq : " << topic.dfreq()/1000.0 << std::endl; // data frequency (send / receive samples per second * 1000) - std::cout << std::endl; + std::cout << "topic name : " << topic.topic_name() << "\n"; // topic name + std::cout << "ttype name : " << topic.datatype_information().name() << "\n"; // topic type name + std::cout << "ttype enc. : " << topic.datatype_information().encoding() << "\n"; // topic type encoding + std::cout << "direction : " << topic.direction() << "\n"; // direction (publisher, subscriber) + std::cout << "host name : " << topic.host_name() << "\n"; // host name + std::cout << "process id : " << topic.process_id() << "\n"; // process id + std::cout << "topic id : " << topic.topic_id() << "\n"; // topic id + std::cout << "topic size : " << topic.topic_size() << "\n"; // topic size + std::cout << "data clock : " << topic.data_clock() << "\n"; // data clock (send / receive action) + std::cout << "data frequency : " << topic.data_frequency()/1000.0 << "\n"; // data frequency (send / receive samples per second * 1000) + std::cout << "\n"; } // sleep @@ -498,7 +498,7 @@ void ProcInfo(const std::string& topic_name) ////////////////////////////////////////// void ProcList() { - std::cout << "display topic details for all active topics" << std::endl << std::endl;; + std::cout << "display topic details for all active topics" << "\n" << "\n"; // monitoring instance to store complete snapshot eCAL::pb::Monitoring monitoring; @@ -519,17 +519,17 @@ void ProcList() for(const auto& topic : monitoring.topics()) { // print topic details - std::cout << "tname : " << topic.tname() << std::endl; // topic name - std::cout << "ttype name : " << topic.tdatatype().name() << std::endl; // topic type name - std::cout << "ttype enc. : " << topic.tdatatype().encoding() << std::endl; // topic type encoding - std::cout << "direction : " << topic.direction() << std::endl; // direction (publisher, subscriber) - std::cout << "hname : " << topic.hname() << std::endl; // host name - std::cout << "pid : " << topic.pid() << std::endl; // process id - std::cout << "tid : " << topic.tid() << std::endl; // topic id - std::cout << "tsize : " << topic.tsize() << std::endl; // topic size - std::cout << "dclock : " << topic.dclock() << std::endl; // data clock (send / receive action) - std::cout << "dfreq : " << topic.dfreq()/1000.0 << std::endl; // data frequency (send / receive samples per second * 1000) - std::cout << std::endl; + std::cout << "topic_name : " << topic.topic_name() << "\n"; // topic name + std::cout << "ttype name : " << topic.datatype_information().name() << "\n"; // topic type name + std::cout << "ttype enc. : " << topic.datatype_information().encoding() << "\n"; // topic type encoding + std::cout << "direction : " << topic.direction() << "\n"; // direction (publisher, subscriber) + std::cout << "host name : " << topic.host_name() << "\n"; // host name + std::cout << "process id : " << topic.process_id() << "\n"; // process id + std::cout << "topic id : " << topic.topic_id() << "\n"; // topic id + std::cout << "topic size : " << topic.topic_size() << "\n"; // topic size + std::cout << "data clock : " << topic.data_clock() << "\n"; // data clock (send / receive action) + std::cout << "data frequency : " << topic.data_frequency()/1000.0 << "\n"; // data frequency (send / receive samples per second * 1000) + std::cout << "\n"; } // sleep @@ -542,7 +542,7 @@ void ProcList() ////////////////////////////////////////// void ProcPub(const std::string& topic_name, const std::string& data) { - std::cout << "publish " << data << " on topic " << topic_name << std::endl << std::endl;; + std::cout << "publish " << data << " on topic " << topic_name << "\n" << "\n";; // create string publisher for topic topic_name_ eCAL::string::CPublisher pub(topic_name); @@ -554,7 +554,7 @@ void ProcPub(const std::string& topic_name, const std::string& data) while(eCAL::Ok()) { // publish content - std::cout << "publishing " << msg << " on topic " << topic_name << std::endl; + std::cout << "publishing " << msg << " on topic " << topic_name << "\n"; pub.Send(msg); // sleep @@ -567,7 +567,7 @@ void ProcPub(const std::string& topic_name, const std::string& data) ////////////////////////////////////////// void ProcType(const std::string& topic_name) { - std::cout << "print type name of topic " << topic_name << std::endl << std::endl;; + std::cout << "print type name of topic " << topic_name << "\n" << "\n"; // monitoring instance to store complete snapshot eCAL::pb::Monitoring monitoring; @@ -586,13 +586,13 @@ void ProcType(const std::string& topic_name) for(const auto& topic : monitoring.topics()) { // check topic name - if(topic.tname() != topic_name) continue; + if(topic.topic_name() != topic_name) continue; - std::string ttype_name = topic.tdatatype().name(); + std::string ttype_name = topic.datatype_information().name(); if(ttype_name.empty()) ttype_name = "\"\""; // print topic type - std::cout << ttype_name << " (" << topic.hname() << ":" << topic.direction() << ")" << std::endl; + std::cout << ttype_name << " (" << topic.host_name() << ":" << topic.direction() << ")" << "\n"; } } @@ -601,7 +601,7 @@ void ProcType(const std::string& topic_name) ////////////////////////////////////////// void ProcDesc(const std::string& topic_name_) { - std::cout << "print description of topic " << topic_name_ << std::endl << std::endl;; + std::cout << "print description of topic " << topic_name_ << "\n" << "\n"; // monitoring instance to store complete snapshot eCAL::pb::Monitoring monitoring; @@ -620,12 +620,12 @@ void ProcDesc(const std::string& topic_name_) for(const auto& topic : monitoring.topics()) { // check topic name - if(topic.tname() != topic_name_) continue; + if(topic.topic_name() != topic_name_) continue; - std::string ttype_desc = topic.tdatatype().desc(); + std::string ttype_desc = topic.datatype_information().descriptor_information(); if (ttype_desc.empty()) ttype_desc = "\"\""; // print topic description - std::cout << ttype_desc << " (" << topic.hname() << ":" << topic.direction() << ")" << std::endl; + std::cout << ttype_desc << " (" << topic.host_name() << ":" << topic.direction() << ")" << "\n"; } } diff --git a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/host_widget.cpp b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/host_widget.cpp index fb01960bd7..7417f4a598 100644 --- a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/host_widget.cpp +++ b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/host_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,12 +86,12 @@ void HostWidget::autoSizeColumns() auto example_process_pb = example_monitoring_pb.add_processes(); - example_process_pb->set_rclock(999999); - example_process_pb->set_hname("CARPC00____"); - example_process_pb->set_pid(999999); - example_process_pb->set_pname(""); - example_process_pb->set_uname("CameraSensorMapFusionCAF___"); - example_process_pb->set_pparam(""); + example_process_pb->set_registration_clock(999999); + example_process_pb->set_host_name("CARPC00____"); + example_process_pb->set_process_id(999999); + example_process_pb->set_process_name(""); + example_process_pb->set_unit_name("CameraSensorMapFusionCAF___"); + example_process_pb->set_process_parameter(""); HostTreeItem* example_host_item = new HostTreeItem("CARPC00____"); example_host_item->update(example_monitoring_pb); diff --git a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/process_widget.cpp b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/process_widget.cpp index 1530e27834..24fb931a45 100644 --- a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/process_widget.cpp +++ b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/process_widget.cpp @@ -80,7 +80,7 @@ ProcessWidget::ProcessWidget(QWidget *parent) { (int)ProcessTreeModel::Columns::UNIT_NAME, (int)ProcessTreeModel::Columns::HOST_NAME, - (int)ProcessTreeModel::Columns::PID, + (int)ProcessTreeModel::Columns::PROCESS_ID, (int)ProcessTreeModel::Columns::PROCESS_NAME, (int)ProcessTreeModel::Columns::PARAMETERS, (int)ProcessTreeModel::Columns::STATE, @@ -108,12 +108,12 @@ ProcessWidget::~ProcessWidget() void ProcessWidget::autoSizeColumns() { eCAL::pb::Process example_process_pb; - example_process_pb.set_rclock(999999); - example_process_pb.set_hname("HNAME00____"); - example_process_pb.set_pid(999999); - example_process_pb.set_pname(""); - example_process_pb.set_uname("eCALProcessUnitNameABCDE___"); - example_process_pb.set_pparam(""); + example_process_pb.set_registration_clock(999999); + example_process_pb.set_host_name("HNAME00____"); + example_process_pb.set_process_id(999999); + example_process_pb.set_process_name(""); + example_process_pb.set_unit_name("eCALProcessUnitNameABCDE___"); + example_process_pb.set_process_parameter(""); example_process_pb.mutable_state()->set_severity(eCAL::pb::eProcessSeverity::proc_sev_warning); example_process_pb.mutable_state()->set_severity_level(eCAL::pb::eProcessSeverityLevel::proc_sev_level5); @@ -130,7 +130,7 @@ void ProcessWidget::autoSizeColumns() (int)ProcessTreeModel::Columns::GROUP, (int)ProcessTreeModel::Columns::UNIT_NAME, (int)ProcessTreeModel::Columns::HOST_NAME, - (int)ProcessTreeModel::Columns::PID, + (int)ProcessTreeModel::Columns::PROCESS_ID, (int)ProcessTreeModel::Columns::PROCESS_NAME, (int)ProcessTreeModel::Columns::STATE, (int)ProcessTreeModel::Columns::HEARTBEAT, diff --git a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/service_widget.cpp b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/service_widget.cpp index 7b4ca5e4f4..b8a851d753 100644 --- a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/service_widget.cpp +++ b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/service_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ ServiceWidget::ServiceWidget(QWidget *parent) (int)ServiceTreeModel::Columns::HOST_NAME, (int)ServiceTreeModel::Columns::PROCESS_NAME, (int)ServiceTreeModel::Columns::UNIT_NAME, - (int)ServiceTreeModel::Columns::PID, + (int)ServiceTreeModel::Columns::PROCESS_ID, (int)ServiceTreeModel::Columns::SERVICE_NAME, (int)ServiceTreeModel::Columns::SERVICE_TYPE, (int)ServiceTreeModel::Columns::TCP_PORT, @@ -82,7 +82,7 @@ ServiceWidget::ServiceWidget(QWidget *parent) (int)ServiceTreeModel::Columns::SERVICE_NAME, (int)ServiceTreeModel::Columns::SERVICE_TYPE, (int)ServiceTreeModel::Columns::HOST_NAME, - (int)ServiceTreeModel::Columns::PID, + (int)ServiceTreeModel::Columns::PROCESS_ID, (int)ServiceTreeModel::Columns::METHOD_NAME, (int)ServiceTreeModel::Columns::METHOD_REQUEST_TYPE, (int)ServiceTreeModel::Columns::METHOD_RESPONSE_TYPE, @@ -110,16 +110,16 @@ void ServiceWidget::autoSizeColumns() { eCAL::pb::Service example_service_pb; - example_service_pb.set_rclock(999999); - example_service_pb.set_hname("CARPC00____"); - example_service_pb.set_pname(""); - example_service_pb.set_uname("eCALRPCService____"); - example_service_pb.set_pid(999999); - example_service_pb.set_sname("eCALRPCService____"); + example_service_pb.set_registration_clock(999999); + example_service_pb.set_host_name("CARPC00____"); + example_service_pb.set_process_name(""); + example_service_pb.set_unit_name("eCALRPCService____"); + example_service_pb.set_process_id(999999); + example_service_pb.set_service_name("eCALRPCService____"); example_service_pb.set_tcp_port_v1(999999); eCAL::pb::Method* method = example_service_pb.mutable_methods()->Add(); - method->set_mname("ShutdownProcessName____"); + method->set_method_name("ShutdownProcessName____"); method->set_req_type("ShutdownProcessNameRequest____"); method->set_resp_type("ShutdownProcessNameResponse____"); method->set_call_count(999999); @@ -136,7 +136,7 @@ void ServiceWidget::autoSizeColumns() (int)ServiceTreeModel::Columns::UNIT_NAME, (int)ServiceTreeModel::Columns::SERVICE_NAME, (int)ServiceTreeModel::Columns::HOST_NAME, - (int)ServiceTreeModel::Columns::PID, + (int)ServiceTreeModel::Columns::PROCESS_ID, (int)ServiceTreeModel::Columns::TCP_PORT, (int)ServiceTreeModel::Columns::METHOD_NAME, (int)ServiceTreeModel::Columns::METHOD_REQUEST_TYPE, diff --git a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/topic_widget.cpp b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/topic_widget.cpp index 9b2c38787f..6be222f180 100644 --- a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/topic_widget.cpp +++ b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/topic_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -151,7 +151,7 @@ TopicWidget::TopicWidget(QWidget *parent) (int)TopicTreeModel::Columns::DIRECTION, (int)TopicTreeModel::Columns::UNIT_NAME, (int)TopicTreeModel::Columns::HOST_NAME, - (int)TopicTreeModel::Columns::PID, + (int)TopicTreeModel::Columns::PROCESS_ID, (int)TopicTreeModel::Columns::TOPIC_ENCODING, (int)TopicTreeModel::Columns::TOPIC_TYPE, (int)TopicTreeModel::Columns::TOPIC_SIZE, @@ -218,26 +218,26 @@ void TopicWidget::autoSizeColumns() { eCAL::pb::Topic example_topic_pb; - example_topic_pb.set_rclock(999999); - example_topic_pb.set_hname("HOSTNAME____"); - example_topic_pb.set_pid(999999); - example_topic_pb.set_pname(""); - example_topic_pb.set_uname("ATypicalLongUnitName___"); - example_topic_pb.set_tid(""); - example_topic_pb.set_tname("ATypicalLongTopicName___"); + example_topic_pb.set_registration_clock(999999); + example_topic_pb.set_host_name("HOSTNAME____"); + example_topic_pb.set_process_id(999999); + example_topic_pb.set_process_name(""); + example_topic_pb.set_unit_name("ATypicalLongUnitName___"); + example_topic_pb.set_topic_id(""); + example_topic_pb.set_topic_name("ATypicalLongTopicName___"); example_topic_pb.set_direction("subscriber__"); - example_topic_pb.mutable_tdatatype()->set_name("Enc.TypeName.Name____"); - example_topic_pb.mutable_tdatatype()->set_encoding("encdg:"); + example_topic_pb.mutable_datatype_information()->set_name("Enc.TypeName.Name____"); + example_topic_pb.mutable_datatype_information()->set_encoding("encdg:"); //example_topic_pb.mutable_tdatatype()->set_desc(""); - example_topic_pb.mutable_tlayer()->Add()->set_type(eCAL::pb::eTLayerType::tl_ecal_shm); - example_topic_pb.mutable_tlayer()->Add()->set_type(eCAL::pb::eTLayerType::tl_ecal_udp_mc); - example_topic_pb.set_tsize(999999); - example_topic_pb.set_connections_loc(999999); - example_topic_pb.set_connections_ext(999999); + example_topic_pb.mutable_transport_layer()->Add()->set_type(eCAL::pb::eTransportLayerType::tl_ecal_shm); + example_topic_pb.mutable_transport_layer()->Add()->set_type(eCAL::pb::eTransportLayerType::tl_ecal_udp_mc); + example_topic_pb.set_topic_size(999999); + example_topic_pb.set_connections_local(999999); + example_topic_pb.set_connections_external(999999); example_topic_pb.set_message_drops(999999); - example_topic_pb.set_dclock(99999999999); - example_topic_pb.set_dfreq(999999); + example_topic_pb.set_data_clock(99999999999); + example_topic_pb.set_data_frequency(999999); TopicTreeItem* example_topic_item = new TopicTreeItem(example_topic_pb); GroupTreeItem* example_group_item = new GroupTreeItem("ATypicalLongGroupName___", "", "", QVariant(), ""); @@ -257,7 +257,7 @@ void TopicWidget::autoSizeColumns() (int)TopicTreeModel::Columns::DIRECTION, (int)TopicTreeModel::Columns::UNIT_NAME, (int)TopicTreeModel::Columns::HOST_NAME, - (int)TopicTreeModel::Columns::PID, + (int)TopicTreeModel::Columns::PROCESS_ID, (int)TopicTreeModel::Columns::TOPIC_ENCODING, (int)TopicTreeModel::Columns::TOPIC_TYPE, (int)TopicTreeModel::Columns::HEARTBEAT, @@ -295,7 +295,7 @@ void TopicWidget::openReflectionWindowForSelection() { TopicTreeItem* topic_item = (TopicTreeItem*)item; - QString topic_name = topic_item->data(TopicTreeItem::Columns::TNAME, (Qt::ItemDataRole)ItemDataRoles::RawDataRole).toString(); //-V1016 + QString topic_name = topic_item->data(TopicTreeItem::Columns::TOPIC_NAME, (Qt::ItemDataRole)ItemDataRoles::RawDataRole).toString(); //-V1016 if (visualisation_windows_.contains(topic_name)) { @@ -343,7 +343,7 @@ void TopicWidget::fillContextMenu(QMenu& menu, const QList& if (item) { - QString topic_name = item->data((int)TopicTreeItem::Columns::TNAME).toString(); + QString topic_name = item->data((int)TopicTreeItem::Columns::TOPIC_NAME).toString(); QString topic_encoding = item->data((int)TopicTreeItem::Columns::TENCODING).toString(); QString topic_type = item->data((int)TopicTreeItem::Columns::TTYPE).toString(); diff --git a/app/mon/mon_gui/src/widgets/log_widget/log_widget.h b/app/mon/mon_gui/src/widgets/log_widget/log_widget.h index 33e5a22d4c..d3f5b9d459 100644 --- a/app/mon/mon_gui/src/widgets/log_widget/log_widget.h +++ b/app/mon/mon_gui/src/widgets/log_widget/log_widget.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,7 @@ private slots: const QVector filter_columns_ { LogModel::Columns::HOST_NAME, - LogModel::Columns::PID, + LogModel::Columns::PROCESS_ID, LogModel::Columns::PROCESS_NAME, LogModel::Columns::PROCESS_PATH, LogModel::Columns::MESSAGE, diff --git a/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp b/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp index 74d04c2608..0f5d6f5f6a 100644 --- a/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp +++ b/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -170,18 +170,18 @@ void HostTreeItem::update(const eCAL::pb::Monitoring& monitoring_pb) for (int i = 0; i column_mapping = { { Columns::GROUP, -1 }, - { Columns::UNIT_NAME, (int)ProcessTreeItem::Columns::UNAME }, - { Columns::HOST_NAME, (int)ProcessTreeItem::Columns::HNAME }, + { Columns::UNIT_NAME, (int)ProcessTreeItem::Columns::UNIT_NAME }, + { Columns::HOST_NAME, (int)ProcessTreeItem::Columns::HOST_NAME }, { Columns::SHM_TRANSPORT_DOMAIN, (int)ProcessTreeItem::Columns::SHM_TRANSPORT_DOMAIN}, - { Columns::PID, (int)ProcessTreeItem::Columns::PID }, - { Columns::PROCESS_NAME, (int)ProcessTreeItem::Columns::PNAME }, - { Columns::PARAMETERS, (int)ProcessTreeItem::Columns::PPARAM }, + { Columns::PROCESS_ID, (int)ProcessTreeItem::Columns::PROCESS_ID }, + { Columns::PROCESS_NAME, (int)ProcessTreeItem::Columns::PROCESS_NAME }, + { Columns::PARAMETERS, (int)ProcessTreeItem::Columns::PROCESS_PARAMETER }, { Columns::STATE, (int)ProcessTreeItem::Columns::SEVERITY }, { Columns::INFO, (int)ProcessTreeItem::Columns::INFO }, - { Columns::HEARTBEAT, (int)ProcessTreeItem::Columns::RCLOCK }, - { Columns::TIMESYNC_STATE, (int)ProcessTreeItem::Columns::TSYNC_STATE }, + { Columns::HEARTBEAT, (int)ProcessTreeItem::Columns::REGISTRATION_CLOCK }, + { Columns::TIMESYNC_STATE, (int)ProcessTreeItem::Columns::TIME_SYNC_STATE }, { Columns::TIMESYNC_MOD_NAME, (int)ProcessTreeItem::Columns::TSYNC_MOD_NAME }, { Columns::COMPONENT_INIT_INFO, (int)ProcessTreeItem::Columns::COMPONENT_INIT_INFO }, { Columns::ECAL_RUNTIME_VERSION, (int)ProcessTreeItem::Columns::ECAL_RUNTIME_VERSION }, diff --git a/app/mon/mon_gui/src/widgets/models/service_tree_item.h b/app/mon/mon_gui/src/widgets/models/service_tree_item.h index 624abd336e..f9f7de2299 100644 --- a/app/mon/mon_gui/src/widgets/models/service_tree_item.h +++ b/app/mon/mon_gui/src/widgets/models/service_tree_item.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,15 +46,15 @@ class ServiceTreeItem : enum class Columns : int { - RCLOCK, - HNAME, - PNAME, - UNAME, - PID, - SNAME, + REGISTRATION_CLOCK, + HOST_NAME, + PROCESS_NAME, + UNIT_NAME, + PROCESS_ID, + SERVICE_NAME, STYPE, TCP_PORT, - MNAME, + METHOD_NAME, REQ_TYPE, RESP_TYPE, CALL_COUNT, @@ -80,29 +80,29 @@ class ServiceTreeItem : { if (role == (Qt::ItemDataRole)ItemDataRoles::RawDataRole) //-V1016 //-V547 { - if (column == Columns::RCLOCK) + if (column == Columns::REGISTRATION_CLOCK) { - return service_.rclock(); + return service_.registration_clock(); } - else if (column == Columns::HNAME) + else if (column == Columns::HOST_NAME) { - return service_.hname().c_str(); + return service_.host_name().c_str(); } - else if (column == Columns::PNAME) + else if (column == Columns::PROCESS_NAME) { - return service_.pname().c_str(); + return service_.process_name().c_str(); } - else if (column == Columns::UNAME) + else if (column == Columns::UNIT_NAME) { - return service_.uname().c_str(); + return service_.unit_name().c_str(); } - else if (column == Columns::PID) + else if (column == Columns::PROCESS_ID) { - return service_.pid(); + return service_.process_id(); } - else if (column == Columns::SNAME) + else if (column == Columns::SERVICE_NAME) { - return service_.sname().c_str(); + return service_.service_name().c_str(); } else if (column == Columns::STYPE) { @@ -112,9 +112,9 @@ class ServiceTreeItem : { return tcpPort() != 0 ? tcpPort() : QVariant(); } - else if (column == Columns::MNAME) + else if (column == Columns::METHOD_NAME) { - return method_.mname().c_str(); + return method_.method_name().c_str(); } else if (column == Columns::REQ_TYPE) { @@ -135,11 +135,11 @@ class ServiceTreeItem : } else if ((role == Qt::ItemDataRole::DisplayRole) || (role == Qt::ItemDataRole::ToolTipRole)) { - if ((column == Columns::HNAME) - || (column == Columns::PNAME) - || (column == Columns::UNAME) - || (column == Columns::SNAME) - || (column == Columns::MNAME) + if ((column == Columns::HOST_NAME) + || (column == Columns::PROCESS_NAME) + || (column == Columns::UNIT_NAME) + || (column == Columns::SERVICE_NAME) + || (column == Columns::METHOD_NAME) || (column == Columns::REQ_TYPE) || (column == Columns::RESP_TYPE)) { @@ -164,8 +164,8 @@ class ServiceTreeItem : else if (role == Qt::ItemDataRole::TextAlignmentRole) { - if ((column == Columns::RCLOCK) - || (column == Columns::PID) + if ((column == Columns::REGISTRATION_CLOCK) + || (column == Columns::PROCESS_ID) || (column == Columns::TCP_PORT) || (column == Columns::CALL_COUNT) ) @@ -180,24 +180,24 @@ class ServiceTreeItem : else if (role == ItemDataRoles::GroupRole) //-V547 { - if (column == Columns::PNAME) + if (column == Columns::PROCESS_NAME) { - QStringList list{ service_.hname().c_str(), service_.pname().c_str() }; + QStringList list{ service_.host_name().c_str(), service_.process_name().c_str() }; return list; } - else if (column == Columns::PID) + else if (column == Columns::PROCESS_ID) { - QStringList list{ service_.hname().c_str(), QString::number(service_.pid()) }; + QStringList list{ service_.host_name().c_str(), QString::number(service_.process_id()) }; return list; } - else if (column == Columns::UNAME) + else if (column == Columns::UNIT_NAME) { - QStringList list{ service_.hname().c_str(), service_.uname().c_str(), QString::number(service_.pid()) }; + QStringList list{ service_.host_name().c_str(), service_.unit_name().c_str(), QString::number(service_.process_id()) }; return list; } - else if (column == Columns::SNAME) + else if (column == Columns::SERVICE_NAME) { - QStringList list{ service_.sname().c_str(), service_.hname().c_str(), service_.uname().c_str(), QString::number(service_.pid()) }; + QStringList list{ service_.service_name().c_str(), service_.host_name().c_str(), service_.unit_name().c_str(), QString::number(service_.process_id()) }; return list; } else @@ -208,12 +208,12 @@ class ServiceTreeItem : else if (role == Qt::ItemDataRole::FontRole) { - if ((column == Columns::HNAME) - || (column == Columns::PNAME) - || (column == Columns::UNAME) - || (column == Columns::SNAME) + if ((column == Columns::HOST_NAME) + || (column == Columns::PROCESS_NAME) + || (column == Columns::UNIT_NAME) + || (column == Columns::SERVICE_NAME) || (column == Columns::STYPE) - || (column == Columns::MNAME) + || (column == Columns::METHOD_NAME) || (column == Columns::REQ_TYPE) || (column == Columns::RESP_TYPE)) { @@ -250,7 +250,7 @@ class ServiceTreeItem : static std::string generateIdentifier(const T& service, const eCAL::pb::Method& method) { - return std::to_string(service.pid()) + "@" + service.hname() + "@" + service.sname() + "@" + method.mname(); + return std::to_string(service.process_id()) + "@" + service.host_name() + "@" + service.service_name() + "@" + method.method_name(); } void update(const T& service, const eCAL::pb::Method& method) diff --git a/app/mon/mon_gui/src/widgets/models/service_tree_model.h b/app/mon/mon_gui/src/widgets/models/service_tree_model.h index 557ff0a08f..171fc693d2 100644 --- a/app/mon/mon_gui/src/widgets/models/service_tree_model.h +++ b/app/mon/mon_gui/src/widgets/models/service_tree_model.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ class ServiceTreeModel : public GroupTreeModel SERVICE_NAME, PROCESS_NAME, HOST_NAME, - PID, + PROCESS_ID, TCP_PORT, METHOD_NAME, METHOD_REQUEST_TYPE, @@ -82,7 +82,7 @@ class ServiceTreeModel : public GroupTreeModel { Columns::GROUP, "Group" }, { Columns::HEARTBEAT, "Heartbeat" }, { Columns::HOST_NAME, "Host" }, - { Columns::PID, "PID" }, + { Columns::PROCESS_ID, "Process Id" }, { Columns::PROCESS_NAME, "Process Path" }, { Columns::UNIT_NAME, "Process" }, { Columns::SERVICE_NAME, "Service" }, @@ -97,15 +97,15 @@ class ServiceTreeModel : public GroupTreeModel std::map tree_item_column_mapping = { { Columns::GROUP, -1 }, - { Columns::HEARTBEAT, (int)ServiceTreeItem::Columns::RCLOCK }, - { Columns::HOST_NAME, (int)ServiceTreeItem::Columns::HNAME }, - { Columns::PID, (int)ServiceTreeItem::Columns::PID }, - { Columns::PROCESS_NAME, (int)ServiceTreeItem::Columns::PNAME }, - { Columns::UNIT_NAME, (int)ServiceTreeItem::Columns::UNAME }, - { Columns::SERVICE_NAME, (int)ServiceTreeItem::Columns::SNAME }, + { Columns::HEARTBEAT, (int)ServiceTreeItem::Columns::REGISTRATION_CLOCK }, + { Columns::HOST_NAME, (int)ServiceTreeItem::Columns::HOST_NAME }, + { Columns::PROCESS_ID, (int)ServiceTreeItem::Columns::PROCESS_ID }, + { Columns::PROCESS_NAME, (int)ServiceTreeItem::Columns::PROCESS_NAME }, + { Columns::UNIT_NAME, (int)ServiceTreeItem::Columns::UNIT_NAME }, + { Columns::SERVICE_NAME, (int)ServiceTreeItem::Columns::SERVICE_NAME }, { Columns::SERVICE_TYPE, (int)ServiceTreeItem::Columns::STYPE }, { Columns::TCP_PORT, (int)ServiceTreeItem::Columns::TCP_PORT }, - { Columns::METHOD_NAME, (int)ServiceTreeItem::Columns::MNAME }, + { Columns::METHOD_NAME, (int)ServiceTreeItem::Columns::METHOD_NAME }, { Columns::METHOD_REQUEST_TYPE, (int)ServiceTreeItem::Columns::REQ_TYPE }, { Columns::METHOD_RESPONSE_TYPE, (int)ServiceTreeItem::Columns::RESP_TYPE }, { Columns::CALL_COUNT, (int)ServiceTreeItem::Columns::CALL_COUNT }, diff --git a/app/mon/mon_gui/src/widgets/models/topic_tree_item.cpp b/app/mon/mon_gui/src/widgets/models/topic_tree_item.cpp index 296200e167..007491c57f 100644 --- a/app/mon/mon_gui/src/widgets/models/topic_tree_item.cpp +++ b/app/mon/mon_gui/src/widgets/models/topic_tree_item.cpp @@ -44,37 +44,37 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const { if (role == (Qt::ItemDataRole)ItemDataRoles::RawDataRole) //-V1016 //-V547 { - if (column == Columns::RCLOCK) + if (column == Columns::REGISTRATION_CLOCK) { - return topic_.rclock(); + return topic_.registration_clock(); } - else if (column == Columns::HNAME) + else if (column == Columns::HOST_NAME) { - return topic_.hname().c_str(); + return topic_.host_name().c_str(); } else if (column == Columns::SHM_TRANSPORT_DOMAIN) { return topic_.shm_transport_domain().c_str(); } - else if (column == Columns::PID) + else if (column == Columns::PROCESS_ID) { - return topic_.pid(); + return topic_.process_id(); } - else if (column == Columns::PNAME) + else if (column == Columns::PROCESS_NAME) { - return topic_.pname().c_str(); + return topic_.process_name().c_str(); } - else if (column == Columns::UNAME) + else if (column == Columns::UNIT_NAME) { - return topic_.uname().c_str(); + return topic_.unit_name().c_str(); } - else if (column == Columns::TID) + else if (column == Columns::TOPIC_ID) { - return topic_.tid().c_str(); + return topic_.topic_id().c_str(); } - else if (column == Columns::TNAME) + else if (column == Columns::TOPIC_NAME) { - return topic_.tname().c_str(); + return topic_.topic_name().c_str(); } else if (column == Columns::DIRECTION) { @@ -82,49 +82,49 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const } else if (column == Columns::TENCODING) { - return topic_.tdatatype().encoding().c_str(); + return topic_.datatype_information().encoding().c_str(); } else if (column == Columns::TTYPE) { - return topic_.tdatatype().name().c_str(); + return topic_.datatype_information().name().c_str(); } else if (column == Columns::TDESC) { - return topic_.tdatatype().desc().c_str(); + return topic_.datatype_information().descriptor_information().c_str(); } - else if (column == Columns::TLAYER) + else if (column == Columns::TRANSPORT_LAYER) { QList layers; - auto layer_pb = topic_.tlayer(); + auto layer_pb = topic_.transport_layer(); for (const auto& layer : layer_pb) { layers.push_back(layer.type()); } return layers; } - else if (column == Columns::TSIZE) + else if (column == Columns::TOPIC_SIZE) { - return topic_.tsize(); + return topic_.topic_size(); } - else if (column == Columns::CONNECTIONS_LOC) + else if (column == Columns::CONNECTIONS_LOCAL) { - return topic_.connections_loc(); + return topic_.connections_local(); } - else if (column == Columns::CONNECTIONS_EXT) + else if (column == Columns::CONNECTIONS_EXTERNAL) { - return topic_.connections_ext(); + return topic_.connections_external(); } else if (column == Columns::MESSAGE_DROPS) { return topic_.message_drops(); } - else if (column == Columns::DCLOCK) + else if (column == Columns::DATA_CLOCK) { - return (long long)topic_.dclock(); + return (long long)topic_.data_clock(); } else if (column == Columns::DFREQ) { - return topic_.dfreq(); + return topic_.data_frequency(); } else { @@ -134,10 +134,10 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const else if ((role == Qt::ItemDataRole::DisplayRole) || (role == Qt::ItemDataRole::ToolTipRole)) { - if ((column == Columns::HNAME) - || (column == Columns::PNAME) - || (column == Columns::UNAME) - || (column == Columns::TNAME) + if ((column == Columns::HOST_NAME) + || (column == Columns::PROCESS_NAME) + || (column == Columns::UNIT_NAME) + || (column == Columns::TOPIC_NAME) || (column == Columns::DIRECTION) || (column == Columns::TENCODING) || (column == Columns::TTYPE)) @@ -147,7 +147,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const } else if (column == Columns::TDESC) { - const std::string& raw_data = topic_.tdatatype().desc(); + const std::string& raw_data = topic_.datatype_information().descriptor_information(); if (!raw_data.empty()) { @@ -168,11 +168,11 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const return "None"; } } - else if (column == Columns::TLAYER) + else if (column == Columns::TRANSPORT_LAYER) { QString layer_string; - auto layer_pb = topic_.tlayer(); + auto layer_pb = topic_.transport_layer(); for (const auto& layer : layer_pb) { @@ -181,16 +181,16 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const { switch (layer.type()) { - case eCAL::pb::eTLayerType::tl_ecal_tcp: + case eCAL::pb::eTransportLayerType::tl_ecal_tcp: this_layer_string = "tcp"; break; - case eCAL::pb::eTLayerType::tl_ecal_udp_mc: + case eCAL::pb::eTransportLayerType::tl_ecal_udp_mc: this_layer_string = "udp_mc"; break; - case eCAL::pb::eTLayerType::tl_ecal_shm: + case eCAL::pb::eTransportLayerType::tl_ecal_shm: this_layer_string = "shm"; break; - case eCAL::pb::eTLayerType::tl_all: + case eCAL::pb::eTransportLayerType::tl_all: this_layer_string = "all"; break; default: @@ -224,7 +224,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const { if (column == Columns::TDESC) { - const std::string& raw_data = topic_.tdatatype().desc(); + const std::string& raw_data = topic_.datatype_information().descriptor_information(); return static_cast(raw_data.size()); } @@ -233,11 +233,11 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const else if (role == (Qt::ItemDataRole)ItemDataRoles::FilterRole) //-V1016 //-V547 { - if ((column == Columns::HNAME) + if ((column == Columns::HOST_NAME) || (column == Columns::SHM_TRANSPORT_DOMAIN) - || (column == Columns::PNAME) - || (column == Columns::UNAME) - || (column == Columns::TNAME) + || (column == Columns::PROCESS_NAME) + || (column == Columns::UNIT_NAME) + || (column == Columns::TOPIC_NAME) || (column == Columns::DIRECTION) || (column == Columns::TENCODING) || (column == Columns::TTYPE)) @@ -253,14 +253,14 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const else if (role == Qt::ItemDataRole::TextAlignmentRole) { - if ((column == Columns::TID) - || (column == Columns::PID) - || (column == Columns::RCLOCK) - || (column == Columns::TSIZE) - || (column == Columns::CONNECTIONS_LOC) - || (column == Columns::CONNECTIONS_EXT) + if ((column == Columns::TOPIC_ID) + || (column == Columns::PROCESS_ID) + || (column == Columns::REGISTRATION_CLOCK) + || (column == Columns::TOPIC_SIZE) + || (column == Columns::CONNECTIONS_LOCAL) + || (column == Columns::CONNECTIONS_EXTERNAL) || (column == Columns::MESSAGE_DROPS) - || (column == Columns::DCLOCK) + || (column == Columns::DATA_CLOCK) || (column == Columns::DFREQ) ) { @@ -274,19 +274,19 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const else if (role == (Qt::ItemDataRole)ItemDataRoles::GroupRole) //-V1016 //-V547 { - if (column == Columns::PID) + if (column == Columns::PROCESS_ID) { - const QStringList list{ topic_.hname().c_str(), QString::number(topic_.pid()) }; + const QStringList list{ topic_.host_name().c_str(), QString::number(topic_.process_id()) }; return list; } - else if (column == Columns::PNAME) + else if (column == Columns::PROCESS_NAME) { - const QStringList list{topic_.hname().c_str(), topic_.pname().c_str()}; + const QStringList list{topic_.host_name().c_str(), topic_.process_name().c_str()}; return list; } - else if (column == Columns::UNAME) + else if (column == Columns::UNIT_NAME) { - const QStringList list{ topic_.hname().c_str(), topic_.uname().c_str(), QString::number(topic_.pid()) }; + const QStringList list{ topic_.host_name().c_str(), topic_.unit_name().c_str(), QString::number(topic_.process_id()) }; return list; } else @@ -298,11 +298,11 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const else if (role == Qt::ItemDataRole::FontRole) { - if ((column == Columns::HNAME) + if ((column == Columns::HOST_NAME) || (column == Columns::SHM_TRANSPORT_DOMAIN) - || (column == Columns::PNAME) - || (column == Columns::UNAME) - || (column == Columns::TNAME) + || (column == Columns::PROCESS_NAME) + || (column == Columns::UNIT_NAME) + || (column == Columns::TOPIC_NAME) || (column == Columns::DIRECTION) || (column == Columns::TENCODING) || (column == Columns::TTYPE)) @@ -317,7 +317,7 @@ QVariant TopicTreeItem::data(Columns column, Qt::ItemDataRole role) const } else if (column == Columns::TDESC) { - const std::string& raw_data = topic_.tdatatype().desc(); + const std::string& raw_data = topic_.datatype_information().descriptor_information(); if (raw_data.empty()) { QFont font; @@ -364,5 +364,5 @@ QString TopicTreeItem::toFrequencyString(long long freq) std::string TopicTreeItem::topicId() const { - return topic_.tid(); + return topic_.topic_id(); } diff --git a/app/mon/mon_gui/src/widgets/models/topic_tree_item.h b/app/mon/mon_gui/src/widgets/models/topic_tree_item.h index 6661d7710d..2320403573 100644 --- a/app/mon/mon_gui/src/widgets/models/topic_tree_item.h +++ b/app/mon/mon_gui/src/widgets/models/topic_tree_item.h @@ -37,24 +37,24 @@ class TopicTreeItem : enum class Columns : int { - RCLOCK, - HNAME, + REGISTRATION_CLOCK, + HOST_NAME, SHM_TRANSPORT_DOMAIN, - PID, - PNAME, - UNAME, - TID, - TNAME, + PROCESS_ID, + PROCESS_NAME, + UNIT_NAME, + TOPIC_ID, + TOPIC_NAME, DIRECTION, TENCODING, TTYPE, TDESC, - TLAYER, - TSIZE, - CONNECTIONS_LOC, - CONNECTIONS_EXT, + TRANSPORT_LAYER, + TOPIC_SIZE, + CONNECTIONS_LOCAL, + CONNECTIONS_EXTERNAL, MESSAGE_DROPS, - DCLOCK, + DATA_CLOCK, DFREQ, }; diff --git a/app/mon/mon_gui/src/widgets/models/topic_tree_model.cpp b/app/mon/mon_gui/src/widgets/models/topic_tree_model.cpp index 919aa0417e..4f63fe37cb 100644 --- a/app/mon/mon_gui/src/widgets/models/topic_tree_model.cpp +++ b/app/mon/mon_gui/src/widgets/models/topic_tree_model.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ void TopicTreeModel::monitorUpdated(const eCAL::pb::Monitoring& monitoring_pb) for (const auto& topic : monitoring_pb.topics()) { - std::string topic_id = topic.tid(); + std::string topic_id = topic.topic_id(); if (topic_tree_item_map_.find(topic_id) == topic_tree_item_map_.end()) { diff --git a/app/mon/mon_gui/src/widgets/models/topic_tree_model.h b/app/mon/mon_gui/src/widgets/models/topic_tree_model.h index afb474c55f..ee40404821 100644 --- a/app/mon/mon_gui/src/widgets/models/topic_tree_model.h +++ b/app/mon/mon_gui/src/widgets/models/topic_tree_model.h @@ -52,7 +52,7 @@ class TopicTreeModel : public GroupTreeModel UNIT_NAME, HOST_NAME, SHM_TRANSPORT_DOMAIN, - PID, + PROCESS_ID, PROCESS_NAME, TOPIC_TYPE, HEARTBEAT, @@ -91,7 +91,7 @@ class TopicTreeModel : public GroupTreeModel { Columns::HEARTBEAT, "Heartbeat" }, { Columns::HOST_NAME, "Host" }, { Columns::SHM_TRANSPORT_DOMAIN, "SHM Transport Domain" }, - { Columns::PID, "PID" }, + { Columns::PROCESS_ID, "Process Id" }, { Columns::PROCESS_NAME, "Process Path" }, { Columns::UNIT_NAME, "Process" }, { Columns::TOPIC_ID, "Topic ID" }, @@ -112,24 +112,24 @@ class TopicTreeModel : public GroupTreeModel std::map topic_tree_item_column_mapping = { { Columns::GROUP, -1 }, - { Columns::HEARTBEAT, (int)TopicTreeItem::Columns::RCLOCK }, - { Columns::HOST_NAME, (int)TopicTreeItem::Columns::HNAME }, + { Columns::HEARTBEAT, (int)TopicTreeItem::Columns::REGISTRATION_CLOCK }, + { Columns::HOST_NAME, (int)TopicTreeItem::Columns::HOST_NAME }, { Columns::SHM_TRANSPORT_DOMAIN, (int)TopicTreeItem::Columns::SHM_TRANSPORT_DOMAIN }, - { Columns::PID, (int)TopicTreeItem::Columns::PID }, - { Columns::PROCESS_NAME, (int)TopicTreeItem::Columns::PNAME }, - { Columns::UNIT_NAME, (int)TopicTreeItem::Columns::UNAME }, - { Columns::TOPIC_ID, (int)TopicTreeItem::Columns::TID }, - { Columns::TOPIC_NAME, (int)TopicTreeItem::Columns::TNAME }, + { Columns::PROCESS_ID, (int)TopicTreeItem::Columns::PROCESS_ID }, + { Columns::PROCESS_NAME, (int)TopicTreeItem::Columns::PROCESS_NAME }, + { Columns::UNIT_NAME, (int)TopicTreeItem::Columns::UNIT_NAME }, + { Columns::TOPIC_ID, (int)TopicTreeItem::Columns::TOPIC_ID }, + { Columns::TOPIC_NAME, (int)TopicTreeItem::Columns::TOPIC_NAME }, { Columns::DIRECTION, (int)TopicTreeItem::Columns::DIRECTION }, { Columns::TOPIC_ENCODING, (int)TopicTreeItem::Columns::TENCODING }, { Columns::TOPIC_TYPE, (int)TopicTreeItem::Columns::TTYPE }, { Columns::TOPIC_DESCRIPTOR, (int)TopicTreeItem::Columns::TDESC }, - { Columns::TRANSPORT_LAYER, (int)TopicTreeItem::Columns::TLAYER }, - { Columns::TOPIC_SIZE, (int)TopicTreeItem::Columns::TSIZE }, - { Columns::CONNECTIONS_LOCAL, (int)TopicTreeItem::Columns::CONNECTIONS_LOC }, - { Columns::CONNECTIONS_EXTERNAL, (int)TopicTreeItem::Columns::CONNECTIONS_EXT }, + { Columns::TRANSPORT_LAYER, (int)TopicTreeItem::Columns::TRANSPORT_LAYER }, + { Columns::TOPIC_SIZE, (int)TopicTreeItem::Columns::TOPIC_SIZE }, + { Columns::CONNECTIONS_LOCAL, (int)TopicTreeItem::Columns::CONNECTIONS_LOCAL }, + { Columns::CONNECTIONS_EXTERNAL, (int)TopicTreeItem::Columns::CONNECTIONS_EXTERNAL }, { Columns::MESSAGE_DROPS, (int)TopicTreeItem::Columns::MESSAGE_DROPS }, - { Columns::DATA_CLOCK, (int)TopicTreeItem::Columns::DCLOCK }, + { Columns::DATA_CLOCK, (int)TopicTreeItem::Columns::DATA_CLOCK }, { Columns::DATA_FREQUENCY, (int)TopicTreeItem::Columns::DFREQ }, }; diff --git a/app/mon/mon_gui/src/widgets/visualisation_widget/visualisation_widget.cpp b/app/mon/mon_gui/src/widgets/visualisation_widget/visualisation_widget.cpp index 3a9a4c8326..30ecc35eb6 100644 --- a/app/mon/mon_gui/src/widgets/visualisation_widget/visualisation_widget.cpp +++ b/app/mon/mon_gui/src/widgets/visualisation_widget/visualisation_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,9 +184,9 @@ void VisualisationWidget::checkForMorePublishersWithSameTopic(const eCAL::pb::Mo { if (!topic_name_.isNull()) { - if ((topic.tname() == topic_name_.toStdString()) && (topic.direction() == std::string("publisher"))) + if ((topic.topic_name() == topic_name_.toStdString()) && (topic.direction() == std::string("publisher"))) { - publishers.append(QString(QString(topic.hname().c_str()) + QString(": ") + QString(topic.pname().c_str()))); + publishers.append(QString(QString(topic.host_name().c_str()) + QString(": ") + QString(topic.process_name().c_str()))); } } } diff --git a/app/mon/mon_tui/src/model/data/process.hpp b/app/mon/mon_tui/src/model/data/process.hpp index bb3dba80c0..7d072c2dcb 100644 --- a/app/mon/mon_tui/src/model/data/process.hpp +++ b/app/mon/mon_tui/src/model/data/process.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ struct Process NONE, REALTIME, REPLAY }; - int32_t pid; + int32_t process_id; std::string name; std::string host_name; std::string unit_name; diff --git a/app/mon/mon_tui/src/model/data/service.hpp b/app/mon/mon_tui/src/model/data/service.hpp index 01d28b0cd7..d104c34132 100644 --- a/app/mon/mon_tui/src/model/data/service.hpp +++ b/app/mon/mon_tui/src/model/data/service.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ struct Service std::string id; std::string host_name; std::string process_name; - int32_t pid; + int32_t process_id; std::string unit_name; int32_t registration_clock; uint32_t tcp_port; diff --git a/app/mon/mon_tui/src/model/data/topic.hpp b/app/mon/mon_tui/src/model/data/topic.hpp index 5486301baf..7e4a5499db 100644 --- a/app/mon/mon_tui/src/model/data/topic.hpp +++ b/app/mon/mon_tui/src/model/data/topic.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ struct Topic int32_t registration_clock; std::string host_name; - int32_t pid; + int32_t process_id; std::string process_name; std::string unit_name; std::string id; diff --git a/app/mon/mon_tui/src/model/log.hpp b/app/mon/mon_tui/src/model/log.hpp index 0bdebdec77..08bcb567a5 100644 --- a/app/mon/mon_tui/src/model/log.hpp +++ b/app/mon/mon_tui/src/model/log.hpp @@ -39,7 +39,7 @@ struct LogEntry }; int64_t time; std::string host_name; - int32_t pid; + int32_t process_id; std::string process_name; std::string process_path; Level log_level; @@ -97,10 +97,10 @@ class LogModel { return LogEntry { val.time(), - val.hname(), - val.pid(), - val.uname(), - val.pname(), + val.host_name(), + val.process_id(), + val.unit_name(), + val.process_name(), ToLogLevel(val.level()), val.content() }; diff --git a/app/mon/mon_tui/src/model/monitor.hpp b/app/mon/mon_tui/src/model/monitor.hpp index 009812fae7..1b9b83b18b 100644 --- a/app/mon/mon_tui/src/model/monitor.hpp +++ b/app/mon/mon_tui/src/model/monitor.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,7 +99,7 @@ class MonitorModel } } - Process::TimeSyncState TimeSyncState(eCAL::pb::eTSyncState state) + Process::TimeSyncState TimeSyncState(eCAL::pb::eTimeSyncState state) { switch(state) { @@ -120,7 +120,7 @@ class MonitorModel return Topic::Direction::SUBSCRIBER; } - Topic::TransportLayer TopicTransportLayer(eCAL::pb::eTLayerType layer) + Topic::TransportLayer TopicTransportLayer(eCAL::pb::eTransportLayerType layer) { switch(layer) { @@ -150,30 +150,30 @@ class MonitorModel std::unordered_map hosts_map; for(auto &p: *mon_.mutable_processes()) { - if(hosts_map.find(p.hname()) == hosts_map.end()) + if(hosts_map.find(p.host_name()) == hosts_map.end()) { auto &host = hosts.emplace_back(); - host.name = p.hname(); + host.name = p.host_name(); hosts_map[host.name] = &host; } auto &process = processes.emplace_back(); - process.pid = p.pid(); - process.name = std::move(*p.mutable_pname()); - process.host_name = std::move(*p.mutable_hname()); - process.unit_name = std::move(*p.mutable_uname()); - process.params = std::move(*p.mutable_pparam()); + process.process_id = p.process_id(); + process.name = std::move(*p.mutable_process_name()); + process.host_name = std::move(*p.mutable_host_name()); + process.unit_name = std::move(*p.mutable_unit_name()); + process.params = std::move(*p.mutable_process_parameter()); process.severity = Severity(p.state().severity()); process.severity_level = SeverityLevel(p.state().severity_level()); process.state_info = std::move(*p.mutable_state()->mutable_info()); - process.time_sync_state = TimeSyncState(p.tsync_state()); - process.time_sync_mod_name = std::move(*p.mutable_tsync_mod_name()); + process.time_sync_state = TimeSyncState(p.time_sync_state()); + process.time_sync_mod_name = std::move(*p.mutable_time_sync_module_name()); process.component_init_info = std::move(*p.mutable_component_init_info()); process.ecal_runtime_version = std::move(*p.mutable_ecal_runtime_version()); } for (auto &t : *mon_.mutable_topics()) { - auto &name = t.hname(); + auto &name = t.host_name(); auto &direction = t.direction(); auto found = hosts_map.find(name); if(found != hosts_map.end()) @@ -182,40 +182,40 @@ class MonitorModel if(direction == "publisher") { host->publisher_count++; - host->data_sent_bytes += ((long long)t.tsize() * (long long)t.dfreq()) / 1000; + host->data_sent_bytes += ((long long)t.topic_size() * (long long)t.data_frequency()) / 1000; } else if(direction == "subscriber") { host->subscriber_count++; - host->data_received_bytes += ((long long)t.tsize() * (long long)t.dfreq()) / 1000; + host->data_received_bytes += ((long long)t.topic_size() * (long long)t.data_frequency()) / 1000; } } auto &topic = topics.emplace_back(); - topic.registration_clock = t.rclock(); - topic.host_name = std::move(*t.mutable_hname()); - topic.pid = t.pid(); - topic.process_name = std::move(*t.mutable_pname()); - topic.unit_name = std::move(*t.mutable_uname()); - topic.id = std::move(*t.mutable_tid()); - topic.name = std::move(*t.mutable_tname()); + topic.registration_clock = t.registration_clock(); + topic.host_name = std::move(*t.mutable_host_name()); + topic.process_id = t.process_id(); + topic.process_name = std::move(*t.mutable_process_name()); + topic.unit_name = std::move(*t.mutable_unit_name()); + topic.id = std::move(*t.mutable_topic_id()); + topic.name = std::move(*t.mutable_topic_name()); topic.direction = TopicDirection(t.direction()); - topic.encoding = std::move(*t.mutable_tdatatype()->mutable_encoding()); - topic.type = std::move(*t.mutable_tdatatype()->mutable_name()); - topic.type_descriptor = std::move(*t.mutable_tdatatype()->mutable_desc()); - for(auto &tl: t.tlayer()) + topic.encoding = std::move(*t.mutable_datatype_information()->mutable_encoding()); + topic.type = std::move(*t.mutable_datatype_information()->mutable_name()); + topic.type_descriptor = std::move(*t.mutable_datatype_information()->mutable_descriptor_information()); + for(auto &tl: t.transport_layer()) { if (tl.active()) { topic.transport_layers.emplace_back(TopicTransportLayer(tl.type())); } } - topic.size = t.tsize(); - topic.local_connections_count = t.connections_loc(); - topic.external_connections_count = t.connections_ext(); + topic.size = t.topic_size(); + topic.local_connections_count = t.connections_local(); + topic.external_connections_count = t.connections_external(); topic.message_drops = t.message_drops(); - topic.data_id = t.did(); - topic.data_clock = t.dclock(); - topic.data_frequency = t.dfreq(); + topic.data_id = t.data_id(); + topic.data_clock = t.data_clock(); + topic.data_frequency = t.data_frequency(); for(auto &attr: *t.mutable_attr()) { topic.attributes.emplace( @@ -229,17 +229,17 @@ class MonitorModel for(auto &s: *mon_.mutable_services()) { auto &service = services.emplace_back(); - service.id = s.sid(); - service.name = std::move(*s.mutable_sname()); - service.host_name = std::move(*s.mutable_hname()); - service.process_name = std::move(*s.mutable_pname()); - service.unit_name = std::move(*s.mutable_uname()); - service.registration_clock = s.rclock(); + service.id = s.service_id(); + service.name = std::move(*s.mutable_service_name()); + service.host_name = std::move(*s.mutable_host_name()); + service.process_name = std::move(*s.mutable_process_name()); + service.unit_name = std::move(*s.mutable_unit_name()); + service.registration_clock = s.registration_clock(); service.tcp_port = s.tcp_port_v1(); for(auto &m: *s.mutable_methods()) { auto &method = service.methods.emplace_back(); - method.name = std::move(*m.mutable_mname()); + method.name = std::move(*m.mutable_method_name()); method.request_type = std::move(*m.mutable_req_type()); method.response_type = std::move(*m.mutable_resp_type()); method.call_count = m.call_count(); diff --git a/app/mon/mon_tui/src/tui/view/log_details.hpp b/app/mon/mon_tui/src/tui/view/log_details.hpp index 2111e55b5a..4fb9526acc 100644 --- a/app/mon/mon_tui/src/tui/view/log_details.hpp +++ b/app/mon/mon_tui/src/tui/view/log_details.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ class LogDetailsView : public View return vbox ( separatorEmpty(), text("Host name: " + details->host_name), - text("PID: " + std::to_string(details->pid)), + text("PID: " + std::to_string(details->process_id)), text("Process path: " + details->process_path), separatorEmpty(), text("Message:"), diff --git a/app/mon/mon_tui/src/tui/view/topic_details.hpp b/app/mon/mon_tui/src/tui/view/topic_details.hpp index 518cec18e8..6083869ab4 100644 --- a/app/mon/mon_tui/src/tui/view/topic_details.hpp +++ b/app/mon/mon_tui/src/tui/view/topic_details.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,14 +73,14 @@ class TopicDetailsView : public View vizualization_view = ftxui::Renderer([]{ return ftxui::emptyElement(); }); } - const auto tname = topic->name; + const auto topic_name = topic->name; const auto tencoding = topic->encoding; const auto ttype = topic->type; - if(tname != prev_topic) + if(topic_name != prev_topic) { - prev_topic = tname; + prev_topic = topic_name; vizualization_view->Detach(); - vizualization_view = CreateVisualizationView(view_factory, view_model->view_model_factory, tname, tencoding, ttype); + vizualization_view = CreateVisualizationView(view_factory, view_model->view_model_factory, topic_name, tencoding, ttype); Add(vizualization_view); } return vizualization_view; diff --git a/app/mon/mon_tui/src/tui/viewmodel/processes.hpp b/app/mon/mon_tui/src/tui/viewmodel/processes.hpp index a671d5e26d..94ec6a51bb 100644 --- a/app/mon/mon_tui/src/tui/viewmodel/processes.hpp +++ b/app/mon/mon_tui/src/tui/viewmodel/processes.hpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ class ProcessesViewModel : public TableViewModel case Column::Host: return value.host_name; case Column::PID: - return std::to_string(value.pid); + return std::to_string(value.process_id); case Column::Name: return value.name; case Column::Info: diff --git a/app/play/play_core/src/state_publisher_thread.cpp b/app/play/play_core/src/state_publisher_thread.cpp index c9a59957ad..6aaa398dcb 100644 --- a/app/play/play_core/src/state_publisher_thread.cpp +++ b/app/play/play_core/src/state_publisher_thread.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -123,7 +123,7 @@ void StatePublisherThread::PublishSimtime() simtime_pb.set_simulation_time_nsecs(std::chrono::duration_cast(state.last_simtime_.time_since_epoch()).count()); simtime_pb.set_real_time_factor (state.simtime_rate_); simtime_pb.set_local_time_nsecs (std::chrono::duration_cast(state.last_simtime_local_timestamp_.time_since_epoch()).count()); - simtime_pb.set_hostname (eCAL::Process::GetHostName()); + simtime_pb.set_host_name (eCAL::Process::GetHostName()); simtime_pb.set_process_id (eCAL::Process::GetProcessID()); simtime_publisher_.Send(simtime_pb); diff --git a/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp b/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp index 33ea84048b..87e566a151 100644 --- a/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp +++ b/app/play/play_gui/src/widgets/channel_widget/channel_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -430,9 +430,9 @@ void ChannelWidget::uncheckPublished() for (const auto& topic : monitoring_pb.topics()) { // Only respect published topics not published by eCAL Play itself - if ((topic.direction() == "publisher") && !((topic.uname() == "eCALPlay") || (topic.uname() == "eCALPlayGUI"))) + if ((topic.direction() == "publisher") && !((topic.unit_name() == "eCALPlay") || (topic.unit_name() == "eCALPlayGUI"))) { - published_topic_names_.emplace(topic.tname()); + published_topic_names_.emplace(topic.topic_name()); } } diff --git a/app/rec/rec_client_core/src/monitoring_thread.cpp b/app/rec/rec_client_core/src/monitoring_thread.cpp index fc39479a4a..53efd33ff7 100644 --- a/app/rec/rec_client_core/src/monitoring_thread.cpp +++ b/app/rec/rec_client_core/src/monitoring_thread.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,21 +80,21 @@ namespace eCAL for (const auto& topic : monitoring_pb.topics()) { // Lookup the topic map entry - auto topic_info_map_it = topic_info_map_.find(topic.tname()); + auto topic_info_map_it = topic_info_map_.find(topic.topic_name()); if (topic_info_map_it == topic_info_map_.end()) { // Create a new topic entry - topic_info_map_.emplace(topic.tname(), eCAL::rec::TopicInfo("", "", "")); - topic_info_map_it = topic_info_map_.find(topic.tname()); + topic_info_map_.emplace(topic.topic_name(), eCAL::rec::TopicInfo("", "", "")); + topic_info_map_it = topic_info_map_.find(topic.topic_name()); } // Create combined encoding:type type (to be fully compatible to old behavior) - std::string combined_enc_type = eCAL::Util::CombinedTopicEncodingAndType(topic.tdatatype().encoding(), topic.tdatatype().name()); + std::string combined_enc_type = eCAL::Util::CombinedTopicEncodingAndType(topic.datatype_information().encoding(), topic.datatype_information().name()); // Evaluate the quality of the current descriptor information int this_topic_info_quality = 0; - if (!topic.tdatatype().desc().empty()) + if (!topic.datatype_information().descriptor_information().empty()) { this_topic_info_quality |= DESCRIPTION_AVAILABLE_QUALITYBIT; } @@ -106,14 +106,14 @@ namespace eCAL this_topic_info_quality |= INFO_COMES_FROM_PUBLISHER_QUALITYBIT; // Also update the publisher list - auto existing_publisher_it = topic_info_map_it->second.publishers_.find(topic.hname()); + auto existing_publisher_it = topic_info_map_it->second.publishers_.find(topic.host_name()); if (existing_publisher_it != topic_info_map_it->second.publishers_.end()) { - existing_publisher_it->second.emplace(topic.uname()); + existing_publisher_it->second.emplace(topic.unit_name()); } else { - topic_info_map_it->second.publishers_.emplace(topic.hname(), std::set{topic.uname()}); + topic_info_map_it->second.publishers_.emplace(topic.host_name(), std::set{topic.unit_name()}); } } @@ -124,18 +124,18 @@ namespace eCAL // Update the channel_descriptor_map { - auto channel_descriptor_map_it = channel_descriptor_map.find(topic.tname()); + auto channel_descriptor_map_it = channel_descriptor_map.find(topic.topic_name()); if (channel_descriptor_map_it == channel_descriptor_map.end()) { // Save the new descriptor - channel_descriptor_map.emplace(topic.tname(), std::make_pair(this_topic_info_quality, std::make_pair(combined_enc_type, topic.tdatatype().desc()))); + channel_descriptor_map.emplace(topic.topic_name(), std::make_pair(this_topic_info_quality, std::make_pair(combined_enc_type, topic.datatype_information().descriptor_information()))); } else { if(channel_descriptor_map_it->second.first < this_topic_info_quality) { // If the old descriptor has a lower quality than the current descriptor, we may overwrite it! - channel_descriptor_map_it->second = std::make_pair(this_topic_info_quality, std::make_pair(combined_enc_type, topic.tdatatype().desc())); + channel_descriptor_map_it->second = std::make_pair(this_topic_info_quality, std::make_pair(combined_enc_type, topic.datatype_information().descriptor_information())); } } } @@ -149,14 +149,14 @@ namespace eCAL if (type_descriptor_map_it == type_descriptor_map.end()) { // Save the new descriptor - type_descriptor_map.emplace(combined_enc_type, std::make_pair(quality_for_other_channels, topic.tdatatype().desc())); + type_descriptor_map.emplace(combined_enc_type, std::make_pair(quality_for_other_channels, topic.datatype_information().descriptor_information())); } else { if(type_descriptor_map_it->second.first < quality_for_other_channels) { // If the old descriptor has a lower quality than the current descriptor, we may overwrite it! - type_descriptor_map_it->second = std::make_pair(quality_for_other_channels, topic.tdatatype().desc()); + type_descriptor_map_it->second = std::make_pair(quality_for_other_channels, topic.datatype_information().descriptor_information()); } } } diff --git a/app/rec/rec_client_core/src/proto_helpers.cpp b/app/rec/rec_client_core/src/proto_helpers.cpp index 3c1374deb2..495baf7fc5 100644 --- a/app/rec/rec_client_core/src/proto_helpers.cpp +++ b/app/rec/rec_client_core/src/proto_helpers.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,10 +141,10 @@ namespace eCAL void ToProtobuf(const eCAL::rec::RecorderStatus& rec_status, const std::string& hostname, eCAL::pb::rec_client::State& rec_status_pb) { // hostname - rec_status_pb.set_hostname (hostname); + rec_status_pb.set_host_name (hostname); - // pid - rec_status_pb.set_pid (rec_status.pid_); + // process_id + rec_status_pb.set_process_id (rec_status.pid_); // initialized rec_status_pb.set_initialized (rec_status.initialized_); @@ -343,12 +343,12 @@ namespace eCAL rec_addon_status.info_.second = rec_addon_status_pb.info_message(); } - void FromProtobuf(const eCAL::pb::rec_client::State& rec_status_pb, std::string& hostname, eCAL::rec::RecorderStatus& rec_status) + void FromProtobuf(const eCAL::pb::rec_client::State& rec_status_pb, std::string& host_name, eCAL::rec::RecorderStatus& rec_status) { - hostname = rec_status_pb.hostname(); + host_name = rec_status_pb.host_name(); // pid_ - rec_status.pid_ = rec_status_pb.pid(); + rec_status.pid_ = rec_status_pb.process_id(); // timestamp_ rec_status.timestamp_ = eCAL::Time::ecal_clock::time_point(std::chrono::nanoseconds(rec_status_pb.timestamp_nsecs())); diff --git a/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.cpp b/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.cpp index 99018269a5..5f17bf031a 100644 --- a/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.cpp +++ b/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -263,7 +263,7 @@ QVariant RecorderModel::data(const QModelIndex &index, int role) const } } - else if (column == Columns::PID) + else if (column == Columns::PROCESS_ID) { if ((role == Qt::ItemDataRole::DisplayRole) && (recorder_list_[row].recording_enabled_) @@ -1668,6 +1668,6 @@ void RecorderModel::emitDataChangedConfig(int row) void RecorderModel::emitDataChangedState(int row) { - emit dataChanged(index(row, (int)Columns::HOSTNAME), index(row, (int)Columns::PID)); + emit dataChanged(index(row, (int)Columns::HOSTNAME), index(row, (int)Columns::PROCESS_ID)); emit dataChanged(index(row, (int)Columns::TIMESTAMP), index(row, (int)Columns::COLUMN_COUNT - 1)); } diff --git a/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.h b/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.h index 40dec0b38f..cf50fe5fc5 100644 --- a/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.h +++ b/app/rec/rec_gui/src/widgets/recordermanager_widget/recorder_model.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ class RecorderModel : public QAbstractItemModel HOSTNAME, // State ADDON_ID, // State ADDON_EXECUTABLE_PATH, // State - PID, // State + PROCESS_ID, // State HOST_FILTER, // Config TIMESTAMP, // State, Time (updateTimeWarning depends on it!) TIME_ERROR, // State, Time (updateTimeWarning depends on it!) @@ -180,7 +180,7 @@ private slots: { Columns::HOSTNAME, "Recorder" } , { Columns::ADDON_ID, "Addon ID" } , { Columns::ADDON_EXECUTABLE_PATH, "Addon Executable" } , - { Columns::PID, "PID" } , + { Columns::PROCESS_ID, "Process Id" } , { Columns::HOST_FILTER, "Hosts" } , { Columns::INFO, "Info" } , { Columns::STATE, "State" } , diff --git a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp index d9afe991d5..438034deae 100644 --- a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp +++ b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -101,8 +101,8 @@ int JobHistoryModel::mapColumnToItem(int model_column, int tree_item_type) const return (int)JobHistoryRecorderItem::Columns::ADDON_NAME; case (int)Columns::ID: return (int)JobHistoryRecorderItem::Columns::ADDON_ID; - case (int)Columns::PID: - return (int)JobHistoryRecorderItem::Columns::PID; + case (int)Columns::PROCESS_ID: + return (int)JobHistoryRecorderItem::Columns::PROCESS_ID; case (int)Columns::STILL_ONLINE: return (int)JobHistoryRecorderItem::Columns::STILL_ONLINE; case (int)Columns::LENGTH: @@ -143,12 +143,12 @@ void JobHistoryModel::setRecorderStatuses(const eCAL::rec_server::RecorderStatus { // Data that is needed by HDF5 Items _and_ addon items std::string hostname = client_job_status.first; - int pid = client_job_status.second.client_pid_; + int process_id = client_job_status.second.client_pid_; bool is_deleted = client_job_status.second.job_status_.is_deleted_; auto recorder_status_it = std::find_if(recorder_statuses.begin(), recorder_statuses.end(), - [pid = client_job_status.second.client_pid_] (const auto& rec_status) -> bool + [process_id = client_job_status.second.client_pid_] (const auto& rec_status) -> bool { - return (rec_status.second.first.pid_ == pid); + return (rec_status.second.first.pid_ == process_id); }); bool recorder_still_online = (recorder_status_it != recorder_statuses.end()); @@ -159,7 +159,7 @@ void JobHistoryModel::setRecorderStatuses(const eCAL::rec_server::RecorderStatus bool update_needed_hdf5_rec = false; update_needed_hdf5_rec = hdf5_recorder_item->updateStillOnline (recorder_still_online) || update_needed_hdf5_rec; - update_needed_hdf5_rec = hdf5_recorder_item->updatePid (pid) || update_needed_hdf5_rec; + update_needed_hdf5_rec = hdf5_recorder_item->updatePid (process_id) || update_needed_hdf5_rec; update_needed_hdf5_rec = hdf5_recorder_item->updateInfoLastCommandResponse(client_job_status.second.info_last_command_response_) || update_needed_hdf5_rec; update_needed_hdf5_rec = hdf5_recorder_item->updateLength ({ client_job_status.second.job_status_.rec_hdf5_status_.total_length_, client_job_status.second.job_status_.rec_hdf5_status_.total_frame_count_ }) || update_needed_hdf5_rec; update_needed_hdf5_rec = hdf5_recorder_item->updateUnflushedFrameCount (client_job_status.second.job_status_.rec_hdf5_status_.unflushed_frame_count_) || update_needed_hdf5_rec; @@ -217,7 +217,7 @@ void JobHistoryModel::setRecorderStatuses(const eCAL::rec_server::RecorderStatus bool update_needed_addon = false; update_needed_addon = addon_item->updateStillOnline (addon_still_online) || update_needed_addon; - update_needed_addon = addon_item->updatePid (pid) || update_needed_addon; + update_needed_addon = addon_item->updatePid (process_id) || update_needed_addon; update_needed_addon = addon_item->updateLength ({std::chrono::steady_clock::duration(0), addon_id_status_pair.second.total_frame_count_ }) || update_needed_addon; update_needed_addon = addon_item->updateUnflushedFrameCount(addon_id_status_pair.second.unflushed_frame_count_) || update_needed_addon; update_needed_addon = addon_item->updateState (addon_state) || update_needed_addon; diff --git a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.h b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.h index 5afaecf982..e1789ce2d4 100644 --- a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.h +++ b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_model.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,7 +88,7 @@ public slots : { JOB, ID, - PID, + PROCESS_ID, STILL_ONLINE, STATUS, HOSTNAME, @@ -108,7 +108,7 @@ public slots : { { Columns::JOB, "Job" } , { Columns::ID, "ID" } , - { Columns::PID, "PID" } , + { Columns::PROCESS_ID, "Process Id" } , { Columns::STILL_ONLINE, "Still online" } , { Columns::STATUS, "Status" } , { Columns::HOSTNAME, "Host" } , diff --git a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.cpp b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.cpp index b63d855c78..3972f3dd24 100644 --- a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.cpp +++ b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,7 +133,7 @@ QVariant JobHistoryRecorderItem::data(int column, Qt::ItemDataRole role) const } } - else if (column == (int)Columns::PID) + else if (column == (int)Columns::PROCESS_ID) { if (role == Qt::ItemDataRole::DisplayRole) { @@ -277,7 +277,7 @@ const QString& JobHistoryRecorderItem:: const QString& JobHistoryRecorderItem::addonName() const { return addon_name_; } bool JobHistoryRecorderItem::isAddonItem() const { return !addon_id_.isEmpty(); } -int JobHistoryRecorderItem::pid() const { return pid_; } +int JobHistoryRecorderItem::process_id() const { return pid_; } bool JobHistoryRecorderItem::stillOnline() const { return still_online_; } std::pair JobHistoryRecorderItem::infoLastCommandResponse() const { return info_last_command_response_; } std::pair JobHistoryRecorderItem::length() const { return length_; } @@ -305,7 +305,7 @@ const std::pair& JobHistoryRecorderItem:: return info_; } -void JobHistoryRecorderItem::setPid (int pid) { pid_ = pid; } +void JobHistoryRecorderItem::setPid (int process_id) { pid_ = process_id; } void JobHistoryRecorderItem::setStillOnline (bool still_online) { still_online_ = still_online; } void JobHistoryRecorderItem::setInfoLastCommandResponse(const std::pair& info_last_command_response) { info_last_command_response_ = info_last_command_response; } void JobHistoryRecorderItem::setLength (const std::pair& length) { length_ = length; } @@ -315,11 +315,11 @@ void JobHistoryRecorderItem::setUploadStatus (const eCAL::rec::UploadS void JobHistoryRecorderItem::setInfo (const std::pair& info) { info_ = info; } void JobHistoryRecorderItem::setIsDeleted (bool is_deleted) { is_deleted_ = is_deleted; } -bool JobHistoryRecorderItem::updatePid(int pid) +bool JobHistoryRecorderItem::updatePid(int process_id) { - if (pid_ != pid) + if (pid_ != process_id) { - pid_ = pid; + pid_ = process_id; return true; } return false; diff --git a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.h b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.h index 430ca95554..219cea84b4 100644 --- a/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.h +++ b/app/rec/rec_gui/src/widgets/recording_history_widget/job_history_recorderitem.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ class JobHistoryRecorderItem : public QAbstractTreeItem const QString& addonName() const; bool isAddonItem() const; - int pid() const; + int process_id() const; bool stillOnline() const; std::pair infoLastCommandResponse() const; std::pair length() const; @@ -63,7 +63,7 @@ class JobHistoryRecorderItem : public QAbstractTreeItem bool isDeleted() const; const std::pair& displayedInfo() const; - void setPid (int pid); + void setPid (int process_id); void setStillOnline (bool still_online); void setInfoLastCommandResponse(const std::pair& info_last_command_response); void setLength (const std::pair& length); @@ -73,7 +73,7 @@ class JobHistoryRecorderItem : public QAbstractTreeItem void setInfo (const std::pair& info); void setIsDeleted (bool is_deleted); - bool updatePid (int pid); + bool updatePid (int process_id); bool updateStillOnline (bool still_online); bool updateInfoLastCommandResponse(const std::pair& info_last_command_response); bool updateLength (const std::pair& length); @@ -94,7 +94,7 @@ class JobHistoryRecorderItem : public QAbstractTreeItem HOSTNAME, ADDON_ID, ADDON_NAME, - PID, + PROCESS_ID, STILL_ONLINE, LENGTH, STATUS, diff --git a/app/rec/rec_server_cli/src/commands/status.cpp b/app/rec/rec_server_cli/src/commands/status.cpp index 768b497e5d..e60f14c043 100644 --- a/app/rec/rec_server_cli/src/commands/status.cpp +++ b/app/rec/rec_server_cli/src/commands/status.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,7 +116,7 @@ namespace eCAL if (cmd_line.unlabled_arg.isSet() && !cmd_line.unlabled_arg.getValue().empty()) { - std::cerr << "WARNING: Unrecognized parameters: " + EcalUtils::CommandLine::ToCommandLine(cmd_line.unlabled_arg.getValue()) << std::endl; + std::cerr << "WARNING: Unrecognized parameters: " + EcalUtils::CommandLine::ToCommandLine(cmd_line.unlabled_arg.getValue()) << "\n"; } if (cmd_line.meas_id_arg.isSet()) @@ -147,9 +147,9 @@ namespace eCAL { // Code duplicated to printStatus function: printRecServerStatus(status, ostream); - ostream << std::endl; + ostream << "\n"; printClientList(status, config, ostream); - ostream << std::endl; + ostream << "\n"; printJobHistory(status, ostream); return eCAL::rec::Error::OK; @@ -179,9 +179,9 @@ namespace eCAL // Code duplicated from execute function: printRecServerStatus(status, std::cout); - std::cout << std::endl; + std::cout << "\n"; printClientList(status, config, std::cout); - std::cout << std::endl; + std::cout << "\n"; printJobHistory(status, std::cout); return eCAL::rec::Error::ErrorCode::OK; @@ -212,7 +212,7 @@ namespace eCAL void Status::printRecServerStatus(const eCAL::rec_server::RecServerStatus& status, std::ostream& ostream) const { - ostream << "Config path: " << (status.config_path_.empty() ? "none" : status.config_path_) << std::endl; + ostream << "Config path: " << (status.config_path_.empty() ? "none" : status.config_path_) << "\n"; ostream << "Activated: "; if (status.activated_) @@ -220,14 +220,14 @@ namespace eCAL else ostream << termcolor::yellow; ostream << (status.activated_ ? "Yes" : "No"); - ostream << termcolor::reset << std::endl; + ostream << termcolor::reset << "\n"; ostream << "Status: "; if (status.recording_meas_id_ != 0) ostream << termcolor::red << "REC" << termcolor::reset << " (ID: " << status.recording_meas_id_ << ")"; else ostream << "Stopped"; - ostream << termcolor::reset << std::endl; + ostream << termcolor::reset << "\n"; } void Status::printJobHistory(const eCAL::rec_server::RecServerStatus& status, std::ostream& ostream) const @@ -566,8 +566,8 @@ namespace eCAL if (show_time_warning) { - ostream << std::endl; - ostream << termcolor::on_yellow << "WARNING: The timestamps appear out of sync!" << termcolor::reset << std::endl; + ostream << "\n"; + ostream << termcolor::on_yellow << "WARNING: The timestamps appear out of sync!" << termcolor::reset << "\n"; } } @@ -618,28 +618,28 @@ namespace eCAL time_ss << "." << std::setfill('0') << std::setw(3) << std::right << remaining_milliseconds; // Output data - ostream << "Timestamp (loc.): " << time_ss.str() << std::endl; - ostream << "Name: " << job_history_entry.local_evaluated_job_config_.GetMeasName() << std::endl; - ostream << "ID: " << job_history_entry.local_evaluated_job_config_.GetJobId() << std::endl; + ostream << "Timestamp (loc.): " << time_ss.str() << "\n"; + ostream << "Name: " << job_history_entry.local_evaluated_job_config_.GetMeasName() << "\n"; + ostream << "ID: " << job_history_entry.local_evaluated_job_config_.GetJobId() << "\n"; ostream << "Status: "; if (combined_state == eCAL::rec::JobState::Recording) ostream << termcolor::red; - ostream << state_string << termcolor::reset << std::endl; + ostream << state_string << termcolor::reset << "\n"; - ostream << "Local meas path: " << job_history_entry.local_evaluated_job_config_.GetCompleteMeasurementPath() << std::endl; - ostream << "HDF5 Split size: " << job_history_entry.local_evaluated_job_config_.GetMaxFileSize() << " MiB" << std::endl; - ostream << "Length: " << length_ss.str() << std::endl; - ostream << "Uploaded: " << (job_history_entry.is_uploaded_ ? "Yes" : "No") << std::endl; + ostream << "Local meas path: " << job_history_entry.local_evaluated_job_config_.GetCompleteMeasurementPath() << "\n"; + ostream << "HDF5 Split size: " << job_history_entry.local_evaluated_job_config_.GetMaxFileSize() << " MiB" << "\n"; + ostream << "Length: " << length_ss.str() << "\n"; + ostream << "Uploaded: " << (job_history_entry.is_uploaded_ ? "Yes" : "No") << "\n"; - ostream << std::endl; + ostream << "\n"; } // Table for recorders that participated in the measurement enum class Column : int { NAME, - PID, + PROCESS_ID, STATUS, LENGTH, INFO, @@ -652,7 +652,7 @@ namespace eCAL { std::vector header_data((int)Column::COLUMN_COUNT); header_data[(int)Column::NAME] = table_printer::TableEntry("Recorder"); - header_data[(int)Column::PID] = table_printer::TableEntry("PID"); + header_data[(int)Column::PROCESS_ID] = table_printer::TableEntry("PROCESS_ID"); header_data[(int)Column::STATUS] = table_printer::TableEntry("Status"); header_data[(int)Column::LENGTH] = table_printer::TableEntry("Length"); header_data[(int)Column::INFO] = table_printer::TableEntry("Info"); @@ -705,10 +705,10 @@ namespace eCAL } } - table_row[(int)Column::NAME] .content = client_status.first; - table_row[(int)Column::PID] .content = std::to_string(client_status.second.client_pid_); - table_row[(int)Column::STATUS] = rec_state_entry; - table_row[(int)Column::LENGTH].content = length_ss.str(); + table_row[(int)Column::NAME] .content = client_status.first; + table_row[(int)Column::PROCESS_ID].content = std::to_string(client_status.second.client_pid_); + table_row[(int)Column::STATUS] = rec_state_entry; + table_row[(int)Column::LENGTH] .content = length_ss.str(); auto displayed_info = displayedInfo(client_status.second); table_row[(int)Column::INFO] .content = displayed_info.second; @@ -762,11 +762,11 @@ namespace eCAL } } - table_row[(int)Column::NAME] .content = getHumanReadableAddonName(client_status.first, addon_status.first, status); - table_row[(int)Column::PID] .content = std::to_string(client_status.second.client_pid_); - table_row[(int)Column::STATUS] = rec_state_entry; - table_row[(int)Column::LENGTH].content = std::to_string(addon_status.second.total_frame_count_) + " frames"; - table_row[(int)Column::INFO] .content = addon_status.second.info_.second; + table_row[(int)Column::NAME] .content = getHumanReadableAddonName(client_status.first, addon_status.first, status); + table_row[(int)Column::PROCESS_ID].content = std::to_string(client_status.second.client_pid_); + table_row[(int)Column::STATUS] = rec_state_entry; + table_row[(int)Column::LENGTH] .content = std::to_string(addon_status.second.total_frame_count_) + " frames"; + table_row[(int)Column::INFO] .content = addon_status.second.info_.second; if (!addon_status.second.info_.first) table_row[(int)Column::INFO].background_color = eCAL::rec_cli::table_printer::Color::RED; @@ -783,7 +783,7 @@ namespace eCAL } } - ostream << std::endl; + ostream << "\n"; eCAL::rec_cli::table_printer::printTable(recorder_table, ostream); return eCAL::rec::Error::ErrorCode::OK; @@ -809,33 +809,33 @@ namespace eCAL << std::chrono::duration_cast>(client_status.pre_buffer_length_.second).count() << " s / " << client_status.pre_buffer_length_.first << " frames"; - ostream << "Client hostname: " << hostname << std::endl; - ostream << "PID: " << client_status.pid_ << std::endl; - ostream << "Timestamp: " << timeToString(client_status.timestamp_) << std::endl; - ostream << "Time-error: " << time_error_ss.str() << " s" << std::endl; - ostream << "Buffer: " << buffer_ss.str() << std::endl; + ostream << "Client hostname: " << hostname << "\n"; + ostream << "Process Id: " << client_status.pid_ << "\n"; + ostream << "Timestamp: " << timeToString(client_status.timestamp_) << "\n"; + ostream << "Time-error: " << time_error_ss.str() << " s" << "\n"; + ostream << "Buffer: " << buffer_ss.str() << "\n"; auto rec_client_state_eval = recClientStateToString(client_status); ostream << "State: "; if (rec_client_state_eval.second == eCAL::rec::JobState::Recording) ostream << termcolor::red; - ostream << rec_client_state_eval.first << termcolor::reset << std::endl; + ostream << rec_client_state_eval.first << termcolor::reset << "\n"; ostream << "Info: "; if (!client_status.info_.first) ostream << termcolor::on_red; - ostream << client_status.info_.second << termcolor::reset << std::endl; + ostream << client_status.info_.second << termcolor::reset << "\n"; - ostream << "Subscribed topics: " << std::endl; + ostream << "Subscribed topics: " << "\n"; if (client_status.subscribed_topics_.empty()) { - ostream << " -- None --" << std::endl; + ostream << " -- None --" << "\n"; } else { for (const std::string& topic_name : client_status.subscribed_topics_) { - ostream << " " << topic_name << std::endl; + ostream << " " << topic_name << "\n"; } } } @@ -843,17 +843,17 @@ namespace eCAL // Addon information for (const auto& addon_status : client_status_it->second.first.addon_statuses_) { - ostream << std::endl; + ostream << "\n"; - ostream << "Addon Name: " << addon_status.name_ << std::endl; - ostream << "Addon ID: " << addon_status.addon_id_ << std::endl; - ostream << "Addon State: " << (addon_status.initialized_ ? "Initialized" : "Not initialized") << std::endl; - ostream << "Addon exe path: " << addon_status.addon_executable_path_ << std::endl; - ostream << "Addon Buffer: " << std::to_string(addon_status.pre_buffer_length_frame_count_) + " frames" << std::endl; + ostream << "Addon Name: " << addon_status.name_ << "\n"; + ostream << "Addon ID: " << addon_status.addon_id_ << "\n"; + ostream << "Addon State: " << (addon_status.initialized_ ? "Initialized" : "Not initialized") << "\n"; + ostream << "Addon exe path: " << addon_status.addon_executable_path_ << "\n"; + ostream << "Addon Buffer: " << std::to_string(addon_status.pre_buffer_length_frame_count_) + " frames" << "\n"; ostream << "Addon Info: "; if (!addon_status.info_.first) ostream << termcolor::on_red; - ostream << addon_status.info_.second << termcolor::reset << std::endl; + ostream << addon_status.info_.second << termcolor::reset << "\n"; } return eCAL::rec::Error::ErrorCode::OK; diff --git a/app/rec/rec_server_core/include/rec_server_core/rec_server_types.h b/app/rec/rec_server_core/include/rec_server_core/rec_server_types.h index 5dd1300202..3c25babc1c 100644 --- a/app/rec/rec_server_core/include/rec_server_core/rec_server_types.h +++ b/app/rec/rec_server_core/include/rec_server_core/rec_server_types.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ namespace eCAL std::string type_; ///< Type of the topic (e.g. the protobuf-type) std::map> publishers_; ///< {hostname: [publisher_names]} - std::map, double> rec_subscribers_; ///< {(hostname, pid): data_frequency} + std::map, double> rec_subscribers_; ///< {(hostname, process_id): data_frequency} }; typedef std::map TopicInfoMap_T; diff --git a/app/rec/rec_server_core/src/monitoring_thread.cpp b/app/rec/rec_server_core/src/monitoring_thread.cpp index f351b86c26..45b602a2a8 100644 --- a/app/rec/rec_server_core/src/monitoring_thread.cpp +++ b/app/rec/rec_server_core/src/monitoring_thread.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,7 +106,7 @@ namespace eCAL // Re-create host list for (const auto& process : monitoring_pb.processes()) { - std::string host_name = process.hname(); + std::string host_name = process.host_name(); auto existing_host_it = hosts_running_ecal_rec_.find(host_name); // Add host if it didn't exist already @@ -116,7 +116,7 @@ namespace eCAL } // set whether this host has an eCAL Rec client - if (process.uname() == "eCALRecClient") + if (process.unit_name() == "eCALRecClient") { existing_host_it->second = true; } @@ -126,13 +126,13 @@ namespace eCAL for (const auto& topic : monitoring_pb.topics()) { // Create combined encoding:type type (to be fully compatible to old behavior) - std::string combined_enc_type = eCAL::Util::CombinedTopicEncodingAndType(topic.tdatatype().encoding(), topic.tdatatype().name()); + std::string combined_enc_type = eCAL::Util::CombinedTopicEncodingAndType(topic.datatype_information().encoding(), topic.datatype_information().name()); - auto topic_info_map_it = topic_info_map_.find(topic.tname()); + auto topic_info_map_it = topic_info_map_.find(topic.topic_name()); if (topic_info_map_it != topic_info_map_.end()) { // Only update the values if there are information available - if (!combined_enc_type.empty() || !topic.tdatatype().name().empty()) + if (!combined_enc_type.empty() || !topic.datatype_information().name().empty()) { topic_info_map_it->second.type_ = combined_enc_type; } @@ -140,33 +140,33 @@ namespace eCAL else { // Create a new topic entry - topic_info_map_.emplace(topic.tname(), eCAL::rec_server::TopicInfo(combined_enc_type)); - topic_info_map_it = topic_info_map_.find(topic.tname()); + topic_info_map_.emplace(topic.topic_name(), eCAL::rec_server::TopicInfo(combined_enc_type)); + topic_info_map_it = topic_info_map_.find(topic.topic_name()); } // Set the topic publisher if (EcalUtils::String::Icompare(topic.direction(), "publisher")) { - auto existing_publisher_it = topic_info_map_it->second.publishers_.find(topic.hname()); + auto existing_publisher_it = topic_info_map_it->second.publishers_.find(topic.host_name()); if (existing_publisher_it != topic_info_map_it->second.publishers_.end()) { - existing_publisher_it->second.emplace(topic.uname()); + existing_publisher_it->second.emplace(topic.unit_name()); } else { - topic_info_map_it->second.publishers_.emplace(topic.hname(), std::set{topic.uname()}); + topic_info_map_it->second.publishers_.emplace(topic.host_name(), std::set{topic.unit_name()}); } } // Set the subscribing eCAL Rec instances - if (((topic.uname() == "eCALRecClient") || (topic.uname() == "eCALRecGUI")) + if (((topic.unit_name() == "eCALRecClient") || (topic.unit_name() == "eCALRecGUI")) && EcalUtils::String::Icompare(topic.direction(), "subscriber")) { - auto running_enabled_rec_client_it = running_enabled_rec_clients.find(topic.hname()); + auto running_enabled_rec_client_it = running_enabled_rec_clients.find(topic.host_name()); if ((running_enabled_rec_client_it != running_enabled_rec_clients.end() - && (running_enabled_rec_client_it->second == topic.pid()))) + && (running_enabled_rec_client_it->second == topic.process_id()))) { - topic_info_map_it->second.rec_subscribers_[{topic.hname(), topic.pid()}] = (static_cast(topic.dfreq()) / 1000.0); + topic_info_map_it->second.rec_subscribers_[{topic.host_name(), topic.process_id()}] = (static_cast(topic.data_frequency()) / 1000.0); } } } diff --git a/app/rec/rec_server_core/src/rec_server_impl.cpp b/app/rec/rec_server_core/src/rec_server_impl.cpp index bf9cf2e596..184665e71b 100644 --- a/app/rec/rec_server_core/src/rec_server_impl.cpp +++ b/app/rec/rec_server_core/src/rec_server_impl.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -806,10 +806,10 @@ namespace eCAL auto connected_rec_client_it = connected_rec_clients_.find(enabled_rec_client.first); if (connected_rec_client_it != connected_rec_clients_.end()) { - int32_t pid = connected_rec_client_it->second->GetStatus().first.pid_; - if (pid >= 0) + int32_t process_id = connected_rec_client_it->second->GetStatus().first.pid_; + if (process_id >= 0) { - running_enabled_rec_clients[enabled_rec_client.first] = pid; + running_enabled_rec_clients[enabled_rec_client.first] = process_id; } } } diff --git a/app/rec/rec_server_core/src/recorder/remote_recorder.cpp b/app/rec/rec_server_core/src/recorder/remote_recorder.cpp index 2b227cd1e7..7655a30536 100644 --- a/app/rec/rec_server_core/src/recorder/remote_recorder.cpp +++ b/app/rec/rec_server_core/src/recorder/remote_recorder.cpp @@ -390,7 +390,7 @@ namespace eCAL eCAL::rec::proto_helpers::FromProtobuf(state_response_pb, hostname, last_status); - int32_t client_pid = state_response_pb.pid(); + int32_t client_pid = state_response_pb.process_id(); { std::lock_guard io_lock(io_mutex_); diff --git a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp index 9e7a215725..b62777b1e7 100644 --- a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp +++ b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp @@ -34,7 +34,7 @@ /////////////////////////////////////////////// ExternalEcalRecInstance::ExternalEcalRecInstance(bool gui) - : pid(0) + : process_id(0) { ecal_rec_cli_instance_lock.lock(); @@ -46,17 +46,17 @@ ExternalEcalRecInstance::ExternalEcalRecInstance(bool gui) if (gui) { std::cout << "Starting " << "\"" << ECAL_REC_GUI_PATH << "\"" << std::endl; - pid = eCAL::Process::StartProcess(ECAL_REC_GUI_PATH, "", "", false, eCAL::Process::eStartMode::minimized, false); + process_id = eCAL::Process::StartProcess(ECAL_REC_GUI_PATH, "", "", false, eCAL::Process::eStartMode::minimized, false); } else { std::cout << "Starting " << "\"" << ECAL_REC_CLI_PATH << "\"" << std::endl; - pid = eCAL::Process::StartProcess(ECAL_REC_CLI_PATH, "--interactive-dont-exit --no-default", "", false, eCAL::Process::eStartMode::hidden, false); + process_id = eCAL::Process::StartProcess(ECAL_REC_CLI_PATH, "--interactive-dont-exit --no-default", "", false, eCAL::Process::eStartMode::hidden, false); } - if (pid != 0) + if (process_id != 0) { - std::cout << "Successfully started eCAL Rec " << (gui ? "GUI" : "CLI") << " with PID " << pid << std::endl; + std::cout << "Successfully started eCAL Rec " << (gui ? "GUI" : "CLI") << " with PID " << process_id << std::endl; } else { @@ -87,8 +87,8 @@ ExternalEcalRecInstance::ExternalEcalRecInstance(bool gui) ExternalEcalRecInstance::~ExternalEcalRecInstance() { - if (pid > 0) - eCAL::Process::StopProcess(pid); + if (process_id > 0) + eCAL::Process::StopProcess(process_id); eCAL::Finalize(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); diff --git a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.h b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.h index b9ec53aafa..9a85e28828 100644 --- a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.h +++ b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,6 +68,6 @@ class ExternalEcalRecInstance // Member Variables /////////////////////////////////////////////// private: - int pid; + int process_id; std::shared_ptr> remote_rec_server_service; }; diff --git a/app/sys/sys_client_cli/src/ecal_sys_client_service.cpp b/app/sys/sys_client_cli/src/ecal_sys_client_service.cpp index 1ba0678276..737bb7a41b 100644 --- a/app/sys/sys_client_cli/src/ecal_sys_client_service.cpp +++ b/app/sys/sys_client_cli/src/ecal_sys_client_service.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,14 +37,14 @@ void EcalSysClientService::StartTasks(::google::protobuf::RpcController* { response->Clear(); - std::vector pids = eCAL::sys_client::StartTasks(eCAL::sys_client::proto_helpers::FromProtobuf(*request)); + std::vector process_ids = eCAL::sys_client::StartTasks(eCAL::sys_client::proto_helpers::FromProtobuf(*request)); - for (int32_t pid : pids) + for (int32_t process_id : process_ids) { auto task_response = response->mutable_responses()->Add(); - task_response->set_pid(pid); - task_response->set_result(pid != 0 ? eCAL::pb::sys_client::eServiceResult::success : eCAL::pb::sys_client::eServiceResult::failed); - task_response->set_error (pid != 0 ? "" : "Error starting task"); + task_response->set_process_id(process_id); + task_response->set_result(process_id != 0 ? eCAL::pb::sys_client::eServiceResult::success : eCAL::pb::sys_client::eServiceResult::failed); + task_response->set_error (process_id != 0 ? "" : "Error starting task"); } } diff --git a/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h b/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h index 1201588ec8..6dee4a05b3 100644 --- a/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h +++ b/app/sys/sys_client_core/include/sys_client_core/proto_helpers.h @@ -53,7 +53,7 @@ namespace eCAL void FromProtobuf(const eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb, StopTaskParameters& stop_task_param); void FromProtobuf(const eCAL::pb::sys_client::StopTaskRequest& stop_task_list_pb, std::vector& stop_task_list); void FromProtobuf(const eCAL::pb::sys_client::TaskList& task_list_pb, std::vector& task_list); - void FromProtobuf(const eCAL::pb::sys_client::PidList& pid_list_pb, std::vector& pid_list); + void FromProtobuf(const eCAL::pb::sys_client::ProcessIdList& pid_list_pb, std::vector& pid_list); void FromProtobuf(const eCAL::pb::sys_client::MatchTaskResponse& map_task_response_pb, std::vector>& map_task_response); eCAL::sys_client::Task FromProtobuf(const eCAL::pb::sys_client::Task& task_pb); @@ -64,7 +64,7 @@ namespace eCAL StopTaskParameters FromProtobuf(const eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb); std::vector FromProtobuf(const eCAL::pb::sys_client::StopTaskRequest& stop_task_list_pb); std::vector FromProtobuf(const eCAL::pb::sys_client::TaskList& task_list_pb); - std::vector FromProtobuf(const eCAL::pb::sys_client::PidList& pid_list_pb); + std::vector FromProtobuf(const eCAL::pb::sys_client::ProcessIdList& pid_list_pb); std::vector> FromProtobuf(const eCAL::pb::sys_client::MatchTaskResponse& map_task_response_pb); /////////////////////////////// @@ -79,7 +79,7 @@ namespace eCAL void ToProtobuf(eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb, const StopTaskParameters& stop_task_param); void ToProtobuf(eCAL::pb::sys_client::StopTaskRequest& stop_task_list_pb, const std::vector& stop_task_list); void ToProtobuf(eCAL::pb::sys_client::TaskList& task_list_pb, const std::vector& task_list); - void ToProtobuf(eCAL::pb::sys_client::PidList& pid_list_pb, const std::vector& pid_list); + void ToProtobuf(eCAL::pb::sys_client::ProcessIdList& pid_list_pb, const std::vector& pid_list); void ToProtobuf(eCAL::pb::sys_client::MatchTaskResponse& map_task_response_pb, const std::vector>& map_task_response); eCAL::pb::sys_client::Task ToProtobuf(const eCAL::sys_client::Task& task); @@ -90,7 +90,7 @@ namespace eCAL eCAL::pb::sys_client::StopTaskParameters ToProtobuf(const StopTaskParameters& stop_task_param); eCAL::pb::sys_client::StopTaskRequest ToProtobuf(const std::vector& stop_task_list); eCAL::pb::sys_client::TaskList ToProtobuf(const std::vector& task_list_pb); - eCAL::pb::sys_client::PidList ToProtobuf(const std::vector& pid_list_pb); + eCAL::pb::sys_client::ProcessIdList ToProtobuf(const std::vector& pid_list_pb); eCAL::pb::sys_client::MatchTaskResponse ToProtobuf(const std::vector>& map_task_response_pb); } } diff --git a/app/sys/sys_client_core/include/sys_client_core/task.h b/app/sys/sys_client_core/include/sys_client_core/task.h index 9077fd2330..382e5eab1e 100644 --- a/app/sys/sys_client_core/include/sys_client_core/task.h +++ b/app/sys/sys_client_core/include/sys_client_core/task.h @@ -54,11 +54,11 @@ namespace eCAL struct StopTaskParameters { StopTaskParameters() - : pid (0) + : process_id (0) , ecal_shutdown(false) {} - int32_t pid; + int32_t process_id; Task task; bool ecal_shutdown; }; diff --git a/app/sys/sys_client_core/src/ecal_sys_client.cpp b/app/sys/sys_client_core/src/ecal_sys_client.cpp index f0ea1efe84..8acbf09849 100644 --- a/app/sys/sys_client_core/src/ecal_sys_client.cpp +++ b/app/sys/sys_client_core/src/ecal_sys_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,19 +55,19 @@ namespace eCAL EvaluateEcalParserFunctions(task, true, now); MergeRunnerIntoTask(task, EcalUtils::Filesystem::OsStyle::Current); - int pid = eCAL::Process::StartProcess(task.path.c_str() + int process_id = eCAL::Process::StartProcess(task.path.c_str() , task.arguments.c_str() , task.working_dir.c_str() , task_param.create_console , task_param.window_mode , false); - pid_list.push_back(static_cast(pid)); + pid_list.push_back(static_cast(process_id)); - if (pid != 0) - EcalSysClientLogger::Instance()->info("Successfully started process (PID " + std::to_string(pid) + "): " + task.path + " " + task.arguments); + if (process_id != 0) + EcalSysClientLogger::Instance()->info("Successfully started process (PID " + std::to_string(process_id) + "): " + task.path + " " + task.arguments); else - EcalSysClientLogger::Instance()->error(std::string("Failed to start Task: ") + std::to_string(pid) + "): " + task.path + " " + task.arguments); + EcalSysClientLogger::Instance()->error(std::string("Failed to start Task: ") + std::to_string(process_id) + "): " + task.path + " " + task.arguments); } return pid_list; @@ -84,18 +84,18 @@ namespace eCAL { bool success = false; - if (task_param.pid != 0) + if (task_param.process_id != 0) { // Stop by PID if (task_param.ecal_shutdown) { - eCAL::Util::ShutdownProcess(task_param.pid); + eCAL::Util::ShutdownProcess(task_param.process_id); success = true; } else { - success = eCAL::Process::StopProcess(task_param.pid); + success = eCAL::Process::StopProcess(task_param.process_id); } } else @@ -161,16 +161,16 @@ namespace eCAL std::vector pid_list; for (const auto& process : monitoring_pb.processes()) { - if (process.hname() == eCAL::Process::GetHostName()) // Only handle local tasks! + if (process.host_name() == eCAL::Process::GetHostName()) // Only handle local tasks! { #ifdef _WIN32 // Windows gives us the proper command line, so we can directly match it - if ((process.pparam() == evaluated_task.path) - || (process.pparam() == "\"" + evaluated_task.path + "\"") - || (process.pparam() == (evaluated_task.path + " " + evaluated_task.arguments)) - || (process.pparam() == ("\"" + evaluated_task.path + "\" " + evaluated_task.arguments))) + if ((process.process_parameter() == evaluated_task.path) + || (process.process_parameter() == "\"" + evaluated_task.path + "\"") + || (process.process_parameter() == (evaluated_task.path + " " + evaluated_task.arguments)) + || (process.process_parameter() == ("\"" + evaluated_task.path + "\" " + evaluated_task.arguments))) { - pid_list.push_back(process.pid()); + pid_list.push_back(process.process_id()); } #else // _WIN32 // Linux splits the command line before we get it, so we cannot know @@ -182,11 +182,11 @@ namespace eCAL // // This is also true for macOS and probably most other UNIX systems. - std::vector process_argv = EcalUtils::CommandLine::ToArgv(process.pparam()); + std::vector process_argv = EcalUtils::CommandLine::ToArgv(process.process_parameter()); if ((sys_task_argv.size() == process_argv.size()) && (sys_task_argv == process_argv)) { - pid_list.push_back(process.pid()); + pid_list.push_back(process.process_id()); } #endif // _WIN32 } diff --git a/app/sys/sys_client_core/src/proto_helpers.cpp b/app/sys/sys_client_core/src/proto_helpers.cpp index 655bb9e977..987d654927 100644 --- a/app/sys/sys_client_core/src/proto_helpers.cpp +++ b/app/sys/sys_client_core/src/proto_helpers.cpp @@ -71,7 +71,7 @@ namespace eCAL void FromProtobuf(const eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb, StopTaskParameters& stop_task_param) { - stop_task_param.pid = stop_task_param_pb.pid(); + stop_task_param.process_id = stop_task_param_pb.process_id(); stop_task_param.task = FromProtobuf(stop_task_param_pb.task()); stop_task_param.ecal_shutdown = stop_task_param_pb.ecal_shutdown(); } @@ -97,21 +97,21 @@ namespace eCAL } } - void FromProtobuf(const eCAL::pb::sys_client::PidList& pid_list_pb, std::vector& pid_list) + void FromProtobuf(const eCAL::pb::sys_client::ProcessIdList& pid_list_pb, std::vector& pid_list) { pid_list.clear(); - pid_list.reserve(pid_list_pb.pids_size()); - for (const int32_t pid : pid_list_pb.pids()) + pid_list.reserve(pid_list_pb.process_ids_size()); + for (const int32_t process_id : pid_list_pb.process_ids()) { - pid_list.push_back(pid); + pid_list.push_back(process_id); } } void FromProtobuf(const eCAL::pb::sys_client::MatchTaskResponse& map_task_response_pb, std::vector>& map_task_response) { map_task_response.clear(); - map_task_response.reserve(map_task_response_pb.pid_lists_size()); - for (const auto& pid_list_pb : map_task_response_pb.pid_lists()) + map_task_response.reserve(map_task_response_pb.process_id_lists_size()); + for (const auto& pid_list_pb : map_task_response_pb.process_id_lists()) { map_task_response.push_back(FromProtobuf(pid_list_pb)); } @@ -182,7 +182,7 @@ namespace eCAL return output; } - std::vector FromProtobuf(const eCAL::pb::sys_client::PidList& pid_list_pb) + std::vector FromProtobuf(const eCAL::pb::sys_client::ProcessIdList& pid_list_pb) { std::vector output; FromProtobuf(pid_list_pb, output); @@ -239,7 +239,7 @@ namespace eCAL void ToProtobuf(eCAL::pb::sys_client::StopTaskParameters& stop_task_param_pb, const StopTaskParameters& stop_task_param) { - stop_task_param_pb.set_pid (stop_task_param.pid); + stop_task_param_pb.set_process_id (stop_task_param.process_id); ToProtobuf (*stop_task_param_pb.mutable_task(), stop_task_param.task); stop_task_param_pb.set_ecal_shutdown(stop_task_param.ecal_shutdown); } @@ -263,23 +263,23 @@ namespace eCAL } } - void ToProtobuf(eCAL::pb::sys_client::PidList& pid_list_pb, const std::vector& pid_list) + void ToProtobuf(eCAL::pb::sys_client::ProcessIdList& pid_list_pb, const std::vector& pid_list) { - pid_list_pb.clear_pids(); - pid_list_pb.mutable_pids()->Reserve(static_cast(pid_list.size())); - for (const int32_t pid : pid_list) + pid_list_pb.clear_process_ids(); + pid_list_pb.mutable_process_ids()->Reserve(static_cast(pid_list.size())); + for (const int32_t process_id : pid_list) { - pid_list_pb.add_pids(pid); + pid_list_pb.add_process_ids(process_id); } } void ToProtobuf(eCAL::pb::sys_client::MatchTaskResponse& map_task_response_pb, const std::vector>& map_task_response) { - map_task_response_pb.clear_pid_lists(); - map_task_response_pb.mutable_pid_lists()->Reserve(static_cast(map_task_response.size())); + map_task_response_pb.clear_process_id_lists(); + map_task_response_pb.mutable_process_id_lists()->Reserve(static_cast(map_task_response.size())); for (const std::vector& pid_list : map_task_response) { - ToProtobuf(*map_task_response_pb.add_pid_lists(), pid_list); + ToProtobuf(*map_task_response_pb.add_process_id_lists(), pid_list); } } @@ -348,9 +348,9 @@ namespace eCAL return output_pb; } - eCAL::pb::sys_client::PidList ToProtobuf(const std::vector& pid_list) + eCAL::pb::sys_client::ProcessIdList ToProtobuf(const std::vector& pid_list) { - eCAL::pb::sys_client::PidList output_pb; + eCAL::pb::sys_client::ProcessIdList output_pb; ToProtobuf(output_pb, pid_list); return output_pb; } diff --git a/app/sys/sys_core/src/connection/remote_connection.cpp b/app/sys/sys_core/src/connection/remote_connection.cpp index 4330ddeaf4..2fe143279b 100644 --- a/app/sys/sys_core/src/connection/remote_connection.cpp +++ b/app/sys/sys_core/src/connection/remote_connection.cpp @@ -41,7 +41,7 @@ namespace eCAL for(const auto& task_response_pb : response_pb.responses()) { - return_values.push_back(task_response_pb.pid()); + return_values.push_back(task_response_pb.process_id()); } return return_values; diff --git a/app/sys/sys_core/src/ecal_sys.cpp b/app/sys/sys_core/src/ecal_sys.cpp index 3bb9e51f13..7f99d387e0 100644 --- a/app/sys/sys_core/src/ecal_sys.cpp +++ b/app/sys/sys_core/src/ecal_sys.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -684,10 +684,10 @@ void EcalSys::WaitForTaskActions() //m_task_list_action_thread_container.for_each( // [](std::shared_ptr t) // { - // auto pid = t->get_pid(); - // std::cout << "Waiting for " << pid << std::endl; + // auto process_id = t->get_pid(); + // std::cout << "Waiting for " << process_id << std::endl; // t->Join(); - // std::cout << "Finished waiting for " << pid << std::endl; + // std::cout << "Finished waiting for " << process_id << std::endl; // } //); } diff --git a/app/sys/sys_core/src/ecal_sys_monitor.cpp b/app/sys/sys_core/src/ecal_sys_monitor.cpp index 142093336c..fc81fde5f4 100644 --- a/app/sys/sys_core/src/ecal_sys_monitor.cpp +++ b/app/sys/sys_core/src/ecal_sys_monitor.cpp @@ -95,17 +95,17 @@ void EcalSysMonitor::UpdateMonitor() for (const auto& process : m_monitoring_pb.processes()) { // Update list of all Hosts - m_all_hosts.emplace(process.hname()); + m_all_hosts.emplace(process.host_name()); //Update list of available Targets - if (process.uname() == "eCALSysClient") + if (process.unit_name() == "eCALSysClient") { - m_hosts_running_ecal_sys_client.emplace(process.hname()); + m_hosts_running_ecal_sys_client.emplace(process.host_name()); } // Update list of hosts running eCAL Sys - if ((process.uname() == "eCALSys") || (process.uname() == "eCALSysGUI")) + if ((process.unit_name() == "eCALSys") || (process.unit_name() == "eCALSysGUI")) { - m_hosts_running_ecalsys.push_back(std::pair(process.hname(), process.pid())); + m_hosts_running_ecalsys.push_back(std::pair(process.host_name(), process.process_id())); } } } @@ -149,8 +149,8 @@ void EcalSysMonitor::UpdateTaskStates(const std::list task_pids = task->GetPids(); - if ((task->GetHostStartedOn() == process.hname()) - && (std::find(task_pids.begin(), task_pids.end(), (int)process.pid()) != task_pids.end())) + if ((task->GetHostStartedOn() == process.host_name()) + && (std::find(task_pids.begin(), task_pids.end(), (int)process.process_id()) != task_pids.end())) { // The task is matching! task_mapping_found = true; @@ -274,11 +274,11 @@ std::list> EcalSysMonitor::GetTasksFromCloud() for (const auto& monitor_process : m_monitoring_pb.processes()) { - std::string monitor_process_name = EcalUtils::String::Trim(monitor_process.uname()); - std::string monitor_process_path = EcalUtils::String::Trim(monitor_process.pname()); - std::string monitor_process_args = EcalUtils::String::Trim(monitor_process.pparam()); - std::string monitor_process_host = EcalUtils::String::Trim(monitor_process.hname()); - int pid = monitor_process.pid(); + std::string monitor_process_name = EcalUtils::String::Trim(monitor_process.unit_name()); + std::string monitor_process_path = EcalUtils::String::Trim(monitor_process.process_name()); + std::string monitor_process_args = EcalUtils::String::Trim(monitor_process.process_parameter()); + std::string monitor_process_host = EcalUtils::String::Trim(monitor_process.host_name()); + int process_id = monitor_process.process_id(); TaskState task_state = eCAL::sys::proto_helpers::FromProtobuf(monitor_process.state()); // If the process has no name we use the executable's name instead @@ -293,7 +293,7 @@ std::list> EcalSysMonitor::GetTasksFromCloud() std::string algo_path; std::string algo_params; - std::vector algo_cmdline_vector = EcalUtils::CommandLine::splitCommandLine(monitor_process.pparam(), 2); // Split command line in algo + arguments + std::vector algo_cmdline_vector = EcalUtils::CommandLine::splitCommandLine(monitor_process.process_parameter(), 2); // Split command line in algo + arguments if(algo_cmdline_vector.size() == 0) { algo_path = monitor_process_path; @@ -317,7 +317,7 @@ std::list> EcalSysMonitor::GetTasksFromCloud() task->SetCommandLineArguments (algo_params); task->SetMonitoringEnabled (true); task->SetHostStartedOn (monitor_process_host); - task->SetPids (std::vector{pid}); + task->SetPids (std::vector{process_id}); task->SetStartStopState (EcalSysTask::StartStopState::Started_Successfully); task->SetFoundInLastMonitorLoop(true); task->SetFoundInMonitorOnce (true); diff --git a/app/sys/sys_core/src/proto_helpers.cpp b/app/sys/sys_core/src/proto_helpers.cpp index dabd6db574..ed6730188e 100644 --- a/app/sys/sys_core/src/proto_helpers.cpp +++ b/app/sys/sys_core/src/proto_helpers.cpp @@ -87,10 +87,10 @@ namespace eCAL task->SetTarget(task_pb.target_host()); task->SetMonitoringTaskState(FromProtobuf(task_pb.state())); - std::vector pids; - for(int32_t pid : task_pb.pids()) - pids.push_back(pid); - task->SetPids(pids); + std::vector process_ids; + for(int32_t process_id : task_pb.process_ids()) + process_ids.push_back(process_id); + task->SetPids(process_ids); task->SetLaunchOrder(task_pb.launch_order()); task->SetAlgoPath(task_pb.path()); @@ -237,9 +237,9 @@ namespace eCAL task_pb.set_name (task->GetName()); task_pb.set_target_host (task->GetTarget()); ToProtobuf (*(task_pb.mutable_state()), task->GetMonitoringTaskState()); - for (int pid : task->GetPids()) + for (int process_id : task->GetPids()) { - task_pb.add_pids(pid); + task_pb.add_process_ids(process_id); } task_pb.set_launch_order (task->GetLaunchOrder()); task_pb.set_path (task->GetAlgoPath()); diff --git a/app/sys/sys_core/src/task/ecal_sys_task_helper.cpp b/app/sys/sys_core/src/task/ecal_sys_task_helper.cpp index d99de0fc47..2aa29da137 100644 --- a/app/sys/sys_core/src/task/ecal_sys_task_helper.cpp +++ b/app/sys/sys_core/src/task/ecal_sys_task_helper.cpp @@ -45,7 +45,7 @@ namespace eCAL } else if (!task->GetPids().empty() && (task->GetPids()[0] != 0)) { - stop_task_param.pid = task->GetPids()[0]; + stop_task_param.process_id = task->GetPids()[0]; stop_task_param.ecal_shutdown = true; } diff --git a/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp b/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp index d3f969a499..ec8e9157a1 100644 --- a/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp +++ b/app/sys/sys_core/src/taskaction_threads/start_task_list_thread.cpp @@ -102,10 +102,10 @@ void StartTaskListThread::Run() for (const auto& host_taskparamlist_pair : start_tasks_param_map) { if (IsInterrupted()) return; - std::vector pids = future_map[host_taskparamlist_pair.first].get(); + std::vector process_ids = future_map[host_taskparamlist_pair.first].get(); if (IsInterrupted()) return; - for (size_t i = 0; (i < pids.size()) && (i < original_task_ptr_map[host_taskparamlist_pair.first].size()); i++) + for (size_t i = 0; (i < process_ids.size()) && (i < original_task_ptr_map[host_taskparamlist_pair.first].size()); i++) { std::shared_ptr task = original_task_ptr_map[host_taskparamlist_pair.first][i]; @@ -113,9 +113,9 @@ void StartTaskListThread::Run() std::lock_guard task_lock(task->mutex); if (IsInterrupted()) return; - if (pids[i] != 0) + if (process_ids[i] != 0) { - task->SetPids({pids[i]}); + task->SetPids({process_ids[i]}); task->SetHostStartedOn(host_taskparamlist_pair.first); task->SetStartStopState(EcalSysTask::StartStopState::Started_Successfully); @@ -133,7 +133,7 @@ void StartTaskListThread::Run() } // Log an error for all tasks that we didn't get a response for (e.g. because we weren't able to contact the client) - for (size_t i = pids.size(); i < original_task_ptr_map[host_taskparamlist_pair.first].size(); i++) + for (size_t i = process_ids.size(); i < original_task_ptr_map[host_taskparamlist_pair.first].size(); i++) { std::shared_ptr task = original_task_ptr_map[host_taskparamlist_pair.first][i]; diff --git a/app/sys/sys_core/src/taskaction_threads/stop_task_list_thread.cpp b/app/sys/sys_core/src/taskaction_threads/stop_task_list_thread.cpp index 29e1cd3dad..25882b3d58 100644 --- a/app/sys/sys_core/src/taskaction_threads/stop_task_list_thread.cpp +++ b/app/sys/sys_core/src/taskaction_threads/stop_task_list_thread.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2020 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ void StopTaskListThread::Run() stop_tasks_param_map [host_to_stop_on].push_back(std::move(stop_task_param)); original_task_ptr_map[host_to_stop_on].push_back(task); } - else if (stop_task_param.pid != 0) + else if (stop_task_param.process_id != 0) { stop_tasks_param_map [host_to_stop_on].push_back(std::move(stop_task_param)); original_task_ptr_map[host_to_stop_on].push_back(task); diff --git a/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp b/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp index c0bcf4aabd..1c38f6f805 100644 --- a/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp +++ b/app/sys/sys_gui/src/widgets/treemodels/task_tree_item.cpp @@ -129,9 +129,9 @@ QVariant TaskTreeItem::data(Columns column, Qt::ItemDataRole role) const { auto pid_list = task_->GetPids(); QStringList pid_strings; - for (auto pid : pid_list) + for (auto process_id : pid_list) { - pid_strings.push_back(QString::number(pid)); + pid_strings.push_back(QString::number(process_id)); } return pid_strings.join(", "); } diff --git a/app/util/stop/src/ecal_stop.cpp b/app/util/stop/src/ecal_stop.cpp index 97f93c4208..efcf83ad4c 100644 --- a/app/util/stop/src/ecal_stop.cpp +++ b/app/util/stop/src/ecal_stop.cpp @@ -53,28 +53,28 @@ int main() for (const auto& process : monitoring.processes) { // filter out eCAL system processes - const std::string uname = process.uname; - if ( (uname != "eCALConfig") - && (uname != "eCALMon") - && (uname != "eCALMon CLI") - && (uname != "eCALMon TUI") - && (uname != "eCALPlay") - && (uname != "eCALPlayGUI") - && (uname != "eCALRec") - && (uname != "eCALRecGUI") - && (uname != "eCALRecClient") - && (uname != "eCALRec-Remote") - && (uname != "eCALRec-Server") - && (uname != "eCALSys") - && (uname != "eCALSysGUI") - && (uname != "eCALSysClient") - && (uname != "eCALSys-Remote") - && (uname != "eCALStop") - && (process.hname == host_name) + const std::string unit_name = process.unit_name; + if ( (unit_name != "eCALConfig") + && (unit_name != "eCALMon") + && (unit_name != "eCALMon CLI") + && (unit_name != "eCALMon TUI") + && (unit_name != "eCALPlay") + && (unit_name != "eCALPlayGUI") + && (unit_name != "eCALRec") + && (unit_name != "eCALRecGUI") + && (unit_name != "eCALRecClient") + && (unit_name != "eCALRec-Remote") + && (unit_name != "eCALRec-Server") + && (unit_name != "eCALSys") + && (unit_name != "eCALSysGUI") + && (unit_name != "eCALSysClient") + && (unit_name != "eCALSys-Remote") + && (unit_name != "eCALStop") + && (process.host_name == host_name) ) { - std::cout << "Stopping process " << process.pname << " (" << process.pid << ")" << std::endl; - eCAL::Util::ShutdownProcess(process.pid); + std::cout << "Stopping process " << process.process_name << " (" << process.process_id << ")" << std::endl; + eCAL::Util::ShutdownProcess(process.process_id); } } diff --git a/contrib/ecaltime/ecaltime_pb/src/ecal/ecaltime/pb/sim_time.proto b/contrib/ecaltime/ecaltime_pb/src/ecal/ecaltime/pb/sim_time.proto index 81cdb36185..25f0f95c2c 100644 --- a/contrib/ecaltime/ecaltime_pb/src/ecal/ecaltime/pb/sim_time.proto +++ b/contrib/ecaltime/ecaltime_pb/src/ecal/ecaltime/pb/sim_time.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ message SimTime sint64 simulation_time_nsecs = 2; // current eCAL simulation time in nanoseconds double real_time_factor = 3; // factor relative to the real time at which the simulation time hast to proceed uint64 local_time_nsecs = 4; // local PC timestamp in nanoseconds (used for interpolating) - string hostname = 5; // hostname of the PC that generated the local_time_nsecs value. Used for + string host_name = 5; // hostname of the PC that generated the local_time_nsecs value. Used for // deciding wether to use that number or rely on the receive time uint32 process_id = 6; // PID of the process that generated the simulation time } diff --git a/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp b/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp index 2c13f12330..a8010e78ec 100644 --- a/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp +++ b/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,7 +145,7 @@ void eCAL::CSimTime::onSimTimeMessage(const eCAL::pb::SimTime & sim_time_) { std::unique_lock lk(time_mutex); last_measurement_time = sim_time_.simulation_time_nsecs(); - if (sim_time_.hostname() == eCAL::Process::GetHostName()) { + if (sim_time_.host_name() == eCAL::Process::GetHostName()) { time_of_last_measurement_time = sim_time_.local_time_nsecs(); } else { diff --git a/contrib/mma/include/windows/processes.h b/contrib/mma/include/windows/processes.h index cd95c0d039..a81db10353 100644 --- a/contrib/mma/include/windows/processes.h +++ b/contrib/mma/include/windows/processes.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,7 +139,7 @@ class Processes { typedef struct ExtendedProcessInfo_s { - DWORD pid; + DWORD process_id; DWORD parent_pid; DWORD session_id; DWORD peb_base_address; diff --git a/contrib/mma/src/windows/processes.cpp b/contrib/mma/src/windows/processes.cpp index 4afd7aa6d9..3e502796bf 100644 --- a/contrib/mma/src/windows/processes.cpp +++ b/contrib/mma/src/windows/processes.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -319,7 +319,7 @@ bool Processes::GetExtendedProcessInfo(const DWORD _pid, ExtendedProcessInfo_ptr ZeroMemory(&peb_ldr, sizeof(peb_ldr)); ZeroMemory(&peb_upp, sizeof(peb_upp)); - spi.pid = _pid; + spi.process_id = _pid; HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, _pid); if (hProcess == INVALID_HANDLE_VALUE) @@ -438,7 +438,7 @@ bool Processes::GetExtendedProcessInfo(const DWORD _pid, ExtendedProcessInfo_ptr } } } - if ((spi.pid == 4) && (failed_to_free_memory == false)) + if ((spi.process_id == 4) && (failed_to_free_memory == false)) { ExpandEnvironmentStrings(_T("%SystemRoot%\\System32\\ntoskrnl.exe"), spi.image_path, sizeof(spi.image_path)); } diff --git a/contrib/mma/src/zombie_instance_killer.cpp b/contrib/mma/src/zombie_instance_killer.cpp index ab628a83e8..ce99b1a6c8 100644 --- a/contrib/mma/src/zombie_instance_killer.cpp +++ b/contrib/mma/src/zombie_instance_killer.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,27 +68,27 @@ bool ZombieInstanceKiller::KillZombie(const std::string& process_name) do { #ifdef _UNICODE - std::wstring pname = pe32.szExeFile; + std::wstring process_name = pe32.szExeFile; std::wstring wpid_name = String2WString(process_name); - DWORD pid = pe32.th32ProcessID; + DWORD process_id = pe32.th32ProcessID; // cause warning C4244 with VS2017 - //std::transform(pname.begin(), pname.end(), pname.begin(), ::tolower); - std::transform(pname.begin(), pname.end(), pname.begin(), + //std::transform(process_name.begin(), process_name.end(), process_name.begin(), ::tolower); + std::transform(process_name.begin(), process_name.end(), process_name.begin(), [](char c) {return static_cast(::tolower(c)); }); - if (pname == wpid_name) + if (process_name == wpid_name) #else /* _UNICODE */ - std::string pname = pe32.szExeFile; - DWORD pid = pe32.th32ProcessID; + std::string process_name = pe32.szExeFile; + DWORD process_id = pe32.th32ProcessID; // cause warning C4244 with VS2017 - //std::transform(pname.begin(), pname.end(), pname.begin(), ::tolower); - std::transform(pname.begin(), pname.end(), pname.begin(), + //std::transform(process_name.begin(), process_name.end(), process_name.begin(), ::tolower); + std::transform(process_name.begin(), process_name.end(), process_name.begin(), [](char c) {return static_cast(::tolower(c)); }); - if (pname == process_name) + if (process_name == process_name) #endif /* _UNICODE */ { - if (pid != GetCurrentProcessId()) + if (process_id != GetCurrentProcessId()) { - eCAL::Process::StopProcess(pid); + eCAL::Process::StopProcess(process_id); ret_state = true; } } @@ -124,20 +124,20 @@ bool ZombieInstanceKiller::KillZombie(const std::string& pid_name) char buf[512]; if (fgets(buf, 512, pipe) == nullptr) return false; - std::list pids; + std::list process_ids; char* pch; pch = strtok(buf, " "); while (pch != nullptr) { - pids.push_back(pch); + process_ids.push_back(pch); pch = strtok(nullptr, " "); } - if (!pids.empty()) + if (!process_ids.empty()) { - for (const auto& pid : pids) + for (const auto& process_id : process_ids) { - pid_t current_pid = strtoul(pid.c_str(), nullptr, 10); + pid_t current_pid = strtoul(process_id.c_str(), nullptr, 10); if ((current_pid != 0) && (current_pid != getpid())) { diff --git a/doc/rst/advanced/ecal_in_docker.rst b/doc/rst/advanced/ecal_in_docker.rst index 0b03698740..9040c46a28 100644 --- a/doc/rst/advanced/ecal_in_docker.rst +++ b/doc/rst/advanced/ecal_in_docker.rst @@ -193,13 +193,13 @@ Seamless IPC-Communication across host borders .. important:: This will work with eCAL 5.12 and higher. - Older versions lack the ability to utilize the ``host_group_name`` in the :file:`ecal.yaml` file, thus it won't work. + Older versions lack the ability to utilize the ``shm_transport_domain`` in the :file:`ecal.yaml` file, thus it won't work. -In eCAL, you are able to set host belonging over network borders by utilizing the :file:`ecal.yaml` configuration file with the same ``host_group_name`` - in the following steps, you will learn how to set this up. +In eCAL, you are able to set host belonging over network borders by utilizing the :file:`ecal.yaml` configuration file with the same ``shm_transport_domain`` - in the following steps, you will learn how to set this up. .. note:: - If we don't set the same ``host_group_name`` on our Host and our Containers, an IPC-Communication across host borders is not available with different host names. + If we don't set the same ``shm_transport_domain`` on our Host and our Containers, an IPC-Communication across host borders is not available with different host names. #. To encapsulate your container network from your host network, you need to create a new docker network with the following command: @@ -215,7 +215,7 @@ In eCAL, you are able to set host belonging over network borders by utilizing th * Search for the line ``registration->network_enabled`` and set it to ``true``. - * Search for the line ``registration->host_group_name`` and write your preferred name. + * Search for the line ``registration->shm_transport_domain`` and write your preferred name. * Save and close the :file:`ecal.yaml` file. diff --git a/ecal/core/include/ecal/types/logging.h b/ecal/core/include/ecal/types/logging.h index 52e9e041f0..11a7804fa1 100644 --- a/ecal/core/include/ecal/types/logging.h +++ b/ecal/core/include/ecal/types/logging.h @@ -37,10 +37,10 @@ namespace eCAL struct SLogMessage { int64_t time = 0; // time - std::string hname; // host name - int32_t pid = 0; // process id - std::string pname; // process name - std::string uname; // unit name + std::string host_name; // host name + int32_t process_id = 0; // process id + std::string process_name; // process name + std::string unit_name; // unit name eLogLevel level = log_level_none; // message level std::string content; // message content }; diff --git a/ecal/core/include/ecal/types/monitoring.h b/ecal/core/include/ecal/types/monitoring.h index 6106f16e98..93f13dbb1c 100644 --- a/ecal/core/include/ecal/types/monitoring.h +++ b/ecal/core/include/ecal/types/monitoring.h @@ -54,57 +54,57 @@ namespace eCAL constexpr unsigned int None = 0x000; } - enum eTLayerType + enum class eTransportLayerType { - tl_none = 0, - tl_ecal_udp_mc = 1, - tl_ecal_shm = 4, - tl_ecal_tcp = 5, + none = 0, + udp_mc = 1, + shm = 4, + tcp = 5, }; - struct TLayer + struct STransportLayer { - eTLayerType type = tl_none; // tlayer; //!< transport layer details - int32_t tsize{0}; //!< topic size + std::vector transport_layer; //!< transport layer details + int32_t topic_size{0}; //!< topic size - int32_t connections_loc{0}; //!< number of local connected entities - int32_t connections_ext{0}; //!< number of external connected entities - int32_t message_drops{0}; //!< dropped messages + int32_t connections_local{0}; //!< number of local connected entities + int32_t connections_external{0}; //!< number of external connected entities + int32_t message_drops{0}; //!< dropped messages - int64_t did{0}; //!< data send id (publisher setid) - int64_t dclock{0}; //!< data clock (send / receive action) - int32_t dfreq{0}; //!< data frequency (send / receive samples per second) [mHz] + int64_t data_id{0}; //!< data send id (publisher setid) + int64_t data_clock{0}; //!< data clock (send / receive action) + int32_t data_frequency{0}; //!< data frequency (send / receive samples per second) [mHz] - std::map attr; //!< generic topic description + std::map attr; //!< generic topic description }; - struct SProcessMon // methods; // lock(service_method_info_map_.mtx); service_method_info_map_.id_map[service_method_info_key] = Convert(service_); @@ -151,7 +151,7 @@ namespace const eCAL::Registration::SampleIdentifier& service_id_, const Service& service_) { - const auto service_method_info_key = eCAL::SServiceId{ ConvertToEntityId(service_id_), service_.sname }; + const auto service_method_info_key = eCAL::SServiceId{ ConvertToEntityId(service_id_), service_.service_name }; const std::lock_guard lock(service_method_info_map_.mtx); service_method_info_map_.id_map.erase(service_method_info_key); @@ -311,16 +311,16 @@ namespace eCAL RemServiceDescription(m_client_info_map, sample_.identifier, sample_.client); break; case bct_reg_publisher: - ApplyTopicDescription(m_publisher_info_map, m_publisher_callback_map, sample_.identifier, sample_.topic.tname, sample_.topic.tdatatype); + ApplyTopicDescription(m_publisher_info_map, m_publisher_callback_map, sample_.identifier, sample_.topic.topic_name, sample_.topic.datatype_information); break; case bct_unreg_publisher: - RemTopicDescription(m_publisher_info_map, m_publisher_callback_map, sample_.identifier, sample_.topic.tname); + RemTopicDescription(m_publisher_info_map, m_publisher_callback_map, sample_.identifier, sample_.topic.topic_name); break; case bct_reg_subscriber: - ApplyTopicDescription(m_subscriber_info_map, m_subscriber_callback_map, sample_.identifier, sample_.topic.tname, sample_.topic.tdatatype); + ApplyTopicDescription(m_subscriber_info_map, m_subscriber_callback_map, sample_.identifier, sample_.topic.topic_name, sample_.topic.datatype_information); break; case bct_unreg_subscriber: - RemTopicDescription(m_subscriber_info_map, m_subscriber_callback_map, sample_.identifier, sample_.topic.tname); + RemTopicDescription(m_subscriber_info_map, m_subscriber_callback_map, sample_.identifier, sample_.topic.topic_name); break; default: { diff --git a/ecal/core/src/ecal_process.cpp b/ecal/core/src/ecal_process.cpp index b4c744b2ed..6998179c57 100644 --- a/ecal/core/src/ecal_process.cpp +++ b/ecal/core/src/ecal_process.cpp @@ -232,10 +232,10 @@ namespace eCAL { if (g_host_name.empty()) { - char hname[1024] = { 0 }; - if (gethostname(hname, 1024) == 0) + char host_name[1024] = { 0 }; + if (gethostname(host_name, 1024) == 0) { - g_host_name = hname; + g_host_name = host_name; } else { @@ -336,9 +336,9 @@ namespace eCAL { if (g_process_name.empty()) { - WCHAR pname[1024] = { 0 }; - GetModuleFileNameExW(GetCurrentProcess(), nullptr, pname, 1024); - g_process_name = EcalUtils::StrConvert::WideToUtf8(pname); + WCHAR process_name[1024] = { 0 }; + GetModuleFileNameExW(GetCurrentProcess(), nullptr, process_name, 1024); + g_process_name = EcalUtils::StrConvert::WideToUtf8(process_name); } return(g_process_name); } @@ -752,7 +752,7 @@ namespace eCAL if (g_process_par.empty()) { #if defined(ECAL_OS_MACOS) - int pid = getpid(); + int process_id = getpid(); int mib[3], argmax, argc; size_t size; @@ -812,7 +812,7 @@ namespace eCAL */ mib[0] = CTL_KERN; mib[1] = KERN_PROCARGS2; - mib[2] = pid; + mib[2] = process_id; size = (size_t)argmax; if (sysctl(mib, 3, procargs.data(), &size, NULL, 0) == -1) diff --git a/ecal/core/src/ecal_util.cpp b/ecal/core/src/ecal_util.cpp index ed56df1ab6..76c5a0d427 100644 --- a/ecal/core/src/ecal_util.cpp +++ b/ecal/core/src/ecal_util.cpp @@ -69,12 +69,12 @@ namespace eCAL std::vector proc_id_list; for (const auto& process : monitoring.processes) { - const std::string pname = process.pname; - if ( (pname == process_name_) - && (process.hname == host_name) + const std::string process_name = process.process_name; + if ( (process_name == process_name_) + && (process.host_name == host_name) ) { - proc_id_list.push_back(process.pid); + proc_id_list.push_back(process.process_id); } } @@ -104,20 +104,20 @@ namespace eCAL std::vector proc_id_list; for (const auto& process : monitoring.processes) { - const std::string uname = process.uname; - if ((uname != "eCALMon") - && (uname != "eCALPlay") - && (uname != "eCALPlayGUI") - && (uname != "eCALRec") - && (uname != "eCALRecGUI") - && (uname != "eCALSys") - && (uname != "eCALSysGUI") - && (uname != "eCALStop") - && (uname != "eCALTopic") - && (process.hname == host_name) + const std::string unit_name = process.unit_name; + if ((unit_name != "eCALMon") + && (unit_name != "eCALPlay") + && (unit_name != "eCALPlayGUI") + && (unit_name != "eCALRec") + && (unit_name != "eCALRecGUI") + && (unit_name != "eCALSys") + && (unit_name != "eCALSysGUI") + && (unit_name != "eCALStop") + && (unit_name != "eCALTopic") + && (process.host_name == host_name) ) { - proc_id_list.push_back(process.pid); + proc_id_list.push_back(process.process_id); } } @@ -135,21 +135,21 @@ namespace eCAL std::vector proc_id_list; for (const auto& process : monitoring.processes) { - const std::string uname = process.uname; - if (((uname == "eCALMon") - || (uname == "eCALPlay") - || (uname == "eCALPlayGUI") - || (uname == "eCALRec") - || (uname == "eCALRecGUI") - || (uname == "eCALSys") - || (uname == "eCALSysGUI") - || (uname == "eCALStop") - || (uname == "eCALTopic") + const std::string unit_name = process.unit_name; + if (((unit_name == "eCALMon") + || (unit_name == "eCALPlay") + || (unit_name == "eCALPlayGUI") + || (unit_name == "eCALRec") + || (unit_name == "eCALRecGUI") + || (unit_name == "eCALSys") + || (unit_name == "eCALSysGUI") + || (unit_name == "eCALStop") + || (unit_name == "eCALTopic") ) - && (process.hname == host_name) + && (process.host_name == host_name) ) { - proc_id_list.push_back(process.pid); + proc_id_list.push_back(process.process_id); } } diff --git a/ecal/core/src/logging/ecal_log_provider.cpp b/ecal/core/src/logging/ecal_log_provider.cpp index eed198bb6d..7d44374b86 100644 --- a/ecal/core/src/logging/ecal_log_provider.cpp +++ b/ecal/core/src/logging/ecal_log_provider.cpp @@ -247,10 +247,10 @@ namespace eCAL // set up log message Logging::SLogMessage log_message; log_message.time = std::chrono::duration_cast(log_time.time_since_epoch()).count(); - log_message.hname = m_attributes.host_name; - log_message.pid = m_attributes.process_id; - log_message.pname = m_attributes.process_name; - log_message.uname = m_attributes.unit_name; + log_message.host_name = m_attributes.host_name; + log_message.process_id = m_attributes.process_id; + log_message.process_name = m_attributes.process_name; + log_message.unit_name = m_attributes.unit_name; log_message.level = level_; log_message.content = msg_; diff --git a/ecal/core/src/logging/ecal_log_receiver.cpp b/ecal/core/src/logging/ecal_log_receiver.cpp index 1db989e02d..fee79cc609 100644 --- a/ecal/core/src/logging/ecal_log_receiver.cpp +++ b/ecal/core/src/logging/ecal_log_receiver.cpp @@ -117,7 +117,7 @@ namespace eCAL { // in "network mode" we accept all log messages // in "local mode" we accept log messages from this host only - if ((m_attributes.host_name == log_message.hname) || m_attributes.network_enabled) + if ((m_attributes.host_name == log_message.host_name) || m_attributes.network_enabled) { const std::lock_guard lock(m_log_mtx); m_log_msglist.log_messages.emplace_back(log_message); diff --git a/ecal/core/src/monitoring/ecal_monitoring_impl.cpp b/ecal/core/src/monitoring/ecal_monitoring_impl.cpp index 544d8bd23c..d3132f0717 100644 --- a/ecal/core/src/monitoring/ecal_monitoring_impl.cpp +++ b/ecal/core/src/monitoring/ecal_monitoring_impl.cpp @@ -141,23 +141,23 @@ namespace eCAL { const auto& sample_topic = sample_.topic; const int process_id = sample_.identifier.process_id; - const std::string& topic_name = sample_topic.tname; - const int32_t topic_size = sample_topic.tsize; + const std::string& topic_name = sample_topic.topic_name; + const int32_t topic_size = sample_topic.topic_size; bool topic_tlayer_ecal_udp(false); bool topic_tlayer_ecal_shm(false); bool topic_tlayer_ecal_tcp(false); - for (const auto& layer : sample_topic.tlayer) + for (const auto& layer : sample_topic.transport_layer) { topic_tlayer_ecal_udp |= (layer.type == tl_ecal_udp) && layer.active; topic_tlayer_ecal_shm |= (layer.type == tl_ecal_shm) && layer.active; topic_tlayer_ecal_tcp |= (layer.type == tl_ecal_tcp) && layer.active; } - const int32_t connections_loc = sample_topic.connections_loc; - const int32_t connections_ext = sample_topic.connections_ext; - const int64_t did = sample_topic.did; - const int64_t dclock = sample_topic.dclock; + const int32_t connections_local = sample_topic.connections_local; + const int32_t connections_external = sample_topic.connections_external; + const int64_t data_id = sample_topic.data_id; + const int64_t data_clock = sample_topic.data_clock; const int32_t message_drops = sample_topic.message_drops; - const int32_t dfreq = sample_topic.dfreq; + const int32_t data_frequency = sample_topic.data_frequency; ///////////////////////////////// // register in topic map @@ -171,8 +171,8 @@ namespace eCAL // common infos const std::string& host_name = sample_.identifier.host_name; const std::string& shm_transport_domain = sample_topic.shm_transport_domain; - const std::string& process_name = sample_topic.pname; - const std::string& unit_name = sample_topic.uname; + const std::string& process_name = sample_topic.process_name; + const std::string& unit_name = sample_topic.unit_name; const auto& topic_id = sample_.identifier.entity_id; std::string direction; switch (pubsub_type_) @@ -186,9 +186,9 @@ namespace eCAL default: break; } - std::string topic_datatype_encoding = sample_topic.tdatatype.encoding; - std::string topic_datatype_name = sample_topic.tdatatype.name; - std::string topic_datatype_desc = sample_topic.tdatatype.descriptor; + std::string topic_datatype_encoding = sample_topic.datatype_information.encoding; + std::string topic_datatype_name = sample_topic.datatype_information.name; + std::string topic_datatype_desc = sample_topic.datatype_information.descriptor; auto attr = sample_topic.attr; // try to get topic info @@ -196,55 +196,55 @@ namespace eCAL Monitoring::STopicMon& TopicInfo = (*pTopicMap->map)[topic_map_key]; // set static content - TopicInfo.hname = host_name; + TopicInfo.host_name = host_name; TopicInfo.shm_transport_domain = shm_transport_domain; - TopicInfo.pid = process_id; - TopicInfo.pname = process_name; - TopicInfo.uname = unit_name; - TopicInfo.tname = topic_name; + TopicInfo.process_id = process_id; + TopicInfo.process_name = process_name; + TopicInfo.unit_name = unit_name; + TopicInfo.topic_name = topic_name; TopicInfo.direction = direction; - TopicInfo.tid = topic_id; + TopicInfo.topic_id = topic_id; // update flexible content - TopicInfo.rclock++; - TopicInfo.tdatatype.encoding = std::move(topic_datatype_encoding); - TopicInfo.tdatatype.name = std::move(topic_datatype_name); - TopicInfo.tdatatype.descriptor = std::move(topic_datatype_desc); + TopicInfo.registration_clock++; + TopicInfo.datatype_information.encoding = std::move(topic_datatype_encoding); + TopicInfo.datatype_information.name = std::move(topic_datatype_name); + TopicInfo.datatype_information.descriptor = std::move(topic_datatype_desc); // attributes TopicInfo.attr = std::map{attr.begin(), attr.end()}; // layer - TopicInfo.tlayer.clear(); - // tlayer udp_mc + TopicInfo.transport_layer.clear(); + // transport_layer udp_mc { - eCAL::Monitoring::TLayer tlayer; - tlayer.type = eCAL::Monitoring::tl_ecal_udp_mc; - tlayer.active = topic_tlayer_ecal_udp; - TopicInfo.tlayer.push_back(tlayer); + eCAL::Monitoring::STransportLayer transport_layer; + transport_layer.type = eCAL::Monitoring::eTransportLayerType::udp_mc; + transport_layer.active = topic_tlayer_ecal_udp; + TopicInfo.transport_layer.push_back(transport_layer); } - // tlayer shm + // transport_layer shm { - eCAL::Monitoring::TLayer tlayer; - tlayer.type = eCAL::Monitoring::tl_ecal_shm; - tlayer.active = topic_tlayer_ecal_shm; - TopicInfo.tlayer.push_back(tlayer); + eCAL::Monitoring::STransportLayer transport_layer; + transport_layer.type = eCAL::Monitoring::eTransportLayerType::shm; + transport_layer.active = topic_tlayer_ecal_shm; + TopicInfo.transport_layer.push_back(transport_layer); } - // tlayer tcp + // transport_layer tcp { - eCAL::Monitoring::TLayer tlayer; - tlayer.type = eCAL::Monitoring::tl_ecal_tcp; - tlayer.active = topic_tlayer_ecal_tcp; - TopicInfo.tlayer.push_back(tlayer); + eCAL::Monitoring::STransportLayer transport_layer; + transport_layer.type = eCAL::Monitoring::eTransportLayerType::tcp; + transport_layer.active = topic_tlayer_ecal_tcp; + TopicInfo.transport_layer.push_back(transport_layer); } - TopicInfo.tsize = static_cast(topic_size); - TopicInfo.connections_loc = static_cast(connections_loc); - TopicInfo.connections_ext = static_cast(connections_ext); - TopicInfo.did = did; - TopicInfo.dclock = dclock; - TopicInfo.message_drops = message_drops; - TopicInfo.dfreq = dfreq; + TopicInfo.topic_size = static_cast(topic_size); + TopicInfo.connections_local = static_cast(connections_local); + TopicInfo.connections_external = static_cast(connections_external); + TopicInfo.data_id = data_id; + TopicInfo.data_clock = data_clock; + TopicInfo.message_drops = message_drops; + TopicInfo.data_frequency = data_frequency; } return(true); @@ -273,16 +273,16 @@ namespace eCAL const auto& sample_process = sample_.process; const std::string& host_name = sample_.identifier.host_name; const std::string& shm_transport_domain = sample_process.shm_transport_domain; - const std::string& process_name = sample_process.pname; + const std::string& process_name = sample_process.process_name; const int process_id = sample_.identifier.process_id; - const std::string& process_param = sample_process.pparam; - const std::string& unit_name = sample_process.uname; + const std::string& process_param = sample_process.process_parameter; + const std::string& unit_name = sample_process.unit_name; const auto& sample_process_state = sample_process.state; const int process_state_severity = sample_process_state.severity; const int process_state_severity_level = sample_process_state.severity_level; const std::string& process_state_info = sample_process_state.info; - const int process_tsync_state = sample_process.tsync_state; - const std::string& process_tsync_mod_name = sample_process.tsync_mod_name; + const int process_time_sync_state = sample_process.time_sync_state; + const std::string& process_tsync_mod_name = sample_process.time_sync_module_name; const int component_init_state = sample_process.component_init_state; const std::string& component_init_info = sample_process.component_init_info; const std::string& ecal_runtime_version = sample_process.ecal_runtime_version; @@ -298,24 +298,24 @@ namespace eCAL Monitoring::SProcessMon& ProcessInfo = (*m_process_map.map)[process_map_key]; // set static content - ProcessInfo.hname = host_name; + ProcessInfo.host_name = host_name; ProcessInfo.shm_transport_domain = shm_transport_domain; - ProcessInfo.pname = process_name; - ProcessInfo.uname = unit_name; - ProcessInfo.pid = process_id; - ProcessInfo.pparam = process_param; + ProcessInfo.process_name = process_name; + ProcessInfo.unit_name = unit_name; + ProcessInfo.process_id = process_id; + ProcessInfo.process_parameter = process_param; // update flexible content - ProcessInfo.rclock++; - ProcessInfo.state_severity = process_state_severity; - ProcessInfo.state_severity_level = process_state_severity_level; - ProcessInfo.state_info = process_state_info; - ProcessInfo.tsync_state = process_tsync_state; - ProcessInfo.tsync_mod_name = process_tsync_mod_name; - ProcessInfo.component_init_state = component_init_state; - ProcessInfo.component_init_info = component_init_info; - ProcessInfo.ecal_runtime_version = ecal_runtime_version; - ProcessInfo.config_file_path = config_file_path; + ProcessInfo.registration_clock++; + ProcessInfo.state_severity = process_state_severity; + ProcessInfo.state_severity_level = process_state_severity_level; + ProcessInfo.state_info = process_state_info; + ProcessInfo.time_sync_state = process_time_sync_state; + ProcessInfo.time_sync_module_name = process_tsync_mod_name; + ProcessInfo.component_init_state = component_init_state; + ProcessInfo.component_init_info = component_init_info; + ProcessInfo.ecal_runtime_version = ecal_runtime_version; + ProcessInfo.config_file_path = config_file_path; return(true); } @@ -341,9 +341,9 @@ namespace eCAL const std::string& host_name = sample_identifier.host_name; const auto& sample_service = sample_.service; - const std::string& service_name = sample_service.sname; - const std::string& process_name = sample_service.pname; - const std::string& unit_name = sample_service.uname; + const std::string& service_name = sample_service.service_name; + const std::string& process_name = sample_service.process_name; + const std::string& unit_name = sample_service.unit_name; const uint32_t tcp_port_v0 = sample_service.tcp_port_v0; const uint32_t tcp_port_v1 = sample_service.tcp_port_v1; @@ -358,25 +358,25 @@ namespace eCAL Monitoring::SServerMon& ServerInfo = (*m_server_map.map)[service_map_key]; // set static content - ServerInfo.hname = host_name; - ServerInfo.sname = service_name; - ServerInfo.sid = service_id; - ServerInfo.pname = process_name; - ServerInfo.uname = unit_name; - ServerInfo.pid = process_id; - ServerInfo.tcp_port_v0 = tcp_port_v0; - ServerInfo.tcp_port_v1 = tcp_port_v1; + ServerInfo.host_name = host_name; + ServerInfo.service_name = service_name; + ServerInfo.service_id = service_id; + ServerInfo.process_name = process_name; + ServerInfo.unit_name = unit_name; + ServerInfo.process_id = process_id; + ServerInfo.tcp_port_v0 = tcp_port_v0; + ServerInfo.tcp_port_v1 = tcp_port_v1; // update flexible content - ServerInfo.rclock++; + ServerInfo.registration_clock++; ServerInfo.methods.clear(); for (const auto& sample_service_method : sample_.service.methods) { struct Monitoring::SMethodMon method; - method.mname = sample_service_method.mname; + method.method_name = sample_service_method.method_name; - method.req_datatype = sample_service_method.req_datatype; - method.resp_datatype = sample_service_method.resp_datatype; + method.request_datatype_information = sample_service_method.request_datatype_information; + method.response_datatype_information = sample_service_method.response_datatype_information; method.call_count = sample_service_method.call_count; ServerInfo.methods.push_back(method); @@ -407,9 +407,9 @@ namespace eCAL const std::string& host_name = sample_identifier.host_name; const auto& sample_client = sample_.client; - const std::string& service_name = sample_client.sname; - const std::string& process_name = sample_client.pname; - const std::string& unit_name = sample_client.uname; + const std::string& service_name = sample_client.service_name; + const std::string& process_name = sample_client.process_name; + const std::string& unit_name = sample_client.unit_name; // create map key const auto& client_map_key = service_id; @@ -421,22 +421,22 @@ namespace eCAL Monitoring::SClientMon& ClientInfo = (*m_clients_map.map)[client_map_key]; // set static content - ClientInfo.hname = host_name; - ClientInfo.sname = service_name; - ClientInfo.sid = service_id; - ClientInfo.pname = process_name; - ClientInfo.uname = unit_name; - ClientInfo.pid = process_id; + ClientInfo.host_name = host_name; + ClientInfo.service_name = service_name; + ClientInfo.service_id = service_id; + ClientInfo.process_name = process_name; + ClientInfo.unit_name = unit_name; + ClientInfo.process_id = process_id; // update flexible content - ClientInfo.rclock++; + ClientInfo.registration_clock++; ClientInfo.methods.clear(); for (const auto& sample_client_method : sample_.client.methods) { struct Monitoring::SMethodMon method; - method.mname = sample_client_method.mname; - method.req_datatype = sample_client_method.req_datatype; - method.resp_datatype = sample_client_method.resp_datatype; + method.method_name = sample_client_method.method_name; + method.request_datatype_information = sample_client_method.request_datatype_information; + method.response_datatype_information = sample_client_method.response_datatype_information; method.call_count = sample_client_method.call_count; ClientInfo.methods.push_back(method); } diff --git a/ecal/core/src/pubsub/ecal_pubgate.cpp b/ecal/core/src/pubsub/ecal_pubgate.cpp index 88906a720c..706d240a7c 100644 --- a/ecal/core/src/pubsub/ecal_pubgate.cpp +++ b/ecal/core/src/pubsub/ecal_pubgate.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,17 +97,17 @@ namespace eCAL if(!m_created) return; const auto& ecal_topic = ecal_sample_.topic; - const std::string& topic_name = ecal_topic.tname; + const std::string& topic_name = ecal_topic.topic_name; // check topic name if (topic_name.empty()) return; // TODO: Substitute ProducerInfo type const auto& subscription_info = ecal_sample_.identifier; - const SDataTypeInformation& topic_information = ecal_topic.tdatatype; + const SDataTypeInformation& topic_information = ecal_topic.datatype_information; CPublisherImpl::SLayerStates layer_states; - for (const auto& layer : ecal_topic.tlayer) + for (const auto& layer : ecal_topic.transport_layer) { // transport layer versions 0 and 1 did not support dynamic layer enable feature // so we set assume layer is enabled if we receive a registration in this case @@ -132,7 +132,7 @@ namespace eCAL std::string reader_par; #if 0 - for (const auto& layer : ecal_sample.tlayer()) + for (const auto& layer : ecal_sample.transport_layer()) { // layer parameter as protobuf message // this parameter is not used at all currently @@ -155,13 +155,13 @@ namespace eCAL if (!m_created) return; const auto& ecal_topic = ecal_sample_.topic; - const std::string& topic_name = ecal_topic.tname; + const std::string& topic_name = ecal_topic.topic_name; // check topic name if (topic_name.empty()) return; const auto& subscription_info = ecal_sample_.identifier; - const SDataTypeInformation& topic_information = ecal_topic.tdatatype; + const SDataTypeInformation& topic_information = ecal_topic.datatype_information; // unregister subscriber const std::shared_lock lock(m_topic_name_publisher_mutex); diff --git a/ecal/core/src/pubsub/ecal_publisher_impl.cpp b/ecal/core/src/pubsub/ecal_publisher_impl.cpp index a8d52b5426..55daf5bfc0 100644 --- a/ecal/core/src/pubsub/ecal_publisher_impl.cpp +++ b/ecal/core/src/pubsub/ecal_publisher_impl.cpp @@ -631,17 +631,17 @@ namespace eCAL auto& ecal_reg_sample_topic = ecal_reg_sample.topic; ecal_reg_sample_topic.shm_transport_domain = m_attributes.shm_transport_domain; - ecal_reg_sample_topic.tname = m_attributes.topic_name; + ecal_reg_sample_topic.topic_name = m_attributes.topic_name; // topic_information { - auto& ecal_reg_sample_tdatatype = ecal_reg_sample_topic.tdatatype; - ecal_reg_sample_tdatatype.encoding = m_topic_info.encoding; - ecal_reg_sample_tdatatype.name = m_topic_info.name; + auto& ecal_reg_sample_tdatatype = ecal_reg_sample_topic.datatype_information; + ecal_reg_sample_tdatatype.encoding = m_topic_info.encoding; + ecal_reg_sample_tdatatype.name = m_topic_info.name; ecal_reg_sample_tdatatype.descriptor = m_topic_info.descriptor; } - ecal_reg_sample_topic.attr = m_attr; - ecal_reg_sample_topic.tsize = static_cast(m_topic_size); + ecal_reg_sample_topic.attr = m_attr; + ecal_reg_sample_topic.topic_size = static_cast(m_topic_size); #if ECAL_CORE_TRANSPORT_UDP // udp multicast layer @@ -653,7 +653,7 @@ namespace eCAL udp_tlayer.enabled = m_layers.udp.write_enabled; udp_tlayer.active = m_layers.udp.active; udp_tlayer.par_layer.layer_par_udpmc = m_writer_udp->GetConnectionParameter().layer_par_udpmc; - ecal_reg_sample_topic.tlayer.push_back(udp_tlayer); + ecal_reg_sample_topic.transport_layer.push_back(udp_tlayer); } #endif @@ -667,7 +667,7 @@ namespace eCAL shm_tlayer.enabled = m_layers.shm.write_enabled; shm_tlayer.active = m_layers.shm.active; shm_tlayer.par_layer.layer_par_shm = m_writer_shm->GetConnectionParameter().layer_par_shm; - ecal_reg_sample_topic.tlayer.push_back(shm_tlayer); + ecal_reg_sample_topic.transport_layer.push_back(shm_tlayer); } #endif @@ -681,15 +681,15 @@ namespace eCAL tcp_tlayer.enabled = m_layers.tcp.write_enabled; tcp_tlayer.active = m_layers.tcp.active; tcp_tlayer.par_layer.layer_par_tcp = m_writer_tcp->GetConnectionParameter().layer_par_tcp; - ecal_reg_sample_topic.tlayer.push_back(tcp_tlayer); + ecal_reg_sample_topic.transport_layer.push_back(tcp_tlayer); } #endif - ecal_reg_sample_topic.pname = m_attributes.process_name; - ecal_reg_sample_topic.uname = m_attributes.unit_name; - ecal_reg_sample_topic.did = m_id; - ecal_reg_sample_topic.dclock = m_clock; - ecal_reg_sample_topic.dfreq = GetFrequency(); + ecal_reg_sample_topic.process_name = m_attributes.process_name; + ecal_reg_sample_topic.unit_name = m_attributes.unit_name; + ecal_reg_sample_topic.data_id = m_id; + ecal_reg_sample_topic.data_clock = m_clock; + ecal_reg_sample_topic.data_frequency = GetFrequency(); size_t loc_connections(0); size_t ext_connections(0); @@ -704,8 +704,8 @@ namespace eCAL } ext_connections = m_connection_map.size() - loc_connections; } - ecal_reg_sample_topic.connections_loc = static_cast(loc_connections); - ecal_reg_sample_topic.connections_ext = static_cast(ext_connections); + ecal_reg_sample_topic.connections_local = static_cast(loc_connections); + ecal_reg_sample_topic.connections_external = static_cast(ext_connections); } void CPublisherImpl::GetUnregistrationSample(Registration::Sample& ecal_unreg_sample) @@ -719,9 +719,9 @@ namespace eCAL auto& ecal_reg_sample_topic = ecal_unreg_sample.topic; ecal_reg_sample_topic.shm_transport_domain = m_attributes.shm_transport_domain; - ecal_reg_sample_topic.pname = m_attributes.process_name; - ecal_reg_sample_topic.tname = m_attributes.topic_name; - ecal_reg_sample_topic.uname = m_attributes.unit_name; + ecal_reg_sample_topic.process_name = m_attributes.process_name; + ecal_reg_sample_topic.topic_name = m_attributes.topic_name; + ecal_reg_sample_topic.unit_name = m_attributes.unit_name; } void CPublisherImpl::FireEvent(const ePublisherEvent type_, const SSubscriptionInfo& subscription_info_, const SDataTypeInformation& data_type_info_) diff --git a/ecal/core/src/pubsub/ecal_subgate.cpp b/ecal/core/src/pubsub/ecal_subgate.cpp index 9c798d03d2..5bf045f183 100644 --- a/ecal/core/src/pubsub/ecal_subgate.cpp +++ b/ecal/core/src/pubsub/ecal_subgate.cpp @@ -120,7 +120,7 @@ namespace eCAL if (layer_ == eTLayerType::tl_none) { // log it - Logging::Log(Logging::log_level_error, ecal_sample.topic_info.tname + " : payload received without layer definition !"); + Logging::Log(Logging::log_level_error, ecal_sample.topic_info.topic_name + " : payload received without layer definition !"); } #endif @@ -149,7 +149,7 @@ namespace eCAL { // apply sample to data reader const std::shared_lock lock(m_topic_name_subscriber_mutex); - auto res = m_topic_name_subscriber_map.equal_range(ecal_sample.topic_info.tname); + auto res = m_topic_name_subscriber_map.equal_range(ecal_sample.topic_info.topic_name); std::transform( res.first, res.second, std::back_inserter(readers_to_apply), [](const auto& match) { return match.second; } ); @@ -190,7 +190,7 @@ namespace eCAL // Apply the samples to the readers afterwards. { const std::shared_lock lock(m_topic_name_subscriber_mutex); - auto res = m_topic_name_subscriber_map.equal_range(topic_info_.tname); + auto res = m_topic_name_subscriber_map.equal_range(topic_info_.topic_name); std::transform( res.first, res.second, std::back_inserter(readers_to_apply), [](const auto& match) { return match.second; } ); @@ -210,16 +210,16 @@ namespace eCAL if(!m_created) return; const auto& ecal_topic = ecal_sample_.topic; - const std::string& topic_name = ecal_topic.tname; + const std::string& topic_name = ecal_topic.topic_name; // check topic name if (topic_name.empty()) return; const auto& publication_info = ecal_sample_.identifier; - const SDataTypeInformation& topic_information = ecal_topic.tdatatype; + const SDataTypeInformation& topic_information = ecal_topic.datatype_information; CSubscriberImpl::SLayerStates layer_states; - for (const auto& layer : ecal_topic.tlayer) + for (const auto& layer : ecal_topic.transport_layer) { // transport layer versions 0 and 1 did not support dynamic layer enable feature // so we set assume layer is enabled if we receive a registration in this case @@ -248,9 +248,9 @@ namespace eCAL for (auto iter = res.first; iter != res.second; ++iter) { // apply layer specific parameter - for (const auto& tlayer : ecal_sample_.topic.tlayer) + for (const auto& transport_layer : ecal_sample_.topic.transport_layer) { - iter->second->ApplyLayerParameter(publication_info, tlayer.type, tlayer.par_layer); + iter->second->ApplyLayerParameter(publication_info, transport_layer.type, transport_layer.par_layer); } iter->second->ApplyPublisherRegistration(publication_info, topic_information, layer_states); } @@ -261,13 +261,13 @@ namespace eCAL if (!m_created) return; const auto& ecal_topic = ecal_sample_.topic; - const std::string& topic_name = ecal_topic.tname; + const std::string& topic_name = ecal_topic.topic_name; // check topic name if (topic_name.empty()) return; const auto& publication_info = ecal_sample_.identifier; - const SDataTypeInformation& topic_information = ecal_topic.tdatatype; + const SDataTypeInformation& topic_information = ecal_topic.datatype_information; // unregister publisher const std::shared_lock lock(m_topic_name_subscriber_mutex); diff --git a/ecal/core/src/pubsub/ecal_subscriber_impl.cpp b/ecal/core/src/pubsub/ecal_subscriber_impl.cpp index f299a48da5..fc79429164 100644 --- a/ecal/core/src/pubsub/ecal_subscriber_impl.cpp +++ b/ecal/core/src/pubsub/ecal_subscriber_impl.cpp @@ -490,9 +490,9 @@ namespace eCAL // - an out-of-order message // - a multiple sent message SPublicationInfo publication_info; - publication_info.entity_id = topic_info_.tid; - publication_info.host_name = topic_info_.hname; - publication_info.process_id = topic_info_.pid; + publication_info.entity_id = topic_info_.topic_id; + publication_info.host_name = topic_info_.host_name; + publication_info.process_id = topic_info_.process_id; if (!CheckMessageClock(publication_info, clock_)) { // we will not process that message @@ -539,15 +539,15 @@ namespace eCAL cb_data.clock = clock_; STopicId topic_id; - topic_id.topic_name = topic_info_.tname; - topic_id.topic_id.host_name = topic_info_.hname; - topic_id.topic_id.entity_id = topic_info_.tid; - topic_id.topic_id.process_id = topic_info_.pid; + topic_id.topic_name = topic_info_.topic_name; + topic_id.topic_id.host_name = topic_info_.host_name; + topic_id.topic_id.entity_id = topic_info_.topic_id; + topic_id.topic_id.process_id = topic_info_.process_id; SPublicationInfo pub_info; - pub_info.entity_id = topic_info_.tid; - pub_info.host_name = topic_info_.hname; - pub_info.process_id = topic_info_.pid; + pub_info.entity_id = topic_info_.topic_id; + pub_info.host_name = topic_info_.host_name; + pub_info.process_id = topic_info_.process_id; // execute it const std::lock_guard exec_lock(m_connection_map_mtx); @@ -632,16 +632,16 @@ namespace eCAL auto& ecal_reg_sample_topic = ecal_reg_sample.topic; ecal_reg_sample_topic.shm_transport_domain = m_attributes.shm_transport_domain; - ecal_reg_sample_topic.tname = m_attributes.topic_name; + ecal_reg_sample_topic.topic_name = m_attributes.topic_name; // topic_information { - auto& ecal_reg_sample_tdatatype = ecal_reg_sample_topic.tdatatype; + auto& ecal_reg_sample_tdatatype = ecal_reg_sample_topic.datatype_information; ecal_reg_sample_tdatatype.encoding = m_topic_info.encoding; ecal_reg_sample_tdatatype.name = m_topic_info.name; ecal_reg_sample_tdatatype.descriptor = m_topic_info.descriptor; } ecal_reg_sample_topic.attr = m_attr; - ecal_reg_sample_topic.tsize = static_cast(m_topic_size); + ecal_reg_sample_topic.topic_size = static_cast(m_topic_size); #if ECAL_CORE_TRANSPORT_UDP // udp multicast layer @@ -651,7 +651,7 @@ namespace eCAL udp_tlayer.version = ecal_transport_layer_version; udp_tlayer.enabled = m_layers.udp.read_enabled; udp_tlayer.active = m_layers.udp.active; - ecal_reg_sample_topic.tlayer.push_back(udp_tlayer); + ecal_reg_sample_topic.transport_layer.push_back(udp_tlayer); } #endif @@ -663,7 +663,7 @@ namespace eCAL shm_tlayer.version = ecal_transport_layer_version; shm_tlayer.enabled = m_layers.shm.read_enabled; shm_tlayer.active = m_layers.shm.active; - ecal_reg_sample_topic.tlayer.push_back(shm_tlayer); + ecal_reg_sample_topic.transport_layer.push_back(shm_tlayer); } #endif @@ -675,19 +675,19 @@ namespace eCAL tcp_tlayer.version = ecal_transport_layer_version; tcp_tlayer.enabled = m_layers.tcp.read_enabled; tcp_tlayer.active = m_layers.tcp.active; - ecal_reg_sample_topic.tlayer.push_back(tcp_tlayer); + ecal_reg_sample_topic.transport_layer.push_back(tcp_tlayer); } #endif - ecal_reg_sample_topic.pname = m_attributes.process_name; - ecal_reg_sample_topic.uname = m_attributes.unit_name; - ecal_reg_sample_topic.dclock = m_clock; - ecal_reg_sample_topic.dfreq = GetFrequency(); - ecal_reg_sample_topic.message_drops = static_cast(m_message_drops); + ecal_reg_sample_topic.process_name = m_attributes.process_name; + ecal_reg_sample_topic.unit_name = m_attributes.unit_name; + ecal_reg_sample_topic.data_clock = m_clock; + ecal_reg_sample_topic.data_frequency = GetFrequency(); + ecal_reg_sample_topic.message_drops = static_cast(m_message_drops); // we do not know the number of connections .. - ecal_reg_sample_topic.connections_loc = 0; - ecal_reg_sample_topic.connections_ext = 0; + ecal_reg_sample_topic.connections_local = 0; + ecal_reg_sample_topic.connections_external = 0; } void CSubscriberImpl::GetUnregistrationSample(Registration::Sample& ecal_unreg_sample) @@ -696,14 +696,14 @@ namespace eCAL auto& ecal_reg_sample_identifier = ecal_unreg_sample.identifier; ecal_reg_sample_identifier.process_id = m_attributes.process_id; - ecal_reg_sample_identifier.entity_id = m_topic_id; - ecal_reg_sample_identifier.host_name = m_attributes.host_name; + ecal_reg_sample_identifier.entity_id = m_topic_id; + ecal_reg_sample_identifier.host_name = m_attributes.host_name; auto& ecal_reg_sample_topic = ecal_unreg_sample.topic; ecal_reg_sample_topic.shm_transport_domain = m_attributes.shm_transport_domain; - ecal_reg_sample_topic.pname = m_attributes.process_name; - ecal_reg_sample_topic.tname = m_attributes.topic_name; - ecal_reg_sample_topic.uname = m_attributes.unit_name; + ecal_reg_sample_topic.process_name = m_attributes.process_name; + ecal_reg_sample_topic.topic_name = m_attributes.topic_name; + ecal_reg_sample_topic.unit_name = m_attributes.unit_name; } void CSubscriberImpl::StartTransportLayer() diff --git a/ecal/core/src/readwrite/shm/ecal_reader_shm.cpp b/ecal/core/src/readwrite/shm/ecal_reader_shm.cpp index 85b96c1757..1a6164785d 100644 --- a/ecal/core/src/readwrite/shm/ecal_reader_shm.cpp +++ b/ecal/core/src/readwrite/shm/ecal_reader_shm.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,10 +54,10 @@ namespace eCAL const std::string memfile_event = memfile_name + "_" + process_id; Payload::TopicInfo topic_info; - topic_info.tname = par_.topic_name; - topic_info.hname = par_.host_name; - topic_info.tid = par_.topic_id; - topic_info.pid = par_.process_id; + topic_info.topic_name = par_.topic_name; + topic_info.host_name = par_.host_name; + topic_info.topic_id = par_.topic_id; + topic_info.process_id = par_.process_id; auto data_callback = [this, topic_info](const char* buf_, size_t len_, long long id_, long long clock_, long long time_, size_t hash_)->size_t { diff --git a/ecal/core/src/readwrite/tcp/ecal_writer_tcp.cpp b/ecal/core/src/readwrite/tcp/ecal_writer_tcp.cpp index 816a9b25ed..6613c8d568 100644 --- a/ecal/core/src/readwrite/tcp/ecal_writer_tcp.cpp +++ b/ecal/core/src/readwrite/tcp/ecal_writer_tcp.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,8 +76,8 @@ namespace eCAL // create new payload sample (header information only, no payload) Payload::Sample proto_header; auto& proto_header_topic = proto_header.topic_info; - proto_header_topic.tname = m_attributes.topic_name; - proto_header_topic.tid = m_attributes.topic_id; + proto_header_topic.topic_name = m_attributes.topic_name; + proto_header_topic.topic_id = m_attributes.topic_id; // set payload content (without payload) auto& proto_header_content = proto_header.content; diff --git a/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp b/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp index ea956daabc..a6a57e70ff 100644 --- a/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp +++ b/ecal/core/src/readwrite/udp/ecal_writer_udp.cpp @@ -68,9 +68,9 @@ namespace eCAL // fill sample info auto& ecal_sample_topic_info = ecal_sample.topic_info; - ecal_sample_topic_info.hname = m_attributes.host_name; - ecal_sample_topic_info.tname = m_attributes.topic_name; - ecal_sample_topic_info.tid = m_attributes.topic_id; + ecal_sample_topic_info.host_name = m_attributes.host_name; + ecal_sample_topic_info.topic_name = m_attributes.topic_name; + ecal_sample_topic_info.topic_id = m_attributes.topic_id; // append content auto& ecal_sample_content = ecal_sample.content; @@ -90,14 +90,14 @@ namespace eCAL { if (m_sample_sender_loopback) { - sent = m_sample_sender_loopback->Send(ecal_sample.topic_info.tname, m_sample_buffer); + sent = m_sample_sender_loopback->Send(ecal_sample.topic_info.topic_name, m_sample_buffer); } } else { if (m_sample_sender_no_loopback) { - sent = m_sample_sender_no_loopback->Send(ecal_sample.topic_info.tname, m_sample_buffer); + sent = m_sample_sender_no_loopback->Send(ecal_sample.topic_info.topic_name, m_sample_buffer); } } } diff --git a/ecal/core/src/registration/ecal_process_registration.cpp b/ecal/core/src/registration/ecal_process_registration.cpp index 8dbf093062..5c27df9117 100644 --- a/ecal/core/src/registration/ecal_process_registration.cpp +++ b/ecal/core/src/registration/ecal_process_registration.cpp @@ -38,45 +38,45 @@ eCAL::Registration::Sample eCAL::Registration::GetProcessRegisterSample() auto& process_sample_identifier = process_sample.identifier; process_sample_identifier.host_name = eCAL::Process::GetHostName(); process_sample_identifier.process_id = eCAL::Process::GetProcessID(); - // We need to set the pid as entity_id. + // We need to set the process_id as entity_id. // However, we cannot send anything over the wire :( process_sample_identifier.entity_id = process_sample_identifier.process_id; auto& process_sample_process = process_sample.process; process_sample_process.shm_transport_domain = eCAL::Process::GetShmTransportDomain(); - process_sample_process.pname = eCAL::Process::GetProcessName(); - process_sample_process.uname = eCAL::Process::GetUnitName(); - process_sample_process.pparam = eCAL::Process::GetProcessParameter(); + process_sample_process.process_name = eCAL::Process::GetProcessName(); + process_sample_process.unit_name = eCAL::Process::GetUnitName(); + process_sample_process.process_parameter = eCAL::Process::GetProcessParameter(); process_sample_process.state.severity = static_cast(g_process_severity); process_sample_process.state.severity_level = static_cast(g_process_severity_level); process_sample_process.state.info = g_process_info; #if ECAL_CORE_TIMEPLUGIN if (g_timegate() == nullptr) { - process_sample_process.tsync_state = Registration::eTSyncState::tsync_none; + process_sample_process.time_sync_state = Registration::eTimeSyncState::tsync_none; } else { if (!g_timegate()->IsSynchronized()) { - process_sample_process.tsync_state = Registration::eTSyncState::tsync_none; + process_sample_process.time_sync_state = Registration::eTimeSyncState::tsync_none; } else { switch (g_timegate()->GetSyncMode()) { case CTimeGate::eTimeSyncMode::realtime: - process_sample_process.tsync_state = Registration::eTSyncState::tsync_realtime; + process_sample_process.time_sync_state = Registration::eTimeSyncState::tsync_realtime; break; case CTimeGate::eTimeSyncMode::replay: - process_sample_process.tsync_state = Registration::eTSyncState::tsync_replay; + process_sample_process.time_sync_state = Registration::eTimeSyncState::tsync_replay; break; default: - process_sample_process.tsync_state = Registration::eTSyncState::tsync_none; + process_sample_process.time_sync_state = Registration::eTimeSyncState::tsync_none; break; } } - process_sample_process.tsync_mod_name = g_timegate()->GetName(); + process_sample_process.time_sync_module_name = g_timegate()->GetName(); } #endif @@ -103,12 +103,12 @@ eCAL::Registration::Sample eCAL::Registration::GetProcessUnregisterSample() process_sample.cmd_type = bct_unreg_process; auto& process_sample_identifier = process_sample.identifier; - process_sample_identifier.host_name = eCAL::Process::GetHostName(); + process_sample_identifier.host_name = eCAL::Process::GetHostName(); process_sample_identifier.process_id = eCAL::Process::GetProcessID(); auto& process_sample_process = process_sample.process; - process_sample_process.pname = eCAL::Process::GetProcessName(); - process_sample_process.uname = eCAL::Process::GetUnitName(); + process_sample_process.process_name = eCAL::Process::GetProcessName(); + process_sample_process.unit_name = eCAL::Process::GetUnitName(); return process_sample; } diff --git a/ecal/core/src/registration/ecal_registration_sample_applier.cpp b/ecal/core/src/registration/ecal_registration_sample_applier.cpp index f24287fe2d..4c5459907f 100644 --- a/ecal/core/src/registration/ecal_registration_sample_applier.cpp +++ b/ecal/core/src/registration/ecal_registration_sample_applier.cpp @@ -68,8 +68,8 @@ namespace eCAL bool CSampleApplier::IsSameProcess(const Registration::Sample& sample_) const { // is this actually sufficient? should we also check host_name? - const int32_t pid = sample_.identifier.process_id; - return pid == m_attributes.process_id; + const int32_t process_id = sample_.identifier.process_id; + return process_id == m_attributes.process_id; } bool CSampleApplier::IsSameHost(const Registration::Sample& sample_) const diff --git a/ecal/core/src/registration/ecal_registration_timeout_provider.cpp b/ecal/core/src/registration/ecal_registration_timeout_provider.cpp index 1769b35e43..cf94cc1c4d 100644 --- a/ecal/core/src/registration/ecal_registration_timeout_provider.cpp +++ b/ecal/core/src/registration/ecal_registration_timeout_provider.cpp @@ -51,9 +51,9 @@ namespace eCAL if (IsProcessRegistration(unregister_sample)) { const auto& sample_process = sample_.process; - auto& unregister_sample_process = unregister_sample.process; - unregister_sample_process.pname = sample_process.pname; - unregister_sample_process.uname = sample_process.uname; + auto& unregister_sample_process = unregister_sample.process; + unregister_sample_process.process_name = sample_process.process_name; + unregister_sample_process.unit_name = sample_process.unit_name; } if (IsTopicRegistration(unregister_sample)) @@ -61,19 +61,19 @@ namespace eCAL const auto& sample_topic = sample_.topic; auto& unregister_sample_topic = unregister_sample.topic; unregister_sample_topic.shm_transport_domain = sample_topic.shm_transport_domain; - unregister_sample_topic.pname = sample_topic.pname; - unregister_sample_topic.tname = sample_topic.tname; - unregister_sample_topic.uname = sample_topic.uname; + unregister_sample_topic.process_name = sample_topic.process_name; + unregister_sample_topic.topic_name = sample_topic.topic_name; + unregister_sample_topic.unit_name = sample_topic.unit_name; } if (unregister_sample.cmd_type == bct_unreg_service) { const auto& sample_service = sample_.service; auto& unregister_sample_service = unregister_sample.service; - unregister_sample_service.pname = sample_service.pname; - unregister_sample_service.sname = sample_service.sname; - unregister_sample_service.uname = sample_service.uname; - unregister_sample_service.version = sample_service.version; + unregister_sample_service.process_name = sample_service.process_name; + unregister_sample_service.service_name = sample_service.service_name; + unregister_sample_service.unit_name = sample_service.unit_name; + unregister_sample_service.version = sample_service.version; } if (unregister_sample.cmd_type == bct_unreg_client) @@ -81,10 +81,10 @@ namespace eCAL const auto& sample_client = sample_.client; auto& unregister_sample_client = unregister_sample.client; - unregister_sample_client.pname = sample_client.pname; - unregister_sample_client.sname = sample_client.sname; - unregister_sample_client.uname = sample_client.uname; - unregister_sample_client.version = sample_client.version; + unregister_sample_client.process_name = sample_client.process_name; + unregister_sample_client.service_name = sample_client.service_name; + unregister_sample_client.unit_name = sample_client.unit_name; + unregister_sample_client.version = sample_client.version; } return unregister_sample; } diff --git a/ecal/core/src/serialization/ecal_serialize_common.cpp b/ecal/core/src/serialization/ecal_serialize_common.cpp index f35daa2180..5d5d94a3fe 100644 --- a/ecal/core/src/serialization/ecal_serialize_common.cpp +++ b/ecal/core/src/serialization/ecal_serialize_common.cpp @@ -301,8 +301,8 @@ namespace eCAL return false; } - eCAL_pb_TLayer pb_layer = eCAL_pb_TLayer_init_default; - pb_layer.type = static_cast(layer.type); + eCAL_pb_TransportLayer pb_layer = eCAL_pb_TransportLayer_init_default; + pb_layer.type = static_cast(layer.type); pb_layer.version = layer.version; pb_layer.enabled = layer.enabled; pb_layer.active = layer.active; @@ -322,7 +322,7 @@ namespace eCAL pb_layer.par_layer.layer_par_shm.memory_file_list.funcs.encode = &encode_string_vector_field; // NOLINT(*-pro-type-union-access) pb_layer.par_layer.layer_par_shm.memory_file_list.arg = (void*)(&layer.par_layer.layer_par_shm.memory_file_list); - if (!pb_encode_submessage(stream, eCAL_pb_TLayer_fields, &pb_layer)) + if (!pb_encode_submessage(stream, eCAL_pb_TransportLayer_fields, &pb_layer)) { return false; } @@ -342,7 +342,7 @@ namespace eCAL if (arg == nullptr) return false; if (*arg == nullptr) return false; - eCAL_pb_TLayer pb_layer = eCAL_pb_TLayer_init_default; + eCAL_pb_TransportLayer pb_layer = eCAL_pb_TransportLayer_init_default; auto* tgt_vector = static_cast*>(*arg); auto& layer = tgt_vector->push_back(); @@ -350,7 +350,7 @@ namespace eCAL pb_layer.par_layer.layer_par_shm.memory_file_list.funcs.decode = &decode_string_vector_field; // NOLINT(*-pro-type-union-access) pb_layer.par_layer.layer_par_shm.memory_file_list.arg = (void*)(&layer.par_layer.layer_par_shm.memory_file_list); - if (!pb_decode(stream, eCAL_pb_TLayer_fields, &pb_layer)) + if (!pb_decode(stream, eCAL_pb_TransportLayer_fields, &pb_layer)) { return false; } @@ -391,21 +391,21 @@ namespace eCAL } eCAL_pb_Method pb_method = eCAL_pb_Method_init_default; - encode_string(pb_method.mname, method.mname); + encode_string(pb_method.method_name, method.method_name); encode_string(pb_method.req_type, method.req_type); encode_string(pb_method.resp_type, method.resp_type); encode_string(pb_method.req_desc, method.req_desc); encode_string(pb_method.resp_desc, method.resp_desc); - pb_method.has_req_datatype = true; - encode_string(pb_method.req_datatype.name, method.req_datatype.name); - encode_string(pb_method.req_datatype.encoding, method.req_datatype.encoding); - encode_string(pb_method.req_datatype.desc, method.req_datatype.descriptor); + pb_method.has_request_datatype_information = true; + encode_string(pb_method.request_datatype_information.name, method.request_datatype_information.name); + encode_string(pb_method.request_datatype_information.encoding, method.request_datatype_information.encoding); + encode_string(pb_method.request_datatype_information.descriptor_information, method.request_datatype_information.descriptor); - pb_method.has_resp_datatype = true; - encode_string(pb_method.resp_datatype.name, method.resp_datatype.name); - encode_string(pb_method.resp_datatype.encoding, method.resp_datatype.encoding); - encode_string(pb_method.resp_datatype.desc, method.resp_datatype.descriptor); + pb_method.has_response_datatype_information = true; + encode_string(pb_method.response_datatype_information.name, method.response_datatype_information.name); + encode_string(pb_method.response_datatype_information.encoding, method.response_datatype_information.encoding); + encode_string(pb_method.response_datatype_information.descriptor_information, method.response_datatype_information.descriptor); pb_method.call_count = method.call_count; @@ -434,19 +434,19 @@ namespace eCAL auto& method = method_vec->push_back(); // decode method parameter - decode_string(pb_method.mname, method.mname); + decode_string(pb_method.method_name, method.method_name); decode_string(pb_method.req_type, method.req_type); decode_string(pb_method.req_desc, method.req_desc); decode_string(pb_method.resp_type, method.resp_type); decode_string(pb_method.resp_desc, method.resp_desc); - decode_string(pb_method.req_datatype.name, method.req_datatype.name); - decode_string(pb_method.req_datatype.encoding, method.req_datatype.encoding); - decode_string(pb_method.req_datatype.desc, method.req_datatype.descriptor); + decode_string(pb_method.request_datatype_information.name, method.request_datatype_information.name); + decode_string(pb_method.request_datatype_information.encoding, method.request_datatype_information.encoding); + decode_string(pb_method.request_datatype_information.descriptor_information, method.request_datatype_information.descriptor); - decode_string(pb_method.resp_datatype.name, method.resp_datatype.name); - decode_string(pb_method.resp_datatype.encoding, method.resp_datatype.encoding); - decode_string(pb_method.resp_datatype.desc, method.resp_datatype.descriptor); + decode_string(pb_method.response_datatype_information.name, method.response_datatype_information.name); + decode_string(pb_method.response_datatype_information.encoding, method.response_datatype_information.encoding); + decode_string(pb_method.response_datatype_information.descriptor_information, method.response_datatype_information.descriptor); // decode it if (!pb_decode(stream, eCAL_pb_Method_fields, &pb_method)) diff --git a/ecal/core/src/serialization/ecal_serialize_logging.cpp b/ecal/core/src/serialization/ecal_serialize_logging.cpp index fd7538d815..49e3442b51 100644 --- a/ecal/core/src/serialization/ecal_serialize_logging.cpp +++ b/ecal/core/src/serialization/ecal_serialize_logging.cpp @@ -44,14 +44,14 @@ namespace { // time pb_log_message_.time = log_message_.time; - // hname - eCAL::nanopb::encode_string(pb_log_message_.hname, log_message_.hname); - // pid - pb_log_message_.pid = log_message_.pid; - // pname - eCAL::nanopb::encode_string(pb_log_message_.pname, log_message_.pname); - // uname - eCAL::nanopb::encode_string(pb_log_message_.uname, log_message_.uname); + // host_name + eCAL::nanopb::encode_string(pb_log_message_.host_name, log_message_.host_name); + // process_id + pb_log_message_.process_id = log_message_.process_id; + // process_name + eCAL::nanopb::encode_string(pb_log_message_.process_name, log_message_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_log_message_.unit_name, log_message_.unit_name); // level pb_log_message_.level = log_message_.level; // content @@ -113,12 +113,12 @@ namespace // assign decoder /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_log_message_.hname, log_message_.hname); - // pname - eCAL::nanopb::decode_string(pb_log_message_.pname, log_message_.pname); - // uname - eCAL::nanopb::decode_string(pb_log_message_.uname, log_message_.uname); + // host_name + eCAL::nanopb::decode_string(pb_log_message_.host_name, log_message_.host_name); + // process_name + eCAL::nanopb::decode_string(pb_log_message_.process_name, log_message_.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_log_message_.unit_name, log_message_.unit_name); // content eCAL::nanopb::decode_string(pb_log_message_.content, log_message_.content); } @@ -130,8 +130,8 @@ namespace /////////////////////////////////////////////// // time log_message_.time = pb_log_message_.time; - // pid - log_message_.pid = pb_log_message_.pid; + // process_id + log_message_.process_id = pb_log_message_.process_id; // level log_message_.level = static_cast(pb_log_message_.level); } diff --git a/ecal/core/src/serialization/ecal_serialize_monitoring.cpp b/ecal/core/src/serialization/ecal_serialize_monitoring.cpp index c18a992a85..33a57d34de 100644 --- a/ecal/core/src/serialization/ecal_serialize_monitoring.cpp +++ b/ecal/core/src/serialization/ecal_serialize_monitoring.cpp @@ -43,20 +43,20 @@ namespace /////////////////////////////////////////////// // process information /////////////////////////////////////////////// - // rclock - pb_process_.rclock = process_.rclock; - // hname - eCAL::nanopb::encode_string(pb_process_.hname, process_.hname); + // registration_clock + pb_process_.registration_clock = process_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_process_.host_name, process_.host_name); // shm_transport_domain eCAL::nanopb::encode_string(pb_process_.shm_transport_domain, process_.shm_transport_domain); - // pid - pb_process_.pid = process_.pid; - // pname - eCAL::nanopb::encode_string(pb_process_.pname, process_.pname); - // uname - eCAL::nanopb::encode_string(pb_process_.uname, process_.uname); - // pparam - eCAL::nanopb::encode_string(pb_process_.pparam, process_.pparam); + // process_id + pb_process_.process_id = process_.process_id; + // process_name + eCAL::nanopb::encode_string(pb_process_.process_name, process_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_process_.unit_name, process_.unit_name); + // process_parameter + eCAL::nanopb::encode_string(pb_process_.process_parameter, process_.process_parameter); // state pb_process_.has_state = true; // state.severity @@ -65,10 +65,10 @@ namespace pb_process_.state.severity_level = static_cast(process_.state_severity_level); // state.info eCAL::nanopb::encode_string(pb_process_.state.info, process_.state_info); - // process.tsync_state - pb_process_.tsync_state = static_cast(process_.tsync_state); - // tsync_mod_name - eCAL::nanopb::encode_string(pb_process_.tsync_mod_name, process_.tsync_mod_name); + // process.time_sync_state + pb_process_.time_sync_state = static_cast(process_.time_sync_state); + // time_sync_module_name + eCAL::nanopb::encode_string(pb_process_.time_sync_module_name, process_.time_sync_module_name); // component_init_state pb_process_.component_init_state = process_.component_init_state; // component_init_info @@ -116,7 +116,7 @@ namespace if (arg == nullptr) return false; if (*arg == nullptr) return false; - auto* layer_vec = static_cast*>(*arg); + auto* layer_vec = static_cast*>(*arg); for (auto layer : *layer_vec) { @@ -125,12 +125,12 @@ namespace return false; } - eCAL_pb_TLayer pb_layer = eCAL_pb_TLayer_init_default; - pb_layer.type = static_cast(layer.type); + eCAL_pb_TransportLayer pb_layer = eCAL_pb_TransportLayer_init_default; + pb_layer.type = static_cast(layer.type); pb_layer.version = layer.version; pb_layer.active = layer.active; - if (!pb_encode_submessage(stream, eCAL_pb_TLayer_fields, &pb_layer)) + if (!pb_encode_submessage(stream, eCAL_pb_TransportLayer_fields, &pb_layer)) { return false; } @@ -139,7 +139,7 @@ namespace return true; } - void encode_mon_registration_layer(pb_callback_t& pb_callback, const std::vector& layer_vec) + void encode_mon_registration_layer(pb_callback_t& pb_callback, const std::vector& layer_vec) { pb_callback.funcs.encode = &encode_mon_registration_layer_field; // NOLINT(*-pro-type-union-access) pb_callback.arg = (void*)(&layer_vec); @@ -147,48 +147,48 @@ namespace void PrepareEncoding(const eCAL::Monitoring::STopicMon& topic_, eCAL_pb_Topic& pb_topic_) { - // rclock - pb_topic_.rclock = topic_.rclock; - // hname - eCAL::nanopb::encode_string(pb_topic_.hname, topic_.hname); + // registration_clock + pb_topic_.registration_clock = topic_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_topic_.host_name, topic_.host_name); // shm_transport_domain eCAL::nanopb::encode_string(pb_topic_.shm_transport_domain, topic_.shm_transport_domain); - // pid - pb_topic_.pid = topic_.pid; - // pname - eCAL::nanopb::encode_string(pb_topic_.pname, topic_.pname); - // uname - eCAL::nanopb::encode_string(pb_topic_.uname, topic_.uname); - // tid - eCAL::nanopb::encode_int_to_string(pb_topic_.tid, topic_.tid); - // tname - eCAL::nanopb::encode_string(pb_topic_.tname, topic_.tname); + // process_id + pb_topic_.process_id = topic_.process_id; + // process_name + eCAL::nanopb::encode_string(pb_topic_.process_name, topic_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_topic_.unit_name, topic_.unit_name); + // topic_id + eCAL::nanopb::encode_int_to_string(pb_topic_.topic_id, topic_.topic_id); + // topic_name + eCAL::nanopb::encode_string(pb_topic_.topic_name, topic_.topic_name); // direction eCAL::nanopb::encode_string(pb_topic_.direction, topic_.direction); - // tdatatype - pb_topic_.has_tdatatype = true; - // tdatatype.name - eCAL::nanopb::encode_string(pb_topic_.tdatatype.name, topic_.tdatatype.name); - // tdatatype.encoding - eCAL::nanopb::encode_string(pb_topic_.tdatatype.encoding, topic_.tdatatype.encoding); - // tdatatype.desc - eCAL::nanopb::encode_string(pb_topic_.tdatatype.desc, topic_.tdatatype.descriptor); - // tsize - pb_topic_.tsize = topic_.tsize; - // connections_loc - pb_topic_.connections_loc = topic_.connections_loc; - // connections_ext - pb_topic_.connections_ext = topic_.connections_ext; + // datatype_information + pb_topic_.has_datatype_information = true; + // datatype_information.name + eCAL::nanopb::encode_string(pb_topic_.datatype_information.name, topic_.datatype_information.name); + // datatype_information.encoding + eCAL::nanopb::encode_string(pb_topic_.datatype_information.encoding, topic_.datatype_information.encoding); + // datatype_information.descriptor + eCAL::nanopb::encode_string(pb_topic_.datatype_information.descriptor_information, topic_.datatype_information.descriptor); + // topic_size + pb_topic_.topic_size = topic_.topic_size; + // connections_local + pb_topic_.connections_local = topic_.connections_local; + // connections_external + pb_topic_.connections_external = topic_.connections_external; // message_drops pb_topic_.message_drops = topic_.message_drops; - // did - pb_topic_.did = topic_.did; - // dclock - pb_topic_.dclock = topic_.dclock; - // dfreq - pb_topic_.dfreq = topic_.dfreq; - // tlayer - encode_mon_registration_layer(pb_topic_.tlayer, topic_.tlayer); + // data_id + pb_topic_.data_id = topic_.data_id; + // data_clock + pb_topic_.data_clock = topic_.data_clock; + // data_frequency + pb_topic_.data_frequency = topic_.data_frequency; + // transport_layer + encode_mon_registration_layer(pb_topic_.transport_layer, topic_.transport_layer); // attr eCAL::nanopb::encode_map(pb_topic_.attr, topic_.attr); } @@ -265,17 +265,17 @@ namespace } eCAL_pb_Method pb_method = eCAL_pb_Method_init_default; - eCAL::nanopb::encode_string(pb_method.mname, method.mname); + eCAL::nanopb::encode_string(pb_method.method_name, method.method_name); - pb_method.has_req_datatype = true; - eCAL::nanopb::encode_string(pb_method.req_datatype.name, method.req_datatype.name); - eCAL::nanopb::encode_string(pb_method.req_datatype.encoding, method.req_datatype.encoding); - eCAL::nanopb::encode_string(pb_method.req_datatype.desc, method.req_datatype.descriptor); + pb_method.has_request_datatype_information = true; + eCAL::nanopb::encode_string(pb_method.request_datatype_information.name, method.request_datatype_information.name); + eCAL::nanopb::encode_string(pb_method.request_datatype_information.encoding, method.request_datatype_information.encoding); + eCAL::nanopb::encode_string(pb_method.request_datatype_information.descriptor_information, method.request_datatype_information.descriptor); - pb_method.has_resp_datatype = true; - eCAL::nanopb::encode_string(pb_method.resp_datatype.name, method.resp_datatype.name); - eCAL::nanopb::encode_string(pb_method.resp_datatype.encoding, method.resp_datatype.encoding); - eCAL::nanopb::encode_string(pb_method.resp_datatype.desc, method.resp_datatype.descriptor); + pb_method.has_response_datatype_information = true; + eCAL::nanopb::encode_string(pb_method.response_datatype_information.name, method.response_datatype_information.name); + eCAL::nanopb::encode_string(pb_method.response_datatype_information.encoding, method.response_datatype_information.encoding); + eCAL::nanopb::encode_string(pb_method.response_datatype_information.descriptor_information, method.response_datatype_information.descriptor); pb_method.call_count = method.call_count; @@ -299,20 +299,20 @@ namespace /////////////////////////////////////////////// // service information /////////////////////////////////////////////// - // rclock - pb_service_.rclock = service_.rclock; - // hname - eCAL::nanopb::encode_string(pb_service_.hname, service_.hname); - // pname - eCAL::nanopb::encode_string(pb_service_.pname, service_.pname); - // uname - eCAL::nanopb::encode_string(pb_service_.uname, service_.uname); - // pid - pb_service_.pid = service_.pid; - // sname - eCAL::nanopb::encode_string(pb_service_.sname, service_.sname); - // sid - eCAL::nanopb::encode_int_to_string(pb_service_.sid, service_.sid); + // registration_clock + pb_service_.registration_clock = service_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_service_.host_name, service_.host_name); + // process_name + eCAL::nanopb::encode_string(pb_service_.process_name, service_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_service_.unit_name, service_.unit_name); + // process_id + pb_service_.process_id = service_.process_id; + // service_name + eCAL::nanopb::encode_string(pb_service_.service_name, service_.service_name); + // service_id + eCAL::nanopb::encode_int_to_string(pb_service_.service_id, service_.service_id); // methods encode_mon_service_methods(pb_service_.methods, service_.methods); // version @@ -360,20 +360,20 @@ namespace /////////////////////////////////////////////// // client information /////////////////////////////////////////////// - // rclock - pb_client_.rclock = client_.rclock; - // hname - eCAL::nanopb::encode_string(pb_client_.hname, client_.hname); - // pname - eCAL::nanopb::encode_string(pb_client_.pname, client_.pname); - // uname - eCAL::nanopb::encode_string(pb_client_.uname, client_.uname); - // pid - pb_client_.pid = client_.pid; - // sname - eCAL::nanopb::encode_string(pb_client_.sname, client_.sname); - // sid - eCAL::nanopb::encode_int_to_string(pb_client_.sid, client_.sid); + // registration_clock + pb_client_.registration_clock = client_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_client_.host_name, client_.host_name); + // process_name + eCAL::nanopb::encode_string(pb_client_.process_name, client_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_client_.unit_name, client_.unit_name); + // process_id + pb_client_.process_id = client_.process_id; + // service_name + eCAL::nanopb::encode_string(pb_client_.service_name, client_.service_name); + // service_id + eCAL::nanopb::encode_int_to_string(pb_client_.service_id, client_.service_id); // methods encode_mon_service_methods(pb_client_.methods, client_.methods); // version @@ -496,20 +496,20 @@ namespace /////////////////////////////////////////////// // assign decoder /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_process_.hname, process_.hname); + // host_name + eCAL::nanopb::decode_string(pb_process_.host_name, process_.host_name); // shm_transport_domain eCAL::nanopb::decode_string(pb_process_.shm_transport_domain, process_.shm_transport_domain); - // pname - eCAL::nanopb::decode_string(pb_process_.pname, process_.pname); - // uname - eCAL::nanopb::decode_string(pb_process_.uname, process_.uname); - // pparam - eCAL::nanopb::decode_string(pb_process_.pparam, process_.pparam); + // process_name + eCAL::nanopb::decode_string(pb_process_.process_name, process_.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_process_.unit_name, process_.unit_name); + // process_parameter + eCAL::nanopb::decode_string(pb_process_.process_parameter, process_.process_parameter); // state.info eCAL::nanopb::decode_string(pb_process_.state.info, process_.state_info); - // tsync_mod_name - eCAL::nanopb::decode_string(pb_process_.tsync_mod_name, process_.tsync_mod_name); + // time_sync_module_name + eCAL::nanopb::decode_string(pb_process_.time_sync_module_name, process_.time_sync_module_name); // component_init_info eCAL::nanopb::decode_string(pb_process_.component_init_info, process_.component_init_info); // ecal_runtime_version @@ -523,16 +523,16 @@ namespace /////////////////////////////////////////////// // assign values /////////////////////////////////////////////// - // rclock - process_.rclock = pb_process_.rclock; - // pid - process_.pid = pb_process_.pid; + // registration_clock + process_.registration_clock = pb_process_.registration_clock; + // process_id + process_.process_id = pb_process_.process_id; // state.severity process_.state_severity = pb_process_.state.severity; // state.severity_level process_.state_severity_level = pb_process_.state.severity_level; - // tsync_state - process_.tsync_state = pb_process_.tsync_state; + // time_sync_state + process_.time_sync_state = pb_process_.time_sync_state; // component_init_state process_.component_init_state = pb_process_.component_init_state; } @@ -572,27 +572,27 @@ namespace if (arg == nullptr) return false; if (*arg == nullptr) return false; - eCAL_pb_TLayer pb_layer = eCAL_pb_TLayer_init_default; - eCAL::Monitoring::TLayer layer{}; + eCAL_pb_TransportLayer pb_layer = eCAL_pb_TransportLayer_init_default; + eCAL::Monitoring::STransportLayer layer{}; - if (!pb_decode(stream, eCAL_pb_TLayer_fields, &pb_layer)) + if (!pb_decode(stream, eCAL_pb_TransportLayer_fields, &pb_layer)) { return false; } // apply layer values - layer.type = static_cast(pb_layer.type); + layer.type = static_cast(pb_layer.type); layer.version = pb_layer.version; layer.active = pb_layer.active; // add layer - auto* tgt_vector = static_cast*>(*arg); + auto* tgt_vector = static_cast*>(*arg); tgt_vector->push_back(layer); return true; } - void decode_mon_registration_layer(pb_callback_t& pb_callback, std::vector& layer_vec) + void decode_mon_registration_layer(pb_callback_t& pb_callback, std::vector& layer_vec) { pb_callback.funcs.decode = &decode_mon_registration_layer_field; // NOLINT(*-pro-type-union-access) pb_callback.arg = &layer_vec; @@ -606,28 +606,28 @@ namespace /////////////////////////////////////////////// // assign decoder /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_topic_.hname, topic_.hname); + // host_name + eCAL::nanopb::decode_string(pb_topic_.host_name, topic_.host_name); // shm_transport_domain eCAL::nanopb::decode_string(pb_topic_.shm_transport_domain, topic_.shm_transport_domain); - // pname - eCAL::nanopb::decode_string(pb_topic_.pname, topic_.pname); - // uname - eCAL::nanopb::decode_string(pb_topic_.uname, topic_.uname); - // tid - eCAL::nanopb::decode_int_from_string(pb_topic_.tid, topic_.tid); - // tname - eCAL::nanopb::decode_string(pb_topic_.tname, topic_.tname); + // process_name + eCAL::nanopb::decode_string(pb_topic_.process_name, topic_.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_topic_.unit_name, topic_.unit_name); + // topic_id + eCAL::nanopb::decode_int_from_string(pb_topic_.topic_id, topic_.topic_id); + // topic_name + eCAL::nanopb::decode_string(pb_topic_.topic_name, topic_.topic_name); // direction eCAL::nanopb::decode_string(pb_topic_.direction, topic_.direction); - // tdatatype.name - eCAL::nanopb::decode_string(pb_topic_.tdatatype.name, topic_.tdatatype.name); - // tdatatype.encoding - eCAL::nanopb::decode_string(pb_topic_.tdatatype.encoding, topic_.tdatatype.encoding); - // tdatatype.desc - eCAL::nanopb::decode_string(pb_topic_.tdatatype.desc, topic_.tdatatype.descriptor); - // tlayer - decode_mon_registration_layer(pb_topic_.tlayer, topic_.tlayer); + // datatype_information.name + eCAL::nanopb::decode_string(pb_topic_.datatype_information.name, topic_.datatype_information.name); + // datatype_information.encoding + eCAL::nanopb::decode_string(pb_topic_.datatype_information.encoding, topic_.datatype_information.encoding); + // datatype_information.descriptor + eCAL::nanopb::decode_string(pb_topic_.datatype_information.descriptor_information, topic_.datatype_information.descriptor); + // transport_layer + decode_mon_registration_layer(pb_topic_.transport_layer, topic_.transport_layer); // attr eCAL::nanopb::decode_map(pb_topic_.attr, topic_.attr); } @@ -637,24 +637,24 @@ namespace /////////////////////////////////////////////// // assign values /////////////////////////////////////////////// - // rclock - topic_.rclock = pb_topic_.rclock; - // pid - topic_.pid = pb_topic_.pid; - // tsize - topic_.tsize = pb_topic_.tsize; - // connections_loc - topic_.connections_loc = pb_topic_.connections_loc; - // connections_ext - topic_.connections_ext = pb_topic_.connections_ext; + // registration_clock + topic_.registration_clock = pb_topic_.registration_clock; + // process_id + topic_.process_id = pb_topic_.process_id; + // topic_size + topic_.topic_size = pb_topic_.topic_size; + // connections_local + topic_.connections_local = pb_topic_.connections_local; + // connections_external + topic_.connections_external = pb_topic_.connections_external; // message_drops topic_.message_drops = pb_topic_.message_drops; - // did - topic_.did = pb_topic_.did; - // dclock - topic_.dclock = pb_topic_.dclock; - // dfreq - topic_.dfreq = pb_topic_.dfreq; + // data_id + topic_.data_id = pb_topic_.data_id; + // data_clock + topic_.data_clock = pb_topic_.data_clock; + // data_frequency + topic_.data_frequency = pb_topic_.data_frequency; } bool decode_topics_field(pb_istream_t* stream, const pb_field_iter_t* /*field*/, void** arg) @@ -703,15 +703,15 @@ namespace eCAL::Monitoring::SMethodMon method{}; // decode method parameter - eCAL::nanopb::decode_string(pb_method.mname, method.mname); + eCAL::nanopb::decode_string(pb_method.method_name, method.method_name); - eCAL::nanopb::decode_string(pb_method.req_datatype.name, method.req_datatype.name); - eCAL::nanopb::decode_string(pb_method.req_datatype.encoding, method.req_datatype.encoding); - eCAL::nanopb::decode_string(pb_method.req_datatype.desc, method.req_datatype.descriptor); + eCAL::nanopb::decode_string(pb_method.request_datatype_information.name, method.request_datatype_information.name); + eCAL::nanopb::decode_string(pb_method.request_datatype_information.encoding, method.request_datatype_information.encoding); + eCAL::nanopb::decode_string(pb_method.request_datatype_information.descriptor_information, method.request_datatype_information.descriptor); - eCAL::nanopb::decode_string(pb_method.resp_datatype.name, method.resp_datatype.name); - eCAL::nanopb::decode_string(pb_method.resp_datatype.encoding, method.resp_datatype.encoding); - eCAL::nanopb::decode_string(pb_method.resp_datatype.desc, method.resp_datatype.descriptor); + eCAL::nanopb::decode_string(pb_method.response_datatype_information.name, method.response_datatype_information.name); + eCAL::nanopb::decode_string(pb_method.response_datatype_information.encoding, method.response_datatype_information.encoding); + eCAL::nanopb::decode_string(pb_method.response_datatype_information.descriptor_information, method.response_datatype_information.descriptor); // decode it if (!pb_decode(stream, eCAL_pb_Method_fields, &pb_method)) @@ -743,16 +743,16 @@ namespace /////////////////////////////////////////////// // assign decoder /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_service_.hname, service_.hname); - // pname - eCAL::nanopb::decode_string(pb_service_.pname, service_.pname); - // uname - eCAL::nanopb::decode_string(pb_service_.uname, service_.uname); - // sname - eCAL::nanopb::decode_string(pb_service_.sname, service_.sname); - // sid - eCAL::nanopb::decode_int_from_string(pb_service_.sid, service_.sid); + // host_name + eCAL::nanopb::decode_string(pb_service_.host_name, service_.host_name); + // process_name + eCAL::nanopb::decode_string(pb_service_.process_name, service_.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_service_.unit_name, service_.unit_name); + // service_name + eCAL::nanopb::decode_string(pb_service_.service_name, service_.service_name); + // service_id + eCAL::nanopb::decode_int_from_string(pb_service_.service_id, service_.service_id); // methods decode_mon_service_methods(pb_service_.methods, service_.methods); } @@ -762,10 +762,10 @@ namespace /////////////////////////////////////////////// // assign values /////////////////////////////////////////////// - // rclock - service_.rclock = pb_service_.rclock; - // pid - service_.pid = pb_service_.pid; + // registration_clock + service_.registration_clock = pb_service_.registration_clock; + // process_id + service_.process_id = pb_service_.process_id; // version service_.version = pb_service_.version; // tcp_port_v0 @@ -812,16 +812,16 @@ namespace /////////////////////////////////////////////// // assign decoder /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_client_.hname, client_.hname); - // pname - eCAL::nanopb::decode_string(pb_client_.pname, client_.pname); - // uname - eCAL::nanopb::decode_string(pb_client_.uname, client_.uname); - // sname - eCAL::nanopb::decode_string(pb_client_.sname, client_.sname); - // sid - eCAL::nanopb::decode_int_from_string(pb_client_.sid, client_.sid); + // host_name + eCAL::nanopb::decode_string(pb_client_.host_name, client_.host_name); + // process_name + eCAL::nanopb::decode_string(pb_client_.process_name, client_.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_client_.unit_name, client_.unit_name); + // service_name + eCAL::nanopb::decode_string(pb_client_.service_name, client_.service_name); + // service_id + eCAL::nanopb::decode_int_from_string(pb_client_.service_id, client_.service_id); // methods decode_mon_service_methods(pb_client_.methods, client_.methods); } @@ -831,10 +831,10 @@ namespace /////////////////////////////////////////////// // assign values /////////////////////////////////////////////// - // rclock - client_.rclock = pb_client_.rclock; - // pid - client_.pid = pb_client_.pid; + // registration_clock + client_.registration_clock = pb_client_.registration_clock; + // process_id + client_.process_id = pb_client_.process_id; // version client_.version = pb_client_.version; } diff --git a/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp b/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp index f71eb7640b..b7aaba5b62 100644 --- a/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp +++ b/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp @@ -72,14 +72,14 @@ namespace // topic information pb_sample_.has_topic = true; - // hname - eCAL::nanopb::encode_string(pb_sample_.topic.hname, payload_.topic_info.hname); - // pid - pb_sample_.topic.pid = payload_.topic_info.pid; - // tid - eCAL::nanopb::encode_int_to_string(pb_sample_.topic.tid, payload_.topic_info.tid); - // tname - eCAL::nanopb::encode_string(pb_sample_.topic.tname, payload_.topic_info.tname); + // host_name + eCAL::nanopb::encode_string(pb_sample_.topic.host_name, payload_.topic_info.host_name); + // process_id + pb_sample_.topic.process_id = payload_.topic_info.process_id; + // topic_id + eCAL::nanopb::encode_int_to_string(pb_sample_.topic.topic_id, payload_.topic_info.topic_id); + // topic_name + eCAL::nanopb::encode_string(pb_sample_.topic.topic_name, payload_.topic_info.topic_name); // topic content pb_sample_.has_content = true; @@ -149,12 +149,12 @@ namespace /////////////////////////////////////////////// // assign decoder /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_sample.topic.hname, payload_.topic_info.hname); - // tid - eCAL::nanopb::decode_int_from_string(pb_sample.topic.tid, payload_.topic_info.tid); - // tname - eCAL::nanopb::decode_string(pb_sample.topic.tname, payload_.topic_info.tname); + // host_name + eCAL::nanopb::decode_string(pb_sample.topic.host_name, payload_.topic_info.host_name); + // topic_id + eCAL::nanopb::decode_int_from_string(pb_sample.topic.topic_id, payload_.topic_info.topic_id); + // topic_name + eCAL::nanopb::decode_string(pb_sample.topic.topic_name, payload_.topic_info.topic_name); // topic content payload payload_.content.payload.type = eCAL::Payload::pl_vec; eCAL::nanopb::decode_bytes(pb_sample.content.payload, payload_.content.payload.vec); @@ -179,8 +179,8 @@ namespace // command type payload_.cmd_type = static_cast(pb_sample.cmd_type); - // pid - payload_.topic_info.pid = pb_sample.topic.pid; + // process_id + payload_.topic_info.process_id = pb_sample.topic.process_id; // topic content payload_.content.id = pb_sample.content.id; diff --git a/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp b/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp index 16f52acac4..b9bea825f7 100644 --- a/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp +++ b/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp @@ -45,20 +45,20 @@ namespace { const auto& registration_process_ = registration_.process; const auto& registration_identifier_ = registration_.identifier; - // rclock - pb_process_.rclock = registration_process_.rclock; - // hname - eCAL::nanopb::encode_string(pb_process_.hname, registration_identifier_.host_name); + // registration_clock + pb_process_.registration_clock = registration_process_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_process_.host_name, registration_identifier_.host_name); // shm_transport_domain eCAL::nanopb::encode_string(pb_process_.shm_transport_domain, registration_process_.shm_transport_domain); - // pid - pb_process_.pid = registration_identifier_.process_id; - // pname - eCAL::nanopb::encode_string(pb_process_.pname, registration_process_.pname); - // uname - eCAL::nanopb::encode_string(pb_process_.uname, registration_process_.uname); - // pparam - eCAL::nanopb::encode_string(pb_process_.pparam, registration_process_.pparam); + // process_id + pb_process_.process_id = registration_identifier_.process_id; + // process_name + eCAL::nanopb::encode_string(pb_process_.process_name, registration_process_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_process_.unit_name, registration_process_.unit_name); + // process_parameter + eCAL::nanopb::encode_string(pb_process_.process_parameter, registration_process_.process_parameter); // state pb_process_.has_state = true; @@ -68,10 +68,10 @@ namespace pb_process_.state.severity_level = static_cast(registration_process_.state.severity_level); // state.info eCAL::nanopb::encode_string(pb_process_.state.info, registration_process_.state.info); - // process.tsync_state - pb_process_.tsync_state = static_cast(registration_process_.tsync_state); - // tsync_mod_name - eCAL::nanopb::encode_string(pb_process_.tsync_mod_name, registration_process_.tsync_mod_name); + // process.time_sync_state + pb_process_.time_sync_state = static_cast(registration_process_.time_sync_state); + // time_sync_module_name + eCAL::nanopb::encode_string(pb_process_.time_sync_module_name, registration_process_.time_sync_module_name); // component_init_state pb_process_.component_init_state = registration_process_.component_init_state; // component_init_info @@ -90,20 +90,20 @@ namespace const auto& registration_service_ = registration_.service; const auto& registration_identifier_ = registration_.identifier; - // rclock - pb_service_.rclock = registration_service_.rclock; - // hname - eCAL::nanopb::encode_string(pb_service_.hname, registration_identifier_.host_name); - // pname - eCAL::nanopb::encode_string(pb_service_.pname, registration_service_.pname); - // uname - eCAL::nanopb::encode_string(pb_service_.uname, registration_service_.uname); - // pid - pb_service_.pid = registration_identifier_.process_id; - // sname - eCAL::nanopb::encode_string(pb_service_.sname, registration_service_.sname); - // sid - eCAL::nanopb::encode_int_to_string(pb_service_.sid, registration_identifier_.entity_id); + // registration_clock + pb_service_.registration_clock = registration_service_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_service_.host_name, registration_identifier_.host_name); + // process_name + eCAL::nanopb::encode_string(pb_service_.process_name, registration_service_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_service_.unit_name, registration_service_.unit_name); + // process_id + pb_service_.process_id = registration_identifier_.process_id; + // service_name + eCAL::nanopb::encode_string(pb_service_.service_name, registration_service_.service_name); + // service_id + eCAL::nanopb::encode_int_to_string(pb_service_.service_id, registration_identifier_.entity_id); // methods eCAL::nanopb::encode_service_methods(pb_service_.methods, registration_service_.methods); // version @@ -122,20 +122,20 @@ namespace const auto& registration_client_ = registration_.client; const auto& registration_producer_ = registration_.identifier; - // rclock - pb_client_.rclock = registration_client_.rclock; - // hname - eCAL::nanopb::encode_string(pb_client_.hname, registration_producer_.host_name); - // pname - eCAL::nanopb::encode_string(pb_client_.pname, registration_client_.pname); - // uname - eCAL::nanopb::encode_string(pb_client_.uname, registration_client_.uname); - // pid - pb_client_.pid = registration_producer_.process_id; - // sname - eCAL::nanopb::encode_string(pb_client_.sname, registration_client_.sname); - // sid - eCAL::nanopb::encode_int_to_string(pb_client_.sid, registration_producer_.entity_id); + // registration_clock + pb_client_.registration_clock = registration_client_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_client_.host_name, registration_producer_.host_name); + // process_name + eCAL::nanopb::encode_string(pb_client_.process_name, registration_client_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_client_.unit_name, registration_client_.unit_name); + // process_id + pb_client_.process_id = registration_producer_.process_id; + // service_name + eCAL::nanopb::encode_string(pb_client_.service_name, registration_client_.service_name); + // service_id + eCAL::nanopb::encode_int_to_string(pb_client_.service_id, registration_producer_.entity_id); // methods eCAL::nanopb::encode_service_methods(pb_client_.methods, registration_client_.methods); // version @@ -150,48 +150,48 @@ namespace const auto& registration_identifier_ = registration_sample_.identifier; const auto& registration_topic_ = registration_sample_.topic; - // rclock - pb_topic_.rclock = registration_topic_.rclock; - // hname - eCAL::nanopb::encode_string(pb_topic_.hname, registration_identifier_.host_name); + // registration_clock + pb_topic_.registration_clock = registration_topic_.registration_clock; + // host_name + eCAL::nanopb::encode_string(pb_topic_.host_name, registration_identifier_.host_name); // shm_transport_domain eCAL::nanopb::encode_string(pb_topic_.shm_transport_domain, registration_topic_.shm_transport_domain); - // pid - pb_topic_.pid = registration_identifier_.process_id; - // pname - eCAL::nanopb::encode_string(pb_topic_.pname, registration_topic_.pname); - // uname - eCAL::nanopb::encode_string(pb_topic_.uname, registration_topic_.uname); - // tid - eCAL::nanopb::encode_int_to_string(pb_topic_.tid, registration_identifier_.entity_id); - // tname - eCAL::nanopb::encode_string(pb_topic_.tname, registration_topic_.tname); + // process_id + pb_topic_.process_id = registration_identifier_.process_id; + // process_name + eCAL::nanopb::encode_string(pb_topic_.process_name, registration_topic_.process_name); + // unit_name + eCAL::nanopb::encode_string(pb_topic_.unit_name, registration_topic_.unit_name); + // topic_id + eCAL::nanopb::encode_int_to_string(pb_topic_.topic_id, registration_identifier_.entity_id); + // topic_name + eCAL::nanopb::encode_string(pb_topic_.topic_name, registration_topic_.topic_name); // direction eCAL::nanopb::encode_string(pb_topic_.direction, registration_topic_.direction); - // tdatatype - pb_topic_.has_tdatatype = true; - // tdatatype.name - eCAL::nanopb::encode_string(pb_topic_.tdatatype.name, registration_topic_.tdatatype.name); - // tdatatype.encoding - eCAL::nanopb::encode_string(pb_topic_.tdatatype.encoding, registration_topic_.tdatatype.encoding); - // tdatatype.desc - eCAL::nanopb::encode_string(pb_topic_.tdatatype.desc, registration_topic_.tdatatype.descriptor); - // tsize - pb_topic_.tsize = registration_topic_.tsize; - // connections_loc - pb_topic_.connections_loc = registration_topic_.connections_loc; - // connections_ext - pb_topic_.connections_ext = registration_topic_.connections_ext; + // datatype_information + pb_topic_.has_datatype_information = true; + // datatype_information.name + eCAL::nanopb::encode_string(pb_topic_.datatype_information.name, registration_topic_.datatype_information.name); + // datatype_information.encoding + eCAL::nanopb::encode_string(pb_topic_.datatype_information.encoding, registration_topic_.datatype_information.encoding); + // datatype_information.descriptor + eCAL::nanopb::encode_string(pb_topic_.datatype_information.descriptor_information, registration_topic_.datatype_information.descriptor); + // topic_size + pb_topic_.topic_size = registration_topic_.topic_size; + // connections_local + pb_topic_.connections_local = registration_topic_.connections_local; + // connections_external + pb_topic_.connections_external = registration_topic_.connections_external; // message_drops pb_topic_.message_drops = registration_topic_.message_drops; - // did - pb_topic_.did = registration_topic_.did; - // dclock - pb_topic_.dclock = registration_topic_.dclock; - // dfreq - pb_topic_.dfreq = registration_topic_.dfreq; - // tlayer - eCAL::nanopb::encode_registration_layer(pb_topic_.tlayer, registration_topic_.tlayer); + // data_id + pb_topic_.data_id = registration_topic_.data_id; + // data_clock + pb_topic_.data_clock = registration_topic_.data_clock; + // data_frequency + pb_topic_.data_frequency = registration_topic_.data_frequency; + // transport_layer + eCAL::nanopb::encode_registration_layer(pb_topic_.transport_layer, registration_topic_.transport_layer); // attr eCAL::nanopb::encode_map(pb_topic_.attr, registration_topic_.attr); } @@ -209,8 +209,8 @@ namespace /////////////////////////////////////////////// pb_sample_.has_host = true; - // hname - eCAL::nanopb::encode_string(pb_sample_.host.hname, registration_.host.hname); + // host_name + eCAL::nanopb::encode_string(pb_sample_.host.name, registration_.host.name); pb_sample_.has_process = false; pb_sample_.has_service = false; @@ -308,26 +308,26 @@ namespace /////////////////////////////////////////////// // host information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_sample_.host.hname, registration_.host.hname); + // host_name + eCAL::nanopb::decode_string(pb_sample_.host.name, registration_.host.name); /////////////////////////////////////////////// // process information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_sample_.process.hname, registration_.identifier.host_name); + // host_name + eCAL::nanopb::decode_string(pb_sample_.process.host_name, registration_.identifier.host_name); // shm_transport_domain eCAL::nanopb::decode_string(pb_sample_.process.shm_transport_domain, registration_.process.shm_transport_domain); - // pname - eCAL::nanopb::decode_string(pb_sample_.process.pname, registration_.process.pname); - // uname - eCAL::nanopb::decode_string(pb_sample_.process.uname, registration_.process.uname); - // pparam - eCAL::nanopb::decode_string(pb_sample_.process.pparam, registration_.process.pparam); + // process_name + eCAL::nanopb::decode_string(pb_sample_.process.process_name, registration_.process.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_sample_.process.unit_name, registration_.process.unit_name); + // process_parameter + eCAL::nanopb::decode_string(pb_sample_.process.process_parameter, registration_.process.process_parameter); // state.info eCAL::nanopb::decode_string(pb_sample_.process.state.info, registration_.process.state.info); - // tsync_mod_name - eCAL::nanopb::decode_string(pb_sample_.process.tsync_mod_name, registration_.process.tsync_mod_name); + // time_sync_module_name + eCAL::nanopb::decode_string(pb_sample_.process.time_sync_module_name, registration_.process.time_sync_module_name); // component_init_info eCAL::nanopb::decode_string(pb_sample_.process.component_init_info, registration_.process.component_init_info); // ecal_runtime_version @@ -338,60 +338,60 @@ namespace /////////////////////////////////////////////// // service information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_sample_.service.hname, registration_.identifier.host_name); - // pname - eCAL::nanopb::decode_string(pb_sample_.service.pname, registration_.service.pname); - // uname - eCAL::nanopb::decode_string(pb_sample_.service.uname, registration_.service.uname); - // sname - eCAL::nanopb::decode_string(pb_sample_.service.sname, registration_.service.sname); - // sid - eCAL::nanopb::decode_int_from_string(pb_sample_.service.sid, registration_.identifier.entity_id); + // host_name + eCAL::nanopb::decode_string(pb_sample_.service.host_name, registration_.identifier.host_name); + // process_name + eCAL::nanopb::decode_string(pb_sample_.service.process_name, registration_.service.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_sample_.service.unit_name, registration_.service.unit_name); + // service_name + eCAL::nanopb::decode_string(pb_sample_.service.service_name, registration_.service.service_name); + // service_id + eCAL::nanopb::decode_int_from_string(pb_sample_.service.service_id, registration_.identifier.entity_id); // methods eCAL::nanopb::decode_service_methods(pb_sample_.service.methods, registration_.service.methods); /////////////////////////////////////////////// // client information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_sample_.client.hname, registration_.identifier.host_name); - // pname - eCAL::nanopb::decode_string(pb_sample_.client.pname, registration_.client.pname); - // uname - eCAL::nanopb::decode_string(pb_sample_.client.uname, registration_.client.uname); - // sname - eCAL::nanopb::decode_string(pb_sample_.client.sname, registration_.client.sname); - // sid - eCAL::nanopb::decode_int_from_string(pb_sample_.client.sid, registration_.identifier.entity_id); + // host_name + eCAL::nanopb::decode_string(pb_sample_.client.host_name, registration_.identifier.host_name); + // process_name + eCAL::nanopb::decode_string(pb_sample_.client.process_name, registration_.client.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_sample_.client.unit_name, registration_.client.unit_name); + // service_name + eCAL::nanopb::decode_string(pb_sample_.client.service_name, registration_.client.service_name); + // service_id + eCAL::nanopb::decode_int_from_string(pb_sample_.client.service_id, registration_.identifier.entity_id); // methods eCAL::nanopb::decode_service_methods(pb_sample_.client.methods, registration_.client.methods); /////////////////////////////////////////////// // topic information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_sample_.topic.hname, registration_.identifier.host_name); + // host_name + eCAL::nanopb::decode_string(pb_sample_.topic.host_name, registration_.identifier.host_name); // shm_transport_domain eCAL::nanopb::decode_string(pb_sample_.topic.shm_transport_domain, registration_.topic.shm_transport_domain); - // pname - eCAL::nanopb::decode_string(pb_sample_.topic.pname, registration_.topic.pname); - // uname - eCAL::nanopb::decode_string(pb_sample_.topic.uname, registration_.topic.uname); - // tid - eCAL::nanopb::decode_int_from_string(pb_sample_.topic.tid, registration_.identifier.entity_id); - // tname - eCAL::nanopb::decode_string(pb_sample_.topic.tname, registration_.topic.tname); + // process_name + eCAL::nanopb::decode_string(pb_sample_.topic.process_name, registration_.topic.process_name); + // unit_name + eCAL::nanopb::decode_string(pb_sample_.topic.unit_name, registration_.topic.unit_name); + // topic_id + eCAL::nanopb::decode_int_from_string(pb_sample_.topic.topic_id, registration_.identifier.entity_id); + // topic_name + eCAL::nanopb::decode_string(pb_sample_.topic.topic_name, registration_.topic.topic_name); // direction eCAL::nanopb::decode_string(pb_sample_.topic.direction, registration_.topic.direction); - // tdatatype.name - eCAL::nanopb::decode_string(pb_sample_.topic.tdatatype.name, registration_.topic.tdatatype.name); - // tdatatype.encoding - eCAL::nanopb::decode_string(pb_sample_.topic.tdatatype.encoding, registration_.topic.tdatatype.encoding); - // tdatatype.desc - eCAL::nanopb::decode_string(pb_sample_.topic.tdatatype.desc, registration_.topic.tdatatype.descriptor); - // tlayer - eCAL::nanopb::decode_registration_layer(pb_sample_.topic.tlayer, registration_.topic.tlayer); + // datatype_information.name + eCAL::nanopb::decode_string(pb_sample_.topic.datatype_information.name, registration_.topic.datatype_information.name); + // datatype_information.encoding + eCAL::nanopb::decode_string(pb_sample_.topic.datatype_information.encoding, registration_.topic.datatype_information.encoding); + // datatype_information.descriptor + eCAL::nanopb::decode_string(pb_sample_.topic.datatype_information.descriptor_information, registration_.topic.datatype_information.descriptor); + // transport_layer + eCAL::nanopb::decode_registration_layer(pb_sample_.topic.transport_layer, registration_.topic.transport_layer); // attr eCAL::nanopb::decode_map(pb_sample_.topic.attr, registration_.topic.attr); } @@ -407,27 +407,27 @@ namespace { case eCAL::bct_reg_process: case eCAL::bct_unreg_process: - // rclock - registration_.process.rclock = pb_sample_.process.rclock; - // pid - registration_.identifier.process_id = pb_sample_.process.pid; - // tid -> we need to use the PID here, because we don't have a designated field for it + // registration_clock + registration_.process.registration_clock = pb_sample_.process.registration_clock; + // process_id + registration_.identifier.process_id = pb_sample_.process.process_id; + // topic_id -> we need to use the PID here, because we don't have a designated field for it registration_.identifier.entity_id = registration_.identifier.process_id; // state.severity registration_.process.state.severity = static_cast(pb_sample_.process.state.severity); // state.severity_level registration_.process.state.severity_level = static_cast(pb_sample_.process.state.severity_level); - // tsync_state - registration_.process.tsync_state = static_cast(pb_sample_.process.tsync_state); + // time_sync_state + registration_.process.time_sync_state = static_cast(pb_sample_.process.time_sync_state); // component_init_state registration_.process.component_init_state = pb_sample_.process.component_init_state; break; case eCAL::bct_reg_service: case eCAL::bct_unreg_service: - // rclock - registration_.service.rclock = pb_sample_.service.rclock; - // pid - registration_.identifier.process_id = pb_sample_.service.pid; + // registration_clock + registration_.service.registration_clock = pb_sample_.service.registration_clock; + // process_id + registration_.identifier.process_id = pb_sample_.service.process_id; // version registration_.service.version = pb_sample_.service.version; // tcp_port_v0 @@ -437,10 +437,10 @@ namespace break; case eCAL::bct_reg_client: case eCAL::bct_unreg_client: - // rclock - registration_.client.rclock = pb_sample_.client.rclock; - // pid - registration_.identifier.process_id = pb_sample_.client.pid; + // registration_clock + registration_.client.registration_clock = pb_sample_.client.registration_clock; + // process_id + registration_.identifier.process_id = pb_sample_.client.process_id; // version registration_.client.version = pb_sample_.client.version; break; @@ -448,24 +448,24 @@ namespace case eCAL::bct_unreg_publisher: case eCAL::bct_reg_subscriber: case eCAL::bct_unreg_subscriber: - // rclock - registration_.topic.rclock = pb_sample_.topic.rclock; - // pid - registration_.identifier.process_id = pb_sample_.topic.pid; - // tsize - registration_.topic.tsize = pb_sample_.topic.tsize; - // connections_loc - registration_.topic.connections_loc = pb_sample_.topic.connections_loc; - // connections_ext - registration_.topic.connections_ext = pb_sample_.topic.connections_ext; + // registration_clock + registration_.topic.registration_clock = pb_sample_.topic.registration_clock; + // process_id + registration_.identifier.process_id = pb_sample_.topic.process_id; + // topic_size + registration_.topic.topic_size = pb_sample_.topic.topic_size; + // connections_local + registration_.topic.connections_local = pb_sample_.topic.connections_local; + // connections_external + registration_.topic.connections_external = pb_sample_.topic.connections_external; // message_drops registration_.topic.message_drops = pb_sample_.topic.message_drops; - // did - registration_.topic.did = pb_sample_.topic.did; - // dclock - registration_.topic.dclock = pb_sample_.topic.dclock; - // dfreq - registration_.topic.dfreq = pb_sample_.topic.dfreq; + // data_id + registration_.topic.data_id = pb_sample_.topic.data_id; + // data_clock + registration_.topic.data_clock = pb_sample_.topic.data_clock; + // data_frequency + registration_.topic.data_frequency = pb_sample_.topic.data_frequency; break; default: break; diff --git a/ecal/core/src/serialization/ecal_serialize_service.cpp b/ecal/core/src/serialization/ecal_serialize_service.cpp index 08902c537b..5e1203fa2b 100644 --- a/ecal/core/src/serialization/ecal_serialize_service.cpp +++ b/ecal/core/src/serialization/ecal_serialize_service.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,14 +45,14 @@ namespace /////////////////////////////////////////////// pb_request_.has_header = true; - // hname - eCAL::nanopb::encode_string(pb_request_.header.hname, request_.header.hname); - // sname - eCAL::nanopb::encode_string(pb_request_.header.sname, request_.header.sname); - // sid - eCAL::nanopb::encode_string(pb_request_.header.sid, request_.header.sid); - // mname - eCAL::nanopb::encode_string(pb_request_.header.mname, request_.header.mname); + // host_name + eCAL::nanopb::encode_string(pb_request_.header.host_name, request_.header.host_name); + // service_name + eCAL::nanopb::encode_string(pb_request_.header.service_name, request_.header.service_name); + // service_id + eCAL::nanopb::encode_string(pb_request_.header.service_id, request_.header.service_id); + // method_name + eCAL::nanopb::encode_string(pb_request_.header.method_name, request_.header.method_name); // error eCAL::nanopb::encode_string(pb_request_.header.error, request_.header.error); // id @@ -119,14 +119,14 @@ namespace /////////////////////////////////////////////// // header information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_request.header.hname, request_.header.hname); - // sname - eCAL::nanopb::decode_string(pb_request.header.sname, request_.header.sname); - // sid - eCAL::nanopb::decode_string(pb_request.header.sid, request_.header.sid); - // mname - eCAL::nanopb::decode_string(pb_request.header.mname, request_.header.mname); + // host_name + eCAL::nanopb::decode_string(pb_request.header.host_name, request_.header.host_name); + // service_name + eCAL::nanopb::decode_string(pb_request.header.service_name, request_.header.service_name); + // service_id + eCAL::nanopb::decode_string(pb_request.header.service_id, request_.header.service_id); + // method_name + eCAL::nanopb::decode_string(pb_request.header.method_name, request_.header.method_name); // error eCAL::nanopb::decode_string(pb_request.header.error, request_.header.error); @@ -171,14 +171,14 @@ namespace /////////////////////////////////////////////// pb_response_.has_header = true; - // hname - eCAL::nanopb::encode_string(pb_response_.header.hname, response_.header.hname); - // sname - eCAL::nanopb::encode_string(pb_response_.header.sname, response_.header.sname); - // sid - eCAL::nanopb::encode_string(pb_response_.header.sid, response_.header.sid); - // mname - eCAL::nanopb::encode_string(pb_response_.header.mname, response_.header.mname); + // host_name + eCAL::nanopb::encode_string(pb_response_.header.host_name, response_.header.host_name); + // service_name + eCAL::nanopb::encode_string(pb_response_.header.service_name, response_.header.service_name); + // service_id + eCAL::nanopb::encode_string(pb_response_.header.service_id, response_.header.service_id); + // method_name + eCAL::nanopb::encode_string(pb_response_.header.method_name, response_.header.method_name); // error eCAL::nanopb::encode_string(pb_response_.header.error, response_.header.error); // id @@ -246,14 +246,14 @@ namespace /////////////////////////////////////////////// // header information /////////////////////////////////////////////// - // hname - eCAL::nanopb::decode_string(pb_response.header.hname, response_.header.hname); - // sname - eCAL::nanopb::decode_string(pb_response.header.sname, response_.header.sname); - // sid - eCAL::nanopb::decode_string(pb_response.header.sid, response_.header.sid); - // mname - eCAL::nanopb::decode_string(pb_response.header.mname, response_.header.mname); + // host_name + eCAL::nanopb::decode_string(pb_response.header.host_name, response_.header.host_name); + // service_name + eCAL::nanopb::decode_string(pb_response.header.service_name, response_.header.service_name); + // service_id + eCAL::nanopb::decode_string(pb_response.header.service_id, response_.header.service_id); + // method_name + eCAL::nanopb::decode_string(pb_response.header.method_name, response_.header.method_name); // error eCAL::nanopb::decode_string(pb_response.header.error, response_.header.error); diff --git a/ecal/core/src/serialization/ecal_struct_sample_payload.h b/ecal/core/src/serialization/ecal_struct_sample_payload.h index 8f9120eeef..08023f8f90 100644 --- a/ecal/core/src/serialization/ecal_struct_sample_payload.h +++ b/ecal/core/src/serialization/ecal_struct_sample_payload.h @@ -39,10 +39,10 @@ namespace eCAL // Topic information struct TopicInfo { - std::string hname; // host name - uint64_t tid; // topic id - std::string tname; // topic name - int32_t pid = 0; // process id + std::string host_name; // host name + uint64_t topic_id; // topic id + std::string topic_name; // topic name + int32_t process_id = 0; // process id }; // Topic content payload diff --git a/ecal/core/src/serialization/ecal_struct_sample_registration.h b/ecal/core/src/serialization/ecal_struct_sample_registration.h index e8b4b09bdb..491ac9103b 100644 --- a/ecal/core/src/serialization/ecal_struct_sample_registration.h +++ b/ecal/core/src/serialization/ecal_struct_sample_registration.h @@ -60,7 +60,7 @@ namespace eCAL proc_sev_level5 = 5 }; - enum eTSyncState + enum eTimeSyncState { tsync_none = 0, tsync_realtime = 1, @@ -70,31 +70,31 @@ namespace eCAL // Operating system details struct OSInfo { - std::string osname; // name + std::string name; // name bool operator==(const OSInfo& other) const { - return osname == other.osname; + return name == other.name; } void clear() { - osname.clear(); + name.clear(); } }; // eCAL host struct Host { - std::string hname; // host name + std::string name; // host name OSInfo os; // operating system details bool operator==(const Host& other) const { - return hname == other.hname && os == other.os; + return name == other.name && os == other.os; } void clear() { - hname.clear(); + name.clear(); os.clear(); } }; @@ -211,28 +211,28 @@ namespace eCAL // Process information struct Process { - int32_t rclock = 0; // registration clock + int32_t registration_clock = 0; // registration clock std::string shm_transport_domain; // shm transport domain - std::string pname; // process name - std::string uname; // unit name - std::string pparam; // process parameter + std::string process_name; // process name + std::string unit_name; // unit name + std::string process_parameter; // process parameter ProcessState state; // process state info - eTSyncState tsync_state = tsync_none; // time synchronization state - std::string tsync_mod_name; // time synchronization module name + eTimeSyncState time_sync_state = tsync_none; // time synchronization state + std::string time_sync_module_name; // time synchronization module name int32_t component_init_state = 0; // eCAL component initialization state (eCAL::Initialize(..)) std::string component_init_info; // like comp_init_state as a human-readable string (pub|sub|srv|mon|log|time|proc) std::string ecal_runtime_version; // loaded/runtime eCAL version of a component std::string config_file_path; // Path from where the eCAL configuration for this process was loadedloaded/runtime eCAL version of a component bool operator==(const Process& other) const { - return rclock == other.rclock && + return registration_clock == other.registration_clock && shm_transport_domain == other.shm_transport_domain && - pname == other.pname && - uname == other.uname && - pparam == other.pparam && + process_name == other.process_name && + unit_name == other.unit_name && + process_parameter == other.process_parameter && state == other.state && - tsync_state == other.tsync_state && - tsync_mod_name == other.tsync_mod_name && + time_sync_state == other.time_sync_state && + time_sync_module_name == other.time_sync_module_name && component_init_state == other.component_init_state && component_init_info == other.component_init_info && ecal_runtime_version == other.ecal_runtime_version && @@ -241,14 +241,14 @@ namespace eCAL void clear() { - rclock = 0; + registration_clock = 0; shm_transport_domain.clear(); - pname.clear(); - uname.clear(); - pparam.clear(); + process_name.clear(); + unit_name.clear(); + process_parameter.clear(); state.clear(); - tsync_state = tsync_none; - tsync_mod_name.clear(); + time_sync_state = tsync_none; + time_sync_module_name.clear(); component_init_state = 0; component_init_info.clear(); ecal_runtime_version.clear(); @@ -259,66 +259,66 @@ namespace eCAL // eCAL topic information struct Topic { - int32_t rclock = 0; // registration clock (heart beat) + int32_t registration_clock = 0; // registration clock (heart beat) std::string shm_transport_domain; // shm transport domain - std::string pname; // process name - std::string uname; // unit name - std::string tname; // topic name + std::string process_name; // process name + std::string unit_name; // unit name + std::string topic_name; // topic name std::string direction; // direction (publisher, subscriber) - SDataTypeInformation tdatatype; // topic datatype information (encoding & type & description) + SDataTypeInformation datatype_information; // topic datatype information (encoding & type & description) - Util::CExpandingVector tlayer; // active topic transport layers and its specific parameter - int32_t tsize = 0; // topic size + Util::CExpandingVector transport_layer; // active topic transport layers and its specific parameter + int32_t topic_size = 0; // topic size - int32_t connections_loc = 0; // number of local connected entities - int32_t connections_ext = 0; // number of external connected entities + int32_t connections_local = 0; // number of local connected entities + int32_t connections_external = 0; // number of external connected entities int32_t message_drops = 0; // dropped messages - int64_t did = 0; // data send id (publisher setid) - int64_t dclock = 0; // data clock (send / receive action) - int32_t dfreq = 0; // data frequency (send / receive registrations per second) [mHz] + int64_t data_id = 0; // data send id (publisher setid) + int64_t data_clock = 0; // data clock (send / receive action) + int32_t data_frequency = 0; // data frequency (send / receive registrations per second) [mHz] std::map attr; // generic topic description bool operator==(const Topic& other) const { - return rclock == other.rclock && + return registration_clock == other.registration_clock && shm_transport_domain == other.shm_transport_domain && - pname == other.pname && - uname == other.uname && - tname == other.tname && + process_name == other.process_name && + unit_name == other.unit_name && + topic_name == other.topic_name && direction == other.direction && - tdatatype == other.tdatatype && - tlayer == other.tlayer && - tsize == other.tsize && - connections_loc == other.connections_loc && - connections_ext == other.connections_ext && + datatype_information == other.datatype_information && + transport_layer == other.transport_layer && + topic_size == other.topic_size && + connections_local == other.connections_local && + connections_external == other.connections_external && message_drops == other.message_drops && - did == other.did && - dclock == other.dclock && - dfreq == other.dfreq && + data_id == other.data_id && + data_clock == other.data_clock && + data_frequency == other.data_frequency && attr == other.attr; } void clear() { - rclock = 0; + registration_clock = 0; shm_transport_domain.clear(); - pname.clear(); - uname.clear(); - tname.clear(); + process_name.clear(); + unit_name.clear(); + topic_name.clear(); direction.clear(); - tdatatype.clear(); + datatype_information.clear(); - tlayer.clear(); - tsize = 0; + transport_layer.clear(); + topic_size = 0; - connections_loc = 0; - connections_ext = 0; + connections_local = 0; + connections_external = 0; message_drops = 0; - did = 0; - dclock = 0; - dfreq = 0; + data_id = 0; + data_clock = 0; + data_frequency = 0; attr.clear(); } diff --git a/ecal/core/src/serialization/ecal_struct_service.h b/ecal/core/src/serialization/ecal_struct_service.h index 9d52e84892..b81e1ab492 100644 --- a/ecal/core/src/serialization/ecal_struct_service.h +++ b/ecal/core/src/serialization/ecal_struct_service.h @@ -47,19 +47,19 @@ namespace eCAL // ServiceHeader struct ServiceHeader { - std::string hname; // Host name - std::string sname; // Service name - std::string sid; // Service id - std::string mname; // Method name + std::string host_name; // Host name + std::string service_name; // Service name + std::string service_id; // Service id + std::string method_name; // Method name std::string error; // Error message int32_t id = 0; // Session id eMethodCallState state = none; // Method call state bool operator==(const ServiceHeader& other) const { - return hname == other.hname && - sname == other.sname && - sid == other.sid && - mname == other.mname && + return host_name == other.host_name && + service_name == other.service_name && + service_id == other.service_id && + method_name == other.method_name && error == other.error && id == other.id && state == other.state; @@ -67,10 +67,10 @@ namespace eCAL void clear() { - hname.clear(); - sname.clear(); - sid.clear(); - mname.clear(); + host_name.clear(); + service_name.clear(); + service_id.clear(); + method_name.clear(); error.clear(); id = 0; state = none; @@ -119,32 +119,32 @@ namespace eCAL // Service Method struct Method { - std::string mname; // Method name + std::string method_name; // Method name - std::string req_type; // Request type (deprecated use req_datatype) - std::string req_desc; // Request descriptor (deprecated use req_datatype) - std::string resp_type; // Response type (deprecated use resp_datatype) - std::string resp_desc; // Response descriptor (deprecated use resp_datatype) + std::string req_type; // Request type (deprecated use request_datatype_information) + std::string req_desc; // Request descriptor (deprecated use request_datatype_information) + std::string resp_type; // Response type (deprecated use response_datatype_information) + std::string resp_desc; // Response descriptor (deprecated use response_datatype_information) - SDataTypeInformation req_datatype; // Request datatype information (encoding & type & description) - SDataTypeInformation resp_datatype; // Response datatype information (encoding & type & description) + SDataTypeInformation request_datatype_information; // Request datatype information (encoding & type & description) + SDataTypeInformation response_datatype_information; // Response datatype information (encoding & type & description) int64_t call_count = 0; // Call counter bool operator==(const Method& other) const { - return mname == other.mname && + return method_name == other.method_name && req_type == other.req_type && req_desc == other.req_desc && resp_type == other.resp_type && resp_desc == other.resp_desc && - req_datatype == other.req_datatype && - resp_datatype == other.resp_datatype && + request_datatype_information == other.request_datatype_information && + response_datatype_information == other.response_datatype_information && call_count == other.call_count; } void clear() { - mname.clear(); + method_name.clear(); req_type.clear(); req_desc.clear(); resp_type.clear(); @@ -157,20 +157,20 @@ namespace eCAL // TODO: this naming is wrong, it should be Server!!! struct Service { - int32_t rclock = 0; // Registration clock - std::string pname; // Process name - std::string uname; // Unit name - std::string sname; // Service name - Util::CExpandingVector methods; // List of methods - uint32_t version = 0; // Service protocol version - uint32_t tcp_port_v0 = 0; // The TCP port used for that service (v0) - uint32_t tcp_port_v1 = 0; // The TCP port used for that service (v1) + int32_t registration_clock = 0; // Registration clock + std::string process_name; // Process name + std::string unit_name; // Unit name + std::string service_name; // Service name + Util::CExpandingVector methods; // List of methods + uint32_t version = 0; // Service protocol version + uint32_t tcp_port_v0 = 0; // The TCP port used for that service (v0) + uint32_t tcp_port_v1 = 0; // The TCP port used for that service (v1) bool operator==(const Service& other) const { - return rclock == other.rclock && - pname == other.pname && - uname == other.uname && - sname == other.sname && + return registration_clock == other.registration_clock && + process_name == other.process_name && + unit_name == other.unit_name && + service_name == other.service_name && methods == other.methods && version == other.version && tcp_port_v0 == other.tcp_port_v0 && @@ -179,10 +179,10 @@ namespace eCAL void clear() { - rclock = 0; - pname.clear(); - uname.clear(); - sname.clear(); + registration_clock = 0; + process_name.clear(); + unit_name.clear(); + service_name.clear(); methods.clear(); version = 0; tcp_port_v0 = 0; @@ -193,28 +193,28 @@ namespace eCAL // Client struct Client { - int32_t rclock = 0; // Registration clock - std::string pname; // Process name - std::string uname; // Unit name - std::string sname; // Service name - Util::CExpandingVector methods; // List of methods - uint32_t version = 0; // Client protocol version + int32_t registration_clock = 0; // Registration clock + std::string process_name; // Process name + std::string unit_name; // Unit name + std::string service_name; // Service name + Util::CExpandingVector methods; // List of methods + uint32_t version = 0; // Client protocol version bool operator==(const Client& other) const { - return rclock == other.rclock && - pname == other.pname && - uname == other.uname && - sname == other.sname && + return registration_clock == other.registration_clock && + process_name == other.process_name && + unit_name == other.unit_name && + service_name == other.service_name && methods == other.methods && version == other.version; } void clear() { - rclock = 0; - pname.clear(); - uname.clear(); - sname.clear(); + registration_clock = 0; + process_name.clear(); + unit_name.clear(); + service_name.clear(); methods.clear(); version = 0; } diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/datatype.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/datatype.npb.h index c4e8b2de7e..7d369e2a57 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/datatype.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/datatype.npb.h @@ -13,7 +13,7 @@ typedef struct _eCAL_pb_DataTypeInformation { pb_callback_t name; /* name of the datatype */ pb_callback_t encoding; /* encoding of the datatype (e.g. protobuf, flatbuffers, capnproto) */ - pb_callback_t desc; /* descriptor information of the datatype (necessary for reflection) */ + pb_callback_t descriptor_information; /* descriptor information of the datatype (necessary for reflection) */ } eCAL_pb_DataTypeInformation; @@ -28,13 +28,13 @@ extern "C" { /* Field tags (for use in manual encoding/decoding) */ #define eCAL_pb_DataTypeInformation_name_tag 1 #define eCAL_pb_DataTypeInformation_encoding_tag 2 -#define eCAL_pb_DataTypeInformation_desc_tag 3 +#define eCAL_pb_DataTypeInformation_descriptor_information_tag 3 /* Struct field encoding specification for nanopb */ #define eCAL_pb_DataTypeInformation_FIELDLIST(X, a) \ X(a, CALLBACK, SINGULAR, STRING, name, 1) \ X(a, CALLBACK, SINGULAR, STRING, encoding, 2) \ -X(a, CALLBACK, SINGULAR, BYTES, desc, 3) +X(a, CALLBACK, SINGULAR, BYTES, descriptor_information, 3) #define eCAL_pb_DataTypeInformation_CALLBACK pb_default_field_callback #define eCAL_pb_DataTypeInformation_DEFAULT NULL diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h index fcfa0cb396..4eaf344102 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h @@ -11,11 +11,11 @@ /* Struct definitions */ typedef struct _eCAL_pb_OSInfo { - pb_callback_t osname; /* name */ + pb_callback_t name; /* name */ } eCAL_pb_OSInfo; typedef struct _eCAL_pb_Host { - pb_callback_t hname; /* host name */ + pb_callback_t name; /* host name */ bool has_os; eCAL_pb_OSInfo os; /* operating system details */ } eCAL_pb_Host; @@ -32,18 +32,18 @@ extern "C" { #define eCAL_pb_Host_init_zero {{{NULL}, NULL}, false, eCAL_pb_OSInfo_init_zero} /* Field tags (for use in manual encoding/decoding) */ -#define eCAL_pb_OSInfo_osname_tag 1 -#define eCAL_pb_Host_hname_tag 1 +#define eCAL_pb_OSInfo_name_tag 1 +#define eCAL_pb_Host_name_tag 1 #define eCAL_pb_Host_os_tag 2 /* Struct field encoding specification for nanopb */ #define eCAL_pb_OSInfo_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, STRING, osname, 1) +X(a, CALLBACK, SINGULAR, STRING, name, 1) #define eCAL_pb_OSInfo_CALLBACK pb_default_field_callback #define eCAL_pb_OSInfo_DEFAULT NULL #define eCAL_pb_Host_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 1) \ +X(a, CALLBACK, SINGULAR, STRING, name, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, os, 2) #define eCAL_pb_Host_CALLBACK pb_default_field_callback #define eCAL_pb_Host_DEFAULT NULL diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c index d4f85b6830..5906a9aede 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c @@ -18,7 +18,7 @@ PB_BIND(eCAL_pb_LayerParTcp, eCAL_pb_LayerParTcp, AUTO) PB_BIND(eCAL_pb_ConnnectionPar, eCAL_pb_ConnnectionPar, AUTO) -PB_BIND(eCAL_pb_TLayer, eCAL_pb_TLayer, AUTO) +PB_BIND(eCAL_pb_TransportLayer, eCAL_pb_TransportLayer, AUTO) diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h index 12d579787f..ec2b7eecc7 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h @@ -10,17 +10,17 @@ #endif /* Enum definitions */ -typedef enum _eCAL_pb_eTLayerType { /* Reserved fields in enums are not supported in protobuf 3.0 +typedef enum _eCAL_pb_eTransportLayerType { /* Reserved fields in enums are not supported in protobuf 3.0 reserved 2, 3, 42; */ - eCAL_pb_eTLayerType_tl_none = 0, /* undefined */ - eCAL_pb_eTLayerType_tl_ecal_udp_mc = 1, /* ecal udp multicast */ + eCAL_pb_eTransportLayerType_tl_none = 0, /* undefined */ + eCAL_pb_eTransportLayerType_tl_ecal_udp_mc = 1, /* ecal udp multicast */ /* 2 = ecal udp unicast (not supported anymore) 3 = ecal udp metal (not supported anymore) */ - eCAL_pb_eTLayerType_tl_ecal_shm = 4, /* ecal shared memory */ - eCAL_pb_eTLayerType_tl_ecal_tcp = 5, /* ecal tcp */ + eCAL_pb_eTransportLayerType_tl_ecal_shm = 4, /* ecal shared memory */ + eCAL_pb_eTransportLayerType_tl_ecal_tcp = 5, /* ecal tcp */ /* 42 = inproc (not supported anymore) */ - eCAL_pb_eTLayerType_tl_all = 255 /* all layer */ -} eCAL_pb_eTLayerType; + eCAL_pb_eTransportLayerType_tl_all = 255 /* all layer */ +} eCAL_pb_eTransportLayerType; /* Struct definitions */ typedef struct _eCAL_pb_LayerParUdpMC { @@ -46,15 +46,15 @@ typedef struct _eCAL_pb_ConnnectionPar { /* Reserved fields in enums are not sup eCAL_pb_LayerParTcp layer_par_tcp; /* parameter for ecal tcp */ } eCAL_pb_ConnnectionPar; -typedef struct _eCAL_pb_TLayer { /* Reserved fields in enums are not supported in protobuf 3.0 +typedef struct _eCAL_pb_TransportLayer { /* Reserved fields in enums are not supported in protobuf 3.0 reserved 4; */ - eCAL_pb_eTLayerType type; /* transport layer type */ + eCAL_pb_eTransportLayerType type; /* transport layer type */ int32_t version; /* transport layer version */ bool active; /* transport layer in use ? */ bool has_par_layer; eCAL_pb_ConnnectionPar par_layer; /* transport layer parameter */ bool enabled; /* transport layer enabled ? */ -} eCAL_pb_TLayer; +} eCAL_pb_TransportLayer; #ifdef __cplusplus @@ -62,15 +62,15 @@ extern "C" { #endif /* Helper constants for enums */ -#define _eCAL_pb_eTLayerType_MIN eCAL_pb_eTLayerType_tl_none -#define _eCAL_pb_eTLayerType_MAX eCAL_pb_eTLayerType_tl_all -#define _eCAL_pb_eTLayerType_ARRAYSIZE ((eCAL_pb_eTLayerType)(eCAL_pb_eTLayerType_tl_all+1)) +#define _eCAL_pb_eTransportLayerType_MIN eCAL_pb_eTransportLayerType_tl_none +#define _eCAL_pb_eTransportLayerType_MAX eCAL_pb_eTransportLayerType_tl_all +#define _eCAL_pb_eTransportLayerType_ARRAYSIZE ((eCAL_pb_eTransportLayerType)(eCAL_pb_eTransportLayerType_tl_all+1)) -#define eCAL_pb_TLayer_type_ENUMTYPE eCAL_pb_eTLayerType +#define eCAL_pb_TransportLayer_type_ENUMTYPE eCAL_pb_eTransportLayerType /* Initializer values for message structs */ @@ -78,12 +78,12 @@ extern "C" { #define eCAL_pb_LayerParShm_init_default {{{NULL}, NULL}} #define eCAL_pb_LayerParTcp_init_default {0} #define eCAL_pb_ConnnectionPar_init_default {false, eCAL_pb_LayerParUdpMC_init_default, false, eCAL_pb_LayerParShm_init_default, false, eCAL_pb_LayerParTcp_init_default} -#define eCAL_pb_TLayer_init_default {_eCAL_pb_eTLayerType_MIN, 0, 0, false, eCAL_pb_ConnnectionPar_init_default, 0} +#define eCAL_pb_TransportLayer_init_default {_eCAL_pb_eTransportLayerType_MIN, 0, 0, false, eCAL_pb_ConnnectionPar_init_default, 0} #define eCAL_pb_LayerParUdpMC_init_zero {0} #define eCAL_pb_LayerParShm_init_zero {{{NULL}, NULL}} #define eCAL_pb_LayerParTcp_init_zero {0} #define eCAL_pb_ConnnectionPar_init_zero {false, eCAL_pb_LayerParUdpMC_init_zero, false, eCAL_pb_LayerParShm_init_zero, false, eCAL_pb_LayerParTcp_init_zero} -#define eCAL_pb_TLayer_init_zero {_eCAL_pb_eTLayerType_MIN, 0, 0, false, eCAL_pb_ConnnectionPar_init_zero, 0} +#define eCAL_pb_TransportLayer_init_zero {_eCAL_pb_eTransportLayerType_MIN, 0, 0, false, eCAL_pb_ConnnectionPar_init_zero, 0} /* Field tags (for use in manual encoding/decoding) */ #define eCAL_pb_LayerParShm_memory_file_list_tag 1 @@ -91,11 +91,11 @@ extern "C" { #define eCAL_pb_ConnnectionPar_layer_par_udpmc_tag 1 #define eCAL_pb_ConnnectionPar_layer_par_shm_tag 2 #define eCAL_pb_ConnnectionPar_layer_par_tcp_tag 4 -#define eCAL_pb_TLayer_type_tag 1 -#define eCAL_pb_TLayer_version_tag 2 -#define eCAL_pb_TLayer_active_tag 3 -#define eCAL_pb_TLayer_par_layer_tag 5 -#define eCAL_pb_TLayer_enabled_tag 6 +#define eCAL_pb_TransportLayer_type_tag 1 +#define eCAL_pb_TransportLayer_version_tag 2 +#define eCAL_pb_TransportLayer_active_tag 3 +#define eCAL_pb_TransportLayer_par_layer_tag 5 +#define eCAL_pb_TransportLayer_enabled_tag 6 /* Struct field encoding specification for nanopb */ #define eCAL_pb_LayerParUdpMC_FIELDLIST(X, a) \ @@ -123,33 +123,33 @@ X(a, STATIC, OPTIONAL, MESSAGE, layer_par_tcp, 4) #define eCAL_pb_ConnnectionPar_layer_par_shm_MSGTYPE eCAL_pb_LayerParShm #define eCAL_pb_ConnnectionPar_layer_par_tcp_MSGTYPE eCAL_pb_LayerParTcp -#define eCAL_pb_TLayer_FIELDLIST(X, a) \ +#define eCAL_pb_TransportLayer_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, type, 1) \ X(a, STATIC, SINGULAR, INT32, version, 2) \ X(a, STATIC, SINGULAR, BOOL, active, 3) \ X(a, STATIC, OPTIONAL, MESSAGE, par_layer, 5) \ X(a, STATIC, SINGULAR, BOOL, enabled, 6) -#define eCAL_pb_TLayer_CALLBACK NULL -#define eCAL_pb_TLayer_DEFAULT NULL -#define eCAL_pb_TLayer_par_layer_MSGTYPE eCAL_pb_ConnnectionPar +#define eCAL_pb_TransportLayer_CALLBACK NULL +#define eCAL_pb_TransportLayer_DEFAULT NULL +#define eCAL_pb_TransportLayer_par_layer_MSGTYPE eCAL_pb_ConnnectionPar extern const pb_msgdesc_t eCAL_pb_LayerParUdpMC_msg; extern const pb_msgdesc_t eCAL_pb_LayerParShm_msg; extern const pb_msgdesc_t eCAL_pb_LayerParTcp_msg; extern const pb_msgdesc_t eCAL_pb_ConnnectionPar_msg; -extern const pb_msgdesc_t eCAL_pb_TLayer_msg; +extern const pb_msgdesc_t eCAL_pb_TransportLayer_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define eCAL_pb_LayerParUdpMC_fields &eCAL_pb_LayerParUdpMC_msg #define eCAL_pb_LayerParShm_fields &eCAL_pb_LayerParShm_msg #define eCAL_pb_LayerParTcp_fields &eCAL_pb_LayerParTcp_msg #define eCAL_pb_ConnnectionPar_fields &eCAL_pb_ConnnectionPar_msg -#define eCAL_pb_TLayer_fields &eCAL_pb_TLayer_msg +#define eCAL_pb_TransportLayer_fields &eCAL_pb_TransportLayer_msg /* Maximum encoded size of messages (where known) */ /* eCAL_pb_LayerParShm_size depends on runtime parameters */ /* eCAL_pb_ConnnectionPar_size depends on runtime parameters */ -/* eCAL_pb_TLayer_size depends on runtime parameters */ +/* eCAL_pb_TransportLayer_size depends on runtime parameters */ #define ECAL_PB_LAYER_NPB_H_MAX_SIZE eCAL_pb_LayerParTcp_size #define eCAL_pb_LayerParTcp_size 11 #define eCAL_pb_LayerParUdpMC_size 0 diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h index 42033f6b4f..34aff47a72 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h @@ -12,10 +12,10 @@ /* Struct definitions */ typedef struct _eCAL_pb_LogMessage { int64_t time; /* time */ - pb_callback_t hname; /* host name */ - int32_t pid; /* process id */ - pb_callback_t pname; /* process name */ - pb_callback_t uname; /* unit name */ + pb_callback_t host_name; /* host name */ + int32_t process_id; /* process id */ + pb_callback_t process_name; /* process name */ + pb_callback_t unit_name; /* unit name */ int32_t level; /* message level */ pb_callback_t content; /* message content */ } eCAL_pb_LogMessage; @@ -37,10 +37,10 @@ extern "C" { /* Field tags (for use in manual encoding/decoding) */ #define eCAL_pb_LogMessage_time_tag 1 -#define eCAL_pb_LogMessage_hname_tag 2 -#define eCAL_pb_LogMessage_pid_tag 3 -#define eCAL_pb_LogMessage_pname_tag 4 -#define eCAL_pb_LogMessage_uname_tag 5 +#define eCAL_pb_LogMessage_host_name_tag 2 +#define eCAL_pb_LogMessage_process_id_tag 3 +#define eCAL_pb_LogMessage_process_name_tag 4 +#define eCAL_pb_LogMessage_unit_name_tag 5 #define eCAL_pb_LogMessage_level_tag 6 #define eCAL_pb_LogMessage_content_tag 7 #define eCAL_pb_LogMessageList_log_messages_tag 1 @@ -48,10 +48,10 @@ extern "C" { /* Struct field encoding specification for nanopb */ #define eCAL_pb_LogMessage_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, INT64, time, 1) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 2) \ -X(a, STATIC, SINGULAR, INT32, pid, 3) \ -X(a, CALLBACK, SINGULAR, STRING, pname, 4) \ -X(a, CALLBACK, SINGULAR, STRING, uname, 5) \ +X(a, CALLBACK, SINGULAR, STRING, host_name, 2) \ +X(a, STATIC, SINGULAR, INT32, process_id, 3) \ +X(a, CALLBACK, SINGULAR, STRING, process_name, 4) \ +X(a, CALLBACK, SINGULAR, STRING, unit_name, 5) \ X(a, STATIC, SINGULAR, INT32, level, 6) \ X(a, CALLBACK, SINGULAR, STRING, content, 7) #define eCAL_pb_LogMessage_CALLBACK pb_default_field_callback diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h index 88a7f1f106..223b02a7fc 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h @@ -27,11 +27,11 @@ typedef enum _eCAL_pb_eProcessSeverityLevel { eCAL_pb_eProcessSeverityLevel_proc_sev_level5 = 5 /* severity level 5 */ } eCAL_pb_eProcessSeverityLevel; -typedef enum _eCAL_pb_eTSyncState { - eCAL_pb_eTSyncState_tsync_none = 0, /* not synchronized */ - eCAL_pb_eTSyncState_tsync_realtime = 1, /* real time sync mode */ - eCAL_pb_eTSyncState_tsync_replay = 2 /* replay time sync mode */ -} eCAL_pb_eTSyncState; +typedef enum _eCAL_pb_eTimeSyncState { + eCAL_pb_eTimeSyncState_tsync_none = 0, /* not synchronized */ + eCAL_pb_eTimeSyncState_tsync_realtime = 1, /* real time sync mode */ + eCAL_pb_eTimeSyncState_tsync_replay = 2 /* replay time sync mode */ +} eCAL_pb_eTimeSyncState; /* Struct definitions */ typedef struct _eCAL_pb_ProcessState { @@ -42,18 +42,18 @@ typedef struct _eCAL_pb_ProcessState { typedef struct _eCAL_pb_Process { /* Reserved fields in enums are not supported in protobuf 3.0 reserved 7 to 11; */ - int32_t rclock; /* registration clock */ - pb_callback_t hname; /* host name */ - int32_t pid; /* process id */ - pb_callback_t pname; /* process name */ - pb_callback_t uname; /* unit name */ - pb_callback_t pparam; /* process parameter */ + int32_t registration_clock; /* registration clock */ + pb_callback_t host_name; /* host name */ + int32_t process_id; /* process id */ + pb_callback_t process_name; /* process name */ + pb_callback_t unit_name; /* unit name */ + pb_callback_t process_parameter; /* process parameter */ /* 10 = data write bytes per sec 11 = data read bytes per sec */ bool has_state; eCAL_pb_ProcessState state; /* process state info */ - eCAL_pb_eTSyncState tsync_state; /* time synchronization state */ - pb_callback_t tsync_mod_name; /* time synchronization module name */ + eCAL_pb_eTimeSyncState time_sync_state; /* time synchronization state */ + pb_callback_t time_sync_module_name; /* time synchronization module name */ int32_t component_init_state; /* eCAL component initialization state (eCAL::Initialize(..)) */ pb_callback_t component_init_info; /* like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) */ pb_callback_t ecal_runtime_version; /* loaded / runtime eCAL version of a component */ @@ -75,35 +75,35 @@ extern "C" { #define _eCAL_pb_eProcessSeverityLevel_MAX eCAL_pb_eProcessSeverityLevel_proc_sev_level5 #define _eCAL_pb_eProcessSeverityLevel_ARRAYSIZE ((eCAL_pb_eProcessSeverityLevel)(eCAL_pb_eProcessSeverityLevel_proc_sev_level5+1)) -#define _eCAL_pb_eTSyncState_MIN eCAL_pb_eTSyncState_tsync_none -#define _eCAL_pb_eTSyncState_MAX eCAL_pb_eTSyncState_tsync_replay -#define _eCAL_pb_eTSyncState_ARRAYSIZE ((eCAL_pb_eTSyncState)(eCAL_pb_eTSyncState_tsync_replay+1)) +#define _eCAL_pb_eTimeSyncState_MIN eCAL_pb_eTimeSyncState_tsync_none +#define _eCAL_pb_eTimeSyncState_MAX eCAL_pb_eTimeSyncState_tsync_replay +#define _eCAL_pb_eTimeSyncState_ARRAYSIZE ((eCAL_pb_eTimeSyncState)(eCAL_pb_eTimeSyncState_tsync_replay+1)) #define eCAL_pb_ProcessState_severity_ENUMTYPE eCAL_pb_eProcessSeverity #define eCAL_pb_ProcessState_severity_level_ENUMTYPE eCAL_pb_eProcessSeverityLevel -#define eCAL_pb_Process_tsync_state_ENUMTYPE eCAL_pb_eTSyncState +#define eCAL_pb_Process_time_sync_state_ENUMTYPE eCAL_pb_eTimeSyncState /* Initializer values for message structs */ #define eCAL_pb_ProcessState_init_default {_eCAL_pb_eProcessSeverity_MIN, {{NULL}, NULL}, _eCAL_pb_eProcessSeverityLevel_MIN} -#define eCAL_pb_Process_init_default {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_default, _eCAL_pb_eTSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define eCAL_pb_Process_init_default {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_default, _eCAL_pb_eTimeSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} #define eCAL_pb_ProcessState_init_zero {_eCAL_pb_eProcessSeverity_MIN, {{NULL}, NULL}, _eCAL_pb_eProcessSeverityLevel_MIN} -#define eCAL_pb_Process_init_zero {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_zero, _eCAL_pb_eTSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define eCAL_pb_Process_init_zero {0, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, eCAL_pb_ProcessState_init_zero, _eCAL_pb_eTimeSyncState_MIN, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} /* Field tags (for use in manual encoding/decoding) */ #define eCAL_pb_ProcessState_severity_tag 1 #define eCAL_pb_ProcessState_info_tag 2 #define eCAL_pb_ProcessState_severity_level_tag 3 -#define eCAL_pb_Process_rclock_tag 1 -#define eCAL_pb_Process_hname_tag 2 -#define eCAL_pb_Process_pid_tag 3 -#define eCAL_pb_Process_pname_tag 4 -#define eCAL_pb_Process_uname_tag 5 -#define eCAL_pb_Process_pparam_tag 6 +#define eCAL_pb_Process_registration_clock_tag 1 +#define eCAL_pb_Process_host_name_tag 2 +#define eCAL_pb_Process_process_id_tag 3 +#define eCAL_pb_Process_process_name_tag 4 +#define eCAL_pb_Process_unit_name_tag 5 +#define eCAL_pb_Process_process_parameter_tag 6 #define eCAL_pb_Process_state_tag 12 -#define eCAL_pb_Process_tsync_state_tag 13 -#define eCAL_pb_Process_tsync_mod_name_tag 14 +#define eCAL_pb_Process_time_sync_state_tag 13 +#define eCAL_pb_Process_time_sync_module_name_tag 14 #define eCAL_pb_Process_component_init_state_tag 15 #define eCAL_pb_Process_component_init_info_tag 16 #define eCAL_pb_Process_ecal_runtime_version_tag 17 @@ -119,15 +119,15 @@ X(a, STATIC, SINGULAR, UENUM, severity_level, 3) #define eCAL_pb_ProcessState_DEFAULT NULL #define eCAL_pb_Process_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, rclock, 1) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 2) \ -X(a, STATIC, SINGULAR, INT32, pid, 3) \ -X(a, CALLBACK, SINGULAR, STRING, pname, 4) \ -X(a, CALLBACK, SINGULAR, STRING, uname, 5) \ -X(a, CALLBACK, SINGULAR, STRING, pparam, 6) \ +X(a, STATIC, SINGULAR, INT32, registration_clock, 1) \ +X(a, CALLBACK, SINGULAR, STRING, host_name, 2) \ +X(a, STATIC, SINGULAR, INT32, process_id, 3) \ +X(a, CALLBACK, SINGULAR, STRING, process_name, 4) \ +X(a, CALLBACK, SINGULAR, STRING, unit_name, 5) \ +X(a, CALLBACK, SINGULAR, STRING, process_parameter, 6) \ X(a, STATIC, OPTIONAL, MESSAGE, state, 12) \ -X(a, STATIC, SINGULAR, UENUM, tsync_state, 13) \ -X(a, CALLBACK, SINGULAR, STRING, tsync_mod_name, 14) \ +X(a, STATIC, SINGULAR, UENUM, time_sync_state, 13) \ +X(a, CALLBACK, SINGULAR, STRING, time_sync_module_name, 14) \ X(a, STATIC, SINGULAR, INT32, component_init_state, 15) \ X(a, CALLBACK, SINGULAR, STRING, component_init_info, 16) \ X(a, CALLBACK, SINGULAR, STRING, ecal_runtime_version, 17) \ diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h index 51cf81e9ba..c630e9e050 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h @@ -19,13 +19,13 @@ typedef enum _eCAL_pb_ServiceHeader_eCallState { /* Struct definitions */ typedef struct _eCAL_pb_ServiceHeader { - pb_callback_t hname; /* host name */ - pb_callback_t sname; /* service name */ - pb_callback_t mname; /* method name */ + pb_callback_t host_name; /* host name */ + pb_callback_t service_name; /* service name */ + pb_callback_t method_name; /* method name */ pb_callback_t error; /* error message */ int32_t id; /* session id */ eCAL_pb_ServiceHeader_eCallState state; /* method call state */ - pb_callback_t sid; /* service id */ + pb_callback_t service_id; /* service id */ } eCAL_pb_ServiceHeader; typedef struct _eCAL_pb_Request { @@ -42,41 +42,41 @@ typedef struct _eCAL_pb_Response { } eCAL_pb_Response; typedef struct _eCAL_pb_Method { - pb_callback_t mname; /* method name */ - pb_callback_t req_type; /* request type (deprecated use req_datatype) */ - pb_callback_t resp_type; /* response type (deprecated use resp_datatype) */ + pb_callback_t method_name; /* method name */ + pb_callback_t req_type; /* request type (deprecated use request_datatype_information) */ + pb_callback_t resp_type; /* response type (deprecated use response_datatype_information) */ int64_t call_count; /* call counter */ - pb_callback_t req_desc; /* request descriptor (deprecated use req_datatype) */ - pb_callback_t resp_desc; /* response descriptor (deprecated use resp_datatype) */ - bool has_req_datatype; - eCAL_pb_DataTypeInformation req_datatype; /* request datatype information (encoding & type & description) */ - bool has_resp_datatype; - eCAL_pb_DataTypeInformation resp_datatype; /* response datatype information (encoding & type & description) */ + pb_callback_t req_desc; /* request descriptor (deprecated use request_datatype_information) */ + pb_callback_t resp_desc; /* response descriptor (deprecated use response_datatype_information) */ + bool has_request_datatype_information; + eCAL_pb_DataTypeInformation request_datatype_information; /* request datatype information (encoding & type & description) */ + bool has_response_datatype_information; + eCAL_pb_DataTypeInformation response_datatype_information; /* response datatype information (encoding & type & description) */ } eCAL_pb_Method; typedef struct _eCAL_pb_Service { - int32_t rclock; /* registration clock */ - pb_callback_t hname; /* host name */ - pb_callback_t pname; /* process name */ - pb_callback_t uname; /* unit name */ - int32_t pid; /* process id */ - pb_callback_t sname; /* service name */ + int32_t registration_clock; /* registration clock */ + pb_callback_t host_name; /* host name */ + pb_callback_t process_name; /* process name */ + pb_callback_t unit_name; /* unit name */ + int32_t process_id; /* process id */ + pb_callback_t service_name; /* service name */ uint32_t tcp_port_v0; /* the tcp port used for that service (deprecated) */ pb_callback_t methods; /* list of methods */ - pb_callback_t sid; /* service id */ + pb_callback_t service_id; /* service id */ /* transport specific parameter (for internal use) */ uint32_t version; /* service protocol version */ uint32_t tcp_port_v1; /* the tcp port used for that service */ } eCAL_pb_Service; typedef struct _eCAL_pb_Client { - int32_t rclock; /* registration clock */ - pb_callback_t hname; /* host name */ - pb_callback_t pname; /* process name */ - pb_callback_t uname; /* unit name */ - int32_t pid; /* process id */ - pb_callback_t sname; /* service name */ - pb_callback_t sid; /* service id */ + int32_t registration_clock; /* registration clock */ + pb_callback_t host_name; /* host name */ + pb_callback_t process_name; /* process name */ + pb_callback_t unit_name; /* unit name */ + int32_t process_id; /* process id */ + pb_callback_t service_name; /* service name */ + pb_callback_t service_id; /* service id */ /* transport specific parameter (for internal use) */ uint32_t version; /* client protocol version */ pb_callback_t methods; /* list of methods */ @@ -115,56 +115,56 @@ extern "C" { #define eCAL_pb_Client_init_zero {0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}, 0, {{NULL}, NULL}} /* Field tags (for use in manual encoding/decoding) */ -#define eCAL_pb_ServiceHeader_hname_tag 1 -#define eCAL_pb_ServiceHeader_sname_tag 2 -#define eCAL_pb_ServiceHeader_mname_tag 3 +#define eCAL_pb_ServiceHeader_host_name_tag 1 +#define eCAL_pb_ServiceHeader_service_name_tag 2 +#define eCAL_pb_ServiceHeader_method_name_tag 3 #define eCAL_pb_ServiceHeader_error_tag 4 #define eCAL_pb_ServiceHeader_id_tag 5 #define eCAL_pb_ServiceHeader_state_tag 6 -#define eCAL_pb_ServiceHeader_sid_tag 7 +#define eCAL_pb_ServiceHeader_service_id_tag 7 #define eCAL_pb_Request_header_tag 1 #define eCAL_pb_Request_request_tag 2 #define eCAL_pb_Response_header_tag 1 #define eCAL_pb_Response_response_tag 2 #define eCAL_pb_Response_ret_state_tag 3 -#define eCAL_pb_Method_mname_tag 1 +#define eCAL_pb_Method_method_name_tag 1 #define eCAL_pb_Method_req_type_tag 2 #define eCAL_pb_Method_resp_type_tag 3 #define eCAL_pb_Method_call_count_tag 4 #define eCAL_pb_Method_req_desc_tag 5 #define eCAL_pb_Method_resp_desc_tag 6 -#define eCAL_pb_Method_req_datatype_tag 7 -#define eCAL_pb_Method_resp_datatype_tag 8 -#define eCAL_pb_Service_rclock_tag 1 -#define eCAL_pb_Service_hname_tag 2 -#define eCAL_pb_Service_pname_tag 3 -#define eCAL_pb_Service_uname_tag 4 -#define eCAL_pb_Service_pid_tag 5 -#define eCAL_pb_Service_sname_tag 6 +#define eCAL_pb_Method_request_datatype_information_tag 7 +#define eCAL_pb_Method_response_datatype_information_tag 8 +#define eCAL_pb_Service_registration_clock_tag 1 +#define eCAL_pb_Service_host_name_tag 2 +#define eCAL_pb_Service_process_name_tag 3 +#define eCAL_pb_Service_unit_name_tag 4 +#define eCAL_pb_Service_process_id_tag 5 +#define eCAL_pb_Service_service_name_tag 6 #define eCAL_pb_Service_tcp_port_v0_tag 7 #define eCAL_pb_Service_methods_tag 8 -#define eCAL_pb_Service_sid_tag 9 +#define eCAL_pb_Service_service_id_tag 9 #define eCAL_pb_Service_version_tag 10 #define eCAL_pb_Service_tcp_port_v1_tag 11 -#define eCAL_pb_Client_rclock_tag 1 -#define eCAL_pb_Client_hname_tag 2 -#define eCAL_pb_Client_pname_tag 3 -#define eCAL_pb_Client_uname_tag 4 -#define eCAL_pb_Client_pid_tag 5 -#define eCAL_pb_Client_sname_tag 6 -#define eCAL_pb_Client_sid_tag 7 +#define eCAL_pb_Client_registration_clock_tag 1 +#define eCAL_pb_Client_host_name_tag 2 +#define eCAL_pb_Client_process_name_tag 3 +#define eCAL_pb_Client_unit_name_tag 4 +#define eCAL_pb_Client_process_id_tag 5 +#define eCAL_pb_Client_service_name_tag 6 +#define eCAL_pb_Client_service_id_tag 7 #define eCAL_pb_Client_version_tag 8 #define eCAL_pb_Client_methods_tag 9 /* Struct field encoding specification for nanopb */ #define eCAL_pb_ServiceHeader_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 1) \ -X(a, CALLBACK, SINGULAR, STRING, sname, 2) \ -X(a, CALLBACK, SINGULAR, STRING, mname, 3) \ +X(a, CALLBACK, SINGULAR, STRING, host_name, 1) \ +X(a, CALLBACK, SINGULAR, STRING, service_name, 2) \ +X(a, CALLBACK, SINGULAR, STRING, method_name, 3) \ X(a, CALLBACK, SINGULAR, STRING, error, 4) \ X(a, STATIC, SINGULAR, INT32, id, 5) \ X(a, STATIC, SINGULAR, UENUM, state, 6) \ -X(a, CALLBACK, SINGULAR, STRING, sid, 7) +X(a, CALLBACK, SINGULAR, STRING, service_id, 7) #define eCAL_pb_ServiceHeader_CALLBACK pb_default_field_callback #define eCAL_pb_ServiceHeader_DEFAULT NULL @@ -184,29 +184,29 @@ X(a, STATIC, SINGULAR, INT64, ret_state, 3) #define eCAL_pb_Response_header_MSGTYPE eCAL_pb_ServiceHeader #define eCAL_pb_Method_FIELDLIST(X, a) \ -X(a, CALLBACK, SINGULAR, STRING, mname, 1) \ +X(a, CALLBACK, SINGULAR, STRING, method_name, 1) \ X(a, CALLBACK, SINGULAR, STRING, req_type, 2) \ X(a, CALLBACK, SINGULAR, STRING, resp_type, 3) \ X(a, STATIC, SINGULAR, INT64, call_count, 4) \ X(a, CALLBACK, SINGULAR, BYTES, req_desc, 5) \ X(a, CALLBACK, SINGULAR, BYTES, resp_desc, 6) \ -X(a, STATIC, OPTIONAL, MESSAGE, req_datatype, 7) \ -X(a, STATIC, OPTIONAL, MESSAGE, resp_datatype, 8) +X(a, STATIC, OPTIONAL, MESSAGE, request_datatype_information, 7) \ +X(a, STATIC, OPTIONAL, MESSAGE, response_datatype_information, 8) #define eCAL_pb_Method_CALLBACK pb_default_field_callback #define eCAL_pb_Method_DEFAULT NULL -#define eCAL_pb_Method_req_datatype_MSGTYPE eCAL_pb_DataTypeInformation -#define eCAL_pb_Method_resp_datatype_MSGTYPE eCAL_pb_DataTypeInformation +#define eCAL_pb_Method_request_datatype_information_MSGTYPE eCAL_pb_DataTypeInformation +#define eCAL_pb_Method_response_datatype_information_MSGTYPE eCAL_pb_DataTypeInformation #define eCAL_pb_Service_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, rclock, 1) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 2) \ -X(a, CALLBACK, SINGULAR, STRING, pname, 3) \ -X(a, CALLBACK, SINGULAR, STRING, uname, 4) \ -X(a, STATIC, SINGULAR, INT32, pid, 5) \ -X(a, CALLBACK, SINGULAR, STRING, sname, 6) \ +X(a, STATIC, SINGULAR, INT32, registration_clock, 1) \ +X(a, CALLBACK, SINGULAR, STRING, host_name, 2) \ +X(a, CALLBACK, SINGULAR, STRING, process_name, 3) \ +X(a, CALLBACK, SINGULAR, STRING, unit_name, 4) \ +X(a, STATIC, SINGULAR, INT32, process_id, 5) \ +X(a, CALLBACK, SINGULAR, STRING, service_name, 6) \ X(a, STATIC, SINGULAR, UINT32, tcp_port_v0, 7) \ X(a, CALLBACK, REPEATED, MESSAGE, methods, 8) \ -X(a, CALLBACK, SINGULAR, STRING, sid, 9) \ +X(a, CALLBACK, SINGULAR, STRING, service_id, 9) \ X(a, STATIC, SINGULAR, UINT32, version, 10) \ X(a, STATIC, SINGULAR, UINT32, tcp_port_v1, 11) #define eCAL_pb_Service_CALLBACK pb_default_field_callback @@ -214,13 +214,13 @@ X(a, STATIC, SINGULAR, UINT32, tcp_port_v1, 11) #define eCAL_pb_Service_methods_MSGTYPE eCAL_pb_Method #define eCAL_pb_Client_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, rclock, 1) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 2) \ -X(a, CALLBACK, SINGULAR, STRING, pname, 3) \ -X(a, CALLBACK, SINGULAR, STRING, uname, 4) \ -X(a, STATIC, SINGULAR, INT32, pid, 5) \ -X(a, CALLBACK, SINGULAR, STRING, sname, 6) \ -X(a, CALLBACK, SINGULAR, STRING, sid, 7) \ +X(a, STATIC, SINGULAR, INT32, registration_clock, 1) \ +X(a, CALLBACK, SINGULAR, STRING, host_name, 2) \ +X(a, CALLBACK, SINGULAR, STRING, process_name, 3) \ +X(a, CALLBACK, SINGULAR, STRING, unit_name, 4) \ +X(a, STATIC, SINGULAR, INT32, process_id, 5) \ +X(a, CALLBACK, SINGULAR, STRING, service_name, 6) \ +X(a, CALLBACK, SINGULAR, STRING, service_id, 7) \ X(a, STATIC, SINGULAR, UINT32, version, 8) \ X(a, CALLBACK, REPEATED, MESSAGE, methods, 9) #define eCAL_pb_Client_CALLBACK pb_default_field_callback diff --git a/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h index 3b21d65e3d..199c5406f2 100644 --- a/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h @@ -14,28 +14,28 @@ /* Struct definitions */ typedef struct _eCAL_pb_Topic { /* Reserved fields in enums are not supported in protobuf 3.0 reserved 9, 10, 11, 14, 15, 22 to 26, 29; */ - int32_t rclock; /* registration clock (heart beat) */ - pb_callback_t hname; /* host name */ - int32_t pid; /* process id */ - pb_callback_t pname; /* process name */ - pb_callback_t uname; /* unit name */ - pb_callback_t tid; /* topic id */ - pb_callback_t tname; /* topic name */ + int32_t registration_clock; /* registration clock (heart beat) */ + pb_callback_t host_name; /* host name */ + int32_t process_id; /* process id */ + pb_callback_t process_name; /* process name */ + pb_callback_t unit_name; /* unit name */ + pb_callback_t topic_id; /* topic id */ + pb_callback_t topic_name; /* topic name */ pb_callback_t direction; /* direction (publisher, subscriber) */ - pb_callback_t tlayer; /* active topic transport layers and it's specific parameter */ - int32_t tsize; /* topic size */ - int32_t connections_loc; /* number of local connected entities */ - int32_t connections_ext; /* number of external connected entities */ + pb_callback_t transport_layer; /* active topic transport layers and it's specific parameter */ + int32_t topic_size; /* topic size */ + int32_t connections_local; /* number of local connected entities */ + int32_t connections_external; /* number of external connected entities */ int32_t message_drops; /* dropped messages */ - int64_t did; /* data send id (publisher setid) */ - int64_t dclock; /* data clock (send / receive action) */ - int32_t dfreq; /* data frequency (send / receive samples per second) [mHz] */ + int64_t data_id; /* data send id (publisher setid) */ + int64_t data_clock; /* data clock (send / receive action) */ + int32_t data_frequency; /* data frequency (send / receive samples per second) [mHz] */ pb_callback_t attr; /* generic topic description */ pb_callback_t shm_transport_domain; /* shm_transport_domain */ /* 9 = topic type + topic encoding (deprecated) 10 = topic description (protocol descriptor) (deprecated) */ - bool has_tdatatype; - eCAL_pb_DataTypeInformation tdatatype; /* topic datatype information (encoding & type & description) */ + bool has_datatype_information; + eCAL_pb_DataTypeInformation datatype_information; /* topic datatype information (encoding & type & description) */ } eCAL_pb_Topic; typedef struct _eCAL_pb_Topic_AttrEntry { @@ -55,54 +55,54 @@ extern "C" { #define eCAL_pb_Topic_AttrEntry_init_zero {{{NULL}, NULL}, {{NULL}, NULL}} /* Field tags (for use in manual encoding/decoding) */ -#define eCAL_pb_Topic_rclock_tag 1 -#define eCAL_pb_Topic_hname_tag 2 -#define eCAL_pb_Topic_pid_tag 3 -#define eCAL_pb_Topic_pname_tag 4 -#define eCAL_pb_Topic_uname_tag 5 -#define eCAL_pb_Topic_tid_tag 6 -#define eCAL_pb_Topic_tname_tag 7 +#define eCAL_pb_Topic_registration_clock_tag 1 +#define eCAL_pb_Topic_host_name_tag 2 +#define eCAL_pb_Topic_process_id_tag 3 +#define eCAL_pb_Topic_process_name_tag 4 +#define eCAL_pb_Topic_unit_name_tag 5 +#define eCAL_pb_Topic_topic_id_tag 6 +#define eCAL_pb_Topic_topic_name_tag 7 #define eCAL_pb_Topic_direction_tag 8 -#define eCAL_pb_Topic_tlayer_tag 12 -#define eCAL_pb_Topic_tsize_tag 13 -#define eCAL_pb_Topic_connections_loc_tag 16 -#define eCAL_pb_Topic_connections_ext_tag 17 +#define eCAL_pb_Topic_transport_layer_tag 12 +#define eCAL_pb_Topic_topic_size_tag 13 +#define eCAL_pb_Topic_connections_local_tag 16 +#define eCAL_pb_Topic_connections_external_tag 17 #define eCAL_pb_Topic_message_drops_tag 18 -#define eCAL_pb_Topic_did_tag 19 -#define eCAL_pb_Topic_dclock_tag 20 -#define eCAL_pb_Topic_dfreq_tag 21 +#define eCAL_pb_Topic_data_id_tag 19 +#define eCAL_pb_Topic_data_clock_tag 20 +#define eCAL_pb_Topic_data_frequency_tag 21 #define eCAL_pb_Topic_attr_tag 27 #define eCAL_pb_Topic_shm_transport_domain_tag 28 -#define eCAL_pb_Topic_tdatatype_tag 30 +#define eCAL_pb_Topic_datatype_information_tag 30 #define eCAL_pb_Topic_AttrEntry_key_tag 1 #define eCAL_pb_Topic_AttrEntry_value_tag 2 /* Struct field encoding specification for nanopb */ #define eCAL_pb_Topic_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, rclock, 1) \ -X(a, CALLBACK, SINGULAR, STRING, hname, 2) \ -X(a, STATIC, SINGULAR, INT32, pid, 3) \ -X(a, CALLBACK, SINGULAR, STRING, pname, 4) \ -X(a, CALLBACK, SINGULAR, STRING, uname, 5) \ -X(a, CALLBACK, SINGULAR, STRING, tid, 6) \ -X(a, CALLBACK, SINGULAR, STRING, tname, 7) \ +X(a, STATIC, SINGULAR, INT32, registration_clock, 1) \ +X(a, CALLBACK, SINGULAR, STRING, host_name, 2) \ +X(a, STATIC, SINGULAR, INT32, process_id, 3) \ +X(a, CALLBACK, SINGULAR, STRING, process_name, 4) \ +X(a, CALLBACK, SINGULAR, STRING, unit_name, 5) \ +X(a, CALLBACK, SINGULAR, STRING, topic_id, 6) \ +X(a, CALLBACK, SINGULAR, STRING, topic_name, 7) \ X(a, CALLBACK, SINGULAR, STRING, direction, 8) \ -X(a, CALLBACK, REPEATED, MESSAGE, tlayer, 12) \ -X(a, STATIC, SINGULAR, INT32, tsize, 13) \ -X(a, STATIC, SINGULAR, INT32, connections_loc, 16) \ -X(a, STATIC, SINGULAR, INT32, connections_ext, 17) \ +X(a, CALLBACK, REPEATED, MESSAGE, transport_layer, 12) \ +X(a, STATIC, SINGULAR, INT32, topic_size, 13) \ +X(a, STATIC, SINGULAR, INT32, connections_local, 16) \ +X(a, STATIC, SINGULAR, INT32, connections_external, 17) \ X(a, STATIC, SINGULAR, INT32, message_drops, 18) \ -X(a, STATIC, SINGULAR, INT64, did, 19) \ -X(a, STATIC, SINGULAR, INT64, dclock, 20) \ -X(a, STATIC, SINGULAR, INT32, dfreq, 21) \ +X(a, STATIC, SINGULAR, INT64, data_id, 19) \ +X(a, STATIC, SINGULAR, INT64, data_clock, 20) \ +X(a, STATIC, SINGULAR, INT32, data_frequency, 21) \ X(a, CALLBACK, REPEATED, MESSAGE, attr, 27) \ X(a, CALLBACK, SINGULAR, STRING, shm_transport_domain, 28) \ -X(a, STATIC, OPTIONAL, MESSAGE, tdatatype, 30) +X(a, STATIC, OPTIONAL, MESSAGE, datatype_information, 30) #define eCAL_pb_Topic_CALLBACK pb_default_field_callback #define eCAL_pb_Topic_DEFAULT NULL -#define eCAL_pb_Topic_tlayer_MSGTYPE eCAL_pb_TLayer +#define eCAL_pb_Topic_transport_layer_MSGTYPE eCAL_pb_TransportLayer #define eCAL_pb_Topic_attr_MSGTYPE eCAL_pb_Topic_AttrEntry -#define eCAL_pb_Topic_tdatatype_MSGTYPE eCAL_pb_DataTypeInformation +#define eCAL_pb_Topic_datatype_information_MSGTYPE eCAL_pb_DataTypeInformation #define eCAL_pb_Topic_AttrEntry_FIELDLIST(X, a) \ X(a, CALLBACK, SINGULAR, STRING, key, 1) \ diff --git a/ecal/core/src/service/ecal_clientgate.cpp b/ecal/core/src/service/ecal_clientgate.cpp index dad0fd6cee..1b16b16a7e 100644 --- a/ecal/core/src/service/ecal_clientgate.cpp +++ b/ecal/core/src/service/ecal_clientgate.cpp @@ -97,9 +97,9 @@ namespace eCAL const auto& ecal_sample_service = ecal_sample_.service; const auto& ecal_sample_identifier = ecal_sample_.identifier; service.hname = ecal_sample_identifier.host_name; - service.pname = ecal_sample_service.pname; - service.uname = ecal_sample_service.uname; - service.sname = ecal_sample_service.sname; + service.pname = ecal_sample_service.process_name; + service.uname = ecal_sample_service.unit_name; + service.sname = ecal_sample_service.service_name; service.sid = ecal_sample_identifier.entity_id; service.pid = static_cast(ecal_sample_identifier.process_id); diff --git a/ecal/core/src/service/ecal_service_client_impl.cpp b/ecal/core/src/service/ecal_service_client_impl.cpp index cf68dfc8f8..e86e5562a8 100644 --- a/ecal/core/src/service/ecal_service_client_impl.cpp +++ b/ecal/core/src/service/ecal_service_client_impl.cpp @@ -40,7 +40,7 @@ namespace std::shared_ptr SerializeRequest(const std::string& method_name_, const std::string& request_) { eCAL::Service::Request request; - request.header.mname = method_name_; + request.header.method_name = method_name_; request.request = request_; auto request_shared_ptr = std::make_shared(); eCAL::SerializeToBuffer(request, *request_shared_ptr); @@ -361,9 +361,9 @@ namespace eCAL auto& service_client = ecal_reg_sample.client; service_client.version = m_client_version; - service_client.pname = Process::GetProcessName(); - service_client.uname = Process::GetUnitName(); - service_client.sname = m_service_name; + service_client.process_name = Process::GetProcessName(); + service_client.unit_name = Process::GetUnitName(); + service_client.service_name = m_service_name; const std::lock_guard lock(m_method_information_set_mutex); for (const auto& method_information : m_method_information_set) @@ -371,7 +371,7 @@ namespace eCAL const auto& method_name = method_information.method_name; Service::Method method; - method.mname = method_name; + method.method_name = method_name; // old type and descriptor fields method.req_type = method_information.request_type.name; @@ -380,8 +380,8 @@ namespace eCAL method.resp_desc = method_information.response_type.descriptor; // new type and descriptor fields - method.req_datatype = method_information.request_type; - method.resp_datatype = method_information.response_type; + method.request_datatype_information = method_information.request_type; + method.response_datatype_information = method_information.response_type; { const auto& call_count_iter = m_method_call_count_map.find(method_name); @@ -407,9 +407,9 @@ namespace eCAL auto& service_client = ecal_reg_sample.client; service_client.version = m_client_version; - service_client.pname = Process::GetProcessName(); - service_client.uname = Process::GetUnitName(); - service_client.sname = m_service_name; + service_client.process_name = Process::GetProcessName(); + service_client.unit_name = Process::GetUnitName(); + service_client.service_name = m_service_name; return ecal_reg_sample; } @@ -481,13 +481,13 @@ namespace eCAL auto state = client_data.client_session->get_state(); SEntityId entity_id; - entity_id.entity_id = client_data.service_attr.sid; + entity_id.entity_id = client_data.service_attr.sid; entity_id.process_id = client_data.service_attr.pid; - entity_id.host_name = client_data.service_attr.hname; + entity_id.host_name = client_data.service_attr.hname; SServiceId service_id; service_id.service_name = m_service_name; - service_id.service_id = entity_id; + service_id.service_id = entity_id; if (!client_data.connected && state == ecal_service::State::CONNECTED) { @@ -536,11 +536,11 @@ namespace eCAL auto data = std::make_shared(); data->response->first = false; - data->response->second.service_method_id.service_id.entity_id = client_.service_attr.sid; + data->response->second.service_method_id.service_id.entity_id = client_.service_attr.sid; data->response->second.service_method_id.service_id.process_id = client_.service_attr.pid; - data->response->second.service_method_id.service_id.host_name = client_.service_attr.hname; + data->response->second.service_method_id.service_id.host_name = client_.service_attr.hname; - data->response->second.service_method_id.service_name = client_.service_attr.sname; + data->response->second.service_method_id.service_name = client_.service_attr.sname; data->response->second.service_method_information.method_name = method_name_; // TODO we need to fill SDatatypeInformation @@ -582,13 +582,13 @@ namespace eCAL { const auto& response_header = response.header; // service/method id - service_reponse.service_method_id.service_id.entity_id = client_.service_attr.sid; + service_reponse.service_method_id.service_id.entity_id = client_.service_attr.sid; service_reponse.service_method_id.service_id.process_id = client_.service_attr.pid; - service_reponse.service_method_id.service_id.host_name = response_header.hname; + service_reponse.service_method_id.service_id.host_name = response_header.host_name; // service and method name - service_reponse.service_method_id.service_name = response_header.sname; - service_reponse.service_method_information.method_name = response_header.mname; + service_reponse.service_method_id.service_name = response_header.service_name; + service_reponse.service_method_information.method_name = response_header.method_name; // TODO fill in information about datatypes. Do we have them? from the other clients? we should??? // error message and return state diff --git a/ecal/core/src/service/ecal_service_server_impl.cpp b/ecal/core/src/service/ecal_service_server_impl.cpp index 2a40242ae3..4d4f849b63 100644 --- a/ecal/core/src/service/ecal_service_server_impl.cpp +++ b/ecal/core/src/service/ecal_service_server_impl.cpp @@ -82,8 +82,8 @@ namespace eCAL #if 0 // this is how it should look like if we do not use the old type and descriptor fields // update data type and callback - iter->second.method.req_datatype = method_info_.request_type; - iter->second.method.resp_datatype = method_info_.response_type; + iter->second.method.request_datatype_information = method_info_.request_type; + iter->second.method.response_datatype_information = method_info_.response_type; iter->second.callback = callback_; #else ///////////////////////////////////////////// @@ -99,14 +99,14 @@ namespace eCAL ///////////////////////////////////////////// // new types, encodings and descriptors ///////////////////////////////////////////// - iter->second.method.req_datatype.name = method_info_.request_type.name; - iter->second.method.resp_datatype.name = method_info_.response_type.name; + iter->second.method.request_datatype_information.name = method_info_.request_type.name; + iter->second.method.response_datatype_information.name = method_info_.response_type.name; // we need to check these fields, because the v5 implementation is using SetMethodCallback with partially filled fields - if (!method_info_.request_type.encoding.empty()) iter->second.method.req_datatype.encoding = method_info_.request_type.encoding; - if (!method_info_.response_type.encoding.empty()) iter->second.method.resp_datatype.encoding = method_info_.response_type.encoding; - if (!method_info_.request_type.descriptor.empty()) iter->second.method.req_datatype.descriptor = method_info_.request_type.descriptor; - if (!method_info_.response_type.descriptor.empty()) iter->second.method.resp_datatype.descriptor = method_info_.response_type.descriptor; + if (!method_info_.request_type.encoding.empty()) iter->second.method.request_datatype_information.encoding = method_info_.request_type.encoding; + if (!method_info_.response_type.encoding.empty()) iter->second.method.response_datatype_information.encoding = method_info_.response_type.encoding; + if (!method_info_.request_type.descriptor.empty()) iter->second.method.request_datatype_information.descriptor = method_info_.request_type.descriptor; + if (!method_info_.response_type.descriptor.empty()) iter->second.method.response_datatype_information.descriptor = method_info_.response_type.descriptor; // we need to do this ugly hack here, because the v5 implementation is using SetMethodCallback with nullptr to update descriptions (AddDescription) if (callback_ != nullptr) @@ -122,12 +122,12 @@ namespace eCAL #endif SMethod method; // method name - method.method.mname = method_; + method.method.method_name = method_; #if 0 // this is how it should look like if we do not use the old type and descriptor fields // set data type and callback - method.method.req_datatype = method_info_.request_type; - method.method.resp_datatype = method_info_.response_type; + method.method.request_datatype_information = method_info_.request_type; + method.method.response_datatype_information = method_info_.response_type; method.callback = callback_; #else #endif @@ -144,14 +144,14 @@ namespace eCAL ///////////////////////////////////////////// // new types, encodings and descriptors ///////////////////////////////////////////// - method.method.req_datatype.name = method_info_.request_type.name; - method.method.resp_datatype.name = method_info_.response_type.name; + method.method.request_datatype_information.name = method_info_.request_type.name; + method.method.response_datatype_information.name = method_info_.response_type.name; // we need to check these fields, because the v5 implementation is using SetMethodCallback with partially filled fields - if (!method_info_.request_type.encoding.empty()) method.method.req_datatype.encoding = method_info_.request_type.encoding; - if (!method_info_.response_type.encoding.empty()) method.method.resp_datatype.encoding = method_info_.response_type.encoding; - if (!method_info_.request_type.descriptor.empty()) method.method.req_datatype.descriptor = method_info_.request_type.descriptor; - if (!method_info_.response_type.descriptor.empty()) method.method.resp_datatype.descriptor = method_info_.response_type.descriptor; + if (!method_info_.request_type.encoding.empty()) method.method.request_datatype_information.encoding = method_info_.request_type.encoding; + if (!method_info_.response_type.encoding.empty()) method.method.response_datatype_information.encoding = method_info_.response_type.encoding; + if (!method_info_.request_type.descriptor.empty()) method.method.request_datatype_information.descriptor = method_info_.request_type.descriptor; + if (!method_info_.response_type.descriptor.empty()) method.method.response_datatype_information.descriptor = method_info_.response_type.descriptor; // we need to do this ugly hack here, because the v5 implementation is using SetMethodCallback with nullptr to update descriptions (AddDescription) if (callback_ != nullptr) @@ -360,9 +360,9 @@ namespace eCAL auto& service = ecal_reg_sample.service; service.version = m_server_version; - service.pname = Process::GetProcessName(); - service.uname = Process::GetUnitName(); - service.sname = m_service_name; + service.process_name = Process::GetProcessName(); + service.unit_name = Process::GetUnitName(); + service.service_name = m_service_name; service.tcp_port_v0 = 0; service.tcp_port_v1 = server_tcp_port; @@ -371,7 +371,7 @@ namespace eCAL for (const auto& iter : m_method_map) { Service::Method method; - method.mname = iter.first; + method.method_name = iter.first; // old type and descriptor fields method.req_type = iter.second.method.req_type; @@ -380,8 +380,8 @@ namespace eCAL method.resp_desc = iter.second.method.resp_desc; // new type and descriptor fields - method.req_datatype = iter.second.method.req_datatype; - method.resp_datatype = iter.second.method.resp_datatype; + method.request_datatype_information = iter.second.method.request_datatype_information; + method.response_datatype_information = iter.second.method.response_datatype_information; method.call_count = iter.second.method.call_count; service.methods.push_back(method); @@ -403,9 +403,9 @@ namespace eCAL auto& service = ecal_reg_sample.service; service.version = m_server_version; - service.pname = Process::GetProcessName(); - service.uname = Process::GetUnitName(); - service.sname = m_service_name; + service.process_name = Process::GetProcessName(); + service.unit_name = Process::GetUnitName(); + service.service_name = m_service_name; return ecal_reg_sample; } @@ -419,9 +419,9 @@ namespace eCAL // prepare response Service::Response response; auto& response_header = response.header; - response_header.hname = Process::GetHostName(); - response_header.sname = m_service_name; - response_header.sid = std::to_string(m_service_id); // TODO: Service ID currently defined as string, should be integer as well + response_header.host_name = Process::GetHostName(); + response_header.service_name = m_service_name; + response_header.service_id = std::to_string(m_service_id); // TODO: Service ID currently defined as string, should be integer as well // try to parse request Service::Request request; @@ -445,16 +445,16 @@ namespace eCAL // get method SMethod method; const auto& request_header = request.header; - response_header.mname = request_header.mname; + response_header.method_name = request_header.method_name; { const std::lock_guard lock(m_method_map_mutex); - auto requested_method_iterator = m_method_map.find(request_header.mname); + auto requested_method_iterator = m_method_map.find(request_header.method_name); if (requested_method_iterator == m_method_map.end()) { // set method call state 'failed' response_header.state = Service::eMethodCallState::failed; // set error message - const std::string emsg = "CServiceServerImpl: Service '" + m_service_name + "' has no method named '" + request_header.mname + "'"; + const std::string emsg = "CServiceServerImpl: Service '" + m_service_name + "' has no method named '" + request_header.method_name + "'"; response_header.error = emsg; // TODO: The next version of the service protocol should omit the double-serialization (i.e. copying the binary data in a protocol buffer and then serializing that again) @@ -476,9 +476,9 @@ namespace eCAL const std::string& request_s = request.request; std::string response_s; const SServiceMethodInformation method_info{ - method.method.mname, - method.method.req_datatype, - method.method.resp_datatype + method.method.method_name, + method.method.request_datatype_information, + method.method.response_datatype_information }; const int service_return_state = method.callback(method_info, request_s, response_s); diff --git a/ecal/core_pb/src/ecal/core/pb/datatype.proto b/ecal/core_pb/src/ecal/core/pb/datatype.proto index 8eb0b9e881..18b9ccf888 100644 --- a/ecal/core_pb/src/ecal/core/pb/datatype.proto +++ b/ecal/core_pb/src/ecal/core/pb/datatype.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ package eCAL.pb; message DataTypeInformation { - string name = 1; // name of the datatype - string encoding = 2; // encoding of the datatype (e.g. protobuf, flatbuffers, capnproto) - bytes desc = 3; // descriptor information of the datatype (necessary for reflection) + string name = 1; // name of the datatype + string encoding = 2; // encoding of the datatype (e.g. protobuf, flatbuffers, capnproto) + bytes descriptor_information = 3; // descriptor information of the datatype (necessary for reflection) } diff --git a/ecal/core_pb/src/ecal/core/pb/host.proto b/ecal/core_pb/src/ecal/core/pb/host.proto index f16fdfe1da..3bae9980e1 100644 --- a/ecal/core_pb/src/ecal/core/pb/host.proto +++ b/ecal/core_pb/src/ecal/core/pb/host.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,11 @@ package eCAL.pb; message OSInfo // operating system details { - string osname = 1; // name + string name = 1; // name } message Host // eCAL host { - string hname = 1; // host name + string name = 1; // host name OSInfo os = 2; // operating system details } diff --git a/ecal/core_pb/src/ecal/core/pb/layer.proto b/ecal/core_pb/src/ecal/core/pb/layer.proto index db9f6d7b25..6c33d85851 100644 --- a/ecal/core_pb/src/ecal/core/pb/layer.proto +++ b/ecal/core_pb/src/ecal/core/pb/layer.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ message ConnnectionPar // connection parameter for read LayerParTcp layer_par_tcp = 4; // parameter for ecal tcp } -enum eTLayerType // transport layer +enum eTransportLayerType // transport layer { // Reserved fields in enums are not supported in protobuf 3.0 // reserved 2, 3, 42; @@ -61,14 +61,14 @@ enum eTLayerType // transport layer tl_all = 255; // all layer } -message TLayer +message TransportLayer { // Reserved fields in enums are not supported in protobuf 3.0 // reserved 4; - eTLayerType type = 1; // transport layer type - int32 version = 2; // transport layer version - bool enabled = 6; // transport layer enabled ? - bool active = 3; // transport layer in use ? - ConnnectionPar par_layer = 5; // transport layer parameter + eTransportLayerType type = 1; // transport layer type + int32 version = 2; // transport layer version + bool enabled = 6; // transport layer enabled ? + bool active = 3; // transport layer in use ? + ConnnectionPar par_layer = 5; // transport layer parameter } diff --git a/ecal/core_pb/src/ecal/core/pb/logging.proto b/ecal/core_pb/src/ecal/core/pb/logging.proto index 3957665576..f6ff98de21 100644 --- a/ecal/core_pb/src/ecal/core/pb/logging.proto +++ b/ecal/core_pb/src/ecal/core/pb/logging.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,10 @@ package eCAL.pb; message LogMessage // eCAL log message { int64 time = 1; // time - string hname = 2; // host name - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name + string host_name = 2; // host name + int32 process_id = 3; // process id + string process_name = 4; // process name + string unit_name = 5; // unit name int32 level = 6; // message level string content = 7; // message content } diff --git a/ecal/core_pb/src/ecal/core/pb/process.proto b/ecal/core_pb/src/ecal/core/pb/process.proto index f3835f14db..f250bb9ea6 100644 --- a/ecal/core_pb/src/ecal/core/pb/process.proto +++ b/ecal/core_pb/src/ecal/core/pb/process.proto @@ -47,7 +47,7 @@ message ProcessState // process state string info = 2; // info string } -enum eTSyncState // time synchronisation +enum eTimeSyncState // time synchronisation { tsync_none = 0; // not synchronized tsync_realtime = 1; // real time sync mode @@ -59,20 +59,20 @@ message Process // process // Reserved fields in enums are not supported in protobuf 3.0 // reserved 7 to 11; - int32 rclock = 1; // registration clock - string hname = 2; // host name - string shm_transport_domain = 18; // shm transport domain - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string pparam = 6; // process parameter - // 10 = data write bytes per sec - // 11 = data read bytes per sec - ProcessState state = 12; // process state info - eTSyncState tsync_state = 13; // time synchronization state - string tsync_mod_name = 14; // time synchronization module name - int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..)) - string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) - string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component - string config_file_path = 19; // Path from where the eCAL configuration for this process was loaded + int32 registration_clock = 1; // registration clock + string host_name = 2; // host name + string shm_transport_domain = 18; // shm transport domain + int32 process_id = 3; // process id + string process_name = 4; // process name + string unit_name = 5; // unit name + string process_parameter = 6; // process parameter + // 10 = data write bytes per sec + // 11 = data read bytes per sec + ProcessState state = 12; // process state info + eTimeSyncState time_sync_state = 13; // time synchronization state + string time_sync_module_name = 14; // time synchronization module name + int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..)) + string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc) + string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component + string config_file_path = 19; // Path from where the eCAL configuration for this process was loaded } diff --git a/ecal/core_pb/src/ecal/core/pb/service.proto b/ecal/core_pb/src/ecal/core/pb/service.proto index 8054bf314f..f6de5a08be 100644 --- a/ecal/core_pb/src/ecal/core/pb/service.proto +++ b/ecal/core_pb/src/ecal/core/pb/service.proto @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ message ServiceHeader failed = 2; } - string hname = 1; // host name - string sname = 2; // service name - string sid = 7; // service id - string mname = 3; // method name + string host_name = 1; // host name + string service_name = 2; // service name + string service_id = 7; // service id + string method_name = 3; // method name string error = 4; // error message int32 id = 5; // session id eCallState state = 6; // method call state @@ -56,29 +56,29 @@ message Response // server response message Method // method { - string mname = 1; // method name + string method_name = 1; // method name - string req_type = 2; // request type (deprecated use req_datatype) - bytes req_desc = 5; // request descriptor (deprecated use req_datatype) - string resp_type = 3; // response type (deprecated use resp_datatype) - bytes resp_desc = 6; // response descriptor (deprecated use resp_datatype) + string req_type = 2; // request type (deprecated use request_datatype_information) + bytes req_desc = 5; // request descriptor (deprecated use request_datatype_information) + string resp_type = 3; // response type (deprecated use response_datatype_information) + bytes resp_desc = 6; // response descriptor (deprecated use response_datatype_information) - DataTypeInformation req_datatype = 7; // request datatype information (encoding & type & description) - DataTypeInformation resp_datatype = 8; // response datatype information (encoding & type & description) + DataTypeInformation request_datatype_information = 7; // request datatype information (encoding & type & description) + DataTypeInformation response_datatype_information = 8; // response datatype information (encoding & type & description) int64 call_count = 4; // call counter } message Service // service { - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 9; // service id - repeated Method methods = 8; // list of methods + int32 registration_clock = 1; // registration clock + string host_name = 2; // host name + string process_name = 3; // process name + string unit_name = 4; // unit name + int32 process_id = 5; // process id + string service_name = 6; // service name + string service_id = 9; // service id + repeated Method methods = 8; // list of methods // transport specific parameter (for internal use) uint32 version = 10; // service protocol version @@ -86,17 +86,17 @@ message Service // service uint32 tcp_port_v1 = 11; // the tcp port used for that service } -message Client // client +message Client // client { - int32 rclock = 1; // registration clock - string hname = 2; // host name - string pname = 3; // process name - string uname = 4; // unit name - int32 pid = 5; // process id - string sname = 6; // service name - string sid = 7; // service id - repeated Method methods = 9; // list of methods + int32 registration_clock = 1; // registration clock + string host_name = 2; // host name + string process_name = 3; // process name + string unit_name = 4; // unit name + int32 process_id = 5; // process id + string service_name = 6; // service name + string service_id = 7; // service id + repeated Method methods = 9; // list of methods // transport specific parameter (for internal use) - uint32 version = 8; // client protocol version + uint32 version = 8; // client protocol version } diff --git a/ecal/core_pb/src/ecal/core/pb/topic.proto b/ecal/core_pb/src/ecal/core/pb/topic.proto index 87587ccf1c..c4f0de2da5 100644 --- a/ecal/core_pb/src/ecal/core/pb/topic.proto +++ b/ecal/core_pb/src/ecal/core/pb/topic.proto @@ -29,29 +29,29 @@ message Topic // eCAL topic // Reserved fields in enums are not supported in protobuf 3.0 // reserved 9, 10, 11, 14, 15, 22 to 26, 29; - int32 rclock = 1; // registration clock (heart beat) - string hname = 2; // host name + int32 registration_clock = 1; // registration clock (heart beat) + string host_name = 2; // host name string shm_transport_domain = 28; // shm_transport_domain - int32 pid = 3; // process id - string pname = 4; // process name - string uname = 5; // unit name - string tid = 6; // topic id - string tname = 7; // topic name + int32 process_id = 3; // process id + string process_name = 4; // process name + string unit_name = 5; // unit name + string topic_id = 6; // topic id + string topic_name = 7; // topic name string direction = 8; // direction (publisher, subscriber) // 9 = topic type + topic encoding (deprecated) // 10 = topic description (protocol descriptor) (deprecated) - DataTypeInformation tdatatype = 30; // topic datatype information (encoding & type & description) + DataTypeInformation datatype_information = 30; // topic datatype information (encoding & type & description) - repeated TLayer tlayer = 12; // active topic transport layers and it's specific parameter - int32 tsize = 13; // topic size + repeated TransportLayer transport_layer = 12; // active topic transport layers and it's specific parameter + int32 topic_size = 13; // topic size - int32 connections_loc = 16; // number of local connected entities - int32 connections_ext = 17; // number of external connected entities + int32 connections_local = 16; // number of local connected entities + int32 connections_external = 17; // number of external connected entities int32 message_drops = 18; // dropped messages - int64 did = 19; // data send id (publisher setid) - int64 dclock = 20; // data clock (send / receive action) - int32 dfreq = 21; // data frequency (send / receive samples per second) [mHz] + int64 data_id = 19; // data send id (publisher setid) + int64 data_clock = 20; // data clock (send / receive action) + int32 data_frequency = 21; // data frequency (send / receive samples per second) [mHz] map attr = 27; // generic topic description } diff --git a/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp b/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp index 177823fa25..a5c9842de1 100644 --- a/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp +++ b/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp @@ -36,9 +36,9 @@ class SubscriberCreator for (int i = 0; i < publisher_count; ++i) { - std::ostringstream tname; - tname << std::setw(5) << std::setfill('0') << i; - subscribers.emplace_back("Topic" + tname.str(), eCAL::SDataTypeInformation{ ttype, "", tdesc }); + std::ostringstream topic_name; + topic_name << std::setw(5) << std::setfill('0') << i; + subscribers.emplace_back("Topic" + topic_name.str(), eCAL::SDataTypeInformation{ ttype, "", tdesc }); auto on_receive = [this](const eCAL::STopicId&, const eCAL::SDataTypeInformation&, const eCAL::SReceiveCallbackData&) { Receive(); diff --git a/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp b/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp index 03470088e4..81d5324528 100644 --- a/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp +++ b/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,9 +36,9 @@ class PublisherCreator for (int i = 1; i <= publisher_count; ++i) { - std::ostringstream tname; - tname << std::setw(5) << std::setfill('0') << i; - publishers.emplace_back("Topic" + tname.str(), eCAL::SDataTypeInformation{ ttype, "", tdesc }); + std::ostringstream topic_name; + topic_name << std::setw(5) << std::setfill('0') << i; + publishers.emplace_back("Topic" + topic_name.str(), eCAL::SDataTypeInformation{ ttype, "", tdesc }); } } diff --git a/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp b/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp index a21fd91775..e804693385 100644 --- a/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp +++ b/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp @@ -99,11 +99,11 @@ int main() for (int i = 0; i < subscriber_number; i++) { // publisher topic name - std::stringstream tname; - tname << "TOPIC_" << i; + std::stringstream topic_name; + topic_name << "TOPIC_" << i; // create subscriber - vector_of_subscriber.emplace_back(tname.str()); + vector_of_subscriber.emplace_back(topic_name.str()); } // stop time measurement auto end_time = std::chrono::high_resolution_clock::now(); @@ -131,11 +131,11 @@ int main() for (int i = 0; i < publisher_number; i++) { // publisher topic name - std::stringstream tname; - tname << "TOPIC_" << i; + std::stringstream topic_name; + topic_name << "TOPIC_" << i; // create publisher - vector_of_publisher.emplace_back(tname.str(), data_type_info); + vector_of_publisher.emplace_back(topic_name.str(), data_type_info); } // stop time measurement auto end_time = std::chrono::high_resolution_clock::now(); diff --git a/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp b/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp index 12550c2905..70b9b3ec6a 100644 --- a/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp +++ b/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp @@ -67,18 +67,18 @@ int main() for(int i = 0; i < SUBSCRIBER_NUMBER; i++) { // publisher topic name - std::stringstream tname; - tname << "PUB_" << i; + std::stringstream topic_name; + topic_name << "PUB_" << i; // create subscriber - eCAL::CSubscriber* sub = new eCAL::CSubscriber(tname.str()); + eCAL::CSubscriber* sub = new eCAL::CSubscriber(topic_name.str()); struct SSubCount sub_count; sub_count.sub = sub; // add subscriber { std::lock_guard lock(g_sub_map_sync); - g_sub_map[tname.str()] = sub_count; + g_sub_map[topic_name.str()] = sub_count; } // setup receive callback diff --git a/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp b/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp index 127598235e..38d0955ad5 100644 --- a/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp +++ b/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,11 +60,11 @@ int main() for(int i = 0; i < PUBLISHER_NUMBER; i++) { - std::stringstream tname; - tname << "PUB_" << i; + std::stringstream topic_name; + topic_name << "PUB_" << i; // publisher topic name - std::shared_ptr pub = std::make_shared(tname.str()); + std::shared_ptr pub = std::make_shared(topic_name.str()); struct SPubCount pub_count; pub_count.pub = std::move(pub); pub_vec[i] = pub_count; diff --git a/ecal/samples/cpp/misc/process/src/process.cpp b/ecal/samples/cpp/misc/process/src/process.cpp index c6b7696f91..843e4743b3 100644 --- a/ecal/samples/cpp/misc/process/src/process.cpp +++ b/ecal/samples/cpp/misc/process/src/process.cpp @@ -43,13 +43,13 @@ int main() eCAL::Process::SleepMS(2000); // start process - int pid = eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false); + int process_id = eCAL::Process::StartProcess(proc_name, "", "", false, eCAL::Process::eStartMode::normal, false); // sleep 2 seconds eCAL::Process::SleepMS(2000); // stop notepad - eCAL::Process::StopProcess(pid); + eCAL::Process::StopProcess(process_id); // finalize eCAL API eCAL::Finalize(); diff --git a/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp b/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp index fdb1c7bc62..34abd3d88d 100644 --- a/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp +++ b/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,18 +62,18 @@ int main() monitoring.ParseFromString(monitoring_s); // collect host infos - std::cout << "-------- HOSTS ----------" << std::endl; + std::cout << "-------- HOSTS ----------" << "\n"; // for all hosts for (const auto& host : monitoring.hosts()) { // check filtering - if (!g_host_filt_string.empty() && (g_host_filt_string != host.hname())) continue; + if (!g_host_filt_string.empty() && (g_host_filt_string != host.name())) continue; // print host details - std::cout << "hname : " << host.hname() << std::endl; // host name - std::cout << "os.osname : " << host.os().osname() << std::endl; // operating system details - std::cout << std::endl; + std::cout << "host.name : " << host.name() << "\n"; // host name + std::cout << "os.name : " << host.os().name() << "\n"; // operating system details + std::cout << "\n"; } } @@ -85,25 +85,25 @@ int main() monitoring.ParseFromString(monitoring_s); // collect process infos - std::cout << "------- PROCESSES -------" << std::endl; + std::cout << "------- PROCESSES -------" << "\n"; // for all processes for (const auto& process : monitoring.processes()) { // check filtering - if (!g_procs_filt_string.empty() && (g_procs_filt_string != process.uname())) continue; + if (!g_procs_filt_string.empty() && (g_procs_filt_string != process.unit_name())) continue; // print process details - std::cout << "hname : " << process.hname() << std::endl; // host name - std::cout << "pid : " << process.pid() << std::endl; // process id - std::cout << "pname : " << process.pname() << std::endl; // process name - std::cout << "uname : " << process.uname() << std::endl; // unit name - std::cout << "pparam : " << process.pparam() << std::endl; // process parameter - std::cout << "severity : " << process.state().severity() << std::endl; // process state severity - std::cout << "info : " << process.state().info() << std::endl; // process state info - std::cout << "tsync state : " << process.tsync_state() << std::endl; // time sync state - std::cout << "tsync mod name : " << process.tsync_mod_name() << std::endl; // time sync mod name - std::cout << std::endl; + std::cout << "host name : " << process.host_name() << "\n"; // host name + std::cout << "process id : " << process.process_id() << "\n"; // process id + std::cout << "process name : " << process.process_name() << "\n"; // process name + std::cout << "unit name : " << process.unit_name() << "\n"; // unit name + std::cout << "process parameter : " << process.process_parameter() << "\n"; // process parameter + std::cout << "severity : " << process.state().severity() << "\n"; // process state severity + std::cout << "info : " << process.state().info() << "\n"; // process state info + std::cout << "tsync state : " << process.time_sync_state() << "\n"; // time sync state + std::cout << "tsync mod name : " << process.time_sync_module_name() << "\n"; // time sync mod name + std::cout << "\n"; } } @@ -115,32 +115,32 @@ int main() monitoring.ParseFromString(monitoring_s); // collect process infos - std::cout << "------- SERVICES -------" << std::endl; + std::cout << "------- SERVICES -------" << "\n"; // for all processes for (const auto& service : monitoring.services()) { // check filtering - if (!g_services_filt_string.empty() && (g_services_filt_string != service.sname())) continue; + if (!g_services_filt_string.empty() && (g_services_filt_string != service.service_name())) continue; // print process details - std::cout << "hname : " << service.hname() << std::endl; // host name - std::cout << "sname : " << service.sname() << std::endl; // service name - std::cout << "pid : " << service.pid() << std::endl; // process id - std::cout << std::endl; + std::cout << "host name : " << service.host_name() << "\n"; // host name + std::cout << "service name : " << service.service_name() << "\n"; // service name + std::cout << "process id : " << service.process_id() << "\n"; // process id + std::cout << "\n"; for (int i = 0; i < service.methods_size(); ++i) { auto method = service.methods(i); - std::cout << " mname : " << method.mname() << std::endl; // method name - std::cout << " req_type : " << method.req_type() << std::endl; // request type - //std::cout << " req_desc : " << method.req_desc() << std::endl; // request descriptor - std::cout << " resp_type : " << method.resp_type() << std::endl; // response type - //std::cout << " resp_desc : " << method.resp_desc() << std::endl; // response descriptor - std::cout << " call_count : " << method.call_count() << std::endl; // call count - std::cout << std::endl; + std::cout << " method name : " << method.method_name() << "\n"; // method name + std::cout << " req_type : " << method.req_type() << "\n"; // request type + //std::cout << " req_desc : " << method.req_desc() << "\n"; // request descriptor + std::cout << " resp_type : " << method.resp_type() << "\n"; // response type + //std::cout << " resp_desc : " << method.resp_desc() << "\n"; // response descriptor + std::cout << " call_count : " << method.call_count() << "\n"; // call count + std::cout << "\n"; } - std::cout << std::endl; + std::cout << "\n"; } } @@ -152,63 +152,63 @@ int main() monitoring.ParseFromString(monitoring_s); // collect topic infos - std::cout << "-------- TOPICS ---------" << std::endl; + std::cout << "-------- TOPICS ---------" << "\n"; // for all topics for (const auto& topic : monitoring.topics()) { // check filtering - if (!g_topics_filt_string.empty() && (g_topics_filt_string != topic.tname())) continue; + if (!g_topics_filt_string.empty() && (g_topics_filt_string != topic.topic_name())) continue; // print topic details - std::cout << "rclock : " << topic.rclock() << std::endl; // registration clock - std::cout << "hname : " << topic.hname() << std::endl; // host name - std::cout << "pid : " << topic.pid() << std::endl; // process id - std::cout << "pname : " << topic.pname() << std::endl; // process name - std::cout << "uname : " << topic.uname() << std::endl; // unit name - std::cout << "tid : " << topic.tid() << std::endl; // topic id - std::cout << "tname : " << topic.tname() << std::endl; // topic name - std::cout << "direction : " << topic.direction() << std::endl; // direction (publisher, subscriber) - std::cout << "ttype name : " << topic.tdatatype().name() << std::endl; // topic type name - std::cout << "ttype encoding : " << topic.tdatatype().encoding() << std::endl; // topic type encoding - //std::cout << "tdesc : " << topic.tdatatype().desc() << std::endl; // topic description - for (const auto& layer : topic.tlayer()) + std::cout << "registration clock : " << topic.registration_clock() << "\n"; // registration clock + std::cout << "host name : " << topic.host_name() << "\n"; // host name + std::cout << "process id : " << topic.process_id() << "\n"; // process id + std::cout << "process name : " << topic.process_name() << "\n"; // process name + std::cout << "unit name : " << topic.unit_name() << "\n"; // unit name + std::cout << "topic id : " << topic.topic_id() << "\n"; // topic id + std::cout << "topic name : " << topic.topic_name() << "\n"; // topic name + std::cout << "direction : " << topic.direction() << "\n"; // direction (publisher, subscriber) + std::cout << "ttype name : " << topic.datatype_information().name() << "\n"; // topic type name + std::cout << "ttype encoding : " << topic.datatype_information().encoding() << "\n"; // topic type encoding + //std::cout << "tdesc : " << topic.datatype_information().descriptor_information() << "\n"; // topic description + for (const auto& layer : topic.transport_layer()) { std::string layer_type("unknown"); switch (layer.type()) { - case eCAL::pb::eTLayerType::tl_none: + case eCAL::pb::eTransportLayerType::tl_none: layer_type = "tlayer_none"; break; - case eCAL::pb::eTLayerType::tl_ecal_udp_mc: + case eCAL::pb::eTransportLayerType::tl_ecal_udp_mc: layer_type = "tlayer_udp_mc"; break; - case eCAL::pb::eTLayerType::tl_ecal_shm: + case eCAL::pb::eTransportLayerType::tl_ecal_shm: layer_type = "tlayer_shm"; break; - case eCAL::pb::eTLayerType::tl_ecal_tcp: + case eCAL::pb::eTransportLayerType::tl_ecal_tcp: layer_type = "tlayer_tcp"; break; - case eCAL::pb::eTLayerType::tl_all: + case eCAL::pb::eTransportLayerType::tl_all: layer_type = "tlayer_all"; break; default: break; } - std::cout << " tlayer.type : " << layer_type << std::endl; // transport layers type - std::cout << " tlayer.active : " << layer.active() << std::endl; // transport layers confirmation - } - std::cout << "tsize : " << topic.tsize() << std::endl; // topic size + std::cout << " transport_layer.type : " << layer_type << "\n"; // transport layers type + std::cout << " transport_layer.active : " << layer.active() << "\n"; // transport layers confirmation + } + std::cout << "topic size : " << topic.topic_size() << "\n"; // topic size - std::cout << "connections_loc : " << topic.connections_loc() << std::endl; // number of local connected entities - std::cout << "connections_ext : " << topic.connections_ext() << std::endl; // number of external connected entities - std::cout << "message_drops : " << topic.message_drops() << std::endl; // dropped messages + std::cout << "connections local : " << topic.connections_local() << "\n"; // number of local connected entities + std::cout << "connections external : " << topic.connections_external() << "\n"; // number of external connected entities + std::cout << "message drops : " << topic.message_drops() << "\n"; // dropped messages - std::cout << "did : " << topic.did() << std::endl; // data send id (publisher setid) - std::cout << "dclock : " << topic.dclock() << std::endl; // data clock (send / receive action) - std::cout << "dfreq : " << topic.dfreq() << std::endl; // data frequency (send / receive samples per second * 1000) + std::cout << "data id : " << topic.data_id() << "\n"; // data send id (publisher setid) + std::cout << "data clock : " << topic.data_clock() << "\n"; // data clock (send / receive action) + std::cout << "data frequency : " << topic.data_frequency() << "\n"; // data frequency (send / receive samples per second * 1000) - std::cout << std::endl; + std::cout << "\n"; } } diff --git a/ecal/tests/cpp/descgate_test/src/descgate_getentities.cpp b/ecal/tests/cpp/descgate_test/src/descgate_getentities.cpp index 7c03217d00..bcfd44345a 100644 --- a/ecal/tests/cpp/descgate_test/src/descgate_getentities.cpp +++ b/ecal/tests/cpp/descgate_test/src/descgate_getentities.cpp @@ -33,12 +33,12 @@ namespace eCAL::Registration::Sample CreatePublisher(const std::string& topic_name_, std::uint64_t topic_id_) { eCAL::Registration::Sample reg_sample; - reg_sample.cmd_type = eCAL::bct_reg_publisher; - reg_sample.identifier.entity_id = topic_id_; - reg_sample.topic.tname = topic_name_; - reg_sample.topic.tdatatype.name = topic_name_ + "-tdatatype.name"; - reg_sample.topic.tdatatype.encoding = topic_name_ + "-tdatatype.encoding"; - reg_sample.topic.tdatatype.descriptor = topic_name_ + "-tdatatype.descriptor"; + reg_sample.cmd_type = eCAL::bct_reg_publisher; + reg_sample.identifier.entity_id = topic_id_; + reg_sample.topic.topic_name = topic_name_; + reg_sample.topic.datatype_information.name = topic_name_ + "-datatype_information.name"; + reg_sample.topic.datatype_information.encoding = topic_name_ + "-datatype_information.encoding"; + reg_sample.topic.datatype_information.descriptor = topic_name_ + "-datatype_information.descriptor"; return reg_sample; } @@ -52,12 +52,12 @@ namespace eCAL::Registration::Sample CreateSubscriber(const std::string& topic_name_, std::uint64_t topic_id_) { eCAL::Registration::Sample reg_sample; - reg_sample.cmd_type = eCAL::bct_reg_subscriber; - reg_sample.identifier.entity_id = topic_id_; - reg_sample.topic.tname = topic_name_; - reg_sample.topic.tdatatype.name = topic_name_ + "-tdatatype.name"; - reg_sample.topic.tdatatype.encoding = topic_name_ + "-tdatatype.encoding"; - reg_sample.topic.tdatatype.descriptor = topic_name_ + "-tdatatype.descriptor"; + reg_sample.cmd_type = eCAL::bct_reg_subscriber; + reg_sample.identifier.entity_id = topic_id_; + reg_sample.topic.topic_name = topic_name_; + reg_sample.topic.datatype_information.name = topic_name_ + "-datatype_information.name"; + reg_sample.topic.datatype_information.encoding = topic_name_ + "-datatype_information.encoding"; + reg_sample.topic.datatype_information.descriptor = topic_name_ + "-datatype_information.descriptor"; return reg_sample; } @@ -72,11 +72,11 @@ namespace { eCAL::Registration::Sample reg_sample; reg_sample.cmd_type = eCAL::bct_reg_service; - reg_sample.service.sname = service_name_; + reg_sample.service.service_name = service_name_; reg_sample.identifier.entity_id = service_id_; eCAL::Service::Method method; - method.mname = "method_name"; + method.method_name = "method_name"; reg_sample.service.methods.push_back(method); return reg_sample; } @@ -92,11 +92,11 @@ namespace { eCAL::Registration::Sample reg_sample; reg_sample.cmd_type = eCAL::bct_reg_client; - reg_sample.client.sname = client_name_; + reg_sample.client.service_name = client_name_; reg_sample.identifier.entity_id = service_id_; eCAL::Service::Method method; - method.mname = "method_name"; + method.method_name = "method_name"; reg_sample.client.methods.push_back(method); return reg_sample; } @@ -151,10 +151,10 @@ TEST(core_cpp_descgate, PublisherQualities) EXPECT_TRUE(found); if (found) { - std::string tname = id.topic_name; - EXPECT_EQ(tname + "-tdatatype.name", topic_info.name); - EXPECT_EQ(tname + "-tdatatype.encoding", topic_info.encoding); - EXPECT_EQ(tname + "-tdatatype.descriptor", topic_info.descriptor); + std::string topic_name = id.topic_name; + EXPECT_EQ(topic_name + "-datatype_information.name", topic_info.name); + EXPECT_EQ(topic_name + "-datatype_information.encoding", topic_info.encoding); + EXPECT_EQ(topic_name + "-datatype_information.descriptor", topic_info.descriptor); } } } @@ -234,10 +234,10 @@ TEST(core_cpp_descgate, SubscriberQualities) EXPECT_TRUE(found); if (found) { - std::string tname = id.topic_name; - EXPECT_EQ(tname + "-tdatatype.name", topic_info.name); - EXPECT_EQ(tname + "-tdatatype.encoding", topic_info.encoding); - EXPECT_EQ(tname + "-tdatatype.descriptor", topic_info.descriptor); + std::string topic_name = id.topic_name; + EXPECT_EQ(topic_name + "-datatype_information.name", topic_info.name); + EXPECT_EQ(topic_name + "-datatype_information.encoding", topic_info.encoding); + EXPECT_EQ(topic_name + "-datatype_information.descriptor", topic_info.descriptor); } } } diff --git a/ecal/tests/cpp/logging_test/src/logging_test.cpp b/ecal/tests/cpp/logging_test/src/logging_test.cpp index eba9c00df8..10560e9687 100644 --- a/ecal/tests/cpp/logging_test/src/logging_test.cpp +++ b/ecal/tests/cpp/logging_test/src/logging_test.cpp @@ -145,10 +145,10 @@ TEST(logging_to /*unused*/, udp /*unused*/) // check before the size -> crashes the whole test if it's not checked before if (!log.log_messages.empty()) { - EXPECT_EQ(log.log_messages.front().hname, eCAL::Process::GetHostName()); - EXPECT_EQ(log.log_messages.front().pid, eCAL::Process::GetProcessID()); - EXPECT_EQ(log.log_messages.front().uname, unit_name); - EXPECT_EQ(log.log_messages.front().level, eCAL::Logging::eLogLevel::log_level_info); + EXPECT_EQ(log.log_messages.front().host_name, eCAL::Process::GetHostName()); + EXPECT_EQ(log.log_messages.front().process_id, eCAL::Process::GetProcessID()); + EXPECT_EQ(log.log_messages.front().unit_name, unit_name); + EXPECT_EQ(log.log_messages.front().level, eCAL::Logging::eLogLevel::log_level_info); EXPECT_TRUE(log.log_messages.front().content.find(log_message) != std::string::npos); } diff --git a/ecal/tests/cpp/registration_test/src/registration_timout_provider_test.cpp b/ecal/tests/cpp/registration_test/src/registration_timout_provider_test.cpp index 562254f853..6660f1ab12 100644 --- a/ecal/tests/cpp/registration_test/src/registration_timout_provider_test.cpp +++ b/ecal/tests/cpp/registration_test/src/registration_timout_provider_test.cpp @@ -47,8 +47,8 @@ eCAL::Registration::Sample UpdateTopicSample(const eCAL::Registration::Sample& i { // vary statistical data eCAL::Registration::Sample updated = input_; - updated.topic.rclock = input_.topic.rclock + 1; - updated.topic.dclock = input_.topic.dclock + 10; + updated.topic.registration_clock = input_.topic.registration_clock + 1; + updated.topic.data_clock = input_.topic.data_clock + 10; return updated; } @@ -60,22 +60,22 @@ void InitializeAllSamples() pub_foo_process_a_unregister.identifier.process_id = 1000; pub_foo_process_a_unregister.identifier.entity_id = getUniqueId(); pub_foo_process_a_unregister.topic.shm_transport_domain = "host0"; - pub_foo_process_a_unregister.topic.pname = "process_a"; - pub_foo_process_a_unregister.topic.tname = "foo"; - pub_foo_process_a_register_1.topic.uname = "abc"; + pub_foo_process_a_unregister.topic.process_name = "process_a"; + pub_foo_process_a_unregister.topic.topic_name = "foo"; + pub_foo_process_a_register_1.topic.unit_name = "abc"; pub_foo_process_a_register_1 = pub_foo_process_a_unregister; pub_foo_process_a_register_1.cmd_type = eCAL::bct_reg_publisher; - pub_foo_process_a_register_1.topic.rclock = 1; + pub_foo_process_a_register_1.topic.registration_clock = 1; pub_foo_process_a_register_1.topic.direction = "publisher"; - pub_foo_process_a_register_1.topic.tdatatype = { "a", "b", "c" }; - pub_foo_process_a_register_1.topic.tsize = 100; - pub_foo_process_a_register_1.topic.connections_loc = 2; - pub_foo_process_a_register_1.topic.connections_ext = 2; + pub_foo_process_a_register_1.topic.datatype_information = { "a", "b", "c" }; + pub_foo_process_a_register_1.topic.topic_size = 100; + pub_foo_process_a_register_1.topic.connections_local = 2; + pub_foo_process_a_register_1.topic.connections_external = 2; pub_foo_process_a_register_1.topic.message_drops = 0; - pub_foo_process_a_register_1.topic.did = 0; - pub_foo_process_a_register_1.topic.dclock = 1; - pub_foo_process_a_register_1.topic.dfreq = 10; + pub_foo_process_a_register_1.topic.data_id = 0; + pub_foo_process_a_register_1.topic.data_clock = 1; + pub_foo_process_a_register_1.topic.data_frequency = 10; pub_foo_process_a_register_2 = UpdateTopicSample(pub_foo_process_a_register_1); @@ -85,22 +85,22 @@ void InitializeAllSamples() sub_foo_process_a_unregister.identifier.process_id = 1000; sub_foo_process_a_unregister.identifier.entity_id = getUniqueId(); sub_foo_process_a_unregister.topic.shm_transport_domain = "host0"; - sub_foo_process_a_unregister.topic.pname = "process_a"; - sub_foo_process_a_unregister.topic.tname = "foo"; - sub_foo_process_a_register_1.topic.uname = "abc"; + sub_foo_process_a_unregister.topic.process_name = "process_a"; + sub_foo_process_a_unregister.topic.topic_name = "foo"; + sub_foo_process_a_register_1.topic.unit_name = "abc"; sub_foo_process_a_register_1 = sub_foo_process_a_unregister; sub_foo_process_a_register_1.cmd_type = eCAL::bct_reg_subscriber; - sub_foo_process_a_register_1.topic.rclock = 1; + sub_foo_process_a_register_1.topic.registration_clock = 1; sub_foo_process_a_register_1.topic.direction = "subscriber"; - sub_foo_process_a_register_1.topic.tdatatype = { "a", "b", "c" }; - sub_foo_process_a_register_1.topic.tsize = 100; - sub_foo_process_a_register_1.topic.connections_loc = 2; - sub_foo_process_a_register_1.topic.connections_ext = 2; + sub_foo_process_a_register_1.topic.datatype_information = { "a", "b", "c" }; + sub_foo_process_a_register_1.topic.topic_size = 100; + sub_foo_process_a_register_1.topic.connections_local = 2; + sub_foo_process_a_register_1.topic.connections_external = 2; sub_foo_process_a_register_1.topic.message_drops = 0; - sub_foo_process_a_register_1.topic.did = 0; - sub_foo_process_a_register_1.topic.dclock = 1; - sub_foo_process_a_register_1.topic.dfreq = 10; + sub_foo_process_a_register_1.topic.data_id = 0; + sub_foo_process_a_register_1.topic.data_clock = 1; + sub_foo_process_a_register_1.topic.data_frequency = 10; sub_foo_process_a_register_2 = UpdateTopicSample(sub_foo_process_a_register_1); @@ -110,22 +110,22 @@ void InitializeAllSamples() sub_foo_process_b_unregister.identifier.process_id = 1000; sub_foo_process_b_unregister.identifier.entity_id = getUniqueId(); sub_foo_process_b_unregister.topic.shm_transport_domain = "host0"; - sub_foo_process_b_unregister.topic.pname = "process_b"; - sub_foo_process_b_unregister.topic.tname = "foo"; - sub_foo_process_b_register_1.topic.uname = "abc"; + sub_foo_process_b_unregister.topic.process_name = "process_b"; + sub_foo_process_b_unregister.topic.topic_name = "foo"; + sub_foo_process_b_register_1.topic.unit_name = "abc"; sub_foo_process_b_register_1 = sub_foo_process_b_unregister; sub_foo_process_b_register_1.cmd_type = eCAL::bct_reg_subscriber; - sub_foo_process_b_register_1.topic.rclock = 1; + sub_foo_process_b_register_1.topic.registration_clock = 1; sub_foo_process_b_register_1.topic.direction = "subscriber"; - sub_foo_process_b_register_1.topic.tdatatype = { "a", "b", "c" }; - sub_foo_process_b_register_1.topic.tsize = 100; - sub_foo_process_b_register_1.topic.connections_loc = 2; - sub_foo_process_b_register_1.topic.connections_ext = 2; + sub_foo_process_b_register_1.topic.datatype_information = { "a", "b", "c" }; + sub_foo_process_b_register_1.topic.topic_size = 100; + sub_foo_process_b_register_1.topic.connections_local = 2; + sub_foo_process_b_register_1.topic.connections_external = 2; sub_foo_process_b_register_1.topic.message_drops = 0; - sub_foo_process_b_register_1.topic.did = 0; - sub_foo_process_b_register_1.topic.dclock = 1; - sub_foo_process_b_register_1.topic.dfreq = 10; + sub_foo_process_b_register_1.topic.data_id = 0; + sub_foo_process_b_register_1.topic.data_clock = 1; + sub_foo_process_b_register_1.topic.data_frequency = 10; sub_foo_process_b_register_2 = UpdateTopicSample(sub_foo_process_b_register_1); } diff --git a/ecal/tests/cpp/registration_test_public/src/registration_getpublisherids.cpp b/ecal/tests/cpp/registration_test_public/src/registration_getpublisherids.cpp index a463f9c284..52ceb47bf7 100644 --- a/ecal/tests/cpp/registration_test_public/src/registration_getpublisherids.cpp +++ b/ecal/tests/cpp/registration_test_public/src/registration_getpublisherids.cpp @@ -60,15 +60,15 @@ TEST_P(TestFixture, GetPublisherIDsReturnsCorrectNumber) std::vector publisher_vec; for (int i = 0; i < GetParam().publisher_count; ++i) { - std::stringstream tname; - tname << "topic_" << i; + std::stringstream topic_name; + topic_name << "topic_" << i; eCAL::SDataTypeInformation data_type_info; - data_type_info.name = tname.str() + "_type_name"; - data_type_info.encoding = tname.str() + "_type_encoding"; - data_type_info.descriptor = tname.str() + "_type_descriptor"; + data_type_info.name = topic_name.str() + "_type_name"; + data_type_info.encoding = topic_name.str() + "_type_encoding"; + data_type_info.descriptor = topic_name.str() + "_type_descriptor"; - publisher_vec.emplace_back(tname.str(), data_type_info); + publisher_vec.emplace_back(topic_name.str(), data_type_info); } // let's register @@ -119,15 +119,15 @@ TEST_P(TestFixture, PublisherEventCallbackIsTriggered) std::vector publisher_vec; for (int i = 0; i < GetParam().publisher_count; ++i) { - std::stringstream tname; - tname << "topic_" << i; + std::stringstream topic_name; + topic_name << "topic_" << i; eCAL::SDataTypeInformation data_type_info; - data_type_info.name = tname.str() + "_type_name"; - data_type_info.encoding = tname.str() + "_type_encoding"; - data_type_info.descriptor = tname.str() + "_type_descriptor"; + data_type_info.name = topic_name.str() + "_type_name"; + data_type_info.encoding = topic_name.str() + "_type_encoding"; + data_type_info.descriptor = topic_name.str() + "_type_descriptor"; - publisher_vec.emplace_back(tname.str(), data_type_info); + publisher_vec.emplace_back(topic_name.str(), data_type_info); } // let's register diff --git a/ecal/tests/cpp/registration_test_public/src/registration_getsubscriberids.cpp b/ecal/tests/cpp/registration_test_public/src/registration_getsubscriberids.cpp index 3ef6be8204..9aa47dd26d 100644 --- a/ecal/tests/cpp/registration_test_public/src/registration_getsubscriberids.cpp +++ b/ecal/tests/cpp/registration_test_public/src/registration_getsubscriberids.cpp @@ -60,15 +60,15 @@ TEST_P(TestFixture, GetSubscriberIDsReturnsCorrectNumber) std::vector subscriber_vec; for (int i = 0; i < GetParam().subscriber_count; ++i) { - std::stringstream tname; - tname << "topic_" << i; + std::stringstream topic_name; + topic_name << "topic_" << i; eCAL::SDataTypeInformation data_type_info; - data_type_info.name = tname.str() + "_type_name"; - data_type_info.encoding = tname.str() + "_type_encoding"; - data_type_info.descriptor = tname.str() + "_type_descriptor"; + data_type_info.name = topic_name.str() + "_type_name"; + data_type_info.encoding = topic_name.str() + "_type_encoding"; + data_type_info.descriptor = topic_name.str() + "_type_descriptor"; - subscriber_vec.emplace_back(tname.str(), data_type_info); + subscriber_vec.emplace_back(topic_name.str(), data_type_info); } // let's register @@ -119,15 +119,15 @@ TEST_P(TestFixture, SubscriberEventCallbackIsTriggered) std::vector subscriber_vec; for (int i = 0; i < GetParam().subscriber_count; ++i) { - std::stringstream tname; - tname << "topic_" << i; + std::stringstream topic_name; + topic_name << "topic_" << i; eCAL::SDataTypeInformation data_type_info; - data_type_info.name = tname.str() + "_type_name"; - data_type_info.encoding = tname.str() + "_type_encoding"; - data_type_info.descriptor = tname.str() + "_type_descriptor"; + data_type_info.name = topic_name.str() + "_type_name"; + data_type_info.encoding = topic_name.str() + "_type_encoding"; + data_type_info.descriptor = topic_name.str() + "_type_descriptor"; - subscriber_vec.emplace_back(tname.str(), data_type_info); + subscriber_vec.emplace_back(topic_name.str(), data_type_info); } // let's register diff --git a/ecal/tests/cpp/serialization_test/src/logging_compare.cpp b/ecal/tests/cpp/serialization_test/src/logging_compare.cpp index cf8b004cef..e99439decc 100644 --- a/ecal/tests/cpp/serialization_test/src/logging_compare.cpp +++ b/ecal/tests/cpp/serialization_test/src/logging_compare.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,13 +26,13 @@ namespace eCAL // compare two LogMessages for equality bool CompareLogMessages(const SLogMessage& message1, const SLogMessage& message2) { - return (message1.time == message2.time && - message1.hname == message2.hname && - message1.pid == message2.pid && - message1.pname == message2.pname && - message1.uname == message2.uname && - message1.level == message2.level && - message1.content == message2.content); + return (message1.time == message2.time && + message1.host_name == message2.host_name && + message1.process_id == message2.process_id && + message1.process_name == message2.process_name && + message1.unit_name == message2.unit_name && + message1.level == message2.level && + message1.content == message2.content); } } } diff --git a/ecal/tests/cpp/serialization_test/src/logging_generate.cpp b/ecal/tests/cpp/serialization_test/src/logging_generate.cpp index d01b6c4e9a..10c54be801 100644 --- a/ecal/tests/cpp/serialization_test/src/logging_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/logging_generate.cpp @@ -29,13 +29,13 @@ namespace eCAL SLogMessage GenerateLogMessage() { SLogMessage logMessage; - logMessage.time = rand() % 1000; - logMessage.hname = GenerateString(10); - logMessage.pid = rand() % 1000; - logMessage.pname = GenerateString(8); - logMessage.uname = GenerateString(6); - logMessage.level = static_cast(rand() % 2); - logMessage.content = GenerateString(50); + logMessage.time = rand() % 1000; + logMessage.host_name = GenerateString(10); + logMessage.process_id = rand() % 1000; + logMessage.process_name = GenerateString(8); + logMessage.unit_name = GenerateString(6); + logMessage.level = static_cast(rand() % 2); + logMessage.content = GenerateString(50); return logMessage; } diff --git a/ecal/tests/cpp/serialization_test/src/monitoring_compare.cpp b/ecal/tests/cpp/serialization_test/src/monitoring_compare.cpp index 155ef9e640..b62218dcf7 100644 --- a/ecal/tests/cpp/serialization_test/src/monitoring_compare.cpp +++ b/ecal/tests/cpp/serialization_test/src/monitoring_compare.cpp @@ -37,18 +37,18 @@ namespace eCAL for (size_t i = 0; i < monitoring1.processes.size(); ++i) { - if (monitoring1.processes[i].rclock != monitoring2.processes[i].rclock || - monitoring1.processes[i].hname != monitoring2.processes[i].hname || + if (monitoring1.processes[i].registration_clock != monitoring2.processes[i].registration_clock || + monitoring1.processes[i].host_name != monitoring2.processes[i].host_name || monitoring1.processes[i].shm_transport_domain != monitoring2.processes[i].shm_transport_domain || - monitoring1.processes[i].pid != monitoring2.processes[i].pid || - monitoring1.processes[i].pname != monitoring2.processes[i].pname || - monitoring1.processes[i].uname != monitoring2.processes[i].uname || - monitoring1.processes[i].pparam != monitoring2.processes[i].pparam || + monitoring1.processes[i].process_id != monitoring2.processes[i].process_id || + monitoring1.processes[i].process_name != monitoring2.processes[i].process_name || + monitoring1.processes[i].unit_name != monitoring2.processes[i].unit_name || + monitoring1.processes[i].process_parameter != monitoring2.processes[i].process_parameter || monitoring1.processes[i].state_severity != monitoring2.processes[i].state_severity || monitoring1.processes[i].state_severity_level != monitoring2.processes[i].state_severity_level || monitoring1.processes[i].state_info != monitoring2.processes[i].state_info || - monitoring1.processes[i].tsync_state != monitoring2.processes[i].tsync_state || - monitoring1.processes[i].tsync_mod_name != monitoring2.processes[i].tsync_mod_name || + monitoring1.processes[i].time_sync_state != monitoring2.processes[i].time_sync_state || + monitoring1.processes[i].time_sync_module_name != monitoring2.processes[i].time_sync_module_name || monitoring1.processes[i].component_init_state != monitoring2.processes[i].component_init_state || monitoring1.processes[i].component_init_info != monitoring2.processes[i].component_init_info || monitoring1.processes[i].ecal_runtime_version != monitoring2.processes[i].ecal_runtime_version || @@ -67,24 +67,24 @@ namespace eCAL for (size_t i = 0; i < monitoring1.publisher.size(); ++i) { - if (monitoring1.publisher[i].rclock != monitoring2.publisher[i].rclock || - monitoring1.publisher[i].hname != monitoring2.publisher[i].hname || + if (monitoring1.publisher[i].registration_clock != monitoring2.publisher[i].registration_clock || + monitoring1.publisher[i].host_name != monitoring2.publisher[i].host_name || monitoring1.publisher[i].shm_transport_domain != monitoring2.publisher[i].shm_transport_domain || - monitoring1.publisher[i].pid != monitoring2.publisher[i].pid || - monitoring1.publisher[i].pname != monitoring2.publisher[i].pname || - monitoring1.publisher[i].uname != monitoring2.publisher[i].uname || - monitoring1.publisher[i].tid != monitoring2.publisher[i].tid || - monitoring1.publisher[i].tname != monitoring2.publisher[i].tname || + monitoring1.publisher[i].process_id != monitoring2.publisher[i].process_id || + monitoring1.publisher[i].process_name != monitoring2.publisher[i].process_name || + monitoring1.publisher[i].unit_name != monitoring2.publisher[i].unit_name || + monitoring1.publisher[i].topic_id != monitoring2.publisher[i].topic_id || + monitoring1.publisher[i].topic_name != monitoring2.publisher[i].topic_name || monitoring1.publisher[i].direction != monitoring2.publisher[i].direction || - monitoring1.publisher[i].tdatatype != monitoring2.publisher[i].tdatatype || - monitoring1.publisher[i].tlayer.size() != monitoring2.publisher[i].tlayer.size() || - monitoring1.publisher[i].tsize != monitoring2.publisher[i].tsize || - monitoring1.publisher[i].connections_loc != monitoring2.publisher[i].connections_loc || - monitoring1.publisher[i].connections_ext != monitoring2.publisher[i].connections_ext || + monitoring1.publisher[i].datatype_information != monitoring2.publisher[i].datatype_information || + monitoring1.publisher[i].transport_layer.size() != monitoring2.publisher[i].transport_layer.size() || + monitoring1.publisher[i].topic_size != monitoring2.publisher[i].topic_size || + monitoring1.publisher[i].connections_local != monitoring2.publisher[i].connections_local || + monitoring1.publisher[i].connections_external != monitoring2.publisher[i].connections_external || monitoring1.publisher[i].message_drops != monitoring2.publisher[i].message_drops || - monitoring1.publisher[i].did != monitoring2.publisher[i].did || - monitoring1.publisher[i].dclock != monitoring2.publisher[i].dclock || - monitoring1.publisher[i].dfreq != monitoring2.publisher[i].dfreq || + monitoring1.publisher[i].data_id != monitoring2.publisher[i].data_id || + monitoring1.publisher[i].data_clock != monitoring2.publisher[i].data_clock || + monitoring1.publisher[i].data_frequency != monitoring2.publisher[i].data_frequency || monitoring1.publisher[i].attr != monitoring2.publisher[i].attr) { return false; @@ -99,24 +99,24 @@ namespace eCAL for (size_t i = 0; i < monitoring1.subscriber.size(); ++i) { - if (monitoring1.subscriber[i].rclock != monitoring2.subscriber[i].rclock || - monitoring1.subscriber[i].hname != monitoring2.subscriber[i].hname || + if (monitoring1.subscriber[i].registration_clock != monitoring2.subscriber[i].registration_clock || + monitoring1.subscriber[i].host_name != monitoring2.subscriber[i].host_name || monitoring1.subscriber[i].shm_transport_domain != monitoring2.subscriber[i].shm_transport_domain || - monitoring1.subscriber[i].pid != monitoring2.subscriber[i].pid || - monitoring1.subscriber[i].pname != monitoring2.subscriber[i].pname || - monitoring1.subscriber[i].uname != monitoring2.subscriber[i].uname || - monitoring1.subscriber[i].tid != monitoring2.subscriber[i].tid || - monitoring1.subscriber[i].tname != monitoring2.subscriber[i].tname || + monitoring1.subscriber[i].process_id != monitoring2.subscriber[i].process_id || + monitoring1.subscriber[i].process_name != monitoring2.subscriber[i].process_name || + monitoring1.subscriber[i].unit_name != monitoring2.subscriber[i].unit_name || + monitoring1.subscriber[i].topic_id != monitoring2.subscriber[i].topic_id || + monitoring1.subscriber[i].topic_name != monitoring2.subscriber[i].topic_name || monitoring1.subscriber[i].direction != monitoring2.subscriber[i].direction || - monitoring1.subscriber[i].tdatatype != monitoring2.subscriber[i].tdatatype || - monitoring1.subscriber[i].tlayer.size() != monitoring2.subscriber[i].tlayer.size() || - monitoring1.subscriber[i].tsize != monitoring2.subscriber[i].tsize || - monitoring1.subscriber[i].connections_loc != monitoring2.subscriber[i].connections_loc || - monitoring1.subscriber[i].connections_ext != monitoring2.subscriber[i].connections_ext || + monitoring1.subscriber[i].datatype_information != monitoring2.subscriber[i].datatype_information || + monitoring1.subscriber[i].transport_layer.size() != monitoring2.subscriber[i].transport_layer.size() || + monitoring1.subscriber[i].topic_size != monitoring2.subscriber[i].topic_size || + monitoring1.subscriber[i].connections_local != monitoring2.subscriber[i].connections_local || + monitoring1.subscriber[i].connections_external != monitoring2.subscriber[i].connections_external || monitoring1.subscriber[i].message_drops != monitoring2.subscriber[i].message_drops || - monitoring1.subscriber[i].did != monitoring2.subscriber[i].did || - monitoring1.subscriber[i].dclock != monitoring2.subscriber[i].dclock || - monitoring1.subscriber[i].dfreq != monitoring2.subscriber[i].dfreq || + monitoring1.subscriber[i].data_id != monitoring2.subscriber[i].data_id || + monitoring1.subscriber[i].data_clock != monitoring2.subscriber[i].data_clock || + monitoring1.subscriber[i].data_frequency != monitoring2.subscriber[i].data_frequency || monitoring1.subscriber[i].attr != monitoring2.subscriber[i].attr) { return false; @@ -131,13 +131,13 @@ namespace eCAL for (size_t i = 0; i < monitoring1.server.size(); ++i) { - if (monitoring1.server[i].rclock != monitoring2.server[i].rclock || - monitoring1.server[i].hname != monitoring2.server[i].hname || - monitoring1.server[i].pname != monitoring2.server[i].pname || - monitoring1.server[i].uname != monitoring2.server[i].uname || - monitoring1.server[i].pid != monitoring2.server[i].pid || - monitoring1.server[i].sname != monitoring2.server[i].sname || - monitoring1.server[i].sid != monitoring2.server[i].sid || + if (monitoring1.server[i].registration_clock != monitoring2.server[i].registration_clock || + monitoring1.server[i].host_name != monitoring2.server[i].host_name || + monitoring1.server[i].process_name != monitoring2.server[i].process_name || + monitoring1.server[i].unit_name != monitoring2.server[i].unit_name || + monitoring1.server[i].process_id != monitoring2.server[i].process_id || + monitoring1.server[i].service_name != monitoring2.server[i].service_name || + monitoring1.server[i].service_id != monitoring2.server[i].service_id || monitoring1.server[i].version != monitoring2.server[i].version || monitoring1.server[i].tcp_port_v0 != monitoring2.server[i].tcp_port_v0 || monitoring1.server[i].tcp_port_v1 != monitoring2.server[i].tcp_port_v1 || @@ -148,9 +148,9 @@ namespace eCAL for (size_t j = 0; j < monitoring1.server[i].methods.size(); ++j) { - if (monitoring1.server[i].methods[j].mname != monitoring2.server[i].methods[j].mname || - monitoring1.server[i].methods[j].req_datatype != monitoring2.server[i].methods[j].req_datatype || - monitoring1.server[i].methods[j].resp_datatype != monitoring2.server[i].methods[j].resp_datatype || + if (monitoring1.server[i].methods[j].method_name != monitoring2.server[i].methods[j].method_name || + monitoring1.server[i].methods[j].request_datatype_information != monitoring2.server[i].methods[j].request_datatype_information || + monitoring1.server[i].methods[j].response_datatype_information != monitoring2.server[i].methods[j].response_datatype_information || monitoring1.server[i].methods[j].call_count != monitoring2.server[i].methods[j].call_count) { return false; @@ -166,13 +166,13 @@ namespace eCAL for (size_t i = 0; i < monitoring1.clients.size(); ++i) { - if (monitoring1.clients[i].rclock != monitoring2.clients[i].rclock || - monitoring1.clients[i].hname != monitoring2.clients[i].hname || - monitoring1.clients[i].pname != monitoring2.clients[i].pname || - monitoring1.clients[i].uname != monitoring2.clients[i].uname || - monitoring1.clients[i].pid != monitoring2.clients[i].pid || - monitoring1.clients[i].sname != monitoring2.clients[i].sname || - monitoring1.clients[i].sid != monitoring2.clients[i].sid || + if (monitoring1.clients[i].registration_clock != monitoring2.clients[i].registration_clock || + monitoring1.clients[i].host_name != monitoring2.clients[i].host_name || + monitoring1.clients[i].process_name != monitoring2.clients[i].process_name || + monitoring1.clients[i].unit_name != monitoring2.clients[i].unit_name || + monitoring1.clients[i].process_id != monitoring2.clients[i].process_id || + monitoring1.clients[i].service_name != monitoring2.clients[i].service_name || + monitoring1.clients[i].service_id != monitoring2.clients[i].service_id || monitoring1.clients[i].methods.size() != monitoring2.clients[i].methods.size() || monitoring1.clients[i].version != monitoring2.clients[i].version) { @@ -181,9 +181,9 @@ namespace eCAL for (size_t j = 0; j < monitoring1.clients[i].methods.size(); ++j) { - if (monitoring1.clients[i].methods[j].mname != monitoring2.clients[i].methods[j].mname || - monitoring1.clients[i].methods[j].req_datatype != monitoring2.clients[i].methods[j].req_datatype || - monitoring1.clients[i].methods[j].resp_datatype != monitoring2.clients[i].methods[j].resp_datatype || + if (monitoring1.clients[i].methods[j].method_name != monitoring2.clients[i].methods[j].method_name || + monitoring1.clients[i].methods[j].request_datatype_information != monitoring2.clients[i].methods[j].request_datatype_information || + monitoring1.clients[i].methods[j].response_datatype_information != monitoring2.clients[i].methods[j].response_datatype_information || monitoring1.clients[i].methods[j].call_count != monitoring2.clients[i].methods[j].call_count) { return false; diff --git a/ecal/tests/cpp/serialization_test/src/monitoring_generate.cpp b/ecal/tests/cpp/serialization_test/src/monitoring_generate.cpp index 489a9c3f55..ffc5ae2d71 100644 --- a/ecal/tests/cpp/serialization_test/src/monitoring_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/monitoring_generate.cpp @@ -32,22 +32,22 @@ namespace eCAL SProcessMon GenerateProcess() { SProcessMon process; - process.rclock = rand() % 1000; - process.hname = GenerateString(10); - process.shm_transport_domain = GenerateString(8); - process.pid = rand() % 1000; - process.pname = GenerateString(8); - process.uname = GenerateString(6); - process.pparam = GenerateString(20); - process.state_severity = rand() % 5; - process.state_severity_level = rand() % 6; - process.state_info = GenerateString(15); - process.tsync_state = rand() % 3; - process.tsync_mod_name = GenerateString(12); - process.component_init_state = rand() % 10; - process.component_init_info = GenerateString(20); - process.ecal_runtime_version = GenerateString(8); - process.config_file_path = GenerateString(20); + process.registration_clock = rand() % 1000; + process.host_name = GenerateString(10); + process.shm_transport_domain = GenerateString(8); + process.process_id = rand() % 1000; + process.process_name = GenerateString(8); + process.unit_name = GenerateString(6); + process.process_parameter = GenerateString(20); + process.state_severity = rand() % 5; + process.state_severity_level = rand() % 6; + process.state_info = GenerateString(15); + process.time_sync_state = rand() % 3; + process.time_sync_module_name = GenerateString(12); + process.component_init_state = rand() % 10; + process.component_init_info = GenerateString(20); + process.ecal_runtime_version = GenerateString(8); + process.config_file_path = GenerateString(20); return process; } @@ -55,24 +55,24 @@ namespace eCAL STopicMon GenerateTopic(const std::string& direction) { STopicMon topic; - topic.rclock = rand() % 1000; - topic.hname = GenerateString(10); + topic.registration_clock = rand() % 1000; + topic.host_name = GenerateString(10); topic.shm_transport_domain = GenerateString(8); - topic.pid = rand() % 1000; - topic.pname = GenerateString(8); - topic.uname = GenerateString(6); - topic.tid = rand(); - topic.tname = GenerateString(10); + topic.process_id = rand() % 1000; + topic.process_name = GenerateString(8); + topic.unit_name = GenerateString(6); + topic.topic_id = rand(); + topic.topic_name = GenerateString(10); topic.direction = direction; - topic.tdatatype = eCAL::Registration::GenerateDataTypeInformation(); - topic.tlayer.push_back({ tl_ecal_shm, 1, true }); - topic.tsize = rand() % 5000; - topic.connections_loc = rand() % 10; - topic.connections_ext = rand() % 10; + topic.datatype_information = eCAL::Registration::GenerateDataTypeInformation(); + topic.transport_layer.push_back({ eTransportLayerType::shm, 1, true }); + topic.topic_size = rand() % 5000; + topic.connections_local = rand() % 10; + topic.connections_external = rand() % 10; topic.message_drops = rand() % 100; - topic.did = rand() % 10000; - topic.dclock = rand() % 10000; - topic.dfreq = rand() % 100; + topic.data_id = rand() % 10000; + topic.data_clock = rand() % 10000; + topic.data_frequency = rand() % 100; return topic; } @@ -80,10 +80,10 @@ namespace eCAL SMethodMon GenerateServiceMethod() { SMethodMon method; - method.mname = GenerateString(8); + method.method_name = GenerateString(8); - method.req_datatype = eCAL::Registration::GenerateDataTypeInformation(); - method.resp_datatype = eCAL::Registration::GenerateDataTypeInformation(); + method.request_datatype_information = eCAL::Registration::GenerateDataTypeInformation(); + method.response_datatype_information = eCAL::Registration::GenerateDataTypeInformation(); method.call_count = rand() % 10000; return method; @@ -93,16 +93,16 @@ namespace eCAL SServerMon GenerateService() { SServerMon server; - server.rclock = rand() % 1000; - server.hname = GenerateString(10); - server.pname = GenerateString(8); - server.uname = GenerateString(6); - server.pid = rand() % 1000; - server.sname = GenerateString(10); - server.sid = rand(); - server.version = rand() % 100; - server.tcp_port_v0 = rand() % 65536; - server.tcp_port_v1 = rand() % 65536; + server.registration_clock = rand() % 1000; + server.host_name = GenerateString(10); + server.process_name = GenerateString(8); + server.unit_name = GenerateString(6); + server.process_id = rand() % 1000; + server.service_name = GenerateString(10); + server.service_id = rand(); + server.version = rand() % 100; + server.tcp_port_v0 = rand() % 65536; + server.tcp_port_v1 = rand() % 65536; server.methods.push_back(GenerateServiceMethod()); server.methods.push_back(GenerateServiceMethod()); @@ -114,17 +114,17 @@ namespace eCAL SClientMon GenerateClient() { SClientMon client; - client.rclock = rand() % 1000; - client.hname = GenerateString(10); - client.pname = GenerateString(8); - client.uname = GenerateString(6); - client.pid = rand() % 1000; - client.sname = GenerateString(10); - client.sid = rand(); + client.registration_clock = rand() % 1000; + client.host_name = GenerateString(10); + client.process_name = GenerateString(8); + client.unit_name = GenerateString(6); + client.process_id = rand() % 1000; + client.service_name = GenerateString(10); + client.service_id = rand(); client.methods.push_back(GenerateServiceMethod()); client.methods.push_back(GenerateServiceMethod()); client.methods.push_back(GenerateServiceMethod()); - client.version = rand() % 100; + client.version = rand() % 100; return client; } diff --git a/ecal/tests/cpp/serialization_test/src/payload_compare.cpp b/ecal/tests/cpp/serialization_test/src/payload_compare.cpp index d886ee1a74..45bc01b7c8 100644 --- a/ecal/tests/cpp/serialization_test/src/payload_compare.cpp +++ b/ecal/tests/cpp/serialization_test/src/payload_compare.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,10 +35,10 @@ namespace eCAL } // compare topic info - if (sample1.topic_info.hname != sample2.topic_info.hname || - sample1.topic_info.pid != sample2.topic_info.pid || - sample1.topic_info.tid != sample2.topic_info.tid || - sample1.topic_info.tname != sample2.topic_info.tname) { + if (sample1.topic_info.host_name != sample2.topic_info.host_name || + sample1.topic_info.process_id != sample2.topic_info.process_id || + sample1.topic_info.topic_id != sample2.topic_info.topic_id || + sample1.topic_info.topic_name != sample2.topic_info.topic_name) { return false; } diff --git a/ecal/tests/cpp/serialization_test/src/payload_generate.cpp b/ecal/tests/cpp/serialization_test/src/payload_generate.cpp index c8281ad278..7abdfdd95d 100644 --- a/ecal/tests/cpp/serialization_test/src/payload_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/payload_generate.cpp @@ -32,10 +32,10 @@ namespace eCAL TopicInfo GenerateTopic() { TopicInfo topic; - topic.hname = GenerateString(8); - topic.pid = rand() % 1000; - topic.tid = rand(); - topic.tname = GenerateString(10); + topic.host_name = GenerateString(8); + topic.process_id = rand() % 1000; + topic.topic_id = rand(); + topic.topic_name = GenerateString(10); return topic; } diff --git a/ecal/tests/cpp/serialization_test/src/registration_generate.cpp b/ecal/tests/cpp/serialization_test/src/registration_generate.cpp index dece2cd9b5..5f451441b4 100644 --- a/ecal/tests/cpp/serialization_test/src/registration_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/registration_generate.cpp @@ -31,15 +31,15 @@ namespace eCAL Service::Method GenerateMethod() { Service::Method method; - method.mname = GenerateString(8); + method.method_name = GenerateString(8); method.req_type = GenerateString(8); // deprecated method.req_desc = GenerateString(10); // deprecated method.resp_type = GenerateString(8); // deprecated method.resp_desc = GenerateString(10); // deprecated - method.req_datatype = GenerateDataTypeInformation(); - method.resp_datatype = GenerateDataTypeInformation(); + method.request_datatype_information = GenerateDataTypeInformation(); + method.response_datatype_information = GenerateDataTypeInformation(); method.call_count = rand() % 10000; @@ -50,10 +50,10 @@ namespace eCAL Service::Service GenerateService() { Service::Service service; - service.rclock = rand() % 1000; - service.pname = GenerateString(10); - service.uname = GenerateString(5); - service.sname = GenerateString(8); + service.registration_clock = rand() % 1000; + service.process_name = GenerateString(10); + service.unit_name = GenerateString(5); + service.service_name = GenerateString(8); service.methods.push_back(GenerateMethod()); service.methods.push_back(GenerateMethod()); service.version = rand() % 10; @@ -67,13 +67,13 @@ namespace eCAL Service::Client GenerateClient() { Service::Client client; - client.rclock = rand() % 1000; - client.pname = GenerateString(10); - client.uname = GenerateString(5); - client.sname = GenerateString(8); + client.registration_clock = rand() % 1000; + client.process_name = GenerateString(10); + client.unit_name = GenerateString(5); + client.service_name = GenerateString(8); client.methods.push_back(GenerateMethod()); client.methods.push_back(GenerateMethod()); - client.version = rand() % 10; + client.version = rand() % 10; return client; } @@ -95,7 +95,7 @@ namespace eCAL layer.type = static_cast(rand() % (tl_all + 1)); layer.version = rand() % 100; layer.enabled = rand() % 2 == 1; - layer.active = rand() % 2 == 1; + layer.active = rand() % 2 == 1; return layer; } @@ -103,63 +103,63 @@ namespace eCAL Topic GenerateTopic() { Topic topic; - topic.rclock = rand() % 1000; + topic.registration_clock = rand() % 1000; topic.shm_transport_domain = GenerateString(6); - topic.pname = GenerateString(10); - topic.uname = GenerateString(5); - topic.tname = GenerateString(8); + topic.process_name = GenerateString(10); + topic.unit_name = GenerateString(5); + topic.topic_name = GenerateString(8); topic.direction = GenerateString(5); - topic.tdatatype = GenerateDataTypeInformation(); - topic.tlayer.push_back(GenerateTLayer()); - topic.tlayer.push_back(GenerateTLayer()); - topic.tsize = rand() % 1000; - topic.connections_loc = rand() % 50; - topic.connections_ext = rand() % 50; + topic.datatype_information = GenerateDataTypeInformation(); + topic.transport_layer.push_back(GenerateTLayer()); + topic.transport_layer.push_back(GenerateTLayer()); + topic.topic_size = rand() % 1000; + topic.connections_local = rand() % 50; + topic.connections_external = rand() % 50; topic.message_drops = rand() % 10; - topic.did = rand(); - topic.dclock = rand(); - topic.dfreq = rand() % 100; + topic.data_id = rand(); + topic.data_clock = rand(); + topic.data_frequency = rand() % 100; return topic; } Process GenerateProcess() { Process process; - process.rclock = rand() % 1000; - process.shm_transport_domain = GenerateString(6); - process.pname = GenerateString(10); - process.uname = GenerateString(5); - process.pparam = GenerateString(12); - process.state.severity = static_cast(rand() % (proc_sev_failed + 1)); - process.state.severity_level = static_cast(rand() % (proc_sev_level5 + 1)); - process.state.info = GenerateString(10); - process.tsync_state = static_cast(rand() % (tsync_replay + 1)); - process.tsync_mod_name = GenerateString(6); - process.component_init_state = rand() % 5; - process.component_init_info = GenerateString(8); - process.ecal_runtime_version = GenerateString(5); - process.config_file_path = GenerateString(20); + process.registration_clock = rand() % 1000; + process.shm_transport_domain = GenerateString(6); + process.process_name = GenerateString(10); + process.unit_name = GenerateString(5); + process.process_parameter = GenerateString(12); + process.state.severity = static_cast(rand() % (proc_sev_failed + 1)); + process.state.severity_level = static_cast(rand() % (proc_sev_level5 + 1)); + process.state.info = GenerateString(10); + process.time_sync_state = static_cast(rand() % (tsync_replay + 1)); + process.time_sync_module_name = GenerateString(6); + process.component_init_state = rand() % 5; + process.component_init_info = GenerateString(8); + process.ecal_runtime_version = GenerateString(5); + process.config_file_path = GenerateString(20); return process; } SampleIdentifier GenerateIdentifier() { SampleIdentifier identifier; - identifier.entity_id = rand(); + identifier.entity_id = rand(); identifier.process_id = rand() % 100; - identifier.host_name = GenerateString(8); + identifier.host_name = GenerateString(8); return identifier; } Sample GenerateProcessSample() { Sample sample; - sample.cmd_type = bct_reg_process; - sample.host.hname = GenerateString(8); + sample.cmd_type = bct_reg_process; + sample.host.name = GenerateString(8); sample.identifier = GenerateIdentifier(); // Process samples don't have an id internally, hence it must be 0. sample.identifier.entity_id = sample.identifier.process_id; - sample.process = GenerateProcess(); + sample.process = GenerateProcess(); return sample; } @@ -167,7 +167,7 @@ namespace eCAL { Sample sample; sample.cmd_type = bct_reg_publisher; - sample.host.hname = GenerateString(8); + sample.host.name = GenerateString(8); sample.identifier = GenerateIdentifier(); sample.topic = GenerateTopic(); return sample; @@ -177,7 +177,7 @@ namespace eCAL { Sample sample; sample.cmd_type = bct_reg_service; - sample.host.hname = GenerateString(8); + sample.host.name = GenerateString(8); sample.identifier = GenerateIdentifier(); sample.service = GenerateService(); return sample; @@ -187,7 +187,7 @@ namespace eCAL { Sample sample; sample.cmd_type = bct_reg_client; - sample.host.hname = GenerateString(8); + sample.host.name = GenerateString(8); sample.identifier = GenerateIdentifier(); sample.client = GenerateClient(); return sample; diff --git a/ecal/tests/cpp/serialization_test/src/service_compare.cpp b/ecal/tests/cpp/serialization_test/src/service_compare.cpp index 1cf1200cbf..3a362ee74b 100644 --- a/ecal/tests/cpp/serialization_test/src/service_compare.cpp +++ b/ecal/tests/cpp/serialization_test/src/service_compare.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,13 +26,13 @@ namespace eCAL // compare two ServiceHeaders for equality bool CompareServiceHeaders(const ServiceHeader& header1, const ServiceHeader& header2) { - return (header1.hname == header2.hname && - header1.sname == header2.sname && - header1.sid == header2.sid && - header1.mname == header2.mname && - header1.error == header2.error && - header1.id == header2.id && - header1.state == header2.state); + return (header1.host_name == header2.host_name && + header1.service_name == header2.service_name && + header1.service_id == header2.service_id && + header1.method_name == header2.method_name && + header1.error == header2.error && + header1.id == header2.id && + header1.state == header2.state); } // compare two Requests for equality diff --git a/ecal/tests/cpp/serialization_test/src/service_generate.cpp b/ecal/tests/cpp/serialization_test/src/service_generate.cpp index 61fa5d2b95..1e0f269ad3 100644 --- a/ecal/tests/cpp/serialization_test/src/service_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/service_generate.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,13 +31,13 @@ namespace eCAL ServiceHeader GenerateServiceHeader() { ServiceHeader header; - header.hname = GenerateString(8); - header.sname = GenerateString(8); - header.sid = GenerateString(5); - header.mname = GenerateString(8); - header.error = GenerateString(15); - header.id = rand() % 100; - header.state = static_cast(rand() % 3); + header.host_name = GenerateString(8); + header.service_name = GenerateString(8); + header.service_id = GenerateString(5); + header.method_name = GenerateString(8); + header.error = GenerateString(15); + header.id = rand() % 100; + header.state = static_cast(rand() % 3); return header; } diff --git a/lang/c/core/include/ecal/cimpl/ecal_callback_cimpl.h b/lang/c/core/include/ecal/cimpl/ecal_callback_cimpl.h index 81efea5c5b..3d3437f7ac 100644 --- a/lang/c/core/include/ecal/cimpl/ecal_callback_cimpl.h +++ b/lang/c/core/include/ecal/cimpl/ecal_callback_cimpl.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,8 +95,8 @@ struct SPubEventCallbackDataC enum eCAL_Publisher_Event type; //!< event type long long time; //!< event time stamp long long clock; //!< event clock - const char* tid; //!< topic id of the connected subscriber (for pub_event_update_connection only) - const char* tname; //!< topic type encoding of the connected subscriber (for pub_event_update_connection only) + const char* topic_id; //!< topic id of the connected subscriber (for pub_event_update_connection only) + const char* topic_name; //!< topic type encoding of the connected subscriber (for pub_event_update_connection only) const char* tencoding; //!< topic type name of the connected subscriber (for pub_event_update_connection only) const char* tdesc; //!< topic type descriptor information of the connected subscriber (for pub_event_update_connection only) }; @@ -109,8 +109,8 @@ struct SSubEventCallbackDataC enum eCAL_Subscriber_Event type; //!< event type long long time; //!< event time stamp long long clock; //!< event clock - const char* tid; //!< topic id of the connected publisher (for sub_event_update_connection only) - const char* tname; //!< topic type encoding of the connected publisher (for sub_event_update_connection only) + const char* topic_id; //!< topic id of the connected publisher (for sub_event_update_connection only) + const char* topic_name; //!< topic type encoding of the connected publisher (for sub_event_update_connection only) const char* tencoding; //!< topic type name of the connected publisher (for sub_event_update_connection only) const char* tdesc; //!< topic type descriptor information of the connected publisher (for sub_event_update_connection only) }; diff --git a/lang/c/core/src/ecal_publisher_cimpl.cpp b/lang/c/core/src/ecal_publisher_cimpl.cpp index b4af48a1b3..a19d31e032 100644 --- a/lang/c/core/src/ecal_publisher_cimpl.cpp +++ b/lang/c/core/src/ecal_publisher_cimpl.cpp @@ -59,13 +59,13 @@ namespace { const std::lock_guard lock(g_pub_event_callback_mtx); SPubEventCallbackDataC data{}; - data.type = enum_class_to_enum(data_->type); - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.tname = data_->tdatatype.name.c_str(); - data.tencoding = data_->tdatatype.encoding.c_str(); - data.tdesc = data_->tdatatype.descriptor.c_str(); + data.type = enum_class_to_enum(data_->type); + data.time = data_->time; + data.clock = data_->clock; + data.topic_id = data_->tid.c_str(); + data.topic_name = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdatatype.descriptor.c_str(); callback_(topic_name_, &data, par_); } } diff --git a/lang/c/core/src/ecal_subscriber_cimpl.cpp b/lang/c/core/src/ecal_subscriber_cimpl.cpp index ea71d338f6..00ecbd396e 100644 --- a/lang/c/core/src/ecal_subscriber_cimpl.cpp +++ b/lang/c/core/src/ecal_subscriber_cimpl.cpp @@ -71,13 +71,13 @@ namespace { const std::lock_guard lock(g_sub_event_callback_mtx); SSubEventCallbackDataC data{}; - data.type = enum_class_to_enum(data_->type); - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.tname = data_->tdatatype.name.c_str(); - data.tencoding = data_->tdatatype.encoding.c_str(); - data.tdesc = data_->tdatatype.descriptor.c_str(); + data.type = enum_class_to_enum(data_->type); + data.time = data_->time; + data.clock = data_->clock; + data.topic_id = data_->tid.c_str(); + data.topic_name = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdatatype.descriptor.c_str(); callback_(topic_name_, &data, par_); } } diff --git a/lang/python/core/ecal/core/service.py b/lang/python/core/ecal/core/service.py index 00304008ba..d8b66d4558 100644 --- a/lang/python/core/ecal/core/service.py +++ b/lang/python/core/ecal/core/service.py @@ -1,6 +1,6 @@ # ========================= eCAL LICENSE ================================= # -# Copyright (C) 2016 - 2019 Continental Corporation +# Copyright (C) 2016 - 2025 Continental Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lang/python/core/src/ecal_clang.cpp b/lang/python/core/src/ecal_clang.cpp index a32296e62c..cdc8d205d5 100644 --- a/lang/python/core/src/ecal_clang.cpp +++ b/lang/python/core/src/ecal_clang.cpp @@ -385,13 +385,13 @@ static void g_pub_event_callback(const char* topic_name_, const struct eCAL::v5: { const std::lock_guard lock(g_pub_event_callback_mtx); SPubEventCallbackDataC data{}; - data.type = enum_class_to_enum(data_->type); - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.tname = data_->tdatatype.name.c_str(); - data.tencoding = data_->tdatatype.encoding.c_str(); - data.tdesc = data_->tdatatype.descriptor.c_str(); + data.type = enum_class_to_enum(data_->type); + data.time = data_->time; + data.clock = data_->clock; + data.topic_id = data_->tid.c_str(); + data.topic_name = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdatatype.descriptor.c_str(); callback_(topic_name_, &data, par_); } @@ -563,13 +563,13 @@ static void g_sub_event_callback(const char* topic_name_, const struct eCAL::v5: { const std::lock_guard lock(g_sub_event_callback_mtx); SSubEventCallbackDataC data{}; - data.type = enum_class_to_enum(data_->type); - data.time = data_->time; - data.clock = data_->clock; - data.tid = data_->tid.c_str(); - data.tname = data_->tdatatype.name.c_str(); - data.tencoding = data_->tdatatype.encoding.c_str(); - data.tdesc = data_->tdatatype.descriptor.c_str(); + data.type = enum_class_to_enum(data_->type); + data.time = data_->time; + data.clock = data_->clock; + data.topic_id = data_->tid.c_str(); + data.topic_name = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdatatype.descriptor.c_str(); callback_(topic_name_, &data, par_); } diff --git a/lang/python/core/src/ecal_wrap.cxx b/lang/python/core/src/ecal_wrap.cxx index 3f95bbf0b7..0e37e814bd 100644 --- a/lang/python/core/src/ecal_wrap.cxx +++ b/lang/python/core/src/ecal_wrap.cxx @@ -942,60 +942,60 @@ namespace PyObject* topicDict = PyDict_New(); PyList_Append(topic_list_, topicDict); Py_DECREF(topicDict); - PyObject* val = Py_BuildValue("i", topic.rclock); + PyObject* val = Py_BuildValue("i", topic.registration_clock); PyDict_SetItemString(topicDict, "rclock", val); Py_DECREF(val); - val = Py_BuildValue("s", topic.hname.c_str()); + val = Py_BuildValue("s", topic.host_name.c_str()); PyDict_SetItemString(topicDict, "hname", val); Py_DECREF(val); val = Py_BuildValue("s", topic.shm_transport_domain.c_str()); PyDict_SetItemString(topicDict, "shm_transport_domain", val); Py_DECREF(val); - val = Py_BuildValue("i", topic.pid); + val = Py_BuildValue("i", topic.process_id); PyDict_SetItemString(topicDict, "pid", val); Py_DECREF(val); - val = Py_BuildValue("s", topic.pname.c_str()); + val = Py_BuildValue("s", topic.process_name.c_str()); PyDict_SetItemString(topicDict, "pname", val); Py_DECREF(val); - val = Py_BuildValue("s", topic.uname.c_str()); + val = Py_BuildValue("s", topic.unit_name.c_str()); PyDict_SetItemString(topicDict, "uname", val); Py_DECREF(val); - val = Py_BuildValue("s", std::to_string(topic.tid).c_str()); + val = Py_BuildValue("s", std::to_string(topic.topic_id).c_str()); PyDict_SetItemString(topicDict, "tid", val); Py_DECREF(val); - val = Py_BuildValue("s", topic.tname.c_str()); + val = Py_BuildValue("s", topic.topic_name.c_str()); PyDict_SetItemString(topicDict, "tname", val); Py_DECREF(val); val = Py_BuildValue("s", topic.direction.c_str()); PyDict_SetItemString(topicDict, "direction", val); Py_DECREF(val); - val = Py_BuildValue("s", topic.tdatatype.name.c_str()); + val = Py_BuildValue("s", topic.datatype_information.name.c_str()); PyDict_SetItemString(topicDict, "tdatatype_name", val); Py_DECREF(val); - val = Py_BuildValue("s", topic.tdatatype.encoding.c_str()); + val = Py_BuildValue("s", topic.datatype_information.encoding.c_str()); PyDict_SetItemString(topicDict, "tdatatype_encoding", val); Py_DECREF(val); - val = Py_BuildValue("y#", topic.tdatatype.descriptor.c_str(), topic.tdatatype.descriptor.length()); + val = Py_BuildValue("y#", topic.datatype_information.descriptor.c_str(), topic.datatype_information.descriptor.length()); PyDict_SetItemString(topicDict, "tdatatype_descriptor", val); Py_DECREF(val); PyObject* layerList = PyList_New(0); - for (auto layer : topic.tlayer) + for (auto layer : topic.transport_layer) { PyObject* layerDict = PyDict_New(); PyList_Append(layerList, layerDict); Py_DECREF(layerDict); switch (layer.type) { - case eCAL::Monitoring::tl_none: + case eCAL::Monitoring::eTransportLayerType::none: val = Py_BuildValue("s", "tl_none"); break; - case eCAL::Monitoring::tl_ecal_shm: + case eCAL::Monitoring::eTransportLayerType::shm: val = Py_BuildValue("s", "tl_ecal_shm"); break; - case eCAL::Monitoring::tl_ecal_udp_mc: + case eCAL::Monitoring::eTransportLayerType::udp_mc: val = Py_BuildValue("s", "tl_ecal_udp_mc"); break; - case eCAL::Monitoring::tl_ecal_tcp: + case eCAL::Monitoring::eTransportLayerType::tcp: val = Py_BuildValue("s", "tl_ecal_tcp"); break; } @@ -1009,25 +1009,25 @@ namespace } PyDict_SetItemString(topicDict, "layer", layerList); Py_DECREF(layerList); - val = Py_BuildValue("i", topic.tsize); + val = Py_BuildValue("i", topic.topic_size); PyDict_SetItemString(topicDict, "tsize", val); Py_DECREF(val); - val = Py_BuildValue("i", topic.connections_loc); + val = Py_BuildValue("i", topic.connections_local); PyDict_SetItemString(topicDict, "connections_loc", val); Py_DECREF(val); - val = Py_BuildValue("i", topic.connections_ext); + val = Py_BuildValue("i", topic.connections_external); PyDict_SetItemString(topicDict, "connections_ext", val); Py_DECREF(val); val = Py_BuildValue("i", topic.message_drops); PyDict_SetItemString(topicDict, "message_drops", val); Py_DECREF(val); - val = Py_BuildValue("i", topic.did); + val = Py_BuildValue("i", topic.data_id); PyDict_SetItemString(topicDict, "did", val); Py_DECREF(val); - val = Py_BuildValue("i", topic.dclock); + val = Py_BuildValue("i", topic.data_clock); PyDict_SetItemString(topicDict, "dclock", val); Py_DECREF(val); - val = Py_BuildValue("i", topic.dfreq); + val = Py_BuildValue("i", topic.data_frequency); PyDict_SetItemString(topicDict, "dfreq", val); Py_DECREF(val); // TODO: std::map attr @@ -1054,25 +1054,25 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) PyObject* processDict = PyDict_New(); PyList_Append(processList, processDict); Py_DECREF(processDict); - val = Py_BuildValue("i", process.rclock); + val = Py_BuildValue("i", process.registration_clock); PyDict_SetItemString(processDict, "rclock", val); Py_DECREF(val); - val = Py_BuildValue("s", process.hname.c_str()); + val = Py_BuildValue("s", process.host_name.c_str()); PyDict_SetItemString(processDict, "hname", val); Py_DECREF(val); val = Py_BuildValue("s", process.shm_transport_domain.c_str()); PyDict_SetItemString(processDict, "shm_transport_domain", val); Py_DECREF(val); - val = Py_BuildValue("i", process.pid); + val = Py_BuildValue("i", process.process_id); PyDict_SetItemString(processDict, "pid", val); Py_DECREF(val); - val = Py_BuildValue("s", process.pname.c_str()); + val = Py_BuildValue("s", process.process_name.c_str()); PyDict_SetItemString(processDict, "pname", val); Py_DECREF(val); - val = Py_BuildValue("s", process.uname.c_str()); + val = Py_BuildValue("s", process.unit_name.c_str()); PyDict_SetItemString(processDict, "uname", val); Py_DECREF(val); - val = Py_BuildValue("s", process.pparam.c_str()); + val = Py_BuildValue("s", process.process_parameter.c_str()); PyDict_SetItemString(processDict, "pparam", val); Py_DECREF(val); val = Py_BuildValue("i", process.state_severity); @@ -1084,10 +1084,10 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) val = Py_BuildValue("s", process.state_info.c_str()); PyDict_SetItemString(processDict, "state_info", val); Py_DECREF(val); - val = Py_BuildValue("i", process.tsync_state); + val = Py_BuildValue("i", process.time_sync_state); PyDict_SetItemString(processDict, "tsync_state", val); Py_DECREF(val); - val = Py_BuildValue("s", process.tsync_mod_name.c_str()); + val = Py_BuildValue("s", process.time_sync_module_name.c_str()); PyDict_SetItemString(processDict, "tsync_mod_name", val); Py_DECREF(val); val = Py_BuildValue("i", process.component_init_state); @@ -1111,25 +1111,25 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) PyObject* serviceDict = PyDict_New(); PyList_Append(serviceList, serviceDict); Py_DECREF(serviceDict); - val = Py_BuildValue("i", service.rclock); + val = Py_BuildValue("i", service.registration_clock); PyDict_SetItemString(serviceDict, "rclock", val); Py_DECREF(val); - val = Py_BuildValue("s", service.hname.c_str()); + val = Py_BuildValue("s", service.host_name.c_str()); PyDict_SetItemString(serviceDict, "hname", val); Py_DECREF(val); - val = Py_BuildValue("s", service.pname.c_str()); + val = Py_BuildValue("s", service.process_name.c_str()); PyDict_SetItemString(serviceDict, "pname", val); Py_DECREF(val); - val = Py_BuildValue("s", service.uname.c_str()); + val = Py_BuildValue("s", service.unit_name.c_str()); PyDict_SetItemString(serviceDict, "uname", val); Py_DECREF(val); - val = Py_BuildValue("i", service.pid); + val = Py_BuildValue("i", service.process_id); PyDict_SetItemString(serviceDict, "pid", val); Py_DECREF(val); - val = Py_BuildValue("s", service.sname.c_str()); + val = Py_BuildValue("s", service.service_name.c_str()); PyDict_SetItemString(serviceDict, "sname", val); Py_DECREF(val); - val = Py_BuildValue("s", std::to_string(service.sid).c_str()); + val = Py_BuildValue("s", std::to_string(service.service_id).c_str()); PyDict_SetItemString(serviceDict, "sid", val); Py_DECREF(val); val = Py_BuildValue("i", service.version); @@ -1146,25 +1146,25 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) for (const auto method : service.methods) { - val = Py_BuildValue("s", method.mname.c_str()); + val = Py_BuildValue("s", method.method_name.c_str()); PyDict_SetItemString(methodsDict, "mname", val); Py_DECREF(val); - val = Py_BuildValue("s", method.req_datatype.name.c_str()); + val = Py_BuildValue("s", method.request_datatype_information.name.c_str()); PyDict_SetItemString(methodsDict, "request_datatype_name", val); Py_DECREF(val); - val = Py_BuildValue("s", method.req_datatype.encoding.c_str()); + val = Py_BuildValue("s", method.request_datatype_information.encoding.c_str()); PyDict_SetItemString(methodsDict, "request_datatype_encoding", val); Py_DECREF(val); - val = Py_BuildValue("y#", method.req_datatype.descriptor.c_str(), method.req_datatype.descriptor.length()); + val = Py_BuildValue("y#", method.request_datatype_information.descriptor.c_str(), method.request_datatype_information.descriptor.length()); PyDict_SetItemString(methodsDict, "request_datatype_descriptor", val); Py_DECREF(val); - val = Py_BuildValue("s", method.resp_datatype.name.c_str()); + val = Py_BuildValue("s", method.response_datatype_information.name.c_str()); PyDict_SetItemString(methodsDict, "response_datatype_name", val); Py_DECREF(val); - val = Py_BuildValue("s", method.resp_datatype.encoding.c_str()); + val = Py_BuildValue("s", method.response_datatype_information.encoding.c_str()); PyDict_SetItemString(methodsDict, "response_datatype_encoding", val); Py_DECREF(val); - val = Py_BuildValue("y#", method.resp_datatype.descriptor.c_str(), method.resp_datatype.descriptor.length()); + val = Py_BuildValue("y#", method.response_datatype_information.descriptor.c_str(), method.response_datatype_information.descriptor.length()); PyDict_SetItemString(methodsDict, "response_datatype_descriptor", val); Py_DECREF(val); val = Py_BuildValue("i", method.call_count); @@ -1183,25 +1183,25 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) PyObject* clientDict = PyDict_New(); PyList_Append(clientList, clientDict); Py_DECREF(clientDict); - val = Py_BuildValue("i", client.rclock); + val = Py_BuildValue("i", client.registration_clock); PyDict_SetItemString(clientDict, "rclock", val); Py_DECREF(val); - val = Py_BuildValue("s", client.hname.c_str()); + val = Py_BuildValue("s", client.host_name.c_str()); PyDict_SetItemString(clientDict, "hname", val); Py_DECREF(val); - val = Py_BuildValue("s", client.pname.c_str()); + val = Py_BuildValue("s", client.process_name.c_str()); PyDict_SetItemString(clientDict, "pname", val); Py_DECREF(val); - val = Py_BuildValue("s", client.uname.c_str()); + val = Py_BuildValue("s", client.unit_name.c_str()); PyDict_SetItemString(clientDict, "uname", val); Py_DECREF(val); - val = Py_BuildValue("i", client.pid); + val = Py_BuildValue("i", client.process_id); PyDict_SetItemString(clientDict, "pid", val); Py_DECREF(val); - val = Py_BuildValue("s", client.sname.c_str()); + val = Py_BuildValue("s", client.service_name.c_str()); PyDict_SetItemString(clientDict, "sname", val); Py_DECREF(val); - val = Py_BuildValue("s", std::to_string(client.sid).c_str()); + val = Py_BuildValue("s", std::to_string(client.service_id).c_str()); PyDict_SetItemString(clientDict, "sid", val); Py_DECREF(val); PyObject* methodsDict = PyDict_New(); @@ -1209,25 +1209,25 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) for (const auto method : client.methods) { - val = Py_BuildValue("s", method.mname.c_str()); + val = Py_BuildValue("s", method.method_name.c_str()); PyDict_SetItemString(methodsDict, "mname", val); Py_DECREF(val); - val = Py_BuildValue("s", method.req_datatype.name.c_str()); + val = Py_BuildValue("s", method.request_datatype_information.name.c_str()); PyDict_SetItemString(methodsDict, "request_datatype_type", val); Py_DECREF(val); - val = Py_BuildValue("s", method.req_datatype.encoding.c_str()); + val = Py_BuildValue("s", method.request_datatype_information.encoding.c_str()); PyDict_SetItemString(methodsDict, "request_datatype_encoding", val); Py_DECREF(val); - val = Py_BuildValue("y#", method.req_datatype.descriptor.c_str(), method.req_datatype.descriptor.length()); + val = Py_BuildValue("y#", method.request_datatype_information.descriptor.c_str(), method.request_datatype_information.descriptor.length()); PyDict_SetItemString(methodsDict, "request_datatype_descriptor", val); Py_DECREF(val); - val = Py_BuildValue("s", method.resp_datatype.name.c_str()); + val = Py_BuildValue("s", method.response_datatype_information.name.c_str()); PyDict_SetItemString(methodsDict, "response_datatype_name", val); Py_DECREF(val); - val = Py_BuildValue("s", method.resp_datatype.encoding.c_str()); + val = Py_BuildValue("s", method.response_datatype_information.encoding.c_str()); PyDict_SetItemString(methodsDict, "response_datatype_encoding", val); Py_DECREF(val); - val = Py_BuildValue("y#", method.resp_datatype.descriptor.c_str(), method.resp_datatype.descriptor.length()); + val = Py_BuildValue("y#", method.response_datatype_information.descriptor.c_str(), method.response_datatype_information.descriptor.length()); PyDict_SetItemString(methodsDict, "response_datatype_descriptor", val); Py_DECREF(val); val = Py_BuildValue("i", method.call_count); @@ -1274,13 +1274,13 @@ PyObject* mon_logging(PyObject* /*self*/, PyObject* /*args*/) val = Py_BuildValue("L", log.time); PyDict_SetItemString(logDict, "time", val); Py_DECREF(val); - val = Py_BuildValue("s", log.hname.c_str()); + val = Py_BuildValue("s", log.host_name.c_str()); PyDict_SetItemString(logDict, "hname", val); Py_DECREF(val); - val = Py_BuildValue("i", log.pid); + val = Py_BuildValue("i", log.process_id); PyDict_SetItemString(logDict, "pid", val); Py_DECREF(val); - val = Py_BuildValue("s", log.pname.c_str()); + val = Py_BuildValue("s", log.process_name.c_str()); PyDict_SetItemString(logDict, "pname", val); Py_DECREF(val); val = Py_BuildValue("i", log.level); From e4ee6ca04c5cdd975ef0155c336526bda9769e74 Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:21:29 +0100 Subject: [PATCH 04/16] [core] Removed "abc" as default ecal yaml file path. (#1970) --- ecal/core/include/ecal/config/configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecal/core/include/ecal/config/configuration.h b/ecal/core/include/ecal/config/configuration.h index 9e0e2198d2..942b039a10 100644 --- a/ecal/core/include/ecal/config/configuration.h +++ b/ecal/core/include/ecal/config/configuration.h @@ -61,6 +61,6 @@ namespace eCAL ECAL_API std::string GetConfigurationFilePath() const; protected: - std::string ecal_yaml_file_path = "abc"; + std::string ecal_yaml_file_path; }; } From 8c713a7bae94b393c431c6d84b1a335c7e125966 Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Thu, 30 Jan 2025 10:50:42 +0100 Subject: [PATCH 05/16] [cmake] Renamed CMake Options (#1968) * All eCAL cmake options are now prefixed with ECAL_ * "HAS" was replaced with "USE", so it now reads e.g. ECAL_USE_QT instead of HAS_QT * The main CMakeLists.txt can translate the old options to the new ones while emitting warnings * The old HAS_QT5 was removed entirely, it had been deprecated a while ago anyways and was replaced by HAS_QT. The newer HAS_QT can still be used through the compatibility options. --- .github/workflows/build-macos.yml | 26 +- .github/workflows/build-ubuntu.yml | 27 +- .github/workflows/build-windows.yml | 56 ++-- .github/workflows/clang-tidy-review.yml | 27 +- .github/workflows/documentation.yml | 26 +- CMakeLists.txt | 278 ++++++++++++------ CMakePresets.json | 30 +- app/mon/mon_gui/CMakeLists.txt | 14 +- app/mon/mon_gui/src/ecalmon.cpp | 8 +- app/mon/mon_plugins/CMakeLists.txt | 4 +- app/rec/rec_client_core/CMakeLists.txt | 6 +- build_win/win_make_cmake.bat | 56 ++-- colcon.pkg | 6 +- conanfile.py | 2 +- contrib/mma/README.md | 2 +- cpack/cpack_variables.cmake | 2 +- .../development/building_ecal_from_source.rst | 4 +- doc/rst/development/ecal_cmake_options.rst | 38 +-- ecal/CMakeLists.txt | 2 +- ecal/core/cfg/CMakeLists.txt | 2 +- ecal/ecal-core-options.cmake | 2 +- ecal/samples/CMakeLists.txt | 4 +- lang/python/CMakeLists.txt | 4 +- lang/python/samples/CMakeLists.txt | 2 +- pyproject.toml | 16 +- samples/CMakeLists.txt | 16 +- tests/contrib/cross/Makefile | 2 +- 27 files changed, 383 insertions(+), 279 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index de9f641135..97c913eba8 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -46,20 +46,20 @@ jobs: cd "${{ runner.workspace }}/_build" cmake $GITHUB_WORKSPACE -G "Ninja" \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake \ - -DHAS_HDF5=ON \ - -DHAS_QT5=ON \ - -DHAS_CURL=ON \ - -DHAS_CAPNPROTO=ON \ - -DHAS_FTXUI=ON \ - -DBUILD_DOCS=ON \ - -DBUILD_APPS=ON \ - -DBUILD_SAMPLES=ON \ - -DBUILD_TIME=ON \ - -DBUILD_PY_BINDING=ON \ - -DBUILD_CSHARP_BINDING=OFF \ - -DBUILD_ECAL_TESTS=ON \ + -DECAL_USE_HDF5=ON \ + -DECAL_USE_QT=ON \ + -DECAL_USE_CURL=ON \ + -DECAL_USE_CAPNPROTO=ON \ + -DECAL_USE_FTXUI=ON \ + -DECAL_BUILD_DOCS=ON \ + -DECAL_BUILD_APPS=ON \ + -DECAL_BUILD_SAMPLES=ON \ + -DECAL_BUILD_TIMEPLUGINS=ON \ + -DECAL_BUILD_PY_BINDING=ON \ + -DECAL_BUILD_CSHARP_BINDING=OFF \ + -DECAL_BUILD_TESTS=ON \ -DECAL_INSTALL_SAMPLE_SOURCES=ON \ - -DECAL_NPCAP_SUPPORT=OFF \ + -DECAL_USE_NPCAP=OFF \ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ -DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 29c61a580d..7fe4c6e760 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -104,21 +104,20 @@ jobs: cmake $GITHUB_WORKSPACE -G "Ninja" \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DHAS_HDF5=ON \ - -DHAS_QT=ON \ - -DHAS_CURL=ON \ - -DHAS_CAPNPROTO=ON \ - -DHAS_FTXUI=ON \ - -DBUILD_DOCS=ON \ - -DBUILD_APPS=ON \ - -DBUILD_SAMPLES=ON \ - -DBUILD_TIME=ON \ - -DBUILD_PY_BINDING=ON \ - -DBUILD_STANDALONE_PY_WHEEL=OFF \ - -DBUILD_CSHARP_BINDING=OFF \ - -DBUILD_ECAL_TESTS=ON \ + -DECAL_USE_HDF5=ON \ + -DECAL_USE_QT=ON \ + -DECAL_USE_CURL=ON \ + -DECAL_USE_CAPNPROTO=ON \ + -DECAL_USE_FTXUI=ON \ + -DECAL_BUILD_DOCS=ON \ + -DECAL_BUILD_APPS=ON \ + -DECAL_BUILD_SAMPLES=ON \ + -DECAL_BUILD_TIMEPLUGINS=ON \ + -DECAL_BUILD_PY_BINDING=ON \ + -DECAL_BUILD_CSHARP_BINDING=OFF \ + -DECAL_BUILD_TESTS=ON \ -DECAL_INSTALL_SAMPLE_SOURCES=ON \ - -DECAL_NPCAP_SUPPORT=OFF \ + -DECAL_USE_NPCAP=OFF \ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ -DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 3a74d5a1f3..b118c37e3b 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -63,20 +63,20 @@ jobs: cmake %GITHUB_WORKSPACE% -G "Visual Studio 16 2019" -A x64 -T v142 ^ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake ^ - -DHAS_HDF5=ON ^ - -DHAS_QT=ON ^ - -DHAS_CURL=OFF ^ - -DHAS_CAPNPROTO=OFF ^ - -DHAS_FTXUI=ON ^ - -DBUILD_DOCS=OFF ^ - -DBUILD_APPS=OFF ^ - -DBUILD_SAMPLES=OFF ^ - -DBUILD_TIME=ON ^ - -DBUILD_PY_BINDING=OFF ^ - -DBUILD_CSHARP_BINDING=OFF ^ - -DBUILD_ECAL_TESTS=OFF ^ + -DECAL_USE_HDF5=ON ^ + -DECAL_USE_QT=ON ^ + -DECAL_USE_CURL=OFF ^ + -DECAL_USE_CAPNPROTO=OFF ^ + -DECAL_USE_FTXUI=ON ^ + -DECAL_BUILD_DOCS=OFF ^ + -DECAL_BUILD_APPS=OFF ^ + -DECAL_BUILD_SAMPLES=OFF ^ + -DECAL_BUILD_TIMEPLUGINS=ON ^ + -DECAL_BUILD_PY_BINDING=OFF ^ + -DECAL_BUILD_CSHARP_BINDING=OFF ^ + -DECAL_BUILD_TESTS=OFF ^ -DECAL_INSTALL_SAMPLE_SOURCES=OFF ^ - -DECAL_NPCAP_SUPPORT=ON ^ + -DECAL_USE_NPCAP=ON ^ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^ -DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON ^ @@ -92,7 +92,7 @@ jobs: -DBUILD_SHARED_LIBS=OFF ^ -DCMAKE_PREFIX_PATH="%ProgramFiles%/Cap'n Proto/lib/cmake/CapnProto" ^ -DCMAKE_BUILD_TYPE=Debug ^ - -DCPACK_PACK_WITH_INNOSETUP=OFF + -DECAL_CPACK_PACK_WITH_INNOSETUP=OFF shell: cmd - name: CMake Complete @@ -101,20 +101,20 @@ jobs: cd "${{ runner.workspace }}/_build/complete" cmake %GITHUB_WORKSPACE% -G "Visual Studio 16 2019" -A x64 -T v142 ^ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake ^ - -DHAS_HDF5=ON ^ - -DHAS_QT=ON ^ - -DHAS_CURL=ON ^ - -DHAS_CAPNPROTO=OFF ^ - -DHAS_FTXUI=ON ^ - -DBUILD_DOCS=ON ^ - -DBUILD_APPS=ON ^ - -DBUILD_SAMPLES=ON ^ - -DBUILD_TIME=ON ^ - -DBUILD_PY_BINDING=OFF ^ - -DBUILD_CSHARP_BINDING=ON ^ - -DBUILD_ECAL_TESTS=ON ^ + -DECAL_USE_HDF5=ON ^ + -DECAL_USE_QT=ON ^ + -DECAL_USE_CURL=ON ^ + -DECAL_USE_CAPNPROTO=OFF ^ + -DECAL_USE_FTXUI=ON ^ + -DECAL_BUILD_DOCS=ON ^ + -DECAL_BUILD_APPS=ON ^ + -DECAL_BUILD_SAMPLES=ON ^ + -DECAL_BUILD_TIMEPLUGINS=ON ^ + -DECAL_BUILD_PY_BINDING=OFF ^ + -DECAL_BUILD_CSHARP_BINDING=ON ^ + -DECAL_BUILD_TESTS=ON ^ -DECAL_INSTALL_SAMPLE_SOURCES=ON ^ - -DECAL_NPCAP_SUPPORT=ON ^ + -DECAL_USE_NPCAP=ON ^ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^ -DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON ^ @@ -130,7 +130,7 @@ jobs: -DBUILD_SHARED_LIBS=OFF ^ -DCMAKE_PREFIX_PATH="%ProgramFiles%/Cap'n Proto/lib/cmake/CapnProto" ^ -DCMAKE_BUILD_TYPE=Release ^ - -DCPACK_PACK_WITH_INNOSETUP=ON + -DECAL_CPACK_PACK_WITH_INNOSETUP=ON shell: cmd - name: Build SDK diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 0ee377b1bb..85567122c6 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -40,21 +40,20 @@ jobs: -G Ninja \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DHAS_HDF5=ON \ - -DHAS_QT=ON \ - -DHAS_CURL=ON \ - -DHAS_CAPNPROTO=OFF \ - -DHAS_FTXUI=ON \ - -DBUILD_DOCS=OFF \ - -DBUILD_APPS=ON \ - -DBUILD_SAMPLES=ONS \ - -DBUILD_TIME=ON \ - -DBUILD_PY_BINDING=OFF \ - -DBUILD_STANDALONE_PY_WHEEL=OFF \ - -DBUILD_CSHARP_BINDING=OFF \ - -DBUILD_ECAL_TESTS=OFF \ + -DECAL_USE_HDF5=ON \ + -DECAL_USE_QT=ON \ + -DECAL_USE_CURL=ON \ + -DECAL_USE_CAPNPROTO=OFF \ + -DECAL_USE_FTXUI=ON \ + -DECAL_BUILD_DOCS=OFF \ + -DECAL_BUILD_APPS=ON \ + -DECAL_BUILD_SAMPLES=ON \ + -DECAL_BUILD_TIMEPLUGINS=ON \ + -DECAL_BUILD_PY_BINDING=OFF \ + -DECAL_BUILD_CSHARP_BINDING=OFF \ + -DECAL_BUILD_TESTS=OFF \ -DECAL_INSTALL_SAMPLE_SOURCES=ON \ - -DECAL_NPCAP_SUPPORT=OFF \ + -DECAL_USE_NPCAP=OFF \ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ -DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4994ad946f..9aa394a53c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -73,20 +73,20 @@ jobs: cd "${{ runner.workspace }}/_build" cmake $GITHUB_WORKSPACE -G "Ninja" \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake \ - -DHAS_HDF5=ON \ - -DHAS_QT=OFF \ - -DHAS_CURL=OFF \ - -DHAS_CAPNPROTO=OFF \ - -DHAS_FTXUI=ON \ - -DBUILD_DOCS=ON \ - -DBUILD_APPS=OFF \ - -DBUILD_SAMPLES=OFF \ - -DBUILD_TIME=OFF \ - -DBUILD_PY_BINDING=ON \ - -DBUILD_CSHARP_BINDING=OFF \ - -DBUILD_ECAL_TESTS=OFF \ + -DECAL_USE_HDF5=ON \ + -DECAL_USE_QT=OFF \ + -DECAL_USE_CURL=OFF \ + -DECAL_USE_CAPNPROTO=OFF \ + -DECAL_USE_FTXUI=ON \ + -DECAL_BUILD_DOCS=ON \ + -DECAL_BUILD_APPS=OFF \ + -DECAL_BUILD_SAMPLES=OFF \ + -DECAL_BUILD_TIMEPLUGINS=OFF \ + -DECAL_BUILD_PY_BINDING=ON \ + -DECAL_BUILD_CSHARP_BINDING=OFF \ + -DECAL_BUILD_TESTS=OFF \ -DECAL_INSTALL_SAMPLE_SOURCES=OFF \ - -DECAL_NPCAP_SUPPORT=OFF \ + -DECAL_USE_NPCAP=OFF \ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ -DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ diff --git a/CMakeLists.txt b/CMakeLists.txt index d5f37b8ad6..a783df0957 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,50 +64,156 @@ if(UNIX) endif () endif() +#--------------------------------------------------------- +# Compatibility Options with eCAL 5 CMake Options +#--------------------------------------------------------- + +# Legacy Compatibility option for HAS_HDF5 +if(DEFINED HAS_HDF5 AND NOT DEFINED ECAL_USE_HDF5) + set(ECAL_USE_HDF5 ${HAS_HDF5}) + message(WARNING "The option HAS_HDF5 is deprecated and may be removed at any time. Please use ECAL_USE_HDF5 instead.") +endif() + +# Legacy Compatibility option for HAS_QT +if(DEFINED HAS_QT AND NOT DEFINED ECAL_USE_QT) + set(ECAL_USE_QT ${HAS_QT}) + message(WARNING "The option HAS_QT is deprecated and may be removed at any time. Please use ECAL_USE_QT instead.") +endif() + +# Legacy Compatibility option for HAS_CURL +if(DEFINED HAS_CURL AND NOT DEFINED ECAL_USE_CURL) + set(ECAL_USE_CURL ${HAS_CURL}) + message(WARNING "The option HAS_CURL is deprecated and may be removed at any time. Please use ECAL_USE_CURL instead.") +endif() + +# Legacy Compatibility option for HAS_FTXUI +if(DEFINED HAS_FTXUI AND NOT DEFINED ECAL_USE_FTXUI) + set(ECAL_USE_FTXUI ${HAS_FTXUI}) + message(WARNING "The option HAS_FTXUI is deprecated and may be removed at any time. Please use ECAL_USE_FTXUI instead.") +endif() + +# Legacy Compatibility option for HAS_CAPNPROTO +if(DEFINED HAS_CAPNPROTO AND NOT DEFINED ECAL_USE_CAPNPROTO) + set(ECAL_USE_CAPNPROTO ${HAS_CAPNPROTO}) + message(WARNING "The option HAS_CAPNPROTO is deprecated and may be removed at any time. Please use ECAL_USE_CAPNPROTO instead.") +endif() + +# Legacy Compatibility option for HAS_FLATBUFFERS +if(DEFINED HAS_FLATBUFFERS AND NOT DEFINED ECAL_USE_FLATBUFFERS) + set(ECAL_USE_FLATBUFFERS ${HAS_FLATBUFFERS}) + message(WARNING "The option HAS_FLATBUFFERS is deprecated and may be removed at any time. Please use ECAL_USE_FLATBUFFERS instead.") +endif() + +# Legacy Compatibility option for HAS_MESSAGEPACK +if(DEFINED HAS_MESSAGEPACK AND NOT DEFINED ECAL_USE_MESSAGEPACK) + set(ECAL_USE_MESSAGEPACK ${HAS_MESSAGEPACK}) + message(WARNING "The option HAS_MESSAGEPACK is deprecated and may be removed at any time. Please use ECAL_USE_MESSAGEPACK instead.") +endif() + +# Legacy Compatibility option for BUILD_DOCS +if(DEFINED BUILD_DOCS AND NOT DEFINED ECAL_BUILD_DOCS) + set(ECAL_BUILD_DOCS ${BUILD_DOCS}) + message(WARNING "The option BUILD_DOCS is deprecated and may be removed at any time. Please use ECAL_BUILD_DOCS instead.") +endif() + +# Legacy Compatibility option for BUILD_APPS +if(DEFINED BUILD_APPS AND NOT DEFINED ECAL_BUILD_APPS) + set(ECAL_BUILD_APPS ${BUILD_APPS}) + message(WARNING "The option BUILD_APPS is deprecated and may be removed at any time. Please use ECAL_BUILD_APPS instead.") +endif() + +# Legacy Compatibility option for BUILD_APP_REC_ADDON_SDK +if(DEFINED BUILD_APP_REC_ADDON_SDK AND NOT DEFINED ECAL_BUILD_APP_REC_ADDON_SDK) + set(ECAL_BUILD_APP_REC_ADDON_SDK ${BUILD_APP_REC_ADDON_SDK}) + message(WARNING "The option BUILD_APP_REC_ADDON_SDK is deprecated and may be removed at any time. Please use ECAL_BUILD_APP_REC_ADDON_SDK instead.") +endif() + +# Legacy Compatibility option for BUILD_SAMPLES +if(DEFINED BUILD_SAMPLES AND NOT DEFINED ECAL_BUILD_SAMPLES) + set(ECAL_BUILD_SAMPLES ${BUILD_SAMPLES}) + message(WARNING "The option BUILD_SAMPLES is deprecated and may be removed at any time. Please use ECAL_BUILD_SAMPLES instead.") +endif() + +# Legacy Compatibility option for BUILD_TIME +if(DEFINED BUILD_TIME AND NOT DEFINED ECAL_BUILD_TIMEPLUGINS) + set(ECAL_BUILD_TIMEPLUGINS ${BUILD_TIME}) + message(WARNING "The option BUILD_TIME is deprecated and may be removed at any time. Please use ECAL_BUILD_TIMEPLUGINS instead.") +endif() + +# Legacy Compatibility option for BUILD_C_BINDING +if(DEFINED BUILD_C_BINDING AND NOT DEFINED ECAL_BUILD_C_BINDING) + set(ECAL_BUILD_C_BINDING ${BUILD_C_BINDING}) + message(WARNING "The option BUILD_C_BINDING is deprecated and may be removed at any time. Please use ECAL_BUILD_C_BINDING instead.") +endif() + +# Legacy Compatibility option for BUILD_PY_BINDING +if(DEFINED BUILD_PY_BINDING AND NOT DEFINED ECAL_BUILD_PY_BINDING) + set(ECAL_BUILD_PY_BINDING ${BUILD_PY_BINDING}) + message(WARNING "The option BUILD_PY_BINDING is deprecated and may be removed at any time. Please use ECAL_BUILD_PY_BINDING instead.") +endif() + +# Legacy Compatibility option for BUILD_CSHARP_BINDING +if(DEFINED BUILD_CSHARP_BINDING AND NOT DEFINED ECAL_BUILD_CSHARP_BINDING) + set(ECAL_BUILD_CSHARP_BINDING ${BUILD_CSHARP_BINDING}) + message(WARNING "The option BUILD_CSHARP_BINDING is deprecated and may be removed at any time. Please use ECAL_BUILD_CSHARP_BINDING instead.") +endif() + +# Legacy Compatibility option for ECAL_NPCAP_SUPPORT +if(DEFINED ECAL_NPCAP_SUPPORT AND NOT DEFINED ECAL_USE_NPCAP) + set(ECAL_USE_NPCAP ${ECAL_NPCAP_SUPPORT}) + message(WARNING "The option ECAL_NPCAP_SUPPORT is deprecated and may be removed at any time. Please use ECAL_USE_NPCAP instead.") +endif() + +# Legacy Compatibility option for BUILD_ECAL_TESTS +if(DEFINED BUILD_ECAL_TESTS AND NOT DEFINED ECAL_BUILD_TESTS) + set(ECAL_BUILD_TESTS ${BUILD_ECAL_TESTS}) + message(WARNING "The option BUILD_ECAL_TESTS is deprecated and may be removed at any time. Please use ECAL_BUILD_TESTS instead.") +endif() + +# Legacy Compatibility option for CPACK_PACK_WITH_INNOSETUP +if(DEFINED CPACK_PACK_WITH_INNOSETUP AND NOT DEFINED ECAL_CPACK_PACK_WITH_INNOSETUP) + set(ECAL_CPACK_PACK_WITH_INNOSETUP ${CPACK_PACK_WITH_INNOSETUP}) + message(WARNING "The option CPACK_PACK_WITH_INNOSETUP is deprecated and may be removed at any time. Please use ECAL_CPACK_PACK_WITH_INNOSETUP instead.") +endif() + # -------------------------------------------------------- # command line build options -# use it that way cmake .. -DBUILD_APPS=ON -DBUILD_SAMPLES=ON +# use it that way cmake .. -DECAL_BUILD_APPS=ON -DECAL_BUILD_SAMPLES=ON # -------------------------------------------------------- -option(HAS_HDF5 "Platform supports HDF5 library" ON) - -# If the user set the legacy HAS_QT5 option, but didn't set the new HAS_QT option, set it to the value of HAS_QT5 -if(DEFINED HAS_QT5 AND NOT DEFINED HAS_QT) - set(HAS_QT ${HAS_QT5}) - message(WARNING "The option HAS_QT5 is deprecated and may be removed at any time. Please use HAS_QT instead.") -endif() +option(ECAL_USE_HDF5 "Platform supports HDF5 library" ON) -option(HAS_QT "Platform supports Qt 5 / 6 library." ON) +option(ECAL_USE_QT "Platform supports Qt 5 / 6 library." ON) -option(HAS_CURL "Build with CURL (i.e. upload support in the recorder app)" ON) -option(HAS_FTXUI "Platform supports FTXUI library. Requires C++17 and up." ON) +option(ECAL_USE_CURL "Build with CURL (i.e. upload support in the recorder app)" ON) +option(ECAL_USE_FTXUI "Platform supports FTXUI library. Requires C++17 and up." ON) # Serialization format support -option(HAS_CAPNPROTO "Platform supports Cap'n Proto library" OFF) -option(HAS_FLATBUFFERS "Platform supports flatbuffers library" OFF) -option(HAS_MESSAGEPACK "Platform supports messagepack library" OFF) - -option(BUILD_DOCS "Build the eCAL documentation" OFF) -option(BUILD_APPS "Build the eCAL applications" ON) -option(BUILD_APP_REC_ADDON_SDK "Build eCAL rec addon SDK" ${BUILD_APPS}) -option(BUILD_SAMPLES "Build the eCAL samples" ON) -option(BUILD_TIME "Build the eCAL time interfaces" ON) -option(BUILD_C_BINDING "Build eCAL C binding" ON) -mark_as_advanced(FORCE BUILD_C_BINDING) -option(BUILD_PY_BINDING "Build eCAL python binding" OFF) -option(BUILD_CSHARP_BINDING "Build eCAL C# binding" OFF) -option(BUILD_ECAL_TESTS "Build the eCAL google tests" OFF) +option(ECAL_USE_CAPNPROTO "Platform supports Cap'n Proto library" OFF) +option(ECAL_USE_FLATBUFFERS "Platform supports flatbuffers library" OFF) +option(ECAL_USE_MESSAGEPACK "Platform supports messagepack library" OFF) + +option(ECAL_BUILD_DOCS "Build the eCAL documentation" OFF) +option(ECAL_BUILD_APPS "Build the eCAL applications" ON) +option(ECAL_BUILD_APP_REC_ADDON_SDK "Build eCAL rec addon SDK" ${ECAL_BUILD_APPS}) +option(ECAL_BUILD_SAMPLES "Build the eCAL samples" ON) +option(ECAL_BUILD_TIMEPLUGINS "Build the eCAL time interfaces" ON) +option(ECAL_BUILD_C_BINDING "Build eCAL C binding" ON) +mark_as_advanced(FORCE ECAL_BUILD_C_BINDING) +option(ECAL_BUILD_PY_BINDING "Build eCAL python binding" OFF) +option(ECAL_BUILD_CSHARP_BINDING "Build eCAL C# binding" OFF) +option(ECAL_BUILD_TESTS "Build the eCAL google tests" OFF) option(ECAL_INSTALL_SAMPLE_SOURCES "Install the sources of eCAL samples" ON) -option(ECAL_NPCAP_SUPPORT "Enable the eCAL Npcap Receiver (i.e. the Win10 performance fix)" OFF) +option(ECAL_USE_NPCAP "Enable the eCAL Npcap Receiver (i.e. the Win10 performance fix)" OFF) option(ECAL_USE_CLOCKLOCK_MUTEX "Use native mutex with monotonic clock (requires glibc >= 2.30)" OFF) # -------------------------------------------------------- # ecal core configuration # -------------------------------------------------------- -set(ECAL_CORE_HAS_PROTOBUF ON) -set(ECAL_CORE_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_CORE_BUILD_TESTS ${BUILD_ECAL_TESTS}) +set(ECAL_CORE_USE_PROTOBUF ON) +set(ECAL_CORE_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +set(ECAL_CORE_BUILD_TESTS ${ECAL_BUILD_TESTS}) set(ECAL_CORE_CONFIGURATION ON) set(ECAL_CORE_COMMAND_LINE ON) set(ECAL_CORE_REGISTRATION ON) @@ -116,7 +222,7 @@ set(ECAL_CORE_PUBLISHER set(ECAL_CORE_SUBSCRIBER ON) set(ECAL_CORE_SERVICE ON) set(ECAL_CORE_TIMEPLUGIN ON) -set(ECAL_CORE_NPCAP_SUPPORT ${ECAL_NPCAP_SUPPORT}) +set(ECAL_CORE_NPCAP_SUPPORT ${ECAL_USE_NPCAP}) set(ECAL_CORE_REGISTRATION_SHM ON) set(ECAL_CORE_TRANSPORT_UDP ON) set(ECAL_CORE_TRANSPORT_TCP ON) @@ -125,15 +231,15 @@ set(ECAL_CORE_TRANSPORT_SHM # ----------------------- # eCAL Python configuration # ----------------------- -#set(ECAL_PYTHON_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_PYTHON_BUILD_TESTS ${BUILD_ECAL_TESTS}) -set(ECAL_PYTHON_HAS_HDF5 ${HAS_HDF5}) +#set(ECAL_PYTHON_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +set(ECAL_PYTHON_BUILD_TESTS ${ECAL_BUILD_TESTS}) +set(ECAL_PYTHON_USE_HDF5 ${ECAL_USE_HDF5}) # This should be ON, unless build ecal hdf5 for Matlab usage option(ECAL_LINK_HDF5_SHARED "Link shared libs of HDF5" ON) -option(CPACK_PACK_WITH_INNOSETUP "Create Innosetup installer for the Windows build" ON) +option(ECAL_CPACK_PACK_WITH_INNOSETUP "Create Innosetup installer for the Windows build" ON) set(ECAL_INSTALL_PYTHON_DIR "bin" CACHE PATH "Location to install the Python extension modules. Might be set by setupdtools install.") @@ -177,7 +283,7 @@ message(STATUS "Prefix Path: ${CMAKE_PREFIX_PATH}") # detect qt library # -------------------------------------------------------- if(MSVC) - if (HAS_QT) + if (ECAL_USE_QT) find_package(QT NAMES Qt6 Qt5 COMPONENTS Core QUIET) if (NOT "${QT_FOUND}") include("cmake/qt_msvc_path.cmake") @@ -275,25 +381,25 @@ add_subdirectory(lib/ThreadingUtils) add_subdirectory(lib/CustomTclap) add_subdirectory(lib/ecal_utils) -if(HAS_QT) +if(ECAL_USE_QT) add_subdirectory(lib/CustomQt) endif() add_subdirectory(lib/EcalParser) -if(HAS_QT) +if(ECAL_USE_QT) add_subdirectory(lib/QEcalParser) endif() # -------------------------------------------------------- # ecal mon plugin sdk # -------------------------------------------------------- -if(HAS_QT AND BUILD_APPS) +if(ECAL_USE_QT AND ECAL_BUILD_APPS) add_subdirectory(app/mon/mon_plugin_lib) endif() # -------------------------------------------------------- # ecal rec addon sdk # -------------------------------------------------------- -if(BUILD_APP_REC_ADDON_SDK) +if(ECAL_BUILD_APP_REC_ADDON_SDK) add_subdirectory(app/rec/rec_addon_core) add_subdirectory(app/rec/rec_addon_dummy) endif() @@ -301,7 +407,7 @@ endif() # -------------------------------------------------------- # ecal time # -------------------------------------------------------- -if(BUILD_TIME) +if(ECAL_BUILD_TIMEPLUGINS) if(WIN32) set(ECAL_TIME_PLUGIN_DIR ecaltime_plugins) endif() @@ -311,7 +417,7 @@ endif() # -------------------------------------------------------- # ecal hdf5 support # -------------------------------------------------------- -if(HAS_HDF5) +if(ECAL_USE_HDF5) add_subdirectory(contrib/measurement/hdf5) add_subdirectory(contrib/ecalhdf5) endif() @@ -320,31 +426,31 @@ add_subdirectory(contrib/measurement/base) # -------------------------------------------------------- # ecal core python binding # -------------------------------------------------------- -if(BUILD_PY_BINDING) +if(ECAL_BUILD_PY_BINDING) add_subdirectory(lang/python) endif() # -------------------------------------------------------- # ecal core csharp binding # -------------------------------------------------------- -if(BUILD_CSHARP_BINDING AND WIN32) - set(ECAL_CSHARP_BUILD_SAMPLES ${BUILD_SAMPLES}) - set(ECAL_CSHARP_BUILD_TESTS ${BUILD_ECAL_TESTS}) +if(ECAL_BUILD_CSHARP_BINDING AND WIN32) + set(ECAL_CSHARP_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) + set(ECAL_CSHARP_BUILD_TESTS ${ECAL_BUILD_TESTS}) add_subdirectory(lang/csharp) endif() -if(BUILD_C_BINDING) - set(ECAL_C_BUILD_SAMPLES ${BUILD_SAMPLES}) - set(ECAL_C_BUILD_TESTS ${BUILD_ECAL_TESTS}) +if(ECAL_BUILD_C_BINDING) + set(ECAL_C_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) + set(ECAL_C_BUILD_TESTS ${ECAL_BUILD_TESTS}) add_subdirectory(lang/c) endif() # -------------------------------------------------------- # console applications # -------------------------------------------------------- -if(BUILD_APPS) +if(ECAL_BUILD_APPS) add_subdirectory(app/apps) - if (HAS_FTXUI) + if (ECAL_USE_FTXUI) add_subdirectory(app/mon/mon_tui) endif() add_subdirectory(app/mon/mon_cli) @@ -362,7 +468,7 @@ endif() # -------------------------------------------------------- # applications using hdf5 # -------------------------------------------------------- -if(BUILD_APPS AND HAS_HDF5) +if(ECAL_BUILD_APPS AND ECAL_USE_HDF5) add_subdirectory(app/play/play_core) add_subdirectory(app/play/play_cli) @@ -377,7 +483,7 @@ endif() # -------------------------------------------------------- # qt applications # -------------------------------------------------------- -if(BUILD_APPS AND (HAS_QT)) +if(ECAL_BUILD_APPS AND (ECAL_USE_QT)) add_subdirectory(app/sys/sys_gui) add_subdirectory(app/mon/mon_gui) if(WIN32) @@ -391,7 +497,7 @@ if(BUILD_APPS AND (HAS_QT)) # -------------------------------------------------------- # qt applications using hdf5 # -------------------------------------------------------- - if(HAS_HDF5) + if(ECAL_USE_HDF5) add_subdirectory(app/play/play_gui) add_subdirectory(app/rec/rec_gui) endif() @@ -400,7 +506,7 @@ endif() # -------------------------------------------------------- # samples # -------------------------------------------------------- -if(BUILD_SAMPLES) +if(ECAL_BUILD_SAMPLES) add_subdirectory(samples) endif() @@ -409,34 +515,34 @@ endif() # Serialization extensions # -------------------------------------------------------- # Capnroto -if (HAS_CAPNPROTO) -set(ECAL_CAPNPROTO_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_CAPNPROTO_BUILD_TESTS ${BUILD_ECAL_TESTS}) +if (ECAL_USE_CAPNPROTO) +set(ECAL_CAPNPROTO_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +set(ECAL_CAPNPROTO_BUILD_TESTS ${ECAL_BUILD_TESTS}) add_subdirectory(serialization/capnproto) endif () # Flatbuffers -if (HAS_FLATBUFFERS) -set(ECAL_FLATBUFFERS_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_FLATBUFFERS_BUILD_TESTS ${BUILD_ECAL_TESTS}) +if (ECAL_USE_FLATBUFFERS) +set(ECAL_FLATBUFFERS_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +set(ECAL_FLATBUFFERS_BUILD_TESTS ${ECAL_BUILD_TESTS}) add_subdirectory(serialization/flatbuffers) endif() # Messagepack -#if (HAS_MESSAGEPACK) -#set(ECAL_MESSAGEPACK_BUILD_SAMPLES ${BUILD_SAMPLES}) -#set(ECAL_MESSAGEPACK_BUILD_TESTS ${BUILD_ECAL_TESTS}) +#if (ECAL_USE_MESSAGEPACK) +#set(ECAL_MESSAGEPACK_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +#set(ECAL_MESSAGEPACK_BUILD_TESTS ${ECAL_BUILD_TESTS}) #add_subdirectory(serialization/messagepack) #endif() # Protobuf -set(ECAL_PROTOBUF_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_PROTOBUF_BUILD_TESTS ${BUILD_ECAL_TESTS}) +set(ECAL_PROTOBUF_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +set(ECAL_PROTOBUF_BUILD_TESTS ${ECAL_BUILD_TESTS}) add_subdirectory(serialization/protobuf) # String -set(ECAL_STRING_BUILD_SAMPLES ${BUILD_SAMPLES}) -set(ECAL_STRING_BUILD_TESTS ${BUILD_ECAL_TESTS}) +set(ECAL_STRING_BUILD_SAMPLES ${ECAL_BUILD_SAMPLES}) +set(ECAL_STRING_BUILD_TESTS ${ECAL_BUILD_TESTS}) add_subdirectory(serialization/string) @@ -444,25 +550,25 @@ add_subdirectory(serialization/string) # -------------------------------------------------------- # unit tests # -------------------------------------------------------- -if(BUILD_ECAL_TESTS) +if(ECAL_BUILD_TESTS) enable_testing() # ------------------------------------------------------ # test contrib # ------------------------------------------------------ - if(HAS_HDF5) + if(ECAL_USE_HDF5) add_subdirectory(tests/contrib/ecalhdf5/hdf5_test) endif() # ------------------------------------------------------ # test apps # ------------------------------------------------------ - if (HAS_HDF5 AND HAS_QT) + if (ECAL_USE_HDF5 AND ECAL_USE_QT) add_subdirectory(app/rec/rec_tests/rec_rpc_tests) endif() endif() -if(BUILD_DOCS) +if(ECAL_BUILD_DOCS) add_subdirectory(doc) endif() @@ -523,22 +629,22 @@ include(cpack/cpack_variables.cmake) message(STATUS "Build Options:") message(STATUS "--------------------------------------------------------------------------------") message(STATUS "CMAKE_EXPORT_COMPILE_COMMANDS : ${CMAKE_EXPORT_COMPILE_COMMANDS}") -message(STATUS "HAS_HDF5 : ${HAS_HDF5}") -message(STATUS "HAS_QT : ${HAS_QT}") -message(STATUS "HAS_CURL : ${HAS_CURL}") -message(STATUS "HAS_CAPNPROTO : ${HAS_CAPNPROTO}") -message(STATUS "HAS_FLATBUFFERS : ${HAS_FLATBUFFERS}") -message(STATUS "HAS_FTXUI : ${HAS_FTXUI}") +message(STATUS "ECAL_USE_HDF5 : ${ECAL_USE_HDF5}") +message(STATUS "ECAL_USE_QT : ${ECAL_USE_QT}") +message(STATUS "ECAL_USE_CURL : ${ECAL_USE_CURL}") +message(STATUS "ECAL_USE_CAPNPROTO : ${ECAL_USE_CAPNPROTO}") +message(STATUS "ECAL_USE_FLATBUFFERS : ${ECAL_USE_FLATBUFFERS}") +message(STATUS "ECAL_USE_FTXUI : ${ECAL_USE_FTXUI}") message(STATUS "BUILD_SHARED_LIBS : ${BUILD_SHARED_LIBS}") -message(STATUS "BUILD_DOCS : ${BUILD_DOCS}") -message(STATUS "BUILD_APPS : ${BUILD_APPS}") -message(STATUS "BUILD_SAMPLES : ${BUILD_SAMPLES}") -message(STATUS "BUILD_TIME : ${BUILD_TIME}") -message(STATUS "BUILD_PY_BINDING : ${BUILD_PY_BINDING}") -message(STATUS "BUILD_CSHARP_BINDING : ${BUILD_CSHARP_BINDING}") -message(STATUS "BUILD_ECAL_TESTS : ${BUILD_ECAL_TESTS}") +message(STATUS "ECAL_BUILD_DOCS : ${ECAL_BUILD_DOCS}") +message(STATUS "ECAL_BUILD_APPS : ${ECAL_BUILD_APPS}") +message(STATUS "ECAL_BUILD_SAMPLES : ${ECAL_BUILD_SAMPLES}") +message(STATUS "ECAL_BUILD_TIMEPLUGINS : ${ECAL_BUILD_TIMEPLUGINS}") +message(STATUS "ECAL_BUILD_PY_BINDING : ${ECAL_BUILD_PY_BINDING}") +message(STATUS "ECAL_BUILD_CSHARP_BINDING : ${ECAL_BUILD_CSHARP_BINDING}") +message(STATUS "ECAL_BUILD_TESTS : ${ECAL_BUILD_TESTS}") message(STATUS "ECAL_INSTALL_SAMPLE_SOURCES : ${ECAL_INSTALL_SAMPLE_SOURCES}") -message(STATUS "ECAL_NPCAP_SUPPORT : ${ECAL_NPCAP_SUPPORT}") +message(STATUS "ECAL_USE_NPCAP : ${ECAL_USE_NPCAP}") message(STATUS "ECAL_THIRDPARTY_BUILD_ASIO : ${ECAL_THIRDPARTY_BUILD_ASIO}") message(STATUS "ECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS : ${ECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS}") message(STATUS "ECAL_THIRDPARTY_BUILD_CURL : ${ECAL_THIRDPARTY_BUILD_CURL}") @@ -557,5 +663,5 @@ message(STATUS "ECAL_THIRDPARTY_BUILD_TINYXML2 : ${ECAL_THIRDPAR message(STATUS "ECAL_THIRDPARTY_BUILD_UDPCAP : ${ECAL_THIRDPARTY_BUILD_UDPCAP}") message(STATUS "ECAL_THIRDPARTY_BUILD_YAML-CPP : ${ECAL_THIRDPARTY_BUILD_YAML-CPP}") message(STATUS "ECAL_LINK_HDF5_SHARED : ${ECAL_LINK_HDF5_SHARED}") -message(STATUS "CPACK_PACK_WITH_INNOSETUP : ${CPACK_PACK_WITH_INNOSETUP}") +message(STATUS "ECAL_CPACK_PACK_WITH_INNOSETUP : ${ECAL_CPACK_PACK_WITH_INNOSETUP}") message(STATUS "--------------------------------------------------------------------------------") diff --git a/CMakePresets.json b/CMakePresets.json index 3412e1e8c9..0efa9349f7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -44,12 +44,12 @@ "displayName": "eCAL Core", "description": "eCAL core library only configuration", "cacheVariables": { - "HAS_HDF5": "OFF", - "HAS_QT": "OFF", - "HAS_CURL": "OFF", - "HAS_FTXUI": "OFF", - "BUILD_APPS": "OFF", - "BUILD_SAMPLES": "OFF", + "ECAL_USE_HDF5": "OFF", + "ECAL_USE_QT": "OFF", + "ECAL_USE_CURL": "OFF", + "ECAL_USE_FTXUI": "OFF", + "ECAL_BUILD_APPS": "OFF", + "ECAL_BUILD_SAMPLES": "OFF", "ECAL_CORE_CONFIGURATION": "OFF", "ECAL_INSTALL_SAMPLE_SOURCES": "OFF", "ECAL_THIRDPARTY_BUILD_FINEFTP": "OFF", @@ -67,8 +67,8 @@ "displayName": "Python Extensions", "description": "Minimal build for Python extensions", "cacheVariables": { - "HAS_HDF5": "ON", - "BUILD_PY_BINDING": "ON", + "ECAL_USE_HDF5": "ON", + "ECAL_BUILD_PY_BINDING": "ON", "BUILD_SHARED": "OFF", "ECAL_THIRDPARTY_BUILD_HDF5": "ON" } @@ -79,7 +79,7 @@ "displayName": "Documentation", "description": "Build documentation", "cacheVariables": { - "BUILD_DOCS": "ON" + "ECAL_BUILD_DOCS": "ON" } }, { @@ -88,11 +88,11 @@ "displayName": "CLI Apps", "description": "eCAL CLI applications", "cacheVariables": { - "HAS_HDF5": "ON", - "HAS_CURL": "ON", - "HAS_FTXUI": "ON", - "BUILD_APPS": "ON", - "BUILD_SAMPLES": "ON", + "ECAL_USE_HDF5": "ON", + "ECAL_USE_CURL": "ON", + "ECAL_USE_FTXUI": "ON", + "ECAL_BUILD_APPS": "ON", + "ECAL_BUILD_SAMPLES": "ON", "ECAL_THIRDPARTY_BUILD_FINEFTP": "ON", "ECAL_THIRDPARTY_BUILD_FTXUI": "ON", "ECAL_THIRDPARTY_BUILD_SPDLOG": "ON", @@ -108,7 +108,7 @@ "displayName": "GUI Apps", "description": "eCAL GUI and CLI applications", "cacheVariables": { - "HAS_QT": "ON" + "ECAL_USE_QT": "ON" } } ], diff --git a/app/mon/mon_gui/CMakeLists.txt b/app/mon/mon_gui/CMakeLists.txt index 4a2523ad00..10d744246e 100644 --- a/app/mon/mon_gui/CMakeLists.txt +++ b/app/mon/mon_gui/CMakeLists.txt @@ -32,9 +32,9 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets) find_package(Protobuf REQUIRED) -if(ECAL_NPCAP_SUPPORT) +if(ECAL_USE_NPCAP) find_package(udpcap REQUIRED) -endif(ECAL_NPCAP_SUPPORT) +endif(ECAL_USE_NPCAP) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC OFF) # Reason for being turned off: AutoUIC will prevent VS from detecting changes in .ui files @@ -163,7 +163,7 @@ set(ui_files src/widgets/visualisation_widget/visualisation_dock_widget.ui ) -if(ECAL_NPCAP_SUPPORT) +if(ECAL_USE_NPCAP) set(source_files ${source_files} src/widgets/npcap_status_dialog/npcap_status_dialog.cpp @@ -173,7 +173,7 @@ if(ECAL_NPCAP_SUPPORT) ${ui_files} src/widgets/npcap_status_dialog/npcap_status_dialog.ui ) -endif(ECAL_NPCAP_SUPPORT) +endif(ECAL_USE_NPCAP) # compile qt resource files and ui files if (${QT_VERSION_MAJOR} GREATER_EQUAL 6) @@ -207,12 +207,12 @@ target_link_libraries (${PROJECT_NAME} PRIVATE target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -if(ECAL_NPCAP_SUPPORT) - add_definitions(-DECAL_NPCAP_SUPPORT) +if(ECAL_USE_NPCAP) + add_definitions(-DECAL_USE_NPCAP) target_link_libraries(${PROJECT_NAME} PRIVATE udpcap::udpcap ) -endif(ECAL_NPCAP_SUPPORT) +endif(ECAL_USE_NPCAP) if(WIN32) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE") diff --git a/app/mon/mon_gui/src/ecalmon.cpp b/app/mon/mon_gui/src/ecalmon.cpp index 5b88861e7c..4d96c4ae10 100644 --- a/app/mon/mon_gui/src/ecalmon.cpp +++ b/app/mon/mon_gui/src/ecalmon.cpp @@ -27,9 +27,9 @@ #include "widgets/plugin_settings_dialog/plugin_settings_dialog.h" #include "widgets/visualisation_widget/visualisation_dock_widget.h" -#ifdef ECAL_NPCAP_SUPPORT +#ifdef ECAL_USE_NPCAP #include "widgets/npcap_status_dialog/npcap_status_dialog.h" -#endif //ECAL_NPCAP_SUPPORT +#endif //ECAL_USE_NPCAP #include "ecalmon_globals.h" #include "plugin/plugin_manager.h" @@ -229,7 +229,7 @@ Ecalmon::Ecalmon(QWidget *parent) // Parse Time connect(ui_.action_show_parsed_times, &QAction::toggled, this, &Ecalmon::setParseTimeEnabled); -#ifdef ECAL_NPCAP_SUPPORT +#ifdef ECAL_USE_NPCAP connect(ui_.action_npcap_status, &QAction::triggered, this, [this]() { @@ -238,7 +238,7 @@ Ecalmon::Ecalmon(QWidget *parent) }); #else ui_.action_npcap_status->setVisible(false); -#endif // ECAL_NPCAP_SUPPORT +#endif // ECAL_USE_NPCAP // Reset layout connect(ui_.action_reset_layout, &QAction::triggered, this, &Ecalmon::resetLayout); diff --git a/app/mon/mon_plugins/CMakeLists.txt b/app/mon/mon_plugins/CMakeLists.txt index 3823bd4782..96e3ea9caa 100644 --- a/app/mon/mon_plugins/CMakeLists.txt +++ b/app/mon/mon_plugins/CMakeLists.txt @@ -20,8 +20,8 @@ add_subdirectory(plugin_template) add_subdirectory(monitor_tree_view) add_subdirectory(protobuf_reflection) add_subdirectory(signals_plotting) -if (HAS_CAPNPROTO) +if (ECAL_USE_CAPNPROTO) add_subdirectory(capnproto_reflection) -endif (HAS_CAPNPROTO) +endif (ECAL_USE_CAPNPROTO) add_subdirectory(raw_data_reflection) add_subdirectory(string_reflection) \ No newline at end of file diff --git a/app/rec/rec_client_core/CMakeLists.txt b/app/rec/rec_client_core/CMakeLists.txt index 663fc040df..e6b2aaf07d 100644 --- a/app/rec/rec_client_core/CMakeLists.txt +++ b/app/rec/rec_client_core/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(Threads REQUIRED) find_package(Protobuf REQUIRED) find_package(spdlog REQUIRED) -if (HAS_CURL) +if (ECAL_USE_CURL) find_package(CURL REQUIRED) add_compile_definitions(ECAL_HAS_CURL) endif () @@ -70,7 +70,7 @@ set(source_files src/job/hdf5_writer_thread.h ) -if (HAS_CURL) +if (ECAL_USE_CURL) set(source_files ${source_files} src/job/ftp_upload_thread.cpp @@ -105,7 +105,7 @@ target_link_libraries(${PROJECT_NAME} EcalParser ) -if(HAS_CURL) +if(ECAL_USE_CURL) target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl diff --git a/build_win/win_make_cmake.bat b/build_win/win_make_cmake.bat index 353d3cc02c..91c8179f5c 100644 --- a/build_win/win_make_cmake.bat +++ b/build_win/win_make_cmake.bat @@ -6,20 +6,20 @@ call build_win\win_set_vars.bat set CMAKE_OPTIONS_COMPLETE=-DCMAKE_INSTALL_PREFIX=_install ^ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake ^ --DHAS_HDF5=ON ^ --DHAS_QT=ON ^ --DHAS_CURL=ON ^ --DHAS_CAPNPROTO=OFF ^ --DHAS_FTXUI=ON ^ --DBUILD_DOCS=ON ^ --DBUILD_APPS=ON ^ --DBUILD_SAMPLES=ON ^ --DBUILD_TIME=ON ^ --DBUILD_PY_BINDING=OFF ^ --DBUILD_CSHARP_BINDING=ON ^ --DBUILD_ECAL_TESTS=ON ^ +-DECAL_USE_HDF5=ON ^ +-DECAL_USE_QT=ON ^ +-DECAL_USE_CURL=ON ^ +-DECAL_USE_CAPNPROTO=OFF ^ +-DECAL_USE_FTXUI=ON ^ +-DECAL_BUILD_DOCS=ON ^ +-DECAL_BUILD_APPS=ON ^ +-DECAL_BUILD_SAMPLES=ON ^ +-DECAL_BUILD_TIMEPLUGINS=ON ^ +-DECAL_BUILD_PY_BINDING=OFF ^ +-DECAL_BUILD_CSHARP_BINDING=ON ^ +-DECAL_BUILD_TESTS=ON ^ -DECAL_INSTALL_SAMPLE_SOURCES=ON ^ --DECAL_NPCAP_SUPPORT=ON ^ +-DECAL_USE_NPCAP=ON ^ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^ -DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^ -DECAL_THIRDPARTY_BUILD_TINYXML2=ON ^ @@ -33,24 +33,24 @@ set CMAKE_OPTIONS_COMPLETE=-DCMAKE_INSTALL_PREFIX=_install ^ -DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^ -DBUILD_SHARED_LIBS=OFF ^ -DCMAKE_BUILD_TYPE=Release ^ --DCPACK_PACK_WITH_INNOSETUP=ON +-DECAL_CPACK_PACK_WITH_INNOSETUP=ON set CMAKE_OPTIONS_SDK=-DCMAKE_INSTALL_PREFIX=_install ^ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake ^ --DHAS_HDF5=ON ^ --DHAS_QT=ON ^ --DHAS_CURL=OFF ^ --DHAS_CAPNPROTO=OFF ^ --DHAS_FTXUI=ON ^ --DBUILD_DOCS=OFF ^ --DBUILD_APPS=OFF ^ --DBUILD_SAMPLES=OFF ^ --DBUILD_TIME=ON ^ --DBUILD_PY_BINDING=OFF ^ --DBUILD_CSHARP_BINDING=OFF ^ --DBUILD_ECAL_TESTS=OFF ^ +-DECAL_USE_HDF5=ON ^ +-DECAL_USE_QT=ON ^ +-DECAL_USE_CURL=OFF ^ +-DECAL_USE_CAPNPROTO=OFF ^ +-DECAL_USE_FTXUI=ON ^ +-DECAL_BUILD_DOCS=OFF ^ +-DECAL_BUILD_APPS=OFF ^ +-DECAL_BUILD_SAMPLES=OFF ^ +-DECAL_BUILD_TIMEPLUGINS=ON ^ +-DECAL_BUILD_PY_BINDING=OFF ^ +-DECAL_BUILD_CSHARP_BINDING=OFF ^ +-DECAL_BUILD_TESTS=OFF ^ -DECAL_INSTALL_SAMPLE_SOURCES=OFF ^ --DECAL_NPCAP_SUPPORT=ON ^ +-DECAL_USE_NPCAP=ON ^ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^ -DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^ -DECAL_THIRDPARTY_BUILD_TINYXML2=ON ^ @@ -64,7 +64,7 @@ set CMAKE_OPTIONS_SDK=-DCMAKE_INSTALL_PREFIX=_install ^ -DECAL_THIRDPARTY_BUILD_UDPCAP=ON ^ -DBUILD_SHARED_LIBS=OFF ^ -DCMAKE_BUILD_TYPE=Debug ^ --DCPACK_PACK_WITH_INNOSETUP=OFF +-DECAL_CPACK_PACK_WITH_INNOSETUP=OFF if not exist "%BUILD_DIR_COMPLETE%" mkdir "%BUILD_DIR_COMPLETE%" if not exist "%BUILD_DIR_SDK%" mkdir "%BUILD_DIR_SDK%" diff --git a/colcon.pkg b/colcon.pkg index f37e425e7d..76e6e166fe 100644 --- a/colcon.pkg +++ b/colcon.pkg @@ -1,8 +1,8 @@ { "cmake-args": [ - "-DHAS_HDF5=OFF", - "-DHAS_QT5=OFF", - "-DBUILD_SAMPLES=OFF", + "-DECAL_USE_HDF5=OFF", + "-DECAL_USE_QT=OFF", + "-DECAL_BUILD_SAMPLES=OFF", "-DECAL_INSTALL_SAMPLE_SOURCES=OFF" ] } diff --git a/conanfile.py b/conanfile.py index 7056bb0454..ec9754cca8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -45,7 +45,7 @@ def generate(self): tc.variables["ECAL_THIRDPARTY_BUILD_PROTOBUF"] = "OFF" tc.variables["ECAL_THIRDPARTY_BUILD_HDF5"] = "OFF" tc.variables["ECAL_THIRDPARTY_BUILD_TINYXML2"] = "OFF" - tc.variables["BUILD_DOCS"] = "ON" + tc.variables["ECAL_BUILD_DOCS"] = "ON" tc.variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = "ON" if self.settings.os == "Windows": tc.variables["Protobuf_PROTOC_EXECUTABLE"] = os.path.join(self.deps_cpp_info["protobuf"].rootpath, "bin", "protoc.exe").replace('\\', '/') diff --git a/contrib/mma/README.md b/contrib/mma/README.md index 30063efb17..7dd4e9a41a 100644 --- a/contrib/mma/README.md +++ b/contrib/mma/README.md @@ -46,7 +46,7 @@ and even on embedded Linux distributions. ### Installation - In order to install the MachineMonitoringAgent along with eCAL, the cmake "-DBUILD_APPS=ON" flag needs to be set ON. + In order to install the MachineMonitoringAgent along with eCAL, the cmake "-DECAL_BUILD_APPS=ON" flag needs to be set ON. MachineMonitoringAgent stand-alone installation: diff --git a/cpack/cpack_variables.cmake b/cpack/cpack_variables.cmake index 3fbbccccf3..b36d4d4cb9 100644 --- a/cpack/cpack_variables.cmake +++ b/cpack/cpack_variables.cmake @@ -33,7 +33,7 @@ SET(CPACK_OUTPUT_FILE_PREFIX _deploy) if(WIN32) set(CPACK_GENERATOR "External") set(CPACK_EXTERNAL_ENABLE_STAGING ON) - if(CPACK_PACK_WITH_INNOSETUP) + if(ECAL_CPACK_PACK_WITH_INNOSETUP) set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${ECAL_PROJECT_ROOT}/cpack/innosetup.cmake") endif() endif() diff --git a/doc/rst/development/building_ecal_from_source.rst b/doc/rst/development/building_ecal_from_source.rst index 5199c5c23a..a0a8df7363 100644 --- a/doc/rst/development/building_ecal_from_source.rst +++ b/doc/rst/development/building_ecal_from_source.rst @@ -145,7 +145,7 @@ We support building on currently supported Ubuntu LTS releases. |fa-ubuntu| Ubuntu 22.04 / 20.04 build -------------------------------------- -#. Compile eCAL with the following options (additional set `BUILD_PY_BINDING` to `ON` if plan to build the python extension): +#. Compile eCAL with the following options (additional set `ECAL_BUILD_PY_BINDING` to `ON` if plan to build the python extension): .. code-block:: bash @@ -162,7 +162,7 @@ We support building on currently supported Ubuntu LTS releases. sudo dpkg -i _deploy/eCAL-* sudo ldconfig -#. Optional: Create and install the eCAL python wheel (Only available if you enabled the `BUILD_PY_BINDING` CMake option in step 1): +#. Optional: Create and install the eCAL python wheel (Only available if you enabled the `ECAL_BUILD_PY_BINDING` CMake option in step 1): .. code-block:: bash diff --git a/doc/rst/development/ecal_cmake_options.rst b/doc/rst/development/ecal_cmake_options.rst index cadb5fa213..d749fa63df 100644 --- a/doc/rst/development/ecal_cmake_options.rst +++ b/doc/rst/development/ecal_cmake_options.rst @@ -10,9 +10,9 @@ eCAL is using CMake as build system. The build makes use of CMake options to configure what features to build and to see what capabilities are available. The options are grouped by their prefix: -- ``HAS_`` variables indicate if a certain feature is supported for the build. E.g setting ``HAS_QT5`` to off, will disable all components of eCAL that have a GUI attached. -- ``BUILD_`` variables turn on / off certain eCAL components. Those components can be language bindings, application (like monitor / player / recorder), documentation or tests -- ``ECAL_THIRDPARTY_`` variables control on a dependency by dependency basis, if that dependency is to be compiled alongside eCAL. +- ``ECAL_USE_`` variables indicate if eCAL shall use a certain dependency. E.g setting ``ECAL_USE_QT`` to off, will disable all components of eCAL that have a (Qt) GUI attached. +- ``ECAL_BUILD_`` variables turn on / off certain eCAL components. Those components can be language bindings, application (like monitor / player / recorder), documentation or tests +- ``ECAL_THIRDPARTY_BUILD`` variables control on a dependency by dependency basis, if that dependency is to be compiled alongside eCAL. There are a few addional options which do not fit in these categories, but they are also documentd below. @@ -21,37 +21,37 @@ All options can be passed on the command line cmake ``-D