From a18d80bd43a7eead98d2812afc00dbf677b0c257 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 14:56:20 +0530 Subject: [PATCH 1/8] Implementation for custom object repeated capability --- build/helper/__init__.py | 1 + build/helper/metadata_add_all.py | 4 ++ build/helper/metadata_filters.py | 9 ++++ build/templates/session.py.mako | 91 +++++++++++++++++++++++++++++++- 4 files changed, 103 insertions(+), 2 deletions(-) diff --git a/build/helper/__init__.py b/build/helper/__init__.py index f6d8dbcfa1..1e00a3d9f1 100644 --- a/build/helper/__init__.py +++ b/build/helper/__init__.py @@ -51,6 +51,7 @@ from build.helper.metadata_filters import filter_library_functions # noqa: F401 from build.helper.metadata_filters import filter_parameters # noqa: F401 from build.helper.metadata_filters import filter_public_functions # noqa: F401 +from build.helper.metadata_filters import filter_rep_cap_supported_attributes from build.helper.metadata_find import find_custom_type # noqa: F401 from build.helper.metadata_find import find_session_handle_parameter # noqa: F401 diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index ed9d836b68..21e6215971 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -12,6 +12,7 @@ from .helper import get_python_type_for_api_type from .metadata_filters import filter_codegen_attributes from .metadata_filters import filter_codegen_functions +from .metadata_filters import filter_rep_cap_supported_attributes from .metadata_find import find_custom_type from .metadata_find import find_size_parameter from .metadata_merge_dicts import merge_helper @@ -721,6 +722,9 @@ def add_all_config_metadata(config): if 'uses_nitclk' not in config: config['uses_nitclk'] = False + if 'repeated_capability_object_type' not in config: + config['repeated_capability_object_type'] = {'python': 'session'} + return config diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index 3a4d5bb1c1..dd402b0f36 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -450,4 +450,13 @@ def filter_codegen_enums(enums): '''Returns enum metadata only for those enums to be included in codegen''' return {k: v for k, v in enums.items() if v['codegen_method'] != 'no'} +def filter_rep_cap_supported_attributes(attributes, rep_cap_name): + '''Returns attribute metadata only for those attributes that support the specified repeated capability. + Args: + attributes: Dictionary of attribute metadata. + rep_cap_name: The name of the repeated capability to filter by. + Returns: + Dictionary of attributes that support the specified repeated capability. + ''' + return {k: v for k, v in attributes.items() if rep_cap_name in v.get('supported_rep_caps', [])} diff --git a/build/templates/session.py.mako b/build/templates/session.py.mako index df755677b3..b91afd992f 100644 --- a/build/templates/session.py.mako +++ b/build/templates/session.py.mako @@ -91,6 +91,83 @@ class _Lock(object): % endif % if len(config['repeated_capabilities']) > 0: +% if config['repeated_capability_object_type']['python'] == 'custom': +% for rep_cap in config['repeated_capabilities']: + +class _RepeatedCapability${rep_cap['python_name'].capitalize()}(object): + % for attribute in helper.sorted_attrs(helper.filter_rep_cap_supported_attributes(attributes, rep_cap['python_name'])): +<% +helper.add_attribute_rep_cap_tip(attributes[attribute], config) +%>\ + % if attributes[attribute]['enum']: + % if helper.enum_uses_converter(enums[attributes[attribute]['enum']]): + ${attributes[attribute]['python_name']} = _attributes.AttributeEnumWithConverter(_attributes.AttributeEnum(_attributes.Attribute${attributes[attribute]['type']}, enums.${enums[attributes[attribute]['enum']]['python_name']}, ${attribute}), _converters.${enums[attributes[attribute]['enum']]['enum_to_converted_value_function_name']}, _converters.${enums[attributes[attribute]['enum']]['converted_value_to_enum_function_name']}) + % else: + ${attributes[attribute]['python_name']} = _attributes.AttributeEnum(_attributes.Attribute${attributes[attribute]['type']}, enums.${enums[attributes[attribute]['enum']]['python_name']}, ${attribute}) + % endif + % else: + ${attributes[attribute]['python_name']} = _attributes.${attributes[attribute]['attribute_class']}(${attribute}) + % endif +% if 'documentation' in attributes[attribute] and len(helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4).strip()) > 0: + '''Type: ${attributes[attribute]['type_in_documentation']} + + ${helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4)} + ''' +% endif +% endfor + def __init__(self, session, repeated_capability_list): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) + object.__setattr__(self, '_prefix', '${rep_cap["prefix"]}') + object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) + object.__setattr__(self, '_separator', '') + + def __setattr__(self, key, value): + if key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) + + def __getitem__(self, repeated_capability): + '''Set/get properties or call methods with a repeated capability (i.e. channels)''' + rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) + complete_rep_cap_list = [ + current_rep_cap + self._separator + rep_cap + for current_rep_cap in self._current_repeated_capability_list + for rep_cap in rep_caps_list + ] + object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) + self._current_repeated_capability_list = complete_rep_cap_list + + return self + + def _get_attribute_vi_real64(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) + return value + + def _set_attribute_vi_real64(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) + + def _get_attribute_vi_int32(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) + return value + + def _set_attribute_vi_int32(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) + + def _get_attribute_vi_string(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) +% endfor +% else: class _RepeatedCapabilities(object): def __init__(self, session, prefix, current_repeated_capability_list): self._session = session @@ -128,6 +205,7 @@ class _NoChannel(object): self._session._repeated_capability = self._repeated_capability_cache +% endif % endif class _SessionBase(object): '''Base class for all ${config['driver_name']} sessions.''' @@ -137,6 +215,11 @@ class _SessionBase(object): % for attribute in helper.sorted_attrs(helper.filter_codegen_attributes(attributes)): <% +# Skip attributes with repeated capability expansion set to "custom" +if 'repeated_capability_type' in attributes[attribute]: + rep_cap_type = attributes[attribute]['repeated_capability_type'] + if any(rep_cap.get('python_name') == rep_cap_type and config['repeated_capability_object_type'] == 'custom' for rep_cap in config['repeated_capabilities']): + continue helper.add_attribute_rep_cap_tip(attributes[attribute], config) %>\ %if attributes[attribute]['enum']: @@ -178,9 +261,13 @@ constructor_params = helper.filter_parameters(init_function['parameters'], helpe % if len(config['repeated_capabilities']) > 0: # Instantiate any repeated capability objects -% for rep_cap in config['repeated_capabilities']: +% for rep_cap in config['repeated_capabilities']: +% if config['repeated_capability_object_type']['python'] == 'custom': + self.${rep_cap['python_name']} = _RepeatedCapability${rep_cap['python_name'].capitalize()}(self, repeated_capability_list) +% else: self.${rep_cap['python_name']} = _RepeatedCapabilities(self, '${rep_cap["prefix"]}', repeated_capability_list) -% endfor +% endif +% endfor % endif # Finally, set _is_frozen to True which is used to prevent clients from accidentally adding From 4592a33839c1fe6d647cbaab2c547193881e4fa5 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 15:08:44 +0530 Subject: [PATCH 2/8] field addition in nifake config --- src/nifake/metadata/attributes.py | 2 +- src/nifake/metadata/config.py | 7 +++++-- src/nifake/metadata/enums.py | 2 +- src/nifake/metadata/functions.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/nifake/metadata/attributes.py b/src/nifake/metadata/attributes.py index 92c59e145b..b78d82bb00 100644 --- a/src/nifake/metadata/attributes.py +++ b/src/nifake/metadata/attributes.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-FAKE API metadata version 24.8.0f100 +# This file is generated from NI-FAKE API metadata version 25.5.0d9999 attributes = { 1000000: { 'access': 'read-write', diff --git a/src/nifake/metadata/config.py b/src/nifake/metadata/config.py index cad911ac9b..0cc90b8392 100644 --- a/src/nifake/metadata/config.py +++ b/src/nifake/metadata/config.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-FAKE API metadata version 24.8.0f100 +# This file is generated from NI-FAKE API metadata version 25.5.0d9999 config = { - 'api_version': '24.8.0f100', + 'api_version': '25.5.0d9999', 'c_function_prefix': 'niFake_', 'close_function': 'close', 'context_manager_name': { @@ -72,6 +72,9 @@ 'python_name': 'instruments' } ], + 'repeated_capability_object_type': { + 'python': 'session' + }, 'session_class_description': 'An NI-FAKE session to a fake MI driver whose sole purpose is to test nimi-python code generation', 'session_handle_parameter_name': 'vi', 'uses_nitclk': True diff --git a/src/nifake/metadata/enums.py b/src/nifake/metadata/enums.py index 97ebe3add5..f3e05575ab 100644 --- a/src/nifake/metadata/enums.py +++ b/src/nifake/metadata/enums.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-FAKE API metadata version 24.8.0f100 +# This file is generated from NI-FAKE API metadata version 25.5.0d9999 enums = { 'AltColor': { 'values': [ diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 24d8ebd8c5..8f06bc4002 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-FAKE API metadata version 24.8.0f100 +# This file is generated from NI-FAKE API metadata version 25.5.0d9999 functions = { 'Abort': { 'codegen_method': 'public', From e2f1e09432d32fd1a4f0f41a001522e1a8c533b4 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 15:09:56 +0530 Subject: [PATCH 3/8] updated session.py of nirfsg after template and config changes --- generated/nirfsg/nirfsg/session.py | 1112 +++++++++++++++++++++++++++- src/nirfsg/metadata/config.py | 3 + 2 files changed, 1085 insertions(+), 30 deletions(-) diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index c81c41bad1..775458f49f 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -52,43 +52,1095 @@ def __exit__(self, exc_type, exc_value, traceback): self._session.unlock() -class _RepeatedCapabilities(object): - def __init__(self, session, prefix, current_repeated_capability_list): - self._session = session - self._prefix = prefix - # We need at least one element. If we get an empty list, make the one element an empty string - self._current_repeated_capability_list = current_repeated_capability_list if len(current_repeated_capability_list) > 0 else [''] - # Now we know there is at lease one entry, so we look if it is an empty string or not - self._separator = '/' if len(self._current_repeated_capability_list[0]) > 0 else '' + +class _RepeatedCapabilityMarkers(object): + exported_marker_event_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.MarkerEventExportOutputTerm, 1150064) + '''Type: enums.MarkerEventExportOutputTerm + + Specifies the destination terminal for exporting the Marker Event. To set this property, the NI-RFSG device must be in the Configuration state. + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Marker Events `_ + + `PFI Lines `_ + + `PXI Trigger Lines `_ + + **High-Level Methods**: + + - export_signal + + **Defined Values**: + + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | Name | Value | Description | + +===========================================+=============+=================================================================================================================================+ + | MarkerEventExportOutputTerm.DO_NOT_EXPORT | | The signal is not exported. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PFI0 | PFI0 | The signal is exported to the PFI 0 connector. For the PXIe-5841 with PXIe-5655, the signal is exported to the PXIe-5841 PFI 0. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PFI1 | PFI1 | The signal is exported to the PFI 1 connector. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PFI4 | PFI4 | The signal is exported to the PFI 4 connector. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PFI5 | PFI5 | The signal is exported to the PFI 5 connector. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | MarkerEventExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | + +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers to specify a subset. + + Example: :py:attr:`my_session.markers[ ... ].exported_marker_event_output_terminal` + + To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.exported_marker_event_output_terminal` + ''' + marker_event_output_behavior = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventOutputBehavior, 1150206) + '''Type: enums.MarkerEventOutputBehavior + + Specifies the output behavior for the Marker Event. To set this property, the NI-RFSG device must be in the Configuration state. + + **Default Value:** MarkerEventOutputBehavior.PULSE + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Marker Events `_ + + **Defined Values**: + + +----------------------------------+----------------+-------------------------------------------------------+ + | Name | Value | Description | + +==================================+================+=======================================================+ + | MarkerEventOutputBehavior.PULSE | 23000 (0x59d8) | Specifies the Marker Event output behavior as pulse. | + +----------------------------------+----------------+-------------------------------------------------------+ + | MarkerEventOutputBehavior.TOGGLE | 23001 (0x59d9) | Specifies the Marker Event output behavior as toggle. | + +----------------------------------+----------------+-------------------------------------------------------+ + + Tip: + This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers to specify a subset. + + Example: :py:attr:`my_session.markers[ ... ].marker_event_output_behavior` + + To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.marker_event_output_behavior` + ''' + marker_event_pulse_width = _attributes.AttributeViReal64(1150207) + '''Type: float + + Specifies the pulse width value for the Marker Event. Use the marker_event_pulse_width_units property to set the units for the pulse width value. This property is valid only when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.PULSE. + + To set this property, the NI-RFSG device must be in the Configuration state. + + **Default Value:** 200 ns + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Marker Events `_ + + Tip: + This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers to specify a subset. + + Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width` + + To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.marker_event_pulse_width` + ''' + marker_event_pulse_width_units = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventPulseWidthUnits, 1150208) + '''Type: enums.MarkerEventPulseWidthUnits + + Specifies the pulse width units for the Marker Event. This property is valid only when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.PULSE. + + To set this property, the NI-RFSG device must be in the Configuration state. + + **Default Value:** MarkerEventPulseWidthUnits.SECONDS + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Marker Events `_ + + **Defined Values**: + + +----------------------------------+----------------+-------------------------------------------------------+ + | Name | Value | Description | + +==================================+================+=======================================================+ + | MarkerEventOutputBehavior.PULSE | 23000 (0x59d8) | Specifies the Marker Event output behavior as pulse. | + +----------------------------------+----------------+-------------------------------------------------------+ + | MarkerEventOutputBehavior.TOGGLE | 23001 (0x59d9) | Specifies the Marker Event output behavior as toggle. | + +----------------------------------+----------------+-------------------------------------------------------+ + + Tip: + This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers to specify a subset. + + Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width_units` + + To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.marker_event_pulse_width_units` + ''' + marker_event_terminal_name = _attributes.AttributeViString(1150115) + '''Type: str + + Returns the name of the fully qualified signal name as a string. + + **Default Values**: + + PXI-5670/5671, PXIe-5672/5673/5673E: /*AWGName*/Marker *X* Event, where *AWGName* is the name of your associated AWG module in MAX and *X* is Marker Event 0 through 3. + + PXIe-5830/5831/5832: /*BasebandModule*/ao/0/Marker *X* Event, where *BasebandModule* is the name of the baseband module of your device in MAX and *X* is Marker Event 0 through 3. + + PXIe-5820/5840/5841: /*ModuleName*/ao/0/Marker *X* Event, where *ModuleName* is the name of your device in MAX and *X* is Marker Event 0 through 3. + + **Supported Devices:** PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Events `_ + + `Syntax for Terminal Names `_ + + **High-Level Methods**: + + - GetTerminalName + + Tip: + This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers to specify a subset. + + Example: :py:attr:`my_session.markers[ ... ].marker_event_terminal_name` + + To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.marker_event_terminal_name` + ''' + marker_event_toggle_initial_state = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventToggleInitialState, 1150209) + '''Type: enums.MarkerEventToggleInitialState + + Specifies the initial state for the Marker Event when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.TOGGLE. + + To set this property, the NI-RFSG device must be in the Configuration state. + + **Default Value:** MarkerEventToggleInitialState.LOW + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Marker Events `_ + + **Defined Values**: + + +------------------------------------+----------------+----------------------------------------------------------------------------------+ + | Name | Value | Description | + +====================================+================+==================================================================================+ + | MarkerEventToggleInitialState.HIGH | 21001 (0x5209) | Specifies the initial state of the Marker Event toggle behavior as digital high. | + +------------------------------------+----------------+----------------------------------------------------------------------------------+ + | MarkerEventToggleInitialState.LOW | 21000 (0x5208) | Specifies the initial state of the Marker Event toggle behavior as digital low. | + +------------------------------------+----------------+----------------------------------------------------------------------------------+ + + Tip: + This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers to specify a subset. + + Example: :py:attr:`my_session.markers[ ... ].marker_event_toggle_initial_state` + + To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.marker_event_toggle_initial_state` + ''' + def __init__(self, session, repeated_capability_list): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) + object.__setattr__(self, '_prefix', 'marker') + object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) + object.__setattr__(self, '_separator', '') + + def __setattr__(self, key, value): + if key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) + + def __getitem__(self, repeated_capability): + '''Set/get properties or call methods with a repeated capability (i.e. channels)''' + rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) + complete_rep_cap_list = [ + current_rep_cap + self._separator + rep_cap + for current_rep_cap in self._current_repeated_capability_list + for rep_cap in rep_caps_list + ] + object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) + self._current_repeated_capability_list = complete_rep_cap_list + + return self + + def _get_attribute_vi_real64(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) + return value + + def _set_attribute_vi_real64(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) + + def _get_attribute_vi_int32(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) + return value + + def _set_attribute_vi_int32(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) + + def _get_attribute_vi_string(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) + +class _RepeatedCapabilityScript_triggers(object): + digital_edge_script_trigger_edge = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigEdgeEdge, 1150021) + '''Type: enums.ScriptTrigDigEdgeEdge + + Specifies the active edge for the Script Trigger. This property is used when the script_trigger_type property is set to digital edge. To set the digital_edge_script_trigger_edge property, the NI-RFSG device must be in the Configuration state. + + **Default Value:** ScriptTrigDigEdgeEdge.RISING + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Script Trigger `_ + + `Digital Edge Trigger `_ + + **High-Level Methods**: + + - configure_digital_edge_script_trigger + + **Defined Values**: + + +-------------------------------+---------+-------------------------------------------------------------------------------+ + | Name | Value | Description | + +===============================+=========+===============================================================================+ + | ScriptTrigDigEdgeEdge.FALLING | 1 (0x1) | Asserts the trigger when the signal transitions from high level to low level. | + +-------------------------------+---------+-------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeEdge.RISING | 0 (0x0) | Asserts the trigger when the signal transitions from low level to high level. | + +-------------------------------+---------+-------------------------------------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_edge` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.digital_edge_script_trigger_edge` + ''' + digital_edge_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigEdgeSource, 1150020) + '''Type: enums.ScriptTrigDigEdgeSource + + Specifies the source terminal for the Script Trigger. This property is used when the script_trigger_type property is set to digital edge. To set this property, the NI-RFSG device must be in the Configuration state. + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Script Trigger `_ + + `PFI Lines `_ + + `PXI Trigger Lines `_ + + **High-Level Methods**: + + - configure_digital_edge_script_trigger + + **Defined Values**: + + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | Name | Value | Description | + +=============================================+=============+=========================================================================================================================================+ + | ScriptTrigDigEdgeSource.PFI0 | PFI0 | The trigger is received on PFI 0. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PFI1 | PFI1 | The trigger is received on PFI 1. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PFI2 | PFI2 | The trigger is received on PFI 2. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PFI3 | PFI3 | The trigger is received on PFI 3. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_STAR | PXI_Star | The trigger is received on the PXI star trigger line. This value is not valid for the PXIe-5644/5645/5646. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXI_TRIG7 | PXI_Trig7 | The trigger is received on PXI trigger line 7. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PXIE_DSTARB | PXIe_DStarB | The trigger is received on the PXIe DStar B trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841/5842/5860. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.PULSE_IN | PulseIn | The trigger is received on the PULSE IN terminal. This value is valid on only the PXIe-5842. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigEdgeSource.SYNC_SCRIPT_TRIGGER | Sync_Script | The trigger is received on the Sync Script trigger line. This value is valid on only the PXIe-5644/5645/5646. | + +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_source` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.digital_edge_script_trigger_source` + ''' + digital_level_script_trigger_active_level = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigLevelActiveLevel, 1150055) + '''Type: enums.ScriptTrigDigLevelActiveLevel + + Specifies the active level for the Script Trigger. This property is used when the script_trigger_type property is set to ScriptTrigType.DIGITAL_LEVEL. + + **Default Value:** ScriptTrigDigLevelActiveLevel.HIGH + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + + + **Related Topics** + + `Script Trigger `_ + + `Digital Level Trigger `_ + + **Defined Values**: + + +------------------------------------+---------------+--------------------------------------------------+ + | Name | Value | Description | + +====================================+===============+==================================================+ + | ScriptTrigDigLevelActiveLevel.HIGH | 9000 (0x2328) | Trigger when the digital trigger signal is high. | + +------------------------------------+---------------+--------------------------------------------------+ + | ScriptTrigDigLevelActiveLevel.LOW | 9001 (0x2329) | Trigger when the digital trigger signal is low. | + +------------------------------------+---------------+--------------------------------------------------+ + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_active_level` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.digital_level_script_trigger_active_level` + ''' + digital_level_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigLevelSource, 1150054) + '''Type: enums.ScriptTrigDigLevelSource + + Specifies the source terminal for the Script Trigger. This property is used when the script_trigger_type property is set to ScriptTrigType.DIGITAL_LEVEL. The digital_level_script_trigger_source property is not case-sensitive. + + To set the digital_level_script_trigger_source property, the NI-RFSG device must be in the Configuration state. + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Script Trigger `_ + + `PFI Lines `_ + + `PXI Trigger Lines `_ + + **Defined Values**: + + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | Name | Value | Description | + +======================================+=============+=========================================================================================================================================+ + | ScriptTrigDigLevelSource.PFI0 | PFI0 | The trigger is received on PFI 0. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PFI1 | PFI1 | The trigger is received on PFI 1. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PFI2 | PFI2 | The trigger is received on PFI 2. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PFI3 | PFI3 | The trigger is received on PFI 3. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_STAR | PXI_Star | The trigger is received on the PXI star trigger line. This value is not valid for the PXIe-5644/5645/5646. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXI_TRIG7 | PXI_Trig7 | The trigger is received on PXI trigger line 7. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PXIE_DSTARB | PXIe_DStarB | The trigger is received on the PXIe DStar B trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841/5842/5860. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.PULSE_IN | PulseIn | The trigger is received on the PULSE IN terminal. This value is valid on only the PXIe-5842. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigDigLevelSource.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | + +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_source` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.digital_level_script_trigger_source` + ''' + exported_script_trigger_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigExportOutputTerm, 1150022) + '''Type: enums.ScriptTrigExportOutputTerm + + Specifies the destination terminal for exporting the Script Trigger. To set this property, the NI-RFSG device must be in the Configuration state. + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Script Trigger `_ —Refer to this topic for information about trigger delay. + + `PFI Lines `_ + + `PXI Trigger Lines `_ + + **High-Level Methods**: + + - export_signal + + **Defined Values**: + + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | Name | Value | Description | + +==========================================+=============+=================================================================================================================================+ + | ScriptTrigExportOutputTerm.DO_NOT_EXPORT | | The signal is not exported. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PFI0 | PFI0 | The signal is exported to the PFI 0 connector. For the PXIe-5841 with PXIe-5655, the signal is exported to the PXIe-5841 PFI 0. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PFI1 | PFI1 | The signal is exported to the PFI 1 connector. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PFI4 | PFI4 | The signal is exported to the PFI 4 connector. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PFI5 | PFI5 | The signal is exported to the PFI 5 connector. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | + +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].exported_script_trigger_output_terminal` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.exported_script_trigger_output_terminal` + ''' + script_trigger_terminal_name = _attributes.AttributeViString(1150116) + '''Type: str + + Returns the name of the fully qualified signal name as a string. + + **Default Values**: + + PXI-5670/5671, PXIe-5672/5673/5673E: /*AWGName*/ScriptTrigger *X*, where *AWGName* is the name of your associated AWG module in MAX and *X* is Script Trigger 0 through 3. + + PXIe-5830/5831/5832: /*BasebandModule*/ao/0/ScriptTrigger *X*, where *BasebandModule* is the name of the baseband module of your device in MAX and *X* is Script Trigger 0 through 3. + + PXIe-5820/5840/5841/5842: /*ModuleName*/ao/0/ScriptTrigger *X*, where *ModuleName* is the name of your device in MAX and *X* is Script Trigger 0 through 3. + + PXIe-5860: /*ModuleName*/ao/*ChannelNumber*/ScriptTrigger *X*, where *ModuleName* is the name of your device in MAX, *ChannelNumber* is the channel number (0 or 1), and *X* is Script Trigger 0 through 3. + + **Supported Devices:** PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Triggers `_ + + `Syntax for Terminal Names `_ + + **High-Level Methods**: + + - GetTerminalName + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_terminal_name` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.script_trigger_terminal_name` + ''' + script_trigger_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigType, 1150019) + '''Type: enums.ScriptTrigType + + Specifies the Script Trigger type. Depending upon the value of this property, more properties may be needed to fully configure the trigger. To set this property, the NI-RFSG device must be in the Configuration state. + + **Default Value:** ScriptTrigType.NONE + + **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Script Trigger `_ + + `Trigger Types `_ + + **High-Level Methods**: + + - configure_digital_edge_script_trigger + + **Defined Values**: + + +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Value | Description | + +==============================+=======================================================================================================================================================================================================================================================================+ + | ScriptTrigType.NONE | No trigger is configured. Signal generation starts immediately. | + +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigType.DIGITAL_EDGE | The data operation does not start until a digital edge is detected. The source of the digital edge is specified with the digital_edge_start_trigger_source property, and the active edge is specified with the digital_edge_start_trigger_edge property. | + +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigType.DIGITAL_LEVEL | The data operation does not start until the digital level is detected. The source of the digital level is specified in the digital_level_script_trigger_source property, and the active level is specified in the digital_level_script_trigger_active_level property. | + +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | ScriptTrigType.SOFTWARE | The data operation does not start until a software trigger occurs. You can create a software event by calling the send_software_edge_trigger method. | + +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container script_triggers to specify a subset. + + Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_type` + + To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.script_trigger_type` + ''' + def __init__(self, session, repeated_capability_list): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) + object.__setattr__(self, '_prefix', 'scripttrigger') + object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) + object.__setattr__(self, '_separator', '') + + def __setattr__(self, key, value): + if key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) + + def __getitem__(self, repeated_capability): + '''Set/get properties or call methods with a repeated capability (i.e. channels)''' + rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) + complete_rep_cap_list = [ + current_rep_cap + self._separator + rep_cap + for current_rep_cap in self._current_repeated_capability_list + for rep_cap in rep_caps_list + ] + object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) + self._current_repeated_capability_list = complete_rep_cap_list + + return self + + def _get_attribute_vi_real64(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) + return value + + def _set_attribute_vi_real64(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) + + def _get_attribute_vi_int32(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) + return value + + def _set_attribute_vi_int32(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) + + def _get_attribute_vi_string(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) + +class _RepeatedCapabilityWaveform(object): + waveform_iq_rate = _attributes.AttributeViReal64(1150263) + '''Type: float + + Specifies the I/Q rate of the waveform. To set this property, the NI-RFSG device must be in the Configuration state. + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_—Refer to this topic for more information about using this property to associate an I/Q rate with a waveform. + + `Digital Upconverter `_ + + Tip: + This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform to specify a subset. + + Example: :py:attr:`my_session.waveform[ ... ].waveform_iq_rate` + + To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.waveform_iq_rate` + ''' + waveform_papr = _attributes.AttributeViReal64(1150266) + '''Type: float + + Specifies the peak-to-average power ratio (PAPR). + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + Tip: + This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform to specify a subset. + + Example: :py:attr:`my_session.waveform[ ... ].waveform_papr` + + To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.waveform_papr` + ''' + waveform_rf_blanking = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.RFBlanking, 1150278) + '''Type: enums.RFBlanking + + **Defined Values**: + + Name (Value): Description + + RFBlanking.DISABLE (0): RF blanking is disabled. + + RFBlanking.ENABLE (1): RF blanking is enabled. + + **Default Value:** RFBlanking.DISABLE + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Marker Events `_ + + Enables or disables RF blanking. + + +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ + | rf_blanking_source | waveform_rf_blanking | Behaviour | + +===================================================================================+======================+===========================================================================================================+ + | "" (empty string) | RFBlanking.DISABLE | No blanking performed. | + +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ + | "" (empty string) | RFBlanking.ENABLE | Blanking performed based on burst start and stop values and blanking source set to private marker. | + +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ + | NIRFSG_VAL_MARKER0, NIRFSG_VAL_MARKER1, NIRFSG_VAL_MARKER2, or NIRFSG_VAL_MARKER3 | RFBlanking.DISABLE | Blanking performed based on the marker locations for the marker that the user set in the blanking source. | + +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ + | NIRFSG_VAL_MARKER0, NIRFSG_VAL_MARKER1, NIRFSG_VAL_MARKER2, or NIRFSG_VAL_MARKER3 | RFBlanking.ENABLE | Error is shown. | + +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ + + Note: For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call ResetWithOptions or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + + Note: + One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + Tip: + This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform to specify a subset. + + Example: :py:attr:`my_session.waveform[ ... ].waveform_rf_blanking` + + To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.waveform_rf_blanking` + ''' + waveform_runtime_scaling = _attributes.AttributeViReal64(1150265) + '''Type: float + + Specifies the waveform runtime scaling. The waveform runtime scaling is applied to the waveform data before any other signal processing. + + **Units**: dB + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860, PXIe-5841 with PXIe-5655 + + Tip: + This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform to specify a subset. + + Example: :py:attr:`my_session.waveform[ ... ].waveform_runtime_scaling` + + To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.waveform_runtime_scaling` + ''' + waveform_signal_bandwidth = _attributes.AttributeViReal64(1150264) + '''Type: float + + Specifies the bandwidth of the arbitrary signal. This value must be less than or equal to (0.8× iq_rate). + + **Units**: hertz (Hz) + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + Tip: + This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform to specify a subset. + + Example: :py:attr:`my_session.waveform[ ... ].waveform_signal_bandwidth` + + To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.waveform_signal_bandwidth` + ''' + waveform_waveform_size = _attributes.AttributeViInt32(1150297) + '''Type: int + + Specifies the size of the waveform specified by an active channel. + + **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5841 with PXIe-5655/5842/5860 + + Tip: + This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform to specify a subset. + + Example: :py:attr:`my_session.waveform[ ... ].waveform_waveform_size` + + To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.waveform_waveform_size` + ''' + def __init__(self, session, repeated_capability_list): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) + object.__setattr__(self, '_prefix', 'waveform::') + object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) + object.__setattr__(self, '_separator', '') + + def __setattr__(self, key, value): + if key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) def __getitem__(self, repeated_capability): '''Set/get properties or call methods with a repeated capability (i.e. channels)''' rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) - complete_rep_cap_list = [current_rep_cap + self._separator + rep_cap for current_rep_cap in self._current_repeated_capability_list for rep_cap in rep_caps_list] + complete_rep_cap_list = [ + current_rep_cap + self._separator + rep_cap + for current_rep_cap in self._current_repeated_capability_list + for rep_cap in rep_caps_list + ] + object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) + self._current_repeated_capability_list = complete_rep_cap_list - return _SessionBase( - repeated_capability_list=complete_rep_cap_list, - all_channels_in_session=self._session._all_channels_in_session, - interpreter=self._session._interpreter, - freeze_it=True - ) + return self + def _get_attribute_vi_real64(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) + return value -# This is a very simple context manager we can use when we need to set/get attributes -# or call functions from _SessionBase that require no channels. It is tied to the specific -# implementation of _SessionBase and how repeated capabilities are handled. -class _NoChannel(object): - def __init__(self, session): - self._session = session + def _set_attribute_vi_real64(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) - def __enter__(self): - self._repeated_capability_cache = self._session._repeated_capability - self._session._repeated_capability = '' + def _get_attribute_vi_int32(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) + return value - def __exit__(self, exc_type, exc_value, traceback): - self._session._repeated_capability = self._repeated_capability_cache + def _set_attribute_vi_int32(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) + + def _get_attribute_vi_string(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) + +class _RepeatedCapabilityDeembedding_port(object): + deembedding_compensation_gain = _attributes.AttributeViReal64(1150289) + '''Type: float + + Returns the de-embedding gain applied to compensate for the mismatch on the specified port. If de-embedding is enabled, NI-RFSG uses the returned compensation gain to remove the effects of the external network between the instrument and the DUT. + + **Supported Devices**: PXIe-5830/5831/5832/5840/5841/5842/5860 + + Tip: + This property can be set/get on specific deembedding_port within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. + + Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_compensation_gain` + + To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.deembedding_compensation_gain` + ''' + deembedding_selected_table = _attributes.AttributeViString(1150253) + '''Type: str + + Selects the de-embedding table to apply to the measurements on the specified port. + + To use this property, you must use the channelName parameter of the _set_attribute_vi_string method to specify the name of the port to configure for de-embedding. + + If de-embedding is enabled, NI-RFSG uses the specified table to remove the effects of the external network between the instrument and the DUT. + + Use the create deembedding sparameter table array method to create tables. + + **Supported Devices**: PXIe-5830/5831/5832/5840/5841/5842/5860 + + Tip: + This property can be set/get on specific deembedding_port within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. + + Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_selected_table` + + To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.deembedding_selected_table` + ''' + deembedding_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.DeembeddingTypeAttrVals, 1150252) + '''Type: enums.DeembeddingTypeAttrVals + + Specifies the type of de-embedding to apply to measurements on the specified port. + + To use this property, you must use the channelName parameter of the _set_attribute_vi_int32 method to specify the name of the port to configure for de-embedding. + + If you set this property to DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR or DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR, NI-RFSG adjusts the instrument settings and the returned data to remove the effects of the external network between the instrument and the DUT. + + **Default Value**: DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR + + **Valid Values for PXIe-5830/5832/5840/5841/5842/5860** : DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR or DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_NONE + + **Valid Values for PXIe-5831** DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR, DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR, or DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_NONE. DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR is only supported for TRX Ports in a Semiconductor Test System (STS). + + **Supported Devices**: PXIe-5830/5831/5832/5840/5841/5842/5860 + + **Defined Values**: + + +-------------------------------------------------+----------------+------------------------------------------------------------------------+ + | Name | Value | Description | + +=================================================+================+========================================================================+ + | DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_NONE | 25000 (0x61a8) | De-embedding is not applied to the measurement. | + +-------------------------------------------------+----------------+------------------------------------------------------------------------+ + | DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR | 25001 (0x61a9) | De-embeds the measurement using only the gain term. | + +-------------------------------------------------+----------------+------------------------------------------------------------------------+ + | DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR | 25002 (0x61aa) | De-embeds the measurement using the gain term and the reflection term. | + +-------------------------------------------------+----------------+------------------------------------------------------------------------+ + + Tip: + This property can be set/get on specific deembedding_port within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. + + Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_type` + + To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. + + Example: :py:attr:`my_session.deembedding_type` + ''' + def __init__(self, session, repeated_capability_list): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) + object.__setattr__(self, '_prefix', '') + object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) + object.__setattr__(self, '_separator', '') + + def __setattr__(self, key, value): + if key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) + + def __getitem__(self, repeated_capability): + '''Set/get properties or call methods with a repeated capability (i.e. channels)''' + rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) + complete_rep_cap_list = [ + current_rep_cap + self._separator + rep_cap + for current_rep_cap in self._current_repeated_capability_list + for rep_cap in rep_caps_list + ] + object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) + self._current_repeated_capability_list = complete_rep_cap_list + + return self + + def _get_attribute_vi_real64(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) + return value + + def _set_attribute_vi_real64(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) + def _get_attribute_vi_int32(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) + return value + + def _set_attribute_vi_int32(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) + def _get_attribute_vi_string(self, attribute): + repeated_capability = ','.join(self._current_repeated_capability_list) + value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + repeated_capability = ','.join(self._current_repeated_capability_list) + self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) class _SessionBase(object): '''Base class for all NI-RFSG sessions.''' @@ -5415,10 +6467,10 @@ def __init__(self, repeated_capability_list, all_channels_in_session, interprete self._param_list = ', '.join(param_list) # Instantiate any repeated capability objects - self.markers = _RepeatedCapabilities(self, 'marker', repeated_capability_list) - self.script_triggers = _RepeatedCapabilities(self, 'scripttrigger', repeated_capability_list) - self.waveform = _RepeatedCapabilities(self, 'waveform::', repeated_capability_list) - self.deembedding_port = _RepeatedCapabilities(self, '', repeated_capability_list) + self.markers = _RepeatedCapabilityMarkers(self, repeated_capability_list) + self.script_triggers = _RepeatedCapabilityScript_triggers(self, repeated_capability_list) + self.waveform = _RepeatedCapabilityWaveform(self, repeated_capability_list) + self.deembedding_port = _RepeatedCapabilityDeembedding_port(self, repeated_capability_list) # Finally, set _is_frozen to True which is used to prevent clients from accidentally adding # members when trying to set a property with a typo. diff --git a/src/nirfsg/metadata/config.py b/src/nirfsg/metadata/config.py index a4b2340071..0349e3f91f 100644 --- a/src/nirfsg/metadata/config.py +++ b/src/nirfsg/metadata/config.py @@ -39,6 +39,9 @@ } }, 'module_name': 'nirfsg', + 'repeated_capability_object_type': { + 'python': 'custom' + }, 'repeated_capabilities': [ { 'prefix': 'marker', From b096c3bf472a7db7661987775a21f3ea33defb31 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 15:49:16 +0530 Subject: [PATCH 4/8] Added unit test for rfsg --- .../nirfsg/nirfsg/unit_tests/test_nirfsg.py | 48 + nirfsgunittest.xml | 2345 +++++++++++++++++ src/nirfsg/unit_tests/test_nirfsg.py | 48 + tox-travis.ini | 5 + tox.ini | 5 + 5 files changed, 2451 insertions(+) create mode 100644 generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py create mode 100644 nirfsgunittest.xml create mode 100644 src/nirfsg/unit_tests/test_nirfsg.py diff --git a/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py b/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py new file mode 100644 index 0000000000..eed139eeb9 --- /dev/null +++ b/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py @@ -0,0 +1,48 @@ +import hightime +import nirfsg + +from unittest.mock import MagicMock +from unittest.mock import patch +import _mock_helper + +SESSION_NUM_FOR_TEST = 42 + +class TestSession: + + class PatchedLibraryInterpreter(nirfsg._library_interpreter.LibraryInterpreter): + def __init__(self, encoding): + for f in dir(self): + if not f.startswith("_") and f not in {'get_session_handle', 'set_session_handle'}: + setattr(self, f, MagicMock(spec_set=getattr(self, f), side_effect=_mock_helper.MockFunctionCallError(f))) + + def setup_method(self, method): + self.patched_library_interpreter = self.PatchedLibraryInterpreter(None) + self.patched_library_interpreter_ctor = patch('nirfsg.session._library_interpreter.LibraryInterpreter', return_value=self.patched_library_interpreter) + self.patched_library_interpreter_ctor.start() + + # We don't actually call into the nitclk DLL, but we do need to mock the function since it is called + self.tclk_patched_library_singleton_get = patch('nitclk._library_interpreter._library_singleton.get', return_value=None) + self.tclk_patched_library_singleton_get.start() + + def interpreter_init(*args, **kwargs): + self.patched_library_interpreter._close_on_exit = True + return SESSION_NUM_FOR_TEST + + self.patched_library_interpreter.init_with_options.side_effect = interpreter_init + self.patched_library_interpreter.close.side_effect = [None] + + # Mock lock/unlock + self.patched_library_interpreter.lock.side_effect = lambda *args: None + self.patched_library_interpreter.unlock.side_effect = lambda *args: None + + def teardown_method(self, method): + self.patched_library_interpreter_ctor.stop() + + def test_attribute_get_for_repeated_capability_custom_object(self): + string = 'markerterminal' + self.patched_library_interpreter.get_attribute_vi_string.side_effect = [string] + with nirfsg.Session('dev1',id_query = False, reset_device = False) as session: + # Custom expansion: Specify marker '0' + value = session.markers['0'].marker_event_terminal_name + # Verify that the repeated capability string is '0' + self.patched_library_interpreter.get_attribute_vi_string.assert_called_once_with('marker0', 1150115) \ No newline at end of file diff --git a/nirfsgunittest.xml b/nirfsgunittest.xml new file mode 100644 index 0000000000..827d15f440 --- /dev/null +++ b/nirfsgunittest.xml @@ -0,0 +1,2345 @@ + + + + + + /mnt/c/dev/Git/nimi-python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/nirfsg/unit_tests/test_nirfsg.py b/src/nirfsg/unit_tests/test_nirfsg.py new file mode 100644 index 0000000000..eed139eeb9 --- /dev/null +++ b/src/nirfsg/unit_tests/test_nirfsg.py @@ -0,0 +1,48 @@ +import hightime +import nirfsg + +from unittest.mock import MagicMock +from unittest.mock import patch +import _mock_helper + +SESSION_NUM_FOR_TEST = 42 + +class TestSession: + + class PatchedLibraryInterpreter(nirfsg._library_interpreter.LibraryInterpreter): + def __init__(self, encoding): + for f in dir(self): + if not f.startswith("_") and f not in {'get_session_handle', 'set_session_handle'}: + setattr(self, f, MagicMock(spec_set=getattr(self, f), side_effect=_mock_helper.MockFunctionCallError(f))) + + def setup_method(self, method): + self.patched_library_interpreter = self.PatchedLibraryInterpreter(None) + self.patched_library_interpreter_ctor = patch('nirfsg.session._library_interpreter.LibraryInterpreter', return_value=self.patched_library_interpreter) + self.patched_library_interpreter_ctor.start() + + # We don't actually call into the nitclk DLL, but we do need to mock the function since it is called + self.tclk_patched_library_singleton_get = patch('nitclk._library_interpreter._library_singleton.get', return_value=None) + self.tclk_patched_library_singleton_get.start() + + def interpreter_init(*args, **kwargs): + self.patched_library_interpreter._close_on_exit = True + return SESSION_NUM_FOR_TEST + + self.patched_library_interpreter.init_with_options.side_effect = interpreter_init + self.patched_library_interpreter.close.side_effect = [None] + + # Mock lock/unlock + self.patched_library_interpreter.lock.side_effect = lambda *args: None + self.patched_library_interpreter.unlock.side_effect = lambda *args: None + + def teardown_method(self, method): + self.patched_library_interpreter_ctor.stop() + + def test_attribute_get_for_repeated_capability_custom_object(self): + string = 'markerterminal' + self.patched_library_interpreter.get_attribute_vi_string.side_effect = [string] + with nirfsg.Session('dev1',id_query = False, reset_device = False) as session: + # Custom expansion: Specify marker '0' + value = session.markers['0'].marker_event_terminal_name + # Verify that the repeated capability string is '0' + self.patched_library_interpreter.get_attribute_vi_string.assert_called_once_with('marker0', 1150115) \ No newline at end of file diff --git a/tox-travis.ini b/tox-travis.ini index c7b847edd8..d65ebdaea0 100644 --- a/tox-travis.ini +++ b/tox-travis.ini @@ -77,6 +77,11 @@ commands = test: coverage report test: coverage xml -o nimodinstunittest.xml test: coverage html --directory=generated/htmlcov/unit_tests/nimodinst + test: coverage run --rcfile=tools/coverage_unit_tests.rc --source nirfsg -m pytest generated/nirfsg/nirfsg {posargs} -s + test: coverage report + test: coverage xml -o nirfsgunittest.xml + test: coverage html --directory=generated/htmlcov/unit_tests/nirfsg + test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s test: coverage report test: coverage xml -o niscopeunittest.xml diff --git a/tox.ini b/tox.ini index 517c919d94..5f9854ca19 100644 --- a/tox.ini +++ b/tox.ini @@ -77,6 +77,11 @@ commands = test: coverage report test: coverage xml -o nimodinstunittest.xml test: coverage html --directory=generated/htmlcov/unit_tests/nimodinst + test: coverage run --rcfile=tools/coverage_unit_tests.rc --source nirfsg -m pytest generated/nirfsg/nirfsg {posargs} -s + test: coverage report + test: coverage xml -o nirfsgunittest.xml + test: coverage html --directory=generated/htmlcov/unit_tests/nirfsg + test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s test: coverage report test: coverage xml -o niscopeunittest.xml From fada700d42e429b4b56310c18cd02f68a5e0a879 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 15:53:23 +0530 Subject: [PATCH 5/8] updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3563df429..4f9f4e69f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1668,6 +1668,7 @@ #### [nirfsg] Unreleased - Added - Enabled selected public APIs + - Enabled custom object expansion for repeated capability - Basic example - Documentation for APIs (not final) - Changed From b699bcd126956e9cd9d4a21efc9417bd1bf869b9 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 16:52:07 +0530 Subject: [PATCH 6/8] Updated indentation and variable name --- CHANGELOG.md | 2 +- build/templates/session.py.mako | 16 ++++++++-------- src/nirfsg/metadata/config.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f9f4e69f5..d982c5a2ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1668,7 +1668,7 @@ #### [nirfsg] Unreleased - Added - Enabled selected public APIs - - Enabled custom object expansion for repeated capability + - Enabled custom object expansion for repeated capabilities - Basic example - Documentation for APIs (not final) - Changed diff --git a/build/templates/session.py.mako b/build/templates/session.py.mako index b91afd992f..8de46d64c3 100644 --- a/build/templates/session.py.mako +++ b/build/templates/session.py.mako @@ -91,7 +91,7 @@ class _Lock(object): % endif % if len(config['repeated_capabilities']) > 0: -% if config['repeated_capability_object_type']['python'] == 'custom': +% if config['repeated_capability_object_type']['python'] == 'applicable-attributes-only': % for rep_cap in config['repeated_capabilities']: class _RepeatedCapability${rep_cap['python_name'].capitalize()}(object): @@ -215,10 +215,10 @@ class _SessionBase(object): % for attribute in helper.sorted_attrs(helper.filter_codegen_attributes(attributes)): <% -# Skip attributes with repeated capability expansion set to "custom" +# Skip attributes with repeated capability expansion set to "applicable-attributes-only" if 'repeated_capability_type' in attributes[attribute]: rep_cap_type = attributes[attribute]['repeated_capability_type'] - if any(rep_cap.get('python_name') == rep_cap_type and config['repeated_capability_object_type'] == 'custom' for rep_cap in config['repeated_capabilities']): + if any(rep_cap.get('python_name') == rep_cap_type and config['repeated_capability_object_type'] == 'applicable-attributes-only' for rep_cap in config['repeated_capabilities']): continue helper.add_attribute_rep_cap_tip(attributes[attribute], config) %>\ @@ -261,13 +261,13 @@ constructor_params = helper.filter_parameters(init_function['parameters'], helpe % if len(config['repeated_capabilities']) > 0: # Instantiate any repeated capability objects -% for rep_cap in config['repeated_capabilities']: -% if config['repeated_capability_object_type']['python'] == 'custom': +% for rep_cap in config['repeated_capabilities']: +% if config['repeated_capability_object_type']['python'] == 'applicable-attributes-only': self.${rep_cap['python_name']} = _RepeatedCapability${rep_cap['python_name'].capitalize()}(self, repeated_capability_list) -% else: +% else: self.${rep_cap['python_name']} = _RepeatedCapabilities(self, '${rep_cap["prefix"]}', repeated_capability_list) -% endif -% endfor +% endif +% endfor % endif # Finally, set _is_frozen to True which is used to prevent clients from accidentally adding diff --git a/src/nirfsg/metadata/config.py b/src/nirfsg/metadata/config.py index 0349e3f91f..62597d10c7 100644 --- a/src/nirfsg/metadata/config.py +++ b/src/nirfsg/metadata/config.py @@ -40,7 +40,7 @@ }, 'module_name': 'nirfsg', 'repeated_capability_object_type': { - 'python': 'custom' + 'python': 'applicable-attributes-only' }, 'repeated_capabilities': [ { From 66b874aa576513a338d9c0aa333b7c165cd89641 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Fri, 16 May 2025 17:16:42 +0530 Subject: [PATCH 7/8] Removed duplicate entry in *.ini files --- tox-travis.ini | 1 - tox.ini | 1 - 2 files changed, 2 deletions(-) diff --git a/tox-travis.ini b/tox-travis.ini index d65ebdaea0..f24d1a3e3e 100644 --- a/tox-travis.ini +++ b/tox-travis.ini @@ -82,7 +82,6 @@ commands = test: coverage xml -o nirfsgunittest.xml test: coverage html --directory=generated/htmlcov/unit_tests/nirfsg test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s - test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s test: coverage report test: coverage xml -o niscopeunittest.xml test: coverage html --directory=generated/htmlcov/unit_tests/niscope diff --git a/tox.ini b/tox.ini index 5f9854ca19..2ae6ba52cb 100644 --- a/tox.ini +++ b/tox.ini @@ -82,7 +82,6 @@ commands = test: coverage xml -o nirfsgunittest.xml test: coverage html --directory=generated/htmlcov/unit_tests/nirfsg test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s - test: coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope {posargs} -s test: coverage report test: coverage xml -o niscopeunittest.xml test: coverage html --directory=generated/htmlcov/unit_tests/niscope From 2faedc09337fd420f4e9f5e44039b21020373e08 Mon Sep 17 00:00:00 2001 From: vnktshr21 Date: Thu, 22 May 2025 12:41:13 +0000 Subject: [PATCH 8/8] cleaned up and fixed few issues and review comments --- .gitignore | 1 + build/helper/__init__.py | 2 +- build/helper/documentation_helper.py | 6 +- build/helper/documentation_snippets.py | 7 + build/helper/metadata_add_all.py | 1 - build/helper/metadata_filters.py | 4 + build/templates/session.py.mako | 113 +- build/unit_tests/test_metadata_add_all.py | 3 + docs/nirfsg/class.rst | 88 - generated/nirfsg/nirfsg/session.py | 1314 +-------- .../nirfsg/nirfsg/unit_tests/test_nirfsg.py | 17 +- nirfsgunittest.xml | 2345 ----------------- src/nirfsg/unit_tests/test_nirfsg.py | 17 +- 13 files changed, 206 insertions(+), 3712 deletions(-) delete mode 100644 nirfsgunittest.xml diff --git a/.gitignore b/.gitignore index eaaa5c2e70..06c40b3d81 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ nidcpowerunittest.xml nidigitalunittest.xml nifakeunittest.xml nimodinstunittest.xml +nirfsgunittest.xml niscopeunittest.xml nitclkunittest.xml codegen.xml diff --git a/build/helper/__init__.py b/build/helper/__init__.py index 1e00a3d9f1..620646a8a4 100644 --- a/build/helper/__init__.py +++ b/build/helper/__init__.py @@ -51,7 +51,7 @@ from build.helper.metadata_filters import filter_library_functions # noqa: F401 from build.helper.metadata_filters import filter_parameters # noqa: F401 from build.helper.metadata_filters import filter_public_functions # noqa: F401 -from build.helper.metadata_filters import filter_rep_cap_supported_attributes +from build.helper.metadata_filters import filter_rep_cap_supported_attributes # noqa: F401 from build.helper.metadata_find import find_custom_type # noqa: F401 from build.helper.metadata_find import find_session_handle_parameter # noqa: F401 diff --git a/build/helper/documentation_helper.py b/build/helper/documentation_helper.py index 5c60c11e65..3933351a7d 100644 --- a/build/helper/documentation_helper.py +++ b/build/helper/documentation_helper.py @@ -4,6 +4,7 @@ from .documentation_snippets import enum_note_text from .documentation_snippets import func_note_text from .documentation_snippets import rep_cap_attr_desc +from .documentation_snippets import rep_cap_attr_desc_without_global from .documentation_snippets import rep_cap_method_desc from .helper import get_array_type_for_api_type from .helper import get_numpy_type_for_api_type @@ -116,7 +117,10 @@ def add_attribute_rep_cap_tip(attr, config): multi_capability = get_attribute_repeated_caps_with_conjunction(attr) single_capability = attr['supported_rep_caps'][0] - attr['documentation']['tip'] = rep_cap_attr_desc.format(config['module_name'], multi_capability, single_capability, attr['python_name']) + if config['repeated_capability_object_type']['python'] != 'applicable-attributes-only': + attr['documentation']['tip'] = rep_cap_attr_desc.format(config['module_name'], multi_capability, single_capability, attr['python_name']) + else: + attr['documentation']['tip'] = rep_cap_attr_desc_without_global.format(config['module_name'], multi_capability, single_capability, attr['python_name']) def get_documentation_for_node_rst(node, config, indent=0): diff --git a/build/helper/documentation_snippets.py b/build/helper/documentation_snippets.py index 2b4a9524cc..4e76c552ef 100644 --- a/build/helper/documentation_snippets.py +++ b/build/helper/documentation_snippets.py @@ -24,6 +24,13 @@ Example: :py:attr:`my_session.{3}` ''' +rep_cap_attr_desc_without_global = ''' +This property can be set/get on specific {1} within your :py:class:`{0}.Session` instance. +Use Python index notation on the repeated capabilities container {1} to specify a subset. + +Example: :py:attr:`my_session.{2}[ ... ].{3}` +''' + func_note_text = ''' One or more of the referenced functions are not in the Python API for this driver. ''' diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index 21e6215971..77195417f3 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -12,7 +12,6 @@ from .helper import get_python_type_for_api_type from .metadata_filters import filter_codegen_attributes from .metadata_filters import filter_codegen_functions -from .metadata_filters import filter_rep_cap_supported_attributes from .metadata_find import find_custom_type from .metadata_find import find_size_parameter from .metadata_merge_dicts import merge_helper diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index dd402b0f36..1cdf6b88e6 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -450,11 +450,15 @@ def filter_codegen_enums(enums): '''Returns enum metadata only for those enums to be included in codegen''' return {k: v for k, v in enums.items() if v['codegen_method'] != 'no'} + def filter_rep_cap_supported_attributes(attributes, rep_cap_name): '''Returns attribute metadata only for those attributes that support the specified repeated capability. + Args: attributes: Dictionary of attribute metadata. + rep_cap_name: The name of the repeated capability to filter by. + Returns: Dictionary of attributes that support the specified repeated capability. ''' diff --git a/build/templates/session.py.mako b/build/templates/session.py.mako index 8de46d64c3..27f0f0a026 100644 --- a/build/templates/session.py.mako +++ b/build/templates/session.py.mako @@ -3,6 +3,7 @@ ${template_parameters['encoding_tag']} <% import build.helper as helper import os + from string import capwords grpc_supported = template_parameters['include_grpc_support'] @@ -33,7 +34,9 @@ from functools import wraps % if attributes: import ${module_name}._attributes as _attributes % endif +% if config['repeated_capability_object_type']['python'] != 'applicable-attributes-only': import ${module_name}._converters as _converters +% endif import ${module_name}._library_interpreter as _library_interpreter import ${module_name}.enums as enums import ${module_name}.errors as errors @@ -92,35 +95,58 @@ class _Lock(object): % endif % if len(config['repeated_capabilities']) > 0: % if config['repeated_capability_object_type']['python'] == 'applicable-attributes-only': -% for rep_cap in config['repeated_capabilities']: +class _RepeatedCapabilityAttributeOnlyBase(object): + def __init__(self, session, prefix): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_prefix', prefix) + object.__setattr__(self, '_repeated_capability', '') + + def _get_attribute_vi_real64(self, attribute): + value = self._session._interpreter.get_attribute_vi_real64(self._prefix + self._repeated_capability, attribute) + return value + + def _set_attribute_vi_real64(self, attribute, value): + self._session._interpreter.set_attribute_vi_real64(self._prefix + self._repeated_capability, attribute, value) + + def _get_attribute_vi_int32(self, attribute): + value = self._session._interpreter.get_attribute_vi_int32(self._prefix + self._repeated_capability, attribute) + return value + + def _set_attribute_vi_int32(self, attribute, value): + self._session._interpreter.set_attribute_vi_int32(self._prefix + self._repeated_capability, attribute, value) -class _RepeatedCapability${rep_cap['python_name'].capitalize()}(object): - % for attribute in helper.sorted_attrs(helper.filter_rep_cap_supported_attributes(attributes, rep_cap['python_name'])): + def _get_attribute_vi_string(self, attribute): + value = self._session._interpreter.get_attribute_vi_string(self._prefix + self._repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + self._session._interpreter.set_attribute_vi_string(self._prefix + self._repeated_capability, attribute, value) + + + % for rep_cap in config['repeated_capabilities']: +class _RepeatedCapability${capwords(rep_cap['python_name'].replace('_', ' ')).replace(' ', '')}(_RepeatedCapabilityAttributeOnlyBase): + % for attribute in helper.sorted_attrs(helper.filter_rep_cap_supported_attributes(attributes, rep_cap['python_name'])): <% helper.add_attribute_rep_cap_tip(attributes[attribute], config) %>\ - % if attributes[attribute]['enum']: - % if helper.enum_uses_converter(enums[attributes[attribute]['enum']]): + % if attributes[attribute]['enum']: + % if helper.enum_uses_converter(enums[attributes[attribute]['enum']]): ${attributes[attribute]['python_name']} = _attributes.AttributeEnumWithConverter(_attributes.AttributeEnum(_attributes.Attribute${attributes[attribute]['type']}, enums.${enums[attributes[attribute]['enum']]['python_name']}, ${attribute}), _converters.${enums[attributes[attribute]['enum']]['enum_to_converted_value_function_name']}, _converters.${enums[attributes[attribute]['enum']]['converted_value_to_enum_function_name']}) - % else: + % else: ${attributes[attribute]['python_name']} = _attributes.AttributeEnum(_attributes.Attribute${attributes[attribute]['type']}, enums.${enums[attributes[attribute]['enum']]['python_name']}, ${attribute}) - % endif - % else: + % endif + % else: ${attributes[attribute]['python_name']} = _attributes.${attributes[attribute]['attribute_class']}(${attribute}) - % endif -% if 'documentation' in attributes[attribute] and len(helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4).strip()) > 0: + % endif + % if 'documentation' in attributes[attribute] and len(helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4).strip()) > 0: '''Type: ${attributes[attribute]['type_in_documentation']} ${helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4)} ''' -% endif -% endfor - def __init__(self, session, repeated_capability_list): - object.__setattr__(self, '_session', session) - object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) - object.__setattr__(self, '_prefix', '${rep_cap["prefix"]}') - object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) - object.__setattr__(self, '_separator', '') + % endif + % endfor + def __init__(self, session): + super(_RepeatedCapability${capwords(rep_cap['python_name'].replace('_', ' ')).replace(' ', '')}, self).__init__(session, '${rep_cap["prefix"]}') def __setattr__(self, key, value): if key not in dir(self): @@ -128,46 +154,12 @@ helper.add_attribute_rep_cap_tip(attributes[attribute], config) object.__setattr__(self, key, value) def __getitem__(self, repeated_capability): - '''Set/get properties or call methods with a repeated capability (i.e. channels)''' - rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) - complete_rep_cap_list = [ - current_rep_cap + self._separator + rep_cap - for current_rep_cap in self._current_repeated_capability_list - for rep_cap in rep_caps_list - ] - object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) - self._current_repeated_capability_list = complete_rep_cap_list - + super(_RepeatedCapability${capwords(rep_cap['python_name'].replace('_', ' ')).replace(' ', '')}, self).__setattr__('_repeated_capability', repeated_capability) return self - def _get_attribute_vi_real64(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) - return value - - def _set_attribute_vi_real64(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) - - def _get_attribute_vi_int32(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) - return value - def _set_attribute_vi_int32(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) - - def _get_attribute_vi_string(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) - return value - - def _set_attribute_vi_string(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) -% endfor -% else: + % endfor + % else: class _RepeatedCapabilities(object): def __init__(self, session, prefix, current_repeated_capability_list): self._session = session @@ -205,7 +197,7 @@ class _NoChannel(object): self._session._repeated_capability = self._repeated_capability_cache -% endif + % endif % endif class _SessionBase(object): '''Base class for all ${config['driver_name']} sessions.''' @@ -214,12 +206,8 @@ class _SessionBase(object): _is_frozen = False % for attribute in helper.sorted_attrs(helper.filter_codegen_attributes(attributes)): +% if not ('supported_rep_caps' in attributes[attribute] and len(attributes[attribute]['supported_rep_caps']) > 0 and config['repeated_capability_object_type']['python'] == 'applicable-attributes-only'): <% -# Skip attributes with repeated capability expansion set to "applicable-attributes-only" -if 'repeated_capability_type' in attributes[attribute]: - rep_cap_type = attributes[attribute]['repeated_capability_type'] - if any(rep_cap.get('python_name') == rep_cap_type and config['repeated_capability_object_type'] == 'applicable-attributes-only' for rep_cap in config['repeated_capabilities']): - continue helper.add_attribute_rep_cap_tip(attributes[attribute], config) %>\ %if attributes[attribute]['enum']: @@ -237,6 +225,7 @@ helper.add_attribute_rep_cap_tip(attributes[attribute], config) ${helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4)} ''' % endif +% endif % endfor <% init_function = config['functions']['_init_function'] @@ -263,7 +252,7 @@ constructor_params = helper.filter_parameters(init_function['parameters'], helpe # Instantiate any repeated capability objects % for rep_cap in config['repeated_capabilities']: % if config['repeated_capability_object_type']['python'] == 'applicable-attributes-only': - self.${rep_cap['python_name']} = _RepeatedCapability${rep_cap['python_name'].capitalize()}(self, repeated_capability_list) + self.${rep_cap['python_name']} = _RepeatedCapability${capwords(rep_cap['python_name'].replace('_', ' ')).replace(' ', '')}(self) % else: self.${rep_cap['python_name']} = _RepeatedCapabilities(self, '${rep_cap["prefix"]}', repeated_capability_list) % endif diff --git a/build/unit_tests/test_metadata_add_all.py b/build/unit_tests/test_metadata_add_all.py index 67a5750a49..ea49750672 100644 --- a/build/unit_tests/test_metadata_add_all.py +++ b/build/unit_tests/test_metadata_add_all.py @@ -979,6 +979,9 @@ def _compare_dicts(actual, expected): }, ], 'enum_whitelist_suffix': ['_POINT_FIVE'], + 'repeated_capability_object_type': { + 'python': 'session' + }, 'repeated_capabilities': [ {'python_name': 'channels', 'prefix': '', }, ], diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index c35091f21e..7ed7978764 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -4811,10 +4811,6 @@ deembedding_compensation_gain Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_compensation_gain` - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_compensation_gain` - The following table lists the characteristics of this property. +-----------------------+------------------+ @@ -4856,10 +4852,6 @@ deembedding_selected_table Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_selected_table` - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_selected_table` - The following table lists the characteristics of this property. +-----------------------+------------------+ @@ -4915,10 +4907,6 @@ deembedding_type Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_type` - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_type` - The following table lists the characteristics of this property. +-----------------------+-------------------------------+ @@ -5078,10 +5066,6 @@ digital_edge_script_trigger_edge Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_edge` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_edge_script_trigger_edge` - The following table lists the characteristics of this property. +-----------------------+-----------------------------+ @@ -5183,10 +5167,6 @@ digital_edge_script_trigger_source Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_source` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_edge_script_trigger_source` - The following table lists the characteristics of this property. +-----------------------+-------------------------------+ @@ -5447,10 +5427,6 @@ digital_level_script_trigger_active_level Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_active_level` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_level_script_trigger_active_level` - The following table lists the characteristics of this property. +-----------------------+-------------------------------------+ @@ -5548,10 +5524,6 @@ digital_level_script_trigger_source Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_source` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_level_script_trigger_source` - The following table lists the characteristics of this property. +-----------------------+--------------------------------+ @@ -6225,10 +6197,6 @@ exported_marker_event_output_terminal Example: :py:attr:`my_session.markers[ ... ].exported_marker_event_output_terminal` - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.exported_marker_event_output_terminal` - The following table lists the characteristics of this property. +-----------------------+-----------------------------------+ @@ -6508,10 +6476,6 @@ exported_script_trigger_output_terminal Example: :py:attr:`my_session.script_triggers[ ... ].exported_script_trigger_output_terminal` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.exported_script_trigger_output_terminal` - The following table lists the characteristics of this property. +-----------------------+----------------------------------+ @@ -8781,10 +8745,6 @@ marker_event_output_behavior Example: :py:attr:`my_session.markers[ ... ].marker_event_output_behavior` - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_output_behavior` - The following table lists the characteristics of this property. +-----------------------+---------------------------------+ @@ -8828,10 +8788,6 @@ marker_event_pulse_width Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width` - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_pulse_width` - The following table lists the characteristics of this property. +-----------------------+------------+ @@ -8883,10 +8839,6 @@ marker_event_pulse_width_units Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width_units` - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_pulse_width_units` - The following table lists the characteristics of this property. +-----------------------+----------------------------------+ @@ -8940,10 +8892,6 @@ marker_event_terminal_name Example: :py:attr:`my_session.markers[ ... ].marker_event_terminal_name` - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_terminal_name` - The following table lists the characteristics of this property. +-----------------------+-----------+ @@ -8995,10 +8943,6 @@ marker_event_toggle_initial_state Example: :py:attr:`my_session.markers[ ... ].marker_event_toggle_initial_state` - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_toggle_initial_state` - The following table lists the characteristics of this property. +-----------------------+-------------------------------------+ @@ -10709,10 +10653,6 @@ script_trigger_terminal_name Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_terminal_name` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.script_trigger_terminal_name` - The following table lists the characteristics of this property. +-----------------------+-----------------+ @@ -10774,10 +10714,6 @@ script_trigger_type Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_type` - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.script_trigger_type` - The following table lists the characteristics of this property. +-----------------------+----------------------+ @@ -12168,10 +12104,6 @@ waveform_iq_rate Example: :py:attr:`my_session.waveform[ ... ].waveform_iq_rate` - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_iq_rate` - The following table lists the characteristics of this property. +-----------------------+------------+ @@ -12207,10 +12139,6 @@ waveform_papr Example: :py:attr:`my_session.waveform[ ... ].waveform_papr` - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_papr` - The following table lists the characteristics of this property. +-----------------------+------------+ @@ -12274,10 +12202,6 @@ waveform_rf_blanking Example: :py:attr:`my_session.waveform[ ... ].waveform_rf_blanking` - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_rf_blanking` - The following table lists the characteristics of this property. +-----------------------+------------------+ @@ -12315,10 +12239,6 @@ waveform_runtime_scaling Example: :py:attr:`my_session.waveform[ ... ].waveform_runtime_scaling` - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_runtime_scaling` - The following table lists the characteristics of this property. +-----------------------+------------+ @@ -12356,10 +12276,6 @@ waveform_signal_bandwidth Example: :py:attr:`my_session.waveform[ ... ].waveform_signal_bandwidth` - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_signal_bandwidth` - The following table lists the characteristics of this property. +-----------------------+------------+ @@ -12395,10 +12311,6 @@ waveform_waveform_size Example: :py:attr:`my_session.waveform[ ... ].waveform_waveform_size` - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_waveform_size` - The following table lists the characteristics of this property. +-----------------------+-----------+ diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 775458f49f..77010ad3fd 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -5,7 +5,6 @@ from functools import wraps import nirfsg._attributes as _attributes -import nirfsg._converters as _converters import nirfsg._library_interpreter as _library_interpreter import nirfsg.enums as enums import nirfsg.errors as errors @@ -52,8 +51,35 @@ def __exit__(self, exc_type, exc_value, traceback): self._session.unlock() +class _RepeatedCapabilityAttributeOnlyBase(object): + def __init__(self, session, prefix): + object.__setattr__(self, '_session', session) + object.__setattr__(self, '_prefix', prefix) + object.__setattr__(self, '_repeated_capability', '') + + def _get_attribute_vi_real64(self, attribute): + value = self._session._interpreter.get_attribute_vi_real64(self._prefix + self._repeated_capability, attribute) + return value + + def _set_attribute_vi_real64(self, attribute, value): + self._session._interpreter.set_attribute_vi_real64(self._prefix + self._repeated_capability, attribute, value) + + def _get_attribute_vi_int32(self, attribute): + value = self._session._interpreter.get_attribute_vi_int32(self._prefix + self._repeated_capability, attribute) + return value + + def _set_attribute_vi_int32(self, attribute, value): + self._session._interpreter.set_attribute_vi_int32(self._prefix + self._repeated_capability, attribute, value) + + def _get_attribute_vi_string(self, attribute): + value = self._session._interpreter.get_attribute_vi_string(self._prefix + self._repeated_capability, attribute) + return value + + def _set_attribute_vi_string(self, attribute, value): + self._session._interpreter.set_attribute_vi_string(self._prefix + self._repeated_capability, attribute, value) -class _RepeatedCapabilityMarkers(object): + +class _RepeatedCapabilityMarkers(_RepeatedCapabilityAttributeOnlyBase): exported_marker_event_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.MarkerEventExportOutputTerm, 1150064) '''Type: enums.MarkerEventExportOutputTerm @@ -129,10 +155,6 @@ class _RepeatedCapabilityMarkers(object): Use Python index notation on the repeated capabilities container markers to specify a subset. Example: :py:attr:`my_session.markers[ ... ].exported_marker_event_output_terminal` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.exported_marker_event_output_terminal` ''' marker_event_output_behavior = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventOutputBehavior, 1150206) '''Type: enums.MarkerEventOutputBehavior @@ -162,10 +184,6 @@ class _RepeatedCapabilityMarkers(object): Use Python index notation on the repeated capabilities container markers to specify a subset. Example: :py:attr:`my_session.markers[ ... ].marker_event_output_behavior` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_output_behavior` ''' marker_event_pulse_width = _attributes.AttributeViReal64(1150207) '''Type: float @@ -187,10 +205,6 @@ class _RepeatedCapabilityMarkers(object): Use Python index notation on the repeated capabilities container markers to specify a subset. Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_pulse_width` ''' marker_event_pulse_width_units = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventPulseWidthUnits, 1150208) '''Type: enums.MarkerEventPulseWidthUnits @@ -222,10 +236,6 @@ class _RepeatedCapabilityMarkers(object): Use Python index notation on the repeated capabilities container markers to specify a subset. Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width_units` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_pulse_width_units` ''' marker_event_terminal_name = _attributes.AttributeViString(1150115) '''Type: str @@ -257,10 +267,6 @@ class _RepeatedCapabilityMarkers(object): Use Python index notation on the repeated capabilities container markers to specify a subset. Example: :py:attr:`my_session.markers[ ... ].marker_event_terminal_name` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_terminal_name` ''' marker_event_toggle_initial_state = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventToggleInitialState, 1150209) '''Type: enums.MarkerEventToggleInitialState @@ -292,17 +298,9 @@ class _RepeatedCapabilityMarkers(object): Use Python index notation on the repeated capabilities container markers to specify a subset. Example: :py:attr:`my_session.markers[ ... ].marker_event_toggle_initial_state` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_toggle_initial_state` ''' - def __init__(self, session, repeated_capability_list): - object.__setattr__(self, '_session', session) - object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) - object.__setattr__(self, '_prefix', 'marker') - object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) - object.__setattr__(self, '_separator', '') + def __init__(self, session): + super(_RepeatedCapabilityMarkers, self).__init__(session, 'marker') def __setattr__(self, key, value): if key not in dir(self): @@ -310,46 +308,11 @@ def __setattr__(self, key, value): object.__setattr__(self, key, value) def __getitem__(self, repeated_capability): - '''Set/get properties or call methods with a repeated capability (i.e. channels)''' - rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) - complete_rep_cap_list = [ - current_rep_cap + self._separator + rep_cap - for current_rep_cap in self._current_repeated_capability_list - for rep_cap in rep_caps_list - ] - object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) - self._current_repeated_capability_list = complete_rep_cap_list - + super(_RepeatedCapabilityMarkers, self).__setattr__('_repeated_capability', repeated_capability) return self - def _get_attribute_vi_real64(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) - return value - - def _set_attribute_vi_real64(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) - - def _get_attribute_vi_int32(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) - return value - - def _set_attribute_vi_int32(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) - - def _get_attribute_vi_string(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) - return value - def _set_attribute_vi_string(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) - -class _RepeatedCapabilityScript_triggers(object): +class _RepeatedCapabilityScriptTriggers(_RepeatedCapabilityAttributeOnlyBase): digital_edge_script_trigger_edge = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigEdgeEdge, 1150021) '''Type: enums.ScriptTrigDigEdgeEdge @@ -387,10 +350,6 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_edge` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_edge_script_trigger_edge` ''' digital_edge_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigEdgeSource, 1150020) '''Type: enums.ScriptTrigDigEdgeSource @@ -473,10 +432,6 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_source` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_edge_script_trigger_source` ''' digital_level_script_trigger_active_level = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigLevelActiveLevel, 1150055) '''Type: enums.ScriptTrigDigLevelActiveLevel @@ -510,10 +465,6 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_active_level` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_level_script_trigger_active_level` ''' digital_level_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigLevelSource, 1150054) '''Type: enums.ScriptTrigDigLevelSource @@ -592,10 +543,6 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_source` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_level_script_trigger_source` ''' exported_script_trigger_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigExportOutputTerm, 1150022) '''Type: enums.ScriptTrigExportOutputTerm @@ -672,10 +619,6 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].exported_script_trigger_output_terminal` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.exported_script_trigger_output_terminal` ''' script_trigger_terminal_name = _attributes.AttributeViString(1150116) '''Type: str @@ -709,10 +652,6 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_terminal_name` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.script_trigger_terminal_name` ''' script_trigger_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigType, 1150019) '''Type: enums.ScriptTrigType @@ -755,17 +694,9 @@ class _RepeatedCapabilityScript_triggers(object): Use Python index notation on the repeated capabilities container script_triggers to specify a subset. Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_type` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.script_trigger_type` ''' - def __init__(self, session, repeated_capability_list): - object.__setattr__(self, '_session', session) - object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) - object.__setattr__(self, '_prefix', 'scripttrigger') - object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) - object.__setattr__(self, '_separator', '') + def __init__(self, session): + super(_RepeatedCapabilityScriptTriggers, self).__init__(session, 'scripttrigger') def __setattr__(self, key, value): if key not in dir(self): @@ -773,46 +704,11 @@ def __setattr__(self, key, value): object.__setattr__(self, key, value) def __getitem__(self, repeated_capability): - '''Set/get properties or call methods with a repeated capability (i.e. channels)''' - rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) - complete_rep_cap_list = [ - current_rep_cap + self._separator + rep_cap - for current_rep_cap in self._current_repeated_capability_list - for rep_cap in rep_caps_list - ] - object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) - self._current_repeated_capability_list = complete_rep_cap_list - + super(_RepeatedCapabilityScriptTriggers, self).__setattr__('_repeated_capability', repeated_capability) return self - def _get_attribute_vi_real64(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) - return value - - def _set_attribute_vi_real64(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) - - def _get_attribute_vi_int32(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) - return value - - def _set_attribute_vi_int32(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) - - def _get_attribute_vi_string(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) - return value - - def _set_attribute_vi_string(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) -class _RepeatedCapabilityWaveform(object): +class _RepeatedCapabilityWaveform(_RepeatedCapabilityAttributeOnlyBase): waveform_iq_rate = _attributes.AttributeViReal64(1150263) '''Type: float @@ -833,10 +729,6 @@ class _RepeatedCapabilityWaveform(object): Use Python index notation on the repeated capabilities container waveform to specify a subset. Example: :py:attr:`my_session.waveform[ ... ].waveform_iq_rate` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_iq_rate` ''' waveform_papr = _attributes.AttributeViReal64(1150266) '''Type: float @@ -850,10 +742,6 @@ class _RepeatedCapabilityWaveform(object): Use Python index notation on the repeated capabilities container waveform to specify a subset. Example: :py:attr:`my_session.waveform[ ... ].waveform_papr` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_papr` ''' waveform_rf_blanking = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.RFBlanking, 1150278) '''Type: enums.RFBlanking @@ -898,10 +786,6 @@ class _RepeatedCapabilityWaveform(object): Use Python index notation on the repeated capabilities container waveform to specify a subset. Example: :py:attr:`my_session.waveform[ ... ].waveform_rf_blanking` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_rf_blanking` ''' waveform_runtime_scaling = _attributes.AttributeViReal64(1150265) '''Type: float @@ -917,10 +801,6 @@ class _RepeatedCapabilityWaveform(object): Use Python index notation on the repeated capabilities container waveform to specify a subset. Example: :py:attr:`my_session.waveform[ ... ].waveform_runtime_scaling` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_runtime_scaling` ''' waveform_signal_bandwidth = _attributes.AttributeViReal64(1150264) '''Type: float @@ -936,10 +816,6 @@ class _RepeatedCapabilityWaveform(object): Use Python index notation on the repeated capabilities container waveform to specify a subset. Example: :py:attr:`my_session.waveform[ ... ].waveform_signal_bandwidth` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_signal_bandwidth` ''' waveform_waveform_size = _attributes.AttributeViInt32(1150297) '''Type: int @@ -953,17 +829,9 @@ class _RepeatedCapabilityWaveform(object): Use Python index notation on the repeated capabilities container waveform to specify a subset. Example: :py:attr:`my_session.waveform[ ... ].waveform_waveform_size` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_waveform_size` ''' - def __init__(self, session, repeated_capability_list): - object.__setattr__(self, '_session', session) - object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) - object.__setattr__(self, '_prefix', 'waveform::') - object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) - object.__setattr__(self, '_separator', '') + def __init__(self, session): + super(_RepeatedCapabilityWaveform, self).__init__(session, 'waveform::') def __setattr__(self, key, value): if key not in dir(self): @@ -971,46 +839,11 @@ def __setattr__(self, key, value): object.__setattr__(self, key, value) def __getitem__(self, repeated_capability): - '''Set/get properties or call methods with a repeated capability (i.e. channels)''' - rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) - complete_rep_cap_list = [ - current_rep_cap + self._separator + rep_cap - for current_rep_cap in self._current_repeated_capability_list - for rep_cap in rep_caps_list - ] - object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) - self._current_repeated_capability_list = complete_rep_cap_list - + super(_RepeatedCapabilityWaveform, self).__setattr__('_repeated_capability', repeated_capability) return self - def _get_attribute_vi_real64(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) - return value - - def _set_attribute_vi_real64(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) - - def _get_attribute_vi_int32(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) - return value - - def _set_attribute_vi_int32(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) - - def _get_attribute_vi_string(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) - return value - - def _set_attribute_vi_string(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) -class _RepeatedCapabilityDeembedding_port(object): +class _RepeatedCapabilityDeembeddingPort(_RepeatedCapabilityAttributeOnlyBase): deembedding_compensation_gain = _attributes.AttributeViReal64(1150289) '''Type: float @@ -1023,10 +856,6 @@ class _RepeatedCapabilityDeembedding_port(object): Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_compensation_gain` - - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_compensation_gain` ''' deembedding_selected_table = _attributes.AttributeViString(1150253) '''Type: str @@ -1046,10 +875,6 @@ class _RepeatedCapabilityDeembedding_port(object): Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_selected_table` - - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_selected_table` ''' deembedding_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.DeembeddingTypeAttrVals, 1150252) '''Type: enums.DeembeddingTypeAttrVals @@ -1085,17 +910,9 @@ class _RepeatedCapabilityDeembedding_port(object): Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_type` - - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_type` ''' - def __init__(self, session, repeated_capability_list): - object.__setattr__(self, '_session', session) - object.__setattr__(self, '_repeated_capability_list', repeated_capability_list) - object.__setattr__(self, '_prefix', '') - object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else ['']) - object.__setattr__(self, '_separator', '') + def __init__(self, session): + super(_RepeatedCapabilityDeembeddingPort, self).__init__(session, '') def __setattr__(self, key, value): if key not in dir(self): @@ -1103,44 +920,10 @@ def __setattr__(self, key, value): object.__setattr__(self, key, value) def __getitem__(self, repeated_capability): - '''Set/get properties or call methods with a repeated capability (i.e. channels)''' - rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix) - complete_rep_cap_list = [ - current_rep_cap + self._separator + rep_cap - for current_rep_cap in self._current_repeated_capability_list - for rep_cap in rep_caps_list - ] - object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list) - self._current_repeated_capability_list = complete_rep_cap_list - + super(_RepeatedCapabilityDeembeddingPort, self).__setattr__('_repeated_capability', repeated_capability) return self - def _get_attribute_vi_real64(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute) - return value - - def _set_attribute_vi_real64(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value) - - def _get_attribute_vi_int32(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute) - return value - - def _set_attribute_vi_int32(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value) - def _get_attribute_vi_string(self, attribute): - repeated_capability = ','.join(self._current_repeated_capability_list) - value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute) - return value - - def _set_attribute_vi_string(self, attribute, value): - repeated_capability = ','.join(self._current_repeated_capability_list) - self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value) class _SessionBase(object): '''Base class for all NI-RFSG sessions.''' @@ -2114,85 +1897,6 @@ class _SessionBase(object): Note: In some cases, the RF signal generator generates packets smaller than the preferred size you set with this property. ''' - deembedding_compensation_gain = _attributes.AttributeViReal64(1150289) - '''Type: float - - Returns the de-embedding gain applied to compensate for the mismatch on the specified port. If de-embedding is enabled, NI-RFSG uses the returned compensation gain to remove the effects of the external network between the instrument and the DUT. - - **Supported Devices**: PXIe-5830/5831/5832/5840/5841/5842/5860 - - Tip: - This property can be set/get on specific deembedding_port within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. - - Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_compensation_gain` - - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_compensation_gain` - ''' - deembedding_selected_table = _attributes.AttributeViString(1150253) - '''Type: str - - Selects the de-embedding table to apply to the measurements on the specified port. - - To use this property, you must use the channelName parameter of the _set_attribute_vi_string method to specify the name of the port to configure for de-embedding. - - If de-embedding is enabled, NI-RFSG uses the specified table to remove the effects of the external network between the instrument and the DUT. - - Use the create deembedding sparameter table array method to create tables. - - **Supported Devices**: PXIe-5830/5831/5832/5840/5841/5842/5860 - - Tip: - This property can be set/get on specific deembedding_port within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. - - Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_selected_table` - - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_selected_table` - ''' - deembedding_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.DeembeddingTypeAttrVals, 1150252) - '''Type: enums.DeembeddingTypeAttrVals - - Specifies the type of de-embedding to apply to measurements on the specified port. - - To use this property, you must use the channelName parameter of the _set_attribute_vi_int32 method to specify the name of the port to configure for de-embedding. - - If you set this property to DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR or DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR, NI-RFSG adjusts the instrument settings and the returned data to remove the effects of the external network between the instrument and the DUT. - - **Default Value**: DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR - - **Valid Values for PXIe-5830/5832/5840/5841/5842/5860** : DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR or DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_NONE - - **Valid Values for PXIe-5831** DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR, DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR, or DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_NONE. DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR is only supported for TRX Ports in a Semiconductor Test System (STS). - - **Supported Devices**: PXIe-5830/5831/5832/5840/5841/5842/5860 - - **Defined Values**: - - +-------------------------------------------------+----------------+------------------------------------------------------------------------+ - | Name | Value | Description | - +=================================================+================+========================================================================+ - | DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_NONE | 25000 (0x61a8) | De-embedding is not applied to the measurement. | - +-------------------------------------------------+----------------+------------------------------------------------------------------------+ - | DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_SCALAR | 25001 (0x61a9) | De-embeds the measurement using only the gain term. | - +-------------------------------------------------+----------------+------------------------------------------------------------------------+ - | DeembeddingTypeAttrVals.DEEMBEDDING_TYPE_VECTOR | 25002 (0x61aa) | De-embeds the measurement using the gain term and the reflection term. | - +-------------------------------------------------+----------------+------------------------------------------------------------------------+ - - Tip: - This property can be set/get on specific deembedding_port within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container deembedding_port to specify a subset. - - Example: :py:attr:`my_session.deembedding_port[ ... ].deembedding_type` - - To set/get on all deembedding_port, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.deembedding_type` - ''' device_instantaneous_bandwidth = _attributes.AttributeViReal64(1150226) '''Type: float @@ -2255,58 +1959,52 @@ class _SessionBase(object): | Second connected mmRH-5582 | SWITCHED TRX PORTS [0-7] | rf1switch1 | +----------------------------+--------------------------+-------------------------+ ''' - digital_edge_script_trigger_edge = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigEdgeEdge, 1150021) - '''Type: enums.ScriptTrigDigEdgeEdge + digital_edge_start_trigger_edge = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.StartTrigDigEdgeEdge, 1250459) + '''Type: enums.StartTrigDigEdgeEdge - Specifies the active edge for the Script Trigger. This property is used when the script_trigger_type property is set to digital edge. To set the digital_edge_script_trigger_edge property, the NI-RFSG device must be in the Configuration state. + Specifies the active edge for the Start Trigger. This property is used when the start_trigger_type property is set to digital edge. To set the digital_edge_start_trigger_edge property, the NI-RFSG device must be in the Configuration state. - **Default Value:** ScriptTrigDigEdgeEdge.RISING + PXIe-5654/5654 with PXIe-5696: The Start Trigger is valid only with a timer-based list when RF list mode is enabled. - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + **Default Value:** StartTrigDigEdgeEdge.RISING + + **Supported Devices:** PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** - `Script Trigger `_ + `Start Trigger `_ `Digital Edge Trigger `_ **High-Level Methods**: - - configure_digital_edge_script_trigger + - configure_digital_edge_start_trigger **Defined Values**: - +-------------------------------+---------+-------------------------------------------------------------------------------+ - | Name | Value | Description | - +===============================+=========+===============================================================================+ - | ScriptTrigDigEdgeEdge.FALLING | 1 (0x1) | Asserts the trigger when the signal transitions from high level to low level. | - +-------------------------------+---------+-------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeEdge.RISING | 0 (0x0) | Asserts the trigger when the signal transitions from low level to high level. | - +-------------------------------+---------+-------------------------------------------------------------------------------+ + +------------------------------+---------+------------------------------------------------------------------+ + | Name | Value | Description | + +==============================+=========+==================================================================+ + | StartTrigDigEdgeEdge.FALLING | 1 (0x1) | Occurs when the signal transitions from high level to low level. | + +------------------------------+---------+------------------------------------------------------------------+ + | StartTrigDigEdgeEdge.RISING | 0 (0x0) | Occurs when the signal transitions from low level to high level. | + +------------------------------+---------+------------------------------------------------------------------+ Note: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_edge` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_edge_script_trigger_edge` ''' - digital_edge_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigEdgeSource, 1150020) - '''Type: enums.ScriptTrigDigEdgeSource + digital_edge_start_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.StartTrigDigEdgeSource, 1150002) + '''Type: enums.StartTrigDigEdgeSource - Specifies the source terminal for the Script Trigger. This property is used when the script_trigger_type property is set to digital edge. To set this property, the NI-RFSG device must be in the Configuration state. + Specifies the source terminal for the Start Trigger. This property is used when the start_trigger_type property is set to digital edge. The digital_edge_start_trigger_source property is not case-sensitive. To set the digital_edge_start_trigger_source property, the NI-RFSG device must be in the Configuration state. - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + PXIe-5654/5654 with PXIe-5696: The Start Trigger is valid only with a timer-based list when RF list mode is enabled. + + **Supported Devices:** PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** - `Script Trigger `_ + `Start Trigger `_ `PFI Lines `_ @@ -2314,129 +2012,7 @@ class _SessionBase(object): **High-Level Methods**: - - configure_digital_edge_script_trigger - - **Defined Values**: - - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | Name | Value | Description | - +=============================================+=============+=========================================================================================================================================+ - | ScriptTrigDigEdgeSource.PFI0 | PFI0 | The trigger is received on PFI 0. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PFI1 | PFI1 | The trigger is received on PFI 1. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PFI2 | PFI2 | The trigger is received on PFI 2. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PFI3 | PFI3 | The trigger is received on PFI 3. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_STAR | PXI_Star | The trigger is received on the PXI star trigger line. This value is not valid for the PXIe-5644/5645/5646. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXI_TRIG7 | PXI_Trig7 | The trigger is received on PXI trigger line 7. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PXIE_DSTARB | PXIe_DStarB | The trigger is received on the PXIe DStar B trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841/5842/5860. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.PULSE_IN | PulseIn | The trigger is received on the PULSE IN terminal. This value is valid on only the PXIe-5842. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigEdgeSource.SYNC_SCRIPT_TRIGGER | Sync_Script | The trigger is received on the Sync Script trigger line. This value is valid on only the PXIe-5644/5645/5646. | - +---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_source` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_edge_script_trigger_source` - ''' - digital_edge_start_trigger_edge = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.StartTrigDigEdgeEdge, 1250459) - '''Type: enums.StartTrigDigEdgeEdge - - Specifies the active edge for the Start Trigger. This property is used when the start_trigger_type property is set to digital edge. To set the digital_edge_start_trigger_edge property, the NI-RFSG device must be in the Configuration state. - - PXIe-5654/5654 with PXIe-5696: The Start Trigger is valid only with a timer-based list when RF list mode is enabled. - - **Default Value:** StartTrigDigEdgeEdge.RISING - - **Supported Devices:** PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Start Trigger `_ - - `Digital Edge Trigger `_ - - **High-Level Methods**: - - - configure_digital_edge_start_trigger - - **Defined Values**: - - +------------------------------+---------+------------------------------------------------------------------+ - | Name | Value | Description | - +==============================+=========+==================================================================+ - | StartTrigDigEdgeEdge.FALLING | 1 (0x1) | Occurs when the signal transitions from high level to low level. | - +------------------------------+---------+------------------------------------------------------------------+ - | StartTrigDigEdgeEdge.RISING | 0 (0x0) | Occurs when the signal transitions from low level to high level. | - +------------------------------+---------+------------------------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - ''' - digital_edge_start_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.StartTrigDigEdgeSource, 1150002) - '''Type: enums.StartTrigDigEdgeSource - - Specifies the source terminal for the Start Trigger. This property is used when the start_trigger_type property is set to digital edge. The digital_edge_start_trigger_source property is not case-sensitive. To set the digital_edge_start_trigger_source property, the NI-RFSG device must be in the Configuration state. - - PXIe-5654/5654 with PXIe-5696: The Start Trigger is valid only with a timer-based list when RF list mode is enabled. - - **Supported Devices:** PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Start Trigger `_ - - `PFI Lines `_ - - `PXI Trigger Lines `_ - - **High-Level Methods**: - - - configure_digital_edge_start_trigger + - configure_digital_edge_start_trigger **Defined Values**: @@ -2533,125 +2109,6 @@ class _SessionBase(object): Note: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. ''' - digital_level_script_trigger_active_level = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigLevelActiveLevel, 1150055) - '''Type: enums.ScriptTrigDigLevelActiveLevel - - Specifies the active level for the Script Trigger. This property is used when the script_trigger_type property is set to ScriptTrigType.DIGITAL_LEVEL. - - **Default Value:** ScriptTrigDigLevelActiveLevel.HIGH - - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - - - **Related Topics** - - `Script Trigger `_ - - `Digital Level Trigger `_ - - **Defined Values**: - - +------------------------------------+---------------+--------------------------------------------------+ - | Name | Value | Description | - +====================================+===============+==================================================+ - | ScriptTrigDigLevelActiveLevel.HIGH | 9000 (0x2328) | Trigger when the digital trigger signal is high. | - +------------------------------------+---------------+--------------------------------------------------+ - | ScriptTrigDigLevelActiveLevel.LOW | 9001 (0x2329) | Trigger when the digital trigger signal is low. | - +------------------------------------+---------------+--------------------------------------------------+ - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_active_level` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_level_script_trigger_active_level` - ''' - digital_level_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigLevelSource, 1150054) - '''Type: enums.ScriptTrigDigLevelSource - - Specifies the source terminal for the Script Trigger. This property is used when the script_trigger_type property is set to ScriptTrigType.DIGITAL_LEVEL. The digital_level_script_trigger_source property is not case-sensitive. - - To set the digital_level_script_trigger_source property, the NI-RFSG device must be in the Configuration state. - - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Script Trigger `_ - - `PFI Lines `_ - - `PXI Trigger Lines `_ - - **Defined Values**: - - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | Name | Value | Description | - +======================================+=============+=========================================================================================================================================+ - | ScriptTrigDigLevelSource.PFI0 | PFI0 | The trigger is received on PFI 0. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PFI1 | PFI1 | The trigger is received on PFI 1. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PFI2 | PFI2 | The trigger is received on PFI 2. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PFI3 | PFI3 | The trigger is received on PFI 3. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_STAR | PXI_Star | The trigger is received on the PXI star trigger line. This value is not valid for the PXIe-5644/5645/5646. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXI_TRIG7 | PXI_Trig7 | The trigger is received on PXI trigger line 7. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PXIE_DSTARB | PXIe_DStarB | The trigger is received on the PXIe DStar B trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841/5842/5860. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.PULSE_IN | PulseIn | The trigger is received on the PULSE IN terminal. This value is valid on only the PXIe-5842. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigDigLevelSource.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | - +--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_source` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.digital_level_script_trigger_source` - ''' digital_modulation_fsk_deviation = _attributes.AttributeViReal64(1150041) '''Type: float @@ -2972,106 +2429,26 @@ class _SessionBase(object): | DoneEventExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ | DoneEventExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | DoneEventExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | - +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - ''' - exported_marker_event_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.MarkerEventExportOutputTerm, 1150064) - '''Type: enums.MarkerEventExportOutputTerm - - Specifies the destination terminal for exporting the Marker Event. To set this property, the NI-RFSG device must be in the Configuration state. - - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Marker Events `_ - - `PFI Lines `_ - - `PXI Trigger Lines `_ - - **High-Level Methods**: - - - export_signal - - **Defined Values**: - - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | Name | Value | Description | - +===========================================+=============+=================================================================================================================================+ - | MarkerEventExportOutputTerm.DO_NOT_EXPORT | | The signal is not exported. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PFI0 | PFI0 | The signal is exported to the PFI 0 connector. For the PXIe-5841 with PXIe-5655, the signal is exported to the PXIe-5841 PFI 0. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PFI1 | PFI1 | The signal is exported to the PFI 1 connector. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PFI4 | PFI4 | The signal is exported to the PFI 4 connector. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PFI5 | PFI5 | The signal is exported to the PFI 5 connector. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | MarkerEventExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | - +-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ + | DoneEventExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | + +-----------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ Note: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container markers to specify a subset. - - Example: :py:attr:`my_session.markers[ ... ].exported_marker_event_output_terminal` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.exported_marker_event_output_terminal` ''' exported_pulse_modulation_event_active_level = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigLevelActiveLevel, 1150310) '''Type: enums.ScriptTrigDigLevelActiveLevel @@ -3180,86 +2557,6 @@ class _SessionBase(object): Note: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. ''' - exported_script_trigger_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigExportOutputTerm, 1150022) - '''Type: enums.ScriptTrigExportOutputTerm - - Specifies the destination terminal for exporting the Script Trigger. To set this property, the NI-RFSG device must be in the Configuration state. - - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Script Trigger `_ —Refer to this topic for information about trigger delay. - - `PFI Lines `_ - - `PXI Trigger Lines `_ - - **High-Level Methods**: - - - export_signal - - **Defined Values**: - - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | Name | Value | Description | - +==========================================+=============+=================================================================================================================================+ - | ScriptTrigExportOutputTerm.DO_NOT_EXPORT | | The signal is not exported. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PFI0 | PFI0 | The signal is exported to the PFI 0 connector. For the PXIe-5841 with PXIe-5655, the signal is exported to the PXIe-5841 PFI 0. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PFI1 | PFI1 | The signal is exported to the PFI 1 connector. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PFI4 | PFI4 | The signal is exported to the PFI 4 connector. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PFI5 | PFI5 | The signal is exported to the PFI 5 connector. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. | - +------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].exported_script_trigger_output_terminal` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.exported_script_trigger_output_terminal` - ''' exported_started_event_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.StartedEventExportOutputTerm, 1150065) '''Type: enums.StartedEventExportOutputTerm @@ -4389,203 +3686,40 @@ class _SessionBase(object): +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | LoSource.LO_IN | LO_In | Uses an external LO as the LO source. Connect a signal to the LO IN connector on the device and use the upconverter_center_frequency property to specify the LO frequency. | +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | LoSource.ONBOARD | Onboard | Uses an internal LO as the LO source. If you specify an internal LO source, the LO is generated inside the device itself. | - +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | LoSource.SG_SA_SHARED | SG_SA_Shared | Uses the same internal LO during NI-RFSA and NI-RFSG sessions. NI-RFSG selects an internal synthesizer and the synthesizer signal is switched to both the RF In and RF Out mixers. This value is valid only on the PXIe-5830/5831/5832/5841 with PXIe-5655/5842. | - +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | LoSource.SECONDARY | Secondary | Uses the PXIe-5831/5840 internal LO as the LO source. This value is valid only on the PXIe-5831 with PXIe-5653 and PXIe-5832 with PXIe-5653. | - +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - - Note: For the PXIe-5841 with PXIe-5655, RF list mode is not supported when this property is set to LoSource.SG_SA_SHARED. - ''' - lo_temperature = _attributes.AttributeViReal64(1150075) - '''Type: float - - Returns the LO module temperature in degrees Celsius. - - PXIe-5840/5841: If you query this property during RF list mode, list steps may take longer to complete during list execution. - - **Units**: degrees Celsius (°C) - - **Supported Devices:** PXIe-5673/5673E, PXIe-5840/5841/5842 - ''' - lo_vco_frequency_step_size = _attributes.AttributeViReal64(1150257) - '''Type: float - - Specifies the step size for tuning the internal voltage-controlled oscillator (VCO) used to generate the LO signal. - - **Valid Values**: - - LO1: 1 Hz to 50 MHz - - LO2: 1 Hz to 100 MHz - - **Default Value**: 1 MHz - - **Supported Devices**: PXIe-5830/5831/5832 - ''' - marker_event_output_behavior = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventOutputBehavior, 1150206) - '''Type: enums.MarkerEventOutputBehavior - - Specifies the output behavior for the Marker Event. To set this property, the NI-RFSG device must be in the Configuration state. - - **Default Value:** MarkerEventOutputBehavior.PULSE - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 - - **Related Topics** - - `Marker Events `_ - - **Defined Values**: - - +----------------------------------+----------------+-------------------------------------------------------+ - | Name | Value | Description | - +==================================+================+=======================================================+ - | MarkerEventOutputBehavior.PULSE | 23000 (0x59d8) | Specifies the Marker Event output behavior as pulse. | - +----------------------------------+----------------+-------------------------------------------------------+ - | MarkerEventOutputBehavior.TOGGLE | 23001 (0x59d9) | Specifies the Marker Event output behavior as toggle. | - +----------------------------------+----------------+-------------------------------------------------------+ - - Tip: - This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container markers to specify a subset. - - Example: :py:attr:`my_session.markers[ ... ].marker_event_output_behavior` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_output_behavior` - ''' - marker_event_pulse_width = _attributes.AttributeViReal64(1150207) - '''Type: float - - Specifies the pulse width value for the Marker Event. Use the marker_event_pulse_width_units property to set the units for the pulse width value. This property is valid only when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.PULSE. - - To set this property, the NI-RFSG device must be in the Configuration state. - - **Default Value:** 200 ns - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 - - **Related Topics** - - `Marker Events `_ - - Tip: - This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container markers to specify a subset. - - Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_pulse_width` - ''' - marker_event_pulse_width_units = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventPulseWidthUnits, 1150208) - '''Type: enums.MarkerEventPulseWidthUnits - - Specifies the pulse width units for the Marker Event. This property is valid only when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.PULSE. - - To set this property, the NI-RFSG device must be in the Configuration state. - - **Default Value:** MarkerEventPulseWidthUnits.SECONDS - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 - - **Related Topics** - - `Marker Events `_ - - **Defined Values**: - - +----------------------------------+----------------+-------------------------------------------------------+ - | Name | Value | Description | - +==================================+================+=======================================================+ - | MarkerEventOutputBehavior.PULSE | 23000 (0x59d8) | Specifies the Marker Event output behavior as pulse. | - +----------------------------------+----------------+-------------------------------------------------------+ - | MarkerEventOutputBehavior.TOGGLE | 23001 (0x59d9) | Specifies the Marker Event output behavior as toggle. | - +----------------------------------+----------------+-------------------------------------------------------+ - - Tip: - This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container markers to specify a subset. - - Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width_units` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.marker_event_pulse_width_units` - ''' - marker_event_terminal_name = _attributes.AttributeViString(1150115) - '''Type: str - - Returns the name of the fully qualified signal name as a string. - - **Default Values**: - - PXI-5670/5671, PXIe-5672/5673/5673E: /*AWGName*/Marker *X* Event, where *AWGName* is the name of your associated AWG module in MAX and *X* is Marker Event 0 through 3. - - PXIe-5830/5831/5832: /*BasebandModule*/ao/0/Marker *X* Event, where *BasebandModule* is the name of the baseband module of your device in MAX and *X* is Marker Event 0 through 3. - - PXIe-5820/5840/5841: /*ModuleName*/ao/0/Marker *X* Event, where *ModuleName* is the name of your device in MAX and *X* is Marker Event 0 through 3. - - **Supported Devices:** PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 - - **Related Topics** - - `Events `_ - - `Syntax for Terminal Names `_ - - **High-Level Methods**: - - - GetTerminalName - - Tip: - This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container markers to specify a subset. - - Example: :py:attr:`my_session.markers[ ... ].marker_event_terminal_name` - - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + | LoSource.ONBOARD | Onboard | Uses an internal LO as the LO source. If you specify an internal LO source, the LO is generated inside the device itself. | + +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | LoSource.SG_SA_SHARED | SG_SA_Shared | Uses the same internal LO during NI-RFSA and NI-RFSG sessions. NI-RFSG selects an internal synthesizer and the synthesizer signal is switched to both the RF In and RF Out mixers. This value is valid only on the PXIe-5830/5831/5832/5841 with PXIe-5655/5842. | + +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | LoSource.SECONDARY | Secondary | Uses the PXIe-5831/5840 internal LO as the LO source. This value is valid only on the PXIe-5831 with PXIe-5653 and PXIe-5832 with PXIe-5653. | + +---------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - Example: :py:attr:`my_session.marker_event_terminal_name` + Note: For the PXIe-5841 with PXIe-5655, RF list mode is not supported when this property is set to LoSource.SG_SA_SHARED. ''' - marker_event_toggle_initial_state = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventToggleInitialState, 1150209) - '''Type: enums.MarkerEventToggleInitialState - - Specifies the initial state for the Marker Event when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.TOGGLE. - - To set this property, the NI-RFSG device must be in the Configuration state. + lo_temperature = _attributes.AttributeViReal64(1150075) + '''Type: float - **Default Value:** MarkerEventToggleInitialState.LOW + Returns the LO module temperature in degrees Celsius. - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 + PXIe-5840/5841: If you query this property during RF list mode, list steps may take longer to complete during list execution. - **Related Topics** + **Units**: degrees Celsius (°C) - `Marker Events `_ + **Supported Devices:** PXIe-5673/5673E, PXIe-5840/5841/5842 + ''' + lo_vco_frequency_step_size = _attributes.AttributeViReal64(1150257) + '''Type: float - **Defined Values**: + Specifies the step size for tuning the internal voltage-controlled oscillator (VCO) used to generate the LO signal. - +------------------------------------+----------------+----------------------------------------------------------------------------------+ - | Name | Value | Description | - +====================================+================+==================================================================================+ - | MarkerEventToggleInitialState.HIGH | 21001 (0x5209) | Specifies the initial state of the Marker Event toggle behavior as digital high. | - +------------------------------------+----------------+----------------------------------------------------------------------------------+ - | MarkerEventToggleInitialState.LOW | 21000 (0x5208) | Specifies the initial state of the Marker Event toggle behavior as digital low. | - +------------------------------------+----------------+----------------------------------------------------------------------------------+ + **Valid Values**: - Tip: - This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container markers to specify a subset. + LO1: 1 Hz to 50 MHz - Example: :py:attr:`my_session.markers[ ... ].marker_event_toggle_initial_state` + LO2: 1 Hz to 100 MHz - To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`. + **Default Value**: 1 MHz - Example: :py:attr:`my_session.marker_event_toggle_initial_state` + **Supported Devices**: PXIe-5830/5831/5832 ''' memory_size = _attributes.AttributeViInt64(1150061) '''Type: int @@ -5476,89 +4610,6 @@ class _SessionBase(object): Note: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. ''' - script_trigger_terminal_name = _attributes.AttributeViString(1150116) - '''Type: str - - Returns the name of the fully qualified signal name as a string. - - **Default Values**: - - PXI-5670/5671, PXIe-5672/5673/5673E: /*AWGName*/ScriptTrigger *X*, where *AWGName* is the name of your associated AWG module in MAX and *X* is Script Trigger 0 through 3. - - PXIe-5830/5831/5832: /*BasebandModule*/ao/0/ScriptTrigger *X*, where *BasebandModule* is the name of the baseband module of your device in MAX and *X* is Script Trigger 0 through 3. - - PXIe-5820/5840/5841/5842: /*ModuleName*/ao/0/ScriptTrigger *X*, where *ModuleName* is the name of your device in MAX and *X* is Script Trigger 0 through 3. - - PXIe-5860: /*ModuleName*/ao/*ChannelNumber*/ScriptTrigger *X*, where *ModuleName* is the name of your device in MAX, *ChannelNumber* is the channel number (0 or 1), and *X* is Script Trigger 0 through 3. - - **Supported Devices:** PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Triggers `_ - - `Syntax for Terminal Names `_ - - **High-Level Methods**: - - - GetTerminalName - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_terminal_name` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.script_trigger_terminal_name` - ''' - script_trigger_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigType, 1150019) - '''Type: enums.ScriptTrigType - - Specifies the Script Trigger type. Depending upon the value of this property, more properties may be needed to fully configure the trigger. To set this property, the NI-RFSG device must be in the Configuration state. - - **Default Value:** ScriptTrigType.NONE - - **Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Script Trigger `_ - - `Trigger Types `_ - - **High-Level Methods**: - - - configure_digital_edge_script_trigger - - **Defined Values**: - - +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Value | Description | - +==============================+=======================================================================================================================================================================================================================================================================+ - | ScriptTrigType.NONE | No trigger is configured. Signal generation starts immediately. | - +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigType.DIGITAL_EDGE | The data operation does not start until a digital edge is detected. The source of the digital edge is specified with the digital_edge_start_trigger_source property, and the active edge is specified with the digital_edge_start_trigger_edge property. | - +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigType.DIGITAL_LEVEL | The data operation does not start until the digital level is detected. The source of the digital level is specified in the digital_level_script_trigger_source property, and the active level is specified in the digital_level_script_trigger_active_level property. | - +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | ScriptTrigType.SOFTWARE | The data operation does not start until a software trigger occurs. You can create a software event by calling the send_software_edge_trigger method. | - +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container script_triggers to specify a subset. - - Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_type` - - To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.script_trigger_type` - ''' selected_path = _attributes.AttributeViString(1150311) '''Type: str @@ -6198,151 +5249,6 @@ class _SessionBase(object): Note: This property is read/write on the PXI-5610 and PXIe-5611 and is read-only on the PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860. ''' - waveform_iq_rate = _attributes.AttributeViReal64(1150263) - '''Type: float - - Specifies the I/Q rate of the waveform. To set this property, the NI-RFSG device must be in the Configuration state. - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_—Refer to this topic for more information about using this property to associate an I/Q rate with a waveform. - - `Digital Upconverter `_ - - Tip: - This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container waveform to specify a subset. - - Example: :py:attr:`my_session.waveform[ ... ].waveform_iq_rate` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_iq_rate` - ''' - waveform_papr = _attributes.AttributeViReal64(1150266) - '''Type: float - - Specifies the peak-to-average power ratio (PAPR). - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - Tip: - This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container waveform to specify a subset. - - Example: :py:attr:`my_session.waveform[ ... ].waveform_papr` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_papr` - ''' - waveform_rf_blanking = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.RFBlanking, 1150278) - '''Type: enums.RFBlanking - - **Defined Values**: - - Name (Value): Description - - RFBlanking.DISABLE (0): RF blanking is disabled. - - RFBlanking.ENABLE (1): RF blanking is enabled. - - **Default Value:** RFBlanking.DISABLE - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842 - - **Related Topics** - - `Marker Events `_ - - Enables or disables RF blanking. - - +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ - | rf_blanking_source | waveform_rf_blanking | Behaviour | - +===================================================================================+======================+===========================================================================================================+ - | "" (empty string) | RFBlanking.DISABLE | No blanking performed. | - +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ - | "" (empty string) | RFBlanking.ENABLE | Blanking performed based on burst start and stop values and blanking source set to private marker. | - +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ - | NIRFSG_VAL_MARKER0, NIRFSG_VAL_MARKER1, NIRFSG_VAL_MARKER2, or NIRFSG_VAL_MARKER3 | RFBlanking.DISABLE | Blanking performed based on the marker locations for the marker that the user set in the blanking source. | - +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ - | NIRFSG_VAL_MARKER0, NIRFSG_VAL_MARKER1, NIRFSG_VAL_MARKER2, or NIRFSG_VAL_MARKER3 | RFBlanking.ENABLE | Error is shown. | - +-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+ - - Note: For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call ResetWithOptions or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. - - Note: - One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - - Tip: - This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container waveform to specify a subset. - - Example: :py:attr:`my_session.waveform[ ... ].waveform_rf_blanking` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_rf_blanking` - ''' - waveform_runtime_scaling = _attributes.AttributeViReal64(1150265) - '''Type: float - - Specifies the waveform runtime scaling. The waveform runtime scaling is applied to the waveform data before any other signal processing. - - **Units**: dB - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860, PXIe-5841 with PXIe-5655 - - Tip: - This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container waveform to specify a subset. - - Example: :py:attr:`my_session.waveform[ ... ].waveform_runtime_scaling` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_runtime_scaling` - ''' - waveform_signal_bandwidth = _attributes.AttributeViReal64(1150264) - '''Type: float - - Specifies the bandwidth of the arbitrary signal. This value must be less than or equal to (0.8× iq_rate). - - **Units**: hertz (Hz) - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - Tip: - This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container waveform to specify a subset. - - Example: :py:attr:`my_session.waveform[ ... ].waveform_signal_bandwidth` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_signal_bandwidth` - ''' - waveform_waveform_size = _attributes.AttributeViInt32(1150297) - '''Type: int - - Specifies the size of the waveform specified by an active channel. - - **Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5841 with PXIe-5655/5842/5860 - - Tip: - This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance. - Use Python index notation on the repeated capabilities container waveform to specify a subset. - - Example: :py:attr:`my_session.waveform[ ... ].waveform_waveform_size` - - To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`. - - Example: :py:attr:`my_session.waveform_waveform_size` - ''' write_waveform_burst_detection = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.WriteWaveformBurstDetection, 1150273) '''Type: enums.WriteWaveformBurstDetection @@ -6467,10 +5373,10 @@ def __init__(self, repeated_capability_list, all_channels_in_session, interprete self._param_list = ', '.join(param_list) # Instantiate any repeated capability objects - self.markers = _RepeatedCapabilityMarkers(self, repeated_capability_list) - self.script_triggers = _RepeatedCapabilityScript_triggers(self, repeated_capability_list) - self.waveform = _RepeatedCapabilityWaveform(self, repeated_capability_list) - self.deembedding_port = _RepeatedCapabilityDeembedding_port(self, repeated_capability_list) + self.markers = _RepeatedCapabilityMarkers(self) + self.script_triggers = _RepeatedCapabilityScriptTriggers(self) + self.waveform = _RepeatedCapabilityWaveform(self) + self.deembedding_port = _RepeatedCapabilityDeembeddingPort(self) # Finally, set _is_frozen to True which is used to prevent clients from accidentally adding # members when trying to set a property with a typo. diff --git a/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py b/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py index eed139eeb9..ca34051860 100644 --- a/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py +++ b/generated/nirfsg/nirfsg/unit_tests/test_nirfsg.py @@ -1,12 +1,13 @@ -import hightime import nirfsg from unittest.mock import MagicMock from unittest.mock import patch + import _mock_helper SESSION_NUM_FOR_TEST = 42 + class TestSession: class PatchedLibraryInterpreter(nirfsg._library_interpreter.LibraryInterpreter): @@ -41,8 +42,14 @@ def teardown_method(self, method): def test_attribute_get_for_repeated_capability_custom_object(self): string = 'markerterminal' self.patched_library_interpreter.get_attribute_vi_string.side_effect = [string] - with nirfsg.Session('dev1',id_query = False, reset_device = False) as session: - # Custom expansion: Specify marker '0' - value = session.markers['0'].marker_event_terminal_name + with nirfsg.Session('dev1', id_query=False, reset_device=False) as session: + value = session.markers['0'].marker_event_terminal_name # noqa: F841 # Verify that the repeated capability string is '0' - self.patched_library_interpreter.get_attribute_vi_string.assert_called_once_with('marker0', 1150115) \ No newline at end of file + self.patched_library_interpreter.get_attribute_vi_string.assert_called_once_with('marker0', 1150115) + + def test_invalid_attribute_set_for_repeated_capability_custom_object(self): + with nirfsg.Session('dev1', id_query=False, reset_device=False) as session: + try: + session.deembedding_port['port0'].amplitude_settling = 2 + except AttributeError: + pass diff --git a/nirfsgunittest.xml b/nirfsgunittest.xml deleted file mode 100644 index 827d15f440..0000000000 --- a/nirfsgunittest.xml +++ /dev/null @@ -1,2345 +0,0 @@ - - - - - - /mnt/c/dev/Git/nimi-python - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/nirfsg/unit_tests/test_nirfsg.py b/src/nirfsg/unit_tests/test_nirfsg.py index eed139eeb9..ca34051860 100644 --- a/src/nirfsg/unit_tests/test_nirfsg.py +++ b/src/nirfsg/unit_tests/test_nirfsg.py @@ -1,12 +1,13 @@ -import hightime import nirfsg from unittest.mock import MagicMock from unittest.mock import patch + import _mock_helper SESSION_NUM_FOR_TEST = 42 + class TestSession: class PatchedLibraryInterpreter(nirfsg._library_interpreter.LibraryInterpreter): @@ -41,8 +42,14 @@ def teardown_method(self, method): def test_attribute_get_for_repeated_capability_custom_object(self): string = 'markerterminal' self.patched_library_interpreter.get_attribute_vi_string.side_effect = [string] - with nirfsg.Session('dev1',id_query = False, reset_device = False) as session: - # Custom expansion: Specify marker '0' - value = session.markers['0'].marker_event_terminal_name + with nirfsg.Session('dev1', id_query=False, reset_device=False) as session: + value = session.markers['0'].marker_event_terminal_name # noqa: F841 # Verify that the repeated capability string is '0' - self.patched_library_interpreter.get_attribute_vi_string.assert_called_once_with('marker0', 1150115) \ No newline at end of file + self.patched_library_interpreter.get_attribute_vi_string.assert_called_once_with('marker0', 1150115) + + def test_invalid_attribute_set_for_repeated_capability_custom_object(self): + with nirfsg.Session('dev1', id_query=False, reset_device=False) as session: + try: + session.deembedding_port['port0'].amplitude_settling = 2 + except AttributeError: + pass