From 8cdcaae4c3f07068f565ba8b133de92fc0f51a94 Mon Sep 17 00:00:00 2001 From: DeborahOoi96 Date: Thu, 1 Feb 2024 18:25:13 +0800 Subject: [PATCH 1/5] Add when attribute to start_trigger.py --- generated/nidaqmx/_base_interpreter.py | 8 ++++++ generated/nidaqmx/_grpc_interpreter.py | 15 ++++++++++- generated/nidaqmx/_library_interpreter.py | 27 +++++++++++++++++++ .../_task_modules/triggering/start_trigger.py | 17 ++++++++++++ src/codegen/metadata/attributes.py | 2 +- .../templates/_grpc_interpreter.py.mako | 2 +- .../triggering/start_trigger.py.mako | 2 +- src/codegen/utilities/attribute_helpers.py | 12 ++++++--- src/codegen/utilities/interpreter_helpers.py | 14 +++++----- 9 files changed, 86 insertions(+), 13 deletions(-) diff --git a/generated/nidaqmx/_base_interpreter.py b/generated/nidaqmx/_base_interpreter.py index 04858e17..20f1ceee 100644 --- a/generated/nidaqmx/_base_interpreter.py +++ b/generated/nidaqmx/_base_interpreter.py @@ -1092,6 +1092,10 @@ def get_trig_attribute_int32_array(self, task, attribute): def get_trig_attribute_string(self, task, attribute): raise NotImplementedError + @abc.abstractmethod + def get_trig_attribute_timestamp(self, task, attribute): + raise NotImplementedError + @abc.abstractmethod def get_trig_attribute_uint32(self, task, attribute): raise NotImplementedError @@ -1572,6 +1576,10 @@ def set_trig_attribute_int32_array(self, task, attribute, value): def set_trig_attribute_string(self, task, attribute, value): raise NotImplementedError + @abc.abstractmethod + def set_trig_attribute_timestamp(self, task, attribute, value): + raise NotImplementedError + @abc.abstractmethod def set_trig_attribute_uint32(self, task, attribute, value): raise NotImplementedError diff --git a/generated/nidaqmx/_grpc_interpreter.py b/generated/nidaqmx/_grpc_interpreter.py index 75ef29fe..937355e5 100644 --- a/generated/nidaqmx/_grpc_interpreter.py +++ b/generated/nidaqmx/_grpc_interpreter.py @@ -17,7 +17,7 @@ from nidaqmx._stubs import nidaqmx_pb2_grpc as nidaqmx_grpc from nidaqmx._stubs import session_pb2 as session_grpc_types from nidaqmx.error_codes import DAQmxErrors -from nidaqmx._grpc_time import convert_time_to_timestamp +from nidaqmx._grpc_time import convert_time_to_timestamp, convert_timestamp_to_time _logger = logging.getLogger(__name__) @@ -2180,6 +2180,12 @@ def get_trig_attribute_string(self, task, attribute): grpc_types.GetTrigAttributeStringRequest(task=task, attribute_raw=attribute)) return response.value + def get_trig_attribute_timestamp(self, task, attribute): + response = self._invoke( + self._client.GetTrigAttributeTimestamp, + grpc_types.GetTrigAttributeTimestampRequest(task=task, attribute_raw=attribute)) + return convert_timestamp_to_time(response.value) + def get_trig_attribute_uint32(self, task, attribute): response = self._invoke( self._client.GetTrigAttributeUInt32, @@ -3126,6 +3132,13 @@ def set_trig_attribute_string(self, task, attribute, value): grpc_types.SetTrigAttributeStringRequest( task=task, attribute_raw=attribute, value=value)) + def set_trig_attribute_timestamp(self, task, attribute, value): + response = self._invoke( + self._client.SetTrigAttributeTimestamp, + grpc_types.SetTrigAttributeTimestampRequest( + task=task, attribute_raw=attribute, + value=convert_time_to_timestamp(value))) + def set_trig_attribute_uint32(self, task, attribute, value): response = self._invoke( self._client.SetTrigAttributeUInt32, diff --git a/generated/nidaqmx/_library_interpreter.py b/generated/nidaqmx/_library_interpreter.py index 80b99fd6..4ef362b6 100644 --- a/generated/nidaqmx/_library_interpreter.py +++ b/generated/nidaqmx/_library_interpreter.py @@ -3672,6 +3672,21 @@ def get_trig_attribute_string(self, task, attribute): self.check_for_error(size_or_code) return value.value.decode('ascii') + def get_trig_attribute_timestamp(self, task, attribute): + value = _lib_time.AbsoluteTime() + + cfunc = lib_importer.cdll.DAQmxGetTrigAttribute + if cfunc.argtypes is None: + with cfunc.arglock: + if cfunc.argtypes is None: + cfunc.argtypes = [ + lib_importer.task_handle, ctypes.c_int32] + + error_code = cfunc( + task, attribute, ctypes.byref(value)) + self.check_for_error(error_code) + return value + def get_trig_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() @@ -5333,6 +5348,18 @@ def set_trig_attribute_string(self, task, attribute, value): task, attribute, value.encode('ascii')) self.check_for_error(error_code) + def set_trig_attribute_timestamp(self, task, attribute, value): + cfunc = lib_importer.cdll.DAQmxSetTrigAttribute + if cfunc.argtypes is None: + with cfunc.arglock: + if cfunc.argtypes is None: + cfunc.argtypes = [ + lib_importer.task_handle, ctypes.c_int32] + + error_code = cfunc( + task, attribute, AbsoluteTime.from_datetime(value)) + self.check_for_error(error_code) + def set_trig_attribute_uint32(self, task, attribute, value): cfunc = lib_importer.cdll.DAQmxSetTrigAttribute if cfunc.argtypes is None: diff --git a/generated/nidaqmx/_task_modules/triggering/start_trigger.py b/generated/nidaqmx/_task_modules/triggering/start_trigger.py index 2af953e5..f8243231 100644 --- a/generated/nidaqmx/_task_modules/triggering/start_trigger.py +++ b/generated/nidaqmx/_task_modules/triggering/start_trigger.py @@ -832,6 +832,23 @@ def retriggerable(self, val): def retriggerable(self): self._interpreter.reset_trig_attribute(self._handle, 0x190f) + @property + def start_trig_trig_when(self): + """ + datetime: Specifies when to trigger the start trigger. + """ + + val = self._interpreter.get_trig_attribute_timestamp(self._handle, 0x304d) + return val + + @start_trig_trig_when.setter + def start_trig_trig_when(self, val): + self._interpreter.set_trig_attribute_timestamp(self._handle, 0x304d, val) + + @start_trig_trig_when.deleter + def start_trig_trig_when(self): + self._interpreter.reset_trig_attribute(self._handle, 0x304d) + @property def term(self): """ diff --git a/src/codegen/metadata/attributes.py b/src/codegen/metadata/attributes.py index 7329d06e..add89e00 100644 --- a/src/codegen/metadata/attributes.py +++ b/src/codegen/metadata/attributes.py @@ -28949,7 +28949,7 @@ 'is_python_object': False, 'name': 'START_TRIG_TRIG_WHEN', 'python_class_name': 'TimeStartTrigger', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Specifies when to trigger the start trigger.', 'resettable': True, 'type': 'CVIAbsoluteTime' diff --git a/src/codegen/templates/_grpc_interpreter.py.mako b/src/codegen/templates/_grpc_interpreter.py.mako index ac0be5ed..68292740 100644 --- a/src/codegen/templates/_grpc_interpreter.py.mako +++ b/src/codegen/templates/_grpc_interpreter.py.mako @@ -33,7 +33,7 @@ from nidaqmx._stubs import nidaqmx_pb2 as grpc_types from nidaqmx._stubs import nidaqmx_pb2_grpc as nidaqmx_grpc from nidaqmx._stubs import session_pb2 as session_grpc_types from nidaqmx.error_codes import DAQmxErrors -from nidaqmx._grpc_time import convert_time_to_timestamp +from nidaqmx._grpc_time import convert_time_to_timestamp, convert_timestamp_to_time _logger = logging.getLogger(__name__) diff --git a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako index d073c45e..dc23a0e2 100644 --- a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako +++ b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako @@ -3,7 +3,7 @@ from codegen.utilities.function_helpers import get_functions, get_enums_used as functions_enums from codegen.utilities.attribute_helpers import get_attributes, get_enums_used as attribute_enums from codegen.utilities.helpers import get_enums_to_import - attributes = get_attributes(data, "StartTrigger") + attributes = get_attributes(data, "StartTrigger", "TimeStartTrigger") functions = get_functions(data,"StartTrigger") attr_enums = attribute_enums(attributes) fuct_enums = functions_enums(functions) diff --git a/src/codegen/utilities/attribute_helpers.py b/src/codegen/utilities/attribute_helpers.py index dfa34714..ec353790 100644 --- a/src/codegen/utilities/attribute_helpers.py +++ b/src/codegen/utilities/attribute_helpers.py @@ -3,7 +3,9 @@ import codegen.metadata as scrapigen_metadata from codegen.properties.attribute import Attribute from codegen.utilities.helpers import camel_to_snake_case -from codegen.utilities.interpreter_helpers import INTERPRETER_CAMEL_TO_SNAKE_CASE_REGEXES +from codegen.utilities.interpreter_helpers import ( + INTERPRETER_CAMEL_TO_SNAKE_CASE_REGEXES, +) EXCLUDED_ATTRIBUTES = [ "AI_CHAN_CAL_HAS_VALID_CAL_INFO", @@ -228,6 +230,7 @@ "int32[]": "int32_array", "uInt8[]": "bytes", "uInt32[]": "uint32_array", + "CVIAbsoluteTime": "timestamp", } GENERIC_ATTRIBUTE_GROUP_NAME_MAP = { @@ -240,14 +243,17 @@ } -def get_attributes(metadata, class_name): +def get_attributes(metadata, class_name, additional_class_name=""): """Converts the scrapigen metadata into a list of attributes.""" attributes_metadata = [] for group_name, attributes in metadata["attributes"].items(): for id, attribute_data in attributes.items(): if ( "python_class_name" in attribute_data - and attribute_data["python_class_name"] == class_name + and ( + attribute_data["python_class_name"] == class_name + or attribute_data["python_class_name"] == additional_class_name + ) and not attribute_data["name"] in EXCLUDED_ATTRIBUTES ): attributes_metadata.append(Attribute(id, attribute_data)) diff --git a/src/codegen/utilities/interpreter_helpers.py b/src/codegen/utilities/interpreter_helpers.py index 83b04aff..df339f31 100644 --- a/src/codegen/utilities/interpreter_helpers.py +++ b/src/codegen/utilities/interpreter_helpers.py @@ -64,14 +64,12 @@ "GetSyncPulseTimeWhen", "GetTimingAttributeExTimestamp", "GetTimingAttributeTimestamp", - "GetTrigAttributeTimestamp", "SetArmStartTrigTrigWhen", "SetFirstSampClkWhen", "SetStartTrigTrigWhen", "SetSyncPulseTimeWhen", "SetTimingAttributeExTimestamp", "SetTimingAttributeTimestamp", - "SetTrigAttributeTimestamp", "WaitForValidTimestamp", # Deprecated, not working "GetAnalogPowerUpStates", @@ -173,13 +171,13 @@ def generate_interpreter_function_call_args(function_metadata): else: function_call_args.append(f"ctypes.byref({param.parameter_name})") elif param.direction == "in": - if ( + if param.type == "CVIAbsoluteTime": + function_call_args.append(f"AbsoluteTime.from_datetime({param.parameter_name})") + elif ( param.parameter_name == "value" and function_metadata.attribute_function_type == AttributeFunctionType.SET ): function_call_args.append(type_cast_attribute_set_function_parameter(param)) - elif param.type == "CVIAbsoluteTime": - function_call_args.append(f"AbsoluteTime.from_datetime({param.parameter_name})") else: function_call_args.append(param.parameter_name) @@ -258,6 +256,8 @@ def get_instantiation_lines_for_output(func): instantiation_lines.append( f"{param.parameter_name} = numpy.zeros(size, dtype={param.ctypes_data_type})" ) + elif param.type == "CVIAbsoluteTime": + instantiation_lines.append(f"{param.parameter_name} = _lib_time.AbsoluteTime()") else: instantiation_lines.append(f"{param.parameter_name} = {param.ctypes_data_type}()") for param in get_interpreter_in_out_params(func): @@ -447,7 +447,7 @@ def get_return_values(func): return_values.append(param.parameter_name) else: return_values.append(f"{param.parameter_name}.tolist()") - elif param.type == "TaskHandle": + elif param.type == "TaskHandle" or param.type == "CVIAbsoluteTime": return_values.append(param.parameter_name) else: return_values.append(f"{param.parameter_name}.value") @@ -586,6 +586,8 @@ def get_response_parameters(func): response_parameters.append(f"response.{name}_raw") elif parameter.is_list: response_parameters.append(f"list(response.{name})") + elif parameter.type == "CVIAbsoluteTime": + response_parameters.append(f"convert_timestamp_to_time(response.{name})") else: response_parameters.append(f"response.{name}") return ", ".join(response_parameters) From 6263129b046fcf87d7bec7d45f2aed510d0967ca Mon Sep 17 00:00:00 2001 From: DeborahOoi96 Date: Thu, 1 Feb 2024 18:37:25 +0800 Subject: [PATCH 2/5] Fix libtime issue --- generated/nidaqmx/_library_interpreter.py | 5 ++--- src/codegen/utilities/function_helpers.py | 2 +- src/codegen/utilities/interpreter_helpers.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/generated/nidaqmx/_library_interpreter.py b/generated/nidaqmx/_library_interpreter.py index 4ef362b6..6b5b6259 100644 --- a/generated/nidaqmx/_library_interpreter.py +++ b/generated/nidaqmx/_library_interpreter.py @@ -397,8 +397,7 @@ def cfg_time_start_trig(self, task, when, timescale): with cfunc.arglock: if cfunc.argtypes is None: cfunc.argtypes = [ - lib_importer.task_handle, _lib_time.AbsoluteTime, - ctypes.c_int] + lib_importer.task_handle, AbsoluteTime, ctypes.c_int] error_code = cfunc( task, AbsoluteTime.from_datetime(when), timescale) @@ -3673,7 +3672,7 @@ def get_trig_attribute_string(self, task, attribute): return value.value.decode('ascii') def get_trig_attribute_timestamp(self, task, attribute): - value = _lib_time.AbsoluteTime() + value = AbsoluteTime() cfunc = lib_importer.cdll.DAQmxGetTrigAttribute if cfunc.argtypes is None: diff --git a/src/codegen/utilities/function_helpers.py b/src/codegen/utilities/function_helpers.py index 30dbc00c..d75462d3 100644 --- a/src/codegen/utilities/function_helpers.py +++ b/src/codegen/utilities/function_helpers.py @@ -197,7 +197,7 @@ def to_param_argtype(parameter): if parameter.ctypes_data_type == "ctypes.TaskHandle": return "lib_importer.task_handle" elif parameter.python_data_type == "datetime": - return "_lib_time.AbsoluteTime" + return "AbsoluteTime" elif parameter.direction == "in": # If is string input parameter, use separate custom # argtype to convert from unicode to bytes. diff --git a/src/codegen/utilities/interpreter_helpers.py b/src/codegen/utilities/interpreter_helpers.py index df339f31..c64bb92e 100644 --- a/src/codegen/utilities/interpreter_helpers.py +++ b/src/codegen/utilities/interpreter_helpers.py @@ -257,7 +257,7 @@ def get_instantiation_lines_for_output(func): f"{param.parameter_name} = numpy.zeros(size, dtype={param.ctypes_data_type})" ) elif param.type == "CVIAbsoluteTime": - instantiation_lines.append(f"{param.parameter_name} = _lib_time.AbsoluteTime()") + instantiation_lines.append(f"{param.parameter_name} = AbsoluteTime()") else: instantiation_lines.append(f"{param.parameter_name} = {param.ctypes_data_type}()") for param in get_interpreter_in_out_params(func): From b0829f729c9052f5ebad894500532cb1851a04b8 Mon Sep 17 00:00:00 2001 From: DeborahOoi96 Date: Fri, 2 Feb 2024 12:59:04 +0800 Subject: [PATCH 3/5] Address comments --- src/codegen/metadata/attributes.py | 20 ++++++++++--------- .../triggering/start_trigger.py.mako | 2 +- src/codegen/utilities/attribute_helpers.py | 7 ++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/codegen/metadata/attributes.py b/src/codegen/metadata/attributes.py index add89e00..fa08c220 100644 --- a/src/codegen/metadata/attributes.py +++ b/src/codegen/metadata/attributes.py @@ -25834,7 +25834,7 @@ 'is_python_object': False, 'name': 'SYNC_PULSE_TIME_WHEN', 'python_class_name': 'Timing', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Specifies the start time of the sync pulse.', 'resettable': True, 'type': 'CVIAbsoluteTime' @@ -25904,7 +25904,7 @@ 'is_python_object': False, 'name': 'FIRST_SAMP_TIMESTAMP_VAL', 'python_class_name': 'Timing', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Indicates the timestamp of the first sample.', 'resettable': False, 'type': 'CVIAbsoluteTime' @@ -25951,7 +25951,7 @@ 'is_python_object': False, 'name': 'FIRST_SAMP_CLK_WHEN', 'python_class_name': 'Timing', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Specifies the time of the first sample clock pulse.', 'resettable': True, 'type': 'CVIAbsoluteTime' @@ -28948,9 +28948,10 @@ 'is_list': False, 'is_python_object': False, 'name': 'START_TRIG_TRIG_WHEN', - 'python_class_name': 'TimeStartTrigger', + 'python_class_name': 'StartTrigger', 'python_data_type': 'datetime', 'python_description': 'Specifies when to trigger the start trigger.', + 'python_name': 'trig_when', 'resettable': True, 'type': 'CVIAbsoluteTime' }, @@ -29433,7 +29434,7 @@ 'is_python_object': False, 'name': 'REF_TRIG_TIMESTAMP_VAL', 'python_class_name': 'ReferenceTrigger', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Indicates the reference trigger timestamp value.', 'python_name': 'timestamp_val', 'resettable': False, @@ -29481,9 +29482,10 @@ 'is_list': False, 'is_python_object': False, 'name': 'ARM_START_TRIG_TRIG_WHEN', - 'python_class_name': 'TimeArmStartTrigger', - 'python_data_type': 'unknown', + 'python_class_name': 'ArmStartTrigger', + 'python_data_type': 'datetime', 'python_description': 'Specifies when to trigger the arm start trigger.', + 'python_name': 'trig_when', 'resettable': True, 'type': 'CVIAbsoluteTime' }, @@ -29554,7 +29556,7 @@ 'is_python_object': False, 'name': 'ARM_START_TRIG_TIMESTAMP_VAL', 'python_class_name': 'ArmStartTrigger', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Indicates the arm start trigger timestamp value.', 'python_name': 'timestamp_val', 'resettable': False, @@ -29627,7 +29629,7 @@ 'is_python_object': False, 'name': 'START_TRIG_TIMESTAMP_VAL', 'python_class_name': 'StartTrigger', - 'python_data_type': 'unknown', + 'python_data_type': 'datetime', 'python_description': 'Indicates the start trigger timestamp value.', 'python_name': 'timestamp_val', 'resettable': False, diff --git a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako index dc23a0e2..d073c45e 100644 --- a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako +++ b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako @@ -3,7 +3,7 @@ from codegen.utilities.function_helpers import get_functions, get_enums_used as functions_enums from codegen.utilities.attribute_helpers import get_attributes, get_enums_used as attribute_enums from codegen.utilities.helpers import get_enums_to_import - attributes = get_attributes(data, "StartTrigger", "TimeStartTrigger") + attributes = get_attributes(data, "StartTrigger") functions = get_functions(data,"StartTrigger") attr_enums = attribute_enums(attributes) fuct_enums = functions_enums(functions) diff --git a/src/codegen/utilities/attribute_helpers.py b/src/codegen/utilities/attribute_helpers.py index ec353790..4fff3879 100644 --- a/src/codegen/utilities/attribute_helpers.py +++ b/src/codegen/utilities/attribute_helpers.py @@ -243,17 +243,14 @@ } -def get_attributes(metadata, class_name, additional_class_name=""): +def get_attributes(metadata, class_name): """Converts the scrapigen metadata into a list of attributes.""" attributes_metadata = [] for group_name, attributes in metadata["attributes"].items(): for id, attribute_data in attributes.items(): if ( "python_class_name" in attribute_data - and ( - attribute_data["python_class_name"] == class_name - or attribute_data["python_class_name"] == additional_class_name - ) + and attribute_data["python_class_name"] == class_name and not attribute_data["name"] in EXCLUDED_ATTRIBUTES ): attributes_metadata.append(Attribute(id, attribute_data)) From 86665204fdb6b6cf588067cd5c1d5514a80d8b1f Mon Sep 17 00:00:00 2001 From: DeborahOoi96 Date: Mon, 5 Feb 2024 15:16:58 +0800 Subject: [PATCH 4/5] Try to fix pipeline --- .../templates/_task_modules/triggering/start_trigger.py.mako | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako index d073c45e..adf3020d 100644 --- a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako +++ b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako @@ -3,9 +3,9 @@ from codegen.utilities.function_helpers import get_functions, get_enums_used as functions_enums from codegen.utilities.attribute_helpers import get_attributes, get_enums_used as attribute_enums from codegen.utilities.helpers import get_enums_to_import - attributes = get_attributes(data, "StartTrigger") + start_trigger_attributes = get_attributes(data, "StartTrigger") functions = get_functions(data,"StartTrigger") - attr_enums = attribute_enums(attributes) + attr_enums = attribute_enums(start_trigger_attributes) fuct_enums = functions_enums(functions) enums_used = get_enums_to_import(attr_enums, fuct_enums) %>\ From 4091d27aec1ee12878ed6010ce14969d3e93ee7c Mon Sep 17 00:00:00 2001 From: DeborahOoi96 Date: Mon, 5 Feb 2024 15:23:44 +0800 Subject: [PATCH 5/5] Fix python file take 2 --- .../triggering/arm_start_trigger.py | 17 ++++++++++ .../_task_modules/triggering/start_trigger.py | 34 +++++++++---------- .../triggering/start_trigger.py.mako | 4 +-- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/generated/nidaqmx/_task_modules/triggering/arm_start_trigger.py b/generated/nidaqmx/_task_modules/triggering/arm_start_trigger.py index 8b7dfe21..df77259c 100644 --- a/generated/nidaqmx/_task_modules/triggering/arm_start_trigger.py +++ b/generated/nidaqmx/_task_modules/triggering/arm_start_trigger.py @@ -231,3 +231,20 @@ def trig_type(self, val): def trig_type(self): self._interpreter.reset_trig_attribute(self._handle, 0x1414) + @property + def trig_when(self): + """ + datetime: Specifies when to trigger the arm start trigger. + """ + + val = self._interpreter.get_trig_attribute_timestamp(self._handle, 0x3131) + return val + + @trig_when.setter + def trig_when(self, val): + self._interpreter.set_trig_attribute_timestamp(self._handle, 0x3131, val) + + @trig_when.deleter + def trig_when(self): + self._interpreter.reset_trig_attribute(self._handle, 0x3131) + diff --git a/generated/nidaqmx/_task_modules/triggering/start_trigger.py b/generated/nidaqmx/_task_modules/triggering/start_trigger.py index f8243231..980fef50 100644 --- a/generated/nidaqmx/_task_modules/triggering/start_trigger.py +++ b/generated/nidaqmx/_task_modules/triggering/start_trigger.py @@ -832,23 +832,6 @@ def retriggerable(self, val): def retriggerable(self): self._interpreter.reset_trig_attribute(self._handle, 0x190f) - @property - def start_trig_trig_when(self): - """ - datetime: Specifies when to trigger the start trigger. - """ - - val = self._interpreter.get_trig_attribute_timestamp(self._handle, 0x304d) - return val - - @start_trig_trig_when.setter - def start_trig_trig_when(self, val): - self._interpreter.set_trig_attribute_timestamp(self._handle, 0x304d, val) - - @start_trig_trig_when.deleter - def start_trig_trig_when(self): - self._interpreter.reset_trig_attribute(self._handle, 0x304d) - @property def term(self): """ @@ -936,6 +919,23 @@ def trig_type(self, val): def trig_type(self): self._interpreter.reset_trig_attribute(self._handle, 0x1393) + @property + def trig_when(self): + """ + datetime: Specifies when to trigger the start trigger. + """ + + val = self._interpreter.get_trig_attribute_timestamp(self._handle, 0x304d) + return val + + @trig_when.setter + def trig_when(self, val): + self._interpreter.set_trig_attribute_timestamp(self._handle, 0x304d, val) + + @trig_when.deleter + def trig_when(self): + self._interpreter.reset_trig_attribute(self._handle, 0x304d) + @property def trig_win(self): """ diff --git a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako index adf3020d..d073c45e 100644 --- a/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako +++ b/src/codegen/templates/_task_modules/triggering/start_trigger.py.mako @@ -3,9 +3,9 @@ from codegen.utilities.function_helpers import get_functions, get_enums_used as functions_enums from codegen.utilities.attribute_helpers import get_attributes, get_enums_used as attribute_enums from codegen.utilities.helpers import get_enums_to_import - start_trigger_attributes = get_attributes(data, "StartTrigger") + attributes = get_attributes(data, "StartTrigger") functions = get_functions(data,"StartTrigger") - attr_enums = attribute_enums(start_trigger_attributes) + attr_enums = attribute_enums(attributes) fuct_enums = functions_enums(functions) enums_used = get_enums_to_import(attr_enums, fuct_enums) %>\