diff --git a/.devcontainer/Dockerfile.ubuntu b/.devcontainer/Dockerfile.ubuntu index 10163090a..056ab44a4 100644 --- a/.devcontainer/Dockerfile.ubuntu +++ b/.devcontainer/Dockerfile.ubuntu @@ -33,7 +33,7 @@ RUN set -ex \ RUN set -ex && apt-get update && apt-get install -y python2-dev || apt-get install -y python-dev # Install additional python versions -ARG PYTHON3_VERSIONS="3.5.10 3.6.15" +ARG PYTHON3_VERSIONS="3.9.21 3.10.16" RUN set -ex \ && for PYTHON3_VERSION in ${PYTHON3_VERSIONS}; do \ curl -fsSLo /tmp/Python-${PYTHON3_VERSION}.tgz https://www.python.org/ftp/python/${PYTHON3_VERSION}/Python-${PYTHON3_VERSION}.tgz; \ diff --git a/.devcontainer/Dockerfile.windows b/.devcontainer/Dockerfile.windows index 9e8940c82..e146a6fec 100644 --- a/.devcontainer/Dockerfile.windows +++ b/.devcontainer/Dockerfile.windows @@ -5,28 +5,28 @@ ARG WINDOWS_VERSION FROM ${WINDOWS_IMAGE}:${WINDOWS_VERSION} # Temporary directory -ENV DOCKER_TEMP_DIR "C:\DockerTemp" +ENV DOCKER_TEMP_DIR "C:/DockerTemp" # All dependencies will be installed in this directory -ENV LIB_PATH "C:\lib" +ENV LIB_PATH "C:/lib" # Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] # Install any additional certificates -COPY .devcontainer\extra_cas C:\DockerTemp\Certs -RUN for %f in (%DOCKER_TEMP_DIR%\Certs\*.crt %DOCKER_TEMP_DIR%\Certs\*.pem) do ( ` - powershell -Command "Import-Certificate -FilePath %f -CertStoreLocation Cert:\LocalMachine\Root" ` +COPY .devcontainer/extra_cas C:/DockerTemp/Certs +RUN for %f in (%DOCKER_TEMP_DIR%/Certs/*.crt %DOCKER_TEMP_DIR%/Certs/*.pem) do ( ` + powershell -Command "Import-Certificate -FilePath %f -CertStoreLocation Cert:/LocalMachine/Root" ` ) # Install Microsoft Buildtools RUN ` # Download the Build Tools bootstrapper. - curl -SL --output %DOCKER_TEMP_DIR%\vs_buildtools.exe https://aka.ms/vs/15/release/vs_buildtools.exe ` + curl -SL --output %DOCKER_TEMP_DIR%/vs_buildtools.exe https://aka.ms/vs/15/release/vs_buildtools.exe ` ` # Install Build Tools && echo Starting install ` - && (start /w %DOCKER_TEMP_DIR%\vs_buildtools.exe --quiet --wait --norestart --nocache ` + && (start /w %DOCKER_TEMP_DIR%/vs_buildtools.exe --quiet --wait --norestart --nocache ` --add Microsoft.Net.Component.4.8.SDK ` --add Microsoft.Net.Component.4.8.TargetingPack ` --add Microsoft.Net.Component.4.TargetingPack ` @@ -37,11 +37,11 @@ RUN ` --add Microsoft.VisualStudio.Component.VC.140 ` --add Microsoft.VisualStudio.Component.Windows10SDK.19041 ` --add Microsoft.Component.VC.Runtime.UCRTSDK ` - --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" ` + --installPath "%ProgramFiles(x86)%/Microsoft Visual Studio/2017/BuildTools" ` || IF "%ERRORLEVEL%"=="3010" EXIT 0) ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\vs_buildtools.exe + && del /q %DOCKER_TEMP_DIR%/vs_buildtools.exe # Install Boost ARG BOOST_VERSION=1.68.0 @@ -49,93 +49,93 @@ ARG BOOST_VERSION_UNDERSCORE=1_68_0 ARG BOOST_MSVC_VERSION=14.0 RUN echo Installing Boost ` # Download the boost installer - && curl -SL --output %DOCKER_TEMP_DIR%\boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/binaries/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe ` - && curl -SL --output %DOCKER_TEMP_DIR%\boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/binaries/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe ` + && curl -SL --output %DOCKER_TEMP_DIR%/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/binaries/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe ` + && curl -SL --output %DOCKER_TEMP_DIR%/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe https://boostorg.jfrog.io/artifactory/main/release/%BOOST_VERSION%/binaries/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe ` ` - # Install - && (start /w %DOCKER_TEMP_DIR%\boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe /VERYSILENT /DIR=%LIB_PATH%\boost) ` - && (start /w %DOCKER_TEMP_DIR%\boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe /VERYSILENT /DIR=%LIB_PATH%\boost) ` + # Install + && (start /w %DOCKER_TEMP_DIR%/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe /VERYSILENT /DIR=%LIB_PATH%/boost) ` + && (start /w %DOCKER_TEMP_DIR%/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe /VERYSILENT /DIR=%LIB_PATH%/boost) ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe ` - && del /q %DOCKER_TEMP_DIR%\boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe + && del /q %DOCKER_TEMP_DIR%/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-32.exe ` + && del /q %DOCKER_TEMP_DIR%/boost_%BOOST_VERSION_UNDERSCORE%-msvc-%BOOST_MSVC_VERSION%-64.exe # Install CMake ARG CMAKE_VERSION=3.23.1 RUN ` # Download the cmake installer - curl -SL --output %DOCKER_TEMP_DIR%\cmake-%CMAKE_VERSION%-windows-x86_64.msi https://github.com/Kitware/CMake/releases/download/v%CMAKE_VERSION%/cmake-%CMAKE_VERSION%-windows-x86_64.msi ` + curl -SL --output %DOCKER_TEMP_DIR%/cmake-%CMAKE_VERSION%-windows-x86_64.msi https://github.com/Kitware/CMake/releases/download/v%CMAKE_VERSION%/cmake-%CMAKE_VERSION%-windows-x86_64.msi ` ` # Install cmake - && msiexec /i %DOCKER_TEMP_DIR%\cmake-%CMAKE_VERSION%-windows-x86_64.msi /quiet /qn /norestart ` + && msiexec /i %DOCKER_TEMP_DIR%/cmake-%CMAKE_VERSION%-windows-x86_64.msi /quiet /qn /norestart ` ` # Add Cmake to the path - && setx PATH "%PATH;C:\Program Files\CMake\bin" ` + && setx PATH "%PATH;C:/Program Files/CMake/bin" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\cmake-%CMAKE_VERSION%-windows-x86_64.msi + && del /q %DOCKER_TEMP_DIR%/cmake-%CMAKE_VERSION%-windows-x86_64.msi # Install 7zip ARG 7ZIP_VERSION=2107 RUN echo Installing 7zip ` # Download the installer - && curl -SL --output %DOCKER_TEMP_DIR%\7z%7ZIP_VERSION%-x64.msi https://www.7-zip.org/a/7z%7ZIP_VERSION%-x64.msi ` + && curl -SL --output %DOCKER_TEMP_DIR%/7z%7ZIP_VERSION%-x64.msi https://www.7-zip.org/a/7z%7ZIP_VERSION%-x64.msi ` ` # Run the installer - && msiexec /i %DOCKER_TEMP_DIR%\7z%7ZIP_VERSION%-x64.msi /quiet /qn /norestart ` + && msiexec /i %DOCKER_TEMP_DIR%/7z%7ZIP_VERSION%-x64.msi /quiet /qn /norestart ` ` # Add 7zip the the path - && setx PATH "%PATH%;C:\Program Files\7-Zip" ` + && setx PATH "%PATH%;C:/Program Files/7-Zip" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\7z%7ZIP_VERSION%-x64.msi + && del /q %DOCKER_TEMP_DIR%/7z%7ZIP_VERSION%-x64.msi # Install OpenSSL ARG OPENSSL_VERSION=1.1.0f ARG OPENSSL_MSVC_VERSION=2015 RUN echo Installing OpenSSL ` # Download the zip file - && curl -SL --output %DOCKER_TEMP_DIR%\openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z https://www.npcglib.org/~stathis/downloads/openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z ` + && curl -SL --output %DOCKER_TEMP_DIR%/openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z https://www.npcglib.org/~stathis/downloads/openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z ` ` # Extract the artifacts - && 7z x %DOCKER_TEMP_DIR%\openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z "-o%LIB_PATH%" ` - && move %LIB_PATH%\openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION% %LIB_PATH%\openssl ` + && 7z x %DOCKER_TEMP_DIR%/openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z "-o%LIB_PATH%" ` + && move %LIB_PATH%/openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION% %LIB_PATH%/openssl ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z + && del /q %DOCKER_TEMP_DIR%/openssl-%OPENSSL_VERSION%-vs%OPENSSL_MSVC_VERSION%.7z # Install Git ARG GIT_VERSION=2.36.0 RUN echo Installing Git ` # Download the installer - && curl -SL --output %DOCKER_TEMP_DIR%\Git-%GIT_VERSION%-64-bit.exe https://github.com/git-for-windows/git/releases/download/v%GIT_VERSION%.windows.1/Git-%GIT_VERSION%-64-bit.exe ` + && curl -SL --output %DOCKER_TEMP_DIR%/Git-%GIT_VERSION%-64-bit.exe https://github.com/git-for-windows/git/releases/download/v%GIT_VERSION%.windows.1/Git-%GIT_VERSION%-64-bit.exe ` ` # Install - && (start /w %DOCKER_TEMP_DIR%\Git-%GIT_VERSION%-64-bit.exe /VERYSILENT /DIR="C:\Program Files\Git") ` + && (start /w %DOCKER_TEMP_DIR%/Git-%GIT_VERSION%-64-bit.exe /VERYSILENT /DIR="C:/Program Files/Git") ` ` # Add Windows to the path - && setx PATH "%PATH%;C:\Program Files\Git\bin" ` + && setx PATH "%PATH%;C:/Program Files/Git/bin" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\Git-%GIT_VERSION%-64-bit.exe + && del /q %DOCKER_TEMP_DIR%/Git-%GIT_VERSION%-64-bit.exe # Install Python3 -ARG PYTHON3_VERSIONS="3.5.0" +ARG PYTHON3_VERSIONS="3.9.0" RUN echo Installing Python3 ` && for %v in (%PYTHON3_VERSIONS%) do ( ` echo Installing Python%v ` ` # Download the installer - && curl -SL --output %DOCKER_TEMP_DIR%\python-%v.exe https://www.python.org/ftp/python/%v/python-%v.exe ` - && curl -SL --output %DOCKER_TEMP_DIR%\python-%v-amd64.exe https://www.python.org/ftp/python/%v/python-%v-amd64.exe ` + && curl -SL --output %DOCKER_TEMP_DIR%/python-%v.exe https://www.python.org/ftp/python/%v/python-%v.exe ` + && curl -SL --output %DOCKER_TEMP_DIR%/python-%v-amd64.exe https://www.python.org/ftp/python/%v/python-%v-amd64.exe ` ` # Install - && (start /w %DOCKER_TEMP_DIR%\python-%v.exe /quiet TargetDir="C:\Python%v-Win32") ` - && (start /w %DOCKER_TEMP_DIR%\python-%v-amd64.exe /quiet TargetDir="C:\Python%v-x64") ` + && (start /w %DOCKER_TEMP_DIR%/python-%v.exe /quiet TargetDir="C:/Python%v-Win32") ` + && (start /w %DOCKER_TEMP_DIR%/python-%v-amd64.exe /quiet TargetDir="C:/Python%v-x64") ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\python-%v.exe ` - && del /q %DOCKER_TEMP_DIR%\python-%v-amd64.exe ` + && del /q %DOCKER_TEMP_DIR%/python-%v.exe ` + && del /q %DOCKER_TEMP_DIR%/python-%v-amd64.exe ` ) # Install Python2 @@ -143,67 +143,67 @@ ARG PYTHON2_VERSION="2.7.18" RUN echo Install Python2 ` ` # Download the installer - && curl -SL --output %DOCKER_TEMP_DIR%\python-%PYTHON2_VERSION%.msi https://www.python.org/ftp/python/%PYTHON2_VERSION%/python-%PYTHON2_VERSION%.msi ` - && curl -SL --output %DOCKER_TEMP_DIR%\python-%PYTHON2_VERSION%.amd64.msi https://www.python.org/ftp/python/%PYTHON2_VERSION%/python-%PYTHON2_VERSION%.amd64.msi ` + && curl -SL --output %DOCKER_TEMP_DIR%/python-%PYTHON2_VERSION%.msi https://www.python.org/ftp/python/%PYTHON2_VERSION%/python-%PYTHON2_VERSION%.msi ` + && curl -SL --output %DOCKER_TEMP_DIR%/python-%PYTHON2_VERSION%.amd64.msi https://www.python.org/ftp/python/%PYTHON2_VERSION%/python-%PYTHON2_VERSION%.amd64.msi ` ` # Install - && msiexec /i %DOCKER_TEMP_DIR%\python-%PYTHON2_VERSION%.msi /quiet /qn /norestart TargetDir="C:\Python2.7-Win32" ` - && msiexec /i %DOCKER_TEMP_DIR%\python-%PYTHON2_VERSION%.amd64.msi /quiet /qn /norestart TargetDir="C:\Python2.7-x64" ` + && msiexec /i %DOCKER_TEMP_DIR%/python-%PYTHON2_VERSION%.msi /quiet /qn /norestart TargetDir="C:/Python2.7-Win32" ` + && msiexec /i %DOCKER_TEMP_DIR%/python-%PYTHON2_VERSION%.amd64.msi /quiet /qn /norestart TargetDir="C:/Python2.7-x64" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\python-%PYTHON2_VERSION%.msi ` - && del /q %DOCKER_TEMP_DIR%\python-%PYTHON2_VERSION%.amd64.msi + && del /q %DOCKER_TEMP_DIR%/python-%PYTHON2_VERSION%.msi ` + && del /q %DOCKER_TEMP_DIR%/python-%PYTHON2_VERSION%.amd64.msi # Install swig ARG SWIG_VERSION="4.0.2" RUN echo Installing SWIG ` ` # Download the zip file - && curl -SL --output %DOCKER_TEMP_DIR%\swigwin-%SWIG_VERSION%.zip https://sourceforge.net/projects/swig/files/swigwin/swigwin-%SWIG_VERSION%/swigwin-%SWIG_VERSION%.zip/download ` + && curl -SL --output %DOCKER_TEMP_DIR%/swigwin-%SWIG_VERSION%.zip https://sourceforge.net/projects/swig/files/swigwin/swigwin-%SWIG_VERSION%/swigwin-%SWIG_VERSION%.zip/download ` ` # Extract to the library path - && 7z x %DOCKER_TEMP_DIR%\swigwin-%SWIG_VERSION%.zip "-o%LIB_PATH%" ` - && move %LIB_PATH%\swigwin-%SWIG_VERSION% %LIB_PATH%\swig ` + && 7z x %DOCKER_TEMP_DIR%/swigwin-%SWIG_VERSION%.zip "-o%LIB_PATH%" ` + && move %LIB_PATH%/swigwin-%SWIG_VERSION% %LIB_PATH%/swig ` ` # Add to the path - && setx PATH "%PATH%;%LIB_PATH%\swig" ` + && setx PATH "%PATH%;%LIB_PATH%/swig" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\swigwin-%SWIG_VERSION%.zip + && del /q %DOCKER_TEMP_DIR%/swigwin-%SWIG_VERSION%.zip # Install NaturalDocs ARG NATURAL_DOCS_VERSION="2.0.2" RUN echo Installing NaturalDocs ` ` # Download the zip file - && curl -SL --output %DOCKER_TEMP_DIR%\Natural_Docs_%NATURAL_DOCS_VERSION%.zip https://www.naturaldocs.org/download/natural_docs/%NATURAL_DOCS_VERSION%/Natural_Docs_%NATURAL_DOCS_VERSION%.zip ` + && curl -SL --output %DOCKER_TEMP_DIR%/Natural_Docs_%NATURAL_DOCS_VERSION%.zip https://www.naturaldocs.org/download/natural_docs/%NATURAL_DOCS_VERSION%/Natural_Docs_%NATURAL_DOCS_VERSION%.zip ` ` # Extract to the library path - && 7z x %DOCKER_TEMP_DIR%\Natural_Docs_%NATURAL_DOCS_VERSION%.zip "-o%LIB_PATH%" ` - && move "%LIB_PATH%\Natural Docs" %LIB_PATH%\NaturalDocs ` + && 7z x %DOCKER_TEMP_DIR%/Natural_Docs_%NATURAL_DOCS_VERSION%.zip "-o%LIB_PATH%" ` + && move "%LIB_PATH%/Natural Docs" %LIB_PATH%/NaturalDocs ` ` # Add to the path - && setx PATH "%PATH%;%LIB_PATH%\NaturalDocs" ` + && setx PATH "%PATH%;%LIB_PATH%/NaturalDocs" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\Natural_Docs_%NATURAL_DOCS_VERSION%.zip + && del /q %DOCKER_TEMP_DIR%/Natural_Docs_%NATURAL_DOCS_VERSION%.zip # Install Turtle ARG TURTLE_VERSION="1.3.2" RUN echo Installing Turtle ` ` # Download the zip file - && curl -SL --output %DOCKER_TEMP_DIR%\turtle-%TURTLE_VERSION%.zip https://sourceforge.net/projects/turtle/files/turtle/%TURTLE_VERSION%/turtle-%TURTLE_VERSION%.zip/download ` + && curl -SL --output %DOCKER_TEMP_DIR%/turtle-%TURTLE_VERSION%.zip https://sourceforge.net/projects/turtle/files/turtle/%TURTLE_VERSION%/turtle-%TURTLE_VERSION%.zip/download ` ` # Extract to the library path - && mkdir "%LIB_PATH%\turtle" ` - && 7z x %DOCKER_TEMP_DIR%\turtle-%TURTLE_VERSION%.zip "-o%LIB_PATH%\turtle" ` + && mkdir "%LIB_PATH%/turtle" ` + && 7z x %DOCKER_TEMP_DIR%/turtle-%TURTLE_VERSION%.zip "-o%LIB_PATH%/turtle" ` ` # Cleanup - && del /q %DOCKER_TEMP_DIR%\turtle-%TURTLE_VERSION%.zip + && del /q %DOCKER_TEMP_DIR%/turtle-%TURTLE_VERSION%.zip # Allow users to execute powershell scripts RUN powershell -Command "Set-ExecutionPolicy RemoteSigned" # Set the entrypoint to powershell -ENTRYPOINT ["powershell"] \ No newline at end of file +ENTRYPOINT ["powershell"] diff --git a/.devcontainer/docker_build_debs.sh b/.devcontainer/docker_build_debs.sh index 5f58fa2f9..295b7912e 100755 --- a/.devcontainer/docker_build_debs.sh +++ b/.devcontainer/docker_build_debs.sh @@ -9,7 +9,7 @@ set -e # Get some arguments from the user arch="amd64" ubuntu_version="20.04" -python3_versions="3.7.16 3.8.16 3.9.16 3.10.9 3.11.1" +python3_versions="3.9.21 3.10.16 3.11.11 3.12.8 3.13.1" while [[ $# -gt 0 ]]; do case $1 in --arch) @@ -78,6 +78,7 @@ docker run \ git fetch origin --tags; \ ./BuildScripts/build_linux.sh \ ${python3_dirs_flag} \ + --branch ${BRANCH_NAME} \ --python2Dir /usr/lib/python2.7 \ --buildDir /home/microstrain/MSCL/${build_dir_name} \ - " \ No newline at end of file + " diff --git a/.devcontainer/docker_build_win.ps1 b/.devcontainer/docker_build_win.ps1 index dfaa979eb..9038cdcd7 100644 --- a/.devcontainer/docker_build_win.ps1 +++ b/.devcontainer/docker_build_win.ps1 @@ -6,7 +6,7 @@ param ( [String]$windows_image, [String]$windows_version, - [String]$python3_versions = "3.7.0 3.8.0 3.9.0 3.10.0 3.11.0", + [String]$python3_versions = "3.9.0 3.10.0 3.11.0 3.12.0 3.13.0", [String]$arch = "x64" ) @@ -35,7 +35,7 @@ try { $project_dir = "${script_dir}/.." $dockerfile = "${script_dir}/Dockerfile.windows" $image_name = "microstrain/mscl_windows_builder:${windows_version}" - + if ("${arch}" -eq "x86") { $cmake_arch = "Win32" } else { @@ -43,10 +43,10 @@ try { } # Construct the flags that we will pass to the build script - $python2_build_script_flags = "-python2Dirs C:\Python2.7-${cmake_arch}" + $python2_build_script_flags = "-python2Dirs C:/Python2.7-${cmake_arch}" $python3_build_script_flags = "-python3Dirs " foreach ($python3_version in ${python3_versions}.split(" ")) { - $python3_build_script_flags += "C:\Python${python3_version}-${cmake_arch}," + $python3_build_script_flags += "C:/Python${python3_version}-${cmake_arch}," } $python3_build_script_flags = $python3_build_script_flags.TrimEnd(',') @@ -75,13 +75,12 @@ try { --cpus="${num_cpus}" ` --memory="${memory}g" ` --isolation="process" ` - -v "${project_dir}:C:\Projects\MSCL" ` - -w "C:\projects\mscl" ` + -v "${project_dir}:C:/Projects/MSCL" ` + -w "C:/projects/mscl" ` "${image_name}" -Command " ` git config --global --add safe.directory C:/projects/mscl; ` git fetch origin --tags; ` - & 'C:\Projects\MSCL\BuildScripts\build_win.ps1' -arch ${cmake_arch} -buildDir C:\projects\mscl\docker_build\${cmake_arch} ${python2_build_script_flags} ${python3_build_script_flags}; ` - & 'C:\Projects\MSCL\BuildScripts\zip_win.ps1' -arch ${arch}; ` + & 'C:/Projects/MSCL/BuildScripts/build_win.ps1' -branch ${env:BRANCH_NAME} -arch ${cmake_arch} -buildDir C:/projects/mscl/build_windows_${arch} ${python2_build_script_flags} ${python3_build_script_flags}; ` " } catch { diff --git a/.gitignore b/.gitignore index 1bd979d40..f48177691 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,12 @@ sample_mscl_cpp/ /mscl_ubuntu_*.tar.bz2 /mscl_centos_*.tar.bz2 /[Oo]utput +.*git-askpass + +## Ignore any CMake generated project files +LibVersion.h +AssemblyInfo.cs + ## Ignore JetBrains files *.idea diff --git a/BuildScripts/buildReadme_Linux.md b/BuildScripts/buildReadme_Linux.md index c2a63099f..b9e80c23d 100644 --- a/BuildScripts/buildReadme_Linux.md +++ b/BuildScripts/buildReadme_Linux.md @@ -72,32 +72,33 @@ These options can be set in the configuration step documented above by prependin build python3, I would run the command: ```bash -cmake .. -DBUILD_PYTHON3=ON +cmake .. -DMSCL_BUILD_PYTHON3=ON ``` ##### Boolean Parameters The following table lists some parameters that can be set to `ON` or `OFF` to enable, or disable certain pieces of the build -| Parameter | Description | Default | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------- | -| BUILD_SHARED_LIBS | Build MSCL as a shared library as well as a static library | OFF | -| BUILD_PYTHON2 | Build the Python2 bindings for MSCL. Note that this requires swig and python2 to be installed | OFF | -| BUILD_PYTHON3 | Build the Python3 bindings for MSCL. Note that this requires swig and python3 to be installed | OFF | -| BUILD_TESTS | Build the unit tests for MSCL. This also enables the `test` CMake target. Note that this also requires that turtle be installed | OFF | -| BUILD_EXAMPLES | Build the examples in [`MSCL_Examples`](../MSCL_Examples/) | OFF | -| BUILD_PACKAGE | Build the resulting artifacts into `.deb`, or `.rpm` files | OFF | -| WITH_SSL | Whether to build with SSL support. Note that this requires openssl to be installed | ON | -| WITH_WEBSOCKETS | Whether to build with Websocket support | ON | -| LINK_STATIC_DEPS | Whether to link boost and OpenSSL statically. Note that this requires both libraries to have been compiled with `-fPIC` | OFF | +| Parameter | Description | Default | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------------| ------- | +| BUILD_SHARED_LIBS | Build MSCL as a shared library as well as a static library | OFF | +| MSCL_BUILD_PYTHON2 | Build the Python2 bindings for MSCL. Note that this requires swig and python2 to be installed | OFF | +| MSCL_BUILD_PYTHON3 | Build the Python3 bindings for MSCL. Note that this requires swig and python3 to be installed | OFF | +| MSCL_BUILD_TESTS | Build the unit tests for MSCL. This also enables the `test` CMake target. Note that this also requires that turtle be installed | OFF | +| MSCL_BUILD_EXAMPLES | Build the examples in [`MSCL_Examples`](../MSCL_Examples/) | OFF | +| MSCL_ZIP_EXAMPLES | Zip the examples in [`MSCL_Examples`](../MSCL_Examples/) | OFF | +| MSCL_BUILD_PACKAGE | Build the resulting artifacts into `.deb`, or `.rpm` files | OFF | +| MSCL_WITH_SSL | Whether to build with SSL support. Note that this requires openssl to be installed | ON | +| MSCL_WITH_WEBSOCKETS | Whether to build with Websocket support | ON | +| MSCL_LINK_STATIC_DEPS | Whether to link boost and OpenSSL statically. Note that this requires both libraries to have been compiled with `-fPIC` | OFF | ##### String Parameters | Parameter | Description | Default | | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | | TURTLE_INCLUDE_DIR | Directory where the turtle include files are installed. Only required if include files are in a nonstandard place. | `C:/lib/turtle/include` | -| DPKG_ROOT | Directory to search for the `dpkg` executable. Only required if `BUILD_PACKAGE` is true, and `dpkg` is installed somewhere nonstandard | `""` | -| RPMBUILD_ROOT | Directory to search for the `rpmbuild` executable. Only required if `BUILD_PACKAGE` is true, and `rpmbuild` is installed somewhere nonstandard | `""` | +| DPKG_ROOT | Directory to search for the `dpkg` executable. Only required if `MSCL_BUILD_PACKAGE` is true, and `dpkg` is installed somewhere nonstandard | `""` | +| RPMBUILD_ROOT | Directory to search for the `rpmbuild` executable. Only required if `MSCL_BUILD_PACKAGE` is true, and `rpmbuild` is installed somewhere nonstandard | `""` | ##### Other parameters diff --git a/BuildScripts/buildReadme_Windows.md b/BuildScripts/buildReadme_Windows.md index 809751b1b..002919a99 100644 --- a/BuildScripts/buildReadme_Windows.md +++ b/BuildScripts/buildReadme_Windows.md @@ -29,7 +29,7 @@ For more information on how to configure the build to use, or not use the option - \>= [OpenSSL 1.1.0](https://www.npcglib.org/~stathis/blog/precompiled-openssl/) - \>= [SWIG 4.0.0](https://swig.org/download.html) (for Python2, Python3, or .NET builds) - \>= [Python 2.7](https://www.python.org/downloads/) -- \>= [Python 3.6](https://www.python.org/downloads/) +- \>= [Python 3.9](https://www.python.org/downloads/) - \>= [NaturalDocs 2.0](https://www.naturaldocs.org/) Since Windows has no standard path for libraries to be installed in, @@ -81,31 +81,32 @@ These options can be set in the configuration step documented above by prependin For example, to build python3, I would run the command: ```powershell -cmake .. -DBUILD_PYTHON3=ON +cmake .. -DMSCL_BUILD_PYTHON3=ON ``` ##### Boolean Parameters The following table lists some parameters that can be set to `ON` or `OFF` to enable, or disable certain pieces of the build -| Parameter | Description | Default | -| ------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------- | -| BUILD_SHARED_LIBS | Build MSCL as a shared library as well as a static library | OFF | -| BUILD_PYTHON2 | Build the Python2 bindings for MSCL. Note that this requires swig and python2 to be installed | OFF | -| BUILD_PYTHON3 | Build the Python3 bindings for MSCL. Note that this requires swig and python3 to be installed | OFF | -| BUILD_CSHARP | Build the C# bindings for MSCL. Note that this requires swig and a csharp compiler to be installed | OFF | -| BUILD_TESTS | Build the unit tests for MSCL. This also enables the `test` CMake target. Note that this also requires that turtle be installed | OFF | -| BUILD_EXAMPLES | Build the examples in [`MSCL_Examples`](../MSCL_Examples/) | OFF | -| BUILD_DOCUMENTATION | Builds the documentation using NaturalDocs. | OFF | -| WITH_SSL | Whether to build with SSL support. Note that this requires openssl to be installed | ON | -| WITH_WEBSOCKETS | Whether to build with Websocket support | ON | +| Parameter | Description | Default | +|--------------------------|---------------------------------------------------------------------------------------------------------------------------------| ------- | +| BUILD_SHARED_LIBS | Build MSCL as a shared library as well as a static library | OFF | +| MSCL_BUILD_PYTHON2 | Build the Python2 bindings for MSCL. Note that this requires swig and python2 to be installed | OFF | +| MSCL_BUILD_PYTHON3 | Build the Python3 bindings for MSCL. Note that this requires swig and python3 to be installed | OFF | +| MSCL_BUILD_CSHARP | Build the C# bindings for MSCL. Note that this requires swig and a csharp compiler to be installed | OFF | +| MSCL_BUILD_TESTS | Build the unit tests for MSCL. This also enables the `test` CMake target. Note that this also requires that turtle be installed | OFF | +| MSCL_BUILD_EXAMPLES | Build the examples in [`MSCL_Examples`](../MSCL_Examples/) | OFF | +| MSCL_ZIP_EXAMPLES | Zip the examples in [`MSCL_Examples`](../MSCL_Examples/) | OFF | +| MSCL_BUILD_DOCUMENTATION | Builds the documentation using NaturalDocs. | OFF | +| MSCL_WITH_SSL | Whether to build with SSL support. Note that this requires openssl to be installed | ON | +| MSCL_WITH_WEBSOCKETS | Whether to build with Websocket support | ON | ##### String Parameters | Parameter | Description | Default | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- | | TURTLE_INCLUDE_DIR | Directory where the turtle include files are installed. Only required if include files are in a nonstandard place. | `C:/lib/turtle/include` | -| NATURAL_DOCS_ROOT | Directory to search for the `NaturalDocs` executable. Only required if `BUILD_DOCUMENTATION` is true, and `NaturalDocs` is installed somewhere nonstandard | `C:/lib/NaturalDocs` | +| NATURAL_DOCS_ROOT | Directory to search for the `NaturalDocs` executable. Only required if `MSCL_BUILD_DOCUMENTATION` is true, and `NaturalDocs` is installed somewhere nonstandard | `C:/lib/NaturalDocs` | ##### Other parameters diff --git a/BuildScripts/build_linux.sh b/BuildScripts/build_linux.sh index de8f9d255..38785e063 100755 --- a/BuildScripts/build_linux.sh +++ b/BuildScripts/build_linux.sh @@ -15,6 +15,7 @@ build_dir="${project_dir}/jenkins_build" # Get some arguments from the user python2Dirs=() python3Dirs=() +branch="unknown" while [[ $# -gt 0 ]]; do case $1 in --python3Dir) @@ -32,12 +33,14 @@ while [[ $# -gt 0 ]]; do shift # past argument shift # past value ;; + --branch) + branch="${2}" + shift # past argument + shift # past value + ;; esac done -# TODO: Add option to build for release instead of copying release artifacts all the time -release_build_dir="${build_dir}_for_release" - # Build MSCL with everything except python2 and python3 mkdir -p "${build_dir}" echo "!! Building MSCL in ${build_dir}" @@ -45,15 +48,17 @@ cmake -S "${project_dir}" -B "${build_dir}" \ -DCMAKE_VERBOSE_MAKEFILE="ON" \ -DCMAKE_BUILD_TYPE="Release" \ -DBUILD_SHARED_LIBS="ON" \ - -DBUILD_PYTHON2="OFF" \ - -DBUILD_PYTHON3="OFF" \ - -DBUILD_TESTS="ON" \ - -DBUILD_EXAMPLES="ON" \ - -DBUILD_DOCUMENTATION="OFF" \ - -DWITH_SSL="OFF" \ - -DWITH_WEBSOCKETS="OFF" \ - -DBUILD_PACKAGE="ON" \ - -DLINK_STATIC_DEPS="OFF" + -DMSCL_BUILD_PYTHON2="OFF" \ + -DMSCL_BUILD_PYTHON3="OFF" \ + -DMSCL_BUILD_TESTS="ON" \ + -DMSCL_BUILD_EXAMPLES="ON" \ + -DMSCL_ZIP_EXAMPLES="OFF" \ + -DMSCL_BUILD_DOCUMENTATION="OFF" \ + -DMSCL_WITH_SSL="OFF" \ + -DMSCL_WITH_WEBSOCKETS="OFF" \ + -DMSCL_BUILD_PACKAGE="ON" \ + -DMSCL_LINK_STATIC_DEPS="OFF" \ + -DMSCL_BRANCH="${branch}" cmake --build "${build_dir}" -j$(nproc) # Run the unit tests @@ -69,15 +74,17 @@ for python3Dir in "${python3Dirs[@]}"; do -DCMAKE_VERBOSE_MAKEFILE="ON" \ -DCMAKE_BUILD_TYPE="Release" \ -DBUILD_SHARED_LIBS="OFF" \ - -DBUILD_PYTHON2="OFF" \ - -DBUILD_PYTHON3="ON" \ - -DBUILD_TESTS="OFF" \ - -DBUILD_EXAMPLES="OFF" \ - -DBUILD_DOCUMENTATION="OFF" \ - -DWITH_SSL="OFF" \ - -DWITH_WEBSOCKETS="OFF" \ - -DBUILD_PACKAGE="ON" \ - -DLINK_STATIC_DEPS="ON" \ + -DMSCL_BUILD_PYTHON2="OFF" \ + -DMSCL_BUILD_PYTHON3="ON" \ + -DMSCL_BUILD_TESTS="OFF" \ + -DMSCL_BUILD_EXAMPLES="OFF" \ + -DMSCL_ZIP_EXAMPLES="OFF" \ + -DMSCL_BUILD_DOCUMENTATION="OFF" \ + -DMSCL_WITH_SSL="OFF" \ + -DMSCL_WITH_WEBSOCKETS="OFF" \ + -DMSCL_BUILD_PACKAGE="ON" \ + -DMSCL_LINK_STATIC_DEPS="ON" \ + -DMSCL_BRANCH="${branch}" \ \ -UPython3_ROOT -DPython3_ROOT="${python3Dir}" \ -UPython3_ROOT_DIR -DPython3_ROOT_DIR="${python3Dir}" \ @@ -95,15 +102,17 @@ for python2Dir in "${python2Dirs[@]}"; do -DCMAKE_VERBOSE_MAKEFILE="ON" \ -DCMAKE_BUILD_TYPE="Release" \ -DBUILD_SHARED_LIBS="OFF" \ - -DBUILD_PYTHON2="ON" \ - -DBUILD_PYTHON3="OFF" \ - -DBUILD_TESTS="OFF" \ - -DBUILD_EXAMPLES="OFF" \ - -DBUILD_DOCUMENTATION="OFF" \ - -DWITH_SSL="OFF" \ - -DWITH_WEBSOCKETS="OFF" \ - -DBUILD_PACKAGE="ON" \ - -DLINK_STATIC_DEPS="ON" \ + -DMSCL_BUILD_PYTHON2="ON" \ + -DMSCL_BUILD_PYTHON3="OFF" \ + -DMSCL_BUILD_TESTS="OFF" \ + -DMSCL_BUILD_EXAMPLES="OFF" \ + -DMSCL_ZIP_EXAMPLES="OFF" \ + -DMSCL_BUILD_DOCUMENTATION="OFF" \ + -DMSCL_WITH_SSL="OFF" \ + -DMSCL_WITH_WEBSOCKETS="OFF" \ + -DMSCL_BUILD_PACKAGE="ON" \ + -DMSCL_LINK_STATIC_DEPS="ON" \ + -DMSCL_BRANCH="${branch}" \ \ -UPython2_ROOT -DPython2_ROOT="${python2Dir}" \ -UPython2_ROOT_DIR -DPython2_ROOT_DIR="${python2Dir}" \ @@ -113,13 +122,3 @@ for python2Dir in "${python2Dirs[@]}"; do cmake --build "${build_dir}" -j$(nproc) cmake --build "${build_dir}" --target "package" done - -# Copy and rename all the packages into a release directory -# Renaming makes it easier for the release process -# Create the new directory -mkdir -p "${release_build_dir}" -for deb_package in "${build_dir}"/*.deb; do - release_package_name=$(basename "${deb_package}") # Get the name of the file - release_package_name="${release_package_name%_*}.deb" # Remove the version number - cp "${deb_package}" "${release_build_dir}/${release_package_name}" # Copy into a release directory -done diff --git a/BuildScripts/build_win.ps1 b/BuildScripts/build_win.ps1 index 5506e3dc6..5c15f82dd 100644 --- a/BuildScripts/build_win.ps1 +++ b/BuildScripts/build_win.ps1 @@ -5,6 +5,7 @@ param ( [String]$arch = "x64", [String]$generator = "Visual Studio 15 2017", [String]$toolset = "v140", + [String]$branch = "unknown", [String[]]$python3Dirs, [String[]]$python2Dirs ) @@ -21,52 +22,64 @@ try # Make sure the build directory exists New-Item "${buildDir}" -ItemType Directory -Force - # Configure MSCL to build the documentation only on x64 release + # Configure MSCL to build the documentation and zip examples only on x64 release if ("$arch" -eq "x64") { cmake -S "${project_dir}" -B "${buildDir}" -G "${generator}" -A "${arch}" -T "${toolset}" ` + -DCMAKE_VERBOSE_MAKEFILE="ON" ` -DBUILD_SHARED_LIBS="OFF" ` - -DBUILD_PYTHON2="OFF" ` - -DBUILD_PYTHON3="OFF" ` - -DBUILD_CSHARP="OFF" ` - -DBUILD_TESTS="OFF" ` - -DBUILD_EXAMPLES="OFF" ` - -DBUILD_DOCUMENTATION="ON" + -DMSCL_BUILD_PYTHON2="OFF" ` + -DMSCL_BUILD_PYTHON3="OFF" ` + -DMSCL_BUILD_CSHARP="OFF" ` + -DMSCL_BUILD_TESTS="OFF" ` + -DMSCL_BUILD_EXAMPLES="OFF" ` + -DMSCL_ZIP_EXAMPLES="ON" ` + -DMSCL_BUILD_DOCUMENTATION="ON" ` + -DMSCL_BUILD_PACKAGE="ON" ` + -DMSCL_BRANCH="${branch}" - cmake --build "${buildDir}" --config "Release" + cmake --build "${buildDir}" --config "Release" --target package } # Configure MSCL to build with everything except csharp, python2, and python3 cmake -S "${project_dir}" -B "${buildDir}" -G "${generator}" -A "${arch}" -T "${toolset}" ` + -DCMAKE_VERBOSE_MAKEFILE="ON" ` -DBUILD_SHARED_LIBS="ON" ` - -DBUILD_PYTHON2="OFF" ` - -DBUILD_PYTHON3="OFF" ` - -DBUILD_CSHARP="OFF" ` - -DBUILD_TESTS="ON" ` - -DBUILD_EXAMPLES="ON" ` - -DBUILD_DOCUMENTATION="OFF" + -DMSCL_BUILD_PYTHON2="OFF" ` + -DMSCL_BUILD_PYTHON3="OFF" ` + -DMSCL_BUILD_CSHARP="OFF" ` + -DMSCL_BUILD_TESTS="ON" ` + -DMSCL_BUILD_EXAMPLES="ON" ` + -DMSCL_ZIP_EXAMPLES="OFF" ` + -DMSCL_BUILD_DOCUMENTATION="OFF" ` + -DMSCL_BUILD_PACKAGE="ON" ` + -DMSCL_BRANCH="${branch}" # Build multiple configurations foreach ($config in ${configs}) { - cmake --build "${buildDir}" --config "${config}" + cmake --build "${buildDir}" --config "${config}" --target package cmake --build "${buildDir}" --config "${config}" --target "RUN_TESTS" } # Build CSharp cmake -S "${project_dir}" -B "${buildDir}" -G "${generator}" -A "${arch}" -T "${toolset}" ` + -DCMAKE_VERBOSE_MAKEFILE="ON" ` -DBUILD_SHARED_LIBS="ON" ` - -DBUILD_PYTHON2="OFF" ` - -DBUILD_PYTHON3="OFF" ` - -DBUILD_CSHARP="ON" ` - -DBUILD_TESTS="OFF" ` - -DBUILD_EXAMPLES="ON" ` - -DBUILD_DOCUMENTATION="OFF" + -DMSCL_BUILD_PYTHON2="OFF" ` + -DMSCL_BUILD_PYTHON3="OFF" ` + -DMSCL_BUILD_CSHARP="ON" ` + -DMSCL_BUILD_TESTS="OFF" ` + -DMSCL_BUILD_EXAMPLES="ON" ` + -DMSCL_ZIP_EXAMPLES="OFF" ` + -DMSCL_BUILD_DOCUMENTATION="OFF" ` + -DMSCL_BUILD_PACKAGE="ON" ` + -DMSCL_BRANCH="${branch}" # Build multiple configurations for CSharp foreach ($config in ${configs}) { - cmake --build "${buildDir}" --config "${config}" + cmake --build "${buildDir}" --config "${config}" --target package } # Build python3 @@ -75,23 +88,27 @@ try foreach ($python3Dir in ${python3Dirs}.split(",")) { cmake -S "${project_dir}" -B "${buildDir}" -G "${generator}" -A "${arch}" -T "${toolset}" ` + -DCMAKE_VERBOSE_MAKEFILE="ON" ` -DBUILD_SHARED_LIBS="OFF" ` - -DBUILD_PYTHON2="OFF" ` - -DBUILD_PYTHON3="ON" ` - -DBUILD_CSHARP="OFF" ` - -DBUILD_TESTS="OFF" ` - -DBUILD_EXAMPLES="OFF" ` - -DBUILD_DOCUMENTATION="OFF" ` + -DMSCL_BUILD_PYTHON2="OFF" ` + -DMSCL_BUILD_PYTHON3="ON" ` + -DMSCL_BUILD_CSHARP="OFF" ` + -DMSCL_BUILD_TESTS="OFF" ` + -DMSCL_BUILD_EXAMPLES="OFF" ` + -DMSCL_ZIP_EXAMPLES="OFF" ` + -DMSCL_BUILD_DOCUMENTATION="OFF" ` + -DMSCL_BUILD_PACKAGE="ON" ` + -DMSCL_BRANCH="${branch}" ` ` -UPython3_ROOT -DPython3_ROOT="${python3Dir}" ` -UPython3_ROOT_DIR -DPython3_ROOT_DIR="${python3Dir}" ` -UPython3_INCLUDE_DIR ` - -UPython3_EXECUTABLE -DPython3_EXECUTABLE="${python3Dir}\python.exe" + -UPython3_EXECUTABLE -DPython3_EXECUTABLE="${python3Dir}/python.exe" # Build multiple configurations foreach ($config in ${configs}) { - cmake --build "${buildDir}" --config "${config}" + cmake --build "${buildDir}" --config "${config}" --target package } } } @@ -102,23 +119,27 @@ try foreach ($python2Dir in ${python2Dirs}.split(",")) { cmake -S "${project_dir}" -B "${buildDir}" -G "${generator}" -A "${arch}" -T "${toolset}" ` + -DCMAKE_VERBOSE_MAKEFILE="ON" ` -DBUILD_SHARED_LIBS="OFF" ` - -DBUILD_PYTHON2="ON" ` - -DBUILD_PYTHON3="OFF" ` - -DBUILD_CSHARP="OFF" ` - -DBUILD_TESTS="OFF" ` - -DBUILD_EXAMPLES="OFF" ` - -DBUILD_DOCUMENTATION="OFF" ` + -DMSCL_BUILD_PYTHON2="ON" ` + -DMSCL_BUILD_PYTHON3="OFF" ` + -DMSCL_BUILD_CSHARP="OFF" ` + -DMSCL_BUILD_TESTS="OFF" ` + -DMSCL_BUILD_EXAMPLES="OFF" ` + -DMSCL_ZIP_EXAMPLES="OFF" ` + -DMSCL_BUILD_DOCUMENTATION="OFF" ` + -DMSCL_BUILD_PACKAGE="ON" ` + -DMSCL_BRANCH="${branch}" ` ` -UPython2_ROOT -DPython2_ROOT="${python2Dir}" ` -UPython2_ROOT_DIR -DPython2_ROOT_DIR="${python2Dir}" ` -UPython2_INCLUDE_DIR ` - -UPython2_EXECUTABLE -DPython2_EXECUTABLE="${python2Dir}\python.exe" + -UPython2_EXECUTABLE -DPython2_EXECUTABLE="${python2Dir}/python.exe" # Build multiple configurations foreach ($config in ${configs}) { - cmake --build "${buildDir}" --config "${config}" + cmake --build "${buildDir}" --config "${config}" --target package } } } diff --git a/BuildScripts/prerelease.sh b/BuildScripts/prerelease.sh new file mode 100755 index 000000000..cdd451ca2 --- /dev/null +++ b/BuildScripts/prerelease.sh @@ -0,0 +1,181 @@ +#!/bin/bash + +# Exit on error +set -ex + +# Compare versions +function version_compare() { + local IFS=. + local i ver1=($1) ver2=($2) + + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do + ver1[i]=0 + done + + # fill empty fields in ver2 with zeros + for ((i=${#ver2[@]}; i<${#ver1[@]}; i++)); do + ver2[i]=0 + done + + for ((i=0; i<${#ver1[@]}; i++)); do + if [[ -z ${ver1[i]} ]]; then + ver1[i]=0 + fi + if [[ -z ${ver2[i]} ]]; then + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})); then + echo 1 + return + elif ((10#${ver1[i]} < 10#${ver2[i]})); then + echo -1 + return + fi + done + + echo 0 +} + +# On Jenkins, log all commands +if [ "${ISHUDSONBUILD}" == "True" ]; then + set -x +fi + +# Get some arguments from the user +while [[ $# -gt 0 ]]; do + case $1 in + --target) + target="$2" + shift # past argument + shift # past value + ;; + *) + shift # past argument + ;; + esac +done + +if [ -z "${target}" ]; then + echo "Script must be called with --target" + exit 1 +fi + +# Only need to perform a pre-release check for develop +if [ "${target}" != "develop" ]; then + echo "No pre-release check required for ${target}" + exit 0 +fi + +# Some constants and other important variables +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" +project_dir="${script_dir}/.." +build_dir="${project_dir}/build_prerelease" + +mkdir -p "${build_dir}" + +# Configure a basic cmake project so we can check the version +cmake -S "${project_dir}" -B "${build_dir}" \ + -DCMAKE_VERBOSE_MAKEFILE="OFF" \ + -DCMAKE_BUILD_TYPE="Release" \ + -DBUILD_SHARED_LIBS="OFF" \ + -DMSCL_BUILD_PYTHON2="OFF" \ + -DMSCL_BUILD_PYTHON3="OFF" \ + -DMSCL_BUILD_TESTS="OFF" \ + -DMSCL_BUILD_EXAMPLES="OFF" \ + -DMSCL_ZIP_EXAMPLES="OFF" \ + -DMSCL_BUILD_DOCUMENTATION="OFF" \ + -DMSCL_WITH_SSL="OFF" \ + -DMSCL_WITH_WEBSOCKETS="OFF" \ + -DMSCL_BUILD_PACKAGE="OFF" \ + -DMSCL_LINK_STATIC_DEPS="OFF" \ + || echo "" # Failures are OK. Project version is added to the cache immediately + +# Only continue the prerelease if the project version changed on develop +pushd "${build_dir}" +# Make sure the target branch is checked out +git checkout ${target} +# Make sure the tags are pulled +git pull --tags +github_release_version=$(git describe --tags --match "v*" --abbrev=0 HEAD) +project_release_version="v$(cmake --system-information | awk -F= '$1~/CMAKE_PROJECT_VERSION:STATIC/{print$2}')" +popd + +# No need for the build directory after getting the project version +rm -rf "${build_dir}" + +if [ "${github_release_version}" == "${project_release_version}" ]; then + echo "No new version to update for pre-release from ${target} since the current version matches the latest version" + exit 0 +fi + +if [[ $(version_compare "${project_release_version:1}" "${github_release_version:1}") -lt 0 ]]; then + echo "The project version is lower than the last release. Fix the new release number before proceeding." + exit 1 +fi + +# Set up the auth for github assuming that a valid token is in the environment at "GH_TOKEN" +git_askpass_file="${project_dir}/.mscl-git-askpass" +echo 'echo ${GH_TOKEN}' > "${git_askpass_file}" +chmod 700 "${git_askpass_file}" + +pushd "${project_dir}" +# Find the commit that this project is built on +mscl_commit="$(git rev-parse HEAD)" + +# Delete the tag if it exists +GIT_ASKPASS="${git_askpass_file}" git push --delete origin "${project_release_version}" || echo "No existing tag named ${project_release_version}." + +changelog_file="${project_dir}/CHANGELOG.md" +forthcoming_header="^## Forthcoming" + +# Check if there are any changes in the changelog first +if [ $(grep -A 1 "${forthcoming_header}" ${changelog_file} | grep -v -e "${forthcoming_header}" -e "^$" | wc -l) -eq 0 ]; then + echo "Nothing to update" + exit 0 +fi + +changelog_release_name="${project_release_version}" + +# Remove any leading 'v' from the release tag +if [[ ${changelog_release_name} =~ ^v ]]; then + changelog_release_name="${changelog_release_name:1}" +fi + +# Get the date of release +today=$(date '+%Y-%m-%d') + +# Shift the forthcoming details down and prepend the version tag +sed -i -e "/^## Forthcoming/s,$,\n\n## ${changelog_release_name} - ${today},g" "${changelog_file}" + +# Replace all the previous release asset links with the new links +sed -i -e "s,${github_release_version},${project_release_version},g" "${project_dir}/README.md" + +# Add any pending changes +git add --all + +# Only commit if there are changes +if ! git diff-index --quiet HEAD --; then + git commit -m "Pre-release updates for release ${project_release_version}." + + GIT_ASKPASS="${git_askpass_file}" git push origin ${target} +else + echo "No changes to commit for pre-release" +fi +popd + +repo="LORD-MicroStrain/MSCL" + +gh release delete \ + -y \ + -R "${repo}" "${project_release_version}" || echo "No existing release named ${project_release_version}." + +# Create a draft release on GitHub +gh release create \ + --repo "${repo}" \ + --prerelease \ + --title "${project_release_version}" \ + --target "${target}" \ + "${project_release_version}" + +rm "${git_askpass_file}" diff --git a/BuildScripts/release.sh b/BuildScripts/release.sh new file mode 100755 index 000000000..f2a274939 --- /dev/null +++ b/BuildScripts/release.sh @@ -0,0 +1,182 @@ +#!/bin/bash + +# Exit on error +set -ex + +# On Jenkins, log all commands +if [ "${ISHUDSONBUILD}" == "True" ]; then + set -x +fi + +# Get some arguments from the user +generate_notes_flag="" +while [[ $# -gt 0 ]]; do + case $1 in + --artifacts) + artifacts="$2" + shift # past argument + shift # past value + ;; + --docs-zip) + docs_zip="$2" + shift # past argument + shift # past value + ;; + --target) + target="$2" + shift # past argument + shift # past value + ;; + --release) + release_name="$2" + shift # past argument + shift # past value + ;; + --generate-notes) + generate_notes_flag="--generate-notes" + shift # past argument + ;; + *) + shift # past argument + ;; + esac +done +if [ -z "${artifacts}" ] || [ -z "${docs_zip}" ] || [ -z "${release_name}" ] || [ -z "${target}" ]; then + echo "Script must be called with --target, --docs-zip, --artifacts and --release" + exit 1 +fi + +# Some constants and other important variables +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" +project_dir="${script_dir}/.." +build_dir="${project_dir}/build_ubuntu_amd64" + +# Only continue releasing for master if the version changed in the project +pushd "${build_dir}" +github_release_version=$(git describe --tag --abbrev=0 HEAD) +project_release_version="v$(cmake --system-information | awk -F= '$1~/CMAKE_PROJECT_VERSION:STATIC/{print$2}')" +if [ "${target}" == "master" ]; then + if [ "${github_release_version}" == "${project_release_version}" ]; then + echo "Not releasing from ${target} since the current version matches the latest version" + exit 0 + fi + + # Use the release name from the project + release_name=${project_release_version} +fi +popd + +# Some more constants and other important variables +repo="LORD-MicroStrain/MSCL" +tmp_dir="/tmp" +docs_dir="${tmp_dir}/MSCL_documentation" +docs_release_dir="${docs_dir}/${release_name}" + +# Set up the auth for github assuming that a valid token is in the environment at "GH_TOKEN" +git_askpass_file="${project_dir}/.mscl-git-askpass" +echo 'echo ${GH_TOKEN}' > "${git_askpass_file}" +chmod 700 "${git_askpass_file}" + +# Delete the release before the tag. Deleting the tag before the release may cause issues +gh release delete \ + -y \ + -R "${repo}" "${release_name}" || echo "No existing release named ${release_name}." + +pushd "${project_dir}" +# Find the commit that this project is built on +mscl_commit="$(git rev-parse HEAD)" + +# Delete the tag if it exists +GIT_ASKPASS="${git_askpass_file}" git push --delete origin "${release_name}" || echo "No existing tag named ${release_name}." +popd + +# Generate a release notes file +documentation_link="https://lord-microstrain.github.io/MSCL_documentation/${release_name}" +changelog_link="https://github.com/LORD-MicroStrain/MSCL/blob/${release_name}/CHANGELOG.md" +release_notes_file="${tmp_dir}/mscl-release-notes-${release_name}.md" +echo "## Useful Links" > ${release_notes_file} +echo "* [Changelog](${changelog_link})" >> ${release_notes_file} +echo "* [Full Documentation](${documentation_link}/MSCL_API_Docs)" >> ${release_notes_file} +echo "* [Public Documentation](${documentation_link}/MSCL_Docs)" >> ${release_notes_file} + +regex_pattern='^## [0-9]+.+' +if [ -z "${generate_notes_flag}" ]; then + add_changes=0 + + while IFS= read line; do + # Read between release notes (I.E. '## 1.2.4...' and '## 1.2.3...') + if [[ "${line}" =~ ${regex_pattern} ]]; then + # Start reading change notes + if [[ ${add_changes} -eq 0 ]]; then + add_changes=1 + echo "" >> ${release_notes_file} + echo "## What's Changed" >> ${release_notes_file} + continue + # Stop reading change notes + else + break + fi + fi + + if [[ ${add_changes} -eq 1 ]]; then + # End of the changes (empty line) + if [[ "${line}" == "" ]]; then + break + fi + + # Append the changes to the release notes while keeping leading whitespaces + echo -e "${line}" >> ${release_notes_file} + fi + done < "${project_dir}/CHANGELOG.md" +fi + +if [ "${release_name}" == "latest" ]; then + latest_flag="--latest" +fi + +# Deploy the artifacts to Github +gh release create \ + -R "${repo}" \ + ${latest_flag} \ + --title "${release_name}" \ + --target "${target}" \ + ${generate_notes_flag} \ + --notes-file "${release_notes_file}" \ + "${release_name}" ${artifacts} +rm -f "${release_notes_file}" + +# Commit the documentation to the github pages branch +rm -rf "${docs_dir}" +git clone -b "main" "https://github.com/LORD-MicroStrain/MSCL_documentation.git" "${docs_dir}" +rm -rf "${docs_release_dir}" +mkdir -p "${docs_release_dir}" +pushd "${docs_release_dir}" +unzip "${docs_zip}" -d "${docs_release_dir}" + +documentation_readme="${docs_dir}/README.md" + +# If the tag is not already in the readme, add it after latest +if ! grep -q -E "^\| ${release_name} +\|" "${documentation_readme}"; then + # Variables to simplify the append process + full_documentation_link="${documentation_link}/MSCL_API_Docs" + public_documentation_link="${documentation_link}/MSCL_Docs" + append_links="\n| $release_name | [Full Documentation]($full_documentation_link) | [Public Documentation]($public_documentation_link) |" + + # Append the new links after release so new releases are at the top + sed -i -E "/^\| latest +/s,$,${append_links},g" "${documentation_readme}" +fi + +# Add any pending changes +git add --all + +# Only commit if there are changes +if ! git diff-index --quiet HEAD --; then + git commit -m "Adds/updates documentation for release ${release_name} at ${repo}@${mscl_commit}." + + GIT_ASKPASS="${git_askpass_file}" git push origin main +else + echo "No changes to commit to documentation" +fi +popd + +rm "${git_askpass_file}" diff --git a/BuildScripts/zip_win.ps1 b/BuildScripts/zip_win.ps1 deleted file mode 100644 index ae69a0417..000000000 --- a/BuildScripts/zip_win.ps1 +++ /dev/null @@ -1,115 +0,0 @@ -######################################################################################################################################################## -# This script is responsible for zipping up the binaries produced by the build on windows. If running manually, this should be run after "build_win.ps1" -######################################################################################################################################################## - -# Get arguments from the user -param ( - [String]$arch = "x64" -) - -# Find the script directory and set some constants -$script_dir = $PSScriptRoot -$project_dir = "${script_dir}/.." -$build_output_dir = "${project_dir}/build_windows_${arch}" -$release_build_output_dir = "${build_output_dir}_for_release" - -# Find the version from Git -pushd "${project_dir}" -$mscl_git_version = (git describe --tag) # Tag and commit hash -$mscl_git_release_version = (git describe --tag --abbrev=0) # Just the tag -popd - -# Function to handle compressing each package -function Compress-Files -{ - param ( - [String]$package_name = "", - [String]$package_output_dir = "" - ) - - if (-Not (Test-Path -Path "${package_output_dir}")) - { - echo "Cannot compress package. Directory does not exist: ${package_output_dir}" - return - } - - # TODO: Move documentation build to separate build process - # Documentation isn't needed to be copied - if (-Not ("${package_name}" -eq "Documentation")) - { - # Copy the files to a temp dir to zip for release - $full_release_package_name = "${release_build_output_dir}/MSCL_Windows_${arch}_${package_name}" - $temp_zip_dir = "${full_release_package_name}_${mscl_git_release_version}" - $zip_file = "${full_release_package_name}.zip" - Copy-Item -Path "${package_output_dir}" -Destination "${temp_zip_dir}" -Recurse - - # Compress the temp directory and then remove it - echo "Compressing ${temp_zip_dir} to ${zip_file} for release" - Compress-Archive -Force -Path "${temp_zip_dir}" -DestinationPath "${zip_file}" - Remove-Item "${temp_zip_dir}" -Recurse -Force - } - - # Compress the files with the git version - $full_package_name = "${build_output_dir}/MSCL_Windows_${arch}_${package_name}" - $versioned_zip_file = "${full_package_name}_${mscl_git_version}.zip" - echo "Compressing contents of ${package_output_dir} to ${versioned_zip_file}" - Compress-Archive -Force -Path "${package_output_dir}/*" -DestinationPath "${versioned_zip_file}" -} - -# Make the build output directories -echo "Creating a Windows archive directory at ${build_output_dir}" -New-Item -Path "${build_output_dir}" -ItemType Directory -Force - -echo "Creating a Windows archive directory for release at ${release_build_output_dir}" -New-Item -Path "${release_build_output_dir}" -ItemType Directory -Force - -# MSCL build output directory -$output_dir = "${project_dir}/Output" - -# Common C++ directory -$cpp_output_dir = "${output_dir}/C++" - -# Zip up the Static library -$static_output_dir = "${cpp_output_dir}/Static" -Compress-Files -package_name "Static_C++" -package_output_dir "${static_output_dir}" - -# Zip up the Shared library -$shared_output_dir = "${cpp_output_dir}/Shared" -Compress-Files -package_name "Shared_C++" -package_output_dir "${shared_output_dir}" - -# Zip up the C# library -$dotnet_output_dir = "${output_dir}/DotNet" -Compress-Files -package_name "DotNet" -package_output_dir "${dotnet_output_dir}" - -# Zip up the documentation -$documentation_output_dir = "${output_dir}/Documentation" -Compress-Files -package_name "Documentation" -package_output_dir "${documentation_output_dir}" - -# Zip up the examples -$examples_output_dir = "${output_dir}/Examples" -Compress-Files -package_name "Examples" -package_output_dir "${examples_output_dir}" - -# Zip up the python versions -$python_output_dir = "${output_dir}/Python" - -# Test to make sure Python libraries were built -if ((-Not (Test-Path -Path "${python_output_dir}")) -or (Get-ChildItem -Path "$python_output_dir" -Recurse -File).Count -eq 0) -{ - echo "Python packages were not built" - exit 1 -} - -$python_directories = Get-ChildItem -Path "${python_output_dir}" -Directory - -foreach ($directory in $python_directories) -{ - if ((Get-ChildItem -Path "$(${directory}.FullName)" -Recurse -File).Count -eq 0) - { - echo "Python Error: No binaries built in ${directory}" - continue - } - - $python_version = ${directory}.Name - $python_version_output_dir = ${directory}.FullName - Compress-Files -package_name "Python${python_version}" -package_output_dir "${python_version_output_dir}" -} diff --git a/CHANGELOG.txt b/CHANGELOG.md similarity index 86% rename from CHANGELOG.txt rename to CHANGELOG.md index 2bca2f1bf..d946931ea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -====================================================================================================== -MSCL Change Log - update with each release +___ +MSCL Change Log The version number scheme in MSCL is as follows: MAJOR.MINOR.PATCH @@ -12,11 +12,25 @@ Major revisions will specify what caused the non-backwards compatible change. Th CHANGED - A non-backwards compatible change was made to an existing function/class. RENAMED - A function/class has been renamed. REMOVED - A function/class has been removed. -====================================================================================================== - -Forthcoming +___ + +## Forthcoming + +## 67.0.0 - 2024-12-19 +- CHANGED Fixed typo for mscl::InertialNode::setAidingMeasurementReferenceFrames() +- Updated CMake options to be project independent (prefixed with MSCL) +- Moved documentation to separate GitHub repository +- REMOVED All files that use version numbers that are now auto-generated by CMake +- REMOVED zip_win.ps1 in favor of CPack +- Updated Python3 versions to latest supported (3.9 - 3.13) +- REMOVED support for MATLAB +- Inertial + - Added CV7-GNSS/INS support + - Added support for MIP commands: + - Interface Control (0x7F,0x02) + - SPARTN Configuration (0x0E,0x20) -66.0.0 - 2024-10-24 +## 66.0.0 - 2024-10-24 - CHANGED Switched to CMake build system - Updated READMEs to reflect new build system - Updated example code for Python to conform more to Python3 @@ -50,7 +64,7 @@ Forthcoming - Aiding Frame Configuration Error (0x82,0x50) - Aiding Frame Configuration Error Uncertainty(0x82,0x51) -65.0.0 - 2022-11-18 +## 65.0.0 - 2022-11-18 - Wireless - Added Taiwan region code for wireless devices - Inertial @@ -78,7 +92,7 @@ Forthcoming - Reference Point Lever Arm (0x0D,0x56) - NMEA Message Format (0x0C,0x0C) -64.3.0 - 2022-06-03 +## 64.3.0 - 2022-06-03 - Added support for G-Link-200 6522-6001 (custom default configuration) - Added support for MIP commands: - Event Support (0x0C,0x2A) @@ -107,40 +121,40 @@ Forthcoming - Added check for complementary filter north compensation support - Added support for storing and getting Timestamp class values in both GPS and Unix epochs - default behavior unchanged -64.2.2 - 2022-03-08 +## 64.2.2 - 2022-03-08 - Reverted default MIP command timeout to 250 ms - Increased timeout for MipNode::saveSettingsAsStartup() to 2500 ms - Increased timeout for MipNode::loadFactoryDefaultSettings() to 1200 ms -64.2.1 - 2022-02-28 +## 64.2.1 - 2022-02-28 - Increased Mip Node commands default timeout 250ms->500ms -64.2.0 - 2022-02-17 +## 64.2.0 - 2022-02-17 - Added support for GPIO State (0x0C,0x42) -64.0.1 - 2022-02-15 +## 64.0.1 - 2022-02-15 - Added Indonesia region code for wireless devices -64.0.0 - 2022-01-28 +## 64.0.0 - 2022-01-28 - RENAMED and inverted MipTypes::MipCommandBytes::responseSuccess to sendCmdFailed - Changed MipNode::getConfigCommandBytes() to catch exceptions thrown when reading settings from the device, instead buildCmdFailed is set to true for the corresponding entry in the returned MipCommandSet -63.2.0 - 2022-01-28 +## 63.2.0 - 2022-01-28 - Added aiding measurement filter supported check -63.1.1 - 2022-01-20 +## 63.1.1 - 2022-01-20 - Add model information for 3DM-CV7-AHRS (6286) and 3DM-CV7-AR (6287) -63.1.0 - 2022-01-13 +## 63.1.0 - 2022-01-13 - Added RTK (v2) 6285-0100 bitfield status support and set as default - Updated RTK (v1) 6285-0000 bitfield status to have _v1 suffix -63.0.1 - 2022-01-06 +## 63.0.1 - 2022-01-06 - Increase default readWriteRetries for BaseStation and WirelessNode objects from 0 - BaseStation default: 2 - WirelessNode default: 3 -63.0.0 - 2022-01-05 +## 63.0.0 - 2022-01-05 - Add enum MipModels::Modifier to represent the second half of a MIP model number for select models - Add enum MipModels::ModelNumber as an integer representation of full MIP device model numbers - Add functions to properly compare model numbers with placeholder modifier values @@ -149,113 +163,113 @@ Forthcoming - MipNode::model() now returns a MipModel object instead of MipModels::NodeModel enum value - Remove unsupported MipModels::NodeModel enum values: node_3dm, node_fasA, node_3dm_gx2 -62.2.1 - 2022-01-05 +## 62.2.1 - 2022-01-05 - Update Torque-Link-200-3ch (s) gain values -62.2.0 - 2021-11-22 +## 62.2.0 - 2021-11-22 - Update wireless sensor warmup delay min/max values - Add wireless sensor warmup delay default values -62.1.2 - 2021-10-18 +## 62.1.2 - 2021-10-18 - Fixes Windows python build, and updates windows python build scripts to work easier out of the box -62.1.1 - 2021-10-13 +## 62.1.1 - 2021-10-13 - Updates documentation definitions to work with new version of NaturalDocs -62.1.0 - 2021-10-12 +## 62.1.0 - 2021-10-12 - Add support for Torque-Link-200-3ch (s) -62.0.2 - 2021-08-17 +## 62.0.2 - 2021-08-17 - set South Africa region to the same as US instead of EU - add merge option for factory streaming channel as enum mscl::InertialTypes::FACTORY_STREAMING_MERGE -62.0.1 - 2021-05-27 +## 62.0.1 - 2021-05-27 - add entry for South Africa to WirelessTypes::RegionCode enum (region_southAfrica) - set available transmit powers to the same as EU (RegionCode::region_europeanUnion) -62.0.0 - 2021-05-19 +## 62.0.0 - 2021-05-19 - update inertial time of week channel names from _lastValidTow to _tow for accuracy: - GNSS Position Aiding Status (0x82,0x43) - GNSS Attitude Aiding Status (0x82,0x44) - Aiding Measurement Summary (0x82,0x46) -61.2.3 - 2021-05-18 +## 61.2.3 - 2021-05-18 - Fix InertialTypes::GnssAidingStatus enum values, add NO_FIX and CONFIG_ERROR entries - definition for status value of fields: GNSS Position Aiding Status (0x82,0x43), GNSS Attitude Aiding Status (0x82,0x44) -61.2.2 - 2021-04-20 +## 61.2.2 - 2021-04-20 - Add ability to set lastDeviceState on MipNode objects (MipNode::setLastDeviceState()) -61.2.1 - 2021-04-16 +## 61.2.1 - 2021-04-16 - Fix available options for Estimation Control Flags (0x0D,0x14) config command for CV5-25 (MipNodeFeatures::supportedEstimationControlOptions()) - hard, soft iron auto calibration now available -61.2.0 - 2021-03-23 +## 61.2.0 - 2021-03-23 - Add support for Torque-Link-200-3ch -61.1.7 - 2021-03-22 +## 61.1.7 - 2021-03-22 - Remove assert(false) from MipTypes::channelName() and MipChannelIdentifier::name() on undefined channel field/qualifier or identifier type -61.1.6 - 2021-03-04 +## 61.1.6 - 2021-03-04 - Add support for inertial command Input Speed Measurement (0x0D,0x60) -61.1.5 - 2021-02-12 +## 61.1.5 - 2021-02-12 - Add support for inertial data field GNSS Dual Antenna Status (0x82,0x49) -61.1.4 - 2020-01-28 +## 61.1.4 - 2020-01-28 - Update RTKDeviceStatusFlags to reflect field definition changes - Changed all bitmask constants (names and values) - Changed all accessor functions - ResetReason enum: changed HARDWARE_RESET to UNKNOWN, WATCHDOG_RESET to HARDWARE_ERROR_RESET -61.1.3 - 2020-01-11 +## 61.1.3 - 2020-01-11 - Add support for RTK Command Activation Code (0x0F, 0x07) -61.1.2 - 2020-01-09 +## 61.1.2 - 2020-01-09 - Add RawBytePacket collection for Wireless Base Stations - Add RawBytePacket parsing to WirelessParser - Add RawBytePacketCollector to BaseStation - Add function BaseStation::getRawBytePackets() to get raw byte packets -61.1.1 - 2020-01-05 +## 61.1.1 - 2020-01-05 - Add RawBytePacket collection for MipNodes - Add RawBytePacket parsing to MipParser - Add RawBytePacketCollector to MipNode - Add function MipNode::getRawBytePackets() to get raw byte packets -61.1.0 - 2021-01-04 +## 61.1.0 - 2021-01-04 - Add support for 3DM-CL5-15, -25 -61.0.20 - 2020-12-10 +## 61.0.20 - 2020-12-10 - Add support for inertial data fields: - Odometer Scale Factor Error (0x82,0x47) - Odometer Scale Factor Error Uncertainty (0x82,0x48) -61.0.19 - 2020-12-04 +## 61.0.19 - 2020-12-04 - Add function MipNode::clearDeviceInfo() to reset the associated MipNodeInfo object, forcing that information to be re-read from the device -61.0.18 - 2020-12-02 +## 61.0.18 - 2020-12-02 - Moved loadStartupSettings() and loadFactoryDefaultSettings() from InertialNode to MipNode (base class) - now available on RTKNode as well - Add additional parameter options to MipNode::saveSettingsAsStartup(), loadStartupSettings(), loadFactoryDefaultSettings() - list of command IDs (MipTypes::MipCommands) to perform the action for - list of command IDs and parameters to perform the action for commands that require identifier(s) (message format, enable streaming, comm port speed, etc.) -61.0.17 - 2020-12-01 +## 61.0.17 - 2020-12-01 - Add support for MIP command Comm Port Speed (0x01,0x09) - automatically used by MipNode::get/setUARTBaudRate() if supported - Moved get/setUARTBaudRate from InertialNode to MipNode (base class) - now available on RTKNode as well - add option port ID parameter - Add MipNodeFeatures::getCommPortInfo() returns supported port IDs and types of MIP device -61.0.16 - 2020-11-02 +## 61.0.16 - 2020-11-02 - Add function DeviceStatusData::asValueMap() to get a map of all populated inertial device status values for the target device - Update RTKDeviceStatusFlags to include additional values after definition change -61.0.15 - 2020-10-26 +## 61.0.15 - 2020-10-26 - Update MIP data packet parsing to detect and use shared inertial timestamp fields as the device timestamp in addition to existing timestamp fields -61.0.14 - 2020-10-25 +## 61.0.14 - 2020-10-25 - Remove MipNodeFeatures::supportedGpioPins() - device supported pin IDs can be found in MipNodeFeatures::supportedGpioConfigurations() - Remove vector type GpioPinIds - Remove GpioConfiguration::PinId - switch all remaining references to uint8 -61.0.13 - 2020-10-23 +## 61.0.13 - 2020-10-23 - Update supported inertial GPIO features functions, typedefs to return map of supported GPIO functionality per pin - Added: supportedGpioConfigurations(), supportedGpioPins() - Fix inertial config command byte creation (MipNode_Impl::getConfigCommandBytes()) for: @@ -264,11 +278,11 @@ Forthcoming - GNSS Signal Configuration (0x0E,0x02) - GNSS RTK Dongle Configuration (0x0E,0x10) -61.0.12 - 2020-10-22 +## 61.0.12 - 2020-10-22 - Fixed Bitmap 0 mask error - Fixed -61.0.11 - 2020-10-21 +## 61.0.11 - 2020-10-21 - Added Inertial Types: - PinModeOptions (A vector of values) - GpioFeatureOptions (A vector of values) @@ -280,16 +294,16 @@ Forthcoming - Added support for: - GPIO Configuration (0x0C,0x41) -61.0.10 - 2020-10-14 +## 61.0.10 - 2020-10-14 - Update values in PositionVelocityReferenceFrame enum - ECEF: 0x01 - LLH_NED: 0x02 - Update Relative Position Configuration (0x0D,0x55) command to reflect definition changes (InertialNode::get/setRelativePositionReference) -61.0.9 -2020-10-13 +## 61.0.9 - 2020-10-13 - Add PpsSource::PPS_DISABLED to MipNodeFeatures::supportedPpsSourceOptions() for supported devices -61.0.8 - 2020-10-13 +## 61.0.8 - 2020-10-13 - Changed InertialTypes::PpsInputOutput to PpsSource - Removed unsupported command PPS Output (0x0C,0x29) - Added option to resume streaming to InertialNode::enableDataStream to maintain function behavior despite command behavior change @@ -297,22 +311,22 @@ Forthcoming - Speed Measurement Lever Arm Offset (0x0D,0x61) - Odometer Settings (0x0C,0x43) -61.0.7 - 2020-10-12 +## 61.0.7 - 2020-10-12 - Shorten multi-identifier name keys to attempt to resolve channel names being too long - Fix finding shared data field names within GNSS data classes -61.0.6 - 2020-10-12 +## 61.0.6 - 2020-10-12 - Removed Tracking Channel as Mip Identifier type (MipChannelIdentifier::GNSS_TRACKING_CHANNEL) - Space Vehicle Information (0x81,0x0C): re-added tracking channel data point/channel -61.0.5 - 2020-10-11 +## 61.0.5 - 2020-10-11 - Add support for shared inertial data fields - these occur in all data sets: - Shared Ticks (0xFF,0xD1) - Shared Delta Ticks (0xFF,0xD2) - Shared GPS Timestamp (0xFF,0xD3) - Shared Delta Time (0xFF,0xD4) -61.0.4 - 2020-10-11 +## 61.0.4 - 2020-10-11 - Changed MipChannelIdentifier::Type::DGNSS_BASE_STATION_ID to GNSS_BASE_STATION_ID - Add support for inertial data fields: - GNSS Satellite Status (0x91,0x20) @@ -320,7 +334,7 @@ Forthcoming - GNSS Station Info (0x91,0x30) - Add command ID definitions for Ephemeris data fields (0x81, 91-95, 0x61, 62, 63) to MipTypes::ChannelField - parsing not implemented -61.0.3 - 2020-10-09 +## 61.0.3 - 2020-10-09 - Update inertial field parsing/definition for GNSS RTK Corrections Status ([0x81, 0x91-95],0x31) - Add support for inertial data fields: - Clock Correction (0x82,0x32) @@ -328,17 +342,17 @@ Forthcoming - Multi Antenna Offset Correction (0x82,0x34) - Multi Antenna Offset Correction Uncertainty (0x82,0x35) -61.0.2 -2020-10-09 +## 61.0.2 - 2020-10-09 - Add unit tonne (unit_mass_tonne) to WirelessTypes::CalCoef_Unit - Add support for inertial command Run Filter (0x0D,0x05) -61.0.1 - 2020-10-08 +## 61.0.1 - 2020-10-08 - Updated channel names to help with parsing/categorization: - Space Vehicle Information (0x81,0x0C) - DGNSS Information (0x81,0x0E) - DGNSS Channel Status (0x81,0x0F) -61.0.0 - 2020-10-07 +## 61.0.0 - 2020-10-07 - CHANGED parsing for following inertial data fields to utilize new additional identifiers functionality: - Space Vehicle Information (0x81,0x0C) - DGNSS Information (0x81,0x0E) @@ -361,10 +375,10 @@ Forthcoming - GNSS Position Aiding Status (0x82,0x43) - Aiding Measurement Summary (0x82,0x46) -60.0.5 - 2020-10-02 +## 60.0.5 - 2020-10-02 - Add units grams (unit_mass_grams) and tons (unit_mass_ton) to WirelessTypes::CalCoef_Unit -60.0.4 - 2020-09-29 +## 60.0.4 - 2020-09-29 - Updated channel names (MipTypes::CHANNEL_NAMES()) of the following channels to help with parsing/categorization: - Temperature Statistics (0x80,0x14) - Odometer Data (0x80,0x40) @@ -375,10 +389,10 @@ Forthcoming - ECEF Velocity (0x82,0x41) - NED Relative Position (0x82,0x42) -60.0.3 - 2020-09-28 +## 60.0.3 - 2020-09-28 - Add support for inertial data fields GNSS Attitude Aiding Status (0x82,0x44) -60.0.2 - 2020-09-25 +## 60.0.2 - 2020-09-25 - Add support for inertial data fields: - Odometer Data (0x80,0x40) - Magnetometer Covariance Matrix (0x82,0x2A) @@ -389,10 +403,10 @@ Forthcoming - ECEF Velocity (0x82,0x41) - NED Relative Position (0x82,0x42) -60.0.1 - 2020-09-19 +## 60.0.1 - 2020-09-19 - InertialNode::getCommunicationMode() - remove verification that this a supported descriptor as it is falsely not reported by the device in some scenarios -60.0.0 - 2020-09-17 +## 60.0.0 - 2020-09-17 - REMOVED InertialModels::NodeModel, RTKModels::NodeModel - combined and replaced with MipModels::NodeModel - REMOVED unsupported RTKNode functions: - getDataPackets() @@ -404,19 +418,19 @@ Forthcoming - sendCommandBytes() - saveSettingsAsStartup() -59.0.0 - 2020-09-11 +## 59.0.0 - 2020-09-11 - RENAMED CH_FIELD_GNSS_IONOSPHERIC_CORRECTION to CH_FIELD_GNSS_GALILEO_IONOSPHERIC_CORRECTION for accuracy - Change applied to all 6 corresponding GNSS data set channel fields CH_FIELD_GNSS_1 - CH_FIELD_GNSS_5 -58.0.7 - 2020-09-04 +## 58.0.7 - 2020-09-04 - Added reporting for DeviceStatusData::asMap() of - gnss1PpsPulseInfo_LastTimeinMS - gnss1PpsPulseInfo_Count -58.0.6 - 2020-08-21 +## 58.0.6 - 2020-08-21 - Fixed Bitfield values in GNSS Signal Configuration (0x0E,0x02) constructor -58.0.5 - 2020-08-19 +## 58.0.5 - 2020-08-19 - Added Bitfield class to handle reading and writing masked values within a bitfield - Added support for reading and writing signed int8 to ByteStream, DataPoint, and Value classes - Added GNSS and RTK command set IDs to MipPacketInfo and DescriptorSet enums @@ -428,25 +442,25 @@ Forthcoming - Added MipNodeFeatures::supportedAdaptiveFilterLevels to support varied level availability across devices - Added InertialTypes::HeadingSource::HEADINGSOURCE_GNSS_DUAL_ANTENNA -58.0.4 - 2020-08-07 +## 58.0.4 - 2020-08-07 - CHANGED InertialTypes::GnssFixType::FIXTYPE_FTK_FIXED to FIXTYPE_RTK_FIXED (typo) -58.0.3 - 2020-08-06 +## 58.0.3 - 2020-08-06 - Changed RTKDeviceStatusFlags::ResetReason enum values to their base values outside of the StatusFlags (uint32) context - Added InertialTypes::FilterStatus_Running::FILTERSTATUS_CONDITION to mask the Condition bits in the Prospect Filter Status bitfield - Added InertialTypes::FilterCondition enum to represent the FILTERSTATUS_CONDITION option values -58.0.2 - 2020-08-03 +## 58.0.2 - 2020-08-03 - Updated RTKDeviceStatusFlags to reflect bitfield definition changes - Changed MipTypes::CHANNEL_NAMES entries for GPS and GNSS Ionospheric Corrections channel field/qualifiers to ensure they're unique -58.0.1 - 2020-08-03 +## 58.0.1 - 2020-08-03 - Update inertial field parsers for: - GNSS RTK Corrections Status (0x81,0x31) - added RTK status data point, fixed valid flags - GPS Ionospheric Correction (0x81,0x71) - fixed matrix parsing, fixed valid flags - GNSS Ionospheric Correction (0x81,0x73) - fixed vector parsing, fixed valid flags -58.0.0 - 2020-07-30 +## 58.0.0 - 2020-07-30 - REMOVED support for inertial command Kinematic Constraint Control (0x0D,0x51) (no device support): - InertialNode::get/setKinematicConstraints() - MipNodeFeatures::supportedAccelerationConstraintOptions(), supportedVelocityConstraintOptions(), supportedAngularConstraintOptions() @@ -459,18 +473,18 @@ Forthcoming - Wheeled Vehicle Constraint Control (0x0D,0x63) - Added new Sample Rate type (decimation) to support inertial data sets with an unknown base rate (SampleRate::Decimation(), RateType::rateType_decimation) -57.2.2 - 2020-07-28 +## 57.2.2 - 2020-07-28 - Add additional options to following enums for new product support: - InertialTypes::GnssFixType - InertialTypes::FilterState - InertialTypes::FilterStatus_Running -57.2.1 - 2020-07-27 +## 57.2.1 - 2020-07-27 - Add support for MIP Commands: - Commanded Zero-Velocity Update (0x0D, 0x22) - Commanded Zero-Angular Rate Update (0x0D, 0x23) -57.2.0 - 2020-07-21 +## 57.2.0 - 2020-07-21 - Update GQ7 and RTK model numbers: - 3DM-GQ7: 6284 - RTK: 6285 @@ -486,10 +500,10 @@ Forthcoming - HeadingAlignmentOption (add HeadingAlignmentMethod view) - PpsInputOutput -57.1.4 - 2020-07-17 +## 57.1.4 - 2020-07-17 - MipCommand: allow function selector to be included for undefined commands despite being reported as 'not supported' -57.1.3 - 2020-07-15 +## 57.1.3 - 2020-07-15 - Fixed data response parsing for inertial commands: - Accel Bias (0x0C,0x37) - Gyro Bias (0x0C,0x38) @@ -497,36 +511,36 @@ Forthcoming - Magnetometer Hard Iron Offset (0x0C,0x3A) - updated inertial command Advanced Low-Pass Filter Settings (0x0C,0x50) to send 0 for cutoff frequency when automatic specified -57.1.2 - 2020-07-14 +## 57.1.2 - 2020-07-14 - Added response descriptor parameter to GenericMipCommand::Response constructor -57.1.1 - 2020-07-10 +## 57.1.1 - 2020-07-10 - Added support for MIP Commands: - Factory Streaming (0x0C,0x10): InertialNode::setFactoryStreamingChannels() - PPS Source (0x0C,0x28): InertialNode::get/setPpsSource() - PPS Output (0x0C,0x29): InertialNode::get/setPpsOutput() -57.1.0 - 2020-06-30 +## 57.1.0 - 2020-06-30 - Added support for existing GNSS MIP data fields for new GNSS data sets (0x91-95) - Fixed bug that prevented function selector byte being included in MIP packet when using MipCommand class for undefined command IDs -57.0.0 - 2020-06-29 +## 57.0.0 - 2020-06-29 - CHANGED constructor MipNodeInfo(MipDeviceInfo, vector, mscl::SampleRates, mscl::SampleRates, mscl::SampleRates) to MipNodeInfo(MipDeviceInfo, vector, map) to better support more possible supported data classes - Added data set descriptors for MIP data sets GNSS 1-5 (0x91-95) to MipTypes::DataClass and DescriptorSet - Add MipNodeFeatures::useLegacyIdsForEnableDataStream() to support parameter definition changes in the Data Stream Control command (0x0C, 0x11) -56.1.2 - 2020-06-19 +## 56.1.2 - 2020-06-19 - Add support for new generic Message Format (0x0C, 0x0F) and Get Base Rate (0x0C, 0x0E) MIP commands - Add function SampleRate::FromInertialRateDecimationInfo() to build a SampleRate object from base rate and rate decimation values -56.1.1 - 2020-06-19 +## 56.1.1 - 2020-06-19 - Added FilterInitializationValues::autoInitialize to support command definition change -56.0.1 - 2020-06-17 +## 56.0.1 - 2020-06-17 - Added support for RTK device type - Added support for Get RTK Device Status Flags (0x0F,0x01) -56.0.0 - 2020-05-28 +## 56.0.0 - 2020-05-28 - RENAMED InertialNode::get/setSensorToVehicleTransformation() to get/setSensorToVehicleRotation_eulerAngles() for accuracy - RENAMED MipTypes::Command::CMD_EF_SENS_VEHIC_FRAME_TRANS to CMD_EF_SENS_VEHIC_FRAME_ROTATION_EULER - Added support for commands: @@ -534,10 +548,10 @@ Forthcoming - Sensor to Vehicle Frame Rotation Quaternion (0x0D,0x4F) - Added class Quaternion (extends Matrix) -55.0.4 - 2020-05-21 +## 55.0.4 - 2020-05-21 - Added InertialNode::saveSettingsAsStartup that accepts a list of command IDs and saves only those specified -55.0.3 - 2020-05-21 +## 55.0.3 - 2020-05-21 - Added support for fields: - GNSS RTK Corrections Status (0x81,0x31) - GPS Ionospheric Correction (0x81,0x71) @@ -545,19 +559,19 @@ Forthcoming - GNSS Clock Info 2 (0x81,0x10) - GNSS GPS Leap Seconds (0x81,0x11) -55.0.2 - 2020-05-14 +## 55.0.2 - 2020-05-14 - Added support for fields: - AHRS Data: Raw Pressure (0x80, 0x16) - AHRS Data: Temperature Abs (0x80, 0x14) - Filter Data: Mag Bias (0x82, 0x1A) - Filter Data: Mag Bias Uncertainty (0x82, 0x1B) -55.0.1 - 2020-04-3 +## 55.0.1 - 2020-04-3 - Added asMap function for DeviceStatusData returned by the DeviceStatus command - returns a map of DeviceStatusValues and string values representing the device status - Added supportedStatusSelectors() to check which devices support diagnostic vs basic status data -55.0.0 - 2020-02-28 +## 55.0.0 - 2020-02-28 - CHANGED WirelessModels::NodeModel::node_ptLink200_gy to node_ptLink200 - CHANGED NodeFeatures_ptlink200_gy to NodeFeatures_ptlink200 - include new inertial filter settings commands to InertialNode::getConfigCommandBytes @@ -565,13 +579,13 @@ Forthcoming - Kinematic Constraint (0x0D,0x51) - Adaptive Filter Options (0x0D,0x53) -54.1.2 - 2020-02-27 +## 54.1.2 - 2020-02-27 - fix latitude/longitude switch in write Filter Initialization Config command (0x0D, 0x52) (GQ7) -54.1.1 - 2020-02-27 +## 54.1.1 - 2020-02-27 - Remove function selector from inertial Reset command (0x0D, 0x01) to avoid invalid parameter error -54.1.0 - 2020-02-17 +## 54.1.0 - 2020-02-17 - Added support for new inertial commands (GQ7) - Aiding Measurement Enable (0x0D,0x50) - Kinematic Constraint (0x0D,0x51) @@ -579,7 +593,7 @@ Forthcoming - Multi Antenna Offset (0x0D,0x54) - add generic functionality to MipCommand class to simplify adding new command support -54.0.0 - 2020-02-13 +## 54.0.0 - 2020-02-13 - CHANGED GeometricVector from a struct to a class - x, y, and z are now get/set functions, not public variables - added north, east, and down get/set functions @@ -591,65 +605,65 @@ Forthcoming - Added support for get/set Filter Initialization Config command (0x0D, 0x52) (GQ7) - Added heading accessor function to EulerAngles class - heading() and yaw() get/set the same value -53.1.0 - 2020-02-04 +## 53.1.0 - 2020-02-04 - Add ability to read factory calibration values (slope, offset, unit) on supported nodes (PT-Link-200-GY) -53.0.0 - 2020-01-09 +## 53.0.0 - 2020-01-09 - REMOVED support for the mV/V-Link (unreleased product) - REMOVED InputRangeMap InputRangeHelper::RANGES_MVPVLINK - CHANGED WirelessModels value 63250200 from node_mvPerVLink to node_ptLink200_gy - Add support for the PT-Link-200-GY -52.5.0 - 2020-01-06 +## 52.5.0 - 2020-01-06 - add InertialNode::isDataStreamEnabled() - command (0x0C, 0x11) function selector 0x02 (read current) -52.4.4 - 2019-12-18 +## 52.4.4 - 2019-12-18 - revert linux symlink port name resolution changes pending additional testing -52.4.3 - 2019-11-25 +## 52.4.3 - 2019-11-25 - resolve symlink port names for serial ports on linux -52.4.2 - 2019-11-20 +## 52.4.2 - 2019-11-20 - update ChannelFrequencyClass enum values (CFC Filter options EEPROM values) -52.4.1 - 2019-11-15 +## 52.4.1 - 2019-11-15 - update supported sample rates for G-Link-200-R -52.4.0 - 2019-11-15 +## 52.4.0 - 2019-11-15 - add support for G-Link-200-R - add support for CFC Filter Configuration option (G-Link-200-R only) -52.3.1 - 2019-10-09 +## 52.3.1 - 2019-10-09 - enabled support for poll command for V-Link-200 on firmware version 12.45139 and above -52.3.0 - 2019-09-09 +## 52.3.0 - 2019-09-09 - added Poll functionality for supported products -52.2.1 - 2019-09-03 +## 52.2.1 - 2019-09-03 - update jam files for static dependency support -52.2.0 - 2019-08-27 +## 52.2.0 - 2019-08-27 - InertialNode::setUARTBaudRate() - add optional parameter to prevent the serial connection automatically being closed and re-opened at the new baud rate - add 250 ms sleep between sending the command to the device and re-establishing port connection to account for the delay on the device -52.1.0 - 2019-08-20 +## 52.1.0 - 2019-08-20 - add ability to close and re-establish serial connections with an different baud rate via SerialConnection::updateBaudRate - automatically re-establish connection when inertial device baud rate is changed via InertialNode::setUARTBaudRate or InertialNode::sendCommandBytes - add missing type documentation to ExposedInertialTypes.h - add function selector 0x06 - USE_NEW_SETTINGS_NO_ACKNACK to MipTypes::FunctionSelector enum -52.0.0 - 2019-08-08 +## 52.0.0 - 2019-08-08 - updating to 52.0.0 which should have been done on the last commit due to the non-backwards compatible change - using the enum keyword for maps in the the SWIG interface to fix an issue with newer versions of SWIG -51.0.2 - 2019-08-07 +## 51.0.2 - 2019-08-07 - RENAMED captureTareOrientation to tareOrientation -51.0.1 - 2019-07-12 +## 51.0.1 - 2019-07-12 - fix for Sync Sampling network logic divide by 0.0 when no channels are active -51.0.0 - 2019-07-11 +## 51.0.0 - 2019-07-11 - had to move the following nested classes as SWIG wasn't generating these in Python - CHANGED PpsPulseInfo to be a standalone struct (previously nested in DeviceStatusData class) - CHANGED StreamInfo to be a standalone struct (previously nested in DeviceStatusData class) @@ -657,40 +671,40 @@ Forthcoming - CHANGED PortInfo to be a standalone struct (previously nested in DeviceStatusData class) - CHANGED TemperatureInfo to be a standalone struct (previously nested in DeviceStatusData class) -50.0.4 - 2019-07-11 +## 50.0.4 - 2019-07-11 - another fix for corrupted mip packet causing a crash when parsing fields -50.0.3 - 2019-07-08 +## 50.0.3 - 2019-07-08 - fix reply byte for Magnetometer Capture Auto Calibration command (0x0D, 0x27) -50.0.2 - 2019-07-08 +## 50.0.2 - 2019-07-08 - fix for corrupted mip packet causing a crash when parsing fields -50.0.1 - 2019-06-18 +## 50.0.1 - 2019-06-18 - added a hasValidFlag() function to the MipDataPoint class for checking if the point was received with a valid flag -50.0.0 - 2019-06-17 +## 50.0.0 - 2019-06-17 - CHANGED Inertial EF FilterStatus enum, as it was previously incorrect - InertialTypes::FilterStatus separated into FilterStatus_Running and FilterStatus_Initialization - Additional inertial data value enums added -49.0.4 - 2019-06-11 +## 49.0.4 - 2019-06-11 - add double support to Vector and Matrix classes - refactor Vector class to extend Matrix - allow vector DataPoint to be cast to matrix -49.0.3 - 2019-06-10 +## 49.0.3 - 2019-06-10 - add support for Magnetometer Capture Auto Calibration command (0x0D, 0x27) - add support for Tare Orientation command (0x0D, 0x21) -49.0.2 - 2019-06-04 +## 49.0.2 - 2019-06-04 - updated algorithm to convert GPS to UTC to get better resolution. -49.0.1 - 2019-06-04 +## 49.0.1 - 2019-06-04 - adding Timestamp::getLeapSeconds() and Timestamp::setLeapSeconds() functions for retrieving and adjusting the number of leap seconds between GPS and UTC time used by MSCLs conversion. -49.0.0 - 2019-06-04 +## 49.0.0 - 2019-06-04 - RENAMED MipDataPacket::utcTimestamp() to MipDataPacket::deviceTimestamp() - RENAMED MipDataPacket::utcTimeValid() to MipDataPacket::deviceTimeValid() - RENAMED MipDataPacket::utcTimeFlags() to MipDataPacket::deviceTimeFlags() @@ -699,208 +713,208 @@ Forthcoming - when deviceTimestamp fields are present, using this information to better set the MipDataPacket::collectedTimestamp() which helps prevent bunching up of points. -48.3.9 - 2019-05-20 +## 48.3.9 - 2019-05-20 - add support for MIP Device Status command (0x0C, 0x64) for additional model numbers (previously supported only GX5-45) -48.3.8 - 2019-05-13 +## 48.3.8 - 2019-05-13 - set timeout for Capture Gyro Bias command based on specified sampling time to allow for full 30 s range -48.3.7 - 2019-05-03 +## 48.3.7 - 2019-05-03 - removed MIP Channel sample rate validation - handle sample rates below 1 Hz for MIP channels (rate type seconds per sample instead of Hz) -48.3.6 - 2019-04-15 +## 48.3.6 - 2019-04-15 - added support for inertial command Get/Set Gravity Noise Minimum (0x0D, 0x2A) -48.3.5 - 2019-04-08 +## 48.3.5 - 2019-04-08 - update SHM-Link-201 and SHM-Link-210 Japan transmit powers -48.3.4 - 2019-04-08 +## 48.3.4 - 2019-04-08 - added Canada region code - updated transmit powers to the latest specifications -48.3.3 - 2019-04-04 +## 48.3.3 - 2019-04-04 - added support for inertial Enable/Disable Measurements command (0x0D, 0x41) -48.3.2 - 2019-04-03 +## 48.3.2 - 2019-04-03 - added support for inertial commands: - Signal Conditioning Settings (0x0C, 0x35) - Device Power States (0x0C, 0x61) - Device Data Stream Format (0x0C, 0x60) -48.3.1 - 2019-04-02 +## 48.3.1 - 2019-04-02 - added support for inertial GPS Dynamics Mode command (0x0C, 0x34) -48.3.0 - 2019-03-22 +## 48.3.0 - 2019-03-22 - added 15 dBm transmit power option - added new region code options - updated transmit powers to the latest specifications - consolidated transmit power logic into 1 file, as it was getting too complicated spread out across "Feature" classes -48.2.6 - 2019-03-12 +## 48.2.6 - 2019-03-12 - add function to InertialNode to send byte streams to node and listen for ACK/NACK response - fix bug in parsing GNSS Constellation Settings response data -48.2.5 - 2019-03-08 +## 48.2.5 - 2019-03-08 - add function to InertialNode to get byte streams needed to set current configuration -48.2.4 - 2019-03-04 +## 48.2.4 - 2019-03-04 - fix for incorrect input ranges for 40G G-Link-200-OEMs -48.2.3 - 2019-02-14 +## 48.2.3 - 2019-02-14 - fix for accel channels available for the SHM-Link-210 -48.2.2 - 2019-02-12 +## 48.2.2 - 2019-02-12 - made InertialNode::features() const -48.2.1 - 2019-02-11 +## 48.2.1 - 2019-02-11 - fix for not parsing LDC (Non-Sync) start command correctly -48.2.0 - 2019-02-11 +## 48.2.0 - 2019-02-11 - added WirelessNode::resendStartSyncSampling, an advanced command to resend just the Start Sync Sampling command to a pre-configured Node -48.1.0 - 2019-02-08 +## 48.1.0 - 2019-02-08 - added SyncNetworkInfo::startedSampling() for checking if a Node has successfully started sync sampling (response heard) -48.0.4 - 2019-02-01 +## 48.0.4 - 2019-02-01 - fix for raw debug data parser reporting duplicating data if not parsed by a device's data/command parser -48.0.3 - 2019-01-31 +## 48.0.3 - 2019-01-31 - support for fw 12.42801 on SG-Link-200 and SG-Link-200-OEM only allowing 1 low pass filter config -48.0.2 - 2019-01-24 +## 48.0.2 - 2019-01-24 - updated WirelessNodeConfig to allow unknown transmit power levels as long as they are below the max supported -48.0.1 - 2019-01-14 +## 48.0.1 - 2019-01-14 - fix for reading the excitation voltage from eeprom in WirelessNodeConfig::apply when not necessary -48.0.0 - 2019-01-07 +## 48.0.0 - 2019-01-07 - CHANGED input range enums for the RTD channels, as they were previously incorrect -47.1.2 - 2018-12-19 +## 47.1.2 - 2018-12-19 - added enums for diagnostic data fields -47.1.1 - 2018-12-18 +## 47.1.1 - 2018-12-18 - added sample rate restriction to SG-Link-200 -47.1.0 - 2018-12-05 +## 47.1.0 - 2018-12-05 - added low battery threshold configuration -47.0.5 - 2018-11-29 +## 47.0.5 - 2018-11-29 - include excitation voltage in auto cal parameters conditionally based on model and firmware version -47.0.4 - 2018-11-29 +## 47.0.4 - 2018-11-29 - add excitation voltage to auto cal parameters to support SG-Link-200-OEM -47.0.3 - 2018-11-20 +## 47.0.3 - 2018-11-20 - fix deadlock caused by locking comm protocol mutex earlier than necessary -47.0.2 - 2018-11-16 +## 47.0.2 - 2018-11-16 - added Connection::rawByteMode and Connection::debugMode "getter" functions - updated RTD-Link-200 max sample rate per adc channels/filter call - added Channel Mask error message for RTD-Link-200 and TC-Link-200 when low pass filter/sample rate/channel mask errors -47.0.1 - 2018-11-01 +## 47.0.1 - 2018-11-01 - fix for logic in determining max sample rate per low pass filter for the RTD-Link-200 -47.0.0 - 2018-10-31 +## 47.0.0 - 2018-10-31 - REMOVED NodeFeatures::minLowPassFilter -46.0.0 - 2018-10-30 +## 46.0.0 - 2018-10-30 - CHANGED NodeFeatures::maxSampleRateForLowPassFilter to take the active channel mask - restricting max sample rate per low pass filter for the TC-Link-200 and RTD-Link-200 -45.3.8 - 2018-10-24 +## 45.3.8 - 2018-10-24 - add additional inertial NodeModel values -45.3.7 - 2018-10-12 +## 45.3.7 - 2018-10-12 - add ConstellationId enum -45.3.6 - 2018-10-11 +## 45.3.6 - 2018-10-11 - fix for listInertialDevices not setting the type of connection - fix for warning on out of order initialization list -45.3.5 - 2018-10-04 +## 45.3.5 - 2018-10-04 - update IEPE-Link acceleration channel resolution to 23-bit -45.3.4 - 2018-10-02 +## 45.3.4 - 2018-10-02 - add IEPE-Link ADC and Gain Amplifier voltage reference feature values to support mV/g calibration -45.3.3 - 2018-10-01 +## 45.3.3 - 2018-10-01 - updated list of input ranges for TC-Link-200 and RTD-Link-200 -45.3.2 - 2018-09-28 +## 45.3.2 - 2018-09-28 - revisions to the names of Channel Groups and channel descriptions retrieved from NodeFeatures - fix for incorrect channel number for the RTD-Link-200 in the NodeFeatures -45.3.1 - 2018-09-26 +## 45.3.1 - 2018-09-26 - update for corrected calibration coefficient ch9-16 eeproms -45.3.0 - 2018-09-26 +## 45.3.0 - 2018-09-26 - initial support for TC-Link-200 - initial support for RTD-Link-200 - added NodeFeatures::transducerTypes() to get a list of supported transducer types -45.2.6 - 2018-09-24 +## 45.2.6 - 2018-09-24 - fix for crash/hang when closing a port (just in the last commit) -45.2.5 - 2018-09-24 +## 45.2.5 - 2018-09-24 - WirelessNodeConfig verifying calibrated float with angle mode, in all sampling modes - changed deprecated boost::io_service to boost::io_context -45.2.4 - 2018-09-11 +## 45.2.4 - 2018-09-11 - updates to Advanced Low-Pass Filter Settings command (0x0C, 0x50) -45.2.3 - 2018-09-07 +## 45.2.3 - 2018-09-07 - fix for Diagnostic Packet not updating the last state correctly -45.2.2 - 2018-09-07 +## 45.2.2 - 2018-09-07 - fix for never updating the WirelessNode last state to Sleep mode -45.2.1 - 2018-09-07 +## 45.2.1 - 2018-09-07 - fix for Set to Idle v2 not updating the WirelessNode last known state - fix for an Angle Mode configuration error for Nodes that don't support Angle Mode -45.2.0 - 2018-09-06 +## 45.2.0 - 2018-09-06 - added WirelessNode, InertialNode, and DisplacementNode lastDeviceState() functions to get the last known state that MSCL believes the device to be in, tracked by processing data and performing commands. -45.1.4 - 2018-09-05 +## 45.1.4 - 2018-09-05 - added new input range for SG-Link-200, SG-Link-200-OEM, and Torque-Link-200 -45.1.3 - 2018-08-31 +## 45.1.3 - 2018-08-31 - added support for inertial config command Set Reference Position (0x0D, 0x26) -45.1.2 - 2018-08-31 +## 45.1.2 - 2018-08-31 - fix for incorrectly labeling int16x10 data sweeps as not being calibrated -45.1.1 - 2018-08-30 +## 45.1.1 - 2018-08-30 - added missing SG-Link-Hermetic 2900 model number -45.1.0 - 2018-08-29 +## 45.1.0 - 2018-08-29 - support for SG-Link-200 -45.0.1 - 2018-08-29 +## 45.0.1 - 2018-08-29 - updated list of low pass filters for SHM-Link-210 -45.0.0 - 2018-08-29 +## 45.0.0 - 2018-08-29 - RENAMED WirelessTypes::sensorOutputMode_vibration to WirelessTypes::sensorOutputMode_accel - support for % memory full diagnostic packet -44.3.0 - 2018-08-28 +## 44.3.0 - 2018-08-28 - added support for inertial config command Soft Iron Matrix Process Noise (0x0D, 0x2C) -44.2.3 - 2018-08-27 +## 44.2.3 - 2018-08-27 - fixed build problem with vehicle dynamics - renamed fixed property of Geographic source to manual to remove warning -44.2.2 - 2018-08-27 +## 44.2.2 - 2018-08-27 - Added features call to find available vehicle dynamics modes by node -44.2.1 - 2018-08-24 +## 44.2.1 - 2018-08-24 - fix for missing excitation voltages from NodeFeatures for the SHM-Link-210 -44.2.0 - 2018-08-24 +## 44.2.0 - 2018-08-24 - added support for the following inertial config commands: - Magnetometer Noise Standard Deviation (0x0D, 0x42), Gravity Noise Standard Deviation (0x0D, 0x28), Accelerometer Noise Standard Deviation (0x0D, 0x1A), Gyroscope Noise Standard Deviation (0x0D, 0x1B) - Hard Iron Offset Process Noise (0x0D, 0x2B) @@ -908,115 +922,115 @@ Forthcoming - Accelerometer Bias Model Parameters (0x0D, 0x1C), Gyroscope Bias Model Parameters (0x0D, 0x1D) - created generic classes for inertial commands to get/set collections of GeometricVectors (floats x, y, z) and floats -44.1.0 - 2018-08-24 +## 44.1.0 - 2018-08-24 - basic support for the SHM-Link-210 models - support for parsing calibrated int16 x10 data types - support for configuring the data format for int16 x10 - verifying that 4-byte float is enabled when using angle fatigue modes -44.0.2 - 2018-08-16 +## 44.0.2 - 2018-08-16 - fix for comments for inertial commands Declination Source (0x0D, 0x43), Inclination Source (0x0D, 0x4C), and Magnetic Field Magnitude Source (0x0D, 0x4D) -44.0.1 - 2018-08-15 +## 44.0.1 - 2018-08-15 - checking for unsupported channels for derived categories in verifyConfig. -44.0.0 - 2018-08-15 +## 44.0.0 - 2018-08-15 - CHANGED NodeFeatures::derivedCategories() to NodeFeatures::channelsPerDerivedCategory() which returns a map of supported DerivedCategory to ChannelMask that it supports. - REMOVED WirelessTypes::DerivedCategories typedef as it is no longer used. -43.5.2 - 2018-08-13 +## 43.5.2 - 2018-08-13 - updated to Boost 1.68 -43.5.1 - 2018-08-10 +## 43.5.1 - 2018-08-10 - checking whether Sensor Output Mode is supported in the verify function of WirelessNodeConfig -43.5.0 - 2018-08-10 +## 43.5.0 - 2018-08-10 - added support for inertial commands Declination Source (0x0D, 0x43), Inclination Source (0x0D, 0x4C), and Magnetic Field Magnitude Source (0x0D, 0x4D) -43.4.1 - 2018-08-10 +## 43.4.1 - 2018-08-10 - support tilt mode on all G-Link-200 nodes -43.4.0 - 2018-08-10 +## 43.4.0 - 2018-08-10 - support for G-Link-200-8G tilt mode (get and set Sensor Output Mode) -43.3.0 - 2018-08-08 +## 43.3.0 - 2018-08-08 - added support for inertial config commands Gravity Magnitude (0x0D, 0x44), Magnetometer Magnitude (0x0D, 0x45), and Magnetometer Dip Angle (0x0D, 0x46) Error Adaptive Measurement - added function to inertial features to get the adaptive measurement modes supported by the node -43.2.4 - 2018-08-08 +## 43.2.4 - 2018-08-08 - fix for UpnpService/WsdaFinder crashing on exit in some scenarios -43.2.3 - 2018-08-06 +## 43.2.3 - 2018-08-06 - corrected formatting of estimation control data -43.2.2 - 2018-08-06 +## 43.2.2 - 2018-08-06 - commenting updates for estimation controls -43.2.1 - 2018-08-02 +## 43.2.1 - 2018-08-02 - fix for .NET build issue -43.2.0 - 2018-08-02 +## 43.2.0 - 2018-08-02 - added MipTypes::EstimationControlOption enum to represent available options for the Heading Update Control command - added function to MipNodeFeatures to get a list of supported estimation control options for the node (by model number) -43.1.0 - 2018-07-31 +## 43.1.0 - 2018-07-31 - allowing symbolic links to be passed to the Serial Connection constructors -43.0.3 - 2018-07-30 +## 43.0.3 - 2018-07-30 - corrected the available Heading Update Control enable options for 3DM-GX4-25 nodes -43.0.2 - 2018-07-23 +## 43.0.2 - 2018-07-23 - fix for .NET build issue -43.0.1 - 2018-07-23 +## 43.0.1 - 2018-07-23 - added function to MipNodeFeatures to get a list of supported heading update control options for the node (by model number) -43.0.0 - 2018-07-23 +## 43.0.0 - 2018-07-23 - CHANGED some WirelessTypes::InputRange enums -42.4.5 - 2018-07-20 +## 42.4.5 - 2018-07-20 - reverting to 42.4.3, previous revision needs to be significantly changed -42.4.4 - 2018-07-20 +## 42.4.4 - 2018-07-20 - added MipTypes::HeadingUpdateEnableOption enum to represent available options for the Heading Update Control command - added function to MipNodeFeatures to get a list of supported heading update control options for the node (by model number) -42.4.3 - 2018-07-20 +## 42.4.3 - 2018-07-20 - corrected parameter names in zero update commands -42.4.2 - 2018-07-20 +## 42.4.2 - 2018-07-20 - corrected styling and documentation for the zero update commands -42.4.1 - 2018-07-19 +## 42.4.1 - 2018-07-19 - changed name of new ADC input voltage type enum to be more general -42.4.0 - 2018-07-19 +## 42.4.0 - 2018-07-19 - added ADC input voltage type to wireless node features -42.3.1 - 2018-07-17 +## 42.3.1 - 2018-07-17 - increased BaseStation timeout for websocket connection after receiving a BaseStation received response -42.3.0 - 2018-07-16 +## 42.3.0 - 2018-07-16 - added commands to set and read velocity and angular rate zero update -42.2.1 - 2018-07-13 +## 42.2.1 - 2018-07-13 - clearing the cache of calibration offset eeproms when the high pass filter is written - changing the start sync sampling retry order to try all Nodes once, then go back and try all again -42.2.0 - 2018-07-12 +## 42.2.0 - 2018-07-12 - added commands to turn on and off altitude aiding and pitch/roll aiding -42.1.2 - 2018-07-06 +## 42.1.2 - 2018-07-06 - updated list of Input Ranges available for SG-Link-200-OEM -42.1.1 - 2018-07-05 +## 42.1.1 - 2018-07-05 - changed derived channels Sync formula to fix an issue where only derived data would get behind at 1hz -42.1.0 - 2018-06-28 +## 42.1.0 - 2018-06-28 - support for the Poll Data Inertial Commands -42.0.0 - 2018-06-22 +## 42.0.0 - 2018-06-22 - RENAMED WirelessTypes::DerivedChannelType to WirelessTypes::DerivedCategory - RENAMED WirelessTypes::DerivedChannelTypes to WirelessTypes::DerivedCategories - RENAMED channelPropertyId_derivedChannelType to channelPropertyId_derivedAlgorithmId @@ -1027,38 +1041,38 @@ Forthcoming - added WirelessTypes::DerivedDataPacketAlgorithmId which represents the actual algorithm ID of a channel - for example, the DerivedDataPacketAlgorithmId has IPS or mm/s while the DerivedCategory just has Velocity -41.0.10 - 2018-06-20 +## 41.0.10 - 2018-06-20 - reverting back to the code in 41.0.8, as we couldn't quite get the header only to work as we wanted -41.0.9 - 2018-06-19 +## 41.0.9 - 2018-06-19 - added BOOST_ERROR_CODE_HEADER_ONLY to remove the dependency on the Boost.System library for Asio -41.0.8 - 2018-06-13 +## 41.0.8 - 2018-06-13 - added event driven sampling as a supported mode for the TC-Link-200s - fix for .NET build not having mscl.MSCL_VERSION -41.0.7 - 2018-06-13 +## 41.0.7 - 2018-06-13 - added excitation voltage to the ShuntCalCmdInfo for Nodes that support it -41.0.6 - 2018-06-06 +## 41.0.6 - 2018-06-06 - reading adc and gain amplifier voltage refs from excitation voltage eeprom for SG-Link-200s -41.0.5 - 2018-06-06 +## 41.0.5 - 2018-06-06 - revised list of filters for SG-Link-200 -41.0.4 - 2018-06-05 +## 41.0.4 - 2018-06-05 - fix mismatched function signature for inputRanges -41.0.3 - 2018-06-05 +## 41.0.3 - 2018-06-05 - handle excitation voltage conditions in WirelessNodeConfig verification -41.0.2 - 2018-06-04 +## 41.0.2 - 2018-06-04 - fix incorrect eeprom lookup for reading/writing internal pull-up resistor -41.0.1 - 2018-05-31 +## 41.0.1 - 2018-05-31 - added sample rate restrictions per low pass filter for the SG-Link-200 -41.0.0 - 2018-05-30 +## 41.0.0 - 2018-05-30 - CHANGED NodeFeatures::excitationVoltage to WirelessNode::getExcitationVoltage - CHANGED NodeFeatures::adcVoltageRef to WirelessNode::getAdcVoltageRef - CHANGED NodeFeatures::gaVoltageRef to WirelessNode::getGainAmplifierVoltageRef @@ -1067,147 +1081,147 @@ Forthcoming - added support for getting list of supported excitation voltages for configuration - added getting supported input ranges per excitation voltage -40.0.0 - 2018-05-27 +## 40.0.0 - 2018-05-27 - CHANGED WirelessTypes::InputRangeEntry to InputRangeEntry (moved to the main mscl namespace) - CHANGED WirelessTypes::InputRanges to InputRanges (moved to the main mscl namespace) - revised list of low pass filters for TC-Link-200-OEM - added input ranges to the TC-Link-200-OEM -39.0.3 - 2018-05-22 +## 39.0.3 - 2018-05-22 - removing the max sample rate limitation from the SG-Link-200-OEM -39.0.2 - 2018-05-17 +## 39.0.2 - 2018-05-17 - fix for missing SG-Link-200-OEM features -39.0.1 - 2018-05-16 +## 39.0.1 - 2018-05-16 - fix for uninitialized MipDataPacket variables - updated to finalized TC-Link-200-OEM model numbers -39.0.0 - 2018-05-16 +## 39.0.0 - 2018-05-16 - made Pull-Up Resistor a channel group setting - CHANGED WirelessNode::getPullUpResistor to take a ChannelMask parameter - CHANGED WirelessNodeConfig::pullUpResistor functions to take a ChannelMask parameter -38.4.1 - 2018-05-15 +## 38.4.1 - 2018-05-15 - reverting the change made in 34.0.0 that reduced the amount of eeprom reads a Node requires when first communicating as it caused issues with MockNode which passed in a valid NodeInfo but was being ignored. -38.4.0 - 2018-05-15 +## 38.4.0 - 2018-05-15 - added configuration of Pull-Up Resistor - fix for max sample rate for 12.66hz low pass filter -38.3.4 - 2018-05-11 +## 38.3.4 - 2018-05-11 - added new uint16 from Node with 24-bit resolution data type for wireless packets -38.3.3 - 2018-05-10 +## 38.3.3 - 2018-05-10 - fix for TC-Link-200 missing channel setting for Low Pass Filter - added China region code -38.3.2 - 2018-05-10 +## 38.3.2 - 2018-05-10 - added new uint24 from Node with 24-bit resolution data type for wireless packets -38.3.1 - 2018-05-09 +## 38.3.1 - 2018-05-09 - updated list of supported sampling modes for SG-Link-200 -38.3.0 - 2018-05-09 +## 38.3.0 - 2018-05-09 - added NodeFeatures::minLowPassFilter() - added NodeFeatures::maxSampleRateForLowPassFilter() - new low pass filters for the TC-Link-200 - verifying low pass filter against the sample rate when verifying the WirelessNodeConfig -38.2.1 - 2018-05-02 +## 38.2.1 - 2018-05-02 - fix for missing information on SG-Link-200-OEM channels. -38.2.0 - 2018-05-01 +## 38.2.0 - 2018-05-01 - added debounce filter configuration for Wireless Nodes that support it. - updated TC-Link-200 sample rates. -38.1.2 - 2018-04-24 +## 38.1.2 - 2018-04-24 - add ohm units to WirelessTypes::CalCoef_Unit enum -38.1.1 - 2018-04-18 +## 38.1.1 - 2018-04-18 - change incorrect excitation voltage, ADC voltage reference, and gain amp voltage reference for SG-Link-Hermetic -38.1.0 - 2018-04-12 +## 38.1.0 - 2018-04-12 - support for TC-Link-200-OEM - support for configuration of TempSensorOptions (thermocouple, rtd, thermistor) -38.0.4 - 2018-04-10 +## 38.0.4 - 2018-04-10 - add/update ADC resolution, excitation voltage, ADC voltage reference, and gain amp voltage reference for some nodes/channels -38.0.3 - 2018-04-03 +## 38.0.3 - 2018-04-03 - add raw voltage units to WirelessTypes::CalCoef_Unit enum -38.0.2 - 2018-04-03 +## 38.0.2 - 2018-04-03 - fix for crash caused when download logged data from a Node that only has derived data on it. -38.0.1 - 2018-03-28 +## 38.0.1 - 2018-03-28 - added default constructor for struct WirelessTypes::InputRangeEntry -38.0.0 - 2018-03-28 +## 38.0.0 - 2018-03-28 - REMOVED NodeFeatures::isChannelSettingReadOnly() - CHANGED WirelessTypes::InputRanges (returned from NodeFeatures::inputRanges()) is now a vector of new struct WirelessTypes::InputRangeEntry - Added struct WirelessTypes::InputRangeEntry to access gain value with the associated WirelessTypes::InputRange - Added ADC resolution values to WirelessChannel per node channel (WirelessChannel::adcResolution() and WirelessChannel::adcMaxValue()) - Added excitation voltage, ADC voltage reference, and Gain Amplifier voltage reference to NodeFeatures for relevant nodes -37.0.0 - 2018-03-22 +## 37.0.0 - 2018-03-22 - REMOVED LibVersion class (use mscl::MSCL_VERSION instead) - fix for missing #include in Utils.h -36.1.2 - 2018-03-21 +## 36.1.2 - 2018-03-21 - fix for DatalogDownloader not finding end of data when a Node was 100% full. -36.1.1 - 2018-03-19 +## 36.1.1 - 2018-03-19 - fix for incorrect transmit powers for WSDA-200 and WSDA-2000 in LXRS+ mode. -36.1.0 - 2018-03-13 +## 36.1.0 - 2018-03-13 - support for more SG-Link-200-OEM model numbers. -36.0.1 - 2018-03-13 +## 36.0.1 - 2018-03-13 - fix for incorrect channel mask for channel group in SG-Link-200-OEM. -36.0.0 - 2018-03-13 +## 36.0.0 - 2018-03-13 - CHANGED input range enumerations to have more precise names. - initial support for the SG-Link-200-OEM. - updated more transmit powers for Japan. -35.2.1 - 2018-03-01 +## 35.2.1 - 2018-03-01 - updated transmit powers for Japan. -35.2.0 - 2018-02-27 +## 35.2.0 - 2018-02-27 - support for more G-Link-200-OEM model numbers. -35.1.8 - 2018-02-27 +## 35.1.8 - 2018-02-27 - changed maxBytesPerPacket for non-lossless. - dropped default Serial BaseStation timeout down to 20ms from 75ms. -35.1.7 - 2018-02-20 +## 35.1.7 - 2018-02-20 - added incrementing numbers to the Single-ended channel descriptions on the vlink200 for consistency -35.1.6 - 2018-02-13 +## 35.1.6 - 2018-02-13 - changed overhead factor for Nodes when lossless disabled and diagnostic packets enabled. -35.1.5 - 2018-02-08 +## 35.1.5 - 2018-02-08 - fix for build failing on C++11 compilers. -35.1.4 - 2018-02-08 +## 35.1.4 - 2018-02-08 - updated Japan transmit powers for certain devices. -35.1.3 - 2018-02-06 +## 35.1.3 - 2018-02-06 - added mscl.h which includes all the headers for the public interface. -35.1.2 - 2018-01-30 +## 35.1.2 - 2018-01-30 - fix for IEPE having incorrect ramBufferSize, causing maxBytesPerBurst to be incorrect. -35.1.1 - 2018-01-29 +## 35.1.1 - 2018-01-29 - fix for maxTransmitPower and minTransmitPower functions using device region code instead of passed in region code. -35.1.0 - 2018-01-26 +## 35.1.0 - 2018-01-26 - added NodeFeatures::maxTransmitPower and minTransmitPower. - added BaseStationFeatures::maxTransmitPower and minTransmitPower. -35.0.0 - 2018-01-26 +## 35.0.0 - 2018-01-26 - REMOVED WirelessTypes::maxTransmitPower(). - CHANGED NodeFeatures::transmitPowers() to take a WirelessTypes::CommProtocol argument. - CHANGED NodeFeatures::supportsTransmitPower() to take a WirelessTypes::CommProtocol argument. @@ -1215,81 +1229,81 @@ Forthcoming - CHANGED BaseStationFeatures::supportsTransmitPower() to take a WirelessTypes::CommProtocol argument. - different set of transmit powers in Japan for some products, depending on communication protocol. -34.0.7 - 2018-01-25 +## 34.0.7 - 2018-01-25 - update Base Received Response timeout logic. -34.0.6 - 2018-01-25 +## 34.0.6 - 2018-01-25 - fix for Node timeouts not always being set correctly. -34.0.5 - 2018-01-25 +## 34.0.5 - 2018-01-25 - setting tcp::no_delay(true) for TcpIpConnections to disable Nagle's Algorithm. -34.0.4 - 2018-01-24 +## 34.0.4 - 2018-01-24 - changed TcpIp connections deadline timer to 5 seconds. -34.0.3 - 2018-01-23 +## 34.0.3 - 2018-01-23 - TcpIp connections now use async_connect with a deadline timer of 3 seconds. -34.0.2 - 2018-01-23 +## 34.0.2 - 2018-01-23 - fix for crash when destroying WsdaFinder object before the initial UPnP thread was started. -34.0.1 - 2018-01-22 +## 34.0.1 - 2018-01-22 - fix for incorrect logic in determining Node timeout, causing failures on TCP connections with lots of latency. - changed default TCP connection timeout from 2 seconds to 500 milliseconds. -34.0.0 - 2018-01-12 +## 34.0.0 - 2018-01-12 - RENAMED MipDataPacket::timestamp() to MipDataPacket::collectedTimestamp() - added MipDataPacket::utcTimestamp() for when a UTC time is available from the data packet (currently just used by Displacement). - added DisplacementNode::setDeviceTime functions. - reduced the amount of eeprom reads a BaseStation and Node require when first communicating. - updated more transmit powers for Japan region for some products. -33.5.1 - 2018-01-10 +## 33.5.1 - 2018-01-10 - updated transmit powers for Japan region for some products. -33.5.0 - 2018-01-08 +## 33.5.0 - 2018-01-08 - added the WirelessNode updateEepromCacheFromNodeDiscovery function to import NodeDiscovery information into a Node's eeprom cache -33.4.6 - 2018-01-03 +## 33.4.6 - 2018-01-03 - support for Sleep v2 (ASPP 1.8) command. -33.4.5 - 2017-12-20 +## 33.4.5 - 2017-12-20 - revised logic for padding on timeout after receiving a BaseStation received response to avoid adding too much timeout to serial/usb connected BaseStations. - BaseStation constructor with no timeout now uses extended default timeout for TCP/WebSocket connections. -33.4.4 - 2017-12-20 +## 33.4.4 - 2017-12-20 - extended padding on timeout after receiving a BaseStation received response. -33.4.3 - 2017-12-19 +## 33.4.3 - 2017-12-19 - fix for getDisplacementOutputDataRate not waiting for data reply. -33.4.2 - 2017-12-19 +## 33.4.2 - 2017-12-19 - update for parsing Displacement model number strings. - update for Displacement model number enum identifier. -33.4.1 - 2017-12-14 +## 33.4.1 - 2017-12-14 - fix for DisplacementOutputDataRate parsing a uint16 instead of a uint32. -33.4.0 - 2017-12-14 +## 33.4.0 - 2017-12-14 - added DisplacementNode::getDisplacementOutputDataRate(). - added DisplacementNode::getAnalogToDisplacementCal(). - fix for Displacement model string to model enum failing. - added nack code to Error_MipCmdFailed string. -33.3.0 - 2017-12-12 +## 33.3.0 - 2017-12-12 - added optional interfaceAddress parameter to Connection::TcpIp. -33.2.0 - 2017-12-12 +## 33.2.0 - 2017-12-12 - added doCommand function to DisplacementNode class for performing advanced MIP commands. -33.1.0 - 2017-12-12 +## 33.1.0 - 2017-12-12 - added DisplacementNode class - support for parsing MIP packets from Displacement Nodes - support for basic MIP commands that Displacement Nodes will support -33.0.0 - 2017-12-08 +## 33.0.0 - 2017-12-08 - RENAMED Error_InertialCmdFailed to Error_MipCmdFailed. - RENAMED InertialTypes to MipTypes. - RENAMED InertialTypes::InertialCategory to MipTypes::DataClass. @@ -1324,121 +1338,121 @@ Forthcoming - CHANGED InertialDataEnums::HeadingSource to be nested under InertialTypes (InertialTypes::HeadingSource). - moved some files from Inertial folder to MIP folder, include paths in C++ may need to be updated. -32.8.3 - 2017-11-29 +## 32.8.3 - 2017-11-29 - removed channel 8 from SHM-Link-2 and SHM-Link-200. - added RF Sweep support for WSDA-2000 with latest firmware. -32.8.2 - 2017-11-27 +## 32.8.2 - 2017-11-27 - added rf sweep support to WSDA-200 for all firmware versions equal or above 5.39166 -32.8.1 - 2017-11-21 +## 32.8.1 - 2017-11-21 - fixed incorrect eeprom mapping for number of active gauges -32.8.0 - 2017-11-16 +## 32.8.0 - 2017-11-16 - added 3DM-GQ4-45 model number. -32.7.1 - 2017-11-15 +## 32.7.1 - 2017-11-15 - update for the features on the variety of SHM-Link-201s. -32.7.0 - 2017-11-14 +## 32.7.0 - 2017-11-14 - support for configuration of Gauge Resistance - support for configuration of Number of Active Gauges -32.6.1 - 2017-11-13 +## 32.6.1 - 2017-11-13 - ignoring eeprom read retry setting when determining protocols for WirelessNodes and BaseStations - including group read/page download as a retry itself when reading Node eeprom -32.6.0 - 2017-11-08 +## 32.6.0 - 2017-11-08 - Devices::listBaseStations now returns any WSDA-Pro devices connected via USB, with their IPV6 TCP address -32.5.0 - 2017-11-07 +## 32.5.0 - 2017-11-07 - initial support for the variety of SHM-Link-201s. -32.4.6 - 2017-11-01 +## 32.4.6 - 2017-11-01 - fix for incorrect model number for the WSDA-2000. -32.4.5 - 2017-10-27 +## 32.4.5 - 2017-10-27 - fixed a typo, and also a logic error in Constellationsettings. -32.4.4 - 2017-10-19 +## 32.4.4 - 2017-10-19 - fix for NodeFeatures::supportsNonSyncLogWithTimestamps() returning true even if the Node doesn't support logging. -32.4.3 - 2017-10-17 +## 32.4.3 - 2017-10-17 - fixed bad data being used in GNSS_SBASSettings. -32.4.2 - 2017-10-11 +## 32.4.2 - 2017-10-11 - fix for incorrect model number for SHM-Link-201. -32.4.1 - 2017-10-06 +## 32.4.1 - 2017-10-06 - fix for erroneous 910hz sample rate, changed to 887hz. -32.4.0 - 2017-10-04 +## 32.4.0 - 2017-10-04 - removed burst option from SHM-Link-201. - support for derived Mean channel. -32.3.0 - 2017-10-03 +## 32.3.0 - 2017-10-03 - added 910hz sample rate. -32.2.2 - 2017-10-02 +## 32.2.2 - 2017-10-02 - another fix for missing parameter in Linux Devices code. -32.2.1 - 2017-10-02 +## 32.2.1 - 2017-10-02 - fix for missing parameter in Linux Devices code. -32.2.0 - 2017-09-29 +## 32.2.0 - 2017-09-29 - support for 5 SHM-Link-201 SN-Curves -32.1.1 - 2017-09-28 +## 32.1.1 - 2017-09-28 - fix for AutoCal ASPP3 command sending invalid command packet. -32.1.0 - 2017-09-28 +## 32.1.0 - 2017-09-28 - support for WebSocket connections. - added requirement for OpenSSL - added requirement for Boost::Beast library -32.0.3 - 2017-09-21 +## 32.0.3 - 2017-09-21 - fix for eeprom caches being destroyed while other threads are using them causing a crash. - changed to just clearing the cache instead of destroying the object, since the cache uses a mutex internally anyway. - don't use group eeprom read if useEepromCache is set to false on the Node, since it just adds unnecessary overhead. -32.0.2 - 2017-09-20 +## 32.0.2 - 2017-09-20 - added mutex for eeprom cache access. -32.0.1 - 2017-09-19 +## 32.0.1 - 2017-09-19 - fix for Timestamps being calculated incorrectly with sample rates 1khz and above. - removed ch8 from SHM-Link-201. -32.0.0 - 2017-09-14 +## 32.0.0 - 2017-09-14 - consolidated AutoCalShmErrorFlag and AutoShuntCalErrorFlag into AutoCalErrorFlag. - CHANGED WirelessTypes::AutoCalShmErrorFlag to AutoCalErrorFlag. - CHANGED WirelessTypes::AutoShuntCalErrorFlag to AutoCalErrorFlag. -31.0.0 - 2017-09-13 +## 31.0.0 - 2017-09-13 - CHANGED NodeFeatures::supportsAutoCal() to supportsAutoCal_shm(). - added NodeFeatures::supportsAutoCal_shm201(). - added WirelessNode::autoCal_shmLink201(). -30.10.0 - 2017-09-13 +## 30.10.0 - 2017-09-13 - Put in code to send a save channel info call to the inertial device. -30.9.1 - 2017-09-08 +## 30.9.1 - 2017-09-08 - fix for Torque-Link using 12-bit resolution in autobalance when should be using 16-bit. -30.9.0 - 2017-09-05 +## 30.9.0 - 2017-09-05 - added new lowPassFilter options for the SHM-Link-201. - changed C++ Release build to not perform Whole Program Optimization. -30.8.1 - 2017-08-31 +## 30.8.1 - 2017-08-31 - fix for normalizeSensorDelay and the actual writing of sensor delay having mismatched logic. -30.8.0 - 2017-08-30 +## 30.8.0 - 2017-08-30 - Added DatalogDownloader::calCoefficientsUpdated() for just checking whether any cal coefficients have been updated since the last call to getNextData (similar to metaDataUpdated()). -30.7.0 - 2017-08-21 +## 30.7.0 - 2017-08-21 - Added HeadingUpdateControl, ExternalHeadingUpdate and ExternalHeadingUpdateWithTimestamp. -30.6.0 - 2017-08-18 +## 30.6.0 - 2017-08-18 - support for Mock WirelessNodes. - use BaseStation::Mock() to create a mock BaseStation. - use WirelessNode::Mock() to create a mock WirelessNode (pass in the mock BaseStation). @@ -1446,148 +1460,148 @@ Forthcoming - SyncSamplingNetwork can work with mock Nodes, which can be verified and applied (will write to eeprom cache). - use WirelessNode::getEepromCache() to get an map of the eeprom cache. -30.5.1 - 2017-08-16 +## 30.5.1 - 2017-08-16 - fix for incorrect parsing of derived sync data packets. -30.5.0 - 2017-08-16 +## 30.5.0 - 2017-08-16 - Added GNSS Source Control and External GNSS Update commands. -30.4.0 - 2017-08-16 +## 30.4.0 - 2017-08-16 - Added EstimationControlFlags, RawRTCM_2_3Message, and VehicleDynamicsMode -30.3.0 - 2017-08-15 +## 30.3.0 - 2017-08-15 - Added ComplementaryFilterSettings and DeviceStatus -30.2.0 - 2017-08-14 +## 30.2.0 - 2017-08-14 - Added UARTBaudRate and AdvancedLowPassFilterSettings -30.1.0 - 2017-08-11 +## 30.1.0 - 2017-08-11 - Added ConingAndScullingEnable and UARTBaudRate commands. -30.0.0 - 2017-08-10 +## 30.0.0 - 2017-08-10 - Added Magnetometer Hard Iron Offset and Magnetometer Soft Iron Matrix commands. - CHANGED Created a GeometricVector struct to replace the old typedef to a std::vector -29.5.0 - 2017-08-09 +## 29.5.0 - 2017-08-09 - Added Capture Gyro Bias command. -29.4.0 - 2017-08-08 +## 29.4.0 - 2017-08-08 - Added Gyro Bias command. -29.3.1 - 2017-08-07 +## 29.3.1 - 2017-08-07 - not clearing cache until after a write eeprom command has failed (instead of before performing it). -29.3.0 - 2017-08-04 +## 29.3.0 - 2017-08-04 - Added Accelerometer Bias command, added lots of comments to .h files. -29.2.0 - 2017-08-03 +## 29.2.0 - 2017-08-03 - Added GNSS Constellation settings command -29.1.0 - 2017-08-02 +## 29.1.0 - 2017-08-02 - Added SBAS settings command - refactored to collect changes for new commands to one place. -29.0.0 - 2017-07-31 +## 29.0.0 - 2017-07-31 - RENAMED WirelessModels::BaseModel::base_wsdaBase_oem to base_wsi_104. -28.1.0 - 2017-07-28 +## 28.1.0 - 2017-07-28 - Added new inertial sensor functionality. -28.0.0 - 2017-07-27 +## 28.0.0 - 2017-07-27 - RENAMED BaseStationFeatures::supportsCommProtocol to BaseStationFeatures::supportsCommunicationProtocol. - not writing comm protocol on the BaseStation unless it supports the comm protocol eeprom. - returning LXRS when reading the comm protocol for Nodes and BaseStation with old firmware that doesn't support it. -27.3.3 - 2017-07-26 +## 27.3.3 - 2017-07-26 - fix for incorrect resizing causing bad alloc when downloading logged data in some scenarios. -27.3.2 - 2017-07-25 +## 27.3.2 - 2017-07-25 - fix for BaseStation broadcastSetToIdle not working in LXRS+ mode. -27.3.1 - 2017-07-25 +## 27.3.1 - 2017-07-25 - updated WirelessParser to ignore ASPP packets found within potential other ASPP packets unless they are data packets or match a response to a command that we are expecting. -27.3.0 - 2017-07-24 +## 27.3.0 - 2017-07-24 - added advanced DatalogDownloader constructor that allows providing the start position and size of data if known. - added up to 3 retries for communication errors during applying (cycling power) for eeprom changes on Nodes and Bases. -27.2.4 - 2017-07-18 +## 27.2.4 - 2017-07-18 - fix for BaseStationFeatures::supportsRfSweepMode not being virtual, so classes failed to override it. -27.2.3 - 2017-07-17 +## 27.2.3 - 2017-07-17 - removed RF Sweep functionality from WSDA-200 USB (will add again once fully supported in firmware). - updated SHM Packet ASPP3 parsing. -27.2.2 - 2017-07-14 +## 27.2.2 - 2017-07-14 - no longer throwing exception for attempting to write the Comm Protocol to a Node that doesn't support configuring the protocol, if the protocol attempting to be written is the same as what it supports (old Nodes technically support LXRS only, but can't write it). -27.2.1 - 2017-07-13 +## 27.2.1 - 2017-07-13 - fix for main parser throwing away packets that erroneously thought were received before the command was sent. - fix for StartSyncSampling ASPP1 incorrectly matching response packet. -27.2.0 - 2017-07-12 +## 27.2.0 - 2017-07-12 - initial support for SHM-Link-201. -27.1.4 - 2017-07-07 +## 27.1.4 - 2017-07-07 - don't read sensor delay value if not needed for the current configuration. - allow reading of sensor delay even if configuration of it is not supported. -27.1.3 - 2017-07-07 +## 27.1.3 - 2017-07-07 - using filter settling time if present in the pendingConfig for SyncSamplingNetwork::addNode. - using sensor delay if present in the pendingConfig for SyncSamplingNetwork::addNode. - removed check for retransmission/lossless being disabled per Node in the SyncSamplingNetwork logic. -27.1.2 - 2017-06-28 +## 27.1.2 - 2017-06-28 - fix for Test Node Comm protocol saying unsupported by BaseStation when it was supported. -27.1.1 - 2017-06-28 +## 27.1.1 - 2017-06-28 - fix for exception not correct for testCommunicationProtocol WirelessNode function. -27.1.0 - 2017-06-28 +## 27.1.0 - 2017-06-28 - support for new Beacon Echo Packet. - added WirelessChannel::channel_beaconConflict. - changed a bunch of packet file/class names. -27.0.1 - 2017-06-27 +## 27.0.1 - 2017-06-27 - fix for DatalogDownloader::startOfSession being set incorrectly to true in some scenarios. -27.0.0 - 2017-06-27 +## 27.0.0 - 2017-06-27 - REMOVED DatalogDownloader::calsApplied (use LoggedDataSweep::calApplied instead). - added DatalogDownloader::metaDataUpdated function to know when meta data has been updated. - previously needed to use DatalogDownloader::startOfSession for this, which wasn't always correct. - use this in place of startOfSession - added LoggedDataSweep::calApplied. -26.0.8 - 2017-06-26 +## 26.0.8 - 2017-06-26 - fix for not setting the start of session flag when changing between raw and derived data during a datalog download with session headers. -26.0.7 - 2017-06-26 +## 26.0.7 - 2017-06-26 - fix for crash when parsing ASPP3 version of LDCMathPacket. -26.0.6 - 2017-06-26 +## 26.0.6 - 2017-06-26 - fix for allowing reading and writing eeproms outside the supported range for older Nodes and BaseStations (which wrapped around). - fix for incorrect payload size parsing of TestNodeCommProtocol ASPP3.X command. - throwing exception from WirelessNode::testCommunicationProtocol if BaseStation doesn't support it. - throwing exception from WirelessNode::testCommunicationProtocol if Node doesn't support it. -26.0.5 - 2017-06-14 +## 26.0.5 - 2017-06-14 - fix for incorrect parsing of timestamp in Sync Sampling ASPP3 packets. -26.0.4 - 2017-06-14 +## 26.0.4 - 2017-06-14 - added mutex for accessing communication protocol in the BaseStation. -26.0.3 - 2017-06-13 +## 26.0.3 - 2017-06-13 - fix for parsing Node Discovery v5 packets. -26.0.2 - 2017-06-13 +## 26.0.2 - 2017-06-13 - temporary change of LXRS+ sync network values. -26.0.1 - 2017-06-13 +## 26.0.1 - 2017-06-13 - fix for incorrect checksum in TestNodeCommProtocol ASPP1.X command. -26.0.0 - 2017-06-13 +## 26.0.0 - 2017-06-13 - REMOVED WirelessNodeConfig::verify() from public interface (use WirelessNode::verifyConfig() instead). - REMOVED WirelessNodeConfig::apply() from public interface (use WirelessNode::applyConfig() instead). - REMOVED BaseStationConfig::verify() from public interface (use BaseStation::verifyConfig() instead). @@ -1595,13 +1609,13 @@ Forthcoming - added WirelessNode::testCommunicationProtocol() - fix for BaseStation always reporting its original communication protocol even after changing it. -25.2.2 - 2017-06-13 +## 25.2.2 - 2017-06-13 - fix for Set to Idle incorrect response parsing. -25.2.1 - 2017-06-12 +## 25.2.1 - 2017-06-12 - fix for Base Reset ASPP3 incorrect command packet. -25.2.0 - 2017-06-12 +## 25.2.0 - 2017-06-12 - applying Communication Protocol in WirelessNodeConfig object. - added padding to Base Station initial response estimated time. - fix for GetDatalogSessionInfo ASPP3 incorrect command packet. @@ -1609,71 +1623,71 @@ Forthcoming - fix for Start Non Sync Sampling ASPP3 incorrect command packet. - fix for NaN percent complete when downloading data with no data on the Node. -25.1.1 - 2017-06-09 +## 25.1.1 - 2017-06-09 - fix for some values being uninitialized in the NodeDiscovery object. -25.1.0 - 2017-06-09 +## 25.1.0 - 2017-06-09 - parsing of BaseStation received responses for Node Commands. - this will, in theory, make commands fail faster when Nodes are out of range, off, or sleeping. -25.0.2 - 2017-06-09 +## 25.0.2 - 2017-06-09 - fix for some NodeDiscovery functions not being const, when they should be. -25.0.1 - 2017-06-08 +## 25.0.1 - 2017-06-08 - fix for commands sometimes causing a read access violation due to being destroyed prematurely. -25.0.0 - 2017-06-08 +## 25.0.0 - 2017-06-08 - REMOVED WirelessNode::quickPing as this feature is being removed from the Nodes. - use WirelessNode::ping instead. -24.3.3 - 2017-06-07 +## 24.3.3 - 2017-06-07 - fix for never choosing the ASPP 3.0 protocol even if EEPROM specified to do so. - fix for Sync network indicating 0% bandwidth when no raw channels, but derived channels enabled. - fix for some Sync formulas causing a divide by 0 crash. -24.3.2 - 2017-06-06 +## 24.3.2 - 2017-06-06 - treating a 2 in the Comm Protocol eeprom the same as LXRS+ (1). - treating any other (unsupported) values in the Comm Protocol eeprom the same as LXRS (0). - fix for listInertialNodes returning a list that may contain BaseStations. -24.3.1 - 2017-06-02 +## 24.3.1 - 2017-06-02 - fix for BaseStation and WirelessNode ping functions throwing exceptions when should be returning false. -24.3.0 - 2017-06-01 +## 24.3.0 - 2017-06-01 - added NodeFeatures::commProtocols to get a list of all communication protocols supported by the Node. -24.2.0 - 2017-06-01 +## 24.2.0 - 2017-06-01 - allow changing of commProtocol of SyncSamplingNetwork to get updated TDMA settings and bandwidth. - throw exception on SyncSamplingNetwork::applyConfiguration if commProtocol of Nodes or Base don't match the network. -24.1.1 - 2017-05-31 +## 24.1.1 - 2017-05-31 - not checking BaseStation ASPP version eeprom if firmware version indicates its not supported. -24.1.0 - 2017-05-30 +## 24.1.0 - 2017-05-30 - support for Node Batch EEPROM read (ASPP3). - major fix for ASPP1 commands sometimes being swapped with ASPP3. - fix for GetLoggedData command failing to parse success response. -24.0.0 - 2017-05-25 +## 24.0.0 - 2017-05-25 - CHANGED NodeFeatures::minTimeBetweenBursts to take an additional WirelessTypes::CommProtocol parameter. - CHANGED SyncSamplingNetwork's constructor to throw exceptions if can't communicate with the parent BaseStation. - Reads the parent BaseStation's CommProtocol setting which will be used for the entire network. - added WirelessNodeConfig::communicationProtocol (not fully functional yet). - updated Sync Sampling formula/network logic to handle LXRS+ mode. -23.1.2 - 2017-05-22 +## 23.1.2 - 2017-05-22 - refactoring some ASPP3 commands. -23.1.1 - 2017-05-22 +## 23.1.1 - 2017-05-22 - refactoring some ASPP3 commands. -23.1.0 - 2017-05-21 +## 23.1.0 - 2017-05-21 - added BaseStationFeatures::supportedCommProtocols() - added BaseStationFeatures::supportsCommProtocol() - added BaseStationConfig::communicationProtocol() for changing the active protocol. - refactored BaseStation commands for ASPP3. -23.0.0 - 2017-05-19 +## 23.0.0 - 2017-05-19 - CHANGED WirelessTypes::RadioMode to WirelessTypes::CommProtocol - radioMode_250kbps to commProtocol_lxrs - radioMode_2Mbps to commProtocol_lxrsPlus @@ -1683,227 +1697,227 @@ Forthcoming - CHANGED NodeDiscovery::asppVersion_250kbps to NodeDiscovery::asppVersion_lxrs - CHANGED NodeDiscovery::asppVersion_2Mbps to NodeDiscovery::asppVersion_lxrsPlus -22.1.0 - 2017-05-16 +## 22.1.0 - 2017-05-16 - support for NodeDiscovery Packet v5. -22.0.0 - 2017-05-16 +## 22.0.0 - 2017-05-16 - REMOVED SyncSamplingNetwork.highCapacity (feature no longer available, LXRS+ replacing soon). -21.7.1 - 2017-05-16 +## 21.7.1 - 2017-05-16 - support for new WSDA-200 USB model numbers -21.7.0 - 2017-05-16 +## 21.7.0 - 2017-05-16 - added support for ASPP 3.0 Beacon Echo packet. -21.6.0 - 2017-05-16 +## 21.6.0 - 2017-05-16 - added support for ASPP 3.0 Raw Strain packet. - added support for ASPP 3.0 Diagnostic packet. - added support for ASPP 3.0 RFSweep packet. -21.5.0 - 2017-05-16 +## 21.5.0 - 2017-05-16 - added support for ShmPacket v3 (ASPP 3.0). -21.4.0 - 2017-05-15 +## 21.4.0 - 2017-05-15 - added support for SyncSamplingMathPacket v2 (ASPP 3.0). -21.3.0 - 2017-05-15 +## 21.3.0 - 2017-05-15 - added support for SyncSamplingPacket v3 (ASPP 3.0). -21.2.0 - 2017-05-15 +## 21.2.0 - 2017-05-15 - added support for LdcMathPacket v2 (ASPP 3.0). -21.1.0 - 2017-05-15 +## 21.1.0 - 2017-05-15 - added support for LdcPacket v3 (ASPP 3.0). -21.0.35 - 2017-05-15 +## 21.0.35 - 2017-05-15 - using new broadcast address for broadcastSetToIdle when in 2Mbps mode. -21.0.34 - 2017-05-12 +## 21.0.34 - 2017-05-12 - support for Set to Idle v3 (ASPP 3.0). -21.0.33 - 2017-05-12 +## 21.0.33 - 2017-05-12 - support for Quick Ping v3 (ASPP 3.0). -21.0.32 - 2017-05-12 +## 21.0.32 - 2017-05-12 - support for BaseStation reset command (ASPP 3.0). -21.0.31 - 2017-05-11 +## 21.0.31 - 2017-05-11 - support for Get Beacon Status v2 (ASPP 3.0). -21.0.30 - 2017-05-11 +## 21.0.30 - 2017-05-11 - support for Enable/Disable Beacon v3 (ASPP 3.0). -21.0.29 - 2017-05-11 +## 21.0.29 - 2017-05-11 - support for Write Base Station EEPROM v3 (ASPP 3.0). -21.0.28 - 2017-05-11 +## 21.0.28 - 2017-05-11 - support for Read Base Station EEPROM v3 (ASPP 3.0). -21.0.27 - 2017-05-11 +## 21.0.27 - 2017-05-11 - support for Ping Base Station v3 (ASPP 3.0). -21.0.26 - 2017-05-11 +## 21.0.26 - 2017-05-11 - support for Start RF Sweep Mode v2 (ASPP 3.0). -21.0.25 - 2017-05-11 +## 21.0.25 - 2017-05-11 - support for WirelessNode reset command (cycle power and reset radio) (ASPP 3.0). -21.0.24 - 2017-05-10 +## 21.0.24 - 2017-05-10 - fix for radioMode not being cached on the BaseStation object. -21.0.23 - 2017-05-10 +## 21.0.23 - 2017-05-10 - enabled custom rf sweep mode for the WSDA-Base-200. -21.0.22 - 2017-05-09 +## 21.0.22 - 2017-05-09 - support for Get Diagnostic Info v2 (ASPP 3.0). -21.0.21 - 2017-05-09 +## 21.0.21 - 2017-05-09 - support for Auto-Cal v2 (ASPP 3.0). -21.0.20 - 2017-05-09 +## 21.0.20 - 2017-05-09 - simplified base and node commands code. -21.0.19 - 2017-05-08 +## 21.0.19 - 2017-05-08 - support for Auto Balance v3 (ASPP 3.0). -21.0.18 - 2017-05-08 +## 21.0.18 - 2017-05-08 - support for Erase v3 (ASPP 3.0). -21.0.17 - 2017-05-08 +## 21.0.17 - 2017-05-08 - support for Get Datalog Session Info v2 (ASPP 3.0). -21.0.16 - 2017-05-08 +## 21.0.16 - 2017-05-08 - support for Get Logged Data v2 (ASPP 3.0). -21.0.15 - 2017-05-05 +## 21.0.15 - 2017-05-05 - support for Start Non-Sync Sampling v3 (ASPP 3.0). -21.0.14 - 2017-05-05 +## 21.0.14 - 2017-05-05 - support for Start Sync Sampling v2 (ASPP 3.0). -21.0.13 - 2017-05-04 +## 21.0.13 - 2017-05-04 - support for Read Node Eeprom v3 (ASPP 3.0). - support for Write Node Eeprom v3 (ASPP 3.0). -21.0.12 - 2017-05-03 +## 21.0.12 - 2017-05-03 - support for Sleep v2 (ASPP 3.0). -21.0.11 - 2017-05-02 +## 21.0.11 - 2017-05-02 - support for reading RadioMode from BaseStations and Nodes. - protocols chosen correctly based on the RadioMode. -21.0.10 - 2017-04-27 +## 21.0.10 - 2017-04-27 - another fix for WsdaFinder crashing if fail to start UpnpService. -21.0.9 - 2017-04-27 +## 21.0.9 - 2017-04-27 - fix for WsdaFinder crashing if fail to start UpnpService. -21.0.8 - 2017-04-27 +## 21.0.8 - 2017-04-27 - added LongPing v2 (ASPP3.0 command). -21.0.7 - 2017-04-26 +## 21.0.7 - 2017-04-26 - initial support for generic parsing of ASPP 3.0 packets. - support for CRC Checksum calculations (for ASPP 3.0 packets). -21.0.6 - 2017-04-24 +## 21.0.6 - 2017-04-24 - finished moving more commands to use WirelessProtocol class (preparing for ASPP 3.0). -21.0.5 - 2017-04-24 +## 21.0.5 - 2017-04-24 - using WirelessProtocol class for more WirelessNode commands (preparing for ASPP 3.0). -21.0.4 - 2017-04-21 +## 21.0.4 - 2017-04-21 - fix for parsing of Node Quick Ping initial basestation response. - fix for referencing Firmware version instead of ASPP version for determining if Beacon Status is available. -21.0.3 - 2017-04-11 +## 21.0.3 - 2017-04-11 - made BaseStation.connection() const. -21.0.2 - 2017-04-07 +## 21.0.2 - 2017-04-07 - support for corrected SHM-Link-2 model number. -21.0.1 - 2017-04-06 +## 21.0.1 - 2017-04-06 - updated NodeAddress from uint16 to uint32 for future updates. -21.0.0 - 2017-03-28 +## 21.0.0 - 2017-03-28 - CHANGED Connection::Serial to attempt to automatically find/use the baud rate using Devices::listPorts if a baud rate is not specified in the function (instead of defaulting to 921600). -20.4.0 - 2017-03-24 +## 20.4.0 - 2017-03-24 - added InertialNode::connection function. -20.3.0 - 2017-03-23 +## 20.3.0 - 2017-03-23 - added a getRawBytesWithPattern function to the Connection class. -20.2.0 - 2017-03-17 +## 20.2.0 - 2017-03-17 - added a minBytes parameter to Connection::getRawBytes and getRawBytesStr functions. -20.1.0 - 2017-03-14 +## 20.1.0 - 2017-03-14 - added WirelessChannel::description() for getting a string description of the channel (ex "Acceleration X"). -20.0.1 - 2017-03-13 +## 20.0.1 - 2017-03-13 - added WirelessTypes::CalCoef_Unit::unit_force_kg. -20.0.0 - 2017-03-13 +## 20.0.0 - 2017-03-13 - CHANGED InertialNode::doInertialCmd() to no longer require a command ID parameter. - RENAMED InertialNode::doInertialCmd() to doCommand(). -19.7.0 - 2017-03-10 +## 19.7.0 - 2017-03-10 - added support for the 3DM-CV5 models. -19.6.1 - 2017-03-09 +## 19.6.1 - 2017-03-09 - made InertialNode::doInertialCmd public. -19.6.0 - 2017-03-09 +## 19.6.0 - 2017-03-09 - added 10G, 20G, and 40G as input ranges for the G-Link-200-40G. -19.5.0 - 2017-03-08 +## 19.5.0 - 2017-03-08 - added InertialNode::saveSettingsAsStartup function. - added InertialNode::loadStartupSettings function. - added InertialNode::loadFactoryDefaultSettings function. - changed InertialNode's default timeout to 250ms (from 100ms). -19.4.2 - 2017-03-08 +## 19.4.2 - 2017-03-08 - added support for logging and limited duration to SHM-Link-200 features. -19.4.1 - 2017-03-07 +## 19.4.1 - 2017-03-07 - added read only channel settings to SHM-Link-200 features. -19.4.0 - 2017-03-07 +## 19.4.0 - 2017-03-07 - added InertialNode cyclePower command. -19.3.1 - 2017-03-06 +## 19.3.1 - 2017-03-06 - fix for never identifying BaseStations as supporting ASPP v1.6. -19.3.0 - 2017-03-03 +## 19.3.0 - 2017-03-03 - verification of Timestamp bytes in Wireless Data Packets. - verification of Angle bytes in Wireless Data Packets. -19.2.4 - 2017-03-02 +## 19.2.4 - 2017-03-02 - fix for WirelessDataPoint initialization bug. -19.2.3 - 2017-03-02 +## 19.2.3 - 2017-03-02 - added Sync Event sampling mode to SHM-Link-200. -19.2.2 - 2017-03-02 +## 19.2.2 - 2017-03-02 - fix for datalogging download sometimes causing out of range exception. -19.2.1 - 2017-02-28 +## 19.2.1 - 2017-02-28 - changed DataPoint::ChannelProperties to a map instead of an unordered_map, which seems to fix a crash when receiving a ShmPacket and requesting a channel property. This is still a mystery as to why it was crashing, as it was on the map->find() line which is not supposed to throw an exception, but threw a vector::out_of_range -19.2.0 - 2017-02-27 +## 19.2.0 - 2017-02-27 - support for the new Internal Temperature field in Diagnostic Packets. -19.1.0 - 2017-02-24 +## 19.1.0 - 2017-02-24 - added BaseStationFeatures::supportsCustomRfSweepMode - added overloaded BaseStation::startRfSweepMode function -19.0.1 - 2017-02-23 +## 19.0.1 - 2017-02-23 - updated min user inactivity timeout to 30s. -19.0.0 - 2017-02-22 +## 19.0.0 - 2017-02-22 - RENAMED InertialDataEnums::GpsFixType to GnssFixType - RENAMED InertialTypes::CATEGORY_GPS to CATEGORY_GNSS - RENAMED InertialTypes::CMD_POLL_GPS_DATA to CMD_POLL_GNSS_DATA @@ -1927,7 +1941,7 @@ Forthcoming - RENAMED InertialTypes::CH_FIELD_ESTFILTER_GPS_ANTENNA_CORRECTION to CH_FIELD_ESTFILTER_GNSS_ANTENNA_CORRECTION - RENAMED InertialTypes::CH_FIELD_ESTFILTER_GPS_ANTENNA_CORRECTION_UNCERT to CH_FIELD_ESTFILTER_GNSS_ANTENNA_CORRECTION_UNCERT -18.0.0 - 2017-02-22 +## 18.0.0 - 2017-02-22 - REMOVED InertialDataPoint::str() - REMOVED InertialTypes::channelFieldToStr() - REMOVED InertialTypes::channelQualifierToStr() @@ -1937,13 +1951,13 @@ Forthcoming - Mag Auto Soft Iron Matrix (0x8226) - Mag Auto Soft Iron Matrix Uncertainty (0x8229) -17.1.1 - 2017-02-22 +## 17.1.1 - 2017-02-22 - fix for channelPropertyId_derivedChannelType throwing an invalid data type exception. -17.1.0 - 2017-02-21 +## 17.1.0 - 2017-02-21 - added DataPoint::channelPropertyId_derivedChannelType for getting the DerivedChannelType for a derived data point. -17.0.0 - 2017-02-21 +## 17.0.0 - 2017-02-21 - RENAMED WirelessTypes::DerivedChannel to DerivedChannelType. - RENAMED NodeFeatures::supportsDerivedChannel to supportsDerivedChannelType. - RENAMED NodeFeatures::derivedChannels to derivedChannelTypes. @@ -1955,30 +1969,30 @@ Forthcoming - added unit_velocity_inchesPerSec to WirelessTypes::CalCoef_Unit enums. - added dataMode_none to WirelessTypes::DataMode enums. -16.0.7 - 2017-02-20 +## 16.0.7 - 2017-02-20 - fix for exception when applying EventTrigger configuration if not all triggers set. -16.0.6 - 2017-02-17 +## 16.0.6 - 2017-02-17 - updated list of InertialTypes::Command enums. -16.0.5 - 2017-02-17 +## 16.0.5 - 2017-02-17 - using the Get Extended Device Descriptor Sets call when supported by the Inertial device. -16.0.4 - 2017-02-16 +## 16.0.4 - 2017-02-16 - fix for interacting with a BaseStation object after calling disconnect() on its connection causing a null pointer exception. -16.0.3 - 2017-02-16 +## 16.0.3 - 2017-02-16 - not performing retries when cycling power on the BaseStation (no response) - added checkComm boolean to BaseStation::cyclePower to allow not pinging after a cycle power. -16.0.2 - 2017-02-16 +## 16.0.2 - 2017-02-16 - updated list of low pass filters for G-Link-200. -16.0.1 - 2017-02-16 +## 16.0.1 - 2017-02-16 - moved WirelessDataPoint::channelProperty into its base class (DataPoint). -16.0.0 - 2017-02-15 +## 16.0.0 - 2017-02-15 - REMOVED InertialNode::info() - (functionality moved to InertialNode) - REMOVED public version of InertialNodeInfo class @@ -1997,18 +2011,18 @@ Forthcoming - added InertialNodeFeatures::supportedChannelFields() - added InertialNodeFeatures::supportedSampleRates() -15.2.0 - 2017-02-13 +## 15.2.0 - 2017-02-13 - added channelPropertyId_derivedFrom to be used with the WirelessDataPoint::channelProperty which provides the ChannelMask that math channels are derived from. -15.1.1 - 2017-02-09 +## 15.1.1 - 2017-02-09 - fix for not checking some config cases for Data Mode in some scenarios. -15.1.0 - 2017-02-09 +## 15.1.0 - 2017-02-09 - added NodeFeatures function for checking if any of the raw data modes are available. - added NodeFeatures function for checking if any of the derived data modes are available. -15.0.0 - 2017-02-08 +## 15.0.0 - 2017-02-08 - REMOVED DataMode class. - CHANGED WirelessNode::getDataMode function to return a WirelessTypes::DataMode enum. - CHANGED WirelessNodeConfig::dataMode functions to take/return a WirelessTypes::DataMode enum. @@ -2022,205 +2036,205 @@ Forthcoming - added NodeFeatures::dataModes function. - added NodeFeatures::supportsDataMode function. -14.4.2 - 2017-02-07 +## 14.4.2 - 2017-02-07 - same bit shifting fix as below, but with datalogging. -14.4.1 - 2017-02-07 +## 14.4.1 - 2017-02-07 - fix for shifting bits for int16 values from a 20-bit (really 22-bit) data type. -14.4.0 - 2017-02-01 +## 14.4.0 - 2017-02-01 - support for Derived + Raw channel downloading. -14.3.4 - 2017-01-31 +## 14.3.4 - 2017-01-31 - update for Set to Idle v2 command. - fix for Quick Ping v2 command. -14.3.3 - 2017-01-30 +## 14.3.3 - 2017-01-30 - fix for TDMA calculations for Nodes with 512Hz sample rate. -14.3.2 - 2017-01-27 +## 14.3.2 - 2017-01-27 - enabling hardware flow control when needed. - fix for Node Quick Ping v2 command packet. -14.3.1 - 2017-01-27 +## 14.3.1 - 2017-01-27 - fix for SWIG not knowing about WirelessNode::startNonSyncSampling exceptions. -14.3.0 - 2017-01-25 +## 14.3.0 - 2017-01-25 - support for Synchronization Info diagnostic data. -14.2.1 - 2017-01-24 +## 14.2.1 - 2017-01-24 - added storage mode configuration to the G-Link-200 nodes. -14.2.0 - 2017-01-24 +## 14.2.0 - 2017-01-24 - support for the WSDA-200 model number. - support for enumerating WSDA-200's via Devices::listBaseStations. - added DeviceInfo::baudRate() for getting the suggested baud rate. -14.1.0 - 2017-01-24 +## 14.1.0 - 2017-01-24 - support for setting up Derived channels in Sync Sampling networks (TDMA logic). -14.0.5 - 2017-01-19 +## 14.0.5 - 2017-01-19 - adding sync event driven to supported sampling modes for G-Link-200 -14.0.4 - 2017-01-17 +## 14.0.4 - 2017-01-17 - fix for checking derived sample rate when derived mode isn't active. -14.0.3 - 2017-01-17 +## 14.0.3 - 2017-01-17 - updated model numbers for G-Link-200-8g and G-Link-200-40g (again). -14.0.2 - 2017-01-17 +## 14.0.2 - 2017-01-17 - added real model numbers for G-Link-200-8g and G-Link-200-40g. -14.0.1 - 2017-01-17 +## 14.0.1 - 2017-01-17 - fix bug from 13.15.3. -14.0.0 - 2017-01-12 +## 14.0.0 - 2017-01-12 - RENAMED ConfigIssue::CONFIG_DERIVED_SAMPLE_RATE to CONFIG_DERIVED_DATA_RATE. - RENAMED WirelessNodeConfig::derivedChannelsSampleRate to derivedDataRate. - RENAMED NodeFeatures::derivedChannelSampleRates to derivedDataRates. - RENAMED WirelessNode::getDerivedChannelsSampleRate to getDerivedDataRate. - verifying Derived Data rate is 32x slower than raw sample rate. -13.15.5 - 2017-01-12 +## 13.15.5 - 2017-01-12 - WirelessNodeConfig::verifyConfig checks for non-supported derived channels. - WirelessNodeConfig::verifyConfig checks for data modes enabled without active channels. -13.15.4 - 2017-01-10 +## 13.15.4 - 2017-01-10 - increased duration between sending start LDC v1 retries. -13.15.3 - 2017-01-10 +## 13.15.3 - 2017-01-10 - fix for different packets with their own tick causing duplicate packet check errors. - verification of bytes in Math packets. -13.15.2 - 2017-01-09 +## 13.15.2 - 2017-01-09 - update for parsing Sync and LDC Math packets. -13.15.1 - 2017-01-06 +## 13.15.1 - 2017-01-06 - added 3DM-GX5 model numbers. - fixed G-Link-200 sample rates to max at 4096hz. -13.15.0 - 2017-01-05 +## 13.15.0 - 2017-01-05 - added NodeFeatures::supportsRawDataMode. - WirelessNodeConfig::verify will no longer given an error if just setting raw mode and raw mode is enabled (legacy Nodes). -13.14.0 - 2017-01-04 +## 13.14.0 - 2017-01-04 - added support for High-Pass Filter configuration. -13.13.1 - 2017-01-03 +## 13.13.1 - 2017-01-03 - updated Japan transmit powers for V-Link-200. - updated Japan transmit powers for G-Link-200. -13.13.0 - 2017-01-03 +## 13.13.0 - 2017-01-03 - added support for configuration of DataMode (raw vs derived). - added support for configuration of Derived Channels' Sample Rate. - added support for configuration of Derived Channels' Channel Masks. -13.12.5 - 2016-12-27 +## 13.12.5 - 2016-12-27 - fix for parsing g-link 200 int16 ota type -13.12.4 - 2016-12-22 +## 13.12.4 - 2016-12-22 - expand available g-link 200 sample rates (copied from v-link 200) -13.12.3 - 2016-12-21 +## 13.12.3 - 2016-12-21 - fix eeprom values for WirelessTypes::InputRange::range_2G/4G/8G to agree with Jeff Tonn -13.12.2 - 2016-12-19 +## 13.12.2 - 2016-12-19 - updated Japan accepted transmit powers for SHM-Link-2. -13.12.1 - 2016-12-14 +## 13.12.1 - 2016-12-14 - updated datalog download of Math Channels. -13.12.0 - 2016-12-14 +## 13.12.0 - 2016-12-14 - support for Set to Idle v2. -13.11.1 - 2016-12-14 +## 13.11.1 - 2016-12-14 - updated short ping command. -13.11.0 - 2016-12-13 +## 13.11.0 - 2016-12-13 - added support for low-pass filter configuration. - added support for G-Link-200 input range configuration. -13.10.0 - 2016-12-12 +## 13.10.0 - 2016-12-12 - added support for int24 data type (configuration and data parsing). - added support for int16 data type (configuration and data parsing). -13.9.0 - 2016-12-07 +## 13.9.0 - 2016-12-07 - added support for downloading logged math channel data. -13.8.2 - 2016-12-06 +## 13.8.2 - 2016-12-06 - added Sync Sampling as supported mode for SHM-Link-200. -13.8.1 - 2016-11-17 +## 13.8.1 - 2016-11-17 - fix for unused local variable error. - added up to 16 channels for math ids. -13.8.0 - 2016-11-17 +## 13.8.0 - 2016-11-17 - added support for Non-Sync Sampling math data packet. -13.7.0 - 2016-11-16 +## 13.7.0 - 2016-11-16 - added support for Sync Sampling math data packet. -13.6.0 - 2016-11-14 +## 13.6.0 - 2016-11-14 - added BaseStation::regionCode function. -13.5.5 - 2016-11-14 +## 13.5.5 - 2016-11-14 - fix for invalid parsing of HclSmartBearing Cal Packet channel data. -13.5.4 - 2016-11-11 +## 13.5.4 - 2016-11-11 - supporting multiple sweeps in HclSmartBearing Cal Packet. -13.5.3 - 2016-11-09 +## 13.5.3 - 2016-11-09 - updated sample rates for SHM-Link-200. -13.5.2 - 2016-11-03 +## 13.5.2 - 2016-11-03 - fix for BaseStation read/write eeprom never retrying even if specified by user. -13.5.1 - 2016-11-03 +## 13.5.1 - 2016-11-03 - fix for SHM-Link-200 not using the correct NodeFeatures class. -13.5.0 - 2016-11-02 +## 13.5.0 - 2016-11-02 - basic support for SHM-Link-200. -13.4.1 - 2016-11-01 +## 13.4.1 - 2016-11-01 - pinging Base Station before WirelessNode setToIdle. - will now throw Error_Communication exception if ping fails (after 5 retries). - extended default Base Station timeout to 75ms from 50ms. - reduced amount of time between each byte sent when canceling set to idle. -13.4.0 - 2016-10-25 +## 13.4.0 - 2016-10-25 - added BaseStation::broadcastSetToIdle command. -13.3.0 - 2016-10-19 +## 13.3.0 - 2016-10-19 - added WirelessNode::percentFull to get the percent of datalogging memory that is filled. -13.2.1 - 2016-10-18 +## 13.2.1 - 2016-10-18 - fix for memory exception when WirelessNode or BaseStation reading/writing eeproms while also attempting to determine protocol version (in another thread). -13.2.0 - 2016-10-13 +## 13.2.0 - 2016-10-13 - WirelessNode::applyConfig no longer cycles power/radio if eeprom's weren't actually changed (due to cache). - BaseStation::applyConfig no longer cycles power/radio if eeprom's weren't actually changed (due to cache). -13.1.1 - 2016-10-13 +## 13.1.1 - 2016-10-13 - fix for datalogging download v1 erroneously parsing data when retrying after a communication exception. -13.1.0 - 2016-10-12 +## 13.1.0 - 2016-10-12 - attempting to read ASPP version off of Node if available instead of using FW version. - clearing internal NodeInfo and NodeFeatures when clearEepromCache is called in case eeproms changed. -13.0.4 - 2016-10-11 +## 13.0.4 - 2016-10-11 - updated legacy Sync network offset -13.0.3 - 2016-10-06 +## 13.0.3 - 2016-10-06 - fix for datalog downloading v2 using incorrect flash sizes for Nodes. -13.0.2 - 2016-10-04 +## 13.0.2 - 2016-10-04 - fix for datalog downloading v2 failing to verify checksum correctly. -13.0.1 - 2016-09-29 +## 13.0.1 - 2016-09-29 - fix for NodeFeatures::supportsFlashId returning true when the node doesn't support logging. -13.0.0 - 2016-09-27 +## 13.0.0 - 2016-09-27 - CHANGED NodeFeatures::sampleRates to take a dataCollectionMethod parameter which also affects the list of sample rates available. - CHANGED NodeFeatures::supportsSamplingRate to take a dataCollectionMethod parameter as well. - CHANGED NodeFeatures::maxSampleRate to take a dataCollectionMethod parameter as well. @@ -2229,55 +2243,55 @@ Forthcoming - added check for flash bandwidth in WirelessNodeConfig's verifyConfig when applicable. - fix for V-Link-200 and Wireless-Impact-Sensor sample rates being incorrect. -12.2.1 - 2016-09-23 +## 12.2.1 - 2016-09-23 - updated list of V-Link-200 anti-aliasing filters. -12.2.0 - 2016-09-22 +## 12.2.0 - 2016-09-22 - added a debug mode option to the Connection class to allow getting all bytes read and written to the connection via the MSCL instance. -12.1.1 - 2016-09-21 +## 12.1.1 - 2016-09-21 - updated v-link-200 available storage limit modes. -12.1.0 - 2016-09-21 +## 12.1.0 - 2016-09-21 - added 300Hz sample rate. - updated SHM-Link-2 features to support 300Hz. -12.0.0 - 2016-09-20 +## 12.0.0 - 2016-09-20 - CHANGED WirelessTypes::AutoCalErrorFlag to WirelessTypes::AutoCalShmErrorFlag. - added WirelessTypes::AutoShuntCalErrorFlag. - added baseline and shunt values to the data read from the AutoShuntCal response. -11.0.1 - 2016-09-19 +## 11.0.1 - 2016-09-19 - fix for using floating point event duration when shouldn't, and vice-versa (inversed logic). -11.0.0 - 2016-09-14 +## 11.0.0 - 2016-09-14 - MOVED WsdaInfo class outside of the WsdaFinder class (no longer nested). -10.4.2 - 2016-09-13 +## 10.4.2 - 2016-09-13 - checking that event driven sampling cannot be configured with transmit only when verifying config settings. -10.4.1 - 2016-09-12 +## 10.4.1 - 2016-09-12 - added missing ShuntCalCmdInfo useInternalShunt field and using in command. - added new microcontroller types. -10.4.0 - 2016-09-12 +## 10.4.0 - 2016-09-12 - added NodeFeatures::supportsNonSyncLogWithTimestamps() -10.3.0 - 2016-09-12 +## 10.3.0 - 2016-09-12 - support for startNonSyncSampling v2 on supported Nodes. - removed Event Driven Non-Sync support from the list of sampling modes for V-Link and Wireless-Impact Sensor. -10.2.0 - 2016-09-09 +## 10.2.0 - 2016-09-09 - support for the WirelessNode getDiagnosticInfo command. - added range_invalid to the input range enum list. - added eepromLocation function to the ChannelGroup class. -10.1.0 - 2016-09-08 +## 10.1.0 - 2016-09-08 - added parsing for new Diagnostic packet channels. - fix for SG-Link not working with Input Range. - added missing input range to the SHM-Link. -10.0.0 - 2016-09-07 +## 10.0.0 - 2016-09-07 - added WirelessNode::autoShuntCal functionality for supported Nodes. - changed from hardware gain interface to input range interface. - CHANGED ConfigOption::CONFIG_HARDWARE_GAIN to ConfigOption::CONFIG_INPUT_RANGE. @@ -2291,84 +2305,84 @@ Forthcoming - CHANGED NodeFeatures::supportsShuntCal to NodeFeatures::supportsLegacyShuntCal. - added Single ended channels to V-Link-200. -9.1.2 - 2016-09-06 +## 9.1.2 - 2016-09-06 - fix for crash during datalog download. -9.1.1 - 2016-08-31 +## 9.1.1 - 2016-08-31 - fix for uint24s in datalog data being built incorrectly. -9.1.0 - 2016-08-31 +## 9.1.0 - 2016-08-31 - added upnp WSDA discovery support (Windows & C++ only for now). - removed unused SG-Link-8ch -9.0.1 - 2016-08-29 +## 9.0.1 - 2016-08-29 - added a minimum timeout of 200ms to the dataloginfo command. -9.0.0 - 2016-08-23 +## 9.0.0 - 2016-08-23 - CHANGED EventTriggerOptions trigger value's to be floats. (Instead of the bits value, this value is now set using the cal coefficients that are set on the Node, or that will be set if changing together in WirelessNodeConfig). -8.0.2 - 2016-08-22 +## 8.0.2 - 2016-08-22 - fix for bugs found using PVS-Studio. -8.0.1 - 2016-08-18 +## 8.0.1 - 2016-08-18 - added more model number for the V-Link 200. -8.0.0 - 2016-08-18 +## 8.0.0 - 2016-08-18 - support for configuring data format of uint24 for supported Nodes. - CHANGED WirelessTypes::DataFormat::dataFormat_2byte_uint to dataFormat_raw_uint16 - CHANGED WirelessTypes::DataFormat::dataFormat_4byte_float to dataFormat_cal_float -7.4.0 - 2016-08-16 +## 7.4.0 - 2016-08-16 - support for 256hz sample rate with SHM-Link-2 node with new firmware. -7.3.0 - 2016-08-16 +## 7.3.0 - 2016-08-16 - support for parsing uint16 (18-bit truncated) data types in Wireless packets. -7.2.0 - 2016-08-16 +## 7.2.0 - 2016-08-16 - support for parsing uint24 data types in Wireless packets. -7.1.10 - 2016-08-15 +## 7.1.10 - 2016-08-15 - fix for HCL Calibrated Packet parser storing temperature in incorrect data type -7.1.9 - 2016-08-11 +## 7.1.9 - 2016-08-11 - updated HCL Calibrated Packet parser. -7.1.8 - 2016-08-11 +## 7.1.8 - 2016-08-11 - using std::chrono::high_resolution_clock instead of boost::chrono::high_resolution_clock. - can do this now because supposedly Microsoft fixed a bug in VS2015 where high_resolution_clock was compiling as a system_clock. - now only dependent on boost/system as a library (for asio). All other boost includes are header only. -7.1.7 - 2016-08-10 +## 7.1.7 - 2016-08-10 - building with VS2015 (upgraded from 2013) -7.1.6 - 2016-08-09 +## 7.1.6 - 2016-08-09 - waiting longer after resetting Node radio before continuing - adding up to 3 retries to ping before autobalance -7.1.5 - 2016-08-05 +## 7.1.5 - 2016-08-05 - support for HCL Smart Bearing - Calibrated packet. -7.1.4 - 2016-07-29 +## 7.1.4 - 2016-07-29 - autobalance command returns a warning if the target percentage is off by more than 5% - Note that this logic is only for autobalance v1, and v2 nodes return this warning themselves -7.1.3 - 2016-07-27 +## 7.1.3 - 2016-07-27 - added minimum timeout of 600ms for the AutoBalance v2 response. -7.1.2 - 2016-07-26 +## 7.1.2 - 2016-07-26 - simplified the Wireless SetToIdle response parser. -7.1.1 - 2016-07-26 +## 7.1.1 - 2016-07-26 - fix for Sensor Delay not writing the Sensor Always On value correctly. -7.1.0 - 2016-07-25 +## 7.1.0 - 2016-07-25 - added support for Sensor Delay configuration. -7.0.1 - 2016-07-15 +## 7.0.1 - 2016-07-15 - renamed node to Wireless Impact Sensor. -7.0.0 - 2016-07-14 +## 7.0.0 - 2016-07-14 - CHANGED ConfigOption::CONFIG_LOW_PASS_FILTER to ConfigOption::CONFIG_ANTI_ALIASING_FILTER. - CHANGED WirelessNodeConfig::lowPassFilter functions to WirelessNodeConfig::antiAliasingFilter. - CHANGED NodeFeatures::supportsLowPassFilter to NodeFeatures::supportsAntiAliasingFilter. @@ -2376,138 +2390,138 @@ Forthcoming - CHANGED WirelessTypes::ChannelGroupSetting::chSetting_lowPassFilter to WirelessTypes::ChannelGroupSetting::chSetting_antiAliasingFilter - CHANGED NodeModel::node_vLink2 to NodeModel::node_vLink200. -6.1.3 - 2016-07-13 +## 6.1.3 - 2016-07-13 - fixed a bug in Datalog Download not stopping when it should (error calculating bytes remaining). - fixed a bug in Datalog Download reading out of range for checksums in some cases. -6.1.2 - 2016-07-13 +## 6.1.2 - 2016-07-13 - fixed a bug in Datalog Download where cal coefficients would never get updated between sessions. -6.1.1 - 2016-07-12 +## 6.1.1 - 2016-07-12 - fixed a bug in Sync Sampling logic allowing nodes with 100.1 percent bandwidth to get slots and the network reporting OK. - added logic where nodes in a Legacy Sync network cannot get assigned the last 8 slots. -6.1.0 - 2016-07-08 +## 6.1.0 - 2016-07-08 - updated to new download data packet (102 bytes instead of 100). -6.0.0 - 2016-07-08 +## 6.0.0 - 2016-07-08 - REMOVED DeviceInfo.status() as it was not always reliable and not available for new CP210x driver. - REMOVED DeviceInfo.DeviceStatus enum. - added DeviceInfo.description(). - changed how devices are discovered on Windows again to support new CP210x driver. -5.4.5 - 2016-07-07 +## 5.4.5 - 2016-07-07 - fix for incorrectly checking for active channels in DatalogDownloader. -5.4.4 - 2016-07-07 +## 5.4.4 - 2016-07-07 - fix for accidental commit of non-working device discovery code. -5.4.3 - 2016-07-01 +## 5.4.3 - 2016-07-01 - fix for datalog download skipping data. -5.4.2 - 2016-06-30 +## 5.4.2 - 2016-06-30 - changed how devices are discovered on Windows - This is an attempt to fix a bug where devices are not listed in WMI's "Win32_SerialPortConfiguration" -5.4.1 - 2016-06-30 +## 5.4.1 - 2016-06-30 - more bug fixes for new datalog download parsing. -5.4.0 - 2016-06-28 +## 5.4.0 - 2016-06-28 - bug fixes for new datalog download parsing. - added new eeprom locations to NodeEepromMap. - added BaseStation::readWriteRetries getter function. - added WirelessNode::readWriteRetries getter function. -5.3.0 - 2016-06-24 +## 5.3.0 - 2016-06-24 - support for parsing the failure (device busy) packets for the 3 new datalogging commands. - fixed bug where new datalog data was being parsed in big endian when should be parsed in little endian. -5.2.0 - 2016-06-24 +## 5.2.0 - 2016-06-24 - added Endianness functionality. -5.1.2 - 2016-06-22 +## 5.1.2 - 2016-06-22 - updated formula for new V-Link hardware gain settings. -5.1.1 - 2016-06-21 +## 5.1.1 - 2016-06-21 - using Get Datalog Info command when asking for # datalogging sessions for new nodes. -5.1.0 - 2016-06-21 +## 5.1.0 - 2016-06-21 - support for 4-byte float with no cals applied datatype. -5.0.1 - 2016-06-21 +## 5.0.1 - 2016-06-21 - fix for parsing of v2 Datalogging headers not being called. -5.0.0 - 2016-06-21 +## 5.0.0 - 2016-06-21 - initial support for Datalogging v2 download. - REMOVED DatalogDownloader::triggerType() - REMOVED DatalogDownloader::totalSweeps() -4.4.1 - 2016-06-17 +## 4.4.1 - 2016-06-17 - fix for duplicate HclSmartBeacon_RawPackets not being thrown out. - fix for duplicate RawAngleStrainPackets not being thrown out. -4.4.0 - 2016-06-16 +## 4.4.0 - 2016-06-16 - added support for Event Trigger Index channel in Diagnostic Packet. -4.3.4 - 2016-06-14 +## 4.3.4 - 2016-06-14 - added NodeMemory2 class (internal class) for next gen Node datalog downloading. -4.3.3 - 2016-06-10 +## 4.3.3 - 2016-06-10 - added Get Datalog Data Node command (internal function). -4.3.2 - 2016-06-10 +## 4.3.2 - 2016-06-10 - added Datalog Session Info Node command (internal function). -4.3.1 - 2016-06-08 +## 4.3.1 - 2016-06-08 - fix for parsing packet failures causing crash, now just them throwing out. -4.3.0 - 2016-06-08 +## 4.3.0 - 2016-06-08 - added support for Storage Limit Mode - added NodeFeatures::storageLimitModes - added WirelessNode::getStorageLimitMode for getting the config - added WirelessNodeConfig::storageLimitMode for setting the config -4.2.1 - 2016-06-08 +## 4.2.1 - 2016-06-08 - changed filterSensorcloudName to not use regex. - removed regex include as its no longer needed. -4.2.0 - 2016-06-01 +## 4.2.0 - 2016-06-01 - support for v2 of the Erase node command (handled automatically through the same interface). -4.1.1 - 2016-06-01 +## 4.1.1 - 2016-06-01 - support for Flash ID eeprom on new nodes (currently used for determining data storage size). -4.1.0 - 2016-05-31 +## 4.1.0 - 2016-05-31 - added NodeFeatures::supportsCentisecondEventDuration to the public interface. -4.0.0 - 2016-05-27 +## 4.0.0 - 2016-05-27 - Event pre/post duration moved to milliseconds in MSCL to avoid floating point errors. - CHANGED EventTriggerOptions::preDuration to take/return a uint32 number of milliseconds instead of float seconds. - CHANGED EventTriggerOptions::postDuration to take/return a uint32 number of milliseconds instead of float seconds. - CHANGED NodeFeatures::maxEventTriggerTotalDuration to return the max event duration in milliseconds. - CHANGED NodeFeatures::normalizeEventDuration to take and return event durations in milliseconds. -3.0.1 - 2016-05-26 +## 3.0.1 - 2016-05-26 - fix for allowing pre and post duration above maximum values. -3.0.0 - 2016-05-26 +## 3.0.0 - 2016-05-26 - CHANGED EventTriggerOptions::preDuration to take/return a float number of seconds instead of uint16. - CHANGED EventTriggerOptions::postDuration to take/return a float number of seconds instead of uint16. - added NodeFeatures::normalizeEventDuration to normalize the pre and post event duration values. - support for new nodes using 10s-of-milliseconds resolution for pre/post duration. -2.1.0 - 2016-05-25 +## 2.1.0 - 2016-05-25 - added support for Torque-Link. -2.0.2 - 2016-05-24 +## 2.0.2 - 2016-05-24 - fix for Event Driven nodes in network being sorted by bandwidth incorrectly. -2.0.1 - 2016-05-24 +## 2.0.1 - 2016-05-24 - fix for SyncSamplingNetwork using Sync eeprom when should be using the Sampling eeprom. This caused Event Driven nodes to run through the optimizeBandwidth routine, messing with the logic. -2.0.0 - 2016-05-24 +## 2.0.0 - 2016-05-24 - support for optimizing slots for Event Driven nodes. - REMOVED SyncSamplingNetwork::setPendingConfig - REMOVED SyncSamplingNetwork::clearPendingConfig @@ -2515,163 +2529,163 @@ Forthcoming - RENAMED Utils::roundDownToNearestBase2 to Utils::floorBase2 - RENAMED Utils::roundUpToNearestBase2 to Utils::ceilBase2 -1.46.0 - 2016-05-20 +## 1.46.0 - 2016-05-20 - added special rules for sync networks with mixed old (fw < 10.0) and new (fw >= 10.0) nodes. -1.45.5 - 2016-05-12 +## 1.45.5 - 2016-05-12 - fix for incorrect parsing of ASPP v2 packets. -1.45.4 - 2016-05-11 +## 1.45.4 - 2016-05-11 - fix for DatalogDownloader's LoggedDataSweep parsing floats incorrectly. -1.45.3 - 2016-05-11 +## 1.45.3 - 2016-05-11 - fix for DatalogDownloader's LoggedDataSweep calsApplied being set incorrectly. -1.45.2 - 2016-05-11 +## 1.45.2 - 2016-05-11 - forcing uninitialized unit values (0xAA or 0xFF) read from eeprom or datalog download to a unit_none id. -1.45.1 - 2016-05-11 +## 1.45.1 - 2016-05-11 - fixed float values (data and cal coefficients) being read in the wrong endianess in the DatalogDownloader. -1.45.0 - 2016-05-09 +## 1.45.0 - 2016-05-09 - moved the calApplied() function from the datapoint level to the sweep level. - removed the nanoseconds() function from the DataSweep, as it was redundant with the Timestamp() function. - added more units -1.44.1 - 2016-05-04 +## 1.44.1 - 2016-05-04 - no longer checking for invalid event trigger settings when no triggers active. -1.44.0 - 2016-05-04 +## 1.44.0 - 2016-05-04 - added the shuntCal wireless channel setting. -1.43.0 - 2016-05-03 +## 1.43.0 - 2016-05-03 - added support for the Built in Test diagnostic packet channel. -1.42.0 - 2016-04-27 +## 1.42.0 - 2016-04-27 - added support for getting cal coefficients from the DatalogDownloader. - added CalCoefficients class as a wrapper for LinearEquation, unit, and equation type. -1.41.1 - 2016-04-26 +## 1.41.1 - 2016-04-26 - fix for Wireless Impact Sensor listing 3 low pass filters for 1 channel. -1.41.0 - 2016-04-25 +## 1.41.0 - 2016-04-25 - added support for low pass filter configuration. -1.40.1 - 2016-04-20 +## 1.40.1 - 2016-04-20 - added uint16 support for the Wireless Impact Sensor. -1.40.0 - 2016-04-20 +## 1.40.0 - 2016-04-20 - added maxSampleRateForSettlingTime NodeFeatures call. -1.39.5 - 2016-04-18 +## 1.39.5 - 2016-04-18 - made separate ConfigIssue enums for Event trigger mask and Event trigger duration. -1.39.4 - 2016-04-15 +## 1.39.4 - 2016-04-15 - fix for a few edge cases where event sampling types weren't being checked. -1.39.3 - 2016-04-15 +## 1.39.3 - 2016-04-15 - fix for V-Link-2 not having any listed sample rates for event driven. -1.39.2 - 2016-04-15 +## 1.39.2 - 2016-04-15 - converting uninitialized unit to a "none" unit. -1.39.1 - 2016-04-15 +## 1.39.1 - 2016-04-15 - added all the units that SensorCloud has to MSCL. -1.39.0 - 2016-04-15 +## 1.39.0 - 2016-04-15 - added nonSyncEvent and syncEvent WirelessSamplingModes. - added logic to the WirelessNodeConfig verify for these new sampling modes. - added new sample rates to the Wireless Impact Sensor for these new sampling modes. -1.38.0 - 2016-04-15 +## 1.38.0 - 2016-04-15 - added basic support for Wireless Impact Sensor. -1.37.2 - 2016-04-12 +## 1.37.2 - 2016-04-12 - added calApplied() function to WirelessDataPoint class. -1.37.1 - 2016-04-07 +## 1.37.1 - 2016-04-07 - updated WirelessNode.lastCommunicationTime() to be BaseStation independent. - updated all lastCommunicationTime functions to include when data is heard from the device as well as command replies. -1.37.0 - 2016-04-06 +## 1.37.0 - 2016-04-06 - support for parsing of incoming ASPP v2 packets. - support for parsing of RollerPackets. - changed Wireless Node nodeAddress to uint32 when parsing data. -1.36.3 - 2016-03-28 +## 1.36.3 - 2016-03-28 - not disabling beacon on successive calls to SyncSamplingNetwork.startSampling() - increased # of retries to ping after a cycle power from 5 to 15. -1.36.2 - 2016-03-24 +## 1.36.2 - 2016-03-24 - retrying up to 10x to communicate after an autobalance command is sent. -1.36.1 - 2016-03-18 +## 1.36.1 - 2016-03-18 - removed check for page download failure as it was causing issues. Unfortunately, this means the page download now needs to time out for a failure. -1.36.0 - 2016-03-16 +## 1.36.0 - 2016-03-16 - added NodeFeatures.supportsLoggedData() function. -1.35.4 - 2016-03-15 +## 1.35.4 - 2016-03-15 - added percentComplete to the DatalogDownloader class. -1.35.3 - 2016-03-09 +## 1.35.3 - 2016-03-09 - added setting of direct triggerMask to EventTriggerOptions. -1.35.2 - 2016-03-09 +## 1.35.2 - 2016-03-09 - changed the way specific trigger settings are configured in EventTriggerOptions. -1.35.1 - 2016-03-09 +## 1.35.1 - 2016-03-09 - added triggerMask() function to EventTriggerOptions. -1.35.0 - 2016-02-29 +## 1.35.0 - 2016-02-29 - support for configuration of diagnostic packets. -1.34.3 - 2016-02-26 +## 1.34.3 - 2016-02-26 - initial support for setting Event Trigger sampling configuration. -1.34.2 - 2016-02-25 +## 1.34.2 - 2016-02-25 - initial support for getting Event Trigger sampling configuration. -1.34.1 - 2016-02-23 +## 1.34.1 - 2016-02-23 - support for the changed sample rate format in diagnostic packet. -1.34.0 - 2016-02-19 +## 1.34.0 - 2016-02-19 - Parsing of diagnostic packets. -1.33.1 - 2016-02-17 +## 1.33.1 - 2016-02-17 - fix for Raw Strain Sync packets duplicating channels between sweeps. -1.33.0 - 2016-02-16 +## 1.33.0 - 2016-02-16 - added support for Raw Strain Sync data packets. - added sync support for the shm-link Node (non-custom). -1.32.2 - 2016-02-15 +## 1.32.2 - 2016-02-15 - sending a byte/ping to the BaseStation before starting SetToIdle to attempt to fix an issue where the Base won't start the Set To Idle operation when lots of data over the air. -1.32.1 - 2016-02-11 +## 1.32.1 - 2016-02-11 - support for the CF-Bearing-Temp-Link -1.32.0 - 2016-02-03 +## 1.32.0 - 2016-02-03 - added InertialNode.setInitialAttitude() command. - added InertialNode.setInitialHeading() command. - fix for 8192Hz sample rate throwing exceptions when being used. - removed maxSampleRate restriction for Nodes with FW 10.0+. -1.31.0 - 2016-02-03 +## 1.31.0 - 2016-02-03 - added InertialNode.getAutoInitialization() command. - added InertialNode.setAutoInitialization() command. -1.30.0 - 2016-02-03 +## 1.30.0 - 2016-02-03 - added InertialNode.resetFilter() command. - removed the Error_Timeout exception (replaced with Error_Communication everywhere). -1.29.1 - 2016-01-29 +## 1.29.1 - 2016-01-29 - fix for failing to parse the BaseStation startRfSweep command response. -1.29.0 - 2016-01-27 +## 1.29.0 - 2016-01-27 - removed BaseStation.nodeCommandsTimeout() and BaseStation.basecommandsTimeout() in favor of a single BaseStation.timeout() function. - renamed InertialNode.commandsTimeout() to InertialNode.timeout(). @@ -2680,126 +2694,126 @@ Forthcoming - change default timeout of InertialNode commands to 100ms (from 1000ms!). - added minimum timeout of 1100ms to old BaseStation enable/disable beacon commands. -1.28.3 - 2016-01-27 +## 1.28.3 - 2016-01-27 - fix for tick being calculated incorrectly for all buffered packets. -1.28.2 - 2016-01-26 +## 1.28.2 - 2016-01-26 - fix for startRfSweepMode having the wrong payload length in the command. -1.28.1 - 2016-01-26 +## 1.28.1 - 2016-01-26 - additional logic for Sync Sampling formulas v2. -1.28.0 - 2016-01-25 +## 1.28.0 - 2016-01-25 - changed Sync Sampling formulas to support new nodes' methods (fw 10.0+). -1.27.1 - 2016-01-21 +## 1.27.1 - 2016-01-21 - applying eeprom changes in SyncSamplingNetwork.applyConfiguration by resetting the node. -1.27.0 - 2016-01-20 +## 1.27.0 - 2016-01-20 - SyncSamplingNetwork.startSampling functions no longer throw communication error exceptions -If a Node fails to respond to a start sync command, 3 more attempts are made, then it moved to other nodes. This is because we can not get the response when a Node really does start, and then successive calls to the startSampling function will not be able to start that Node, nor Nodes behind it in the network. -1.26.0 - 2016-01-18 +## 1.26.0 - 2016-01-18 - no longer caching eeprom 1030. - initial support for the new V-Link. - added "options" parameter to the startRfSweep command (for internal use). -1.25.0 - 2016-01-18 +## 1.25.0 - 2016-01-18 - removed BaseStation.getNextData() in favor of BaseStation.getData() - removed InertialNode.getNextDataPacket() in favor of InertialNode.getDataPackets() -1.24.1 - 2016-01-13 +## 1.24.1 - 2016-01-13 - fix for RfSweep data throwing an error when asking for channel name. -1.24.0 - 2016-01-12 +## 1.24.0 - 2016-01-12 - added parsing of RfSweep data packets. -1.23.0 - 2016-01-11 +## 1.23.0 - 2016-01-11 - added BaseStation startRfSweepMode command. -1.22.0 - 2016-01-08 +## 1.22.0 - 2016-01-08 - Wireless command responses now ignore the bytes that were already in the read buffer before the command was sent. - this was a fix for the short commands/responses sometimes erroneously getting mixed up. -1.21.11 - 2016-01-06 +## 1.21.11 - 2016-01-06 - WirelessDataPoint now lazy loads the channelName. - WirelessDataPoint now has arbitrary properties that can be set by packet parsers to be passed to user programs. -1.21.10 - 2015-12-16 +## 1.21.10 - 2015-12-16 - support for parsing Node Discovery v4 packets. -1.21.9 - 2015-12-14 +## 1.21.9 - 2015-12-14 - sending the startNonSyncSampling command multiple times to give Nodes a better chance at successfully starting. -1.21.8 - 2015-12-14 +## 1.21.8 - 2015-12-14 - reverting changes made in 1.21.7. -1.21.7 - 2015-12-11 +## 1.21.7 - 2015-12-11 - changed SampleRate::str() to return strings that match SensorCloud's specs. -1.21.6 - 2015-12-09 +## 1.21.6 - 2015-12-09 - adding Node Built In Test to eeproms that shouldn't be cached. -1.21.5 - 2015-12-07 +## 1.21.5 - 2015-12-07 - using reset radio to apply Node eeproms when possible, instead of cycle power. -1.21.4 - 2015-12-02 +## 1.21.4 - 2015-12-02 - checking if sampling modes are supported when defaulting to a sampling mode if not yet set in eeprom. -1.21.3 - 2015-12-01 +## 1.21.3 - 2015-12-01 - support for Sleep Interval eeprom on Nodes with firmware 10.0+. -1.21.2 - 2015-11-19 +## 1.21.2 - 2015-11-19 - fix for issues with min and max distributed angles throwing errors when they are valid. -1.21.1 - 2015-11-11 +## 1.21.1 - 2015-11-11 - fixed bugs causing Raw Angle Strain packets to get parsed incorrectly. -1.21.0 - 2015-11-10 +## 1.21.0 - 2015-11-10 - added support for parsing Beacon Echo packets (base fw v3.32+). -1.20.6 - 2015-11-06 +## 1.20.6 - 2015-11-06 - fix for angles in distributed version of Raw Angle Strain packets being incorrectly determined. -1.20.5 - 2015-11-05 +## 1.20.5 - 2015-11-05 - added parsing of Raw Angle Strain Packets. - fix for SetToIdleStatus::cancel() failing due to attempting to determine which ping function to use. - set complete flag to true on the SetToIdleStatus after a successful cancel operation. - restricting SHM-Link2 sample rates to the correct range. - added BaseStation connection() function for getting a reference to the underlying Connection. -1.20.4 - 2015-11-03 +## 1.20.4 - 2015-11-03 - added more detail to read/write eeprom specific failure code messages. - changed Windows serial port timeouts to be as fast and efficient as possible. - this fixes an issue with Inertial data coming in so fast that it gets timestamps incorrectly. - Note: there currently seems to be a bug in the SiLabs driver causing CPU spikes with this method. -1.20.3 - 2015-11-02 +## 1.20.3 - 2015-11-02 - changed Value casting from boost numeric_cast (runtime out of range errors) to static_cast. -1.20.2 - 2015-11-02 +## 1.20.2 - 2015-11-02 - fix for LDC 16ch packets not being parsed correctly. -1.20.1 - 2015-10-29 +## 1.20.1 - 2015-10-29 - added histogramEnable to FatigueOptions config. - added supportsHistogramEnableConfig to NodeFeatures. -1.20.0 - 2015-10-29 +## 1.20.0 - 2015-10-29 - added fatigueMode to FatigueOptions config (replaces distributedAngleMode boolean). - changed rawMode to debugMode in FatigueOptions. - changed supportsFatigueRawModeConfig to supportsFatigueDebugModeConfig. - added supportsFatigueModeConfig (replaces supportsFatigueDistributedAngleMode). - added fatigueModes function to NodeFeatures for getting a list of supported fatigue modes. -1.19.2 - 2015-10-28 +## 1.19.2 - 2015-10-28 - changed back to std::regex...again. -1.19.1 - 2015-10-27 +## 1.19.1 - 2015-10-27 - fix for specific config issue enums not actually being returned. -1.19.0 - 2015-10-27 +## 1.19.0 - 2015-10-27 - added support for WirelessNode quickPing() command for performing a "Short Ping". - this uses the new ASPP Short Ping if the Base Station supports it. - changed from std::regex to boost::regex as the current Ubuntu LTS (14.04) doesn't support it. @@ -2807,53 +2821,53 @@ Forthcoming - exposed InertialTypes::channelQualifierToStr to SWIG. - exposed InertialTypes::channelName to SWIG. -1.18.3 - 2015-10-27 +## 1.18.3 - 2015-10-27 - added more specific config issue enums. - fix for Gauge Factor config issue incorrectly sending a Hardware Gain issue enum. -1.18.2 - 2015-10-26 +## 1.18.2 - 2015-10-26 - fix for ActivitySense options not being written in the applyConfig function. -1.18.1 - 2015-10-22 +## 1.18.1 - 2015-10-22 - added support for the SG-Link-Micro node. -1.18.0 - 2015-10-21 +## 1.18.0 - 2015-10-21 - added support for the Fatigue distributed angle mode configuration. -1.17.1 - 2015-10-21 +## 1.17.1 - 2015-10-21 - added support for WirelessNode regionCode() function. - removed optional frequency parameter from WirelessNode constructor. -1.17.0 - 2015-10-21 +## 1.17.0 - 2015-10-21 - added support for Gauge Factor configuration for supported nodes. -1.16.0 - 2015-10-20 +## 1.16.0 - 2015-10-20 - finalized support for ActivitySense feature. -1.15.1 - 2015-10-20 +## 1.15.1 - 2015-10-20 - added support for SHM-Link2-cust1 model. - starting to add support for ActivitySense feature (not yet working, invalid eeproms). -1.15.0 - 2015-10-19 +## 1.15.0 - 2015-10-19 - added InertialNode::getAntennaOffset(). - added InertialNode::setAntennaOffset(). -1.14.0 - 2015-10-16 +## 1.14.0 - 2015-10-16 - added InertialNode::getSensorToVehicleOffset(). - added InertialNode::setSensorToVehicleOffset(). - added start of InertialNodeFeatures class (doesn't provide anything right now). -1.13.0 - 2015-10-15 +## 1.13.0 - 2015-10-15 - added InertialNode::getSensorToVehicleTransformation(). - added InertialNode::setSensorToVehicleTransformation(). -1.12.2 - 2015-10-15 +## 1.12.2 - 2015-10-15 - removing support for cal coefficients from the SHM-Link 2. -1.12.1 - 2015-10-15 +## 1.12.1 - 2015-10-15 - updated SHM-Link 2 features to not support limited duration (sweeps). -1.12.0 - 2015-10-15 +## 1.12.0 - 2015-10-15 - added NodeFeatures::supportsLimitedDuration for checking which Nodes only support unlimited sampling (no sweeps). - don't allow a value other than true to be set for unlimited duration if Node doesn't support disabling it. - don't allow reading or writing the number of sweeps if the node only supports unlimited sampling. @@ -2864,346 +2878,346 @@ Forthcoming - added sleep after performing the WirelessNode reset radio command. - writing a disabled value of 0xFFFF to the channel value for analog base stations if set to 0xFF. -1.11.4 - 2015-10-14 +## 1.11.4 - 2015-10-14 - updated to changes made to auto balance 2 packet. - changed WirelessNode::autoBalance command to take a float percentage range. - changed AutoBalanceResult to have percent achieved instead of the channel sample value. - removed resolution from all of the channels as the new autobalance made it unnecessary. -1.11.3 - 2015-10-13 +## 1.11.3 - 2015-10-13 - updated auto balance 2 command id. - fix for cycle power on the base station failing if haven't determined protocol version. - resetting the radio or cycling power when writing base eeproms (depending on firmware version). - cycling the power on nodes when committing eeproms (instead of resetting radio). -1.11.2 - 2015-10-13 +## 1.11.2 - 2015-10-13 - made AutoBalanceResult functions const. -1.11.1 - 2015-10-13 +## 1.11.1 - 2015-10-13 - fix for WirelessNode::autobalance not returning the AutoBalanceResult. -1.11.0 - 2015-10-13 +## 1.11.0 - 2015-10-13 - support for old and new auto balance commands. - old auto balance command now performs a hardware offset eeprom read. - old auto balance command now performs a read single sensor to get the channel value. - moved AutoCalResult to its own file. - moved AutoBalanceResult to its own file. -1.10.1 - 2015-10-12 +## 1.10.1 - 2015-10-12 - changed WirelessNode's autobalance function to take a ChannelMask instead of a channel number. - added method to get the resolution from each WirelessChannel object. - adding start of the AutoBalance_v2 command (not fully functional). -1.10.0 - 2015-10-09 +## 1.10.0 - 2015-10-09 - added supportsLostBeaconTimeout() to the NodeFeatures class. -1.9.2 - 2015-10-06 +## 1.9.2 - 2015-10-06 - fix for mV/V-Link having incorrect model number. -1.9.1 - 2015-10-05 +## 1.9.1 - 2015-10-05 - added support for Wireless Nodes and BaseStations supporting new transmit powers. -1.9.0 - 2015-10-02 +## 1.9.0 - 2015-10-02 - added support for the mV/V-Link Wireless Node. -1.8.1 - 2015-10-01 +## 1.8.1 - 2015-10-01 - fix for the swig.jam file not having quotes around the paths, causing failures when spaces are in the path. -1.8.0 - 2015-09-29 +## 1.8.0 - 2015-09-29 - parsing of BaseStation Read/Write eeprom failure error codes. - any BaseStation function that reads from eeprom can potentially now throw an Error_NotSupported exception. - any BaseStation function that writes to eeprom can potentially now throw an Error_NotSupported exception. -1.7.3 - 2015-09-29 +## 1.7.3 - 2015-09-29 - parsing of Node Write Eeprom failure packet. - any Node function that writes to eeprom can potentially now throw an Error_NotSupported exception. -1.7.2 - 2015-09-29 +## 1.7.2 - 2015-09-29 - parsing of Node Read Eeprom failure packet. - any Node function that reads from eeprom can potentially now throw an Error_NotSupported exception. -1.7.1 - 2015-09-28 +## 1.7.1 - 2015-09-28 - fix for AutoCal_shmLink using new App Data Type. -1.7.0 - 2015-09-28 +## 1.7.0 - 2015-09-28 - added WirelessNode::readWriteRetries for configuring automatic retries of Node eeprom reads and writes. - added BaseStation::readWriteRetries for configuring automatic retries of BaseStation eeprom reads and writes. -1.6.1 - 2015-09-25 +## 1.6.1 - 2015-09-25 - fix for AutoCal_shmLink command returning when it should still be waiting for a second response. -1.6.0 - 2015-09-24 +## 1.6.0 - 2015-09-24 - added WirelessNode::useGroupRead to allow disabling of group eeprom read commands. -1.5.1 - 2015-09-21 +## 1.5.1 - 2015-09-21 - using WirelessProtocol class for WirelessNode read/write eeprom and page download commands. -1.5.0 - 2015-09-15 +## 1.5.0 - 2015-09-15 - added BaseStation::doCommand function for making custom commands/responses (C++ only). -1.4.1 - 2015-09-11 +## 1.4.1 - 2015-09-11 - fix for gcc on Windows not finding type_info -1.4.0 - 2015-09-11 +## 1.4.0 - 2015-09-11 - support for the Beacon Status command. -1.3.0 - 2015-09-09 +## 1.3.0 - 2015-09-09 - support for v2 Ping Base Station command. - support for v2 Read Base Eeprom command. - support for v2 Write Base Eeprom command. - support for the "WSDA-Base OEM" BaseStation. -1.2.1 - 2015-09-08 +## 1.2.1 - 2015-09-08 - added BaseProtocol class to use for future ASPP protocol updates. -1.2.0 - 2015-09-04 +## 1.2.0 - 2015-09-04 - support for Wireless Node AutoBalance functionality. - support for Wireless Node Hardware Offset configuration. - restricting sampling modes in features for SHM-Link 2. - fix for the HCL Raw packets being thrown out when should be accepted. -1.1.0 - 2015-08-31 +## 1.1.0 - 2015-08-31 - support for HCL Smart Bearing Raw Inertial and Raw Sensor Board packets. -1.0.2 - 2015-08-27 +## 1.0.2 - 2015-08-27 - fix for parsing mag values as uint16 when should be int16 in HCL Smart Bearing packet. -1.0.1 - 2015-08-27 +## 1.0.1 - 2015-08-27 - fix for invalid node rssi being transmitted in SHM Packet. -1.0.0 - 2015-08-26 +## 1.0.0 - 2015-08-26 - official release of MSCL 1.0 -0.42.0 - 2015-08-26 +## 0.42.0 - 2015-08-26 - support for the new wireless firmware version scheme (Major.SvnRevision). -0.41.4 - 2015-08-26 +## 0.41.4 - 2015-08-26 - support for changes to the HCL Smart Bearing - Raw Base Board packet. -0.41.3 - 2015-08-25 +## 0.41.3 - 2015-08-25 - changed types of rssi values from "int" to "int16". -0.41.2 - 2015-08-24 +## 0.41.2 - 2015-08-24 - fix for v-link hardware gain to bits function not rounding correctly. -0.41.1 - 2015-08-24 +## 0.41.1 - 2015-08-24 - Structural Health channel names now include the angle. - added decimal point to the supported SensorCloud characters. - made DataPoint constructor public. -0.41.0 - 2015-08-17 +## 0.41.0 - 2015-08-17 - full parsing of AutoCal command for the SHM-Link. -0.40.1 - 2015-08-17 +## 0.40.1 - 2015-08-17 - changed support for HCL Smart Bearing - Raw Base Board data parsing to be individual channels. -0.40.0 - 2015-08-17 +## 0.40.0 - 2015-08-17 - using the real SHM-Link2 model number. - added support for the legacy V-Link (12-bit). -0.39.0 - 2015-08-14 +## 0.39.0 - 2015-08-14 - changed Bin class to have a uint32 for the count value. - support for parsing Raw Base Board data. -0.38.5 - 2015-08-14 +## 0.38.5 - 2015-08-14 - fix for SetToIdle destructor throwing exceptions. - added some buffer time to the SetToIdleStatus cancel operation. -0.38.4 - 2015-08-12 +## 0.38.4 - 2015-08-12 - added NodeFeatures.supportsAutoCal command. - now throwing exception if the Node doesn't support autocal when trying to perform the operation. -0.38.3 - 2015-08-12 +## 0.38.3 - 2015-08-12 - added the start of the AutoCal_shmLink command (not yet tested, documented, etc.). - removed as_Histogram function as it was no longer being used. - changed HistogramOptions "bin" function names to "bins" (binStart -> binsStart). -0.38.2 - 2015-08-11 +## 0.38.2 - 2015-08-11 - fix for previous commit breaking parsing of some command responses (most notably page download). -0.38.1 - 2015-08-11 +## 0.38.1 - 2015-08-11 - fix for Wireless parser not resetting read position when looking for responses withing "not enough data" bytes. -0.38.0 - 2015-08-07 +## 0.38.0 - 2015-08-07 - added peak/valley threshold configuration to FatigueOptions object. -0.37.1 - 2015-08-07 +## 0.37.1 - 2015-08-07 - changed HistogramOptions transmit rate to a WirelessSampleRate enum from a SampleRate object. -0.37.0 - 2015-08-06 +## 0.37.0 - 2015-08-06 - added WirelessNode clearHistogram command. - changed SHM-Link 1 to only have 1/30seconds in list of histogram tx rates. -0.36.1 - 2015-08-06 +## 0.36.1 - 2015-08-06 - converting FatigueOptions angles to within 0-360. -0.36.0 - 2015-08-06 +## 0.36.0 - 2015-08-06 - added support for parsing the SHM-Link v2 Data Packet. -0.35.0 - 2015-08-05 +## 0.35.0 - 2015-08-05 - added support for SHM-Link 2 NodeFeatures (currently using temporary model number). -0.34.0 - 2015-08-04 +## 0.34.0 - 2015-08-04 - added support for enabling/disabling FatigeeOptions rawMode. -0.33.0 - 2015-08-04 +## 0.33.0 - 2015-08-04 - added support for getting/setting HistogramOptions configuration. - changed WirelessNode.channelMask() to WirelessNode.activeChannels(). - changed DataSweep.tick to a uint32 instead of a uint16. -0.32.6 - 2015-08-03 +## 0.32.6 - 2015-08-03 - converting original ShmPacket's angles from radians to degrees. -0.32.5 - 2015-07-31 +## 0.32.5 - 2015-07-31 - start of support for FatigueOptions. -0.32.4 - 2015-07-30 +## 0.32.4 - 2015-07-30 - supporting both the incorrect and correct read/write eeprom v3 packets. -0.32.3 - 2015-07-30 +## 0.32.3 - 2015-07-30 - fix for cal coefficient channel groups having funky channelGroup names. -0.32.2 - 2015-07-29 +## 0.32.2 - 2015-07-29 - fix for channelGroup settings incorrectly searching for eeprom locations. - start of support for FatigueOptions. -0.32.1 - 2015-07-29 +## 0.32.1 - 2015-07-29 - fix for .NET library having Null Ref issues with ChannelMask and Version classes. -0.32.0 - 2015-07-24 +## 0.32.0 - 2015-07-24 - support for the "Micro-USB Base Station" in listBasestations function. -0.31.0 - 2015-07-21 +## 0.31.0 - 2015-07-21 - added InertialNode lastCommunicationTime command. -0.30.0 - 2015-07-21 +## 0.30.0 - 2015-07-21 - added BaseStation lastCommunicationTime command. - added WirelessNode lastCommunicationTime command. -0.29.2 - 2015-07-20 +## 0.29.2 - 2015-07-20 - added new version of the Write EEPROM command. -0.29.1 - 2015-07-20 +## 0.29.1 - 2015-07-20 - added new version of the Read EEPROM command, including function to determine the read/write version. -0.29.0 - 2015-07-16 +## 0.29.0 - 2015-07-16 - completion of moving all Wireless Channel configuration to Wireless Node. - removed ChannelInfo class. -0.28.5 - 2015-07-16 +## 0.28.5 - 2015-07-16 - moved LinearEquation, unit, and equation type to node side. - removed WirelessChannelConfig class. -0.28.4 - 2015-07-15 +## 0.28.4 - 2015-07-15 - removed classes and functions that are no longer used since the move away from Wireless Channels. -0.28.3 - 2015-07-15 +## 0.28.3 - 2015-07-15 - moved thermocouple type over to node side. -0.28.2 - 2015-07-15 +## 0.28.2 - 2015-07-15 - moved filter settling time over to node side. -0.28.1 - 2015-07-13 +## 0.28.1 - 2015-07-13 - moved hardware gain over to node side (start of removing channel config layer). -0.28.0 - 2015-07-08 +## 0.28.0 - 2015-07-08 - support for Node Discovery Packet v3. -0.27.0 - 2015-07-08 +## 0.27.0 - 2015-07-08 - support for Node Discovery Packet v2. -0.26.0 - 2015-07-06 +## 0.26.0 - 2015-07-06 - added support for 3 part Wireless firmware versions (Node and BaseStation). -0.25.12 - 2015-07-06 +## 0.25.12 - 2015-07-06 - fix for allowing get/set time between bursts when burst mode not supported by the Node. - added ability to clear the eeprom cache for WirelessNode and BaseStation objects. -0.25.11 - 2015-07-06 +## 0.25.11 - 2015-07-06 - fix for WirelessNodeConfig checking the number of sweeps when unlimited duration is set. -0.25.10 - 2015-07-02 +## 0.25.10 - 2015-07-02 - fix for the Sync Sampling Network allowing a single node with 100.09% bandwidth. -0.25.9 - 2015-07-02 +## 0.25.9 - 2015-07-02 - added 50ms sleep between each Node's Start Sync Sampling command (attempt to improve start success). -0.25.8 - 2015-07-01 +## 0.25.8 - 2015-07-01 - fix for verifyConfig failing with filter settling time and sample rate conflict incorrectly. -0.25.7 - 2015-06-29 +## 0.25.7 - 2015-06-29 - adding issue for 0 active channels in verifyConfig (fix for divide by zero error). -0.25.6 - 2015-06-29 +## 0.25.6 - 2015-06-29 - changed order of sample rates in mscl so that they go from fastest to slowest. -0.25.5 - 2015-06-25 +## 0.25.5 - 2015-06-25 - added checks for transmit power before applying to the Node/BaseStation. -0.25.4 - 2015-06-25 +## 0.25.4 - 2015-06-25 - updated WirelessNode::features() and BaseStation::features() functions to throw exceptions for unsupported devices. -0.25.3 - 2015-06-22 +## 0.25.3 - 2015-06-22 - changed changeFrequency on BaseStation and Node to reset the radio instead of cycling power (faster). -0.25.2 - 2015-06-16 +## 0.25.2 - 2015-06-16 - previous regex change didn't solve compatibility issues. reverting back to std::regex. -0.25.1 - 2015-06-15 +## 0.25.1 - 2015-06-15 - changed std::regex to boost::regex for better backwards compatibility (compilation on older build systems). -0.25.0 - 2015-06-08 +## 0.25.0 - 2015-06-08 - added NodeFeatures::transmitPowers() function. - added BaseStationFeatures::transmitPowers() function. - transmitPowers functions use the region code in their logic. -0.24.0 - 2015-06-05 +## 0.24.0 - 2015-06-05 - renamed BootMode and BootModes to DefaultMode and DefaultModes respectively. -0.23.0 - 2015-06-05 +## 0.23.0 - 2015-06-05 - renamed stop() to setToIdle() for the WirelessNode class. - renamed StopNodeStatus to SetToIdleStatus. -0.22.7 - 2015-06-02 +## 0.22.7 - 2015-06-02 - fix for throwing away non-ASPP responses when waiting on more than 1 response at a time. -0.22.6 - 2015-05-18 +## 0.22.6 - 2015-05-18 - fix for single bytes (0xAA, 0x21) left in the buffer causing issues with parsing non-ASPP packets. - this caused behavior where reading the model from a Node that was off would timeout, but then a successive read of the Base Station's model would fail to be parsed because of a leftover 0xAA or 0x21. -0.22.5 - 2015-04-24 +## 0.22.5 - 2015-04-24 - removed Error_InvalidResponse exception. - removed Error_InvalidChecksum exception. -0.22.4 - 2015-04-23 +## 0.22.4 - 2015-04-23 - moved thermocouple type to Wireless Channel (get/set). - made "mask" functions return an empty mask when the feature isn't supported, instead of throwing an exception. -0.22.3 - 2015-04-23 +## 0.22.3 - 2015-04-23 - updated to new method of adding ChannelGroupOption features to nodes. -0.22.2 - 2015-04-21 +## 0.22.2 - 2015-04-21 - updated "valid" flag for GPS Correlation Timestamp in FieldParser_GpsCorrelationTimestamp. -0.22.1 - 2015-04-21 +## 0.22.1 - 2015-04-21 - moved filter settling time functionality from WirelessNode to WirelessChannel. -0.22.0 - 2015-04-20 +## 0.22.0 - 2015-04-20 - renamed ActiveChannels class to ChannelMask. -0.21.11 - 2015-04-20 +## 0.21.11 - 2015-04-20 - added checks for channel # of 0 to ActiveChannels class. - added lastChEnabled() function to ActiveChannels class, and using it in packet parsing. -0.21.10 - 2015-04-17 +## 0.21.10 - 2015-04-17 - removed shared hardware gain functionality. - updated NodeEepromHelper's hardware gain functions to get the eeprom locations using the NodeFeatures class. -0.21.9 - 2015-04-16 +## 0.21.9 - 2015-04-16 - added hardwareGainMask() function to ChannelFeatures class. -0.21.8 - 2015-04-16 +## 0.21.8 - 2015-04-16 - starting to move Hardware Gain to the new method of setting and getting. - added a vector of Hardware Gains to the NodeFeatures class. - each NodeFeatures subclass initializes its own Hardware Gains vector. @@ -3212,23 +3226,23 @@ Forthcoming - added ChannelInfo class (internal). - moved NodeInfo class to the Features directory. -0.21.7 - 2015-04-10 +## 0.21.7 - 2015-04-10 - changed Sensor Measurement Range behavior to Shared Hardware Gain behavior. - removed WirelessTypes::SensorMeasurementRange enum. -0.21.6 - 2015-04-09 +## 0.21.6 - 2015-04-09 - added bootModes() to NodeFeatures class. - added supportsBootModes() to NodeFeatures class. - checking for supported boot modes in the WirelessNodeConfig class. -0.21.5 - 2015-04-09 +## 0.21.5 - 2015-04-09 - added getLostBeaconTimeout() to WirelessNode class. (getter) - added lostBeaconTime() to the WirelessNodeConfig class. (setter) - added minLostBeaconTimeout() and maxLostBeaconTimeout() to the NodeFeatures class. - fix for BaseStation reset() function trapping all MSCL errors, when should only trap Error_Communication. - changed the behavior of as_bool() in the Value class to accept converting from other types to bool values. -0.21.4 - 2015-04-08 +## 0.21.4 - 2015-04-08 - added minHardwareGain() and maxHardwareGain() to the ChannelFeatures class. - changed NodeFeatures minHardwareGain() to minSharedHardwareGain() - changed NodeFeatures maxHardwareGain() to maxSharedHardwareGain() @@ -3237,31 +3251,31 @@ Forthcoming - NodeEepromHelper no longer verifies features are supported. Functions now assume this has been validated already. - Functions that were using NodeEepromHelper have been updated to verify feature support before calling NodeEepromHelper. -0.21.3 - 2015-04-06 +## 0.21.3 - 2015-04-06 - added channelNumber() function to WirelessDataPoint. - changed channel() to channelId() in WirelessDataPoint. -0.21.2 - 2015-04-06 +## 0.21.2 - 2015-04-06 - changed maxSweeps, maxSweepsPerBurst, and minTimeBetweenBursts functions to take an ActiveChannels object instead of channel count. -0.21.1 - 2015-04-06 +## 0.21.1 - 2015-04-06 - added Check Radio Interval configuration for WirelessNode. - added min and max Check Radio Interval functions. -0.21.0 - 2015-03-31 +## 0.21.0 - 2015-03-31 - added WirelessChannelConfig class for setting configuration on WirelessChannels. - removed "setters" from WirelessChannel class. - changed "verifyConfig" functions to be part of the WirelessNode and BaseStation classes instead of being directly in the WirelessNodeConfig and BaseStationConfig class. -0.20.19 - 2015-03-30 +## 0.20.19 - 2015-03-30 - changed WirelessChannels over to a map of channel# to WirelessChannel pointers. -0.20.18 - 2015-03-30 +## 0.20.18 - 2015-03-30 - fix for SyncNetworkInfo's copy constructor being broken (not compiling when trying to use). -0.20.17 - 2015-03-27 +## 0.20.17 - 2015-03-27 - big commit on tackling CPU performance. - changed serial port read timeouts on Windows to be 1 ms between bytes or 8ms total timeout. - optimized ByteStream "append" functions. @@ -3270,157 +3284,157 @@ Forthcoming - fix for the BoostCommunication class using a standard mutex instead of a recursive mutex. - updated some functions to take const refs instead of plain refs. -0.20.16 - 2015-03-25 +## 0.20.16 - 2015-03-25 - added support for setting/getting Shared Hardware Gain. -0.20.15 - 2015-03-24 +## 0.20.15 - 2015-03-24 - fix for SG-Link-RGD hardware gain formulas. -0.20.14 - 2015-03-18 +## 0.20.14 - 2015-03-18 - utilizing the new generic eeprom read/write functions in the BaseStationEepromHelper class. - removed readEeprom_float and writeEeprom_float from the BaseStation class. -0.20.13 - 2015-03-18 +## 0.20.13 - 2015-03-18 - added generic readEeprom and writeEeprom functions to Eeprom class which determine which type of eeprom read/write to perform (uint16, float, uint32, etc.) based on the inputs. - utilizing the new generic eeprom read/write functions in the NodeEepromHelper class. - moved hardware gain bitsToGain and gainToBits functions to the HardwareGain class instead of Features. - removed readEeprom_float and writeEeprom_float from the WirelessNode class. -0.20.12 - 2015-03-12 +## 0.20.12 - 2015-03-12 - added full support for configuration of BaseStation Analog Pairing options. -0.20.11 - 2015-03-10 +## 0.20.11 - 2015-03-10 - added some Analog configuration options to BaseStation and BaseStationConfig. -0.20.10 - 2015-03-09 +## 0.20.10 - 2015-03-09 - changed BaseStationAnalogPair's "floatData" functions to "expectFloatData". -0.20.9 - 2015-03-09 +## 0.20.9 - 2015-03-09 - added BaseStationAnalogPair class (not currently used). -0.20.8 - 2015-03-09 +## 0.20.8 - 2015-03-09 - added totalButtons() function to BaseStationFeatures. - added check to BaseStationConfig.verify() to check that the specific button is supported. -0.20.7 - 2015-03-06 +## 0.20.7 - 2015-03-06 - fix for BaseStationConfig not verifying before applying the config. -0.20.6 - 2015-03-06 +## 0.20.6 - 2015-03-06 - added support for setting and getting button configurations on BaseStations. - fix for the BaseStation.cyclePower() function not working correctly. -0.20.5 - 2015-03-05 +## 0.20.5 - 2015-03-05 - added start of BaseStationConfig class. -0.20.4 - 2015-03-04 +## 0.20.4 - 2015-03-04 - bug fix for missing Error_UnknownSampleRate exception in .NET -0.20.3 - 2015-03-03 +## 0.20.3 - 2015-03-03 - support for ENV-Link Mini nodes. -0.20.2 - 2015-03-03 +## 0.20.2 - 2015-03-03 - added support for getting and setting Thermocouple Type, Sensor Measurement Range, and Filter Settling Time for supported nodes. -0.20.1 - 2015-02-24 +## 0.20.1 - 2015-02-24 - added "get" functions for all sampling commands that were previously in SamplingConfig. -0.20.0 - 2015-02-24 +## 0.20.0 - 2015-02-24 - fix for certain connection errors not throwing exceptions (specifically TCP/IP connection being closed). - removed SamplingConfig class. - removed all "set" functions from WirelessNode class. - added WirelessNodeConfig class which is now used for all configuration options on a WirelessNode. -0.19.16 - 2015-02-18 +## 0.19.16 - 2015-02-18 - configured tcp/ip keep-alive on Windows for a timeout of 30sec and an interval of 1sec. - fix for disconnecting and reconnecting causing crashes. -0.19.15 - 2015-02-06 +## 0.19.15 - 2015-02-06 - added BaseStation.features() function to get the BaseStationFeatures, similar to WirelessNode. -0.19.14 - 2015-02-06 +## 0.19.14 - 2015-02-06 - removed BaseStation's read eeprom version "1", as this command does not provide access to upper eeproms, so cannot be used. This command is a legacy command from a long time ago (fw < 2.29). MSCL cannot support BaseStations before this firmware. -0.19.13 - 2015-02-05 +## 0.19.13 - 2015-02-05 - added support for finding the Inertial GX4's in the listPorts() and listInertialDevices() functions. -0.19.12 - 2015-02-03 +## 0.19.12 - 2015-02-03 - added ChannelFeatures class to get the features of a WirelessChannel. - added WirelessChannel.features() function for the above functionality. -0.19.11 - 2015-02-02 +## 0.19.11 - 2015-02-02 - moved unit and equation functionality from WirelessNode to WirelessChannel. - enabled keep-alive for tcp/ip connections. - changed default timeouts from 2 seconds to 1 seconds across the board (WirelessNode, BaseStation, InertialNode). -0.19.10 - 2015-01-30 +## 0.19.10 - 2015-01-30 - fix for Connect.reconnect() not knowing about correct exceptions in C# and Python. -0.19.9 - 2015-01-30 +## 0.19.9 - 2015-01-30 - moved slope and offset (LinearEquation) functionality from WirelessNode to WirelessChannel. - added LinearEquation class. -0.19.8 - 2015-01-29 +## 0.19.8 - 2015-01-29 - fix for InertialNode.name() function returning a name that was not supported by SensorCloud. -0.19.7 - 2015-01-26 +## 0.19.7 - 2015-01-26 - changed WirelessNode.channels() to return a map instead of a vector, allowing easier channel lookup. -0.19.6 - 2015-01-23 +## 0.19.6 - 2015-01-23 - added WirelessNode.channels() function which returns a vector of WirelessChannels. - added WirelessChannel set and get hardware gain (moved functionality from Node). -0.19.5 - 2015-01-22 +## 0.19.5 - 2015-01-22 - fixed bug where page download responses containing 0xAA for certain reads would be parsed incorrectly. -0.19.4 - 2015-01-20 +## 0.19.4 - 2015-01-20 - removed sleep between serial port reads -0.19.3 - 2015-01-20 +## 0.19.3 - 2015-01-20 - fixed bug where connection errors wouldn't get thrown by getData() functions if a connection was lost (base unplugged). -0.19.2 - 2015-01-19 +## 0.19.2 - 2015-01-19 - fixed major bug where Wireless page download command was not parsing the correct response. - added get/set hardware gain to WirelessNode class. -0.19.1 - 2015-01-15 +## 0.19.1 - 2015-01-15 - moved some functionality that WirelessNode_Impl was doing itself into NodeEepromHelper. -0.19.0 - 2015-01-15 +## 0.19.0 - 2015-01-15 - removed individual Device files. Will be using different approach in the future for "custom" options. - refactored NodeEepromHelper and BaseStationEepromHelper classes so that NodeInfo is lazy loaded, preventing unnecessary eeprom reads. - changed HardwareGain to have functions for channel hardware gain vs. node hardware gain (not currently used). -0.18.6 - 2015-01-14 +## 0.18.6 - 2015-01-14 - fix for WirelessParser throwing away parts of non-ASPP responses if the bytes comes in across multiple reads. -0.18.5 - 2015-01-12 +## 0.18.5 - 2015-01-12 - changing from the current way of serial port read timeouts to the MAXDWORD way in an attempt to fix large data reads being timestamped incorrectly. -0.18.4 - 2015-01-09 +## 0.18.4 - 2015-01-09 - fixed same serial port bug as in 0.18.2, but this time it was only affecting the first serial port read. -0.18.3 - 2015-01-07 +## 0.18.3 - 2015-01-07 - fixed a bug in the DatalogDownloader which would cause extra garbage data to be downloaded in some scenarios. -0.18.2 - 2015-01-06 +## 0.18.2 - 2015-01-06 - fixed major bug where reading bytes from the serial port would hang on Windows. - fixed a bug where InertialNode.getDataPackets() would return with no data when data was available. -0.18.1 - 2015-01-05 +## 0.18.1 - 2015-01-05 - backend changes to remove a lot of unnecessary shared_ptrs. -0.18.0 - 2014-12-16 +## 0.18.0 - 2014-12-16 - Added BaseStation getTransmitPower and setTransmitPower functions. -0.17.10 - 2014-12-10 +## 0.17.10 - 2014-12-10 - Added maxSampleRate rule for all nodes (4096Hz only supports 1 channel). - Reduced the sample rates available for GLink2 nodes (max of 10kHz instead of 60 kHz). - Removed maxSampleRate rule for GLink2 nodes. - Changed maxSampleRate function to return an enum instead of a SampleRate object. -0.17.9 - 2014-12-09 +## 0.17.9 - 2014-12-09 - Added support for the following MIP data fields: (8017) - Scaled Ambient Pressure (810E) - DGPS Info @@ -3437,112 +3451,112 @@ Forthcoming (8230) - GPS Antenna Correction (8231) - GPS Antenna Correction Uncertainty -0.17.8 - 2014-12-09 +## 0.17.8 - 2014-12-09 - fix for InertialDataPackets being a shared_ptr to a vector when it should just be a vector. -0.17.7 - 2014-12-08 +## 0.17.7 - 2014-12-08 - added Error_InvalidNodeConfig exception that includes the node address of the WirelessNode. -0.17.6 - 2014-12-05 +## 0.17.6 - 2014-12-05 - Added InertialNodeInfo model() function to get the model type as an enum. - Throwing out LDC packets if the channel mask indicates there are 0 active channels. -0.17.5 - 2014-11-26 +## 0.17.5 - 2014-11-26 - Changed InertialNodeInfo's firmwareVersion from a uint16 to a Version object. -0.17.4 - 2014-11-21 +## 0.17.4 - 2014-11-21 - Fixed listBaseStations and listInertialDevices functions to correctly identify that a device has been unplugged even when mscl has a connection open for it. -0.17.3 - 2014-11-20 +## 0.17.3 - 2014-11-20 - Removed InertialFieldId class. - Separated the InertialFieldId into commands and data. -0.17.2 - 2014-11-14 +## 0.17.2 - 2014-11-14 - Fix for typeinfo not working on Linux. - including in Types.h - added virtual destructor to SamplingConfig class. - Fix for gmtime_s not working on Linux. -0.17.1 - 2014-10-30 +## 0.17.1 - 2014-10-30 - Fix for destroying BaseStation before StopNodeStatus accessing null memory. -0.17.0 - 2014-10-20 +## 0.17.0 - 2014-10-20 - Added InertialNode resume() function. -0.16.2 - 2014-10-16 +## 0.16.2 - 2014-10-16 - Changed InertialNode's supportSampleRates function to take an InertialCategory instead of an InertialChannel. - Max hardware gain for SG-Link nodes fixed. -0.16.1 - 2014-10-15 +## 0.16.1 - 2014-10-15 - Fix for DatalogDownloader incorrectly parsing a Version 1.0 datalogging session header. -0.16.0 - 2014-10-15 +## 0.16.0 - 2014-10-15 - Added DatalogDownloader and LoggedDataSweep classes used to download logged data from a WirelessNode. - Standardized exception names to all be in the form: Error_MyCustomError. - Switched SampleRate type enums to match SensorCloud (Hertz = 1, Seconds = 0). - Changed CONFIG_DATA_COLLECTION_MODE to CONFIG_DATA_COLLECTION_METHOD. -0.15.8 - 2014-10-09 +## 0.15.8 - 2014-10-09 - SyncSamplingNetwork addNode function can now take a pending SamplingConfig to use for network calculations. - Added retries to opening the serial port connection in the case of access denied, in case it is being closed. -0.15.7 - 2014-10-03 +## 0.15.7 - 2014-10-03 - Added WirelessNode erase() function to erase datalogged data from a Node. - Added an extra check to the packet parsing integrity check functions, as a problem packet was discovered that should be thrown away but was accepted. -0.15.6 - 2014-10-03 +## 0.15.6 - 2014-10-03 - StopNode cancel() now waits up to the baseCommandsTimeout for the canceled response. This is also the case in the destructor. - Fix for StopNode cancel() leaving bytes in the buffer than are then parsed when repeating a StopNode command. -0.15.5 - 2014-10-02 +## 0.15.5 - 2014-10-02 - Added InertialNodeInfo supportedChannelFields() function to get the list of supported channel fields. - Added InertialNodeInfo supportsCategory() function to check whether an InertialCategory is supported. -0.15.4 - 2014-10-02 +## 0.15.4 - 2014-10-02 - Added WirelessNode name() function to get the name that should be used for uploading to SensorCloud. - Added InertialNode name() function to get the name that should be used for uploading to SensorCloud. - Added BaseStation serial(), model(), and firmwareVersion() function. -0.15.3 - 2014-10-01 +## 0.15.3 - 2014-10-01 - WirelessDataPoint now has a channelName() function to get the name that should be used for uploading to SensorCloud. - Removed WirelessChannel str() function. channelName() replaces this. -0.15.2 - 2014-10-01 +## 0.15.2 - 2014-10-01 - InertialDataPoint now has a name() function to get the name that should be used for uploading to SensorCloud. - InertialNode's setCommunicationMode() no longer checks to validate that it is supported. -0.15.1 - 2014-09-29 +## 0.15.1 - 2014-09-29 - Removed SamplingConfigTemplate pure virtual base class. - WirelessNode's getSamplingConfig() function no longer takes a reference to a config template, but instead returns a SamplingConfig object. -0.15.0 - 2014-09-29 +## 0.15.0 - 2014-09-29 - Added ArmedDataloggingNetwork class used to create and trigger a wireless armed datalogging network. -0.14.1 - 2014-09-23 +## 0.14.1 - 2014-09-23 - Changed style of static consts back to original (pre-0.13.13). -0.14.0 - 2014-09-22 +## 0.14.0 - 2014-09-22 - Added InertialNode setToIdle() function. -0.13.13 - 2014-09-22 +## 0.13.13 - 2014-09-22 - Changed style of static consts. -0.13.12 - 2014-09-17 +## 0.13.12 - 2014-09-17 - Fix for StopNode canceling automatically when it shouldn't be. -0.13.11 - 2014-09-16 +## 0.13.11 - 2014-09-16 - Added InertialNode enableDataStream command. - Changed InertialNode ping() function to just return a bool instead of an object. -0.13.10 - 2014-09-15 +## 0.13.10 - 2014-09-15 - Now allow calling startSampling functions of the SyncSamplingNetwork repeatedly and it will only start nodes that haven't previously been started. -0.13.9 - 2014-09-15 +## 0.13.9 - 2014-09-15 - Canceling the Stop Node operation when the StopNodeStatus object is destroyed (if not completed). - C++ output has boost static libraries linked in so they are no longer needed to be installed by the user. -0.13.8 - 2014-09-10 +## 0.13.8 - 2014-09-10 - SamplingConfig.verify() now verifies the number of sweeps and the time between bursts. - Changed from distutils to bjam for building python extension. - Changed a lot of the boost functionality to C++11 functionality. @@ -3550,30 +3564,30 @@ Forthcoming - WirelessNode and BaseStation serial() functions now returns a string with '0' padding when necessary. - Fixed connection objects not always calling disconnect when destroying, causing crashes in rare scenarios. -0.13.7 - 2014-08-25 +## 0.13.7 - 2014-08-25 - No longer attempting to ping a node when adding to the SyncNetwork object. - Nodes must have the same parent BaseStation as the SyncNetwork's master BaseStation, or an exception is thrown when added to the network. -0.13.6 - 2014-08-18 +## 0.13.6 - 2014-08-18 - got rid of EepromValue class, eeproms stored as uint16s -0.13.5 - 2014-08-18 +## 0.13.5 - 2014-08-18 - Added sleep() command for WirelessNode object. -0.13.4 - 2014-08-17 +## 0.13.4 - 2014-08-17 - Added Error_Connection exception which is used in many places where Error_Communication was previously used, but makes more sense. -0.13.3 - 2014-08-16 +## 0.13.3 - 2014-08-16 - BaseStation Eeprom reading and writing now using its own class similar to Node. -0.13.2 - 2014-08-16 +## 0.13.2 - 2014-08-16 - Updated simple_any to use Jon's latest version with C-style function pointers. -0.13.1 - 2014-08-15 +## 0.13.1 - 2014-08-15 - Support for starting Non-Sync Sampling mode. - Node EEprom reading and writing is now done within its own class. -0.13.0 - 2014-08-13 +## 0.13.0 - 2014-08-13 - Changed how SyncSamplingNetwork class works: - Creating a network now involves giving a BaseStation, not a frequency. - adding a node to the network changes its parent BaseStation to the network BaseStation and @@ -3588,39 +3602,39 @@ Forthcoming - Renamed references to dataCollectionMode to dataCollectionMethod to be consistent. - Fix for boot mode not returning bootMode_normal when the value in EEPROM is out of range. -0.12.1 - 2014-08-12 +## 0.12.1 - 2014-08-12 - Changed anyType to simple_any. -0.12.0 - 2014-08-11 +## 0.12.0 - 2014-08-11 - Added Disconnect function to Connection objects. - Added Reconnect function to Connection objects. -0.11.7 - 2014-08-11 +## 0.11.7 - 2014-08-11 - Changed all of the timeouts in the BaseStation / InertialNode classes to work with direct milliseconds (uint64) instead of a TimeSpan object, which seemed unnecessary. - Verifying that the sampling mode is one of the Sync sampling modes when adding a node to the SyncSamplingNetwork and when calling setPendingConfig on that network. -0.11.6 - 2014-08-08 +## 0.11.6 - 2014-08-08 - Support for verifying the maximum sample rate for the number of active channels. - Fix for Armed Datalogging sample rates not using the correct (different) eeprom values for some sample rates. - not counting IEPE-Link Temperature channel in Sync Sampling calculations now (as they only transmit once per burst) -0.11.5 - 2014-08-05 +## 0.11.5 - 2014-08-05 - Support for verifying sampling configuration options. - Changed how SHM packets are parsed - now create 1 StructuralHealthMonitor channel. - Updated to SWIG 3.0.2 -0.11.4 - 2014-07-29 +## 0.11.4 - 2014-07-29 - Fix for timeout not working on the getData function. - Fix for packets sending bad RSSI values instead of UNKNOWN_RSSI when not in packet. -0.11.3 - 2014-07-25 +## 0.11.3 - 2014-07-25 - InertialDataPoint now has field() and qualifier() functions. - Split most inertial data points that were being stored as Vectors to be broken apart (ie. 3 floats). - Renamed at_float and like functions to as_floatAt functions - Renamed getMessageFormat and setMessageFormat to getActiveChannelFields and setActiveChannelFields. - Removed InertialDataPointId. -0.11.2 - 2014-07-23 +## 0.11.2 - 2014-07-23 - Added writeStr function for writing a string of raw bytes to a Connection object. - Added getRawBytesStr function for getting a string of raw bytes from "raw byte mode". - getRawBytes and getRawBytesStr functions now take an optional timeout and an option maxBytes as parameters. @@ -3628,41 +3642,41 @@ Forthcoming - WirelessNode's constructor now takes a BaseStation by constant reference. - Support for MSCL working on XP. -0.11.1 - 2014-07-22 +## 0.11.1 - 2014-07-22 - Fix for crashing on destruction of connection when reading incoming data (threading/mutex issue). -0.11.0 - 2014-07-21 +## 0.11.0 - 2014-07-21 - InertialChannel object now has a SampleRate instead of a rate decimator, which would require the user to get the rate base and determine the decimator they wanted themselves. Now this is abstracted. - Added supportedSampleRates function to get a list of all sample rates for a specific Inertial Channel Id. - Changed WirelessNode's setBaseStation function to take a constant BaseStation ref. -0.10.3 - 2014-07-17 +## 0.10.3 - 2014-07-17 - Support for Ch4 on IEPE-Link. - Nodes with legacy serial numbers are identified correctly, instead of pulling from the new serial number location. -0.10.2 - 2014-07-16 +## 0.10.2 - 2014-07-16 - Removed ReadEepromResponse, WriteEepromResponse, and BaseStation_ReadEepromResponse classes (internal). -0.10.1 - 2014-07-14 +## 0.10.1 - 2014-07-14 - Changed "getData" functions of BaseStation and InertialNode classes to take a timeout parameter. -0.10.0 - 2014-07-11 +## 0.10.0 - 2014-07-11 - Support for TCP/IP Connection. -0.9.0 - 2014-07-09 +## 0.9.0 - 2014-07-09 - Support for SHM Packet. - Changed as_Bytes to return an actual vector of Bytes, instead of a mscl::Vector object. -0.8.1 - 2014-07-02 +## 0.8.1 - 2014-07-02 - Removed the InertialCommunicationType enum as it wasn't correct (each device uses different values). - Fixed issue where using the Communication object to create a BaseStation or InertialNode would immediately set the Raw Byte Mode parsing function to that device's parsing function. -0.8.0 - 2014-07-02 +## 0.8.0 - 2014-07-02 - Added Raw Bytes Mode for the Connection object. -0.7.2 - 2014-06-29 +## 0.7.2 - 2014-06-29 - The BaseStation getData function now returns a shared_ptr to a vector of DataSweep objects. - The InertialNode getDataPackets function now returns a shared_ptr to a vector of InertialDataPacket objects. - The getData and getNextData functions on the BaseStation, and the getDataPackets and getNextDataPacket object are more efficient (less copying). @@ -3670,7 +3684,7 @@ Forthcoming This means that there is no communication necessary at instantiation, however data that is collected. before the frequency is known on the base station will be stamped with an unknown frequency. -0.7.1 - 2014-06-26 +## 0.7.1 - 2014-06-26 - Support for 1 sample per 24 hours Wireless Sample Rate. - To fix the Connection bug below, the Connection objects now listen for data as soon as they are created. If no parsing function has been set for them (no BaseStation created), all incoming bytes will be thrown out. @@ -3678,36 +3692,36 @@ Forthcoming - Removed The .version() and .date() commands that were previously used to get the MSCL version. - Fixed Bug where reusing a Connection would fail, even after destroying the 1st BaseStation it was attached to. -0.7.0 - 2014-05-07 +## 0.7.0 - 2014-05-07 - Added methods to get some available settings information for some node types. - Support for new Wireless device model numbers. -0.6.0 - 2014-03-25 +## 0.6.0 - 2014-03-25 - Stop Node functionality - Changed how WirelessNode configuration is performed (moved more directly into WirelessNode class). - Some individual node classes to handle unique node commands (such as hardware gain). - "Pending Configuration" functionality to the SyncSamplingNetwork class. -0.5.0 2014-02-14 +## 0.5.0 - 2014-02-14 - Using write eeprom cache now (if same value as was previously read, doesn't write to node or base). - Can disable/enable the cache per device. - Can read/write configuration for Node, Channel, and Sampling for "generic" nodes (no node specific functionality yet). - Using "pimpl idiom" for some classes so that smart pointers are no longer exposed to the user. -0.4.1 2013-12-31 +## 0.4.1 - 2013-12-31 - Finished support for the SyncSamplingNetwork. - Allowing user to get detailed information about each node in the SyncSamplingNetwork. - Fix for some bugs in the SyncSamplingNetwork class. -0.4.0 2013-12-17 +## 0.4.0 - 2013-12-17 - Switched from boost::any to my own custom any class (similar to boost::spirit::hold_any) to improve performance [internal]. - Beginning of support for the SyncSamplingNetwork for creating and starting a Synchronized Sampling network. - Support for GetDeviceInfo and GetDeviceDescriptorSets for Inertial nodes [internal]. - Added InertialNode.info() to get information about the InertialNode. -0.3.0 2013-09-26 +## 0.3.0 - 2013-09-26 - Support for getting all or some data from the InertialNode object (getDataPackets(maxPackets)). -0.2.1 2013-09-26 +## 0.2.1 - 2013-09-26 - Fix for all floating point data being incorrect endianness. - Support for getting all or some data from the BaseStation object (getData(maxSweeps)). diff --git a/CMakeLists.txt b/CMakeLists.txt index d7349252b..0585f392b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.16.0) -project(MSCL LANGUAGES CXX) +project(MSCL + LANGUAGES CXX + VERSION 67.0.0 +) set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE STRING "Supported configuration types" FORCE) @@ -11,17 +14,17 @@ set(CMAKE_CXX_STANDARD 11) # If a build type was not specified, default to debug if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Debug") + set(CMAKE_BUILD_TYPE "Debug") endif() +# Add our custom modules path +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") + +# Include some utilities used for MicroStrain projects +include(microstrain_utilities) + # Detect if this is a x64 or x86 build -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(MSCL_X64 ON) - set(MSCL_ARCH_NAME "x64") -elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(MSCL_X86 ON) - set(MSCL_ARCH_NAME "x86") -endif() +microstrain_get_architecture(MSCL_ARCH_NAME) # This will make windows create a .lib file with all the symbols of the .dll files exported set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -29,103 +32,100 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # Parse some flags # These are all ON/OFF flags. For example, -DBUILD_SHARED_LIBS="ON" option(BUILD_SHARED_LIBS "Whether or not to build the shared version of the library." OFF) -option(WITH_SSL "Whether or not to compile the library with SSL support" ON) -option(WITH_WEBSOCKETS "Whether or not to compile the library with Websocket support" ON) -option(BUILD_PYTHON2 "Whether to build the python 2 bindings." OFF) -option(BUILD_PYTHON3 "Whether to build the python 3 bindings." OFF) -option(BUILD_TESTS "Whether to build the unit tests." OFF) -option(BUILD_EXAMPLES "Whether to build the examples." OFF) +option(MSCL_WITH_SSL "Whether or not to compile the library with SSL support" ON) +option(MSCL_WITH_WEBSOCKETS "Whether or not to compile the library with Websocket support" ON) +option(MSCL_BUILD_PYTHON2 "Whether to build the python 2 bindings." OFF) +option(MSCL_BUILD_PYTHON3 "Whether to build the python 3 bindings." OFF) +option(MSCL_BUILD_TESTS "Whether to build the unit tests." OFF) +option(MSCL_BUILD_EXAMPLES "Whether to build the examples." OFF) +option(MSCL_ZIP_EXAMPLES "Whether to zip the examples source code." OFF) +option(MSCL_BUILD_PACKAGE "Whether to build a package from the resulting binaries" OFF) if(WIN32) - option(BUILD_CSHARP "Whether to build the C# bindings. Only supported on Windows" OFF) - option(BUILD_DOCUMENTATION "Whether to build the documentation" OFF) + option(MSCL_BUILD_CSHARP "Whether to build the C# bindings. Only supported on Windows" OFF) + option(MSCL_BUILD_DOCUMENTATION "Whether to build the documentation" OFF) + + if(DEFINED MSCL_LINK_STATIC_DEPS) + message(WARNING "Linking static dependencies is for Linux. Making sure this is off for Windows") + set(MSCL_LINK_STATIC_DEPS OFF) + endif() elseif(UNIX) - option(LINK_STATIC_DEPS "Whether to link the dependencies statically. Please note that this means that OpenSSL and boost must be built with -fPIC" OFF) - option(BUILD_PACKAGE "Whether to build a package from the resulting binaries" OFF) + option(MSCL_LINK_STATIC_DEPS "Whether to link the dependencies statically. Please note that this means that OpenSSL and boost must be built with -fPIC" OFF) + + if(DEFINED MSCL_BUILD_CSHARP) + message(WARNING "Building .NET is only supported on Windows. Making sure this is off for Linux") + set(MSCL_BUILD_CSHARP OFF) + endif() + + if(DEFINED MSCL_BUILD_DOCUMENTATION) + message(WARNING "Building documentation is only supported on Windows. Making sure this is off for Linux") + set(MSCL_BUILD_DOCUMENTATION OFF) + endif() endif() # Allow the user to override the location where most dependencies are installed on Windows if(WIN32) - if(DEFINED ENV{LIB_PATH}) - set(MICROSTRAIN_LIB_DIR "$ENV{LIB_PATH}" CACHE STRING "Directory where most dependencies are installed") - else() - set(MICROSTRAIN_LIB_DIR "C:/lib" CACHE STRING "Directory where most dependencies are installed") - endif() + if(DEFINED ENV{LIB_PATH}) + set(MICROSTRAIN_LIB_DIR "$ENV{LIB_PATH}" CACHE STRING "Directory where most dependencies are installed") + else() + set(MICROSTRAIN_LIB_DIR "C:/lib" CACHE STRING "Directory where most dependencies are installed") + endif() endif() # These flags can be passed string values. For example, -DOPENSSL_ROOT_DIR="/usr/lib" # Different default search paths for windows set(Boost_REQUESTED_VERSION "1.68.0" CACHE INTERNAL "Required version of boost") +# Disable CMake policy for Boost config find_package +# CMake 3.30+ uses Boost Config for Boost 1.70+ +if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) +endif() + if(WIN32) - string(REPLACE "." "_" Boost_REQUESTED_VERSION_UNDERSCORE ${Boost_REQUESTED_VERSION}) - set(DEFAULT_BOOST_ROOT "${MICROSTRAIN_LIB_DIR}/boost") - if(MSCL_X64) - set(DEFAULT_OPENSSL_ROOT_DIR "${MICROSTRAIN_LIB_DIR}/openssl/lib64") - elseif(MSCL_X86) + string(REPLACE "." "_" Boost_REQUESTED_VERSION_UNDERSCORE ${Boost_REQUESTED_VERSION}) + set(DEFAULT_BOOST_ROOT "${MICROSTRAIN_LIB_DIR}/boost") set(DEFAULT_OPENSSL_ROOT_DIR "${MICROSTRAIN_LIB_DIR}/openssl/lib") - endif() - set(DEFAULT_SWIG_ROOT "${MICROSTRAIN_LIB_DIR}/swig/swigwin-4.0.0") + + if(${MSCL_ARCH_NAME} STREQUAL "x64") + string(APPEND DEFAULT_OPENSSL_ROOT_DIR "64") + endif() + + set(DEFAULT_SWIG_ROOT "${MICROSTRAIN_LIB_DIR}/swig/swigwin-4.0.0") endif() set(TURTLE_INCLUDE_DIR "${MICROSTRAIN_LIB_DIR}/turtle/include" CACHE STRING "Location to search for the turtle include files. Only used when building tests") set(NATURAL_DOCS_ROOT "${MICROSTRAIN_LIB_DIR}/NaturalDocs" CACHE STRING "Location of NaturalDocs used to generate the documentation") if(UNIX AND NOT APPLE) - set(DPKG_ROOT "" CACHE STRING "Location of the dpkg executable") - set(RPMBUILD_ROOT "" CACHE STRING "Location of the rpmbuild executable") + set(DPKG_ROOT "" CACHE STRING "Location of the dpkg executable") + set(RPMBUILD_ROOT "" CACHE STRING "Location of the rpmbuild executable") endif() # Use Git to find the version of this repo -find_package(Git) -set(DEFAULT_MSCL_GIT_VERSION "v0.0.0") -if(NOT GIT_FOUND) - message(WARNING "Unable to find git, will build with unknown version") - set(MSCL_GIT_VERSION ${DEFAULT_MSCL_GIT_VERSION}) -else() - execute_process( - COMMAND ${CMAKE_COMMAND} -E env ${GIT_EXECUTABLE} describe --tags - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE MSCL_GIT_VERSION_OUT - ERROR_VARIABLE MSCL_GIT_VERSION_ERR - RESULT_VARIABLE MSCL_GIT_VERSION_RET - ) - if(NOT ${MSCL_GIT_VERSION_RET} EQUAL 0) - message(WARNING "Unable to determine version from Git, defaulting to version ${DEFAULT_MSCL_GIT_VERSION}") - set(MSCL_GIT_VERSION ${DEFAULT_MSCL_GIT_VERSION}) - else() - set(MSCL_GIT_VERSION ${MSCL_GIT_VERSION_OUT}) - string(REGEX REPLACE "\n" "" MSCL_GIT_VERSION "${MSCL_GIT_VERSION}") - message(STATUS "MSCL Version: ${MSCL_GIT_VERSION}") - endif() -endif() +microstrain_get_git_version(MSCL_GIT_VERSION MSCL_GIT_VERSION_CLEAN) # Make the Output directory which is where we will copy all of the build artifacts on a successful build set(MSCL_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Output) file(MAKE_DIRECTORY ${MSCL_OUTPUT_DIR}) -# Setup a phony target that will zip up all the artifacts -set(MSCL_ZIP_TARGET Zip) -add_custom_target(${MSCL_ZIP_TARGET}) -set_property(TARGET ${MSCL_ZIP_TARGET} PROPERTY EXCLUDE_FROM_ALL ON) - if(MSVC) - # Parallel build options for Windows - add_compile_options(/MP) + # Parallel build options for Windows + add_compile_options(/MP) - # Ignore warnings from the linker when it can't find a pdb file - add_link_options(/ignore:4099) + # Ignore warnings from the linker when it can't find a pdb file + add_link_options(/ignore:4099) endif() # On Windows, add a few flags for compatibility with the old solution files if(WIN32) - add_compile_definitions( - WIN32 - _WINDOWS - _USRDLL - NOMINMAX - _WIN32_WINNT=0x0501 - ) + add_compile_definitions( + WIN32 + _WINDOWS + _USRDLL + NOMINMAX + _WIN32_WINNT=0x0501 + ) endif() # Don't let boost figure out the libraries to link @@ -136,7 +136,7 @@ set(Boost_REQUESTED_COMPONENTS system filesystem) # Setup the boost root variable if(NOT DEFINED Boost_ROOT) - set(Boost_ROOT "${DEFAULT_BOOST_ROOT}") + set(Boost_ROOT "${DEFAULT_BOOST_ROOT}") endif() # Find the static version of boost @@ -144,177 +144,183 @@ set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) find_package(Boost ${Boost_REQUESTED_VERSION} EXACT REQUIRED COMPONENTS ${Boost_REQUESTED_COMPONENTS}) set(Boost_STATIC_LIBRARIES ${Boost_LIBRARIES}) -message(STATUS "Boost_STATIC_LIBRARIES: " ${Boost_LIBRARIES}) # Optionally find some boost testing libraries -if(BUILD_TESTS) - set(Boost_USE_STATIC_LIBS ON) - set(Boost_USE_STATIC_RUNTIME ON) - find_package(Boost ${Boost_REQUESTED_VERSION} EXACT REQUIRED COMPONENTS unit_test_framework test_exec_monitor) - set(Boost_TEST_LIBRARIES ${Boost_LIBRARIES}) +if(MSCL_BUILD_TESTS) + set(Boost_USE_STATIC_LIBS ON) + set(Boost_USE_STATIC_RUNTIME ON) + find_package(Boost ${Boost_REQUESTED_VERSION} EXACT REQUIRED COMPONENTS unit_test_framework test_exec_monitor) + set(Boost_TEST_LIBRARIES ${Boost_LIBRARIES}) endif() # Find the shared version of boost -if(BUILD_SHARED_LIBS OR (UNIX AND BUILD_PYTHON3) OR (UNIX AND BUILD_PYTHON2)) - set(Boost_USE_STATIC_LIBS OFF) - set(Boost_USE_STATIC_RUNTIME OFF) - find_package(Boost ${Boost_REQUESTED_VERSION} EXACT REQUIRED COMPONENTS ${Boost_REQUESTED_COMPONENTS}) - set(Boost_SHARED_LIBRARIES ${Boost_LIBRARIES}) # Save the shared libraries, so they will not be overridden when we find the static libraries +if(BUILD_SHARED_LIBS OR (UNIX AND MSCL_BUILD_PYTHON3) OR (UNIX AND MSCL_BUILD_PYTHON2)) + set(Boost_USE_STATIC_LIBS OFF) + set(Boost_USE_STATIC_RUNTIME OFF) + find_package(Boost ${Boost_REQUESTED_VERSION} EXACT REQUIRED COMPONENTS ${Boost_REQUESTED_COMPONENTS}) + set(Boost_SHARED_LIBRARIES ${Boost_LIBRARIES}) # Save the shared libraries, so they will not be overridden when we find the static libraries endif() # Find the threading library find_package(Threads REQUIRED) # If we were requested to build with SSL, find OpenSSL -if(WITH_SSL) - # Ultra mega hack since we are finding the lib path of OpenSSL, we need to manually set the include path... - if(NOT DEFINED OPENSSL_ROOT_DIR) - set(OPENSSL_ROOT_DIR "${DEFAULT_OPENSSL_ROOT_DIR}") - if(MSCL_X64) - set(OPENSSL_INCLUDE_DIR ${DEFAULT_OPENSSL_ROOT_DIR}/../include64 CACHE INTERNAL "") - elseif(MSCL_X86) - set(OPENSSL_INCLUDE_DIR ${DEFAULT_OPENSSL_ROOT_DIR}/../include CACHE INTERNAL "") +if(MSCL_WITH_SSL) + # Ultra mega hack since we are finding the lib path of OpenSSL, we need to manually set the include path... + if(NOT DEFINED OPENSSL_ROOT_DIR) + set(OPENSSL_ROOT_DIR "${DEFAULT_OPENSSL_ROOT_DIR}") + if(${MSCL_ARCH_NAME} STREQUAL "x64") + set(OPENSSL_INCLUDE_DIR ${DEFAULT_OPENSSL_ROOT_DIR}/../include64 CACHE INTERNAL "") + else() + set(OPENSSL_INCLUDE_DIR ${DEFAULT_OPENSSL_ROOT_DIR}/../include CACHE INTERNAL "") + endif() + endif() + + # For some reason, FindOpenSSL does not look for the libraries again, so unset the variables to force it to search again + unset(OPENSSL_SSL_LIBRARY CACHE) + unset(OPENSSL_LIBRARIES CACHE) + unset(OPENSSL_CRYPTO_LIBRARY CACHE) + unset(LIB_EAY_DEBUG CACHE) + unset(LIB_EAY_RELEASE CACHE) + unset(SSL_EAY_DEBUG CACHE) + unset(SSL_EAY_RELEASE CACHE) + + # Shared OpenSSL + if(BUILD_SHARED_LIBS) + set(OPENSSL_USE_STATIC_LIBS FALSE) + set(OPENSSL_MSVC_STATIC_RT FALSE) + find_package(OpenSSL REQUIRED) + set(OPENSSL_SHARED_LIBRARIES ${OPENSSL_LIBRARIES}) endif() - endif() - - # For some reason, FindOpenSSL does not look for the libraries again, so unset the variables to force it to search again - unset(OPENSSL_SSL_LIBRARY CACHE) - unset(OPENSSL_LIBRARIES CACHE) - unset(OPENSSL_CRYPTO_LIBRARY CACHE) - unset(LIB_EAY_DEBUG CACHE) - unset(LIB_EAY_RELEASE CACHE) - unset(SSL_EAY_DEBUG CACHE) - unset(SSL_EAY_RELEASE CACHE) - - # Shared OpenSSL - if(BUILD_SHARED_LIBS) - set(OPENSSL_USE_STATIC_LIBS FALSE) - set(OPENSSL_MSVC_STATIC_RT FALSE) + + # For some reason, FindOpenSSL does not look for the libraries again, so unset the variables to force it to search again + unset(OPENSSL_SSL_LIBRARY CACHE) + unset(OPENSSL_LIBRARIES CACHE) + unset(OPENSSL_CRYPTO_LIBRARY CACHE) + unset(LIB_EAY_DEBUG CACHE) + unset(LIB_EAY_RELEASE CACHE) + unset(SSL_EAY_DEBUG CACHE) + unset(SSL_EAY_RELEASE CACHE) + + # Static OpenSSL + set(OPENSSL_USE_STATIC_LIBS TRUE) + set(OPENSSL_MSVC_STATIC_RT TRUE) find_package(OpenSSL REQUIRED) - set(OPENSSL_SHARED_LIBRARIES ${OPENSSL_LIBRARIES}) - endif() - - # For some reason, FindOpenSSL does not look for the libraries again, so unset the variables to force it to search again - unset(OPENSSL_SSL_LIBRARY CACHE) - unset(OPENSSL_LIBRARIES CACHE) - unset(OPENSSL_CRYPTO_LIBRARY CACHE) - unset(LIB_EAY_DEBUG CACHE) - unset(LIB_EAY_RELEASE CACHE) - unset(SSL_EAY_DEBUG CACHE) - unset(SSL_EAY_RELEASE CACHE) - - # Static OpenSSL - set(OPENSSL_USE_STATIC_LIBS TRUE) - set(OPENSSL_MSVC_STATIC_RT TRUE) - find_package(OpenSSL REQUIRED) - set(OPENSSL_STATIC_LIBRARIES ${OPENSSL_LIBRARIES}) - - # If linking on Windows, we will also need the windows crypto library - if(WIN32) - list(APPEND OPENSSL_STATIC_LIBRARIES CRYPT32.lib) - list(APPEND OPENSSL_SHARED_LIBRARIES CRYPT32.lib) - endif() + set(OPENSSL_STATIC_LIBRARIES ${OPENSSL_LIBRARIES}) + + # If linking on Windows, we will also need the windows crypto library + if(WIN32) + list(APPEND OPENSSL_STATIC_LIBRARIES CRYPT32.lib) + list(APPEND OPENSSL_SHARED_LIBRARIES CRYPT32.lib) + endif() endif() # Find language libraries if building them -if(BUILD_PYTHON3) - set(Python3_USE_STATIC_LIBS OFF) - find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +if(MSCL_BUILD_PYTHON3) + set(Python3_USE_STATIC_LIBS OFF) + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) endif() -if(BUILD_PYTHON2) - set(Python2_USE_STATIC_LIBS OFF) - find_package(Python2 REQUIRED COMPONENTS Interpreter Development) + +if(MSCL_BUILD_PYTHON2) + set(Python2_USE_STATIC_LIBS OFF) + find_package(Python2 REQUIRED COMPONENTS Interpreter Development) endif() -if(BUILD_CSHARP) - enable_language(CSharp) + +if(MSCL_BUILD_CSHARP) + enable_language(CSharp) endif() -if(BUILD_PYTHON2 OR BUILD_PYTHON3 OR BUILD_CSHARP) - # Make sure we can find swig - cmake_policy(SET CMP0078 NEW) - cmake_policy(SET CMP0086 NEW) - if(BUILD_CSHARP AND WIN32) - cmake_policy(SET CMP0122 NEW) - endif() +if(MSCL_BUILD_PYTHON2 OR MSCL_BUILD_PYTHON3 OR MSCL_BUILD_CSHARP) + # Make sure we can find swig + cmake_policy(SET CMP0078 NEW) + cmake_policy(SET CMP0086 NEW) + if(MSCL_BUILD_CSHARP AND WIN32) + cmake_policy(SET CMP0122 NEW) + endif() - set(SWIG_REQUESTED_VERSION "4.0.0" CACHE STRING "") + set(SWIG_REQUESTED_VERSION "4.0.0" CACHE STRING "") - # Attempt to find swig with a user set location - find_package(SWIG ${SWIG_REQUESTED_VERSION} QUIET) + # Attempt to find swig with a user set location + find_package(SWIG ${SWIG_REQUESTED_VERSION} QUIET) - # Set a default swig executable location and try again - if(NOT SWIG_FOUND) - set(SWIG_EXECUTABLE "${DEFAULT_SWIG_ROOT}/swig.exe") - find_package(SWIG ${SWIG_REQUESTED_VERSION} QUIET REQUIRED) - endif() + # Set a default swig executable location and try again + if(NOT SWIG_FOUND) + set(SWIG_EXECUTABLE "${DEFAULT_SWIG_ROOT}/swig.exe") + find_package(SWIG ${SWIG_REQUESTED_VERSION} QUIET REQUIRED) + endif() - # Display a found swig message since we set quiet above - message(STATUS "Found SWIG: ${SWIG_EXECUTABLE} (found suitable version \"${SWIG_VERSION}\", minimum required is \"${SWIG_REQUESTED_VERSION}\")") + # Display a found swig message since we set quiet above + message(STATUS "Found SWIG: ${SWIG_EXECUTABLE} (found suitable version \"${SWIG_VERSION}\", minimum required is \"${SWIG_REQUESTED_VERSION}\")") endif() # If we were asked to build the docs, try to find NaturalDocs -if(BUILD_DOCUMENTATION) - find_program(NaturalDocs_EXECUTABLE - NAMES NaturalDocs - PATHS ${NATURAL_DOCS_ROOT} - DOC "NaturalDocs command line client" - ) - if(${NaturalDocs_EXECUTABLE} STREQUAL "NaturalDocs_EXECUTABLE-NOTFOUND") - message(FATAL_ERROR "Unable to build docs as we were unable to find NaturalDocs in ${NATURAL_DOCS_ROOT}") - else() - message(STATUS "Found NaturalDocs: ${NaturalDocs_EXECUTABLE}") - endif() +if(MSCL_BUILD_DOCUMENTATION) + find_program(NaturalDocs_EXECUTABLE + NAMES NaturalDocs + PATHS ${NATURAL_DOCS_ROOT} + DOC "NaturalDocs command line client" + ) + if(${NaturalDocs_EXECUTABLE} STREQUAL "NaturalDocs_EXECUTABLE-NOTFOUND") + message(FATAL_ERROR "Unable to build docs as we were unable to find NaturalDocs in ${NATURAL_DOCS_ROOT}") + else() + message(STATUS "Found NaturalDocs: ${NaturalDocs_EXECUTABLE}") + endif() endif() # If we were asked to package, find the generators we can use -if(BUILD_PACKAGE AND UNIX AND NOT APPLE) - set(FOUND_CPACK_GENERATORS "") - find_program(DPKG_EXECUTABLE - NAMES dpkg - PATHS ${DPKG_ROOT} - DOC "dpkg command line client" - ) - if(NOT ${DPKG_EXECUTABLE} STREQUAL "DPKG_EXECUTABLE-NOTFOUND") - list(APPEND FOUND_CPACK_GENERATORS "DEB") - endif() - find_program(RPMBUILD_EXECUTABLE - NAMES rpmbuild - PATHS ${RPMBUILD_ROOT} - DOC "rpmbuild command line client" - ) - if(NOT ${RPMBUILD_EXECUTABLE} STREQUAL "RPMBUILD_EXECUTABLE-NOTFOUND") - list(APPEND FOUND_CPACK_GENERATORS "RPM") - endif() - if(NOT FOUND_CPACK_GENERATORS) - message(FATAL_ERROR "Unable to find either dpkg or rpmbuild, but we were requested to build a package. Make sure these exist on the system") - endif() +if(MSCL_BUILD_PACKAGE AND UNIX AND NOT APPLE) + set(FOUND_CPACK_GENERATORS "") + find_program(DPKG_EXECUTABLE + NAMES dpkg + PATHS ${DPKG_ROOT} + DOC "dpkg command line client" + ) + if(NOT ${DPKG_EXECUTABLE} STREQUAL "DPKG_EXECUTABLE-NOTFOUND") + list(APPEND FOUND_CPACK_GENERATORS "DEB") + endif() + find_program(RPMBUILD_EXECUTABLE + NAMES rpmbuild + PATHS ${RPMBUILD_ROOT} + DOC "rpmbuild command line client" + ) + if(NOT ${RPMBUILD_EXECUTABLE} STREQUAL "RPMBUILD_EXECUTABLE-NOTFOUND") + list(APPEND FOUND_CPACK_GENERATORS "RPM") + endif() + if(NOT FOUND_CPACK_GENERATORS) + message(FATAL_ERROR "Unable to find either dpkg or rpmbuild, but we were requested to build a package. Make sure these exist on the system") + endif() +endif() + +if(MSCL_ZIP_EXAMPLES) + set(MSCL_EXAMPLES_OUTPUT_DIR "${MSCL_OUTPUT_DIR}/Examples") + + # Also copy the test source and build files to the output directory so it can be compressed + set(MSCL_EXAMPLES_TARGET MSCL_Examples_Zip) + add_custom_target(${MSCL_EXAMPLES_TARGET} + ALL + COMMAND ${CMAKE_COMMAND} -E remove_directory "${MSCL_EXAMPLES_OUTPUT_DIR}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${MSCL_EXAMPLES_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMSCL.cmake ${MSCL_EXAMPLES_OUTPUT_DIR}/cmake/FindMSCL.cmake + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMSCL_Managed.cmake ${MSCL_EXAMPLES_OUTPUT_DIR}/cmake/FindMSCL_Managed.cmake + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/MSCL_Examples ${MSCL_EXAMPLES_OUTPUT_DIR}/MSCL_Examples + ) + + set(MSCL_EXAMPLES_INSTALL_COMPONENT ${PROJECT_NAME}_EXAMPLES) + install( + DIRECTORY "${MSCL_EXAMPLES_OUTPUT_DIR}/" + DESTINATION . + COMPONENT ${MSCL_EXAMPLES_INSTALL_COMPONENT} + ) endif() # Add the underlying CMake files -add_subdirectory(MSCL) -if(BUILD_EXAMPLES) - add_subdirectory(MSCL_Examples) - - # Also copy the test source and build files to the output directory so it can be compressed - set(MSCL_EXAMPLES_OUTPUT_DIR "${MSCL_OUTPUT_DIR}/Examples") - add_custom_target(MSCL_Examples_Copy - ALL - COMMAND ${CMAKE_COMMAND} -E remove_directory "${MSCL_EXAMPLES_OUTPUT_DIR}" - COMMAND ${CMAKE_COMMAND} -E make_directory ${MSCL_EXAMPLES_OUTPUT_DIR} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMSCL.cmake ${MSCL_EXAMPLES_OUTPUT_DIR}/cmake/FindMSCL.cmake - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMSCL_Managed.cmake ${MSCL_EXAMPLES_OUTPUT_DIR}/cmake/FindMSCL_Managed.cmake - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/MSCL_Examples ${MSCL_EXAMPLES_OUTPUT_DIR}/MSCL_Examples - ) - - # Zip up the examples - add_custom_target(MSCL_Examples_Zip - WORKING_DIRECTORY ${MSCL_OUTPUT_DIR} - DEPENDS MSCL_Examples_Copy - COMMAND ${CMAKE_COMMAND} -E tar "cf" "${MSCL_OUTPUT_DIR}/mscl_${MSCL_GIT_VERSION}_Examples.zip" --format=zip "Examples" - ) - add_dependencies(${MSCL_ZIP_TARGET} MSCL_Examples_Zip) +if(MSCL_BUILD_EXAMPLES) + add_subdirectory(MSCL_Examples) endif() -if(BUILD_TESTS) - enable_testing() - add_subdirectory(MSCL_Unit_Tests) + +add_subdirectory(MSCL) + +if(MSCL_BUILD_TESTS) + enable_testing() + add_subdirectory(MSCL_Unit_Tests) endif() diff --git a/Jenkinsfile b/Jenkinsfile index 0c989e4ab..524edd1d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,9 +3,9 @@ def python3Versions() { // Different version depending on the OS String[] versions; if (isUnix()) { - versions = ["3.7.16", "3.8.16", "3.9.16", "3.10.9", "3.11.1"]; + versions = ["3.9.21", "3.10.16", "3.11.11", "3.12.8", "3.13.1"]; } else { - versions = ["3.7.0", "3.8.0", "3.9.0", "3.10.0", "3.11.0"]; + versions = ["3.9.0", "3.10.0", "3.11.0", "3.12.0", "3.13.0"]; } // If a PR build, just build the most recent, otherwise build all versions @@ -23,6 +23,23 @@ pipeline { timeout(time: 3, unit: 'HOURS') } stages { + stage('Pre-Release') { + agent { label 'linux-amd64' } + options { + skipDefaultCheckout() + // TODO: Fix timeout issues on Jenkins for console activity +// timeout(time: 10, activity: true, unit: 'MINUTES') + } + steps { + checkout scm + withCredentials([string(credentialsId: 'Github_Token', variable: 'GH_TOKEN')]) { + sh ''' + # Pre-release check/update before building on develop + "${WORKSPACE}/BuildScripts/prerelease.sh" --target "${BRANCH_NAME}" + ''' + } + } + } stage('Build') { // Run the windows and linux builds in parallel parallel { @@ -30,20 +47,21 @@ pipeline { agent { label 'windows10' } options { skipDefaultCheckout() - timeout(time: 20, activity: true, unit: 'MINUTES') + // TODO: Fix timeout issues on Jenkins for console activity +// timeout(time: 20, activity: true, unit: 'MINUTES') } steps { cleanWs() checkout scm powershell '.devcontainer/docker_build_win.ps1 -arch x64 -python3_versions "' + python3Versions() + '"' archiveArtifacts artifacts: 'build_windows_x64/*.zip' - archiveArtifacts artifacts: 'build_windows_x64_for_release/*.zip' } } stage('Windows x86') { agent { label 'windows10' } options { skipDefaultCheckout() + // TODO: Fix timeout issues on Jenkins for console activity timeout(time: 20, activity: true, unit: 'MINUTES') } steps { @@ -51,76 +69,91 @@ pipeline { checkout scm powershell '.devcontainer/docker_build_win.ps1 -arch x86 -python3_versions "' + python3Versions() + '"' archiveArtifacts artifacts: 'build_windows_x86/*.zip' - archiveArtifacts artifacts: 'build_windows_x86_for_release/*.zip' } } stage('DEB AMD64') { agent { label 'linux-amd64' } options { skipDefaultCheckout() - timeout(time: 20, activity: true, unit: 'MINUTES') + // TODO: Fix timeout issues on Jenkins for console activity +// timeout(time: 20, activity: true, unit: 'MINUTES') } steps { cleanWs() checkout scm sh '.devcontainer/docker_build_debs.sh --arch amd64 --python3Versions "' + python3Versions() + '"' archiveArtifacts artifacts: 'build_ubuntu_amd64/*.deb' - archiveArtifacts artifacts: 'build_ubuntu_amd64_for_release/*.deb' } } stage('DEB ARM64') { agent { label 'linux-arm64' } options { skipDefaultCheckout() - timeout(time: 20, activity: true, unit: 'MINUTES') + // TODO: Fix timeout issues on Jenkins for console activity +// timeout(time: 20, activity: true, unit: 'MINUTES') } steps { cleanWs() checkout scm sh '.devcontainer/docker_build_debs.sh --arch arm64v8 --python3Versions "' + python3Versions() + '"' archiveArtifacts artifacts: 'build_ubuntu_arm64v8/*.deb' - archiveArtifacts artifacts: 'build_ubuntu_arm64v8_for_release/*.deb' } } stage('DEB ARM32') { agent { label 'linux-arm64' } options { skipDefaultCheckout() - timeout(time: 20, activity: true, unit: 'MINUTES') + // TODO: Fix timeout issues on Jenkins for console activity +// timeout(time: 20, activity: true, unit: 'MINUTES') } steps { cleanWs() checkout scm sh '.devcontainer/docker_build_debs.sh --arch arm32v7 --python3Versions "' + python3Versions() + '"' archiveArtifacts artifacts: 'build_ubuntu_arm32v7/*.deb' - archiveArtifacts artifacts: 'build_ubuntu_arm32v7_for_release/*.deb' } } } } } -// post { -// failure { -// script { -// if (BRANCH_NAME && (BRANCH_NAME == 'main' || BRANCH_NAME == 'master')) { -// mail to: "${env.Notification_Emails_MSCL}", -// subject: "Build Failed in Jenkins: ${env.JOB_NAME}", -// body: "See: ${env.BUILD_URL}", -// charset: 'UTF-8', -// mimeType: 'text/html'; -// } -// } -// } -// changed { -// script { -// if (BRANCH_NAME && (BRANCH_NAME == 'main' || BRANCH_NAME == 'master') && currentBuild.currentResult == 'SUCCESS') { // Other values: FAILURE, UNSTABLE -// mail to: "${env.Notification_Emails_MSCL}", -// subject: "Jenkins build is back to normal: ${env.JOB_NAME}", -// body: "See: ${env.BUILD_URL}", -// charset: 'UTF-8', -// mimeType: 'text/html'; -// } -// } -// } -// } + post { + success { + script { + if (BRANCH_NAME && BRANCH_NAME == 'develop') { + node("linux-amd64") { + dir("/tmp/mscl_${env.BRANCH_NAME}_${currentBuild.number}") { + copyArtifacts(projectName: "${env.JOB_NAME}", selector: specific("${currentBuild.number}")); + withCredentials([string(credentialsId: 'Github_Token', variable: 'GH_TOKEN')]) { + sh ''' + # Release to github + "${WORKSPACE}/BuildScripts/release.sh" \ + --artifacts "$(find "$(pwd)" -type f)" \ + --target "${BRANCH_NAME}" \ + --release "latest" \ + --docs-zip "$(find "$(pwd)" -type f -name "MSCL_Documentation_*.zip" | sort | uniq)" \ + --generate-notes + ''' + } + } + } + } else if (BRANCH_NAME && BRANCH_NAME == 'master') { + node("linux-amd64") { + dir("/tmp/mscl_${env.BRANCH_NAME}_${currentBuild.number}") { + copyArtifacts(projectName: "${env.JOB_NAME}", selector: specific("12")); + withCredentials([string(credentialsId: 'Github_Token', variable: 'GH_TOKEN')]) { + sh ''' + # Release to github. The release script will determine if master needs to be published + "${WORKSPACE}/BuildScripts/release.sh" \ + --artifacts "$(find "$(pwd)" -type f)" \ + --target "${BRANCH_NAME}" \ + --release "$(cd ${WORKSPACE} && git describe --match "v*" --abbrev=0 --tags HEAD)" \ + --docs-zip "$(find "$(pwd)" -type f -name "MSCL_Documentation_*.zip" | sort | uniq)" + ''' + } + } + } + } + } + } + } } diff --git a/MSCL/CMakeLists.txt b/MSCL/CMakeLists.txt index 4e67050ef..35563ece0 100644 --- a/MSCL/CMakeLists.txt +++ b/MSCL/CMakeLists.txt @@ -1,106 +1,135 @@ -project(MSCL) +# Get the Git version to use for the version file generation +microstrain_extract_git_version(MSCL_GIT_VERSION_CLEAN MSCL_GIT_VERSION_MAJOR MSCL_GIT_VERSION_MINOR MSCL_GIT_VERSION_PATCH) + +# Get the current year to make sure the file copyright is up-to-date +string(TIMESTAMP MSCL_CURRENT_YEAR "%Y") + +set(MSCL_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") +set(MSCL_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/source") +set(MSCL_SOURCE_FILES_DIR "${MSCL_SOURCE_DIR}/mscl") + +# Generate the version header file +set(VERSION_FILE "LibVersion.h") +set(MSCL_VERSION_IN_FILE "${CMAKE_CURRENT_LIST_DIR}/../cmake/${VERSION_FILE}.in") +set(MSCL_VERSION_OUT_FILE "${MSCL_SOURCE_FILES_DIR}/${VERSION_FILE}") +configure_file(${MSCL_VERSION_IN_FILE} ${MSCL_VERSION_OUT_FILE}) + +if(MSCL_BUILD_CSHARP) + # Generate the assembly info file for CSharp + set(ASSEMBLY_FILE "AssemblyInfo.cs") + set(MSCL_ASSEMBLY_CS_IN_FILE "${CMAKE_CURRENT_LIST_DIR}/../cmake/${ASSEMBLY_FILE}.in") + set(MSCL_ASSEMBLY_CS_OUT_FILE "${MSCL_SOURCE_FILES_DIR}/Wrapper/CSharp/Properties/${ASSEMBLY_FILE}") + configure_file(${MSCL_ASSEMBLY_CS_IN_FILE} ${MSCL_ASSEMBLY_CS_OUT_FILE}) +endif() # Since we use globs here we won't need to update this file every time. # NOTE: If building locally and you add a file, you will need to reconfigure CMake to make it appear to the glob file(GLOB_RECURSE SRC_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source/**/*.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/source/**/*.h + ${MSCL_SOURCE_DIR}/**/*.cpp + ${MSCL_SOURCE_DIR}/**/*.h ) # Create VS filters based on file directories foreach(FILE ${SRC_FILES}) - # Get the directory of the source file - get_filename_component(PARENT_DIR "${FILE}" DIRECTORY) + # Get the directory of the source file + get_filename_component(PARENT_DIR "${FILE}" DIRECTORY) - # Remove common directory prefix to make the group and removed the trailing mscl source directory - string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/source/mscl" "" GROUP "${PARENT_DIR}") + # Remove common directory prefix to make the group and removed the trailing mscl source directory + string(REPLACE "${MSCL_SOURCE_FILES_DIR}" "" GROUP "${PARENT_DIR}") - # Make sure we are using windows slashes - string(REPLACE "/" "\\" GROUP "${GROUP}") + # Make sure we are using windows slashes + string(REPLACE "/" "\\" GROUP "${GROUP}") - # Group into "Source Files" and "Header Files" - if("${FILE}" MATCHES ".*\\.cpp") - set(GROUP "Source Files${GROUP}") - elseif("${FILE}" MATCHES ".*\\.h") - set(GROUP "Header Files${GROUP}") - endif() + # Group into "Source Files" and "Header Files" + if("${FILE}" MATCHES ".*\\.cpp") + set(GROUP "Source Files${GROUP}") + elseif("${FILE}" MATCHES ".*\\.h") + set(GROUP "Header Files${GROUP}") + endif() - source_group("${GROUP}" FILES "${FILE}") + source_group("${GROUP}" FILES "${FILE}") endforeach() - # Files that should only be compiled on windows set(WINDOWS_ONLY_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/WsdaFinder.h - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/WsdaFinder.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/UpnpService.h - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/UpnpService.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/UpnpDeviceFinderCallback.h - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/UpnpDeviceFinderCallback.cpp + ${MSCL_SOURCE_FILES_DIR}/Communication/WsdaFinder.h + ${MSCL_SOURCE_FILES_DIR}/Communication/WsdaFinder.cpp + ${MSCL_SOURCE_FILES_DIR}/Communication/UpnpService.h + ${MSCL_SOURCE_FILES_DIR}/Communication/UpnpService.cpp + ${MSCL_SOURCE_FILES_DIR}/Communication/UpnpDeviceFinderCallback.h + ${MSCL_SOURCE_FILES_DIR}/Communication/UpnpDeviceFinderCallback.cpp ) # Files that should only be compiled on linux set(LINUX_ONLY_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Communication/UnixSocketConnection.cpp + ${MSCL_SOURCE_FILES_DIR}/Communication/UnixSocketConnection.cpp ) # Excluded file on all OSes set(LIB_EXCLUDED_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper/MSCL_Wrap.cpp + ${MSCL_SOURCE_FILES_DIR}/Wrapper/MSCL_Wrap.cpp ) # Remove files from the list based on the OS if(WIN32) - foreach(item_to_remove IN LISTS LINUX_ONLY_FILES) - list(REMOVE_ITEM SRC_FILES "${item_to_remove}") - endforeach() + foreach(item_to_remove IN LISTS LINUX_ONLY_FILES) + list(REMOVE_ITEM SRC_FILES "${item_to_remove}") + endforeach() endif() + if(UNIX) - foreach(item_to_remove IN LISTS WINDOWS_ONLY_FILES) - list(REMOVE_ITEM SRC_FILES "${item_to_remove}") - endforeach() + foreach(item_to_remove IN LISTS WINDOWS_ONLY_FILES) + list(REMOVE_ITEM SRC_FILES "${item_to_remove}") + endforeach() endif() + foreach(item_to_remove IN LISTS LIB_EXCLUDED_FILES) - list(REMOVE_ITEM SRC_FILES "${item_to_remove}") + list(REMOVE_ITEM SRC_FILES "${item_to_remove}") endforeach() # Configure some compiler flags set(LIB_DEFINES "") -if(NOT WITH_SSL) - list(APPEND LIB_DEFINES MSCL_DISABLE_SSL) + +if(NOT MSCL_WITH_SSL) + list(APPEND LIB_DEFINES MSCL_DISABLE_SSL) endif() -if(NOT WITH_WEBSOCKETS) - list(APPEND LIB_DEFINES MSCL_DISABLE_WEBSOCKETS) + +if(NOT MSCL_WITH_WEBSOCKETS) + list(APPEND LIB_DEFINES MSCL_DISABLE_WEBSOCKETS) endif() + if(UNIX) - list(APPEND LIB_DEFINES UNIX_BUILD) + list(APPEND LIB_DEFINES UNIX_BUILD) endif() # Add some include directories set(LIB_INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/source + ${Boost_INCLUDE_DIRS} + ${MSCL_SOURCE_DIR} ) -if(WITH_SSL) - list(APPEND LIB_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) + +if(MSCL_WITH_SSL) + list(APPEND LIB_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) endif() # Collect the list of shared libraries to link against if building shared if(BUILD_SHARED_LIBS) - set(LIB_SHARED_LIBRARIES - ${Boost_SHARED_LIBRARIES} - ) - if(WITH_SSL) - list(APPEND LIB_SHARED_LIBRARIES ${OPENSSL_SHARED_LIBRARIES}) - endif() + set(LIB_SHARED_LIBRARIES + ${Boost_SHARED_LIBRARIES} + ) + + if(MSCL_WITH_SSL) + list(APPEND LIB_SHARED_LIBRARIES ${OPENSSL_SHARED_LIBRARIES}) + endif() endif() # Collect the list of static libraries to link against if building static set(LIB_STATIC_LIBRARIES - ${Boost_STATIC_LIBRARIES} + ${Boost_STATIC_LIBRARIES} ) -if(WITH_SSL) - list(APPEND LIB_STATIC_LIBRARIES ${OPENSSL_STATIC_LIBRARIES}) + +if(MSCL_WITH_SSL) + list(APPEND LIB_STATIC_LIBRARIES ${OPENSSL_STATIC_LIBRARIES}) endif() # Build both the C++ shared and static libraries if configured to do so @@ -111,19 +140,19 @@ set(LIB_NAME_SHARED ${LIB_NAME}_Shared) add_library(${LIB_NAME_STATIC} STATIC ${SRC_FILES}) set(LIB_NAME_STATIC_DIR ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME_STATIC}) set_target_properties(${LIB_NAME_STATIC} - PROPERTIES - OUTPUT_NAME ${LIB_NAME} - COMPILE_PDB_NAME ${LIB_NAME} - COMPILE_PDB_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} - ARCHIVE_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} - LIBRARY_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} - RUNTIME_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} + PROPERTIES + OUTPUT_NAME ${LIB_NAME} + COMPILE_PDB_NAME ${LIB_NAME} + COMPILE_PDB_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} + ARCHIVE_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} + LIBRARY_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} + RUNTIME_OUTPUT_DIRECTORY ${LIB_NAME_STATIC_DIR} ) # Configure some precompiled headers target_precompile_headers(${LIB_NAME_STATIC} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/source/stdafx.h - ${CMAKE_CURRENT_SOURCE_DIR}/source/stdafx.cpp + ${MSCL_SOURCE_DIR}/stdafx.h + ${MSCL_SOURCE_DIR}/stdafx.cpp ) # In order to copy the headers, create a cmake script that will do the copying @@ -132,432 +161,506 @@ set(MSCL_STATIC_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/C++/Static/${LIB_NAME}) set(MSCL_STATIC_OUTPUT_INCLUDE_DIR ${MSCL_STATIC_OUTPUT_DIR}/include) set(MSCL_STATIC_OUTPUT_LIB_DIR ${MSCL_STATIC_OUTPUT_DIR}/lib/${MSCL_ARCH_NAME}/$) file(GENERATE - OUTPUT ${MSCL_STATIC_HEADER_CP_SCRIPT} - CONTENT "file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl DESTINATION ${MSCL_STATIC_OUTPUT_INCLUDE_DIR} FILES_MATCHING PATTERN *.h PATTERN Wrapper EXCLUDE)\n" + OUTPUT ${MSCL_STATIC_HEADER_CP_SCRIPT} + CONTENT "file(COPY ${MSCL_SOURCE_FILES_DIR} DESTINATION ${MSCL_STATIC_OUTPUT_INCLUDE_DIR} FILES_MATCHING PATTERN *.h PATTERN Wrapper EXCLUDE)\n" ) # Copy the artifacts to an Output directory to make it easier for users to navigate the artifacts add_custom_command(TARGET ${LIB_NAME_STATIC} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_STATIC_OUTPUT_INCLUDE_DIR} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_STATIC_OUTPUT_LIB_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_directory $ ${MSCL_STATIC_OUTPUT_LIB_DIR} - COMMAND ${CMAKE_COMMAND} -P ${MSCL_STATIC_HEADER_CP_SCRIPT} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_STATIC_OUTPUT_INCLUDE_DIR} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_STATIC_OUTPUT_LIB_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory $ ${MSCL_STATIC_OUTPUT_LIB_DIR} + COMMAND ${CMAKE_COMMAND} -P ${MSCL_STATIC_HEADER_CP_SCRIPT} ) -if(UNIX) - # If running on linux, mark the target for installation - install( +include(GNUInstallDirs) + +if(MSVC) + set(MSCL_STATIC_INSTALL_LIBDIR "MSCL/${CMAKE_INSTALL_LIBDIR}/${MSCL_ARCH_NAME}/$") + set(MSCL_STATIC_INSTALL_INCLUDEDIR "MSCL/${CMAKE_INSTALL_INCLUDEDIR}") +else() + set(MSCL_STATIC_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}") + set(MSCL_STATIC_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") +endif() + +set(MSCL_STATIC_INSTALL_COMPONENT ${PROJECT_NAME}_STATIC) +install( TARGETS ${LIB_NAME_STATIC} - DESTINATION "lib" - COMPONENT static - ) - install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/source/mscl" - DESTINATION "include" - COMPONENT static + DESTINATION "${MSCL_STATIC_INSTALL_LIBDIR}" + COMPONENT ${MSCL_STATIC_INSTALL_COMPONENT} +) +install( + DIRECTORY "${MSCL_SOURCE_FILES_DIR}" + DESTINATION "${MSCL_STATIC_INSTALL_INCLUDEDIR}" + COMPONENT ${MSCL_STATIC_INSTALL_COMPONENT} FILES_MATCHING PATTERN "*.h" - ) -endif() + PATTERN "Wrapper" EXCLUDE +) + if(BUILD_SHARED_LIBS) - add_library(${LIB_NAME_SHARED} SHARED ${SRC_FILES}) - set(LIB_NAME_SHARED_DIR ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME_SHARED}) - set_target_properties(${LIB_NAME_SHARED} - PROPERTIES - OUTPUT_NAME ${LIB_NAME} - PDB_NAME ${LIB_NAME} - PDB_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} - ARCHIVE_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} - LIBRARY_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} - RUNTIME_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} - ) - - # Configure some precompiled headers - target_precompile_headers(${LIB_NAME_SHARED} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/source/stdafx.h - ${CMAKE_CURRENT_SOURCE_DIR}/source/stdafx.cpp - ) - - # In order to copy the headers, create a cmake script that will do the copying - set(MSCL_SHARED_HEADER_CP_SCRIPT ${CMAKE_BINARY_DIR}/${LIB_NAME_SHARED}_$_header_cp.cmake) - set(MSCL_SHARED_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/C++/Shared/${LIB_NAME}) - set(MSCL_SHARED_OUTPUT_INCLUDE_DIR ${MSCL_SHARED_OUTPUT_DIR}/include) - set(MSCL_SHARED_OUTPUT_LIB_DIR ${MSCL_SHARED_OUTPUT_DIR}/lib/${MSCL_ARCH_NAME}/$) - file(GENERATE - OUTPUT ${MSCL_SHARED_HEADER_CP_SCRIPT} - CONTENT "file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl DESTINATION ${MSCL_SHARED_OUTPUT_INCLUDE_DIR} FILES_MATCHING PATTERN *.h PATTERN Wrapper EXCLUDE)\n" - ) - - # Copy the artifacts to an Output directory to make it easier for users to navigate the artifacts - add_custom_command(TARGET ${LIB_NAME_SHARED} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_SHARED_OUTPUT_INCLUDE_DIR} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_SHARED_OUTPUT_LIB_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_directory $ ${MSCL_SHARED_OUTPUT_LIB_DIR} - COMMAND ${CMAKE_COMMAND} -P ${MSCL_SHARED_HEADER_CP_SCRIPT} - ) - - if(UNIX) - # If running on linux, mark the target for installation + add_library(${LIB_NAME_SHARED} SHARED ${SRC_FILES}) + set(LIB_NAME_SHARED_DIR ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME_SHARED}) + set_target_properties(${LIB_NAME_SHARED} + PROPERTIES + OUTPUT_NAME ${LIB_NAME} + PDB_NAME ${LIB_NAME} + PDB_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} + ARCHIVE_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} + LIBRARY_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} + RUNTIME_OUTPUT_DIRECTORY ${LIB_NAME_SHARED_DIR} + ) + + # Configure some precompiled headers + target_precompile_headers(${LIB_NAME_SHARED} PRIVATE + ${MSCL_SOURCE_DIR}/stdafx.h + ${MSCL_SOURCE_DIR}/stdafx.cpp + ) + + # In order to copy the headers, create a cmake script that will do the copying + set(MSCL_SHARED_HEADER_CP_SCRIPT ${CMAKE_BINARY_DIR}/${LIB_NAME_SHARED}_$_header_cp.cmake) + set(MSCL_SHARED_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/C++/Shared/${LIB_NAME}) + set(MSCL_SHARED_OUTPUT_INCLUDE_DIR ${MSCL_SHARED_OUTPUT_DIR}/include) + set(MSCL_SHARED_OUTPUT_LIB_DIR ${MSCL_SHARED_OUTPUT_DIR}/lib/${MSCL_ARCH_NAME}/$) + file(GENERATE + OUTPUT ${MSCL_SHARED_HEADER_CP_SCRIPT} + CONTENT "file(COPY ${MSCL_SOURCE_FILES_DIR} DESTINATION ${MSCL_SHARED_OUTPUT_INCLUDE_DIR} FILES_MATCHING PATTERN *.h PATTERN Wrapper EXCLUDE)\n" + ) + + # Copy the artifacts to an Output directory to make it easier for users to navigate the artifacts + add_custom_command(TARGET ${LIB_NAME_SHARED} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_SHARED_OUTPUT_INCLUDE_DIR} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_SHARED_OUTPUT_LIB_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory $ ${MSCL_SHARED_OUTPUT_LIB_DIR} + COMMAND ${CMAKE_COMMAND} -P ${MSCL_SHARED_HEADER_CP_SCRIPT} + ) + + include(GNUInstallDirs) + + if(MSVC) + set(MSCL_SHARED_INSTALL_LIBDIR "MSCL/${CMAKE_INSTALL_LIBDIR}/${MSCL_ARCH_NAME}/$") + set(MSCL_SHARED_INSTALL_INCLUDEDIR "MSCL/${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(MSCL_SHARED_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}") + set(MSCL_SHARED_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") + endif() + + set(MSCL_SHARED_INSTALL_COMPONENT ${PROJECT_NAME}_SHARED) install( - TARGETS ${LIB_NAME_SHARED} - DESTINATION "lib" - COMPONENT shared + TARGETS ${LIB_NAME_SHARED} + DESTINATION "${MSCL_SHARED_INSTALL_LIBDIR}" + COMPONENT ${MSCL_SHARED_INSTALL_COMPONENT} ) + install( - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/source/mscl" - DESTINATION "include" - COMPONENT shared - FILES_MATCHING PATTERN "*.h" + DIRECTORY "${MSCL_SOURCE_FILES_DIR}" + DESTINATION "${MSCL_SHARED_INSTALL_INCLUDEDIR}" + COMPONENT ${MSCL_SHARED_INSTALL_COMPONENT} + FILES_MATCHING PATTERN "*.h" + PATTERN "Wrapper" EXCLUDE ) - endif() endif() # Compiler definitions target_compile_definitions(${LIB_NAME_STATIC} PRIVATE ${LIB_DEFINES}) target_include_directories(${LIB_NAME_STATIC} PUBLIC ${LIB_INCLUDE_DIRS}) target_compile_options(${LIB_NAME_STATIC} PRIVATE - $<$:-fPIC> # Normally static libraries aren't compiled with this flag, but we need it to compile our bindings properly - $<$:/MT$<$:d>> - $<$:/MP> + $<$:-fPIC> # Normally static libraries aren't compiled with this flag, but we need it to compile our bindings properly + $<$:/MT$<$:d>> + $<$:/MP> ) + if(BUILD_SHARED_LIBS) - if(MSVC) - target_compile_options(${LIB_NAME_SHARED} PRIVATE - /MD$<$:d> - /MP - ) - endif() - target_compile_definitions(${LIB_NAME_SHARED} PRIVATE ${LIB_DEFINES}) - target_include_directories(${LIB_NAME_SHARED} PUBLIC ${LIB_INCLUDE_DIRS}) + if(MSVC) + target_compile_options(${LIB_NAME_SHARED} PRIVATE + /MD$<$:d> + /MP + ) + endif() + + target_compile_definitions(${LIB_NAME_SHARED} PRIVATE ${LIB_DEFINES}) + target_include_directories(${LIB_NAME_SHARED} PUBLIC ${LIB_INCLUDE_DIRS}) endif() # Shared linker options if(BUILD_SHARED_LIBS) - if(UNIX AND LINK_STATIC_DEPS) - target_link_libraries(${LIB_NAME_SHARED} PUBLIC ${LIB_STATIC_LIBRARIES}) - else() - target_link_libraries(${LIB_NAME_SHARED} PUBLIC ${LIB_SHARED_LIBRARIES}) - endif() + if(UNIX AND MSCL_LINK_STATIC_DEPS) + target_link_libraries(${LIB_NAME_SHARED} PUBLIC ${LIB_STATIC_LIBRARIES}) + else() + target_link_libraries(${LIB_NAME_SHARED} PUBLIC ${LIB_SHARED_LIBRARIES}) + endif() endif() # Optionally generate the language bindings using swig -if(BUILD_PYTHON2 OR BUILD_PYTHON3 OR BUILD_CSHARP) - include(UseSWIG) - include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/mscl_python_swig.cmake) - - if(MSVC) - # Linking through the MSCL cmake interface causes linker error 4197. This is related to swig and can be ignored - #TODO: Figure out how to fix this linker error - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4197") - endif() - - # Set up our source - set(SWIG_SOURCE_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper/MSCL_Main_Interface.i - ) - set_property(SOURCE ${SWIG_SOURCE_FILES} PROPERTY CPLUSPLUS ON) - - # Different compile flags depending on the platform - set(PYTHON_COMPILE_OPTIONS $<$:/bigobj /MT$<$:d>>) - set(PYTHON_LINK_OPTIONS $<$:-Wl,--no-as-needed>) - set(PYTHON_LINK_LIBRARIES ${LIB_NAME_STATIC}) - if((UNIX AND LINK_STATIC_DEPS) OR WIN32) - list(APPEND PYTHON_LINK_LIBRARIES ${Boost_STATIC_LIBRARIES}) - else() - list(APPEND PYTHON_LINK_LIBRARIES ${Boost_SHARED_LIBRARIES}) - endif() - if(WITH_SSL) - if((UNIX AND PYTHON_STATIC_DEPS) OR WIN32) - list(APPEND PYTHON_LINK_LIBRARIES ${OPENSSL_STATIC_LIBRARIES}) - else() - list(APPEND PYTHON_LINK_LIBRARIES ${OPENSSL_SHARED_LIBRARIES}) +if(MSCL_BUILD_PYTHON2 OR MSCL_BUILD_PYTHON3 OR MSCL_BUILD_CSHARP) + include(UseSWIG) + include(mscl_python_swig) + + if(MSVC) + # Linking through the MSCL cmake interface causes linker error 4197. This is related to swig and can be ignored + #TODO: Figure out how to fix this linker error + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4197") endif() - endif() - - # Build for python3 - if(BUILD_PYTHON3) - set(PYTHON3_MODULE_NAME MSCL_Python3) - set(MSCL_PYTHON3_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}) - mscl_python_swig( - MODULE_NAME ${PYTHON3_MODULE_NAME} - MODULE_VERSION ${MSCL_GIT_VERSION} - OUTPUT_NAME mscl - OUTPUT_DIR ${MSCL_OUTPUT_DIR} - PYTHON_VERSION ${MSCL_PYTHON3_VERSION} - ARCH ${MSCL_ARCH_NAME} - SOURCES ${SWIG_SOURCE_FILES} - COMPILE_OPTIONS ${PYTHON_COMPILE_OPTIONS} - COMPILE_DEFINITIONS ${LIB_DEFINES} SWIG_PYTHON_INTERPRETER_NO_DEBUG - INCLUDE_DIRECTORIES ${LIB_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper # Temp fix for bad include paths - LINK_DIRECTORIES ${Python3_LIBRARY_DIRS} - LINK_OPTIONS ${PYTHON_LINK_OPTIONS} - LINK_LIBRARIES ${PYTHON_LINK_LIBRARIES} ${Python3_LIBRARIES} - ) - endif() - - # Build for python2 - if(BUILD_PYTHON2) - set(PYTHON2_MODULE_NAME MSCL_Python2) - set(MSCL_PYTHON2_VERSION ${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}) - mscl_python_swig( - MODULE_NAME ${PYTHON2_MODULE_NAME} - MODULE_VERSION ${MSCL_GIT_VERSION} - OUTPUT_NAME mscl - OUTPUT_DIR ${MSCL_OUTPUT_DIR} - PYTHON_VERSION ${MSCL_PYTHON2_VERSION} - ARCH ${MSCL_ARCH_NAME} - SOURCES ${SWIG_SOURCE_FILES} - COMPILE_OPTIONS ${PYTHON_COMPILE_OPTIONS} - COMPILE_DEFINITIONS ${LIB_DEFINES} SWIG_PYTHON_INTERPRETER_NO_DEBUG - INCLUDE_DIRECTORIES ${LIB_INCLUDE_DIRS} ${Python2_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper # Temp fix for bad include paths - LINK_DIRECTORIES ${Python2_LIBRARY_DIRS} - LINK_OPTIONS ${PYTHON_LINK_OPTIONS} - LINK_LIBRARIES ${PYTHON_LINK_LIBRARIES} ${Python2_LIBRARIES} - ) - endif() - - # Build C# on Windows - # Wish we could generate it the same as python, but we need to get the list of CSharp files - if(BUILD_CSHARP) - set(CSHARP_MODULE_NAME MSCL_CSharp) - - # Hack of all hacks, but we need to generate the source separately so we can determine the source files at configure time - set(CSHARP_MODULE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CSHARP_MODULE_NAME}) - set(CSHARP_MODULE_CPP_FILE ${CSHARP_MODULE_DIR}/MSCL_Main_InterfaceCSHARP_wrap.cxx) - file(MAKE_DIRECTORY ${CSHARP_MODULE_DIR}) - message(STATUS "Generating CSharp binding source") - execute_process( - COMMAND ${CMAKE_COMMAND} -E env SWIG_LIB=${SWIG_DIR} "${SWIG_EXECUTABLE}" -csharp -namespace mscl -outdir "${CSHARP_MODULE_DIR}" -c++ -dllimport MSCL -o "${CSHARP_MODULE_CPP_FILE}" "${SWIG_SOURCE_FILES}" - COMMAND_ERROR_IS_FATAL ANY - ) - file(GLOB MSCL_GENERATED_CSHARP_SOURCE - ${CSHARP_MODULE_DIR}/*.cs - ) - # Build the C++ wrapper - add_library(${CSHARP_MODULE_NAME} SHARED ${CSHARP_MODULE_CPP_FILE}) - target_compile_options(${CSHARP_MODULE_NAME} PRIVATE - /bigobj - /MT$<$:d> - /MP + # Set up our source + set(SWIG_SOURCE_FILES + ${MSCL_SOURCE_FILES_DIR}/Wrapper/MSCL_Main_Interface.i ) - target_compile_definitions(${CSHARP_MODULE_NAME} PRIVATE - ${LIB_DEFINES} - ) - target_include_directories(${CSHARP_MODULE_NAME} PUBLIC - ${LIB_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper # Temp fix for bad include path - ) - target_link_libraries(${CSHARP_MODULE_NAME} PRIVATE - ${LIB_NAME_STATIC} ${Boost_STATIC_LIBRARIES} - ) - if(WITH_SSL) - target_link_libraries(${CSHARP_MODULE_NAME} PRIVATE - ${OPENSSL_STATIC_LIBRARIES} - ) + set_property(SOURCE ${SWIG_SOURCE_FILES} PROPERTY CPLUSPLUS ON) + + # Different compile flags depending on the platform + set(PYTHON_COMPILE_OPTIONS $<$:/bigobj /MT$<$:d>>) + set(PYTHON_LINK_OPTIONS $<$:-Wl,--no-as-needed>) + set(PYTHON_LINK_LIBRARIES ${LIB_NAME_STATIC}) + + if((UNIX AND MSCL_LINK_STATIC_DEPS) OR WIN32) + list(APPEND PYTHON_LINK_LIBRARIES ${Boost_STATIC_LIBRARIES}) + else() + list(APPEND PYTHON_LINK_LIBRARIES ${Boost_SHARED_LIBRARIES}) endif() - set_target_properties(${CSHARP_MODULE_NAME} - PROPERTIES - OUTPUT_NAME ${LIB_NAME} - ARCHIVE_OUTPUT_DIRECTORY "${CSHARP_MODULE_DIR}" - LIBRARY_OUTPUT_DIRECTORY "${CSHARP_MODULE_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${CSHARP_MODULE_DIR}" - ) - # Add the CSharp library - set(MSCL_CSHARP_SOURCE - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper/CSharp/Properties/AssemblyInfo.cs - ${CMAKE_CURRENT_SOURCE_DIR}/source/mscl/Wrapper/CSharp/mscl/Exceptions.cs - ${MSCL_GENERATED_CSHARP_SOURCE} - ) - set(MSCL_Managed_NAME MSCL_Managed) - add_library(${MSCL_Managed_NAME} SHARED ${MSCL_CSHARP_SOURCE}) - target_link_libraries(${MSCL_Managed_NAME} PUBLIC ${CSHARP_MODULE_NAME}) - - # Copy the library to an Output directory - set(MSCL_Managed_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/DotNet/${MSCL_ARCH_NAME}/$) - add_custom_command(TARGET ${MSCL_Managed_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_Managed_OUTPUT_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_directory $ ${MSCL_Managed_OUTPUT_DIR} - COMMAND ${CMAKE_COMMAND} -E copy $ ${MSCL_Managed_OUTPUT_DIR} - ) - endif() + if(MSCL_WITH_SSL) + if((UNIX AND PYTHON_STATIC_DEPS) OR WIN32) + list(APPEND PYTHON_LINK_LIBRARIES ${OPENSSL_STATIC_LIBRARIES}) + else() + list(APPEND PYTHON_LINK_LIBRARIES ${OPENSSL_SHARED_LIBRARIES}) + endif() + endif() + + # Fix the include paths on Windows to remove backslashes + if(WIN32) + list(TRANSFORM LIB_INCLUDE_DIRS REPLACE "\\\\" "/") + endif() + + # Build for python3 + if(MSCL_BUILD_PYTHON3) + set(PYTHON3_MODULE_NAME MSCL_Python3) + set(MSCL_PYTHON3_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}) + mscl_python_swig( + MODULE_NAME ${PYTHON3_MODULE_NAME} + MODULE_VERSION ${MSCL_GIT_VERSION} + OUTPUT_NAME mscl + OUTPUT_DIR ${MSCL_OUTPUT_DIR} + PYTHON_VERSION ${MSCL_PYTHON3_VERSION} + ARCH ${MSCL_ARCH_NAME} + SOURCES ${SWIG_SOURCE_FILES} + COMPILE_OPTIONS ${PYTHON_COMPILE_OPTIONS} + COMPILE_DEFINITIONS ${LIB_DEFINES} SWIG_PYTHON_INTERPRETER_NO_DEBUG + INCLUDE_DIRECTORIES ${LIB_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} ${MSCL_SOURCE_FILES_DIR}/Wrapper # Temp fix for bad include paths + LINK_DIRECTORIES ${Python3_LIBRARY_DIRS} + LINK_OPTIONS ${PYTHON_LINK_OPTIONS} + LINK_LIBRARIES ${PYTHON_LINK_LIBRARIES} ${Python3_LIBRARIES} + ) + endif() + + # Build for python2 + if(MSCL_BUILD_PYTHON2) + set(PYTHON2_MODULE_NAME MSCL_Python2) + set(MSCL_PYTHON2_VERSION ${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}) + mscl_python_swig( + MODULE_NAME ${PYTHON2_MODULE_NAME} + MODULE_VERSION ${MSCL_GIT_VERSION} + OUTPUT_NAME mscl + OUTPUT_DIR ${MSCL_OUTPUT_DIR} + PYTHON_VERSION ${MSCL_PYTHON2_VERSION} + ARCH ${MSCL_ARCH_NAME} + SOURCES ${SWIG_SOURCE_FILES} + COMPILE_OPTIONS ${PYTHON_COMPILE_OPTIONS} + COMPILE_DEFINITIONS ${LIB_DEFINES} SWIG_PYTHON_INTERPRETER_NO_DEBUG + INCLUDE_DIRECTORIES ${LIB_INCLUDE_DIRS} ${Python2_INCLUDE_DIRS} ${MSCL_SOURCE_FILES_DIR}/Wrapper # Temp fix for bad include paths + LINK_DIRECTORIES ${Python2_LIBRARY_DIRS} + LINK_OPTIONS ${PYTHON_LINK_OPTIONS} + LINK_LIBRARIES ${PYTHON_LINK_LIBRARIES} ${Python2_LIBRARIES} + ) + endif() + + # Build C# on Windows + # Wish we could generate it the same as python, but we need to get the list of CSharp files + if(MSCL_BUILD_CSHARP) + set(CSHARP_MODULE_NAME MSCL_CSharp) + + # Hack of all hacks, but we need to generate the source separately so we can determine the source files at configure time + set(CSHARP_MODULE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CSHARP_MODULE_NAME}) + set(CSHARP_MODULE_CPP_FILE ${CSHARP_MODULE_DIR}/MSCL_Main_InterfaceCSHARP_wrap.cxx) + file(MAKE_DIRECTORY ${CSHARP_MODULE_DIR}) + message(STATUS "Generating CSharp binding source") + execute_process( + COMMAND ${CMAKE_COMMAND} -E env SWIG_LIB=${SWIG_DIR} "${SWIG_EXECUTABLE}" -csharp -namespace mscl -outdir "${CSHARP_MODULE_DIR}" -c++ -dllimport MSCL -o "${CSHARP_MODULE_CPP_FILE}" "${SWIG_SOURCE_FILES}" + COMMAND_ERROR_IS_FATAL ANY + ) + file(GLOB MSCL_GENERATED_CSHARP_SOURCE + ${CSHARP_MODULE_DIR}/*.cs + ) + + # Build the C++ wrapper + add_library(${CSHARP_MODULE_NAME} SHARED ${CSHARP_MODULE_CPP_FILE}) + + target_compile_options(${CSHARP_MODULE_NAME} PRIVATE + /bigobj + /MT$<$:d> + /MP + ) + target_compile_definitions(${CSHARP_MODULE_NAME} PRIVATE + ${LIB_DEFINES} + ) + target_include_directories(${CSHARP_MODULE_NAME} PUBLIC + ${LIB_INCLUDE_DIRS} + ${MSCL_SOURCE_FILES_DIR}/Wrapper # Temp fix for bad include path + ) + target_link_libraries(${CSHARP_MODULE_NAME} PRIVATE + ${LIB_NAME_STATIC} ${Boost_STATIC_LIBRARIES} + ) + + if(MSCL_WITH_SSL) + target_link_libraries(${CSHARP_MODULE_NAME} PRIVATE + ${OPENSSL_STATIC_LIBRARIES} + ) + endif() + + set_target_properties(${CSHARP_MODULE_NAME} + PROPERTIES + OUTPUT_NAME ${LIB_NAME} + ARCHIVE_OUTPUT_DIRECTORY "${CSHARP_MODULE_DIR}" + LIBRARY_OUTPUT_DIRECTORY "${CSHARP_MODULE_DIR}" + RUNTIME_OUTPUT_DIRECTORY "${CSHARP_MODULE_DIR}" + ) + + # Add the CSharp library + set(MSCL_CSHARP_SOURCE + ${MSCL_SOURCE_FILES_DIR}/Wrapper/CSharp/Properties/${ASSEMBLY_FILE} + ${MSCL_SOURCE_FILES_DIR}/Wrapper/CSharp/mscl/Exceptions.cs + ${MSCL_GENERATED_CSHARP_SOURCE} + ) + set(MSCL_Managed_NAME MSCL_Managed) + add_library(${MSCL_Managed_NAME} SHARED ${MSCL_CSHARP_SOURCE}) + target_link_libraries(${MSCL_Managed_NAME} PUBLIC ${CSHARP_MODULE_NAME}) + + # Copy the library to an Output directory + set(MSCL_Managed_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/DotNet/${MSCL_ARCH_NAME}/$) + add_custom_command(TARGET ${MSCL_Managed_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MSCL_Managed_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory $ ${MSCL_Managed_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E copy $ ${MSCL_Managed_OUTPUT_DIR} + ) + + set(MSCL_CSHARP_INSTALL_COMPONENT ${PROJECT_NAME}_CSHARP) + install( + TARGETS ${MSCL_Managed_NAME} + DESTINATION "DotNet/${MSCL_ARCH_NAME}/$" + COMPONENT ${MSCL_CSHARP_INSTALL_COMPONENT} + ) + endif() endif() # Build the documentation -if(BUILD_DOCUMENTATION) - set(MSCL_DOCS_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/Documentation/MSCL_Docs) - set(MSCL_API_DOCS_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/Documentation/MSCL_API_Docs) - add_custom_target(MSCL_Docs - ALL - DEPENDS ${SRC_FILES} - COMMAND ${CMAKE_COMMAND} -E remove_directory "${MSCL_OUTPUT_DIR}/Documentation" - COMMAND ${CMAKE_COMMAND} -E make_directory "${MSCL_DOCS_OUTPUT_DIR}" - COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_Docs_Project/Working Data" - COMMAND ${CMAKE_COMMAND} -E env ${NaturalDocs_EXECUTABLE} -i "${CMAKE_CURRENT_SOURCE_DIR}/source/mscl" -o FramedHTML "${MSCL_DOCS_OUTPUT_DIR}" -p "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_Docs_Project" -s msclDocsStyle - COMMAND ${CMAKE_COMMAND} -E make_directory "${MSCL_API_DOCS_OUTPUT_DIR}" - COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_API_Docs_Project/Working Data" - COMMAND ${CMAKE_COMMAND} -E env ${NaturalDocs_EXECUTABLE} -i "${CMAKE_CURRENT_SOURCE_DIR}/source/mscl" -o FramedHTML "${MSCL_API_DOCS_OUTPUT_DIR}" -p "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_API_Docs_Project" -s msclDocsStyle - ) -endif() +if(MSCL_BUILD_DOCUMENTATION) + set(MSCL_BASE_DOCS_OUTPUT_DIR ${MSCL_OUTPUT_DIR}/Documentation) + set(MSCL_DOCS_OUTPUT_DIR ${MSCL_BASE_DOCS_OUTPUT_DIR}/MSCL_Docs) + set(MSCL_API_DOCS_OUTPUT_DIR ${MSCL_BASE_DOCS_OUTPUT_DIR}/MSCL_API_Docs) + set(MSCL_DOCS_TARGET MSCL_Documentation) + + add_custom_target(${MSCL_DOCS_TARGET} + ALL + DEPENDS ${SRC_FILES} + COMMAND ${CMAKE_COMMAND} -E remove_directory "${MSCL_BASE_DOCS_OUTPUT_DIR}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${MSCL_DOCS_OUTPUT_DIR}" + COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_Docs_Project/Working Data" + COMMAND ${CMAKE_COMMAND} -E env ${NaturalDocs_EXECUTABLE} -i "${MSCL_SOURCE_FILES_DIR}" -o FramedHTML "${MSCL_DOCS_OUTPUT_DIR}" -p "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_Docs_Project" -s msclDocsStyle + COMMAND ${CMAKE_COMMAND} -E make_directory "${MSCL_API_DOCS_OUTPUT_DIR}" + COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_API_Docs_Project/Working Data" + COMMAND ${CMAKE_COMMAND} -E env ${NaturalDocs_EXECUTABLE} -i "${MSCL_SOURCE_FILES_DIR}" -o FramedHTML "${MSCL_API_DOCS_OUTPUT_DIR}" -p "${CMAKE_CURRENT_SOURCE_DIR}/../BuildScripts/NaturalDocsProjects/MSCL_API_Docs_Project" -s msclDocsStyle + ) + set(MSCL_DOCS_INSTALL_COMPONENT ${PROJECT_NAME}_DOCS) + install( + DIRECTORY "${MSCL_BASE_DOCS_OUTPUT_DIR}/" + DESTINATION . + COMPONENT ${MSCL_DOCS_INSTALL_COMPONENT} + ) +endif() # If we were asked to build packages, include CPack and set up packaging -if(BUILD_PACKAGE) - # Try to determine what architecture we are building for based on the compiler output - if(MSVC) - # Detect if this is a x64 or x86 build - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(MSCL_ARCH "x64") - elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(MSCL_ARCH "x86") +if(MSCL_BUILD_PACKAGE) + microstrain_get_git_branch(MSCL_GIT_BRANCH MSCL_BRANCH) # Second param is used to set a cache variable + + # Use the tag for assets built on master + if("${MSCL_GIT_BRANCH}" STREQUAL "master") + string(REGEX REPLACE "(^v[0-9]+\\.[0-9]+\\.[0-9]+).+" "\\1" MSCL_GIT_VERSION "${MSCL_GIT_VERSION}") endif() - elseif(UNIX) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # The dumpmachine command from gcc should contain information on the architecture - execute_process( - COMMAND ${CMAKE_COMMAND} -E env /bin/bash -c "${CMAKE_CXX_COMPILER} -dumpmachine" - OUTPUT_VARIABLE GCC_ARCHITECTURE_OUT - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ERROR_VARIABLE GCC_ARCHITECTURE_ERR - RESULT_VARIABLE GCC_ARCHITECTURE_RET - ) - - # Convert the GCC architecture to the format that we use - if("${GCC_ARCHITECTURE_OUT}" MATCHES ".*x86_64.*") - set(MSCL_ARCH "amd64") - elseif("${GCC_ARCHITECTURE_OUT}" MATCHES ".*aarch64.*") - set(MSCL_ARCH "arm64") - elseif("${GCC_ARCHITECTURE_OUT}" MATCHES ".*arm.*") - set(MSCL_ARCH "armhf") - else() - message(STATUS "Unrecognized GCC architecture ${GCC_ARCHITECTURE_OUT}. Using CMAKE_SYSTEM_PROCESSOR for architecture") - endif() + + # Try to determine what architecture we are building for based on the compiler output + if(MSVC) + set(MSCL_ARCH ${MSCL_ARCH_NAME}) + + # Make a zip of the package + list(APPEND FOUND_CPACK_GENERATORS "ZIP") + elseif(UNIX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # The dumpmachine command from gcc should contain information on the architecture + execute_process( + COMMAND ${CMAKE_COMMAND} -E env /bin/bash -c "${CMAKE_CXX_COMPILER} -dumpmachine" + OUTPUT_VARIABLE GCC_ARCHITECTURE_OUT + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ERROR_VARIABLE GCC_ARCHITECTURE_ERR + RESULT_VARIABLE GCC_ARCHITECTURE_RET + ) + + # Convert the GCC architecture to the format that we use + if("${GCC_ARCHITECTURE_OUT}" MATCHES ".*x86_64.*") + set(MSCL_ARCH "amd64") + elseif("${GCC_ARCHITECTURE_OUT}" MATCHES ".*aarch64.*") + set(MSCL_ARCH "arm64") + elseif("${GCC_ARCHITECTURE_OUT}" MATCHES ".*arm.*") + set(MSCL_ARCH "armhf") + else() + message(STATUS "Unrecognized GCC architecture ${GCC_ARCHITECTURE_OUT}. Using CMAKE_SYSTEM_PROCESSOR for architecture") + endif() + endif() endif() - endif() - if(NOT DEFINED MSCL_ARCH) - message(STATUS "Defaulting MSCL_ARCH to ${CMAKE_SYSTEM_PROCESSOR}") - set(MSCL_ARCH ${CMAKE_SYSTEM_PROCESSOR}) - endif() - - # NOTE: CPack requires all these variables to be set before importing the module. Do not move them after the include(CPack) line - set(CPACK_GENERATOR "${FOUND_CPACK_GENERATORS}") - set(CPACK_PACKAGE_VENDOR "MicroStrain by HBK") - set(CPACK_PACKAGE_CONTACT "MicroStrain Support ") - set(CPACK_COMPONENTS_ALL "static") - if(BUILD_SHARED_LIBS) - list(APPEND CPACK_COMPONENTS_ALL shared) - endif() - if(BUILD_PYTHON3) - list(APPEND CPACK_COMPONENTS_ALL python${MSCL_PYTHON3_VERSION}) - endif() - if(BUILD_PYTHON2) - list(APPEND CPACK_COMPONENTS_ALL python${MSCL_PYTHON2_VERSION}) - endif() - - # Massage the version number a little so we can set the proper version - string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1.\\2.\\3" MSCL_GIT_VERSION_CPACK ${MSCL_GIT_VERSION}) - set(CPACK_PACKAGE_VERSION ${MSCL_GIT_VERSION_CPACK}) - - if(WIN32) - set(MSCL_FILE_NAME_PREFIX "MSCL_Windows_${MSCL_ARCH}") - else() - set(MSCL_FILE_NAME_PREFIX "MSCL_${MSCL_ARCH}") - endif() - - set(MSCL_FILE_NAME_SHARED "${MSCL_FILE_NAME_PREFIX}_Shared_C++_${MSCL_GIT_VERSION}") - set(MSCL_FILE_NAME_STATIC "${MSCL_FILE_NAME_PREFIX}_Static_C++_${MSCL_GIT_VERSION}") - set(MSCL_FILE_NAME_PYTHON2 "${MSCL_FILE_NAME_PREFIX}_Python${MSCL_PYTHON2_VERSION}_${MSCL_GIT_VERSION}") - set(MSCL_FILE_NAME_PYTHON3 "${MSCL_FILE_NAME_PREFIX}_Python${MSCL_PYTHON3_VERSION}_${MSCL_GIT_VERSION}") - - # DEB specific configuration - # Build different deb packages for each target - set(CPACK_DEBIAN_SHARED_FILE_NAME "${MSCL_FILE_NAME_SHARED}.deb") - set(CPACK_DEBIAN_STATIC_FILE_NAME "${MSCL_FILE_NAME_STATIC}.deb") - set(CPACK_DEBIAN_PYTHON${MSCL_PYTHON2_VERSION}_FILE_NAME "${MSCL_FILE_NAME_PYTHON2}.deb") - set(CPACK_DEBIAN_PYTHON${MSCL_PYTHON3_VERSION}_FILE_NAME "${MSCL_FILE_NAME_PYTHON3}.deb") - set(CPACK_DEB_COMPONENT_INSTALL ON) - - # Most packages share these dependencies - set(CPACK_DEBIAN_COMMON_DEPS libboost-system-dev libboost-filesystem-dev) - if(WITH_SSL) - list(APPEND CPACK_DEBIAN_COMMON_DEPS libssl-dev) - endif() - string(REPLACE ";" ", " CPACK_DEBIAN_COMMON_DEPS "${CPACK_DEBIAN_COMMON_DEPS}") - - # Package specific configuration for debian packages - set(CPACK_DEBIAN_STATIC_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") - set(CPACK_DEBIAN_SHARED_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") - set(CPACK_DEBIAN_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_DEPENDS "python${MSCL_PYTHON3_VERSION}") - if(NOT LINK_STATIC_DEPS) - list(APPEND CPACK_DEBIAN_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") - string(REPLACE ";" ", " CPACK_DEBIAN_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_DEPENDS "${CPACK_DEBIAN_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_DEPENDS}") - endif() - set(CPACK_DEBIAN_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_DEPENDS "python${MSCL_PYTHON2_VERSION}") - if(NOT LINK_STATIC_DEPS) - list(APPEND CPACK_DEBIAN_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") - string(REPLACE ";" ", " CPACK_DEBIAN_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_DEPENDS "${CPACK_DEBIAN_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_DEPENDS}") - endif() - - # RPM specific configuration - # Build different RPM packages for each target - set(CPACK_RPM_SHARED_FILE_NAME "${MSCL_FILE_NAME_SHARED}.rpm") - set(CPACK_RPM_STATIC_FILE_NAME "${MSCL_FILE_NAME_STATIC}.rpm") - set(CPACK_RPM_PYTHON${MSCL_PYTHON2_VERSION}_FILE_NAME "${MSCL_FILE_NAME_PYTHON2}.rpm") - set(CPACK_RPM_PYTHON${MSCL_PYTHON3_VERSION}_FILE_NAME "${MSCL_FILE_NAME_PYTHON3}.rpm") - set(CPACK_RPM_COMPONENT_INSTALL ON) - set(CPACK_RPM_PACKAGE_AUTOREQ OFF) - - # Most packages share these dependencies - set(CPACK_RPM_COMMON_DEPS boost-filesystem boost-system boost-devel) - if(WITH_SSL) - list(APPEND CPACK_RPM_COMMON_DEPS openssl-devel) - endif() - string(REPLACE ";" ", " CPACK_RPM_COMMON_DEPS "${CPACK_RPM_COMMON_DEPS}") - - # Package specific configuration for RPM packages - set(CPACK_RPM_STATIC_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") - set(CPACK_RPM_SHARED_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") - set(CPACK_RPM_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_REQUIRES "python3") - if(NOT LINK_STATIC_DEPS) - list(APPEND CPACK_RPM_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") - string(REPLACE ";" ", " CPACK_RPM_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_REQUIRES "${CPACK_RPM_PYTHON${MSCL_PYTHON3_VERSION}_PACKAGE_REQUIRES}") - endif() - set(CPACK_RPM_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_REQUIRES "python2") - if(NOT LINK_STATIC_DEPS) - list(APPEND CPACK_RPM_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") - string(REPLACE ";" ", " CPACK_RPM_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_REQUIRES "${CPACK_RPM_PYTHON${MSCL_PYTHON2_VERSION}_PACKAGE_REQUIRES}") - endif() - - if(MSVC) - set(CPACK_ARCHIVE_FILE_NAME "${MSCL_FILE_NAME_PREFIX}_MSVC_v${MSVC_TOOLSET_VERSION}") - else() - set(CPACK_ARCHIVE_FILE_NAME "${MSCL_FILE_NAME_PREFIX}_${CMAKE_SYSTEM_NAME}") - endif() - set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) - - # Finally include cpack which should have taken all of the previous variables into consideration - include(CPack) - - cpack_add_component(static - DESCRIPTION "MSCL static library and header files" - GROUP static - ) - if(BUILD_SHARED_LIBS) - cpack_add_component(shared - DESCRIPTION "MSCL shared library and header files" - GROUP shared - ) - endif() - if(BUILD_PYTHON3) - cpack_add_component(python${MSCL_PYTHON3_VERSION} - DESCRIPTION "MSCL python bindings for ${MSCL_PYTHON3_VERSION}" - GROUP python${MSCL_PYTHON3_VERSION} - ) - endif() - if(BUILD_PYTHON2) - cpack_add_component(python${MSCL_PYTHON2_VERSION} - DESCRIPTION "MSCL python bindings for ${MSCL_PYTHON2_VERSION}" - GROUP python${MSCL_PYTHON2_VERSION} + + if(NOT DEFINED MSCL_ARCH) + message(STATUS "Defaulting MSCL_ARCH to ${CMAKE_SYSTEM_PROCESSOR}") + set(MSCL_ARCH ${CMAKE_SYSTEM_PROCESSOR}) + endif() + + # NOTE: CPack requires all these variables to be set before importing the module. Do not move them after the include(CPack) line + set(CPACK_GENERATOR "${FOUND_CPACK_GENERATORS}") + set(CPACK_PACKAGE_VENDOR "MicroStrain by HBK") + set(CPACK_PACKAGE_CONTACT "MicroStrain Support ") + + set(CPACK_PACKAGE_VERSION ${MSCL_GIT_VERSION_CLEAN}) + + if(WIN32) + set(MSCL_FILE_NAME_PREFIX "${PROJECT_NAME}_Windows_${MSCL_ARCH}") + else() + set(MSCL_FILE_NAME_PREFIX "${PROJECT_NAME}_${MSCL_ARCH}") + endif() + + # Archive specific configuration + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) + + # Deb specific configuration + set(CPACK_DEB_COMPONENT_INSTALL ON) + + # Most packages share these dependencies + set(CPACK_DEBIAN_COMMON_DEPS libboost-system-dev libboost-filesystem-dev) + + if(MSCL_WITH_SSL) + list(APPEND CPACK_DEBIAN_COMMON_DEPS libssl-dev) + endif() + + string(REPLACE ";" ", " CPACK_DEBIAN_COMMON_DEPS "${CPACK_DEBIAN_COMMON_DEPS}") + + # RPM specific configuration + set(CPACK_RPM_COMPONENT_INSTALL ON) + set(CPACK_RPM_PACKAGE_AUTOREQ OFF) + + # Most packages share these dependencies + set(CPACK_RPM_COMMON_DEPS boost-filesystem boost-system boost-devel) + + if(MSCL_WITH_SSL) + list(APPEND CPACK_RPM_COMMON_DEPS openssl-devel) + endif() + + string(REPLACE ";" ", " CPACK_RPM_COMMON_DEPS "${CPACK_RPM_COMMON_DEPS}") + + # Static package + microstrain_add_archive_component(${MSCL_STATIC_INSTALL_COMPONENT} ${MSCL_FILE_NAME_PREFIX} "Static_C++" ${MSCL_GIT_VERSION}) + set(CPACK_DEBIAN_${MSCL_STATIC_INSTALL_COMPONENT}_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") + set(CPACK_RPM_${MSCL_STATIC_INSTALL_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") + + if(BUILD_SHARED_LIBS) + microstrain_add_archive_component(${MSCL_SHARED_INSTALL_COMPONENT} ${MSCL_FILE_NAME_PREFIX} "Shared_C++" ${MSCL_GIT_VERSION}) + set(CPACK_DEBIAN_${MSCL_SHARED_INSTALL_COMPONENT}_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") + set(CPACK_RPM_${MSCL_SHARED_INSTALL_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") + endif() + + if(MSCL_BUILD_PYTHON3) + microstrain_add_archive_component(${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT} ${MSCL_FILE_NAME_PREFIX} "Python${MSCL_PYTHON3_VERSION}" ${MSCL_GIT_VERSION}) + set(CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS "python${MSCL_PYTHON3_VERSION}") + set(CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES "python3") + + if(NOT MSCL_LINK_STATIC_DEPS) + list(APPEND CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") + string(REPLACE ";" ", " CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS "${CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS}") + + list(APPEND CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") + string(REPLACE ";" ", " CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES}") + endif() + endif() + + if(MSCL_BUILD_PYTHON2) + microstrain_add_archive_component(${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT} ${MSCL_FILE_NAME_PREFIX} "Python${MSCL_PYTHON2_VERSION}" ${MSCL_GIT_VERSION}) + set(CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS "python${MSCL_PYTHON2_VERSION}") + set(CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES "python2") + + if(NOT MSCL_LINK_STATIC_DEPS) + list(APPEND CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS "${CPACK_DEBIAN_COMMON_DEPS}") + string(REPLACE ";" ", " CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS "${CPACK_DEBIAN_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_DEPENDS}") + + list(APPEND CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_COMMON_DEPS}") + string(REPLACE ";" ", " CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT}_PACKAGE_REQUIRES}") + endif() + endif() + + if(MSCL_BUILD_CSHARP) + microstrain_add_archive_component(${MSCL_CSHARP_INSTALL_COMPONENT} ${MSCL_FILE_NAME_PREFIX} "DotNet" ${MSCL_GIT_VERSION}) + endif() + + if(MSCL_BUILD_DOCUMENTATION) + microstrain_add_archive_component(${MSCL_DOCS_INSTALL_COMPONENT} ${PROJECT_NAME} "Documentation" ${MSCL_GIT_VERSION}) + endif() + + if(MSCL_ZIP_EXAMPLES) + microstrain_add_archive_component(${MSCL_EXAMPLES_INSTALL_COMPONENT} ${PROJECT_NAME} "Examples" ${MSCL_GIT_VERSION}) + endif() + + # Finally include cpack which should have taken all of the previous variables into consideration + include(CPack) + + cpack_add_component(${MSCL_STATIC_INSTALL_COMPONENT} + DESCRIPTION "MSCL static library and header files" + GROUP ${MSCL_STATIC_INSTALL_COMPONENT} ) - endif() + + if(BUILD_SHARED_LIBS) + cpack_add_component(${MSCL_SHARED_INSTALL_COMPONENT} + DESCRIPTION "MSCL shared library and header files" + GROUP ${MSCL_SHARED_INSTALL_COMPONENT} + ) + endif() + + if(MSCL_BUILD_PYTHON3) + cpack_add_component(${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT} + DESCRIPTION "MSCL python bindings for ${MSCL_PYTHON3_VERSION}" + GROUP ${MSCL_PYTHON${MSCL_PYTHON3_VERSION}_INSTALL_COMPONENT} + ) + endif() + + if(MSCL_BUILD_PYTHON2) + cpack_add_component(${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT} + DESCRIPTION "MSCL python bindings for ${MSCL_PYTHON2_VERSION}" + GROUP ${MSCL_PYTHON${MSCL_PYTHON2_VERSION}_INSTALL_COMPONENT} + ) + endif() + + if(MSCL_BUILD_CSHARP) + cpack_add_component(${MSCL_CSHARP_INSTALL_COMPONENT} + DESCRIPTION "MSCL CSharp bindings" + GROUP ${MSCL_CSHARP_INSTALL_COMPONENT} + ) + endif() + + if(MSCL_BUILD_DOCUMENTATION) + cpack_add_component(${MSCL_DOCS_INSTALL_COMPONENT} + DESCRIPTION "MSCL documentation" + GROUP ${MSCL_DOCS_INSTALL_COMPONENT} + ) + endif() + + if(MSCL_ZIP_EXAMPLES) + cpack_add_component(${MSCL_EXAMPLES_INSTALL_COMPONENT} + DESCRIPTION "MSCL examples" + GROUP ${MSCL_EXAMPLES_INSTALL_COMPONENT} + ) + endif() endif() diff --git a/MSCL/MSCL.licenseheader b/MSCL/MSCL.licenseheader deleted file mode 100644 index 03e334b97..000000000 --- a/MSCL/MSCL.licenseheader +++ /dev/null @@ -1,21 +0,0 @@ -extensions: designer.cs generated.cs -extensions: .cs .cpp .h .js -/***************************************************************************************** -** Copyright(c) 2015-2024 MicroStrain by HBK. All rights reserved. ** -** ** -** MIT Licensed. See the included LICENSE file for a copy of the full MIT License. ** -*****************************************************************************************/ - -extensions: .aspx .ascx -<%---------------------------------------------------------------------------------------- --- Copyright(c) 2015-2024 MicroStrain by HBK. All rights reserved. -- --- -- --- MIT Licensed. See the included LICENSE file for a copy of the full MIT License. -- -----------------------------------------------------------------------------------------%> - -extensions: .xml .config .xsd - diff --git a/MSCL/MSCL.vcxproj.filters b/MSCL/MSCL.vcxproj.filters deleted file mode 100644 index 4a64625a5..000000000 --- a/MSCL/MSCL.vcxproj.filters +++ /dev/null @@ -1,1955 +0,0 @@ - - - - - {5ca1e82c-77b4-4753-a854-af380a4c5842} - - - {181a01bf-6a57-482a-8f28-91e628e81a20} - - - {8f7df735-a41b-442b-b08d-8e699efe2533} - - - {a0c4978a-491a-42bd-b256-4930113c3842} - - - {8efa8df0-1379-4813-a2ef-32b2e9cb05a8} - - - {c5d40daf-047d-4f63-b923-0c820cc42bb5} - - - {badda1b9-a76c-47f7-95a0-b63d0a389071} - - - {a5c09752-b10c-4138-994d-b878290ecff7} - - - {b9ba266d-e22b-43a9-bd63-fa971b803f28} - - - {d2d1bb8b-9e26-4014-b038-991baad2a269} - - - {6dacea4b-94d7-44cb-8fd1-fd0e595761ab} - - - {ab80ac60-d19f-4837-89a6-3f79d84dc4c0} - - - {cbdc3bdb-e7cb-41da-a41c-7838900e5257} - - - {cecc2ab0-4168-4af7-b457-e8c1e4555354} - - - {1793bf1c-8cdc-4bfa-ab53-dba1ed6d4381} - - - {80e53095-6d46-4bd6-8b22-3f08342d1f55} - - - {ed35a560-b8c0-4032-97ce-f93ace000880} - - - {4e29be50-7643-4834-b914-e432107d6582} - - - {0c912607-e36c-43d0-a88f-f1a119c049f5} - - - {fa19234a-59ec-4a07-b4e2-d5148e8720b8} - - - {2d816ebe-dc87-4cd4-b97f-9e952ba15164} - - - {4160275e-7fa9-4c22-8578-607d82e2b2bf} - - - {a49d32a6-b691-45ec-b639-26ffa719c426} - - - - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Inertial - - - Communication - - - Communication - - - Communication - - - Communication - - - Communication - - - Communication - - - Communication - - - Utils - - - Utils - - - Utils - - - - - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - Communication - - - Utils - - - Utils - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - - Utils - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Inertial\Packets - - - MicroStrain\Inertial\Packets - - - MicroStrain\Inertial\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - Communication - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features - - - Communication - - - MicroStrain\Inertial\Commands - - - - MicroStrain\Wireless\Packets - - - - Communication - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - Utils - - - MicroStrain\Wireless\Commands - - - Utils - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Features - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - Utils - - - MicroStrain\Inertial - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Configuration - - - Communication - - - Communication - - - Communication - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - Communication - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Inertial\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - Communication - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - Utils - - - Communication - - - Communication - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP\Packets - - - MicroStrain\Displacement - - - MicroStrain\Displacement - - - MicroStrain\Displacement\Commands - - - MicroStrain\Displacement\Commands - - - MicroStrain - - - MicroStrain\Wireless\Commands - - - MicroStrain\Displacement\Commands - - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\RTK - - - MicroStrain\RTK\Commands - - - MicroStrain - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\Inertial\Packets - - - Communication - - - Communication - - - MicroStrain\RTK\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\MIP\Packets - - - MicroStrain\Inertial\Packets - - - MicroStrain\MIP - - - MicroStrain\Inertial - - - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Inertial - - - Communication - - - Communication - - - - Utils - - - Utils - - - _Wrapper - - - - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - Communication - - - Utils - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - - MicroStrain\Wireless - - - MicroStrain\Inertial\Packets - - - MicroStrain\Inertial\Packets - - - MicroStrain\Inertial\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features - - - MicroStrain\Wireless - - - Communication - - - MicroStrain\Inertial\Commands - - - MicroStrain\Wireless\Packets - - - - Communication - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - Utils - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Features - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - Utils - - - MicroStrain\Inertial - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Configuration - - - Communication - - - Communication - - - Communication - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - Communication - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Inertial\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Packets - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless - - - MicroStrain\Wireless - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - Utils - - - Communication - - - Communication - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Packets - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP\Commands - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\MIP\Packets - - - MicroStrain\Displacement - - - MicroStrain\Displacement - - - MicroStrain\Displacement\Commands - - - MicroStrain\Displacement\Commands - - - MicroStrain - - - MicroStrain\Wireless\Commands - - - MicroStrain\Displacement\Commands - - - MicroStrain\Wireless\Features\BaseStations - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Configuration - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands\3DM_Commands - - - MicroStrain\Inertial\Commands - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Inertial\Commands\Estimation_Filter_Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\RTK - - - MicroStrain\RTK\Commands - - - MicroStrain - - - MicroStrain\MIP - - - MicroStrain\MIP - - - MicroStrain\Inertial\Packets - - - Communication - - - Communication - - - MicroStrain\RTK\Commands - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\Wireless\Features\Nodes - - - MicroStrain\MIP\Packets - - - MicroStrain\Inertial\Packets - - - MicroStrain\MIP - - - MicroStrain\Inertial - - - - - _Wrapper - - - _Wrapper - - - - - \ No newline at end of file diff --git a/MSCL/source/mscl/Communication/Devices.cpp b/MSCL/source/mscl/Communication/Devices.cpp index a2331d19a..a25627d31 100644 --- a/MSCL/source/mscl/Communication/Devices.cpp +++ b/MSCL/source/mscl/Communication/Devices.cpp @@ -274,18 +274,12 @@ namespace mscl //InertialDevice device type if(devType == TYPE_INERTIALDEVICE || devType == TYPE_ALL) { - //check for the STM vendor ID (this is the best we can do right now for GX4's) - if(Utils::containsStr(pnpID, "VID_0483&PID_5740")) - { - baudRate = 921600; - type = DeviceInfo::connectionType_serial; - return true; - } - //check for the inertial VID/PIDs - if(Utils::containsStr(pnpID, "VID_199B&PID_3065") || //Inertial - Utils::containsStr(pnpID, "VID_199B&PID_3A65") || //3DM-GX3-45 - Utils::containsStr(pnpID, "VID_199B&PID_3D65")) //Inertial in DFU (usb updater) mode + if(Utils::containsStr(pnpID, "VID_199B&PID_0001&MI_00") || //CV7-GNSS/INS + Utils::containsStr(pnpID, "VID_199B&PID_3065") || //Inertial + Utils::containsStr(pnpID, "VID_0483&PID_5740") || //check for the STM vendor ID (this is the best we can do right now for GX4's) + Utils::containsStr(pnpID, "VID_199B&PID_3A65") || //3DM-GX3-45 + Utils::containsStr(pnpID, "VID_199B&PID_3D65")) //Inertial in DFU (usb updater) mode { baudRate = 921600; type = DeviceInfo::connectionType_serial; diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.cpp index 5ff3aa2f0..448c8bae3 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.cpp +++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.cpp @@ -4,18 +4,17 @@ ** MIT Licensed. See the included LICENSE file for a copy of the full MIT License. ** *****************************************************************************************/ -#include "stdafx.h" -#include "GNSS_Commands.h" +#include "mscl/MicroStrain/Inertial/Commands/GNSS_Commands.h" -#include "mscl/MicroStrain/MIP/Commands/MIP_Commands.h" #include "mscl/Exceptions.h" #include "mscl/Utils.h" +#include "mscl/MicroStrain/MIP/Commands/MIP_Commands.h" namespace mscl { ByteStream GetGnssDataRateBase::buildCommand() { - //return the result of the Generic buildCommand function + // return the result of the Generic buildCommand function return GenericMipCommand::buildCommand(CMD_ID); } @@ -32,60 +31,60 @@ namespace mscl //GNSS MESSAGE FORMAT ByteStream GnssMessageFormat::buildCommand_get() { - //container to hold the command's field data + // container to hold the command's field data ByteStream fieldData; - //add the command selector byte + // add the command selector byte fieldData.append_uint8(static_cast(MipTypes::READ_BACK_CURRENT_SETTINGS)); - //"get" has no channels, so add 0 + // "get" has no channels, so add 0 fieldData.append_uint8(0); - //build and return the command bytes + // build and return the command bytes return GenericMipCommand::buildCommand(CMD_ID, fieldData.data()); } ByteStream GnssMessageFormat::buildCommand_set(const MipChannels& channels, uint16 sampleRateBase) { - //container to hold the command's field data + // container to hold the command's field data ByteStream fieldData; - //add the command selector byte + // add the command selector byte fieldData.append_uint8(static_cast(MipTypes::USE_NEW_SETTINGS)); - //add the number of channels + // add the number of channels fieldData.append_uint8(static_cast(channels.size())); - //loop through each channel in the vector of channels - for(MipChannel ch : channels) + // loop through each channel in the vector of channels + for (MipChannel ch : channels) { - //if we find a channel not in the Sensor descriptor set - if(ch.descriptorSet() != DescriptorSet::DESC_SET_DATA_GNSS) + // if we find a channel not in the Sensor descriptor set + if (ch.descriptorSet() != DescriptorSet::DESC_SET_DATA_GNSS) { throw Error("MipChannel (" + Utils::toStr(ch.channelField()) +") is not in the GNSS descriptor set"); } - //add the field descriptor and rate decimation + // add the field descriptor and rate decimation fieldData.append_uint8(ch.fieldDescriptor()); fieldData.append_uint16(ch.rateDecimation(sampleRateBase)); } - //build and return the command bytes + // build and return the command bytes return GenericMipCommand::buildCommand(CMD_ID, fieldData.data()); } ByteStream GnssMessageFormat::buildCommand_save() { - //container to hold the command's field data + // container to hold the command's field data ByteStream fieldData; - //add the command selector byte + // add the command selector byte fieldData.append_uint8(static_cast(MipTypes::SAVE_CURRENT_SETTINGS)); - //"get" has no channels, so add 0 + // "get" has no channels, so add 0 fieldData.append_uint8(0); - //build and return the command bytes + // build and return the command bytes return GenericMipCommand::buildCommand(CMD_ID, fieldData.data()); } @@ -98,4 +97,4 @@ namespace mscl return MIP_Commands::parseData_MessageFormat(response, fieldDataByte(), sampleRateBase); } //========================================================================================== -} +} // namespace mscl diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.h index b4eb189bf..383dc6832 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.h +++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/GNSS_Commands.h @@ -6,8 +6,8 @@ #pragma once -#include "mscl/MicroStrain/MIP/Commands/GenericMipCommand.h" #include "mscl/MicroStrain/MIP/MipChannel.h" +#include "mscl/MicroStrain/MIP/Commands/GenericMipCommand.h" namespace mscl { @@ -19,10 +19,10 @@ namespace mscl { public: //Constants: Packet Bytes - // CMD_ID - CMD_GET_GPS_RATE_BASE - The for this command - // FIELD_DATA_BYTE - 0x84 - The Data Field Descriptor byte - static const MipTypes::Command CMD_ID = MipTypes::CMD_GET_GNSS_RATE_BASE; - static const uint8 FIELD_DATA_BYTE = 0x84; + // CMD_ID - CMD_GET_GPS_RATE_BASE - The for this command + // FIELD_DATA_BYTE - 0x84 - The Data Field Descriptor byte + static const MipTypes::Command CMD_ID = MipTypes::CMD_GET_GNSS_RATE_BASE; + static const uint8 FIELD_DATA_BYTE = 0x84; private: GetGnssDataRateBase(); //private default constructor @@ -45,7 +45,10 @@ namespace mscl protected: //Function: fieldDataByte // Gets the data field descriptor byte - virtual uint8 fieldDataByte() const override { return FIELD_DATA_BYTE; } + uint8 fieldDataByte() const override + { + return FIELD_DATA_BYTE; + } public: //Constructor: Response @@ -70,13 +73,13 @@ namespace mscl { public: //Constants: Packet Bytes - // CMD_ID - CMD_GNSS_MESSAGE_FORMAT - The for this command - // FIELD_DATA_BYTE - 0x81 - The Data Field Descriptor byte + // CMD_ID - CMD_GNSS_MESSAGE_FORMAT - The for this command + // FIELD_DATA_BYTE - 0x81 - The Data Field Descriptor byte static const MipTypes::Command CMD_ID = MipTypes::CMD_GNSS_MESSAGE_FORMAT; - static const uint8 FIELD_DATA_BYTE = 0x81; + static const uint8 FIELD_DATA_BYTE = 0x81; private: - GnssMessageFormat(); //disabled default constructor + GnssMessageFormat(); //disabled default constructor public: //Function: buildCommand_get @@ -113,11 +116,14 @@ namespace mscl class Response : public GenericMipCommand::Response { protected: - virtual uint8 fieldDataByte() const override { return FIELD_DATA_BYTE; } + uint8 fieldDataByte() const override + { + return FIELD_DATA_BYTE; + } public: Response(std::weak_ptr collector, bool dataResponse); MipChannels parseResponse(const GenericMipCmdResponse& response, uint16 sampleRateBase) const; }; }; -} +} // namespace mscl diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp index b1af3e92c..ee69c6443 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp +++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.cpp @@ -4,12 +4,59 @@ ** MIT Licensed. See the included LICENSE file for a copy of the full MIT License. ** *****************************************************************************************/ -#include "stdafx.h" -#include "System_Commands.h" +#include "mscl/MicroStrain/Inertial/Commands/System_Commands.h" #include "mscl/MicroStrain/MIP/Commands/MIP_Commands.h" namespace mscl { + //========================================================================================== + //GET PORT INTERFACE CONTROL + ByteStream InterfaceControl::buildCommand_get(uint8 interfaceId) + { + //container to hold the command's field data + ByteStream fieldData; + + //add the command selector byte + fieldData.append_uint8(static_cast(MipTypes::READ_BACK_CURRENT_SETTINGS)); + + //add the interface ID byte + fieldData.append_uint8(interfaceId); + + //build and return the command bytes + return GenericMipCommand::buildCommand(CMD_ID, fieldData.data()); + } + + ByteStream InterfaceControl::buildCommand_set(uint8 interfaceId, DeviceCommPort::Protocol inputProtocols, DeviceCommPort::Protocol outputProtocols) + { + //container to hold the command's field data + ByteStream fieldData; + + //add the command selector byte + fieldData.append_uint8(static_cast(MipTypes::USE_NEW_SETTINGS)); + + //add the interface ID + fieldData.append_uint8(interfaceId); + + //add the input protocols + fieldData.append_uint32(static_cast(inputProtocols)); + + //add the output protocols + fieldData.append_uint32(static_cast(outputProtocols)); + + //build and return the command bytes + return GenericMipCommand::buildCommand(CMD_ID, fieldData.data()); + } + + InterfaceControl::Response::Response(std::weak_ptr collector, bool dataResponse): + GenericMipCommand::Response(MipTypes::CMD_INTERFACE_CONTROL, collector, true, dataResponse, "Interface Control") + {} + + DeviceCommPort InterfaceControl::Response::parseResponse(const GenericMipCmdResponse& response) const + { + return MIP_Commands::parseData_InterfaceControl(response); + } + //========================================================================================== + //========================================================================================== //GET SENSOR DATA RATE BASE ByteStream CommunicationMode::buildCommand_get() diff --git a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h index ca43ba875..6a79ddf58 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h +++ b/MSCL/source/mscl/MicroStrain/Inertial/Commands/System_Commands.h @@ -6,13 +6,67 @@ #pragma once -#include "mscl/MicroStrain/MIP/Commands/GenericMipCommand.h" #include "mscl/MicroStrain/MIP/MipTypes.h" +#include "mscl/MicroStrain/MIP/Commands/GenericMipCommand.h" namespace mscl { //Title: System_Commands + //Class: InterfaceControl + // Contains the logic for the "Interface Control" command + // + //See Also: + // + class InterfaceControl + { + public: + //Constants: Packet Bytes + // CMD_ID - CMD_INTERFACE_CONTROL - The for this command + // FIELD_DATA_BYTE - 0x82 - The Data Field Descriptor byte + static constexpr MipTypes::Command CMD_ID = MipTypes::CMD_INTERFACE_CONTROL; + static constexpr uint8 FIELD_DATA_BYTE = 0x82; + + private: + InterfaceControl(); //disabled default constructor + + public: + //Function: buildCommand_get + // Builds the bytes for the "get" command + // + //Parameters: + // interfaceId - The interface ID to get the configuration for + // + //Returns: + // A that holds the bytes that make up the command + static ByteStream buildCommand_get(uint8 interfaceId); + + //Function: buildCommand_set + // Builds the bytes for the "set" command. + // + //Parameters: + // interfaceId - The interface ID to configure + // inputProtocols - The input protocols to set + // outputProtocols - The output protocols to set + // + //Returns: + // A that holds the bytes that make up the command + // + //Exceptions: + // - : An in the channels parameter is not part of the Sensor descriptor set + static ByteStream buildCommand_set(uint8 interfaceId, DeviceCommPort::Protocol inputProtocols, DeviceCommPort::Protocol outputProtocols); + + class Response : public GenericMipCommand::Response + { + protected: + uint8 fieldDataByte() const override { return FIELD_DATA_BYTE; } + + public: + Response(std::weak_ptr collector, bool dataResponse); + DeviceCommPort parseResponse(const GenericMipCmdResponse& response) const; + }; + }; + //Class: CommunicationMode // Contains the logic for the "Communication Mode" command // @@ -22,10 +76,10 @@ namespace mscl { public: //Constants: Packet Bytes - // CMD_ID - CMD_GET_SENSOR_RATE_BASE - The for this command - // FIELD_DATA_BYTE - 0x90 - The Data Field Descriptor byte - static const MipTypes::Command CMD_ID = MipTypes::CMD_COMMUNICATION_MODE; - static const uint8 FIELD_DATA_BYTE = 0x90; + // CMD_ID - CMD_COMMUNICATION_MODE - The for this command + // FIELD_DATA_BYTE - 0x90 - The Data Field Descriptor byte + static constexpr MipTypes::Command CMD_ID = MipTypes::CMD_COMMUNICATION_MODE; + static constexpr uint8 FIELD_DATA_BYTE = 0x90; private: CommunicationMode(); //disabled default constructor @@ -54,7 +108,7 @@ namespace mscl class Response : public GenericMipCommand::Response { protected: - virtual uint8 fieldDataByte() const { return FIELD_DATA_BYTE; } + uint8 fieldDataByte() const override { return FIELD_DATA_BYTE; } public: Response(std::weak_ptr collector, bool dataResponse); diff --git a/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h b/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h index b39c21253..9414f61fb 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h +++ b/MSCL/source/mscl/MicroStrain/Inertial/EulerAngles.h @@ -170,12 +170,12 @@ namespace mscl //API Enum: Format // Possible formats for the Rotation object. // - // EULER_ANGLES - 1 - EulerAngles format - // QUATERINION - 2 - Quaternion format + // EULER_ANGLES - 1 - EulerAngles format + // QUATERNION - 2 - Quaternion format enum Format { EULER_ANGLES = 1, - QUATERNION = 2 + QUATERNION = 2 }; public: diff --git a/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.cpp b/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.cpp index d60abb05c..277f6ab2c 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.cpp +++ b/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.cpp @@ -994,6 +994,94 @@ namespace mscl return m_beidouSignals.get(signal) > 0; } + void GnssSpartnConfiguration::enable(const bool enable) + { + m_enable = enable; + } + + bool GnssSpartnConfiguration::enabled() const + { + return m_enable; + } + + void GnssSpartnConfiguration::type(const ConnectionType connectionType) + { + m_type = connectionType; + } + + GnssSpartnConfiguration::ConnectionType GnssSpartnConfiguration::type() const + { + return m_type; + } + + void GnssSpartnConfiguration::currentKeyTow(const uint32_t tow) + { + m_currentKeyTow = tow; + } + + uint32_t GnssSpartnConfiguration::currentKeyTow() const + { + return m_currentKeyTow; + } + + void GnssSpartnConfiguration::currentKeyWeek(const uint16_t week) + { + m_currentKeyWeek = week; + } + + uint16_t GnssSpartnConfiguration::currentKeyWeek() const + { + return m_currentKeyWeek; + } + + void GnssSpartnConfiguration::currentKey(const char key[KEY_SIZE]) + { + memset(m_currentKey, 0, KEY_SIZE); + strcpy(m_currentKey, key); + + // The string needs a null terminating character to work + m_currentKey[KEY_SIZE - 1] = '\0'; + } + + const std::string GnssSpartnConfiguration::currentKey() + { + return m_currentKey; + } + + void GnssSpartnConfiguration::nextKeyTow(const uint32_t tow) + { + m_nextKeyTow = tow; + } + + uint32_t GnssSpartnConfiguration::nextKeyTow() const + { + return m_nextKeyTow; + } + + void GnssSpartnConfiguration::nextKeyWeek(const uint16_t week) + { + m_nextKeyWeek = week; + } + + uint16_t GnssSpartnConfiguration::nextKeyWeek() const + { + return m_nextKeyWeek; + } + + void GnssSpartnConfiguration::nextKey(const char key[KEY_SIZE]) + { + memset(m_nextKey, 0, KEY_SIZE); + strcpy(m_nextKey, key); + + // The string needs a null terminating character to work + m_nextKey[KEY_SIZE - 1] = '\0'; + } + + const std::string GnssSpartnConfiguration::nextKey() const + { + return m_nextKey; + } + OdometerConfiguration::Mode OdometerConfiguration::mode() const { return m_mode; diff --git a/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.h b/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.h index fc8dd9af9..63ddeee9f 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.h +++ b/MSCL/source/mscl/MicroStrain/Inertial/ExposedInertialTypes.h @@ -470,14 +470,14 @@ namespace mscl //API Enum: GeographicSourceOption // The enum to represent the source options for Declination (0x0D, 0x43), Inclination (0x0D, 0x4C), and Magnitude Source (0x0D, 0x4D) // - // NONE - 0x0001 - // WORLD_MAGNETIC_MODEL - 0x0002 - // MANUAL - 0x0004 + // NONE - 0x01 - No source + // WORLD_MAGNETIC_MODEL - 0x02 - Magnetic field is assumed to conform to the World Magnetic Model + // MANUAL - 0x03 - Magnetic field is assumed to have the parameter specified by the user enum GeographicSourceOption { - NONE = 0x01, - WORLD_MAGNETIC_MODEL = 0x02, - MANUAL = 0x03 + NONE = 0x01, // No source + WORLD_MAGNETIC_MODEL = 0x02, // Magnetic field is assumed to conform to the World Magnetic Model + MANUAL = 0x03 // Magnetic field is assumed to have the parameter specified by the user }; //API Enum: AdaptiveMeasurementMode @@ -545,13 +545,13 @@ namespace mscl // FILTERING_OFF - 0x00 // FILTERING_CONSERVATIVE - 0x01 // FILTERING_MODERATE - 0x02 - // FILTERING_AGGRESIVE - 0x03 + // FILTERING_AGGRESSIVE - 0x03 enum AutoAdaptiveFilteringLevel { FILTERING_OFF = 0x00, FILTERING_CONSERVATIVE = 0x01, FILTERING_MODERATE = 0x02, - FILTERING_AGGRESIVE = 0x03 + FILTERING_AGGRESSIVE = 0x03 }; //API Enum: FactoryStreamingOption @@ -1891,16 +1891,16 @@ namespace mscl //API Enum: HeadingAlignmentOption // Method options for automatically determining initial filter heading // - // GNSS_DualAntenna - 0x01 - Dual-antenna GNSS alignment - // GNSS_Kinematic - 0x02 - GNSS kinematic alignment (GNSS velocity determines initial heading) - // Magnetometer - 0x04 - Magnetometer heading alignment - // External - 0x08 - External heading source + // GNSS_DualAntenna - 0x01 - Dual-antenna GNSS alignment + // GNSS_Kinematic - 0x02 - GNSS kinematic alignment (GNSS velocity determines initial heading) + // Magnetometer - 0x04 - Magnetometer heading alignment + // External - 0x08 - External heading source enum HeadingAlignmentOption { - GNSS_DualAntenna = 0x01, - GNSS_Kinematic = 0x02, - Magnetometer = 0x04, - External = 0x08 + GNSS_DualAntenna = 0x01, // Dual-antenna GNSS alignment + GNSS_Kinematic = 0x02, // GNSS kinematic alignment (GNSS velocity determines initial heading) + Magnetometer = 0x04, // Magnetometer heading alignment + External = 0x08 // External heading source }; //API Struct: HeadingAlignmentMethod @@ -2725,6 +2725,158 @@ namespace mscl typedef std::map> GnssSignalConfigOptions; + //API Class: GnssSpartnConfiguration + class GnssSpartnConfiguration + { + public: + //API Constant: KEY_SIZE + // Null terminated character count for key strings + static constexpr uint8_t KEY_SIZE = 33; + + //API Enum: ConnectionType + // Available connection types + // + // NONE - 0x00 - No connection type + // NETWORK - 0x01 - Network connection type + // LBAND - 0x02 - L-Band connection type + enum ConnectionType : uint8_t + { + NONE = 0x00, // No connection type + NETWORK = 0x01, // Network connection type + LBAND = 0x02 // L-Band connection type + }; + + //API Constructor: GnssSpartnConfiguration + GnssSpartnConfiguration() = default; + + //API Function: enable + // Enable or disable the SPARTN subsystem + // + //Parameters: + // enable - True/False value to enabled or disabled the SPARTN subsystem + void enable(const bool enable); + + //API Function: enabled + // Check if the SPARTN subsystem is enabled or disabled + bool enabled() const; + + //API Function: type + // Set the connection type + // + //Parameters: + // connectionType - value to set for the SPARTN subsystem + void type(const ConnectionType connectionType); + + //API Function: type + // Get the connection type + ConnectionType type() const; + + //API Function: currentKeyTow + // Set the time-of-week for the current key + // + //Parameters: + // tow - The time-of-week to set for the current key + void currentKeyTow(const uint32_t tow); + + //API Function: currentKeyTow + // Get the time-of-week for the current key + uint32_t currentKeyTow() const; + + //API Function: currentKeyWeek + // Set the week number for the current key + // + //Parameters: + // week - The week number to set for the current key + void currentKeyWeek(const uint16_t week); + + //API Function: currentKeyWeek + // Get the week number for the current key + uint16_t currentKeyWeek() const; + + //API Function: currentKey + // Set the current key for the SPARTN subsystem + // + //Note: + // This value needs to be 32 characters long and is sent as ASCII bytes + // + //Parameters: + // key - The 32 character key to set + void currentKey(const char key[KEY_SIZE]); + + //API Function: currentKey + // Get the current key for the SPARTN subsystem + const std::string currentKey(); + + //API Function: nextKeyTow + // Set the time-of-week for the next key + // + //Parameters: + // tow - The time-of-week to set for the next key + void nextKeyTow(const uint32_t tow); + + //API Function: nextKeyTow + // Get the time-of-week for the next key + uint32_t nextKeyTow() const; + + //API Function: type + // Enable or disable the SPARTN subsystem + void nextKeyWeek(const uint16_t week); + + //API Function: nextKeyWeek + // Set the week number for the next key + // + //Parameters: + // week - The week number to set for the next key + uint16_t nextKeyWeek() const; + + //API Function: nextKey + // Set the next key for the SPARTN subsystem + // + //Note: + // This value needs to be 32 characters long and is sent as ASCII bytes + // + //Parameters: + // key - The 32 character key to set + void nextKey(const char key[KEY_SIZE]); + + //API Function: nextKey + // Get the next key for the SPARTN subsystem + const std::string nextKey() const; + + private: + //API Variable: m_enable + // Enable/Disable the SPARTN subsystem + bool m_enable = false; + + //API Variable: m_type + // Connection type + ConnectionType m_type = NONE; + + //API Variable: m_currentKeyTow + // The GPS time of week the current key is valid until + uint32_t m_currentKeyTow = 0; + + //API Variable: m_currentKeyWeek + // The GPS week number the current key is valid until + uint16_t m_currentKeyWeek = 0; + + //API Variable: m_currentKey + // 32 character string of ASCII hex values for the current key (e.g. "bc" for 0xBC) + char m_currentKey[KEY_SIZE] = ""; + + //API Variable: m_nextKeyTow + // The GPS time of week the next key is valid until + uint32_t m_nextKeyTow = 0; + + //API Variable: m_nextKeyWeek + // The GPS week number the next key is valid until + uint16_t m_nextKeyWeek = 0; + + //API Variable: m_nextKey + // 32 character string of ASCII hex values for the next key (e.g. "bc" for 0xBC) + char m_nextKey[KEY_SIZE] = ""; + }; + //API Struct: PositionReferenceConfiguration struct PositionReferenceConfiguration { @@ -2809,103 +2961,111 @@ namespace mscl struct GpioConfiguration { //API Enum: Feature - // GPIO Feature options + // GPIO Feature options. Determines how the pin will be used // // UNUSED_FEATURE - 0x00 - Pin is unused - // GPIO_FEATURE - 0x01 - Encoder is disabled - // PPS_FEATURE - 0x02 - Single pulse input; one direction only - // ENCODER_FEATURE - 0x03 - Quadrature encoder mode + // GPIO_FEATURE - 0x01 - Direct control of pin output state or to stream the state of the pin + // PPS_FEATURE - 0x02 - Pulse per second input or output + // ENCODER_FEATURE - 0x03 - Motor encoder/odometer input // EVENT_TIMESTAMP_FEATURE - 0x04 - Precision event timestamping // UART_FEATURE - 0x05 - UART data or control lines enum Feature { - UNUSED_FEATURE = 0x00, - GPIO_FEATURE = 0x01, - PPS_FEATURE = 0x02, - ENCODER_FEATURE = 0x03, - EVENT_TIMESTAMP_FEATURE = 0x04, - UART_FEATURE = 0x05 + UNUSED_FEATURE = 0x00, // Pin is unused + GPIO_FEATURE = 0x01, // Direct control of pin output state or to stream the state of the pin + PPS_FEATURE = 0x02, // Pulse per second input or output + ENCODER_FEATURE = 0x03, // Motor encoder/odometer input + EVENT_TIMESTAMP_FEATURE = 0x04, // Precision event timestamping + UART_FEATURE = 0x05 // UART data or control lines }; //API Enum: GpioBehavior // GPIO Pin behavior // - // UNUSED_BEHAVIOR - 0x00 - Unused - // GPIO_INPUT_BEHAVIOR - 0x01 - Input - // GPIO_OUTPUT_LOW_BEHAVIOR - 0x02 - Output on low - // GPIO_OUTPUT_HIGH_BEHAVIOR - 0x03 - Output on high + // GPIO_UNUSED - 0x00 - Pin is unused + // GPIO_INPUT - 0x01 - Pin will be an input + // GPIO_OUTPUT_LOW - 0x02 - Pin is an output initially in the LOW state + // GPIO_OUTPUT_HIGH - 0x03 - Pin is an output initially in the HIGH state enum GpioBehavior { - UNUSED_BEHAVIOR = 0x00, - GPIO_INPUT_BEHAVIOR = 0x01, - GPIO_OUTPUT_LOW_BEHAVIOR = 0x02, - GPIO_OUTPUT_HIGH_BEHAVIOR = 0x03 + GPIO_UNUSED = 0x00, // Pin is unused + GPIO_INPUT = 0x01, // Pin will be an input + GPIO_OUTPUT_LOW = 0x02, // Pin is an output initially in the LOW state + GPIO_OUTPUT_HIGH = 0x03 // Pin is an output initially in the HIGH state }; //API Enum: PpsBehavior // PPS Pin behavior // - // UNUSED - 0x00 - Pin is unused - // PPS_INPUT - 0x01 - Input - // PPS_OUTPUT - 0x02 - Single pulse input; one direction only + // UNUSED - 0x00 - Pin is unused + // PPS_INPUT - 0x01 - Pin will receive the pulse-per-second signal + // PPS_OUTPUT - 0x02 - Pin will transmit the pulse-per-second signal from the device enum PpsBehavior { - PPS_UNUSED = 0x00, - PPS_INPUT = 0x01, - PPS_OUTPUT = 0x02 + PPS_UNUSED = 0x00, // Pin is unused + PPS_INPUT = 0x01, // Pin will receive the pulse-per-second signal + PPS_OUTPUT = 0x02 // Pin will transmit the pulse-per-second signal from the device }; //API Enum: EncoderBehavior // Encoder Pin behavior // - // UNUSED - 0x00 - Pin is unused - // ENCODER_A - 0x01 - Encoder A - // ENCODER_B - 0x02 - Encoder B + // ENCODER_UNUSED - 0x00 - Pin is unused + // ENCODER_A - 0x01 - Encoder A + // ENCODER_B - 0x02 - Encoder B enum EncoderBehavior { - ENCODER_UNUSED = 0x00, - ENCODER_A = 0x01, - ENCODER_B = 0x02 + ENCODER_UNUSED = 0x00, // Pin is unused + ENCODER_A = 0x01, // Encoder A + ENCODER_B = 0x02 // Encoder B }; //API Enum: EventTimestampBehavior // Event Timestamp Pin behavior // - // TIMESTAMP_UNUSED - 0x00 - Pin is unused - // TIMESTAMP_RISING - 0x01 - Rising edge will be timestamped - // TIMESTAMP_FALLING - 0x02 - Falling edge will be timestamped - // TIMESTAMP_EDGE - 0x03 - Both rising and falling edges will be timestamped + // TIMESTAMP_UNUSED - 0x00 - Pin is unused + // TIMESTAMP_RISING - 0x01 - Rising edge will be timestamped + // TIMESTAMP_FALLING - 0x02 - Falling edge will be timestamped + // TIMESTAMP_EITHER - 0x03 - Both rising and falling edges will be timestamped enum EventTimestampBehavior { - EVENT_TIMESTAMP_UNUSED = 0x00, - EVENT_TIMESTAMP_RISING = 0x01, - EVENT_TIMESTAMP_FALLING = 0x02, - EVENT_TIMESTAMP_EDGE = 0x03, + TIMESTAMP_UNUSED = 0x00, // Pin is unused + TIMESTAMP_RISING = 0x01, // Rising edge will be timestamped + TIMESTAMP_FALLING = 0x02, // Falling edge will be timestamped + TIMESTAMP_EITHER = 0x03 // Both rising and falling edges will be timestamped }; //API Enum: UartBehavior // UART Pin behavior // Note: only one Transmit and one Receive pin can be configured per port pair (see documentation) // - // UART_TRANSMIT - 0x01 - UART transmit line - // UART_RECEIVE - 0x02 - UART receive line + // UART_UNUSED - 0x00 - Pin is unused + // UART_PORT2_TX - 0x21 - UART port 2 transmit + // UART_PORT2_RX - 0x22 - UART port 2 receive + // UART_PORT3_TX - 0x31 - UART port 3 transmit + // UART_PORT3_RX - 0x32 - UART port 3 receive enum UartBehavior { - UART_TRANSMIT = 0x01, // UART transmit line - UART_RECEIVE = 0x02 // UART receive line + UART_UNUSED = 0x00, // Pin is unused + UART_PORT2_TX = 0x21, // UART port 2 transmit + UART_PORT2_RX = 0x22, // UART port 2 receive + UART_PORT3_TX = 0x31, // UART port 3 transmit + UART_PORT3_RX = 0x32 // UART port 3 receive }; //API Enum: PinModes - // // PinModes for the pinMode Bitfield - // OPEN_DRAIN - 0x01 - // PULLDOWN - 0x02 - // PULLUP - 0x04 + // + // NONE - 0x00 - Pin not set + // OPEN_DRAIN - 0x01 - The pin will be an open-drain output + // PULLDOWN - 0x02 - The pin will have an internal pull-down resistor enabled + // PULLUP - 0x04 - The pin will have an internal pull-up resistor enabled enum PinModes { - OPEN_DRAIN = 0x01, - PULLDOWN = 0x02, - PULLUP = 0x04 + NONE = 0x00, // Pin not set + OPEN_DRAIN = 0x01, // The pin will be an open-drain output + PULLDOWN = 0x02, // The pin will have an internal pull-down resistor enabled + PULLUP = 0x04 // The pin will have an internal pull-up resistor enabled }; Bitfield pinMode; @@ -2918,8 +3078,8 @@ namespace mscl //API Function: pinModeValue // Gets or sets the underlying value for the pin mode bitfield - void pinModeValue(uint8 val) { pinMode.value(val); }; - uint8 pinModeValue() const { return static_cast(pinMode.value()); }; + void pinModeValue(uint8 val) { pinMode.value(val); } + uint8 pinModeValue() const { return static_cast(pinMode.value()); } private: friend class InertialNode; @@ -2933,21 +3093,25 @@ namespace mscl static GpioConfiguration fromCommandResponse(const MipFieldValues& responseValues, uint8 startIndex = 0); }; - //API Typedef: PinModes + //API Typedef: GpioPinId + // A uint8 representing logical GPIO pin IDs + typedef uint8 GpioPinId; + + //API Typedef: GpioPinModeOptions // A vector of representing masked pin modes typedef std::vector GpioPinModeOptions; - //API Typedef: BehaviorModes + //API Typedef: GpioBehaviorModes // A map of uint behavior ID, pairs typedef std::map GpioBehaviorModes; - //API Typedef: FeatureBehaviors + //API Typedef: GpioFeatureBehaviors // A map of , pairs typedef std::map GpioFeatureBehaviors; //API Typedef: GpioPinOptions - // A map of uint GPIO pin ID, pairs - typedef std::map GpioPinOptions; + // A map of uint , pairs + typedef std::map GpioPinOptions; //API Enum: EventControlMode // Event control modes diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp index deac3e476..b6843dd7e 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp +++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.cpp @@ -63,6 +63,22 @@ namespace mscl Value::UINT8(0) }); } + DeviceCommPort InertialNode::getInterfaceControl(const uint8 interfaceId) const + { + return m_impl->getInterfaceControl(interfaceId); + } + + void InertialNode::setInterfaceControl(const DeviceCommPort& portInterface) + { + m_impl->setInterfaceControl(portInterface); + } + + void InertialNode::setInterfaceControl(const uint8 interfaceId, const DeviceCommPort::Protocol inputProtocols, + const DeviceCommPort::Protocol outputProtocols) + { + m_impl->setInterfaceControl(interfaceId, inputProtocols, outputProtocols); + } + uint8 InertialNode::getCommunicationMode() { return m_impl->getCommunicationMode(); @@ -1235,6 +1251,36 @@ namespace mscl }); } + GnssSpartnConfiguration InertialNode::getGnssSpartnConfig() const + { + MipFieldValues data = m_impl->get(MipTypes::CMD_GNSS_SPARTN_CONFIG); + GnssSpartnConfiguration config; + config.enable(data[0].as_bool()); + config.type(static_cast(data[1].as_uint8())); + config.currentKeyTow(data[2].as_uint32()); + config.currentKeyWeek(data[3].as_uint16()); + config.currentKey(data[4].as_string().c_str()); + config.nextKeyTow(data[5].as_uint32()); + config.nextKeyWeek(data[6].as_uint16()); + config.nextKey(data[7].as_string().c_str()); + + return config; + } + + void InertialNode::setGnssSpartnConfig(GnssSpartnConfiguration config) + { + m_impl->set(MipTypes::CMD_GNSS_SPARTN_CONFIG, { + Value::UINT8(static_cast(config.enabled())), + Value::UINT8(static_cast(config.type())), + Value::UINT32(config.currentKeyTow()), + Value::UINT16(config.currentKeyWeek()), + Value(ValueType::valueType_string, config.currentKey()), + Value::UINT32(config.nextKeyTow()), + Value::UINT16(config.nextKeyWeek()), + Value(ValueType::valueType_string, config.nextKey()), + }); + } + bool InertialNode::rtkEnabled() const { MipFieldValues data = m_impl->get(MipTypes::CMD_GNSS_RTK_CONFIG); @@ -1359,7 +1405,7 @@ namespace mscl return ret; } - void InertialNode::setAidingMeasurementRefrenceFrames(const MeasurementReferenceFrames& frames, bool clearExcludedIds) const + void InertialNode::setAidingMeasurementReferenceFrames(const MeasurementReferenceFrames& frames, bool clearExcludedIds) const { MeasurementReferenceFrame clearFrame; diff --git a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h index d8a64df95..c0479825c 100644 --- a/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h +++ b/MSCL/source/mscl/MicroStrain/Inertial/InertialNode.h @@ -151,6 +151,48 @@ namespace mscl // - : An in the channels parameter is not part of the specified 's descriptor set. void setFactoryStreamingChannels(InertialTypes::FactoryStreamingOption option); + //API Function: getInterfaceControl + // Gets the current comm port interface configuration for the specified ID. + // This includes the port type, ID and input/output protocols currently configured. + // + //Returns: + // The comm port configuration for the specified ID. + // + //Exceptions: + // - : The command or is not supported by this Node. + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + DeviceCommPort getInterfaceControl(const uint8 interfaceId) const; + + //API Function: setInterfaceControl + // Sets the specified comm port interface configuration for the node. + // Note: See the device's manual for possible configurations and limitations. + // + //Parameters: + // portInterface - The preconfigured comm port information to set + // + //Exceptions: + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + void setInterfaceControl(const DeviceCommPort& portInterface); + + //API Function: setInterfaceControl + // Sets the specified comm port interface configuration for the node. + // Note: See the device's manual for possible configurations and limitations. + // + //Parameters: + // interfaceId - The interface ID to configure + // inputProtocols - The protocols to receive on the specified ID + // outputProtocols - The protocols to transmit on the specified ID + // + //Exceptions: + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + void setInterfaceControl(const uint8 interfaceId, const DeviceCommPort::Protocol inputProtocols, const DeviceCommPort::Protocol outputProtocols); + //API Function: getCommunicationMode // Gets the current communication mode that the node is in. // @@ -2317,6 +2359,32 @@ namespace mscl // - : A connection error has occurred with the InertialNode. void setGnssSignalConfig(GnssSignalConfiguration config); + //API Function: getGnssSpartnConfig + // Gets the device's current GNSS SPARTN configuration. + // + //Return: + // - The current GNSS SPARTN configuration + // + //Exceptions: + // - : The command is not supported by this Node. + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + GnssSpartnConfiguration getGnssSpartnConfig() const; + + //API Function: setGnssSpartnConfig + // Set the GNSS SPARTN configuration. + // + //Parameter: + // config - the to apply. + // + //Exceptions: + // - : The command is not supported by this Node. + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + void setGnssSpartnConfig(GnssSpartnConfiguration config); + //API Function: rtkEnabled // Reads whether RTK input is currently enabled on the device. // @@ -2423,7 +2491,7 @@ namespace mscl //Parameters: // frames - map of reference frames for each frame ID to be set // clearExcludedIds - bool, default: false - if true, clears reference frame information for IDs not included in the frames map otherwise only overwrites included IDs - void setAidingMeasurementRefrenceFrames(const MeasurementReferenceFrames& frames, bool clearExcludedIds = false) const; + void setAidingMeasurementReferenceFrames(const MeasurementReferenceFrames& frames, bool clearExcludedIds = false) const; //API Function: getAidingMeasurementReferenceFrame // Get the aiding measurement reference frame for the specified frame ID configured on the device. diff --git a/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.cpp b/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.cpp index d0309ff86..fac780871 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.cpp +++ b/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.cpp @@ -83,6 +83,23 @@ namespace mscl return response.data().read_uint16(0); } + DeviceCommPort MIP_Commands::parseData_InterfaceControl(const GenericMipCmdResponse& response) + { + //use a DataBuffer to make reading nicer + DataBuffer db(response.data()); + + //read the interface ID value + uint8 interfaceId = db.read_uint8(); + + //read the input protocols + DeviceCommPort::Protocol inputProtocols = static_cast(db.read_uint32()); + + //read the output protocols + DeviceCommPort::Protocol outputProtocols = static_cast(db.read_uint32()); + + return DeviceCommPort(interfaceId, inputProtocols, outputProtocols); + } + uint8 MIP_Commands::parseData_CommunicationMode(const GenericMipCmdResponse& response) { //cast to comm mode and return diff --git a/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.h b/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.h index 6320c3e35..dddccbd5b 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.h +++ b/MSCL/source/mscl/MicroStrain/MIP/Commands/MIP_Commands.h @@ -57,6 +57,16 @@ namespace mscl // The data rate base parsed from the response static uint16 parseData_DataRateBase(const GenericMipCmdResponse& response); + //Function: parseData_InterfaceControl + // Parses the data from a InterfaceControl response + // + //Parameters: + // response - The that contains the data to be parsed + // + //Returns: + // The comm port interface configuration parsed from the response + static DeviceCommPort parseData_InterfaceControl(const GenericMipCmdResponse& response); + //Function: parseData_CommunicationMode // Parses the data from a CommunicationMode response // @@ -64,7 +74,7 @@ namespace mscl // response - The that contains the data to be parsed // //Returns: - // The data rate base parsed from the response + // The comm mode parsed from the response static uint8 parseData_CommunicationMode(const GenericMipCmdResponse& response); // static uint8 parseData_AssistedFixOptions(const GenericMipCmdResponse& response); diff --git a/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.cpp b/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.cpp index c41c77453..760067fb4 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.cpp +++ b/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.cpp @@ -4,14 +4,14 @@ ** MIT Licensed. See the included LICENSE file for a copy of the full MIT License. ** *****************************************************************************************/ -#include "stdafx.h" -#include "mscl/MicroStrain/MIP/Commands/GenericMipCommand.h" -#include "MipCommand.h" +#include "mscl/MicroStrain/MIP/Commands/MipCommand.h" + #include "mscl/MicroStrain/ResponseCollector.h" +#include "mscl/MicroStrain/MIP/Commands/GenericMipCommand.h" namespace mscl { - ///// MipCommand ///// + ///// MipCommand ///// std::shared_ptr MipCommand::createResponse(std::weak_ptr collector) { @@ -35,32 +35,56 @@ namespace mscl ValueType type = val.storedAs(); switch (type) { - case valueType_bool: - command.append_uint8((val.as_bool() ? 1 : 0)); - break; - case valueType_uint8: - command.append_uint8(val.as_uint8()); - break; - case valueType_uint16: - command.append_uint16(val.as_uint16()); - break; - case valueType_uint32: - command.append_uint32(val.as_uint32()); - break; - case valueType_uint64: - command.append_uint64(val.as_uint64()); - break; - case valueType_int8: - command.append_int8(val.as_int8()); - break; - case valueType_float: - command.append_float(val.as_float()); - break; - case valueType_double: - command.append_double(val.as_double()); - break; - default: - break; + case valueType_bool: + { + command.append_uint8((val.as_bool() ? 1 : 0)); + break; + } + case valueType_uint8: + { + command.append_uint8(val.as_uint8()); + break; + } + case valueType_uint16: + { + command.append_uint16(val.as_uint16()); + break; + } + case valueType_uint32: + { + command.append_uint32(val.as_uint32()); + break; + } + case valueType_uint64: + { + command.append_uint64(val.as_uint64()); + break; + } + case valueType_int8: + { + command.append_int8(val.as_int8()); + break; + } + case valueType_float: + { + command.append_float(val.as_float()); + break; + } + case valueType_double: + { + command.append_double(val.as_double()); + break; + } + case valueType_string: + { + std::string str = val.as_string(); + command.append_string(str); + break; + } + default: + { + break; + } } } @@ -92,82 +116,90 @@ namespace mscl { switch (cmd) { - // 0x0C - case MipTypes::CMD_POLL: - case MipTypes::CMD_GET_BASE_RATE: - case MipTypes::CMD_FACTORY_STREAMING: - case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: - // 0x0D - case MipTypes::CMD_EF_RUN_FILTER: - case MipTypes::CMD_EF_EXTERN_SPEED_UPDATE: - // Ox0E - case MipTypes::CMD_GNSS_RECEIVER_INFO: - // 0x13 - case MipTypes::CMD_AIDING_POS_ECEF: - case MipTypes::CMD_AIDING_POS_LLH: - case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: - case MipTypes::CMD_AIDING_VEL_ECEF: - case MipTypes::CMD_AIDING_VEL_NED: - case MipTypes::CMD_AIDING_VEL_BODY_FRAME: - case MipTypes::CMD_AIDING_HEADING_TRUE: - case MipTypes::CMD_AIDING_MAGNETIC_FIELD: - case MipTypes::CMD_AIDING_PRESSURE: - return {}; - - /**** Read, Write ****/ - // 0x0C - case MipTypes::CMD_GPIO_STATE: - return { - MipTypes::FunctionSelector::USE_NEW_SETTINGS, - MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS - }; - - /**** Read, Write, Save, Load, Default ****/ - // 0x01 - case MipTypes::CMD_COMM_PORT_SPEED: - // 0x0C - case MipTypes::CMD_NMEA_MESSAGE_FORMAT: - case MipTypes::CMD_MESSAGE_FORMAT: - case MipTypes::CMD_CONTINUOUS_DATA_STREAM: - case MipTypes::CMD_PPS_SOURCE: - case MipTypes::CMD_EVENT_CONTROL: - case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: - case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: - case MipTypes::CMD_GPIO_CONFIGURATION: - case MipTypes::CMD_ODOMETER_SETTINGS: - case MipTypes::CMD_SENSOR_RANGE: - case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: - // 0x0D - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: - case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: - case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: - case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: - case MipTypes::CMD_EF_RELATIVE_POSITION_REF: - case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: - case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: - case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: - case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: - case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: - // 0x0E - case MipTypes::CMD_GNSS_SIGNAL_CONFIG: - case MipTypes::CMD_GNSS_RTK_CONFIG: - // 0x13 - case MipTypes::CMD_AIDING_FRAME_CONFIG: - case MipTypes::CMD_AIDING_ECHO_CONTROL: - return { - MipTypes::FunctionSelector::USE_NEW_SETTINGS, - MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS, - MipTypes::FunctionSelector::SAVE_CURRENT_SETTINGS, - MipTypes::FunctionSelector::LOAD_STARTUP_SETTINGS, - MipTypes::FunctionSelector::RESET_TO_DEFAULT - }; - - default: - return {}; + // 0x0C + case MipTypes::CMD_POLL: + case MipTypes::CMD_GET_BASE_RATE: + case MipTypes::CMD_FACTORY_STREAMING: + case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: + // 0x0D + case MipTypes::CMD_EF_RUN_FILTER: + case MipTypes::CMD_EF_EXTERN_SPEED_UPDATE: + // Ox0E + case MipTypes::CMD_GNSS_RECEIVER_INFO: + // 0x13 + case MipTypes::CMD_AIDING_POS_ECEF: + case MipTypes::CMD_AIDING_POS_LLH: + case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: + case MipTypes::CMD_AIDING_VEL_ECEF: + case MipTypes::CMD_AIDING_VEL_NED: + case MipTypes::CMD_AIDING_VEL_BODY_FRAME: + case MipTypes::CMD_AIDING_HEADING_TRUE: + case MipTypes::CMD_AIDING_MAGNETIC_FIELD: + case MipTypes::CMD_AIDING_PRESSURE: + { + return {}; + } + + /**** Read, Write ****/ + // 0x0C + case MipTypes::CMD_GPIO_STATE: + { + return { + MipTypes::FunctionSelector::USE_NEW_SETTINGS, + MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS + }; + } + + /**** Read, Write, Save, Load, Default ****/ + // 0x01 + case MipTypes::CMD_COMM_PORT_SPEED: + // 0x0C + case MipTypes::CMD_NMEA_MESSAGE_FORMAT: + case MipTypes::CMD_MESSAGE_FORMAT: + case MipTypes::CMD_CONTINUOUS_DATA_STREAM: + case MipTypes::CMD_PPS_SOURCE: + case MipTypes::CMD_EVENT_CONTROL: + case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: + case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: + case MipTypes::CMD_GPIO_CONFIGURATION: + case MipTypes::CMD_ODOMETER_SETTINGS: + case MipTypes::CMD_SENSOR_RANGE: + case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: + // 0x0D + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: + case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: + case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: + case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: + case MipTypes::CMD_EF_RELATIVE_POSITION_REF: + case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: + case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: + case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: + case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: + case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: + // 0x0E + case MipTypes::CMD_GNSS_SIGNAL_CONFIG: + case MipTypes::CMD_GNSS_RTK_CONFIG: + case MipTypes::CMD_GNSS_SPARTN_CONFIG: + // 0x13 + case MipTypes::CMD_AIDING_FRAME_CONFIG: + case MipTypes::CMD_AIDING_ECHO_CONTROL: + { + return { + MipTypes::FunctionSelector::USE_NEW_SETTINGS, + MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS, + MipTypes::FunctionSelector::SAVE_CURRENT_SETTINGS, + MipTypes::FunctionSelector::LOAD_STARTUP_SETTINGS, + MipTypes::FunctionSelector::RESET_TO_DEFAULT + }; + } + default: + { + return {}; + } } } @@ -200,39 +232,44 @@ namespace mscl switch (m_commandId) { // 0x0C - case MipTypes::CMD_CONTINUOUS_DATA_STREAM: - case MipTypes::CMD_GET_BASE_RATE: - case MipTypes::CMD_MESSAGE_FORMAT: - case MipTypes::CMD_EVENT_CONTROL: - case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: - case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: - case MipTypes::CMD_SENSOR_RANGE: - case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: - case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: + case MipTypes::CMD_CONTINUOUS_DATA_STREAM: + case MipTypes::CMD_GET_BASE_RATE: + case MipTypes::CMD_MESSAGE_FORMAT: + case MipTypes::CMD_EVENT_CONTROL: + case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: + case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: + case MipTypes::CMD_SENSOR_RANGE: + case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: + case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: // 0x0D - case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: + case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: //0x13 - case MipTypes::CMD_AIDING_FRAME_CONFIG: - // check that the identifier is echoed back in the response - matchData.emplace(0, m_data[0]); - break; + case MipTypes::CMD_AIDING_FRAME_CONFIG: + { + // check that the identifier is echoed back in the response + matchData.emplace(0, m_data[0]); + break; + } - // 0x13 - case MipTypes::CMD_AIDING_POS_ECEF: - case MipTypes::CMD_AIDING_POS_LLH: - case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: - case MipTypes::CMD_AIDING_VEL_ECEF: - case MipTypes::CMD_AIDING_VEL_NED: - case MipTypes::CMD_AIDING_VEL_BODY_FRAME: - case MipTypes::CMD_AIDING_HEADING_TRUE: - case MipTypes::CMD_AIDING_MAGNETIC_FIELD: - case MipTypes::CMD_AIDING_PRESSURE: - // check that the frame id is echoed back in the response - matchData.emplace(10, m_data[3]); - break; - - default: - break; + // 0x13 + case MipTypes::CMD_AIDING_POS_ECEF: + case MipTypes::CMD_AIDING_POS_LLH: + case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: + case MipTypes::CMD_AIDING_VEL_ECEF: + case MipTypes::CMD_AIDING_VEL_NED: + case MipTypes::CMD_AIDING_VEL_BODY_FRAME: + case MipTypes::CMD_AIDING_HEADING_TRUE: + case MipTypes::CMD_AIDING_MAGNETIC_FIELD: + case MipTypes::CMD_AIDING_PRESSURE: + { + // check that the frame id is echoed back in the response + matchData.emplace(10, m_data[3]); + break; + } + default: + { + break; + } } return matchData; @@ -242,114 +279,223 @@ namespace mscl { switch (id) { - // 0x01 - case MipTypes::CMD_COMM_PORT_SPEED: - return "CommPortSpeed"; - // 0x0C - case MipTypes::CMD_NMEA_MESSAGE_FORMAT: - return "NmeaMessageFormat"; - case MipTypes::CMD_POLL: - return "PollData"; - case MipTypes::CMD_GET_BASE_RATE: - return "GetDataBaseRate"; - case MipTypes::CMD_MESSAGE_FORMAT: - return "MessageFormat"; - case MipTypes::CMD_FACTORY_STREAMING: - return "FactoryStreaming"; - case MipTypes::CMD_CONTINUOUS_DATA_STREAM: - return "ContinuousDataStream"; - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: - return "SensorToVehicleFrameTransformationEulerAngles"; - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: - return "SensorToVehicleFrameTransformationQuaternion"; - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: - return "SensorToVehicleFrameTransformationDCM"; - case MipTypes::CMD_PPS_SOURCE: - return "PpsSource"; - case MipTypes::CMD_EVENT_SUPPORT: - return "EventSupport"; - case MipTypes::CMD_EVENT_CONTROL: - return "EventControl"; - case MipTypes::CMD_EVENT_TRIGGER_STATUS: - return "EventTriggerStatus"; - case MipTypes::CMD_EVENT_ACTION_STATUS: - return "EventActionStatus"; - case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: - return "EventTriggerConfiguration"; - case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: - return "EventActionConfiguration"; - case MipTypes::CMD_GPIO_CONFIGURATION: - return "GpioConfiguration"; - case MipTypes::CMD_GPIO_STATE: - return "GpioState"; - case MipTypes::CMD_ODOMETER_SETTINGS: - return "OdometerSettings"; - case MipTypes::CMD_SENSOR_RANGE: - return "SensorRange"; - case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: - return "SupportedSensorRanges"; - case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: - return "LowPassAntiAliasingFilter"; - // 0x0D - case MipTypes::CMD_EF_RUN_FILTER: - return "RunEstimationFilter"; - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: - return "SensorToVehicleFrameRotationDCM"; - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: - return "SensorToVehicleFrameRotationQuaternion"; - case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: - return "AidingMeasurementEnable"; - case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: - return "AdaptiveFilterOptions"; - case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: - return "MultiAntennaOffset"; - case MipTypes::CMD_EF_RELATIVE_POSITION_REF: - return "RelativePositionReference"; - case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: - return "LeverArmOffsetReference"; - case MipTypes::CMD_EF_EXTERN_SPEED_UPDATE: - return "ExternalSpeedMeasurementUpdate"; - case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: - return "SpeedMeasurementLeverArmOffset"; - case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: - return "VerticalGyroConstraint"; - case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: - return "WheeledVehicleConstraint"; - case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: - return "GnssAntennaLeverArmCalibration"; - // 0x0E - case MipTypes::CMD_GNSS_RECEIVER_INFO: - return "GnssReceiverInfo"; - case MipTypes::CMD_GNSS_SIGNAL_CONFIG: - return "GnssSignalConfiguration"; - case MipTypes::CMD_GNSS_RTK_CONFIG: - return "GnssRtkConfiguration"; - // 0x13 - case MipTypes::CMD_AIDING_FRAME_CONFIG: - return "AidingMeasurementReferenceFrameConfig"; - case MipTypes::CMD_AIDING_ECHO_CONTROL: - return "AidingMeasurementEchoControl"; - case MipTypes::CMD_AIDING_POS_ECEF: - return "AidingMeasurementEcefPosition"; - case MipTypes::CMD_AIDING_POS_LLH: - return "AidingMeasurementLlhPosition"; - case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: - return "AidingMeasurementHeightAboveEllipsoid"; - case MipTypes::CMD_AIDING_VEL_ECEF: - return "AidingMeasurementEcefVelocity"; - case MipTypes::CMD_AIDING_VEL_NED: - return "AidingMeasurementNedVelocity"; - case MipTypes::CMD_AIDING_VEL_BODY_FRAME: - return "AidingMeasurementVehicelFrameVelocity"; - case MipTypes::CMD_AIDING_HEADING_TRUE: - return "AidingMeasurementTrueHeading"; - case MipTypes::CMD_AIDING_MAGNETIC_FIELD: - return "AidingMeasurementMagneticField"; - case MipTypes::CMD_AIDING_PRESSURE: - return "AidingMeasurementPressure"; - - default: - return ""; + // 0x01 + case MipTypes::CMD_COMM_PORT_SPEED: + { + return "CommPortSpeed"; + } + + // 0x0C + case MipTypes::CMD_NMEA_MESSAGE_FORMAT: + { + return "NmeaMessageFormat"; + } + case MipTypes::CMD_POLL: + { + return "PollData"; + } + case MipTypes::CMD_GET_BASE_RATE: + { + return "GetDataBaseRate"; + } + case MipTypes::CMD_MESSAGE_FORMAT: + { + return "MessageFormat"; + } + case MipTypes::CMD_FACTORY_STREAMING: + { + return "FactoryStreaming"; + } + case MipTypes::CMD_CONTINUOUS_DATA_STREAM: + { + return "ContinuousDataStream"; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: + { + return "SensorToVehicleFrameTransformationEulerAngles"; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: + { + return "SensorToVehicleFrameTransformationQuaternion"; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: + { + return "SensorToVehicleFrameTransformationDCM"; + } + case MipTypes::CMD_PPS_SOURCE: + { + return "PpsSource"; + } + case MipTypes::CMD_EVENT_SUPPORT: + { + return "EventSupport"; + } + case MipTypes::CMD_EVENT_CONTROL: + { + return "EventControl"; + } + case MipTypes::CMD_EVENT_TRIGGER_STATUS: + { + return "EventTriggerStatus"; + } + case MipTypes::CMD_EVENT_ACTION_STATUS: + { + return "EventActionStatus"; + } + case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: + { + return "EventTriggerConfiguration"; + } + case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: + { + return "EventActionConfiguration"; + } + case MipTypes::CMD_GPIO_CONFIGURATION: + { + return "GpioConfiguration"; + } + case MipTypes::CMD_GPIO_STATE: + { + return "GpioState"; + } + case MipTypes::CMD_ODOMETER_SETTINGS: + { + return "OdometerSettings"; + } + case MipTypes::CMD_SENSOR_RANGE: + { + return "SensorRange"; + } + case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: + { + return "SupportedSensorRanges"; + } + case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: + { + return "LowPassAntiAliasingFilter"; + } + + // 0x0D + case MipTypes::CMD_EF_RUN_FILTER: + { + return "RunEstimationFilter"; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: + { + return "SensorToVehicleFrameRotationDCM"; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: + { + return "SensorToVehicleFrameRotationQuaternion"; + } + case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: + { + return "AidingMeasurementEnable"; + } + case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: + { + return "AdaptiveFilterOptions"; + } + case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: + { + return "MultiAntennaOffset"; + } + case MipTypes::CMD_EF_RELATIVE_POSITION_REF: + { + return "RelativePositionReference"; + } + case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: + { + return "LeverArmOffsetReference"; + } + case MipTypes::CMD_EF_EXTERN_SPEED_UPDATE: + { + return "ExternalSpeedMeasurementUpdate"; + } + case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: + { + return "SpeedMeasurementLeverArmOffset"; + } + case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: + { + return "VerticalGyroConstraint"; + } + case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: + { + return "WheeledVehicleConstraint"; + } + case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: + { + return "GnssAntennaLeverArmCalibration"; + } + + // 0x0E + case MipTypes::CMD_GNSS_RECEIVER_INFO: + { + return "GnssReceiverInfo"; + } + case MipTypes::CMD_GNSS_SIGNAL_CONFIG: + { + return "GnssSignalConfiguration"; + } + case MipTypes::CMD_GNSS_RTK_CONFIG: + { + return "GnssRtkConfiguration"; + } + case MipTypes::CMD_GNSS_SPARTN_CONFIG: + { + return "GnssSpartnConfiguration"; + } + + // 0x13 + case MipTypes::CMD_AIDING_FRAME_CONFIG: + { + return "AidingMeasurementReferenceFrameConfig"; + } + case MipTypes::CMD_AIDING_ECHO_CONTROL: + { + return "AidingMeasurementEchoControl"; + } + case MipTypes::CMD_AIDING_POS_ECEF: + { + return "AidingMeasurementEcefPosition"; + } + case MipTypes::CMD_AIDING_POS_LLH: + { + return "AidingMeasurementLlhPosition"; + } + case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: + { + return "AidingMeasurementHeightAboveEllipsoid"; + } + case MipTypes::CMD_AIDING_VEL_ECEF: + { + return "AidingMeasurementEcefVelocity"; + } + case MipTypes::CMD_AIDING_VEL_NED: + { + return "AidingMeasurementNedVelocity"; + } + case MipTypes::CMD_AIDING_VEL_BODY_FRAME: + { + return "AidingMeasurementVehicelFrameVelocity"; + } + case MipTypes::CMD_AIDING_HEADING_TRUE: + { + return "AidingMeasurementTrueHeading"; + } + case MipTypes::CMD_AIDING_MAGNETIC_FIELD: + { + return "AidingMeasurementMagneticField"; + } + case MipTypes::CMD_AIDING_PRESSURE: + { + return "AidingMeasurementPressure"; + } + default: + { + return ""; + } } } @@ -357,73 +503,92 @@ namespace mscl { switch (id) { + // 0x0C + case MipTypes::CMD_CONTINUOUS_DATA_STREAM: + { + return 0x85; + } + case MipTypes::CMD_EVENT_SUPPORT: + { + return 0xB4; + } + case MipTypes::CMD_EVENT_CONTROL: + { + return 0xB5; + } + case MipTypes::CMD_EVENT_TRIGGER_STATUS: + { + return 0xB6; + } + case MipTypes::CMD_EVENT_ACTION_STATUS: + { + return 0xB7; + } + case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: + { + return 0xB8; + } + case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: + { + return 0xB9; + } - // 0x0C - case MipTypes::CMD_CONTINUOUS_DATA_STREAM: - return 0x85; - case MipTypes::CMD_EVENT_SUPPORT: - return 0xB4; - case MipTypes::CMD_EVENT_CONTROL: - return 0xB5; - case MipTypes::CMD_EVENT_TRIGGER_STATUS: - return 0xB6; - case MipTypes::CMD_EVENT_ACTION_STATUS: - return 0xB7; - case MipTypes::CMD_EVENT_TRIGGER_CONFIGURATION: - return 0xB8; - case MipTypes::CMD_EVENT_ACTION_CONFIGURATION: - return 0xB9; - // 0x0D - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: - return 0xBE; - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: - return 0xBF; - - // 0x01 - case MipTypes::CMD_COMM_PORT_SPEED: //0x89 - // 0x0C - case MipTypes::CMD_NMEA_MESSAGE_FORMAT: //0x8C - case MipTypes::CMD_GET_BASE_RATE: //0x8E - case MipTypes::CMD_MESSAGE_FORMAT: //0x8F - case MipTypes::CMD_PPS_SOURCE: //0xA8 - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: //0xB1 - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: //0xB2 - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: //0xB3 - case MipTypes::CMD_GPIO_CONFIGURATION: //0xC1 - case MipTypes::CMD_GPIO_STATE: //0xC2 - case MipTypes::CMD_ODOMETER_SETTINGS: //0xC3 - case MipTypes::CMD_SENSOR_RANGE: //0xD2 - case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: //0xD3 - case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: //0xD4 - // 0x0D - case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: //0xD0 - case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: //0xD3 - case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: //0xD4 - case MipTypes::CMD_EF_RELATIVE_POSITION_REF: //0xD5 - case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: //0xD6 - case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: //0xE1 - case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: //0xE2 - case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: //0xE3 - case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: //0xE4 - // 0x0E - case MipTypes::CMD_GNSS_RECEIVER_INFO: //0x81 - case MipTypes::CMD_GNSS_SIGNAL_CONFIG: //0x82 - case MipTypes::CMD_GNSS_RTK_CONFIG: //0x90 - // 0x13 - all fields follow pattern - default: - { - // this pattern is not true for all commands - may result in communication failures - uint8 cmdDesc = Utils::lsb(static_cast(id)); - - // 0xF0-FF are reserved - // any command desc over 0x70 cannot follow this pattern and needs to be manually defined - if (cmdDesc >= 0x70) + // 0x0D + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: { - return 0; + return 0xBE; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: + { + return 0xBF; } - return cmdDesc | 0x80; - } + // 0x01 + case MipTypes::CMD_COMM_PORT_SPEED: //0x89 + // 0x0C + case MipTypes::CMD_NMEA_MESSAGE_FORMAT: //0x8C + case MipTypes::CMD_GET_BASE_RATE: //0x8E + case MipTypes::CMD_MESSAGE_FORMAT: //0x8F + case MipTypes::CMD_PPS_SOURCE: //0xA8 + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: //0xB1 + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: //0xB2 + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: //0xB3 + case MipTypes::CMD_GPIO_CONFIGURATION: //0xC1 + case MipTypes::CMD_GPIO_STATE: //0xC2 + case MipTypes::CMD_ODOMETER_SETTINGS: //0xC3 + case MipTypes::CMD_SENSOR_RANGE: //0xD2 + case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: //0xD3 + case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: //0xD4 + // 0x0D + case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: //0xD0 + case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: //0xD3 + case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: //0xD4 + case MipTypes::CMD_EF_RELATIVE_POSITION_REF: //0xD5 + case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: //0xD6 + case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: //0xE1 + case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: //0xE2 + case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: //0xE3 + case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: //0xE4 + // 0x0E + case MipTypes::CMD_GNSS_RECEIVER_INFO: //0x81 + case MipTypes::CMD_GNSS_SIGNAL_CONFIG: //0x82 + case MipTypes::CMD_GNSS_RTK_CONFIG: //0x90 + case MipTypes::CMD_GNSS_SPARTN_CONFIG: //0xA0 + // 0x13 - all fields follow pattern + default: + { + // this pattern is not true for all commands - may result in communication failures + uint8 cmdDesc = Utils::lsb(static_cast(id)); + + // 0xF0-FF are reserved + // any command desc over 0x70 cannot follow this pattern and needs to be manually defined + if (cmdDesc >= 0x70) + { + return 0; + } + + return cmdDesc | 0x80; + } } } @@ -431,352 +596,418 @@ namespace mscl { switch (id) { - // 0x01 - case MipTypes::CMD_COMM_PORT_SPEED: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint32 - }; - - - // 0x0C - case MipTypes::CMD_NMEA_MESSAGE_FORMAT: - return{ - ValueType::valueType_uint8, - ValueType::valueType_Vector - }; - - case MipTypes::CMD_GET_BASE_RATE: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint16 - }; - - case MipTypes::CMD_MESSAGE_FORMAT: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_Vector - }; - - case MipTypes::CMD_CONTINUOUS_DATA_STREAM: - return{ - ValueType::valueType_uint8, - ValueType::valueType_bool - }; - - case MipTypes::CMD_PPS_SOURCE: - return{ ValueType::valueType_uint8 }; - - case MipTypes::CMD_EVENT_SUPPORT: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_Vector, - }; - - case MipTypes::CMD_EVENT_CONTROL: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8 - }; - - case MipTypes::CMD_EVENT_TRIGGER_STATUS: - return{ - ValueType::valueType_uint8, // count - ValueType::valueType_Vector // status info - }; - - case MipTypes::CMD_EVENT_ACTION_STATUS: - return{ - ValueType::valueType_uint8, // count - ValueType::valueType_Vector // status info - }; - - case MipTypes::CMD_ODOMETER_SETTINGS: - return{ - ValueType::valueType_uint8, // mode - ValueType::valueType_float, // scaling - ValueType::valueType_float // uncertainty - }; - - case MipTypes::CMD_SENSOR_RANGE: - return{ - ValueType::valueType_uint8, // sensor - ValueType::valueType_uint8 // range - }; - - case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_Vector - }; - - case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: - return{ - ValueType::valueType_uint16, - ValueType::valueType_bool, - ValueType::valueType_bool, - ValueType::valueType_float, - }; - - case MipTypes::CMD_GPIO_CONFIGURATION: - return{ - ValueType::valueType_uint8, - ValueType::valueType_int8, - ValueType::valueType_int8, - ValueType::valueType_int8 - }; - - case MipTypes::CMD_GPIO_STATE: - return{ - ValueType::valueType_uint8, - ValueType::valueType_bool - }; - - - // 0x0D - case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: - return{ - ValueType::valueType_uint16, - ValueType::valueType_bool - }; - - case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint16 - }; - - case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: - return{ - ValueType::valueType_uint8, - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float - }; - - case MipTypes::CMD_EF_RELATIVE_POSITION_REF: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_double, - ValueType::valueType_double, - ValueType::valueType_double - }; - - case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: - return{ - ValueType::valueType_uint8, - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, - }; - - case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: - return{ - ValueType::valueType_uint8, - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, - }; - - case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: - return{ - ValueType::valueType_bool, - ValueType::valueType_float - }; - - - // 0x0E - case MipTypes::CMD_GNSS_RECEIVER_INFO: - return{ - ValueType::valueType_uint8, // num receivers - ValueType::valueType_Vector // receiver info - }; - - case MipTypes::CMD_GNSS_SIGNAL_CONFIG: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_uint8 - }; - - // 0x13 - case MipTypes::CMD_AIDING_FRAME_CONFIG: - return{ - ValueType::valueType_uint8, // frame id - ValueType::valueType_uint8, // format - ValueType::valueType_bool, // error tracking enabled - ValueType::valueType_float, // translation - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_Vector, // rotation (ve3 for euler, vec4 for quat) - }; - case MipTypes::CMD_AIDING_ECHO_CONTROL: - return{ - ValueType::valueType_uint8 - }; - //case MipTypes::CMD_AIDING_POS_LOCAL: return{}; - case MipTypes::CMD_AIDING_POS_ECEF: - case MipTypes::CMD_AIDING_POS_LLH: - return{ - ValueType::valueType_uint8, // timebase - ValueType::valueType_uint8, // reserved - ValueType::valueType_uint64, // nanoseconds since timebase epoch - - ValueType::valueType_uint8, // frame id - - ValueType::valueType_double, // pos - ValueType::valueType_double, - ValueType::valueType_double, - ValueType::valueType_float, // unc - ValueType::valueType_float, - ValueType::valueType_float, - - ValueType::valueType_uint16, // valid flags - }; - case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: - return{ - ValueType::valueType_uint8, // timebase - ValueType::valueType_uint8, // reserved - ValueType::valueType_uint64, // nanoseconds since timebase epoch - - ValueType::valueType_uint8, // frame id - - ValueType::valueType_float, // height - ValueType::valueType_float, // unc - - ValueType::valueType_uint16, // valid flags - }; - //case MipTypes::CMD_AIDING_HEIGHT_REL: return{}; - case MipTypes::CMD_AIDING_VEL_ECEF: - case MipTypes::CMD_AIDING_VEL_NED: - case MipTypes::CMD_AIDING_VEL_BODY_FRAME: - return{ - ValueType::valueType_uint8, // timebase - ValueType::valueType_uint8, // reserved - ValueType::valueType_uint64, // nanoseconds since timebase epoch - - ValueType::valueType_uint8, // frame id - - ValueType::valueType_float, // vel - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, // unc - ValueType::valueType_float, - ValueType::valueType_float, - - ValueType::valueType_uint16, // valid flags - }; - //case MipTypes::CMD_AIDING_WHEELSPEED: return{}; - case MipTypes::CMD_AIDING_HEADING_TRUE: - return{ - ValueType::valueType_uint8, // timebase - ValueType::valueType_uint8, // reserved - ValueType::valueType_uint64, // nanoseconds since timebase epoch - - ValueType::valueType_uint8, // frame id - - ValueType::valueType_float, // heading - ValueType::valueType_float, // unc - - ValueType::valueType_uint16, // valid flags - }; - case MipTypes::CMD_AIDING_MAGNETIC_FIELD: - return{ - ValueType::valueType_uint8, // timebase - ValueType::valueType_uint8, // reserved - ValueType::valueType_uint64, // nanoseconds since timebase epoch - - ValueType::valueType_uint8, // frame id - - ValueType::valueType_float, // mag field - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, // unc - ValueType::valueType_float, - ValueType::valueType_float, - - ValueType::valueType_uint16, // valid flags - }; - case MipTypes::CMD_AIDING_PRESSURE: - return{ - ValueType::valueType_uint8, // timebase - ValueType::valueType_uint8, // reserved - ValueType::valueType_uint64, // nanoseconds since timebase epoch - - ValueType::valueType_uint8, // frame id - - ValueType::valueType_float, // pressure - ValueType::valueType_float, // unc - - ValueType::valueType_uint16, // valid flags - }; - //case MipTypes::CMD_AIDING_DELTA_POSITION: return{}; - //case MipTypes::CMD_AIDING_DELTA_ATTITUDE: return{}; - //case MipTypes::CMD_AIDING_ANGULAR_RATE_LOCAL: return{}; - - - // Single Bool + // 0x01 + case MipTypes::CMD_COMM_PORT_SPEED: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint32 + }; + } + + // 0x0C + case MipTypes::CMD_NMEA_MESSAGE_FORMAT: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_Vector + }; + } + case MipTypes::CMD_GET_BASE_RATE: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint16 + }; + } + case MipTypes::CMD_MESSAGE_FORMAT: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_Vector + }; + } + case MipTypes::CMD_CONTINUOUS_DATA_STREAM: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_bool + }; + } + case MipTypes::CMD_PPS_SOURCE: + { + return { ValueType::valueType_uint8 }; + } + case MipTypes::CMD_EVENT_SUPPORT: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_Vector, + }; + } + case MipTypes::CMD_EVENT_CONTROL: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8 + }; + } + case MipTypes::CMD_EVENT_TRIGGER_STATUS: + { + return { + ValueType::valueType_uint8, // count + ValueType::valueType_Vector // status info + }; + } + case MipTypes::CMD_EVENT_ACTION_STATUS: + { + return { + ValueType::valueType_uint8, // count + ValueType::valueType_Vector // status info + }; + } + case MipTypes::CMD_ODOMETER_SETTINGS: + { + return { + ValueType::valueType_uint8, // mode + ValueType::valueType_float, // scaling + ValueType::valueType_float // uncertainty + }; + } + case MipTypes::CMD_SENSOR_RANGE: + { + return { + ValueType::valueType_uint8, // sensor + ValueType::valueType_uint8 // range + }; + } + case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_Vector + }; + } + case MipTypes::CMD_LOWPASS_ANTIALIASING_FILTER: + { + return { + ValueType::valueType_uint16, + ValueType::valueType_bool, + ValueType::valueType_bool, + ValueType::valueType_float, + }; + } + case MipTypes::CMD_GPIO_CONFIGURATION: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_int8, + ValueType::valueType_int8, + ValueType::valueType_int8 + }; + } + case MipTypes::CMD_GPIO_STATE: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_bool + }; + } + // 0x0D - case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: - case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: + case MipTypes::CMD_EF_AIDING_MEASUREMENT_ENABLE: + { + return { + ValueType::valueType_uint16, + ValueType::valueType_bool + }; + } + case MipTypes::CMD_EF_ADAPTIVE_FILTER_OPTIONS: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint16 + }; + } + case MipTypes::CMD_EF_MULTI_ANTENNA_OFFSET: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float + }; + } + case MipTypes::CMD_EF_RELATIVE_POSITION_REF: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_double, + ValueType::valueType_double, + ValueType::valueType_double + }; + } + case MipTypes::CMD_EF_LEVER_ARM_OFFSET_REF: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, + }; + } + case MipTypes::CMD_EF_SPEED_MEASUREMENT_OFFSET: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, + }; + } + + case MipTypes::CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL: + { + return { + ValueType::valueType_bool, + ValueType::valueType_float + }; + } + // 0x0E - case MipTypes::CMD_GNSS_RTK_CONFIG: - return{ - ValueType::valueType_bool - }; + case MipTypes::CMD_GNSS_RECEIVER_INFO: + { + return { + ValueType::valueType_uint8, // num receivers + ValueType::valueType_Vector // receiver info + }; + } + case MipTypes::CMD_GNSS_SIGNAL_CONFIG: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_uint8 + }; + } + case MipTypes::CMD_GNSS_SPARTN_CONFIG: + { + return { + ValueType::valueType_uint8, // enable + ValueType::valueType_uint8, // type + ValueType::valueType_uint32, // current key TOW + ValueType::valueType_uint16, // current key week + ValueType::valueType_string, // ascii description of current key in HEX + ValueType::valueType_uint32, // next key TOW + ValueType::valueType_uint16, // next key week + ValueType::valueType_string // ascii description of next key in HEX + }; + } + // 0x13 + case MipTypes::CMD_AIDING_FRAME_CONFIG: + { + return { + ValueType::valueType_uint8, // frame id + ValueType::valueType_uint8, // format + ValueType::valueType_bool, // error tracking enabled + ValueType::valueType_float, // translation + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_Vector, // rotation (ve3 for euler, vec4 for quat) + }; + } + case MipTypes::CMD_AIDING_ECHO_CONTROL: + { + return { + ValueType::valueType_uint8 + }; + } + // case MipTypes::CMD_AIDING_POS_LOCAL: + // { + // return {}; + // } + case MipTypes::CMD_AIDING_POS_ECEF: + case MipTypes::CMD_AIDING_POS_LLH: + { + return { + ValueType::valueType_uint8, // timebase + ValueType::valueType_uint8, // reserved + ValueType::valueType_uint64, // nanoseconds since timebase epoch + + ValueType::valueType_uint8, // frame id + + ValueType::valueType_double, // pos + ValueType::valueType_double, + ValueType::valueType_double, + ValueType::valueType_float, // unc + ValueType::valueType_float, + ValueType::valueType_float, + + ValueType::valueType_uint16, // valid flags + }; + } + case MipTypes::CMD_AIDING_HEIGHT_ABOVE_ELLIPSOID: + { + return { + ValueType::valueType_uint8, // timebase + ValueType::valueType_uint8, // reserved + ValueType::valueType_uint64, // nanoseconds since timebase epoch - // Euler Angles (float[3]) - // 0x0C - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: - return{ - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float - }; + ValueType::valueType_uint8, // frame id + ValueType::valueType_float, // height + ValueType::valueType_float, // unc - // 3x3 Matrix - // 0x0C - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: - // 0x0D - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: - return { - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, + ValueType::valueType_uint16, // valid flags + }; + } + // case MipTypes::CMD_AIDING_HEIGHT_REL: + // { + // return {}; + // } + case MipTypes::CMD_AIDING_VEL_ECEF: + case MipTypes::CMD_AIDING_VEL_NED: + case MipTypes::CMD_AIDING_VEL_BODY_FRAME: + { + return { + ValueType::valueType_uint8, // timebase + ValueType::valueType_uint8, // reserved + ValueType::valueType_uint64, // nanoseconds since timebase epoch + + ValueType::valueType_uint8, // frame id + + ValueType::valueType_float, // vel + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, // unc + ValueType::valueType_float, + ValueType::valueType_float, + + ValueType::valueType_uint16, // valid flags + }; + } + // case MipTypes::CMD_AIDING_WHEELSPEED: + // { + // return {}; + // } + case MipTypes::CMD_AIDING_HEADING_TRUE: + { + return { + ValueType::valueType_uint8, // timebase + ValueType::valueType_uint8, // reserved + ValueType::valueType_uint64, // nanoseconds since timebase epoch + + ValueType::valueType_uint8, // frame id - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, + ValueType::valueType_float, // heading + ValueType::valueType_float, // unc - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float - }; + ValueType::valueType_uint16, // valid flags + }; + } + case MipTypes::CMD_AIDING_MAGNETIC_FIELD: + { + return { + ValueType::valueType_uint8, // timebase + ValueType::valueType_uint8, // reserved + ValueType::valueType_uint64, // nanoseconds since timebase epoch + + ValueType::valueType_uint8, // frame id + + ValueType::valueType_float, // mag field + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, // unc + ValueType::valueType_float, + ValueType::valueType_float, + + ValueType::valueType_uint16, // valid flags + }; + } + case MipTypes::CMD_AIDING_PRESSURE: + { + return { + ValueType::valueType_uint8, // timebase + ValueType::valueType_uint8, // reserved + ValueType::valueType_uint64, // nanoseconds since timebase epoch + ValueType::valueType_uint8, // frame id - // Quaternion - // 0x0C - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: - // 0x0D - case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: - return{ - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float, - ValueType::valueType_float - }; - - default: - // no defined format, read out vector of uint8 - return{ ValueType::valueType_Vector }; + ValueType::valueType_float, // pressure + ValueType::valueType_float, // unc + + ValueType::valueType_uint16, // valid flags + }; + } + // case MipTypes::CMD_AIDING_DELTA_POSITION: + // { + // return {}; + // } + // case MipTypes::CMD_AIDING_DELTA_ATTITUDE: + // { + // return {}; + // } + // case MipTypes::CMD_AIDING_ANGULAR_RATE_LOCAL: + // { + // return {}; + // } + case MipTypes::CMD_EF_VERTICAL_GYRO_CONSTRAINT: + case MipTypes::CMD_EF_WHEELED_VEHICLE_CONSTRAINT: + case MipTypes::CMD_GNSS_RTK_CONFIG: + { + return { + ValueType::valueType_bool + }; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_EULER: + { + return { + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float + }; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_DCM: + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_DCM: + { + return { + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, + + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, + + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float + }; + } + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_TRANSFORM_QUAT: + case MipTypes::CMD_EF_SENS_VEHIC_FRAME_ROTATION_QUAT: + { + return { + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float, + ValueType::valueType_float + }; + } + default: + { + // no defined format, read out vector of uint8 + return { + ValueType::valueType_Vector + }; + } } } @@ -784,59 +1015,71 @@ namespace mscl { switch (id) { - case MipTypes::CMD_NMEA_MESSAGE_FORMAT: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_uint8, - ValueType::valueType_uint16 - }; - - case MipTypes::CMD_MESSAGE_FORMAT: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint16 - }; - - case MipTypes::CMD_EVENT_SUPPORT: - return{ - ValueType::valueType_uint8, - ValueType::valueType_uint8 - }; - - case MipTypes::CMD_GNSS_RECEIVER_INFO: - return{ - ValueType::valueType_uint8, // receiver id - ValueType::valueType_uint8, // associated data set - ValueType::valueType_string // ascii description of receiver - }; - - case MipTypes::CMD_EVENT_TRIGGER_STATUS: - return{ - ValueType::valueType_uint8, // type - ValueType::valueType_uint8 // status - }; - - case MipTypes::CMD_EVENT_ACTION_STATUS: - return{ - ValueType::valueType_uint8, // type - ValueType::valueType_uint8 // status - }; - - case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: - return{ - ValueType::valueType_uint8, - ValueType::valueType_float - }; - - case MipTypes::CMD_AIDING_FRAME_CONFIG: - return{ - ValueType::valueType_float - }; - - default: - // no defined format, read out vector of uint8 - return{ ValueType::valueType_uint8 }; + case MipTypes::CMD_NMEA_MESSAGE_FORMAT: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_uint8, + ValueType::valueType_uint16 + }; + } + case MipTypes::CMD_MESSAGE_FORMAT: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint16 + }; + } + case MipTypes::CMD_EVENT_SUPPORT: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_uint8 + }; + } + case MipTypes::CMD_GNSS_RECEIVER_INFO: + { + return { + ValueType::valueType_uint8, // receiver id + ValueType::valueType_uint8, // associated data set + ValueType::valueType_string // ascii description of receiver + }; + } + case MipTypes::CMD_EVENT_TRIGGER_STATUS: + { + return { + ValueType::valueType_uint8, // type + ValueType::valueType_uint8 // status + }; + } + case MipTypes::CMD_EVENT_ACTION_STATUS: + { + return { + ValueType::valueType_uint8, // type + ValueType::valueType_uint8 // status + }; + } + case MipTypes::CMD_SUPPORTED_SENSOR_RANGES: + { + return { + ValueType::valueType_uint8, + ValueType::valueType_float + }; + } + case MipTypes::CMD_AIDING_FRAME_CONFIG: + { + return { + ValueType::valueType_float + }; + } + default: + { + // no defined format, read out vector of uint8 + return { + ValueType::valueType_uint8 + }; + } } } @@ -844,9 +1087,15 @@ namespace mscl { switch (id) { - case MipTypes::CMD_GNSS_RECEIVER_INFO: return 32; - - default: return -1; + case MipTypes::CMD_GNSS_RECEIVER_INFO: + case MipTypes::CMD_GNSS_SPARTN_CONFIG: + { + return 32; + } + default: + { + return -1; + } } } @@ -856,88 +1105,106 @@ namespace mscl { switch (type) { - case valueType_bool: - outData.push_back(Value::BOOL((buffer.read_uint8() > 0))); - break; - case valueType_uint8: - outData.push_back(Value::UINT8(buffer.read_uint8())); - break; - case valueType_uint16: - outData.push_back(Value::UINT16(buffer.read_uint16())); - break; - case valueType_uint32: - outData.push_back(Value::UINT32(buffer.read_uint32())); - break; - case valueType_uint64: - outData.push_back(Value::UINT64(buffer.read_uint64())); - break; - case valueType_int8: - outData.push_back(Value::INT8(buffer.read_int8())); - break; - case valueType_float: - outData.push_back(Value::FLOAT(buffer.read_float())); - break; - case valueType_double: - outData.push_back(Value::DOUBLE(buffer.read_double())); - break; - - case valueType_string: - { - size_t count = stringLength(id); - if (count <= 0) + case valueType_bool: { - // no count - read until end of buffer - count = buffer.size(); + outData.push_back(Value::BOOL((buffer.read_uint8() > 0))); + break; } - - std::string str; - for (size_t i = 0; i < count; i++) + case valueType_uint8: + { + outData.push_back(Value::UINT8(buffer.read_uint8())); + break; + } + case valueType_uint16: + { + outData.push_back(Value::UINT16(buffer.read_uint16())); + break; + } + case valueType_uint32: + { + outData.push_back(Value::UINT32(buffer.read_uint32())); + break; + } + case valueType_uint64: + { + outData.push_back(Value::UINT64(buffer.read_uint64())); + break; + } + case valueType_int8: { - str += static_cast(buffer.read_uint8()); + outData.push_back(Value::INT8(buffer.read_int8())); + break; } + case valueType_float: + { + outData.push_back(Value::FLOAT(buffer.read_float())); + break; + } + case valueType_double: + { + outData.push_back(Value::DOUBLE(buffer.read_double())); + break; + } + case valueType_string: + { + size_t count = stringLength(id); + if (count <= 0) + { + // no count - read until end of buffer + count = buffer.size(); + } - outData.push_back(Value(ValueType::valueType_string, str)); - } - break; + std::string str; + for (size_t i = 0; i < count; i++) + { + str += static_cast(buffer.read_uint8()); + } - case valueType_Vector: - { - MipFieldFormat vectorFormat = MipCommand::getResponseVectorPartFormat(id, vectorNestedLevel, vectorSequenceCount); - size_t count = 0; - bool hasCount = false; - if (outData.size() > 0) + outData.push_back(Value(ValueType::valueType_string, str)); + + break; + } + case valueType_Vector: { - // assume previous value is count if exists and is uint8 - Value last = outData.back(); - if (last.storedAs() == valueType_uint8) + MipFieldFormat vectorFormat = MipCommand::getResponseVectorPartFormat(id, vectorNestedLevel, vectorSequenceCount); + size_t count = 0; + bool hasCount = false; + if (outData.size() > 0) { - count = last.as_uint8(); - hasCount = true; + // assume previous value is count if exists and is uint8 + Value last = outData.back(); + if (last.storedAs() == valueType_uint8) + { + count = last.as_uint8(); + hasCount = true; + } } - } - if(count == 0 && !hasCount) - { - // no count - read element format until end of buffer - size_t elementSize = 0; - for (ValueType t : vectorFormat) + if (count == 0 && !hasCount) { - elementSize += Utils::valueTypeSize(t); + // no count - read element format until end of buffer + size_t elementSize = 0; + for (ValueType t : vectorFormat) + { + elementSize += Utils::valueTypeSize(t); + } + + size_t remainingBytes = buffer.size() - buffer.readPosition(); + count = remainingBytes / elementSize; } - size_t remainingBytes = buffer.size() - buffer.readPosition(); - count = remainingBytes / elementSize; - } + for (size_t i = 0; i < count; i++) + { + MipCommand::populateGenericResponseData(id, buffer, vectorFormat, outData); + } - for (size_t i = 0; i < count; i++) + break; + } + default: { - MipCommand::populateGenericResponseData(id, buffer, vectorFormat, outData); + break; } } - break; - default: - break; - } } } -} // namespace mscl +} // namespace mscl diff --git a/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.h b/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.h index 44151d5ea..f4641871f 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.h +++ b/MSCL/source/mscl/MicroStrain/MIP/Commands/MipCommand.h @@ -11,132 +11,134 @@ namespace mscl { - -class MipCommand -{ -public: - //Constructor: MipCommand - // Constructor to build MIP command based on Command ID and function selector - MipCommand(MipTypes::Command cmdId, MipTypes::FunctionSelector fn) : - m_commandId(cmdId), - m_functionSelector(fn), - m_responseExpected(fn == MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS) - {}; - - //Constructor: MipCommand - // Constructor to build MIP command based on Command ID and function selector with specified data - MipCommand(MipTypes::Command cmdId, MipTypes::FunctionSelector fn, MipFieldValues vals) : - m_commandId(cmdId), - m_functionSelector(fn), - m_data(vals), - m_responseExpected(fn == MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS) - {}; - - MipCommand(MipTypes::Command cmdId, bool resExpected = false) : - m_commandId(cmdId), - m_functionSelector(MipTypes::FunctionSelector(0)), - m_responseExpected(resExpected) - {}; - - MipCommand(MipTypes::Command cmdId, MipFieldValues vals, bool resExpected = false) : - m_commandId(cmdId), - m_functionSelector(MipTypes::FunctionSelector(0)), - m_data(vals), - m_responseExpected(resExpected) - {}; - - //Function: createResponse - // Converts this class to a ByteStream. - // - //Parameters: - // weak_ptr - // - //Returns: - // std::shared_ptr - the response to be filled in with data from the device. - virtual std::shared_ptr createResponse(std::weak_ptr collector); - - //Function: operator ByteStream - // Converts this class to a ByteStream. - virtual operator ByteStream() const; - - //Function: getGenericResponseData - // - //Parameter: - // response - The object from which to get formatted data. - // - //Returns: - // - A object with the values returned from the device. - MipFieldValues getGenericResponseData(const GenericMipCmdResponse& response); - - //Function: commandName - // - //Returns: - // std::string - the string name for this class. - virtual std::string commandName() const; - - //Function: supportedFunctionSelectors - // - //Returns: - // - list of function selectors supported for the given command. - static MipFunctionSelectors supportedFunctionSelectors(MipTypes::Command cmd); - - //Function: supportsFunctionSelector - // - //Returns: - // bool - indicates whether or not the function selector is supported by the specified command. - static bool supportsFunctionSelector(MipTypes::Command cmd, MipTypes::FunctionSelector fn); - -protected: - // Constructor - MipCommand() {}; - - //Function: commandType - // - //Returns: - // MipTypes::Command - the command ID. - virtual MipTypes::Command commandType() const { return m_commandId; }; - - //Function: fieldDataByte - // - //Returns: - // uint8 - the byte ID for field data in the reply. - virtual uint8 fieldDataByte() const; - - //Function: responseExpected - // - //Returns: - // bool - True indicates that a response should return from the device. - virtual bool responseExpected() const; - -private: - MipTypes::Command m_commandId; - - MipTypes::FunctionSelector m_functionSelector; - - MipFieldValues m_data; - - bool m_responseExpected; - - //Function: isKnownCommand - // checks whether the command name is defined to determine if this command is defined in MSCL - // - //Returns: - // bool - whether definition info for this command id is known - bool isKnownCommand() const; - - MipResponseMatchValues buildMatchData() const; - - static std::string getCommandName(MipTypes::Command id); - - static uint8 getFieldDataByte(MipTypes::Command id); - - static MipFieldFormat getResponseFieldFormat(MipTypes::Command id); - - static MipFieldFormat getResponseVectorPartFormat(MipTypes::Command id, uint8 nestedLevel = 0, uint8 sequenceCount = 0); - - static int stringLength(MipTypes::Command id); - - static void populateGenericResponseData(MipTypes::Command id, DataBuffer& buffer, const MipFieldFormat& format, MipFieldValues& outData, uint8 vectorNestedLevel = 0, uint8 vectorSequenceCount = 0); -}; - -} + class MipCommand + { + public: + //Constructor: MipCommand + // Constructor to build MIP command based on Command ID and function selector + MipCommand(MipTypes::Command cmdId, MipTypes::FunctionSelector fn) : + m_commandId(cmdId), + m_functionSelector(fn), + m_responseExpected(fn == MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS) + {} + + //Constructor: MipCommand + // Constructor to build MIP command based on Command ID and function selector with specified data + MipCommand(MipTypes::Command cmdId, MipTypes::FunctionSelector fn, MipFieldValues vals) : + m_commandId(cmdId), + m_functionSelector(fn), + m_data(vals), + m_responseExpected(fn == MipTypes::FunctionSelector::READ_BACK_CURRENT_SETTINGS) + {} + + MipCommand(MipTypes::Command cmdId, bool resExpected = false) : + m_commandId(cmdId), + m_functionSelector(MipTypes::FunctionSelector(0)), + m_responseExpected(resExpected) + {} + + MipCommand(MipTypes::Command cmdId, MipFieldValues vals, bool resExpected = false) : + m_commandId(cmdId), + m_functionSelector(MipTypes::FunctionSelector(0)), + m_data(vals), + m_responseExpected(resExpected) + {} + + //Function: createResponse + // Converts this class to a ByteStream. + // + //Parameters: + // weak_ptr + // + //Returns: + // std::shared_ptr - the response to be filled in with data from the device. + virtual std::shared_ptr createResponse(std::weak_ptr collector); + + //Function: operator ByteStream + // Converts this class to a ByteStream. + virtual operator ByteStream() const; + + //Function: getGenericResponseData + // + //Parameter: + // response - The object from which to get formatted data. + // + //Returns: + // - A object with the values returned from the device. + MipFieldValues getGenericResponseData(const GenericMipCmdResponse& response); + + //Function: commandName + // + //Returns: + // std::string - the string name for this class. + virtual std::string commandName() const; + + //Function: supportedFunctionSelectors + // + //Returns: + // - list of function selectors supported for the given command. + static MipFunctionSelectors supportedFunctionSelectors(MipTypes::Command cmd); + + //Function: supportsFunctionSelector + // + //Returns: + // bool - indicates whether the function selector is supported by the specified command. + static bool supportsFunctionSelector(MipTypes::Command cmd, MipTypes::FunctionSelector fn); + + protected: + // Constructor + MipCommand() {}; + + //Function: commandType + // + //Returns: + // MipTypes::Command - the command ID. + virtual MipTypes::Command commandType() const + { + return m_commandId; + } + + //Function: fieldDataByte + // + //Returns: + // uint8 - the byte ID for field data in the reply. + virtual uint8 fieldDataByte() const; + + //Function: responseExpected + // + //Returns: + // bool - True indicates that a response should return from the device. + virtual bool responseExpected() const; + + private: + MipTypes::Command m_commandId; + + MipTypes::FunctionSelector m_functionSelector; + + MipFieldValues m_data; + + bool m_responseExpected; + + //Function: isKnownCommand + // checks whether the command name is defined to determine if this command is defined in MSCL + // + //Returns: + // bool - whether definition info for this command id is known + bool isKnownCommand() const; + + MipResponseMatchValues buildMatchData() const; + + static std::string getCommandName(MipTypes::Command id); + + static uint8 getFieldDataByte(MipTypes::Command id); + + static MipFieldFormat getResponseFieldFormat(MipTypes::Command id); + + static MipFieldFormat getResponseVectorPartFormat(MipTypes::Command id, uint8 nestedLevel = 0, uint8 sequenceCount = 0); + + static int stringLength(MipTypes::Command id); + + static void populateGenericResponseData(MipTypes::Command id, DataBuffer& buffer, const MipFieldFormat& format, MipFieldValues& outData, + uint8 vectorNestedLevel = 0, uint8 vectorSequenceCount = 0); + }; +} // namespace mscl diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipBuiltInTest.cpp b/MSCL/source/mscl/MicroStrain/MIP/MipBuiltInTest.cpp index 383dcee9a..26fccc1bf 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipBuiltInTest.cpp +++ b/MSCL/source/mscl/MicroStrain/MIP/MipBuiltInTest.cpp @@ -20,6 +20,7 @@ namespace mscl case MipModels::node_3dm_cv7_ahrs: case MipModels::node_3dm_cv7_ar: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: { const CV7ContinuousBIT bit(data); return bit.as_MipDataPoints(); diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipModels.cpp b/MSCL/source/mscl/MicroStrain/MIP/MipModels.cpp index 2cb096728..b96de6b00 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipModels.cpp +++ b/MSCL/source/mscl/MicroStrain/MIP/MipModels.cpp @@ -126,44 +126,45 @@ namespace mscl return !MipModels::modelNumbersEqual(model1, model2.modelNumber()); } - const MipModel MipModel::mip_model_none("0000-0000"); // undefined placeholder - const MipModel MipModel::mip_model_3dm_dh3(MipModels::ModelNumber::model_3dm_dh3); // 3DM-DH3 - const MipModel MipModel::mip_model_3dm_gx3_15(MipModels::ModelNumber::model_3dm_gx3_15); // 3DM-GX3-15 - const MipModel MipModel::mip_model_3dm_gx3_25(MipModels::ModelNumber::model_3dm_gx3_25); // 3DM-GX3-25 - const MipModel MipModel::mip_model_3dm_gx3_35(MipModels::ModelNumber::model_3dm_gx3_35); // 3DM-GX3-35 - const MipModel MipModel::mip_model_3dm_gx3_45(MipModels::ModelNumber::model_3dm_gx3_45); // 3DM-GX3-45 - const MipModel MipModel::mip_model_3dm_rq1_45_lt(MipModels::ModelNumber::model_3dm_rq1_45_lt); // 3DM-RQ1-45-LT - const MipModel MipModel::mip_model_3dm_rq1_45_st(MipModels::ModelNumber::model_3dm_rq1_45_st); // 3DM-RQ1-45-ST - const MipModel MipModel::mip_model_3dm_gx4_15(MipModels::ModelNumber::model_3dm_gx4_15); // 3DM-GX4-15 - const MipModel MipModel::mip_model_3dm_gx4_25(MipModels::ModelNumber::model_3dm_gx4_25); // 3DM-GX4-25 - const MipModel MipModel::mip_model_3dm_gx4_45(MipModels::ModelNumber::model_3dm_gx4_45); // 3DM-GX4-45 - const MipModel MipModel::mip_model_mv5_ar(MipModels::ModelNumber::model_mv5_ar); // MV5-AR - const MipModel MipModel::mip_model_3dm_gx5_10(MipModels::ModelNumber::model_3dm_gx5_10); // 3DM-GX5-10 - const MipModel MipModel::mip_model_3dm_gx5_15(MipModels::ModelNumber::model_3dm_gx5_15); // 3DM-GX5-15 - const MipModel MipModel::mip_model_3dm_gx5_25(MipModels::ModelNumber::model_3dm_gx5_25); // 3DM-GX5-25 - const MipModel MipModel::mip_model_3dm_gx5_35(MipModels::ModelNumber::model_3dm_gx5_35); // 3DM-GX5-35 - const MipModel MipModel::mip_model_3dm_gx5_45(MipModels::ModelNumber::model_3dm_gx5_45); // 3DM-GX5-45 - const MipModel MipModel::mip_model_3dm_cv5_10(MipModels::ModelNumber::model_3dm_cv5_10); // 3DM-CV5-10 - const MipModel MipModel::mip_model_3dm_cv5_15(MipModels::ModelNumber::model_3dm_cv5_15); // 3DM-CV5-15 - const MipModel MipModel::mip_model_3dm_cv5_25(MipModels::ModelNumber::model_3dm_cv5_25); // 3DM-CV5-25 - const MipModel MipModel::mip_model_3dm_cv5_45(MipModels::ModelNumber::model_3dm_cv5_45); // 3DM-CV5-45 - const MipModel MipModel::mip_model_3dm_gq4_45(MipModels::ModelNumber::model_3dm_gq4_45); // 3DM-GQ4-45 - const MipModel MipModel::mip_model_3dm_cx5_45(MipModels::ModelNumber::model_3dm_cx5_45); // 3DM-CX5-45 - const MipModel MipModel::mip_model_3dm_cx5_35(MipModels::ModelNumber::model_3dm_cx5_35); // 3DM-CX5-35 - const MipModel MipModel::mip_model_3dm_cx5_25(MipModels::ModelNumber::model_3dm_cx5_25); // 3DM-CX5-25 - const MipModel MipModel::mip_model_3dm_cx5_15(MipModels::ModelNumber::model_3dm_cx5_15); // 3DM-CX5-15 - const MipModel MipModel::mip_model_3dm_cx5_10(MipModels::ModelNumber::model_3dm_cx5_10); // 3DM-CX5-10 - const MipModel MipModel::mip_model_3dm_cl5_15(MipModels::ModelNumber::model_3dm_cl5_15); // 3DM-CL5-15 - const MipModel MipModel::mip_model_3dm_cl5_25(MipModels::ModelNumber::model_3dm_cl5_25); // 3DM-CL5-25 - const MipModel MipModel::mip_model_3dm_gq7(MipModels::ModelNumber::model_3dm_gq7); // 3DM-GQ7 - const MipModel MipModel::mip_model_3dm_rtk_v1(MipModels::ModelNumber::model_3dm_rtk_v1); // 3DM-RTK v1 - const MipModel MipModel::mip_model_3dm_rtk(MipModels::ModelNumber::model_3dm_rtk); // 3DM-RTK - const MipModel MipModel::mip_model_3dm_cv7_ahrs(MipModels::ModelNumber::model_3dm_cv7_ahrs); // 3DM-CV7-AHRS - const MipModel MipModel::mip_model_3dm_cv7_ar(MipModels::ModelNumber::model_3dm_cv7_ar); // 3DM-CV7-AR - const MipModel MipModel::mip_model_3dm_gv7_ahrs(MipModels::ModelNumber::model_3dm_gv7_ahrs); // 3DM-GV7-AHRS - const MipModel MipModel::mip_model_3dm_gv7_ar(MipModels::ModelNumber::model_3dm_gv7_ar); // 3DM-GV7-AR - const MipModel MipModel::mip_model_3dm_gv7_ins(MipModels::ModelNumber::model_3dm_gv7_ins); // 3DM-GV7-INS - const MipModel MipModel::mip_model_3dm_cv7_ins(MipModels::ModelNumber::model_3dm_cv7_ins); // 3DM-CV7-INS + const MipModel MipModel::mip_model_none("0000-0000"); // undefined placeholder + const MipModel MipModel::mip_model_3dm_dh3(MipModels::ModelNumber::model_3dm_dh3); // 3DM-DH3 + const MipModel MipModel::mip_model_3dm_gx3_15(MipModels::ModelNumber::model_3dm_gx3_15); // 3DM-GX3-15 + const MipModel MipModel::mip_model_3dm_gx3_25(MipModels::ModelNumber::model_3dm_gx3_25); // 3DM-GX3-25 + const MipModel MipModel::mip_model_3dm_gx3_35(MipModels::ModelNumber::model_3dm_gx3_35); // 3DM-GX3-35 + const MipModel MipModel::mip_model_3dm_gx3_45(MipModels::ModelNumber::model_3dm_gx3_45); // 3DM-GX3-45 + const MipModel MipModel::mip_model_3dm_rq1_45_lt(MipModels::ModelNumber::model_3dm_rq1_45_lt); // 3DM-RQ1-45-LT + const MipModel MipModel::mip_model_3dm_rq1_45_st(MipModels::ModelNumber::model_3dm_rq1_45_st); // 3DM-RQ1-45-ST + const MipModel MipModel::mip_model_3dm_gx4_15(MipModels::ModelNumber::model_3dm_gx4_15); // 3DM-GX4-15 + const MipModel MipModel::mip_model_3dm_gx4_25(MipModels::ModelNumber::model_3dm_gx4_25); // 3DM-GX4-25 + const MipModel MipModel::mip_model_3dm_gx4_45(MipModels::ModelNumber::model_3dm_gx4_45); // 3DM-GX4-45 + const MipModel MipModel::mip_model_mv5_ar(MipModels::ModelNumber::model_mv5_ar); // MV5-AR + const MipModel MipModel::mip_model_3dm_gx5_10(MipModels::ModelNumber::model_3dm_gx5_10); // 3DM-GX5-10 + const MipModel MipModel::mip_model_3dm_gx5_15(MipModels::ModelNumber::model_3dm_gx5_15); // 3DM-GX5-15 + const MipModel MipModel::mip_model_3dm_gx5_25(MipModels::ModelNumber::model_3dm_gx5_25); // 3DM-GX5-25 + const MipModel MipModel::mip_model_3dm_gx5_35(MipModels::ModelNumber::model_3dm_gx5_35); // 3DM-GX5-35 + const MipModel MipModel::mip_model_3dm_gx5_45(MipModels::ModelNumber::model_3dm_gx5_45); // 3DM-GX5-45 + const MipModel MipModel::mip_model_3dm_cv5_10(MipModels::ModelNumber::model_3dm_cv5_10); // 3DM-CV5-10 + const MipModel MipModel::mip_model_3dm_cv5_15(MipModels::ModelNumber::model_3dm_cv5_15); // 3DM-CV5-15 + const MipModel MipModel::mip_model_3dm_cv5_25(MipModels::ModelNumber::model_3dm_cv5_25); // 3DM-CV5-25 + const MipModel MipModel::mip_model_3dm_cv5_45(MipModels::ModelNumber::model_3dm_cv5_45); // 3DM-CV5-45 + const MipModel MipModel::mip_model_3dm_gq4_45(MipModels::ModelNumber::model_3dm_gq4_45); // 3DM-GQ4-45 + const MipModel MipModel::mip_model_3dm_cx5_45(MipModels::ModelNumber::model_3dm_cx5_45); // 3DM-CX5-45 + const MipModel MipModel::mip_model_3dm_cx5_35(MipModels::ModelNumber::model_3dm_cx5_35); // 3DM-CX5-35 + const MipModel MipModel::mip_model_3dm_cx5_25(MipModels::ModelNumber::model_3dm_cx5_25); // 3DM-CX5-25 + const MipModel MipModel::mip_model_3dm_cx5_15(MipModels::ModelNumber::model_3dm_cx5_15); // 3DM-CX5-15 + const MipModel MipModel::mip_model_3dm_cx5_10(MipModels::ModelNumber::model_3dm_cx5_10); // 3DM-CX5-10 + const MipModel MipModel::mip_model_3dm_cl5_15(MipModels::ModelNumber::model_3dm_cl5_15); // 3DM-CL5-15 + const MipModel MipModel::mip_model_3dm_cl5_25(MipModels::ModelNumber::model_3dm_cl5_25); // 3DM-CL5-25 + const MipModel MipModel::mip_model_3dm_gq7(MipModels::ModelNumber::model_3dm_gq7); // 3DM-GQ7 + const MipModel MipModel::mip_model_3dm_rtk_v1(MipModels::ModelNumber::model_3dm_rtk_v1); // 3DM-RTK v1 + const MipModel MipModel::mip_model_3dm_rtk(MipModels::ModelNumber::model_3dm_rtk); // 3DM-RTK + const MipModel MipModel::mip_model_3dm_cv7_ahrs(MipModels::ModelNumber::model_3dm_cv7_ahrs); // 3DM-CV7-AHRS + const MipModel MipModel::mip_model_3dm_cv7_ar(MipModels::ModelNumber::model_3dm_cv7_ar); // 3DM-CV7-AR + const MipModel MipModel::mip_model_3dm_gv7_ahrs(MipModels::ModelNumber::model_3dm_gv7_ahrs); // 3DM-GV7-AHRS + const MipModel MipModel::mip_model_3dm_gv7_ar(MipModels::ModelNumber::model_3dm_gv7_ar); // 3DM-GV7-AR + const MipModel MipModel::mip_model_3dm_gv7_ins(MipModels::ModelNumber::model_3dm_gv7_ins); // 3DM-GV7-INS + const MipModel MipModel::mip_model_3dm_cv7_ins(MipModels::ModelNumber::model_3dm_cv7_ins); // 3DM-CV7-INS + const MipModel MipModel::mip_model_3dm_cv7_gnss_ins(MipModels::ModelNumber::model_3dm_cv7_gnss_ins); // 3DM-CV7-GNSS/INS MipModel::MipModel() : m_modelStr(""), diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipModels.h b/MSCL/source/mscl/MicroStrain/MIP/MipModels.h index 0d7c1e09a..95b39e32b 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipModels.h +++ b/MSCL/source/mscl/MicroStrain/MIP/MipModels.h @@ -22,81 +22,83 @@ namespace mscl // The base model numbers for each of the MIP devices. // Ex: 6284-4220 (3DM-GQ7) NodeModel is 6284 // - // node_3dm_dh3 - 6219 - 3DM-DH3 - // node_3dm_gx3_15 - 6227 - 3DM-GX3-15 - // node_3dm_gx3_25 - 6223 - 3DM-GX3-25 - // node_3dm_gx3_35 - 6225 - 3DM-GX3-35 - // node_3dm_gx3_45 - 6228 - 3DM-GX3-45 - // node_3dm_rq1_45_lt - 6232 - 3DM-RQ1-45-LT - // node_3dm_gx4_15 - 6233 - 3DM-GX4-15 - // node_3dm_gx4_25 - 6234 - 3DM-GX4-25 - // node_3dm_gx4_45 - 6236 - 3DM-GX4-45 - // node_3dm_rq1_45_st - 6239 - 3DM-RQ1-45-ST - // node_mv5_ar - 6243 - MV5-AR - // node_3dm_gx5_10 - 6255 - 3DM-GX5-10 - // node_3dm_gx5_15 - 6254 - 3DM-GX5-15 - // node_3dm_gx5_25 - 6253 - 3DM-GX5-25 - // node_3dm_gx5_35 - 6252 - 3DM-GX5-35 - // node_3dm_gx5_45 - 6251 - 3DM-GX5-45 - // node_3dm_cv5_10 - 6259 - 3DM-CV5-10 - // node_3dm_cv5_15 - 6258 - 3DM-CV5-15 - // node_3dm_cv5_25 - 6257 - 3DM-CV5-25 - // node_3dm_cv5_45 - 6256 - 3DM-CV5-45 - // node_3dm_gq4_45 - 6250 - 3DM-GQ4-45 - // node_3dm_cx5_45 - 6271 - 3DM-CX5-45 - // node_3dm_cx5_35 - 6272 - 3DM-CX5-35 - // node_3dm_cx5_25 - 6273 - 3DM-CX5-25 - // node_3dm_cx5_15 - 6274 - 3DM-CX5-15 - // node_3dm_cx5_10 - 6275 - 3DM-CX5-10 - // node_3dm_cl5_15 - 6280 - 3DM-CL5-15 - // node_3dm_cl5_25 - 6281 - 3DM-CL5-25 - // node_3dm_gq7 - 6284 - 3DM-GQ7 - // node_3dm_rtk - 6285 - 3DM-RTK - // node_3dm_cv7_ahrs - 6286 - 3DM-CV7-AHRS - // node_3dm_cv7_ar - 6287 - 3DM-CV7-AR - // node_3dm_gv7_ahrs - 6288 - 3DM-GV7-AHRS - // node_3dm_gv7_ar - 6289 - 3DM-GV7-AR - // node_3dm_gv7_ins - 6290 - 3DM-GV7-INS - // node_3dm_cv7_ins - 6291 - 3DM-CV7-INS + // node_3dm_dh3 - 6219 - 3DM-DH3 + // node_3dm_gx3_15 - 6227 - 3DM-GX3-15 + // node_3dm_gx3_25 - 6223 - 3DM-GX3-25 + // node_3dm_gx3_35 - 6225 - 3DM-GX3-35 + // node_3dm_gx3_45 - 6228 - 3DM-GX3-45 + // node_3dm_rq1_45_lt - 6232 - 3DM-RQ1-45-LT + // node_3dm_gx4_15 - 6233 - 3DM-GX4-15 + // node_3dm_gx4_25 - 6234 - 3DM-GX4-25 + // node_3dm_gx4_45 - 6236 - 3DM-GX4-45 + // node_3dm_rq1_45_st - 6239 - 3DM-RQ1-45-ST + // node_mv5_ar - 6243 - MV5-AR + // node_3dm_gx5_10 - 6255 - 3DM-GX5-10 + // node_3dm_gx5_15 - 6254 - 3DM-GX5-15 + // node_3dm_gx5_25 - 6253 - 3DM-GX5-25 + // node_3dm_gx5_35 - 6252 - 3DM-GX5-35 + // node_3dm_gx5_45 - 6251 - 3DM-GX5-45 + // node_3dm_cv5_10 - 6259 - 3DM-CV5-10 + // node_3dm_cv5_15 - 6258 - 3DM-CV5-15 + // node_3dm_cv5_25 - 6257 - 3DM-CV5-25 + // node_3dm_cv5_45 - 6256 - 3DM-CV5-45 + // node_3dm_gq4_45 - 6250 - 3DM-GQ4-45 + // node_3dm_cx5_45 - 6271 - 3DM-CX5-45 + // node_3dm_cx5_35 - 6272 - 3DM-CX5-35 + // node_3dm_cx5_25 - 6273 - 3DM-CX5-25 + // node_3dm_cx5_15 - 6274 - 3DM-CX5-15 + // node_3dm_cx5_10 - 6275 - 3DM-CX5-10 + // node_3dm_cl5_15 - 6280 - 3DM-CL5-15 + // node_3dm_cl5_25 - 6281 - 3DM-CL5-25 + // node_3dm_gq7 - 6284 - 3DM-GQ7 + // node_3dm_rtk - 6285 - 3DM-RTK + // node_3dm_cv7_ahrs - 6286 - 3DM-CV7-AHRS + // node_3dm_cv7_ar - 6287 - 3DM-CV7-AR + // node_3dm_gv7_ahrs - 6288 - 3DM-GV7-AHRS + // node_3dm_gv7_ar - 6289 - 3DM-GV7-AR + // node_3dm_gv7_ins - 6290 - 3DM-GV7-INS + // node_3dm_cv7_ins - 6291 - 3DM-CV7-INS + // node_3dm_cv7_gnss_ins - 6292 - 3DM-CV7-GNSS/INS //========================================================================= enum NodeModel { - node_3dm_dh3 = 6219, // 3DM-DH3 - node_3dm_gx3_15 = 6227, // 3DM-GX3-15 - node_3dm_gx3_25 = 6223, // 3DM-GX3-25 - node_3dm_gx3_35 = 6225, // 3DM-GX3-35 - node_3dm_gx3_45 = 6228, // 3DM-GX3-45 - node_3dm_rq1_45_lt = 6232, // 3DM-RQ1-45-LT - node_3dm_gx4_15 = 6233, // 3DM-GX4-15 - node_3dm_gx4_25 = 6234, // 3DM-GX4-25 - node_3dm_gx4_45 = 6236, // 3DM-GX4-45 - node_3dm_rq1_45_st = 6239, // 3DM-RQ1-45-ST - node_mv5_ar = 6243, // MV5-AR - node_3dm_gx5_10 = 6255, // 3DM-GX5-10 - node_3dm_gx5_15 = 6254, // 3DM-GX5-15 - node_3dm_gx5_25 = 6253, // 3DM-GX5-25 - node_3dm_gx5_35 = 6252, // 3DM-GX5-35 - node_3dm_gx5_45 = 6251, // 3DM-GX5-45 - node_3dm_cv5_10 = 6259, // 3DM-CV5-10 - node_3dm_cv5_15 = 6258, // 3DM-CV5-15 - node_3dm_cv5_25 = 6257, // 3DM-CV5-25 - node_3dm_cv5_45 = 6256, // 3DM-CV5-45 - node_3dm_gq4_45 = 6250, // 3DM-GQ4-45 - node_3dm_cx5_45 = 6271, // 3DM-CX5-45 - node_3dm_cx5_35 = 6272, // 3DM-CX5-35 - node_3dm_cx5_25 = 6273, // 3DM-CX5-25 - node_3dm_cx5_15 = 6274, // 3DM-CX5-15 - node_3dm_cx5_10 = 6275, // 3DM-CX5-10 - node_3dm_cl5_15 = 6280, // 3DM-CL5-15 - node_3dm_cl5_25 = 6281, // 3DM-CL5-25 - node_3dm_gq7 = 6284, // 3DM-GQ7 - node_3dm_rtk = 6285, // 3DM-RTK - node_3dm_cv7_ahrs = 6286, // 3DM-CV7-AHRS - node_3dm_cv7_ar = 6287, // 3DM-CV7-AR - node_3dm_gv7_ahrs = 6288, // 3DM-GV7-AHRS - node_3dm_gv7_ar = 6289, // 3DM-GV7-AR - node_3dm_gv7_ins = 6290, // 3DM-GV7-INS - node_3dm_cv7_ins = 6291 // 3DM-CV7-INS + node_3dm_dh3 = 6219, // 3DM-DH3 + node_3dm_gx3_15 = 6227, // 3DM-GX3-15 + node_3dm_gx3_25 = 6223, // 3DM-GX3-25 + node_3dm_gx3_35 = 6225, // 3DM-GX3-35 + node_3dm_gx3_45 = 6228, // 3DM-GX3-45 + node_3dm_rq1_45_lt = 6232, // 3DM-RQ1-45-LT + node_3dm_gx4_15 = 6233, // 3DM-GX4-15 + node_3dm_gx4_25 = 6234, // 3DM-GX4-25 + node_3dm_gx4_45 = 6236, // 3DM-GX4-45 + node_3dm_rq1_45_st = 6239, // 3DM-RQ1-45-ST + node_mv5_ar = 6243, // MV5-AR + node_3dm_gx5_10 = 6255, // 3DM-GX5-10 + node_3dm_gx5_15 = 6254, // 3DM-GX5-15 + node_3dm_gx5_25 = 6253, // 3DM-GX5-25 + node_3dm_gx5_35 = 6252, // 3DM-GX5-35 + node_3dm_gx5_45 = 6251, // 3DM-GX5-45 + node_3dm_cv5_10 = 6259, // 3DM-CV5-10 + node_3dm_cv5_15 = 6258, // 3DM-CV5-15 + node_3dm_cv5_25 = 6257, // 3DM-CV5-25 + node_3dm_cv5_45 = 6256, // 3DM-CV5-45 + node_3dm_gq4_45 = 6250, // 3DM-GQ4-45 + node_3dm_cx5_45 = 6271, // 3DM-CX5-45 + node_3dm_cx5_35 = 6272, // 3DM-CX5-35 + node_3dm_cx5_25 = 6273, // 3DM-CX5-25 + node_3dm_cx5_15 = 6274, // 3DM-CX5-15 + node_3dm_cx5_10 = 6275, // 3DM-CX5-10 + node_3dm_cl5_15 = 6280, // 3DM-CL5-15 + node_3dm_cl5_25 = 6281, // 3DM-CL5-25 + node_3dm_gq7 = 6284, // 3DM-GQ7 + node_3dm_rtk = 6285, // 3DM-RTK + node_3dm_cv7_ahrs = 6286, // 3DM-CV7-AHRS + node_3dm_cv7_ar = 6287, // 3DM-CV7-AR + node_3dm_gv7_ahrs = 6288, // 3DM-GV7-AHRS + node_3dm_gv7_ar = 6289, // 3DM-GV7-AR + node_3dm_gv7_ins = 6290, // 3DM-GV7-INS + node_3dm_cv7_ins = 6291, // 3DM-CV7-INS + node_3dm_cv7_gnss_ins = 6292, // 3DM-CV7-GNSS/INS }; //========================================================================= @@ -126,83 +128,85 @@ namespace mscl // Most models have 9999 placeholder modifier values because there is no significant interface difference between the different versions of the same base model. // This placeholder value will match to any modifier value read from the device when comparing objects. // - // model_3dm_dh3 - 62199999 - 3DM-DH3 - // model_3dm_gx3_15 - 62279999 - 3DM-GX3-15 - // model_3dm_gx3_25 - 62239999 - 3DM-GX3-25 - // model_3dm_gx3_35 - 62259999 - 3DM-GX3-35 - // model_3dm_gx3_45 - 62289999 - 3DM-GX3-45 - // model_3dm_rq1_45_lt - 62329999 - 3DM-RQ1-45-LT - // model_3dm_gx4_15 - 62339999 - 3DM-GX4-15 - // model_3dm_gx4_25 - 62349999 - 3DM-GX4-25 - // model_3dm_gx4_45 - 62369999 - 3DM-GX4-45 - // model_3dm_rq1_45_st - 62399999 - 3DM-RQ1-45-ST - // model_mv5_ar - 62439999 - MV5-AR - // model_3dm_gx5_10 - 62559999 - 3DM-GX5-10 - // model_3dm_gx5_15 - 62549999 - 3DM-GX5-15 - // model_3dm_gx5_25 - 62539999 - 3DM-GX5-25 - // model_3dm_gx5_35 - 62529999 - 3DM-GX5-35 - // model_3dm_gx5_45 - 62519999 - 3DM-GX5-45 - // model_3dm_cv5_10 - 62599999 - 3DM-CV5-10 - // model_3dm_cv5_15 - 62589999 - 3DM-CV5-15 - // model_3dm_cv5_25 - 62579999 - 3DM-CV5-25 - // model_3dm_cv5_45 - 62569999 - 3DM-CV5-45 - // model_3dm_gq4_45 - 62509999 - 3DM-GQ4-45 - // model_3dm_cx5_45 - 62719999 - 3DM-CX5-45 - // model_3dm_cx5_35 - 62729999 - 3DM-CX5-35 - // model_3dm_cx5_25 - 62739999 - 3DM-CX5-25 - // model_3dm_cx5_15 - 62749999 - 3DM-CX5-15 - // model_3dm_cx5_10 - 62759999 - 3DM-CX5-10 - // model_3dm_cl5_15 - 62809999 - 3DM-CL5-15 - // model_3dm_cl5_25 - 62819999 - 3DM-CL5-25 - // model_3dm_gq7 - 62849999 - 3DM-GQ7 - // model_3dm_rtk_v1 - 62850000 - 3DM-RTK v1 - // model_3dm_rtk - 62850100 - 3DM-RTK - // model_3dm_cv7_ahrs - 62869999 - 3DM-CV7-AHRS - // model_3dm_cv7_ar - 62879999 - 3DM-CV7-AR - // model_3dm_gv7_ahrs - 62889999 - 3DM-GV7-AHRS - // model_3dm_gv7_ar - 62899999 - 3DM-GV7-AR - // model_3dm_gv7_ins - 62909999 - 3DM-GV7-INS - // model_3dm_cv7_ins - 62919999 - 3DM-CV7-INS + // model_3dm_dh3 - 62199999 - 3DM-DH3 + // model_3dm_gx3_15 - 62279999 - 3DM-GX3-15 + // model_3dm_gx3_25 - 62239999 - 3DM-GX3-25 + // model_3dm_gx3_35 - 62259999 - 3DM-GX3-35 + // model_3dm_gx3_45 - 62289999 - 3DM-GX3-45 + // model_3dm_rq1_45_lt - 62329999 - 3DM-RQ1-45-LT + // model_3dm_gx4_15 - 62339999 - 3DM-GX4-15 + // model_3dm_gx4_25 - 62349999 - 3DM-GX4-25 + // model_3dm_gx4_45 - 62369999 - 3DM-GX4-45 + // model_3dm_rq1_45_st - 62399999 - 3DM-RQ1-45-ST + // model_mv5_ar - 62439999 - MV5-AR + // model_3dm_gx5_10 - 62559999 - 3DM-GX5-10 + // model_3dm_gx5_15 - 62549999 - 3DM-GX5-15 + // model_3dm_gx5_25 - 62539999 - 3DM-GX5-25 + // model_3dm_gx5_35 - 62529999 - 3DM-GX5-35 + // model_3dm_gx5_45 - 62519999 - 3DM-GX5-45 + // model_3dm_cv5_10 - 62599999 - 3DM-CV5-10 + // model_3dm_cv5_15 - 62589999 - 3DM-CV5-15 + // model_3dm_cv5_25 - 62579999 - 3DM-CV5-25 + // model_3dm_cv5_45 - 62569999 - 3DM-CV5-45 + // model_3dm_gq4_45 - 62509999 - 3DM-GQ4-45 + // model_3dm_cx5_45 - 62719999 - 3DM-CX5-45 + // model_3dm_cx5_35 - 62729999 - 3DM-CX5-35 + // model_3dm_cx5_25 - 62739999 - 3DM-CX5-25 + // model_3dm_cx5_15 - 62749999 - 3DM-CX5-15 + // model_3dm_cx5_10 - 62759999 - 3DM-CX5-10 + // model_3dm_cl5_15 - 62809999 - 3DM-CL5-15 + // model_3dm_cl5_25 - 62819999 - 3DM-CL5-25 + // model_3dm_gq7 - 62849999 - 3DM-GQ7 + // model_3dm_rtk_v1 - 62850000 - 3DM-RTK v1 + // model_3dm_rtk - 62850100 - 3DM-RTK + // model_3dm_cv7_ahrs - 62869999 - 3DM-CV7-AHRS + // model_3dm_cv7_ar - 62879999 - 3DM-CV7-AR + // model_3dm_gv7_ahrs - 62889999 - 3DM-GV7-AHRS + // model_3dm_gv7_ar - 62899999 - 3DM-GV7-AR + // model_3dm_gv7_ins - 62909999 - 3DM-GV7-INS + // model_3dm_cv7_ins - 62919999 - 3DM-CV7-INS + // model_3dm_cv7_gnss_ins - 62929999 - 3DM-CV7-GNSS/INS //========================================================================= enum ModelNumber { - model_3dm_dh3 = 62199999, // 3DM-DH3 - model_3dm_gx3_15 = 62279999, // 3DM-GX3-15 - model_3dm_gx3_25 = 62239999, // 3DM-GX3-25 - model_3dm_gx3_35 = 62259999, // 3DM-GX3-35 - model_3dm_gx3_45 = 62289999, // 3DM-GX3-45 - model_3dm_rq1_45_lt = 62329999, // 3DM-RQ1-45-LT - model_3dm_gx4_15 = 62339999, // 3DM-GX4-15 - model_3dm_gx4_25 = 62349999, // 3DM-GX4-25 - model_3dm_gx4_45 = 62369999, // 3DM-GX4-45 - model_3dm_rq1_45_st = 62399999, // 3DM-RQ1-45-ST - model_mv5_ar = 62439999, // MV5-AR - model_3dm_gx5_10 = 62559999, // 3DM-GX5-10 - model_3dm_gx5_15 = 62549999, // 3DM-GX5-15 - model_3dm_gx5_25 = 62539999, // 3DM-GX5-25 - model_3dm_gx5_35 = 62529999, // 3DM-GX5-35 - model_3dm_gx5_45 = 62519999, // 3DM-GX5-45 - model_3dm_cv5_10 = 62599999, // 3DM-CV5-10 - model_3dm_cv5_15 = 62589999, // 3DM-CV5-15 - model_3dm_cv5_25 = 62579999, // 3DM-CV5-25 - model_3dm_cv5_45 = 62569999, // 3DM-CV5-45 - model_3dm_gq4_45 = 62509999, // 3DM-GQ4-45 - model_3dm_cx5_45 = 62719999, // 3DM-CX5-45 - model_3dm_cx5_35 = 62729999, // 3DM-CX5-35 - model_3dm_cx5_25 = 62739999, // 3DM-CX5-25 - model_3dm_cx5_15 = 62749999, // 3DM-CX5-15 - model_3dm_cx5_10 = 62759999, // 3DM-CX5-10 - model_3dm_cl5_15 = 62809999, // 3DM-CL5-15 - model_3dm_cl5_25 = 62819999, // 3DM-CL5-25 - model_3dm_gq7 = 62849999, // 3DM-GQ7 - model_3dm_rtk_v1 = 62850000, // 3DM-RTK v1 - model_3dm_rtk = 62850100, // 3DM-RTK - model_3dm_cv7_ahrs = 62869999, // 3DM-CV7-AHRS - model_3dm_cv7_ar = 62879999, // 3DM-CV7-AR - model_3dm_gv7_ahrs = 62889999, // 3DM-GV7-AHRS - model_3dm_gv7_ar = 62899999, // 3DM-GV7-AR - model_3dm_gv7_ins = 62909999, // 3DM-GV7-INS - model_3dm_cv7_ins = 62919999 // 3DM-CV7-INS + model_3dm_dh3 = 62199999, // 3DM-DH3 + model_3dm_gx3_15 = 62279999, // 3DM-GX3-15 + model_3dm_gx3_25 = 62239999, // 3DM-GX3-25 + model_3dm_gx3_35 = 62259999, // 3DM-GX3-35 + model_3dm_gx3_45 = 62289999, // 3DM-GX3-45 + model_3dm_rq1_45_lt = 62329999, // 3DM-RQ1-45-LT + model_3dm_gx4_15 = 62339999, // 3DM-GX4-15 + model_3dm_gx4_25 = 62349999, // 3DM-GX4-25 + model_3dm_gx4_45 = 62369999, // 3DM-GX4-45 + model_3dm_rq1_45_st = 62399999, // 3DM-RQ1-45-ST + model_mv5_ar = 62439999, // MV5-AR + model_3dm_gx5_10 = 62559999, // 3DM-GX5-10 + model_3dm_gx5_15 = 62549999, // 3DM-GX5-15 + model_3dm_gx5_25 = 62539999, // 3DM-GX5-25 + model_3dm_gx5_35 = 62529999, // 3DM-GX5-35 + model_3dm_gx5_45 = 62519999, // 3DM-GX5-45 + model_3dm_cv5_10 = 62599999, // 3DM-CV5-10 + model_3dm_cv5_15 = 62589999, // 3DM-CV5-15 + model_3dm_cv5_25 = 62579999, // 3DM-CV5-25 + model_3dm_cv5_45 = 62569999, // 3DM-CV5-45 + model_3dm_gq4_45 = 62509999, // 3DM-GQ4-45 + model_3dm_cx5_45 = 62719999, // 3DM-CX5-45 + model_3dm_cx5_35 = 62729999, // 3DM-CX5-35 + model_3dm_cx5_25 = 62739999, // 3DM-CX5-25 + model_3dm_cx5_15 = 62749999, // 3DM-CX5-15 + model_3dm_cx5_10 = 62759999, // 3DM-CX5-10 + model_3dm_cl5_15 = 62809999, // 3DM-CL5-15 + model_3dm_cl5_25 = 62819999, // 3DM-CL5-25 + model_3dm_gq7 = 62849999, // 3DM-GQ7 + model_3dm_rtk_v1 = 62850000, // 3DM-RTK v1 + model_3dm_rtk = 62850100, // 3DM-RTK + model_3dm_cv7_ahrs = 62869999, // 3DM-CV7-AHRS + model_3dm_cv7_ar = 62879999, // 3DM-CV7-AR + model_3dm_gv7_ahrs = 62889999, // 3DM-GV7-AHRS + model_3dm_gv7_ar = 62899999, // 3DM-GV7-AR + model_3dm_gv7_ins = 62909999, // 3DM-GV7-INS + model_3dm_cv7_ins = 62919999, // 3DM-CV7-INS + model_3dm_cv7_gnss_ins = 62929999, // 3DM-CV7-GNSS/INS }; //API Function: modelNumberEqual @@ -309,83 +313,85 @@ namespace mscl // Most models have 9999 placeholder modifier values because there is no significant interface difference between the different versions of the same base model. // This placeholder value will match to any modifier value read from the device when comparing objects. // - // mip_model_none - 00000000 - undefined placeholder - // mip_model_3dm_dh3 - 62199999 - 3DM-DH3 - // mip_model_3dm_gx3_15 - 62279999 - 3DM-GX3-15 - // mip_model_3dm_gx3_25 - 62239999 - 3DM-GX3-25 - // mip_model_3dm_gx3_35 - 62259999 - 3DM-GX3-35 - // mip_model_3dm_gx3_45 - 62289999 - 3DM-GX3-45 - // mip_model_3dm_rq1_45_lt - 62329999 - 3DM-RQ1-45-LT - // mip_model_3dm_gx4_15 - 62339999 - 3DM-GX4-15 - // mip_model_3dm_gx4_25 - 62349999 - 3DM-GX4-25 - // mip_model_3dm_gx4_45 - 62369999 - 3DM-GX4-45 - // mip_model_3dm_rq1_45_st - 62399999 - 3DM-RQ1-45-ST - // mip_model_mv5_ar - 62439999 - MV5-AR - // mip_model_3dm_gx5_10 - 62559999 - 3DM-GX5-10 - // mip_model_3dm_gx5_15 - 62549999 - 3DM-GX5-15 - // mip_model_3dm_gx5_25 - 62539999 - 3DM-GX5-25 - // mip_model_3dm_gx5_35 - 62529999 - 3DM-GX5-35 - // mip_model_3dm_gx5_45 - 62519999 - 3DM-GX5-45 - // mip_model_3dm_cv5_10 - 62599999 - 3DM-CV5-10 - // mip_model_3dm_cv5_15 - 62589999 - 3DM-CV5-15 - // mip_model_3dm_cv5_25 - 62579999 - 3DM-CV5-25 - // mip_model_3dm_cv5_45 - 62569999 - 3DM-CV5-45 - // mip_model_3dm_gq4_45 - 62509999 - 3DM-GQ4-45 - // mip_model_3dm_cx5_45 - 62719999 - 3DM-CX5-45 - // mip_model_3dm_cx5_35 - 62729999 - 3DM-CX5-35 - // mip_model_3dm_cx5_25 - 62739999 - 3DM-CX5-25 - // mip_model_3dm_cx5_15 - 62749999 - 3DM-CX5-15 - // mip_model_3dm_cx5_10 - 62759999 - 3DM-CX5-10 - // mip_model_3dm_cl5_15 - 62809999 - 3DM-CL5-15 - // mip_model_3dm_cl5_25 - 62819999 - 3DM-CL5-25 - // mip_model_3dm_gq7 - 62849999 - 3DM-GQ7 - // mip_model_3dm_rtk_v1 - 62850000 - 3DM-RTK v1 - // mip_model_3dm_rtk - 62850100 - 3DM-RTK - // mip_model_3dm_cv7_ahrs - 62869999 - 3DM-CV7-AHRS - // mip_model_3dm_cv7_ar - 62879999 - 3DM-CV7-AR - // mip_model_3dm_gv7_ahrs - 62889999 - 3DM-GV7-AHRS - // mip_model_3dm_gv7_ar - 62899999 - 3DM-GV7-AR - // mip_model_3dm_Gv7_ins - 62909999 - 3DM-GV7-INS - // mip_model_3dm_cv7_ins - 62919999 - 3DM-CV7-INS + // mip_model_none - 00000000 - undefined placeholder + // mip_model_3dm_dh3 - 62199999 - 3DM-DH3 + // mip_model_3dm_gx3_15 - 62279999 - 3DM-GX3-15 + // mip_model_3dm_gx3_25 - 62239999 - 3DM-GX3-25 + // mip_model_3dm_gx3_35 - 62259999 - 3DM-GX3-35 + // mip_model_3dm_gx3_45 - 62289999 - 3DM-GX3-45 + // mip_model_3dm_rq1_45_lt - 62329999 - 3DM-RQ1-45-LT + // mip_model_3dm_gx4_15 - 62339999 - 3DM-GX4-15 + // mip_model_3dm_gx4_25 - 62349999 - 3DM-GX4-25 + // mip_model_3dm_gx4_45 - 62369999 - 3DM-GX4-45 + // mip_model_3dm_rq1_45_st - 62399999 - 3DM-RQ1-45-ST + // mip_model_mv5_ar - 62439999 - MV5-AR + // mip_model_3dm_gx5_10 - 62559999 - 3DM-GX5-10 + // mip_model_3dm_gx5_15 - 62549999 - 3DM-GX5-15 + // mip_model_3dm_gx5_25 - 62539999 - 3DM-GX5-25 + // mip_model_3dm_gx5_35 - 62529999 - 3DM-GX5-35 + // mip_model_3dm_gx5_45 - 62519999 - 3DM-GX5-45 + // mip_model_3dm_cv5_10 - 62599999 - 3DM-CV5-10 + // mip_model_3dm_cv5_15 - 62589999 - 3DM-CV5-15 + // mip_model_3dm_cv5_25 - 62579999 - 3DM-CV5-25 + // mip_model_3dm_cv5_45 - 62569999 - 3DM-CV5-45 + // mip_model_3dm_gq4_45 - 62509999 - 3DM-GQ4-45 + // mip_model_3dm_cx5_45 - 62719999 - 3DM-CX5-45 + // mip_model_3dm_cx5_35 - 62729999 - 3DM-CX5-35 + // mip_model_3dm_cx5_25 - 62739999 - 3DM-CX5-25 + // mip_model_3dm_cx5_15 - 62749999 - 3DM-CX5-15 + // mip_model_3dm_cx5_10 - 62759999 - 3DM-CX5-10 + // mip_model_3dm_cl5_15 - 62809999 - 3DM-CL5-15 + // mip_model_3dm_cl5_25 - 62819999 - 3DM-CL5-25 + // mip_model_3dm_gq7 - 62849999 - 3DM-GQ7 + // mip_model_3dm_rtk_v1 - 62850000 - 3DM-RTK v1 + // mip_model_3dm_rtk - 62850100 - 3DM-RTK + // mip_model_3dm_cv7_ahrs - 62869999 - 3DM-CV7-AHRS + // mip_model_3dm_cv7_ar - 62879999 - 3DM-CV7-AR + // mip_model_3dm_gv7_ahrs - 62889999 - 3DM-GV7-AHRS + // mip_model_3dm_gv7_ar - 62899999 - 3DM-GV7-AR + // mip_model_3dm_gv7_ins - 62909999 - 3DM-GV7-INS + // mip_model_3dm_cv7_ins - 62919999 - 3DM-CV7-INS + // mip_model_3dm_cv7_gnss_ins - 62929999 - 3DM-CV7-GNSS/INS //========================================================================= - static const MipModel mip_model_none; // undefined - static const MipModel mip_model_3dm_dh3; // 3DM-DH3 - static const MipModel mip_model_3dm_gx3_15; // 3DM-GX3-15 - static const MipModel mip_model_3dm_gx3_25; // 3DM-GX3-25 - static const MipModel mip_model_3dm_gx3_35; // 3DM-GX3-35 - static const MipModel mip_model_3dm_gx3_45; // 3DM-GX3-45 - static const MipModel mip_model_3dm_rq1_45_lt; // 3DM-RQ1-45-LT - static const MipModel mip_model_3dm_rq1_45_st; // 3DM-RQ1-45-ST - static const MipModel mip_model_3dm_gx4_15; // 3DM-GX4-15 - static const MipModel mip_model_3dm_gx4_25; // 3DM-GX4-25 - static const MipModel mip_model_3dm_gx4_45; // 3DM-GX4-45 - static const MipModel mip_model_mv5_ar; // MV5-AR - static const MipModel mip_model_3dm_gx5_10; // 3DM-GX5-10 - static const MipModel mip_model_3dm_gx5_15; // 3DM-GX5-15 - static const MipModel mip_model_3dm_gx5_25; // 3DM-GX5-25 - static const MipModel mip_model_3dm_gx5_35; // 3DM-GX5-35 - static const MipModel mip_model_3dm_gx5_45; // 3DM-GX5-45 - static const MipModel mip_model_3dm_cv5_10; // 3DM-CV5-10 - static const MipModel mip_model_3dm_cv5_15; // 3DM-CV5-15 - static const MipModel mip_model_3dm_cv5_25; // 3DM-CV5-25 - static const MipModel mip_model_3dm_cv5_45; // 3DM-CV5-45 - static const MipModel mip_model_3dm_gq4_45; // 3DM-GQ4-45 - static const MipModel mip_model_3dm_cx5_45; // 3DM-CX5-45 - static const MipModel mip_model_3dm_cx5_35; // 3DM-CX5-35 - static const MipModel mip_model_3dm_cx5_25; // 3DM-CX5-25 - static const MipModel mip_model_3dm_cx5_15; // 3DM-CX5-15 - static const MipModel mip_model_3dm_cx5_10; // 3DM-CX5-10 - static const MipModel mip_model_3dm_cl5_15; // 3DM-CL5-15 - static const MipModel mip_model_3dm_cl5_25; // 3DM-CL5-25 - static const MipModel mip_model_3dm_gq7; // 3DM-GQ7 - static const MipModel mip_model_3dm_rtk_v1; // 3DM-RTK v1 - static const MipModel mip_model_3dm_rtk; // 3DM-RTK - static const MipModel mip_model_3dm_cv7_ahrs; // 3DM-CV7-AHRS - static const MipModel mip_model_3dm_cv7_ar; // 3DM-CV7-AR - static const MipModel mip_model_3dm_gv7_ahrs; // 3DM-GV7-AHRS - static const MipModel mip_model_3dm_gv7_ar; // 3DM-GV7-AR - static const MipModel mip_model_3dm_gv7_ins; // 3DM-CV7-INS - static const MipModel mip_model_3dm_cv7_ins; // 3DM-CV7-INS + static const MipModel mip_model_none; // undefined + static const MipModel mip_model_3dm_dh3; // 3DM-DH3 + static const MipModel mip_model_3dm_gx3_15; // 3DM-GX3-15 + static const MipModel mip_model_3dm_gx3_25; // 3DM-GX3-25 + static const MipModel mip_model_3dm_gx3_35; // 3DM-GX3-35 + static const MipModel mip_model_3dm_gx3_45; // 3DM-GX3-45 + static const MipModel mip_model_3dm_rq1_45_lt; // 3DM-RQ1-45-LT + static const MipModel mip_model_3dm_rq1_45_st; // 3DM-RQ1-45-ST + static const MipModel mip_model_3dm_gx4_15; // 3DM-GX4-15 + static const MipModel mip_model_3dm_gx4_25; // 3DM-GX4-25 + static const MipModel mip_model_3dm_gx4_45; // 3DM-GX4-45 + static const MipModel mip_model_mv5_ar; // MV5-AR + static const MipModel mip_model_3dm_gx5_10; // 3DM-GX5-10 + static const MipModel mip_model_3dm_gx5_15; // 3DM-GX5-15 + static const MipModel mip_model_3dm_gx5_25; // 3DM-GX5-25 + static const MipModel mip_model_3dm_gx5_35; // 3DM-GX5-35 + static const MipModel mip_model_3dm_gx5_45; // 3DM-GX5-45 + static const MipModel mip_model_3dm_cv5_10; // 3DM-CV5-10 + static const MipModel mip_model_3dm_cv5_15; // 3DM-CV5-15 + static const MipModel mip_model_3dm_cv5_25; // 3DM-CV5-25 + static const MipModel mip_model_3dm_cv5_45; // 3DM-CV5-45 + static const MipModel mip_model_3dm_gq4_45; // 3DM-GQ4-45 + static const MipModel mip_model_3dm_cx5_45; // 3DM-CX5-45 + static const MipModel mip_model_3dm_cx5_35; // 3DM-CX5-35 + static const MipModel mip_model_3dm_cx5_25; // 3DM-CX5-25 + static const MipModel mip_model_3dm_cx5_15; // 3DM-CX5-15 + static const MipModel mip_model_3dm_cx5_10; // 3DM-CX5-10 + static const MipModel mip_model_3dm_cl5_15; // 3DM-CL5-15 + static const MipModel mip_model_3dm_cl5_25; // 3DM-CL5-25 + static const MipModel mip_model_3dm_gq7; // 3DM-GQ7 + static const MipModel mip_model_3dm_rtk_v1; // 3DM-RTK v1 + static const MipModel mip_model_3dm_rtk; // 3DM-RTK + static const MipModel mip_model_3dm_cv7_ahrs; // 3DM-CV7-AHRS + static const MipModel mip_model_3dm_cv7_ar; // 3DM-CV7-AR + static const MipModel mip_model_3dm_gv7_ahrs; // 3DM-GV7-AHRS + static const MipModel mip_model_3dm_gv7_ar; // 3DM-GV7-AR + static const MipModel mip_model_3dm_gv7_ins; // 3DM-GV7-INS + static const MipModel mip_model_3dm_cv7_ins; // 3DM-CV7-INS + static const MipModel mip_model_3dm_cv7_gnss_ins; // 3DM-CV7-GNSS/INS private: MipModel(); // hide default constructor diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipNode.h b/MSCL/source/mscl/MicroStrain/MIP/MipNode.h index 1f5965849..b6a4d9267 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipNode.h +++ b/MSCL/source/mscl/MicroStrain/MIP/MipNode.h @@ -318,6 +318,8 @@ namespace mscl // - : A connection error has occurred with the MipNode. void resume(); + // TODO: Interface Control (0x7F, 0x02) + //API Function: getCommunicationMode // Gets the current communication mode that the node is in. // diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.cpp b/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.cpp index 197c9e608..e7abe2ba8 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.cpp +++ b/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.cpp @@ -241,26 +241,65 @@ namespace mscl const CommPortInfo MipNodeFeatures::getCommPortInfo() const { - MipModel model(nodeInfo().deviceInfo().modelNumber); + const MipModel model(nodeInfo().deviceInfo().modelNumber); + switch (model.baseModel().nodeModel()) { - case MipModels::node_3dm_gq7: - return{ - DeviceCommPort(DeviceCommPort::Type::PRIMARY, 1), - DeviceCommPort(DeviceCommPort::Type::AUX, 2) - }; - - case MipModels::node_3dm_cv7_ins: - case MipModels::node_3dm_gv7_ins: - return{ - DeviceCommPort(DeviceCommPort::Type::PRIMARY, 1), - DeviceCommPort(DeviceCommPort::Type::GPIO, 2) - }; + case MipModels::node_3dm_gq7: + { + return{ + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 1), + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 2) + }; + } - default: - return{ - DeviceCommPort(DeviceCommPort::Type::PRIMARY, 1) - }; + case MipModels::node_3dm_cv7_ar: + case MipModels::node_3dm_cv7_ahrs: + case MipModels::node_3dm_gv7_ar: + case MipModels::node_3dm_gv7_ahrs: + { + return { + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 1), + DeviceCommPort(DeviceCommPort::Type::USB, 1) + }; + } + case MipModels::node_3dm_cv7_ins: + { + return { + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 2), + DeviceCommPort(DeviceCommPort::Type::UART, 3), + DeviceCommPort(DeviceCommPort::Type::USB, 1) + }; + } + case MipModels::node_3dm_gv7_ins: + { + return { + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 2), + DeviceCommPort(DeviceCommPort::Type::USB, 1) + }; + } + case MipModels::node_3dm_cv7_gnss_ins: + { + return { + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 1), + DeviceCommPort(DeviceCommPort::Type::UART, 2), + DeviceCommPort(DeviceCommPort::Type::UART, 3), + DeviceCommPort(DeviceCommPort::Type::USB, 1), + DeviceCommPort(DeviceCommPort::Type::USB, 2) + }; + } + default: + { + return { + DeviceCommPort(DeviceCommPort::Type::SPECIAL, 1) + }; + } } } @@ -459,23 +498,28 @@ namespace mscl MipModel model(nodeInfo().deviceInfo().modelNumber); switch (model.baseModel().nodeModel()) { - case MipModels::node_3dm_cv7_ins: - case MipModels::node_3dm_gv7_ins: - return HeadingAlignmentMethod( - HeadingAlignmentOption::GNSS_Kinematic - | HeadingAlignmentOption::Magnetometer - | HeadingAlignmentOption::External - ); - - case MipModels::node_3dm_gq7: - return HeadingAlignmentMethod( - HeadingAlignmentOption::GNSS_DualAntenna - | HeadingAlignmentOption::GNSS_Kinematic - | HeadingAlignmentOption::Magnetometer - ); - - default: - return HeadingAlignmentMethod(0xFF); + case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_gv7_ins: + { + return HeadingAlignmentMethod( + HeadingAlignmentOption::GNSS_Kinematic | + HeadingAlignmentOption::Magnetometer | + HeadingAlignmentOption::External + ); + } + case MipModels::node_3dm_gq7: + { + return HeadingAlignmentMethod( + HeadingAlignmentOption::GNSS_DualAntenna | + HeadingAlignmentOption::GNSS_Kinematic | + HeadingAlignmentOption::Magnetometer + ); + } + case MipModels::node_3dm_cv7_gnss_ins: + default: + { + return HeadingAlignmentMethod(0xFF); + } } } @@ -614,12 +658,13 @@ namespace mscl case MipModels::node_3dm_gv7_ar: case MipModels::node_3dm_gv7_ins: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: default: return{ InertialTypes::AutoAdaptiveFilteringLevel::FILTERING_OFF, InertialTypes::AutoAdaptiveFilteringLevel::FILTERING_CONSERVATIVE, InertialTypes::AutoAdaptiveFilteringLevel::FILTERING_MODERATE, - InertialTypes::AutoAdaptiveFilteringLevel::FILTERING_AGGRESIVE + InertialTypes::AutoAdaptiveFilteringLevel::FILTERING_AGGRESSIVE }; } } @@ -670,6 +715,7 @@ namespace mscl InertialTypes::AidingMeasurementSource::EXTERNAL_HEADING_AIDING }; + case MipModels::node_3dm_cv7_gnss_ins: default: return { InertialTypes::AidingMeasurementSource::GNSS_POS_VEL_AIDING, @@ -701,6 +747,7 @@ namespace mscl case MipModels::node_3dm_gv7_ar: case MipModels::node_3dm_gv7_ins: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: return{ InertialTypes::PpsSource::PPS_DISABLED, InertialTypes::PpsSource::PPS_GPIO, @@ -718,28 +765,57 @@ namespace mscl } } + const std::vector MipNodeFeatures::supportedGpioPins() const + { + const MipModel model(nodeInfo().deviceInfo().modelNumber); + const MipModels::NodeModel nodeModel = model.baseModel().nodeModel(); + + switch (nodeModel) + { + case MipModels::node_3dm_gv7_ahrs: + case MipModels::node_3dm_gv7_ar: + case MipModels::node_3dm_gv7_ins: + { + return { 1, 2 }; + } + case MipModels::node_3dm_cv7_ahrs: + case MipModels::node_3dm_cv7_ar: + case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: + case MipModels::node_3dm_gq7: + { + return { 1, 2, 3, 4 }; + } + // No supported GPIO pins + default: + { + return {}; + } + } + } + const GpioPinModeOptions MipNodeFeatures::supportedGpioPinModes(GpioConfiguration::Feature feature, uint8 behavior) const { if (!supportsCommand(mscl::MipTypes::Command::CMD_GPIO_CONFIGURATION)) { - return{ GpioPinModeOptions(0) }; + return GpioPinModeOptions(); } if ((feature == GpioConfiguration::ENCODER_FEATURE && behavior != GpioConfiguration::EncoderBehavior::ENCODER_UNUSED) - || (feature == GpioConfiguration::GPIO_FEATURE && behavior == GpioConfiguration::GpioBehavior::GPIO_INPUT_BEHAVIOR)) + || (feature == GpioConfiguration::GPIO_FEATURE && behavior == GpioConfiguration::GpioBehavior::GPIO_INPUT)) { - return{ - GpioConfiguration::PinModes(0), - GpioConfiguration::PinModes::PULLUP, - GpioConfiguration::PinModes::PULLDOWN + return { + GpioConfiguration::PinModes::NONE, + GpioConfiguration::PinModes::PULLDOWN, + GpioConfiguration::PinModes::PULLUP }; } if (feature == GpioConfiguration::GPIO_FEATURE - && (behavior == GpioConfiguration::GpioBehavior::GPIO_OUTPUT_LOW_BEHAVIOR || behavior == GpioConfiguration::GpioBehavior::GPIO_OUTPUT_HIGH_BEHAVIOR)) + && (behavior == GpioConfiguration::GpioBehavior::GPIO_OUTPUT_LOW || behavior == GpioConfiguration::GpioBehavior::GPIO_OUTPUT_HIGH)) { - return{ - GpioConfiguration::PinModes(0), + return { + GpioConfiguration::PinModes::NONE, GpioConfiguration::PinModes::OPEN_DRAIN, GpioConfiguration::PinModes(GpioConfiguration::PinModes::OPEN_DRAIN | GpioConfiguration::PinModes::PULLUP) }; @@ -747,10 +823,10 @@ namespace mscl if (feature == GpioConfiguration::EVENT_TIMESTAMP_FEATURE) // same modes available for all Event Timestamp behaviors { - return{ - GpioConfiguration::PinModes(0), - GpioConfiguration::PinModes::PULLUP, - GpioConfiguration::PinModes::PULLDOWN + return { + GpioConfiguration::PinModes::NONE, + GpioConfiguration::PinModes::PULLDOWN, + GpioConfiguration::PinModes::PULLUP }; } @@ -758,86 +834,267 @@ namespace mscl { switch (behavior) { - case GpioConfiguration::UartBehavior::UART_TRANSMIT: - return{ - GpioConfiguration::PinModes(0), - GpioConfiguration::PinModes::OPEN_DRAIN, - GpioConfiguration::PinModes(GpioConfiguration::PinModes::OPEN_DRAIN | GpioConfiguration::PinModes::PULLUP) - }; - - case GpioConfiguration::UartBehavior::UART_RECEIVE: - return{ - GpioConfiguration::PinModes(0), - GpioConfiguration::PinModes::PULLUP, - GpioConfiguration::PinModes::PULLDOWN - }; - - default: - break; + case GpioConfiguration::UartBehavior::UART_PORT2_TX: + { + return { + GpioConfiguration::PinModes::NONE, + GpioConfiguration::PinModes::OPEN_DRAIN + }; + } + case GpioConfiguration::UartBehavior::UART_PORT2_RX: + { + return { + GpioConfiguration::PinModes::NONE, + GpioConfiguration::PinModes::PULLDOWN, + GpioConfiguration::PinModes::PULLUP + }; + } + case GpioConfiguration::UartBehavior::UART_PORT3_TX: + { + return { + GpioConfiguration::PinModes::NONE, + GpioConfiguration::PinModes::OPEN_DRAIN + }; + } + case GpioConfiguration::UartBehavior::UART_PORT3_RX: + { + return { + GpioConfiguration::PinModes::NONE, + GpioConfiguration::PinModes::PULLDOWN, + GpioConfiguration::PinModes::PULLUP + }; + } + default: + { + break; + } } } - return{ GpioPinModeOptions(0) }; + return GpioPinModeOptions(); } - const GpioBehaviorModes MipNodeFeatures::supportedGpioBehaviors(GpioConfiguration::Feature feature) const + const GpioBehaviorModes MipNodeFeatures::supportedGpioBehaviors(GpioConfiguration::Feature feature, GpioPinId pin) const { - if (!supportsCommand(mscl::MipTypes::Command::CMD_GPIO_CONFIGURATION)) + if (!supportsCommand(mscl::MipTypes::Command::CMD_GPIO_CONFIGURATION) || feature == GpioConfiguration::UNUSED_FEATURE) { - return{}; + return GpioBehaviorModes(); } - switch (feature) + // Make sure the pin is supported by the device first + if (pin != 0) { - case GpioConfiguration::Feature::GPIO_FEATURE: - return{ - { GpioConfiguration::GpioBehavior::GPIO_INPUT_BEHAVIOR, supportedGpioPinModes(feature, GpioConfiguration::GpioBehavior::GPIO_INPUT_BEHAVIOR) }, - { GpioConfiguration::GpioBehavior::GPIO_OUTPUT_LOW_BEHAVIOR, supportedGpioPinModes(feature, GpioConfiguration::GpioBehavior::GPIO_OUTPUT_LOW_BEHAVIOR) }, - { GpioConfiguration::GpioBehavior::GPIO_OUTPUT_HIGH_BEHAVIOR, supportedGpioPinModes(feature, GpioConfiguration::GpioBehavior::GPIO_OUTPUT_HIGH_BEHAVIOR) } - }; + const std::vector supportedPins = supportedGpioPins(); - case GpioConfiguration::Feature::PPS_FEATURE: - return{ - { GpioConfiguration::PpsBehavior::PPS_INPUT, GpioPinModeOptions(0) }, - { GpioConfiguration::PpsBehavior::PPS_OUTPUT, GpioPinModeOptions(0) } - }; - - case GpioConfiguration::Feature::ENCODER_FEATURE: - return{ - { GpioConfiguration::EncoderBehavior::ENCODER_A, supportedGpioPinModes(feature, GpioConfiguration::EncoderBehavior::ENCODER_A) }, - { GpioConfiguration::EncoderBehavior::ENCODER_B, supportedGpioPinModes(feature, GpioConfiguration::EncoderBehavior::ENCODER_A) } - }; + if (std::find(supportedPins.begin(), supportedPins.end(), pin) == supportedPins.end()) + { + return GpioBehaviorModes(); + } + } - case GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE: - return{ - { GpioConfiguration::EventTimestampBehavior::EVENT_TIMESTAMP_RISING, supportedGpioPinModes(feature, 0) }, - { GpioConfiguration::EventTimestampBehavior::EVENT_TIMESTAMP_FALLING, supportedGpioPinModes(feature, 0) }, - { GpioConfiguration::EventTimestampBehavior::EVENT_TIMESTAMP_EDGE, supportedGpioPinModes(feature, 0) } - }; + const MipModels::NodeModel nodeModel = MipModel(nodeInfo().deviceInfo().modelNumber).baseModel().nodeModel(); - case GpioConfiguration::Feature::UART_FEATURE: + switch (feature) { - MipModel model(nodeInfo().deviceInfo().modelNumber); - switch (model.baseModel().nodeModel()) + // GPIO Feature is supported on all available pins + case GpioConfiguration::Feature::GPIO_FEATURE: { - case MipModels::node_3dm_gv7_ins: - case MipModels::node_3dm_cv7_ins: - // technically Transmit is also supported, but the device won't actually output anything so no reason to configure it - return{ - { GpioConfiguration::UartBehavior::UART_RECEIVE, supportedGpioPinModes(feature, GpioConfiguration::UartBehavior::UART_RECEIVE) } + return { + { + GpioConfiguration::GpioBehavior::GPIO_INPUT, + supportedGpioPinModes(feature, GpioConfiguration::GpioBehavior::GPIO_INPUT) + }, + { + GpioConfiguration::GpioBehavior::GPIO_OUTPUT_LOW, + supportedGpioPinModes(feature, GpioConfiguration::GpioBehavior::GPIO_OUTPUT_LOW) + }, + { + GpioConfiguration::GpioBehavior::GPIO_OUTPUT_HIGH, + supportedGpioPinModes(feature, GpioConfiguration::GpioBehavior::GPIO_OUTPUT_HIGH) + } }; + } + case GpioConfiguration::Feature::PPS_FEATURE: + { + switch (nodeModel) + { + case MipModels::node_3dm_gq7: + { + if (pin != 1 && pin != 3) + { + return GpioBehaviorModes(); + } + + break; + } + case MipModels::node_3dm_cv7_ahrs: + case MipModels::node_3dm_cv7_ar: + case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: + case MipModels::node_3dm_gv7_ahrs: + case MipModels::node_3dm_gv7_ar: + case MipModels::node_3dm_gv7_ins: + { + break; + } + default: + { + return GpioBehaviorModes(); + } + } - default: - return{ - { GpioConfiguration::UartBehavior::UART_TRANSMIT, supportedGpioPinModes(feature, GpioConfiguration::UartBehavior::UART_TRANSMIT) }, - { GpioConfiguration::UartBehavior::UART_RECEIVE, supportedGpioPinModes(feature, GpioConfiguration::UartBehavior::UART_RECEIVE) } + return { + { + GpioConfiguration::PpsBehavior::PPS_INPUT, + GpioPinModeOptions() + }, + { + GpioConfiguration::PpsBehavior::PPS_OUTPUT, + GpioPinModeOptions() + } }; } - } + case GpioConfiguration::Feature::ENCODER_FEATURE: + { + switch (nodeModel) + { + case MipModels::node_3dm_gq7: + { + if (pin == 1) + { + return { + { + GpioConfiguration::EncoderBehavior::ENCODER_A, + supportedGpioPinModes(feature, GpioConfiguration::EncoderBehavior::ENCODER_A) + } + }; + } + + if (pin == 2) + { + return { + { + GpioConfiguration::EncoderBehavior::ENCODER_B, + supportedGpioPinModes(feature, GpioConfiguration::EncoderBehavior::ENCODER_B) + } + }; + } + + break; + } + case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: + case MipModels::node_3dm_gv7_ins: + { + if (pin == 3) + { + return { + { + GpioConfiguration::EncoderBehavior::ENCODER_A, + supportedGpioPinModes(feature, GpioConfiguration::EncoderBehavior::ENCODER_A) + } + }; + } + + if (pin == 4) + { + return { + { + GpioConfiguration::EncoderBehavior::ENCODER_B, + supportedGpioPinModes(feature, GpioConfiguration::EncoderBehavior::ENCODER_B) + } + }; + } + + break; + } + default: + { + break; + } + } - default: - return{}; + return GpioBehaviorModes(); + } + case GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE: + { + switch (nodeModel) + { + case MipModels::node_3dm_cv7_ahrs: + case MipModels::node_3dm_cv7_ar: + case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: + case MipModels::node_3dm_gv7_ahrs: + case MipModels::node_3dm_gv7_ar: + case MipModels::node_3dm_gv7_ins: + { + return { + { + GpioConfiguration::EventTimestampBehavior::TIMESTAMP_RISING, + supportedGpioPinModes(feature, GpioConfiguration::EventTimestampBehavior::TIMESTAMP_RISING) + }, + { + GpioConfiguration::EventTimestampBehavior::TIMESTAMP_FALLING, + supportedGpioPinModes(feature, GpioConfiguration::EventTimestampBehavior::TIMESTAMP_FALLING) + }, + { + GpioConfiguration::EventTimestampBehavior::TIMESTAMP_EITHER, + supportedGpioPinModes(feature, GpioConfiguration::EventTimestampBehavior::TIMESTAMP_EITHER) + } + }; + } + default: + { + return GpioBehaviorModes(); + } + } + } + case GpioConfiguration::Feature::UART_FEATURE: + { + switch (nodeModel) + { + case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: + case MipModels::node_3dm_gv7_ins: + { + if (pin == 1 || pin == 2) + { + return { + { + GpioConfiguration::UartBehavior::UART_PORT2_TX, + supportedGpioPinModes(GpioConfiguration::Feature::UART_FEATURE, GpioConfiguration::UartBehavior::UART_PORT2_TX) + }, + { + GpioConfiguration::UartBehavior::UART_PORT2_RX, + supportedGpioPinModes(GpioConfiguration::Feature::UART_FEATURE, GpioConfiguration::UartBehavior::UART_PORT2_RX) + } + }; + } + + return { + { + GpioConfiguration::UartBehavior::UART_PORT3_TX, + supportedGpioPinModes(GpioConfiguration::Feature::UART_FEATURE, GpioConfiguration::UartBehavior::UART_PORT3_TX) + }, + { + GpioConfiguration::UartBehavior::UART_PORT3_RX, + supportedGpioPinModes(GpioConfiguration::Feature::UART_FEATURE, GpioConfiguration::UartBehavior::UART_PORT3_RX) + } + }; + } + default: + { + return GpioBehaviorModes(); + } + } + } + default: + { + return GpioBehaviorModes(); + } } + + return GpioBehaviorModes(); } const GpioFeatureBehaviors MipNodeFeatures::supportedGpioFeatures(uint8 pin) const @@ -861,91 +1118,53 @@ namespace mscl { if (!supportsCommand(mscl::MipTypes::Command::CMD_GPIO_CONFIGURATION)) { - return{}; + return GpioPinOptions(); } - const MipModel model(nodeInfo().deviceInfo().modelNumber); - const MipModels::NodeModel nodeModel = model.baseModel().nodeModel(); + // Build pin options + GpioPinOptions pinOptions; - // get supported pin IDs - std::vector supportedPins; - switch (nodeModel) + // Iterate supported pin IDs + for (const GpioPinId pinId : supportedGpioPins()) { - case MipModels::node_3dm_gv7_ahrs: - case MipModels::node_3dm_gv7_ar: - case MipModels::node_3dm_gv7_ins: - supportedPins = { 1, 2 }; - break; - - // gq7, cv7 - default: - supportedPins = { 1, 2, 3, 4 }; - break; - } + // Build feature behaviors + GpioFeatureBehaviors features; - // get all available to avoid re-calling supportedGpioBehaviors() for a behavior type - const GpioFeatureBehaviors availableBehaviors = { - { GpioConfiguration::Feature::GPIO_FEATURE, supportedGpioBehaviors(GpioConfiguration::Feature::GPIO_FEATURE) }, - { GpioConfiguration::Feature::PPS_FEATURE, supportedGpioBehaviors(GpioConfiguration::Feature::PPS_FEATURE) }, - { GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE, supportedGpioBehaviors(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE) }, - { GpioConfiguration::Feature::ENCODER_FEATURE, supportedGpioBehaviors(GpioConfiguration::Feature::ENCODER_FEATURE) }, - { GpioConfiguration::Feature::UART_FEATURE, supportedGpioBehaviors(GpioConfiguration::Feature::UART_FEATURE) } - }; + // All pins support unused behaviors + const GpioBehaviorModes unusedBehaviors = supportedGpioBehaviors(GpioConfiguration::Feature::UNUSED_FEATURE, pinId); + features.emplace(GpioConfiguration::Feature::UNUSED_FEATURE, unusedBehaviors); - // build pin options - GpioPinOptions pinOptions; - for (uint8 pinId : supportedPins) - { - // add features shared for all pins across all devices - GpioFeatureBehaviors features = { - { GpioConfiguration::Feature::UNUSED_FEATURE,{} }, - { GpioConfiguration::Feature::GPIO_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::GPIO_FEATURE) } - }; + const GpioBehaviorModes gpioBehaviors = supportedGpioBehaviors(GpioConfiguration::Feature::GPIO_FEATURE, pinId); + if (!gpioBehaviors.empty()) + { + features.emplace(GpioConfiguration::Feature::GPIO_FEATURE, gpioBehaviors); + } - // add device- and pin-specific features - switch (nodeModel) + const GpioBehaviorModes ppsBehaviors = supportedGpioBehaviors(GpioConfiguration::Feature::PPS_FEATURE, pinId); + if (!ppsBehaviors.empty()) { - case MipModels::node_3dm_cv7_ahrs: - case MipModels::node_3dm_cv7_ar: - case MipModels::node_3dm_gv7_ahrs: - case MipModels::node_3dm_gv7_ar: - // CV7 and GV7 all pins support the same features - features.emplace(GpioConfiguration::Feature::PPS_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::PPS_FEATURE)); - features.emplace(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE)); - break; + features.emplace(GpioConfiguration::Feature::PPS_FEATURE, ppsBehaviors); + } - case MipModels::node_3dm_gv7_ins: - case MipModels::node_3dm_cv7_ins: - // CV7 and GV7 all pins support the same features - features.emplace(GpioConfiguration::Feature::PPS_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::PPS_FEATURE)); - features.emplace(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE)); - features.emplace(GpioConfiguration::Feature::UART_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::UART_FEATURE)); - break; + const GpioBehaviorModes encoderBehaviors = supportedGpioBehaviors(GpioConfiguration::Feature::ENCODER_FEATURE, pinId); + if (!encoderBehaviors.empty()) + { + features.emplace(GpioConfiguration::Feature::ENCODER_FEATURE, encoderBehaviors); + } - case MipModels::node_3dm_gq7: - // GQ7 feature support varies across pins - switch (pinId) - { - case 1: - features.emplace(GpioConfiguration::Feature::PPS_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::PPS_FEATURE)); - features.emplace(GpioConfiguration::Feature::ENCODER_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::ENCODER_FEATURE)); - break; - case 2: - features.emplace(GpioConfiguration::Feature::ENCODER_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::ENCODER_FEATURE)); - break; - case 3: - features.emplace(GpioConfiguration::Feature::PPS_FEATURE, availableBehaviors.at(GpioConfiguration::Feature::PPS_FEATURE)); - break; - default: - break; - } - break; + const GpioBehaviorModes eventBehaviors = supportedGpioBehaviors(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE, pinId); + if (!eventBehaviors.empty()) + { + features.emplace(GpioConfiguration::Feature::EVENT_TIMESTAMP_FEATURE, eventBehaviors); + } - default: - break; + const GpioBehaviorModes uartBehaviors = supportedGpioBehaviors(GpioConfiguration::Feature::UART_FEATURE, pinId); + if (!uartBehaviors.empty()) + { + features.emplace(GpioConfiguration::Feature::UART_FEATURE, uartBehaviors); } - // add features for target id to pin options + // Add features for target id to pin options pinOptions.emplace(pinId, features); } @@ -1027,6 +1246,7 @@ namespace mscl case MipModels::node_3dm_gv7_ins: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: default: return{ InertialTypes::GeographicSourceOption::NONE, @@ -1058,6 +1278,7 @@ namespace mscl case MipModels::node_3dm_gv7_ins: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: default: return{ InertialTypes::GeographicSourceOption::NONE, @@ -1089,6 +1310,7 @@ namespace mscl case MipModels::node_3dm_gv7_ins: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: default: return{ InertialTypes::GeographicSourceOption::NONE, @@ -1117,6 +1339,7 @@ namespace mscl case MipModels::node_3dm_gv7_ar: case MipModels::node_3dm_gv7_ins: case MipModels::node_3dm_cv7_ins: + case MipModels::node_3dm_cv7_gnss_ins: default: possibleFields = { // 0x80: Sensor Data @@ -1279,6 +1502,18 @@ namespace mscl return 0; } - return 4; + const MipModel model(nodeInfo().deviceInfo().modelNumber); + + switch (model.baseModel().nodeModel()) + { + case MipModels::node_3dm_cv7_gnss_ins: + { + return 3; + } + default: + { + return 4; + } + } } } diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.h b/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.h index 6a2150670..4a716893c 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.h +++ b/MSCL/source/mscl/MicroStrain/MIP/MipNodeFeatures.h @@ -305,6 +305,13 @@ namespace mscl // A list containing all the supported options. const PpsSourceOptions supportedPpsSourceOptions() const; + //API Function: supportedGpioPins + // Gets the GPIO Pin IDs supported by this device. + // + //Returns: + // A > list containing all the supported GPIO pins. + const std::vector supportedGpioPins() const; + //API Function: supportedGpioPinModes // Gets the Pin Mode options supported by this device based on the selected feature and behavior. // @@ -322,10 +329,11 @@ namespace mscl // //Parameters: // feature - the + // pin - the to get the feature behaviors for // //Returns: // A list containing all the supported options. - const GpioBehaviorModes supportedGpioBehaviors(GpioConfiguration::Feature feature) const; + const GpioBehaviorModes supportedGpioBehaviors(GpioConfiguration::Feature feature, GpioPinId pin) const; //API Function: supportedGpioFeatures // Gets the GPIO Feature options supported by this device for the specified GPIO pin. @@ -335,7 +343,7 @@ namespace mscl // //Returns: // A list containing all the supported options. - const GpioFeatureBehaviors supportedGpioFeatures(uint8 pin) const; + const GpioFeatureBehaviors supportedGpioFeatures(GpioPinId pin) const; //API Function: supportedGpioConfigurations // Gets a map of supported GPIO configuration options for each supported pin diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.cpp b/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.cpp index 4dbc6b1d5..d146ce0fb 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.cpp +++ b/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.cpp @@ -674,7 +674,7 @@ namespace mscl CommPortInfo ports = features().getCommPortInfo(); for (DeviceCommPort& port : ports) { - params.push_back({ cmd, { Value::UINT8(port.id) } }); + params.push_back({ cmd, { Value::UINT8(port.interfaceId()) } }); } break; } @@ -1295,6 +1295,9 @@ namespace mscl setCmds.push_back(MipCommandBytes(cmd, s.data())); } break; + + // TODO: Interface Control (0x7F, 0x02) + case MipTypes::CMD_COMMUNICATION_MODE: { uint8 data = getCommunicationMode(); @@ -1664,6 +1667,33 @@ namespace mscl } } + DeviceCommPort MipNode_Impl::getInterfaceControl(const uint8 interfaceId) const + { + //set the expected response + InterfaceControl::Response r(m_responseCollector, true); + + //send the command, wait for the response, and parse the result + return r.parseResponse(doCommand(r, InterfaceControl::buildCommand_get(interfaceId), false)); + } + + void MipNode_Impl::setInterfaceControl(const DeviceCommPort& portInterface) + { + setInterfaceControl(portInterface.interfaceId(), portInterface.inputProtocols, portInterface.outputProtocols); + } + + void MipNode_Impl::setInterfaceControl(const uint8 interfaceId, const DeviceCommPort::Protocol inputProtocols, + const DeviceCommPort::Protocol outputProtocols) + { + //set the expected response + InterfaceControl::Response r(m_responseCollector, false); + + //send the command and wait for the response + doCommand(r, InterfaceControl::buildCommand_set(interfaceId, inputProtocols, outputProtocols), false); + + //reset the node info because we are switching contexts + resetNodeInfo(); + } + uint8 MipNode_Impl::getCommunicationMode() const { //set the expected response diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.h b/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.h index 170b5b036..3e0adb2e9 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.h +++ b/MSCL/source/mscl/MicroStrain/MIP/MipNode_Impl.h @@ -567,6 +567,51 @@ namespace mscl // - : An in the channels parameter is not part of the specified 's descriptor set. void saveMessageFormat(MipTypes::DataClass type); + //Function: getInterfaceControl + // Gets the current comm port interface configuration for the specified ID. + // This includes the port type, ID and input/output protocols currently configured. + // + //Parameters: + // interfaceId - The interface ID to get the comm port configuration for + // + //Returns: + // The configuration for the specified ID. + // + //Exceptions: + // - : The command or is not supported by this Node. + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + virtual DeviceCommPort getInterfaceControl(uint8 interfaceId) const; + + //Function: setInterfaceControl + // Sets the interface control for the node. + // Note: See the device's manual for possible configurations and limitations. + // + //Parameters: + // portInterface - The with prepopulated configuration information to set + // + //Exceptions: + // - : There was no response to the command. The command timed out. + // - : The command has failed. + // - : A connection error has occurred with the InertialNode. + virtual void setInterfaceControl(const DeviceCommPort& portInterface); + + //Function: setInterfaceControl + // Sets the specified comm port interface configuration for the node. + // Note: See the device's manual for possible configurations and limitations. + // + //Parameters: + // interfaceId - The interface ID to configure + // inputProtocols - The protocols to receive on the specified ID + // outputProtocols - The protocols to transmit on the specified ID + // + //Exceptions: + // - : There was no response to the command. The command timed out. + // - : The command has failed. Check the error code for more details. + // - : A connection error has occurred with the InertialNode. + virtual void setInterfaceControl(const uint8 interfaceId, const DeviceCommPort::Protocol inputProtocols, const DeviceCommPort::Protocol outputProtocols); + //Function: getCommunicationMode // Gets the current communication mode that the node is in. // diff --git a/MSCL/source/mscl/MicroStrain/MIP/MipTypes.h b/MSCL/source/mscl/MicroStrain/MIP/MipTypes.h index d0c0f34bf..3cc6763fd 100644 --- a/MSCL/source/mscl/MicroStrain/MIP/MipTypes.h +++ b/MSCL/source/mscl/MicroStrain/MIP/MipTypes.h @@ -225,7 +225,9 @@ namespace mscl // CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL - 0x0D64 - Estimation Filter - GNSS Antenna Lever Arm Calibration Control // CMD_GNSS_RECEIVER_INFO - 0x0E01 - GNSS Receiver Info // CMD_GNSS_SIGNAL_CONFIG - 0x0E02 - GNSS Signal Configuration + // CMD_GNSS_SPARTN_CONFIG - 0x0E20 - GNSS Spartn Configuration // CMD_GNSS_RTK_CONFIG - 0x0E10 - GNSS RTK Configuration + // CMD_INTERFACE_CONTROL - 0x7F02 - Interface Control // CMD_COMMUNICATION_MODE - 0x7F10 - Communication Mode // CMD_HARDWARE_CTRL - 0x7F11 - Hardware Control // CMD_GET_ANALOG_DISPLACEMENT_CALS - 0x1101 - Get Analog Output to Displacement Slope and Offset @@ -375,7 +377,9 @@ namespace mscl CMD_EF_GNSS_ANTENNA_LEVER_ARM_CAL = 0x0D64, CMD_GNSS_RECEIVER_INFO = 0x0E01, CMD_GNSS_SIGNAL_CONFIG = 0x0E02, + CMD_GNSS_SPARTN_CONFIG = 0x0E20, CMD_GNSS_RTK_CONFIG = 0x0E10, + CMD_INTERFACE_CONTROL = 0x7F02, CMD_COMMUNICATION_MODE = 0x7F10, CMD_HARDWARE_CTRL = 0x7F11, CMD_GET_ANALOG_DISPLACEMENT_CALS = 0x1101, @@ -393,7 +397,7 @@ namespace mscl CMD_AIDING_VEL_BODY_FRAME = 0x132A, CMD_AIDING_HEADING_TRUE = 0x1331, CMD_AIDING_MAGNETIC_FIELD = 0x1332, - CMD_AIDING_PRESSURE = 0x1333, + CMD_AIDING_PRESSURE = 0x1333, }; //==================================================================================================== @@ -2779,34 +2783,90 @@ namespace mscl { //API Enum: Type // Available comm port type definitions - // PRIMARY - 0 - // AUX - 1 - // GPIO - 2 + // SPECIAL - 0x00 - Device specific ports (Main/Aux) + // UART - 0x01 - UART related ports + // USB - 0x02 - USB related ports enum Type { - PRIMARY = 0, - AUX = 1, - GPIO = 2 + SPECIAL = 0x00, // Device specific ports (Main/Aux) + UART = 0x01, // UART related ports + USB = 0x02 // USB related ports + }; + + //API Enum: Protocol + // Available comm protocols that can be configured for UART ports + // NONE - 0x00000000 - Not set + // MIP_COMMANDS - 0x00000001 - MIP commands + // MIP_DATA - 0x00000002 - MIP data + // NMEA - 0x00000004 - NMEA + // RTCM - 0x00000008 - RTCM + // SPARTN - 0x00000010 - SPARTN + // ALL - 0x0000001F - All protocols + enum Protocol : uint32 + { + NONE = 0x00000000, // Not set + MIP_COMMANDS = 0x00000001, // MIP commands + MIP_DATA = 0x00000002, // MIP data + NMEA = 0x00000004, // NMEA + RTCM = 0x00000008, // RTCM + SPARTN = 0x00000010, // SPARTN + ALL = 0x0000001F // All protocols }; //API Constructor: DeviceCommPort // Constructs DeviceCommPort object with default values - DeviceCommPort() {}; + DeviceCommPort() = default; //API Constructor: DeviceCommPort // Constructs DeviceCommPort object with specified values - DeviceCommPort(Type portType, uint8 portId) : + // + //Parameters: + // portType - Type of port being configured + // portId - The ID of the port to configure + // portInputProtocols - The input protocols accepted by the port + // portOutputProtocols - The output protocols transmitted from the port + DeviceCommPort(Type portType, uint8 portId, Protocol portInputProtocols = NONE, Protocol portOutputProtocols = NONE) : type(portType), - id(portId) - {}; + id(portId), + inputProtocols(portInputProtocols), + outputProtocols(portOutputProtocols) + {} + + //API Constructor: DeviceCommPort + // Constructs DeviceCommPort object with specified values + // The ID and Type are determined by the interface value. I.E. Interface 0x12 == Type 1 && ID 2 + // + //Parameters: + // portInterface - A combination of the port type and ID + // portInputProtocols - The input protocols accepted by the port + // portOutputProtocols - The output protocols transmitted from the port + DeviceCommPort(uint8 portInterface, Protocol portInputProtocols = NONE, Protocol portOutputProtocols = NONE) : + type(static_cast((portInterface & 0xF0) >> 4)), + id(portInterface & 0xF), + inputProtocols(portInputProtocols), + outputProtocols(portOutputProtocols) + {} + + //API Function: interfaceId + // Get the interface ID of the port + // This is a combined value of the type and port ID + uint8 interfaceId() const { return (static_cast(type) << 4) | id; } //API Variable: type - // Port type (primary, aux, etc.) + // Port type (special, UART, etc.) Type type; //API Variable: id // Port ID uint8 id; + + //API Variable: protocol + // Input communication protocols + Protocol inputProtocols; + + //API Variable: protocol + // Output communication protocols + Protocol outputProtocols; }; typedef std::vector CommPortInfo; diff --git a/MSCL/source/mscl/Wrapper/MSCL_Main_Interface.i b/MSCL/source/mscl/Wrapper/MSCL_Main_Interface.i index 73fa670b3..dd7d8bfcf 100644 --- a/MSCL/source/mscl/Wrapper/MSCL_Main_Interface.i +++ b/MSCL/source/mscl/Wrapper/MSCL_Main_Interface.i @@ -354,4 +354,4 @@ namespace std //The exceptions need to be created by hand in the Exceptions.cs file #ifndef SWIGCSHARP %include "../Exceptions.h" -#endif \ No newline at end of file +#endif diff --git a/MSCL/source/stdafx.h b/MSCL/source/stdafx.h index bdc1947fe..598cacce1 100644 --- a/MSCL/source/stdafx.h +++ b/MSCL/source/stdafx.h @@ -12,14 +12,15 @@ #include //for boost asio communication #include //for boost circular buffer #include //for boost::posix_time::from_time_t +#include //for boost::optional #include //for boost::posix_time::nanosec #include //for boost ptime #include //for endianess #include //for boost::numeric_cast -#include //for boost::optional #include //for BOOST_BINARY #include //for std::min, std::replace +#include //for std::bitset #include //for std::chrono::duration #include //for std::condition_variable #include //for std::uint16_t and like fixed-width types @@ -37,11 +38,10 @@ #include //for std:tuple, std::get #include //for std::unordered_map #include //for std::vector -#include //for std::bitset //common MSCL files that will rarely change -#include "mscl/simple_any.h" #include "mscl/Exceptions.h" +#include "mscl/simple_any.h" #include "mscl/TimedCondition.h" #include "mscl/TimeSpan.h" #include "mscl/Timestamp.h" diff --git a/MSCL_Examples/Displacement/C++/MSCL_Displacement_Example_C++/MSCL_Displacement_Example_C++/CMakeLists.txt b/MSCL_Examples/Displacement/C++/MSCL_Displacement_Example_C++/MSCL_Displacement_Example_C++/CMakeLists.txt index 881b112fc..c996c9825 100644 --- a/MSCL_Examples/Displacement/C++/MSCL_Displacement_Example_C++/MSCL_Displacement_Example_C++/CMakeLists.txt +++ b/MSCL_Examples/Displacement/C++/MSCL_Displacement_Example_C++/MSCL_Displacement_Example_C++/CMakeLists.txt @@ -8,19 +8,19 @@ add_executable(${PROJECT_NAME} main.cpp) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake") if(CMAKE_PROJECT_NAME STREQUAL "MSCL") - # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. - # If not building in the MSCL repo, this can be safely ignored or removed - set(MSCL_LIBRARY MSCL) - set(MSCL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../MSCL/source") - target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/MSCL/MSCL_Static/${CMAKE_CFG_INTDIR}) - add_dependencies(${PROJECT_NAME} MSCL_Static) + # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. + # If not building in the MSCL repo, this can be safely ignored or removed + set(MSCL_LIBRARY MSCL) + set(MSCL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../MSCL/source") + target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/MSCL/MSCL_Static/${CMAKE_CFG_INTDIR}) + add_dependencies(${PROJECT_NAME} MSCL_Static) endif() find_package(MSCL REQUIRED) target_include_directories(${PROJECT_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${MSCL_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${MSCL_INCLUDE_DIRS} ) target_link_libraries(${PROJECT_NAME} ${MSCL_LIBRARIES}) @@ -28,9 +28,9 @@ target_link_libraries(${PROJECT_NAME} ${MSCL_LIBRARIES}) target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB) if(MSVC) - # On windows, we need to set the runtime library to the same as MSCL - target_compile_options(${PROJECT_NAME} PRIVATE - /MT$<$:d> - /MP - ) + # On windows, we need to set the runtime library to the same as MSCL + target_compile_options(${PROJECT_NAME} PRIVATE + /MT$<$:d> + /MP + ) endif() diff --git a/MSCL_Examples/Displacement/CMakeLists.txt b/MSCL_Examples/Displacement/CMakeLists.txt index 0c5e0780f..fcd847cbc 100644 --- a/MSCL_Examples/Displacement/CMakeLists.txt +++ b/MSCL_Examples/Displacement/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(C++/MSCL_Displacement_Example_C++/MSCL_Displacement_Example_C++) -if(BUILD_CSHARP) - add_subdirectory(CSharp/MSCL_Displacement_Example_CSharp/MSCL_Displacement_Example_CSharp) -endif() \ No newline at end of file + +if(MSCL_BUILD_CSHARP) + add_subdirectory(CSharp/MSCL_Displacement_Example_CSharp/MSCL_Displacement_Example_CSharp) +endif() diff --git a/MSCL_Examples/Displacement/CSharp/MSCL_Displacement_Example_CSharp/MSCL_Displacement_Example_CSharp/CMakeLists.txt b/MSCL_Examples/Displacement/CSharp/MSCL_Displacement_Example_CSharp/MSCL_Displacement_Example_CSharp/CMakeLists.txt index d00f6196e..e91bb3413 100644 --- a/MSCL_Examples/Displacement/CSharp/MSCL_Displacement_Example_CSharp/MSCL_Displacement_Example_CSharp/CMakeLists.txt +++ b/MSCL_Examples/Displacement/CSharp/MSCL_Displacement_Example_CSharp/MSCL_Displacement_Example_CSharp/CMakeLists.txt @@ -5,43 +5,43 @@ project(MSCL_Example_Displacement_CSharp LANGUAGES CSharp) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake") add_executable(${PROJECT_NAME} - Properties/AssemblyInfo.cs - getCurrentConfig.cs - parseData.cs - Program.cs - setCurrentConfig.cs - setToIdle.cs - startSampling.cs + Properties/AssemblyInfo.cs + getCurrentConfig.cs + parseData.cs + Program.cs + setCurrentConfig.cs + setToIdle.cs + startSampling.cs ) if(CMAKE_PROJECT_NAME STREQUAL "MSCL") - # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. - # If not building in the MSCL repo, this can be safely ignored or removed - set(MSCL_Managed_LIBRARIES MSCL_Managed) - set(MSCL_Managed_LIBRARY_PATH $) - set(MSCL_Managed_INTERFACE_LIBRARY_PATH $) + # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. + # If not building in the MSCL repo, this can be safely ignored or removed + set(MSCL_Managed_LIBRARIES MSCL_Managed) + set(MSCL_Managed_LIBRARY_PATH $) + set(MSCL_Managed_INTERFACE_LIBRARY_PATH $) else() - find_package(MSCL_Managed REQUIRED) + find_package(MSCL_Managed REQUIRED) endif() target_link_libraries(${PROJECT_NAME} ${MSCL_Managed_LIBRARIES}) # This seems like the only way to properly link the CSharp file to the project, wish we could do this in the Find script if(NOT CMAKE_PROJECT_NAME STREQUAL "MSCL") - set_target_properties(${PROJECT_NAME} PROPERTIES - VS_DOTNET_REFERENCE_MSCL_Managed "${MSCL_Managed_LIBRARY_PATH}") + set_target_properties(${PROJECT_NAME} PROPERTIES + VS_DOTNET_REFERENCE_MSCL_Managed "${MSCL_Managed_LIBRARY_PATH}") endif() # Copy the MSCL.dll file to the build directory for this binary add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_INTERFACE_LIBRARY_PATH} $ - VERBATIM + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_INTERFACE_LIBRARY_PATH} $ + VERBATIM ) # Copy the MSCL_Managed.dll file to the build directory for this binary add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_LIBRARY_PATH} $ - VERBATIM + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_LIBRARY_PATH} $ + VERBATIM ) diff --git a/MSCL_Examples/Displacement/MATLAB/parseData.m b/MSCL_Examples/Displacement/MATLAB/parseData.m deleted file mode 100644 index 8688fdb3e..000000000 --- a/MSCL_Examples/Displacement/MATLAB/parseData.m +++ /dev/null @@ -1,63 +0,0 @@ -function parseData_2016_01_19() - -% MSCL Example: ParseData -% This example shows how to parse incoming data from an Displacement Device. -% This example does not start a Node sampling. To receive data, a Node -% must be put into a sampling mode. - - -% import MSCL .NET library (make sure path is correct for your system) -msclInfo = NET.addAssembly('C:\Program Files\MATLAB\MSCL\MSCL_Managed.dll'); - - -%TODO: change these constants to match your setup - -COM_PORT = 'COM3'; - -try - % create a Serial Connection with the specified COM Port - connection = mscl.Connection.Serial(COM_PORT, 115200); - - % create an instance of MATLAB onCleanup class to gracefully disconnect from COM port when - % this object is cleared, for instance if matlab encounters an error - % before the connection is closed. - cleanupConnection = onCleanup(@()connection.disconnect); - - % create an DisplacementNode with the connection - node = mscl.DisplacementNode(connection); - - while true - try - % get all the data packets from the node, with a timeout of 500 milliseconds - packets = node.getDataPackets(500); - - % iterate over all the data packets received - for j = 1:packets.Count(), - - packet = packets.Item(j-1); - % print out the data - display('Packet received: '); - - % iterate over all the data points in the packet - for i = 1:packet.data().Count(), - dataPoint = packet.data().Item(i-1); - display(['dataPoint: ',num2str(dataPoint.as_float)]) % display dataPoint value as string - end - - end - - catch err - display(err.message) - clearvars cleanupConnnection % performs cleanup on connection - break % exits while loop upon error - end - end - -catch err - display(err.message) - clearvars cleanupConnnection % performs cleanup on connection -end - -end - - diff --git a/MSCL_Examples/Displacement/Python/getCurrentConfig.py b/MSCL_Examples/Displacement/Python/getCurrentConfig.py index f7c40208e..92daf05b5 100644 --- a/MSCL_Examples/Displacement/Python/getCurrentConfig.py +++ b/MSCL_Examples/Displacement/Python/getCurrentConfig.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Displacement/Python/parseData.py b/MSCL_Examples/Displacement/Python/parseData.py index 4ee1dde49..fd49b6b53 100644 --- a/MSCL_Examples/Displacement/Python/parseData.py +++ b/MSCL_Examples/Displacement/Python/parseData.py @@ -3,14 +3,16 @@ # This example does not start a Node sampling. To receive data, a Node # must be put into a sampling mode. # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Displacement/Python/setCurrentConfig.py b/MSCL_Examples/Displacement/Python/setCurrentConfig.py index d86ca35a6..29775aedf 100644 --- a/MSCL_Examples/Displacement/Python/setCurrentConfig.py +++ b/MSCL_Examples/Displacement/Python/setCurrentConfig.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Displacement/Python/setToIdle.py b/MSCL_Examples/Displacement/Python/setToIdle.py index 09c8360f7..912e0e99e 100644 --- a/MSCL_Examples/Displacement/Python/setToIdle.py +++ b/MSCL_Examples/Displacement/Python/setToIdle.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Displacement/Python/startSampling.py b/MSCL_Examples/Displacement/Python/startSampling.py index 8998c0de1..8d22c8387 100644 --- a/MSCL_Examples/Displacement/Python/startSampling.py +++ b/MSCL_Examples/Displacement/Python/startSampling.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Inertial/C++/MSCL_Inertial_Example_C++/MSCL_Inertial_Example_C++/CMakeLists.txt b/MSCL_Examples/Inertial/C++/MSCL_Inertial_Example_C++/MSCL_Inertial_Example_C++/CMakeLists.txt index 3594927ee..57e8881d5 100644 --- a/MSCL_Examples/Inertial/C++/MSCL_Inertial_Example_C++/MSCL_Inertial_Example_C++/CMakeLists.txt +++ b/MSCL_Examples/Inertial/C++/MSCL_Inertial_Example_C++/MSCL_Inertial_Example_C++/CMakeLists.txt @@ -8,19 +8,19 @@ add_executable(${PROJECT_NAME} main.cpp) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake") if(CMAKE_PROJECT_NAME STREQUAL "MSCL") - # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. - # If not building in the MSCL repo, this can be safely ignored or removed - set(MSCL_LIBRARY MSCL) - set(MSCL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../MSCL/source") - target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/MSCL/MSCL_Static/${CMAKE_CFG_INTDIR}) - add_dependencies(${PROJECT_NAME} MSCL_Static) + # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. + # If not building in the MSCL repo, this can be safely ignored or removed + set(MSCL_LIBRARY MSCL) + set(MSCL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../MSCL/source") + target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/MSCL/MSCL_Static/${CMAKE_CFG_INTDIR}) + add_dependencies(${PROJECT_NAME} MSCL_Static) endif() find_package(MSCL REQUIRED) target_include_directories(${PROJECT_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${MSCL_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${MSCL_INCLUDE_DIRS} ) target_link_libraries(${PROJECT_NAME} ${MSCL_LIBRARIES}) @@ -28,9 +28,9 @@ target_link_libraries(${PROJECT_NAME} ${MSCL_LIBRARIES}) target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB) if(MSVC) - # On windows, we need to set the runtime library to the same as MSCL - target_compile_options(${PROJECT_NAME} PRIVATE - /MT$<$:d> - /MP - ) + # On windows, we need to set the runtime library to the same as MSCL + target_compile_options(${PROJECT_NAME} PRIVATE + /MT$<$:d> + /MP + ) endif() diff --git a/MSCL_Examples/Inertial/CMakeLists.txt b/MSCL_Examples/Inertial/CMakeLists.txt index 754c78922..8bf827816 100644 --- a/MSCL_Examples/Inertial/CMakeLists.txt +++ b/MSCL_Examples/Inertial/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(C++/MSCL_Inertial_Example_C++/MSCL_Inertial_Example_C++) -if(BUILD_CSHARP) - add_subdirectory(CSharp/MSCL_Inertial_Example_CSharp/MSCL_Inertial_Example_CSharp) -endif() \ No newline at end of file + +if(MSCL_BUILD_CSHARP) + add_subdirectory(CSharp/MSCL_Inertial_Example_CSharp/MSCL_Inertial_Example_CSharp) +endif() diff --git a/MSCL_Examples/Inertial/CSharp/MSCL_Inertial_Example_CSharp/MSCL_Inertial_Example_CSharp/CMakeLists.txt b/MSCL_Examples/Inertial/CSharp/MSCL_Inertial_Example_CSharp/MSCL_Inertial_Example_CSharp/CMakeLists.txt index 174ed308a..04789af48 100644 --- a/MSCL_Examples/Inertial/CSharp/MSCL_Inertial_Example_CSharp/MSCL_Inertial_Example_CSharp/CMakeLists.txt +++ b/MSCL_Examples/Inertial/CSharp/MSCL_Inertial_Example_CSharp/MSCL_Inertial_Example_CSharp/CMakeLists.txt @@ -5,43 +5,43 @@ project(MSCL_Example_Inertial_CSharp LANGUAGES CSharp) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake") add_executable(${PROJECT_NAME} - Properties/AssemblyInfo.cs - getCurrentConfig.cs - parseData.cs - Program.cs - setCurrentConfig.cs - setToIdle.cs - startSampling.cs + Properties/AssemblyInfo.cs + getCurrentConfig.cs + parseData.cs + Program.cs + setCurrentConfig.cs + setToIdle.cs + startSampling.cs ) if(CMAKE_PROJECT_NAME STREQUAL "MSCL") - # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. - # If not building in the MSCL repo, this can be safely ignored or removed - set(MSCL_Managed_LIBRARIES MSCL_Managed) - set(MSCL_Managed_LIBRARY_PATH $) - set(MSCL_Managed_INTERFACE_LIBRARY_PATH $) + # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. + # If not building in the MSCL repo, this can be safely ignored or removed + set(MSCL_Managed_LIBRARIES MSCL_Managed) + set(MSCL_Managed_LIBRARY_PATH $) + set(MSCL_Managed_INTERFACE_LIBRARY_PATH $) else() - find_package(MSCL_Managed REQUIRED) + find_package(MSCL_Managed REQUIRED) endif() target_link_libraries(${PROJECT_NAME} ${MSCL_Managed_LIBRARIES}) # This seems like the only way to properly link the CSharp file to the project, wish we could do this in the Find script if(NOT CMAKE_PROJECT_NAME STREQUAL "MSCL") - set_target_properties(${PROJECT_NAME} PROPERTIES - VS_DOTNET_REFERENCE_MSCL_Managed "${MSCL_Managed_LIBRARY_PATH}") + set_target_properties(${PROJECT_NAME} PROPERTIES + VS_DOTNET_REFERENCE_MSCL_Managed "${MSCL_Managed_LIBRARY_PATH}") endif() # Copy the MSCL.dll file to the build directory for this binary add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_INTERFACE_LIBRARY_PATH} $ - VERBATIM + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_INTERFACE_LIBRARY_PATH} $ + VERBATIM ) # Copy the MSCL_Managed.dll file to the build directory for this binary add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_LIBRARY_PATH} $ - VERBATIM + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_LIBRARY_PATH} $ + VERBATIM ) diff --git a/MSCL_Examples/Inertial/MATLAB/parseData.m b/MSCL_Examples/Inertial/MATLAB/parseData.m deleted file mode 100644 index fe0f688ba..000000000 --- a/MSCL_Examples/Inertial/MATLAB/parseData.m +++ /dev/null @@ -1,68 +0,0 @@ -function parseData_2016_01_19() - -% MSCL Example: ParseData -% This example shows how to parse incoming data from an Inertial Device. -% This example does not start a Node sampling. To receive data, a Node -% must be put into a sampling mode. - - -% import MSCL .NET library (make sure path is correct for your system) -msclInfo = NET.addAssembly('C:\Program Files\MATLAB\MSCL\MSCL_Managed.dll'); - - -%TODO: change these constants to match your setup - -COM_PORT = 'COM3'; - -try - % create a Serial Connection with the specified COM Port, default baud rate of 921600 - connection = mscl.Connection.Serial(COM_PORT); - - % create an instance of MATLAB onCleanup class to gracefully disconnect from COM port when - % this object is cleared, for instance if matlab encounters an error - % before the connection is closed. - cleanupConnection = onCleanup(@()connection.disconnect); - - % create an InertialNode with the connection - node = mscl.InertialNode(connection); - - while true - try - % get all the data packets from the node, with a timeout of 500 milliseconds - packets = node.getDataPackets(500); - - % iterate over all the data packets received - for j = 1:packets.Count(), - - packet = packets.Item(j-1); - % print out the data - display('Packet received: '); - - % iterate over all the data points in the packet - for i = 1:packet.data().Count(), - dataPoint = packet.data().Item(i-1); - display(['dataPoint: ',num2str(dataPoint.as_float)]) % display dataPoint value as string - end - - %if the dataPoint is invalid - if dataPoint.valid() == false, - display('Invalid data point') - end - - end - - catch err - display(err.message) - clearvars cleanupConnnection % performs cleanup on connection - break % exits while loop upon error - end - end - -catch err - display(err.message) - clearvars cleanupConnnection % performs cleanup on connection -end - -end - - diff --git a/MSCL_Examples/Inertial/Python/getCurrentConfig.py b/MSCL_Examples/Inertial/Python/getCurrentConfig.py index a8cea0d9b..2c788d98a 100644 --- a/MSCL_Examples/Inertial/Python/getCurrentConfig.py +++ b/MSCL_Examples/Inertial/Python/getCurrentConfig.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Inertial/Python/parseData.py b/MSCL_Examples/Inertial/Python/parseData.py index 26af7fad3..eff75bc4e 100644 --- a/MSCL_Examples/Inertial/Python/parseData.py +++ b/MSCL_Examples/Inertial/Python/parseData.py @@ -3,14 +3,16 @@ # This example does not start a Node sampling. To receive data, a Node # must be put into a sampling mode. # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Inertial/Python/setCurrentConfig.py b/MSCL_Examples/Inertial/Python/setCurrentConfig.py index 530fb4725..001858445 100644 --- a/MSCL_Examples/Inertial/Python/setCurrentConfig.py +++ b/MSCL_Examples/Inertial/Python/setCurrentConfig.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Inertial/Python/setToIdle.py b/MSCL_Examples/Inertial/Python/setToIdle.py index 9ac0e0e3c..b5ca2fbb8 100644 --- a/MSCL_Examples/Inertial/Python/setToIdle.py +++ b/MSCL_Examples/Inertial/Python/setToIdle.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Inertial/Python/startSampling.py b/MSCL_Examples/Inertial/Python/startSampling.py index 7541ff33b..ca37c2f44 100644 --- a/MSCL_Examples/Inertial/Python/startSampling.py +++ b/MSCL_Examples/Inertial/Python/startSampling.py @@ -1,11 +1,13 @@ -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Wireless/C++/MSCL_Wireless_Example_C++/MSCL_Wireless_Example_C++/CMakeLists.txt b/MSCL_Examples/Wireless/C++/MSCL_Wireless_Example_C++/MSCL_Wireless_Example_C++/CMakeLists.txt index 47757bf1e..890dfe54e 100644 --- a/MSCL_Examples/Wireless/C++/MSCL_Wireless_Example_C++/MSCL_Wireless_Example_C++/CMakeLists.txt +++ b/MSCL_Examples/Wireless/C++/MSCL_Wireless_Example_C++/MSCL_Wireless_Example_C++/CMakeLists.txt @@ -8,19 +8,19 @@ add_executable(${PROJECT_NAME} main.cpp) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake") if(CMAKE_PROJECT_NAME STREQUAL "MSCL") - # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. - # If not building in the MSCL repo, this can be safely ignored or removed - set(MSCL_LIBRARY MSCL) - set(MSCL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../MSCL/source") - target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/MSCL/MSCL_Static/${CMAKE_CFG_INTDIR}) - add_dependencies(${PROJECT_NAME} MSCL_Static) + # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. + # If not building in the MSCL repo, this can be safely ignored or removed + set(MSCL_LIBRARY MSCL) + set(MSCL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../MSCL/source") + target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/MSCL/MSCL_Static/${CMAKE_CFG_INTDIR}) + add_dependencies(${PROJECT_NAME} MSCL_Static) endif() find_package(MSCL REQUIRED) target_include_directories(${PROJECT_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${MSCL_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${MSCL_INCLUDE_DIRS} ) target_link_libraries(${PROJECT_NAME} ${MSCL_LIBRARIES}) @@ -28,9 +28,9 @@ target_link_libraries(${PROJECT_NAME} ${MSCL_LIBRARIES}) target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB) if(MSVC) - # On windows, we need to set the runtime library to the same as MSCL - target_compile_options(${PROJECT_NAME} PRIVATE - /MT$<$:d> - /MP - ) + # On windows, we need to set the runtime library to the same as MSCL + target_compile_options(${PROJECT_NAME} PRIVATE + /MT$<$:d> + /MP + ) endif() diff --git a/MSCL_Examples/Wireless/CMakeLists.txt b/MSCL_Examples/Wireless/CMakeLists.txt index 07430e7ab..8a60f00ec 100644 --- a/MSCL_Examples/Wireless/CMakeLists.txt +++ b/MSCL_Examples/Wireless/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(C++/MSCL_Wireless_Example_C++/MSCL_Wireless_Example_C++) -if(BUILD_CSHARP) - add_subdirectory(CSharp/MSCL_Wireless_Example_CSharp/MSCL_Wireless_Example_CSharp) -endif() \ No newline at end of file + +if(MSCL_BUILD_CSHARP) + add_subdirectory(CSharp/MSCL_Wireless_Example_CSharp/MSCL_Wireless_Example_CSharp) +endif() diff --git a/MSCL_Examples/Wireless/CSharp/MSCL_Wireless_Example_CSharp/MSCL_Wireless_Example_CSharp/CmakeLists.txt b/MSCL_Examples/Wireless/CSharp/MSCL_Wireless_Example_CSharp/MSCL_Wireless_Example_CSharp/CmakeLists.txt index 8a278d1fd..4e0f52292 100644 --- a/MSCL_Examples/Wireless/CSharp/MSCL_Wireless_Example_CSharp/MSCL_Wireless_Example_CSharp/CmakeLists.txt +++ b/MSCL_Examples/Wireless/CSharp/MSCL_Wireless_Example_CSharp/MSCL_Wireless_Example_CSharp/CmakeLists.txt @@ -5,45 +5,45 @@ project(MSCL_Example_Wireless_CSharp LANGUAGES CSharp) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake") add_executable(${PROJECT_NAME} - Properties/AssemblyInfo.cs - enableDisableBeacon.cs - getCurrentConfig.cs - parseData.cs - pingNode.cs - Program.cs - setCurrentConfig.cs - setToIdle.cs - startSyncSampling.cs + Properties/AssemblyInfo.cs + enableDisableBeacon.cs + getCurrentConfig.cs + parseData.cs + pingNode.cs + Program.cs + setCurrentConfig.cs + setToIdle.cs + startSyncSampling.cs ) if(CMAKE_PROJECT_NAME STREQUAL "MSCL") - # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. - # If not building in the MSCL repo, this can be safely ignored or removed - set(MSCL_Managed_LIBRARIES MSCL_Managed) - set(MSCL_Managed_LIBRARY_PATH $) - set(MSCL_Managed_INTERFACE_LIBRARY_PATH $) + # NOTE: This section will only be called if this CMakeLists.txt is imported during the MSCL build. + # If not building in the MSCL repo, this can be safely ignored or removed + set(MSCL_Managed_LIBRARIES MSCL_Managed) + set(MSCL_Managed_LIBRARY_PATH $) + set(MSCL_Managed_INTERFACE_LIBRARY_PATH $) else() - find_package(MSCL_Managed REQUIRED) + find_package(MSCL_Managed REQUIRED) endif() target_link_libraries(${PROJECT_NAME} ${MSCL_Managed_LIBRARIES}) # This seems like the only way to properly link the CSharp file to the project, wish we could do this in the Find script if(NOT CMAKE_PROJECT_NAME STREQUAL "MSCL") - set_target_properties(${PROJECT_NAME} PROPERTIES - VS_DOTNET_REFERENCE_MSCL_Managed "${MSCL_Managed_LIBRARY_PATH}") + set_target_properties(${PROJECT_NAME} PROPERTIES + VS_DOTNET_REFERENCE_MSCL_Managed "${MSCL_Managed_LIBRARY_PATH}") endif() # Copy the MSCL.dll file to the build directory for this binary add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_INTERFACE_LIBRARY_PATH} $ - VERBATIM + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_INTERFACE_LIBRARY_PATH} $ + VERBATIM ) # Copy the MSCL_Managed.dll file to the build directory for this binary add_custom_command( - TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_LIBRARY_PATH} $ - VERBATIM + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${MSCL_Managed_LIBRARY_PATH} $ + VERBATIM ) diff --git a/MSCL_Examples/Wireless/Python/BaseStationBeacon.py b/MSCL_Examples/Wireless/Python/BaseStationBeacon.py index 0c9553c69..2953b5acf 100644 --- a/MSCL_Examples/Wireless/Python/BaseStationBeacon.py +++ b/MSCL_Examples/Wireless/Python/BaseStationBeacon.py @@ -2,14 +2,16 @@ # This example shows how to Enable and Disable the # beacon (used for Synchronized Sampling) on a base station # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Wireless/Python/ConfigureNode.py b/MSCL_Examples/Wireless/Python/ConfigureNode.py index f908667d7..36e828940 100644 --- a/MSCL_Examples/Wireless/Python/ConfigureNode.py +++ b/MSCL_Examples/Wireless/Python/ConfigureNode.py @@ -2,14 +2,16 @@ # This example shows how to get and set the configuration options for a Wireless Node. # Warning: Running this example will change the configuration on the Wireless Node. # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Wireless/Python/NodePing.py b/MSCL_Examples/Wireless/Python/NodePing.py index 3f3ec1e3c..593af03f6 100644 --- a/MSCL_Examples/Wireless/Python/NodePing.py +++ b/MSCL_Examples/Wireless/Python/NodePing.py @@ -2,14 +2,16 @@ # This examples shows how to open a connection with a Base Station, # ping a Node, and get the result and its information # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl @@ -42,4 +44,4 @@ print("Failed to ping Node", NODE_ADDRESS) except Exception as e: - print("Error:", e ) + print("Error:", e) diff --git a/MSCL_Examples/Wireless/Python/ParseData.py b/MSCL_Examples/Wireless/Python/ParseData.py index f517028fa..042277ac3 100644 --- a/MSCL_Examples/Wireless/Python/ParseData.py +++ b/MSCL_Examples/Wireless/Python/ParseData.py @@ -3,14 +3,16 @@ # This example does not start a Node sampling. To receive data, a Node # must be put into a sampling mode (Sync Sampling, Low Duty Cycle, etc.) # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl diff --git a/MSCL_Examples/Wireless/Python/StopNode.py b/MSCL_Examples/Wireless/Python/StopNode.py index ca1594204..ea153e7b8 100644 --- a/MSCL_Examples/Wireless/Python/StopNode.py +++ b/MSCL_Examples/Wireless/Python/StopNode.py @@ -4,14 +4,16 @@ # idle state so that it can be communicated with. # Note: Stopping a Node may take up to a maximum of 2 minutes. # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl @@ -57,4 +59,4 @@ print("Set to Idle has failed!") except Exception as e: - print("Error:", e ) + print("Error:", e) diff --git a/MSCL_Examples/Wireless/Python/SynchronizedSampling.py b/MSCL_Examples/Wireless/Python/SynchronizedSampling.py index 65e1c003a..674bd667d 100644 --- a/MSCL_Examples/Wireless/Python/SynchronizedSampling.py +++ b/MSCL_Examples/Wireless/Python/SynchronizedSampling.py @@ -1,14 +1,16 @@ # MSCL Example: SynchronizedSampling # This example shows how to create and start a Synchronized Sampling network. # -# Updated: 2/21/2024 +# Updated: 12/18/2024 import sys +import os # TODO: change this path to match your setup # import the mscl library. -arch = sys.maxsize > 2**32 and "x64" or "x32" -sys.path.append("../../../Output/Python{sys.version_info.major}.{sys.version_info.minor}/{arch}/Release") +arch = sys.maxsize > 2 ** 32 and "x64" or "x32" +sys.path.append(os.path.abspath("{}/../../../Output/Python/{}.{}/{}/Release".format(os.path.dirname(os.path.realpath(__file__)), + sys.version_info.major, sys.version_info.minor, arch))) import mscl @@ -69,4 +71,4 @@ # ======================================================================================= except Exception as e: - print("Error:", e ) + print("Error:", e) diff --git a/README.md b/README.md index b495c13ef..cd561c89f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,8 @@ MSCL is developed by [MicroStrain](https://microstrain.com) in Williston, VT. It was created to make it simple to interact with our [Wireless](https://www.microstrain.com/wireless), and [Inertial](https://www.microstrain.com/inertial) sensors. -| Stable | Development | -|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| [![GitHub tag status](https://img.shields.io/github/checks-status/LORD-MicroStrain/MSCL/v66.0.0?label=v66.0.0)](https://github.com/LORD-MicroStrain/MSCL/releases/v66.0.0/) | [![GitHub tag status](https://img.shields.io/github/checks-status/LORD-MicroStrain/MSCL/latest?label=latest)](https://github.com/LORD-MicroStrain/MSCL/releases/latest/) | +[![GitHub tag status](https://img.shields.io/github/checks-status/LORD-MicroStrain/MSCL/v67.0.0?label=v67.0.0)](https://github.com/LORD-MicroStrain/MSCL/releases/v67.0.0/)   +[![GitHub tag status](https://img.shields.io/github/checks-status/LORD-MicroStrain/MSCL/latest?label=latest)](https://github.com/LORD-MicroStrain/MSCL/releases/latest/) ### Support/Issues @@ -23,11 +22,14 @@ For projects using our inertial product lines check out our new lightweight C/C+ Release notes and all downloadable assets can be found on our [releases page](https://github.com/LORD-MicroStrain/MSCL/releases) or from the links below. -[Offline Documentation](https://github.com/LORD-MicroStrain/MSCL/releases/download/v66.0.0/MSCL_Documentation.zip) | -[Offline Example Code](https://github.com/LORD-MicroStrain/MSCL/releases/download/v66.0.0/MSCL_Examples.zip) +[Offline Documentation](https://github.com/LORD-MicroStrain/MSCL/releases/download/v67.0.0/MSCL_Documentation_v67.0.0.zip)
+[Offline Example Code](https://github.com/LORD-MicroStrain/MSCL/releases/download/v67.0.0/MSCL_Examples_v67.0.0.zip) +Please see our [releases](https://github.com/LORD-MicroStrain/MSCL/releases) page for all of our release notes and packages.
+Packages for the current release, v67.0.0, can be found [here](https://github.com/LORD-MicroStrain/MSCL/releases/tag/v67.0.0)
+Latest pre-release packages can be found [here](https://github.com/LORD-MicroStrain/MSCL/releases/tag/latest)
-## Pre-built Binaries/Packages +## Supported Pre-Built Binaries/Packages ### Windows: @@ -42,42 +44,42 @@ links below. C++ - C++ Shared (.dll) x64 - C++ Shared (.dll) x86 + C++ Shared (.dll) x64 + C++ Shared (.dll) x86 - C++ Static (.lib) x64 - C++ Static (.lib) x86 + C++ Static (.lib) x64 + C++ Static (.lib) x86 Python - Python 2.7 x64 - Python 2.7 x86 + Python 2.7 x64 + Python 2.7 x86 - Python 3.7 x64 - Python 3.7 x86 + Python 3.9 x64 + Python 3.9 x86 - Python 3.8 x64 - Python 3.8 x86 + Python 3.10 x64 + Python 3.10 x86 - Python 3.9 x64 - Python 3.9 x86 + Python 3.11 x64 + Python 3.11 x86 - Python 3.10 x64 - Python 3.10 x86 + Python 3.12 x64 + Python 3.12 x86 - Python 3.11 x64 - Python 3.11 x86 + Python 3.13 x64 + Python 3.13 x86 .NET - .NET x64 - .NET x86 + .NET x64 + .NET x86 @@ -96,45 +98,45 @@ links below. C++ - C++ Shared (.so) x64 - C++ Shared (.so) arm64 - C++ Shared (.so) armhf + C++ Shared (.so) x64 + C++ Shared (.so) arm64 + C++ Shared (.so) armhf - C++ Static (.a) x64 - C++ Static (.a) arm64 - C++ Static (.a) armhf + C++ Static (.a) x64 + C++ Static (.a) arm64 + C++ Static (.a) armhf Python - Python 2.7 x64 - Python 2.7 arm64 - Python 2.7 armhf + Python 2.7 x64 + Python 2.7 arm64 + Python 2.7 armhf - Python 3.7 x64 - Python 3.7 arm64 - Python 3.7 armhf + Python 3.9 x64 + Python 3.9 arm64 + Python 3.9 armhf - Python 3.8 x64 - Python 3.8 arm64 - Python 3.8 armhf + Python 3.10 x64 + Python 3.10 arm64 + Python 3.10 armhf - Python 3.9 x64 - Python 3.9 arm64 - Python 3.9 armhf + Python 3.11 x64 + Python 3.11 arm64 + Python 3.11 armhf - Python 3.10 x64 - Python 3.10 arm64 - Python 3.10 armhf + Python 3.12 x64 + Python 3.12 arm64 + Python 3.12 armhf - Python 3.11 x64 - Python 3.11 arm64 - Python 3.11 armhf + Python 3.13 x64 + Python 3.13 arm64 + Python 3.13 armhf @@ -147,23 +149,15 @@ from source. If the pre-built packages aren't available on your platform, you can build MSCL from source. -Instructions can be found here: -[Building MSCL on Windows](BuildScripts/buildReadme_Windows.md) | +Instructions can be found here:
+[Building MSCL on Windows](BuildScripts/buildReadme_Windows.md)
[Building MSCL on Linux](BuildScripts/buildReadme_Linux.md) --- ### Documentation -[How to use MSCL](HowToUseMSCL.md) - -[Quick Start Guide](https://lord-microstrain.github.io/MSCL/Documentation/Getting%20Started/index.html) - -[Public Documentation](https://lord-microstrain.github.io/MSCL/Documentation/MSCL%20API%20Documentation/index.html) - Documentation for all the public -functionality of MSCL. - -[Full Documentation](https://lord-microstrain.github.io/MSCL/Documentation/MSCL%20Documentation/index.html) - Full Documentation of everything in MSCL -(useful when editing the source). +MSCL documentation can now be found [here](https://github.com/LORD-MicroStrain/MSCL_documentation) [Example Code](MSCL_Examples) diff --git a/MSCL/source/mscl/Wrapper/CSharp/Properties/AssemblyInfo.cs b/cmake/AssemblyInfo.cs.in similarity index 80% rename from MSCL/source/mscl/Wrapper/CSharp/Properties/AssemblyInfo.cs rename to cmake/AssemblyInfo.cs.in index 0c4fc149a..8f95d491f 100644 --- a/MSCL/source/mscl/Wrapper/CSharp/Properties/AssemblyInfo.cs +++ b/cmake/AssemblyInfo.cs.in @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MicroStrain by HBK")] [assembly: AssemblyProduct("MSCL")] -[assembly: AssemblyCopyright("Copyright © 2024 MicroStrain by HBK")] +[assembly: AssemblyCopyright("Copyright © ${MSCL_CURRENT_YEAR} MicroStrain by HBK")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,6 +32,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // -//update with each release -[assembly: AssemblyVersion("66.0.0.0")] -[assembly: AssemblyFileVersion("66.0.0.0")] +[assembly: AssemblyVersion("${MSCL_GIT_VERSION_MAJOR}.${MSCL_GIT_VERSION_MINOR}.${MSCL_GIT_VERSION_PATCH}.0")] +[assembly: AssemblyFileVersion("${MSCL_GIT_VERSION_MAJOR}.${MSCL_GIT_VERSION_MINOR}.${MSCL_GIT_VERSION_PATCH}.0")] diff --git a/cmake/FindMSCL.cmake b/cmake/FindMSCL.cmake index 91dee71da..ea07c1c47 100644 --- a/cmake/FindMSCL.cmake +++ b/cmake/FindMSCL.cmake @@ -1,4 +1,4 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. #[=======================================================================[.rst: @@ -13,7 +13,7 @@ Imported Targets This module provides the following imported targets, if found: ``MSCL::MSCL`` - The MSCL library + The MSCL library Result Variables ^^^^^^^^^^^^^^^^ @@ -21,11 +21,11 @@ Result Variables This will define the following variables: ``MSCL_FOUND`` - True if the system has the MSCL library. + True if the system has the MSCL library. ``MSCL_INCLUDE_DIRS`` - Include directories needed to use MSCL. + Include directories needed to use MSCL. ``MSCL_LIBRARIES`` - Libraries needed to link to MSCL. + Libraries needed to link to MSCL. Cache Variables ^^^^^^^^^^^^^^^ @@ -33,39 +33,45 @@ Cache Variables The following cache variables may also be set: ``MSCL_ROOT_DIR`` - The directory containing the ``include`` directory and ``lib`` directory + The directory containing the ``include`` directory and ``lib`` directory ``MSCL_INCLUDE_DIR`` - The directory containing ``mscl.h``. + The directory containing ``mscl.h``. ``MSCL_LIBRARY`` - The path to the MSCL library. + The path to the MSCL library. #]=======================================================================] # This variable can be overridden to point to a different location where MSCL is installed if(NOT DEFINED MSCL_ROOT_DIR) - set(MSCL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/MSCL" CACHE STRING "Directory to search for MSCL") + set(MSCL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/MSCL" CACHE STRING "Directory to search for MSCL") endif() # The following directories are the common additional places to search for MSCL set(_MSCL_ROOT_DIRS - ${CMAKE_CURRENT_LIST_DIR}/.. - ${MSCL_ROOT_DIR} + ${CMAKE_CURRENT_LIST_DIR}/.. + ${MSCL_ROOT_DIR} ) foreach(_MSCL_ROOT_DIR IN LISTS _MSCL_ROOT_DIRS) - list(APPEND _MSCL_INCLUDE_DIRS "${_MSCL_ROOT_DIR}/include") - list(APPEND _MSCL_LIBRARY_DIRS "${_MSCL_ROOT_DIR}/lib") + list(APPEND _MSCL_INCLUDE_DIRS "${_MSCL_ROOT_DIR}/include") + list(APPEND _MSCL_LIBRARY_DIRS "${_MSCL_ROOT_DIR}/lib") endforeach() # Find the MSCL library and include directory find_path(MSCL_INCLUDE_DIR - NAMES mscl/mscl.h - PATHS ${_MSCL_INCLUDE_DIRS} + NAMES mscl/mscl.h + PATHS ${_MSCL_INCLUDE_DIRS} ) find_library(MSCL_LIBRARY - NAMES MSCL mscl - PATHS ${_MSCL_LIBRARY_DIRS} + NAMES MSCL mscl + PATHS ${_MSCL_LIBRARY_DIRS} ) +# Disable CMake policy for Boost config find_package +# CMake 3.30+ uses Boost Config for Boost 1.70+ +if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) +endif() + # Also find the dependencies for MSCL set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) @@ -79,7 +85,7 @@ set(MSCL_OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES}) # If linking on Windows, we will also need the windows crypto library if(WIN32) - list(APPEND MSCL_OPENSSL_LIBRARIES CRYPT32.lib) + list(APPEND MSCL_OPENSSL_LIBRARIES CRYPT32.lib) endif() # Find the threading library @@ -88,11 +94,11 @@ find_package(Threads REQUIRED) # Hand the rest off to find_package include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MSCL - FOUND_VAR MSCL_FOUND - REQUIRED_VARS - MSCL_LIBRARY - MSCL_INCLUDE_DIR - VERSION_VAR MSCL_VERSION + FOUND_VAR MSCL_FOUND + REQUIRED_VARS + MSCL_LIBRARY + MSCL_INCLUDE_DIR + VERSION_VAR MSCL_VERSION ) # Append the dependencies to the list of MSCL libraries @@ -103,15 +109,15 @@ list(APPEND MSCL_LIBRARIES ${MSCL_LIBRARY} ${Boost_LIBRARIES} ${MSCL_OPENSSL_LIB # If on linux, we also need to link against libdl if(UNIX) - list(APPEND MSCL_LIBRARIES dl) - - # Determine the flavor of linux we are running on, as different flavors require different libraries - execute_process( - COMMAND ${CMAKE_COMMAND} -E env bash -c "awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"'" - COMMAND_ERROR_IS_FATAL ANY - OUTPUT_VARIABLE _MSCL_LINUX_FLAVOR - ) - if("${_MSCL_LINUX_FLAVOR}" STREQUAL "centos") - list(APPEND MSCL_LIBRARIES z krb5 k5crypto) - endif() + list(APPEND MSCL_LIBRARIES dl) + + # Determine the flavor of linux we are running on, as different flavors require different libraries + execute_process( + COMMAND ${CMAKE_COMMAND} -E env bash -c "awk -F= '/^ID=/{print $2}' /etc/os-release |tr -d '\n' | tr -d '\"'" + COMMAND_ERROR_IS_FATAL ANY + OUTPUT_VARIABLE _MSCL_LINUX_FLAVOR + ) + if("${_MSCL_LINUX_FLAVOR}" STREQUAL "centos") + list(APPEND MSCL_LIBRARIES z krb5 k5crypto) + endif() endif() diff --git a/cmake/FindMSCL_Managed.cmake b/cmake/FindMSCL_Managed.cmake index 219ebdd8d..9b7bdae46 100644 --- a/cmake/FindMSCL_Managed.cmake +++ b/cmake/FindMSCL_Managed.cmake @@ -1,4 +1,4 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. #[=======================================================================[.rst: @@ -13,7 +13,7 @@ Imported Targets This module provides the following imported targets, if found: ``MSCL_Managed::MSCL_Managed`` - The MSCL_Managed library + The MSCL_Managed library Result Variables ^^^^^^^^^^^^^^^^ @@ -21,9 +21,9 @@ Result Variables This will define the following variables: ``MSCL_Managed_FOUND`` - True if the system has the MSCL library. + True if the system has the MSCL library. ``MSCL_Managed_LIBRARIES`` - Libraries needed to link to MSCL. + Libraries needed to link to MSCL. Cache Variables ^^^^^^^^^^^^^^^ @@ -31,67 +31,67 @@ Cache Variables The following cache variables may also be set: ``MSCL_Managed_ROOT_DIR`` - The directory containing the ``MSCL_Managed.dll`` and ``MSCL.dll`` files + The directory containing the ``MSCL_Managed.dll`` and ``MSCL.dll`` files #]=======================================================================] # This variable can be overridden to point to a different location where MSCL is installed if(NOT DEFINED MSCL_Managed_ROOT_DIR) - set(MSCL_Managed_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/MSCL_Managed" CACHE STRING "Directory to search for MSCL Managed") + set(MSCL_Managed_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/MSCL_Managed" CACHE STRING "Directory to search for MSCL Managed") endif() # Default to x64 if no platform is set if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32") - set(_MSCL_Managed_MSVC_ARCH_SUFFIX "x86") + set(_MSCL_Managed_MSVC_ARCH_SUFFIX "x86") else() - set(_MSCL_Managed_MSVC_ARCH_SUFFIX "x64") + set(_MSCL_Managed_MSVC_ARCH_SUFFIX "x64") endif() # The following directories are the common additional places to search for MSCL Managed set(_MSCL_DEBUG_ROOT_DIRS - "${CMAKE_CURRENT_LIST_DIR}/.." - "${CMAKE_CURRENT_LIST_DIR}/../Output/DotNet/${_MSCL_Managed_MSVC_ARCH_SUFFIX}/Debug/MSCL_Managed" - "${MSCL_Managed_ROOT_DIR}" + "${CMAKE_CURRENT_LIST_DIR}/.." + "${CMAKE_CURRENT_LIST_DIR}/../Output/DotNet/${_MSCL_Managed_MSVC_ARCH_SUFFIX}/Debug/MSCL_Managed" + "${MSCL_Managed_ROOT_DIR}" ) set(_MSCL_RELEASE_ROOT_DIRS - "${CMAKE_CURRENT_LIST_DIR}/.." - "${CMAKE_CURRENT_LIST_DIR}/../Output/DotNet/${_MSCL_Managed_MSVC_ARCH_SUFFIX}/Release/MSCL_Managed" - "${MSCL_Managed_ROOT_DIR}" + "${CMAKE_CURRENT_LIST_DIR}/.." + "${CMAKE_CURRENT_LIST_DIR}/../Output/DotNet/${_MSCL_Managed_MSVC_ARCH_SUFFIX}/Release/MSCL_Managed" + "${MSCL_Managed_ROOT_DIR}" ) # Find the MSCL Managed library and include directory find_file(MSCL_Managed_RELEASE_LIBRARY_PATH - NAMES MSCL_Managed.dll - PATHS ${_MSCL_RELEASE_ROOT_DIRS} + NAMES MSCL_Managed.dll + PATHS ${_MSCL_RELEASE_ROOT_DIRS} ) find_file(MSCL_Managed_DEBUG_LIBRARY_PATH - NAMES MSCL_Managed.dll - PATHS ${_MSCL_DEBUG_ROOT_DIRS} + NAMES MSCL_Managed.dll + PATHS ${_MSCL_DEBUG_ROOT_DIRS} ) # Find the MSCL library and include directory find_file(MSCL_Managed_RELEASE_INTERFACE_LIBRARY_PATH - NAMES MSCL.dll - PATHS ${_MSCL_RELEASE_ROOT_DIRS} + NAMES MSCL.dll + PATHS ${_MSCL_RELEASE_ROOT_DIRS} ) find_file(MSCL_Managed_DEBUG_INTERFACE_LIBRARY_PATH - NAMES MSCL.dll - PATHS ${_MSCL_DEBUG_ROOT_DIRS} + NAMES MSCL.dll + PATHS ${_MSCL_DEBUG_ROOT_DIRS} ) # Default to release versions of MSCL Managed if(EXISTS ${MSCL_Managed_RELEASE_LIBRARY_PATH}) - set(MSCL_Managed_LIBRARY_PATH ${MSCL_Managed_RELEASE_LIBRARY_PATH}) + set(MSCL_Managed_LIBRARY_PATH ${MSCL_Managed_RELEASE_LIBRARY_PATH}) elseif(EXISTS ${MSCL_Managed_DEBUG_LIBRARY_PATH}) - set(MSCL_Managed_LIBRARY_PATH ${MSCL_Managed_DEBUG_LIBRARY_PATH}) + set(MSCL_Managed_LIBRARY_PATH ${MSCL_Managed_DEBUG_LIBRARY_PATH}) endif() # Default to release versions of MSCL if(EXISTS ${MSCL_Managed_RELEASE_INTERFACE_LIBRARY_PATH}) - set(MSCL_Managed_INTERFACE_LIBRARY_PATH ${MSCL_Managed_RELEASE_INTERFACE_LIBRARY_PATH}) + set(MSCL_Managed_INTERFACE_LIBRARY_PATH ${MSCL_Managed_RELEASE_INTERFACE_LIBRARY_PATH}) elseif(EXISTS ${MSCL_Managed_DEBUG_INTERFACE_LIBRARY_PATH}) - set(MSCL_Managed_INTERFACE_LIBRARY_PATH ${MSCL_Managed_DEBUG_INTERFACE_LIBRARY_PATH}) + set(MSCL_Managed_INTERFACE_LIBRARY_PATH ${MSCL_Managed_DEBUG_INTERFACE_LIBRARY_PATH}) endif() set(MSCL_Managed_LIBRARY MSCL_Managed) @@ -99,12 +99,12 @@ set(MSCL_Managed_LIBRARY MSCL_Managed) # Hand the rest off to find_package include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MSCL_Managed - FOUND_VAR MSCL_Managed_FOUND - REQUIRED_VARS - MSCL_Managed_LIBRARY - MSCL_Managed_LIBRARY_PATH - MSCL_Managed_INTERFACE_LIBRARY_PATH - VERSION_VAR MSCL_Managed_VERSION + FOUND_VAR MSCL_Managed_FOUND + REQUIRED_VARS + MSCL_Managed_LIBRARY + MSCL_Managed_LIBRARY_PATH + MSCL_Managed_INTERFACE_LIBRARY_PATH + VERSION_VAR MSCL_Managed_VERSION ) # Append the dependencies to the list of MSCL libraries diff --git a/MSCL/source/mscl/LibVersion.h b/cmake/LibVersion.h.in similarity index 65% rename from MSCL/source/mscl/LibVersion.h rename to cmake/LibVersion.h.in index dd96726a8..3fff97650 100644 --- a/MSCL/source/mscl/LibVersion.h +++ b/cmake/LibVersion.h.in @@ -1,23 +1,22 @@ /***************************************************************************************** -** Copyright(c) 2015-2024 MicroStrain by HBK. All rights reserved. ** +** Copyright(c) 2015-${MSCL_CURRENT_YEAR} MicroStrain by HBK. All rights reserved. ** ** ** ** MIT Licensed. See the included LICENSE file for a copy of the full MIT License. ** *****************************************************************************************/ #pragma once -#include "Version.h" +#include "mscl/Version.h" #ifndef SWIG -//update with each release -#define MSCL_MAJOR 66 -#define MSCL_MINOR 0 -#define MSCL_PATCH 0 -#endif +#define MSCL_MAJOR ${MSCL_GIT_VERSION_MAJOR} +#define MSCL_MINOR ${MSCL_GIT_VERSION_MINOR} +#define MSCL_PATCH ${MSCL_GIT_VERSION_PATCH} +#endif // !SWIG namespace mscl { //API Variable: MSCL_VERSION // Gets the of MSCL. static const Version MSCL_VERSION = Version(MSCL_MAJOR, MSCL_MINOR, MSCL_PATCH); -} +} // namespace mscl diff --git a/cmake/microstrain_utilities.cmake b/cmake/microstrain_utilities.cmake new file mode 100644 index 000000000..e568021c6 --- /dev/null +++ b/cmake/microstrain_utilities.cmake @@ -0,0 +1,129 @@ +# +# Utility macros to write to output variables +# Do not call these in the conventional way I.E. macro_name(${VARIABLE_NAME}) +# Instead, do macro_name(VARIABLE_NAME) which will do `set(${PARAM_OUT} value)` and is equivalent to set(VARIABLE_NAME value) +# + +macro(microstrain_get_git_version GIT_VERSION_OUT GIT_VERSION_CLEAN_OUT) + # Use Git to find the version + find_package(Git) + + set(MICROSTRAIN_DEFAULT_GIT_VERSION "v${PROJECT_VERSION}") + + if(NOT GIT_FOUND) + message(WARNING "Unable to find Git, defaulting to version ${MICROSTRAIN_DEFAULT_GIT_VERSION}") + set(${GIT_VERSION_OUT} ${MICROSTRAIN_DEFAULT_GIT_VERSION}) + else() + # Find the latest semantic version tag I.E. 'v1.0.0' not 'latest' + execute_process( + COMMAND ${CMAKE_COMMAND} -E env ${GIT_EXECUTABLE} describe --tags --match "v*" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE MICROSTRAIN_GIT_VERSION_OUT + ERROR_VARIABLE MICROSTRAIN_GIT_VERSION_ERR + RESULT_VARIABLE MICROSTRAIN_GIT_VERSION_RET + ) + if(NOT ${MICROSTRAIN_GIT_VERSION_RET} EQUAL 0) + message(STATUS "Unable to determine version from Git, defaulting to version ${MICROSTRAIN_DEFAULT_GIT_VERSION}") + set(${GIT_VERSION_OUT} ${MICROSTRAIN_DEFAULT_GIT_VERSION}) + else() + if("${MICROSTRAIN_GIT_VERSION_OUT}" MATCHES "^v.+") + set(${GIT_VERSION_OUT} ${MICROSTRAIN_GIT_VERSION_OUT}) + else() + message(STATUS "Unable to determine semantic version from Git, defaulting to version ${MICROSTRAIN_DEFAULT_GIT_VERSION}") + set(${GIT_VERSION_OUT} ${MICROSTRAIN_DEFAULT_GIT_VERSION}) + endif() + string(REGEX REPLACE "\n" "" ${GIT_VERSION_OUT} "${${GIT_VERSION_OUT}}") + message(STATUS "Determined version from Git: ${${GIT_VERSION_OUT}}") + endif() + endif() + + + # Massage the version number a little so we can use it in a couple places + string(REGEX REPLACE "^v?([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1.\\2.\\3" ${GIT_VERSION_CLEAN_OUT} ${${GIT_VERSION_OUT}}) +endmacro() + +# Use the variable name not value for GIT_VERSION_CLEAN to lookup the version and also set it +# This is a followup macro for microstrain_get_git_version +# I.E. microstrain_extract_git_version(MICROSTRAIN_GIT_VERSION_CLEAN MICROSTRAIN_GIT_VERSION_MAJOR ...) +macro(microstrain_extract_git_version GIT_VERSION_CLEAN GIT_VERSION_MAJOR_OUT GIT_VERSION_MINOR_OUT GIT_VERSION_PATCH_OUT) + if(NOT DEFINED ${GIT_VERSION_CLEAN}) + message(WARNING "Use the name to use for the variable GIT_VERSION_CLEAN instead of passing the value") + endif() + + string(REPLACE "." ";" MICROSTRAIN_GIT_VERSION_LIST ${${GIT_VERSION_CLEAN}}) + list(LENGTH MICROSTRAIN_GIT_VERSION_LIST MICROSTRAIN_GIT_VERSION_LIST_LENGTH) + + if(MICROSTRAIN_GIT_VERSION_LIST_LENGTH GREATER_EQUAL 3) + list(GET MICROSTRAIN_GIT_VERSION_LIST 0 ${GIT_VERSION_MAJOR_OUT}) + list(GET MICROSTRAIN_GIT_VERSION_LIST 1 ${GIT_VERSION_MINOR_OUT}) + list(GET MICROSTRAIN_GIT_VERSION_LIST 2 ${GIT_VERSION_PATCH_OUT}) + else() + message(WARNING "Version cannot be parsed into a semantic version string.\nPlease run 'git fetch --tags' to get a properly tagged build") + set(${GIT_VERSION_CLEAN} "0.0.0") + set(${GIT_VERSION_MAJOR_OUT} 0) + set(${GIT_VERSION_MINOR_OUT} 0) + set(${GIT_VERSION_PATCH_OUT} 0) + endif() +endmacro() + +# Try to determine what architecture we are building for based on the compiler output +# Specify the variable to set as the parameter +macro(microstrain_get_architecture SYS_ARCH_OUT) + # Detect if this is a x64 or x86 build + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(${SYS_ARCH_OUT} "x64") + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(${SYS_ARCH_OUT} "x86") + endif() + + if(NOT DEFINED ${SYS_ARCH_OUT}) + message(STATUS "Defaulting ${SYS_ARCH_OUT} to ${CMAKE_SYSTEM_PROCESSOR}") + set(${SYS_ARCH_OUT} ${CMAKE_SYSTEM_PROCESSOR}) + else() + message(STATUS "Detected system architecture ${${SYS_ARCH_OUT}}") + endif() +endmacro() + +macro(microstrain_add_archive_component COMPONENT_NAME FILE_NAME_PREFIX FILE_NAME FILE_NAME_SUFFIX) + list(APPEND CPACK_COMPONENTS_ALL ${COMPONENT_NAME}) + set(CPACK_ARCHIVE_${COMPONENT_NAME}_FILE_NAME "${FILE_NAME_PREFIX}_${FILE_NAME}_${FILE_NAME_SUFFIX}") + set(CPACK_DEBIAN_${COMPONENT_NAME}_FILE_NAME "${FILE_NAME_PREFIX}_${FILE_NAME}_${FILE_NAME_SUFFIX}.deb") + set(CPACK_RPM_${COMPONENT_NAME}_FILE_NAME "${FILE_NAME_PREFIX}_${FILE_NAME}_${FILE_NAME_SUFFIX}.rpm") +endmacro() + +macro(microstrain_get_git_branch GIT_BRANCH_OUT USER_CACHE_BRANCH) + set(MICROSTRAIN_DEFAULT_GIT_BRANCH "unknown") + set(${USER_CACHE_BRANCH} "${MICROSTRAIN_DEFAULT_GIT_BRANCH}" CACHE STRING "Branch that this build is happening on") + + if("${${USER_CACHE_BRANCH}}" STREQUAL "${MICROSTRAIN_DEFAULT_GIT_BRANCH}") + # Use Git to find the version + if(NOT GIT_FOUND) + find_package(Git) + endif() + + if(NOT GIT_FOUND) + message(STATUS "Unable to determine branch from Git, defaulting to ${MICROSTRAIN_DEFAULT_GIT_BRANCH}") + set(${GIT_BRANCH_OUT} ${MICROSTRAIN_DEFAULT_GIT_BRANCH}) + else() + execute_process( + COMMAND ${CMAKE_COMMAND} -E env ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE MICROSTRAIN_GIT_BRANCH_OUT + ERROR_VARIABLE MICROSTRAIN_GIT_BRANCH_ERR + RESULT_VARIABLE MICROSTRAIN_GIT_BRANCH_RET + ) + + if(NOT ${MICROSTRAIN_GIT_BRANCH_RET} EQUAL 0) + message(STATUS "Unable to determine branch from Git, defaulting to ${MICROSTRAIN_DEFAULT_GIT_BRANCH}") + set(${GIT_BRANCH_OUT} ${MICROSTRAIN_DEFAULT_GIT_BRANCH}) + else() + set(${GIT_BRANCH_OUT} ${MICROSTRAIN_GIT_BRANCH_OUT}) + string(REGEX REPLACE "\n" "" ${GIT_BRANCH_OUT} "${MICROSTRAIN_GIT_BRANCH_OUT}") + message(STATUS "Determined branch from Git: ${${GIT_BRANCH_OUT}}") + endif() + endif() + else() + set(${GIT_BRANCH_OUT} "${${USER_CACHE_BRANCH}}") + message(STATUS "Using user defined Git branch: ${${GIT_BRANCH_OUT}}") + endif() +endmacro() diff --git a/cmake/mscl_python_swig.cmake b/cmake/mscl_python_swig.cmake index f639bd4b8..593aac7af 100644 --- a/cmake/mscl_python_swig.cmake +++ b/cmake/mscl_python_swig.cmake @@ -1,89 +1,94 @@ include(CMakeParseArguments) -function(mscl_python_swig) - set(single_value_args MODULE_NAME MODULE_VERSION OUTPUT_NAME OUTPUT_DIR PYTHON_VERSION ARCH) - set(multi_value_args SOURCES SWIG_FLAGS COMPILE_OPTIONS COMPILE_DEFINITIONS INCLUDE_DIRECTORIES LINK_DIRECTORIES LINK_OPTIONS LINK_LIBRARIES) - cmake_parse_arguments( - mscl_python_swig - "" - "${single_value_args}" - "${multi_value_args}" - ${ARGN} - ) - - # Generate the python and interface file - set(OUTFILE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Python) - set(OUTFILE_TARGET ${mscl_python_swig_OUTPUT_NAME}_PYTHON_SWIG) - set(PYTHON_INTERFACE_FILE ${OUTFILE_DIR}/${mscl_python_swig_OUTPUT_NAME}.py) - set(CPP_INTERFACE_FILE ${OUTFILE_DIR}/${mscl_python_swig_OUTPUT_NAME}_Main_InterfacePYTHON_wrap.cxx) - if(NOT TARGET ${OUTFILE_TARGET}) - set(mscl_python_swig_COMPILE_DEFINITIONS_SWIG ${mscl_python_swig_COMPILE_DEFINITIONS}) - list(TRANSFORM mscl_python_swig_COMPILE_DEFINITIONS_SWIG PREPEND -D) - add_custom_command( - COMMAND ${CMAKE_COMMAND} -E env SWIG_LIB=${SWIG_DIR} "${SWIG_EXECUTABLE}" -python -outdir "${OUTFILE_DIR}" -c++ -o "${CPP_INTERFACE_FILE}" ${mscl_python_swig_COMPILE_DEFINITIONS_SWIG} "${mscl_python_swig_SOURCES}" - OUTPUT ${PYTHON_INTERFACE_FILE} ${CPP_INTERFACE_FILE} - DEPENDS ${mscl_python_swig_SOURCES} - MAIN_DEPENDENCY ${mscl_python_swig_SOURCES} +macro(mscl_python_swig) + set(single_value_args MODULE_NAME MODULE_VERSION OUTPUT_NAME OUTPUT_DIR PYTHON_VERSION ARCH) + set(multi_value_args SOURCES SWIG_FLAGS COMPILE_OPTIONS COMPILE_DEFINITIONS INCLUDE_DIRECTORIES LINK_DIRECTORIES LINK_OPTIONS LINK_LIBRARIES) + cmake_parse_arguments( + mscl_python_swig + "" + "${single_value_args}" + "${multi_value_args}" + ${ARGN} ) - add_custom_target(${OUTFILE_TARGET}) - endif() - # Set up the swig target - set(OUTPUT_DIR ${OUTFILE_DIR}/${mscl_python_swig_MODULE_NAME}) - add_library(${mscl_python_swig_MODULE_NAME} SHARED ${CPP_INTERFACE_FILE}) + # Generate the python and interface file + set(OUTFILE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Python) + set(OUTFILE_TARGET ${mscl_python_swig_OUTPUT_NAME}_PYTHON_SWIG) + set(PYTHON_INTERFACE_FILE ${OUTFILE_DIR}/${mscl_python_swig_OUTPUT_NAME}.py) + set(CPP_INTERFACE_FILE ${OUTFILE_DIR}/${mscl_python_swig_OUTPUT_NAME}_Main_InterfacePYTHON_wrap.cxx) - # Fix the name of the library - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY PREFIX "_") - if(WIN32) - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY SUFFIX ".pyd") - endif() + if(NOT TARGET ${OUTFILE_TARGET}) + set(mscl_python_swig_COMPILE_DEFINITIONS_SWIG ${mscl_python_swig_COMPILE_DEFINITIONS}) + list(TRANSFORM mscl_python_swig_COMPILE_DEFINITIONS_SWIG PREPEND -D) + add_custom_command( + COMMAND ${CMAKE_COMMAND} -E env SWIG_LIB=${SWIG_DIR} "${SWIG_EXECUTABLE}" -python -outdir "${OUTFILE_DIR}" -c++ -o "${CPP_INTERFACE_FILE}" ${mscl_python_swig_COMPILE_DEFINITIONS_SWIG} "${mscl_python_swig_SOURCES}" + OUTPUT ${PYTHON_INTERFACE_FILE} ${CPP_INTERFACE_FILE} + DEPENDS ${mscl_python_swig_SOURCES} + MAIN_DEPENDENCY ${mscl_python_swig_SOURCES} + ) + add_custom_target(${OUTFILE_TARGET}) + endif() - # Some extra flags to pass directly to swig - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY SWIG_COMPILE_OPTIONS ${mscl_python_swig_SWIG_FLAGS}) + # Set up the swig target + set(OUTPUT_DIR ${OUTFILE_DIR}/${mscl_python_swig_MODULE_NAME}) + add_library(${mscl_python_swig_MODULE_NAME} SHARED ${CPP_INTERFACE_FILE}) - # Compiler flags for the target that will be passed directly to the compiler - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY COMPILE_OPTIONS ${mscl_python_swig_COMPILE_OPTIONS}) + # Fix the name of the library + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY PREFIX "_") - # Compiler definitions for both the compiler and swig - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY COMPILE_DEFINITIONS ${mscl_python_swig_COMPILE_DEFINITIONS}) + if(WIN32) + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY SUFFIX ".pyd") + endif() - # Include directories - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY INCLUDE_DIRECTORIES ${mscl_python_swig_INCLUDE_DIRECTORIES}) + # Some extra flags to pass directly to swig + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY SWIG_COMPILE_OPTIONS ${mscl_python_swig_SWIG_FLAGS}) - # Link directories - target_link_directories(${mscl_python_swig_MODULE_NAME} PRIVATE ${mscl_python_swig_LINK_DIRECTORIES}) + # Compiler flags for the target that will be passed directly to the compiler + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY COMPILE_OPTIONS ${mscl_python_swig_COMPILE_OPTIONS}) - # Raw linker flags - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY STATIC_LINK_OPTIONS ${mscl_python_swig_LINK_OPTIONS} $<$:/ignore:4099>) - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY LINK_OPTIONS ${mscl_python_swig_LINK_OPTIONS} $<$:/ignore:4099>) + # Compiler definitions for both the compiler and swig + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY COMPILE_DEFINITIONS ${mscl_python_swig_COMPILE_DEFINITIONS}) - # Link libraries - target_link_libraries(${mscl_python_swig_MODULE_NAME} ${mscl_python_swig_LINK_LIBRARIES}) + # Include directories + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY INCLUDE_DIRECTORIES ${mscl_python_swig_INCLUDE_DIRECTORIES}) - # Change the output directory and name of the resulting library - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR}) - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}) - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}) - set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY OUTPUT_NAME ${mscl_python_swig_OUTPUT_NAME}) + # Link directories + target_link_directories(${mscl_python_swig_MODULE_NAME} PRIVATE ${mscl_python_swig_LINK_DIRECTORIES}) - # Copy the python file to the same directory as the library - add_custom_command(TARGET ${mscl_python_swig_MODULE_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${OUTPUT_DIR}$<$:/$> ${mscl_python_swig_OUTPUT_DIR}/Python/${mscl_python_swig_PYTHON_VERSION}/${mscl_python_swig_ARCH}/$ - COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_INTERFACE_FILE} ${mscl_python_swig_OUTPUT_DIR}/Python/${mscl_python_swig_PYTHON_VERSION}/${mscl_python_swig_ARCH}/$/${mscl_python_swig_OUTPUT_NAME}.py - ) + # Raw linker flags + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY STATIC_LINK_OPTIONS ${mscl_python_swig_LINK_OPTIONS} $<$:/ignore:4099>) + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY LINK_OPTIONS ${mscl_python_swig_LINK_OPTIONS} $<$:/ignore:4099>) - if(UNIX) - # If running on linux, install the artifacts - set(PYTHON_SITE_PACKAGES_DIR lib/python${mscl_python_swig_PYTHON_VERSION}/site-packages) + # Link libraries + target_link_libraries(${mscl_python_swig_MODULE_NAME} ${mscl_python_swig_LINK_LIBRARIES}) + + # Change the output directory and name of the resulting library + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR}) + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}) + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}) + set_property(TARGET ${mscl_python_swig_MODULE_NAME} PROPERTY OUTPUT_NAME ${mscl_python_swig_OUTPUT_NAME}) + + # Copy the python file to the same directory as the library + add_custom_command(TARGET ${mscl_python_swig_MODULE_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${OUTPUT_DIR}$<$:/$> ${mscl_python_swig_OUTPUT_DIR}/Python/${mscl_python_swig_PYTHON_VERSION}/${mscl_python_swig_ARCH}/$ + COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_INTERFACE_FILE} ${mscl_python_swig_OUTPUT_DIR}/Python/${mscl_python_swig_PYTHON_VERSION}/${mscl_python_swig_ARCH}/$/${mscl_python_swig_OUTPUT_NAME}.py + ) + + if(MSVC) + set(PYTHON_SITE_PACKAGES_DIR "${mscl_python_swig_PYTHON_VERSION}/${MSCL_ARCH_NAME}/$") + else() + set(PYTHON_SITE_PACKAGES_DIR lib/python${mscl_python_swig_PYTHON_VERSION}/site-packages) + endif() + + set(MSCL_PYTHON${mscl_python_swig_PYTHON_VERSION}_INSTALL_COMPONENT ${PROJECT_NAME}_PYTHON${mscl_python_swig_PYTHON_VERSION}) install( - TARGETS ${mscl_python_swig_MODULE_NAME} - DESTINATION "${PYTHON_SITE_PACKAGES_DIR}" - COMPONENT python${mscl_python_swig_PYTHON_VERSION} + TARGETS ${mscl_python_swig_MODULE_NAME} + DESTINATION "${PYTHON_SITE_PACKAGES_DIR}" + COMPONENT ${MSCL_PYTHON${mscl_python_swig_PYTHON_VERSION}_INSTALL_COMPONENT} ) install( - FILES "${PYTHON_INTERFACE_FILE}" - DESTINATION "${PYTHON_SITE_PACKAGES_DIR}" - COMPONENT python${mscl_python_swig_PYTHON_VERSION} + FILES "${PYTHON_INTERFACE_FILE}" + DESTINATION "${PYTHON_SITE_PACKAGES_DIR}" + COMPONENT ${MSCL_PYTHON${mscl_python_swig_PYTHON_VERSION}_INSTALL_COMPONENT} ) - endif() -endfunction() \ No newline at end of file +endmacro()