From 441569ac2e0e4483e954f983f3f2bcbf7db21836 Mon Sep 17 00:00:00 2001 From: Joo Liang Cheah Date: Tue, 9 Jul 2024 01:35:48 +0800 Subject: [PATCH] Pick up new daqmx metadata (#608) * Pick up new daqmx metadata * reverted readArray type in ReadRaw metadata --- generated/nidaqmx/constants.py | 1 + generated/nidaqmx/error_codes.py | 1 + src/codegen/metadata/enums.py | 15 ++++++ src/codegen/metadata/functions.py | 84 +++++++++++++++++++++++++++++-- 4 files changed, 97 insertions(+), 4 deletions(-) diff --git a/generated/nidaqmx/constants.py b/generated/nidaqmx/constants.py index cf2a4d05a..bdb88ed56 100644 --- a/generated/nidaqmx/constants.py +++ b/generated/nidaqmx/constants.py @@ -517,6 +517,7 @@ class ProductCategory(Enum): FIELD_DAQ = 16151 #: FieldDAQ. TEST_SCALE_CHASSIS = 16180 #: TestScale chassis. TEST_SCALE_MODULE = 16181 #: TestScale I/O module. + MIODAQ = 16182 #: mioDAQ. UNKNOWN = 12588 #: Unknown category. diff --git a/generated/nidaqmx/error_codes.py b/generated/nidaqmx/error_codes.py index cc43efe9c..fb20e52be 100644 --- a/generated/nidaqmx/error_codes.py +++ b/generated/nidaqmx/error_codes.py @@ -6,6 +6,7 @@ class DAQmxErrors(IntEnum): + NEEDS_USB_SUPER_SPEED = -209889 REMOTE_SENSE = -209888 OVER_TEMPERATURE_PROTECTION_ACTIVATED = -209887 MULTI_TASK_CFG_SAMP_RATE_NOT_SUPPORTED_WITH_PROP_SET = -209886 diff --git a/src/codegen/metadata/enums.py b/src/codegen/metadata/enums.py index 8ba43d648..a16981c25 100644 --- a/src/codegen/metadata/enums.py +++ b/src/codegen/metadata/enums.py @@ -1484,6 +1484,13 @@ }, 'DAQmxErrors': { 'values': [ + { + 'documentation': { + 'description': ' ' + }, + 'name': 'NEEDS_USB_SUPER_SPEED', + 'value': -209889 + }, { 'documentation': { 'description': ' ' @@ -16502,6 +16509,14 @@ 'name': 'TEST_SCALE_MODULE', 'value': 16181 }, + { + 'documentation': { + 'description': 'mioDAQ.' + }, + 'name': 'MIO_DAQ', + 'python_name': 'MIODAQ', + 'value': 16182 + }, { 'documentation': { 'description': 'Unknown category.' diff --git a/src/codegen/metadata/functions.py b/src/codegen/metadata/functions.py index eb59b6dd2..d969cc238 100644 --- a/src/codegen/metadata/functions.py +++ b/src/codegen/metadata/functions.py @@ -13827,9 +13827,9 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'logicFamily', - 'python_data_type': 'int', + 'python_data_type': 'LogicFamily', 'python_description': '', - 'python_type_annotation': 'int', + 'python_type_annotation': 'nidaqmx.constants.LogicFamily', 'type': 'int32' } ], @@ -19462,30 +19462,53 @@ 'calling_convention': 'StdCall', 'parameters': [ { + 'ctypes_data_type': 'ctypes.TaskHandle', 'direction': 'in', + 'is_optional_in_python': False, 'name': 'task', + 'python_data_type': 'TaskHandle', + 'python_description': '', + 'python_type_annotation': 'TaskHandle', 'type': 'TaskHandle' }, { + 'ctypes_data_type': 'ctypes.c_int', 'direction': 'in', + 'is_optional_in_python': False, 'name': 'numSampsPerChan', + 'python_data_type': 'int', + 'python_description': '', + 'python_type_annotation': 'int', 'type': 'int32' }, { + 'ctypes_data_type': 'ctypes.c_double', 'direction': 'in', + 'is_optional_in_python': False, 'name': 'timeout', + 'python_data_type': 'float', + 'python_description': '', + 'python_type_annotation': 'float', 'type': 'float64' }, { + 'ctypes_data_type': 'ctypes.c_int', 'direction': 'in', 'enum': 'GroupBy', + 'is_optional_in_python': False, 'name': 'fillMode', + 'python_data_type': 'FillMode', + 'python_description': '', + 'python_type_annotation': 'nidaqmx.constants.FillMode', 'type': 'int32' }, { 'coerced': True, + 'ctypes_data_type': 'numpy.generic', 'direction': 'out', + 'is_list': True, 'name': 'readArrayVoltage', + 'python_data_type': 'object', 'size': { 'mechanism': 'passed-in', 'value': 'arraySizeInSamps' @@ -19494,8 +19517,11 @@ }, { 'coerced': True, + 'ctypes_data_type': 'numpy.generic', 'direction': 'out', + 'is_list': True, 'name': 'readArrayCurrent', + 'python_data_type': 'object', 'size': { 'mechanism': 'passed-in', 'value': 'arraySizeInSamps' @@ -19503,26 +19529,38 @@ 'type': 'int16[]' }, { + 'ctypes_data_type': 'ctypes.c_uint32', 'direction': 'in', 'name': 'arraySizeInSamps', + 'python_data_type': 'int', 'type': 'uInt32' }, { + 'ctypes_data_type': 'ctypes.c_int', 'direction': 'out', + 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'python_data_type': 'int', + 'python_description': '', + 'python_type_annotation': 'int', 'return_on_error_key': 'ni-samps-per-chan-read', 'type': 'int32' }, { + 'ctypes_data_type': 'c_bool32', 'direction': 'in', 'hardcoded_value': 'nullptr', 'include_in_proto': False, + 'is_optional_in_python': False, 'name': 'reserved', 'pointer': True, + 'python_data_type': 'bool', + 'python_description': '', + 'python_type_annotation': 'bool', 'type': 'bool32' } ], - 'python_codegen_method': 'no', + 'python_codegen_method': 'CustomCode', 'returns': 'int32', 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, @@ -19530,29 +19568,52 @@ 'calling_convention': 'StdCall', 'parameters': [ { + 'ctypes_data_type': 'ctypes.TaskHandle', 'direction': 'in', + 'is_optional_in_python': False, 'name': 'task', + 'python_data_type': 'TaskHandle', + 'python_description': '', + 'python_type_annotation': 'TaskHandle', 'type': 'TaskHandle' }, { + 'ctypes_data_type': 'ctypes.c_int', 'direction': 'in', + 'is_optional_in_python': False, 'name': 'numSampsPerChan', + 'python_data_type': 'int', + 'python_description': '', + 'python_type_annotation': 'int', 'type': 'int32' }, { + 'ctypes_data_type': 'ctypes.c_double', 'direction': 'in', + 'is_optional_in_python': False, 'name': 'timeout', + 'python_data_type': 'float', + 'python_description': '', + 'python_type_annotation': 'float', 'type': 'float64' }, { + 'ctypes_data_type': 'ctypes.c_int', 'direction': 'in', 'enum': 'GroupBy', + 'is_optional_in_python': False, 'name': 'fillMode', + 'python_data_type': 'FillMode', + 'python_description': '', + 'python_type_annotation': 'nidaqmx.constants.FillMode', 'type': 'int32' }, { + 'ctypes_data_type': 'numpy.float64', 'direction': 'out', + 'is_list': True, 'name': 'readArrayVoltage', + 'python_data_type': 'float', 'size': { 'mechanism': 'passed-in', 'value': 'arraySizeInSamps' @@ -19560,8 +19621,11 @@ 'type': 'float64[]' }, { + 'ctypes_data_type': 'numpy.float64', 'direction': 'out', + 'is_list': True, 'name': 'readArrayCurrent', + 'python_data_type': 'float', 'size': { 'mechanism': 'passed-in', 'value': 'arraySizeInSamps' @@ -19569,26 +19633,38 @@ 'type': 'float64[]' }, { + 'ctypes_data_type': 'ctypes.c_uint32', 'direction': 'in', 'name': 'arraySizeInSamps', + 'python_data_type': 'int', 'type': 'uInt32' }, { + 'ctypes_data_type': 'ctypes.c_int', 'direction': 'out', + 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'python_data_type': 'int', + 'python_description': '', + 'python_type_annotation': 'int', 'return_on_error_key': 'ni-samps-per-chan-read', 'type': 'int32' }, { + 'ctypes_data_type': 'c_bool32', 'direction': 'in', 'hardcoded_value': 'nullptr', 'include_in_proto': False, + 'is_optional_in_python': False, 'name': 'reserved', 'pointer': True, + 'python_data_type': 'bool', + 'python_description': '', + 'python_type_annotation': 'bool', 'type': 'bool32' } ], - 'python_codegen_method': 'no', + 'python_codegen_method': 'CustomCode', 'returns': 'int32', 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' },