plesty-lib 0.1.0__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.
- plesty_lib-0.1.0/.gitignore +49 -0
- plesty_lib-0.1.0/.gitlab-ci.yaml +4 -0
- plesty_lib-0.1.0/.plesty/.gitignore +1 -0
- plesty_lib-0.1.0/.plesty/.sdk-version +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/.buildinfo +4 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/api_reference.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/contributing.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/auto_test.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/base_device.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/cmd_solver.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/error_handling.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/func_system.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/logging_system.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/param_system.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/device/traffic_manager.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/environment.pickle +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/quickstart.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/auto_test_func_system/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/auto_test_sync_device/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/device_test/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/array/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/ctype_manager/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/table/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/types/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/units/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/async_wrapper/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/base_device_sync/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/base_tcp_scpi_device/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/base_visa_scpi_device/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/device_utils/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/funcs/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/params/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/service/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/service/tcp_ip_client/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/service/tcp_ip_server/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/sim/data_generator/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/sim/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/solver/iceblock/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/solver/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/solver/scpi/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/serial/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/tcp_ip/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/usb_utils/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/utils/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/visa/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/dll_utils/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/error_utils/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/logger/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/registry/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/test_data_array/index.doctree +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_images/device_layers.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_images/device_standard.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_images/plesty_framework.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/api_reference.md.txt +15 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/contributing.md.txt +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/auto_test.md.txt +168 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/base_device.md.txt +167 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/cmd_solver.md.txt +137 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/error_handling.md.txt +121 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/func_system.md.txt +248 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/index.md.txt +32 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/logging_system.md.txt +154 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/param_system.md.txt +227 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/device/traffic_manager.md.txt +153 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/index.md.txt +34 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/quickstart.md.txt +164 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/auto_test_func_system/index.rst.txt +31 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/auto_test_sync_device/index.rst.txt +19 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/device_test/index.rst.txt +77 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/index.rst.txt +15 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/data/array/index.rst.txt +160 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/data/ctype_manager/index.rst.txt +67 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/data/index.rst.txt +339 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/data/table/index.rst.txt +121 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/data/types/index.rst.txt +40 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/data/units/index.rst.txt +71 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/async_wrapper/index.rst.txt +241 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/base_device_sync/index.rst.txt +169 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/base_tcp_scpi_device/index.rst.txt +147 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/base_visa_scpi_device/index.rst.txt +129 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/device_utils/index.rst.txt +55 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/funcs/index.rst.txt +335 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/index.rst.txt +21 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/device/params/index.rst.txt +392 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/index.rst.txt +21 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/service/index.rst.txt +459 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/service/tcp_ip_client/index.rst.txt +125 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/service/tcp_ip_server/index.rst.txt +139 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/sim/data_generator/index.rst.txt +140 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/sim/index.rst.txt +15 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/solver/iceblock/index.rst.txt +77 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/solver/index.rst.txt +143 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/solver/scpi/index.rst.txt +76 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/traffic/index.rst.txt +140 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/traffic/serial/index.rst.txt +123 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/traffic/tcp_ip/index.rst.txt +119 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/traffic/usb_utils/index.rst.txt +35 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/traffic/utils/index.rst.txt +55 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/traffic/visa/index.rst.txt +115 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/utils/dll_utils/index.rst.txt +19 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/utils/error_utils/index.rst.txt +22 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/utils/index.rst.txt +18 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/utils/logger/index.rst.txt +19 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/plestylib/utils/registry/index.rst.txt +32 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sources/reference/test_data_array/index.rst.txt +43 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sphinx_design_static/design-tabs.js +101 -0
- plesty_lib-0.1.0/.plesty/docs-build/_sphinx_design_static/sphinx-design.min.css +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/base-stemmer.js +476 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/basic.css +906 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/check-solid.svg +4 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/clipboard.min.js +7 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/copy-button.svg +5 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/copybutton.css +94 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/copybutton.js +248 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/copybutton_funcs.js +73 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/design-tabs.js +101 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/doctools.js +150 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/documentation_options.js +13 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/english-stemmer.js +1066 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/file.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/graphviz.css +12 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/language_data.js +13 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/minus.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/plesty_icon.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/plesty_logo.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/plus.png +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/pygments.css +152 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/bootstrap.js +3 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/bootstrap.js.LICENSE.txt +5 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/bootstrap.js.map +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/fontawesome.js +3 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/fontawesome.js.LICENSE.txt +5 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/fontawesome.js.map +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/pydata-sphinx-theme.js +2 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/scripts/pydata-sphinx-theme.js.map +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/searchtools.js +693 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/sphinx-design.min.css +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/sphinx_highlight.js +159 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/styles/pydata-sphinx-theme.css +32 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/styles/pydata-sphinx-theme.css.map +1 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/styles/theme.css +2 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/vendor/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/vendor/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/vendor/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/vendor/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/vendor/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/vendor/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/_static/webpack-macros.html +24 -0
- plesty_lib-0.1.0/.plesty/docs-build/api_reference.html +500 -0
- plesty_lib-0.1.0/.plesty/docs-build/contributing.html +450 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/auto_test.html +667 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/base_device.html +668 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/cmd_solver.html +639 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/error_handling.html +645 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/func_system.html +749 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/index.html +533 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/logging_system.html +654 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/param_system.html +732 -0
- plesty_lib-0.1.0/.plesty/docs-build/device/traffic_manager.html +649 -0
- plesty_lib-0.1.0/.plesty/docs-build/genindex.html +2572 -0
- plesty_lib-0.1.0/.plesty/docs-build/index.html +460 -0
- plesty_lib-0.1.0/.plesty/docs-build/objects.inv +0 -0
- plesty_lib-0.1.0/.plesty/docs-build/py-modindex.html +1040 -0
- plesty_lib-0.1.0/.plesty/docs-build/quickstart.html +642 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/auto_test_func_system/index.html +594 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/auto_test_sync_device/index.html +567 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/device_test/index.html +693 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/index.html +594 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/data/array/index.html +808 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/data/ctype_manager/index.html +640 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/data/index.html +1179 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/data/table/index.html +707 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/data/types/index.html +637 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/data/units/index.html +731 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/async_wrapper/index.html +844 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/base_device_sync/index.html +838 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/base_tcp_scpi_device/index.html +723 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/base_visa_scpi_device/index.html +696 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/device_utils/index.html +639 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/funcs/index.html +1104 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/index.html +561 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/device/params/index.html +1224 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/index.html +558 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/service/index.html +1158 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/service/tcp_ip_client/index.html +745 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/service/tcp_ip_server/index.html +714 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/sim/data_generator/index.html +789 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/sim/index.html +555 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/solver/iceblock/index.html +653 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/solver/index.html +734 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/solver/scpi/index.html +653 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/traffic/index.html +746 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/traffic/serial/index.html +680 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/traffic/tcp_ip/index.html +674 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/traffic/usb_utils/index.html +606 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/traffic/utils/index.html +628 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/traffic/visa/index.html +671 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/utils/dll_utils/index.html +573 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/utils/error_utils/index.html +574 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/utils/index.html +558 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/utils/logger/index.html +581 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/plestylib/utils/registry/index.html +593 -0
- plesty_lib-0.1.0/.plesty/docs-build/reference/test_data_array/index.html +639 -0
- plesty_lib-0.1.0/.plesty/docs-build/search.html +848 -0
- plesty_lib-0.1.0/.plesty/docs-build/searchindex.js +1 -0
- plesty_lib-0.1.0/COPYING +674 -0
- plesty_lib-0.1.0/LICENSE +184 -0
- plesty_lib-0.1.0/LICENSES/GPL-3.0-or-later.txt +674 -0
- plesty_lib-0.1.0/LICENSES/LGPL-3.0-or-later.txt +165 -0
- plesty_lib-0.1.0/PKG-INFO +91 -0
- plesty_lib-0.1.0/README.md +72 -0
- plesty_lib-0.1.0/docs/api_reference.md +15 -0
- plesty_lib-0.1.0/docs/contributing.md +0 -0
- plesty_lib-0.1.0/docs/device/auto_test.md +168 -0
- plesty_lib-0.1.0/docs/device/base_device.md +167 -0
- plesty_lib-0.1.0/docs/device/cmd_solver.md +137 -0
- plesty_lib-0.1.0/docs/device/error_handling.md +121 -0
- plesty_lib-0.1.0/docs/device/func_system.md +248 -0
- plesty_lib-0.1.0/docs/device/index.md +32 -0
- plesty_lib-0.1.0/docs/device/logging_system.md +154 -0
- plesty_lib-0.1.0/docs/device/param_system.md +227 -0
- plesty_lib-0.1.0/docs/device/traffic_manager.md +153 -0
- plesty_lib-0.1.0/docs/imgs/device_layers.png +0 -0
- plesty_lib-0.1.0/docs/imgs/device_standard.png +0 -0
- plesty_lib-0.1.0/docs/imgs/plesty_framework.png +0 -0
- plesty_lib-0.1.0/docs/index.md +34 -0
- plesty_lib-0.1.0/docs/quickstart.md +164 -0
- plesty_lib-0.1.0/docs/toc.yaml +17 -0
- plesty_lib-0.1.0/plestylib/__init__.py +7 -0
- plesty_lib-0.1.0/plestylib/data/__init__.py +30 -0
- plesty_lib-0.1.0/plestylib/data/array.py +313 -0
- plesty_lib-0.1.0/plestylib/data/ctype_manager.py +101 -0
- plesty_lib-0.1.0/plestylib/data/table.py +52 -0
- plesty_lib-0.1.0/plestylib/data/types.py +107 -0
- plesty_lib-0.1.0/plestylib/data/units.py +164 -0
- plesty_lib-0.1.0/plestylib/device/__init__.py +6 -0
- plesty_lib-0.1.0/plestylib/device/async_wrapper.py +278 -0
- plesty_lib-0.1.0/plestylib/device/base_device_sync.py +204 -0
- plesty_lib-0.1.0/plestylib/device/base_tcp_scpi_device.py +124 -0
- plesty_lib-0.1.0/plestylib/device/base_visa_scpi_device.py +102 -0
- plesty_lib-0.1.0/plestylib/device/device_utils.py +77 -0
- plesty_lib-0.1.0/plestylib/device/funcs.py +788 -0
- plesty_lib-0.1.0/plestylib/device/params.py +494 -0
- plesty_lib-0.1.0/plestylib/service/__init__.py +46 -0
- plesty_lib-0.1.0/plestylib/service/tcp_ip_client.py +163 -0
- plesty_lib-0.1.0/plestylib/service/tcp_ip_server.py +205 -0
- plesty_lib-0.1.0/plestylib/sim/__init__.py +6 -0
- plesty_lib-0.1.0/plestylib/sim/data_generator.py +259 -0
- plesty_lib-0.1.0/plestylib/solver/__init__.py +25 -0
- plesty_lib-0.1.0/plestylib/solver/iceblock.py +90 -0
- plesty_lib-0.1.0/plestylib/solver/scpi.py +91 -0
- plesty_lib-0.1.0/plestylib/test/auto_test_func_system.py +99 -0
- plesty_lib-0.1.0/plestylib/test/auto_test_sync_device.py +58 -0
- plesty_lib-0.1.0/plestylib/test/device_test.py +125 -0
- plesty_lib-0.1.0/plestylib/test/test_data_array.py +110 -0
- plesty_lib-0.1.0/plestylib/traffic/__init__.py +133 -0
- plesty_lib-0.1.0/plestylib/traffic/serial.py +121 -0
- plesty_lib-0.1.0/plestylib/traffic/tcp_ip.py +106 -0
- plesty_lib-0.1.0/plestylib/traffic/usb_utils.py +68 -0
- plesty_lib-0.1.0/plestylib/traffic/utils.py +120 -0
- plesty_lib-0.1.0/plestylib/traffic/visa.py +95 -0
- plesty_lib-0.1.0/plestylib/utils/__init__.py +6 -0
- plesty_lib-0.1.0/plestylib/utils/dll_utils.py +19 -0
- plesty_lib-0.1.0/plestylib/utils/error_utils.py +29 -0
- plesty_lib-0.1.0/plestylib/utils/logger.py +25 -0
- plesty_lib-0.1.0/plestylib/utils/registry.py +24 -0
- plesty_lib-0.1.0/pyproject.toml +54 -0
- plesty_lib-0.1.0/spdx.tmpl +4 -0
- plesty_lib-0.1.0/uv.lock +1301 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Custom
|
|
2
|
+
.deprecated/
|
|
3
|
+
|
|
4
|
+
# Python bytecode and caches
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# C extensions and shared libraries
|
|
10
|
+
*.so
|
|
11
|
+
*.pyd
|
|
12
|
+
*.dll
|
|
13
|
+
|
|
14
|
+
# Packaging and build artifacts
|
|
15
|
+
build/
|
|
16
|
+
dist/
|
|
17
|
+
*.egg-info/
|
|
18
|
+
.eggs/
|
|
19
|
+
|
|
20
|
+
# Virtual environments
|
|
21
|
+
.venv/
|
|
22
|
+
venv/
|
|
23
|
+
env/
|
|
24
|
+
ENV/
|
|
25
|
+
|
|
26
|
+
# Test and coverage outputs
|
|
27
|
+
.pytest_cache/
|
|
28
|
+
.coverage
|
|
29
|
+
.coverage.*
|
|
30
|
+
htmlcov/
|
|
31
|
+
.mypy_cache/
|
|
32
|
+
.ruff_cache/
|
|
33
|
+
|
|
34
|
+
# Jupyter
|
|
35
|
+
.ipynb_checkpoints/
|
|
36
|
+
|
|
37
|
+
# Logs and runtime files
|
|
38
|
+
*.log
|
|
39
|
+
*.pid
|
|
40
|
+
|
|
41
|
+
# IDE/editor
|
|
42
|
+
.vscode/
|
|
43
|
+
.idea/
|
|
44
|
+
*.swp
|
|
45
|
+
*.swo
|
|
46
|
+
|
|
47
|
+
# OS files
|
|
48
|
+
.DS_Store
|
|
49
|
+
Thumbs.db
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0.dev76+5b01a5a
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/data/ctype_manager/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/async_wrapper/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/device/device_utils/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/sim/data_generator/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/solver/iceblock/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/serial/index.doctree
ADDED
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/tcp_ip/index.doctree
ADDED
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/traffic/usb_utils/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/dll_utils/index.doctree
ADDED
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/error_utils/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
plesty_lib-0.1.0/.plesty/docs-build/.doctrees/reference/plestylib/utils/registry/index.doctree
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
Entry page for [Full API](reference/index) documentation.
|
|
3
|
+
|
|
4
|
+
## Core Packages
|
|
5
|
+
|
|
6
|
+
| Package | Description |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| [`plestylib.data`](reference/plestylib/data/index) | Data containers, units, and type helpers
|
|
9
|
+
| [`plestylib.device`](reference/plestylib/device/index) | Base device model, parameter/function systems, async wrappers |
|
|
10
|
+
| [`plestylib.traffic`](reference/plestylib/traffic/index) | Transport backends (TCP/IP, VISA, Serial) |
|
|
11
|
+
| [`plestylib.solver`](reference/plestylib/solver/index) | Command and operation solvers |
|
|
12
|
+
| [`plestylib.service`](reference/plestylib/service/index) | TCP/IP server/client and service builders |
|
|
13
|
+
| [`plestylib.sim`](reference/plestylib/sim/index) | Synthetic data generation for testing |
|
|
14
|
+
| [`plestylib.utils`](reference/plestylib/utils/index) | Shared utilities (logging, errors, registry, DLL helpers) |
|
|
15
|
+
|
|
File without changes
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Auto Test
|
|
2
|
+
|
|
3
|
+
PlestyLib includes lightweight auto-test helpers to quickly validate a device API implementation.
|
|
4
|
+
|
|
5
|
+
These helpers are intended for development-time smoke testing, not full regression testing.
|
|
6
|
+
|
|
7
|
+
## Available Auto Tests
|
|
8
|
+
|
|
9
|
+
There are two utilities:
|
|
10
|
+
|
|
11
|
+
1. Config auto test: validates registered config parameters (read-only, write-only, read-write).
|
|
12
|
+
2. Function auto test: validates registered operations in the function system.
|
|
13
|
+
|
|
14
|
+
## 1) Config Auto Test (Synchronous Device API)
|
|
15
|
+
|
|
16
|
+
Utility location:
|
|
17
|
+
|
|
18
|
+
`plestylib.test.auto_test_sync_device.auto_test`
|
|
19
|
+
|
|
20
|
+
What it does:
|
|
21
|
+
|
|
22
|
+
1. Opens the device with context manager.
|
|
23
|
+
2. Prints identity.
|
|
24
|
+
3. Queries all read-only configs.
|
|
25
|
+
4. Writes all write-only configs using defaults or dtype-based fallback values.
|
|
26
|
+
5. Writes and re-queries read-write configs.
|
|
27
|
+
|
|
28
|
+
Example:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from plestylib.test.auto_test_sync_device import auto_test
|
|
32
|
+
from powermeter_device import PowermeterDevice
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
auto_test(
|
|
36
|
+
PowermeterDevice,
|
|
37
|
+
"USB0::0x1313::0x8078::P0000001::INSTR",
|
|
38
|
+
sensor_type="S155C",
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Notes:
|
|
43
|
+
|
|
44
|
+
1. For read-write parameters without default value, current queried value is written back.
|
|
45
|
+
2. This avoids guessing unsupported values when device constraints are incomplete.
|
|
46
|
+
|
|
47
|
+
## 2) Function Auto Test (Operation/Func System)
|
|
48
|
+
|
|
49
|
+
Utility location:
|
|
50
|
+
|
|
51
|
+
`plestylib.test.auto_test_func_system.auto_test`
|
|
52
|
+
|
|
53
|
+
What it does:
|
|
54
|
+
|
|
55
|
+
1. Opens the device and optionally queries identity.
|
|
56
|
+
2. Enumerates registered operations from `device._functions`.
|
|
57
|
+
3. Generates valid payloads from `FuncParam` metadata.
|
|
58
|
+
4. Calls each operation and checks response shape.
|
|
59
|
+
5. Prints pass/fail summary.
|
|
60
|
+
|
|
61
|
+
By default it can use a mock operation solver so operation validation can run without real backend behavior.
|
|
62
|
+
|
|
63
|
+
Example (mock solver mode):
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from plestylib.test.auto_test_func_system import auto_test
|
|
67
|
+
from my_device import MyDevice
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
auto_test(
|
|
71
|
+
MyDevice,
|
|
72
|
+
"device-id-or-address",
|
|
73
|
+
use_mock_solver=True,
|
|
74
|
+
seed=123,
|
|
75
|
+
)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Example (real solver mode):
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from plestylib.test.auto_test_func_system import auto_test
|
|
82
|
+
from my_device import MyDevice
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
auto_test(
|
|
86
|
+
MyDevice,
|
|
87
|
+
"device-id-or-address",
|
|
88
|
+
use_mock_solver=False,
|
|
89
|
+
ignore_ops=["dangerous_operation"],
|
|
90
|
+
)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Important Parameters (Function Auto Test)
|
|
94
|
+
|
|
95
|
+
1. `use_mock_solver`:
|
|
96
|
+
When true, binds an internal mock solver that generates output-shaped responses from metadata.
|
|
97
|
+
2. `ignore_ops`:
|
|
98
|
+
List of operation names to skip.
|
|
99
|
+
3. `seed`:
|
|
100
|
+
Seed for deterministic test payload generation.
|
|
101
|
+
4. `sleep_time`:
|
|
102
|
+
Delay between operation calls.
|
|
103
|
+
|
|
104
|
+
## Output Interpretation
|
|
105
|
+
|
|
106
|
+
Function auto test prints one line per operation:
|
|
107
|
+
|
|
108
|
+
1. `[PASS] op_name payload=... response=...`
|
|
109
|
+
2. `[FAIL] op_name payload=... error=...`
|
|
110
|
+
|
|
111
|
+
Then a summary:
|
|
112
|
+
|
|
113
|
+
1. Passed count
|
|
114
|
+
2. Failed count
|
|
115
|
+
3. Passed operation list
|
|
116
|
+
|
|
117
|
+
## Recommended Workflow
|
|
118
|
+
|
|
119
|
+
1. Start with config auto test after registering parameters.
|
|
120
|
+
2. Add function auto test after registering operations.
|
|
121
|
+
3. Run function auto test first with `use_mock_solver=True` to validate schemas.
|
|
122
|
+
4. Then switch to `use_mock_solver=False` for end-to-end backend checks.
|
|
123
|
+
5. Add operation names to `ignore_ops` for stateful or destructive actions.
|
|
124
|
+
|
|
125
|
+
## Limitations
|
|
126
|
+
|
|
127
|
+
1. These helpers are print-based and not pytest assertions by default.
|
|
128
|
+
2. They do not replace integration tests for timing, hardware state transitions, or long-running sequences.
|
|
129
|
+
3. Mock mode validates interface contracts, not real protocol/device behavior.
|
|
130
|
+
|
|
131
|
+
## Using with pytest
|
|
132
|
+
|
|
133
|
+
You can leverage auto-test utilities inside `pytest` suites in two ways.
|
|
134
|
+
|
|
135
|
+
### 1. Smoke-test style (no exception means pass)
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from plestylib.test.auto_test_sync_device import auto_test as auto_test_sync
|
|
139
|
+
from plestylib.test.auto_test_func_system import auto_test as auto_test_func
|
|
140
|
+
from my_device import MyDevice
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def test_config_auto():
|
|
144
|
+
auto_test_sync(MyDevice, "device-id-or-address")
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def test_function_auto_mock():
|
|
148
|
+
auto_test_func(MyDevice, "device-id-or-address", use_mock_solver=True, seed=123)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 2. Assertion style with pytest output capture
|
|
152
|
+
|
|
153
|
+
Because these helpers currently print summary lines, use pytest `capsys` to capture stdout and assert summary text.
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
from plestylib.test.auto_test_func_system import auto_test
|
|
157
|
+
from my_device import MyDevice
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def test_no_failed_operations(capsys):
|
|
161
|
+
auto_test(MyDevice, "device-id-or-address", use_mock_solver=True, seed=123)
|
|
162
|
+
captured = capsys.readouterr()
|
|
163
|
+
assert "Failed: 0" in captured.out, captured.out
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Recommendation
|
|
167
|
+
|
|
168
|
+
For stronger tests, consider extending auto-test helpers to return a summary dictionary (for example passed/failed counts) in addition to printing. Then `pytest` assertions can be done directly without parsing text output.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Base Device
|
|
2
|
+
|
|
3
|
+
`BaseDeviceSyncModel` is the core abstraction for building a synchronized device API in PlestyLib.
|
|
4
|
+
|
|
5
|
+
It combines:
|
|
6
|
+
|
|
7
|
+
1. Device lifecycle (`init`, `connect`, `disconnect`)
|
|
8
|
+
2. Parameter system (`ConfigSystem`)
|
|
9
|
+
3. Function system (`FunctionSystem`)
|
|
10
|
+
4. Standardized read/write/query workflow
|
|
11
|
+
5. Resource ownership and context-manager cleanup
|
|
12
|
+
|
|
13
|
+
## What It Provides
|
|
14
|
+
|
|
15
|
+
When your device class inherits from `BaseDeviceSyncModel`, you get:
|
|
16
|
+
|
|
17
|
+
1. Parameter registration, validation, and typed parsing through `ConfigSystem`.
|
|
18
|
+
2. Function registration and invocation metadata through `FunctionSystem`.
|
|
19
|
+
3. Built-in high-level methods such as `write`, `query`, `state`, and `summary`.
|
|
20
|
+
4. Context manager support (`with device:`) that calls `init`, `connect`, and `disconnect`.
|
|
21
|
+
5. Resource tracking through `ResourceRegistry` to avoid duplicate ownership.
|
|
22
|
+
|
|
23
|
+
## Typical Layering
|
|
24
|
+
|
|
25
|
+
A concrete device class usually composes three parts:
|
|
26
|
+
|
|
27
|
+
1. Device class (inherits `BaseDeviceSyncModel`)
|
|
28
|
+
2. Traffic manager (transport I/O)
|
|
29
|
+
3. Command/operation solver (protocol translation)
|
|
30
|
+
|
|
31
|
+
Data flow:
|
|
32
|
+
|
|
33
|
+
1. `write("KEY", value)` validates input against parameter metadata.
|
|
34
|
+
2. Device `_write_` builds protocol command and sends it via traffic manager.
|
|
35
|
+
3. `query("KEY")` sends protocol query and converts response to target dtype.
|
|
36
|
+
|
|
37
|
+
## Required Methods to Implement
|
|
38
|
+
|
|
39
|
+
Your subclass must implement these methods:
|
|
40
|
+
|
|
41
|
+
1. `connect(self)`
|
|
42
|
+
2. `disconnect(self)`
|
|
43
|
+
3. `_write_(self, key, value)`
|
|
44
|
+
4. `_query_(self, key)`
|
|
45
|
+
5. `check_errors(self)`
|
|
46
|
+
6. `check_operatability(self)`
|
|
47
|
+
|
|
48
|
+
Commonly overridden methods:
|
|
49
|
+
|
|
50
|
+
1. `init(self, main=None)` to create traffic manager and solver objects.
|
|
51
|
+
2. `identity(self)` for model/vendor identification command.
|
|
52
|
+
3. `query_param_range(self, key)` if device can report runtime min/max.
|
|
53
|
+
4. `query_param_options(self, key)` if categorical options are queryable.
|
|
54
|
+
|
|
55
|
+
## Lifecycle
|
|
56
|
+
|
|
57
|
+
Recommended lifecycle:
|
|
58
|
+
|
|
59
|
+
1. Instantiate device object.
|
|
60
|
+
2. Enter context (`with device:`) or call `init()` and `connect()` manually.
|
|
61
|
+
3. Perform `query`/`write` operations.
|
|
62
|
+
4. Call `disconnect()` (automatic when using context manager).
|
|
63
|
+
|
|
64
|
+
Using context manager is recommended because cleanup is guaranteed:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
with MyDevice("dev-id") as dev:
|
|
68
|
+
print(dev.query("POWER"))
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Minimal Implementation Example
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from typing import Any
|
|
75
|
+
|
|
76
|
+
from plestylib.device.base_device_sync import BaseDeviceSyncModel
|
|
77
|
+
from plestylib.traffic.serial import SerialTrafficManager
|
|
78
|
+
from plestylib.solver.scpi import SCPISolver
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class MyScpiSerialDevice(BaseDeviceSyncModel):
|
|
82
|
+
def __init__(self, port: str):
|
|
83
|
+
super().__init__(id=port)
|
|
84
|
+
self.port = port
|
|
85
|
+
|
|
86
|
+
# Register parameters for validation + parsing.
|
|
87
|
+
self.register_config("POWER", dtype=float, read_only=True, command="MEAS:POW")
|
|
88
|
+
self.register_config("WAVELENGTH", dtype=int, command="SENS:WAV")
|
|
89
|
+
|
|
90
|
+
def init(self, main=None):
|
|
91
|
+
self.traffic_manager = SerialTrafficManager(
|
|
92
|
+
port=self.port,
|
|
93
|
+
baudrate=9600,
|
|
94
|
+
timeout=5,
|
|
95
|
+
write_termination="\r",
|
|
96
|
+
read_termination="\r\n",
|
|
97
|
+
)
|
|
98
|
+
self.cmd_solver = SCPISolver()
|
|
99
|
+
|
|
100
|
+
def connect(self):
|
|
101
|
+
return self.traffic_manager.open(parity="none", stopbits="one", bytesize=8)
|
|
102
|
+
|
|
103
|
+
def disconnect(self):
|
|
104
|
+
self.traffic_manager.close()
|
|
105
|
+
|
|
106
|
+
def _write_(self, key: str, value: str | float | int | bool) -> bool:
|
|
107
|
+
cfg = self.get_config(key)
|
|
108
|
+
command = self.cmd_solver.get_write_cmd(cfg, value)
|
|
109
|
+
return bool(self.traffic_manager.send_command(command))
|
|
110
|
+
|
|
111
|
+
def _query_(self, key: str) -> str:
|
|
112
|
+
cfg = self.get_config(key)
|
|
113
|
+
command = self.cmd_solver.get_query_cmd(cfg)
|
|
114
|
+
return self.traffic_manager.send_command(command)
|
|
115
|
+
|
|
116
|
+
def check_errors(self) -> list[str]:
|
|
117
|
+
# Replace with device-specific error query if available.
|
|
118
|
+
return []
|
|
119
|
+
|
|
120
|
+
def check_operatability(self) -> bool:
|
|
121
|
+
return self.traffic_manager is not None and self.traffic_manager.is_open
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## State and Synchronization Helpers
|
|
125
|
+
|
|
126
|
+
Useful built-in helpers:
|
|
127
|
+
|
|
128
|
+
1. `state` / `get_state()`: query all registered parameters and return a dictionary.
|
|
129
|
+
2. `synchronize_param_from_device(keys=None, sync_constraints=False)`: pull current values from hardware into the model.
|
|
130
|
+
3. `summary()`: generate a textual API overview.
|
|
131
|
+
|
|
132
|
+
If your device supports querying dynamic constraints, implement:
|
|
133
|
+
|
|
134
|
+
1. `query_param_range` for numeric parameters.
|
|
135
|
+
2. `query_param_options` for categorical parameters.
|
|
136
|
+
|
|
137
|
+
## Sync vs Async Use
|
|
138
|
+
|
|
139
|
+
`BaseDeviceSyncModel` is synchronous by design. To use it in async applications, wrap it with one of the provided wrappers.
|
|
140
|
+
|
|
141
|
+
1. `AsyncWrapperSafe`: thread-offloaded calls protected by an async lock (simple, safe default).
|
|
142
|
+
2. `AsyncDeviceThread`: dedicated worker thread with queued calls (better for high-frequency workflows).
|
|
143
|
+
|
|
144
|
+
Example with `AsyncWrapperSafe`:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
import asyncio
|
|
148
|
+
from plestylib.device.async_wrapper import AsyncWrapperSafe
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
async def main():
|
|
152
|
+
async with AsyncWrapperSafe(MyScpiSerialDevice("/dev/ttyUSB0")) as dev:
|
|
153
|
+
power = await dev.query("POWER")
|
|
154
|
+
print(power)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
asyncio.run(main())
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Best Practices
|
|
161
|
+
|
|
162
|
+
1. Keep transport logic in traffic managers, not in device classes.
|
|
163
|
+
2. Keep protocol formatting/parsing in solvers.
|
|
164
|
+
3. Register all parameters with correct dtype/range/options for safe validation.
|
|
165
|
+
4. Prefer `with device:` for guaranteed cleanup.
|
|
166
|
+
5. Implement `check_operatability` using a real device health query when possible.
|
|
167
|
+
6. Avoid mixing direct synchronous access and async wrapper access on the same device instance.
|