diff --git a/Python/XA/CHANGELOG.md b/Python/XA/CHANGELOG.md new file mode 100644 index 0000000..f9c21ed --- /dev/null +++ b/Python/XA/CHANGELOG.md @@ -0,0 +1,57 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.1.6] - 2026-03-31 + +### Changed + +- Added GitHub changelog URL to package metadata (#9903). + +## [1.1.5] - 2026-03-27 + +### Changed + +- Internal native API improvements (#9899). + +## [1.1.4] - 2026-03-26 + +### Changed + +- Internal native API improvements (#9895). + +## [1.1.3] - 2026-03-26 + +### Fixed + +- Connected product information now correctly reported as "rotational - continuous" (rather than "rotational - fixed range") for FW103, FW6, FW12, HDR50 and NR360S stages (#9883). + +## [1.1.2] - 2026-03-20 + +### Added + +- Added native API support for PDXC3 (#9879). + +## [1.1.1] - 2026-03-03 + +### Changed + +- Internal native API improvements (#9858). + +## [1.1.0] - 2026-02-19 + +### Added + +- LTS product API support (#9851). +- KDC product API support (#9850). + +## [1.0.0] - 2026-01-21 + +### Added + +- Initial python wrapper API implementation (#9719, #9720). \ No newline at end of file diff --git a/Python/XA/EULA.rtf b/Python/XA/EULA.rtf new file mode 100644 index 0000000..b607a87 --- /dev/null +++ b/Python/XA/EULA.rtf @@ -0,0 +1,55 @@ +{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057\deflangfe2057{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\froman\fprq2\fcharset0 Times New Roman;}} +{\*\generator Riched20 10.0.22621}{\*\mmathPr\mnaryLim0\mdispDef1\mwrapIndent1440 }\viewkind4\uc1 +\pard\brdrb\brdrs\brdrw50\brsp20 \widctlpar\sa120\qc\f0\fs18\lang1033 END-USER LICENSE AGREEMENT FOR \b THORLABS XA SOFTWARE\par +\par + +\pard\widctlpar\sa120\qj\fs16 IMPORTANT-READ CAREFULLY. This End-User License Agreement (\ldblquote EULA\rdblquote ) is a legal AGREEMENT between you (either as a registered individual user or as the registered user/representative and on behalf of a single entity) and the company for the product identified above, which product includes computer software and may include associated media, printed materials, and \ldblquote online\rdblquote or electronic documentation. By installing, copying, or otherwise using the software, you agree to be bound by the terms of this EULA. \i If you do not agree to the terms of this EULA, then DO NOT install or use the XA software; in such event the original purchaser may, however, return it to the place of purchase within thirty days of the date of original purchase for a full refund.\i0\par + +\pard\brdrt\brdrs\brdrw50\brsp20 \widctlpar\sa120\qc\par +XA SOFTWARE LICENSE\par + +\pard\widctlpar\sa120\qj\b0\fs14 The XA SOFTWARE is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE is licensed free of charge for use with any and all supported XA hardware, or the development of end applications thereof, and not sold. \par + +\pard\widctlpar\fi-360\li360\sa120\qj\b 1)\tab GRANT OF LICENSE\b0 . This EULA grants you, the registered user the following rights:\par + +\pard\widctlpar\fi-360\li720\sa120\qj\b\f1\'b7\tab\f0 Applications Software\b0 . The XA SOFTWARE may be used only by you. You may install and use multiple copies of the XA SOFTWARE, or any prior version thereof for the supported operating systems, on more than one computer. \par +\b\f1\'b7\tab\f0 Redistributable File(s)\b0 . Notwithstanding the terms of this EULA to the contrary, certain parts of the executable files of the XA SOFTWARE may be redistributed by you to the extent required for the permitted operation of the application(s) software installation code created by you while using the XA SOFTWARE hereunder. The specific redistributable file(s) are limited to those specifically identified as \ldblquote Redistributables\rdblquote in the media, printed materials, and \ldblquote online\rdblquote or electronic documentation accompanying the particular embodiment of the XA SOFTWARE. To determine whether a particular file(s) are redistributable, please contact Technical Support.\par +\b\f1\'b7\tab\f0 Storage/Network Use\b0 . You may also store or install a copy of the XA SOFTWARE on a storage device, such as a network server, used only to install or run the XA SOFTWARE on your other computers over an internal network.\par +\par + +\pard\widctlpar\fi-360\li360\sa120\qj\b 2)\tab DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS\b0 .\par + +\pard\widctlpar\fi-360\li720\qj\b\f1\'b7\tab\f0\lang2057 Limitations on Reverse Engineering, Decompilation, and Disassembly\b0 . You may not modify, reverse engineer, decompile, or disassemble the XA SOFTWARE, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation of components, and after obtaining relevant permissions from the company, including notification of the intended application and final state of the XA SOFTWARE. The XA SOFTWARE is licensed as a single product. Its component parts may not be separated for use, except those identified as \lang1033 redistributables and used in a manner to distribute an end application\lang2057 .\par +\f2\par + +\pard\widctlpar\fi-360\li720\sa120\qj\b\f1\lang1033\'b7\tab\f0 Rental\b0 . You may not rent or lease the XA SOFTWARE to any party.\par +\b\f1\'b7\tab\f0 Software Transfer\b0 . You may permanently and wholly transfer all of your rights under this EULA, provided you the recipient first agrees to abide by all of the terms of this EULA. If the XA SOFTWARE is an upgrade, any transfer must include any and all prior rights therein. \par +\b\f1\'b7\tab\f0 Support Services\b0 . The company may provide you with support services related to the XA SOFTWARE (\ldblquote Support Services\rdblquote ). The provision and use of Support Services is governed by the policies and programs described in the XA SOFTWARE user manual and/or in \ldblquote online\rdblquote documentation. Any supplemental software code provided to you as part of the Support Services shall be considered part of the XA SOFTWARE and subject to the terms and conditions of this EULA. With respect to technical information you provide to the company as part of the Support Services, the company may use such information for its business purposes, including for product updates and development. The company will use its best efforts to not utilize such technical information in a form that personally identifies you.\par +\b\f1\'b7\tab\f0 Termination\b0 . Without prejudice to any of the companies other rights, the company may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy any and all copies of the XA SOFTWARE and all of its component parts; to this end you grant to the company the right to, with or without notice, monitor your Internet accessible activities for the purpose of verifying XA SOFTWARE performance and/or your compliance with the terms hereof, including, but not limited to the remote monitoring and verification of your implementation, use and duplication of the XA SOFTWARE.\par + +\pard\widctlpar\fi-360\li360\sa120\qj\page\b 3)\tab UPGRADES\b0 . \par + +\pard\widctlpar\fi-360\li720\sa120\qj\b\f1\'b7\tab\b0\f0 If the XA SOFTWARE is labeled or otherwise identified by the company as an \ldblquote upgrade\rdblquote , you must be properly licensed to use a product identified by the company as being eligible for the upgrade in order to use the XA SOFTWARE. A version of XA SOFTWARE, labeled or otherwise identified by the company as an upgrade, replaces and/or supplements the product that formed the basis for your eligibility for such upgrade. You may use the resulting upgraded product only in accordance with the terms of this EULA. If the version of XA SOFTWARE is an upgrade of a component of a package of software programs that you licensed as a single product, the XA SOFTWARE may be used and transferred only as part of that single product package.\par + +\pard\widctlpar\fi-360\li360\sa120\qj\par + +\pard\keepn\widctlpar\fi-360\li360\sa120\qj\b 4)\tab COPYRIGHT AND TRADEMARKS.\b0 \par + +\pard\widctlpar\fi-360\li720\sa120\qj\f1\'b7\tab\f0 All title, trademarks and copyrights in and pertaining to the XA SOFTWARE (including but not limited to any images, photographs, animation, video, audio, music, text, and applets incorporated into the XA SOFTWARE), the accompanying, printed materials and any copies of the XA SOFTWARE are owned by the company or its affiliated companies. The XA SOFTWARE is protected by copyright and trademark laws and international treaty provisions. You must treat the XA SOFTWARE like any other copyrighted material for archival purposes, and you may not copy the printed materials accompanying the XA SOFTWARE other than for the use by you.\par +\f1\'b7\tab\f0 You may not remove, modify or alter any company copyright or trademark notice from any part of the XA SOFTWARE, including but not limited to any such notices contained in the physical and/or electronic media or documentation, in the Setup Wizard dialogue or \lquote about\rquote boxes, in any of the runtime resources and/or in any web-presence or web-enabled notices, code or other embodiments originally contained in or dynamically or otherwise created by the XA SOFTWARE.\par + +\pard\widctlpar\fi-360\li360\sa120\qj\b 5)\tab DUAL-MEDIA SOFTWARE.\b0 You may receive the XA SOFTWARE in more than one medium. Regardless of the type or size of the medium you receive, you may not loan, rent, lease, or otherwise transfer the other medium to another user, except as part of the permanent transfer (as provided above) of the XA SOFTWARE.\par + +\pard\widctlpar\li360\sa120\qj\par + +\pard\widctlpar\fi-360\li360\sa120\qj\b 6)\tab LIMITED WARRANTY\b0\par + +\pard\widctlpar\fi-360\li720\sa120\qj\b\f1\'b7\tab\f0 Limited Warranty\b0 . The company warrants that (a) the XA SOFTWARE will, for a period of ninety (90) days from the date of your receipt, perform substantially in accordance with the\b \b0 written materials accompanying it, (b) any Support Services provided by the company shall be substantially as described in applicable written materials provided to you by the company, and (c) Company support engineers will make commercially reasonable efforts to solve any problem issues with the XA SOFTWARE. To the extent that implied warranties on the XA SOFTWARE are disclaimable, they are disclaimed herein below. Some countries do not allow disclaimers of or limitations on the duration of an implied warranty, so the above limitation may not apply to you. To the extent implied warranties may not be entirely disclaimed but implied warranty limitations are allowed by applicable law, implied warranties on the XA SOFTWARE, if any, are limited to ninety (90) days.\par +\b\f1\'b7\tab\f0 Customer Remedies\b0 . The company and its suppliers\rquote entire liability and your exclusive remedy shall be, at the companies option, either (a) return of the price paid by you for the accompanying XA hardware (not to exceed the retail price) if any, or (b) repair or replacement of the component(s) of the XA SOFTWARE that do(es) not meet the companies Warranty and which is returned to the company with a copy of your purchase receipt. This Limited Warranty is void if failure of the XA SOFTWARE has resulted from accident, abuse, or misapplication. Any replacement XA SOFTWARE will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer. Outside of the United Kingdom, neither of these remedies nor any product support services offered by the company are available without proof of purchase from an authorized international source.\par +\b\f1\'b7\tab\f0 No Other Warranties.\b0 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE COMPANY AND ITS SUPPLIERS DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE XA SOFTWARE AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO STATE/JURISDICTION.\par + +\pard\widctlpar\fi-360\li360\sa120\qj\b 7)\tab LIMITATION OF LIABILITY\b0 . TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL THE COMPANY OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE XA SOFTWARE OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF THE COMPANY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. \fs16\par + +\pard\widctlpar\f2\fs20\lang2057\par +} + \ No newline at end of file diff --git a/Python/XA/LICENSE b/Python/XA/LICENSE new file mode 100644 index 0000000..4b88951 --- /dev/null +++ b/Python/XA/LICENSE @@ -0,0 +1,16 @@ +The XA Python SDK is licensed under the BSD 3-Clause license: +============================================================= + +Copyright © 2024-2025 Thorlabs + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The XA native library is licensed under the separate Thorlabs EULA found in EULA.rtf in the installed package folder. \ No newline at end of file diff --git a/Python/XA/MANIFEST.in b/Python/XA/MANIFEST.in new file mode 100644 index 0000000..cec4c11 --- /dev/null +++ b/Python/XA/MANIFEST.in @@ -0,0 +1,4 @@ +include EULA.rtf +include VERSION +include ReadMe.md +include CHANGELOG.md \ No newline at end of file diff --git a/Python/XA/ReadMe.md b/Python/XA/ReadMe.md new file mode 100644 index 0000000..b5c3458 --- /dev/null +++ b/Python/XA/ReadMe.md @@ -0,0 +1,5 @@ +# Thorlabs XA Python SDK + +This is the official Thorlabs XA Python SDK. The required XA native SDK is included in this package. + +Please refer to the LICENSE file for details regarding the licensing of this package and its dependencies. \ No newline at end of file diff --git a/Python/XA/VERSION b/Python/XA/VERSION new file mode 100644 index 0000000..bb18ded --- /dev/null +++ b/Python/XA/VERSION @@ -0,0 +1 @@ +0.0.0.0.dev0 \ No newline at end of file diff --git a/Python/XA/examples/kdc101_test_script.py b/Python/XA/examples/kdc101_test_script.py new file mode 100644 index 0000000..16323f1 --- /dev/null +++ b/Python/XA/examples/kdc101_test_script.py @@ -0,0 +1,314 @@ +import platform + +from thorlabs_xa.products.kdc101 import Kdc101 +from thorlabs_xa.shared.diagnostics_helper import DiagnosticsHelper +from thorlabs_xa.shared.system_manager import SystemManager +from thorlabs_xa.shared.enums import TLMC_DigitalOutput, TLMC_EnableState, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_JogMode, TLMC_JogStopMode, TLMC_MoveMode, TLMC_OperatingMode, TLMC_SoftLimitOperatingMode, TLMC_Wait +from thorlabs_xa.shared.params import TLMC_DcPidParams, TLMC_DeviceInfo, TLMC_GeneralMoveParams, TLMC_HomeParams, TLMC_JogParams, TLMC_LimitSwitchParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams +from thorlabs_xa.shared.xa_error_factory import XADeviceException + +KDC101_PART_NUMBER = "KDC101" + +SIMULATION_CONFIG_STRING = { "PartNumber" : KDC101_PART_NUMBER, "SerialNumber" : "27001234", "ActuatorType" : "MTS25-Z8" } +DEFAULT_TIMEOUT = 5000 + +def create_simulation(system_manager: SystemManager) -> TLMC_DeviceInfo: + + system_manager.create_simulation(SIMULATION_CONFIG_STRING) + + device_info = TLMC_DeviceInfo() + + device_info.device_type_description = SIMULATION_CONFIG_STRING["PartNumber"] + device_info.device = SIMULATION_CONFIG_STRING["SerialNumber"] + device_info.transport = "" + + return device_info + +def main() -> None: + + device: Kdc101 | None = None + + system_manager = SystemManager.instance() + + if platform.system() == "Linux": + # If using Linux, we are required to state the port explicitly. Replace if you require an alternative port. + system_manager.startup("deviceDiscovery.connections=/dev/ttyUSB0") + else: + system_manager.startup() + + devices = system_manager.get_device_list() + device_info: TLMC_DeviceInfo | None = None + + if not devices: + print("No devices found, check that your device is powered and is visible to your system. Continuing with simulation!") + device_info = create_simulation(system_manager) + else: + print("Devices found:") + for listed_device_info in devices: + print (f"{listed_device_info.device_type_description}:{listed_device_info.device} found at {listed_device_info.transport} ({listed_device_info.part_number})") + + if listed_device_info.part_number == KDC101_PART_NUMBER: + device_info = listed_device_info + + if not device_info: + print("No KDC101 devices found, check that your device is powered and is visible to your system. Continuing with simulation!") + device_info = create_simulation(system_manager) + + try: + + # Create device object and enable device. + device = system_manager.open_device_as(device_info.device, device_info.transport, TLMC_OperatingMode.TLMC_OperatingMode_Default, Kdc101) + + DiagnosticsHelper.console("Enabling KDC101...") + device.set_enable_state(TLMC_EnableState.TLMC_Enabled) + + enable_state = device.get_enable_state(DEFAULT_TIMEOUT) + + if enable_state == TLMC_EnableState.TLMC_Enabled: + DiagnosticsHelper.console_green("KDC101 enabled.") + else: + DiagnosticsHelper.console_error("KDC101 not enabled as expected.") + return + + DiagnosticsHelper.console(f"Device part number is {device.get_hardware_info(TLMC_Wait.TLMC_InfiniteWait).part_number}") + + DiagnosticsHelper.console("Testing round trip of DC PID Params...") + + dc_pid_params = TLMC_DcPidParams() + dc_pid_params.integral = 90 + dc_pid_params.filter_control = 0b00001111 + dc_pid_params.derivative = 40 + dc_pid_params.integral_limit = 45 + dc_pid_params.proportional = 150 + + device.set_dc_pid_params(dc_pid_params) + + dc_pid_params_returned = device.get_dc_pid_params(DEFAULT_TIMEOUT) + + dc_pid_params_string = DiagnosticsHelper.object_as_string(dc_pid_params) + dc_pid_params_returned_string = DiagnosticsHelper.object_as_string(dc_pid_params_returned) + + DiagnosticsHelper.console(f"Sent: {dc_pid_params_string}") + DiagnosticsHelper.console(f"Received: {dc_pid_params_returned_string}") + + if dc_pid_params_string == dc_pid_params_returned_string: + + DiagnosticsHelper.console_green("DC PID Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("DC PID Params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of digital output states...") + + digital_output = TLMC_DigitalOutput.TLMC_DigitalOutput_1 + device.set_digital_output_states(digital_output) + + digital_output_returned = device.get_digital_output_states(DEFAULT_TIMEOUT) + + DiagnosticsHelper.console(f"Sent: {digital_output}") + DiagnosticsHelper.console(f"Received: {digital_output_returned}") + + if digital_output == digital_output_returned: + + DiagnosticsHelper.console_green("Digital Output States round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Digital Output States round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of general move params...") + + general_move_params = TLMC_GeneralMoveParams() + general_move_params.backlash_distance = 50 + + device.set_general_move_params(general_move_params) + + general_move_params_returned = device.get_general_move_params(DEFAULT_TIMEOUT) + + general_move_params_string = DiagnosticsHelper.object_as_string(general_move_params) + general_move_params_returned_string = DiagnosticsHelper.object_as_string(general_move_params_returned) + + DiagnosticsHelper.console(f"Sent: {general_move_params_string}") + DiagnosticsHelper.console(f"Received: {general_move_params_returned_string}") + + if general_move_params_string == general_move_params_returned_string: + + DiagnosticsHelper.console_green("General move params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("General move params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of home params...") + + home_params = TLMC_HomeParams() + + home_params.direction = TLMC_HomeDirection.TLMC_HomeDirection_Forward + home_params.limit_switch = TLMC_HomeLimitSwitch.TLMC_HomeLimitSwitch_Reverse + home_params.offset_distance = 40 + home_params.velocity = 50 + + device.set_home_params(home_params) + + home_params_returned = device.get_home_params(DEFAULT_TIMEOUT) + + home_params_string = DiagnosticsHelper.object_as_string(home_params) + home_params_returned_string = DiagnosticsHelper.object_as_string(home_params_returned) + + DiagnosticsHelper.console(f"Sent: {home_params_string}") + DiagnosticsHelper.console(f"Received: {home_params_returned_string}") + + if home_params_string == home_params_returned_string: + + DiagnosticsHelper.console_green("Home Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Home Params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of jog params...") + + jog_params = TLMC_JogParams() + jog_params.acceleration = 20 + jog_params.max_velocity = 25 + jog_params.min_velocity = 0 + jog_params.mode = TLMC_JogMode.TLMC_JogMode_SingleStep + jog_params.step_size = 36 + jog_params.stop_mode = TLMC_JogStopMode.TLMC_JogStopMode_Profiled + + device.set_jog_params(jog_params) + + jog_params_returned = device.get_jog_params(DEFAULT_TIMEOUT) + + jog_params_string = DiagnosticsHelper.object_as_string(jog_params) + jog_params_returned_string = DiagnosticsHelper.object_as_string(jog_params_returned) + + DiagnosticsHelper.console(f"Sent: {jog_params_string}") + DiagnosticsHelper.console(f"Received: {jog_params_returned_string}") + + if jog_params_string == jog_params_returned_string: + + DiagnosticsHelper.console_green("Jog Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Jog Params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of limit switch params...") + + limit_switch_params = TLMC_LimitSwitchParams() + limit_switch_params.clockwise_limit_mode = TLMC_HardLimitOperatingMode.TLMC_HardLimitOperatingMode_SwitchContactMakes + limit_switch_params.clockwise_soft_limit = 20 + limit_switch_params.counterclockwise_limit_mode = TLMC_HardLimitOperatingMode.TLMC_HardLimitOperatingMode_SwitchContactMakes + limit_switch_params.counterclockwise_soft_limit = 30 + limit_switch_params.soft_limit_operating_mode = TLMC_SoftLimitOperatingMode.TLMC_SoftLimitOperatingMode_Ignored + + device.set_limit_switch_params(limit_switch_params) + + limit_switch_params_returned = device.get_limit_switch_params(DEFAULT_TIMEOUT) + + limit_switch_params_string = DiagnosticsHelper.object_as_string(limit_switch_params) + limit_switch_params_returned_string = DiagnosticsHelper.object_as_string(limit_switch_params_returned) + + DiagnosticsHelper.console(f"Sent: {limit_switch_params_string}") + DiagnosticsHelper.console(f"Received: {limit_switch_params_returned_string}") + + if limit_switch_params_string == limit_switch_params_returned_string: + + DiagnosticsHelper.console_green("Limit Switch Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Limit Switch Params round trip test failed.") + + DiagnosticsHelper.console("Running test move command...") + device.move(TLMC_MoveMode.TLMC_MoveMode_ContinuousForward, 500, DEFAULT_TIMEOUT) + + DiagnosticsHelper.console("Testing round trip of move absolute params...") + + move_absolute_params = TLMC_MoveAbsoluteParams() + move_absolute_params.absolute_position = 500 + + device.set_move_absolute_params(move_absolute_params) + + move_absolute_params_returned = device.get_move_absolute_params(DEFAULT_TIMEOUT) + + move_absolute_params_string = DiagnosticsHelper.object_as_string(move_absolute_params) + move_absolute_params_returned_string = DiagnosticsHelper.object_as_string(move_absolute_params_returned) + + DiagnosticsHelper.console(f"Sent: {move_absolute_params_string}") + DiagnosticsHelper.console(f"Received: {move_absolute_params_returned_string}") + + if move_absolute_params_string == move_absolute_params_returned_string: + + DiagnosticsHelper.console_green("Move Absolute Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Move Absolute Params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of move relative params...") + + move_relative_params = TLMC_MoveRelativeParams() + move_relative_params.relative_distance = 400 + + device.set_move_relative_params(move_relative_params) + + move_relative_params_returned = device.get_move_relative_params(DEFAULT_TIMEOUT) + + move_relative_params_string = DiagnosticsHelper.object_as_string(move_relative_params) + move_relative_params_returned_string = DiagnosticsHelper.object_as_string(move_relative_params_returned) + + DiagnosticsHelper.console(f"Sent: {move_relative_params_string}") + DiagnosticsHelper.console(f"Received: {move_relative_params_returned_string}") + + if move_relative_params_string == move_relative_params_returned_string: + + DiagnosticsHelper.console_green("Move Relative Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Move Relative Params round trip test failed.") + + position_counter = 50 + device.set_position_counter(position_counter) + + position_counter_returned = device.get_position_counter(DEFAULT_TIMEOUT) + + if position_counter == position_counter_returned: + + DiagnosticsHelper.console_green("Position Counter round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Position Counter round trip test failed.") + + DiagnosticsHelper.console("Getting universal status...") + universal_status = device.get_universal_status(DEFAULT_TIMEOUT) + + DiagnosticsHelper.console(DiagnosticsHelper.object_as_string(universal_status)) + + DiagnosticsHelper.console("Getting universal status bits...") + universal_status_bits = device.get_universal_status_bits(DEFAULT_TIMEOUT) + + DiagnosticsHelper.console(DiagnosticsHelper.object_as_string(universal_status_bits)) + + + except XADeviceException as e: + + print("Encountered error, code: ", e.error_code) + + finally: + + if device is not None: + DiagnosticsHelper.console("Shutting down KDC101...") + device.disconnect() + device.close() + + DiagnosticsHelper.console("Shutting down system...") + system_manager.shutdown() + + DiagnosticsHelper.console("Completed.") + +main() \ No newline at end of file diff --git a/Python/XA/examples/kpc101_test_script.py b/Python/XA/examples/kpc101_test_script.py new file mode 100644 index 0000000..cd42224 --- /dev/null +++ b/Python/XA/examples/kpc101_test_script.py @@ -0,0 +1,339 @@ +import time +import platform + +from thorlabs_xa.products.kpc101 import Kpc101 +from thorlabs_xa.shared.diagnostics_helper import DiagnosticsHelper +from thorlabs_xa.shared.enums import TLMC_EnableState, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickGear, TLMC_KcubeMmiLockState, TLMC_OperatingMode, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_PositionControlMode, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StatusItemId, TLMC_Wait +from thorlabs_xa.shared.params import TLMC_DeviceInfo, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformParams +from thorlabs_xa.shared.system_manager import SystemManager + +from thorlabs_xa.shared.xa_error_factory import XADeviceException + +KPC101_PART_NUMBER = "KPC101" + +SIMULATION_CONFIG_STRING = { "PartNumber" : KPC101_PART_NUMBER, "SerialNumber" : "113000001" } +DEFAULT_TIMEOUT = 5000 + +def create_simulation(system_manager: SystemManager) -> TLMC_DeviceInfo: + + system_manager.create_simulation(SIMULATION_CONFIG_STRING) + + device_info = TLMC_DeviceInfo() + + device_info.device_type_description = SIMULATION_CONFIG_STRING["PartNumber"] + device_info.device = SIMULATION_CONFIG_STRING["SerialNumber"] + device_info.transport = "" + + return device_info + +def main() -> None: + + device: Kpc101 | None = None + + system_manager = SystemManager.instance() + + if platform.system() == "Linux": + # If using Linux, we are required to state the port explicitly. Replace if you require an alternative port. + system_manager.startup("deviceDiscovery.connections=/dev/ttyUSB0") + else: + system_manager.startup() + + devices = system_manager.get_device_list() + device_info: TLMC_DeviceInfo | None = None + + if not devices: + print("No devices found, check that your device is powered and is visible to your system. Continuing with simulation!") + device_info = create_simulation(system_manager) + else: + print("Devices found:") + for listed_device_info in devices: + print (f"{listed_device_info.device_type_description}:{listed_device_info.device} found at {listed_device_info.transport} ({listed_device_info.part_number})") + + if listed_device_info.part_number == KPC101_PART_NUMBER: + device_info = listed_device_info + + if not device_info: + print("No KPC101 devices found, check that your device is powered and is visible to your system. Continuing with simulation!") + device_info = create_simulation(system_manager) + + try: + + # Create device object and enable device. + device = system_manager.open_device_as(device_info.device, device_info.transport, TLMC_OperatingMode.TLMC_OperatingMode_Default, Kpc101) + + DiagnosticsHelper.console("Enabling KPC101...") + device.set_enable_state(TLMC_EnableState.TLMC_Enabled) + + enable_state = device.get_enable_state(DEFAULT_TIMEOUT) + + if enable_state == TLMC_EnableState.TLMC_Enabled: + DiagnosticsHelper.console_green("KPC101 enabled.") + else: + DiagnosticsHelper.console_error("KPC101 not enabled as expected.") + + # Get Connected controller part number and available methods. + DiagnosticsHelper.console(f"Device part number is {device.get_hardware_info(TLMC_Wait.TLMC_InfiniteWait).part_number}") + + # Convert unit methods used to work in real world units. + physical_voltage, voltage_unit = device.convert_from_device_units_to_physical(TLMC_ScaleType.TLMC_ScaleType_Voltage, 1000) + DiagnosticsHelper.console(f"New converted value is: {physical_voltage} Unit: {voltage_unit}.") + + # Test round trip of IO settings params + DiagnosticsHelper.console("Testing round trip of KPC IO Settings Params...") + + settings_params = TLMC_PZ_KpcIoSettingsParams() + settings_params.analog_input_source = TLMC_PZ_KpcAnalogInputSource.TLMC_PZ_KpcAnalogInputSource_HubInputA + settings_params.voltage_limit = 75 + settings_params.voltage_range = TLMC_PZ_KpcVoltageRange.TLMC_PZ_KpcVoltageRange_75Volts + settings_params.strain_gauge_option = TLMC_PZ_KpcStrainGaugeOption.TLMC_PZ_KpcStrainGaugeOption_Position + settings_params.filter_cut_off_frequency = 40 + settings_params.force_sense = 50 + + device.set_io_settings_params(settings_params) + + settings_params_returned = device.get_io_settings_params(DEFAULT_TIMEOUT) + + settings_params_string = DiagnosticsHelper.object_as_string(settings_params) + settings_params_returned_string = DiagnosticsHelper.object_as_string(settings_params_returned) + + DiagnosticsHelper.console(f"Sent: {settings_params_string}") + DiagnosticsHelper.console(f"Received: {settings_params_returned_string}") + + if settings_params_string == settings_params_returned_string: + + DiagnosticsHelper.console_green("KPC IO Settings Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("KPC IO Settings Params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of KPC IO Trigger Params...") + + trigger_params = TLMC_PZ_KpcIoTriggerParams() + trigger_params.trigger_1_mode = TLMC_PZ_KpcIoTriggerMode.TLMC_PZ_KpcIoTriggerMode_InputTriggersVoltagePositionStepDown + trigger_params.trigger_1_polarity = TLMC_KcubeIoTriggerPolarity.TLMC_KcubeIoTriggerPolarity_ActiveIsLogicHigh + trigger_params.trigger_2_mode = TLMC_PZ_KpcIoTriggerMode.TLMC_PZ_KpcIoTriggerMode_OutputActiveStrainGaugeLessThanUpperLimit + trigger_params.trigger_2_polarity = TLMC_KcubeIoTriggerPolarity.TLMC_KcubeIoTriggerPolarity_ActiveIsLogicLow + trigger_params.monitor_output_mode = TLMC_PZ_KpcMonitorOutputMode.TLMC_PZ_KpcMonitorOutputMode_Software + trigger_params.monitor_output_software_value = 50 + trigger_params.monitor_filter_cut_off_frequency = 250 + trigger_params.smoothing_samples = 300 + trigger_params.strain_gauge_lower_limit = 20 + trigger_params.strain_gauge_upper_limit = 40 + + device.set_io_trigger_params(trigger_params) + + trigger_params_returned = device.get_io_trigger_params(DEFAULT_TIMEOUT) + + trigger_params_string = DiagnosticsHelper.object_as_string(trigger_params) + trigger_params_returned_string = DiagnosticsHelper.object_as_string(trigger_params_returned) + + DiagnosticsHelper.console(f"Sent: {trigger_params_string}") + DiagnosticsHelper.console(f"Received: {trigger_params_returned_string}") + + if trigger_params_string == trigger_params_returned_string: + + DiagnosticsHelper.console_green("KPC IO Trigger Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("KPC IO Trigger Params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of KPC MMI Params...") + + mmi_params = TLMC_PZ_KpcMmiParams() + mmi_params.display_brightness = 20 + mmi_params.display_dim_level = 10 + mmi_params.display_timeout = 5 + mmi_params.joystick_direction_sense = TLMC_PZ_KpcMmi_JoystickDirectionSense.TLMC_PZ_KpcMmiJoystickDirectionSense_Normal + mmi_params.joystick_gear = TLMC_KcubeMmi_JoystickGear.TLMC_KcubeMmiJoystickGear_High + mmi_params.joystick_mode = TLMC_PZ_KpcMmi_JoystickMode.TLMC_PZ_KpcMmiJoystickMode_GoesToVoltagePosition + mmi_params.joystick_position_step_size = 33 + mmi_params.joystick_voltage_step_size = 30 + mmi_params.preset_position_1 = 0 + mmi_params.preset_position_2 = 33 + mmi_params.preset_voltage_1 = 5 + mmi_params.preset_voltage_2 = 40 + + device.set_kpc_mmi_params(mmi_params) + + mmi_params_returned = device.get_kpc_mmi_params(DEFAULT_TIMEOUT) + + mmi_params_string = DiagnosticsHelper.object_as_string(mmi_params) + mmi_params_returned_string = DiagnosticsHelper.object_as_string(mmi_params_returned) + + DiagnosticsHelper.console(f"Sent: {mmi_params_string}") + DiagnosticsHelper.console(f"Received: {mmi_params_returned_string}") + + if mmi_params_string == mmi_params_returned_string: + + DiagnosticsHelper.console_green("KPC MMI Params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("KPC MMI Params round trip test failed.") + + DiagnosticsHelper.console("Getting settings...") + + json_settings = device.get_settings(TLMC_SettingStringFormat.TLMC_SettingStringFormat_Json, True) + DiagnosticsHelper.console(json_settings) + + # Set to open loop position control mode + DiagnosticsHelper.console("Setting to open loop control mode...") + device.set_position_control_mode(TLMC_PZ_PositionControlMode.TLMC_PZ_PositionControlMode_OpenLoop) + + position_control_mode_returned = device.get_position_control_mode(DEFAULT_TIMEOUT) + + if position_control_mode_returned == TLMC_PZ_PositionControlMode.TLMC_PZ_PositionControlMode_OpenLoop: + + DiagnosticsHelper.console_green("KPC set to open loop.") + + else: + + DiagnosticsHelper.console_error(f"KPC not set to open loop (set to {position_control_mode_returned}).") + + # Set a new target output voltage and wait + DiagnosticsHelper.console("Setting output voltage and waiting...") + device.set_output_voltage(25) + + time.sleep(3) + + print("New output voltage is:", device.get_output_voltage(DEFAULT_TIMEOUT)) + + io_settings_params = device.get_io_settings_params(DEFAULT_TIMEOUT) + print("Output voltage limit is:", io_settings_params.voltage_limit) + + status_items_count = device.get_status_item_count() + status_items = device.get_status_items(0, status_items_count) + + for status_item in status_items: + DiagnosticsHelper.console_object(status_item) + + error_status_item = device.get_status_item(TLMC_StatusItemId.TLMC_StatusItemId_Error) + print (f"Error status item: ID {error_status_item.id.name}, Value: {error_status_item.value}, Value type: {error_status_item.value_type.name}") + + connected_product = device.get_connected_product_info() + print(f"Product name: {connected_product.product_name}") + + device_firmware_version, required_firmware_version = device.get_firmware_version_info(DEFAULT_TIMEOUT) + + DiagnosticsHelper.console_object(device_firmware_version) + DiagnosticsHelper.console_object(required_firmware_version) + + hardware_info = device.get_hardware_info(DEFAULT_TIMEOUT) + DiagnosticsHelper.console_object(hardware_info) + + DiagnosticsHelper.console("Testing round trip of Kcube MMI lock state...") + lock_state = TLMC_KcubeMmiLockState.TLMC_KcubeMmiLockState_Locked + device.set_kcube_mmi_lock_state(lock_state) + + lock_state_returned = device.get_kcube_mmi_lock_state(DEFAULT_TIMEOUT) + + DiagnosticsHelper.console(f"Sent: {lock_state.name}") + DiagnosticsHelper.console(f"Received: {lock_state_returned.name}") + + if (lock_state == lock_state_returned): + + DiagnosticsHelper.console_green(f"MMI lock state set to set to {lock_state.name} as expected.") + + else: + + DiagnosticsHelper.console_error(f"MMI lock state not set to {lock_state.name} as expected (set to {lock_state_returned.name}.") + + DiagnosticsHelper.console("Testing round trip of max travel...") + + max_travel = 50 + device.set_max_travel(max_travel) + + max_travel_returned = device.get_max_travel(DEFAULT_TIMEOUT) + + if max_travel == max_travel_returned: + + DiagnosticsHelper.console_green(f"Max travel set to {max_travel} as expected.") + + else: + + DiagnosticsHelper.console_error(f"Max travel not set to {max_travel_returned} as expected.") + + DiagnosticsHelper.console("Testing round trip of output voltage control source params...") + + source_params = TLMC_PZ_OutputVoltageControlSourceParams() + source_params.source = TLMC_PZ_OutputVoltageControlSource.TLMC_PZ_OutputVoltageControlSource_Knob + + device.set_output_voltage_control_source_params(source_params) + + source_params_returned = device.get_output_voltage_control_source_params(DEFAULT_TIMEOUT) + + source_params_string = DiagnosticsHelper.object_as_string(source_params) + source_params_returned_string = DiagnosticsHelper.object_as_string(source_params_returned) + + DiagnosticsHelper.console(f"Sent: {source_params_string}") + DiagnosticsHelper.console(f"Received: {source_params_returned_string}") + + if source_params_string == source_params_returned_string: + + DiagnosticsHelper.console_green("Output voltage control source params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Output voltage control source params round trip test failed.") + + DiagnosticsHelper.console("Testing round trip of output waveform params...") + + waveform_params = TLMC_PZ_OutputWaveformParams() + waveform_params.mode = TLMC_PZ_OutputWaveformOperatingMode.TLMC_PZ_OutputWaveformOperatingMode_OutputGated + waveform_params.inter_sample_delay = 500 + waveform_params.number_of_cycles = 30 + waveform_params.number_of_samples_between_trigger_repetition = 30 + waveform_params.number_of_samples_per_cycle = 30 + waveform_params.output_trigger_start_index = 3 + waveform_params.output_trigger_width = 20 + waveform_params.post_cycle_delay = 20 + waveform_params.pre_cycle_delay = 10 + + device.set_output_waveform_params(waveform_params) + + waveform_params_returned = device.get_output_waveform_params(DEFAULT_TIMEOUT) + + waveform_params_string = DiagnosticsHelper.object_as_string(waveform_params) + waveform_params_returned_string = DiagnosticsHelper.object_as_string(waveform_params_returned) + + DiagnosticsHelper.console(f"Sent: {waveform_params_string}") + DiagnosticsHelper.console(f"Received: {waveform_params_returned_string}") + + if waveform_params_string == waveform_params_returned_string: + + DiagnosticsHelper.console_green("Output waveform params round trip test passed.") + + else: + + DiagnosticsHelper.console_error("Output waveform params round trip test failed.") + + DiagnosticsHelper.console_object(device.get_piezo_status(DEFAULT_TIMEOUT)) + + DiagnosticsHelper.console_object(device.get_piezo_status_bits(DEFAULT_TIMEOUT)) + + DiagnosticsHelper.console_object(device.get_preferred_physical_unit(TLMC_ScaleType.TLMC_ScaleType_Voltage)) + + settings_items = device.get_settings_items() + + for settings_item in settings_items: + DiagnosticsHelper.console_object(settings_item) + + except XADeviceException as e: + + print("Encountered error, code: ", e.error_code) + + finally: + + if device is not None: + DiagnosticsHelper.console("Shutting down KPC101...") + device.disconnect() + device.close() + + DiagnosticsHelper.console("Shutting down system...") + system_manager.shutdown() + + DiagnosticsHelper.console("Completed.") + +main() \ No newline at end of file diff --git a/Python/XA/examples/linear_translation_stage_test_script.py b/Python/XA/examples/linear_translation_stage_test_script.py new file mode 100644 index 0000000..a3fb20c --- /dev/null +++ b/Python/XA/examples/linear_translation_stage_test_script.py @@ -0,0 +1,137 @@ +import platform + +from thorlabs_xa.products.linear_translation_stage import LinearTranslationStage +from thorlabs_xa.shared.diagnostics_helper import DiagnosticsHelper +from thorlabs_xa.shared.enums import TLMC_EnableState, TLMC_OperatingMode, TLMC_MoveMode, TLMC_ScaleType, TLMC_Wait +from thorlabs_xa.shared.params import TLMC_DeviceInfo, TLMC_GeneralMoveParams, TLMC_MoveAbsoluteParams, TLMC_VelocityParams +from thorlabs_xa.shared.system_manager import SystemManager + +from thorlabs_xa.shared.xa_error_factory import XADeviceException + +LTS300C_PART_NUMBER = "LTS300C" + +SIMULATION_CONFIG_STRING = { "PartNumber" : LTS300C_PART_NUMBER, "SerialNumber" : "45000001" } +# TLMC_InfiniteWait +DEFAULT_TIMEOUT = -1 + +def create_simulation(system_manager: SystemManager) -> TLMC_DeviceInfo: + system_manager.create_simulation(SIMULATION_CONFIG_STRING) + + device_info = TLMC_DeviceInfo() + device_info.device_type_description = SIMULATION_CONFIG_STRING["PartNumber"] + device_info.device = SIMULATION_CONFIG_STRING["SerialNumber"] + device_info.transport = "" + + return device_info + +def main() -> None: + + device: LinearTranslationStage | None = None + + system_manager = SystemManager.instance() + + if platform.system() == "Linux": + # If using Linux, we are required to state the port explicitly. Replace if you require an alternative port. + system_manager.startup("deviceDiscovery.connections=/dev/ttyUSB0") + else: + system_manager.startup() + + devices = system_manager.get_device_list() + device_info: TLMC_DeviceInfo | None = None + + if not devices: + print("No devices found, check that your device is powered and is visible to your system. Continuing with simulation!") + device_info = create_simulation(system_manager) + else: + print("Devices found:") + for listed_device_info in devices: + print (f"{listed_device_info.device_type_description}:{listed_device_info.device} found at {listed_device_info.transport} ({listed_device_info.part_number})") + + if listed_device_info.part_number == LTS300C_PART_NUMBER: + device_info = listed_device_info + + if not device_info: + print("No LTS devices found, check that your device is powered and is visible to your system. Continuing with simulation!") + device_info = create_simulation(system_manager) + + try: + # Create device object and enable device. + device = system_manager.open_device_as(device_info.device, device_info.transport, TLMC_OperatingMode.TLMC_OperatingMode_Default, LinearTranslationStage) + + DiagnosticsHelper.console(f"Enabling {device_info.device_type_description}...") + device.set_enable_state(TLMC_EnableState.TLMC_Enabled) + + enable_state = device.get_enable_state(DEFAULT_TIMEOUT) + + if enable_state == TLMC_EnableState.TLMC_Enabled: + DiagnosticsHelper.console_green(f"{device_info.device_type_description} enabled.") + else: + DiagnosticsHelper.console_error(f"{device_info.device_type_description} not enabled as expected.") + + # Get Connected controller part number and available methods. + DiagnosticsHelper.console(f"Device part number is {device.get_hardware_info(TLMC_Wait.TLMC_InfiniteWait).part_number}") + + # Home the stage + DiagnosticsHelper.console(f"Homing {device_info.device_type_description}") + device.home(DEFAULT_TIMEOUT) + + # Convert unit methods used to work in real world units. + physical_position, position_unit = device.convert_from_device_units_to_physical(TLMC_ScaleType.TLMC_ScaleType_Distance, 1000) + DiagnosticsHelper.console(f"Physical position: {physical_position}, device unit position: {position_unit}") + + # Test setting parameters. + DiagnosticsHelper.console("Testing velocity params...") + velocity_params = TLMC_VelocityParams() + velocity_params.acceleration = 1000 + velocity_params.max_velocity = 2000 + velocity_params.min_velocity = 1000 + + device.set_velocity_params(velocity_params) + + velocity_params_returned = device.get_velocity_params(DEFAULT_TIMEOUT) + + settings_params_string = DiagnosticsHelper.object_as_string(velocity_params) + settings_params_returned_string = DiagnosticsHelper.object_as_string(velocity_params_returned) + + DiagnosticsHelper.console(f"Sent: {settings_params_string}") + DiagnosticsHelper.console(f"Received: {settings_params_returned_string}") + + # Testing move param structures and moves + DiagnosticsHelper.console("Testing general move params...") + move_params = TLMC_GeneralMoveParams() + move_params.backlash_distance = 200 + + device.set_general_move_params(move_params) + + DiagnosticsHelper.console("Testing absolute move params...") + absolute_move_params = TLMC_MoveAbsoluteParams() + absolute_move_params.absolute_position = 1000 + + device.set_move_absolute_params(absolute_move_params) + + absolute_move_settings_returned = device.get_move_absolute_params(DEFAULT_TIMEOUT) + + move_absolute_params_string = DiagnosticsHelper.object_as_string(absolute_move_params) + move_absolute_params_returned_string = DiagnosticsHelper.object_as_string(absolute_move_settings_returned) + + DiagnosticsHelper.console(f"Sent: {move_absolute_params_string}") + DiagnosticsHelper.console(f"Received: {move_absolute_params_returned_string}") + + device.move(TLMC_MoveMode.TLMC_MoveMode_AbsoluteToProgrammedPosition, 0 , DEFAULT_TIMEOUT) + + + except XADeviceException as e: + print("Encountered error, code: ", e.error_code) + + finally: + if device is not None: + DiagnosticsHelper.console("Shutting down LTS...") + device.disconnect() + device.close() + + DiagnosticsHelper.console("Shutting down system...") + system_manager.shutdown() + + DiagnosticsHelper.console("Completed.") + +main() \ No newline at end of file diff --git a/Python/XA/examples/lnnx_test_script.py b/Python/XA/examples/lnnx_test_script.py new file mode 100644 index 0000000..a317008 --- /dev/null +++ b/Python/XA/examples/lnnx_test_script.py @@ -0,0 +1,33 @@ +from thorlabs_xa.products.lnnx import Lnnx +from thorlabs_xa.shared.enums import TLMC_OperatingMode +from thorlabs_xa.shared.system_manager import SystemManager +from thorlabs_xa.shared.xa_error_factory import XADeviceException + +MB_SERIAL = "123000001" +CH1_SERIAL = "124000001" +CH2_SERIAL = "124000002" +CH3_SERIAL = "124000003" + +DEFAULT_TRANSPORT = "" + +system_manager = SystemManager.instance() + +device: Lnnx | None = None + +try: + system_manager.startup() + + device = system_manager.open_device_as(MB_SERIAL, DEFAULT_TRANSPORT, TLMC_OperatingMode.TLMC_OperatingMode_Default, Lnnx) + +except XADeviceException as e: + print("Encountered error, code: ", e.error_code) + +finally: + + if device is not None: + try: + device.close() + except Exception: + pass + + system_manager.shutdown() \ No newline at end of file diff --git a/Python/XA/pyproject.toml b/Python/XA/pyproject.toml new file mode 100644 index 0000000..f5b211d --- /dev/null +++ b/Python/XA/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/Python/XA/setup.py b/Python/XA/setup.py new file mode 100644 index 0000000..41f46a9 --- /dev/null +++ b/Python/XA/setup.py @@ -0,0 +1,72 @@ +from setuptools import setup, find_packages, Distribution +from wheel.bdist_wheel import bdist_wheel as _bdist_wheel +import platform +import shutil +import os +from pathlib import Path + +# Open the readme content for including as the long description of the package +with open("ReadMe.md", "r") as file: + read_me_content = file.read() + +# The wheel is NOT pure python (contains native files). +class BinaryDistribution(Distribution): + def has_ext_modules(self): + return True + def is_pure(self): + return False + +# Force tags py3-none-. This is specifically OK in our case, because we don't have any +# CPython dependent Python extensions being shipped with the package, just our native library +class bdist_wheel(_bdist_wheel): + def get_tag(self): + _, _, plat = super().get_tag() + return "py3", "none", plat + +included_native_library = "" + +if platform.system() == "Windows": + included_native_library = "tlmc_xa_native.dll" +elif platform.system() == "Linux": + included_native_library = "libtlmc_xa_native.so" +else: + print("ERROR: Current system operating system not recognised for Python SDK package.") + exit -1 + +# Read the version from the VERSION file +sdk_version = "" + +version_file = Path("VERSION") + +with open("VERSION", "r") as versionfile: + sdk_version = versionfile.readline().strip() + +print ("Building for {} {}.".format(platform.system(), platform.machine())) + +setup( + name="thorlabs_xa", + version = sdk_version, + include_package_data=True, + author = "Thorlabs", + author_email = "techsupport@thorlabs.com", + description = "Thorlabs XA Python SDK", + project_urls={ + "Changelog": "https://github.com/Thorlabs/Motion_Control_Examples/blob/main/Python/XA/CHANGELOG.md" + }, + long_description = read_me_content, + long_description_content_type="text/markdown", + package_data={"thorlabs_xa": [included_native_library]}, + package_dir={"": "src"}, + distclass=BinaryDistribution, + cmdclass={"bdist_wheel": bdist_wheel}, + license="BSD-3-Clause", + license_files=["LICENSE"], + packages=find_packages(where="src"), + classifiers=[ + "Programming Language :: Python :: 3", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux" + ], + python_requires='>=3.10, <4', + install_requires=[], +) diff --git a/Python/XA/src/thorlabs_xa/__init__.py b/Python/XA/src/thorlabs_xa/__init__.py new file mode 100644 index 0000000..9eca9d5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/__init__.py @@ -0,0 +1,6 @@ +#from thorlabs_xa.native_sdks.c_native_functions import CNativeFunctions + +# This ensures that the native DLL is loaded from the thorlabs_xa folder, which is compatible with circumstances where +# the python SDK is installed as a package via PIP. Note this script is automatically executed by the interpreter +# when this, or child packages, are imported by a script. It is only executed once over the lifetime of a script. +#CNativeFunctions.try_load_library(__file__) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/__init__.py b/Python/XA/src/thorlabs_xa/implementations/__init__.py new file mode 100644 index 0000000..7463971 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/__init__.py @@ -0,0 +1 @@ +# Blank - just an indicator that this is a package folder \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/__init__.py b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/kdc101_feature_group.py b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/kdc101_feature_group.py new file mode 100644 index 0000000..ea88d87 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/kdc101_feature_group.py @@ -0,0 +1,255 @@ +import thorlabs_xa.interfaces.device_feature_groups.kdc101_feature_group + +from thorlabs_xa.implementations.device_features.connected_product_feature import ConnectedProductFeature +from thorlabs_xa.implementations.device_features.dc_pid_params_feature import DcPidParamsFeature +from thorlabs_xa.implementations.device_features.digital_output_states_feature import DigitalOutputStatesFeature +from thorlabs_xa.implementations.device_features.disconnect_feature import DisconnectFeature +from thorlabs_xa.implementations.device_features.enable_state_feature import EnableStateFeature +from thorlabs_xa.implementations.device_features.end_of_move_messages_mode_feature import EndOfMoveMessagesModeFeature +from thorlabs_xa.implementations.device_features.firmware_version_info_feature import FirmwareVersionInfoFeature +from thorlabs_xa.implementations.device_features.general_move_params_feature import GeneralMoveParamsFeature +from thorlabs_xa.implementations.device_features.hardware_info_feature import HardwareInfoFeature +from thorlabs_xa.implementations.device_features.home_feature import HomeFeature +from thorlabs_xa.implementations.device_features.home_params_feature import HomeParamsFeature +from thorlabs_xa.implementations.device_features.identify_feature import IdentifyFeature +from thorlabs_xa.implementations.device_features.jog_params_feature import JogParamsFeature +from thorlabs_xa.implementations.device_features.kcube_io_trigger_params_feature import KcubeIoTriggerParamsFeature +from thorlabs_xa.implementations.device_features.kcube_mmi_params_feature import KcubeMmiParamsFeature +from thorlabs_xa.implementations.device_features.kcube_position_trigger_params_feature import KcubePositionTriggerParamsFeature +from thorlabs_xa.implementations.device_features.limit_switch_params_getter_feature import LimitSwitchParamsGetterFeature +from thorlabs_xa.implementations.device_features.limit_switch_params_setter_feature import LimitSwitchParamsSetterFeature +from thorlabs_xa.implementations.device_features.load_params_feature import LoadParamsFeature +from thorlabs_xa.implementations.device_features.move_absolute_params_feature import MoveAbsoluteParamsFeature +from thorlabs_xa.implementations.device_features.move_feature import MoveFeature +from thorlabs_xa.implementations.device_features.move_relative_params_feature import MoveRelativeParamsFeature +from thorlabs_xa.implementations.device_features.persist_params_feature import PersistParamsFeature +from thorlabs_xa.implementations.device_features.position_counter_feature import PositionCounterFeature +from thorlabs_xa.implementations.device_features.restore_factory_defaults_feature import RestoreFactoryDefaultsFeature +from thorlabs_xa.implementations.device_features.rich_response_feature import RichResponseFeature +from thorlabs_xa.implementations.device_features.settings_feature import SettingsFeature +from thorlabs_xa.implementations.device_features.status_items_feature import StatusItemsFeature +from thorlabs_xa.implementations.device_features.status_mode_feature import StatusModeFeature +from thorlabs_xa.implementations.device_features.status_request_feature import StatusRequestFeature +from thorlabs_xa.implementations.device_features.stop_feature import StopFeature +from thorlabs_xa.implementations.device_features.unit_converter_feature import UnitConverterFeature +from thorlabs_xa.implementations.device_features.universal_status_feature import UniversalStatusFeature +from thorlabs_xa.implementations.device_features.universal_status_bits_feature import UniversalStatusBitsFeature +from thorlabs_xa.implementations.device_features.velocity_params_feature import VelocityParamsFeature + +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.dc_pid_params import DcPidParams +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.end_of_move_messages_mode import EndOfMoveMessagesMode +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.interfaces.device_features.kcube_io_trigger_params import KcubeIoTriggerParams +from thorlabs_xa.interfaces.device_features.kcube_mmi_params import KcubeMmiParams +from thorlabs_xa.interfaces.device_features.kcube_position_trigger_params import KcubePositionTriggerParams +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.interfaces.device_features.limit_switch_params_setter import LimitSwitchParamsSetter +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.interfaces.device_features.universal_status_bits import UniversalStatusBits +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class Kdc101FeatureGroup(thorlabs_xa.interfaces.device_feature_groups.kdc101_feature_group.Kdc101FeatureGroup): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self._connected_product_feature = ConnectedProductFeature(device_handle, native_functions) + self._dc_pid_params_feature = DcPidParamsFeature(device_handle, native_functions) + self._digital_output_states_feature = DigitalOutputStatesFeature(device_handle, native_functions) + self._disconnect_feature = DisconnectFeature(device_handle, native_functions) + self._enable_state_feature = EnableStateFeature(device_handle, native_functions) + self._end_of_move_messages_mode_feature = EndOfMoveMessagesModeFeature(device_handle, native_functions) + self._firmware_version_info_feature = FirmwareVersionInfoFeature(device_handle, native_functions) + self._general_move_params_feature = GeneralMoveParamsFeature(device_handle, native_functions) + self._hardware_info_feature = HardwareInfoFeature(device_handle, native_functions) + self._home_feature = HomeFeature(device_handle, native_functions) + self._home_params_feature = HomeParamsFeature(device_handle, native_functions) + self._identify_feature = IdentifyFeature(device_handle, native_functions) + self._jog_params_feature = JogParamsFeature(device_handle, native_functions) + self._kcube_mmi_params_feature = KcubeMmiParamsFeature(device_handle, native_functions) + self._kcube_position_trigger_params_feature = KcubePositionTriggerParamsFeature(device_handle, native_functions) + self._kcube_io_trigger_params_feature = KcubeIoTriggerParamsFeature(device_handle, native_functions) + self._limit_switch_params_getter_feature = LimitSwitchParamsGetterFeature(device_handle, native_functions) + self._limit_switch_params_setter_feature = LimitSwitchParamsSetterFeature(device_handle, native_functions) + self._load_params_feature = LoadParamsFeature(device_handle, native_functions) + self._move_feature = MoveFeature(device_handle, native_functions) + self._move_absolute_params_feature = MoveAbsoluteParamsFeature(device_handle, native_functions) + self._move_relative_params_feature = MoveRelativeParamsFeature(device_handle, native_functions) + self._persist_params_feature = PersistParamsFeature(device_handle, native_functions) + self._position_counter_feature = PositionCounterFeature(device_handle, native_functions) + self._restore_factory_defaults_feature = RestoreFactoryDefaultsFeature(device_handle, native_functions) + self._rich_response_feature = RichResponseFeature(device_handle, native_functions) + self._set_status_mode_feature = StatusModeFeature(device_handle, native_functions) + self._settings_feature = SettingsFeature(device_handle, native_functions) + self._status_items_feature = StatusItemsFeature(device_handle, native_functions) + self._status_request_feature = StatusRequestFeature(device_handle, native_functions) + self._stop_feature = StopFeature(device_handle, native_functions) + self._unit_converter_feature = UnitConverterFeature(device_handle, native_functions) + self._universal_status_feature = UniversalStatusFeature(device_handle, native_functions) + self._universal_status_bits_feature = UniversalStatusBitsFeature(device_handle, native_functions) + self._velocity_params_feature = VelocityParamsFeature(device_handle, native_functions) + + @property + def connected_product_feature(self) -> ConnectedProduct: + return self._connected_product_feature + + @property + def dc_pid_params_feature(self) -> DcPidParams: + return self._dc_pid_params_feature + + @property + def digital_output_states_feature(self) -> DigitalOutputStates: + return self._digital_output_states_feature + + @property + def disconnect_feature(self) -> Disconnect: + return self._disconnect_feature + + @property + def enable_state_feature(self) -> EnableState: + return self._enable_state_feature + + @property + def end_of_move_messages_mode_feature(self) -> EndOfMoveMessagesMode: + return self._end_of_move_messages_mode_feature + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: + return self._firmware_version_info_feature + + @property + def general_move_params_feature(self) -> GeneralMoveParams: + return self._general_move_params_feature + + @property + def hardware_info_feature(self) -> HardwareInfo: + return self._hardware_info_feature + + @property + def home_feature(self) -> Home: + return self._home_feature + + @property + def home_params_feature(self) -> HomeParams: + return self._home_params_feature + + @property + def identify_feature(self) -> Identify: + return self._identify_feature + + @property + def jog_params_feature(self) -> JogParams: + return self._jog_params_feature + + @property + def kcube_mmi_params_feature(self) -> KcubeMmiParams: + return self._kcube_mmi_params_feature + + @property + def kcube_position_trigger_params_feature(self) -> KcubePositionTriggerParams: + return self._kcube_position_trigger_params_feature + + @property + def kcube_io_trigger_params_feature(self) -> KcubeIoTriggerParams: + return self._kcube_io_trigger_params_feature + + @property + def limit_switch_params_getter_feature(self) -> LimitSwitchParamsGetter: + return self._limit_switch_params_getter_feature + + @property + def limit_switch_params_setter_feature(self) -> LimitSwitchParamsSetter: + return self._limit_switch_params_setter_feature + + @property + def load_params_feature(self) -> LoadParams: + return self._load_params_feature + + @property + def move_feature(self) -> Move: + return self._move_feature + + @property + def move_absolute_params_feature(self) -> MoveAbsoluteParams: + return self._move_absolute_params_feature + + @property + def move_relative_params_feature(self) -> MoveRelativeParams: + return self._move_relative_params_feature + + @property + def persist_params_feature(self) -> PersistParams: + return self._persist_params_feature + + @property + def position_counter_feature(self) -> PositionCounter: + return self._position_counter_feature + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: + return self._restore_factory_defaults_feature + + @property + def rich_response_feature(self) -> RichResponse: + return self._rich_response_feature + + @property + def set_status_mode_feature(self) -> StatusMode: + return self._set_status_mode_feature + + @property + def settings_feature(self) -> Settings: + return self._settings_feature + + @property + def status_items_feature(self) -> StatusItems: + return self._status_items_feature + + @property + def status_request_feature(self) -> StatusRequest: + return self._status_request_feature + + @property + def stop_feature(self) -> Stop: + return self._stop_feature + + @property + def unit_converter_feature(self) -> UnitConverter: + return self._unit_converter_feature + + @property + def universal_status_feature(self) -> UniversalStatus: + return self._universal_status_feature + + @property + def universal_status_bits_feature(self) -> UniversalStatusBits: + return self._universal_status_bits_feature + + @property + def velocity_params_feature(self) -> VelocityParams: + return self._velocity_params_feature \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/kpc101_feature_group.py b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/kpc101_feature_group.py new file mode 100644 index 0000000..b57d597 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/kpc101_feature_group.py @@ -0,0 +1,227 @@ +import thorlabs_xa.interfaces.device_feature_groups.kpc101_feature_group + +from thorlabs_xa.implementations.device_features.connected_product_feature import ConnectedProductFeature +from thorlabs_xa.implementations.device_features.digital_output_states_feature import DigitalOutputStatesFeature +from thorlabs_xa.implementations.device_features.disconnect_feature import DisconnectFeature +from thorlabs_xa.implementations.device_features.enable_state_feature import EnableStateFeature +from thorlabs_xa.implementations.device_features.firmware_version_info_feature import FirmwareVersionInfoFeature +from thorlabs_xa.implementations.device_features.hardware_info_feature import HardwareInfoFeature +from thorlabs_xa.implementations.device_features.identify_feature import IdentifyFeature +from thorlabs_xa.implementations.device_features.kcube_mmi_lock_feature import KcubeMmiLockFeature +from thorlabs_xa.implementations.device_features.piezo.kpc_io_settings_params_feature import KpcIoSettingsParamsFeature +from thorlabs_xa.implementations.device_features.piezo.kpc_io_trigger_params_feature import KpcIoTriggerParamsFeature +from thorlabs_xa.implementations.device_features.load_params_feature import LoadParamsFeature +from thorlabs_xa.implementations.device_features.persist_params_feature import PersistParamsFeature +from thorlabs_xa.implementations.device_features.piezo.kpc_mmi_params_feature import KpcMmiParamsFeature +from thorlabs_xa.implementations.device_features.piezo.max_travel_feature import MaxTravelFeature +from thorlabs_xa.implementations.device_features.piezo.output_voltage_control_source_params_feature import OutputVoltageControlSourceParamsFeature +from thorlabs_xa.implementations.device_features.piezo.output_voltage_feature import OutputVoltageFeature +from thorlabs_xa.implementations.device_features.piezo.output_waveform_feature import OutputWaveformFeature +from thorlabs_xa.implementations.device_features.piezo.output_waveform_params_getter_feature import OutputWaveformParamsGetterFeature +from thorlabs_xa.implementations.device_features.piezo.piezo_status_bits_feature import PiezoStatusBitsFeature +from thorlabs_xa.implementations.device_features.piezo.piezo_status_feature import PiezoStatusFeature +from thorlabs_xa.implementations.device_features.piezo.position_control_mode_feature import PositionControlModeFeature +from thorlabs_xa.implementations.device_features.piezo.position_feature import PositionFeature +from thorlabs_xa.implementations.device_features.piezo.position_loop_params_feature import PositionLoopParamsFeature +from thorlabs_xa.implementations.device_features.restore_factory_defaults_feature import RestoreFactoryDefaultsFeature +from thorlabs_xa.implementations.device_features.rich_response_feature import RichResponseFeature +from thorlabs_xa.implementations.device_features.settings_feature import SettingsFeature +from thorlabs_xa.implementations.device_features.status_items_feature import StatusItemsFeature +from thorlabs_xa.implementations.device_features.status_mode_feature import StatusModeFeature +from thorlabs_xa.implementations.device_features.status_request_feature import StatusRequestFeature +from thorlabs_xa.implementations.device_features.unit_converter_feature import UnitConverterFeature +from thorlabs_xa.implementations.device_features.piezo.zero_feature import ZeroFeature + +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.kcube_mmi_lock import KcubeMmiLock +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_settings_params import KpcIoSettingsParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_trigger_params import KpcIoTriggerParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_mmi_params import KpcMmiParams +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.interfaces.device_features.piezo.output_waveform import OutputWaveform +from thorlabs_xa.interfaces.device_features.piezo.output_waveform_params_getter import OutputWaveformParamsGetter +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.interfaces.device_features.piezo.position_loop_params import PositionLoopParams +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class Kpc101FeatureGroup(thorlabs_xa.interfaces.device_feature_groups.kpc101_feature_group.Kpc101FeatureGroup): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self._connected_product_feature = ConnectedProductFeature(device_handle, native_functions) + self._digital_output_states_feature = DigitalOutputStatesFeature(device_handle, native_functions) + self._disconnect_feature = DisconnectFeature(device_handle, native_functions) + self._enable_state_feature = EnableStateFeature(device_handle, native_functions) + self._firmware_version_info_feature = FirmwareVersionInfoFeature(device_handle, native_functions) + self._hardware_info_feature = HardwareInfoFeature(device_handle, native_functions) + self._identify_feature = IdentifyFeature(device_handle, native_functions) + self._kcube_mmi_lock_feature = KcubeMmiLockFeature(device_handle, native_functions) + self._kpc_io_settings_params_feature = KpcIoSettingsParamsFeature(device_handle, native_functions) + self._kpc_io_trigger_params_feature = KpcIoTriggerParamsFeature(device_handle, native_functions) + self._kpc_mmi_params_feature = KpcMmiParamsFeature(device_handle, native_functions) + self._load_params_feature = LoadParamsFeature(device_handle, native_functions) + self._max_travel_feature = MaxTravelFeature(device_handle, native_functions) + self._output_voltage_feature = OutputVoltageFeature(device_handle, native_functions) + self._output_voltage_control_source_params_feature = OutputVoltageControlSourceParamsFeature(device_handle, native_functions) + self._output_waveform_feature = OutputWaveformFeature(device_handle, native_functions) + self._output_waveform_params_getter_feature = OutputWaveformParamsGetterFeature(device_handle, native_functions) + self._persist_params_feature = PersistParamsFeature(device_handle, native_functions) + self._piezo_status_feature = PiezoStatusFeature(device_handle, native_functions) + self._piezo_status_bits_feature = PiezoStatusBitsFeature(device_handle, native_functions) + self._position_loop_params_feature = PositionLoopParamsFeature(device_handle, native_functions) + self._position_feature = PositionFeature(device_handle, native_functions) + self._position_control_mode_feature = PositionControlModeFeature(device_handle, native_functions) + self._restore_factory_defaults_feature = RestoreFactoryDefaultsFeature(device_handle, native_functions) + self._rich_response_feature = RichResponseFeature(device_handle, native_functions) + self._settings_feature = SettingsFeature(device_handle, native_functions) + self._status_items_feature = StatusItemsFeature(device_handle, native_functions) + self._status_request_feature = StatusRequestFeature(device_handle, native_functions) + self._set_status_mode_feature = StatusModeFeature(device_handle, native_functions) + self._unit_converter_feature = UnitConverterFeature(device_handle, native_functions) + self._zero_feature = ZeroFeature(device_handle, native_functions) + + @property + def connected_product_feature(self) -> ConnectedProduct: + return self._connected_product_feature + + @property + def digital_output_states_feature(self) -> DigitalOutputStates: + return self._digital_output_states_feature + + @property + def disconnect_feature(self) -> Disconnect: + return self._disconnect_feature + + @property + def enable_state_feature(self) -> EnableState: + return self._enable_state_feature + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: + return self._firmware_version_info_feature + + @property + def hardware_version_info_feature(self) -> HardwareInfo: + return self._hardware_info_feature + + @property + def identify_feature(self) -> Identify: + return self._identify_feature + + @property + def kcube_mmi_lock_feature(self) -> KcubeMmiLock: + return self._kcube_mmi_lock_feature + + @property + def kpc_io_settings_params_feature(self) -> KpcIoSettingsParams: + return self._kpc_io_settings_params_feature + + @property + def kpc_io_trigger_params_feature(self) -> KpcIoTriggerParams: + return self._kpc_io_trigger_params_feature + + @property + def kpc_mmi_params_feature(self) -> KpcMmiParams: + return self._kpc_mmi_params_feature + + @property + def load_params_feature(self) -> LoadParams: + return self._load_params_feature + + @property + def max_travel_feature(self) -> MaxTravel: + return self._max_travel_feature + + @property + def output_voltage_feature(self) -> OutputVoltage: + return self._output_voltage_feature + + @property + def output_voltage_control_source_params_feature(self) -> OutputVoltageControlSourceParams: + return self._output_voltage_control_source_params_feature + + @property + def output_waveform_feature(self) -> OutputWaveform: + return self._output_waveform_feature + + @property + def output_waveform_params_getter_feature(self) -> OutputWaveformParamsGetter: + return self._output_waveform_params_getter_feature + + @property + def persist_params_feature(self) -> PersistParams: + return self._persist_params_feature + + @property + def piezo_status_feature(self) -> PiezoStatus: + return self._piezo_status_feature + + @property + def piezo_status_bits_feature(self) -> PiezoStatusBits: + return self._piezo_status_bits_feature + + @property + def position_loop_params_feature(self) -> PositionLoopParams: + return self._position_loop_params_feature + + @property + def position_feature(self) -> Position: + return self._position_feature + + @property + def position_control_mode_feature(self) -> PositionControlMode: + return self._position_control_mode_feature + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: + return self._restore_factory_defaults_feature + + @property + def rich_response_feature(self) -> RichResponse: + return self._rich_response_feature + + @property + def settings_feature(self) -> Settings: + return self._settings_feature + + @property + def status_items_feature(self) -> StatusItems: + return self._status_items_feature + + @property + def status_request_feature(self) -> StatusRequest: + return self._status_request_feature + + @property + def set_status_mode_feature(self) -> StatusMode: + return self._set_status_mode_feature + + @property + def unit_converter_feature(self) -> UnitConverter: + return self._unit_converter_feature + + @property + def zero_feature(self) -> Zero: + return self._zero_feature \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/linear_translation_stage_feature_group.py b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/linear_translation_stage_feature_group.py new file mode 100644 index 0000000..5208e92 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/linear_translation_stage_feature_group.py @@ -0,0 +1,213 @@ +import thorlabs_xa.interfaces.device_feature_groups.linear_translation_stage_feature_group + +from thorlabs_xa.implementations.device_features.button_params_feature import ButtonParamsFeature +from thorlabs_xa.implementations.device_features.calibration_feature import CalibrationFeature +from thorlabs_xa.implementations.device_features.connected_product_feature import ConnectedProductFeature +from thorlabs_xa.implementations.device_features.disconnect_feature import DisconnectFeature +from thorlabs_xa.implementations.device_features.enable_state_feature import EnableStateFeature +from thorlabs_xa.implementations.device_features.firmware_version_info_feature import FirmwareVersionInfoFeature +from thorlabs_xa.implementations.device_features.general_move_params_feature import GeneralMoveParamsFeature +from thorlabs_xa.implementations.device_features.hardware_info_feature import HardwareInfoFeature +from thorlabs_xa.implementations.device_features.home_feature import HomeFeature +from thorlabs_xa.implementations.device_features.home_params_feature import HomeParamsFeature +from thorlabs_xa.implementations.device_features.identify_feature import IdentifyFeature +from thorlabs_xa.implementations.device_features.jog_params_feature import JogParamsFeature +from thorlabs_xa.implementations.device_features.limit_switch_params_getter_feature import LimitSwitchParamsGetterFeature +from thorlabs_xa.implementations.device_features.load_params_feature import LoadParamsFeature +from thorlabs_xa.implementations.device_features.move_feature import MoveFeature +from thorlabs_xa.implementations.device_features.move_absolute_params_feature import MoveAbsoluteParamsFeature +from thorlabs_xa.implementations.device_features.move_relative_params_feature import MoveRelativeParamsFeature +from thorlabs_xa.implementations.device_features.persist_params_feature import PersistParamsFeature +from thorlabs_xa.implementations.device_features.position_counter_feature import PositionCounterFeature +from thorlabs_xa.implementations.device_features.potentiometer_params_feature import PotentiometerParamsFeature +from thorlabs_xa.implementations.device_features.status_mode_feature import StatusModeFeature +from thorlabs_xa.implementations.device_features.settings_feature import SettingsFeature +from thorlabs_xa.implementations.device_features.status_items_feature import StatusItemsFeature +from thorlabs_xa.implementations.device_features.status_request_feature import StatusRequestFeature +from thorlabs_xa.implementations.device_features.stepper_status_feature import StepperStatusFeature +from thorlabs_xa.implementations.device_features.stop_feature import StopFeature +from thorlabs_xa.implementations.device_features.unit_converter_feature import UnitConverterFeature +from thorlabs_xa.implementations.device_features.universal_status_feature import UniversalStatusFeature +from thorlabs_xa.implementations.device_features.velocity_params_feature import VelocityParamsFeature + +from thorlabs_xa.interfaces.device_features.button_params import ButtonParams +from thorlabs_xa.interfaces.device_features.calibration import Calibration +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.potentiometer_params import PotentiometerParams +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.stepper_status import StepperStatus +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class LinearTranslationStageFeatureGroup(thorlabs_xa.interfaces.device_feature_groups.linear_translation_stage_feature_group.LinearTranslationStageFeatureGroup): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self._button_params_feature = ButtonParamsFeature(device_handle, native_functions) + self._calibration_feature = CalibrationFeature(device_handle, native_functions) + self._connected_product_feature = ConnectedProductFeature(device_handle, native_functions) + self._disconnect_feature = DisconnectFeature(device_handle, native_functions) + self._enable_state_feature = EnableStateFeature(device_handle, native_functions) + self._firmware_version_info_feature = FirmwareVersionInfoFeature(device_handle, native_functions) + self._general_move_params = GeneralMoveParamsFeature(device_handle, native_functions) + self._hardware_info_feature = HardwareInfoFeature(device_handle, native_functions) + self._home_feature = HomeFeature(device_handle, native_functions) + self._home_params_feature = HomeParamsFeature(device_handle, native_functions) + self._identify_feature = IdentifyFeature(device_handle, native_functions) + self._jog_params_feature = JogParamsFeature(device_handle, native_functions) + self._limit_switch_params_getter_feature = LimitSwitchParamsGetterFeature(device_handle, native_functions) + self._load_params_feature = LoadParamsFeature(device_handle, native_functions) + self._move_feature = MoveFeature(device_handle, native_functions) + self._move_absolute_params_feature = MoveAbsoluteParamsFeature(device_handle, native_functions) + self._move_relative_params_feature = MoveRelativeParamsFeature(device_handle, native_functions) + self._persist_params_feature = PersistParamsFeature(device_handle, native_functions) + self._potentiometer_params_feature = PotentiometerParamsFeature(device_handle, native_functions) + self._position_counter_feature = PositionCounterFeature(device_handle, native_functions) + self._status_mode_feature = StatusModeFeature(device_handle, native_functions) + self._settings_feature = SettingsFeature(device_handle, native_functions) + self._status_items_feature = StatusItemsFeature(device_handle, native_functions) + self._status_request_feature = StatusRequestFeature(device_handle, native_functions) + self._stepper_status_feature = StepperStatusFeature(device_handle, native_functions) + self._stop_feature = StopFeature(device_handle, native_functions) + self._unit_converter_feature = UnitConverterFeature(device_handle, native_functions) + self._universal_status_feature = UniversalStatusFeature(device_handle, native_functions) + self._velocity_params_feature = VelocityParamsFeature(device_handle, native_functions) + + @property + def button_params_feature(self) -> ButtonParams: + return self._button_params_feature + + @property + def calibration_feature(self) -> Calibration: + return self._calibration_feature + + @property + def connected_product_feature(self) -> ConnectedProduct: + return self._connected_product_feature + + @property + def disconnect_feature(self) -> Disconnect: + return self._disconnect_feature + + @property + def enable_state_feature(self) -> EnableState: + return self._enable_state_feature + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: + return self.firmware_version_info_feature + + @property + def general_move_params_feature(self) -> GeneralMoveParams: + return self._general_move_params + + @property + def hardware_info_feature(self) -> HardwareInfo: + return self._hardware_info_feature + + @property + def home_feature(self) -> Home: + return self._home_feature + + @property + def home_params_feature(self) -> HomeParams: + return self._home_params_feature + + @property + def identify_feature(self) -> Identify: + return self._identify_feature + + @property + def jog_params_feature(self) -> JogParams: + return self._jog_params_feature + + @property + def limit_switch_params_getter_feature(self) -> LimitSwitchParamsGetter: + return self._limit_switch_params_getter_feature + + @property + def load_params_feature(self) -> LoadParams: + return self._load_params_feature + + @property + def move_feature(self) -> Move: + return self._move_feature + + @property + def move_absolute_params_feature(self) -> MoveAbsoluteParams: + return self._move_absolute_params_feature + + @property + def move_relative_params_feature(self) -> MoveRelativeParams: + return self._move_relative_params_feature + + @property + def persist_params_feature(self) -> PersistParams: + return self._persist_params_feature + + @property + def potentiometer_params_feature(self) -> PotentiometerParams: + return self._potentiometer_params_feature + + @property + def position_counter_feature(self) -> PositionCounter: + return self._position_counter_feature + + @property + def status_mode_feature(self) -> StatusMode: + return self._status_mode_feature + + @property + def settings_feature(self) -> Settings: + return self._settings_feature + + @property + def status_items_feature(self) -> StatusItems: + return self._status_items_feature + + @property + def status_request_feature(self) -> StatusRequest: + return self._status_request_feature + + @property + def stepper_status_feature(self) -> StepperStatus: + return self._stepper_status_feature + + @property + def stop_feature(self) -> Stop: + return self._stop_feature + + @property + def unit_converter_feature(self) -> UnitConverter: + return self._unit_converter_feature + + @property + def universal_status_feature(self) -> UniversalStatus: + return self._universal_status_feature + + @property + def velocity_params_feature(self) -> VelocityParams: + return self._velocity_params_feature + diff --git a/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/lnnx_feature_group.py b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/lnnx_feature_group.py new file mode 100644 index 0000000..aaabb9c --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/lnnx_feature_group.py @@ -0,0 +1,170 @@ +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.digital_input_states import DigitalInputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_diameter_lookup_table_data import NanoTrakCircleDiameterLookupTableData +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_home_position import NanoTrakCircleHomePosition +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_params import NanoTrakCircleParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_eeprom_params import NanoTrakEEPROMParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_gain_params import NanoTrakGainParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_mode import NanoTrakMode +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_phase_compensation_params import NanoTrakPhaseCompensationParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_range_params import NanoTrakRangeParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_status import NanoTrakStatus +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_tna_io_settings import NanoTrakTnaIoSettings +from thorlabs_xa.interfaces.device_features.rack_bay_occupied_state import RackBayOccupiedState +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings + +from thorlabs_xa.implementations.device_features.digital_input_states_feature import DigitalInputStatesFeature +from thorlabs_xa.implementations.device_features.digital_output_states_feature import DigitalOutputStatesFeature +from thorlabs_xa.implementations.device_features.disconnect_feature import DisconnectFeature +from thorlabs_xa.implementations.device_features.firmware_version_info_feature import FirmwareVersionInfoFeature +from thorlabs_xa.implementations.device_features.hardware_info_feature import HardwareInfoFeature +from thorlabs_xa.implementations.device_features.identify_feature import IdentifyFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_circle_diameter_lookup_table_data_feature import NanoTrakCircleDiameterLookupTableDataFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_circle_home_position_feature import NanoTrakCircleHomePositionFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_circle_params_feature import NanoTrakCircleParamsFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_eeprom_params_feature import NanoTrakEEPROMParamsFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_gain_params_feature import NanoTrakGainParamsFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_mode_feature import NanoTrakModeFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_phase_compensation_params_feature import NanoTrakPhaseCompensationParamsFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_range_params_feature import NanoTrakRangeParamsFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_status_feature import NanoTrakStatusFeature +from thorlabs_xa.implementations.device_features.piezo.nano_trak_tna_io_settings_feature import NanoTrakTnaIoSettingsFeature +from thorlabs_xa.implementations.device_features.rack_bay_occupied_state_feature import RackBayOccupiedStateFeature +from thorlabs_xa.implementations.device_features.restore_factory_defaults_feature import RestoreFactoryDefaultsFeature +from thorlabs_xa.implementations.device_features.rich_response_feature import RichResponseFeature +from thorlabs_xa.implementations.device_features.settings_feature import SettingsFeature + +import thorlabs_xa.interfaces.device_feature_groups.lnnx_feature_group + +class LnnxFeatureGroup(thorlabs_xa.interfaces.device_feature_groups.lnnx_feature_group.LnnxFeatureGroup): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self._digital_input_states_feature = DigitalInputStatesFeature(device_handle, native_functions) + self._digital_output_states_feature = DigitalOutputStatesFeature(device_handle, native_functions) + self._disconnect_feature = DisconnectFeature(device_handle, native_functions) + self._firmware_version_info_feature = FirmwareVersionInfoFeature(device_handle, native_functions) + self._hardware_info_feature = HardwareInfoFeature(device_handle, native_functions) + self._identify_feature = IdentifyFeature(device_handle, native_functions) + self._nano_trak_circle_diameter_lookup_table_data_feature = NanoTrakCircleDiameterLookupTableDataFeature(device_handle, native_functions) + self._nano_trak_circle_home_position_feature = NanoTrakCircleHomePositionFeature(device_handle, native_functions) + self._nano_trak_circle_params_feature = NanoTrakCircleParamsFeature(device_handle, native_functions) + self._nano_trak_eeprom_params_feature = NanoTrakEEPROMParamsFeature(device_handle, native_functions) + self._nano_trak_gain_params_feature = NanoTrakGainParamsFeature(device_handle, native_functions) + self._nano_trak_mode_feature = NanoTrakModeFeature(device_handle, native_functions) + self._nano_trak_phase_compensation_params_feature = NanoTrakPhaseCompensationParamsFeature(device_handle, native_functions) + self._nano_trak_range_params_feature = NanoTrakRangeParamsFeature(device_handle, native_functions) + self._nano_trak_status_feature = NanoTrakStatusFeature(device_handle, native_functions) + self._nano_trak_tna_io_settings_feature = NanoTrakTnaIoSettingsFeature(device_handle, native_functions) + self._rack_bay_occupied_state_feature = RackBayOccupiedStateFeature(device_handle, native_functions) + self._restore_factory_defaults_feature = RestoreFactoryDefaultsFeature(device_handle, native_functions) + self._rich_response_feature = RichResponseFeature(device_handle, native_functions) + self._settings_feature = SettingsFeature(device_handle, native_functions) + + @property + def digital_input_states_feature(self) -> DigitalInputStates: + + return self._digital_input_states_feature + + @property + def digital_output_states_feature(self) -> DigitalOutputStates: + + return self._digital_output_states_feature + + @property + def disconnect_feature(self) -> Disconnect: + + return self._disconnect_feature + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: + + return self._firmware_version_info_feature + + @property + def hardware_info_feature(self) -> HardwareInfo: + + return self._hardware_info_feature + + @property + def identify_feature(self) -> Identify: + + return self._identify_feature + + @property + def nano_trak_circle_diameter_lookup_table_data_feature(self) -> NanoTrakCircleDiameterLookupTableData: + + return self._nano_trak_circle_diameter_lookup_table_data_feature + + @property + def nano_trak_circle_home_position_feature(self) -> NanoTrakCircleHomePosition: + + return self._nano_trak_circle_home_position_feature + + @property + def nano_trak_circle_params_feature(self) -> NanoTrakCircleParams: + + return self._nano_trak_circle_params_feature + + @property + def nano_trak_eeprom_params_feature(self) -> NanoTrakEEPROMParams: + + return self._nano_trak_eeprom_params_feature + + @property + def nano_trak_gain_params_feature(self) -> NanoTrakGainParams: + + return self._nano_trak_gain_params_feature + + @property + def nano_trak_mode_feature(self) -> NanoTrakMode: + + return self._nano_trak_mode_feature + + @property + def nano_trak_phase_compensation_params_feature(self) -> NanoTrakPhaseCompensationParams: + + return self._nano_trak_phase_compensation_params_feature + + @property + def nano_trak_range_params_feature(self) -> NanoTrakRangeParams: + + return self._nano_trak_range_params_feature + + @property + def nano_trak_status_feature(self) -> NanoTrakStatus: + + return self._nano_trak_status_feature + + @property + def nano_trak_tna_io_settings_feature(self) -> NanoTrakTnaIoSettings: + + return self._nano_trak_tna_io_settings_feature + + @property + def rack_bay_occupied_state_feature(self) -> RackBayOccupiedState: + + return self._rack_bay_occupied_state_feature + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: + + return self._restore_factory_defaults_feature + + @property + def rich_response_feature(self) -> RichResponse: + + return self._rich_response_feature + + @property + def settings_feature(self) -> Settings: + + return self._settings_feature \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/lnnx_logical_channel_feature_group.py b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/lnnx_logical_channel_feature_group.py new file mode 100644 index 0000000..08a4aee --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_feature_groups/lnnx_logical_channel_feature_group.py @@ -0,0 +1,154 @@ +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.implementations.device_features.enable_state_feature import EnableStateFeature +from thorlabs_xa.implementations.device_features.firmware_version_info_feature import FirmwareVersionInfoFeature +from thorlabs_xa.implementations.device_features.hardware_info_feature import HardwareInfoFeature +from thorlabs_xa.implementations.device_features.identify_feature import IdentifyFeature +from thorlabs_xa.implementations.device_features.piezo.max_output_voltage_params_feature import MaxOutputVoltageParamsFeature +from thorlabs_xa.implementations.device_features.piezo.max_travel_feature import MaxTravelFeature +from thorlabs_xa.implementations.device_features.piezo.output_voltage_feature import OutputVoltageFeature +from thorlabs_xa.implementations.device_features.piezo.output_voltage_control_source_params_feature import OutputVoltageControlSourceParamsFeature +from thorlabs_xa.implementations.device_features.piezo.piezo_status_feature import PiezoStatusFeature +from thorlabs_xa.implementations.device_features.piezo.piezo_status_bits_feature import PiezoStatusBitsFeature +from thorlabs_xa.implementations.device_features.piezo.position_feature import PositionFeature +from thorlabs_xa.implementations.device_features.piezo.position_control_mode_feature import PositionControlModeFeature +from thorlabs_xa.implementations.device_features.restore_factory_defaults_feature import RestoreFactoryDefaultsFeature +from thorlabs_xa.implementations.device_features.settings_feature import SettingsFeature +from thorlabs_xa.implementations.device_features.status_items_feature import StatusItemsFeature +from thorlabs_xa.implementations.device_features.status_mode_feature import StatusModeFeature +from thorlabs_xa.implementations.device_features.unit_converter_feature import UnitConverterFeature +from thorlabs_xa.implementations.device_features.piezo.zero_feature import ZeroFeature + +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.piezo.max_output_voltage_params import MaxOutputVoltageParams +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero + +import thorlabs_xa.interfaces.device_feature_groups.lnnx_logical_channel_feature_group + +class LnnxLogicalChannelFeatureGroup(thorlabs_xa.interfaces.device_feature_groups.lnnx_logical_channel_feature_group.LnnxLogicalChannelFeatureGroup): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self._enable_state_feature : EnableState = EnableStateFeature(device_handle, native_functions) + self._firmware_version_info_feature : FirmwareVersionInfo = FirmwareVersionInfoFeature(device_handle, native_functions) + self._hardware_info_feature : HardwareInfo = HardwareInfoFeature(device_handle, native_functions) + self._identify_feature : Identify = IdentifyFeature(device_handle, native_functions) + self._max_output_voltage_params_feature : MaxOutputVoltageParams = MaxOutputVoltageParamsFeature(device_handle, native_functions) + self._max_travel_feature : MaxTravel = MaxTravelFeature(device_handle, native_functions) + self._output_voltage_feature : OutputVoltage = OutputVoltageFeature(device_handle, native_functions) + self._output_voltage_control_source_params_feature : OutputVoltageControlSourceParams = OutputVoltageControlSourceParamsFeature(device_handle, native_functions) + self._piezo_status_feature : PiezoStatus = PiezoStatusFeature(device_handle, native_functions) + self._piezo_status_bits_feature : PiezoStatusBits = PiezoStatusBitsFeature(device_handle, native_functions) + self._position_feature : Position = PositionFeature(device_handle, native_functions) + self._position_control_mode_feature : PositionControlMode = PositionControlModeFeature(device_handle, native_functions) + self._restore_factory_defaults_feature : RestoreFactoryDefaults = RestoreFactoryDefaultsFeature(device_handle, native_functions) + self._settings_feature : Settings = SettingsFeature(device_handle, native_functions) + self._status_items_feature : StatusItems = StatusItemsFeature(device_handle, native_functions) + self._status_mode_feature : StatusMode = StatusModeFeature(device_handle, native_functions) + self._unit_converter_feature : UnitConverter = UnitConverterFeature(device_handle, native_functions) + self._zero_feature : Zero = ZeroFeature(device_handle, native_functions) + + @property + def enable_state_feature(self) -> EnableState: + + return self._enable_state_feature + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: + + return self._firmware_version_info_feature + + @property + def hardware_info_feature(self) -> HardwareInfo: + + return self._hardware_info_feature + + @property + def identify_feature(self) -> Identify: + + return self._identify_feature + + @property + def max_output_voltage_params_feature(self) -> MaxOutputVoltageParams: + + return self._max_output_voltage_params_feature + + @property + def max_travel_feature(self) -> MaxTravel: + + return self._max_travel_feature + + @property + def output_voltage_feature(self) -> OutputVoltage: + + return self._output_voltage_feature + + @property + def output_voltage_control_source_params_feature(self) -> OutputVoltageControlSourceParams: + + return self._output_voltage_control_source_params_feature + + @property + def piezo_status_feature(self) -> PiezoStatus: + + return self._piezo_status_feature + + @property + def piezo_status_bits_feature(self) -> PiezoStatusBits: + + return self._piezo_status_bits_feature + + @property + def position_feature(self) -> Position: + + return self._position_feature + + @property + def position_control_mode_feature(self) -> PositionControlMode: + + return self._position_control_mode_feature + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: + + return self._restore_factory_defaults_feature + + @property + def settings_feature(self) -> Settings: + + return self._settings_feature + + @property + def status_items_feature(self) -> StatusItems: + + return self._status_items_feature + + @property + def status_mode_feature(self) -> StatusMode: + + return self._status_mode_feature + + @property + def unit_converter_feature(self) -> UnitConverter: + + return self._unit_converter_feature + + @property + def zero_feature(self) -> Zero: + + return self._zero_feature \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/__init__.py b/Python/XA/src/thorlabs_xa/implementations/device_features/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/adc_inputs_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/adc_inputs_feature.py new file mode 100644 index 0000000..31b01a9 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/adc_inputs_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.shared.params import TLMC_AdcInputs +from thorlabs_xa.interfaces.device_features.adc_inputs import AdcInputs + +class AdcInputsFeature(AdcInputs): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.native_functions = native_functions + self.device_handle = device_handle + + def get_adc_inputs(self, max_wait_in_milliseconds: int) -> TLMC_AdcInputs: + return self.native_functions.get_adc_inputs(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/analog_monitor_configuration_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/analog_monitor_configuration_params_feature.py new file mode 100644 index 0000000..8fff13c --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/analog_monitor_configuration_params_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.analog_monitor_configuration_params import AnalogMonitorConfigurationParams as AnalogMonitorConfigurationParamsABC + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorNumber +from thorlabs_xa.shared.params import TLMC_AnalogMonitorConfigurationParams + +class AnalogMonitorConfigurationParamsFeature(AnalogMonitorConfigurationParamsABC): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_analog_monitor_configuration_params(self, monitor_number: TLMC_AnalogMonitorNumber, max_wait_in_milliseconds: int) -> TLMC_AnalogMonitorConfigurationParams: + return self.native_functions.get_analog_monitor_configuration_params(self.device_handle, monitor_number, max_wait_in_milliseconds) + + def set_analog_monitor_configuration_params(self, monitor_number: TLMC_AnalogMonitorNumber, params: TLMC_AnalogMonitorConfigurationParams): + self.native_functions.set_analog_monitor_configuration_params(self.device_handle, monitor_number, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/aux_io_configuration_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/aux_io_configuration_params_feature.py new file mode 100644 index 0000000..28da2b7 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/aux_io_configuration_params_feature.py @@ -0,0 +1,21 @@ +from thorlabs_xa.interfaces.device_features.aux_io_configuration_params import AuxIoConfigurationParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_AuxIoPortMode, TLMC_AuxIoPortNumber + +class AuxIoConfigurationParamsFeature(AuxIoConfigurationParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_aux_io_port_mode(self, port_number: TLMC_AuxIoPortNumber, max_wait_in_milliseconds: int) -> TLMC_AuxIoPortMode: + return self.native_functions.get_aux_io_port_mode(self.device_handle, port_number, max_wait_in_milliseconds) + + def set_aux_io_port_mode(self, port_number: TLMC_AuxIoPortNumber, port_mode: TLMC_AuxIoPortMode) -> None: + self.native_functions.set_aux_io_port_mode(self.device_handle, port_number, port_mode) + + def get_aux_io_software_states(self, max_wait_in_milliseconds: int) -> int: + return self.native_functions.get_aux_io_software_states(self.device_handle, max_wait_in_milliseconds) + + def set_aux_io_software_states(self, software_states: int) -> None: + self.native_functions.set_aux_io_software_states(self.device_handle, software_states) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/bow_index_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/bow_index_feature.py new file mode 100644 index 0000000..fc95017 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/bow_index_feature.py @@ -0,0 +1,15 @@ +from thorlabs_xa.interfaces.device_features.bow_index import BowIndex +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_BowIndex + +class BowIndexFeature(BowIndex): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_bow_index(self, max_wait_in_milliseconds: int) -> TLMC_BowIndex: + return self.native_functions.get_bow_index(self.device_handle, max_wait_in_milliseconds) + + def set_bow_index(self, bow_index: TLMC_BowIndex) -> None: + self.native_functions.set_bow_index(self.device_handle, bow_index) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/button_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/button_params_feature.py new file mode 100644 index 0000000..9e51ded --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/button_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.button_params import ButtonParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_ButtonParams + +class ButtonParamsFeature(ButtonParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_button_params(self, max_wait_in_milliseconds: int) -> TLMC_ButtonParams: + return self.native_functions.get_button_params(self.device_handle, max_wait_in_milliseconds) + + def set_button_params(self, params: TLMC_ButtonParams) -> None: + self.native_functions.set_button_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/calibration_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/calibration_feature.py new file mode 100644 index 0000000..fbd217b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/calibration_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.calibration import Calibration +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_CalibrationState + +class CalibrationFeature(Calibration): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def activate(self) -> None: + self.native_functions.activate_calibration(self.device_handle) + + def deactivate(self) -> None: + self.native_functions.deactivate_calibration(self.device_handle) + + def get_calibration_state(self, max_wait_in_milliseconds: int) -> TLMC_CalibrationState: + return self.native_functions.get_calibration_state(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/connected_product_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/connected_product_feature.py new file mode 100644 index 0000000..a02833f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/connected_product_feature.py @@ -0,0 +1,23 @@ +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.shared.params import TLMC_ConnectedProductInfo + +class ConnectedProductFeature(ConnectedProduct): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_connected_product_info(self) -> TLMC_ConnectedProductInfo: + return self.native_functions.get_connected_product_info(self.device_handle) + + def set_connected_product_info(self, product_info: TLMC_ConnectedProductInfo) -> None: + self.native_functions.set_connected_product_info(self.device_handle, product_info) + + def set_connected_product(self, product_name: str) -> None: + self.native_functions.set_connected_product(self.device_handle, product_name) + + def get_connected_products_supported(self, max_length: int) -> tuple [str, int]: + return self.native_functions.get_connected_products_supported(self.device_handle, max_length) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/current_loop_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/current_loop_params_feature.py new file mode 100644 index 0000000..6f121cb --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/current_loop_params_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.current_loop_params import CurrentLoopParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_CurrentLoopScenario +from thorlabs_xa.shared.params import TLMC_CurrentLoopParams + +class CurrentLoopParamsFeature(CurrentLoopParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_current_loop_params(self, scenario: TLMC_CurrentLoopScenario, max_wait_in_milliseconds: int) -> TLMC_CurrentLoopParams: + return self.native_functions.get_current_loop_params(self.device_handle, scenario, max_wait_in_milliseconds) + + def set_current_loop_params(self, scenario: TLMC_CurrentLoopScenario, parameters: TLMC_CurrentLoopParams) -> None: + self.native_functions.set_current_loop_params(self.device_handle, scenario, parameters) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/dc_pid_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/dc_pid_params_feature.py new file mode 100644 index 0000000..537ec3d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/dc_pid_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.dc_pid_params import DcPidParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_DcPidParams + +class DcPidParamsFeature(DcPidParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_dc_pid_params(self, max_wait_in_milliseconds: int) -> TLMC_DcPidParams: + return self.native_functions.get_dc_pid_params(self.device_handle, max_wait_in_milliseconds) + + def set_dc_pid_params(self, parameters: TLMC_DcPidParams) -> None: + self.native_functions.set_dc_pid_params(self.device_handle, parameters) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/digital_input_states_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/digital_input_states_feature.py new file mode 100644 index 0000000..3fe10d2 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/digital_input_states_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.digital_input_states import DigitalInputStates +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_DigitalInput + +class DigitalInputStatesFeature(DigitalInputStates): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_digital_input_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalInput: + return self.native_functions.get_digital_input_states(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/digital_output_states_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/digital_output_states_feature.py new file mode 100644 index 0000000..65c9e39 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/digital_output_states_feature.py @@ -0,0 +1,19 @@ +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.shared.enums import TLMC_DigitalOutput + +class DigitalOutputStatesFeature(DigitalOutputStates): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_digital_output_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: + + return self.native_functions.get_digital_output_states(self.device_handle, max_wait_in_milliseconds) + + def set_digital_output_states(self, params: TLMC_DigitalOutput) -> None: + + self.native_functions.set_digital_output_states(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/disconnect_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/disconnect_feature.py new file mode 100644 index 0000000..9a59914 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/disconnect_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class DisconnectFeature(Disconnect): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def disconnect(self) -> None: + + self.native_functions.disconnect(self.device_handle) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/enable_state_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/enable_state_feature.py new file mode 100644 index 0000000..8f933c5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/enable_state_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_EnableState + +class EnableStateFeature(EnableState): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_EnableState: + return self.native_functions.get_enable_state(self.device_handle, max_wait_in_milliseconds) + + def set_enable_state(self, enable_state: TLMC_EnableState) -> None: + self.native_functions.set_enable_state(self.device_handle, enable_state) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/encoder_counter_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/encoder_counter_feature.py new file mode 100644 index 0000000..0d9fb18 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/encoder_counter_feature.py @@ -0,0 +1,15 @@ +from thorlabs_xa.interfaces.device_features.encoder_counter import EncoderCounter +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class EncoderCounterFeature(EncoderCounter): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_encoder_counter(self, max_wait_in_milliseconds: int) -> int: + return self.native_functions.get_encoder_counter(self.device_handle, max_wait_in_milliseconds) + + def set_encoder_counter(self, new_encoder_counter: int) -> None: + self.native_functions.set_encoder_counter(self.device_handle, new_encoder_counter) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/end_of_move_messages_mode_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/end_of_move_messages_mode_feature.py new file mode 100644 index 0000000..0ad56de --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/end_of_move_messages_mode_feature.py @@ -0,0 +1,15 @@ +from thorlabs_xa.interfaces.device_features.end_of_move_messages_mode import EndOfMoveMessagesMode + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_EndOfMoveMessagesMode + +class EndOfMoveMessagesModeFeature(EndOfMoveMessagesMode): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_end_of_move_messages_mode(self, messages_mode: TLMC_EndOfMoveMessagesMode) -> None: + + self.native_functions.set_end_of_move_messages_mode(self.device_handle, messages_mode) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/firmware_version_info_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/firmware_version_info_feature.py new file mode 100644 index 0000000..c97bd0a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/firmware_version_info_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_FirmwareVersion + +class FirmwareVersionInfoFeature(FirmwareVersionInfo): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + + return self.native_functions.get_firmware_version_info(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/general_move_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/general_move_params_feature.py new file mode 100644 index 0000000..599f490 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/general_move_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_GeneralMoveParams + +class GeneralMoveParamsFeature(GeneralMoveParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_general_move_params(self, max_wait_in_milliseconds: int) -> TLMC_GeneralMoveParams: + + return self.native_functions.get_general_move_params(self.device_handle, max_wait_in_milliseconds) + + def set_general_move_params(self, params: TLMC_GeneralMoveParams) -> None: + + self.native_functions.set_general_move_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/hardware_info_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/hardware_info_feature.py new file mode 100644 index 0000000..56efc5f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/hardware_info_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_HardwareInfo + +class HardwareInfoFeature(HardwareInfo): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + + return self.native_functions.get_hardware_info(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/home_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/home_feature.py new file mode 100644 index 0000000..06dc841 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/home_feature.py @@ -0,0 +1,10 @@ +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class HomeFeature(Home): + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def home(self, max_wait_in_milliseconds: int) -> None: + self.native_functions.home(self.device_handle, max_wait_in_milliseconds) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/home_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/home_params_feature.py new file mode 100644 index 0000000..559b902 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/home_params_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_HomeParams + +class HomeParamsFeature(HomeParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.device_handle = device_handle + self.native_functions = native_functions + + def get_home_params(self, max_wait_in_milliseconds: int) -> TLMC_HomeParams: + + return self.native_functions.get_home_params(self.device_handle, max_wait_in_milliseconds) + + def set_home_params(self, params: TLMC_HomeParams) -> None: + + self.native_functions.set_home_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/identify_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/identify_feature.py new file mode 100644 index 0000000..1fe4650 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/identify_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.identify import Identify + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class IdentifyFeature(Identify): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def identify(self) -> None: + + return self.native_functions.identify(self.device_handle) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/io_configuration_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/io_configuration_params_feature.py new file mode 100644 index 0000000..e5180cd --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/io_configuration_params_feature.py @@ -0,0 +1,20 @@ +from thorlabs_xa.interfaces.device_features.io_configuration_params import IoConfigurationParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_IoPortNumber +from thorlabs_xa.shared.params import TLMC_IoConfigurationParams + +class IoConfigurationParamsFeature(IoConfigurationParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_io_configuration_number_of_ports_supported(self) -> int: + return self.native_functions.get_io_configuration_number_of_ports_supported(self.device_handle) + + def get_io_configuration_params(self, port_number: TLMC_IoPortNumber, max_wait_in_milliseconds: int) -> TLMC_IoConfigurationParams: + return self.native_functions.get_io_configuration_params(self.device_handle, port_number, max_wait_in_milliseconds) + + def set_io_configuration_params(self, handle: int, port_number: TLMC_IoPortNumber, params: TLMC_IoConfigurationParams) -> None: + self.native_functions.set_io_configuration_params(self.device_handle, port_number, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/io_position_trigger_enable_state_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/io_position_trigger_enable_state_feature.py new file mode 100644 index 0000000..82bb9e8 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/io_position_trigger_enable_state_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.io_position_trigger_enable_state import IoPositionTriggerEnableState +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_IoPositionTriggerEnableState + +class IoPositionTriggerEnableStateFeature(IoPositionTriggerEnableState): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_io_position_trigger_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_IoPositionTriggerEnableState: + return self.native_functions.get_io_position_trigger_enable_state(self.device_handle, max_wait_in_milliseconds) + + def set_io_position_trigger_enable_state(self, enable_state: TLMC_IoPositionTriggerEnableState, max_wait_in_milliseconds: int) -> None: + self.native_functions.set_io_position_trigger_enable_state(self.device_handle, enable_state, max_wait_in_milliseconds) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/io_trigger_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/io_trigger_params_feature.py new file mode 100644 index 0000000..022c543 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/io_trigger_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.io_trigger_params import IoTriggerParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_IoTriggerParams + +class IoTriggerParamsFeature(IoTriggerParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_IoTriggerParams: + return self.native_functions.get_io_trigger_params(self.device_handle, max_wait_in_milliseconds) + + def set_io_trigger_params(self, params: TLMC_IoTriggerParams) -> None: + self.native_functions.set_io_trigger_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/jog_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/jog_params_feature.py new file mode 100644 index 0000000..43276cd --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/jog_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_JogParams + +class JogParamsFeature(JogParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_jog_params(self, max_wait_in_milliseconds: int) -> TLMC_JogParams: + return self.native_functions.get_jog_params(self.device_handle, max_wait_in_milliseconds) + + def set_jog_params(self, params: TLMC_JogParams) -> None: + self.native_functions.set_jog_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/joystick_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/joystick_params_feature.py new file mode 100644 index 0000000..f5f0c23 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/joystick_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.joystick_params import JoystickParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_JoystickParams + +class JoystickParamsFeature(JoystickParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_joystick_params(self, max_wait_in_milliseconds: int) -> TLMC_JoystickParams: + return self.native_functions.get_joystick_params(self.device_handle, max_wait_in_milliseconds) + + def set_joystick_params(self, params: TLMC_JoystickParams) -> None: + self.native_functions.set_joystick_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_io_trigger_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_io_trigger_params_feature.py new file mode 100644 index 0000000..aaf9a37 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_io_trigger_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.kcube_io_trigger_params import KcubeIoTriggerParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_KcubeIoTriggerParams + +class KcubeIoTriggerParamsFeature(KcubeIoTriggerParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_kcube_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubeIoTriggerParams: + return self.native_functions.get_kcube_io_trigger_params(self.device_handle, max_wait_in_milliseconds) + + def set_kcube_io_trigger_params(self, params: TLMC_KcubeIoTriggerParams) -> None: + self.native_functions.set_kcube_io_trigger_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_mmi_lock_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_mmi_lock_feature.py new file mode 100644 index 0000000..657b06d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_mmi_lock_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.kcube_mmi_lock import KcubeMmiLock +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_KcubeMmiLockState + +class KcubeMmiLockFeature(KcubeMmiLock): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_kcube_mmi_lock_state(self, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiLockState: + return self.native_functions.get_kcube_mmi_lock_state(self.device_handle, max_wait_in_milliseconds) + + def set_kcube_mmi_lock_state(self, lock_state: TLMC_KcubeMmiLockState) -> None: + self.native_functions.set_kcube_mmi_lock_state(self.device_handle, lock_state) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_mmi_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_mmi_params_feature.py new file mode 100644 index 0000000..6b8e2db --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_mmi_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.kcube_mmi_params import KcubeMmiParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_KcubeMmiParams + +class KcubeMmiParamsFeature(KcubeMmiParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_kcube_mmi_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiParams: + return self.native_functions.get_kcube_mmi_params(self.device_handle, max_wait_in_milliseconds) + + def set_kcube_mmi_params(self, params: TLMC_KcubeMmiParams) -> None: + self.native_functions.set_kcube_mmi_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_position_trigger_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_position_trigger_params_feature.py new file mode 100644 index 0000000..4827a3d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/kcube_position_trigger_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.kcube_position_trigger_params import KcubePositionTriggerParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_KcubePositionTriggerParams + +class KcubePositionTriggerParamsFeature(KcubePositionTriggerParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_kcube_position_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubePositionTriggerParams: + + return self.native_functions.get_kcube_position_trigger_params(self.device_handle, max_wait_in_milliseconds) + + def set_kcube_position_trigger_params(self, params: TLMC_KcubePositionTriggerParams) -> None: + + self.native_functions.set_kcube_position_trigger_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/lcd_display_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/lcd_display_params_feature.py new file mode 100644 index 0000000..357f82f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/lcd_display_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.lcd_display_params import LcdDisplayParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_LcdDisplayParams + +class LcdDisplayParamsFeature(LcdDisplayParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_lcd_display_params(self, max_wait_in_milliseconds: int) -> TLMC_LcdDisplayParams: + return self.native_functions.get_lcd_display_params(self.device_handle, max_wait_in_milliseconds) + + def set_lcd_display_params(self, params: TLMC_LcdDisplayParams) -> None: + self.native_functions.set_lcd_display_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/lcd_move_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/lcd_move_params_feature.py new file mode 100644 index 0000000..02e4d1b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/lcd_move_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.lcd_move_params import LcdMoveParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_LcdMoveParams + +class LcdMoveParamsFeature(LcdMoveParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_lcd_move_params(self, max_wait_in_milliseconds: int) -> TLMC_LcdMoveParams: + return self.native_functions.get_lcd_move_params(self.device_handle, max_wait_in_milliseconds) + + def set_lcd_move_params(self, params: TLMC_LcdMoveParams) -> None: + self.native_functions.set_lcd_move_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/limit_switch_params_getter_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/limit_switch_params_getter_feature.py new file mode 100644 index 0000000..608f46e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/limit_switch_params_getter_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_LimitSwitchParams + +class LimitSwitchParamsGetterFeature(LimitSwitchParamsGetter): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_limit_switch_params(self, max_wait_in_milliseconds: int) -> TLMC_LimitSwitchParams: + + return self.native_functions.get_limit_switch_params(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/limit_switch_params_setter_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/limit_switch_params_setter_feature.py new file mode 100644 index 0000000..e4ec473 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/limit_switch_params_setter_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.limit_switch_params_setter import LimitSwitchParamsSetter +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_LimitSwitchParams + +class LimitSwitchParamsSetterFeature(LimitSwitchParamsSetter): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_limit_switch_params(self, params: TLMC_LimitSwitchParams) -> None: + + self.native_functions.set_limit_switch_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/load_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/load_params_feature.py new file mode 100644 index 0000000..52e29f3 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/load_params_feature.py @@ -0,0 +1,11 @@ +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class LoadParamsFeature(LoadParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + self.native_functions = native_functions + self.device_handle = device_handle + + def load_params(self) -> None: + self.native_functions.load_params(self.device_handle) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/motor_output_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/motor_output_params_feature.py new file mode 100644 index 0000000..13d3362 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/motor_output_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.motor_output_params import MotorOutputParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_MotorOutputParams + +class MotorOutputParamsFeature(MotorOutputParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_motor_output_params(self, max_wait_in_milliseconds: int) -> TLMC_MotorOutputParams: + + return self.native_functions.get_motor_output_params(self.device_handle, max_wait_in_milliseconds) + + def set_motor_output_params(self, params: TLMC_MotorOutputParams) -> None: + + self.native_functions.set_motor_output_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/move_absolute_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/move_absolute_params_feature.py new file mode 100644 index 0000000..867345e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/move_absolute_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_MoveAbsoluteParams + +class MoveAbsoluteParamsFeature(MoveAbsoluteParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.native_functions = native_functions + self.device_handle = device_handle + + def get_move_absolute_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveAbsoluteParams: + + return self.native_functions.get_move_absolute_params(self.device_handle, max_wait_in_milliseconds) + + def set_move_absolute_params(self, params: TLMC_MoveAbsoluteParams) -> None: + + self.native_functions.set_move_absolute_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/move_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/move_feature.py new file mode 100644 index 0000000..be891d1 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/move_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_MoveMode + +class MoveFeature(Move): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def move(self, move_mode: TLMC_MoveMode, params: int, max_wait_in_milliseconds: int) -> None: + + self.native_functions.move(self.device_handle, move_mode, params, max_wait_in_milliseconds) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/move_relative_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/move_relative_params_feature.py new file mode 100644 index 0000000..2d5b131 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/move_relative_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_MoveRelativeParams + +class MoveRelativeParamsFeature(MoveRelativeParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_move_relative_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveRelativeParams: + + return self.native_functions.get_move_relative_params(self.device_handle, max_wait_in_milliseconds) + + def set_move_relative_params(self, params: TLMC_MoveRelativeParams) -> None: + + self.native_functions.set_move_relative_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/no_flash_programming_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/no_flash_programming_feature.py new file mode 100644 index 0000000..02f9f02 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/no_flash_programming_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.no_flash_programming import NoFlashProgramming +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class NoFlashProgrammingFeature(NoFlashProgramming): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def send_no_flash_programming(self) -> None: + + self.native_functions.send_no_flash_programming(self.device_handle) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/persist_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/persist_params_feature.py new file mode 100644 index 0000000..b82c564 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/persist_params_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_ParameterGroupId + +class PersistParamsFeature(PersistParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def persist_params(self, parameter_group_id: TLMC_ParameterGroupId) -> None: + + self.native_functions.persist_params(self.device_handle, parameter_group_id) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/__init__.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_io_settings_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_io_settings_params_feature.py new file mode 100644 index 0000000..677444b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_io_settings_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_settings_params import KpcIoSettingsParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_KpcIoSettingsParams + +class KpcIoSettingsParamsFeature(KpcIoSettingsParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_io_settings_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoSettingsParams: + + return self.native_functions.pz_get_kpc_io_settings_params(self.device_handle, max_wait_in_milliseconds) + + def set_io_settings_params(self, params: TLMC_PZ_KpcIoSettingsParams) -> None: + + self.native_functions.pz_set_kpc_io_settings_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_io_trigger_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_io_trigger_params_feature.py new file mode 100644 index 0000000..420edae --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_io_trigger_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_trigger_params import KpcIoTriggerParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_KpcIoTriggerParams + +class KpcIoTriggerParamsFeature(KpcIoTriggerParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoTriggerParams: + + return self.native_functions.pz_get_kpc_io_trigger_params(self.device_handle, max_wait_in_milliseconds) + + def set_io_trigger_params(self, params: TLMC_PZ_KpcIoTriggerParams) -> None: + + self.native_functions.pz_set_kpc_io_trigger_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_mmi_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_mmi_params_feature.py new file mode 100644 index 0000000..0715d95 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/kpc_mmi_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.kpc_mmi_params import KpcMmiParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_KpcMmiParams + +class KpcMmiParamsFeature(KpcMmiParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_kpc_mmi_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcMmiParams: + + return self.native_functions.pz_get_kpc_mmi_params(self.device_handle, max_wait_in_milliseconds) + + def set_kpc_mmi_params(self, params: TLMC_PZ_KpcMmiParams) -> None: + + self.native_functions.pz_set_kpc_mmi_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/max_output_voltage_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/max_output_voltage_params_feature.py new file mode 100644 index 0000000..f7aa16a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/max_output_voltage_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.max_output_voltage_params import MaxOutputVoltageParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_MaxOutputVoltageParams + +class MaxOutputVoltageParamsFeature(MaxOutputVoltageParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_max_output_voltage_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_MaxOutputVoltageParams: + + return self.native_functions.pz_get_max_output_voltage_params(self.device_handle, max_wait_in_milliseconds) + + def set_max_output_voltage(self, max_output_voltage: int) -> None: + + self.native_functions.pz_set_max_output_voltage(self.device_handle, max_output_voltage) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/max_travel_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/max_travel_feature.py new file mode 100644 index 0000000..e259cfd --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/max_travel_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class MaxTravelFeature(MaxTravel): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_max_travel(self, max_wait_in_milliseconds: int) -> int: + + return self.native_functions.pz_get_max_travel(self.device_handle, max_wait_in_milliseconds) + + def set_max_travel(self, max_travel: int) -> None: + + self.native_functions.pz_set_max_travel(self.device_handle, max_travel) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_diameter_lookup_table_data_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_diameter_lookup_table_data_feature.py new file mode 100644 index 0000000..55020d6 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_diameter_lookup_table_data_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_diameter_lookup_table_data import NanoTrakCircleDiameterLookupTableData +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakCircleDiameterLookupTableData + +class NanoTrakCircleDiameterLookupTableDataFeature(NanoTrakCircleDiameterLookupTableData): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_circle_diameter_lookup_table_data(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleDiameterLookupTableData: + + return self.native_functions.pz_get_nano_trak_circle_diameter_lookup_table_data(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_circle_diameter_lookup_table_data(self, params: TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> None: + + self.native_functions.pz_set_nano_trak_circle_diameter_lookup_table_data(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_home_position_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_home_position_feature.py new file mode 100644 index 0000000..01633fe --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_home_position_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_home_position import NanoTrakCircleHomePosition +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakCircleHomePositionParams + +class NanoTrakCircleHomePositionFeature(NanoTrakCircleHomePosition): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_circle_home_position(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleHomePositionParams: + + return self.native_functions.pz_get_nano_trak_circle_home_position(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_circle_home_position(self, params: TLMC_PZ_NanoTrakCircleHomePositionParams) -> None: + + self.native_functions.pz_set_nano_trak_circle_home_position(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_params_feature.py new file mode 100644 index 0000000..6e1b03b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_circle_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_params import NanoTrakCircleParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakCircleParams + +class NanoTrakCircleParamsFeature(NanoTrakCircleParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_circle_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleParams: + + return self.native_functions.pz_get_nano_trak_circle_params(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_circle_params(self, params: TLMC_PZ_NanoTrakCircleParams) -> None: + + self.native_functions.pz_set_nano_trak_circle_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_eeprom_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_eeprom_params_feature.py new file mode 100644 index 0000000..18bcf8b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_eeprom_params_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_eeprom_params import NanoTrakEEPROMParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakEEPROMParams + +class NanoTrakEEPROMParamsFeature(NanoTrakEEPROMParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_nano_trak_eeprom_params(self, params: TLMC_PZ_NanoTrakEEPROMParams) -> None: + + self.native_functions.pz_set_nano_trak_eeprom_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_gain_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_gain_params_feature.py new file mode 100644 index 0000000..8053503 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_gain_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_gain_params import NanoTrakGainParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakGainParams + +class NanoTrakGainParamsFeature(NanoTrakGainParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_gain_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakGainParams: + + return self.native_functions.pz_get_nano_trak_gain_params(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_gain_params(self, params: TLMC_PZ_NanoTrakGainParams) -> None: + + self.native_functions.pz_set_nano_trak_gain_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_mode_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_mode_feature.py new file mode 100644 index 0000000..6c45dc5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_mode_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_mode import NanoTrakMode +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_PZ_SetNanoTrakModeType +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakMode + +class NanoTrakModeFeature(NanoTrakMode): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakMode: + return self.native_functions.pz_get_nano_trak_mode(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_mode(self, set_mode: TLMC_PZ_SetNanoTrakModeType) -> None: + self.native_functions.pz_set_nano_trak_mode(self.device_handle, set_mode) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_phase_compensation_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_phase_compensation_params_feature.py new file mode 100644 index 0000000..9deaaf9 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_phase_compensation_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_phase_compensation_params import NanoTrakPhaseCompensationParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakPhaseCompensationParams + +class NanoTrakPhaseCompensationParamsFeature(NanoTrakPhaseCompensationParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_phase_compensation_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakPhaseCompensationParams: + + return self.native_functions.pz_get_nano_trak_phase_compensation_params(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_phase_compensation_params(self, params: TLMC_PZ_NanoTrakPhaseCompensationParams) -> None: + + self.native_functions.pz_set_nano_trak_phase_compensation_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_range_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_range_params_feature.py new file mode 100644 index 0000000..c62571b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_range_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_range_params import NanoTrakRangeParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakRangeParams + +class NanoTrakRangeParamsFeature(NanoTrakRangeParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_range_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakRangeParams: + + return self.native_functions.pz_get_nano_trak_range_params(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_range_params(self, params: TLMC_PZ_NanoTrakRangeParams) -> None: + + self.native_functions.pz_set_nano_trak_range_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_status_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_status_feature.py new file mode 100644 index 0000000..7ef4cca --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_status_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_status import NanoTrakStatus +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakStatus + +class NanoTrakStatusFeature(NanoTrakStatus): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakStatus: + + return self.native_functions.pz_get_nano_trak_status(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_tna_io_settings_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_tna_io_settings_feature.py new file mode 100644 index 0000000..30cab34 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/nano_trak_tna_io_settings_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_tna_io_settings import NanoTrakTnaIoSettings +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakTnaIoSettings + +class NanoTrakTnaIoSettingsFeature(NanoTrakTnaIoSettings): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_nano_trak_tna_io_settings(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTnaIoSettings: + + return self.native_functions.pz_get_nano_trak_tna_io_settings(self.device_handle, max_wait_in_milliseconds) + + def set_nano_trak_tna_io_settings(self, params: TLMC_PZ_NanoTrakTnaIoSettings) -> None: + + self.native_functions.pz_set_nano_trak_tna_io_settings(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_voltage_control_source_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_voltage_control_source_params_feature.py new file mode 100644 index 0000000..5bc6836 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_voltage_control_source_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_OutputVoltageControlSourceParams + +class OutputVoltageControlSourceParamsFeature(OutputVoltageControlSourceParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_output_voltage_control_source_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputVoltageControlSourceParams: + + return self.native_functions.pz_get_output_voltage_control_source_params(self.device_handle, max_wait_in_milliseconds) + + def set_output_voltage_control_source_params(self, params: TLMC_PZ_OutputVoltageControlSourceParams) -> None: + + self.native_functions.pz_set_output_voltage_control_source_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_voltage_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_voltage_feature.py new file mode 100644 index 0000000..6432a5f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_voltage_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class OutputVoltageFeature(OutputVoltage): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.native_functions = native_functions + self.device_handle = device_handle + + def get_output_voltage(self, max_wait_in_milliseconds: int) -> int: + + return self.native_functions.pz_get_output_voltage(self.device_handle, max_wait_in_milliseconds) + + def set_output_voltage(self, output_voltage: int) -> None: + + self.native_functions.pz_set_output_voltage(self.device_handle, output_voltage) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_waveform_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_waveform_feature.py new file mode 100644 index 0000000..345a1bd --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_waveform_feature.py @@ -0,0 +1,26 @@ +from thorlabs_xa.interfaces.device_features.piezo.output_waveform import OutputWaveform +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_OutputWaveformLoopTableSample, TLMC_PZ_OutputWaveformParams + +class OutputWaveformFeature(OutputWaveform): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_output_waveform_lookup_table_sample_params(self, params: TLMC_PZ_OutputWaveformLoopTableSample) -> None: + + self.native_functions.pz_set_output_waveform_loop_table_sample(self.device_handle, params) + + def set_output_waveform_params(self, params: TLMC_PZ_OutputWaveformParams) -> None: + + return self.native_functions.pz_set_output_waveform_params(self.device_handle, params) + + def start_output_waveform(self) -> None: + + self.native_functions.pz_start_output_waveform(self.device_handle) + + def stop_output_waveform(self) -> None: + + self.native_functions.pz_stop_output_waveform(self.device_handle) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_waveform_params_getter_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_waveform_params_getter_feature.py new file mode 100644 index 0000000..13f9797 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/output_waveform_params_getter_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.piezo.output_waveform_params_getter import OutputWaveformParamsGetter +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_OutputWaveformParams + +class OutputWaveformParamsGetterFeature(OutputWaveformParamsGetter): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_output_waveform_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputWaveformParams: + + return self.native_functions.pz_get_output_waveform_params(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/piezo_status_bits_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/piezo_status_bits_feature.py new file mode 100644 index 0000000..916717b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/piezo_status_bits_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_PZ_StatusBit + +class PiezoStatusBitsFeature(PiezoStatusBits): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_piezo_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_PZ_StatusBit: + + return self.native_functions.pz_get_status_bits(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/piezo_status_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/piezo_status_feature.py new file mode 100644 index 0000000..54b393b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/piezo_status_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_Status + +class PiezoStatusFeature(PiezoStatus): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_piezo_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_Status: + + return self.native_functions.pz_get_status(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_control_mode_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_control_mode_feature.py new file mode 100644 index 0000000..6548b2c --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_control_mode_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_PZ_PositionControlMode + +class PositionControlModeFeature(PositionControlMode): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_position_control_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionControlMode: + + return self.native_functions.pz_get_position_control_mode(self.device_handle, max_wait_in_milliseconds) + + def set_position_control_mode(self, control_mode: TLMC_PZ_PositionControlMode) -> None: + + self.native_functions.pz_set_position_control_mode(self.device_handle, control_mode) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_feature.py new file mode 100644 index 0000000..3ba291e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class PositionFeature(Position): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_position(self, max_wait_in_milliseconds: int) -> int: + + return self.native_functions.pz_get_position(self.device_handle, max_wait_in_milliseconds) + + def set_position(self, position: int) -> None: + + self.native_functions.pz_set_position(self.device_handle, position) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_loop_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_loop_params_feature.py new file mode 100644 index 0000000..fa7195a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/position_loop_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.piezo.position_loop_params import PositionLoopParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PZ_PositionLoopParams + +class PositionLoopParamsFeature(PositionLoopParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.native_functions = native_functions + self.device_handle = device_handle + + def get_position_loop_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionLoopParams: + + return self.native_functions.pz_get_position_loop_params(self.device_handle, max_wait_in_milliseconds) + + def set_position_loop_params(self, params: TLMC_PZ_PositionLoopParams) -> None: + + self.native_functions.pz_set_position_loop_params(self.device_handle, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/zero_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/zero_feature.py new file mode 100644 index 0000000..986e29d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/piezo/zero_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class ZeroFeature(Zero): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_zero(self, max_wait_in_milliseconds: int): + + self.native_functions.pz_set_zero(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/position_counter_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/position_counter_feature.py new file mode 100644 index 0000000..0947b83 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/position_counter_feature.py @@ -0,0 +1,17 @@ +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class PositionCounterFeature(PositionCounter): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_position_counter(self, max_wait_in_milliseconds: int) -> int: + + return self.native_functions.get_position_counter(self.device_handle, max_wait_in_milliseconds) + + def set_position_counter(self, new_position_counter: int) -> None: + + self.native_functions.set_position_counter(self.device_handle, new_position_counter) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/position_loop_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/position_loop_params_feature.py new file mode 100644 index 0000000..8f0840e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/position_loop_params_feature.py @@ -0,0 +1,19 @@ +from thorlabs_xa.interfaces.device_features.position_loop_params import PositionLoopParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_PositionLoopScenario +from thorlabs_xa.shared.params import TLMC_PositionLoopParams + +class PositionLoopParamsFeature(PositionLoopParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_position_loop_params(self, scenario: TLMC_PositionLoopScenario, max_wait_in_milliseconds: int) -> TLMC_PositionLoopParams: + + return self.native_functions.get_position_loop_params(self.device_handle, scenario, max_wait_in_milliseconds) + + def set_position_loop_params(self, scenario: TLMC_PositionLoopScenario, params: TLMC_PositionLoopParams) -> None: + + self.native_functions.set_position_loop_params(self.device_handle, scenario, params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/potentiometer_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/potentiometer_params_feature.py new file mode 100644 index 0000000..75bc70d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/potentiometer_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.potentiometer_params import PotentiometerParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PotentiometerParams + +class PotentiometerParamsFeature(PotentiometerParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_potentiometer_params(self, max_wait_in_milliseconds: int) -> TLMC_PotentiometerParams: + return self.native_functions.get_potentiometer_params(self.device_handle, max_wait_in_milliseconds) + + def set_potentiometer_params(self, params: TLMC_PotentiometerParams): + self.native_functions.set_potentiometer_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/power_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/power_params_feature.py new file mode 100644 index 0000000..d7bf667 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/power_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.power_params import PowerParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_PowerParams + +class PowerParamsFeature(PowerParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_power_params(self, max_wait_in_milliseconds: int) -> TLMC_PowerParams: + return self.native_functions.get_power_params(self.device_handle, max_wait_in_milliseconds) + + def set_power_params(self, params: TLMC_PowerParams): + self.native_functions.set_power_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/profile_mode_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/profile_mode_params_feature.py new file mode 100644 index 0000000..60ee726 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/profile_mode_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.profile_mode_params import ProfileModeParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_ProfileModeParams + +class ProfileModeParamsFeature(ProfileModeParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_profile_mode_params(self, max_wait_in_milliseconds: int) -> TLMC_ProfileModeParams: + return self.native_functions.get_profile_mode_params(self.device_handle, max_wait_in_milliseconds) + + def set_profile_mode_params(self, params: TLMC_ProfileModeParams): + self.native_functions.set_profile_mode_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/rack_bay_occupied_state_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/rack_bay_occupied_state_feature.py new file mode 100644 index 0000000..c7d8c3e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/rack_bay_occupied_state_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.rack_bay_occupied_state import RackBayOccupiedState +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_RackBayNumber, TLMC_RackBayOccupiedState + +class RackBayOccupiedStateFeature(RackBayOccupiedState): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_rack_bay_occupied_state(self, bay_number: TLMC_RackBayNumber, max_wait_in_milliseconds: int) -> TLMC_RackBayOccupiedState: + + return self.native_functions.get_rack_bay_occupied_state(self.device_handle, bay_number, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/rack_identify_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/rack_identify_feature.py new file mode 100644 index 0000000..4ef646b --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/rack_identify_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.rank_identify import RackIdentify +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class RackIdentifyFeature(RackIdentify): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def rack_identify(self, channel: int) -> None: + + self.native_functions.rack_identify(self.device_handle, channel) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/restore_factory_defaults_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/restore_factory_defaults_feature.py new file mode 100644 index 0000000..43f89f4 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/restore_factory_defaults_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class RestoreFactoryDefaultsFeature(RestoreFactoryDefaults): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def restore_factory_defaults(self): + + self.native_functions.restore_factory_defaults(self.device_handle) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/rich_response_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/rich_response_feature.py new file mode 100644 index 0000000..df03869 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/rich_response_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_RichResponse + +class RichResponseFeature(RichResponse): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_rich_response(self) -> TLMC_RichResponse: + + return self.native_functions.get_rich_response(self.device_handle) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/set_actuator_type_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/set_actuator_type_feature.py new file mode 100644 index 0000000..ff3f370 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/set_actuator_type_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.set_actuator_type import SetActuatorType +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class SetActuatorTypeFeature(SetActuatorType): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_actuator_type(self, actuator_type: int): + + self.native_functions.set_actuator_type(self.device_handle, actuator_type) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/settings_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/settings_feature.py new file mode 100644 index 0000000..7742e10 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/settings_feature.py @@ -0,0 +1,31 @@ +from typing import List + +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_SettingStringFormat +from thorlabs_xa.shared.params import TLMC_Setting + +class SettingsFeature(Settings): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + return self.native_functions.get_setting(self.device_handle, settings_name, max_wait_in_milliseconds) + + def get_settings_items(self) -> List[TLMC_Setting]: + + number_of_settings = self.native_functions.get_setting_count(self.device_handle) + return self.native_functions.get_settings(self.device_handle, 0, number_of_settings) + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + return self.native_functions.get_settings_as_string(self.device_handle, setting_string_format, include_read_only_items) + + def set_settings(self, settings: str) -> None: + + self.native_functions.set_settings_from_string(self.device_handle, settings) + + def get_setting_discrete_values(self, settings_name: str) -> str: + return self.native_functions.get_setting_discrete_values(self.device_handle, settings_name) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/stage_axis_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/stage_axis_params_feature.py new file mode 100644 index 0000000..84cf7aa --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/stage_axis_params_feature.py @@ -0,0 +1,16 @@ +from thorlabs_xa.interfaces.device_features.stage_axis_params import StageAxisParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_StageAxisParams + +class StageAxisParamsFeature(StageAxisParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_stage_axis_params(self, max_wait_in_milliseconds: int) -> TLMC_StageAxisParams: + return self.native_functions.get_stage_axis_params(self.device_handle, max_wait_in_milliseconds) + + def set_stage_axis_params(self, params: TLMC_StageAxisParams) -> None: + self.native_functions.set_stage_axis_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/status_items_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/status_items_feature.py new file mode 100644 index 0000000..068e345 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/status_items_feature.py @@ -0,0 +1,24 @@ +from typing import List +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_StatusItemId +from thorlabs_xa.shared.params import TLMC_StatusItem + +class StatusItemsFeature(StatusItems): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_status_item(self, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: + + return self.native_functions.get_status_item(self.device_handle, status_item_id) + + def get_status_item_count(self): + + return self.native_functions.get_status_item_count(self.device_handle) + + def get_status_items(self, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: + + return self.native_functions.get_status_items(self.device_handle, start_index, number_of_items) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/status_mode_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/status_mode_feature.py new file mode 100644 index 0000000..4ae0c42 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/status_mode_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_OperatingMode + +class StatusModeFeature(StatusMode): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def set_status_mode(self, operating_mode: TLMC_OperatingMode) -> None: + + self.native_functions.set_status_mode(self.device_handle, operating_mode) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/status_request_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/status_request_feature.py new file mode 100644 index 0000000..5126bbe --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/status_request_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class StatusRequestFeature(StatusRequest): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def request_status(self, max_wait_in_milliseconds: int): + + self.native_functions.request_status(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/stepper_loop_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/stepper_loop_params_feature.py new file mode 100644 index 0000000..93f6795 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/stepper_loop_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.stepper_loop_params import StepperLoopParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_StepperLoopParams + +class StepperLoopParamsFeature(StepperLoopParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_stepper_loop_params(self, max_wait_in_milliseconds: int) -> TLMC_StepperLoopParams: + + return self.native_functions.get_stepper_loop_params(self.device_handle, max_wait_in_milliseconds) + + def set_stepper_loop_params(self, params: TLMC_StepperLoopParams): + + self.native_functions.set_stepper_loop_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/stepper_status_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/stepper_status_feature.py new file mode 100644 index 0000000..329b61f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/stepper_status_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.stepper_status import StepperStatus +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_StepperStatus + +class StepperStatusFeature(StepperStatus): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_stepper_status(self, max_wait_in_milliseconds: int) -> TLMC_StepperStatus: + + return self.native_functions.get_stepper_status(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/stop_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/stop_feature.py new file mode 100644 index 0000000..b6f757c --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/stop_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_StopMode + +class StopFeature(Stop): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def stop(self, stop_mode: TLMC_StopMode, max_wait_in_milliseconds: int) -> None: + + self.native_functions.stop(self.device_handle, stop_mode, max_wait_in_milliseconds) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/track_settle_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/track_settle_params_feature.py new file mode 100644 index 0000000..cb2dca2 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/track_settle_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.track_settle_params import TrackSettleParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_TrackSettleParams + +class TrackSettleParamsFeature(TrackSettleParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_track_settle_params(self, max_wait_in_milliseconds: int): + + return self.native_functions.get_track_settle_params(self.device_handle, max_wait_in_milliseconds) + + def set_track_settle_params(self, params: TLMC_TrackSettleParams): + + self.native_functions.set_track_settle_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/trigger_params_for_dc_brushless_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/trigger_params_for_dc_brushless_feature.py new file mode 100644 index 0000000..5ff3a26 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/trigger_params_for_dc_brushless_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.trigger_params_for_dc_brushless import TriggerParamsForDcBrushless +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_TriggerParamsForDcBrushless + +class TriggerParamsForDcBrushlessFeature(TriggerParamsForDcBrushless): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_trigger_params_for_dc_brushless(self, max_wait_in_milliseconds: int) -> TLMC_TriggerParamsForDcBrushless: + + return self.native_functions.get_trigger_params_for_dc_brushless(self.device_handle, max_wait_in_milliseconds) + + def set_trigger_params_for_dc_brushless(self, params: TLMC_TriggerParamsForDcBrushless) -> None: + + self.native_functions.set_trigger_params_for_dc_brushless(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/trigger_params_for_stepper_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/trigger_params_for_stepper_feature.py new file mode 100644 index 0000000..9c3e5c3 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/trigger_params_for_stepper_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.trigger_params_for_stepper import TriggerParamsForStepper +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_TriggerParamsForStepper + +class TriggerParamsForStepperFeature(TriggerParamsForStepper): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_trigger_params_for_stepper(self, max_wai_in_milliseconds: int) -> TLMC_TriggerParamsForStepper: + + return self.native_functions.get_trigger_params_for_stepper(self.device_handle, max_wai_in_milliseconds) + + def set_trigger_params_for_stepper(self, params: TLMC_TriggerParamsForStepper) -> None: + + self.native_functions.set_trigger_params_for_stepper(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/unit_converter_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/unit_converter_feature.py new file mode 100644 index 0000000..0ffe0f0 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/unit_converter_feature.py @@ -0,0 +1,22 @@ +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_ScaleType, TLMC_Unit + +class UnitConverterFeature(UnitConverter): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def convert_from_device_units_to_physical(self, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: + + return self.native_functions.convert_from_device_units_to_physical(self.device_handle, scale_type, device_value) + + def convert_from_physical_to_device(self, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: int) -> int: + + return self.native_functions.convert_from_physical_to_device(self.device_handle, scale_type, unit, physical_value) + + def get_preferred_physical_unit(self, scale_type: TLMC_ScaleType) -> TLMC_Unit: + + return self.native_functions.get_preferred_physical_unit(self.device_handle, scale_type) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/universal_status_bits_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/universal_status_bits_feature.py new file mode 100644 index 0000000..07cd003 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/universal_status_bits_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.universal_status_bits import UniversalStatusBits +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_UniversalStatusBit + +class UniversalStatusBitsFeature(UniversalStatusBits): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_universal_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatusBit: + + return self.native_functions.get_universal_status_bits(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/universal_status_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/universal_status_feature.py new file mode 100644 index 0000000..d64c88a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/universal_status_feature.py @@ -0,0 +1,14 @@ +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_UniversalStatus + +class UniversalStatusFeature(UniversalStatus): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_universal_status(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatus: + + return self.native_functions.get_universal_status(self.device_handle, max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/velocity_params_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/velocity_params_feature.py new file mode 100644 index 0000000..8e963b5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/velocity_params_feature.py @@ -0,0 +1,18 @@ +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.params import TLMC_VelocityParams + +class VelocityParamsFeature(VelocityParams): + + def __init__(self, device_handle: int, native_functions: NativeFunctions) -> None: + + self.device_handle = device_handle + self.native_functions = native_functions + + def get_velocity_params(self, max_wait_in_milliseconds: int) -> TLMC_VelocityParams: + + return self.native_functions.get_velocity_params(self.device_handle, max_wait_in_milliseconds) + + def set_velocity_params(self, params: TLMC_VelocityParams) -> None: + + self.native_functions.set_velocity_params(self.device_handle, params) diff --git a/Python/XA/src/thorlabs_xa/implementations/device_features/yes_flash_programming_feature.py b/Python/XA/src/thorlabs_xa/implementations/device_features/yes_flash_programming_feature.py new file mode 100644 index 0000000..c3ddd99 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/implementations/device_features/yes_flash_programming_feature.py @@ -0,0 +1,13 @@ +from thorlabs_xa.interfaces.device_features.yes_flash_programming import YesFlashProgramming +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +class YesFlashProgrammingFeature(YesFlashProgramming): + + def __init__(self, device_handle: int, native_functions: NativeFunctions): + + self.device_handle = device_handle + self.native_functions = native_functions + + def send_yes_flash_programming(self): + + self.native_functions.send_yes_flash_programming(self.device_handle) diff --git a/Python/XA/src/thorlabs_xa/interfaces/__init__.py b/Python/XA/src/thorlabs_xa/interfaces/__init__.py new file mode 100644 index 0000000..7463971 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/__init__.py @@ -0,0 +1 @@ +# Blank - just an indicator that this is a package folder \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/__init__.py b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/kdc101_feature_group.py b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/kdc101_feature_group.py new file mode 100644 index 0000000..36082b5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/kdc101_feature_group.py @@ -0,0 +1,144 @@ +from typing import Protocol + +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.dc_pid_params import DcPidParams +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.end_of_move_messages_mode import EndOfMoveMessagesMode +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.interfaces.device_features.kcube_io_trigger_params import KcubeIoTriggerParams +from thorlabs_xa.interfaces.device_features.kcube_mmi_params import KcubeMmiParams +from thorlabs_xa.interfaces.device_features.kcube_position_trigger_params import KcubePositionTriggerParams +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.interfaces.device_features.limit_switch_params_setter import LimitSwitchParamsSetter +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.interfaces.device_features.universal_status_bits import UniversalStatusBits +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams + +class Kdc101FeatureGroup(Protocol): + + @property + def connected_product_feature(self) -> ConnectedProduct: ... + + @property + def dc_pid_params_feature(self) -> DcPidParams: ... + + @property + def digital_output_states_feature(self) -> DigitalOutputStates: ... + + @property + def disconnect_feature(self) -> Disconnect: ... + + @property + def enable_state_feature(self) -> EnableState: ... + + @property + def end_of_move_messages_mode_feature(self) -> EndOfMoveMessagesMode: ... + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: ... + + @property + def general_move_params_feature(self) -> GeneralMoveParams: ... + + @property + def hardware_info_feature(self) -> HardwareInfo: ... + + @property + def home_feature(self) -> Home: ... + + @property + def home_params_feature(self) -> HomeParams: ... + + @property + def identify_feature(self) -> Identify: ... + + @property + def jog_params_feature(self) -> JogParams: ... + + @property + def kcube_mmi_params_feature(self) -> KcubeMmiParams: ... + + @property + def kcube_position_trigger_params_feature(self) -> KcubePositionTriggerParams: ... + + @property + def kcube_io_trigger_params_feature(self) -> KcubeIoTriggerParams: ... + + @property + def limit_switch_params_getter_feature(self) -> LimitSwitchParamsGetter: ... + + @property + def limit_switch_params_setter_feature(self) -> LimitSwitchParamsSetter: ... + + @property + def load_params_feature(self) -> LoadParams: ... + + @property + def move_feature(self) -> Move: ... + + @property + def move_absolute_params_feature(self) -> MoveAbsoluteParams: ... + + @property + def move_relative_params_feature(self) -> MoveRelativeParams: ... + + @property + def persist_params_feature(self) -> PersistParams: ... + + @property + def position_counter_feature(self) -> PositionCounter: ... + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: ... + + @property + def rich_response_feature(self) -> RichResponse: ... + + @property + def set_status_mode_feature(self) -> StatusMode: ... + + @property + def settings_feature(self) -> Settings: ... + + @property + def status_items_feature(self) -> StatusItems: ... + + @property + def status_request_feature(self) -> StatusRequest: ... + + @property + def stop_feature(self) -> Stop: ... + + @property + def unit_converter_feature(self) -> UnitConverter: ... + + @property + def universal_status_feature(self) -> UniversalStatus: ... + + @property + def universal_status_bits_feature(self) -> UniversalStatusBits: ... + + @property + def velocity_params_feature(self) -> VelocityParams: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/kpc101_feature_group.py b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/kpc101_feature_group.py new file mode 100644 index 0000000..006d921 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/kpc101_feature_group.py @@ -0,0 +1,128 @@ +from typing import Protocol + +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.kcube_mmi_lock import KcubeMmiLock +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_settings_params import KpcIoSettingsParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_trigger_params import KpcIoTriggerParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_mmi_params import KpcMmiParams +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.interfaces.device_features.piezo.output_waveform import OutputWaveform +from thorlabs_xa.interfaces.device_features.piezo.output_waveform_params_getter import OutputWaveformParamsGetter +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.interfaces.device_features.piezo.position_loop_params import PositionLoopParams +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter + +class Kpc101FeatureGroup(Protocol): + + @property + def connected_product_feature(self) -> ConnectedProduct: ... + + @property + def digital_output_states_feature(self) -> DigitalOutputStates: ... + + @property + def disconnect_feature(self) -> Disconnect: ... + + @property + def enable_state_feature(self) -> EnableState: ... + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: ... + + @property + def hardware_version_info_feature(self) -> HardwareInfo: ... + + @property + def identify_feature(self) -> Identify: ... + + @property + def kcube_mmi_lock_feature(self) -> KcubeMmiLock: ... + + @property + def kpc_io_settings_params_feature(self) -> KpcIoSettingsParams: ... + + @property + def kpc_io_trigger_params_feature(self) -> KpcIoTriggerParams: ... + + @property + def kpc_mmi_params_feature(self) -> KpcMmiParams: ... + + @property + def load_params_feature(self) -> LoadParams: ... + + @property + def max_travel_feature(self) -> MaxTravel: ... + + @property + def output_voltage_feature(self) -> OutputVoltage: ... + + @property + def output_voltage_control_source_params_feature(self) -> OutputVoltageControlSourceParams: ... + + @property + def output_waveform_feature(self) -> OutputWaveform: ... + + @property + def output_waveform_params_getter_feature(self) -> OutputWaveformParamsGetter: ... + + @property + def persist_params_feature(self) -> PersistParams: ... + + @property + def piezo_status_feature(self) -> PiezoStatus: ... + + @property + def piezo_status_bits_feature(self) -> PiezoStatusBits: ... + + @property + def position_loop_params_feature(self) -> PositionLoopParams: ... + + @property + def position_feature(self) -> Position: ... + + @property + def position_control_mode_feature(self) -> PositionControlMode: ... + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: ... + + @property + def rich_response_feature(self) -> RichResponse: ... + + @property + def settings_feature(self) -> Settings: ... + + @property + def status_items_feature(self) -> StatusItems: ... + + @property + def status_request_feature(self) -> StatusRequest: ... + + @property + def set_status_mode_feature(self) -> StatusMode: ... + + @property + def unit_converter_feature(self) -> UnitConverter: ... + + @property + def zero_feature(self) -> Zero: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/linear_translation_stage_feature_group.py b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/linear_translation_stage_feature_group.py new file mode 100644 index 0000000..77ea89f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/linear_translation_stage_feature_group.py @@ -0,0 +1,121 @@ +from typing import Protocol + +from thorlabs_xa.interfaces.device_features.button_params import ButtonParams +from thorlabs_xa.interfaces.device_features.calibration import Calibration +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.potentiometer_params import PotentiometerParams +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.stepper_status import StepperStatus +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams + +class LinearTranslationStageFeatureGroup(Protocol): + + @property + def button_params_feature(self) -> ButtonParams: ... + + @property + def calibration_feature(self) -> Calibration: ... + + @property + def connectd_product_feature(self) -> ConnectedProduct: ... + + @property + def disconnect_feature(self) -> Disconnect: ... + + @property + def enable_state_feature(self) -> EnableState: ... + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: ... + + @property + def hardware_info_feature(self) -> HardwareInfo: ... + + @property + def general_move_params_feature(self) -> GeneralMoveParams: ... + + @property + def home_feature(self) -> Home: ... + + @property + def home_params_feature(self) -> HomeParams: ... + + @property + def identify_feature(self) -> Identify: ... + + @property + def jog_params_feature(self) -> JogParams: ... + + @property + def limit_switch_params_getter_feature(self) -> LimitSwitchParamsGetter: ... + + @property + def load_params_feature(self) -> LoadParams: ... + + @property + def move_feature(self) -> Move: ... + + @property + def move_absolute_params_feature(self) -> MoveAbsoluteParams: ... + + @property + def move_relative_params_feature(self) -> MoveRelativeParams: ... + + @property + def persist_params_feature(self) -> PersistParams: ... + + @property + def potentiometer_params_feature(self) -> PotentiometerParams: ... + + @property + def position_counter(self) -> PositionCounter: ... + + @property + def status_mode_feature(self) -> StatusMode: ... + + @property + def settings_feature(self) -> Settings: ... + + @property + def status_items_feature(self) -> StatusItems: ... + + @property + def status_request_feature(self) -> StatusRequest: ... + + @property + def stop_feature(self) -> Stop: ... + + @property + def unit_converter_feature(self) -> UnitConverter: ... + + @property + def stepper_status_feature(self) -> StepperStatus: ... + + @property + def universal_status_feature(self) -> UniversalStatus: ... + + @property + def velocity_params_feature(self) -> VelocityParams: ... + diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/lnnx_feature_group.py b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/lnnx_feature_group.py new file mode 100644 index 0000000..fdeb2d0 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/lnnx_feature_group.py @@ -0,0 +1,85 @@ + +from typing import Protocol + +from thorlabs_xa.interfaces.device_features.digital_input_states import DigitalInputStates +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_diameter_lookup_table_data import NanoTrakCircleDiameterLookupTableData +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_home_position import NanoTrakCircleHomePosition +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_params import NanoTrakCircleParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_eeprom_params import NanoTrakEEPROMParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_gain_params import NanoTrakGainParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_mode import NanoTrakMode +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_phase_compensation_params import NanoTrakPhaseCompensationParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_range_params import NanoTrakRangeParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_status import NanoTrakStatus +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_tna_io_settings import NanoTrakTnaIoSettings +from thorlabs_xa.interfaces.device_features.rack_bay_occupied_state import RackBayOccupiedState +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings + +class LnnxFeatureGroup(Protocol): + + @property + def digital_input_states_feature(self) -> DigitalInputStates: ... + + @property + def digital_output_states_feature(self) -> DigitalOutputStates: ... + + @property + def disconnect_feature(self) -> Disconnect: ... + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: ... + + @property + def hardware_info_feature(self) -> HardwareInfo: ... + + @property + def identify_feature(self) -> Identify: ... + + @property + def nano_trak_circle_diameter_lookup_table_data_feature(self) -> NanoTrakCircleDiameterLookupTableData: ... + + @property + def nano_trak_circle_home_position_feature(self) -> NanoTrakCircleHomePosition: ... + + @property + def nano_trak_circle_params_feature(self) -> NanoTrakCircleParams: ... + + @property + def nano_trak_eeprom_params_feature(self) -> NanoTrakEEPROMParams: ... + + @property + def nano_trak_gain_params_feature(self) -> NanoTrakGainParams: ... + + @property + def nano_trak_mode_feature(self) -> NanoTrakMode: ... + + @property + def nano_trak_phase_compensation_params_feature(self) -> NanoTrakPhaseCompensationParams: ... + + @property + def nano_trak_status_feature(self) -> NanoTrakStatus: ... + + @property + def nano_trak_range_params_feature(self) -> NanoTrakRangeParams: ... + + @property + def nano_trak_tna_io_settings_feature(self) -> NanoTrakTnaIoSettings: ... + + @property + def rack_bay_occupied_state_feature(self) -> RackBayOccupiedState: ... + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: ... + + @property + def rich_response_feature(self) -> RichResponse: ... + + @property + def settings_feature(self) -> Settings: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/lnnx_logical_channel_feature_group.py b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/lnnx_logical_channel_feature_group.py new file mode 100644 index 0000000..05b3c67 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_feature_groups/lnnx_logical_channel_feature_group.py @@ -0,0 +1,76 @@ +from typing import Protocol + +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.piezo.max_output_voltage_params import MaxOutputVoltageParams +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero + +class LnnxLogicalChannelFeatureGroup(Protocol): + + @property + def enable_state_feature(self) -> EnableState: ... + + @property + def firmware_version_info_feature(self) -> FirmwareVersionInfo: ... + + @property + def hardware_info_feature(self) -> HardwareInfo: ... + + @property + def identify_feature(self) -> Identify: ... + + @property + def max_output_voltage_params_feature(self) -> MaxOutputVoltageParams: ... + + @property + def max_travel_feature(self) -> MaxTravel: ... + + @property + def output_voltage_feature(self) -> OutputVoltage: ... + + @property + def output_voltage_control_source_params_feature(self) -> OutputVoltageControlSourceParams: ... + + @property + def piezo_status_feature(self) -> PiezoStatus: ... + + @property + def piezo_status_bits_feature(self) -> PiezoStatusBits: ... + + @property + def position_feature(self) -> Position: ... + + @property + def position_control_mode_feature(self) -> PositionControlMode: ... + + @property + def restore_factory_defaults_feature(self) -> RestoreFactoryDefaults: ... + + @property + def settings_feature(self) -> Settings: ... + + @property + def status_items_feature(self) -> StatusItems: ... + + @property + def status_mode_feature(self) -> StatusMode: ... + + @property + def unit_converter_feature(self) -> UnitConverter: ... + + @property + def zero_feature(self) -> Zero: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/__init__.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/adc_inputs.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/adc_inputs.py new file mode 100644 index 0000000..b529b30 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/adc_inputs.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_AdcInputs + +@runtime_checkable +class AdcInputs(Protocol): + + def get_adc_inputs(self, max_wait_in_milliseconds: int) -> TLMC_AdcInputs: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/analog_monitor_configuration_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/analog_monitor_configuration_params.py new file mode 100644 index 0000000..2947d57 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/analog_monitor_configuration_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorNumber +from thorlabs_xa.shared.params import TLMC_AnalogMonitorConfigurationParams + +@runtime_checkable +class AnalogMonitorConfigurationParams(Protocol): + + def get_analog_monitor_configuration_params(self, monitor_number: TLMC_AnalogMonitorNumber, max_wait_in_milliseconds: int) -> TLMC_AnalogMonitorConfigurationParams: ... + def set_analog_monitor_configuration_params(self, monitor_number: TLMC_AnalogMonitorNumber, params: TLMC_AnalogMonitorConfigurationParams): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/aux_io_configuration_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/aux_io_configuration_params.py new file mode 100644 index 0000000..5cb57aa --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/aux_io_configuration_params.py @@ -0,0 +1,14 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_AuxIoPortMode, TLMC_AuxIoPortNumber + +@runtime_checkable +class AuxIoConfigurationParams(Protocol): + + def get_aux_io_port_mode(self, port_number: TLMC_AuxIoPortNumber, max_wait_in_milliseconds: int) -> TLMC_AuxIoPortMode: ... + + def set_aux_io_port_mode(self, port_number: TLMC_AuxIoPortNumber, port_mode: TLMC_AuxIoPortMode): ... + + def get_aux_io_software_states(self, max_wait_in_milliseconds: int) -> int: ... + + def set_aux_io_software_states(self, software_states: int): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/bow_index.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/bow_index.py new file mode 100644 index 0000000..d5c3627 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/bow_index.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_BowIndex + +@runtime_checkable +class BowIndex(Protocol): + + def get_bow_index(self, max_wait_in_milliseconds: int) -> TLMC_BowIndex: ... + + def set_bow_index(self, bow_index: TLMC_BowIndex): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/button_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/button_params.py new file mode 100644 index 0000000..c7ccc0c --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/button_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_ButtonParams + +@runtime_checkable +class ButtonParams(Protocol): + + def get_button_params(self, max_wait_in_milliseconds: int) -> TLMC_ButtonParams: ... + + def set_button_params(self, params: TLMC_ButtonParams): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/calibration.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/calibration.py new file mode 100644 index 0000000..1095415 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/calibration.py @@ -0,0 +1,19 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.enums import TLMC_CalibrationState +from thorlabs_xa.shared.params import * + + +@runtime_checkable +class Calibration(Protocol): + + + def activate(self) -> None: + pass + + + def deactivate(self) -> None: + pass + + + def get_calibration_state(self, max_wait_in_milliseconds: int) -> TLMC_CalibrationState: + pass diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/connected_product.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/connected_product.py new file mode 100644 index 0000000..e5ba679 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/connected_product.py @@ -0,0 +1,14 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_ConnectedProductInfo + +@runtime_checkable +class ConnectedProduct(Protocol): + + def get_connected_product_info(self) -> TLMC_ConnectedProductInfo: ... + + def set_connected_product_info(self, product_info: TLMC_ConnectedProductInfo) -> None: ... + + def set_connected_product(self, product_name: str) -> None: ... + + def get_connected_products_supported(self, max_length: int) -> tuple [str, int]: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/current_loop_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/current_loop_params.py new file mode 100644 index 0000000..5507f50 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/current_loop_params.py @@ -0,0 +1,11 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_CurrentLoopScenario +from thorlabs_xa.shared.params import TLMC_CurrentLoopParams + +@runtime_checkable +class CurrentLoopParams(Protocol): + + def get_current_loop_params(self, scenario: TLMC_CurrentLoopScenario, max_wait_in_milliseconds: int) -> TLMC_CurrentLoopParams: ... + + def set_current_loop_params(self, scenario: TLMC_CurrentLoopScenario, parameters: TLMC_CurrentLoopParams): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/dc_pid_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/dc_pid_params.py new file mode 100644 index 0000000..bd6146a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/dc_pid_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_DcPidParams + +@runtime_checkable +class DcPidParams(Protocol): + + def get_dc_pid_params(self, max_wait_in_milliseconds: int) -> TLMC_DcPidParams: ... + + def set_dc_pid_params(self, parameters: TLMC_DcPidParams): ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/digital_input_states.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/digital_input_states.py new file mode 100644 index 0000000..5c4e50e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/digital_input_states.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_DigitalInput + +@runtime_checkable +class DigitalInputStates(Protocol): + + def get_digital_input_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalInput: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/digital_output_states.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/digital_output_states.py new file mode 100644 index 0000000..35c0003 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/digital_output_states.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_DigitalOutput + +@runtime_checkable +class DigitalOutputStates(Protocol): + + def get_digital_output_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: ... + + def set_digital_output_states(self, params: TLMC_DigitalOutput): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/disconnect.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/disconnect.py new file mode 100644 index 0000000..7ef1729 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/disconnect.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class Disconnect(Protocol): + + def disconnect(self) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/enable_state.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/enable_state.py new file mode 100644 index 0000000..0a151a4 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/enable_state.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_EnableState + +@runtime_checkable +class EnableState(Protocol): + + def get_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_EnableState: ... + + def set_enable_state(self, enable_state: TLMC_EnableState) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/encoder_counter.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/encoder_counter.py new file mode 100644 index 0000000..050decc --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/encoder_counter.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class EncoderCounter(Protocol): + + def get_encoder_counter(self, max_wait_in_milliseconds: int) -> int: ... + + def set_encoder_counter(self, new_encoder_counter: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/end_of_move_messages_mode.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/end_of_move_messages_mode.py new file mode 100644 index 0000000..f9eb499 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/end_of_move_messages_mode.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_EndOfMoveMessagesMode + +@runtime_checkable +class EndOfMoveMessagesMode(Protocol): + + def set_end_of_move_messages_mode(self, messages_mode: TLMC_EndOfMoveMessagesMode) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/firmware_version_info.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/firmware_version_info.py new file mode 100644 index 0000000..d889e34 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/firmware_version_info.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_FirmwareVersion + +@runtime_checkable +class FirmwareVersionInfo(Protocol): + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/general_move_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/general_move_params.py new file mode 100644 index 0000000..bdd5c0f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/general_move_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_GeneralMoveParams + +@runtime_checkable +class GeneralMoveParams(Protocol): + + def get_general_move_params(self, max_wait_in_milliseconds: int) -> TLMC_GeneralMoveParams: ... + + def set_general_move_params(self, params: TLMC_GeneralMoveParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/hardware_info.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/hardware_info.py new file mode 100644 index 0000000..2e292e7 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/hardware_info.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_HardwareInfo + +@runtime_checkable +class HardwareInfo(Protocol): + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/home.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/home.py new file mode 100644 index 0000000..14f8264 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/home.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class Home(Protocol): + + def home(self, max_wait_in_milliseconds: int) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/home_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/home_params.py new file mode 100644 index 0000000..19c30f5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/home_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_HomeParams + +@runtime_checkable +class HomeParams(Protocol): + + def get_home_params(self, max_wait_in_milliseconds: int) -> TLMC_HomeParams: ... + + def set_home_params(self, params: TLMC_HomeParams): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/identify.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/identify.py new file mode 100644 index 0000000..420e103 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/identify.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class Identify(Protocol): + + def identify(self) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/io_configuration_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/io_configuration_params.py new file mode 100644 index 0000000..45ffe14 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/io_configuration_params.py @@ -0,0 +1,13 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_IoPortNumber +from thorlabs_xa.shared.params import TLMC_IoConfigurationParams + +@runtime_checkable +class IoConfigurationParams(Protocol): + + def get_io_configuration_number_of_ports_supported(self) -> int: ... + + def get_io_configuration_params(self, port_number: TLMC_IoPortNumber, max_wait_in_milliseconds: int) -> TLMC_IoConfigurationParams: ... + + def set_io_configuration_params(self, handle: int, port_number: TLMC_IoPortNumber, params: TLMC_IoConfigurationParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/io_position_trigger_enable_state.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/io_position_trigger_enable_state.py new file mode 100644 index 0000000..af6bcf2 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/io_position_trigger_enable_state.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_IoPositionTriggerEnableState + +@runtime_checkable +class IoPositionTriggerEnableState(Protocol): + + def get_io_position_trigger_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_IoPositionTriggerEnableState: ... + + def set_io_position_trigger_enable_state(self, enable_state: TLMC_IoPositionTriggerEnableState, max_wait_in_milliseconds: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/io_trigger_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/io_trigger_params.py new file mode 100644 index 0000000..afcc642 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/io_trigger_params.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_IoTriggerParams + +@runtime_checkable +class IoTriggerParams(Protocol): + + def get_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_IoTriggerParams: ... + + def set_io_trigger_params(self, params: TLMC_IoTriggerParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/jog_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/jog_params.py new file mode 100644 index 0000000..49d81c1 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/jog_params.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_JogParams + +@runtime_checkable +class JogParams(Protocol): + + def get_jog_params(self, max_wait_in_milliseconds: int) -> TLMC_JogParams: ... + + def set_jog_params(self, params: TLMC_JogParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/joystick_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/joystick_params.py new file mode 100644 index 0000000..704fbfd --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/joystick_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_JoystickParams + +@runtime_checkable +class JoystickParams(Protocol): + + def get_joystick_params(self, max_wait_in_milliseconds: int) -> TLMC_JoystickParams: ... + + def set_joystick_params(self, params: TLMC_JoystickParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_io_trigger_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_io_trigger_params.py new file mode 100644 index 0000000..6085697 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_io_trigger_params.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_KcubeIoTriggerParams + +@runtime_checkable +class KcubeIoTriggerParams(Protocol): + + def get_kcube_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubeIoTriggerParams: ... + + def set_kcube_io_trigger_params(self, params: TLMC_KcubeIoTriggerParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_mmi_lock.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_mmi_lock.py new file mode 100644 index 0000000..704c89d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_mmi_lock.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_KcubeMmiLockState + +@runtime_checkable +class KcubeMmiLock(Protocol): + + def get_kcube_mmi_lock_state(self, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiLockState: ... + + def set_kcube_mmi_lock_state(self, lock_state: TLMC_KcubeMmiLockState) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_mmi_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_mmi_params.py new file mode 100644 index 0000000..3b189b5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_mmi_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_KcubeMmiParams + +@runtime_checkable +class KcubeMmiParams(Protocol): + + def get_kcube_mmi_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiParams: ... + + def set_kcube_mmi_params(self, params: TLMC_KcubeMmiParams): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_position_trigger_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_position_trigger_params.py new file mode 100644 index 0000000..790a6fa --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/kcube_position_trigger_params.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_KcubePositionTriggerParams + +@runtime_checkable +class KcubePositionTriggerParams(Protocol): + + def get_kcube_position_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubePositionTriggerParams: ... + + def set_kcube_position_trigger_params(self, params: TLMC_KcubePositionTriggerParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/lcd_display_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/lcd_display_params.py new file mode 100644 index 0000000..567437e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/lcd_display_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_LcdDisplayParams + +@runtime_checkable +class LcdDisplayParams(Protocol): + + def get_lcd_display_params(self, max_wait_in_milliseconds: int) -> TLMC_LcdDisplayParams: ... + + def set_lcd_display_params(self, params: TLMC_LcdDisplayParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/lcd_move_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/lcd_move_params.py new file mode 100644 index 0000000..56aae86 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/lcd_move_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_LcdMoveParams + +@runtime_checkable +class LcdMoveParams(Protocol): + + def get_lcd_move_params(self, max_wait_in_milliseconds: int) -> TLMC_LcdMoveParams: ... + + def set_lcd_move_params(self, params: TLMC_LcdMoveParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/limit_switch_params_getter.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/limit_switch_params_getter.py new file mode 100644 index 0000000..8d19df9 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/limit_switch_params_getter.py @@ -0,0 +1,8 @@ + +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_LimitSwitchParams + +@runtime_checkable +class LimitSwitchParamsGetter(Protocol): + + def get_limit_switch_params(self, max_wait_in_milliseconds: int) -> TLMC_LimitSwitchParams: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/limit_switch_params_setter.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/limit_switch_params_setter.py new file mode 100644 index 0000000..2b07163 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/limit_switch_params_setter.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_LimitSwitchParams + +@runtime_checkable +class LimitSwitchParamsSetter(Protocol): + + def set_limit_switch_params(self, params: TLMC_LimitSwitchParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/load_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/load_params.py new file mode 100644 index 0000000..a3376e2 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/load_params.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class LoadParams(Protocol): + + def load_params(self) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/motor_output_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/motor_output_params.py new file mode 100644 index 0000000..92c5482 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/motor_output_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_MotorOutputParams + +@runtime_checkable +class MotorOutputParams(Protocol): + + def get_motor_output_params(self, max_wait_in_milliseconds: int) -> TLMC_MotorOutputParams: ... + + def set_motor_output_params(self, params: TLMC_MotorOutputParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/move.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/move.py new file mode 100644 index 0000000..90af53a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/move.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_MoveMode + +@runtime_checkable +class Move(Protocol): + + def move(self, move_mode: TLMC_MoveMode, params: int, max_wait_in_milliseconds: int): ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/move_absolute_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/move_absolute_params.py new file mode 100644 index 0000000..73b3d65 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/move_absolute_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_MoveAbsoluteParams + +@runtime_checkable +class MoveAbsoluteParams(Protocol): + + def get_move_absolute_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveAbsoluteParams: ... + + def set_move_absolute_params(self, params: TLMC_MoveAbsoluteParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/move_relative_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/move_relative_params.py new file mode 100644 index 0000000..8b3d890 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/move_relative_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_MoveRelativeParams + +@runtime_checkable +class MoveRelativeParams(Protocol): + + def get_move_relative_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveRelativeParams: ... + + def set_move_relative_params(self, params: TLMC_MoveRelativeParams) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/no_flash_programming.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/no_flash_programming.py new file mode 100644 index 0000000..7b49d02 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/no_flash_programming.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class NoFlashProgramming(Protocol): + + def send_no_flash_programming(self) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/persist_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/persist_params.py new file mode 100644 index 0000000..9359ccf --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/persist_params.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_ParameterGroupId + +@runtime_checkable +class PersistParams(Protocol): + + def persist_params(self, parameter_group_id: TLMC_ParameterGroupId): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/__init__.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_io_settings_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_io_settings_params.py new file mode 100644 index 0000000..7872c84 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_io_settings_params.py @@ -0,0 +1,9 @@ +from typing import Protocol + +from thorlabs_xa.shared.params import TLMC_PZ_KpcIoSettingsParams + +class KpcIoSettingsParams(Protocol): + + def get_io_settings_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoSettingsParams: ... + + def set_io_settings_params(self, params: TLMC_PZ_KpcIoSettingsParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_io_trigger_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_io_trigger_params.py new file mode 100644 index 0000000..70facd8 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_io_trigger_params.py @@ -0,0 +1,9 @@ +from typing import Protocol + +from thorlabs_xa.shared.params import TLMC_PZ_KpcIoTriggerParams + +class KpcIoTriggerParams(Protocol): + + def get_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoTriggerParams: ... + + def set_io_trigger_params(self, params: TLMC_PZ_KpcIoTriggerParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_mmi_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_mmi_params.py new file mode 100644 index 0000000..d7b400a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/kpc_mmi_params.py @@ -0,0 +1,9 @@ +from typing import Protocol + +from thorlabs_xa.shared.params import TLMC_PZ_KpcMmiParams + +class KpcMmiParams(Protocol): + + def get_kpc_mmi_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcMmiParams: ... + + def set_kpc_mmi_params(self, params: TLMC_PZ_KpcMmiParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/max_output_voltage_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/max_output_voltage_params.py new file mode 100644 index 0000000..3e59345 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/max_output_voltage_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_MaxOutputVoltageParams + +@runtime_checkable +class MaxOutputVoltageParams(Protocol): + + def get_max_output_voltage_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_MaxOutputVoltageParams: ... + + def set_max_output_voltage(self, max_output_voltage: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/max_travel.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/max_travel.py new file mode 100644 index 0000000..9b95145 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/max_travel.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class MaxTravel(Protocol): + + def get_max_travel(self, max_wait_in_milliseconds: int) -> int: ... + + def set_max_travel(self, max_travel: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_diameter_lookup_table_data.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_diameter_lookup_table_data.py new file mode 100644 index 0000000..33e4b5a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_diameter_lookup_table_data.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakCircleDiameterLookupTableData + +@runtime_checkable +class NanoTrakCircleDiameterLookupTableData(Protocol): + + def get_nano_trak_circle_diameter_lookup_table_data(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleDiameterLookupTableData: ... + + def set_nano_trak_circle_diameter_lookup_table_data(self, params: TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_home_position.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_home_position.py new file mode 100644 index 0000000..a266902 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_home_position.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakCircleHomePositionParams + +@runtime_checkable +class NanoTrakCircleHomePosition(Protocol): + + def get_nano_trak_circle_home_position(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleHomePositionParams: ... + + def set_nano_trak_circle_home_position(self, params: TLMC_PZ_NanoTrakCircleHomePositionParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_params.py new file mode 100644 index 0000000..94b1333 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_circle_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakCircleParams + +@runtime_checkable +class NanoTrakCircleParams(Protocol): + + def get_nano_trak_circle_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleParams: ... + + def set_nano_trak_circle_params(self, params: TLMC_PZ_NanoTrakCircleParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_eeprom_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_eeprom_params.py new file mode 100644 index 0000000..838d1bb --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_eeprom_params.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakEEPROMParams + +@runtime_checkable +class NanoTrakEEPROMParams(Protocol): + + def set_nano_trak_eeprom_params(self, params: TLMC_PZ_NanoTrakEEPROMParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_gain_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_gain_params.py new file mode 100644 index 0000000..3945b85 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_gain_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakGainParams + +@runtime_checkable +class NanoTrakGainParams(Protocol): + + def get_nano_trak_gain_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakGainParams: ... + + def set_nano_trak_gain_params(self, params: TLMC_PZ_NanoTrakGainParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_mode.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_mode.py new file mode 100644 index 0000000..89499d4 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_mode.py @@ -0,0 +1,11 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_PZ_SetNanoTrakModeType +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakMode + +@runtime_checkable +class NanoTrakMode(Protocol): + + def get_nano_trak_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakMode: ... + + def set_nano_trak_mode(self, set_mode: TLMC_PZ_SetNanoTrakModeType) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_phase_compensation_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_phase_compensation_params.py new file mode 100644 index 0000000..536dc6f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_phase_compensation_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakPhaseCompensationParams + +@runtime_checkable +class NanoTrakPhaseCompensationParams(Protocol): + + def get_nano_trak_phase_compensation_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakPhaseCompensationParams: ... + + def set_nano_trak_phase_compensation_params(self, params: TLMC_PZ_NanoTrakPhaseCompensationParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_range_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_range_params.py new file mode 100644 index 0000000..36fb5a9 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_range_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakRangeParams + +@runtime_checkable +class NanoTrakRangeParams(Protocol): + + def get_nano_trak_range_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakRangeParams: ... + + def set_nano_trak_range_params(self, params: TLMC_PZ_NanoTrakRangeParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_status.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_status.py new file mode 100644 index 0000000..6c3849e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_status.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakStatus + +@runtime_checkable +class NanoTrakStatus(Protocol): + + def get_nano_trak_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakStatus: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_tna_io_settings.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_tna_io_settings.py new file mode 100644 index 0000000..db0df2f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/nano_trak_tna_io_settings.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_PZ_NanoTrakTnaIoSettings + +@runtime_checkable +class NanoTrakTnaIoSettings(Protocol): + + def get_nano_trak_tna_io_settings(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTnaIoSettings: ... + + def set_nano_trak_tna_io_settings(self, params: TLMC_PZ_NanoTrakTnaIoSettings) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_voltage.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_voltage.py new file mode 100644 index 0000000..cf021e6 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_voltage.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class OutputVoltage(Protocol): + + def get_output_voltage(self, max_wait_in_milliseconds: int) -> int: ... + + def set_output_voltage(self, output_voltage: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_voltage_control_source_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_voltage_control_source_params.py new file mode 100644 index 0000000..df77133 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_voltage_control_source_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_OutputVoltageControlSourceParams + +@runtime_checkable +class OutputVoltageControlSourceParams(Protocol): + + def get_output_voltage_control_source_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputVoltageControlSourceParams: ... + + def set_output_voltage_control_source_params(self, params: TLMC_PZ_OutputVoltageControlSourceParams) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_waveform.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_waveform.py new file mode 100644 index 0000000..4ff11bf --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_waveform.py @@ -0,0 +1,14 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_OutputWaveformLoopTableSample, TLMC_PZ_OutputWaveformParams + +@runtime_checkable +class OutputWaveform(Protocol): + + def set_output_waveform_lookup_table_sample_params(self, params: TLMC_PZ_OutputWaveformLoopTableSample) -> None: ... + + def set_output_waveform_params(self, params: TLMC_PZ_OutputWaveformParams) -> None: ... + + def start_output_waveform(self) -> None: ... + + def stop_output_waveform(self) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_waveform_params_getter.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_waveform_params_getter.py new file mode 100644 index 0000000..aa00421 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/output_waveform_params_getter.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_OutputWaveformParams + +@runtime_checkable +class OutputWaveformParamsGetter(Protocol): + + def get_output_waveform_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputWaveformParams: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/piezo_status.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/piezo_status.py new file mode 100644 index 0000000..4397cef --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/piezo_status.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_Status + +@runtime_checkable +class PiezoStatus(Protocol): + + def get_piezo_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_Status: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/piezo_status_bits.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/piezo_status_bits.py new file mode 100644 index 0000000..ca81287 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/piezo_status_bits.py @@ -0,0 +1,7 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.enums import TLMC_PZ_StatusBit + +@runtime_checkable +class PiezoStatusBits(Protocol): + + def get_piezo_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_PZ_StatusBit: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position.py new file mode 100644 index 0000000..0672d73 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class Position(Protocol): + + def get_position(self, max_wait_in_milliseconds: int) -> int: ... + + def set_position(self, position: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position_control_mode.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position_control_mode.py new file mode 100644 index 0000000..5f43ae2 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position_control_mode.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_PZ_PositionControlMode + +@runtime_checkable +class PositionControlMode(Protocol): + + def get_position_control_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionControlMode: ... + + def set_position_control_mode(self, control_mode: TLMC_PZ_PositionControlMode) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position_loop_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position_loop_params.py new file mode 100644 index 0000000..5764ba1 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/position_loop_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PZ_PositionLoopParams + +@runtime_checkable +class PositionLoopParams(Protocol): + + def get_position_loop_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionLoopParams: ... + + def set_position_loop_params(self, params: TLMC_PZ_PositionLoopParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/zero.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/zero.py new file mode 100644 index 0000000..4d6baa6 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/piezo/zero.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class Zero(Protocol): + + def set_zero(self, max_wait_in_milliseconds: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/position_counter.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/position_counter.py new file mode 100644 index 0000000..ae2c7b6 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/position_counter.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class PositionCounter(Protocol): + + def get_position_counter(self, max_wait_in_milliseconds: int) -> int: ... + + def set_position_counter(self, new_position_counter: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/position_loop_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/position_loop_params.py new file mode 100644 index 0000000..3bb6c3e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/position_loop_params.py @@ -0,0 +1,11 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_PositionLoopScenario +from thorlabs_xa.shared.params import TLMC_PositionLoopParams + +@runtime_checkable +class PositionLoopParams(Protocol): + + def get_position_loop_params(self, scenario: TLMC_PositionLoopScenario, max_wait_in_milliseconds: int) -> TLMC_PositionLoopParams: ... + + def set_position_loop_params(self, scenario: TLMC_PositionLoopScenario, params: TLMC_PositionLoopParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/potentiometer_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/potentiometer_params.py new file mode 100644 index 0000000..ad7f456 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/potentiometer_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PotentiometerParams + +@runtime_checkable +class PotentiometerParams(Protocol): + + def get_potentiometer_params(self, max_wait_in_milliseconds: int) -> TLMC_PotentiometerParams: ... + + def set_potentiometer_params(self, params: TLMC_PotentiometerParams): ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/power_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/power_params.py new file mode 100644 index 0000000..da43484 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/power_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_PowerParams + +@runtime_checkable +class PowerParams(Protocol): + + def get_power_params(self, max_wait_in_milliseconds: int) -> TLMC_PowerParams: ... + + def set_power_params(self, params: TLMC_PowerParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/profile_mode_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/profile_mode_params.py new file mode 100644 index 0000000..96ba54f --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/profile_mode_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_ProfileModeParams + +@runtime_checkable +class ProfileModeParams(Protocol): + + def get_profile_mode_params(self, max_wait_in_milliseconds: int) -> TLMC_ProfileModeParams: ... + + def set_profile_mode_params(self, params: TLMC_ProfileModeParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/rack_bay_occupied_state.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/rack_bay_occupied_state.py new file mode 100644 index 0000000..f73360d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/rack_bay_occupied_state.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_RackBayNumber, TLMC_RackBayOccupiedState + +@runtime_checkable +class RackBayOccupiedState(Protocol): + + def get_rack_bay_occupied_state(self, bay_number: TLMC_RackBayNumber, max_wait_in_milliseconds: int) -> TLMC_RackBayOccupiedState: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/rank_identify.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/rank_identify.py new file mode 100644 index 0000000..05f861d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/rank_identify.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class RackIdentify(Protocol): + + def rack_identify(self, channel: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/restore_factory_defaults.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/restore_factory_defaults.py new file mode 100644 index 0000000..f746a5d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/restore_factory_defaults.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class RestoreFactoryDefaults(Protocol): + + def restore_factory_defaults(self) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/rich_response.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/rich_response.py new file mode 100644 index 0000000..a2b0aed --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/rich_response.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_RichResponse + +@runtime_checkable +class RichResponse(Protocol): + + def get_rich_response(self) -> TLMC_RichResponse: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/set_actuator_type.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/set_actuator_type.py new file mode 100644 index 0000000..bc34030 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/set_actuator_type.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class SetActuatorType(Protocol): + + def set_actuator_type(self, actuator_type: int) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/settings.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/settings.py new file mode 100644 index 0000000..e1e48e0 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/settings.py @@ -0,0 +1,17 @@ +from typing import List, Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_SettingStringFormat +from thorlabs_xa.shared.params import TLMC_Setting + +@runtime_checkable +class Settings(Protocol): + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: ... + + def get_settings_items(self) -> List[TLMC_Setting]: ... + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: ... + + def set_settings(self, settings: str) -> None: ... + + def get_setting_discrete_values(self, settings_name: str) -> str: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/stage_axis_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/stage_axis_params.py new file mode 100644 index 0000000..01162ef --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/stage_axis_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_StageAxisParams + +@runtime_checkable +class StageAxisParams(Protocol): + + def get_stage_axis_params(self, max_wait_in_milliseconds: int) -> TLMC_StageAxisParams: ... + + def set_stage_axis_params(self, params: TLMC_StageAxisParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/status_items.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/status_items.py new file mode 100644 index 0000000..2ca2ff8 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/status_items.py @@ -0,0 +1,12 @@ +from typing import List, Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_StatusItem, TLMC_StatusItemId + +@runtime_checkable +class StatusItems(Protocol): + + def get_status_item(self, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: ... + + def get_status_item_count(self) -> int: ... + + def get_status_items(self, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/status_mode.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/status_mode.py new file mode 100644 index 0000000..e49f8be --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/status_mode.py @@ -0,0 +1,8 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_OperatingMode + +@runtime_checkable +class StatusMode(Protocol): + + def set_status_mode(self, operating_mode: TLMC_OperatingMode): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/status_request.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/status_request.py new file mode 100644 index 0000000..169384d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/status_request.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class StatusRequest(Protocol): + + def request_status(self, max_wait_in_milliseconds: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/stepper_loop_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/stepper_loop_params.py new file mode 100644 index 0000000..0bb1f07 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/stepper_loop_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_StepperLoopParams + +@runtime_checkable +class StepperLoopParams(Protocol): + + def get_stepper_loop_params(self, max_wait_in_milliseconds: int) -> TLMC_StepperLoopParams: ... + + def set_stepper_loop_params(self, params: TLMC_StepperLoopParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/stepper_status.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/stepper_status.py new file mode 100644 index 0000000..d30ad75 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/stepper_status.py @@ -0,0 +1,7 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_StepperStatus + +@runtime_checkable +class StepperStatus(Protocol): + + def get_stepper_status(self, max_wait_in_milliseconds: int) -> TLMC_StepperStatus: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/stop.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/stop.py new file mode 100644 index 0000000..b33ca03 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/stop.py @@ -0,0 +1,7 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.enums import TLMC_StopMode + +@runtime_checkable +class Stop(Protocol): + + def stop(self, stop_mode: TLMC_StopMode, max_wait_in_milliseconds: int) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/track_settle_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/track_settle_params.py new file mode 100644 index 0000000..56482ce --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/track_settle_params.py @@ -0,0 +1,10 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.params import TLMC_TrackSettleParams + +@runtime_checkable +class TrackSettleParams(Protocol): + + def get_track_settle_params(self, max_wait_in_milliseconds: int) -> TLMC_TrackSettleParams: ... + + def set_track_settle_params(self, params: TLMC_TrackSettleParams): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/trigger_params_for_dc_brushless.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/trigger_params_for_dc_brushless.py new file mode 100644 index 0000000..0825ebf --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/trigger_params_for_dc_brushless.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_TriggerParamsForDcBrushless + +@runtime_checkable +class TriggerParamsForDcBrushless(Protocol): + + def get_trigger_params_for_dc_brushless(self, max_wait_in_milliseconds: int) -> TLMC_TriggerParamsForDcBrushless: ... + + def set_trigger_params_for_dc_brushless(self, params: TLMC_TriggerParamsForDcBrushless) -> None:... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/trigger_params_for_stepper.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/trigger_params_for_stepper.py new file mode 100644 index 0000000..322829c --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/trigger_params_for_stepper.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_TriggerParamsForStepper + +@runtime_checkable +class TriggerParamsForStepper(Protocol): + + def get_trigger_params_for_stepper(self, max_wai_in_milliseconds: int) -> TLMC_TriggerParamsForStepper: ... + + def set_trigger_params_for_stepper(self, params: TLMC_TriggerParamsForStepper) -> None: ... diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/unit_converter.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/unit_converter.py new file mode 100644 index 0000000..eefaae7 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/unit_converter.py @@ -0,0 +1,12 @@ +from typing import Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_ScaleType, TLMC_Unit + +@runtime_checkable +class UnitConverter(Protocol): + + def convert_from_device_units_to_physical(self, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: ... + + def convert_from_physical_to_device(self, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: int) -> int: ... + + def get_preferred_physical_unit(self, scale_type: TLMC_ScaleType) -> TLMC_Unit: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/universal_status.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/universal_status.py new file mode 100644 index 0000000..db74f9a --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/universal_status.py @@ -0,0 +1,7 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_UniversalStatus + +@runtime_checkable +class UniversalStatus(Protocol): + + def get_universal_status(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatus: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/universal_status_bits.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/universal_status_bits.py new file mode 100644 index 0000000..d5bcb6e --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/universal_status_bits.py @@ -0,0 +1,7 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_UniversalStatusBit + +@runtime_checkable +class UniversalStatusBits(Protocol): + + def get_universal_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatusBit: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/velocity_params.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/velocity_params.py new file mode 100644 index 0000000..122aa93 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/velocity_params.py @@ -0,0 +1,9 @@ +from typing import Protocol, runtime_checkable +from thorlabs_xa.shared.params import TLMC_VelocityParams + +@runtime_checkable +class VelocityParams(Protocol): + + def get_velocity_params(self, max_wait_in_milliseconds: int) -> TLMC_VelocityParams: ... + + def set_velocity_params(self, params: TLMC_VelocityParams) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/interfaces/device_features/yes_flash_programming.py b/Python/XA/src/thorlabs_xa/interfaces/device_features/yes_flash_programming.py new file mode 100644 index 0000000..87656a7 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/interfaces/device_features/yes_flash_programming.py @@ -0,0 +1,6 @@ +from typing import Protocol, runtime_checkable + +@runtime_checkable +class YesFlashProgramming(Protocol): + + def send_yes_flash_programming(self): ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/native_sdks/__init__.py b/Python/XA/src/thorlabs_xa/native_sdks/__init__.py new file mode 100644 index 0000000..7463971 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/native_sdks/__init__.py @@ -0,0 +1 @@ +# Blank - just an indicator that this is a package folder \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/native_sdks/c_native_functions.py b/Python/XA/src/thorlabs_xa/native_sdks/c_native_functions.py new file mode 100644 index 0000000..3b11abd --- /dev/null +++ b/Python/XA/src/thorlabs_xa/native_sdks/c_native_functions.py @@ -0,0 +1,1076 @@ +import copy +from ctypes import c_bool, c_char_p, c_int16, c_int8, c_uint, c_uint32, byref, c_double, c_ulong, c_int64, c_int32, c_uint16, c_uint8, create_string_buffer +import ctypes +from importlib.resources import as_file, files +import os +from pathlib import Path +import platform +import json +import sys +from typing import List, Optional + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorNumber, TLMC_AuxIoPortMode, TLMC_AuxIoPortNumber, TLMC_BowIndex, TLMC_CalibrationState, TLMC_CurrentLoopScenario, TLMC_DigitalInput, TLMC_DigitalOutput, TLMC_EnableState, TLMC_EndOfMoveMessagesMode, TLMC_IoPortNumber, TLMC_IoPositionTriggerEnableState, TLMC_KcubeMmiLockState, TLMC_MoveDirection, TLMC_MoveMode, TLMC_OperatingMode, TLMC_PZ_PositionControlMode, TLMC_PZ_SetNanoTrakModeType, TLMC_PZ_StatusBit, TLMC_ParameterGroupId, TLMC_PositionLoopScenario, TLMC_RackBayNumber, TLMC_RackBayOccupiedState, TLMC_ResultCode, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StatusItemId, TLMC_StopMode, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_Wait +from thorlabs_xa.shared.c_params import C_TLMC_AdcInputs, C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ApiVersion, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_DeviceInfo, C_TLMC_FirmwareVersion, C_TLMC_GeneralMoveParams, C_TLMC_HardwareInfo, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_MaxOutputVoltageParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakStatus, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PZ_Status, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_RichResponse, C_TLMC_Setting, C_TLMC_StageAxisParams, C_TLMC_StatusItem, C_TLMC_StepperLoopParams, C_TLMC_StepperStatus, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_UniversalStatus, C_TLMC_VelocityParams +from thorlabs_xa.shared.params import TLMC_AdcInputs, TLMC_AnalogMonitorConfigurationParams, TLMC_ApiVersion, TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_CurrentLoopParams, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_GeneralMoveParams, TLMC_HardwareInfo, TLMC_HomeParams, TLMC_DcPidParams, TLMC_IoConfigurationParams, TLMC_IoTriggerParams, TLMC_JogParams, TLMC_JoystickParams, TLMC_KcubeIoTriggerParams, TLMC_KcubeMmiParams, TLMC_KcubePositionTriggerParams, TLMC_LcdDisplayParams, TLMC_LcdMoveParams, TLMC_LimitSwitchParams, TLMC_MotorOutputParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_MaxOutputVoltageParams, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakEEPROMParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakStatus, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_PZ_NanoTrakTrackThresholdParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_SlewRateParams, TLMC_PZ_Status, TLMC_PositionLoopParams, TLMC_PotentiometerParams, TLMC_PowerParams, TLMC_ProfileModeParams, TLMC_RichResponse, TLMC_Setting, TLMC_StageAxisParams, TLMC_StatusItem, TLMC_StepperLoopParams, TLMC_StepperStatus, TLMC_TrackSettleParams, TLMC_TriggerParamsForDcBrushless, TLMC_TriggerParamsForStepper, TLMC_UniversalStatus, TLMC_Value, TLMC_VelocityParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_OutputWaveformLoopTableSample + +from thorlabs_xa.shared.xa_error_factory import XAErrorFactory + +from thorlabs_xa.shared.map_native_to_python import MapNativeToPython +from thorlabs_xa.shared.map_python_to_native import MapPythonToNative + +class CNativeFunctions(NativeFunctions): + + NATIVELIBRARYFILENAME_WINDOWS = "tlmc_xa_native.dll" + NATIVELIBRARYFILENAME_LINUX = "libtlmc_xa_native.so" + + xa_lib: ctypes.CDLL | None = None + + def __init__(self) -> None: + lib_name = self.pick_lib_name() + + resource_pkg = "thorlabs_xa" + resource = files(resource_pkg).joinpath(lib_name) + + with as_file(resource) as lib_path: + self.load_with_search_path(lib_path) + + def pick_lib_name(self) -> str: + system = platform.system() + if system == "Windows": + return self.NATIVELIBRARYFILENAME_WINDOWS + elif system == "Linux": + return self.NATIVELIBRARYFILENAME_LINUX + raise OSError(f"Unsupported OS: {system}") + + def load_with_search_path(self, lib_path: Path) -> None: + + if sys.platform.startswith("win"): + dll_dir = str(lib_path.parent) + try: + os.add_dll_directory(dll_dir) + except (AttributeError, FileNotFoundError): + os.environ["PATH"] = dll_dir + os.pathsep + os.environ.get("PATH", "") + + try: + self.xa_lib = ctypes.CDLL(str(lib_path)) + except OSError as e: + raise OSError( + f"Failed to load native library at '{lib_path}': {e}\n" + f"OS: {platform.system()} Arch: {platform.machine()} " + f"Python: {platform.python_version()} " + ) from e + + + @staticmethod + def wrap_error_code(return_code: int): + + if (return_code != 0): + exception = XAErrorFactory.convert_return(TLMC_ResultCode(return_code)) + + if exception is not None: + raise exception + + def activate_calibration(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_ActivateCalibration(c_ulong(handle))) + + def add_user_message_to_log(self, user_message: str) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_AddUserMessageToLog(MapPythonToNative.string(user_message))) + + def close(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Close(c_ulong(handle))) + + def convert_from_device_units_to_physical(self, handle: int, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: + c_physical = c_double(0) + c_unit = c_int32(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_ConvertFromDeviceToPhysical(c_ulong(handle), c_uint16(scale_type), c_int64(device_value), byref(c_physical), byref(c_unit))) + return c_physical.value, TLMC_Unit(c_unit.value) + + def convert_from_physical_to_device(self, handle: int, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: float) -> int: + device_val = c_int64(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_ConvertFromPhysicalToDevice(c_ulong(handle), c_uint16(scale_type), c_uint16(unit), c_double(physical_value), byref(device_val))) + return device_val.value + + def create_simulation(self, description: dict[str, str]) -> None: + contents = json.dumps(description) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_CreateSimulation(MapPythonToNative.string(contents))) + + def deactivate_calibration(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_DeactivateCalibration(c_ulong(handle))) + + def disconnect(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Disconnect(c_ulong(handle))) + + def get_adc_inputs(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_AdcInputs: + c_params = C_TLMC_AdcInputs() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetAdcInputs(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + + return MapNativeToPython.adc_inputs(c_params) + + def get_analog_monitor_configuration_params(self, handle: int, monitor_number: TLMC_AnalogMonitorNumber, max_wait_in_milliseconds: int) -> TLMC_AnalogMonitorConfigurationParams: + c_params = C_TLMC_AnalogMonitorConfigurationParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetAnalogMonitorConfigurationParams(c_ulong(handle), c_uint16(monitor_number), byref(c_params), c_int64(max_wait_in_milliseconds))) + + return MapNativeToPython.analog_monitor_configuration_params(c_params) + + def get_api_version(self) -> TLMC_ApiVersion: + c_params = C_TLMC_ApiVersion() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetApiVersion(byref(c_params))) + + return MapNativeToPython.api_version(c_params) + + def get_aux_io_port_mode(self, handle: int, port_number: TLMC_AuxIoPortNumber, max_wait_in_milliseconds: int) -> TLMC_AuxIoPortMode: + c_port_mode = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetAuxIoPortMode(handle, c_uint16(port_number), byref(c_port_mode), c_int64(max_wait_in_milliseconds))) + + return TLMC_AuxIoPortMode(c_port_mode.value) + + def get_aux_io_software_states(self, handle: int, max_wait_in_milliseconds: int) -> int: + c_software_states = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetAuxIoSoftwareStates(c_ulong(handle), byref(c_software_states), c_int64(max_wait_in_milliseconds))) + return c_software_states.value + + def get_button_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_ButtonParams: + c_button_params = C_TLMC_ButtonParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetButtonParams(c_ulong(handle), byref(c_button_params), c_int64(max_wait_in_milliseconds))) + + return MapNativeToPython.button_params(c_button_params) + + def get_calibration_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_CalibrationState: + c_calibration_state = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetCalibrationState(c_ulong(handle), byref(c_calibration_state), c_int64(max_wait_in_milliseconds))) + + return TLMC_CalibrationState(c_calibration_state) + + def get_bow_index(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_BowIndex: + c_bow_index = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetBowIndex(handle, byref(c_bow_index), c_int64(max_wait_in_milliseconds))) + return TLMC_BowIndex(c_bow_index.value) + + def get_connected_product(self, handle: int, max_length: int) -> str: + c_buffer = ctypes.create_string_buffer(max_length) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetConnectedProduct(c_ulong(handle), byref(c_buffer), c_uint(max_length))) + + return MapNativeToPython.string(c_buffer) + + def get_connected_product_info(self, handle: int) -> TLMC_ConnectedProductInfo: + c_params = C_TLMC_ConnectedProductInfo() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetConnectedProductInfo(c_ulong(handle), byref(c_params))) + + return MapNativeToPython.connected_product_info(c_params) + + def get_connected_products_supported(self, handle: int, max_length: int) -> tuple [str, int]: + c_buffer = ctypes.create_string_buffer(max_length) + result_length = c_int32(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetConnectedProductsSupported( + c_ulong(handle), byref(c_buffer), c_uint(max_length), byref(result_length))) + + return MapNativeToPython.string(c_buffer), result_length.value + + def get_current_loop_params(self, handle: int, loop_scenario: TLMC_CurrentLoopScenario, max_wait_in_milliseconds: int) -> TLMC_CurrentLoopParams: + c_params = C_TLMC_CurrentLoopParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetCurrentLoopParams(c_ulong(handle), loop_scenario, + byref(c_params), c_int64(max_wait_in_milliseconds))) + + return MapNativeToPython.current_loop_params(c_params) + + def get_dc_pid_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_DcPidParams: + c_params = C_TLMC_DcPidParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetDcPidParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + + return MapNativeToPython.dc_pid_params(c_params) + + def get_device_info(self, handle: int) -> TLMC_DeviceInfo: + c_params = C_TLMC_DeviceInfo() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetDeviceInfo(c_ulong(handle), byref(c_params))) + + return MapNativeToPython.device_info(c_params) + + def get_device_list_item_count(self) -> int: + c_count = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetDeviceListItemCount(byref(c_count))) + return c_count.value + + def get_device_list_items(self, source_start_index: int, number_of_items: int) -> List[TLMC_DeviceInfo]: + ArrayType = C_TLMC_DeviceInfo * number_of_items + items_buf = ArrayType() + + items_copied = c_uint16(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetDeviceListItems(c_uint16(source_start_index), c_uint16(number_of_items), items_buf, byref(items_copied))) + + count = int(items_copied.value) + device_infos: list[TLMC_DeviceInfo] = [] + for i in range(count): + device_infos.append(MapNativeToPython.device_info(copy.copy(items_buf[i]))) + + return device_infos + + def get_digital_input_states(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_DigitalInput: + c_state = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetDigitalInputStates(c_ulong(handle), byref(c_state), c_int64(max_wait_in_milliseconds))) + return TLMC_DigitalInput(c_state.value) + + def get_digital_output_states(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: + c_state = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetDigitalOutputStates(c_ulong(handle), byref(c_state), c_int64(max_wait_in_milliseconds))) + return TLMC_DigitalOutput(c_state.value) + + def get_enable_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_EnableState: + c_enable_state = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetEnableState(c_ulong(handle), byref(c_enable_state), c_int64(max_wait_in_milliseconds))) + return TLMC_EnableState(c_enable_state.value) + + def get_encoder_counter(self, handle: int, max_wait_in_milliseconds: int) -> int: + c_encoder_counter = c_int32(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetEncoderCounter(c_ulong(handle), byref(c_encoder_counter), c_int64(max_wait_in_milliseconds))) + return c_encoder_counter.value + + def get_firmware_version_info(self, handle: int, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + c_device_firmware_version = C_TLMC_FirmwareVersion() + c_required_firmware_version = C_TLMC_FirmwareVersion() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetFirmwareVersionInfo(c_ulong(handle), byref(c_device_firmware_version), byref(c_required_firmware_version), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.firmware_version(c_device_firmware_version), MapNativeToPython.firmware_version(c_required_firmware_version) + + def get_general_move_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_GeneralMoveParams: + c_params = C_TLMC_GeneralMoveParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetGeneralMoveParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.general_move_params(c_params) + + def get_hardware_info(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + c_params = C_TLMC_HardwareInfo() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetHardwareInfo(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.hardware_info(c_params) + + def get_home_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_HomeParams: + c_params = C_TLMC_HomeParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetHomeParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.home_params(c_params) + + def get_io_configuration_number_of_ports_supported(self, handle: int) -> int: + c_ports = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetIoConfigurationNumberOfPortsSupported(handle, byref(c_ports))) + return c_ports.value + + def get_io_configuration_params(self, handle: int, port_number: TLMC_IoPortNumber, max_wait_in_milliseconds: int) -> TLMC_IoConfigurationParams: + c_params = C_TLMC_IoConfigurationParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetIoConfigurationParams(c_ulong(handle), c_uint16(port_number.value), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.io_configuration_params(c_params) + + def get_io_position_trigger_enable_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_IoPositionTriggerEnableState: + c_enable_state = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetIoPositionTriggerEnableState(c_ulong(handle), byref(c_enable_state), c_int64(max_wait_in_milliseconds))) + return TLMC_IoPositionTriggerEnableState(c_enable_state.value) + + def get_io_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_IoTriggerParams: + c_params = C_TLMC_IoTriggerParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetIoTriggerParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.io_trigger_params(c_params) + + def get_jog_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_JogParams: + c_params = C_TLMC_JogParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetJogParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.jog_params(c_params) + + def get_joystick_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_JoystickParams: + c_params = C_TLMC_JoystickParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetJoystickParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.joystick_params(c_params) + + def get_kcube_io_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubeIoTriggerParams: + c_params = C_TLMC_KcubeIoTriggerParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetKcubeIoTriggerParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.kcube_io_trigger_params(c_params) + + def get_kcube_mmi_lock_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiLockState: + c_lock_state = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetKcubeMmiLockState(c_ulong(handle), byref(c_lock_state), c_int64(max_wait_in_milliseconds))) + return TLMC_KcubeMmiLockState(c_lock_state.value) + + def get_kcube_mmi_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiParams: + c_params = C_TLMC_KcubeMmiParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetKcubeMmiParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.kcube_mmi_params(c_params) + + def get_kcube_position_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubePositionTriggerParams: + c_params = C_TLMC_KcubePositionTriggerParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetKcubePositionTriggerParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.kcube_position_trigger_params(c_params) + + def get_lcd_display_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_LcdDisplayParams: + c_params = C_TLMC_LcdDisplayParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetLcdDisplayParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.lcd_display_params(c_params) + + def get_lcd_move_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_LcdMoveParams: + c_params = C_TLMC_LcdMoveParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetLcdMoveParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.lcd_move_params(c_params) + + def get_limit_switch_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_LimitSwitchParams: + c_params = C_TLMC_LimitSwitchParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetLimitSwitchParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.limit_switch_params(c_params) + + def get_motor_output_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_MotorOutputParams: + c_params = C_TLMC_MotorOutputParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetMotorOutputParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.motor_output_params(c_params) + + def get_move_absolute_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_MoveAbsoluteParams: + c_params = C_TLMC_MoveAbsoluteParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetMoveAbsoluteParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.move_absolute_params(c_params) + + def get_move_relative_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_MoveRelativeParams: + c_params = C_TLMC_MoveRelativeParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetMoveRelativeParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.move_relative_params(c_params) + + def get_position_counter(self, handle: int, max_wait_in_milliseconds: int) -> int: + c_position_counter = c_int32(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetPositionCounter(c_ulong(handle), byref(c_position_counter), c_int64(max_wait_in_milliseconds))) + return c_position_counter.value + + def get_position_loop_params(self, handle: int, position_loop_scenario: TLMC_PositionLoopScenario, max_wait_in_milliseconds: int) -> TLMC_PositionLoopParams: + c_params = C_TLMC_PositionLoopParams() + max_wait_val = c_int64(max_wait_in_milliseconds) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetPositionLoopParams(c_ulong(handle), c_uint16(int(position_loop_scenario)), byref(c_params), max_wait_val)) + return MapNativeToPython.position_loop_params(c_params) + + def get_potentiometer_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PotentiometerParams: + c_params = C_TLMC_PotentiometerParams() + max_wait_val = c_int64(max_wait_in_milliseconds) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetPotentiometerParams(c_ulong(handle), byref(c_params), max_wait_val)) + return MapNativeToPython.potentiometer_params(c_params) + + def get_power_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PowerParams: + c_params = C_TLMC_PowerParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetPowerParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.power_params(c_params) + + def get_preferred_physical_unit(self, handle: int, scale_type: TLMC_ScaleType) -> TLMC_Unit: + c_unit = c_int32(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetPreferredPhysicalUnit(c_ulong(handle), c_uint16(scale_type.value), byref(c_unit))) + return TLMC_Unit(c_unit.value) + + def get_profile_mode_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_ProfileModeParams: + c_params = C_TLMC_ProfileModeParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetProfileModeParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.profile_mode_params(c_params) + + def get_rack_bay_occupied_state(self, handle: int, bay_number: TLMC_RackBayNumber, max_wait_in_milliseconds: int) -> TLMC_RackBayOccupiedState: + c_state = c_uint8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetRackBayOccupiedState(c_ulong(handle), c_uint16(bay_number.value), byref(c_state), c_int64(max_wait_in_milliseconds))) + return TLMC_RackBayOccupiedState(c_state.value) + + def get_rich_response(self, handle: int) -> TLMC_RichResponse: + c_params = C_TLMC_RichResponse() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetRichResponse(c_ulong(handle), byref(c_params))) + return MapNativeToPython.rich_response(c_params) + + def get_setting(self, handle: int, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + c_params = C_TLMC_Setting() + c_settings_name = create_string_buffer(settings_name.encode("utf-8")) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSetting(c_ulong(handle), c_settings_name, byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.setting(c_params) + + def get_setting_count(self, handle: int) -> int: + c_count = c_uint16() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSettingCount(c_ulong(handle), byref(c_count))) + return c_count.value + + def get_settings(self, handle: int, source_start_index: int, number_of_items: int) -> List[TLMC_Setting]: + + if number_of_items <= 0: + return [] + + ArrayType = C_TLMC_Setting * number_of_items + settings_buf = ArrayType() + items_copied = c_uint16(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSettings( + c_ulong(handle), + c_uint16(source_start_index), + c_uint16(number_of_items), + settings_buf, + byref(items_copied) + )) + + count = min(items_copied.value, number_of_items) + + settings: List[TLMC_Setting] = [] + + for i in range(count): + settings.append(MapNativeToPython.setting(copy.copy(settings_buf[i]))) + + return settings + + def get_setting_discrete_values(self, handle: int, setting_name: str) -> str: + + name_bytes = setting_name.encode("utf-8") + name_c = c_char_p(name_bytes) + + needed = c_uint(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSettingDiscreteValues( + c_ulong(handle), + name_c, + None, + c_uint(0), + byref(needed) + )) + + size = int(needed.value) + if size == 0: + return "" + + buf = create_string_buffer(size + 1) + + wrote = c_uint(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSettingDiscreteValues( + c_ulong(handle), + name_c, + buf, + c_uint(size), + byref(wrote) + )) + + n = int(wrote.value) if wrote.value != 0 else size + + if n > 0 and buf.raw[n - 1:n] == b"\x00": + n_for_decode = n - 1 + else: + n_for_decode = n + + raw = buf.raw[:min(n_for_decode, size)] + + try: + text = raw.decode("utf-8") + except UnicodeDecodeError: + text = raw.decode("utf-8", errors="replace") + + return text + + def get_settings_as_string(self, handle: int, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + + needed = c_uint(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSettingsAsString( + c_ulong(handle), + None, + c_uint(0), + byref(needed), + c_uint8(setting_string_format), + c_bool(include_read_only_items) + )) + + size = int(needed.value) + if size <= 0: + return "" + + buffer_length = size + 1 + buf = create_string_buffer(buffer_length) + + written = c_uint(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetSettingsAsString( + c_ulong(handle), + byref(buf), + c_uint(buffer_length), + byref(written), + c_uint8(setting_string_format), + c_bool(include_read_only_items) + )) + + n = int(written.value) if written.value != 0 else size + raw = buf.raw[:min(n, size)] + + try: + text = raw.decode("utf-8") + except UnicodeDecodeError: + text = raw.decode("utf-8", errors="replace") + + return text + + def get_status_item(self, handle: int, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: + c_status_item = C_TLMC_StatusItem() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetStatusItem(c_ulong(handle), status_item_id, byref(c_status_item))) + return MapNativeToPython.status_item(c_status_item) + + def get_status_item_count(self, handle: int) -> int: + c_count = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetStatusItemCount(c_ulong(handle), byref(c_count))) + return c_count.value + + def get_status_items(self, handle: int, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: + + if number_of_items <= 0: + return [] + + ArrayType = C_TLMC_StatusItem * number_of_items + items_buf = ArrayType() + items_copied = c_uint16(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetStatusItems( + c_ulong(handle), + c_uint16(start_index), + c_uint16(number_of_items), + items_buf, + byref(items_copied) + )) + + count = min(items_copied.value, number_of_items) + status_items: List[TLMC_StatusItem] = [MapNativeToPython.status_item(copy.copy(items_buf[i])) for i in range(count)] + + return status_items + + def get_stage_axis_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_StageAxisParams: + c_params = C_TLMC_StageAxisParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetStageAxisParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.stage_axis_params(c_params) + + def get_stepper_loop_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_StepperLoopParams: + c_params = C_TLMC_StepperLoopParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetStepperLoopParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.stepper_loop_params(c_params) + + def get_stepper_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_StepperStatus: + c_params = C_TLMC_StepperStatus() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetStepperStatus(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.stepper_status(c_params) + + def get_track_settle_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_TrackSettleParams: + c_params = C_TLMC_TrackSettleParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetTrackSettleParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.track_settle_params(c_params) + + def get_trigger_params_for_dc_brushless(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_TriggerParamsForDcBrushless: + c_params = C_TLMC_TriggerParamsForDcBrushless() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetTriggerParamsForDcBrushless(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.trigger_params_for_dc_brushless(c_params) + + def get_trigger_params_for_stepper(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_TriggerParamsForStepper: + c_params = C_TLMC_TriggerParamsForStepper() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetTriggerParamsForStepper(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.trigger_params_for_stepper(c_params) + + def get_universal_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_UniversalStatus: + c_params = C_TLMC_UniversalStatus() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetUniversalStatus(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.universal_status(c_params) + + def get_universal_status_bits(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_UniversalStatusBit: + c_universal_status_bits = c_uint32(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetUniversalStatusBits( + c_ulong(handle), byref(c_universal_status_bits), c_int64(max_wait_in_milliseconds))) + return TLMC_UniversalStatusBit(c_universal_status_bits.value) + + def get_velocity_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_VelocityParams: + c_params = C_TLMC_VelocityParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetVelocityParams(c_ulong(handle), byref( + c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.velocity_params(c_params) + + def home(self, handle: int, max_wait_in_milliseconds: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Home(c_ulong(handle), c_int64(max_wait_in_milliseconds))) + + def identify(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Identify(c_ulong(handle))) + + def load_params(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_LoadParams(c_ulong(handle))) + + def move(self, handle: int, mode: TLMC_MoveMode, param: int, max_wait_in_milliseconds: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Move( + c_ulong(handle), c_uint8(mode), c_int32(param), c_int64(max_wait_in_milliseconds))) + + def move_absolute(self, handle: int, move_mode: TLMC_MoveMode, position: int, max_wait_in_milliseconds: int) -> None: + position_val = position + + if move_mode == TLMC_MoveMode.TLMC_MoveMode_AbsoluteToProgrammedPosition: + position_val = TLMC_Wait.TLMC_Unused + else: + move_mode = TLMC_MoveMode.TLMC_MoveMode_Absolute + + self.move(handle, move_mode, position_val, max_wait_in_milliseconds) + + def move_continuous(self, handle: int, direction: TLMC_MoveDirection, max_wait_in_milliseconds: int) -> None: + if direction == TLMC_MoveDirection.Move_Direction_Reverse: + move_mode = TLMC_MoveMode.TLMC_MoveMode_ContinuousReverse + else: + move_mode = TLMC_MoveMode.TLMC_MoveMode_ContinuousForward + + self.move(handle, move_mode, TLMC_Wait.TLMC_Unused, max_wait_in_milliseconds) + + def move_jog(self, handle: int, direction: TLMC_MoveDirection, max_wait_in_milliseconds: int) -> None: + + if direction == TLMC_MoveDirection.Move_Direction_Reverse: + move_mode = TLMC_MoveMode.TLMC_MoveMode_JogReverse + else: + move_mode = TLMC_MoveMode.TLMC_MoveMode_JogForward + + self.move(handle, move_mode, TLMC_Wait.TLMC_Unused, max_wait_in_milliseconds) + + def move_relative(self, handle: int, move_mode: TLMC_MoveMode, step_size: int, max_wait_in_milliseconds: int) -> None: + step_size_val = step_size + if move_mode == TLMC_MoveMode.TLMC_MoveMode_RelativeByProgrammedDistance: + step_size_val = TLMC_Wait.TLMC_Unused + else: + move_mode = TLMC_MoveMode.TLMC_MoveMode_Relative + + self.move(handle, move_mode, step_size_val, max_wait_in_milliseconds) + + def open(self, device: str, transport_type: str, operating_mode: TLMC_OperatingMode) -> int: + + device_handle_val = c_ulong(0) + + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Open( + MapPythonToNative.string(device), + MapPythonToNative.string(transport_type), + c_uint32(operating_mode.value), + byref(device_handle_val))) + + return device_handle_val.value + + def persist_params(self, handle: int, parameter_group_id: TLMC_ParameterGroupId) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PersistParams(c_ulong(handle), parameter_group_id)) + + def pz_nanotrak_move_to_circle_home_position(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_NanoTrakMoveToCircleHomePosition(c_ulong(handle))) + + def pz_get_kpc_io_settings_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoSettingsParams: + c_params = C_TLMC_PZ_KpcIoSettingsParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetKpcIoSettingsParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_kpc_io_settings_params(c_params) + + def pz_get_kpc_io_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoTriggerParams: + c_params = C_TLMC_PZ_KpcIoTriggerParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetKpcIoTriggerParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_kpc_io_trigger_params(c_params) + + def pz_get_kpc_mmi_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcMmiParams: + c_params = C_TLMC_PZ_KpcMmiParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetKpcMmiParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_kpc_mmi_params(c_params) + + def pz_get_max_output_voltage_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_MaxOutputVoltageParams: + c_params = C_TLMC_PZ_MaxOutputVoltageParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetMaxOutputVoltageParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_max_output_voltage_params(c_params) + + def pz_get_max_travel(self, handle: int, max_wait_in_milliseconds: int) -> int: + c_max_travel = c_uint16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetMaxTravel(c_ulong(handle), byref(c_max_travel), c_int64(max_wait_in_milliseconds))) + return c_max_travel.value + + def pz_get_nano_trak_circle_diameter_lookup_table_data(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleDiameterLookupTableData: + c_params = C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakCircleDiameterLookupTableData(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_circle_diameter_lookup_table_data(c_params) + + def pz_get_nano_trak_circle_home_position(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleHomePositionParams: + c_params = C_TLMC_PZ_NanoTrakCircleHomePositionParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakCircleHomePosition(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_circle_home_position_params(c_params) + + def pz_get_nano_trak_circle_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleParams: + c_params = C_TLMC_PZ_NanoTrakCircleParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakCircleParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_circle_params(c_params) + + def pz_get_nano_trak_gain_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakGainParams: + c_params = C_TLMC_PZ_NanoTrakGainParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakGainParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_gain_params(c_params) + + def pz_get_nano_trak_mode(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakMode: + c_params = C_TLMC_PZ_NanoTrakMode() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakMode(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_mode(c_params) + + def pz_get_nano_trak_phase_compensation_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakPhaseCompensationParams: + c_params = C_TLMC_PZ_NanoTrakPhaseCompensationParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakPhaseCompensationParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_phase_compensation_params(c_params) + + def pz_get_nano_trak_range_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakRangeParams: + c_params = C_TLMC_PZ_NanoTrakRangeParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakRangeParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_range_params(c_params) + + def pz_get_nano_trak_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakStatus: + c_params = C_TLMC_PZ_NanoTrakStatus() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakStatus(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_status(c_params) + + def pz_get_nano_trak_tna_io_settings(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTnaIoSettings: + c_params = C_TLMC_PZ_NanoTrakTnaIoSettings() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_GetNanoTrakTnaIoSettings(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_tna_io_settings(c_params) + + def pz_get_nano_trak_track_threshold(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTrackThresholdParams: + c_params = C_TLMC_PZ_NanoTrakTrackThresholdParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetNanoTrakTrackThreshold(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_nano_trak_track_threshold(c_params) + + def pz_get_output_voltage(self, handle: int, max_wait_in_milliseconds: int) -> int: + c_voltage = c_int16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetOutputVoltage(handle, byref(c_voltage), c_int64(max_wait_in_milliseconds))) + return c_voltage.value + + def pz_get_output_voltage_control_source_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputVoltageControlSourceParams: + c_params = C_TLMC_PZ_OutputVoltageControlSourceParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetOutputVoltageControlSourceParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_output_voltage_control_source_params(c_params) + + def pz_get_output_waveform_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputWaveformParams: + c_params = C_TLMC_PZ_OutputWaveformParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetOutputWaveformParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_output_waveform_params(c_params) + + def pz_get_position(self, handle: int, max_wait_in_milliseconds: int) -> int: + c_position = c_int16(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetPosition(c_ulong(handle), byref(c_position), c_int64(max_wait_in_milliseconds))) + return c_position.value + + def pz_get_position_control_mode(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionControlMode: + c_control_mode = c_int8(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetPositionControlMode(c_ulong(handle), byref(c_control_mode), c_int64(max_wait_in_milliseconds))) + return TLMC_PZ_PositionControlMode(c_control_mode.value) + + def pz_get_position_loop_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionLoopParams: + c_params = C_TLMC_PZ_PositionLoopParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetPositionLoopParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_position_loop_params(c_params) + + def pz_get_slew_rate_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_SlewRateParams: + c_params = C_TLMC_PZ_SlewRateParams() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetSlewRateParams(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_slew_rate_params(c_params) + + def pz_get_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_Status: + c_params = C_TLMC_PZ_Status() + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetStatus(c_ulong(handle), byref(c_params), c_int64(max_wait_in_milliseconds))) + return MapNativeToPython.pz_status(c_params) + + def pz_get_status_bits(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_StatusBit: + c_status_bits = c_uint32(0) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_GetStatusBits(c_ulong(handle), byref(c_status_bits), c_int64(max_wait_in_milliseconds))) + return TLMC_PZ_StatusBit(c_status_bits.value) + + def pz_set_kpc_io_settings_params(self, handle: int, params: TLMC_PZ_KpcIoSettingsParams) -> None: + c_params = MapPythonToNative.pz_kpc_io_settings_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetKpcIoSettingsParams(c_ulong(handle), byref(c_params))) + + def pz_set_kpc_io_trigger_params(self, handle: int, params: TLMC_PZ_KpcIoTriggerParams) -> None: + c_params = MapPythonToNative.pz_kpc_io_trigger_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetKpcIoTriggerParams(c_ulong(handle), byref(c_params))) + + def pz_set_kpc_mmi_params(self, handle: int, params: TLMC_PZ_KpcMmiParams) -> None: + c_params = MapPythonToNative.pz_kpc_mmi_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetKpcMmiParams(c_ulong(handle), byref(c_params))) + + def pz_set_max_output_voltage(self, handle: int, max_output_voltage: int) -> None: + c_voltage = c_uint16(max_output_voltage) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetMaxOutputVoltage(c_ulong(handle), c_voltage)) + + def pz_set_max_travel(self, handle: int, max_travel: int) -> None: + c_max_travel = c_uint16(max_travel) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetMaxTravel(c_ulong(handle), c_max_travel)) + + def pz_set_nano_trak_circle_diameter_lookup_table_data(self, handle: int, params: TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> None: + c_params = MapPythonToNative.pz_nano_trak_circle_diameter_lookup_table_data(params) + return CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakCircleDiameterLookupTableData(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_circle_home_position(self, handle: int, params: TLMC_PZ_NanoTrakCircleHomePositionParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_circle_home_position_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakCircleHomePosition(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_circle_params(self, handle: int, params: TLMC_PZ_NanoTrakCircleParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_circle_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakCircleParams(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_eeprom_params(self, handle: int, params: TLMC_PZ_NanoTrakEEPROMParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_eeprom_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakEEPROMParams(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_gain_params(self, handle: int, params: TLMC_PZ_NanoTrakGainParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_gain_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakGainParams(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_mode(self, handle: int, set_mode: TLMC_PZ_SetNanoTrakModeType) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakMode(c_ulong(handle), c_uint8(int(set_mode)))) + + def pz_set_nano_trak_phase_compensation_params(self, handle: int, params: TLMC_PZ_NanoTrakPhaseCompensationParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_phase_compensation_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakPhaseCompensationParams(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_range_params(self, handle: int, params: TLMC_PZ_NanoTrakRangeParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_range_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakRangeParams(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_tna_io_settings(self, handle: int, params: TLMC_PZ_NanoTrakTnaIoSettings) -> None: + c_params = MapPythonToNative.pz_nano_trak_tna_io_settings(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakTnaIoSettings(c_ulong(handle), byref(c_params))) + + def pz_set_nano_trak_track_threshold(self, handle: int, params: TLMC_PZ_NanoTrakTrackThresholdParams) -> None: + c_params = MapPythonToNative.pz_nano_trak_track_threshold(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetNanoTrakTrackThreshold(c_ulong(handle), byref(c_params))) + + def pz_set_output_voltage(self, handle: int, new_output_voltage: int) -> None: + c_voltage = c_int16(new_output_voltage) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetOutputVoltage(c_ulong(handle), c_voltage)) + + def pz_set_output_voltage_control_source_params(self, handle: int, params: TLMC_PZ_OutputVoltageControlSourceParams) -> None: + c_params = MapPythonToNative.pz_output_voltage_control_source_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetOutputVoltageControlSourceParams(c_ulong(handle), byref(c_params))) + + def pz_set_output_waveform_loop_table_sample(self, handle: int, params: TLMC_PZ_OutputWaveformLoopTableSample) -> None: + c_params = MapPythonToNative.pz_output_waveform_lookup_table_sample(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetOutputWaveformLookupTableSample(c_ulong(handle), byref(c_params))) + + def pz_set_output_waveform_params(self, handle: int, params: TLMC_PZ_OutputWaveformParams) -> None: + c_params = MapPythonToNative.pz_output_waveform_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetOutputWaveformParams(c_ulong(handle), byref(c_params))) + + def pz_set_position(self, handle: int, new_position: int) -> None: + c_position = c_int16(new_position) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetPosition(c_ulong(handle), c_position)) + + def pz_set_position_control_mode(self, handle: int, control_mode: TLMC_PZ_PositionControlMode) -> None: + c_control_mode = c_uint16(control_mode) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetPositionControlMode(c_ulong(handle), c_control_mode)) + + def pz_set_position_loop_params(self, handle: int, params: TLMC_PZ_PositionLoopParams) -> None: + c_params = MapPythonToNative.pz_position_loop_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetPositionLoopParams(c_ulong(handle), byref(c_params))) + + def pz_set_slew_rate_params(self, handle: int, params: TLMC_PZ_SlewRateParams) -> None: + c_params = MapPythonToNative.pz_slew_rate_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetSlewRateParams(c_ulong(handle), byref(c_params))) + + def pz_set_zero(self, handle: int, max_wait_in_milliseconds: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_SetZero(c_ulong(handle), c_int64(max_wait_in_milliseconds))) + + def pz_start_output_waveform(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_StartOutputWaveform(c_ulong(handle))) + + def pz_stop_output_waveform(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_PZ_StopOutputWaveform(c_ulong(handle))) + + def rack_identify(self, handle: int, channel: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_RackIdentify(c_ulong(handle), c_uint8(channel))) + + def remove_simulation(self, description: str) -> None: + c_check = MapPythonToNative.string(json.dumps(description)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_RemoveSimulation(c_check)) + + def request_status(self, handle: int, max_wait_in_milliseconds: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lab.TLMC_RequestStatus(c_ulong(handle), c_int64(max_wait_in_milliseconds))) + + def restore_factory_defaults(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_RestoreFactoryDefaults(c_ulong(handle))) + + def send_no_flash_programming(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SendNoFlashProgramming(c_ulong(handle))) + + def send_yes_flash_programming(self, handle: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SendYesFlashProgramming(c_ulong(handle))) + + def set_actuator_type(self, handle: int, actuator_type: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetActuatorType(c_ulong(handle))) + + def set_analog_monitor_configuration_params(self, handle: int, monitor_number: TLMC_AnalogMonitorNumber, params: TLMC_AnalogMonitorConfigurationParams) -> None: + c_params = MapPythonToNative.analog_monitor_configuration_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetAnalogMonitorConfigurationParams( + c_ulong(handle), c_uint16(int(monitor_number)), byref(c_params))) + + def set_aux_io_port_mode(self, handle: int, port_number: TLMC_AuxIoPortNumber, port_mode: TLMC_AuxIoPortMode) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.SetAuxIoPortMode(c_ulong(handle), c_uint16(int(port_number)), c_uint16(int(port_mode)))) + + def set_aux_io_software_states(self, handle: int, software_states: int) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetAuxIoSoftwareStates(c_ulong(handle), c_uint16(software_states))) + + def set_bow_index(self, handle: int, bow_index: TLMC_BowIndex) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetBowIndex(c_ulong(handle), c_uint16(int(bow_index)))) + + def set_button_params(self, handle: int, params: TLMC_ButtonParams) -> None: + c_params = MapPythonToNative.button_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetButtonParams(c_ulong(handle), byref(c_params))) + + def set_connected_product(self, handle: int, product_name: str) -> None: + c_product_name = MapPythonToNative.string(product_name) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetConnectedProduct(c_ulong(handle), c_product_name)) + + def set_connected_product_info(self, handle: int, params: TLMC_ConnectedProductInfo) -> None: + c_params = MapPythonToNative.connected_product_info(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetConnectedProductInfo(c_ulong(handle), byref(c_params))) + + def set_current_loop_params(self, handle: int, scenario: TLMC_CurrentLoopScenario, params: TLMC_CurrentLoopParams) -> None: + c_params = MapPythonToNative.current_loop_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetCurrentLoopParams( + c_ulong(handle), c_uint16(int(scenario)), byref(c_params))) + + def set_dc_pid_params(self, handle: int, params: TLMC_DcPidParams) -> None: + c_params = MapPythonToNative.dc_pid_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetDcPidParams(c_ulong(handle), byref(c_params))) + + def set_digital_output_states(self, handle: int, output_state: TLMC_DigitalOutput) -> None: + c_output_state = c_uint8(int(output_state)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetDigitalOutputStates(c_ulong(handle), c_output_state)) + + def set_enable_state(self, handle: int, enable_state: TLMC_EnableState) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetEnableState(c_ulong(handle), enable_state, c_int64(TLMC_Wait.TLMC_InfiniteWait))) + + def set_encoder_counter(self, handle: int, encoder_counter: int) -> None: + c_encoder_counter = c_int32(encoder_counter) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetEncoderCounter(c_ulong(handle), c_encoder_counter)) + + def set_end_of_move_messages_mode(self, handle: int, messages_mode: TLMC_EndOfMoveMessagesMode) -> None: + c_messages_mode = c_uint8(int(messages_mode)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetEndOfMoveMessagesMode(c_ulong(handle), c_messages_mode)) + + def set_general_move_params(self, handle: int, params: TLMC_GeneralMoveParams) -> None: + c_params = MapPythonToNative.general_move_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetGeneralMoveParams(c_ulong(handle), byref(c_params))) + + def set_home_params(self, handle: int, params: TLMC_HomeParams) -> None: + c_params = MapPythonToNative.home_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetHomeParams(handle, byref(c_params))) + + def set_io_configuration_params(self, handle: int, port_number: TLMC_IoPortNumber, params: TLMC_IoConfigurationParams) -> None: + c_port_number = c_uint16(int(port_number)) + c_params = MapPythonToNative.io_configuration_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetIoConfigurationParams(c_ulong(handle), c_port_number, byref(c_params))) + + def set_io_position_trigger_enable_state(self, handle: int, enable_state: TLMC_IoPositionTriggerEnableState, max_wait_in_milliseconds: int) -> None: + c_enable_state = c_uint8(int(enable_state)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetIoPositionTriggerEnableState(c_ulong(handle), c_enable_state, c_int64(max_wait_in_milliseconds))) + + def set_io_trigger_params(self, handle: int, params: TLMC_IoTriggerParams) -> None: + c_params = MapPythonToNative.io_trigger_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetIoTriggerParams(c_ulong(handle), byref(c_params))) + + def set_joystick_params(self, handle: int, params: TLMC_JoystickParams) -> None: + c_params = MapPythonToNative.joystick_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetJoystickParams(c_ulong(handle), byref(c_params))) + + def set_kcube_io_trigger_params(self, handle: int, params: TLMC_KcubeIoTriggerParams) -> None: + c_params = MapPythonToNative.kcube_io_trigger_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetKcubeIoTriggerParams(c_ulong(handle), byref(c_params))) + + def set_kcube_mmi_lock_state(self, handle: int, lock_state: TLMC_KcubeMmiLockState) -> None: + c_lock_state = c_uint8(int(lock_state)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetKcubeMmiLockState(c_ulong(handle), c_lock_state)) + + def set_kcube_mmi_params(self, handle: int, params: TLMC_KcubeMmiParams) -> None: + c_params = MapPythonToNative.kcube_mmi_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetKcubeMmiParams(c_ulong(handle), byref(c_params))) + + def set_kcube_position_trigger_params(self, handle: int, params: TLMC_KcubePositionTriggerParams) -> None: + c_params = MapPythonToNative.kcube_position_trigger_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetKcubePositionTriggerParams(c_ulong(handle), byref(c_params))) + + def set_lcd_display_params(self, handle: int, params: TLMC_LcdDisplayParams) -> None: + c_params = MapPythonToNative.lcd_display_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetLcdDisplayParams(c_ulong(handle), byref(c_params))) + + def set_lcd_move_params(self, handle: int, params: TLMC_LcdMoveParams) -> None: + c_params = MapPythonToNative.lcd_move_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetLcdMoveParams(c_ulong(handle), byref(c_params))) + + def set_limit_switch_params(self, handle: int, params: TLMC_LimitSwitchParams) -> None: + c_params = MapPythonToNative.limit_switch_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetLimitSwitchParams(c_ulong(handle), byref(c_params))) + + def set_motor_output_params(self, handle: int, params: TLMC_MotorOutputParams) -> None: + c_params = MapPythonToNative.motor_output_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetMotorOutputParams(c_ulong(handle), byref(c_params))) + + def set_move_absolute_params(self, handle: int, params: TLMC_MoveAbsoluteParams) -> None: + c_params = MapPythonToNative.move_absolute_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetMoveAbsoluteParams(c_ulong(handle), byref(c_params))) + + def set_jog_params(self, handle: int, params: TLMC_JogParams) -> None: + c_params = MapPythonToNative.jog_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetJogParams(c_ulong(handle), byref(c_params))) + + def set_move_relative_params(self, handle: int, params: TLMC_MoveRelativeParams) -> None: + c_params = MapPythonToNative.move_relative_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetMoveRelativeParams(c_ulong(handle), byref(c_params))) + + def set_position_counter(self, handle: int, position_counter: int) -> None: + c_position_counter = c_int32(position_counter) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetPositionCounter(c_ulong(handle), c_position_counter)) + + def set_position_loop_params(self, handle: int, scenario: TLMC_PositionLoopScenario, params: TLMC_PositionLoopParams) -> None: + c_scenario = c_uint16(int(scenario)) + c_params = MapPythonToNative.position_loop_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetPositionLoopParams(c_ulong(handle), c_scenario, byref(c_params))) + + def set_potentiometer_params(self, handle: int, params: TLMC_PotentiometerParams) -> None: + c_params = MapPythonToNative.potentiometer_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetPotentiometerParams(c_ulong(handle), byref(c_params))) + + def set_power_params(self, handle: int, params: TLMC_PowerParams) -> None: + c_params = MapPythonToNative.power_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetPowerParams(c_ulong(handle), byref(c_params))) + + def set_profile_mode_params(self, handle: int, params: TLMC_ProfileModeParams) -> None: + c_params = MapPythonToNative.profile_mode_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetProfileModeParams(c_ulong(handle), byref(c_params))) + + def set_setting(self, handle: int, setting_name: str, value: TLMC_Value) -> None: + c_setting_name = MapPythonToNative.string(setting_name) + c_value = MapPythonToNative.value(value) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetSetting(c_ulong(handle), c_setting_name, c_value)) + + def set_settings_from_string(self, handle: int, settings: str) -> None: + c_settings = MapPythonToNative.string(settings) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetSettingsFromString(c_ulong(handle), c_settings)) + + def set_stage_axis_params(self, handle: int, params: TLMC_StageAxisParams) -> None: + c_params = MapPythonToNative.stage_axis_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetStageAxisParams(c_ulong(handle), byref(c_params))) + + def set_status_mode(self, handle: int, operating_mode: TLMC_OperatingMode) -> None: + c_operating_mode = c_uint32(int(operating_mode)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetStatusMode(c_ulong(handle), c_operating_mode)) + + def set_stepper_loop_params(self, handle: int, params: TLMC_StepperLoopParams) -> None: + c_params = MapPythonToNative.stepper_loop_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetStepperLoopParams(c_ulong(handle), byref(c_params))) + + def set_track_settle_params(self, handle: int, params: TLMC_TrackSettleParams) -> None: + c_params = MapPythonToNative.track_settle_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetTrackSettleParams(c_ulong(handle), byref(c_params))) + + def set_trigger_params_for_dc_brushless(self, handle: int, params: TLMC_TriggerParamsForDcBrushless) -> None: + c_params = MapPythonToNative.trigger_params_for_dc_brushless(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetTriggerParamsForDcBrushless(c_ulong(handle), byref(c_params))) + + def set_trigger_params_for_stepper(self, handle: int, params: TLMC_TriggerParamsForStepper) -> None: + c_params = MapPythonToNative.trigger_params_for_stepper(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetTriggerParamsForStepper(c_ulong(handle), byref(c_params))) + + def set_velocity_params(self, handle: int, params: TLMC_VelocityParams) -> None: + c_params = MapPythonToNative.velocity_params(params) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_SetVelocityParams(c_ulong(handle), byref(c_params))) + + def shutdown(self) -> None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Shutdown()) + + def startup(self, settings_file_name: Optional[str]) -> None: + if settings_file_name is None: + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Startup(None)) + return + + c_settings_file_name = MapPythonToNative.string(settings_file_name) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Startup(c_settings_file_name)) + + def stop(self, handle: int, stop_mode: TLMC_StopMode, max_wait_in_milliseconds: int) -> None: + c_stop_mode = c_uint8(int(stop_mode)) + CNativeFunctions.wrap_error_code(self.xa_lib.TLMC_Stop(handle, c_stop_mode, c_int64(max_wait_in_milliseconds))) diff --git a/Python/XA/src/thorlabs_xa/native_sdks/native_functions.py b/Python/XA/src/thorlabs_xa/native_sdks/native_functions.py new file mode 100644 index 0000000..f63ceb8 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/native_sdks/native_functions.py @@ -0,0 +1,383 @@ +from typing import List, Optional, Protocol, runtime_checkable + +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorNumber, TLMC_AuxIoPortMode, TLMC_AuxIoPortNumber, TLMC_BowIndex, TLMC_CalibrationState, TLMC_CurrentLoopScenario, TLMC_DigitalInput, TLMC_DigitalOutput, TLMC_EnableState, TLMC_EndOfMoveMessagesMode, TLMC_IoPortNumber, TLMC_IoPositionTriggerEnableState, TLMC_KcubeMmiLockState, TLMC_MoveDirection, TLMC_MoveMode, TLMC_OperatingMode, TLMC_PZ_PositionControlMode, TLMC_PZ_SetNanoTrakModeType, TLMC_PZ_StatusBit, TLMC_ParameterGroupId, TLMC_PositionLoopScenario, TLMC_RackBayNumber, TLMC_RackBayOccupiedState, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StatusItemId, TLMC_StopMode, TLMC_Unit, TLMC_UniversalStatusBit +from thorlabs_xa.shared.params import TLMC_AdcInputs, TLMC_AnalogMonitorConfigurationParams, TLMC_ApiVersion, TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_CurrentLoopParams, TLMC_DcPidParams, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_GeneralMoveParams, TLMC_HardwareInfo, TLMC_HomeParams, TLMC_IoConfigurationParams, TLMC_IoTriggerParams, TLMC_JogParams, TLMC_JoystickParams, TLMC_KcubeIoTriggerParams, TLMC_KcubeMmiParams, TLMC_KcubePositionTriggerParams, TLMC_LcdDisplayParams, TLMC_LcdMoveParams, TLMC_LimitSwitchParams, TLMC_MotorOutputParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_MaxOutputVoltageParams, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_NanoTrakEEPROMParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakStatus, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_PZ_NanoTrakTrackThresholdParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformLoopTableSample, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_SlewRateParams, TLMC_PZ_Status, TLMC_PositionLoopParams, TLMC_PotentiometerParams, TLMC_PowerParams, TLMC_ProfileModeParams, TLMC_RichResponse, TLMC_Setting, TLMC_StageAxisParams, TLMC_StatusItem, TLMC_StepperLoopParams, TLMC_StepperStatus, TLMC_TrackSettleParams, TLMC_TriggerParamsForDcBrushless, TLMC_TriggerParamsForStepper, TLMC_UniversalStatus, TLMC_Value, TLMC_VelocityParams + +@runtime_checkable +class NativeFunctions(Protocol): + + def activate_calibration(self, handle: int): ... + + def add_user_message_to_log(self, user_message: str) -> None: ... + + def close(self, handle: int) -> None: ... + + def convert_from_device_units_to_physical(self, handle: int, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: ... + + def convert_from_physical_to_device(self, handle: int, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: float) -> int: ... + + def create_simulation(self, description: dict[str, str]) -> None: ... + + def deactivate_calibration(self, handle: int) -> None: ... + + def disconnect(self, handle: int) -> None: ... + + def set_actuator_type(self, handle: int, actuator_type: int) -> None: ... + + def get_adc_inputs(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_AdcInputs: ... + + def get_analog_monitor_configuration_params(self, handle: int, monitor_number: TLMC_AnalogMonitorNumber, max_wait_in_milliseconds: int) -> TLMC_AnalogMonitorConfigurationParams: ... + + def get_api_version(self) -> TLMC_ApiVersion: ... + + def get_aux_io_port_mode(self, handle: int, port_number: TLMC_AuxIoPortNumber, max_wait_in_milliseconds: int) -> TLMC_AuxIoPortMode: ... + + def get_aux_io_software_states(self, handle: int, max_wait_in_milliseconds: int) -> int: ... + + def get_button_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_ButtonParams: ... + + def get_calibration_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_CalibrationState: ... + + def get_bow_index(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_BowIndex: ... + + def get_connected_product(self, handle: int, max_length: int) -> str: ... + + def get_connected_product_info(self, handle: int) -> TLMC_ConnectedProductInfo: ... + + def get_connected_products_supported(self, handle: int, max_length: int) -> tuple [str, int]: ... + + def get_current_loop_params(self, handle: int, loop_scenario: TLMC_CurrentLoopScenario, max_wait_in_milliseconds: int) -> TLMC_CurrentLoopParams: ... + + def get_dc_pid_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_DcPidParams: ... + + def get_device_info(self, handle: int) -> TLMC_DeviceInfo: ... + + def get_device_list_item_count(self) -> int: ... + + def get_device_list_items(self, source_start_index: int, number_of_items: int) -> List[TLMC_DeviceInfo]: ... + + def get_digital_input_states(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_DigitalInput: ... + + def get_digital_output_states(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: ... + + def get_enable_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_EnableState: ... + + def get_encoder_counter(self, handle: int, max_wait_in_milliseconds: int) -> int: ... + + def get_firmware_version_info(self, handle: int, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: ... + + def get_general_move_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_GeneralMoveParams: ... + + def get_hardware_info(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: ... + + def get_home_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_HomeParams: ... + + def get_io_configuration_number_of_ports_supported(self, handle: int) -> int: ... + + def get_io_configuration_params(self, handle: int, port_number: TLMC_IoPortNumber, max_wait_in_milliseconds: int) -> TLMC_IoConfigurationParams: ... + + def get_io_position_trigger_enable_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_IoPositionTriggerEnableState: ... + + def get_io_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_IoTriggerParams: ... + + def get_jog_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_JogParams: ... + + def get_joystick_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_JoystickParams: ... + + def get_kcube_io_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubeIoTriggerParams: ... + + def get_kcube_mmi_lock_state(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiLockState: ... + + def get_kcube_mmi_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiParams: ... + + def get_kcube_position_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_KcubePositionTriggerParams: ... + + def get_lcd_display_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_LcdDisplayParams: ... + + def get_lcd_move_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_LcdMoveParams: ... + + def get_limit_switch_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_LimitSwitchParams: ... + + def get_motor_output_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_MotorOutputParams: ... + + def get_move_absolute_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_MoveAbsoluteParams: ... + + def get_move_relative_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_MoveRelativeParams: ... + + def get_position_counter(self, handle: int, max_wait_in_milliseconds: int) -> int: ... + + def get_position_loop_params(self, handle: int, position_loop_scenario: TLMC_PositionLoopScenario, max_wait_in_milliseconds: int) -> TLMC_PositionLoopParams: ... + + def get_potentiometer_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PotentiometerParams: ... + + def get_power_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PowerParams: ... + + def get_preferred_physical_unit(self, handle: int, scale_type: TLMC_ScaleType) -> TLMC_Unit: ... + + def get_profile_mode_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_ProfileModeParams: ... + + def get_rack_bay_occupied_state(self, handle: int, bay_number: TLMC_RackBayNumber, max_wait_in_milliseconds: int) -> TLMC_RackBayOccupiedState: ... + + def get_rich_response(self, handle: int) -> TLMC_RichResponse: ... + + def get_setting(self, handle: int, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: ... + + def get_setting_count(self, handle: int) -> int: ... + + def get_settings(self, handle: int, source_start_index: int, number_of_items: int) -> List[TLMC_Setting]: ... + + def get_setting_discrete_values(self, handle: int, setting_name: str) -> str: ... + + def get_settings_as_string(self, handle: int, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: ... + + def get_status_item(self, handle: int, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: ... + + def get_status_item_count(self, handle: int) -> int: ... + + def get_status_items(self, handle: int, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: ... + + def get_stage_axis_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_StageAxisParams: ... + + def get_stepper_loop_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_StepperLoopParams: ... + + def get_stepper_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_StepperStatus: ... + + def get_track_settle_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_TrackSettleParams: ... + + def get_trigger_params_for_dc_brushless(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_TriggerParamsForDcBrushless: ... + + def get_trigger_params_for_stepper(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_TriggerParamsForStepper: ... + + def get_universal_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_UniversalStatus: ... + + def get_universal_status_bits(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_UniversalStatusBit: ... + + def get_velocity_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_VelocityParams: ... + + def home(self, handle: int, max_wait_in_milliseconds: int) -> None: ... + + def identify(self, handle: int) -> None: ... + + def load_params(self, handle: int) -> None: ... + + def move(self, handle: int, mode: TLMC_MoveMode, param: int, max_wait_in_milliseconds: int) -> None: ... + + def move_absolute(self, handle: int, move_mode: TLMC_MoveMode, position: int, max_wait_in_milliseconds: int) -> None: ... + + def move_continuous(self, handle: int, direction: TLMC_MoveDirection, max_wait_in_milliseconds: int) -> None: ... + + def move_jog(self, handle: int, direction: TLMC_MoveDirection, max_wait_in_milliseconds: int) -> None: ... + + def move_relative(self, handle: int, move_mode: TLMC_MoveMode, step_size: int, max_wait_in_milliseconds: int) -> None: ... + + def open(self, device: str, transport_type: str, operating_mode: TLMC_OperatingMode) -> int: ... + + def persist_params(self, handle: int, parameter_group_id: TLMC_ParameterGroupId) -> None: ... + + def pz_nanotrak_move_to_circle_home_position(self, handle: int) -> None: ... + + def pz_get_kpc_io_settings_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoSettingsParams: ... + + def pz_get_kpc_io_trigger_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoTriggerParams: ... + + def pz_get_kpc_mmi_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcMmiParams: ... + + def pz_get_max_output_voltage_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_MaxOutputVoltageParams: ... + + def pz_get_max_travel(self, handle: int, max_wait_in_milliseconds: int) -> int: ... + + def pz_get_nano_trak_circle_diameter_lookup_table_data(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleDiameterLookupTableData: ... + + def pz_get_nano_trak_circle_home_position(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleHomePositionParams: ... + + def pz_get_nano_trak_circle_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleParams: ... + + def pz_get_nano_trak_gain_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakGainParams: ... + + def pz_get_nano_trak_mode(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakMode: ... + + def pz_get_nano_trak_phase_compensation_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakPhaseCompensationParams: ... + + def pz_get_nano_trak_range_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakRangeParams: ... + + def pz_get_nano_trak_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakStatus: ... + + def pz_get_nano_trak_tna_io_settings(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTnaIoSettings: ... + + def pz_get_nano_trak_track_threshold(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTrackThresholdParams: ... + + def pz_get_output_voltage(self, handle: int, max_wait_in_milliseconds: int) -> int: ... + + def pz_get_output_voltage_control_source_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputVoltageControlSourceParams: ... + + def pz_get_output_waveform_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputWaveformParams: ... + + def pz_get_position(self, handle: int, max_wait_in_milliseconds: int) -> int: ... + + def pz_get_position_control_mode(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionControlMode: ... + + def pz_get_position_loop_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionLoopParams: ... + + def pz_get_slew_rate_params(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_SlewRateParams: ... + + def pz_get_status(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_Status: ... + + def pz_get_status_bits(self, handle: int, max_wait_in_milliseconds: int) -> TLMC_PZ_StatusBit: ... + + def pz_set_kpc_io_settings_params(self, handle: int, params: TLMC_PZ_KpcIoSettingsParams) -> None: ... + + def pz_set_kpc_io_trigger_params(self, handle: int, params: TLMC_PZ_KpcIoTriggerParams) -> None: ... + + def pz_set_kpc_mmi_params(self, handle: int, params: TLMC_PZ_KpcMmiParams) -> None: ... + + def pz_set_max_output_voltage(self, handle: int, max_output_voltage: int) -> None: ... + + def pz_set_max_travel(self, handle: int, max_travel: int) -> None: ... + + def pz_set_nano_trak_circle_diameter_lookup_table_data(self, handle: int, params: TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> None: ... + + def pz_set_nano_trak_circle_home_position(self, handle: int, params: TLMC_PZ_NanoTrakCircleHomePositionParams) -> None: ... + + def pz_set_nano_trak_circle_params(self, handle: int, params: TLMC_PZ_NanoTrakCircleParams) -> None: ... + + def pz_set_nano_trak_eeprom_params(self, handle: int, params: TLMC_PZ_NanoTrakEEPROMParams) -> None: ... + + def pz_set_nano_trak_gain_params(self, handle: int, params: TLMC_PZ_NanoTrakGainParams) -> None: ... + + def pz_set_nano_trak_mode(self, handle: int, set_mode: TLMC_PZ_SetNanoTrakModeType) -> None: ... + + def pz_set_nano_trak_phase_compensation_params(self, handle: int, params: TLMC_PZ_NanoTrakPhaseCompensationParams) -> None: ... + + def pz_set_nano_trak_range_params(self, handle: int, params: TLMC_PZ_NanoTrakRangeParams) -> None: ... + + def pz_set_nano_trak_tna_io_settings(self, handle: int, params: TLMC_PZ_NanoTrakTnaIoSettings) -> None: ... + + def pz_set_nano_trak_track_threshold(self, handle: int, params: TLMC_PZ_NanoTrakTrackThresholdParams) -> None: ... + + def pz_set_output_voltage(self, handle: int, new_output_voltage: int) -> None: ... + + def pz_set_output_voltage_control_source_params(self, handle: int, params: TLMC_PZ_OutputVoltageControlSourceParams) -> None: ... + + def pz_set_output_waveform_loop_table_sample(self, handle: int, params: TLMC_PZ_OutputWaveformLoopTableSample) -> None: ... + + def pz_set_output_waveform_params(self, handle: int, params: TLMC_PZ_OutputWaveformParams) -> None: ... + + def pz_set_position(self, handle: int, new_position: int) -> None: ... + + def pz_set_position_control_mode(self, handle: int, control_mode: TLMC_PZ_PositionControlMode) -> None: ... + + def pz_set_position_loop_params(self, handle: int, params: TLMC_PZ_PositionLoopParams) -> None: ... + + def pz_set_slew_rate_params(self, handle: int, params: TLMC_PZ_SlewRateParams) -> None: ... + + def pz_set_zero(self, handle: int, max_wait_in_milliseconds: int) -> None: ... + + def pz_start_output_waveform(self, handle: int) -> None: ... + + def pz_stop_output_waveform(self, handle: int) -> None: ... + + def rack_identify(self, handle: int, channel: int) -> None: ... + + def request_status(self, handle: int, max_wait_in_milliseconds: int) -> None: ... + + def remove_simulation(self, description: str) -> None: ... + + def restore_factory_defaults(self, handle: int) -> None: ... + + def send_no_flash_programming(self, handle: int) -> None: ... + + def send_yes_flash_programming(self, handle: int) -> None: ... + + def set_analog_monitor_configuration_params(self, handle: int, monitor_number: TLMC_AnalogMonitorNumber, params: TLMC_AnalogMonitorConfigurationParams) -> None: ... + + def set_aux_io_port_mode(self, handle: int, port_number: TLMC_AuxIoPortNumber, port_mode: TLMC_AuxIoPortMode) -> None: ... + + def set_aux_io_software_states(self, handle: int, software_states: int) -> None: ... + + def set_bow_index(self, handle: int, bow_index: TLMC_BowIndex) -> None: ... + + def set_button_params(self, handle: int, params: TLMC_ButtonParams) -> None: ... + + def set_connected_product(self, handle: int, product_name: str) -> None: ... + + def set_connected_product_info(self, handle: int, params: TLMC_ConnectedProductInfo) -> None: ... + + def set_current_loop_params(self, handle: int, scenario: TLMC_CurrentLoopScenario, params: TLMC_CurrentLoopParams) -> None: ... + + def set_dc_pid_params(self, handle: int, params: TLMC_DcPidParams) -> None: ... + + def set_digital_output_states(self, handle: int, output_state: TLMC_DigitalOutput) -> None: ... + + def set_enable_state(self, handle: int, enable_state: TLMC_EnableState) -> None: ... + + def set_encoder_counter(self, handle: int, encoder_counter: int) -> None: ... + + def set_end_of_move_messages_mode(self, handle: int, messages_mode: TLMC_EndOfMoveMessagesMode) -> None: ... + + def set_general_move_params(self, handle: int, params: TLMC_GeneralMoveParams) -> None: ... + + def set_home_params(self, handle: int, params: TLMC_HomeParams) -> None: ... + + def set_io_configuration_params(self, handle: int, port_number: TLMC_IoPortNumber, params: TLMC_IoConfigurationParams) -> None: ... + + def set_io_position_trigger_enable_state(self, handle: int, enable_state: TLMC_IoPositionTriggerEnableState, max_wait_in_milliseconds: int) -> None: ... + + def set_io_trigger_params(self, handle: int, params: TLMC_IoTriggerParams) -> None: ... + + def set_joystick_params(self, handle: int, params: TLMC_JoystickParams) -> None: ... + + def set_kcube_io_trigger_params(self, handle: int, params: TLMC_KcubeIoTriggerParams) -> None: ... + + def set_kcube_mmi_lock_state(self, handle: int, lock_state: TLMC_KcubeMmiLockState) -> None: ... + + def set_kcube_mmi_params(self, handle: int, params: TLMC_KcubeMmiParams) -> None: ... + + def set_kcube_position_trigger_params(self, handle: int, params: TLMC_KcubePositionTriggerParams) -> None: ... + + def set_lcd_display_params(self, handle: int, params: TLMC_LcdDisplayParams) -> None: ... + + def set_lcd_move_params(self, handle: int, params: TLMC_LcdMoveParams) -> None: ... + + def set_limit_switch_params(self, handle: int, params: TLMC_LimitSwitchParams) -> None: ... + + def set_motor_output_params(self, handle: int, params: TLMC_MotorOutputParams) -> None: ... + + def set_move_absolute_params(self, handle: int, params: TLMC_MoveAbsoluteParams) -> None: ... + + def set_jog_params(self, handle: int, params: TLMC_JogParams) -> None: ... + + def set_move_relative_params(self, handle: int, params: TLMC_MoveRelativeParams) -> None: ... + + def set_position_counter(self, handle: int, position_counter: int) -> None: ... + + def set_position_loop_params(self, handle: int, scenario: TLMC_PositionLoopScenario, params: TLMC_PositionLoopParams) -> None: ... + + def set_potentiometer_params(self, handle: int, params: TLMC_PotentiometerParams) -> None: ... + + def set_power_params(self, handle: int, params: TLMC_PowerParams) -> None: ... + + def set_profile_mode_params(self, handle: int, params: TLMC_ProfileModeParams) -> None: ... + + def set_setting(self, handle: int, setting_name: str, value: TLMC_Value) -> None: ... + + def set_settings_from_string(self, handle: int, settings: str) -> None: ... + + def set_stage_axis_params(self, handle: int, params: TLMC_StageAxisParams) -> None: ... + + def set_status_mode(self, handle: int, operating_mode: TLMC_OperatingMode) -> None: ... + + def set_stepper_loop_params(self, handle: int, params: TLMC_StepperLoopParams) -> None: ... + + def set_track_settle_params(self, handle: int, params: TLMC_TrackSettleParams) -> None: ... + + def set_trigger_params_for_dc_brushless(self, handle: int, params: TLMC_TriggerParamsForDcBrushless) -> None: ... + + def set_trigger_params_for_stepper(self, handle: int, params: TLMC_TriggerParamsForStepper) -> None: ... + + def set_velocity_params(self, handle: int, params: TLMC_VelocityParams) -> None: ... + + def shutdown(self) -> None: ... + + def startup(self, settings_file_name: Optional[str]) -> None: ... + + def stop(self, handle: int, stop_mode: TLMC_StopMode, max_wait_in_milliseconds: int) -> None: ... \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/products/__init__.py b/Python/XA/src/thorlabs_xa/products/__init__.py new file mode 100644 index 0000000..7463971 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/products/__init__.py @@ -0,0 +1 @@ +# Blank - just an indicator that this is a package folder \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/products/kdc101.py b/Python/XA/src/thorlabs_xa/products/kdc101.py new file mode 100644 index 0000000..4309704 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/products/kdc101.py @@ -0,0 +1,240 @@ +from typing import List +from thorlabs_xa.interfaces.device_feature_groups.kdc101_feature_group import Kdc101FeatureGroup +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.dc_pid_params import DcPidParams +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.end_of_move_messages_mode import EndOfMoveMessagesMode +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.interfaces.device_features.kcube_io_trigger_params import KcubeIoTriggerParams +from thorlabs_xa.interfaces.device_features.kcube_mmi_params import KcubeMmiParams +from thorlabs_xa.interfaces.device_features.kcube_position_trigger_params import KcubePositionTriggerParams +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.interfaces.device_features.limit_switch_params_setter import LimitSwitchParamsSetter +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.interfaces.device_features.universal_status_bits import UniversalStatusBits +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.shared.device import Device +from thorlabs_xa.shared.enums import TLMC_DigitalOutput, TLMC_EnableState, TLMC_EndOfMoveMessagesMode, TLMC_MoveMode, TLMC_OperatingMode, TLMC_ParameterGroupId, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StopMode, TLMC_Unit +from thorlabs_xa.shared.params import TLMC_ConnectedProductInfo, TLMC_DcPidParams, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_GeneralMoveParams, TLMC_HardwareInfo, TLMC_HomeParams, TLMC_JogParams, TLMC_KcubeIoTriggerParams, TLMC_LimitSwitchParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_RichResponse, TLMC_Setting, TLMC_UniversalStatus, TLMC_UniversalStatusBit, TLMC_VelocityParams + + +class Kdc101(Device, + ConnectedProduct, + DcPidParams, + DigitalOutputStates, + Disconnect, + EnableState, + EndOfMoveMessagesMode, + FirmwareVersionInfo, + GeneralMoveParams, + HardwareInfo, + Home, + HomeParams, + Identify, + JogParams, + KcubeMmiParams, + KcubePositionTriggerParams, + KcubeIoTriggerParams, + LimitSwitchParamsGetter, + LimitSwitchParamsSetter, + LoadParams, + Move, + MoveAbsoluteParams, + MoveRelativeParams, + PersistParams, + PositionCounter, + RestoreFactoryDefaults, + RichResponse, + StatusMode, + Settings, + StatusItems, + StatusRequest, + Stop, + UnitConverter, + UniversalStatus, + UniversalStatusBits, + VelocityParams): + + def __init__(self, device_handle: int, device_info: TLMC_DeviceInfo, feature_group: Kdc101FeatureGroup, native_functions: NativeFunctions) -> None: + + super().__init__(device_handle, device_info, native_functions) + + self.feature_group = feature_group + + def get_connected_product_info(self) -> TLMC_ConnectedProductInfo: + return self.feature_group.connected_product_feature.get_connected_product_info() + + def get_connected_products_supported(self, max_length: int) -> tuple[str, int]: + return self.feature_group.connected_product_feature.get_connected_products_supported(max_length) + + def set_connected_product(self, product_name: str) -> None: + self.feature_group.connected_product_feature.set_connected_product(product_name) + + def set_connected_product_info(self, product_info: TLMC_ConnectedProductInfo) -> None: + self.feature_group.connected_product_feature.set_connected_product_info(product_info) + + def get_dc_pid_params(self, max_wait_in_milliseconds: int) -> TLMC_DcPidParams: + return self.feature_group.dc_pid_params_feature.get_dc_pid_params(max_wait_in_milliseconds) + + def set_dc_pid_params(self, parameters: TLMC_DcPidParams): + self.feature_group.dc_pid_params_feature.set_dc_pid_params(parameters) + + def get_digital_output_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: + return self.feature_group.digital_output_states_feature.get_digital_output_states(max_wait_in_milliseconds) + + def set_digital_output_states(self, params: TLMC_DigitalOutput) -> None: + self.feature_group.digital_output_states_feature.set_digital_output_states(params) + + def get_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_EnableState: + return self.feature_group.enable_state_feature.get_enable_state(max_wait_in_milliseconds) + + def set_enable_state(self, enable_state: TLMC_EnableState) -> None: + self.feature_group.enable_state_feature.set_enable_state(enable_state) + + def set_end_of_move_messages_mode(self, messages_mode: TLMC_EndOfMoveMessagesMode) -> None: + self.feature_group.end_of_move_messages_mode_feature.set_end_of_move_messages_mode(messages_mode) + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple[TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + return self.feature_group.firmware_version_info_feature.get_firmware_version_info(max_wait_in_milliseconds) + + def get_general_move_params(self, max_wait_in_milliseconds: int) -> TLMC_GeneralMoveParams: + return self.feature_group.general_move_params_feature.get_general_move_params(max_wait_in_milliseconds) + + def set_general_move_params(self, params: TLMC_GeneralMoveParams) -> None: + self.feature_group.general_move_params_feature.set_general_move_params(params) + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + return self.feature_group.hardware_info_feature.get_hardware_info(max_wait_in_milliseconds) + + def home(self, max_wait_in_milliseconds: int) -> None: + self.feature_group.home_feature.home(max_wait_in_milliseconds) + + def get_home_params(self, max_wait_in_milliseconds: int) -> TLMC_HomeParams: + return self.feature_group.home_params_feature.get_home_params(max_wait_in_milliseconds) + + def set_home_params(self, params: TLMC_HomeParams): + self.feature_group.home_params_feature.set_home_params(params) + + def identify(self) -> None: + self.feature_group.identify_feature.identify() + + def get_jog_params(self, max_wait_in_milliseconds: int) -> TLMC_JogParams: + return self.feature_group.jog_params_feature.get_jog_params(max_wait_in_milliseconds) + + def set_jog_params(self, params: TLMC_JogParams) -> None: + self.feature_group.jog_params_feature.set_jog_params(params) + + def get_kcube_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_KcubeIoTriggerParams: + return self.feature_group.kcube_io_trigger_params_feature.get_kcube_io_trigger_params(max_wait_in_milliseconds) + + def set_kcube_io_trigger_params(self, params: TLMC_KcubeIoTriggerParams) -> None: + self.feature_group.kcube_io_trigger_params_feature.set_kcube_io_trigger_params(params) + + def get_limit_switch_params(self, max_wait_in_milliseconds: int) -> TLMC_LimitSwitchParams: + return self.feature_group.limit_switch_params_getter_feature.get_limit_switch_params(max_wait_in_milliseconds) + + def set_limit_switch_params(self, params: TLMC_LimitSwitchParams) -> None: + self.feature_group.limit_switch_params_setter_feature.set_limit_switch_params(params) + + def load_params(self) -> None: + self.feature_group.load_params_feature.load_params() + + def move(self, move_mode: TLMC_MoveMode, params: int, max_wait_in_milliseconds: int): + return self.feature_group.move_feature.move(move_mode, params, max_wait_in_milliseconds) + + def get_move_absolute_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveAbsoluteParams: + return self.feature_group.move_absolute_params_feature.get_move_absolute_params(max_wait_in_milliseconds) + + def set_move_absolute_params(self, params: TLMC_MoveAbsoluteParams) -> None: + self.feature_group.move_absolute_params_feature.set_move_absolute_params(params) + + def get_move_relative_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveRelativeParams: + return self.feature_group.move_relative_params_feature.get_move_relative_params(max_wait_in_milliseconds) + + def set_move_relative_params(self, params: TLMC_MoveRelativeParams) -> None: + return self.feature_group.move_relative_params_feature.set_move_relative_params(params) + + def persist_params(self, parameter_group_id: TLMC_ParameterGroupId): + self.feature_group.persist_params_feature.persist_params(parameter_group_id) + + def get_position_counter(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.position_counter_feature.get_position_counter(max_wait_in_milliseconds) + + def set_position_counter(self, new_position_counter: int) -> None: + self.feature_group.position_counter_feature.set_position_counter(new_position_counter) + + def restore_factory_defaults(self) -> None: + self.feature_group.restore_factory_defaults_feature.restore_factory_defaults() + + def get_rich_response(self) -> TLMC_RichResponse: + return self.feature_group.rich_response_feature.get_rich_response() + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + return self.feature_group.settings_feature.get_setting(settings_name, max_wait_in_milliseconds); + + def get_settings_items(self) -> List[TLMC_Setting]: + return self.feature_group.settings_feature.get_settings_items() + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + return self.feature_group.settings_feature.get_settings(setting_string_format, include_read_only_items) + + def set_settings_from_string(self, settings: str) -> None: + self.feature_group.settings_feature.set_settings(settings) + + def get_setting_discrete_values(self, settings_name: str) -> str: + return self.feature_group.settings_feature.get_setting_discrete_values(settings_name) + + def set_status_mode(self, operating_mode: TLMC_OperatingMode) -> None: + return self.feature_group.set_status_mode_feature.set_status_mode(operating_mode) + + def request_status(self, max_wait_in_milliseconds: int) -> None: + self.feature_group.status_request_feature.request_status(max_wait_in_milliseconds) + + def stop(self, stop_mode: TLMC_StopMode, max_wait_in_milliseconds: int) -> None: + self.feature_group.stop_feature.stop(stop_mode, max_wait_in_milliseconds) + + def convert_from_device_units_to_physical(self, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: + return self.feature_group.unit_converter_feature.convert_from_device_units_to_physical(scale_type, device_value) + + def convert_from_physical_to_device(self, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: int) -> int: + return self.feature_group.unit_converter_feature.convert_from_physical_to_device(scale_type, unit, physical_value) + + def get_preferred_physical_unit(self, scale_type: TLMC_ScaleType) -> TLMC_Unit: + return self.feature_group.unit_converter_feature.get_preferred_physical_unit(scale_type) + + def get_universal_status(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatus: + return self.feature_group.universal_status_feature.get_universal_status(max_wait_in_milliseconds) + + def get_universal_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatusBit: + return self.feature_group.universal_status_bits_feature.get_universal_status_bits(max_wait_in_milliseconds) + + def get_velocity_params(self, max_wait_in_milliseconds: int) -> TLMC_VelocityParams: + return self.feature_group.velocity_params_feature.get_velocity_params(max_wait_in_milliseconds) + + def set_velocity_params(self, params: TLMC_VelocityParams) -> None: + return self.feature_group.velocity_params_feature.set_velocity_params(params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/products/kpc101.py b/Python/XA/src/thorlabs_xa/products/kpc101.py new file mode 100644 index 0000000..0af23e3 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/products/kpc101.py @@ -0,0 +1,253 @@ +from typing import List + +from thorlabs_xa.interfaces.device_feature_groups.kpc101_feature_group import Kpc101FeatureGroup +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.kcube_mmi_lock import KcubeMmiLock +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_settings_params import KpcIoSettingsParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_io_trigger_params import KpcIoTriggerParams +from thorlabs_xa.interfaces.device_features.piezo.kpc_mmi_params import KpcMmiParams +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.interfaces.device_features.piezo.output_waveform import OutputWaveform +from thorlabs_xa.interfaces.device_features.piezo.output_waveform_params_getter import OutputWaveformParamsGetter +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.interfaces.device_features.piezo.position_loop_params import PositionLoopParams +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions + +from thorlabs_xa.shared.device import Device +from thorlabs_xa.shared.enums import TLMC_DigitalOutput, TLMC_EnableState, TLMC_KcubeMmiLockState, TLMC_OperatingMode, TLMC_PZ_PositionControlMode, TLMC_PZ_StatusBit, TLMC_ParameterGroupId, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StatusItemId, TLMC_Unit +from thorlabs_xa.shared.params import TLMC_ConnectedProductInfo, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_HardwareInfo, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformLoopTableSample, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_Status, TLMC_RichResponse, TLMC_Setting, TLMC_StatusItem + + +class Kpc101(Device, + ConnectedProduct, + DigitalOutputStates, + Disconnect, + EnableState, + FirmwareVersionInfo, + HardwareInfo, + Identify, + KcubeMmiLock, + KpcIoSettingsParams, + KpcIoTriggerParams, + KpcMmiParams, + LoadParams, + MaxTravel, + OutputVoltage, + OutputVoltageControlSourceParams, + OutputWaveform, + OutputWaveformParamsGetter, + PersistParams, + PiezoStatus, + PiezoStatusBits, + PositionLoopParams, + Position, + PositionControlMode, + RestoreFactoryDefaults, + RichResponse, + Settings, + StatusItems, + StatusRequest, + StatusMode, + UnitConverter, + Zero): + """ + Thorlabs Kcube Piezo Controller With Strain Gauge. + """ + def __init__(self, device_handle: int, device_info: TLMC_DeviceInfo, feature_group: Kpc101FeatureGroup, native_functions: NativeFunctions) -> None: + + super().__init__(device_handle, device_info, native_functions) + + self.feature_group = feature_group + + def get_connected_product_info(self) -> TLMC_ConnectedProductInfo: + return self.feature_group.connected_product_feature.get_connected_product_info() + + def get_connected_products_supported(self, max_length: int) -> tuple[str, int]: + return self.feature_group.connected_product_feature.get_connected_products_supported(max_length) + + def set_connected_product(self, product_name: str) -> None: + self.feature_group.connected_product_feature.set_connected_product(product_name) + + def set_connected_product_info(self, product_info: TLMC_ConnectedProductInfo) -> None: + self.feature_group.connected_product_feature.set_connected_product_info(product_info) + + def get_digital_output_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: + return self.feature_group.digital_output_states_feature.get_digital_output_states(max_wait_in_milliseconds) + + def set_digital_output_states(self, params: TLMC_DigitalOutput) -> None: + self.feature_group.digital_output_states_feature.set_digital_output_states(params) + + def disconnect(self) -> None: + self.feature_group.disconnect_feature.disconnect() + + def get_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_EnableState: + return self.feature_group.enable_state_feature.get_enable_state(max_wait_in_milliseconds) + + def set_enable_state(self, enable_state: TLMC_EnableState) -> None: + self.feature_group.enable_state_feature.set_enable_state(enable_state) + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + return self.feature_group.firmware_version_info_feature.get_firmware_version_info(max_wait_in_milliseconds) + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + return self.feature_group.hardware_version_info_feature.get_hardware_info(max_wait_in_milliseconds) + + def identify(self) -> None: + self.feature_group.identify_feature.identify() + + def get_kcube_mmi_lock_state(self, max_wait_in_milliseconds: int) -> TLMC_KcubeMmiLockState: + return self.feature_group.kcube_mmi_lock_feature.get_kcube_mmi_lock_state(max_wait_in_milliseconds) + + def set_kcube_mmi_lock_state(self, lock_state: TLMC_KcubeMmiLockState) -> None: + self.feature_group.kcube_mmi_lock_feature.set_kcube_mmi_lock_state(lock_state) + + def get_io_settings_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoSettingsParams: + return self.feature_group.kpc_io_settings_params_feature.get_io_settings_params(max_wait_in_milliseconds) + + def set_io_settings_params(self, params: TLMC_PZ_KpcIoSettingsParams) -> None: + return self.feature_group.kpc_io_settings_params_feature.set_io_settings_params(params) + + def get_io_trigger_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcIoTriggerParams: + return self.feature_group.kpc_io_trigger_params_feature.get_io_trigger_params(max_wait_in_milliseconds) + + def set_io_trigger_params(self, params: TLMC_PZ_KpcIoTriggerParams) -> None: + return self.feature_group.kpc_io_trigger_params_feature.set_io_trigger_params(params) + + def get_kpc_mmi_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_KpcMmiParams: + return self.feature_group.kpc_mmi_params_feature.get_kpc_mmi_params(max_wait_in_milliseconds) + + def set_kpc_mmi_params(self, params: TLMC_PZ_KpcMmiParams) -> None: + return self.feature_group.kpc_mmi_params_feature.set_kpc_mmi_params(params) + + def load_params(self) -> None: + self.feature_group.load_params_feature.load_params() + + def get_max_travel(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.max_travel_feature.get_max_travel(max_wait_in_milliseconds) + + def set_max_travel(self, max_travel: int) -> None: + self.feature_group.max_travel_feature.set_max_travel(max_travel) + + def get_output_voltage(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.output_voltage_feature.get_output_voltage(max_wait_in_milliseconds) + + def set_output_voltage(self, output_voltage: int) -> None: + self.feature_group.output_voltage_feature.set_output_voltage(output_voltage) + + def get_output_voltage_control_source_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputVoltageControlSourceParams: + return self.feature_group.output_voltage_control_source_params_feature.get_output_voltage_control_source_params(max_wait_in_milliseconds) + + def set_output_voltage_control_source_params(self, params: TLMC_PZ_OutputVoltageControlSourceParams) -> None: + self.feature_group.output_voltage_control_source_params_feature.set_output_voltage_control_source_params(params) + + def set_output_waveform_params(self, params: TLMC_PZ_OutputWaveformParams) -> None: + self.feature_group.output_waveform_feature.set_output_waveform_params(params) + + def set_output_waveform_lookup_table_sample_params(self, params: TLMC_PZ_OutputWaveformLoopTableSample) -> None: + self.feature_group.output_waveform_feature.set_output_waveform_lookup_table_sample_params(params) + + def start_output_waveform(self) -> None: + self.feature_group.output_waveform_feature.start_output_waveform() + + def stop_output_waveform(self) -> None: + self.feature_group.output_waveform_feature.stop_output_waveform() + + def get_output_waveform_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputWaveformParams: + return self.feature_group.output_waveform_params_getter_feature.get_output_waveform_params(max_wait_in_milliseconds) + + def persist_params(self, parameter_group_id: TLMC_ParameterGroupId) -> None: + self.feature_group.persist_params_feature.persist_params(parameter_group_id) + + def get_piezo_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_PZ_StatusBit: + return self.feature_group.piezo_status_bits_feature.get_piezo_status_bits(max_wait_in_milliseconds) + + def get_piezo_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_Status: + return self.feature_group.piezo_status_feature.get_piezo_status(max_wait_in_milliseconds) + + def get_position_control_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionControlMode: + return self.feature_group.position_control_mode_feature.get_position_control_mode(max_wait_in_milliseconds) + + def set_position_control_mode(self, control_mode: TLMC_PZ_PositionControlMode) -> None: + self.feature_group.position_control_mode_feature.set_position_control_mode(control_mode) + + def get_position(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.position_feature.get_position(max_wait_in_milliseconds) + + def set_position(self, position: int) -> None: + self.feature_group.position_feature.set_position(position) + + def get_position_loop_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionLoopParams: + return self.feature_group.position_loop_params_feature.get_position_loop_params(max_wait_in_milliseconds) + + def set_position_loop_params(self, params: TLMC_PZ_PositionLoopParams) -> None: + return self.feature_group.position_loop_params_feature.set_position_loop_params(params) + + def restore_factory_defaults(self) -> None: + self.feature_group.restore_factory_defaults_feature.restore_factory_defaults() + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + return self.feature_group.settings_feature.get_setting(settings_name, max_wait_in_milliseconds); + + def get_settings_items(self) -> List[TLMC_Setting]: + return self.feature_group.settings_feature.get_settings_items() + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + return self.feature_group.settings_feature.get_settings(setting_string_format, include_read_only_items) + + def set_settings_from_string(self, settings: str) -> None: + self.feature_group.settings_feature.set_settings(settings) + + def get_setting_discrete_values(self, settings_name: str) -> str: + return self.feature_group.settings_feature.get_setting_discrete_values(settings_name) + + def get_status_item(self, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: + return self.feature_group.status_items_feature.get_status_item(status_item_id) + + def get_status_item_count(self) -> int: + return self.feature_group.status_items_feature.get_status_item_count() + + def get_status_items(self, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: + return self.feature_group.status_items_feature.get_status_items(start_index, number_of_items) + + def set_status_mode(self, operating_mode: TLMC_OperatingMode) -> None: + return self.feature_group.set_status_mode_feature.set_status_mode(operating_mode) + + def get_rich_response(self) -> TLMC_RichResponse: + return self.feature_group.rich_response_feature.get_rich_response() + + def request_status(self, max_wait_in_milliseconds: int) -> None: + return self.feature_group.status_request_feature.request_status(max_wait_in_milliseconds) + + def convert_from_device_units_to_physical(self, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: + return self.feature_group.unit_converter_feature.convert_from_device_units_to_physical(scale_type, device_value) + + def convert_from_physical_to_device(self, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: int) -> int: + return self.feature_group.unit_converter_feature.convert_from_physical_to_device(scale_type, unit, physical_value) + + def get_preferred_physical_unit(self, scale_type: TLMC_ScaleType) -> TLMC_Unit: + return self.feature_group.unit_converter_feature.get_preferred_physical_unit(scale_type) + + def set_zero(self, max_wait_in_milliseconds: int) -> None: + self.feature_group.zero_feature.set_zero(max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/products/linear_translation_stage.py b/Python/XA/src/thorlabs_xa/products/linear_translation_stage.py new file mode 100644 index 0000000..6f6a598 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/products/linear_translation_stage.py @@ -0,0 +1,232 @@ +from typing import List + +from thorlabs_xa.interfaces.device_feature_groups.linear_translation_stage_feature_group import LinearTranslationStageFeatureGroup +from thorlabs_xa.interfaces.device_features.button_params import ButtonParams +from thorlabs_xa.interfaces.device_features.calibration import Calibration +from thorlabs_xa.interfaces.device_features.connected_product import ConnectedProduct +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.general_move_params import GeneralMoveParams +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.home import Home +from thorlabs_xa.interfaces.device_features.home_params import HomeParams +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.jog_params import JogParams +from thorlabs_xa.interfaces.device_features.limit_switch_params_getter import LimitSwitchParamsGetter +from thorlabs_xa.interfaces.device_features.load_params import LoadParams +from thorlabs_xa.interfaces.device_features.move import Move +from thorlabs_xa.interfaces.device_features.move_absolute_params import MoveAbsoluteParams +from thorlabs_xa.interfaces.device_features.move_relative_params import MoveRelativeParams +from thorlabs_xa.interfaces.device_features.persist_params import PersistParams +from thorlabs_xa.interfaces.device_features.potentiometer_params import PotentiometerParams +from thorlabs_xa.interfaces.device_features.position_counter import PositionCounter +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_request import StatusRequest +from thorlabs_xa.interfaces.device_features.stepper_status import StepperStatus +from thorlabs_xa.interfaces.device_features.stop import Stop +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.universal_status import UniversalStatus +from thorlabs_xa.interfaces.device_features.velocity_params import VelocityParams + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.device import Device +from thorlabs_xa.shared.enums import TLMC_CalibrationState, TLMC_EnableState, TLMC_MoveMode, TLMC_OperatingMode, TLMC_ParameterGroupId, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StatusItemId, TLMC_StopMode, TLMC_Unit +from thorlabs_xa.shared.params import TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_GeneralMoveParams, TLMC_HardwareInfo, TLMC_HomeParams,TLMC_JogParams,TLMC_LimitSwitchParams,TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PotentiometerParams,TLMC_StepperStatus, TLMC_Setting, TLMC_StatusItem, TLMC_UniversalStatus, TLMC_VelocityParams + +class LinearTranslationStage(Device, + ButtonParams, + Calibration, + ConnectedProduct, + Disconnect, + EnableState, + FirmwareVersionInfo, + GeneralMoveParams, + HardwareInfo, + Home, + HomeParams, + Identify, + JogParams, + LimitSwitchParamsGetter, + LoadParams, + Move, + MoveAbsoluteParams, + MoveRelativeParams, + PersistParams, + PotentiometerParams, + PositionCounter, + StatusMode, + Settings, + StatusItems, + StatusRequest, + StepperStatus, + Stop, + UnitConverter, + UniversalStatus, + VelocityParams): + """ + Thorlabs Long travel stage control. + """ + def __init__(self, device_handle: int, device_info: TLMC_DeviceInfo, feature_group: LinearTranslationStageFeatureGroup, native_functions: NativeFunctions) -> None: + + super().__init__(device_handle, device_info, native_functions) + + self.feature_group = feature_group + + def get_button_params(self, max_wait_in_milliseconds: int) -> TLMC_ButtonParams: + return self.feature_group.button_params_feature.get_button_params(max_wait_in_milliseconds) + + def set_button_params(self, params: TLMC_ButtonParams) -> None: + self.feature_group.button_params_feature.set_button_params(params) + + def get_calibration_state(self, max_wait_in_milliseconds: int) -> TLMC_CalibrationState: + return self.feature_group.calibration_feature.get_calibration_state(max_wait_in_milliseconds) + + def activate(self) -> None: + self.feature_group.calibration_feature.activate() + + def deactivate(self): + self.feature_group.calibration_feature.deactivate() + + def get_connected_product_info(self) -> TLMC_ConnectedProductInfo: + return self.feature_group.connectd_product_feature.get_connected_product_info() + + def get_connected_products_supported(self, max_length: int) -> tuple[str, int]: + return self.feature_group.connectd_product_feature.get_connected_products_supported(max_length) + + def set_connected_product(self, product_name: str) -> None: + self.feature_group.connectd_product_feature.set_connected_product(product_name) + + def set_connected_product_info(self, product_info: TLMC_ConnectedProductInfo) -> None: + self.feature_group.connectd_product_feature.set_connected_product_info(product_info) + + def disconnect(self) -> None: + self.feature_group.disconnect_feature.disconnect() + + def get_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_EnableState: + return self.feature_group.enable_state_feature.get_enable_state(max_wait_in_milliseconds) + + def set_enable_state(self, enable_state: TLMC_EnableState) -> None: + self.feature_group.enable_state_feature.set_enable_state(enable_state) + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + return self.feature_group.firmware_version_info_feature.get_firmware_version_info(max_wait_in_milliseconds) + + def get_general_move_params(self, max_wait_in_milliseconds: int) -> TLMC_GeneralMoveParams: + return self.feature_group.general_move_params_feature.get_general_move_params(max_wait_in_milliseconds) + + def set_general_move_params(self, params: TLMC_GeneralMoveParams): + self.feature_group.general_move_params_feature.set_general_move_params(params) + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + return self.feature_group.hardware_info_feature.get_hardware_info(max_wait_in_milliseconds) + + def home(self, max_wait_in_milliseconds: int) -> None: + self.feature_group.home_feature.home(max_wait_in_milliseconds) + + def get_home_params(self, max_wait_in_milliseconds: int) -> TLMC_HomeParams: + return self.feature_group.home_params_feature.get_home_params(max_wait_in_milliseconds) + + def set_home_params(self, params: TLMC_HomeParams) -> None: + self.feature_group.home_params_feature.set_home_params(params) + + def identify(self) -> None: + self.feature_group.identify_feature.identify() + + def get_jog_params(self, max_wait_in_milliseconds: int) -> TLMC_JogParams: + return self.feature_group.jog_params_feature.get_jog_params(max_wait_in_milliseconds) + + def set_jog_params(self, params: TLMC_JogParams) -> None: + self.feature_group.jog_params_feature.set_jog_params(params) + + def get_limit_switch_params(self, max_wait_in_milliseconds: int) -> TLMC_LimitSwitchParams: + return self.feature_group.limit_switch_params_getter_feature.get_limit_switch_params(max_wait_in_milliseconds) + + def load_params(self) -> None: + self.feature_group.load_params_feature.load_params() + + def move(self, move_mode: TLMC_MoveMode, params: int, max_wait_in_milliseconds: int): + self.feature_group.move_feature.move(move_mode, params, max_wait_in_milliseconds) + + def get_move_absolute_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveAbsoluteParams: + return self.feature_group.move_absolute_params_feature.get_move_absolute_params(max_wait_in_milliseconds) + + def set_move_absolute_params(self, params: TLMC_MoveAbsoluteParams) -> None: + self.feature_group.move_absolute_params_feature.set_move_absolute_params(params) + + def get_move_relative_params(self, max_wait_in_milliseconds: int) -> TLMC_MoveRelativeParams: + return self.feature_group.move_relative_params_feature.get_move_relative_params(max_wait_in_milliseconds) + + def set_move_relative_params(self, params: TLMC_MoveRelativeParams) -> None: + self.feature_group.move_relative_params_feature.set_move_relative_params(params) + + def persist_params(self, parameter_group_id: TLMC_ParameterGroupId) -> None: + self.feature_group.persist_params_feature.persist_params(parameter_group_id) + + def get_potentiometer_params(self, max_wait_in_milliseconds: int) -> TLMC_PotentiometerParams: + return self.feature_group.potentiometer_params_feature.get_potentiometer_params(max_wait_in_milliseconds) + + def set_potentiometer_params(self, params: TLMC_PotentiometerParams): + self.feature_group.potentiometer_params_feature.set_potentiometer_params(params) + + def get_position_counter(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.position_counter.get_position_counter(max_wait_in_milliseconds) + + def set_position_counter(self, new_position_counter: int) -> None: + self.feature_group.position_counter.set_position_counter(new_position_counter) + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + return self.feature_group.settings_feature.get_setting(settings_name, max_wait_in_milliseconds) + + def get_settings_items(self) -> List[TLMC_Setting]: + return self.feature_group.settings_feature.get_settings_items() + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + return self.feature_group.settings_feature.get_settings(setting_string_format, include_read_only_items) + + def set_settings_from_string(self, settings: str) -> None: + self.feature_group.settings_feature.set_settings(settings) + + def get_setting_discrete_values(self, settings_name: str) -> str: + return self.feature_group.settings_feature.get_setting_discrete_values(settings_name) + + def get_status_item(self, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: + return self.feature_group.status_items_feature.get_status_item(status_item_id) + + def get_status_item_count(self) -> int: + return self.feature_group.status_items_feature.get_status_item_count() + + def get_status_items(self, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: + return self.feature_group.status_items_feature.get_status_items(start_index, number_of_items) + + def set_status_mode(self, operating_mode: TLMC_OperatingMode) -> None: + return self.feature_group.status_mode_feature.set_status_mode(operating_mode) + + def get_stepper_status(self, max_wait_in_milliseconds: int) -> TLMC_StepperStatus: + return self.feature_group.stepper_status_feature.get_stepper_status(max_wait_in_milliseconds) + + def stop(self, stop_mode: TLMC_StopMode, max_wait_in_milliseconds : int) -> None: + return self.feature_group.stop_feature.stop(stop_mode, max_wait_in_milliseconds) + + def request_status(self, max_wait_in_milliseconds: int) -> None: + return self.feature_group.status_request_feature.request_status(max_wait_in_milliseconds) + + def convert_from_device_units_to_physical(self, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: + return self.feature_group.unit_converter_feature.convert_from_device_units_to_physical(scale_type, device_value) + + def convert_from_physical_to_device(self, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: int) -> int: + return self.feature_group.unit_converter_feature.convert_from_physical_to_device(scale_type, unit, physical_value) + + def get_preferred_physical_unit(self, scale_type: TLMC_ScaleType) -> TLMC_Unit: + return self.feature_group.unit_converter_feature.get_preferred_physical_unit(scale_type) + + def get_universal_status(self, max_wait_in_milliseconds: int) -> TLMC_UniversalStatus: + return self.feature_group.universal_status_feature.get_universal_status(max_wait_in_milliseconds) + + def get_velocity_params(self, max_wait_in_milliseconds: int) -> TLMC_VelocityParams: + return self.feature_group.velocity_params_feature.get_velocity_params(max_wait_in_milliseconds) + + def set_velocity_params(self, params: TLMC_VelocityParams) -> None: + return self.feature_group.velocity_params_feature.set_velocity_params(params) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/products/lnnx.py b/Python/XA/src/thorlabs_xa/products/lnnx.py new file mode 100644 index 0000000..0f14675 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/products/lnnx.py @@ -0,0 +1,159 @@ +from typing import List + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.device import Device + +from thorlabs_xa.interfaces.device_feature_groups.lnnx_feature_group import LnnxFeatureGroup + +from thorlabs_xa.shared.enums import TLMC_DigitalInput, TLMC_DigitalOutput, TLMC_PZ_SetNanoTrakModeType, TLMC_RackBayNumber, TLMC_RackBayOccupiedState, TLMC_SettingStringFormat +from thorlabs_xa.shared.params import TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_HardwareInfo, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_NanoTrakEEPROMParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakStatus, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_RichResponse, TLMC_Setting + +from thorlabs_xa.interfaces.device_features.disconnect import Disconnect +from thorlabs_xa.interfaces.device_features.digital_input_states import DigitalInputStates +from thorlabs_xa.interfaces.device_features.digital_output_states import DigitalOutputStates +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_diameter_lookup_table_data import NanoTrakCircleDiameterLookupTableData +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_home_position import NanoTrakCircleHomePosition +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_circle_params import NanoTrakCircleParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_eeprom_params import NanoTrakEEPROMParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_gain_params import NanoTrakGainParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_mode import NanoTrakMode +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_phase_compensation_params import NanoTrakPhaseCompensationParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_range_params import NanoTrakRangeParams +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_status import NanoTrakStatus +from thorlabs_xa.interfaces.device_features.piezo.nano_trak_tna_io_settings import NanoTrakTnaIoSettings +from thorlabs_xa.interfaces.device_features.rack_bay_occupied_state import RackBayOccupiedState +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.rich_response import RichResponse +from thorlabs_xa.interfaces.device_features.settings import Settings + +class Lnnx(Device, + DigitalInputStates, + DigitalOutputStates, + Disconnect, + FirmwareVersionInfo, + HardwareInfo, + Identify, + NanoTrakCircleDiameterLookupTableData, + NanoTrakCircleHomePosition, + NanoTrakCircleParams, + NanoTrakEEPROMParams, + NanoTrakGainParams, + NanoTrakMode, + NanoTrakPhaseCompensationParams, + NanoTrakRangeParams, + NanoTrakStatus, + NanoTrakTnaIoSettings, + RackBayOccupiedState, + RestoreFactoryDefaults, + RichResponse, + Settings): + """ + Thorlabs Low Noise NanoTrak Piezo Controller. + """ + def __init__(self, device_handle: int, device_info: TLMC_DeviceInfo, feature_group: LnnxFeatureGroup, native_functions: NativeFunctions): + + super().__init__(device_handle, device_info, native_functions) + + self.feature_group = feature_group + + def get_digital_input_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalInput: + return self.feature_group.digital_input_states_feature.get_digital_input_states(max_wait_in_milliseconds) + + def get_digital_output_states(self, max_wait_in_milliseconds: int) -> TLMC_DigitalOutput: + return self.feature_group.digital_output_states_feature.get_digital_output_states(max_wait_in_milliseconds) + + def set_digital_output_states(self, params: TLMC_DigitalOutput) -> None: + self.feature_group.digital_output_states_feature.set_digital_output_states(params) + + def disconnect(self) -> None: + self.feature_group.disconnect_feature.disconnect() + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + return self.feature_group.firmware_version_info_feature.get_firmware_version_info(max_wait_in_milliseconds) + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + return self.feature_group.hardware_info_feature.get_hardware_info(max_wait_in_milliseconds) + + def identify(self) -> None: + self.feature_group.identify_feature.identify() + + def get_nano_trak_circle_diameter_lookup_table_data(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleDiameterLookupTableData: + return self.feature_group.nano_trak_circle_diameter_lookup_table_data_feature.get_nano_trak_circle_diameter_lookup_table_data(max_wait_in_milliseconds) + + def set_nano_trak_circle_diameter_lookup_table_data(self, params: TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> None: + self.feature_group.nano_trak_circle_diameter_lookup_table_data_feature.set_nano_trak_circle_diameter_lookup_table_data(params) + + def get_nano_trak_circle_home_position(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleHomePositionParams: + return self.feature_group.nano_trak_circle_home_position_feature.get_nano_trak_circle_home_position(max_wait_in_milliseconds) + + def set_nano_trak_circle_home_position(self, params: TLMC_PZ_NanoTrakCircleHomePositionParams) -> None: + self.feature_group.nano_trak_circle_home_position_feature.set_nano_trak_circle_home_position(params) + + def get_nano_trak_circle_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakCircleParams: + return self.feature_group.nano_trak_circle_params_feature.get_nano_trak_circle_params(max_wait_in_milliseconds) + + def set_nano_trak_circle_params(self, params: TLMC_PZ_NanoTrakCircleParams) -> None: + self.feature_group.nano_trak_circle_params_feature.set_nano_trak_circle_params(params) + + def set_nano_trak_eeprom_params(self, params: TLMC_PZ_NanoTrakEEPROMParams) -> None: + self.feature_group.nano_trak_eeprom_params_feature.set_nano_trak_eeprom_params(params) + + def get_nano_trak_gain_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakGainParams: + return self.feature_group.nano_trak_gain_params_feature.get_nano_trak_gain_params(max_wait_in_milliseconds) + + def set_nano_trak_gain_params(self, params: TLMC_PZ_NanoTrakGainParams) -> None: + self.feature_group.nano_trak_gain_params_feature.set_nano_trak_gain_params(params) + + def get_nano_trak_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakMode: + return self.feature_group.nano_trak_mode_feature.get_nano_trak_mode(max_wait_in_milliseconds) + + def set_nano_trak_mode(self, set_mode: TLMC_PZ_SetNanoTrakModeType) -> None: + self.feature_group.nano_trak_mode_feature.set_nano_trak_mode(set_mode) + + def get_nano_trak_phase_compensation_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakPhaseCompensationParams: + return self.feature_group.nano_trak_phase_compensation_params_feature.get_nano_trak_phase_compensation_params(max_wait_in_milliseconds) + + def set_nano_trak_phase_compensation_params(self, params: TLMC_PZ_NanoTrakPhaseCompensationParams) -> None: + self.feature_group.nano_trak_phase_compensation_params_feature.set_nano_trak_phase_compensation_params(params) + + def get_nano_trak_range_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakRangeParams: + return self.feature_group.nano_trak_range_params_feature.get_nano_trak_range_params(max_wait_in_milliseconds) + + def set_nano_trak_range_params(self, params: TLMC_PZ_NanoTrakRangeParams) -> None: + self.feature_group.nano_trak_range_params_feature.set_nano_trak_range_params(params) + + def get_nano_trak_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakStatus: + return self.feature_group.nano_trak_status_feature.get_nano_trak_status(max_wait_in_milliseconds) + + def get_nano_trak_tna_io_settings(self, max_wait_in_milliseconds: int) -> TLMC_PZ_NanoTrakTnaIoSettings: + return self.feature_group.nano_trak_tna_io_settings_feature.get_nano_trak_tna_io_settings(max_wait_in_milliseconds) + + def set_nano_trak_tna_io_settings(self, params: TLMC_PZ_NanoTrakTnaIoSettings) -> None: + self.feature_group.nano_trak_tna_io_settings_feature.set_nano_trak_tna_io_settings(params) + + def get_rack_bay_occupied_state(self, bay_number: TLMC_RackBayNumber, max_wait_in_milliseconds: int) -> TLMC_RackBayOccupiedState: + return self.feature_group.rack_bay_occupied_state_feature.get_rack_bay_occupied_state(bay_number, max_wait_in_milliseconds) + + def restore_factory_defaults(self) -> None: + self.feature_group.restore_factory_defaults_feature.restore_factory_defaults() + + def get_rich_response(self) -> TLMC_RichResponse: + return self.feature_group.rich_response_feature.get_rich_response() + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + return self.feature_group.settings_feature.get_setting(settings_name, max_wait_in_milliseconds); + + def get_settings_items(self) -> List[TLMC_Setting]: + return self.feature_group.settings_feature.get_settings_items() + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + return self.feature_group.settings_feature.get_settings(setting_string_format, include_read_only_items) + + def set_settings_from_string(self, settings: str) -> None: + self.feature_group.settings_feature.set_settings(settings) + + def get_setting_discrete_values(self, settings_name: str) -> str: + return self.feature_group.settings_feature.get_setting_discrete_values(settings_name) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/products/lnnx_logical_channel.py b/Python/XA/src/thorlabs_xa/products/lnnx_logical_channel.py new file mode 100644 index 0000000..fd469ce --- /dev/null +++ b/Python/XA/src/thorlabs_xa/products/lnnx_logical_channel.py @@ -0,0 +1,153 @@ +from typing import List + +from thorlabs_xa.interfaces.device_feature_groups.lnnx_logical_channel_feature_group import LnnxLogicalChannelFeatureGroup +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.device import Device +from thorlabs_xa.shared.enums import TLMC_EnableState, TLMC_OperatingMode, TLMC_PZ_PositionControlMode, TLMC_PZ_StatusBit, TLMC_ScaleType, TLMC_SettingStringFormat, TLMC_StatusItemId, TLMC_Unit +from thorlabs_xa.shared.params import TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_HardwareInfo, TLMC_PZ_MaxOutputVoltageParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_Status, TLMC_Setting, TLMC_StatusItem + +from thorlabs_xa.interfaces.device_features.enable_state import EnableState +from thorlabs_xa.interfaces.device_features.firmware_version_info import FirmwareVersionInfo +from thorlabs_xa.interfaces.device_features.hardware_info import HardwareInfo +from thorlabs_xa.interfaces.device_features.identify import Identify +from thorlabs_xa.interfaces.device_features.piezo.max_output_voltage_params import MaxOutputVoltageParams +from thorlabs_xa.interfaces.device_features.piezo.max_travel import MaxTravel +from thorlabs_xa.interfaces.device_features.piezo.output_voltage import OutputVoltage +from thorlabs_xa.interfaces.device_features.piezo.output_voltage_control_source_params import OutputVoltageControlSourceParams +from thorlabs_xa.interfaces.device_features.piezo.piezo_status import PiezoStatus +from thorlabs_xa.interfaces.device_features.piezo.piezo_status_bits import PiezoStatusBits +from thorlabs_xa.interfaces.device_features.piezo.position import Position +from thorlabs_xa.interfaces.device_features.piezo.position_control_mode import PositionControlMode +from thorlabs_xa.interfaces.device_features.restore_factory_defaults import RestoreFactoryDefaults +from thorlabs_xa.interfaces.device_features.settings import Settings +from thorlabs_xa.interfaces.device_features.status_items import StatusItems +from thorlabs_xa.interfaces.device_features.status_mode import StatusMode +from thorlabs_xa.interfaces.device_features.unit_converter import UnitConverter +from thorlabs_xa.interfaces.device_features.piezo.zero import Zero + +class LnnxLogicalChannel(Device, + EnableState, + FirmwareVersionInfo, + HardwareInfo, + Identify, + MaxOutputVoltageParams, + MaxTravel, + OutputVoltage, + OutputVoltageControlSourceParams, + PiezoStatus, + PiezoStatusBits, + Position, + PositionControlMode, + RestoreFactoryDefaults, + Settings, + StatusItems, + StatusMode, + UnitConverter, + Zero): + """ + Thorlabs Low Noise NanoTrak Piezo Controller channel. + """ + + def __init__(self, device_handle: int, device_info: TLMC_DeviceInfo, feature_group: LnnxLogicalChannelFeatureGroup, native_functions: NativeFunctions) -> None: + + super().__init__(device_handle, device_info, native_functions) + self.feature_group = feature_group + + def get_enable_state(self, max_wait_in_milliseconds: int) -> TLMC_EnableState: + return self.feature_group.enable_state_feature.get_enable_state(max_wait_in_milliseconds) + + def set_enable_state(self, enable_state: TLMC_EnableState) -> None: + self.feature_group.enable_state_feature.set_enable_state(enable_state) + + def get_firmware_version_info(self, max_wait_in_milliseconds: int) -> tuple [TLMC_FirmwareVersion, TLMC_FirmwareVersion]: + return self.feature_group.firmware_version_info_feature.get_firmware_version_info(max_wait_in_milliseconds) + + def get_hardware_info(self, max_wait_in_milliseconds: int) -> TLMC_HardwareInfo: + return self.feature_group.hardware_info_feature.get_hardware_info(max_wait_in_milliseconds) + + def identify(self) -> None: + self.feature_group.identify_feature.identify() + + def get_max_output_voltage_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_MaxOutputVoltageParams: + return self.feature_group.max_output_voltage_params_feature.get_max_output_voltage_params(max_wait_in_milliseconds) + + def set_max_output_voltage(self, max_output_voltage: int) -> None: + self.feature_group.max_output_voltage_params_feature.set_max_output_voltage(max_output_voltage) + + def get_max_travel(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.max_travel_feature.get_max_travel(max_wait_in_milliseconds) + + def set_max_travel(self, max_travel: int) -> None: + self.feature_group.max_travel_feature.set_max_travel(max_travel) + + def get_position(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.position_feature.get_position(max_wait_in_milliseconds) + + def set_position(self, position: int) -> None: + self.feature_group.position_feature.set_position(position) + + def get_output_voltage(self, max_wait_in_milliseconds: int) -> int: + return self.feature_group.output_voltage_feature.get_output_voltage(max_wait_in_milliseconds) + + def set_output_voltage(self, output_voltage: int) -> None: + self.feature_group.output_voltage_feature.set_output_voltage(output_voltage) + + def get_output_voltage_control_source_params(self, max_wait_in_milliseconds: int) -> TLMC_PZ_OutputVoltageControlSourceParams: + return self.feature_group.output_voltage_control_source_params_feature.get_output_voltage_control_source_params(max_wait_in_milliseconds) + + def set_output_voltage_control_source_params(self, params: TLMC_PZ_OutputVoltageControlSourceParams) -> None: + self.feature_group.output_voltage_control_source_params_feature.set_output_voltage_control_source_params(params) + + def get_piezo_status(self, max_wait_in_milliseconds: int) -> TLMC_PZ_Status: + return self.feature_group.piezo_status_feature.get_piezo_status(max_wait_in_milliseconds) + + def get_piezo_status_bits(self, max_wait_in_milliseconds: int) -> TLMC_PZ_StatusBit: + return self.feature_group.piezo_status_bits_feature.get_piezo_status_bits(max_wait_in_milliseconds) + + def get_position_control_mode(self, max_wait_in_milliseconds: int) -> TLMC_PZ_PositionControlMode: + return self.feature_group.position_control_mode_feature.get_position_control_mode(max_wait_in_milliseconds) + + def set_position_control_mode(self, control_mode: TLMC_PZ_PositionControlMode) -> None: + self.feature_group.position_control_mode_feature.set_position_control_mode(control_mode) + + def restore_factory_defaults(self) -> None: + self.feature_group.restore_factory_defaults_feature.restore_factory_defaults() + + def get_setting(self, settings_name: str, max_wait_in_milliseconds: int) -> TLMC_Setting: + return self.feature_group.settings_feature.get_setting(settings_name, max_wait_in_milliseconds); + + def get_settings_items(self) -> List[TLMC_Setting]: + return self.feature_group.settings_feature.get_settings_items() + + def get_settings(self, setting_string_format: TLMC_SettingStringFormat, include_read_only_items: bool) -> str: + return self.feature_group.settings_feature.get_settings(setting_string_format, include_read_only_items) + + def set_settings_from_string(self, settings: str) -> None: + self.feature_group.settings_feature.set_settings(settings) + + def get_setting_discrete_values(self, settings_name: str) -> str: + return self.feature_group.settings_feature.get_setting_discrete_values(settings_name) + + def get_status_item(self, status_item_id: TLMC_StatusItemId) -> TLMC_StatusItem: + return self.feature_group.status_items_feature.get_status_item(status_item_id) + + def get_status_item_count(self) -> int: + return self.feature_group.status_items_feature.get_status_item_count() + + def get_status_items(self, start_index: int, number_of_items: int) -> List[TLMC_StatusItem]: + return self.feature_group.status_items_feature.get_status_items(start_index, number_of_items) + + def set_status_mode(self, operating_mode: TLMC_OperatingMode) -> None: + self.feature_group.status_mode_feature.set_status_mode(operating_mode) + + def convert_from_device_units_to_physical(self, scale_type: TLMC_ScaleType, device_value: int) -> tuple [float, TLMC_Unit]: + return self.feature_group.unit_converter_feature.convert_from_device_units_to_physical(scale_type, device_value) + + def convert_from_physical_to_device(self, scale_type: TLMC_ScaleType, unit: TLMC_Unit, physical_value: int) -> int: + return self.feature_group.unit_converter_feature.convert_from_physical_to_device(scale_type, unit, physical_value) + + def get_preferred_physical_unit(self, scale_type: TLMC_ScaleType) -> TLMC_Unit: + return self.feature_group.unit_converter_feature.get_preferred_physical_unit(scale_type) + + def set_zero(self, max_wait_in_milliseconds: int) -> None: + return self.feature_group.zero_feature.set_zero(max_wait_in_milliseconds) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/__init__.py b/Python/XA/src/thorlabs_xa/shared/__init__.py new file mode 100644 index 0000000..7463971 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/__init__.py @@ -0,0 +1 @@ +# Blank - just an indicator that this is a package folder \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/c_params.py b/Python/XA/src/thorlabs_xa/shared/c_params.py new file mode 100644 index 0000000..8e28461 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/c_params.py @@ -0,0 +1,649 @@ +from ctypes import Structure, Union, c_bool, c_char, c_double, c_int16, c_int32, c_int8, c_longlong, c_uint16, c_uint32, c_uint8, c_ulonglong + +class C_TLMC_AdcInputs(Structure): + _pack_ = 1 + _fields_ = [("adcInput1", c_uint16), + ("adcInput2", c_uint16) + ] + + +class C_TLMC_ApiVersion(Structure): + _pack_ = 1 + _fields_ = [("major", c_uint16), + ("minor", c_uint16), + ("patch", c_uint16), + ("build", c_uint32), + ("prereleaseLabel", c_char * 32), + ("displayString", c_char * 64) + ] + + +class C_TLMC_AnalogMonitorConfigurationParams(Structure): + _pack_ = 1 + _fields_ = [("motorChannel", c_uint16), + ("systemVariable", c_uint16), + ("scale", c_int32), + ("offset", c_int32) + ] + + +class C_TLMC_AnalogMonitorConfigurationParamsChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("monitorNumber", c_uint16) + ] + + +class C_TLMC_AuxIoPortModeChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("portNumber", c_uint16) + ] + +class C_TLMC_ButtonParams(Structure): + _pack_ = 1 + _fields_ = [("buttonMode", c_uint16), + ("position1", c_int32), + ("position2", c_int32), + ("timeout1Milliseconds", c_uint16), + ("timeout2Milliseconds", c_uint16)] + +class C_TLMC_ConnectedProductInfo(Structure): + _pack_ = 1 + _fields_ = [("productName", c_char * 64), + ("partNumber", c_char * 16), + ("axisType", c_uint16), + ("movementType", c_uint16), + ("unitType", c_uint16), + ("distanceScaleFactor", c_double), + ("velocityScaleFactor", c_double), + ("accelerationScaleFactor", c_double), + ("minPosition", c_double), + ("maxPosition", c_double), + ("maxVelocity", c_double), + ("maxAcceleration", c_double) + ] + + +class C_TLMC_CurrentLoopParams(Structure): + _pack_ = 1 + _fields_ = [("phase", c_uint16), + ("proportional", c_uint16), + ("integral", c_uint16), + ("integralLimit", c_uint16), + ("integralDeadBand", c_uint16), + ("feedForward", c_uint16), + ] + + +class C_TLMC_CurrentLoopParamsChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("scenario", c_uint16)] + + +class C_TLMC_DcPidParams(Structure): + _pack_ = 1 + _fields_ = [("proportional", c_uint32), + ("integral", c_uint32), + ("derivative", c_uint32), + ("integralLimit", c_uint32), + ("filterControl", c_uint16) + ] + + +class C_TLMC_DeviceInfo(Structure): + _pack_ = 1 + _fields_ = [("deviceFamily", c_uint8), + ("deviceType", c_uint32), + ("partNumber", c_char * 8), + ("device", c_char * 64), + ("transport", c_char * 128), + ("parentDevice", c_char * 64), + ("deviceTypeDescription", c_char * 256) + ] + + +class C_TLMC_FirmwareVersion(Structure): + _pack_ = 1 + _fields_ = [("minorVersion", c_uint8), + ("interimVersion", c_uint8), + ("majorVersion", c_uint8), + ("reserved", c_uint8) + ] + + +class C_TLMC_GeneralMoveParams(Structure): + _pack_ = 1 + _fields_ = [("backlashDistance", c_int32) + ] + + +class C_TLMC_HardwareInfo(Structure): + _pack_ = 1 + _fields_ = [("serialNumber", c_uint32), + ("partNumber", c_char * 8), + ("type", c_uint16), + ("firmwareVersion", C_TLMC_FirmwareVersion), + ("notes", c_char * 48), + ("deviceDependantData", c_char * 12), + ("hardwareVersion", c_uint16), + ("modificationState", c_uint16), + ("numChannels", c_uint16) + ] + + +class C_TLMC_HomeParams(Structure): + _pack_ = 1 + _fields_ = [("direction", c_uint16), + ("limitSwitch", c_uint16), + ("velocity", c_uint32), + ("offsetDistance", c_int32) + ] + + +class C_TLMC_IoConfigurationParams(Structure): + _pack_ = 1 + _fields_ = [("mode", c_uint16), + ("triggerOutSource", c_uint16) + ] + + +class TLMC_IoConfigurationParamsChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("portNumber", c_uint16)] + + +class C_TLMC_IoTriggerParams(Structure): + _pack_ = 1 + _fields_ = [("triggerInMode", c_uint16), + ("triggerInPolarity", c_uint16), + ("triggerInSource", c_uint16), + ("triggerOutMode", c_uint16), + ("triggerOutPolarity", c_uint16), + ("triggerOutForwardStartPosition", c_int32), + ("triggerOutForwardInterval", c_int32), + ("triggerOutForwardNumberOfPulses", c_int32), + ("triggerOutReverseStartPosition", c_int32), + ("triggerOutReverseInterval", c_int32), + ("triggerOutReverseNumberOfPulses", c_int32), + ("triggerOutPulseWidth", c_uint32), + ("triggerOutNumberOfCycles", c_uint32), + ("reserved", c_int8 * 8) + ] + + +class C_TLMC_JogParams(Structure): + _pack_ = 1 + _fields_ = [("mode", c_uint16), + ("stepSize", c_int32), + ("minVelocity", c_uint32), + ("acceleration", c_uint32), + ("maxVelocity", c_uint32), + ("stopMode", c_uint16), + ] + + +class C_TLMC_JoystickParams(Structure): + _pack_ = 1 + _fields_ = [("lowGearMaxVelocity", c_uint32), + ("highGearMaxVelocity", c_uint32), + ("lowGearAcceleration", c_uint32), + ("highGearAcceleration", c_uint32), + ("directionSense", c_uint16) + ] + + +class C_TLMC_KcubeIoTriggerParams(Structure): + _pack_ = 1 + _fields_ = [("trigger1Mode", c_uint16), + ("trigger1Polarity", c_uint16), + ("trigger2Mode", c_uint16), + ("trigger2Polarity", c_uint16), + ("reserved", c_uint8 * 12) + ] + + +class C_TLMC_KcubeMmiParams(Structure): + _pack_ = 1 + _fields_ = [("joystickMode", c_uint16), + ("joystickMaxVelocity", c_uint32), + ("joystickAcceleration", c_uint32), + ("joystickDirectionSense", c_uint16), + ("presetPosition1", c_int32), + ("presetPosition2", c_int32), + ("displayBrightness", c_uint16), + ("displayTimeout", c_uint16), + ("displayDimLevel", c_uint16), + ("presetPosition3", c_int32), + ("joystickSensativity", c_uint16), + ("reserved", c_uint8 * 2) + ] + + +class C_TLMC_PZ_KpcIoSettingsParams(Structure): + _pack_ = 1 + _fields_ = [("voltageLimit", c_uint16), + ("analogInputSource", c_uint16), + ("filterCutOffFrequency", c_uint16), + ("voltageRange", c_uint16), + ("forceSense", c_uint16), + ("strainGaugeOption", c_uint16) + ] + + +class C_TLMC_PZ_KpcMmiParams(Structure): + _pack_ = 1 + _fields_ = [("joystickMode", c_uint16), + ("joystickGear", c_uint16), + ("joystickVoltageStepSize", c_uint16), + ("joystickPositionStepSize", c_uint16), + ("joystickDirectionSense", c_uint16), + ("presetVoltage1", c_uint16), + ("presetVoltage2", c_uint16), + ("presetPosition1", c_uint16), + ("presetPosition2", c_uint16), + ("displayBrightness", c_uint16), + ("displayTimeout", c_uint16), + ("displayDimLevel", c_uint16), + ("reserved", c_uint8 * 8) + ] + + +class C_TLMC_PZ_KpcIoTriggerParams(Structure): + _pack_ = 1 + _fields_ = [("trigger1Mode", c_uint16), + ("trigger1Polarity", c_uint16), + ("trigger2Mode", c_uint16), + ("trigger2Polarity", c_uint16), + ("strainGaugeLowerLimit", c_int32), + ("strainGaugeUpperLimit", c_int32), + ("smoothingSamples", c_uint16), + ("monitorOutputMode", c_uint16), + ("monitorFilterCutOffFrequency", c_uint16), + ("monitorOutputSoftwareValue", c_int16), + ("reserved", c_uint8 * 6) + ] + + +class C_TLMC_KcubePositionTriggerParams(Structure): + _pack_ = 1 + _fields_ = [("forwardStartPosition", c_int32), + ("forwardInterval", c_uint32), + ("forwardNumberOfPulses", c_uint32), + ("reverseStartPosition", c_int32), + ("reverseInterval", c_uint32), + ("reverseNumberOfPulses", c_uint32), + ("pulseWidth", c_uint32), + ("numberOfCycles", c_uint32), + ("reserved", c_uint8 * 12) + ] + + +class C_TLMC_LcdDisplayParams(Structure): + _pack_ = 1 + _fields_ = [("knobSensitivity", c_int16), + ("displayBrightness", c_uint16), + ("displayTimeout", c_uint16), + ("displayDimLevel", c_uint16), + ("reserved", c_uint8 * 20) + ] + + +class C_TLMC_LcdMoveParams(Structure): + _pack_ = 1 + _fields_ = [("knobMode", c_uint16), + ("jogStepSize", c_int32), + ("acceleration", c_int32), + ("maxVelocity", c_int32), + ("jogStopMode", c_uint16), + ("presetPosition", c_int32 * 3), + ("reserved", c_uint8 * 20) + ] + + +class C_TLMC_LimitSwitchParams(Structure): + _pack_ = 1 + _fields_ = [("clockwiseHardLimitOperatingMode", c_uint16), + ("counterclockwiseHardLimitOperatingMode", c_uint16), + ("clockwiseSoftLimit", c_int32), + ("counterclockwiseSoftLimit", c_int32), + ("softLimitOperatingMode", c_uint16) + ] + + +class C_TLMC_MotorOutputParams(Structure): + _pack_ = 1 + _fields_ = [("continuousCurrentLimit", c_uint16), + ("energyLimit", c_uint16), + ("motorLimit", c_uint16), + ("motorBias", c_uint16), + ("reserved", c_int8 * 4) + ] + + +class C_TLMC_MoveAbsoluteParams(Structure): + _pack_ = 1 + _fields_ = [("absolutePosition", c_int32) + ] + + +class C_TLMC_MoveRelativeParams(Structure): + _pack_ = 1 + _fields_ = [("relativeDistance", c_int32) + ] + + +class C_TLMC_PotentiometerParams(Structure): + _pack = 1 + _fields = [("deflection0", c_uint16), + ("velocity1", c_int32), + ("deflection1", c_uint16), + ("velocity2", c_int32), + ("deflection2", c_uint16), + ("velocity3", c_int32), + ("deflection3", c_uint16), + ("velocity4", c_int32)] + + +class C_TLMC_PositionLoopParams(Structure): + _pack_ = 1 + _fields_ = [("proportional", c_uint16), + ("integral", c_uint16), + ("integralLimit", c_uint32), + ("derivative", c_uint16), + ("servoCycles", c_uint16), + ("scale", c_uint16), + ("velocityFeedForward", c_uint16), + ("accelerationFeedForward", c_uint16), + ("errorLimit", c_uint32) + ] + + +class TLMC_PositionLoopParamsChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("scenario", c_uint16)] + + +class C_TLMC_PowerParams(Structure): + _pack_ = 1 + _fields_ = [("restFactor", c_uint16), + ("moveFactor", c_uint16), + ] + + +class C_TLMC_ProfileModeParams(Structure): + _pack_ = 1 + _fields_ = [("mode", c_uint16), + ("jerk", c_uint32), + ("reserved", c_int8 * 4) + ] + +class C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData(Structure): + _pack_ = 1 + _fields_ = [("lookupTableValues", c_uint16 * 16)] + +class C_TLMC_PZ_NanoTrakCircleHomePositionParams(Structure): + _pack_ = 1 + _fields_ = [("circleHomePositionA", c_uint16), + ("circleHomePositionB", c_uint16)] + +class C_TLMC_PZ_NanoTrakCircleParams(Structure): + _pack_ = 1 + _fields_ = [("circleDiameterMode", c_uint16), + ("circleDiameterSoftware", c_uint16), + ("circleOscillationFrequency", c_uint16), + ("absolutePowerMinCircleDiameter", c_uint16), + ("absolutePowerMaxCircleDiameter", c_uint16), + ("absolutePowerAdjustType", c_uint16)] + +class C_TLMC_PZ_NanoTrakEEPROMParams(Structure): + _pack_ = 1 + _fields_ = [("channelIdentifier", c_uint16), + ("messageId", c_uint16)] + +class C_TLMC_PZ_NanoTrakGainParams(Structure): + _pack_ = 1 + _fields_ = [("gainControlMode", c_uint16), + ("gain", c_int16)] + +class C_TLMC_PZ_NanoTrakMode(Structure): + _pack_ = 1 + _fields_ = [("state", c_uint8), + ("mode", c_uint8)] + +class C_TLMC_PZ_NanoTrakPhaseCompensationParams(Structure): + _pack_ = 1 + _fields_ = [("phaseCompensationMode", c_uint16), + ("phaseCompensationASoftware", c_int16), + ("phaseCompensationBSoftware", c_int16)] + +class C_TLMC_PZ_NanoTrakRangeParams(Structure): + _pack_ = 1 + _fields_ = [("rangeMode", c_uint16), + ("rangeUpLimit", c_int16), + ("rangeDownLimit", c_int16), + ("settleSamples", c_int16), + ("rangeChangeType", c_uint16), + ("rangeType", c_uint16)] + +class C_TLMC_PZ_NanoTrakStatus(Structure): + _pack_ = 1 + _fields_ = [("circlePositionA", c_uint16), + ("circlePositionB", c_uint16), + ("circleDiameter", c_uint16), + ("absoluteReading", c_uint32), + ("relativeReading", c_uint32), + ("range", c_int16), + ("underOverRead", c_int16), + ("statusBits", c_uint32), + ("nanoTrakGain", c_int16), + ("phaseCompensationA", c_int16), + ("phaseCompensationB", c_int16)] + +class C_TLMC_PZ_NanoTrakTnaIoSettings(Structure): + _pack_ = 1 + _fields_ = [("outRangeType", c_uint8), + ("outRouteType", c_uint8), + ("signalSourceMode", c_uint8), + ("signalSourceBoostType", c_uint8), + ("signalOutputMode", c_uint8), + ("channel1SignalRangeType", c_uint8), + ("channel2SignalRangeType", c_uint8)] + +class C_TLMC_PZ_NanoTrakTrackThresholdParams(Structure): + _pack_ = 1 + _fields_ = [("trackThreshold", c_uint32)] + + +class C_TLMC_Notification(Structure): + _pack = 1 + _fields = [("id", c_int32), + ("data", c_ulonglong), + ("dataLength", c_uint32)] + + +class C_TLMC_PZ_OutputWaveformParams(Structure): + _pack_ = 1 + _fields_ = [("mode", c_uint16), + ("numberOfSamplesPerCycle", c_uint16), + ("numberOfCycles", c_int32), + ("interSampleDelay", c_int32), + ("preCycleDelay", c_int32), + ("postCycleDelay", c_int32), + ("outputTriggerStartIndex", c_uint16), + ("outputTriggerWidth", c_int32), + ("numberOfSamplesBetweenTriggerRepetition", c_uint16) + ] + +class C_TLMC_PZ_OutputWaveformLoopTableSample(Structure): + _pack_ = 1 + _fields_ = [("index", c_uint16), + ("voltage", c_int16) + ] + +class C_TLMC_PZ_MaxOutputVoltageParams(Structure): + _pack_ = 1 + _fields_ = [("maxOutputVoltage", c_uint16), + ("voltageLimit", c_uint16) + ] + + +class C_TLMC_PZ_OutputVoltageControlSourceParams(Structure): + _pack_ = 1 + _fields_ = [("source", c_uint16) + ] + + +class C_TLMC_PZ_PositionLoopParams(Structure): + _pack_ = 1 + _fields_ = [("proportional", c_uint16), + ("integral", c_uint16) + ] + + +class C_TLMC_PZ_Status(Structure): + _pack_ = 1 + _fields_ = [("outputVoltage", c_int16), + ("position", c_int16), + ("statusBits", c_uint32) + ] + + +class C_TLMC_PZ_SlewRateParams(Structure): + _pack_ = 1 + _fields_ = [("openSlewRate", c_uint16), + ("closedLoopSlewRate", c_uint16) + ] + + +class C_TLMC_RichResponse(Structure): + _pack_ = 1 + _fields_ = [("messageId", c_uint16), + ("code", c_uint16), + ("notes", c_char * 64) + ] + + +class TLMC_Response(Structure): + _pack_ = 1 + _fields_ = [("messageId", c_uint16), + ("code", c_uint16) + ] + + +class C_TLMC_Value(Union): + _pack_ = 1 + _fields_ = [("int64Value", c_longlong), + ("boolValue", c_bool), + ("string", c_char * 24) + ] + + +class C_TLMC_Setting(Structure): + _pack_ = 1 + _fields_ = [("valueType", c_uint8), + ("isValueSet", c_bool), + ("Value", C_TLMC_Value), + ("ScaleType", c_uint16), + ("UnitType", c_uint16), + ("Name", c_char * 128), + ("DisplayName", c_char * 128), + ("isReadOnly", c_bool), + ("hasDiscreteValues", c_bool), + ("hasMin", c_bool), + ("hasMax", c_bool), + ("minValue", C_TLMC_Value), + ("maxValue", C_TLMC_Value) + ] + + +class C_TLMC_SettingItemChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("settingName", c_char * 128)] + + +class C_TLMC_StageAxisParams(Structure): + _pack_ = 1 + _fields_ = [("typeId", c_uint16), + ("axisId", c_uint16), + ("partNumber", c_char * 16), + ("serialNumber", c_uint32), + ("countsPerUnit", c_uint32), + ("minPosition", c_int32), + ("maxPosition", c_int32), + ("maxAcceleration", c_uint32), + ("maxDeceleration", c_uint32), + ("maxVelocity", c_uint32), + ("gearBoxRatio", c_uint16), + ("reserved", c_uint8 * 22) + ] + + +class C_TLMC_StatusItem(Structure): + _pack_ = 1 + _fields_ = [("id", c_int32), + ("valueType", c_uint8), + ("value", C_TLMC_Value) + ] + + +class C_TLMC_StatusItemChangedNotificationData(Structure): + _pack_ = 1 + _fields_ = [("count", c_uint16), + ("ids", c_int32) + ] + + +class C_TLMC_StepperLoopParams(Structure): + _pack_ = 1 + _fields_ = [("loopMode", c_uint16), + ("proportional", c_int32), + ("integral", c_int32), + ("differential", c_int32), + ("outputClip", c_int32), + ("outputTolerance", c_int32), + ("microstepsPerEncoderCount", c_uint32), + ("reserved", c_uint8 * 8) + ] + + +class C_TLMC_StepperStatus(Structure): + _pack_ = 1 + _fields_ = [("position", c_int32), + ("encoderCount", c_int32), + ("statusBits", c_int32), + ] + + +class C_TLMC_TrackSettleParams(Structure): + _pack_ = 1 + _fields_ = [("settleTime", c_uint16), + ("settleWindow", c_uint16), + ("trackWindow", c_uint16), + ("reserved", c_uint8 * 4) + ] + + +class C_TLMC_TriggerParamsForDcBrushless(Structure): + _pack_ = 1 + _fields_ = [("modes", c_uint8)] + + +class C_TLMC_TriggerParamsForStepper(Structure): + _pack_ = 1 + _fields_ = [("modes", c_uint8)] + + +class C_TLMC_UniversalStatus(Structure): + _pack_ = 1 + _fields_ = [("position", c_int32), + ("velocity", c_int16), + ("motorCurrent", c_int16), + ("statusBits", c_uint32) + ] + + +class C_TLMC_VelocityParams(Structure): + _pack_ = 1 + _fields_ = [("minVelocity", c_uint32), + ("acceleration", c_uint32), + ("maxVelocity", c_uint32) + ] \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/device.py b/Python/XA/src/thorlabs_xa/shared/device.py new file mode 100644 index 0000000..4fc10a3 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/device.py @@ -0,0 +1,51 @@ +from abc import ABCMeta + +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.shared.enums import TLMC_DeviceFamily, TLMC_DeviceType +from thorlabs_xa.shared.params import TLMC_DeviceInfo + +class Device(metaclass=ABCMeta): + + def __init__(self, device_handle: int, device_info: TLMC_DeviceInfo, native_functions: NativeFunctions): + + self._device_handle = device_handle + self._device_id = device_info.device + self._device_family = device_info.device_family + self._parent_device_id = device_info.parent_device + self._part_number = device_info.part_number + self._transport = device_info.transport + self._device_type = device_info.device_type + self._device_type_description = device_info.device_type_description + self._native_functions = native_functions + + def close(self): + + self._native_functions.close(self._device_handle) + + @property + def device_id(self) -> str: + return self._device_id + + @property + def device_family(self) -> TLMC_DeviceFamily: + return self._device_family + + @property + def parent_device_id(self) -> str: + return self._device_id + + @property + def part_number(self) -> str: + return self._part_number + + @property + def transport(self) -> str: + return self._transport + + @property + def device_type(self) -> TLMC_DeviceType: + return self._device_type + + @property + def device_type_description(self) -> str: + return self._device_type_description \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/device_factory.py b/Python/XA/src/thorlabs_xa/shared/device_factory.py new file mode 100644 index 0000000..ffde2c5 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/device_factory.py @@ -0,0 +1,41 @@ +from thorlabs_xa.implementations.device_feature_groups.kpc101_feature_group import Kpc101FeatureGroup +from thorlabs_xa.implementations.device_feature_groups.kdc101_feature_group import Kdc101FeatureGroup +from thorlabs_xa.implementations.device_feature_groups.lnnx_feature_group import LnnxFeatureGroup +from thorlabs_xa.implementations.device_feature_groups.linear_translation_stage_feature_group import LinearTranslationStageFeatureGroup +from thorlabs_xa.implementations.device_feature_groups.lnnx_logical_channel_feature_group import LnnxLogicalChannelFeatureGroup +from thorlabs_xa.native_sdks.native_functions import NativeFunctions +from thorlabs_xa.products.kpc101 import Kpc101 +from thorlabs_xa.products.kdc101 import Kdc101 +from thorlabs_xa.products.lnnx import Lnnx +from thorlabs_xa.products.linear_translation_stage import LinearTranslationStage +from thorlabs_xa.products.lnnx_logical_channel import LnnxLogicalChannel +from thorlabs_xa.shared.device import Device +from thorlabs_xa.shared.enums import TLMC_DeviceType +from thorlabs_xa.shared.params import TLMC_DeviceInfo + +class DeviceFactory: + + def __init__(self, native_functions: NativeFunctions): + + self.native_functions = native_functions + + def create(self, device_handle: int, device_info: TLMC_DeviceInfo) -> Device: + + # Note: It is expected that this will produce a pylance error until all device types are implemented + match device_info.device_type: + case TLMC_DeviceType.TLMC_DeviceType_LnnxBaseUnit: + feature_group = LnnxFeatureGroup(device_handle, self.native_functions) + return Lnnx(device_handle, device_info, feature_group, self.native_functions) + case TLMC_DeviceType.TLMC_DeviceType_LnnxLogicalChannel: + feature_group = LnnxLogicalChannelFeatureGroup(device_handle, self.native_functions) + return LnnxLogicalChannel(device_handle, device_info, feature_group, self.native_functions) + case TLMC_DeviceType.TLMC_DeviceType_Kdc101: + feature_group = Kdc101FeatureGroup(device_handle, self.native_functions) + return Kdc101(device_handle, device_info, feature_group, self.native_functions) + case TLMC_DeviceType.TLMC_DeviceType_Kpc101: + feature_group = Kpc101FeatureGroup(device_handle, self.native_functions) + return Kpc101(device_handle, device_info, feature_group, self.native_functions) + case TLMC_DeviceType.TLMC_DeviceType_LinearTranslationStage: + feature_group = LinearTranslationStageFeatureGroup(device_handle, self.native_functions) + return LinearTranslationStage(device_handle, device_info, feature_group, self.native_functions) + raise ValueError("Device type not currently supported") \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/diagnostics_helper.py b/Python/XA/src/thorlabs_xa/shared/diagnostics_helper.py new file mode 100644 index 0000000..9aedead --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/diagnostics_helper.py @@ -0,0 +1,94 @@ +from typing import Any, cast +from collections.abc import Sequence, Set, Mapping +from enum import Enum + +class DiagnosticsHelper: + + RED = "\033[91m" + GREEN = "\033[92m" + RESET = "\033[0m" + + @staticmethod + def format_value(value: Any) -> str: + + if isinstance(value, Enum): + return f"{value.__class__.__name__}.{value.name}" + + if isinstance(value, (str, bytes)): + return str(value) + + if isinstance(value, Sequence): + seq: Sequence[Any] = cast(Sequence[Any], value) + + if isinstance(value, list): + open_bracket, close_bracket = "[", "]" + elif isinstance(value, tuple): + open_bracket, close_bracket = "(", ")" + else: + open_bracket, close_bracket = "[", "]" + + parts: list[str] = [DiagnosticsHelper.format_value(elem) for elem in seq] + inner: str = ", ".join(parts) + return f"{open_bracket}{inner}{close_bracket}" + + if isinstance(value, Set): + s: Set[Any] = cast(Set[Any], value) + parts: list[str] = [DiagnosticsHelper.format_value(elem) for elem in s] + inner: str = ", ".join(parts) + return "{" + inner + "}" + + if isinstance(value, Mapping): + m: Mapping[Any, Any] = cast(Mapping[Any, Any], value) + parts: list[str] = [f"{DiagnosticsHelper.format_value(k)}: {DiagnosticsHelper.format_value(v)}" for k, v in m.items()] + inner: str = ", ".join(parts) + return "{" + inner + "}" + + return str(value) + + @staticmethod + def object_as_string(obj: Any) -> str: + cls_name: str = obj.__class__.__name__ + + attributes: dict[str, Any] | None + try: + attributes = vars(obj) # type: ignore + except TypeError: + attributes = None + + if attributes is not None: + items: list[tuple[str, Any]] = list(sorted(attributes.items(), key = lambda kv: kv[0])) # type: ignore + else: + def _should_include(name: str) -> bool: + if name.startswith("_"): + return False + try: + attr = getattr(obj, name) + except Exception: + return False + return not callable(attr) + + names: list[str] = sorted(n for n in dir(obj) if _should_include(n)) + items = [(n, getattr(obj, n)) for n in names] + + props: list[str] = [f"{key}={DiagnosticsHelper.format_value(value)}" for key, value in items] + return f"{cls_name}({', '.join(props)})" + + @staticmethod + def console(string: str) -> None: + + print(string) + + @staticmethod + def console_green(string: str) -> None: + + print (f"{DiagnosticsHelper.GREEN}{string}{DiagnosticsHelper.RESET}") + + @staticmethod + def console_error(string: str) -> None: + + print (f"{DiagnosticsHelper.RED}{string}{DiagnosticsHelper.RESET}") + + @staticmethod + def console_object(object: Any) -> None: + + DiagnosticsHelper.console(DiagnosticsHelper.object_as_string(object)) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/enums.py b/Python/XA/src/thorlabs_xa/shared/enums.py new file mode 100644 index 0000000..1ea5990 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/enums.py @@ -0,0 +1,980 @@ +from enum import IntEnum, IntFlag, auto + +class TLMC_AnalogMonitorMotorChannel(IntEnum): + TLMC_AnalogMonitorMotorChannel_1 = 0x0001 + TLMC_AnalogMonitorMotorChannel_2 = 0x0002 + + +class TLMC_AnalogMonitorNumber(IntEnum): + TLMC_AnalogueMonitorNumber_1 = 0x0001 + TLMC_AnalogueMonitorNumber_2 = 0x0002 + + +class TLMC_AnalogMonitorSystemVariable(IntEnum): + TLMC_AnalogMonitorSystemVariable_PositionError = 0x0001 + TLMC_AnalogMonitorSystemVariable_Position = 0x0002 + TLMC_AnalogMonitorSystemVariable_MotorCurrentPhaseA = 0x0003 + TLMC_AnalogMonitorSystemVariable_MotorCurrentPhaseB = 0x0004 + TLMC_AnalogMonitorSystemVariable_MotorCurrentPhaseC = 0x0005 + TLMC_AnalogMonitorSystemVariable_MotorCurrent = 0x0006 + + +class TLMC_AuxIoPortMode(IntEnum): + TLMC_AuxIoPortMode_None = 0x0000 + TLMC_AuxIoPortMode_SoftwareControlled = 0x0001 + TLMC_AuxIoPortMode_EncoderOutput = 0x0002 + + +class TLMC_AuxIoPortNumber(IntEnum): + TLMC_AuxIoPortNumber_None = 0x0000 + TLMC_AuxIoPortNumber_Port1 = 0x0001 + TLMC_AuxIoPortNumber_Port2 = 0x0002 + TLMC_AuxIoPortNumber_Port3 = 0x0004 + + +class TLMC_ButtonMode(IntEnum): + + TLMC_ButtonMode_Jog = 0x0001 + TLMC_ButtonMode_PresetPosition = 0x0002 + + +class TLMC_BowIndex(IntEnum): + TLMC_BowIndex_Trapezoidal = 0 + TLMC_BowIndex_SCurve1 = 1 + TLMC_BowIndex_SCurve2 = 2 + TLMC_BowIndex_SCurve3 = 3 + TLMC_BowIndex_SCurve4 = 4 + TLMC_BowIndex_SCurve5 = 5 + TLMC_BowIndex_SCurve6 = 6 + TLMC_BowIndex_SCurve7 = 7 + TLMC_BowIndex_SCurve8 = 8 + TLMC_BowIndex_SCurve9 = 9 + TLMC_BowIndex_SCurve10 = 10 + TLMC_BowIndex_SCurve11 = 11 + TLMC_BowIndex_SCurve12 = 12 + TLMC_BowIndex_SCurve13 = 13 + TLMC_BowIndex_SCurve14 = 14 + TLMC_BowIndex_SCurve15 = 15 + TLMC_BowIndex_SCurve16 = 16 + TLMC_BowIndex_SCurve17 = 17 + TLMC_BowIndex_SCurve18 = 18 + + +class TLMC_CalibrationState(IntEnum): + TLMC_CalibrationState_Unknown = 0x00 + TLMC_CalibrationState_FileNotPresent = 0x01 + TLMC_CalibrationState_Active = 0x02 + TLMC_CalibrationState_Inactive = 0x03 + + +class TLMC_ChannelEnableStates(IntEnum): + ChannelEnabled = 0x01 + ChannelDisabled = 0x02 + + +class TLMC_ConnectedProductAxisType(IntEnum): + TLMC_ConnectedProductAxisType_Unknown = 0 + TLMC_ConnectedProductAxisType_Single = 1 + TLMC_ConnectedProductAxisType_Rotary = 2 + TLMC_ConnectedProductAxisType_X = 3 + TLMC_ConnectedProductAxisType_Y = 4 + TLMC_ConnectedProductAxisType_Z = 5 + TLMC_ConnectedProductAxisType_Pitch = 6 + TLMC_ConnectedProductAxisType_Roll = 7 + TLMC_ConnectedProductAxisType_Yaw = 8 + TLMC_ConnectedProductAxisType_Goniometer = 9 + + +class TLMC_ConnectedProductMovementType(IntEnum): + TLMC_ConnectedProductMovementType_Unknown = 0 + TLMC_ConnectedProductMovementType_Linear = 1 + TLMC_ConnectedProductMovementType_RotaryContinuous = 2 + TLMC_ConnectedProductMovementType_RotaryFixedRange = 3 + + +class TLMC_ConversionMeasure(IntEnum): + TLMC_ConversionMeasure_Distance = 0x0000 + TLMC_ConversionMeasure_Velocity = 0x0001 + TLMC_ConversionMeasure_Acceleration = 0x0002 + + +class TLMC_CurrentLoopPhase(IntEnum): + TLMC_CurrentLoopPhase_A = 0x0000 + TLMC_CurrentLoopPhase_B = 0x0001 + TLMC_CurrentLoopPhase_AB = 0x0002 + + +class TLMC_CurrentLoopScenario(IntEnum): + TLMC_CurrentLoopScenario_Single = 0x0000 + TLMC_CurrentLoopScenario_Normal = 0x0001 + TLMC_CurrentLoopScenario_Settled = 0x0002 + + +class TLMC_DcPidUpdateFilter(IntFlag): + TLMC_DcPidUpdateFilter_None = 0x0000 + TLMC_DcPidUpdateFilter_IntegralLimit = 0x0001 + TLMC_DcPidUpdateFilter_Derivative = 0x0002 + TLMC_DcPidUpdateFilter_Integral = 0x0004 + TLMC_DcPidUpdateFilter_Proportional = 0x0008 + TLMC_DcPidUpdateFilter_All = (TLMC_DcPidUpdateFilter_IntegralLimit + | TLMC_DcPidUpdateFilter_Derivative + | TLMC_DcPidUpdateFilter_Integral + | TLMC_DcPidUpdateFilter_Proportional) + + +class TLMC_DeviceFamily(IntEnum): + TLMC_DeviceFamily_ThorlabsMotionControl = 0 + + +class TLMC_DeviceType(IntEnum): + TLMC_DeviceType_Bbd30xBaseUnit = 0 + TLMC_DeviceType_Bbd30xLogicalChannel = 1 + TLMC_DeviceType_Bpc301 = 2 + TLMC_DeviceType_Bpc30xBaseUnit = 3 + TLMC_DeviceType_Bpc30xLogicalChannel = 4 + TLMC_DeviceType_Bsc20xBaseUnit = 5 + TLMC_DeviceType_Bsc20xLogicalChannel = 6 + TLMC_DeviceType_Kbd101 = 7 + TLMC_DeviceType_Kdc101 = 8 + TLMC_DeviceType_Kpz101 = 9 + TLMC_DeviceType_Kst101 = 10 + TLMC_DeviceType_Kst201 = 11 + TLMC_DeviceType_Tbd001 = 12 + TLMC_DeviceType_LinearTranslationStage = 13 + TLMC_DeviceType_Bsc20xv4LogicalChannel = 14 + TLMC_DeviceType_Bsc201 = 15 + TLMC_DeviceType_Bsc201v4 = 16 + TLMC_DeviceType_Kpc101 = 17 + TLMC_DeviceType_LnnxBaseUnit = 18 + TLMC_DeviceType_LnnxLogicalChannel = 19 + + +class TLMC_DeviceListChange(IntEnum): + TLMC_DeviceListChange_EntryAdded = 0 + TLMC_DeviceListChange_EntryRemoved = 1 + + +class TLMC_DigitalInput(IntFlag): + TLMC_DigitalInput_None = 0x00000000 + TLMC_DigitalInput_1 = 0x00000001 + TLMC_DigitalInput_2 = 0x00000002 + TLMC_DigitalInput_3 = 0x00000004 + TLMC_DigitalInput_4 = 0x00000008 + TLMC_DigitalInput_All = (TLMC_DigitalInput_1 + | TLMC_DigitalInput_2 + | TLMC_DigitalInput_3 + | TLMC_DigitalInput_4) + + +class TLMC_DigitalOutput(IntFlag): + TLMC_DigitalOutput_None = 0x00 + TLMC_DigitalOutput_1 = 0x01 + TLMC_DigitalOutput_2 = 0x02 + TLMC_DigitalOutput_3 = 0x04 + TLMC_DigitalOutput_4 = 0x08 + TLMC_DigitalOutput_All = (TLMC_DigitalOutput_1 + | TLMC_DigitalOutput_2 + | TLMC_DigitalOutput_3 + | TLMC_DigitalOutput_4) + + +class TLMC_EnableState(IntEnum): + TLMC_Enabled = 0x01 + TLMC_Disabled = 0x02 + + +class TLMC_EndOfMoveMessagesMode(IntEnum): + TLMC_EndOfMoveMessagesMode_Enabled = 0x01 + TLMC_EndOfMoveMessagesMode_Disabled = 0x02 + + +class TLMC_HardLimitOperatingMode(IntEnum): + TLMC_HardLimitOperatingMode_SwitchIgnored = 0x0001 + TLMC_HardLimitOperatingMode_SwitchContactMakes = 0x0002 + TLMC_HardLimitOperatingMode_SwitchContactBreaks = 0x0003 + TLMC_HardLimitOperatingMode_SwitchContactMakesWhenHoming = 0x0004 + TLMC_HardLimitOperatingMode_SwitchContactBreaksWhenHoming = 0x0005 + TLMC_HardLimitOperatingMode_SwitchUseIndexMarkForHoming = 0x0006 + TLMC_HardLimitOperatingMode_SwitchesSwapped = 0x0080 + + +class TLMC_HomeDirection(IntEnum): + TLMC_HomeDirection_Forward = 0x0001 + TLMC_HomeDirection_Reverse = 0x0002 + + +class TLMC_HomeLimitSwitch(IntEnum): + TLMC_HomeLimitSwitch_Reverse = 0x0001 + TLMC_HomeLimitSwitch_Forward = 0x0004 + + +class TLMC_IoPortMode(IntEnum): + TLMC_IoPortMode_DigitalInput = 0x0000 + TLMC_IoPortMode_DigitalOutput = 0x0001 + TLMC_IoPortMode_AnalogOutput = 0x0002 + + +class TLMC_IoPortNumber(IntEnum): + TLMC_IoPortNumber_Port1 = 0x0001 + TLMC_IoPortNumber_Port2 = 0x0002 + TLMC_IoPortNumber_Port3 = 0x0003 + + +class TLMC_IoPortSource(IntEnum): + TLMC_IoPortSource_Software = 0x0000 + TLMC_IoPortSource_Channel1 = 0x0001 + TLMC_IoPortSource_Channel2 = 0x0002 + TLMC_IoPortSource_Channel3 = 0x0003 + + +class TLMC_IoPositionTriggerEnableState(IntEnum): + TLMC_IoPositionTriggerEnableState_Armed = 0x01 + TLMC_IoPositionTriggerEnableState_Canceled = 0x02 + + +class TLMC_IoTriggerInMode(IntEnum): + TLMC_IoTriggerInMode_Disabled = 0x0000 + TLMC_IoTriggerInMode_GeneralPurpose = 0x0001 + TLMC_IoTriggerInMode_TriggersRelativeMove = 0x0002 + TLMC_IoTriggerInMode_TriggersAbsoluteMove = 0x0003 + TLMC_IoTriggerInMode_TriggersHomeMove = 0x0004 + + +class TLMC_IoTriggerInSource(IntEnum): + TLMC_IoTriggerInSource_Software = 0x0000 + TLMC_IoTriggerInSource_BNC1 = 0x0001 + TLMC_IoTriggerInSource_BNC2 = 0x0002 + TLMC_IoTriggerInSource_BNC3 = 0x0003 + + +class TLMC_IoTriggerOutMode(IntEnum): + TLMC_IoTriggerOutMode_GeneralPurpose = 0x000A + TLMC_IoTriggerOutMode_ActiveDuringMotion = 0x000B + TLMC_IoTriggerOutMode_ActiveAtMaxVelocity = 0x000C + TLMC_IoTriggerOutMode_PulsedInForwardDirection = 0x000D + TLMC_IoTriggerOutMode_PulsedInReverseDirection = 0x000E + TLMC_IoTriggerOutMode_PulsedInBothDirections = 0x000F + TLMC_IoTriggerOutMode_ActiveAtForwardLimit = 0x0010 + TLMC_IoTriggerOutMode_ActiveAtReverseLimit = 0x0011 + TLMC_IoTriggerOutMode_ActiveAtBothLimits = 0x0012 + + +class TLMC_IoTriggerPolarity(IntEnum): + TLMC_IoTriggerPolarity_ActiveIsLogicHigh = 0x0001 + TLMC_IoTriggerPolarity_ActiveIsLogicLow = 0x0002 + + +class TLMC_JogMode(IntEnum): + TLMC_JogMode_Continuous = 0x0001 + TLMC_JogMode_SingleStep = 0x0002 + + +class TLMC_JogStopMode(IntEnum): + TLMC_JogStopMode_Immediate = 0x0001 + TLMC_JogStopMode_Profiled = 0x0002 + + +class TLMC_JoystickDirectionSense(IntEnum): + TLMC_JoystickDirectionSense_Positive = 0x0001 + TLMC_JoystickDirectionSense_Negative = 0x0002 + + +class TLMC_KcubeIoTriggerMode(IntEnum): + TLMC_KcubeIoTriggerMode_Disabled = 0x0000 + TLMC_KcubeIoTriggerMode_GeneralPurposeInput = 0x0001 + TLMC_KcubeIoTriggerMode_InputTriggersRelativeMove = 0x0002 + TLMC_KcubeIoTriggerMode_InputTriggersAbsoluteMove = 0x0003 + TLMC_KcubeIoTriggerMode_InputTriggersHomeMove = 0x0004 + TLMC_KcubeIoTriggerMode_GeneralPurposeOutput = 0x000A + TLMC_KcubeIoTriggerMode_OutputActiveDuringMotion = 0x000B + TLMC_KcubeIoTriggerMode_OutputActiveAtMaxVelocity = 0x000C + TLMC_KcubeIoTriggerMode_OutputPulsedInForwardDirection = 0x000D + TLMC_KcubeIoTriggerMode_OutputPulsedInReverseDirection = 0x000E + TLMC_KcubeIoTriggerMode_OutputPulsedInBothDirections = 0x000F + + +class TLMC_KcubeIoTriggerPolarity(IntEnum): + TLMC_KcubeIoTriggerPolarity_ActiveIsLogicHigh = 0x0001 + TLMC_KcubeIoTriggerPolarity_ActiveIsLogicLow = 0x0002 + + +class TLMC_KcubeMmi_JoystickDirectionSense(IntEnum): + TLMC_KcubeMmi_JoystickDirectionSense_Disabled = 0x0000 + TLMC_KcubeMmi_JoystickDirectionSense_Normal = 0x0001 + TLMC_KcubeMmi_JoystickDirectionSense_Inverted = 0x0002 + + +class TLMC_KcubeMmi_JoystickGear(IntEnum): + TLMC_KcubeMmiJoystickGear_High = 0x0001 + TLMC_KcubeMmiJoystickGear_Medium = 0x0002 + TLMC_KcubeMmiJoystickGear_Low = 0x0003 + + +class TLMC_KcubeMmi_JoystickMode(IntEnum): + TLMC_KcubeMmi_JoystickMode_ControlsVelocity = 0x0001 + TLMC_KcubeMmi_JoystickMode_Jogs = 0x0002 + TLMC_KcubeMmi_JoystickMode_GoesToPosition = 0x0003 + + +class TLMC_KcubeMmiLockState(IntEnum): + TLMC_KcubeMmiLockState_Locked = 0x01 + TLMC_KcubeMmiLockState_Unlocked = 0x02 + + +class TLMC_PZ_KpcIoTriggerMode(IntEnum): + TLMC_PZ_KpcIoTriggerMode_Disabled = 0x0000 + TLMC_PZ_KpcIoTriggerMode_GeneralPurposeInput = 0x0001 + TLMC_PZ_KpcIoTriggerMode_InputTriggersVoltagePositionStepUp = 0x0002 + TLMC_PZ_KpcIoTriggerMode_InputTriggersVoltagePositionStepDown = 0x0003 + TLMC_PZ_KpcIoTriggerMode_GeneralPurposeOutput = 0x000A + TLMC_PZ_KpcIoTriggerMode_OutputActiveStrainGaugeLessThanLowerLimit = 0x000B + TLMC_PZ_KpcIoTriggerMode_OutputActiveStrainGaugeMoreThanLowerLimit = 0x000C + TLMC_PZ_KpcIoTriggerMode_OutputActiveStrainGaugeLessThanUpperLimit = 0x000D + TLMC_PZ_KpcIoTriggerMode_OutputActiveStrainGaugeMoreThanUpperLimit = 0x000E + TLMC_PZ_KpcIoTriggerMode_OutputActiveStrainGaugeWithinLimits = 0x000F + + +class TLMC_PZ_KpcMonitorOutputMode(IntEnum): + TLMC_PZ_KpcMonitorOutputMode_Software = 0x0000 + TLMC_PZ_KpcMonitorOutputMode_HighVoltage = 0x0001 + TLMC_PZ_KpcMonitorOutputMode_Position = 0x0002 + + +class TLMC_PZ_KpcMmi_JoystickDirectionSense(IntEnum): + TLMC_PZ_KpcMmiJoystickDirectionSense_Disabled = 0x0000 + TLMC_PZ_KpcMmiJoystickDirectionSense_Normal = 0x0001 + TLMC_PZ_KpcMmiJoystickDirectionSense_Invert = 0x0002 + + +class TLMC_PZ_KpcMmi_JoystickMode(IntEnum): + TLMC_PZ_KpcMmiJoystickMode_ControlsVoltagePosition = 0x0001 + TLMC_PZ_KpcMmiJoystickMode_Jogs = 0x0002 + TLMC_PZ_KpcMmiJoystickMode_GoesToVoltagePosition = 0x0003 + + +class TLMC_PZ_KpcAnalogInputSource(IntEnum): + TLMC_PZ_KpcAnalogInputSource_Disabled = 0x0000 + TLMC_PZ_KpcAnalogInputSource_HubInputA = 0x0001 + TLMC_PZ_KpcAnalogInputSource_HubInputB = 0x0002 + TLMC_PZ_KpcAnalogInputSource_External = 0x0003 + + +class TLMC_PZ_KpcStrainGaugeOption(IntEnum): + TLMC_PZ_KpcStrainGaugeOption_Position = 0x0000 + TLMC_PZ_KpcStrainGaugeOption_Force = 0x0001 + + +class TLMC_PZ_KpcVoltageRange(IntEnum): + TLMC_PZ_KpcVoltageRange_75Volts = 0x4B + TLMC_PZ_KpcVoltageRange_150Volts = 0x96 + + +class TLMC_PZ_NanoTrakCircleDiameterMode(IntEnum): + TLMC_PZ_NanoTrakCircleDiameterModes_Software = 0x0001 + TLMC_PZ_NanoTrakCircleDiameterModes_AbsolutePower = 0x0002 + TLMC_PZ_NanoTrakCircleDiameterModes_Lut = 0x0003 + + +class TLMC_PZ_NanoTrakAbsolutePowerAdjustType(IntEnum): + TLMC_PZ_NanoTrakAbsolutePowerAdjustType_LIN = 0x0001 + TLMC_PZ_NanoTrakAbsolutePowerAdjustType_LOG = 0x0002 + TLMC_PZ_NanoTrakAbsolutePowerAdjustType_X2 = 0x0003 + TLMC_PZ_NanoTrakAbsolutePowerAdjustType_X3 = 0x0004 + + +class TLMC_PZ_NanoTrakGainControlMode(IntEnum): + TLMC_PZ_NanoTrakGainControlMode_Software = 0x02 + + +class TLMC_PZ_NanoTrakTrackingState(IntEnum): + TLMC_PZ_NanoTrakTrackingState_ModeUndefined = 0 + TLMC_PZ_NanoTrakTrackingState_TrackingOff = 1 + TLMC_PZ_NanoTrakTrackingState_LatchMode = 2 + TLMC_PZ_NanoTrakTrackingState_NoSignal = 3 + TLMC_PZ_NanoTrakTrackingState_Signal = 4 + + +class TLMC_PZ_NanoTrakTrackingMode(IntEnum): + TLMC_PZ_NanoTrakTrackingMode_DualAxisTracking = 1 + TLMC_PZ_NanoTrakTrackingMode_HorizontalAxisTracking = 2 + TLMC_PZ_NanoTrakTrackingMode_VerticalAxisTracking = 3 + + +class TLMC_PZ_NanoTrakPhaseCompensationMode(IntEnum): + TLMC_PZ_NanoTrakPhaseCompensationMode_Manual = 0x0002 + + +class TLMC_PZ_NanoTrakRangeMode(IntEnum): + TLMC_PZ_NanoTrakRangeMode_Auto = 0x0001 + TLMC_PZ_NanoTrakRangeMode_Software = 0x0002 + TLMC_PZ_NanoTrakRangeMode_SoftwareSet = 0x0003 + TLMC_PZ_NanoTrakRangeMode_AutoSet = 0x0004 + + +class TLMC_PZ_NanoTrakRangeChangeType(IntEnum): + TLMC_PZ_NanoTrakRangeChangeType_All = 0x0001 + TLMC_PZ_NanoTrakRangeChangeType_Odd = 0x0002 + TLMC_PZ_NanoTrakRangeChangeType_Even = 0x0004 + + +class TLMC_PZ_SetNanoTrakModeType(IntEnum): + TLMC_PZ_SetNanoTrakModeType_PiezoMode = 1 + TLMC_PZ_SetNanoTrakModeType_LatchMode = 2 + TLMC_PZ_SetNanoTrakModeType_TrackMode = 3 + TLMC_PZ_SetNanoTrakModeType_HorizontalTrackMode = 4 + TLMC_PZ_SetNanoTrakModeType_VerticalTrackMode = 5 + + +class TLMC_PZ_TnaIoOutRangeType(IntEnum): + TLMC_PZ_TnaIoOutRangeType_5V = 0x01 + TLMC_PZ_TnaIoOutRangeType_10V = 0x02 + + +class TLMC_PZ_TnaIoOutRouteType(IntEnum): + TLMC_PZ_TnaIoOutRouteType_SmaConnectorsOnly=0x01 + TLMC_PZ_TnaIoOutRouteType_SmaConnectorsAndHubRouting=0x02 + + +class TLMC_PZ_TnaIoSignalSourceMode(IntEnum): + TLMC_PZ_TnaIoSignalSourceMode_InternalPin = 0x00 + TLMC_PZ_TnaIoSignalSourceMode_ExternalIo1 = 0x01 + + +class TLMC_PZ_TnaIoSignalSourceBoostType(IntEnum): + TLMC_PZ_TnaIoSignalSourceBoostType_Disabled = 0x00 + TLMC_PZ_TnaIoSignalSourceBoostType_Enabled = 0x01 + + +class TLMC_PZ_TnaIoSignalOutputMode(IntEnum): + TLMC_PZ_TnaIoSignalOutputMode_Disabled = 0x00 + TLMC_PZ_TnaIoSignalOutputMode_Io2 = 0x01 + + +class TLMC_PZ_TnaIoSignalRangeType(IntEnum): + TLMC_PZ_TnaIoSignalRangeType_75V = 0x00 + TLMC_PZ_TnaIoSignalRangeType_150V = 0x01 + + +class TLMC_PZ_NanoTrakRange(IntEnum): + TLMC_PZ_NanoTrakRange_Range1 = 0x0003 + TLMC_PZ_NanoTrakRange_Range2 = 0x0004 + TLMC_PZ_NanoTrakRange_Range3 = 0x0005 + TLMC_PZ_NanoTrakRange_Range4 = 0x0006 + TLMC_PZ_NanoTrakRange_Range5 = 0x0007 + TLMC_PZ_NanoTrakRange_Range6 = 0x0008 + TLMC_PZ_NanoTrakRange_Range7 = 0x0009 + TLMC_PZ_NanoTrakRange_Range8 = 0x000A + TLMC_PZ_NanoTrakRange_Range9 = 0x000B + TLMC_PZ_NanoTrakRange_Range10 = 0x000C + TLMC_PZ_NanoTrakRange_Range11 = 0x000D + TLMC_PZ_NanoTrakRange_Range12 = 0x000E + TLMC_PZ_NanoTrakRange_Range13 = 0x000F + TLMC_PZ_NanoTrakRange_Range14 = 0x0010 + + +class TLMC_PZ_NanoTrakUnderOverReadType(IntEnum): + TLMC_PZ_NanoTrakUnderOverReadType_InRange = 0x0001 + TLMC_PZ_NanoTrakUnderOverReadType_UnderRange = 0x0002 + TLMC_PZ_NanoTrakUnderOverReadType_OverRange = 0x0003 + + +class TLMC_PZ_NanoTrakStatusBit(IntFlag): + TLMC_PZ_NanoTrakStatusBit_Tracking = 0x0001 + TLMC_PZ_NanoTrakStatusBit_TrackingWithSignal = 0x0002 + TLMC_PZ_NanoTrakStatusBit_TrackingOnlyChannelA = 0x0004 + TLMC_PZ_NanoTrakStatusBit_TrackingOnlyChannelB = 0x0008 + TLMC_PZ_NanoTrakStatusBit_AutoRange = 0x0010 + TLMC_PZ_NanoTrakStatusBit_UnderRead = 0x0020 + TLMC_PZ_NanoTrakStatusBit_OverRead = 0x0040 + TLMC_PZ_NanoTrakStatusBit_ChannelAConnected = 0x00010000 + TLMC_PZ_NanoTrakStatusBit_ChannelBConnected = 0x00020000 + TLMC_PZ_NanoTrakStatusBit_ChannelAEnabled = 0x00040000 + TLMC_PZ_NanoTrakStatusBit_ChannelBEnabled = 0x00080000 + TLMC_PZ_NanoTrakStatusBit_ChannelAControlMode = 0x00100000 + TLMC_PZ_NanoTrakStatusBit_ChannelBControlMode = 0x00200000 + + +class TLMC_LcdKnobMode(IntEnum): + TLMC_LcdKnobMode_Velocity = 0x0001 + TLMC_LcdKnobMode_Jog = 0x0002 + + +class TLMC_LogLevel(IntEnum): + TLMC_LogLevel_Critical = 0x0002 + TLMC_LogLevel_Error = 0x0003 + TLMC_LogLevel_Warning = 0x0004 + TLMC_LogLevel_Information = 0x0005 + + +class TLMC_LogCatagoryFilter(IntEnum): + TLMC_LogCategoryFilter_User = 0x00000001 + TLMC_LogCategoryFilter_Internal = 0x00000002 + TLMC_LogCategoryFilter_Communication = 0x00000004 + TLMC_LogCategoryFilter_NativeApi = 0x00000008 + TLMC_LogCategoryFilter_All = 0xFFFFFFFF + + +class TLMC_MoveMode(IntEnum): + TLMC_MoveMode_Absolute = 0 + TLMC_MoveMode_AbsoluteToProgrammedPosition = auto() + TLMC_MoveMode_Relative = auto() + TLMC_MoveMode_RelativeByProgrammedDistance = auto() + TLMC_MoveMode_ContinuousForward = auto() + TLMC_MoveMode_ContinuousReverse = auto() + TLMC_MoveMode_JogForward = auto() + TLMC_MoveMode_JogReverse = auto() + +class TLMC_MoveDirection(IntEnum): + Move_Direction_Forward = 0 + Move_Direction_Reverse = 1 + +class TLMC_NotificationId(IntEnum): + TLMC_NotificationId_AnalogMonitorConfigurationParamsChanged = 0 + TLMC_NotificationId_AuxIoPortModeChanged = 1 + TLMC_NotificationId_AuxIoSoftwareStatesChanged = 2 + TLMC_NotificationId_BowIndexChanged = 3 + TLMC_NotificationId_CurrentLoopParamsChanged = 4 + TLMC_NotificationId_DcPidParamsChanged = 5 + TLMC_NotificationId_DigitalInputsChanged = 6 + TLMC_NotificationId_DigitalOutputsChanged = 7 + TLMC_NotificationId_EncoderCounterChanged = 8 + TLMC_NotificationId_GeneralMoveParamsChanged = 9 + TLMC_NotificationId_HardwareInfoChanged = 10 + TLMC_NotificationId_HomeParamsChanged = 11 + TLMC_NotificationId_IoConfigurationParamsChanged = 12 + TLMC_NotificationId_IoPositionTriggerEnableStateChanged = 13 + TLMC_NotificationId_IoTriggerParamsChanged = 14 + TLMC_NotificationId_JogParamsChanged = 15 + TLMC_NotificationId_JoystickParamsChanged = 16 + TLMC_NotificationId_KcubeIoTriggerParamsChanged = 17 + TLMC_NotificationId_KcubeMmiLockStateChanged = 18 + TLMC_NotificationId_KcubeMmiParamsChanged = 19 + TLMC_NotificationId_KcubePositionTriggerParamsChanged = 20 + TLMC_NotificationId_LcdDisplayParamsChanged = 21 + TLMC_NotificationId_LcdMoveParamsChanged = 22 + TLMC_NotificationId_LimitSwitchParamsChanged = 23 + TLMC_NotificationId_MotorOutputParamsChanged = 24 + TLMC_NotificationId_MoveAbsoluteParamsChanged = 25 + TLMC_NotificationId_MoveRelativeParamsChanged = 26 + TLMC_NotificationId_PiezoMaxOutputVoltageParamsChanged = 27 + TLMC_NotificationId_PiezoMaxTravelChanged = 28 + TLMC_NotificationId_PiezoOutputVoltageChanged = 29 + TLMC_NotificationId_PiezoOutputVoltageControlSourceChanged = 30 + TLMC_NotificationId_PiezoOutputWaveformParamsChanged = 31 + TLMC_NotificationId_PiezoPositionChanged = 32 + TLMC_NotificationId_PiezoPositionControlModeChanged = 33 + TLMC_NotificationId_PiezoPositionLoopParamsChanged = 34 + TLMC_NotificationId_PiezoSlewRateParamsChanged = 35 + TLMC_NotificationId_PiezoStatusChanged = 36 + TLMC_NotificationId_PiezoStatusBitsChanged = 37 + TLMC_NotificationId_PositionCounterChanged = 38 + TLMC_NotificationId_PositionLoopParamsChanged = 39 + TLMC_NotificationId_PowerParamsChanged = 40 + TLMC_NotificationId_ProfileModeParamsChanged = 41 + TLMC_NotificationId_RichResponseChanged = 42 + TLMC_NotificationId_StageAxisParamsChanged = 43 + TLMC_NotificationId_StepperStatusChanged = 44 + TLMC_NotificationId_TrackSettleParamsChanged = 45 + TLMC_NotificationId_TriggerParamsForDcBrushlessChanged = 46 + TLMC_NotificationId_UniversalStatusChanged = 47 + TLMC_NotificationId_UniversalStatusBitsChanged = 48 + TLMC_NotificationId_VelocityParamsChanged = 49 + TLMC_NotificationId_StatusItemChanged = 50 + TLMC_NotificationId_SettingItemChanged = 51 + TLMC_NotificationId_ConnectedProductChanged = 52 + TLMC_NotificationId_StepperLoopParamsChanged = 53 + TLMC_NotificationId_AdcInputsChanged = 54 + TLMC_NotificationId_TriggerParamsForStepperChanged = 55 + TLMC_NotificationId_ResponseChanged = 56 + TLMC_NotificationId_ButtonParamsChanged = 57 + TLMC_NotificationId_PotentiometerParamsChanged = 58 + TLMC_NotificationId_CalibrationStateChanged = 59 + TLMC_NotificationId_PiezoKpcIoSettingsChanged = 60 + TLMC_NotificationId_PiezoKpcIoTriggerParamsChanged = 61 + TLMC_NotificationId_PiezoKpcMmiParamsChanged = 62 + + +class TLMC_OperatingMode(IntFlag): + TLMC_OperatingMode_StatusPushedByController = 0x00000000 + TLMC_OperatingMode_ManualStatusPolling = 0x00000001 + TLMC_OperatingMode_AutomaticStatusPolling = 0x00000002 + TLMC_OperatingMode_DoNotChangeStatusPollingMode = 0x00000004 + TLMC_OperatingMode_SendEndOfMoveMessages = 0x00000100 + TLMC_OperatingMode_DoNotSendEndOfMoveMessages = 0x00000200 + TLMC_OperatingMode_DoNotLoadParamsOnConnect = 0x00010000 + TLMC_OperatingMode_DoNotSendDisconnectOnFinalClose = 0x00020000 + TLMC_OperatingMode_DoNotAutoSetConnectedProduct = 0x00040000 + TLMC_OperatingMode_DoNotSendNoFlashProgrammingOnConnect = 0x00080000 + TLMC_OperatingMode_Apt = (TLMC_OperatingMode_StatusPushedByController | TLMC_OperatingMode_SendEndOfMoveMessages) + TLMC_OperatingMode_Kinesis = (TLMC_OperatingMode_AutomaticStatusPolling | TLMC_OperatingMode_SendEndOfMoveMessages) + TLMC_OperatingMode_Default = TLMC_OperatingMode_Apt + TLMC_OperatingMode_Expert = ( + TLMC_OperatingMode_DoNotChangeStatusPollingMode | TLMC_OperatingMode_DoNotLoadParamsOnConnect | + TLMC_OperatingMode_DoNotSendDisconnectOnFinalClose | TLMC_OperatingMode_DoNotAutoSetConnectedProduct) + + +class TLMC_ParameterGroupId(IntEnum): + TLMC_ParameterGroupId_Unspecified = 0x0000 + TLMC_ParameterGroupId_JogParams = 0x0416 + TLMC_ParameterGroupId_LimitSwitchParams = 0x0423 + TLMC_ParameterGroupId_GenMoveParams = 0x043A + TLMC_ParameterGroupId_HomeParams = 0x0440 + TLMC_ParameterGroupId_JoystickParams = 0x04E6 + TLMC_ParameterGroupId_BowIndex = 0x04F4 + TLMC_ParameterGroupId_StepperLoopParams = 0x0529 + + +class TLMC_PositionLoopScenario(IntEnum): + TLMC_PositionLoopScenario_Single = 0x0000 + TLMC_PositionLoopScenario_Stationary = 0x0001 + TLMC_PositionLoopScenario_Accelerating = 0x0002 + TLMC_PositionLoopScenario_AtConstantVelocity = 0x0003 + + +class TLMC_ProfileMode(IntEnum): + TLMC_ProfileMode_Trapezoidal = 0x0000 + TLMC_ProfileMode_VelocityContouring = 0x0001 + TLMC_ProfileMode_SCurve = 0x0002 + TLMC_ProfileMode_ElectronicGear = 0x0003 + + +class TLMC_PZ_OutputVoltageControlSource(IntEnum): + TLMC_PZ_OutputVoltageControlSource_SoftwareOnly = 0x0000 + TLMC_PZ_OutputVoltageControlSource_ExternalSignal = 0x0001 + TLMC_PZ_OutputVoltageControlSource_Knob = 0x0002 + + +class TLMC_PZ_OutputWaveformOperatingMode(IntEnum): + TLMC_PZ_OutputWaveformOperatingMode_Continuous = 0x0001 + TLMC_PZ_OutputWaveformOperatingMode_FixedNumberOfCycles = 0x0002 + TLMC_PZ_OutputWaveformOperatingMode_OutputTriggerEnabled = 0x0004 + TLMC_PZ_OutputWaveformOperatingMode_InputTriggerEnabled = 0x0008 + TLMC_PZ_OutputWaveformOperatingMode_OutputTriggerRisingEdge = 0x0010 + TLMC_PZ_OutputWaveformOperatingMode_InputTriggerRisingEdge = 0x0020 + TLMC_PZ_OutputWaveformOperatingMode_OutputGated = 0x0040 + TLMC_PZ_OutputWaveformOperatingMode_TriggerRepeats = 0x0080 + + +class TLMC_PZ_PositionControlMode(IntEnum): + TLMC_PZ_PositionControlMode_OpenLoop = 0x01 + TLMC_PZ_PositionControlMode_ClosedLoop = 0x02 + TLMC_PZ_PositionControlMode_OpenLoopSmooth = 0x03 + TLMC_PZ_PositionControlMode_ClosedLoopSmooth = 0x04 + + +class TLMC_PZ_StatusBit(IntFlag): + TLMC_PZ_StatusBit_ActuatorConnected = 0x00000001 + TLMC_PZ_StatusBit_Zeroed = 0x00000010 + TLMC_PZ_StatusBit_Zeroing = 0x00000020 + TLMC_PZ_StatusBit_ExternalStrainGaugeConnected = 0x00000100 + TLMC_PZ_StatusBit_ClosedLoopPositionControl = 0x00000400 + TLMC_PZ_StatusBit_MaxOutputVoltageLow = 0x00001000 + TLMC_PZ_StatusBit_PositionUnderTravel = 0x00001000 + TLMC_PZ_StatusBit_MaxOutputVoltageMedium = 0x00002000 + TLMC_PZ_StatusBit_PositionOverTravel = 0x00002000 + TLMC_PZ_StatusBit_MaxOutputVoltageHigh = 0x00004000 + TLMC_PZ_StatusBit_DigitalInput1 = 0x00100000 + TLMC_PZ_StatusBit_DigitalInput2 = 0x00200000 + TLMC_PZ_StatusBit_DigitalInput3 = 0x00400000 + TLMC_PZ_StatusBit_DigitalInput4 = 0x00800000 + TLMC_PZ_StatusBit_DigitalInput5 = 0x01000000 + TLMC_PZ_StatusBit_DigitalInput6 = 0x02000000 + TLMC_PZ_StatusBit_DigitalInput7 = 0x04000000 + TLMC_PZ_StatusBit_DigitalInput8 = 0x08000000 + TLMC_PZ_StatusBit_PowerOk = 0x10000000 + TLMC_PZ_StatusBit_Active = 0x20000000 + TLMC_PZ_StatusBit_Error = 0x40000000 + TLMC_PZ_StatusBit_Enabled = 0x80000000 + + +class TLMC_PZ_VoltageLimit(IntEnum): + TLMC_PZ_VoltageLimit_75Volts = 0x0002 + TLMC_PZ_VoltageLimit_100Volts = 0x0004 + TLMC_PZ_VoltageLimit_150Volts = 0x0008 + + +class TLMC_RackBayNumber(IntEnum): + TLMC_RackBayNumber_1 = 0x0000 + TLMC_RackBayNumber_2 = 0x0001 + TLMC_RackBayNumber_3 = 0x0002 + TLMC_RackBayNumber_4 = 0x0003 + TLMC_RackBayNumber_5 = 0x0004 + TLMC_RackBayNumber_6 = 0x0005 + TLMC_RackBayNumber_7 = 0x0006 + TLMC_RackBayNumber_8 = 0x0007 + TLMC_RackBayNumber_9 = 0x0008 + TLMC_RackBayNumber_10 = 0x0009 + TLMC_RackBayNumber_11 = 0x000A + TLMC_RackBayNumber_12 = 0x000B + + +class TLMC_RackBayOccupiedState(IntEnum): + TLMC_RackBayState_Occupied = 0x0001 + TLMC_RackBayState_Empty = 0x0002 + + +class TLMC_ResultCode(IntEnum): + TLMC_Success = 0 + TLMC_FunctionNotSupported = 1 + TLMC_DeviceNotFound = 2 + TLMC_DeviceNotSupported = 3 + TLMC_Timeout = 4 + TLMC_Fail = 5 + TLMC_InsufficientFirmware = 6 + TLMC_AlreadyStarted = 7 + TLMC_StartRequired = 8 + TLMC_AllocationError = 9 + TLMC_InternalError = 10 + TLMC_InvalidHandle = 11 + TLMC_InvalidArgument = 12 + TLMC_ItemIsReadOnly = 13 + TLMC_LoadParamsError = 14 + TLMC_TransportError = 15 + TLMC_TransportClosed = 16 + TLMC_TransportNotAvailable = 17 + TLMC_SharingModeNotAvailable = 18 + TLMC_NotInitialized = 19 + TLMC_NoFreeHandles = 20 + TLMC_VerificationFailure = 21 + TLMC_DataNotLoaded = 22 + TLMC_ConnectedProductNotSupported = 23 + TLMC_SimulationCreationError = 24 + TLMC_ConnectedProductNotSet = 25 + TLMC_CalibrationFileNotPresent = 26 + + +class TLMC_ScaleType(IntEnum): + TLMC_ScaleType_None = 0 + TLMC_ScaleType_Distance = 1 + TLMC_ScaleType_Velocity = 2 + TLMC_ScaleType_Acceleration = 3 + TLMC_ScaleType_Voltage = 4 + TLMC_ScaleType_Brightness = 5 + TLMC_ScaleType_Time = 6 + TLMC_ScaleType_Deceleration = 7 + TLMC_ScaleType_Jerk = 8 + TLMC_ScaleType_RescaledProportion = 9 + TLMC_ScaleType_SlewRate = 10 + TLMC_ScaleType_Force = 11 + TLMC_ScaleType_NormalizedStrainGauge = 12 + TLMC_ScaleType_RescaledVoltage = 13 + TLMC_ScaleType_RescaledDistance = 14 + + +class TLMC_SettingStringFormat(IntEnum): + TLMC_SettingStringFormat_SemiStructured = 0 + TLMC_SettingStringFormat_Json = 1 + + +class TLMC_SoftLimitOperatingMode(IntEnum): + TLMC_SoftLimitOperatingMode_FeatureNotSupported = 0x0000 + TLMC_SoftLimitOperatingMode_Ignored = 0x0001 + TLMC_SoftLimitOperatingMode_StopImmediate = 0x0002 + TLMC_SoftLimitOperatingMode_StopProfiled = 0x0003 + TLMC_SoftLimitOperatingMode_RestrictMoves = 0x0004 + TLMC_SoftLimitOperatingMode_FilterWheelConnected = 0x0040 + TLMC_SoftLimitOperatingMode_RotationStageLimit = 0x0080 + + +class TLMC_StageAxis_AxisId(IntEnum): + TLMC_StageAxisId_Unknown = 0x0001 + TLMC_StageAxisId_Rotary = 0x0003 + TLMC_StageAxisId_X = 0x0010 + TLMC_StageAxisId_Y = 0x0011 + TLMC_StageAxisId_Single = 0x0012 + + +class TLMC_StageAxis_TypeId(IntEnum): + TLMC_StageAxisType_Unknown = 0x0001 + TLMC_StageAxisType_MLS203_X = 0x0010 + TLMC_StageAxisType_MLS203_Y = 0x0011 + TLMC_StageAxisType_DDS = 0x0012 + TLMC_StageAxisType_DDR = 0x0075 + + +class TLMC_StatusItemId(IntEnum): + TLMC_StatusItemId_Active = 0 + TLMC_StatusItemId_ActuatorConnected = 1 + TLMC_StatusItemId_BusOvercurrent = 2 + TLMC_StatusItemId_BusCurrentFault = 3 + TLMC_StatusItemId_BusVoltageFault = 4 + TLMC_StatusItemId_ClockwiseHardLimit = 5 + TLMC_StatusItemId_CounterclockwiseHardLimit = 6 + TLMC_StatusItemId_ClockwiseSoftLimit = 7 + TLMC_StatusItemId_CommutationError = 8 + TLMC_StatusItemId_Connected = 9 + TLMC_StatusItemId_CounterclockwiseSoftLimit = 10 + TLMC_StatusItemId_ClosedLoopPositionControl = 11 + TLMC_StatusItemId_DigitalInput1 = 12 + TLMC_StatusItemId_DigitalInput2 = 13 + TLMC_StatusItemId_DigitalInput3 = 14 + TLMC_StatusItemId_DigitalInput4 = 15 + TLMC_StatusItemId_DigitalInput5 = 16 + TLMC_StatusItemId_DigitalInput6 = 17 + TLMC_StatusItemId_DigitalInput7 = 18 + TLMC_StatusItemId_DigitalInput8 = 19 + TLMC_StatusItemId_E2PROMFailure = 20 + TLMC_StatusItemId_Enabled = 21 + TLMC_StatusItemId_EncoderCount = 22 + TLMC_StatusItemId_EncoderFault = 23 + TLMC_StatusItemId_Error = 24 + TLMC_StatusItemId_ExternalStrainGaugeConnected = 25 + TLMC_StatusItemId_Homing = 26 + TLMC_StatusItemId_HomingFailed = 27 + TLMC_StatusItemId_Homed = 28 + TLMC_StatusItemId_Initializing = 29 + TLMC_StatusItemId_InstrumentError = 30 + TLMC_StatusItemId_Interlock = 31 + TLMC_StatusItemId_IonBusVoltage = 32 + TLMC_StatusItemId_IonInstructionError = 33 + TLMC_StatusItemId_IonCommutationError = 34 + TLMC_StatusItemId_IonOvercurrent = 35 + TLMC_StatusItemId_IonOvertemperature = 36 + TLMC_StatusItemId_IonReceiveTimeout = 37 + TLMC_StatusItemId_IonInterlockOpen = 38 + TLMC_StatusItemId_IonPhaseInitializationFailed = 39 + TLMC_StatusItemId_JoggingClockwise = 40 + TLMC_StatusItemId_JoggingCounterclockwise = 41 + TLMC_StatusItemId_MotorCurrent = 42 + TLMC_StatusItemId_MotorOvercurrent = 43 + TLMC_StatusItemId_MovingClockwise = 44 + TLMC_StatusItemId_MovingCounterclockwise = 45 + TLMC_StatusItemId_OutputVoltage = 46 + TLMC_StatusItemId_Overcurrent = 47 + TLMC_StatusItemId_Overload = 48 + TLMC_StatusItemId_Overtemperature = 49 + TLMC_StatusItemId_PhaseInitializationFailure = 50 + TLMC_StatusItemId_Position = 51 + TLMC_StatusItemId_PositionError = 52 + TLMC_StatusItemId_PowerOk = 53 + TLMC_StatusItemId_Settled = 54 + TLMC_StatusItemId_Tracking = 55 + TLMC_StatusItemId_UnrecognisedError = 56 + TLMC_StatusItemId_Velocity = 57 + TLMC_StatusItemId_VelocityLimitExceeded = 58 + TLMC_StatusItemId_Zeroed = 59 + TLMC_StatusItemId_Zeroing = 60 + TLMC_StatusItemId_PositionUnderTravel = 61 + TLMC_StatusItemId_PositionOverTravel = 62 + TLMC_StatusItemId_ZeroingFailure = 63 + + +class TLMC_StatusItemValue(IntEnum): + TLMC_ValueType_int = 0 + TLMC_ValueType_bool = 1 + TLMC_ValueType_string = 2 + + +class TLMC_StepperStatusBit(IntEnum): + TLMC_StepperStatusBit_ClockwiseHardLimit = 0x00000001 + TLMC_StepperStatusBit_CounterclockwiseHardLimit = 0x00000002 + TLMC_StepperStatusBit_MovingClockwise = 0x00000010 + TLMC_StepperStatusBit_MovingCounterclockwise = 0x00000020 + TLMC_StepperStatusBit_JoggingClockwise = 0x00000040 + TLMC_StepperStatusBit_JoggingCounterclockwise = 0x00000080 + TLMC_StepperStatusBit_Homing = 0x00000200 + TLMC_StepperStatusBit_Homed = 0x00000400 + TLMC_StepperStatusBit_DigitalInput1 = 0x00100000 + TLMC_StepperStatusBit_DigitalInput2 = 0x00200000 + TLMC_StepperStatusBit_Enabled = 0x80000000 + + +class TLMC_StepperLoopParams_LoopMode(IntEnum): + TLMC_StepperLoopParams_LoopMode_Open = 0x0001 + TLMC_StepperLoopParams_LoopMode_Closed = 0x0002 + + +class TLMC_StopMode(IntEnum): + TLMC_StopMode_Immediate = 1 + TLMC_StopMode_Profiled = 2 + + +class TLMC_TriggerModesForDcBrushless(IntEnum): + TLMC_TriggerModesForDcBrushless_InputActiveIsLogicHigh = 0x01 + TLMC_TriggerModesForDcBrushless_InputTriggersRelativeMove = 0x02 + TLMC_TriggerModesForDcBrushless_InputTriggersAbsoluteMove = 0x04 + TLMC_TriggerModesForDcBrushless_InputTriggersHomeMove = 0x08 + TLMC_TriggerModesForDcBrushless_OutputActiveIsLogicHigh = 0x10 + TLMC_TriggerModesForDcBrushless_OutputActiveDuringMotion = 0x20 + TLMC_TriggerModesForDcBrushless_OutputActiveWhenMotionComplete = 0x40 + TLMC_TriggerModesForDcBrushless_OutputActiveAtMaxVelocity = 0x80 + + +class TLMC_TriggerModesForStepper(IntEnum): + TLMC_TriggerModesForStepper_None = 0x00 + TLMC_TriggerModesForStepper_InputTriggerEnabled = 0x01 + TLMC_TriggerModesForStepper_OutputTriggerEnabled = 0x02 + TLMC_TriggerModesForStepper_OutputTriggerFollowsInputTrigger = 0x04 + TLMC_TriggerModesForStepper_OutputActiveUntilMoveEnd = 0x08 + TLMC_TriggerModesForStepper_InputTriggersRelativeMove = 0x10 + TLMC_TriggerModesForStepper_InputTriggersAbsoluteMove = 0x20 + TLMC_TriggerModesForStepper_InputTriggersHomeMove = 0x40 + TLMC_TriggerModesForStepper_OutputTriggerSoftwareInitiated = 0x80 + + +class TLMC_Unit(IntEnum): + TLMC_Unit_Unspecified = 0 + TLMC_Unit_Millimetres = 1 + TLMC_Unit_Degrees = 2 + TLMC_Unit_Radians = 3 + TLMC_Unit_Cycles = 4 + TLMC_Unit_Micrometres = 5 + TLMC_Unit_Volts = 6 + TLMC_Unit_EncoderCounts = 7 + TLMC_Unit_EncoderCountsPerCycle = 8 + TLMC_Unit_EncoderCountsPerCyclePerCycle = 9 + TLMC_Unit_Minutes = 10 + TLMC_Unit_Microseconds = 11 + TLMC_Unit_MillimetresPerSecondPerSecondPerSecond = 12 + TLMC_Unit_Percentage = 13 + TLMC_Unit_VoltsPerMillisecond = 14 + TLMC_Unit_Milliseconds = 15 + TLMC_Unit_Hertz = 16 + TLMC_Unit_Newtons = 17 + + +class TLMC_UniversalStatusBit(IntFlag): + TLMC_UniversalStatusBit_ClockwiseHardLimit = 0x00000001 + TLMC_UniversalStatusBit_CounterclockwiseHardLimit = 0x00000002 + TLMC_UniversalStatusBit_ClockwiseSoftLimit = 0x00000004 + TLMC_UniversalStatusBit_CounterclockwiseSoftLimit = 0x00000008 + TLMC_UniversalStatusBit_MovingClockwise = 0x00000010 + TLMC_UniversalStatusBit_MovingCounterclockwise = 0x00000020 + TLMC_UniversalStatusBit_JoggingClockwise = 0x00000040 + TLMC_UniversalStatusBit_JoggingCounterclockwise = 0x00000080 + TLMC_UniversalStatusBit_Connected = 0x00000100 + TLMC_UniversalStatusBit_Homing = 0x00000200 + TLMC_UniversalStatusBit_Homed = 0x00000400 + TLMC_UniversalStatusBit_Initializing = 0x00000800 + TLMC_UniversalStatusBit_Tracking = 0x00001000 + TLMC_UniversalStatusBit_Settled = 0x00002000 + TLMC_UniversalStatusBit_PositionError = 0x00004000 + TLMC_UniversalStatusBit_InstrumentError = 0x00008000 + TLMC_UniversalStatusBit_Interlock = 0x00010000 + TLMC_UniversalStatusBit_Overtemperature = 0x00020000 + TLMC_UniversalStatusBit_BusVoltageFault = 0x00040000 + TLMC_UniversalStatusBit_CommutationError = 0x00080000 + TLMC_UniversalStatusBit_DigitalInput1 = 0x00100000 + TLMC_UniversalStatusBit_DigitalInput2 = 0x00200000 + TLMC_UniversalStatusBit_DigitalInput3 = 0x00400000 + TLMC_UniversalStatusBit_DigitalInput4 = 0x00800000 + TLMC_UniversalStatusBit_Overload = 0x01000000 + TLMC_UniversalStatusBit_EncoderFault = 0x02000000 + TLMC_UniversalStatusBit_Overcurrent = 0x04000000 + TLMC_UniversalStatusBit_BusCurrentFault = 0x08000000 + TLMC_UniversalStatusBit_PowerOk = 0x10000000 + TLMC_UniversalStatusBit_Active = 0x20000000 + TLMC_UniversalStatusBit_Error = 0x40000000 + TLMC_UniversalStatusBit_Enabled = 0x80000000 + + +class TLMC_ValueType(IntEnum): + TLMC_ValueType_int64 = 0 + TLMC_ValueType_bool = 1 + TLMC_ValueType_string = 2 + + +class TLMC_Wait(IntEnum): + TLMC_NoWait = 0 + TLMC_InfiniteWait = -1 + TLMC_Unused = 0 \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/map_native_to_python.py b/Python/XA/src/thorlabs_xa/shared/map_native_to_python.py new file mode 100644 index 0000000..df094b3 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/map_native_to_python.py @@ -0,0 +1,753 @@ +import ctypes + +from typing import TypeAlias, Union + +from thorlabs_xa.shared.c_params import C_TLMC_AdcInputs, C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ApiVersion, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_DeviceInfo, C_TLMC_FirmwareVersion, C_TLMC_GeneralMoveParams, C_TLMC_HardwareInfo, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_MaxOutputVoltageParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakStatus, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PZ_Status, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_RichResponse, C_TLMC_Setting, C_TLMC_StageAxisParams, C_TLMC_StatusItem, C_TLMC_StepperLoopParams, C_TLMC_StepperStatus, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_UniversalStatus, C_TLMC_VelocityParams +from thorlabs_xa.shared.params import TLMC_AdcInputs, TLMC_AnalogMonitorConfigurationParams, TLMC_ApiVersion, TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_CurrentLoopParams, TLMC_DcPidParams, TLMC_DeviceInfo, TLMC_FirmwareVersion, TLMC_GeneralMoveParams, TLMC_HardwareInfo, TLMC_HomeParams, TLMC_IoConfigurationParams, TLMC_IoTriggerParams, TLMC_JogParams, TLMC_JoystickParams, TLMC_KcubeIoTriggerParams, TLMC_KcubeMmiParams, TLMC_KcubePositionTriggerParams, TLMC_LcdDisplayParams, TLMC_LcdMoveParams, TLMC_LimitSwitchParams, TLMC_MotorOutputParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_MaxOutputVoltageParams, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakStatus, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_PZ_NanoTrakTrackThresholdParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_SlewRateParams, TLMC_PZ_Status, TLMC_PositionLoopParams, TLMC_PotentiometerParams, TLMC_PowerParams, TLMC_ProfileModeParams, TLMC_RichResponse, TLMC_Setting, TLMC_StageAxisParams, TLMC_StatusItem, TLMC_StepperLoopParams, TLMC_StepperStatus, TLMC_TrackSettleParams, TLMC_TriggerParamsForDcBrushless, TLMC_TriggerParamsForStepper, TLMC_UniversalStatus, TLMC_VelocityParams + +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorMotorChannel, TLMC_AnalogMonitorSystemVariable, TLMC_ButtonMode, TLMC_ConnectedProductAxisType, TLMC_ConnectedProductMovementType, TLMC_CurrentLoopPhase, TLMC_DeviceFamily, TLMC_DeviceType, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_IoPortMode, TLMC_IoPortSource, TLMC_JogMode, TLMC_JogStopMode, TLMC_JoystickDirectionSense, TLMC_KcubeIoTriggerMode, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickDirectionSense, TLMC_KcubeMmi_JoystickGear, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_NanoTrakAbsolutePowerAdjustType, TLMC_PZ_NanoTrakCircleDiameterMode, TLMC_PZ_NanoTrakGainControlMode, TLMC_PZ_NanoTrakPhaseCompensationMode, TLMC_PZ_NanoTrakRange, TLMC_PZ_NanoTrakRangeChangeType, TLMC_PZ_NanoTrakRangeMode, TLMC_PZ_NanoTrakStatusBit, TLMC_PZ_NanoTrakTrackingMode, TLMC_PZ_NanoTrakTrackingState, TLMC_PZ_NanoTrakUnderOverReadType, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_StatusBit, TLMC_PZ_TnaIoSignalOutputMode, TLMC_PZ_TnaIoSignalRangeType, TLMC_PZ_TnaIoSignalSourceBoostType, TLMC_PZ_TnaIoSignalSourceMode, TLMC_PZ_VoltageLimit, TLMC_ScaleType, TLMC_SoftLimitOperatingMode, TLMC_StageAxis_AxisId, TLMC_StageAxis_TypeId, TLMC_StatusItemId, TLMC_StepperLoopParams_LoopMode, TLMC_TriggerModesForDcBrushless, TLMC_TriggerModesForStepper, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_ValueType + +BufLike: TypeAlias = ( + ctypes.Array[ctypes.c_char] + | ctypes.Array[ctypes.c_wchar] + | ctypes.c_char_p + | ctypes.c_wchar_p +) + +class MapNativeToPython: + + @staticmethod + def string(arr: BufLike) -> str: + buffer = bytes(arr) + buffer = buffer.split(b"\x00", 1)[0] + + return buffer.decode("utf-8", errors="replace") + + @staticmethod + def int(arr: Union[bytes, bytearray, ctypes.Array[ctypes.c_uint8]]) -> int: + b = bytes(arr) + return ctypes.c_uint64(int.from_bytes(b, "little")).value + + @staticmethod + def bool(value: Union[bytes, bytearray]) -> bool: + return bool(value[0]) if value else False + + @staticmethod + def adc_inputs(c_params: C_TLMC_AdcInputs) -> TLMC_AdcInputs: + + params = TLMC_AdcInputs() + params.adc_input_1 = c_params.adcInput1 + params.adc_input_2 = c_params.adcInput2 + + return params + + @staticmethod + def analog_monitor_configuration_params(c_params: C_TLMC_AnalogMonitorConfigurationParams) -> TLMC_AnalogMonitorConfigurationParams: + + params = TLMC_AnalogMonitorConfigurationParams() + params.motor_channel = TLMC_AnalogMonitorMotorChannel(c_params.motorChannel) + params.system_variable = TLMC_AnalogMonitorSystemVariable(c_params.systemVariable) + params.scale = c_params.scale + params.offset = c_params.offset + + return params + + @staticmethod + def api_version(c_params: C_TLMC_ApiVersion) -> TLMC_ApiVersion: + + params = TLMC_ApiVersion() + params.major = c_params.major + params.minor = c_params.minor + params.patch = c_params.patch + params.build = c_params.build + params.prerelease_label = MapNativeToPython.string(c_params.prereleaseLabel) + params.display_string = MapNativeToPython.string(c_params.displayString) + + return params + + @staticmethod + def button_params(c_params: C_TLMC_ButtonParams) -> TLMC_ButtonParams: + + params = TLMC_ButtonParams() + params.button_mode = TLMC_ButtonMode(c_params.buttonMode) + params.position_1 = c_params.position1 + params.position_2 = c_params.position2 + params.timeout_1_milliseconds = c_params.timeout1Milliseconds + params.timeout_2_milliseconds = c_params.timeout2Milliseconds + + return params + + @staticmethod + def connected_product_info(c_params: C_TLMC_ConnectedProductInfo) -> TLMC_ConnectedProductInfo: + + params = TLMC_ConnectedProductInfo() + params.product_name = MapNativeToPython.string(c_params.productName) + params.part_number = MapNativeToPython.string(c_params.partNumber) + params.axis_type = TLMC_ConnectedProductAxisType(c_params.axisType) + params.movement_type = TLMC_ConnectedProductMovementType(c_params.movementType) + params.unit_type = TLMC_Unit(c_params.unitType) + params.distance_scale_factor = c_params.distanceScaleFactor + params.velocity_scale_factor = c_params.velocityScaleFactor + params.acceleration_scale_factor = c_params.accelerationScaleFactor + params.min_position = c_params.minPosition + params.max_position = c_params.maxPosition + params.max_velocity = c_params.maxVelocity + params.max_acceleration = c_params.maxAcceleration + + return params + + @staticmethod + def current_loop_params(c_params: C_TLMC_CurrentLoopParams) -> TLMC_CurrentLoopParams: + + params = TLMC_CurrentLoopParams() + params.phase = TLMC_CurrentLoopPhase(c_params.phase) + params.proportional = c_params.proportional + params.integral_limit = c_params.integralLimit + params.integral_dead_band = c_params.integralDeadBand + params.feed_forward = c_params.feedForward + + return params + + @staticmethod + def dc_pid_params(c_params: C_TLMC_DcPidParams) -> TLMC_DcPidParams: + + params = TLMC_DcPidParams() + params.proportional = c_params.proportional + params.integral = c_params.integral + params.derivative = c_params.derivative + params.integral_limit = c_params.integralLimit + params.filter_control = c_params.filterControl + + return params + + @staticmethod + def device_info(c_params: C_TLMC_DeviceInfo) -> TLMC_DeviceInfo: + + params = TLMC_DeviceInfo() + params.device_family = TLMC_DeviceFamily(c_params.deviceFamily) + params.device_type = TLMC_DeviceType(c_params.deviceType) + params.part_number = MapNativeToPython.string(c_params.partNumber) + params.device = MapNativeToPython.string(c_params.device) + params.transport = MapNativeToPython.string(c_params.transport) + params.parent_device = MapNativeToPython.string(c_params.parentDevice) + params.device_type_description = MapNativeToPython.string(c_params.deviceTypeDescription) + + return params + + @staticmethod + def firmware_version(c_params: C_TLMC_FirmwareVersion) -> TLMC_FirmwareVersion: + + params = TLMC_FirmwareVersion() + + params.major_version = c_params.majorVersion + params.interim_version = c_params.interimVersion + params.minor_version = c_params.minorVersion + + return params + + @staticmethod + def general_move_params(c_params: C_TLMC_GeneralMoveParams) -> TLMC_GeneralMoveParams: + + params = TLMC_GeneralMoveParams() + params.backlash_distance = c_params.backlashDistance + + return params + + @staticmethod + def hardware_info(c_params: C_TLMC_HardwareInfo) -> TLMC_HardwareInfo: + + params = TLMC_HardwareInfo() + params.serial_number = c_params.serialNumber + params.part_number = MapNativeToPython.string(c_params.partNumber) + params.type = c_params.type + params.firmware_version = MapNativeToPython.firmware_version(c_params.firmwareVersion) + params.notes = MapNativeToPython.string(c_params.notes) + params.device_dependent_data = MapNativeToPython.string(c_params.deviceDependantData) + params.hardware_version = c_params.hardwareVersion + params.modification_state = c_params.modificationState + params.number_of_channels = c_params.numChannels + + return params + + @staticmethod + def home_params(c_params: C_TLMC_HomeParams) -> TLMC_HomeParams: + + params = TLMC_HomeParams() + params.direction = TLMC_HomeDirection(c_params.direction) + params.limit_switch = TLMC_HomeLimitSwitch(c_params.limitSwitch) + params.offset_distance = c_params.offsetDistance + params.velocity = c_params.velocity + + return params + + @staticmethod + def io_configuration_params(c_params: C_TLMC_IoConfigurationParams) -> TLMC_IoConfigurationParams: + + params = TLMC_IoConfigurationParams() + params.mode = TLMC_IoPortMode(c_params.mode) + params.trigger_out_source = TLMC_IoPortSource(c_params.triggerOutSource) + + return params + + @staticmethod + def io_trigger_params(c_params: C_TLMC_IoTriggerParams) -> TLMC_IoTriggerParams: + + params = TLMC_IoTriggerParams() + params.trigger_in_mode = c_params.triggerInMode + params.trigger_in_polarity = c_params.triggerInPolarity + params.trigger_in_source = c_params.triggerInSource + params.trigger_out_mode = c_params.triggerOutMode + params.trigger_out_polarity = c_params.triggerOutPolarity + params.trigger_out_forward_start_position = c_params.triggerOutForwardStartPosition + params.trigger_out_forward_interval = c_params.triggerOutForwardInterval + params.trigger_out_forward_number_of_pulses = c_params.triggerOutForwardNumberOfPulses + params.trigger_out_reverse_start_position = c_params.triggerOutReverseStartPosition + params.trigger_out_reverse_interval = c_params.triggerOutReverseInterval + params.trigger_out_reverse_number_of_pulses = c_params.triggerOutReverseNumberOfPulses + params.trigger_out_pulse_width = c_params.triggerOutPulseWidth + params.trigger_out_number_of_cycles = c_params.triggerOutNumberOfCycles + + return params + + @staticmethod + def jog_params(c_params: C_TLMC_JogParams) -> TLMC_JogParams: + + params = TLMC_JogParams() + params.acceleration = c_params.acceleration + params.max_velocity = c_params.maxVelocity + params.min_velocity = c_params.minVelocity + params.mode = TLMC_JogMode(c_params.mode) + params.step_size = c_params.stepSize + params.stop_mode = TLMC_JogStopMode(c_params.stopMode) + + return params + + @staticmethod + def joystick_params(c_params: C_TLMC_JoystickParams) -> TLMC_JoystickParams: + + params = TLMC_JoystickParams() + params.direction_sense = TLMC_JoystickDirectionSense(c_params.directionSense) + params.high_gear_acceleration = c_params.highGearAcceleration + params.high_gear_max_velocity = c_params.highGearMaxVelocity + params.low_gear_acceleration = c_params.lowGearAcceleration + params.low_gear_max_velocity = c_params.lowGearMaxVelocity + + return params + + @staticmethod + def kcube_io_trigger_params(c_params: C_TLMC_KcubeIoTriggerParams) -> TLMC_KcubeIoTriggerParams: + + params = TLMC_KcubeIoTriggerParams() + params.trigger_1_mode = TLMC_KcubeIoTriggerMode(c_params.trigger1Mode) + params.trigger_1_polarity = TLMC_KcubeIoTriggerPolarity(c_params.trigger1Polarity) + params.trigger_2_mode = TLMC_KcubeIoTriggerMode(c_params.trigger2Mode) + params.trigger_2_polarity = TLMC_KcubeIoTriggerPolarity(c_params.trigger2Polarity) + + return params + + @staticmethod + def kcube_mmi_params(c_params: C_TLMC_KcubeMmiParams) -> TLMC_KcubeMmiParams: + + params = TLMC_KcubeMmiParams() + params.display_brightness = c_params.displayBrightness + params.display_dim_level = c_params.displayDimLevel + params.display_timeout = c_params.displayTimeout + params.joystick_acceleration = c_params.joystickAcceleration + params.joystick_direction_sense = TLMC_KcubeMmi_JoystickDirectionSense(c_params.joystickDirectionSense) + params.joystick_max_velocity = c_params.joystickMaxVelocity + params.joystick_mode = c_params.joystickMode + params.joystick_sensitivity = c_params.joystickSensativity + params.preset_position_1 = c_params.presetPosition1 + params.preset_position_2 = c_params.presetPosition2 + params.preset_position_3 = c_params.presetPosition3 + + return params + + @staticmethod + def kcube_position_trigger_params(c_params: C_TLMC_KcubePositionTriggerParams) -> TLMC_KcubePositionTriggerParams: + + params = TLMC_KcubePositionTriggerParams() + params.forward_interval = c_params.forwardInterval + params.forward_number_of_pulses = c_params.forwardNumberOfPulses + params.forward_start_position = c_params.forwardStartPosition + params.number_of_cycles = c_params.numberOfCycles + params.pulse_width = c_params.pulseWidth + params.reverse_interval = c_params.reverseInterval + params.reverse_number_of_pulses = c_params.reverseNumberOfPulses + params.reverse_start_position = c_params.reverseStartPosition + + return params + + @staticmethod + def lcd_display_params(c_params: C_TLMC_LcdDisplayParams) -> TLMC_LcdDisplayParams: + + params = TLMC_LcdDisplayParams() + params.display_brightness = c_params.displayBrightness + params.display_dim_level = c_params.displayDimLevel + params.display_timeout = c_params.displayTimeout + params.knob_sensitivity = c_params.knobSensitivity + + return params + + @staticmethod + def lcd_move_params(c_params: C_TLMC_LcdMoveParams) -> TLMC_LcdMoveParams: + + params = TLMC_LcdMoveParams() + params.knob_mode = c_params.knobMode + params.jog_step_size = c_params.jogStepSize + params.acceleration = c_params.acceleration + params.max_velocity = c_params.maxVelocity + params.preset_position = c_params.presetPosition + + return params + + @staticmethod + def limit_switch_params(c_params: C_TLMC_LimitSwitchParams) -> TLMC_LimitSwitchParams: + + params = TLMC_LimitSwitchParams() + params.clockwise_limit_mode = TLMC_HardLimitOperatingMode(c_params.clockwiseHardLimitOperatingMode) + params.counterclockwise_limit_mode = TLMC_HardLimitOperatingMode(c_params.counterclockwiseHardLimitOperatingMode) + params.clockwise_soft_limit = c_params.clockwiseSoftLimit + params.counterclockwise_soft_limit = c_params.counterclockwiseSoftLimit + params.soft_limit_operating_mode = TLMC_SoftLimitOperatingMode(c_params.softLimitOperatingMode) + + return params + + @staticmethod + def motor_output_params(c_params: C_TLMC_MotorOutputParams) -> TLMC_MotorOutputParams: + + params = TLMC_MotorOutputParams() + params.continuous_current_limit = c_params.continuousCurrentLimit + params.energy_limit = c_params.energyLimit + params.motor_bias = c_params.motorBias + params.motor_limit = c_params.motorLimit + + return params + + @staticmethod + def move_absolute_params(c_params: C_TLMC_MoveAbsoluteParams) -> TLMC_MoveAbsoluteParams: + + params = TLMC_MoveAbsoluteParams() + params.absolute_position = c_params.absolutePosition + + return params + + @staticmethod + def move_relative_params(c_params: C_TLMC_MoveRelativeParams) -> TLMC_MoveRelativeParams: + + params = TLMC_MoveRelativeParams() + params.relative_distance = c_params.relativeDistance + + return params + + @staticmethod + def position_loop_params(c_params: C_TLMC_PositionLoopParams) -> TLMC_PositionLoopParams: + + params = TLMC_PositionLoopParams() + params.acceleration_feed_forward = c_params.accelerationFeedForward + params.derivative = c_params.derivative + params.error_limit = c_params.errorLimit + params.integral = c_params.integral + params.integral_limit = c_params.integralLimit + params.proportional = c_params.proportional + params.scale = c_params.scale + params.servo_cycles = c_params.servoCycles + params.velocity_feed_forward = c_params.velocityFeedForward + + return params + + @staticmethod + def potentiometer_params(c_params: C_TLMC_PotentiometerParams) -> TLMC_PotentiometerParams: + + params = TLMC_PotentiometerParams() + params.deflection_0 = c_params.deflection0 + params.velocity_1 = c_params.velocity1 + params.deflection_1 = c_params.deflection1 + params.velocity_2 = c_params.velocity2 + params.deflection_2 = c_params.deflection2 + params.velocity_3 = c_params.velocity3 + params.deflection_3 = c_params.deflection3 + params.velocity_4 = c_params.velocity4 + + return params + + @staticmethod + def power_params(c_params: C_TLMC_PowerParams) -> TLMC_PowerParams: + + params = TLMC_PowerParams() + params.move_factor = c_params.moveFactor + params.rest_factor = c_params.restFactor + + return params + + @staticmethod + def profile_mode_params(c_params: C_TLMC_ProfileModeParams) -> TLMC_ProfileModeParams: + + params = TLMC_ProfileModeParams() + params.mode = c_params.mode + params.jerk = c_params.jerk + + return params + + @staticmethod + def pz_kpc_io_settings_params(c_params: C_TLMC_PZ_KpcIoSettingsParams) -> TLMC_PZ_KpcIoSettingsParams: + + params = TLMC_PZ_KpcIoSettingsParams() + params.voltage_limit = c_params.voltageLimit + params.analog_input_source = TLMC_PZ_KpcAnalogInputSource(c_params.analogInputSource) + params.filter_cut_off_frequency = c_params.filterCutOffFrequency + params.voltage_range = TLMC_PZ_KpcVoltageRange(c_params.voltageRange) + params.force_sense = c_params.forceSense + params.strain_gauge_option = TLMC_PZ_KpcStrainGaugeOption(c_params.strainGaugeOption) + + return params + + @staticmethod + def pz_kpc_io_trigger_params(c_params: C_TLMC_PZ_KpcIoTriggerParams) -> TLMC_PZ_KpcIoTriggerParams: + + params = TLMC_PZ_KpcIoTriggerParams() + params.trigger_1_mode = TLMC_PZ_KpcIoTriggerMode(c_params.trigger1Mode) + params.trigger_1_polarity = TLMC_KcubeIoTriggerPolarity(c_params.trigger1Polarity) + params.trigger_2_mode = TLMC_PZ_KpcIoTriggerMode(c_params.trigger2Mode) + params.trigger_2_polarity = TLMC_KcubeIoTriggerPolarity(c_params.trigger2Polarity) + params.strain_gauge_lower_limit = c_params.strainGaugeLowerLimit + params.strain_gauge_upper_limit = c_params.strainGaugeUpperLimit + params.smoothing_samples = c_params.smoothingSamples + params.monitor_output_mode = TLMC_PZ_KpcMonitorOutputMode(c_params.monitorOutputMode) + params.monitor_filter_cut_off_frequency = c_params.monitorFilterCutOffFrequency + params.monitor_output_software_value = c_params.monitorOutputSoftwareValue + + return params + + @staticmethod + def pz_kpc_mmi_params(c_params: C_TLMC_PZ_KpcMmiParams) -> TLMC_PZ_KpcMmiParams: + + params = TLMC_PZ_KpcMmiParams() + params.display_brightness = c_params.displayBrightness + params.display_dim_level = c_params.displayDimLevel + params.display_timeout = c_params.displayTimeout + params.joystick_direction_sense = TLMC_PZ_KpcMmi_JoystickDirectionSense(c_params.joystickDirectionSense) + params.joystick_gear = TLMC_KcubeMmi_JoystickGear(c_params.joystickGear) + params.joystick_mode = TLMC_PZ_KpcMmi_JoystickMode(c_params.joystickMode) + params.joystick_position_step_size = c_params.joystickPositionStepSize + params.joystick_voltage_step_size = c_params.joystickVoltageStepSize + params.preset_position_1 = c_params.presetPosition1 + params.preset_position_2 = c_params.presetPosition2 + params.preset_voltage_1 = c_params.presetVoltage1 + params.preset_voltage_2 = c_params.presetVoltage2 + + return params + + @staticmethod + def pz_max_output_voltage_params(c_params: C_TLMC_PZ_MaxOutputVoltageParams) -> TLMC_PZ_MaxOutputVoltageParams: + + params = TLMC_PZ_MaxOutputVoltageParams() + params.max_output_voltage = c_params.maxOutputVoltage + params.voltage_limit = TLMC_PZ_VoltageLimit(c_params.voltageLimit) + + return params + + @staticmethod + def pz_nano_trak_circle_diameter_lookup_table_data(c_params: C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> TLMC_PZ_NanoTrakCircleDiameterLookupTableData: + + params = TLMC_PZ_NanoTrakCircleDiameterLookupTableData() + params.lookup_table_values = [int(v) for v in c_params.lookupTableValues] + + return params + + @staticmethod + def pz_nano_trak_circle_home_position_params(c_params: C_TLMC_PZ_NanoTrakCircleHomePositionParams) -> TLMC_PZ_NanoTrakCircleHomePositionParams: + + params = TLMC_PZ_NanoTrakCircleHomePositionParams() + params.circle_home_position_a = c_params.circleHomePositionA + params.circle_home_position_b = c_params.circleHomePositionB + + return params + + @staticmethod + def pz_nano_trak_circle_params(c_params: C_TLMC_PZ_NanoTrakCircleParams) -> TLMC_PZ_NanoTrakCircleParams: + + params = TLMC_PZ_NanoTrakCircleParams() + params.absolute_power_adjust_type = TLMC_PZ_NanoTrakAbsolutePowerAdjustType(c_params.absolutePowerAdjustType) + params.absolute_power_max_circle_diameter = c_params.absolutePowerMaxCircleDiameter + params.absolute_power_min_circle_diameter = c_params.absolutePowerMinCircleDiameter + params.circle_diameter_mode = TLMC_PZ_NanoTrakCircleDiameterMode(c_params.circleDiameterMode) + params.circle_oscillation_frequency = c_params.circleOscillationFrequency + params.circle_diameter_software = c_params.circleDiameterSoftware + + return params + + @staticmethod + def pz_nano_trak_gain_params(c_params: C_TLMC_PZ_NanoTrakGainParams) -> TLMC_PZ_NanoTrakGainParams: + + params = TLMC_PZ_NanoTrakGainParams() + params.gain = c_params.gain + params.gain_control_mode = TLMC_PZ_NanoTrakGainControlMode(c_params.gainControlMode) + + return params + + @staticmethod + def pz_nano_trak_mode(c_params: C_TLMC_PZ_NanoTrakMode) -> TLMC_PZ_NanoTrakMode: + + params = TLMC_PZ_NanoTrakMode() + params.mode = TLMC_PZ_NanoTrakTrackingMode(c_params.mode) + params.state = TLMC_PZ_NanoTrakTrackingState(c_params.state) + + return params + + @staticmethod + def pz_nano_trak_phase_compensation_params(c_params: C_TLMC_PZ_NanoTrakPhaseCompensationParams) -> TLMC_PZ_NanoTrakPhaseCompensationParams: + + params = TLMC_PZ_NanoTrakPhaseCompensationParams() + params.phase_compensation_a_software = c_params.phaseCompensationASoftware + params.phase_compensation_b_software = c_params.phaseCompensationBSoftware + params.phase_compensation_mode = TLMC_PZ_NanoTrakPhaseCompensationMode(c_params.phaseCompensationMode) + + return params + + @staticmethod + def pz_nano_trak_range_params(c_params: C_TLMC_PZ_NanoTrakRangeParams) -> TLMC_PZ_NanoTrakRangeParams: + + params = TLMC_PZ_NanoTrakRangeParams() + params.range_change_type = TLMC_PZ_NanoTrakRangeChangeType(c_params.rangeChangeType) + params.range_down_limit = c_params.rangeDownLimit + params.range_mode = TLMC_PZ_NanoTrakRangeMode(c_params.rangeMode) + params.range_type = TLMC_PZ_NanoTrakRange(c_params.rangeType) + params.range_up_limit = c_params.rangeUpLimit + params.settle_samples = c_params.settleSamples + + return params + + @staticmethod + def pz_nano_trak_status(c_params: C_TLMC_PZ_NanoTrakStatus) -> TLMC_PZ_NanoTrakStatus: + + params = TLMC_PZ_NanoTrakStatus() + params.absolute_reading = c_params.absoluteReading + params.circle_diameter = c_params.circleDiameter + params.circle_position_a = c_params.circlePositionA + params.circle_position_b = c_params.circlePositionB + params.nano_trak_gain = c_params.nanoTrakGain + params.phase_compensation_a = c_params.phaseCompensationA + params.phase_compensation_b = c_params.phaseCompensationB + params.range = TLMC_PZ_NanoTrakRange(c_params.range) + params.relative_reading = c_params.relativeReading + params.status_bits = TLMC_PZ_NanoTrakStatusBit(c_params.statusBits) + params.under_over_read = TLMC_PZ_NanoTrakUnderOverReadType(c_params.underOverRead) + + return params + + @staticmethod + def pz_nano_trak_tna_io_settings(c_params: C_TLMC_PZ_NanoTrakTnaIoSettings) -> TLMC_PZ_NanoTrakTnaIoSettings: + + params = TLMC_PZ_NanoTrakTnaIoSettings() + params.channel_1_signal_range_type = TLMC_PZ_TnaIoSignalRangeType(c_params.channel1SignalRangeType) + params.channel_2_signal_range_type = TLMC_PZ_TnaIoSignalRangeType(c_params.channel2SignalRangeType) + params.signal_output_mode = TLMC_PZ_TnaIoSignalOutputMode(c_params.signalOutputMode) + params.signal_source_boost_type = TLMC_PZ_TnaIoSignalSourceBoostType(c_params.signalSourceBoostType) + params.signal_source_mode = TLMC_PZ_TnaIoSignalSourceMode(c_params.signalSourceMode) + + return params + + @staticmethod + def pz_nano_trak_track_threshold(c_params: C_TLMC_PZ_NanoTrakTrackThresholdParams) -> TLMC_PZ_NanoTrakTrackThresholdParams: + + params = TLMC_PZ_NanoTrakTrackThresholdParams() + params.track_threshold = c_params.trackThreshold + + return params + + @staticmethod + def pz_output_voltage_control_source_params(c_params: C_TLMC_PZ_OutputVoltageControlSourceParams) -> TLMC_PZ_OutputVoltageControlSourceParams: + + params = TLMC_PZ_OutputVoltageControlSourceParams() + params.source = TLMC_PZ_OutputVoltageControlSource(c_params.source) + + return params + + @staticmethod + def pz_output_waveform_params(c_params: C_TLMC_PZ_OutputWaveformParams) -> TLMC_PZ_OutputWaveformParams: + + params = TLMC_PZ_OutputWaveformParams() + params.inter_sample_delay = c_params.interSampleDelay + params.mode = TLMC_PZ_OutputWaveformOperatingMode(c_params.mode) + params.number_of_cycles = c_params.numberOfCycles + params.number_of_samples_between_trigger_repetition = c_params.numberOfSamplesBetweenTriggerRepetition + params.number_of_samples_per_cycle = c_params.numberOfSamplesPerCycle + params.output_trigger_start_index = c_params.outputTriggerStartIndex + params.output_trigger_width = c_params.outputTriggerWidth + params.post_cycle_delay = c_params.postCycleDelay + params.pre_cycle_delay = c_params.preCycleDelay + + return params + + @staticmethod + def pz_position_loop_params(c_params: C_TLMC_PZ_PositionLoopParams) -> TLMC_PZ_PositionLoopParams: + + params = TLMC_PZ_PositionLoopParams() + params.integral = c_params.integral + params.proportional = c_params.proportional + + return params + + @staticmethod + def pz_slew_rate_params(c_params: C_TLMC_PZ_SlewRateParams) -> TLMC_PZ_SlewRateParams: + + params = TLMC_PZ_SlewRateParams() + params.closed_loop_slew_rate = c_params.closedLoopSlewRate + params.open_slew_rate = c_params.openSlewRate + + return params + + @staticmethod + def pz_status(c_params: C_TLMC_PZ_Status) -> TLMC_PZ_Status: + + params = TLMC_PZ_Status() + params.output_voltage = c_params.outputVoltage + params.position = c_params.position + params.status_bits = TLMC_PZ_StatusBit(c_params.statusBits) + + return params + + @staticmethod + def rich_response(c_params: C_TLMC_RichResponse) -> TLMC_RichResponse: + + params = TLMC_RichResponse() + params.code = c_params.code + params.message_id = c_params.messageId + params.notes = c_params.notes + + return params + + + @staticmethod + def setting(c_params: C_TLMC_Setting) -> TLMC_Setting: + + params = TLMC_Setting() + params.display_name = MapNativeToPython.string(c_params.DisplayName) + params.has_discrete_values = c_params.hasDiscreteValues + params.has_max = c_params.hasMax + params.has_min = c_params.hasMin + params.is_read_only = c_params.isReadOnly + params.is_value_set = c_params.isValueSet + params.name = MapNativeToPython.string(c_params.Name) + params.scale_type = TLMC_ScaleType(c_params.ScaleType) + params.unit_type = TLMC_Unit(c_params.UnitType) + params.value_type = TLMC_ValueType(c_params.valueType) + params.is_value_set = c_params.isValueSet + + if params.value_type == TLMC_ValueType.TLMC_ValueType_int64: + params.value = int(c_params.Value.int64Value) + if params.has_min == True: + params.min_value = int(c_params.minValue.int64Value) + if params.has_max == True: + params.max_value = int(c_params.maxValue.int64Value) + elif params.value_type == TLMC_ValueType.TLMC_ValueType_bool: + params.value = bool(c_params.Value.boolValue) + elif params.value_type == TLMC_ValueType.TLMC_ValueType_string: + params.value = MapNativeToPython.string(c_params.Value.string) + + return params + + @staticmethod + def status_item(c_params: C_TLMC_StatusItem) -> TLMC_StatusItem: + + params = TLMC_StatusItem() + params.id = TLMC_StatusItemId(c_params.id) + params.value_type = TLMC_ValueType(c_params.valueType) + + if params.value_type == TLMC_ValueType.TLMC_ValueType_int64: + params.value = int(c_params.value.int64Value) + elif params.value_type == TLMC_ValueType.TLMC_ValueType_bool: + params.value = bool(c_params.value.boolValue) + elif params.value_type == TLMC_ValueType.TLMC_ValueType_string: + params.value = MapNativeToPython.string(c_params.value.string) + + return params + + @staticmethod + def stage_axis_params(c_params: C_TLMC_StageAxisParams) -> TLMC_StageAxisParams: + + params = TLMC_StageAxisParams() + params.axis_id = TLMC_StageAxis_AxisId(c_params.axisId) + params.counts_per_unit = c_params.countsPerUnit + params.gear_box_ratio = c_params.gearBoxRatio + params.max_acceleration = c_params.maxAcceleration + params.max_deceleration = c_params.maxDeceleation + params.min_position = c_params.minPosition + params.max_position = c_params.maxPosition + params.max_velocity = c_params.maxVelocity + params.part_number = MapNativeToPython.string(c_params.partNumber) + params.serial_number = c_params.serialNumber + params.type_id = TLMC_StageAxis_TypeId(c_params.typeId) + + return params + + @staticmethod + def stepper_loop_params(c_params: C_TLMC_StepperLoopParams) -> TLMC_StepperLoopParams: + + params = TLMC_StepperLoopParams() + params.differential = c_params.differential + params.integral = c_params.integral + params.loop_mode = TLMC_StepperLoopParams_LoopMode(c_params.loopMode) + params.output_tolerance = c_params.outputTolerance + params.proportional = c_params.proportional + params.microsteps_per_encoder_count = c_params.microstepsPerEncoderCount + + return params + + @staticmethod + def stepper_status(c_params: C_TLMC_StepperStatus) -> TLMC_StepperStatus: + + params = TLMC_StepperStatus() + params.position = c_params.position + params.encoder_count = c_params.encoder_count + params.status_bits = TLMC_UniversalStatusBit(c_params.statusBits) + + return params + + @staticmethod + def track_settle_params(c_params: C_TLMC_TrackSettleParams) -> TLMC_TrackSettleParams: + + params = TLMC_TrackSettleParams() + params.settle_time = c_params.settleTime + params.settle_window = c_params.settleWindow + params.track_window = c_params.trackWindow + + return params + + @staticmethod + def trigger_params_for_dc_brushless(c_params: C_TLMC_TriggerParamsForDcBrushless) -> TLMC_TriggerParamsForDcBrushless: + + params = TLMC_TriggerParamsForDcBrushless() + params.modes = TLMC_TriggerModesForDcBrushless(c_params.modes) + + return params + + @staticmethod + def trigger_params_for_stepper(c_params: C_TLMC_TriggerParamsForStepper) -> TLMC_TriggerParamsForStepper: + + params = TLMC_TriggerParamsForStepper() + params.modes = TLMC_TriggerModesForStepper(c_params.modes) + + return params + + @staticmethod + def universal_status(c_params: C_TLMC_UniversalStatus) -> TLMC_UniversalStatus: + + params = TLMC_UniversalStatus() + params.motor_current = c_params.motorCurrent + params.position = c_params.position + params.status_bits = TLMC_UniversalStatusBit(c_params.statusBits) + params.velocity = c_params.velocity + + return params + + @staticmethod + def velocity_params(c_params: C_TLMC_VelocityParams) -> TLMC_VelocityParams: + + params = TLMC_VelocityParams() + params.acceleration = c_params.acceleration + params.max_velocity = c_params.maxVelocity + params.min_velocity = c_params.minVelocity + + return params \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/map_python_to_native.py b/Python/XA/src/thorlabs_xa/shared/map_python_to_native.py new file mode 100644 index 0000000..04564c6 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/map_python_to_native.py @@ -0,0 +1,589 @@ +from ctypes import c_bool, c_char, c_char_p, c_double, c_int16, c_int32, c_longlong, c_uint16, c_uint32, c_uint8 + +from thorlabs_xa.shared.c_params import C_TLMC_AnalogMonitorConfigurationParams, C_TLMC_ButtonParams, C_TLMC_ConnectedProductInfo, C_TLMC_CurrentLoopParams, C_TLMC_DcPidParams, C_TLMC_GeneralMoveParams, C_TLMC_HomeParams, C_TLMC_IoConfigurationParams, C_TLMC_IoTriggerParams, C_TLMC_JogParams, C_TLMC_JoystickParams, C_TLMC_KcubeIoTriggerParams, C_TLMC_KcubeMmiParams, C_TLMC_KcubePositionTriggerParams, C_TLMC_LcdDisplayParams, C_TLMC_LcdMoveParams, C_TLMC_LimitSwitchParams, C_TLMC_MotorOutputParams, C_TLMC_MoveAbsoluteParams, C_TLMC_MoveRelativeParams, C_TLMC_PZ_KpcIoSettingsParams, C_TLMC_PZ_KpcIoTriggerParams, C_TLMC_PZ_KpcMmiParams, C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData, C_TLMC_PZ_NanoTrakCircleHomePositionParams, C_TLMC_PZ_NanoTrakCircleParams, C_TLMC_PZ_NanoTrakEEPROMParams, C_TLMC_PZ_NanoTrakGainParams, C_TLMC_PZ_NanoTrakMode, C_TLMC_PZ_NanoTrakPhaseCompensationParams, C_TLMC_PZ_NanoTrakRangeParams, C_TLMC_PZ_NanoTrakTnaIoSettings, C_TLMC_PZ_NanoTrakTrackThresholdParams, C_TLMC_PZ_OutputVoltageControlSourceParams, C_TLMC_PZ_OutputWaveformLoopTableSample, C_TLMC_PZ_OutputWaveformParams, C_TLMC_PZ_PositionLoopParams, C_TLMC_PZ_SlewRateParams, C_TLMC_PositionLoopParams, C_TLMC_PotentiometerParams, C_TLMC_PowerParams, C_TLMC_ProfileModeParams, C_TLMC_StageAxisParams, C_TLMC_StepperLoopParams, C_TLMC_TrackSettleParams, C_TLMC_TriggerParamsForDcBrushless, C_TLMC_TriggerParamsForStepper, C_TLMC_Value, C_TLMC_VelocityParams +from thorlabs_xa.shared.params import TLMC_AnalogMonitorConfigurationParams, TLMC_ButtonParams, TLMC_ConnectedProductInfo, TLMC_CurrentLoopParams, TLMC_DcPidParams, TLMC_GeneralMoveParams, TLMC_HomeParams, TLMC_IoConfigurationParams, TLMC_IoTriggerParams, TLMC_JogParams, TLMC_JoystickParams, TLMC_KcubeIoTriggerParams, TLMC_KcubeMmiParams, TLMC_KcubePositionTriggerParams, TLMC_LcdDisplayParams, TLMC_LcdMoveParams, TLMC_LimitSwitchParams, TLMC_MotorOutputParams, TLMC_MoveAbsoluteParams, TLMC_MoveRelativeParams, TLMC_PZ_KpcIoSettingsParams, TLMC_PZ_KpcIoTriggerParams, TLMC_PZ_KpcMmiParams, TLMC_PZ_NanoTrakCircleDiameterLookupTableData, TLMC_PZ_NanoTrakCircleHomePositionParams, TLMC_PZ_NanoTrakCircleParams, TLMC_PZ_NanoTrakEEPROMParams, TLMC_PZ_NanoTrakGainParams, TLMC_PZ_NanoTrakMode, TLMC_PZ_NanoTrakPhaseCompensationParams, TLMC_PZ_NanoTrakRangeParams, TLMC_PZ_NanoTrakTnaIoSettings, TLMC_PZ_NanoTrakTrackThresholdParams, TLMC_PZ_OutputVoltageControlSourceParams, TLMC_PZ_OutputWaveformLoopTableSample, TLMC_PZ_OutputWaveformParams, TLMC_PZ_PositionLoopParams, TLMC_PZ_SlewRateParams, TLMC_PositionLoopParams, TLMC_PotentiometerParams, TLMC_PowerParams, TLMC_ProfileModeParams, TLMC_StageAxisParams, TLMC_StepperLoopParams, TLMC_TrackSettleParams, TLMC_TriggerParamsForDcBrushless, TLMC_TriggerParamsForStepper, TLMC_Value, TLMC_VelocityParams + +class MapPythonToNative: + + @staticmethod + def string(string: str) -> c_char_p: + return c_char_p(string.encode('utf-8')) + + @staticmethod + def pz_kpc_io_settings_params(params: TLMC_PZ_KpcIoSettingsParams) -> C_TLMC_PZ_KpcIoSettingsParams: + + c_params = C_TLMC_PZ_KpcIoSettingsParams() + c_params.voltageLimit = c_uint16(params.voltage_limit) + c_params.analogInputSource = c_uint16(int(params.analog_input_source)) + c_params.filterCutOffFrequency = c_uint16(params.filter_cut_off_frequency) + c_params.voltageRange = c_uint16(int(params.voltage_range)) + c_params.forceSense = c_uint16(params.force_sense) + c_params.strainGaugeOption = c_uint16(int(params.strain_gauge_option)) + + return c_params + + @staticmethod + def pz_kpc_io_trigger_params(params: TLMC_PZ_KpcIoTriggerParams) -> C_TLMC_PZ_KpcIoTriggerParams: + + c_params = C_TLMC_PZ_KpcIoTriggerParams() + c_params.trigger1Mode = c_uint16(int(params.trigger_1_mode)) + c_params.trigger1Polarity = c_uint16(int(params.trigger_1_polarity)) + c_params.trigger2Mode = c_uint16(int(params.trigger_2_mode)) + c_params.trigger2Polarity = c_uint16(int(params.trigger_2_polarity)) + c_params.strainGaugeLowerLimit = c_int32(params.strain_gauge_lower_limit) + c_params.strainGaugeUpperLimit = c_int32(params.strain_gauge_upper_limit) + c_params.smoothingSamples = c_uint16(params.smoothing_samples) + c_params.monitorFilterCutOffFrequency = c_uint16(params.monitor_filter_cut_off_frequency) + c_params.monitorOutputSoftwareValue = c_int16(params.monitor_output_software_value) + + return c_params + + @staticmethod + def pz_kpc_mmi_params(params: TLMC_PZ_KpcMmiParams) -> C_TLMC_PZ_KpcMmiParams: + + c_params = C_TLMC_PZ_KpcMmiParams() + c_params.joystickMode = c_uint16(int(params.joystick_mode)) + c_params.joystickGear = c_uint16(int(params.joystick_gear)) + c_params.joystickVoltageStepSize = c_uint16(params.joystick_voltage_step_size) + c_params.joystickPositionStepSize = c_uint16(params.joystick_voltage_step_size) + c_params.joystickDirectionSense = c_uint16(int(params.joystick_direction_sense)) + c_params.presetVoltage1 = c_uint16(params.preset_voltage_1) + c_params.presetVoltage2 = c_uint16(params.preset_voltage_2) + c_params.presetPosition1 = c_uint16(params.preset_position_1) + c_params.presetPosition2 = c_uint16(params.preset_position_2) + c_params.displayBrightness = c_uint16(params.display_brightness) + c_params.displayTimeout = c_uint16(params.display_timeout) + c_params.displayDimLevel = c_uint16(params.display_dim_level) + + return c_params + + @staticmethod + def pz_nano_trak_circle_diameter_lookup_table_data(params: TLMC_PZ_NanoTrakCircleDiameterLookupTableData) -> C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData: + + Array16 = c_uint16 * 16 + c_params = C_TLMC_PZ_NanoTrakCircleDiameterLookupTableData() + c_params.lookupTableValues = Array16(*[(int(v) & 0xFFFF) for v in params.lookup_table_values]) + + return c_params + + @staticmethod + def pz_nano_trak_circle_home_position_params(params: TLMC_PZ_NanoTrakCircleHomePositionParams) -> C_TLMC_PZ_NanoTrakCircleHomePositionParams: + c_params = C_TLMC_PZ_NanoTrakCircleHomePositionParams() + c_params.circleHomePositionA = c_uint16(params.circle_home_position_a) + c_params.circleHomePositionB = c_uint16(params.circle_home_position_b) + return c_params + + @staticmethod + def pz_nano_trak_circle_params(params: TLMC_PZ_NanoTrakCircleParams) -> C_TLMC_PZ_NanoTrakCircleParams: + c_params = C_TLMC_PZ_NanoTrakCircleParams() + c_params.circleDiameterMode = c_uint16(int(params.circle_diameter_mode)) + c_params.circleDiameterSoftware = c_uint16(params.circle_diameter_software) + c_params.circleOscillationFrequency = c_uint16(params.circle_oscillation_frequency) + c_params.absolutePowerMinCircleDiameter = c_uint16(params.absolute_power_min_circle_diameter) + c_params.absolutePowerMaxCircleDiameter = c_uint16(params.absolute_power_max_circle_diameter) + c_params.absolutePowerAdjustType = c_uint16(int(params.absolute_power_adjust_type)) + return c_params + + @staticmethod + def pz_nano_trak_eeprom_params(params: TLMC_PZ_NanoTrakEEPROMParams) -> C_TLMC_PZ_NanoTrakEEPROMParams: + c_params = C_TLMC_PZ_NanoTrakEEPROMParams() + c_params.channelIdentifier = c_uint16(params.channel_identifier) + c_params.messageId = c_uint16(params.message_id) + return c_params + + @staticmethod + def pz_nano_trak_gain_params(params: TLMC_PZ_NanoTrakGainParams) -> C_TLMC_PZ_NanoTrakGainParams: + + c_params = C_TLMC_PZ_NanoTrakGainParams() + c_params.gainControlMode = c_uint16(int(params.gain_control_mode)) + c_params.gain = c_uint16(params.gain) + + return c_params + + @staticmethod + def pz_nano_trak_mode(params: TLMC_PZ_NanoTrakMode) -> C_TLMC_PZ_NanoTrakMode: + + c_params = C_TLMC_PZ_NanoTrakMode() + c_params.mode = c_uint8(int(params.mode)) + c_params.state = c_uint8(int(params.state)) + + return c_params + + @staticmethod + def pz_nano_trak_phase_compensation_params(params: TLMC_PZ_NanoTrakPhaseCompensationParams) -> C_TLMC_PZ_NanoTrakPhaseCompensationParams: + + c_params = C_TLMC_PZ_NanoTrakPhaseCompensationParams() + c_params.phaseCompensationMode = c_uint16(int(params.phase_compensation_mode)) + c_params.phaseCompensationASoftware = c_int16(params.phase_compensation_a_software) + c_params.phaseCompensationBSoftware = c_int16(params.phase_compensation_b_software) + + return c_params + + @staticmethod + def pz_nano_trak_range_params(params: TLMC_PZ_NanoTrakRangeParams) -> C_TLMC_PZ_NanoTrakRangeParams: + + c_params = C_TLMC_PZ_NanoTrakRangeParams() + c_params.rangeMode = c_uint16(int(params.range_mode)) + c_params.rangeUpLimit = c_int16(params.range_up_limit) + c_params.rangeDownLimit = c_int16(params.range_down_limit) + c_params.settleSamples = c_int16(params.settle_samples) + c_params.rangeChangeType = c_uint16(params.range_change_type) + c_params.rangeType = c_uint16(params.range_type) + + return c_params + + @staticmethod + def pz_nano_trak_tna_io_settings(params: TLMC_PZ_NanoTrakTnaIoSettings) -> C_TLMC_PZ_NanoTrakTnaIoSettings: + + c_params = C_TLMC_PZ_NanoTrakTnaIoSettings() + c_params.outRangeType = c_uint8(int(params.out_range_type)) + c_params.outRouteType = c_uint8(int(params.out_route_type)) + c_params.signalSourceMode = c_uint8(int(params.signal_source_mode)) + c_params.signalSourceBoostType = c_uint8(int(params.signal_source_boost_type)) + c_params.signalOutputMode = c_uint8(int(params.signal_output_mode)) + c_params.channel1SignalRangeType = c_uint8(int(params.channel_1_signal_range_type)) + c_params.channel2SignalRangeType = c_uint8(int(params.channel_2_signal_range_type)) + + return c_params + + @staticmethod + def pz_nano_trak_track_threshold(params: TLMC_PZ_NanoTrakTrackThresholdParams) -> C_TLMC_PZ_NanoTrakTrackThresholdParams: + + c_params = C_TLMC_PZ_NanoTrakTrackThresholdParams() + c_params.trackThreshold = c_uint32(params.track_threshold) + + return c_params + + @staticmethod + def pz_output_voltage_control_source_params(params: TLMC_PZ_OutputVoltageControlSourceParams) -> C_TLMC_PZ_OutputVoltageControlSourceParams: + + c_params = C_TLMC_PZ_OutputVoltageControlSourceParams() + c_params.source = c_uint16(int(params.source)) + + return c_params + + @staticmethod + def pz_output_waveform_lookup_table_sample(params: TLMC_PZ_OutputWaveformLoopTableSample) -> C_TLMC_PZ_OutputWaveformLoopTableSample: + + c_params = C_TLMC_PZ_OutputWaveformLoopTableSample() + c_params.index = c_uint16(params.index) + c_params.voltage = c_uint16(params.voltage) + + return c_params + + @staticmethod + def pz_output_waveform_params(params: TLMC_PZ_OutputWaveformParams) -> C_TLMC_PZ_OutputWaveformParams: + + c_params = C_TLMC_PZ_OutputWaveformParams() + c_params.interSampleDelay = c_int32(params.inter_sample_delay) + c_params.mode = c_uint16(int(params.mode)) + c_params.numberOfCycles = c_int32(params.number_of_cycles) + c_params.numberOfSamplesBetweenTriggerRepetition = c_uint16(params.number_of_samples_between_trigger_repetition) + c_params.numberOfSamplesPerCycle = c_uint16(params.number_of_samples_per_cycle) + c_params.outputTriggerStartIndex = c_uint16(params.output_trigger_start_index) + c_params.outputTriggerWidth = c_int32(params.output_trigger_width) + c_params.postCycleDelay = c_int32(params.post_cycle_delay) + c_params.preCycleDelay = c_int32(params.pre_cycle_delay) + + return c_params + + @staticmethod + def pz_position_loop_params(params: TLMC_PZ_PositionLoopParams) -> C_TLMC_PZ_PositionLoopParams: + + c_params = C_TLMC_PZ_PositionLoopParams() + c_params.proportional = c_uint16(params.proportional) + c_params.integral = c_uint16(params.integral) + + return c_params + + @staticmethod + def pz_slew_rate_params(params: TLMC_PZ_SlewRateParams) -> C_TLMC_PZ_SlewRateParams: + + c_params = C_TLMC_PZ_SlewRateParams() + c_params.openSlewRate = c_uint16(params.open_slew_rate) + c_params.closedLoopSlewRate = c_uint16(params.closed_loop_slew_rate) + + return c_params + + @staticmethod + def analog_monitor_configuration_params(params: TLMC_AnalogMonitorConfigurationParams) -> C_TLMC_AnalogMonitorConfigurationParams: + + c_params = C_TLMC_AnalogMonitorConfigurationParams() + c_params.motorChannel = c_uint16(params.motor_channel) + c_params.systemVariable = c_uint16(params.system_variable) + c_params.scale = c_int32(params.scale) + c_params.offset = c_int32(params.offset) + + return c_params + + @staticmethod + def button_params(params: TLMC_ButtonParams) -> C_TLMC_ButtonParams: + + c_params = C_TLMC_ButtonParams() + c_params.buttonMode = c_uint16(int(params.button_mode)) + c_params.position1 = c_int32(params.position_1) + c_params.position2 = c_int32(params.position_2) + c_params.timeout1Milliseconds = c_uint16(params.timeout_1_milliseconds) + c_params.timeout2Milliseconds = c_uint16(params.timeout_2_milliseconds) + + return c_params + + @staticmethod + def connected_product_info(params: TLMC_ConnectedProductInfo) -> C_TLMC_ConnectedProductInfo: + + c_params = C_TLMC_ConnectedProductInfo() + c_params.productName = MapPythonToNative.string(params.product_name) + c_params.axisType = c_uint16(int(params.axis_type)) + c_params.movementType = c_uint16(int(params.movement_type)) + c_params.unitType = c_uint16(int(params.unit_type)) + c_params.distanceScaleFactor = c_double(params.distance_scale_factor) + c_params.velocityScaleFactor = c_double(params.velocity_scale_factor) + c_params.accelerationScaleFactor = c_double(params.acceleration_scale_factor) + c_params.minPosition = c_double(params.min_position) + c_params.maxPosition = c_double(params.max_position) + c_params.maxvelcoity = c_double(params.max_velocity) + c_params.maxAcceleration = c_double(params.max_acceleration) + + return c_params + + @staticmethod + def current_loop_params(params: TLMC_CurrentLoopParams) -> C_TLMC_CurrentLoopParams: + + c_params = C_TLMC_CurrentLoopParams() + c_params.phase = c_uint16(int(params.phase)) + c_params.proportional = c_uint16(params.proportional) + c_params.integral = c_uint16(params.integral) + c_params.integralLimit = c_uint16(params.integral_limit) + c_params.integralDeadBand = c_uint16(params.integral_dead_band) + c_params.feedForward = c_uint16(params.feed_forward) + + return c_params + + @staticmethod + def dc_pid_params(params: TLMC_DcPidParams) -> C_TLMC_DcPidParams: + + c_params = C_TLMC_DcPidParams() + c_params.proportional = c_uint32(params.proportional) + c_params.integral = c_uint32(params.integral) + c_params.derivative = c_uint32(params.derivative) + c_params.integralLimit = c_uint32(params.integral_limit) + c_params.filterControl = c_uint16(params.filter_control) + + return c_params + + @staticmethod + def general_move_params(params: TLMC_GeneralMoveParams) -> C_TLMC_GeneralMoveParams: + + c_params = C_TLMC_GeneralMoveParams() + c_params.backlashDistance = c_int32(params.backlash_distance) + + return c_params + + @staticmethod + def home_params(params: TLMC_HomeParams) -> C_TLMC_HomeParams: + + c_params = C_TLMC_HomeParams() + c_params.direction = c_uint16(int(params.direction)) + c_params.limitSwitch = c_uint16(int(params.limit_switch)) + c_params.velocity = c_uint32(params.velocity) + c_params.offsetDistance = c_int32(params.offset_distance) + + return c_params + + @staticmethod + def io_configuration_params(params: TLMC_IoConfigurationParams) -> C_TLMC_IoConfigurationParams: + + c_params = C_TLMC_IoConfigurationParams() + c_params.mode = c_uint16(int(params.mode)) + c_params.triggerOutSource = c_uint16(int(params.trigger_out_source)) + + return c_params + + @staticmethod + def io_trigger_params(params: TLMC_IoTriggerParams) -> C_TLMC_IoTriggerParams: + + c_params = C_TLMC_IoTriggerParams() + c_params.triggerInMode = c_uint16(int(params.trigger_in_mode)) + c_params.triggerInPolarity = c_uint16(int(params.trigger_in_polarity)) + c_params.triggerInSource = c_uint16(int(params.trigger_in_source)) + c_params.triggerOutMode = c_uint16(int(params.trigger_out_mode)) + c_params.triggerOutPolarity = c_uint16(int(params.trigger_out_polarity)) + c_params.triggerOutForwardStartPosition = c_int32(params.trigger_out_forward_start_position) + c_params.triggerOutForwardInterval = c_int32(params.trigger_out_forward_interval) + c_params.triggerOutForwardNumberOfPulses = c_int32(params.trigger_out_forward_number_of_pulses) + c_params.triggerOutReverseStartPosition = c_int32(params.trigger_out_reverse_start_position) + c_params.triggerOutReverseInterval = c_int32(params.trigger_out_reverse_interval) + c_params.triggerOutReverseNumberOPulses = c_int32(params.trigger_out_reverse_number_of_pulses) + c_params.triggerOutPulseWidth = c_uint32(params.trigger_out_pulse_width) + c_params.triggerOutNumberOfCycles = c_uint32(params.trigger_out_number_of_cycles) + + return c_params + + @staticmethod + def joystick_params(params: TLMC_JoystickParams) -> C_TLMC_JoystickParams: + + c_params = C_TLMC_JoystickParams() + c_params.lowGearMaxVelocity = c_uint32(params.low_gear_max_velocity) + c_params.highGearMaxVelocity = c_uint32(params.high_gear_max_velocity) + c_params.lowGearAcceleration = c_uint32(params.low_gear_acceleration) + c_params.highGearAcceleration = c_uint32(params.high_gear_acceleration) + c_params.directionSense = c_uint16(params.direction_sense) + + return c_params + + @staticmethod + def kcube_io_trigger_params(params: TLMC_KcubeIoTriggerParams) -> C_TLMC_KcubeIoTriggerParams: + + c_params = C_TLMC_KcubeIoTriggerParams() + c_params.trigger1Mode = c_uint16(int(params.trigger_1_mode)) + c_params.trigger1Polarity = c_uint16(int(params.trigger_1_polarity)) + c_params.trigger2Mode = c_uint16(int(params.trigger_2_mode)) + c_params.trigger2Polarity = c_uint16(int(params.trigger_2_polarity)) + + return c_params + + @staticmethod + def kcube_mmi_params(params: TLMC_KcubeMmiParams) -> C_TLMC_KcubeMmiParams: + + c_params = C_TLMC_KcubeMmiParams() + c_params.joystickMode = c_uint16(int(params.joystick_mode)) + c_params.joystickMaxVelocity = c_uint32(params.joystick_max_velocity) + c_params.joystickAcceleration = c_uint32(params.joystick_acceleration) + c_params.joystickDirectionSense = c_uint16(params.joystick_direction_sense) + c_params.presetPosition1 = c_int32(params.preset_position_1) + c_params.presetPosition2 = c_int32(params.preset_position_2) + c_params.displayBrightness = c_uint16(params.display_brightness) + c_params.displayTimeout = c_uint16(params.display_timeout) + c_params.displayDimLevel = c_uint16(params.display_dim_level) + c_params.presetPosition3 = c_int32(params.preset_position_3) + c_params.joystickSensitivity = c_uint16(params.joystick_sensitivity) + + return c_params + + @staticmethod + def kcube_position_trigger_params(params: TLMC_KcubePositionTriggerParams) -> C_TLMC_KcubePositionTriggerParams: + + c_params = C_TLMC_KcubePositionTriggerParams() + c_params.forwardStartPosition = c_int32(params.forward_start_position) + c_params.forwardInterval = c_uint32(params.forward_interval) + c_params.forwardNumberOfPulses = c_uint32(params.forward_number_of_pulses) + c_params.reverseStartPosition = c_int32(params.reverse_start_position) + c_params.reverseInterval = c_uint32(params.reverse_interval) + c_params.reverseNumberOfPulses = c_uint32(params.reverse_number_of_pulses) + c_params.pulseWidth = c_uint32(params.pulse_width) + c_params.numberOfCycles = c_uint32(params.number_of_cycles) + + return c_params + + @staticmethod + def lcd_display_params(params: TLMC_LcdDisplayParams) -> C_TLMC_LcdDisplayParams: + + c_params = C_TLMC_LcdDisplayParams() + c_params.knobSensitivity = c_int16(params.knob_sensitivity) + c_params.displayBrightness = c_uint16(params.display_brightness) + c_params.displayTimeout = c_uint16(params.display_timeout) + c_params.displayDimLevel = c_uint16(params.display_dim_level) + + return c_params + + @staticmethod + def lcd_move_params(params: TLMC_LcdMoveParams) -> C_TLMC_LcdMoveParams: + + c_params = C_TLMC_LcdMoveParams() + c_params.knobMode = c_uint16(params.knob_mode) + c_params.jogStepSize = c_int32(params.jog_step_size) + c_params.acceleration = c_int32(params.acceleration) + c_params.maxVelocity = c_int32(params.max_velocity) + c_params.jogStopMode = c_uint16(params.jog_stop_mode) + + for i, v in enumerate(params.preset_position): + c_params.presetPosition[i] = c_int32(int(v)) + + return c_params + + @staticmethod + def limit_switch_params(params: TLMC_LimitSwitchParams) -> C_TLMC_LimitSwitchParams: + + c_params = C_TLMC_LimitSwitchParams() + c_params.clockwiseHardLimitOperatingMode = c_uint16(int(params.clockwise_limit_mode)) + c_params.counterclockwiseHardLimitOperatingMode = c_uint16(int(params.counterclockwise_limit_mode)) + c_params.clockwiseSoftLimit = c_int32(params.clockwise_soft_limit) + c_params.counterclockwiseSoftLimit = c_int32(params.counterclockwise_soft_limit) + c_params.softLimitOperatingMode = c_uint16(int(params.soft_limit_operating_mode)) + + return c_params + + @staticmethod + def motor_output_params(params: TLMC_MotorOutputParams) -> C_TLMC_MotorOutputParams: + + c_params = C_TLMC_MotorOutputParams() + c_params.continuousCurrentLimit = c_uint16(params.continuous_current_limit) + c_params.energyLimit = c_uint16(params.energy_limit) + c_params.motorLimit = c_uint16(params.motor_limit) + c_params.motorBias = c_uint16(params.motor_bias) + + return c_params + + @staticmethod + def move_absolute_params(params: TLMC_MoveAbsoluteParams) -> C_TLMC_MoveAbsoluteParams: + + c_params = C_TLMC_MoveAbsoluteParams() + c_params.absolutePosition = c_int32(params.absolute_position) + + return c_params + + @staticmethod + def jog_params(params: TLMC_JogParams) -> C_TLMC_JogParams: + + c_params = C_TLMC_JogParams() + c_params.mode = c_uint16(int(params.mode)) + c_params.stepSize = c_int32(params.step_size) + c_params.minVelocity = c_uint32(params.min_velocity) + c_params.acceleration = c_uint32(params.acceleration) + c_params.maxVelocity = c_uint32(params.max_velocity) + c_params.stopMode = c_uint16(int(params.stop_mode)) + + return c_params + + @staticmethod + def move_relative_params(params: TLMC_MoveRelativeParams) -> C_TLMC_MoveRelativeParams: + + c_params = C_TLMC_MoveRelativeParams() + c_params.relativeDistance = c_int32(params.relative_distance) + + return c_params + + @staticmethod + def position_loop_params(params: TLMC_PositionLoopParams) -> C_TLMC_PositionLoopParams: + + c_params = C_TLMC_PositionLoopParams() + c_params.proportional = c_uint16(params.proportional) + c_params.integral = c_uint16(params.integral) + c_params.integralLimit = c_uint32(params.integral_limit) + c_params.derivative = c_uint16(params.derivative) + c_params.servoCycles = c_uint16(params.servo_cycles) + c_params.scale = c_uint16(params.scale) + c_params.velocityFeedForward = c_uint16(params.velocity_feed_forward) + c_params.accelerationFeedForward = c_uint16(params.acceleration_feed_forward) + c_params.errorLimit = c_uint32(params.error_limit) + + return c_params + + @staticmethod + def power_params(params: TLMC_PowerParams) -> C_TLMC_PowerParams: + + c_params = C_TLMC_PowerParams() + c_params.restFactor = c_uint16(params.rest_factor) + c_params.moveFactor = c_uint16(params.move_factor) + + return c_params + + @staticmethod + def potentiometer_params(params: TLMC_PotentiometerParams) -> C_TLMC_PotentiometerParams: + + c_params = C_TLMC_PotentiometerParams() + c_params.deflection0 = c_uint16(params.deflection_0) + c_params.velocity1 = c_int32(params.velocity_1) + c_params.deflection1 = c_uint16(params.deflection_1) + c_params.velocity2 = c_int32(params.velocity_2) + c_params.deflection2 = c_uint16(params.deflection_2) + c_params.velocity3 = c_int32(params.velocity_3) + c_params.deflection3 = c_uint16(params.deflection_3) + c_params.velocity4 = c_int32(params.velocity_4) + + return c_params + + @staticmethod + def profile_mode_params(params: TLMC_ProfileModeParams) -> C_TLMC_ProfileModeParams: + + c_params = C_TLMC_ProfileModeParams() + c_params.mode = c_uint16(int(params.mode)) + c_params.jerk = c_uint32(params.jerk) + + return c_params + + @staticmethod + def value(params: TLMC_Value) -> C_TLMC_Value: + + c_params = C_TLMC_Value() + + val = params.value + + if isinstance(val, bool): + c_params.boolValue = c_bool(val) + elif isinstance(val, int): + c_params.int64Value = c_longlong(val) + else: + encoded = val.encode("utf-8")[:24] + padded = encoded + b"\x00" * (24 - len(encoded)) + c_params.String = (c_char * 24).from_buffer_copy(padded) + + return c_params + + @staticmethod + def stage_axis_params(params: TLMC_StageAxisParams) -> C_TLMC_StageAxisParams: + + c_params = C_TLMC_StageAxisParams() + c_params.typeId = c_uint16(int(params.type_id)) + c_params.axisId = c_uint16(int(params.axis_id)) + c_params.partNumber = MapPythonToNative.string(params.part_number) + c_params.serialNumber = c_uint32(params.serial_number) + c_params.countsPerUnit = c_uint32(params.counts_per_unit) + c_params.minPosition = c_int32(params.min_position) + c_params.maxPosition = c_int32(params.max_position) + c_params.maxAcceleration = c_uint32(params.max_acceleration) + c_params.maxDecceleration = c_uint32(params.max_deceleration) + c_params.maxVelocity = c_uint32(params.max_velocity) + c_params.gearBoxRatio = c_uint16(params.gear_box_ratio) + + return c_params + + @staticmethod + def stepper_loop_params(params: TLMC_StepperLoopParams) -> C_TLMC_StepperLoopParams: + + c_params = C_TLMC_StepperLoopParams() + c_params.loopMode = c_uint16(int(params.loop_mode)) + c_params.proportional = c_int32(params.proportional) + c_params.integral = c_int32(params.integral) + c_params.differential = c_int32(params.differential) + c_params.outputClip = c_int32(params.output_clip) + c_params.outputTolerance = c_int32(params.output_tolerance) + c_params.microstepsPerEncoderCount = c_uint32(params.microsteps_per_encoder_count) + + return c_params + + @staticmethod + def track_settle_params(params: TLMC_TrackSettleParams) -> C_TLMC_TrackSettleParams: + + c_params = C_TLMC_TrackSettleParams() + c_params.settleTime = c_uint16(params.settle_time) + c_params.settleWindow = c_uint16(params.settle_window) + c_params.trackWindow = c_uint16(params.track_window) + + return c_params + + @staticmethod + def trigger_params_for_dc_brushless(params: TLMC_TriggerParamsForDcBrushless) -> C_TLMC_TriggerParamsForDcBrushless: + + c_params = C_TLMC_TriggerParamsForDcBrushless() + c_params.modes = c_uint8(int(params.modes)) + + return c_params + + @staticmethod + def trigger_params_for_stepper(params: TLMC_TriggerParamsForStepper) -> C_TLMC_TriggerParamsForStepper: + + c_params = C_TLMC_TriggerParamsForStepper() + c_params.modes = c_uint8(int(params.modes)) + + return c_params + + @staticmethod + def velocity_params(params: TLMC_VelocityParams) -> C_TLMC_VelocityParams: + + c_params = C_TLMC_VelocityParams() + c_params.minVelocity = c_uint32(params.min_velocity) + c_params.acceleration = c_uint32(params.acceleration) + c_params.maxVelocity = c_uint32(params.max_velocity) + + return c_params \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/params.py b/Python/XA/src/thorlabs_xa/shared/params.py new file mode 100644 index 0000000..580fb2d --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/params.py @@ -0,0 +1,2960 @@ +from typing import Sequence + +from thorlabs_xa.shared.enums import TLMC_AnalogMonitorMotorChannel, TLMC_AnalogMonitorSystemVariable, TLMC_ButtonMode, TLMC_ConnectedProductAxisType, TLMC_ConnectedProductMovementType, TLMC_CurrentLoopPhase, TLMC_DeviceFamily, TLMC_DeviceType, TLMC_HardLimitOperatingMode, TLMC_HomeDirection, TLMC_HomeLimitSwitch, TLMC_IoPortMode, TLMC_IoPortSource, TLMC_JogMode, TLMC_JogStopMode, TLMC_JoystickDirectionSense, TLMC_KcubeIoTriggerMode, TLMC_KcubeIoTriggerPolarity, TLMC_KcubeMmi_JoystickDirectionSense, TLMC_KcubeMmi_JoystickGear, TLMC_KcubeMmi_JoystickMode, TLMC_PZ_KpcAnalogInputSource, TLMC_PZ_KpcIoTriggerMode, TLMC_PZ_KpcMmi_JoystickDirectionSense, TLMC_PZ_KpcMmi_JoystickMode, TLMC_PZ_KpcMonitorOutputMode, TLMC_PZ_KpcStrainGaugeOption, TLMC_PZ_KpcVoltageRange, TLMC_PZ_NanoTrakAbsolutePowerAdjustType, TLMC_PZ_NanoTrakCircleDiameterMode, TLMC_PZ_NanoTrakGainControlMode, TLMC_PZ_NanoTrakPhaseCompensationMode, TLMC_PZ_NanoTrakRange, TLMC_PZ_NanoTrakRangeChangeType, TLMC_PZ_NanoTrakRangeMode, TLMC_PZ_NanoTrakStatusBit, TLMC_PZ_NanoTrakTrackingMode, TLMC_PZ_NanoTrakTrackingState, TLMC_PZ_NanoTrakUnderOverReadType, TLMC_PZ_OutputVoltageControlSource, TLMC_PZ_OutputWaveformOperatingMode, TLMC_PZ_StatusBit, TLMC_PZ_TnaIoOutRangeType, TLMC_PZ_TnaIoOutRouteType, TLMC_PZ_TnaIoSignalOutputMode, TLMC_PZ_TnaIoSignalRangeType, TLMC_PZ_TnaIoSignalSourceBoostType, TLMC_PZ_TnaIoSignalSourceMode, TLMC_PZ_VoltageLimit, TLMC_ProfileMode, TLMC_SoftLimitOperatingMode, TLMC_StageAxis_AxisId, TLMC_StageAxis_TypeId, TLMC_StatusItemId, TLMC_StepperLoopParams_LoopMode, TLMC_TriggerModesForDcBrushless, TLMC_TriggerModesForStepper, TLMC_Unit, TLMC_UniversalStatusBit, TLMC_ValueType + +class TLMC_AnalogMonitorConfigurationParams(): + def __init__(self): + self._motor_channel = TLMC_AnalogMonitorMotorChannel.TLMC_AnalogMonitorMotorChannel_1 + self._system_variable = TLMC_AnalogMonitorSystemVariable.TLMC_AnalogMonitorSystemVariable_PositionError + self._scale = 0 + self._offset = 0 + + @property + def motor_channel(self) -> TLMC_AnalogMonitorMotorChannel: + return self._motor_channel + + @motor_channel.setter + def motor_channel(self, val: TLMC_AnalogMonitorMotorChannel): + self._motor_channel = val + + @property + def system_variable(self) -> TLMC_AnalogMonitorSystemVariable: + return self._system_variable + + @system_variable.setter + def system_variable(self, val: TLMC_AnalogMonitorSystemVariable): + self._system_variable = val + + @property + def scale(self) -> int: + return self._scale + + @scale.setter + def scale(self, val: int): + self._scale = val + + @property + def offset(self) -> int: + return self._offset + + @offset.setter + def offset(self, val: int): + self._offset = val + + +class TLMC_ApiVersion(): + def __init__(self): + self._major = 0 + self._minor = 0 + self._patch = 0 + self._build = 0 + self._prerelease_label = "" + self._display_string = "" + + @property + def major(self) -> int: + return self._major + + @major.setter + def major(self, val: int): + self._major = val + + @property + def minor(self) -> int: + return self._minor + + @minor.setter + def minor(self, val: int): + self._minor = val + + @property + def patch(self) -> int: + return self._patch + + @patch.setter + def patch(self, val: int): + self._patch = val + + @property + def build(self) -> int: + return self._build + + @build.setter + def build(self, val: int): + self._build = val + + @property + def prerelease_label(self) -> str: + return self._prerelease_label + + @prerelease_label.setter + def prerelease_label(self, val: str): + self._prerelease_label = val + + @property + def display_string(self) -> str: + return self._display_string + + @display_string.setter + def display_string(self, val: str): + self._display_string = val + + +class TLMC_ButtonParams(): + def __init__(self): + self._button_mode = TLMC_ButtonMode.TLMC_ButtonMode_Jog + self._position_1 = 0 + self._position_2 = 0 + self._timeout_1_milliseconds = 0 + self._timeout_2_milliseconds = 0 + + @property + def button_mode(self) -> TLMC_ButtonMode: + return self._button_mode + + @button_mode.setter + def button_mode(self, val: TLMC_ButtonMode): + self._button_mode = val + + @property + def position_1(self) -> int: + return self._position_1 + + @position_1.setter + def position_1(self, val: int): + self._position_1 = val + + @property + def position_2(self) -> int: + return self._position_2 + + @position_2.setter + def position_2(self, val: int): + self._position_2 = val + + @property + def timeout_1_milliseconds(self) -> int: + return self._timeout_1_milliseconds + + @timeout_1_milliseconds.setter + def timeout_1_milliseconds(self, val: int): + self._timeout_1_milliseconds = val + + @property + def timeout_2_milliseconds(self) -> int: + return self._timeout_2_milliseconds + + @timeout_2_milliseconds.setter + def timeout_2_milliseconds(self, val: int): + self._timeout_2_milliseconds = val + + +class TLMC_ConnectedProductInfo(): + def __init__(self): + self._product_name = "" + self._part_number = "" + self._axis_type = TLMC_ConnectedProductAxisType.TLMC_ConnectedProductAxisType_Unknown + self._movement_type = TLMC_ConnectedProductMovementType.TLMC_ConnectedProductMovementType_Unknown + self._unit_type = TLMC_Unit.TLMC_Unit_Unspecified + self._distance_scale_factor = 0.0 + self._velocity_scale_factor = 0.0 + self._acceleration_scale_factor = 0.0 + self._min_position = 0.0 + self._max_position = 0.0 + self._max_velocity = 0.0 + self._max_acceleration = 0.0 + + @property + def product_name(self) -> str: + return self._product_name + + @product_name.setter + def product_name(self, val: str): + self._product_name = val + + @property + def part_number(self) -> str: + return self._part_number + + @part_number.setter + def part_number(self, val: str): + self._part_number = val + + @property + def axis_type(self) -> TLMC_ConnectedProductAxisType: + return self._axis_type + + @axis_type.setter + def axis_type(self, val: TLMC_ConnectedProductAxisType): + self._axis_type = val + + @property + def movement_type(self) -> TLMC_ConnectedProductMovementType: + return self._movement_type + + @movement_type.setter + def movement_type(self, val: TLMC_ConnectedProductMovementType): + self._movement_type = val + + @property + def unit_type(self) -> TLMC_Unit: + return self._unit_type + + @unit_type.setter + def unit_type(self, val: TLMC_Unit): + self._unit_type = val + + @property + def distance_scale_factor(self) -> float: + return self._distance_scale_factor + + @distance_scale_factor.setter + def distance_scale_factor(self, val: float): + self._distance_scale_factor = val + + @property + def velocity_scale_factor(self) -> float: + return self._velocity_scale_factor + + @velocity_scale_factor.setter + def velocity_scale_factor(self, val: float): + self._velocity_scale_factor = val + + @property + def acceleration_scale_factor(self) -> float: + return self._acceleration_scale_factor + + @acceleration_scale_factor.setter + def acceleration_scale_factor(self, val: float): + self._acceleration_scale_factor = val + + @property + def min_position(self) -> float: + return self._min_position + + @min_position.setter + def min_position(self, val: float): + self._min_position = val + + @property + def max_position(self) -> float: + return self._max_position + + @max_position.setter + def max_position(self, val: float): + self._max_position = val + + @property + def max_velocity(self) -> float: + return self._max_velocity + + @max_velocity.setter + def max_velocity(self, val: float): + self._max_velocity = val + + @property + def max_acceleration(self) -> float: + return self._max_acceleration + + @max_acceleration.setter + def max_acceleration(self, val: float): + self._max_acceleration = val + + +class TLMC_TriggerParamsForDcBrushless(): + def __init__(self): + self._modes = TLMC_TriggerModesForDcBrushless.TLMC_TriggerModesForDcBrushless_InputActiveIsLogicHigh + + @property + def modes(self) -> TLMC_TriggerModesForDcBrushless: + return self._modes + + @modes.setter + def modes(self, val: TLMC_TriggerModesForDcBrushless): + self._modes = val + + +class TLMC_DeviceInfo(): + def __init__(self): + self._device_family = TLMC_DeviceFamily.TLMC_DeviceFamily_ThorlabsMotionControl + self._device_type = TLMC_DeviceType.TLMC_DeviceType_Bbd30xBaseUnit + self._part_number = "" + self._device = "" + self._transport = "" + self._parent_device = "" + self._device_type_description = "" + + @property + def device_family(self) -> TLMC_DeviceFamily: + return self._device_family + + @device_family.setter + def device_family(self, val: TLMC_DeviceFamily): + self._device_family = val + + @property + def device_type(self) -> TLMC_DeviceType: + return self._device_type + + @device_type.setter + def device_type(self, val: TLMC_DeviceType): + self._device_type = val + + @property + def part_number(self) -> str: + return self._part_number + + @part_number.setter + def part_number(self, val: str): + self._part_number = val + + @property + def device(self) -> str: + return self._device + + @device.setter + def device(self, val: str): + self._device = val + + @property + def transport(self) -> str: + return self._transport + + @transport.setter + def transport(self, val: str): + self._transport = val + + @property + def parent_device(self) -> str: + return self._parent_device + + @parent_device.setter + def parent_device(self, val: str): + self._parent_device = val + + @property + def device_type_description(self) -> str: + return self._device_type_description + + @device_type_description.setter + def device_type_description(self, val: str): + self._device_type_description = val + + +class TLMC_DcPidParams(): + def __init__(self): + self._proportional = 0 + self._integral = 0 + self._derivative = 0 + self._integralLimit = 0 + self._filterControl = 0 + + @property + def proportional(self) -> int: + return self._proportional + + @proportional.setter + def proportional(self, value: int): + self._proportional = value + + @property + def integral(self) -> int: + return self._integral + + @integral.setter + def integral(self, value: int): + self._integral = value + + @property + def derivative(self) -> int: + return self._derivative + + @derivative.setter + def derivative(self, value: int): + self._derivative = value + + @property + def integral_limit(self) -> int: + return self._integralLimit + + @integral_limit.setter + def integral_limit(self, value: int): + self._integralLimit = value + + @property + def filter_control(self) -> int: + return self._filterControl + + @filter_control.setter + def filter_control(self, value: int): + self._filterControl = value + + +class TLMC_FirmwareVersion(): + def __init__(self): + self._minor_version = 0 + self._interim_version = 0 + self._major_version = 0 + + @property + def minor_version(self) -> int: + return self._minor_version + + @minor_version.setter + def minor_version(self, val: int) -> None: + self._minor_version = val + + @property + def interim_version(self) -> int: + return self._interim_version + + @interim_version.setter + def interim_version(self, val: int) -> None: + self._interim_version = val + + @property + def major_version(self) -> int: + return self._major_version + + @major_version.setter + def major_version(self, val: int) -> None: + self._major_version = val + + +class TLMC_GeneralMoveParams(): + def __init__(self): + self._backlash_distance = 0 + + @property + def backlash_distance(self) -> int: + return self._backlash_distance + + @backlash_distance.setter + def backlash_distance(self, val: int): + self._backlash_distance = val + + +class TLMC_HardwareInfo(): + def __init__(self): + self._serial_number = 0 + self._part_number = "" + self._type = 0 + self._firmware_version = TLMC_FirmwareVersion() + self._notes = "" + self._device_dependent_data = "" + self._hardware_version = 0 + self._modification_state = 0 + self._number_of_channels = 0 + + @property + def serial_number(self) -> int: + return self._serial_number + + @serial_number.setter + def serial_number(self, val: int): + self._serial_number = val + + @property + def part_number(self) -> str: + return self._part_number + + @part_number.setter + def part_number(self, val: str): + self._part_number = val + + @property + def type(self) -> int: + return self._type + + @type.setter + def type(self, val: int): + self._type = val + + @property + def firmware_version(self) -> TLMC_FirmwareVersion: + return self._firmware_version + + @firmware_version.setter + def firmware_version(self, val: TLMC_FirmwareVersion): + self._firmware_version = val + + @property + def notes(self) -> str: + return self._notes + + @notes.setter + def notes(self, val: str): + self._notes = val + + @property + def device_dependent_data(self) -> str: + return self._device_dependent_data + + @device_dependent_data.setter + def device_dependent_data(self, val: str): + self._device_dependent_data = val + + @property + def hardware_version(self) -> int: + return self._hardware_version + + @hardware_version.setter + def hardware_version(self, val: int): + self._hardware_version = val + + @property + def modification_state(self) -> int: + return self._modification_state + + @modification_state.setter + def modification_state(self, val: int): + self._modification_state = val + + @property + def number_of_channels(self) -> int: + return self._number_of_channels + + @number_of_channels.setter + def number_of_channels(self, val: int): + self._number_of_channels = val + + +class TLMC_HomeParams(): + def __init__(self): + self._direction = TLMC_HomeDirection.TLMC_HomeDirection_Forward + self._limit_switch = TLMC_HomeLimitSwitch.TLMC_HomeLimitSwitch_Reverse + self._offset_distance = 0 + self._velocity = 0 + + @property + def direction(self) -> TLMC_HomeDirection: + return self._direction + + @direction.setter + def direction(self, val: TLMC_HomeDirection) -> None: + self._direction = val + + @property + def limit_switch(self) -> TLMC_HomeLimitSwitch: + return self._limit_switch + + @limit_switch.setter + def limit_switch(self, val: TLMC_HomeLimitSwitch) -> None: + self._limit_switch = val + + @property + def offset_distance(self) -> int: + return self._offset_distance + + @offset_distance.setter + def offset_distance(self, val: int) -> None: + self._offset_distance = val + + @property + def velocity(self) -> int: + return self._velocity + + @velocity.setter + def velocity(self, val: int) -> None: + self._velocity = val + + +class TLMC_IoConfigurationParams(): + def __init__(self): + self._mode = TLMC_IoPortMode.TLMC_IoPortMode_DigitalInput + self._trigger_out_source = TLMC_IoPortSource.TLMC_IoPortSource_Software + + @property + def mode(self) -> TLMC_IoPortMode: + return self._mode + + @mode.setter + def mode(self, val: TLMC_IoPortMode) -> None: + self._mode = val + + @property + def trigger_out_source(self) -> TLMC_IoPortSource: + return self._trigger_out_source + + @trigger_out_source.setter + def trigger_out_source(self, val: TLMC_IoPortSource) -> None: + self._trigger_out_source = val + + +class TLMC_IoTriggerParams(): + def __init__(self): + self._trigger_in_mode = 0 + self._trigger_in_polarity = 0 + self._trigger_in_source = 0 + self._trigger_out_mode = 0 + self._trigger_out_polarity = 0 + self._trigger_out_forward_start_position = 0 + self._trigger_out_forward_interval = 0 + self._trigger_out_forward_number_of_pulses = 0 + self._trigger_out_reverse_start_position = 0 + self._trigger_out_reverse_interval = 0 + self._trigger_out_reverse_number_of_pulses = 0 + self._trigger_out_pulse_width = 0 + self._trigger_out_number_of_cycles = 0 + + @property + def trigger_in_mode(self) -> int: + return self._trigger_in_mode + + @trigger_in_mode.setter + def trigger_in_mode(self, val: int): + self._trigger_in_mode = val + + @property + def trigger_in_polarity(self) -> int: + return self._trigger_in_polarity + + @trigger_in_polarity.setter + def trigger_in_polarity(self, val: int): + self._trigger_in_polarity = val + + @property + def trigger_in_source(self) -> int: + return self._trigger_in_source + + @trigger_in_source.setter + def trigger_in_source(self, val: int): + self._trigger_in_source = val + + @property + def trigger_out_mode(self) -> int: + return self._trigger_out_mode + + @trigger_out_mode.setter + def trigger_out_mode(self, val: int): + self._trigger_out_mode = val + + @property + def trigger_out_polarity(self) -> int: + return self._trigger_out_polarity + + @trigger_out_polarity.setter + def trigger_out_polarity(self, val: int): + self._trigger_out_polarity = val + + @property + def trigger_out_forward_start_position(self) -> int: + return self._trigger_out_forward_start_position + + @trigger_out_forward_start_position.setter + def trigger_out_forward_start_position(self, val: int): + self._trigger_out_forward_start_position = val + + @property + def trigger_out_forward_interval(self) -> int: + return self._trigger_out_forward_interval + + @trigger_out_forward_interval.setter + def trigger_out_forward_interval(self, val: int): + self._trigger_out_forward_interval = val + + @property + def trigger_out_forward_number_of_pulses(self) -> int: + return self._trigger_out_forward_number_of_pulses + + @trigger_out_forward_number_of_pulses.setter + def trigger_out_forward_number_of_pulses(self, val: int): + self._trigger_out_forward_number_of_pulses = val + + @property + def trigger_out_reverse_start_position(self) -> int: + return self._trigger_out_reverse_start_position + + @trigger_out_reverse_start_position.setter + def trigger_out_reverse_start_position(self, val: int): + self._trigger_out_reverse_start_position = val + + @property + def trigger_out_reverse_interval(self) -> int: + return self._trigger_out_reverse_interval + + @trigger_out_reverse_interval.setter + def trigger_out_reverse_interval(self, val: int): + self._trigger_out_reverse_interval = val + + @property + def trigger_out_reverse_number_of_pulses(self) -> int: + return self._trigger_out_reverse_number_of_pulses + + @trigger_out_reverse_number_of_pulses.setter + def trigger_out_reverse_number_of_pulses(self, val: int): + self._trigger_out_reverse_number_of_pulses = val + + @property + def trigger_out_pulse_width(self) -> int: + return self._trigger_out_pulse_width + + @trigger_out_pulse_width.setter + def trigger_out_pulse_width(self, val: int): + self._trigger_out_pulse_width = val + + @property + def trigger_out_number_of_cycles(self) -> int: + return self._trigger_out_number_of_cycles + + @trigger_out_number_of_cycles.setter + def trigger_out_number_of_cycles(self, val: int): + self._trigger_out_number_of_cycles = val + + +class TLMC_JogParams(): + def __init__(self): + self._mode = TLMC_JogMode.TLMC_JogMode_Continuous + self._step_size = 0 + self._min_velocity = 0 + self._acceleration = 0 + self._max_velocity = 0 + self._stop_mode = TLMC_JogStopMode.TLMC_JogStopMode_Immediate + + @property + def mode(self) -> TLMC_JogMode: + return self._mode + + @mode.setter + def mode(self, val: TLMC_JogMode): + self._mode = val + + @property + def step_size(self) -> int: + return self._step_size + + @step_size.setter + def step_size(self, val: int): + self._step_size = val + + @property + def min_velocity(self) -> int: + return self._min_velocity + + @min_velocity.setter + def min_velocity(self, val: int): + self._min_velocity = val + + @property + def acceleration(self) -> int: + return self._acceleration + + @acceleration.setter + def acceleration(self, val: int): + self._acceleration = val + + @property + def max_velocity(self) -> int: + return self._max_velocity + + @max_velocity.setter + def max_velocity(self, val: int): + self._max_velocity = val + + @property + def stop_mode(self) -> TLMC_JogStopMode: + return self._stop_mode + + @stop_mode.setter + def stop_mode(self, val: TLMC_JogStopMode): + self._stop_mode = val + + +class TLMC_JoystickParams(): + def __init__(self): + self._low_gear_max_velocity = 0 + self._high_gear_max_velocity = 0 + self._low_gear_acceleration = 0 + self._high_gear_acceleration = 0 + self._direction_sense = TLMC_JoystickDirectionSense.TLMC_JoystickDirectionSense_Positive + + @property + def low_gear_max_velocity(self) -> int: + return self._low_gear_max_velocity + + @low_gear_max_velocity.setter + def low_gear_max_velocity(self, val: int): + self._low_gear_max_velocity = val + + @property + def high_gear_max_velocity(self) -> int: + return self._high_gear_max_velocity + + @high_gear_max_velocity.setter + def high_gear_max_velocity(self, val: int): + self._high_gear_max_velocity = val + + @property + def low_gear_acceleration(self) -> int: + return self._low_gear_acceleration + + @low_gear_acceleration.setter + def low_gear_acceleration(self, val: int): + self._low_gear_acceleration = val + + @property + def high_gear_acceleration(self) -> int: + return self._high_gear_acceleration + + @high_gear_acceleration.setter + def high_gear_acceleration(self, val: int): + self._high_gear_acceleration = val + + @property + def direction_sense(self) -> TLMC_JoystickDirectionSense: + return self._direction_sense + + @direction_sense.setter + def direction_sense(self, val: TLMC_JoystickDirectionSense): + self._direction_sense = val + + +class TLMC_KcubeIoTriggerParams(): + def __init__(self): + self._trigger_1_mode = TLMC_KcubeIoTriggerMode.TLMC_KcubeIoTriggerMode_Disabled + self._trigger_1_polarity = TLMC_KcubeIoTriggerPolarity.TLMC_KcubeIoTriggerPolarity_ActiveIsLogicHigh + self._trigger_2_mode = TLMC_KcubeIoTriggerMode.TLMC_KcubeIoTriggerMode_Disabled + self._trigger_2_polarity = TLMC_KcubeIoTriggerPolarity.TLMC_KcubeIoTriggerPolarity_ActiveIsLogicHigh + + @property + def trigger_1_mode(self) -> TLMC_KcubeIoTriggerMode: + return self._trigger_1_mode + + @trigger_1_mode.setter + def trigger_1_mode(self, val: TLMC_KcubeIoTriggerMode): + self._trigger_1_mode = val + + @property + def trigger_1_polarity(self) -> TLMC_KcubeIoTriggerPolarity: + return self._trigger_1_polarity + + @trigger_1_polarity.setter + def trigger_1_polarity(self, val: TLMC_KcubeIoTriggerPolarity): + self._trigger_1_polarity = val + + @property + def trigger_2_mode(self) -> TLMC_KcubeIoTriggerMode: + return self._trigger_2_mode + + @trigger_2_mode.setter + def trigger_2_mode(self, val: TLMC_KcubeIoTriggerMode): + self._trigger_2_mode = val + + @property + def trigger_2_polarity(self) -> TLMC_KcubeIoTriggerPolarity: + return self._trigger_2_polarity + + @trigger_2_polarity.setter + def trigger_2_polarity(self, val: TLMC_KcubeIoTriggerPolarity): + self._trigger_2_polarity = val + + +class TLMC_KcubeMmiParams(): + def __init__(self): + self._joystick_mode = TLMC_KcubeMmi_JoystickMode.TLMC_KcubeMmi_JoystickMode_ControlsVelocity + self._joystick_max_velocity = 0 + self._joystick_acceleration = 0 + self._joystick_direction_sense = TLMC_KcubeMmi_JoystickDirectionSense.TLMC_KcubeMmi_JoystickDirectionSense_Disabled + self._preset_position_1 = 0 + self._preset_position_2 = 0 + self._display_brightness = 0 + self._display_timeout = 0 + self._display_dim_level = 0 + self._preset_position_3 = 0 + self._joystick_sensitivity = 0 + + @property + def joystick_mode(self) -> TLMC_KcubeMmi_JoystickMode: + return self._joystick_mode + + @joystick_mode.setter + def joystick_mode(self, val: TLMC_KcubeMmi_JoystickMode): + self._joystick_mode = val + + @property + def joystick_max_velocity(self) -> int: + return self._joystick_max_velocity + + @joystick_max_velocity.setter + def joystick_max_velocity(self, val: int): + self._joystick_max_velocity = val + + @property + def joystick_acceleration(self) -> int: + return self._joystick_acceleration + + @joystick_acceleration.setter + def joystick_acceleration(self, val: int): + self._joystick_acceleration = val + + @property + def joystick_direction_sense(self) -> TLMC_KcubeMmi_JoystickDirectionSense: + return self._joystick_direction_sense + + @joystick_direction_sense.setter + def joystick_direction_sense(self, val : TLMC_KcubeMmi_JoystickDirectionSense): + self._joystick_direction_sense = val + + @property + def preset_position_1(self) -> int: + return self._preset_position_1 + + @preset_position_1.setter + def preset_position_1(self, val: int): + self._preset_position_1 = val + + @property + def preset_position_2(self) -> int: + return self._preset_position_2 + + @preset_position_2.setter + def preset_position_2(self, val: int): + self._preset_position_2 = val + + @property + def display_brightness(self) -> int: + return self._display_brightness + + @display_brightness.setter + def display_brightness(self, val: int): + self._display_brightness = val + + @property + def display_timeout(self) -> int: + return self._display_timeout + + @display_timeout.setter + def display_timeout(self, val: int): + self._display_timeout = val + + @property + def display_dim_level(self) -> int: + return self._display_dim_level + + @display_dim_level.setter + def display_dim_level(self, val: int): + self._display_dim_level = val + + @property + def preset_position_3(self) -> int: + return self._preset_position_3 + + @preset_position_3.setter + def preset_position_3(self, val: int): + self._preset_position_3 = val + + @property + def joystick_sensitivity(self) -> int: + return self._joystick_sensitivity + + @joystick_sensitivity.setter + def joystick_sensitivity(self, val: int): + self._joystick_sensitivity = val + + +class TLMC_KcubePositionTriggerParams(): + def __init__(self): + self._forward_start_position = 0 + self._forward_interval = 0 + self._forward_number_of_pulses = 0 + self._reverse_start_position = 0 + self._reverse_interval = 0 + self._reverse_number_of_pulses = 0 + self._pulse_width = 0 + self._number_of_cycles = 0 + + @property + def forward_start_position(self) -> int: + return self._forward_start_position + + @forward_start_position.setter + def forward_start_position(self, val: int): + self._forward_start_position = val + + @property + def forward_interval(self) -> int: + return self._forward_interval + + @forward_interval.setter + def forward_interval(self, val: int): + self._forward_interval = val + + @property + def forward_number_of_pulses(self) -> int: + return self._forward_number_of_pulses + + @forward_number_of_pulses.setter + def forward_number_of_pulses(self, val: int): + self._forward_number_of_pulses = val + + @property + def reverse_start_position(self) -> int: + return self._reverse_start_position + + @reverse_start_position.setter + def reverse_start_position(self, val: int): + self._reverse_start_position = val + + @property + def reverse_interval(self) -> int: + return self._reverse_interval + + @reverse_interval.setter + def reverse_interval(self, val: int): + self._reverse_interval = val + + @property + def reverse_number_of_pulses(self) -> int: + return self._reverse_number_of_pulses + + @reverse_number_of_pulses.setter + def reverse_number_of_pulses(self, val: int): + self._reverse_number_of_pulses = val + + @property + def pulse_width(self) -> int: + return self._pulse_width + + @pulse_width.setter + def pulse_width(self, val: int): + self._pulse_width = val + + @property + def number_of_cycles(self) -> int: + return self._number_of_cycles + + @number_of_cycles.setter + def number_of_cycles(self, val: int): + self._number_of_cycles = val + + +class TLMC_LcdDisplayParams(): + def __init__(self): + self._knob_sensitivity = 0 + self._display_brightness = 0 + self._display_timeout = 0 + self._display_dim_level = 0 + + @property + def knob_sensitivity(self) -> int: + return self._knob_sensitivity + + @knob_sensitivity.setter + def knob_sensitivity(self, val: int): + self._knob_sensitivity = val + + @property + def display_brightness(self) -> int: + return self._display_brightness + + @display_brightness.setter + def display_brightness(self, val: int): + self._display_brightness = val + + @property + def display_timeout(self) -> int: + return self._display_timeout + + @display_timeout.setter + def display_timeout(self, val: int): + self._display_timeout = val + + @property + def display_dim_level(self) -> int: + return self._display_dim_level + + @display_dim_level.setter + def display_dim_level(self, val: int): + self._display_dim_level = val + + +class TLMC_LcdMoveParams(): + def __init__(self): + self._knob_mode = 0 + self._jog_step_size = 0 + self._acceleration = 0 + self._max_velocity = 0 + self._jog_stop_mode = TLMC_JogStopMode.TLMC_JogStopMode_Immediate + self._preset_position = [] + + @property + def knob_mode(self) -> int: + return self._knob_mode + + @knob_mode.setter + def knob_mode(self, val: int): + self._knob_mode = val + + @property + def jog_step_size(self) -> int: + return self._jog_step_size + + @jog_step_size.setter + def jog_step_size(self, val: int): + self._jog_step_size = val + + @property + def acceleration(self) -> int: + return self._acceleration + + @acceleration.setter + def acceleration(self, val: int): + self._acceleration = val + + @property + def max_velocity(self) -> int: + return self._max_velocity + + @max_velocity.setter + def max_velocity(self, val: int): + self._max_velocity = val + + @property + def jog_stop_mode(self) -> TLMC_JogStopMode: + return self._jog_stop_mode + + @jog_stop_mode.setter + def jog_stop_mode(self, val: TLMC_JogStopMode): + self._jog_stop_mode = val + + @property + def preset_position(self) -> list[int]: + return self._preset_position + + @preset_position.setter + def preset_position(self, vals: Sequence[int]): + self._preset_position = [ + int(v) for i, v in enumerate(vals) # type: ignore + ] + + +class TLMC_LimitSwitchParams(): + def __init__(self): + self._clockwise_hard_limit_operating_mode = TLMC_HardLimitOperatingMode.TLMC_HardLimitOperatingMode_SwitchIgnored + self._counterclockwise_hard_limit_operating_mode = TLMC_HardLimitOperatingMode.TLMC_HardLimitOperatingMode_SwitchIgnored + self._clockwise_soft_limit = 0 + self._counterclockwise_soft_limit = 0 + self._soft_limit_operating_mode = TLMC_SoftLimitOperatingMode.TLMC_SoftLimitOperatingMode_FeatureNotSupported + + @property + def clockwise_limit_mode(self) -> TLMC_HardLimitOperatingMode: + return self._clockwise_hard_limit_operating_mode + + @clockwise_limit_mode.setter + def clockwise_limit_mode(self, val: TLMC_HardLimitOperatingMode): + self._clockwise_hard_limit_operating_mode = val + + @property + def counterclockwise_limit_mode(self) -> TLMC_HardLimitOperatingMode: + return self._counterclockwise_hard_limit_operating_mode + + @counterclockwise_limit_mode.setter + def counterclockwise_limit_mode(self, val: TLMC_HardLimitOperatingMode): + self._counterclockwise_hard_limit_operating_mode = val + + @property + def clockwise_soft_limit(self) -> int: + return self._clockwise_soft_limit + + @clockwise_soft_limit.setter + def clockwise_soft_limit(self, val: int): + self._clockwise_soft_limit = val + + @property + def counterclockwise_soft_limit(self) -> int: + return self._counterclockwise_soft_limit + + @counterclockwise_soft_limit.setter + def counterclockwise_soft_limit(self, val: int): + self._counterclockwise_soft_limit = val + + @property + def soft_limit_operating_mode(self) -> TLMC_SoftLimitOperatingMode: + return self._soft_limit_operating_mode + + @soft_limit_operating_mode.setter + def soft_limit_operating_mode(self, val: TLMC_SoftLimitOperatingMode): + self._soft_limit_operating_mode = val + + +class TLMC_MotorOutputParams(): + def __init__(self): + self._continuous_current_limit = 0 + self._energy_limit = 0 + self._motor_limit = 0 + self._motor_bias = 0 + + @property + def continuous_current_limit(self) -> int: + return self._continuous_current_limit + + @continuous_current_limit.setter + def continuous_current_limit(self, val: int): + self._continuous_current_limit = val + + @property + def energy_limit(self) -> int: + return self._energy_limit + + @energy_limit.setter + def energy_limit(self, val: int): + self._energy_limit = val + + @property + def motor_limit(self) -> int: + return self._motor_limit + + @motor_limit.setter + def motor_limit(self, val: int): + self._motor_limit = val + + @property + def motor_bias(self) -> int: + return self._motor_bias + + @motor_bias.setter + def motor_bias(self, val: int): + self._motor_bias = val + + +class TLMC_MoveAbsoluteParams(): + def __init__(self): + self._absolute_position = 0 + + @property + def absolute_position(self) -> int: + return self._absolute_position + + @absolute_position.setter + def absolute_position(self, val: int): + self._absolute_position = val + + +class TLMC_MoveRelativeParams(): + def __init__(self): + self._relative_distance = 0 + + @property + def relative_distance(self) -> int: + return self._relative_distance + + @relative_distance.setter + def relative_distance(self, val: int): + self._relative_distance = val + + +class TLMC_PositionLoopParams(): + def __init__(self): + self._proportional = 0 + self._integral = 0 + self._integral_limit = 0 + self._derivative = 0 + self._servo_cycles = 0 + self._scale = 0 + self._velocity_feed_forward = 0 + self._acceleration_feed_forward = 0 + self._error_limit = 0 + + @property + def proportional(self) -> int: + return self._proportional + + @proportional.setter + def proportional(self, val: int): + self._proportional = val + + @property + def integral(self) -> int: + return self._integral + + @integral.setter + def integral(self, val: int): + self._integral = val + + @property + def integral_limit(self) -> int: + return self._integral_limit + + @integral_limit.setter + def integral_limit(self, val: int): + self._integral_limit = val + + @property + def derivative(self) -> int: + return self._derivative + + @derivative.setter + def derivative(self, val: int): + self._derivative = val + + @property + def servo_cycles(self) -> int: + return self._servo_cycles + + @servo_cycles.setter + def servo_cycles(self, val: int): + self._servo_cycles = val + + @property + def scale(self) -> int: + return self._scale + + @scale.setter + def scale(self, val: int): + self._scale = val + + @property + def velocity_feed_forward(self) -> int: + return self._velocity_feed_forward + + @velocity_feed_forward.setter + def velocity_feed_forward(self, val: int): + self._velocity_feed_forward = val + + @property + def acceleration_feed_forward(self) -> int: + return self._acceleration_feed_forward + + @acceleration_feed_forward.setter + def acceleration_feed_forward(self, val: int): + self._acceleration_feed_forward = val + + @property + def error_limit(self) -> int: + return self._error_limit + + @error_limit.setter + def error_limit(self, val: int): + self._error_limit = val + + +class TLMC_PZ_KpcIoTriggerParams(): + def __init__(self): + self._trigger_1_mode = TLMC_PZ_KpcIoTriggerMode.TLMC_PZ_KpcIoTriggerMode_Disabled + self._trigger_1_polarity = TLMC_KcubeIoTriggerPolarity.TLMC_KcubeIoTriggerPolarity_ActiveIsLogicHigh + self._trigger_2_mode = TLMC_PZ_KpcIoTriggerMode.TLMC_PZ_KpcIoTriggerMode_Disabled + self._trigger_2_polarity = TLMC_KcubeIoTriggerPolarity.TLMC_KcubeIoTriggerPolarity_ActiveIsLogicHigh + self._strain_gauge_lower_limit = 0 + self._strain_gauge_upper_limit = 0 + self._smoothing_samples = 0 + self._monitor_output_mode = TLMC_PZ_KpcMonitorOutputMode.TLMC_PZ_KpcMonitorOutputMode_Software + self._monitor_filter_cut_off_frequency = 0 + self._monitor_output_software_value = 0 + + @property + def trigger_1_mode(self) -> TLMC_PZ_KpcIoTriggerMode: + return self._trigger_1_mode + + @trigger_1_mode.setter + def trigger_1_mode(self, val: TLMC_PZ_KpcIoTriggerMode): + self._trigger_1_mode = val + + @property + def trigger_1_polarity(self) -> TLMC_KcubeIoTriggerPolarity: + return self._trigger_1_polarity + + @trigger_1_polarity.setter + def trigger_1_polarity(self, val: TLMC_KcubeIoTriggerPolarity): + self._trigger_1_polarity = val + + @property + def trigger_2_mode(self) -> TLMC_PZ_KpcIoTriggerMode: + return self._trigger_2_mode + + @trigger_2_mode.setter + def trigger_2_mode(self, val: TLMC_PZ_KpcIoTriggerMode): + self._trigger_2_mode = val + + @property + def trigger_2_polarity(self) -> TLMC_KcubeIoTriggerPolarity: + return self._trigger_2_polarity + + @trigger_2_polarity.setter + def trigger_2_polarity(self, val: TLMC_KcubeIoTriggerPolarity): + self._trigger_2_polarity = val + + @property + def strain_gauge_lower_limit(self) -> int: + return self._strain_gauge_lower_limit + + @strain_gauge_lower_limit.setter + def strain_gauge_lower_limit(self, val: int): + self._strain_gauge_lower_limit = val + + @property + def strain_gauge_upper_limit(self) -> int: + return self._strain_gauge_upper_limit + + @strain_gauge_upper_limit.setter + def strain_gauge_upper_limit(self, val: int): + self._strain_gauge_upper_limit = val + + @property + def smoothing_samples(self) -> int: + return self._smoothing_samples + + @smoothing_samples.setter + def smoothing_samples(self, val: int): + self._smoothing_samples = val + + @property + def monitor_output_mode(self) -> TLMC_PZ_KpcMonitorOutputMode: + return self._monitor_output_mode + + @monitor_output_mode.setter + def monitor_output_mode(self, val: TLMC_PZ_KpcMonitorOutputMode): + self._monitor_output_mode = val + + @property + def monitor_filter_cut_off_frequency(self) -> int: + return self._monitor_filter_cut_off_frequency + + @monitor_filter_cut_off_frequency.setter + def monitor_filter_cut_off_frequency(self, val: int): + self._monitor_filter_cut_off_frequency = val + + @property + def monitor_output_software_value(self) -> int: + return self._monitor_output_software_value + + @monitor_output_software_value.setter + def monitor_output_software_value(self, val: int): + self._monitor_output_software_value = val + + +class TLMC_PZ_KpcIoSettingsParams(): + def __init__(self): + self._voltage_limit = 0 + self._analog_input_source = TLMC_PZ_KpcAnalogInputSource.TLMC_PZ_KpcAnalogInputSource_Disabled + self._filter_cut_off_frequency = 0 + self._voltage_range = TLMC_PZ_KpcVoltageRange.TLMC_PZ_KpcVoltageRange_75Volts + self._force_sense = 0 + self._strain_gauge_option = TLMC_PZ_KpcStrainGaugeOption.TLMC_PZ_KpcStrainGaugeOption_Position + + @property + def voltage_limit(self) -> int: + return self._voltage_limit + + @voltage_limit.setter + def voltage_limit(self, val: int): + self._voltage_limit = val + + @property + def analog_input_source(self) -> TLMC_PZ_KpcAnalogInputSource: + return self._analog_input_source + + @analog_input_source.setter + def analog_input_source(self, val: TLMC_PZ_KpcAnalogInputSource): + self._analog_input_source = val + + @property + def filter_cut_off_frequency(self) -> int: + return self._filter_cut_off_frequency + + @filter_cut_off_frequency.setter + def filter_cut_off_frequency(self, val: int): + self._filter_cut_off_frequency = val + + @property + def voltage_range(self) -> TLMC_PZ_KpcVoltageRange: + return self._voltage_range + + @voltage_range.setter + def voltage_range(self, val: TLMC_PZ_KpcVoltageRange): + self._voltage_range = val + + @property + def force_sense(self) -> int: + return self._force_sense + + @force_sense.setter + def force_sense(self, val: int): + self._force_sense = val + + @property + def strain_gauge_option(self) -> TLMC_PZ_KpcStrainGaugeOption: + return self._strain_gauge_option + + @strain_gauge_option.setter + def strain_gauge_option(self, val: TLMC_PZ_KpcStrainGaugeOption): + self._strain_gauge_option = val + + +class TLMC_PZ_KpcMmiParams(): + def __init__(self): + self._joystick_mode = TLMC_PZ_KpcMmi_JoystickMode.TLMC_PZ_KpcMmiJoystickMode_ControlsVoltagePosition + self._joystick_gear = TLMC_KcubeMmi_JoystickGear.TLMC_KcubeMmiJoystickGear_High + self._joystick_voltage_step_size = 0 + self._joystick_position_step_size = 0 + self._joystick_direction_sense = TLMC_PZ_KpcMmi_JoystickDirectionSense.TLMC_PZ_KpcMmiJoystickDirectionSense_Disabled + self._preset_voltage_1 = 0 + self._preset_voltage_2 = 0 + self._preset_position_1 = 0 + self._preset_position_2 = 0 + self._display_brightness = 0 + self._display_timeout = 0 + self._display_dim_level = 0 + + @property + def joystick_mode(self) -> TLMC_PZ_KpcMmi_JoystickMode: + return self._joystick_mode + + @joystick_mode.setter + def joystick_mode(self, val: TLMC_PZ_KpcMmi_JoystickMode) -> None: + self._joystick_mode = val + + @property + def joystick_gear(self) -> TLMC_KcubeMmi_JoystickGear: + return self._joystick_gear + + @joystick_gear.setter + def joystick_gear(self, val: TLMC_KcubeMmi_JoystickGear) -> None: + self._joystick_gear = val + + @property + def joystick_voltage_step_size(self) -> int: + return self._joystick_voltage_step_size + + @joystick_voltage_step_size.setter + def joystick_voltage_step_size(self, val: int) -> None: + self._joystick_voltage_step_size = val + + @property + def joystick_position_step_size(self) -> int: + return self._joystick_position_step_size + + @joystick_position_step_size.setter + def joystick_position_step_size(self, val: int) -> None: + self._joystick_position_step_size = val + + @property + def joystick_direction_sense(self) -> TLMC_PZ_KpcMmi_JoystickDirectionSense: + return self._joystick_direction_sense + + @joystick_direction_sense.setter + def joystick_direction_sense(self, val: TLMC_PZ_KpcMmi_JoystickDirectionSense) -> None: + self._joystick_direction_sense = val + + @property + def preset_voltage_1(self) -> int: + return self._preset_voltage_1 + + @preset_voltage_1.setter + def preset_voltage_1(self, val: int) -> None: + self._preset_voltage_1 = val + + @property + def preset_voltage_2(self) -> int: + return self._preset_voltage_2 + + @preset_voltage_2.setter + def preset_voltage_2(self, val: int) -> None: + self._preset_voltage_2 = val + + @property + def preset_position_1(self) -> int: + return self._preset_position_1 + + @preset_position_1.setter + def preset_position_1(self, val: int) -> None: + self._preset_position_1 = val + + @property + def preset_position_2(self) -> int: + return self._preset_position_2 + + @preset_position_2.setter + def preset_position_2(self, val: int) -> None: + self._preset_position_2 = val + + @property + def display_brightness(self) -> int: + return self._display_brightness + + @display_brightness.setter + def display_brightness(self, val: int) -> None: + self._display_brightness = val + + @property + def display_timeout(self) -> int: + return self._display_timeout + + @display_timeout.setter + def display_timeout(self, val: int) -> None: + self._display_timeout = val + + @property + def display_dim_level(self) -> int: + return self._display_dim_level + + @display_dim_level.setter + def display_dim_level(self, val: int) -> None: + self._display_dim_level = val + + +class TLMC_PZ_MaxOutputVoltageParams(): + def __init__(self): + self._max_output_voltage = 0 + self._voltage_limit = TLMC_PZ_VoltageLimit.TLMC_PZ_VoltageLimit_75Volts + + @property + def max_output_voltage(self) -> int: + return self._max_output_voltage + + @max_output_voltage.setter + def max_output_voltage(self, val: int): + self._max_output_voltage = val + + @property + def voltage_limit(self) -> TLMC_PZ_VoltageLimit: + return self._voltage_limit + + @voltage_limit.setter + def voltage_limit(self, val: TLMC_PZ_VoltageLimit): + self._voltage_limit = val + + +class TLMC_PZ_NanoTrakCircleDiameterLookupTableData(): + def __init__(self): + self._lookup_table_values = [] + + @property + def lookup_table_values(self)-> list[int]: + return self._lookup_table_values + + @lookup_table_values.setter + def lookup_table_values(self, val: list[int]) -> None: + self._lookup_table_values = val + + +class TLMC_PZ_NanoTrakCircleHomePositionParams(): + def __init__(self): + self._circle_home_position_a = 0 + self._circle_home_position_b = 0 + + @property + def circle_home_position_a(self) -> int: + return self._circle_home_position_a + + @circle_home_position_a.setter + def circle_home_position_a(self, val: int) -> None: + self._circle_home_position_a = val + + @property + def circle_home_position_b(self) -> int: + return self._circle_home_position_b + + @circle_home_position_b.setter + def circle_home_position_b(self, val: int) -> None: + self._circle_home_position_b = val + + +class TLMC_PZ_NanoTrakCircleParams(): + def __init__(self): + self._circle_diameter_mode = TLMC_PZ_NanoTrakCircleDiameterMode.TLMC_PZ_NanoTrakCircleDiameterModes_Software + self._circle_diameter_software = 0 + self._circle_oscillation_frequency = 0 + self._absolute_power_min_circle_diameter = 0 + self._absolute_power_max_circle_diameter = 0 + self._absolute_power_adjust_type = TLMC_PZ_NanoTrakAbsolutePowerAdjustType.TLMC_PZ_NanoTrakAbsolutePowerAdjustType_LIN + + @property + def circle_diameter_mode(self) -> TLMC_PZ_NanoTrakCircleDiameterMode: + return self._circle_diameter_mode + + @circle_diameter_mode.setter + def circle_diameter_mode(self, val: TLMC_PZ_NanoTrakCircleDiameterMode) -> None: + self._circle_diameter_mode = val + + @property + def circle_diameter_software(self) -> int: + return self._circle_diameter_software + + @circle_diameter_software.setter + def circle_diameter_software(self, val: int) -> None: + self._circle_diameter_software = val + + @property + def circle_oscillation_frequency(self) -> int: + return self._circle_oscillation_frequency + + @circle_oscillation_frequency.setter + def circle_oscillation_frequency(self, val: int) -> None: + self._circle_oscillation_frequency = val + + @property + def absolute_power_min_circle_diameter(self) -> int: + return self._absolute_power_min_circle_diameter + + @absolute_power_min_circle_diameter.setter + def absolute_power_min_circle_diameter(self, val: int) -> None: + self._absolute_power_min_circle_diameter = val + + @property + def absolute_power_max_circle_diameter(self) -> int: + return self._absolute_power_max_circle_diameter + + @absolute_power_max_circle_diameter.setter + def absolute_power_max_circle_diameter(self, val: int) -> None: + self._absolute_power_max_circle_diameter = val + + @property + def absolute_power_adjust_type(self) -> TLMC_PZ_NanoTrakAbsolutePowerAdjustType: + return self._absolute_power_adjust_type + + @absolute_power_adjust_type.setter + def absolute_power_adjust_type(self, val: TLMC_PZ_NanoTrakAbsolutePowerAdjustType) -> None: + self._absolute_power_adjust_type = val + + +class TLMC_PZ_NanoTrakEEPROMParams(): + def __init__(self): + self._channel_identifier = 0 + self._message_id = 0 + + @property + def channel_identifier(self) -> int: + return self._channel_identifier + + @channel_identifier.setter + def channel_identifier(self, val: int) -> None: + self._channel_identifier = val + + @property + def message_id(self) -> int: + return self._message_id + + @message_id.setter + def message_id(self, val: int) -> None: + self._message_id = val + + +class TLMC_PZ_NanoTrakGainParams(): + def __init__(self): + self._gain_control_mode = TLMC_PZ_NanoTrakGainControlMode.TLMC_PZ_NanoTrakGainControlMode_Software + self._gain = 0 + + @property + def gain_control_mode(self) -> TLMC_PZ_NanoTrakGainControlMode: + return self._gain_control_mode + + @gain_control_mode.setter + def gain_control_mode(self, val: TLMC_PZ_NanoTrakGainControlMode) -> None: + self._gain_control_mode = val + + @property + def gain(self) -> int: + return self._gain + + @gain.setter + def gain(self, val: int) -> None: + self._gain = val + + +class TLMC_PZ_NanoTrakMode(): + def __init__(self): + self._state = TLMC_PZ_NanoTrakTrackingState.TLMC_PZ_NanoTrakTrackingState_ModeUndefined + self._mode = TLMC_PZ_NanoTrakTrackingMode.TLMC_PZ_NanoTrakTrackingMode_DualAxisTracking + + @property + def state(self) -> TLMC_PZ_NanoTrakTrackingState: + return self._state + + @state.setter + def state(self, val: TLMC_PZ_NanoTrakTrackingState) -> None: + self._state = val + + @property + def mode(self) -> TLMC_PZ_NanoTrakTrackingMode: + return self._mode + + @mode.setter + def mode(self, val: TLMC_PZ_NanoTrakTrackingMode) -> None: + self._mode = val + + +class TLMC_PZ_NanoTrakPhaseCompensationParams(): + def __init__(self): + self._phase_compensation_mode = TLMC_PZ_NanoTrakPhaseCompensationMode.TLMC_PZ_NanoTrakPhaseCompensationMode_Manual + self._phase_compensation_a_software = 0 + self._phase_compensation_b_software = 0 + + @property + def phase_compensation_mode(self) -> TLMC_PZ_NanoTrakPhaseCompensationMode: + return self._phase_compensation_mode + + @phase_compensation_mode.setter + def phase_compensation_mode(self, val: TLMC_PZ_NanoTrakPhaseCompensationMode) -> None: + self._phase_compensation_mode = val + + @property + def phase_compensation_a_software(self) -> int: + return self._phase_compensation_a_software + + @phase_compensation_a_software.setter + def phase_compensation_a_software(self, val: int) -> None: + self._phase_compensation_a_software = val + + @property + def phase_compensation_b_software(self) -> int: + return self._phase_compensation_b_software + + @phase_compensation_b_software.setter + def phase_compensation_b_software(self, val: int) -> None: + self._phase_compensation_b_software = val + + +class TLMC_PZ_NanoTrakRangeParams(): + def __init__(self): + self._range_mode = TLMC_PZ_NanoTrakRangeMode.TLMC_PZ_NanoTrakRangeMode_Auto + self._range_up_limit = 0 + self._range_down_limit = 0 + self._settle_samples = 0 + self._range_change_type = TLMC_PZ_NanoTrakRangeChangeType.TLMC_PZ_NanoTrakRangeChangeType_All + self._range_type = TLMC_PZ_NanoTrakRange.TLMC_PZ_NanoTrakRange_Range1 + + @property + def range_mode(self) -> TLMC_PZ_NanoTrakRangeMode: + return self._range_mode + + @range_mode.setter + def range_mode(self, val: TLMC_PZ_NanoTrakRangeMode) -> None: + self._range_mode = val + + @property + def range_up_limit(self) -> int: + return self._range_up_limit + + @range_up_limit.setter + def range_up_limit(self, val: int) -> None: + self._range_up_limit = val + + @property + def range_down_limit(self) -> int: + return self._range_down_limit + + @range_down_limit.setter + def range_down_limit(self, val: int) -> None: + self._range_down_limit = val + + @property + def settle_samples(self) -> int: + return self._settle_samples + + @settle_samples.setter + def settle_samples(self, val: int) -> None: + self._settle_samples = val + + @property + def range_change_type(self) -> TLMC_PZ_NanoTrakRangeChangeType: + return self._range_change_type + + @range_change_type.setter + def range_change_type(self, val: TLMC_PZ_NanoTrakRangeChangeType) -> None: + self._range_change_type = val + + @property + def range_type(self) -> TLMC_PZ_NanoTrakRange: + return self._range_type + + @range_type.setter + def range_type(self, val: TLMC_PZ_NanoTrakRange) -> None: + self._range_type = val + + +class TLMC_PZ_NanoTrakStatus(): + def __init__(self): + self._circle_position_a = 0 + self._circle_position_b = 0 + self._circle_diameter = 0 + self._absolute_reading = 0 + self._relative_reading = 0 + self._range = TLMC_PZ_NanoTrakRange.TLMC_PZ_NanoTrakRange_Range1 + self._under_over_read = TLMC_PZ_NanoTrakUnderOverReadType.TLMC_PZ_NanoTrakUnderOverReadType_InRange + self._status_bits = TLMC_PZ_NanoTrakStatusBit.TLMC_PZ_NanoTrakStatusBit_Tracking + self._nano_trak_gain = 0 + self._phase_compensation_a = 0 + self._phase_compensation_b = 0 + + @property + def circle_position_a(self) -> int: + return self._circle_position_a + + @circle_position_a.setter + def circle_position_a(self, val: int) -> None: + self._circle_position_a = val + + @property + def circle_position_b(self) -> int: + return self._circle_position_b + + @circle_position_b.setter + def circle_position_b(self, val: int) -> None: + self._circle_position_b = val + + @property + def circle_diameter(self) -> int: + return self._circle_diameter + + @circle_diameter.setter + def circle_diameter(self, val: int) -> None: + self._circle_diameter = val + + @property + def absolute_reading(self) -> int: + return self._absolute_reading + + @absolute_reading.setter + def absolute_reading(self, val: int) -> None: + self._absolute_reading = val + + @property + def relative_reading(self) -> int: + return self._relative_reading + + @relative_reading.setter + def relative_reading(self, val: int) -> None: + self._relative_reading = val + + @property + def range(self) -> TLMC_PZ_NanoTrakRange: + return self._range + + @range.setter + def range(self, val: TLMC_PZ_NanoTrakRange) -> None: + self._range = val + + @property + def under_over_read(self) -> TLMC_PZ_NanoTrakUnderOverReadType: + return self._under_over_read + + @under_over_read.setter + def under_over_read(self, val: TLMC_PZ_NanoTrakUnderOverReadType) -> None: + self._under_over_read = val + + @property + def status_bits(self) -> TLMC_PZ_NanoTrakStatusBit: + return self._status_bits + + @status_bits.setter + def status_bits(self, val: TLMC_PZ_NanoTrakStatusBit) -> None: + self._status_bits = val + + @property + def nano_trak_gain(self) -> int: + return self._nano_trak_gain + + @nano_trak_gain.setter + def nano_trak_gain(self, val: int) -> None: + self._nano_trak_gain = val + + @property + def phase_compensation_a(self) -> int: + return self._phase_compensation_a + + @phase_compensation_a.setter + def phase_compensation_a(self, val: int) -> None: + self._phase_compensation_a = val + + @property + def phase_compensation_b(self) -> int: + return self._phase_compensation_b + + @phase_compensation_b.setter + def phase_compensation_b(self, val: int) -> None: + self._phase_compensation_b = val + + +class TLMC_PZ_NanoTrakTnaIoSettings(): + def __init__(self): + self._out_range_type = TLMC_PZ_TnaIoOutRangeType.TLMC_PZ_TnaIoOutRangeType_5V + self._out_route_type = TLMC_PZ_TnaIoOutRouteType.TLMC_PZ_TnaIoOutRouteType_SmaConnectorsOnly + self._signal_source_mode = TLMC_PZ_TnaIoSignalSourceMode.TLMC_PZ_TnaIoSignalSourceMode_InternalPin + self._signal_source_boost_type = TLMC_PZ_TnaIoSignalSourceBoostType.TLMC_PZ_TnaIoSignalSourceBoostType_Disabled + self._signal_output_mode = TLMC_PZ_TnaIoSignalOutputMode.TLMC_PZ_TnaIoSignalOutputMode_Disabled + self._channel_1_signal_range_type = TLMC_PZ_TnaIoSignalRangeType.TLMC_PZ_TnaIoSignalRangeType_75V + self._channel_2_signal_range_type = TLMC_PZ_TnaIoSignalRangeType.TLMC_PZ_TnaIoSignalRangeType_75V + + @property + def out_range_type(self) -> TLMC_PZ_TnaIoOutRangeType: + return self._out_range_type + + @out_range_type.setter + def out_range_type(self, val: TLMC_PZ_TnaIoOutRangeType) -> None: + self._out_range_type = val + + @property + def out_route_type(self) -> TLMC_PZ_TnaIoOutRouteType: + return self._out_route_type + + @out_route_type.setter + def out_route_type(self, val: TLMC_PZ_TnaIoOutRouteType) -> None: + self._out_route_type = val + + @property + def signal_source_mode(self) -> TLMC_PZ_TnaIoSignalSourceMode: + return self._signal_source_mode + + @signal_source_mode.setter + def signal_source_mode(self, val: TLMC_PZ_TnaIoSignalSourceMode) -> None: + self._signal_source_mode = val + + @property + def signal_source_boost_type(self) -> TLMC_PZ_TnaIoSignalSourceBoostType: + return self._signal_source_boost_type + + @signal_source_boost_type.setter + def signal_source_boost_type(self, val: TLMC_PZ_TnaIoSignalSourceBoostType) -> None: + self._signal_source_boost_type = val + + @property + def signal_output_mode(self) -> TLMC_PZ_TnaIoSignalOutputMode: + return self._signal_output_mode + + @signal_output_mode.setter + def signal_output_mode(self, val: TLMC_PZ_TnaIoSignalOutputMode) -> None: + self._signal_output_mode = val + + @property + def channel_1_signal_range_type(self) -> TLMC_PZ_TnaIoSignalRangeType: + return self._channel_1_signal_range_type + + @channel_1_signal_range_type.setter + def channel_1_signal_range_type(self, val: TLMC_PZ_TnaIoSignalRangeType) -> None: + self._channel_1_signal_range_type = val + + @property + def channel_2_signal_range_type(self) -> TLMC_PZ_TnaIoSignalRangeType: + return self._channel_2_signal_range_type + + @channel_2_signal_range_type.setter + def channel_2_signal_range_type(self, val: TLMC_PZ_TnaIoSignalRangeType) -> None: + self._channel_2_signal_range_type = val + + +class TLMC_PZ_NanoTrakTrackThresholdParams(): + def __init__(self): + self._track_threshold = 0 + + @property + def track_threshold(self) -> int: + return self._track_threshold + + @track_threshold.setter + def track_threshold(self, val: int) -> None: + self._track_threshold = val + + +class TLMC_PZ_OutputVoltageControlSourceParams(): + def __init__(self): + self._source = TLMC_PZ_OutputVoltageControlSource.TLMC_PZ_OutputVoltageControlSource_SoftwareOnly + + @property + def source(self) -> TLMC_PZ_OutputVoltageControlSource: + return self._source + + @source.setter + def source(self, val: TLMC_PZ_OutputVoltageControlSource): + self._source = val + + +class TLMC_PZ_OutputWaveformLoopTableSample(): + def __init__(self): + self._index = 0 + self._voltage = 0 + + @property + def index(self) -> int: + return self._index + + @index.setter + def index(self, val: int): + self._index = val + + @property + def voltage(self) -> int: + return self._voltage + + @voltage.setter + def voltage(self, val: int): + self._voltage = val + + +class TLMC_PZ_OutputWaveformParams(): + def __init__(self): + self._mode = TLMC_PZ_OutputWaveformOperatingMode.TLMC_PZ_OutputWaveformOperatingMode_Continuous + self._number_of_samples_per_cycle = 0 + self._number_of_cycles = 0 + self._inter_sample_delay = 0 + self._pre_cycle_delay = 0 + self._post_cycle_delay = 0 + self._output_trigger_start_index = 0 + self._output_trigger_width = 0 + self._number_of_samples_between_trigger_repetition = 0 + + @property + def mode(self) -> TLMC_PZ_OutputWaveformOperatingMode: + return self._mode + + @mode.setter + def mode(self, val: TLMC_PZ_OutputWaveformOperatingMode): + self._mode = val + + @property + def number_of_samples_per_cycle(self) -> int: + return self._number_of_samples_per_cycle + + @number_of_samples_per_cycle.setter + def number_of_samples_per_cycle(self, val: int): + self._number_of_samples_per_cycle = val + + @property + def number_of_cycles(self) -> int: + return self._number_of_cycles + + @number_of_cycles.setter + def number_of_cycles(self, val: int): + self._number_of_cycles = val + + @property + def inter_sample_delay(self) -> int: + return self._inter_sample_delay + + @inter_sample_delay.setter + def inter_sample_delay(self, val: int): + self._inter_sample_delay = val + + @property + def pre_cycle_delay(self) -> int: + return self._pre_cycle_delay + + @pre_cycle_delay.setter + def pre_cycle_delay(self, val: int): + self._pre_cycle_delay = val + + @property + def post_cycle_delay(self) -> int: + return self._post_cycle_delay + + @post_cycle_delay.setter + def post_cycle_delay(self, val: int): + self._post_cycle_delay = val + + @property + def output_trigger_start_index(self) -> int: + return self._output_trigger_start_index + + @output_trigger_start_index.setter + def output_trigger_start_index(self, val: int): + self._output_trigger_start_index = val + + @property + def output_trigger_width(self) -> int: + return self._output_trigger_width + + @output_trigger_width.setter + def output_trigger_width(self, val: int): + self._output_trigger_width = val + + @property + def number_of_samples_between_trigger_repetition(self) -> int: + return self._number_of_samples_between_trigger_repetition + + @number_of_samples_between_trigger_repetition.setter + def number_of_samples_between_trigger_repetition(self, val: int): + self._number_of_samples_between_trigger_repetition = val + + +class TLMC_PZ_PositionLoopParams(): + def __init__(self): + self._proportional = 0 + self._integral = 0 + + @property + def proportional(self) -> int: + return self._proportional + + @proportional.setter + def proportional(self, val: int): + self._proportional = val + + @property + def integral(self) -> int: + return self._integral + + @integral.setter + def integral(self, val: int): + self._integral = val + + +class TLMC_PZ_SlewRateParams(): + def __init__(self): + self._open_slew_rate = 0 + self._closed_loop_slew_rate = 0 + + @property + def open_slew_rate(self) -> int: + return self._open_slew_rate + + @open_slew_rate.setter + def open_slew_rate(self, val: int): + self._open_slew_rate = val + + @property + def closed_loop_slew_rate(self) -> int: + return self._closed_loop_slew_rate + + @closed_loop_slew_rate.setter + def closed_loop_slew_rate(self, val: int): + self._closed_loop_slew_rate = val + + +class TLMC_PZ_Status(): + def __init__(self): + self._output_voltage = 0 + self._position = 0 + self._status_bits = TLMC_PZ_StatusBit.TLMC_PZ_StatusBit_ActuatorConnected + + @property + def output_voltage(self) -> int: + return self._output_voltage + + @output_voltage.setter + def output_voltage(self, val: int) -> None: + self._output_voltage = val + + @property + def position(self) -> int: + return self._position + + @position.setter + def position(self, val: int) -> None: + self._position = val + + @property + def status_bits(self) -> TLMC_PZ_StatusBit: + return self._status_bits + + @status_bits.setter + def status_bits(self, val: TLMC_PZ_StatusBit) -> None: + self._status_bits = val + + +class TLMC_StageAxisParams(): + def __init__(self): + self._type_id = TLMC_StageAxis_TypeId.TLMC_StageAxisType_Unknown + self._axis_id = TLMC_StageAxis_AxisId.TLMC_StageAxisId_Unknown + self._part_number = "" + self._serial_number = 0 + self._counts_per_unit = 0 + self._min_position = 0 + self._max_position = 0 + self._max_acceleration = 0 + self._max_deceleration = 0 + self._max_velocity = 0 + self._gear_box_ratio = 0 + + @property + def type_id(self) -> TLMC_StageAxis_TypeId: + return self._type_id + + @type_id.setter + def type_id(self, val: TLMC_StageAxis_TypeId): + self._type_id = val + + @property + def axis_id(self) -> TLMC_StageAxis_AxisId: + return self._axis_id + + @axis_id.setter + def axis_id(self, val: TLMC_StageAxis_AxisId): + self._axis_id = val + + @property + def part_number(self) -> str: + return self._part_number + + @part_number.setter + def part_number(self, val: str): + self._part_number = val + + @property + def serial_number(self) -> int: + return self._serial_number + + @serial_number.setter + def serial_number(self, val: int): + self._serial_number = val + + @property + def counts_per_unit(self) -> int: + return self._counts_per_unit + + @counts_per_unit.setter + def counts_per_unit(self, val: int): + self._counts_per_unit = val + + @property + def min_position(self) -> int: + return self._min_position + + @min_position.setter + def min_position(self, val: int): + self._min_position = val + + @property + def max_position(self) -> int: + return self._max_position + + @max_position.setter + def max_position(self, val: int): + self._max_position = val + + @property + def max_acceleration(self) -> int: + return self._max_acceleration + + @max_acceleration.setter + def max_acceleration(self, val: int): + self._max_acceleration = val + + @property + def max_deceleration(self) -> int: + return self._max_deceleration + + @max_deceleration.setter + def max_deceleration(self, val: int): + self._max_deceleration = val + + @property + def max_velocity(self) -> int: + return self._max_velocity + + @max_velocity.setter + def max_velocity(self, val: int): + self._max_velocity = val + + @property + def gear_box_ratio(self) -> int: + return self._gear_box_ratio + + @gear_box_ratio.setter + def gear_box_ratio(self, val: int): + self._gear_box_ratio = val + + +class TLMC_TriggerParamsForStepper(): + def __init__(self): + self._modes = TLMC_TriggerModesForStepper.TLMC_TriggerModesForStepper_None + + @property + def modes(self) -> TLMC_TriggerModesForStepper: + return self._modes + + @modes.setter + def modes(self, val: TLMC_TriggerModesForStepper): + self._modes = val + + +class TLMC_StepperLoopParams(): + def __init__(self): + self._loop_mode = TLMC_StepperLoopParams_LoopMode.TLMC_StepperLoopParams_LoopMode_Open + self._proportional = 0 + self._integral = 0 + self._differential = 0 + self._output_clip = 0 + self._output_tolerance = 0 + self._microsteps_per_encoder_count = 0 + + @property + def loop_mode(self) -> TLMC_StepperLoopParams_LoopMode: + return self._loop_mode + + @loop_mode.setter + def loop_mode(self, val: TLMC_StepperLoopParams_LoopMode): + self._loop_mode = val + + @property + def proportional(self) -> int: + return self._proportional + + @proportional.setter + def proportional(self, val: int): + self._proportional = val + + @property + def integral(self) -> int: + return self._integral + + @integral.setter + def integral(self, val: int): + self._integral = val + + @property + def differential(self) -> int: + return self._differential + + @differential.setter + def differential(self, val: int): + self._differential = val + + @property + def output_clip(self) -> int: + return self._output_clip + + @output_clip.setter + def output_clip(self, val: int): + self._output_clip = val + + @property + def output_tolerance(self) -> int: + return self._output_tolerance + + @output_tolerance.setter + def output_tolerance(self, val: int): + self._output_tolerance = val + + @property + def microsteps_per_encoder_count(self) -> int: + return self._microsteps_per_encoder_count + + @microsteps_per_encoder_count.setter + def microsteps_per_encoder_count(self, val: int): + self._microsteps_per_encoder_count = val + + +class TLMC_StepperStatus(): + def __init__(self): + self._position = 0 + self._encoder_count = 0 + self._status_bits = TLMC_UniversalStatusBit.TLMC_UniversalStatusBit_ClockwiseHardLimit + + @property + def position(self) -> int: + return self._position + + @position.setter + def position(self, val: int): + self._position = val + + @property + def encoder_count(self) -> int: + return self._encoder_count + + @encoder_count.setter + def encoder_count(self, val: int): + self._encoder_count = val + + @property + def status_bits(self) -> TLMC_UniversalStatusBit: + return self._status_bits + + @status_bits.setter + def status_bits(self, val: TLMC_UniversalStatusBit): + self._status_bits = val + + +class TLMC_AdcInputs(): + def __init__(self): + self._adc_input_1 = 0 + self._adc_input_2 = 0 + + @property + def adc_input_1(self) -> int: + return self._adc_input_1 + + @adc_input_1.setter + def adc_input_1(self, val: int): + self._adc_input_1 = val + + @property + def adc_input_2(self) -> int: + return self._adc_input_2 + + @adc_input_2.setter + def adc_input_2(self, val: int): + self._adc_input_2 = val + + +class TLMC_CurrentLoopParams(): + def __init__(self): + self._phase = TLMC_CurrentLoopPhase.TLMC_CurrentLoopPhase_A + self._proportional = 0 + self._integral = 0 + self._integral_limit = 0 + self._integral_dead_band = 0 + self._feed_forward = 0 + self._deflection_0 = 0 + self._velocity_1 = 0 + self._deflection_1 = 0 + self._velocity_2 = 0 + self._deflection_2 = 0 + self._velocity_3 = 0 + self._deflection_3 = 0 + self._velocity_4 = 0 + + @property + def phase(self) -> TLMC_CurrentLoopPhase: + return self._phase + + @phase.setter + def phase(self, val: TLMC_CurrentLoopPhase): + self._phase = val + + @property + def proportional(self) -> int: + return self._proportional + + @proportional.setter + def proportional(self, val: int): + self._proportional = val + + @property + def integral(self) -> int: + return self._integral + + @integral.setter + def integral(self, val: int): + self._integral = val + + @property + def integral_limit(self) -> int: + return self._integral_limit + + @integral_limit.setter + def integral_limit(self, val: int): + self._integral_limit = val + + @property + def integral_dead_band(self) -> int: + return self._integral_dead_band + + @integral_dead_band.setter + def integral_dead_band(self, val: int): + self._integral_dead_band = val + + @property + def feed_forward(self) -> int: + return self._feed_forward + + @feed_forward.setter + def feed_forward(self, val: int): + self._feed_forward = val + + +class TLMC_PotentiometerParams: + def __init__(self): + self._deflection_0 = 0 + self._velocity_1 = 0 + self._deflection_1 = 0 + self._velocity_2 = 0 + self._deflection_2 = 0 + self._velocity_3 = 0 + self._deflection_3 = 0 + self._velocity_4 = 0 + + @property + def deflection_0(self) -> int: + return self._deflection_0 + + @deflection_0.setter + def deflection_0(self, val: int): + self._deflection_0 = val + + @property + def velocity_1(self) -> int: + return self._velocity_1 + + @velocity_1.setter + def velocity_1(self, val: int): + self._velocity_1 = val + + @property + def deflection_1(self) -> int: + return self._deflection_1 + + @deflection_1.setter + def deflection_1(self, val: int): + self._deflection_1 = val + + @property + def velocity_2(self) -> int: + return self._velocity_2 + + @velocity_2.setter + def velocity_2(self, val: int): + self._velocity_2 = val + + @property + def deflection_2(self) -> int: + return self._deflection_2 + + @deflection_2.setter + def deflection_2(self, val: int): + self._deflection_2 = val + + @property + def velocity_3(self) -> int: + return self._velocity_3 + + @velocity_3.setter + def velocity_3(self, val: int): + self._velocity_3 = val + + @property + def deflection_3(self) -> int: + return self._deflection_3 + + @deflection_3.setter + def deflection_3(self, val: int): + self._deflection_3 = val + + @property + def velocity_4(self) -> int: + return self._velocity_4 + + @velocity_4.setter + def velocity_4(self, val: int): + self._velocity_4 = val + + +class TLMC_PowerParams(): + def __init__(self): + self._rest_factor = 0 + self._move_factor = 0 + + @property + def rest_factor(self) -> int: + return self._rest_factor + + @rest_factor.setter + def rest_factor(self, val: int): + self._rest_factor = val + + @property + def move_factor(self) -> int: + return self._move_factor + + @move_factor.setter + def move_factor(self, val: int): + self._move_factor = val + + +class TLMC_ProfileModeParams(): + def __init__(self): + self._mode = TLMC_ProfileMode.TLMC_ProfileMode_Trapezoidal + self._jerk = 0 + + @property + def mode(self) -> TLMC_ProfileMode: + return self._mode + + @mode.setter + def mode(self, val: TLMC_ProfileMode): + self._mode = val + + @property + def jerk(self) -> int: + return self._jerk + + @jerk.setter + def jerk(self, val: int): + self._jerk = val + + +class TLMC_RichResponse(): + def __init__(self): + self._message_id = 0 + self._code = 0 + self._notes = "" + + @property + def message_id(self) -> int: + return self._message_id + + @message_id.setter + def message_id(self, val: int): + self._message_id = val + + @property + def code(self) -> int: + return self._code + + @code.setter + def code(self, val: int): + self._code = val + + @property + def notes(self) -> str: + return self._notes + + @notes.setter + def notes(self, val: str): + self._notes = val + + +class TLMC_Setting(): + def __init__(self): + self._value_type = 0 + self._is_value_set = False + self._value = 0 + self._scale_type = 0 + self._unit_type = 0 + self._name = "" + self._display_name = "" + self._is_read_only = False + self._has_discrete_values = False + self._has_min = False + self._has_max = False + self._min_value = 0 + self._max_value = 0 + + @property + def value_type(self) -> int: + return self._value_type + + @value_type.setter + def value_type(self, val: int) -> None: + self._value_type = val + + @property + def is_value_set(self) -> bool: + return self._is_value_set + + @is_value_set.setter + def is_value_set(self, val: bool) -> None: + self._is_value_set = val + + @property + def value(self) -> int | bool | str: + return self._value + + @value.setter + def value(self, val: int | bool | str) -> None: + self._value = val + + @property + def scale_type(self) -> int: + return self._scale_type + + @scale_type.setter + def scale_type(self, val: int) -> None: + self._scale_type = val + + @property + def unit_type(self) -> int: + return self._unit_type + + @unit_type.setter + def unit_type(self, val: int) -> None: + self._unit_type = val + + @property + def name(self) -> str: + return self._name + + @name.setter + def name(self, val: str) -> None: + self._name = val + + @property + def display_name(self) -> str: + return self._display_name + + @display_name.setter + def display_name(self, val: str) -> None: + self._display_name = val + + @property + def is_read_only(self) -> bool: + return self._is_read_only + + @is_read_only.setter + def is_read_only(self, val: bool) -> None: + self._is_read_only = val + + @property + def has_discrete_values(self) -> bool: + return self._has_discrete_values + + @has_discrete_values.setter + def has_discrete_values(self, val: bool) -> None: + self._has_discrete_values = val + + @property + def has_min(self) -> bool: + return self._has_min + + @has_min.setter + def has_min(self, val: bool) -> None: + self._has_min = val + + @property + def has_max(self) -> bool: + return self._has_max + + @has_max.setter + def has_max(self, val: bool) -> None: + self._has_max = val + + @property + def min_value(self) -> int: + return self._min_value + + @min_value.setter + def min_value(self, val: int) -> None: + self._min_value = val + + @property + def max_value(self) -> int: + return self._max_value + + @max_value.setter + def max_value(self, val: int) -> None: + self._max_value = val + + +class TLMC_StatusItem(): + def __init__(self): + self._id = TLMC_StatusItemId.TLMC_StatusItemId_Active + self._value_type = TLMC_ValueType.TLMC_ValueType_int64 + self._value = 0 + + @property + def id(self) -> TLMC_StatusItemId: + return self._id + + @id.setter + def id(self, val: TLMC_StatusItemId) -> None: + self._id = val + + @property + def value_type(self) -> TLMC_ValueType: + return self._value_type + + @value_type.setter + def value_type(self, val: TLMC_ValueType) -> None: + self._value_type = val + + @property + def value(self) -> int | bool | str: + return self._value + + @value.setter + def value(self, val: int | bool | str) -> None: + self._value = val + + +class TLMC_TrackSettleParams(): + def __init__(self): + self._settle_time = 0 + self._settle_window = 0 + self._track_window = 0 + + @property + def settle_time(self) -> int: + return self._settle_time + + @settle_time.setter + def settle_time(self, val: int): + self._settle_time = val + + @property + def settle_window(self) -> int: + return self._settle_window + + @settle_window.setter + def settle_window(self, val: int): + self._settle_window = val + + @property + def track_window(self) -> int: + return self._track_window + + @track_window.setter + def track_window(self, val: int): + self._track_window = val + + +class TLMC_UniversalStatus(): + def __init__(self): + self._position = 0 + self._velocity = 0 + self._motor_current = 0 + self._status_bits = 0 + + @property + def position(self) -> int: + return self._position + + @position.setter + def position(self, val: int): + self._position = val + + @property + def velocity(self) -> int: + return self._velocity + + @velocity.setter + def velocity(self, val: int): + self._velocity = val + + @property + def motor_current(self) -> int: + return self._motor_current + + @motor_current.setter + def motor_current(self, val: int): + self._motor_current = val + + @property + def status_bits(self) -> int: + return self._status_bits + + @status_bits.setter + def status_bits(self, val: int): + self._status_bits = val + + +class TLMC_Value(): + def __init__(self): + self._value = 0 + + @property + def value(self) -> int | str | bool: + return self._value + + @value.setter + def value(self, val: int | str | bool): + self._value = val + + +class TLMC_VelocityParams(): + def __init__(self): + self._min_velocity = 0 + self._acceleration = 0 + self._max_velocity = 0 + + @property + def min_velocity(self) -> int: + return self._min_velocity + + @min_velocity.setter + def min_velocity(self, val: int): + self._min_velocity = val + + @property + def acceleration(self) -> int: + return self._acceleration + + @acceleration.setter + def acceleration(self, val: int): + self._acceleration = val + + @property + def max_velocity(self) -> int: + return self._max_velocity + + @max_velocity.setter + def max_velocity(self, val: int): + self._max_velocity = val diff --git a/Python/XA/src/thorlabs_xa/shared/system_manager.py b/Python/XA/src/thorlabs_xa/shared/system_manager.py new file mode 100644 index 0000000..246ffc3 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/system_manager.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +import threading +from typing import Any, List, Optional, Type, TypeVar + +from thorlabs_xa.native_sdks.c_native_functions import CNativeFunctions +from thorlabs_xa.shared.device import Device +from thorlabs_xa.shared.device_factory import DeviceFactory +from thorlabs_xa.shared.enums import TLMC_OperatingMode +from thorlabs_xa.shared.params import TLMC_ApiVersion, TLMC_DeviceInfo + +TDev = TypeVar("TDev", bound=Device) + +class SystemManager: + + _instance: SystemManager | None = None + _lock = threading.Lock() + _initialized: bool + + def __new__(cls, *args: Any, **kwargs: Any) -> SystemManager: + if cls._instance is None: + with cls._lock: + if cls._instance is None: + inst = super().__new__(cls) + inst._initialized = False + cls._instance = inst + return cls._instance + + def __init__(self) -> None: + if self._initialized: + return + + self.native_functions = CNativeFunctions() + self.device_factory = DeviceFactory(self.native_functions) + + self._initialized = True + + @classmethod + def instance(cls) -> SystemManager: + return cls() + + def startup(self, settings_file_name: Optional[str] = None) -> None: + self.native_functions.startup(settings_file_name) + + def shutdown(self) -> None: + self.native_functions.shutdown() + + def get_api_version(self) -> TLMC_ApiVersion: + return self.native_functions.get_api_version() + + def get_device_list(self) -> List[TLMC_DeviceInfo]: + device_count = self.native_functions.get_device_list_item_count() + return self.native_functions.get_device_list_items(0, device_count) + + def open_device(self, device_id: str, transport: str, operating_mode: TLMC_OperatingMode) -> Device: + device_handle = self.native_functions.open(device_id, transport, operating_mode) + device_info = self.native_functions.get_device_info(device_handle) + return self.device_factory.create(device_handle, device_info) + + def open_device_as(self, device_id: str, transport: str, operating_mode: TLMC_OperatingMode, expected_type: Type[TDev]) -> TDev: + device = self.open_device(device_id, transport, operating_mode) + + if not isinstance(device, expected_type): + raise TypeError( + f"Factory produced {type(device).__name__}; " + f"expected {expected_type.__name__}" + ) + return device + + def create_simulation(self, description: dict[str, str]) -> None: + self.native_functions.create_simulation(description) + + def remove_simulation(self, description: str) -> None: + self.native_functions.remove_simulation(description) \ No newline at end of file diff --git a/Python/XA/src/thorlabs_xa/shared/xa_error_factory.py b/Python/XA/src/thorlabs_xa/shared/xa_error_factory.py new file mode 100644 index 0000000..aaf19a6 --- /dev/null +++ b/Python/XA/src/thorlabs_xa/shared/xa_error_factory.py @@ -0,0 +1,139 @@ +from thorlabs_xa.shared.enums import TLMC_ResultCode + +class XADeviceException(Exception): + def __init__(self, message: str, error_code: int) -> None: + super().__init__(message) + self.error_code = error_code + +class XAErrorFactory: + + def __init__(self): + pass + + @staticmethod + def convert_return(return_code: TLMC_ResultCode) -> None | XADeviceException: + ex = None + match return_code: + case TLMC_ResultCode.TLMC_Success: + pass + case TLMC_ResultCode.TLMC_FunctionNotSupported: + ex = XADeviceException( + message="Function not supported, error code 1", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_DeviceNotFound: + ex = XADeviceException( + message="Device not found, error code 2", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_DeviceNotSupported: + ex = XADeviceException( + message="Device not supported, error code 3", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_Timeout: + ex = XADeviceException( + message="Timeout error, error code 4", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_Fail: + ex = XADeviceException( + message="Method failed, error code 5", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_InsufficientFirmware: + ex = XADeviceException( + message="Device firmware is to old, error code 6", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_AlreadyStarted: + ex = XADeviceException( + message="AlreadyStarted, error code 7", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_StartRequired: + ex = XADeviceException( + message="XA startup required, error code 8", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_AllocationError: + ex = XADeviceException( + message="Allocation error, error code 9", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_InternalError: + ex = XADeviceException( + message="Internal error detected, error code 10", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_InvalidHandle: + ex = XADeviceException( + message="Invalid Handle, error code 11", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_InvalidArgument: + ex = XADeviceException( + message="Invalid Argument, error code 12", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_ItemIsReadOnly: + ex = XADeviceException( + message="Item is Read Only, error code 13", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_LoadParamsError: + ex = XADeviceException( + message="Load params failed, error code 14", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_TransportError: + ex = XADeviceException( + message="Transport error, error code 15", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_TransportClosed: + ex = XADeviceException( + message="Transport is closed, error code 16", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_TransportNotAvailable: + ex = XADeviceException( + message="Transport not available, error code 17", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_SharingModeNotAvailable: + ex = XADeviceException( + message="Sharing mode is not available, error code 18", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_NotInitialized: + ex = XADeviceException( + message="Device not initialized, error code 19", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_NoFreeHandles: + ex = XADeviceException( + message="No free handles available, error code 20", error_code=return_code) + pass + + + case TLMC_ResultCode.TLMC_VerificationFailure: + ex = XADeviceException( + message="Verification failure, error code 21", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_DataNotLoaded: + ex = XADeviceException( + message="Data not loaded, error code 22", error_code=return_code) + pass + + case TLMC_ResultCode.TLMC_ConnectedProductNotSupported: + ex = XADeviceException( + message="Connected product not supported, error code 23", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_SimulationCreationError: + ex = XADeviceException( + message="Simulation failed to start, error code 24", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_ConnectedProductNotSet: + ex = XADeviceException( + message="Simulation failed to start, error code 25", error_code=return_code) + pass + case TLMC_ResultCode.TLMC_CalibrationFileNotPresent: + ex = XADeviceException( + message = "Calibration file not present, error code 26", error_code=return_code) + pass + + return ex