microstrain-daq-utils 0.9.0b0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- microstrain_daq_utils-0.9.0b0/.gitignore +216 -0
- microstrain_daq_utils-0.9.0b0/MicroStrain.DaqUtils.sln +27 -0
- microstrain_daq_utils-0.9.0b0/PKG-INFO +9 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/cpp/CMakeLists.txt +40 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/cpp/cmake/git_version.cmake +32 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/cpp/include/daq_utils/daq_utils.h +146 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/cpp/include/daq_utils/wireless.h +19 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/cpp/src/daq_utils.cpp +343 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/cpp/src/wireless.cpp +53 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/DaqUtils.cs +275 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/DaqUtils.csproj +32 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/Wireless.cs +29 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/LICENSE +176 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/copendaq.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/daqcoreobjects-64-3.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/daqcoretypes-64-3.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/audio_device_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/basic_csv_recorder_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/native_stream_cl_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/native_stream_srv_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/new_ws_stream_srv_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/opcua_client_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/opcua_server_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/parquet_recorder_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/ref_device_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/ref_fb_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/ws_stream_cl_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/modules/ws_stream_srv_module-64-3.module.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/csharp/opendaq-net/runtimes/win-x64/native/opendaq-64-3.dll +0 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/python/__init__.py +316 -0
- microstrain_daq_utils-0.9.0b0/daq_utils/python/wireless.py +31 -0
- microstrain_daq_utils-0.9.0b0/pyproject.toml +27 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# C# build outputs
|
|
2
|
+
bin/
|
|
3
|
+
obj/
|
|
4
|
+
packages/
|
|
5
|
+
|
|
6
|
+
# Track the modules directory but ignore its contents
|
|
7
|
+
/modules/*
|
|
8
|
+
!/modules/.gitkeep
|
|
9
|
+
|
|
10
|
+
# Byte-compiled / optimized / DLL files
|
|
11
|
+
__pycache__/
|
|
12
|
+
*.py[codz]
|
|
13
|
+
*$py.class
|
|
14
|
+
|
|
15
|
+
# C extensions
|
|
16
|
+
*.so
|
|
17
|
+
|
|
18
|
+
# Distribution / packaging
|
|
19
|
+
.Python
|
|
20
|
+
build/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
dist/
|
|
23
|
+
downloads/
|
|
24
|
+
eggs/
|
|
25
|
+
.eggs/
|
|
26
|
+
lib/
|
|
27
|
+
lib64/
|
|
28
|
+
parts/
|
|
29
|
+
sdist/
|
|
30
|
+
var/
|
|
31
|
+
wheels/
|
|
32
|
+
share/python-wheels/
|
|
33
|
+
*.egg-info/
|
|
34
|
+
.installed.cfg
|
|
35
|
+
*.egg
|
|
36
|
+
MANIFEST
|
|
37
|
+
|
|
38
|
+
# PyInstaller
|
|
39
|
+
# Usually these files are written by a python script from a template
|
|
40
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
41
|
+
*.manifest
|
|
42
|
+
*.spec
|
|
43
|
+
|
|
44
|
+
# Installer logs
|
|
45
|
+
pip-log.txt
|
|
46
|
+
pip-delete-this-directory.txt
|
|
47
|
+
|
|
48
|
+
# Unit test / coverage reports
|
|
49
|
+
htmlcov/
|
|
50
|
+
.tox/
|
|
51
|
+
.nox/
|
|
52
|
+
.coverage
|
|
53
|
+
.coverage.*
|
|
54
|
+
.cache
|
|
55
|
+
nosetests.xml
|
|
56
|
+
coverage.xml
|
|
57
|
+
*.cover
|
|
58
|
+
*.py.cover
|
|
59
|
+
.hypothesis/
|
|
60
|
+
.pytest_cache/
|
|
61
|
+
cover/
|
|
62
|
+
|
|
63
|
+
# Translations
|
|
64
|
+
*.mo
|
|
65
|
+
*.pot
|
|
66
|
+
|
|
67
|
+
# Django stuff:
|
|
68
|
+
*.log
|
|
69
|
+
local_settings.py
|
|
70
|
+
db.sqlite3
|
|
71
|
+
db.sqlite3-journal
|
|
72
|
+
|
|
73
|
+
# Flask stuff:
|
|
74
|
+
instance/
|
|
75
|
+
.webassets-cache
|
|
76
|
+
|
|
77
|
+
# Scrapy stuff:
|
|
78
|
+
.scrapy
|
|
79
|
+
|
|
80
|
+
# Sphinx documentation
|
|
81
|
+
docs/_build/
|
|
82
|
+
|
|
83
|
+
# PyBuilder
|
|
84
|
+
.pybuilder/
|
|
85
|
+
target/
|
|
86
|
+
|
|
87
|
+
# Jupyter Notebook
|
|
88
|
+
.ipynb_checkpoints
|
|
89
|
+
|
|
90
|
+
# IPython
|
|
91
|
+
profile_default/
|
|
92
|
+
ipython_config.py
|
|
93
|
+
|
|
94
|
+
# pyenv
|
|
95
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
96
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
97
|
+
# .python-version
|
|
98
|
+
|
|
99
|
+
# pipenv
|
|
100
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
101
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
102
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
103
|
+
# install all needed dependencies.
|
|
104
|
+
#Pipfile.lock
|
|
105
|
+
|
|
106
|
+
# UV
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
108
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
109
|
+
# commonly ignored for libraries.
|
|
110
|
+
#uv.lock
|
|
111
|
+
|
|
112
|
+
# poetry
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
114
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
115
|
+
# commonly ignored for libraries.
|
|
116
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
117
|
+
#poetry.lock
|
|
118
|
+
#poetry.toml
|
|
119
|
+
|
|
120
|
+
# pdm
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
122
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
123
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
124
|
+
#pdm.lock
|
|
125
|
+
#pdm.toml
|
|
126
|
+
.pdm-python
|
|
127
|
+
.pdm-build/
|
|
128
|
+
|
|
129
|
+
# pixi
|
|
130
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
131
|
+
#pixi.lock
|
|
132
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
133
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
134
|
+
.pixi
|
|
135
|
+
|
|
136
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
137
|
+
__pypackages__/
|
|
138
|
+
|
|
139
|
+
# Celery stuff
|
|
140
|
+
celerybeat-schedule
|
|
141
|
+
celerybeat.pid
|
|
142
|
+
|
|
143
|
+
# SageMath parsed files
|
|
144
|
+
*.sage.py
|
|
145
|
+
|
|
146
|
+
# Environments
|
|
147
|
+
.env
|
|
148
|
+
.envrc
|
|
149
|
+
.venv
|
|
150
|
+
env/
|
|
151
|
+
venv/
|
|
152
|
+
ENV/
|
|
153
|
+
env.bak/
|
|
154
|
+
venv.bak/
|
|
155
|
+
|
|
156
|
+
# Spyder project settings
|
|
157
|
+
.spyderproject
|
|
158
|
+
.spyproject
|
|
159
|
+
|
|
160
|
+
# Rope project settings
|
|
161
|
+
.ropeproject
|
|
162
|
+
|
|
163
|
+
# mkdocs documentation
|
|
164
|
+
/site
|
|
165
|
+
|
|
166
|
+
# mypy
|
|
167
|
+
.mypy_cache/
|
|
168
|
+
.dmypy.json
|
|
169
|
+
dmypy.json
|
|
170
|
+
|
|
171
|
+
# Pyre type checker
|
|
172
|
+
.pyre/
|
|
173
|
+
|
|
174
|
+
# pytype static type analyzer
|
|
175
|
+
.pytype/
|
|
176
|
+
|
|
177
|
+
# Cython debug symbols
|
|
178
|
+
cython_debug/
|
|
179
|
+
|
|
180
|
+
# PyCharm
|
|
181
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
182
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
183
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
184
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
185
|
+
#.idea/
|
|
186
|
+
|
|
187
|
+
# Abstra
|
|
188
|
+
# Abstra is an AI-powered process automation framework.
|
|
189
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
190
|
+
# Learn more at https://abstra.io/docs
|
|
191
|
+
.abstra/
|
|
192
|
+
|
|
193
|
+
# Visual Studio Code
|
|
194
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
195
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
196
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
197
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
198
|
+
# .vscode/
|
|
199
|
+
|
|
200
|
+
# Ruff stuff:
|
|
201
|
+
.ruff_cache/
|
|
202
|
+
|
|
203
|
+
# PyPI configuration file
|
|
204
|
+
.pypirc
|
|
205
|
+
|
|
206
|
+
# Cursor
|
|
207
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
208
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
209
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
210
|
+
.cursorignore
|
|
211
|
+
.cursorindexingignore
|
|
212
|
+
|
|
213
|
+
# Marimo
|
|
214
|
+
marimo/_static/
|
|
215
|
+
marimo/_lsp/
|
|
216
|
+
__marimo__/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
3
|
+
# Visual Studio Version 17
|
|
4
|
+
VisualStudioVersion = 17.0.31903.59
|
|
5
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
|
6
|
+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "daq_utils", "daq_utils", "{41A744D0-4583-46C4-8882-656F23A92F44}"
|
|
7
|
+
EndProject
|
|
8
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DaqUtils", "daq_utils\csharp\DaqUtils.csproj", "{DC7F027B-896B-4428-8C2B-BEDE60E4CD96}"
|
|
9
|
+
EndProject
|
|
10
|
+
Global
|
|
11
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
12
|
+
Debug|Any CPU = Debug|Any CPU
|
|
13
|
+
Release|Any CPU = Release|Any CPU
|
|
14
|
+
EndGlobalSection
|
|
15
|
+
GlobalSection(SolutionProperties) = preSolution
|
|
16
|
+
HideSolutionNode = FALSE
|
|
17
|
+
EndGlobalSection
|
|
18
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
19
|
+
{DC7F027B-896B-4428-8C2B-BEDE60E4CD96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
20
|
+
{DC7F027B-896B-4428-8C2B-BEDE60E4CD96}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
21
|
+
{DC7F027B-896B-4428-8C2B-BEDE60E4CD96}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
22
|
+
{DC7F027B-896B-4428-8C2B-BEDE60E4CD96}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
23
|
+
EndGlobalSection
|
|
24
|
+
GlobalSection(NestedProjects) = preSolution
|
|
25
|
+
{DC7F027B-896B-4428-8C2B-BEDE60E4CD96} = {41A744D0-4583-46C4-8882-656F23A92F44}
|
|
26
|
+
EndGlobalSection
|
|
27
|
+
EndGlobal
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microstrain-daq-utils
|
|
3
|
+
Version: 0.9.0b0
|
|
4
|
+
Summary: An opinionated library that enhances working with openDAQ modules from MicroStrain by HBK.
|
|
5
|
+
Maintainer-email: MicroStrain by HBK <microstrainsupport@hbkworld.com>
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Requires-Dist: opendaq==3.30.3
|
|
8
|
+
Provides-Extra: jupyter
|
|
9
|
+
Requires-Dist: microstrain-daq-jupyter; extra == 'jupyter'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.20)
|
|
2
|
+
|
|
3
|
+
include(cmake/git_version.cmake)
|
|
4
|
+
get_project_version_from_git_tag("v" REPO_FULL_VERSION REPO_NUMERIC_VERSION)
|
|
5
|
+
|
|
6
|
+
project(MicroStrainDaqUtils VERSION ${REPO_NUMERIC_VERSION})
|
|
7
|
+
set(PROJECT_VERSION ${REPO_FULL_VERSION})
|
|
8
|
+
|
|
9
|
+
find_package(openDAQ 3.30.3 EXACT QUIET)
|
|
10
|
+
if(NOT openDAQ_FOUND)
|
|
11
|
+
include(FetchContent)
|
|
12
|
+
FetchContent_Declare(
|
|
13
|
+
openDAQ
|
|
14
|
+
GIT_REPOSITORY https://github.com/openDAQ/openDAQ.git
|
|
15
|
+
GIT_TAG v3.30.3
|
|
16
|
+
)
|
|
17
|
+
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
|
18
|
+
set(OPENDAQ_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
|
|
19
|
+
set(OPENDAQ_ENABLE_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|
20
|
+
set(OPENDAQ_ENABLE_SIMULATOR OFF CACHE BOOL "" FORCE)
|
|
21
|
+
FetchContent_MakeAvailable(openDAQ)
|
|
22
|
+
endif()
|
|
23
|
+
|
|
24
|
+
add_library(microstrain_daq_utils
|
|
25
|
+
src/daq_utils.cpp
|
|
26
|
+
src/wireless.cpp
|
|
27
|
+
)
|
|
28
|
+
add_library(microstrain::daq_utils ALIAS microstrain_daq_utils)
|
|
29
|
+
|
|
30
|
+
target_include_directories(microstrain_daq_utils PUBLIC
|
|
31
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
32
|
+
$<INSTALL_INTERFACE:include>
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
target_link_libraries(microstrain_daq_utils PRIVATE daq::opendaq)
|
|
36
|
+
target_compile_features(microstrain_daq_utils PUBLIC cxx_std_17)
|
|
37
|
+
|
|
38
|
+
if(MSVC)
|
|
39
|
+
target_compile_options(microstrain_daq_utils PRIVATE /MP)
|
|
40
|
+
endif()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Extracts the version for a project from the latest git tag.
|
|
2
|
+
#
|
|
3
|
+
# Arguments:
|
|
4
|
+
# PROJECT_PREFIX - The project prefix in the git tag ("v" in "v1.2.3").
|
|
5
|
+
#
|
|
6
|
+
# Returns:
|
|
7
|
+
# FULL_VERSION_OUT: The extracted full version string (ex: "1.2.3-beta").
|
|
8
|
+
# NUMERIC_VERSION_OUT: The extracted numeric version string (ex: "1.2.3").
|
|
9
|
+
#
|
|
10
|
+
function(get_project_version_from_git_tag PROJECT_PREFIX FULL_VERSION_OUT NUMERIC_VERSION_OUT)
|
|
11
|
+
execute_process(
|
|
12
|
+
COMMAND git describe --tags --match "${PROJECT_PREFIX}*" --dirty
|
|
13
|
+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
14
|
+
OUTPUT_VARIABLE GIT_TAG
|
|
15
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if(GIT_TAG)
|
|
19
|
+
# Extract full version (e.g., "v1.2.3-alpha" -> "1.2.3-alpha")
|
|
20
|
+
string(REGEX REPLACE "^${PROJECT_PREFIX}" "" FULL_VERSION_STRING ${GIT_TAG})
|
|
21
|
+
|
|
22
|
+
# Extract just numeric version for CMake project() (ex: "1.2.3-alpha" -> "1.2.3")
|
|
23
|
+
string(REGEX REPLACE "^([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" NUMERIC_VERSION_STRING "${FULL_VERSION_STRING}")
|
|
24
|
+
|
|
25
|
+
set(${NUMERIC_VERSION_OUT} ${NUMERIC_VERSION_STRING} PARENT_SCOPE)
|
|
26
|
+
set(${FULL_VERSION_OUT} ${FULL_VERSION_STRING} PARENT_SCOPE)
|
|
27
|
+
else()
|
|
28
|
+
message(WARNING "No git tag found matching '${PROJECT_PREFIX}*', using 0.0.0 as a fallback.")
|
|
29
|
+
set(${NUMERIC_VERSION_OUT} "0.0.0" PARENT_SCOPE)
|
|
30
|
+
set(${FULL_VERSION_OUT} "0.0.0" PARENT_SCOPE)
|
|
31
|
+
endif()
|
|
32
|
+
endfunction()
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <initializer_list>
|
|
4
|
+
#include <iosfwd>
|
|
5
|
+
#include <string>
|
|
6
|
+
#include <utility>
|
|
7
|
+
#include <vector>
|
|
8
|
+
|
|
9
|
+
#include <coreobjects/property_object_ptr.h>
|
|
10
|
+
#include <coretypes/enumeration_ptr.h>
|
|
11
|
+
#include <coretypes/struct_ptr.h>
|
|
12
|
+
#include <coretypes/type_manager_ptr.h>
|
|
13
|
+
#include <opendaq/instance_ptr.h>
|
|
14
|
+
|
|
15
|
+
namespace daq_utils {
|
|
16
|
+
|
|
17
|
+
struct PropertyInfo {
|
|
18
|
+
std::string group;
|
|
19
|
+
std::string name;
|
|
20
|
+
std::string type;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/// @brief Creates openDAQ typed values (enumerations, structs) without requiring an explicit
|
|
24
|
+
/// type manager or string wrapping.
|
|
25
|
+
///
|
|
26
|
+
/// @example
|
|
27
|
+
/// DaqTypeFactory factory(instance);
|
|
28
|
+
/// daq::EnumerationPtr voltage = factory.MakeEnum("MSCL_Wireless_Voltage", "voltage_3000mV");
|
|
29
|
+
class DaqTypeFactory
|
|
30
|
+
{
|
|
31
|
+
public:
|
|
32
|
+
/// @param instance The openDAQ instance to retrieve the type manager from.
|
|
33
|
+
explicit DaqTypeFactory(daq::InstancePtr instance);
|
|
34
|
+
|
|
35
|
+
/// @brief Creates an openDAQ Enumeration value.
|
|
36
|
+
/// @param typeName The registered enum type name.
|
|
37
|
+
/// @param valueName The enum value name.
|
|
38
|
+
/// @return The created Enumeration.
|
|
39
|
+
///
|
|
40
|
+
/// @example
|
|
41
|
+
/// daq::EnumerationPtr voltage = factory.MakeEnum("MSCL_Wireless_Voltage", "voltage_3000mV");
|
|
42
|
+
daq::EnumerationPtr MakeEnum(const std::string& typeName, const std::string& valueName);
|
|
43
|
+
|
|
44
|
+
/// @brief Creates an openDAQ Struct value.
|
|
45
|
+
/// @param typeName The registered struct type name.
|
|
46
|
+
/// @param fields Field name-value pairs. Values must be openDAQ types
|
|
47
|
+
/// (Integer(), Float(), Boolean(), Enumeration(), etc.).
|
|
48
|
+
/// @return The created Struct.
|
|
49
|
+
///
|
|
50
|
+
/// @example
|
|
51
|
+
/// daq::StructPtr eq = factory.MakeStruct("MSCL_Wireless_LinearEquation",
|
|
52
|
+
/// {{"Slope", daq::Float(1.0)}, {"Offset", daq::Float(0.0)}});
|
|
53
|
+
daq::StructPtr MakeStruct(
|
|
54
|
+
const std::string& typeName,
|
|
55
|
+
std::initializer_list<std::pair<std::string, daq::BaseObjectPtr>> fields);
|
|
56
|
+
|
|
57
|
+
private:
|
|
58
|
+
daq::TypeManagerPtr typeManager_;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/// @brief Inspects openDAQ registered types without requiring an explicit instance argument
|
|
62
|
+
/// on each call.
|
|
63
|
+
///
|
|
64
|
+
/// @example
|
|
65
|
+
/// DaqTypeInspector inspector(instance);
|
|
66
|
+
/// inspector.Describe("MSCL_Wireless_ShuntCalCmdInfo");
|
|
67
|
+
/// inspector.Describe("MSCL_Wireless_Voltage");
|
|
68
|
+
class DaqTypeInspector
|
|
69
|
+
{
|
|
70
|
+
public:
|
|
71
|
+
/// @param instance The openDAQ instance to retrieve the type manager from.
|
|
72
|
+
explicit DaqTypeInspector(daq::InstancePtr instance);
|
|
73
|
+
|
|
74
|
+
/// @brief Prints the fields and values for a registered enum or struct type to stdout.
|
|
75
|
+
/// @param typeName The full registered type name.
|
|
76
|
+
void Describe(const std::string& typeName);
|
|
77
|
+
|
|
78
|
+
/// @brief Prints the fields and values for a registered enum or struct type to the given stream.
|
|
79
|
+
/// @param typeName The full registered type name.
|
|
80
|
+
/// @param out The output stream to write to.
|
|
81
|
+
void Describe(const std::string& typeName, std::ostream& out);
|
|
82
|
+
|
|
83
|
+
private:
|
|
84
|
+
daq::TypeManagerPtr typeManager_;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/// @brief Returns the full dot-notation path of a property or group given its name.
|
|
88
|
+
/// @param root The openDAQ object to search.
|
|
89
|
+
/// @param name The property or group name to find.
|
|
90
|
+
/// @return The dot-notation path, or "Not found" if no match exists.
|
|
91
|
+
///
|
|
92
|
+
/// @example
|
|
93
|
+
/// std::string path = Find(channel, "LostBeaconTimeout");
|
|
94
|
+
/// // => "Setup.Configure.Sampling.LostBeaconTimeout"
|
|
95
|
+
std::string Find(daq::PropertyObjectPtr root, const std::string& name);
|
|
96
|
+
|
|
97
|
+
/// @brief Returns all property groups and subgroups as dot-notation path strings.
|
|
98
|
+
/// @param root The openDAQ object to query.
|
|
99
|
+
/// @return A list of dot-notation group paths.
|
|
100
|
+
std::vector<std::string> Groups(daq::PropertyObjectPtr root);
|
|
101
|
+
|
|
102
|
+
/// @brief Prints all property groups and subgroups sorted alphabetically to stdout.
|
|
103
|
+
/// @param root The openDAQ object to query.
|
|
104
|
+
void PrintGroups(daq::PropertyObjectPtr root);
|
|
105
|
+
|
|
106
|
+
/// @brief Prints all property groups and subgroups sorted alphabetically to the given stream.
|
|
107
|
+
/// @param root The openDAQ object to query.
|
|
108
|
+
/// @param out The output stream to write to.
|
|
109
|
+
void PrintGroups(daq::PropertyObjectPtr root, std::ostream& out);
|
|
110
|
+
|
|
111
|
+
/// @brief Returns properties as a list of PropertyInfo (group, name, type) entries.
|
|
112
|
+
/// @param root The openDAQ object to query.
|
|
113
|
+
/// @param group Optional dot-notation group path to filter properties.
|
|
114
|
+
/// @return A list of PropertyInfo entries.
|
|
115
|
+
///
|
|
116
|
+
/// @example
|
|
117
|
+
/// std::vector<PropertyInfo> props = Properties(channel, "Setup.Configure.Sampling");
|
|
118
|
+
std::vector<PropertyInfo> Properties(daq::PropertyObjectPtr root, const std::string& group = "");
|
|
119
|
+
|
|
120
|
+
/// @brief Prints properties as an aligned table sorted alphabetically by group then name to stdout.
|
|
121
|
+
/// @param root The openDAQ object to query.
|
|
122
|
+
/// @param group Optional dot-notation group path to filter properties.
|
|
123
|
+
void PrintProperties(daq::PropertyObjectPtr root, const std::string& group = "");
|
|
124
|
+
|
|
125
|
+
/// @brief Prints properties as an aligned table sorted alphabetically by group then name
|
|
126
|
+
/// to the given stream.
|
|
127
|
+
/// @param root The openDAQ object to query.
|
|
128
|
+
/// @param group Dot-notation group path to filter properties, or empty string for all.
|
|
129
|
+
/// @param out The output stream to write to.
|
|
130
|
+
void PrintProperties(daq::PropertyObjectPtr root, const std::string& group, std::ostream& out);
|
|
131
|
+
|
|
132
|
+
/// @brief Calls an openDAQ function property and returns its result.
|
|
133
|
+
/// @param root The root openDAQ property object to start from.
|
|
134
|
+
/// @param path The dot-notation path from the root to the function property.
|
|
135
|
+
/// @param args Optional arguments to pass to the function.
|
|
136
|
+
/// @return The result returned by the function, or an unassigned object for procedures.
|
|
137
|
+
///
|
|
138
|
+
/// @example
|
|
139
|
+
/// daq::BaseObjectPtr result = Call(channel, "Setup.Configure.Apply");
|
|
140
|
+
/// daq::BaseObjectPtr result = Call(channel, "Capabilities.ChannelType", {daq::Integer(1)});
|
|
141
|
+
daq::BaseObjectPtr Call(
|
|
142
|
+
daq::PropertyObjectPtr root,
|
|
143
|
+
const std::string& path,
|
|
144
|
+
std::initializer_list<daq::BaseObjectPtr> args = {});
|
|
145
|
+
|
|
146
|
+
} // namespace daq_utils
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <iosfwd>
|
|
4
|
+
|
|
5
|
+
#include <opendaq/device_ptr.h>
|
|
6
|
+
|
|
7
|
+
namespace daq_utils::wireless {
|
|
8
|
+
|
|
9
|
+
/// @brief Prints a table of all wireless node channels discovered by a base station device.
|
|
10
|
+
/// @param baseStation The openDAQ device representing the wireless base station.
|
|
11
|
+
void ListNodes(daq::DevicePtr baseStation);
|
|
12
|
+
|
|
13
|
+
/// @brief Prints a table of all wireless node channels discovered by a base station device
|
|
14
|
+
/// to the given stream.
|
|
15
|
+
/// @param baseStation The openDAQ device representing the wireless base station.
|
|
16
|
+
/// @param out The output stream to write to.
|
|
17
|
+
void ListNodes(daq::DevicePtr baseStation, std::ostream& out);
|
|
18
|
+
|
|
19
|
+
} // namespace daq_utils::wireless
|