diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e8447c18..e3e43ffaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1705,6 +1705,7 @@ - Changed `interpolation_delay` and `relative_delay` properties to be of type hightime.timedelta, so that it aligns with _delay_ attributes across other APIs in the repository - Changed `exported_ref_clock_rate` and `ref_clock_rate` properties to be of type float instead of enum, since the enums just represented raw float values - Fixed the return type of `get_all_script_names` and `get_all_named_waveform_names` to remove the size parameter and return a list of strings instead of a comma-separated string + - Updated `external_calibration_recommended_interval` property to return a hightime.timedelta object instead of months as an int, aligning with other APIs in the repository - Updated `self_test` to not have any parameters, aligning with other APIs in the repository - Updated `wait_until_settled` method to have `max_time_milliseconds` parameter as type hightime.timedelta with a default value of 10 seconds - Updated below properties and method parameters to be of string enum type instead of plain string, since they would support only fixed set of strings @@ -1715,6 +1716,12 @@ - `arb_sample_clock_source` - `ref_clock_source` - `trigger_identifier` parameter in `send_software_edge_trigger` method + - Updated below properties to be list of str instead of them returning a comma separated list of string values + - `available_paths` + - `available_ports` + - `fixed_group_delay_across_ports` + - `group_capabilities` + - `supported_instrument_models` - Removed - Python 3.9 Support - Methods and properties applicable only to hardware which are not supported anymore diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index b5dfe9a3a..ccbe8656f 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -3888,19 +3888,19 @@ available_paths .. py:attribute:: available_paths - Returns a comma separated list of the configurable paths available for use based on your instrument configuration. + Returns a list of the configurable paths available for use based on your instrument configuration. The following table lists the characteristics of this property. - +-----------------------+-----------+ - | Characteristic | Value | - +=======================+===========+ - | Datatype | str | - +-----------------------+-----------+ - | Permissions | read only | - +-----------------------+-----------+ - | Repeated Capabilities | None | - +-----------------------+-----------+ + +-----------------------+-------------+ + | Characteristic | Value | + +=======================+=============+ + | Datatype | list of str | + +-----------------------+-------------+ + | Permissions | read only | + +-----------------------+-------------+ + | Repeated Capabilities | None | + +-----------------------+-------------+ .. tip:: This property corresponds to the following LabVIEW Property or C Attribute: @@ -3913,21 +3913,21 @@ available_ports .. py:attribute:: available_ports - Returns a comma-separated list of the ports available for use based on your instrument configuration. + Returns a list of the ports available for use based on your instrument configuration. **Supported Devices**: PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 The following table lists the characteristics of this property. - +-----------------------+-----------+ - | Characteristic | Value | - +=======================+===========+ - | Datatype | str | - +-----------------------+-----------+ - | Permissions | read only | - +-----------------------+-----------+ - | Repeated Capabilities | None | - +-----------------------+-----------+ + +-----------------------+-------------+ + | Characteristic | Value | + +=======================+=============+ + | Datatype | list of str | + +-----------------------+-------------+ + | Permissions | read only | + +-----------------------+-------------+ + | Repeated Capabilities | None | + +-----------------------+-------------+ .. tip:: This property corresponds to the following LabVIEW Property or C Attribute: @@ -5629,21 +5629,19 @@ external_calibration_recommended_interval Returns the recommended interval between each external calibration of the device. - **Units**: months - **Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 The following table lists the characteristics of this property. - +-----------------------+-----------+ - | Characteristic | Value | - +=======================+===========+ - | Datatype | int | - +-----------------------+-----------+ - | Permissions | read only | - +-----------------------+-----------+ - | Repeated Capabilities | None | - +-----------------------+-----------+ + +-----------------------+--------------------+ + | Characteristic | Value | + +=======================+====================+ + | Datatype | hightime.timedelta | + +-----------------------+--------------------+ + | Permissions | read only | + +-----------------------+--------------------+ + | Repeated Capabilities | None | + +-----------------------+--------------------+ .. tip:: This property corresponds to the following LabVIEW Property or C Attribute: @@ -5765,22 +5763,22 @@ fixed_group_delay_across_ports .. py:attribute:: fixed_group_delay_across_ports - Specifies a comma-separated list of ports for which to fix the group delay. + Specifies a list of ports for which to fix the group delay. **Supported Devices:** PXIe-5831/5832 The following table lists the characteristics of this property. - +-----------------------+------------+ - | Characteristic | Value | - +=======================+============+ - | Datatype | str | - +-----------------------+------------+ - | Permissions | read-write | - +-----------------------+------------+ - | Repeated Capabilities | None | - +-----------------------+------------+ + +-----------------------+-------------+ + | Characteristic | Value | + +=======================+=============+ + | Datatype | list of str | + +-----------------------+-------------+ + | Permissions | read-write | + +-----------------------+-------------+ + | Repeated Capabilities | None | + +-----------------------+-------------+ .. tip:: This property corresponds to the following LabVIEW Property or C Attribute: @@ -6093,21 +6091,21 @@ group_capabilities .. py:attribute:: group_capabilities - Returns a string that contains a comma-separated list of class-extension groups that NI-RFSG implements. + Returns a list of class-extension groups that NI-RFSG implements. **Supported Devices:** PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 The following table lists the characteristics of this property. - +-----------------------+-----------+ - | Characteristic | Value | - +=======================+===========+ - | Datatype | str | - +-----------------------+-----------+ - | Permissions | read only | - +-----------------------+-----------+ - | Repeated Capabilities | None | - +-----------------------+-----------+ + +-----------------------+-------------+ + | Characteristic | Value | + +=======================+=============+ + | Datatype | list of str | + +-----------------------+-------------+ + | Permissions | read only | + +-----------------------+-------------+ + | Repeated Capabilities | None | + +-----------------------+-------------+ .. tip:: This property corresponds to the following LabVIEW Property or C Attribute: @@ -9792,21 +9790,21 @@ supported_instrument_models .. py:attribute:: supported_instrument_models - Returns a string that contains a model code of the NI-RFSG device. For drivers that support more than one device, this property contains a comma-separated list of supported devices. + Returns a list of supported devices. **Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 The following table lists the characteristics of this property. - +-----------------------+-----------+ - | Characteristic | Value | - +=======================+===========+ - | Datatype | str | - +-----------------------+-----------+ - | Permissions | read only | - +-----------------------+-----------+ - | Repeated Capabilities | None | - +-----------------------+-----------+ + +-----------------------+-------------+ + | Characteristic | Value | + +=======================+=============+ + | Datatype | list of str | + +-----------------------+-------------+ + | Permissions | read only | + +-----------------------+-------------+ + | Repeated Capabilities | None | + +-----------------------+-------------+ .. tip:: This property corresponds to the following LabVIEW Property or C Attribute: diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 8c5850563..c6eaa90c8 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -727,15 +727,15 @@ 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. ''' - available_paths = _attributes.AttributeViString(1150312) - '''Type: str + available_paths = _attributes.AttributeViStringCommaSeparated(1150312) + '''Type: list of str - Returns a comma separated list of the configurable paths available for use based on your instrument configuration. + Returns a list of the configurable paths available for use based on your instrument configuration. ''' - available_ports = _attributes.AttributeViString(1150249) - '''Type: str + available_ports = _attributes.AttributeViStringCommaSeparated(1150249) + '''Type: list of str - Returns a comma-separated list of the ports available for use based on your instrument configuration. + Returns a list of the ports available for use based on your instrument configuration. **Supported Devices**: PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 ''' @@ -1882,13 +1882,11 @@ class _SessionBase(object): | "DIO/PFI7" | The trigger is received on PFI7 from the front panel DIO terminal. | +----------------+----------------------------------------------------------------------------------------------------------------------------------------+ ''' - external_calibration_recommended_interval = _attributes.AttributeViInt32(1150076) - '''Type: int + external_calibration_recommended_interval = _attributes.AttributeViInt32TimeDeltaMonths(1150076) + '''Type: hightime.timedelta Returns the recommended interval between each external calibration of the device. - **Units**: months - **Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 ''' external_calibration_temperature = _attributes.AttributeViReal64(1150077) @@ -1938,10 +1936,10 @@ class _SessionBase(object): | False | The RF signal generator has the 1 ms tuning option. | +-------+------------------------------------------------------------+ ''' - fixed_group_delay_across_ports = _attributes.AttributeViString(1150271) - '''Type: str + fixed_group_delay_across_ports = _attributes.AttributeViStringCommaSeparated(1150271) + '''Type: list of str - Specifies a comma-separated list of ports for which to fix the group delay. + Specifies a list of ports for which to fix the group delay. **Supported Devices:** PXIe-5831/5832 @@ -2103,10 +2101,10 @@ class _SessionBase(object): | GenerationMode.SCRIPT | 1002 (0x3ea) | Configures the RF signal generator to generate arbitrary waveforms as directed by the selected_script property.. | +-----------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+ ''' - group_capabilities = _attributes.AttributeViString(1050401) - '''Type: str + group_capabilities = _attributes.AttributeViStringCommaSeparated(1050401) + '''Type: list of str - Returns a string that contains a comma-separated list of class-extension groups that NI-RFSG implements. + Returns a list of class-extension groups that NI-RFSG implements. **Supported Devices:** PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 ''' @@ -4098,10 +4096,10 @@ class _SessionBase(object): `Streaming Waveform Data `_ ''' - supported_instrument_models = _attributes.AttributeViString(1050327) - '''Type: str + supported_instrument_models = _attributes.AttributeViStringCommaSeparated(1050327) + '''Type: list of str - Returns a string that contains a model code of the NI-RFSG device. For drivers that support more than one device, this property contains a comma-separated list of supported devices. + Returns a list of supported devices. **Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 ''' diff --git a/src/nirfsg/metadata/attributes.py b/src/nirfsg/metadata/attributes.py index b109e0905..5862b0cbe 100644 --- a/src/nirfsg/metadata/attributes.py +++ b/src/nirfsg/metadata/attributes.py @@ -33,23 +33,27 @@ }, 1050327: { 'access': 'read only', + 'attribute_class': 'AttributeViStringCommaSeparated', 'codegen_method': 'public', 'documentation': { - 'description': 'Returns a string that contains a model code of the NI-RFSG device. For drivers that support more than one device, this attribute contains a comma-separated list of supported devices.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': 'Returns a list of supported devices.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'lv_property': 'Inherent IVI Attributes:Driver Capabilities:Supported Instrument Models', 'name': 'SUPPORTED_INSTRUMENT_MODELS', - 'type': 'ViString' + 'type': 'ViString', + 'type_in_documentation': 'list of str' }, 1050401: { 'access': 'read only', + 'attribute_class': 'AttributeViStringCommaSeparated', 'codegen_method': 'public', 'documentation': { - 'description': 'Returns a string that contains a comma-separated list of class-extension groups that NI-RFSG implements.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': 'Returns a list of class-extension groups that NI-RFSG implements.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'lv_property': 'Inherent IVI Attributes:Driver Capabilities:Class Group Capabilities', 'name': 'GROUP_CAPABILITIES', - 'type': 'ViString' + 'type': 'ViString', + 'type_in_documentation': 'list of str' }, 1050510: { 'access': 'read only', @@ -1864,13 +1868,15 @@ }, 1150076: { 'access': 'read only', + 'attribute_class': 'AttributeViInt32TimeDeltaMonths', 'codegen_method': 'public', 'documentation': { - 'description': 'Returns the recommended interval between each external calibration of the device.\n\n**Units**: months\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': 'Returns the recommended interval between each external calibration of the device.\n\n**Supported Devices:** PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'lv_property': 'External Calibration:Recommended Interval', 'name': 'EXTERNAL_CALIBRATION_RECOMMENDED_INTERVAL', - 'type': 'ViInt32' + 'type': 'ViInt32', + 'type_in_documentation': 'hightime.timedelta' }, 1150077: { 'access': 'read only', @@ -3330,13 +3336,15 @@ }, 1150249: { 'access': 'read only', + 'attribute_class': 'AttributeViStringCommaSeparated', 'codegen_method': 'public', 'documentation': { - 'description': 'Returns a comma-separated list of the ports available for use based on your instrument configuration.\n\n**Supported Devices**: PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': 'Returns a list of the ports available for use based on your instrument configuration.\n\n**Supported Devices**: PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'lv_property': 'Device Specific:Vector Signal Transceiver:Signal Path:Available Ports', 'name': 'AVAILABLE_PORTS', - 'type': 'ViString' + 'type': 'ViString', + 'type_in_documentation': 'list of str' }, 1150251: { 'access': 'read only', @@ -3471,13 +3479,15 @@ }, 1150271: { 'access': 'read-write', + 'attribute_class': 'AttributeViStringCommaSeparated', 'codegen_method': 'public', 'documentation': { - 'description': 'Specifies a comma-separated list of ports for which to fix the group delay.\n\n\n**Supported Devices:** PXIe-5831/5832' + 'description': 'Specifies a list of ports for which to fix the group delay.\n\n\n**Supported Devices:** PXIe-5831/5832' }, 'lv_property': 'Device Specific:Vector Signal Transceiver:Signal Path:Fixed Group Delay Across Ports', 'name': 'FIXED_GROUP_DELAY_ACROSS_PORTS', - 'type': 'ViString' + 'type': 'ViString', + 'type_in_documentation': 'list of str' }, 1150273: { 'access': 'read-write', @@ -3850,13 +3860,15 @@ }, 1150312: { 'access': 'read only', + 'attribute_class': 'AttributeViStringCommaSeparated', 'codegen_method': 'public', 'documentation': { - 'description': 'Returns a comma separated list of the configurable paths available for use based on your instrument configuration.' + 'description': 'Returns a list of the configurable paths available for use based on your instrument configuration.' }, 'lv_property': 'Signal Path:Advanced:Available Paths', 'name': 'AVAILABLE_PATHS', - 'type': 'ViString' + 'type': 'ViString', + 'type_in_documentation': 'list of str' }, 1154097: { 'access': 'read-write', diff --git a/src/nirfsg/system_tests/test_system_nirfsg.py b/src/nirfsg/system_tests/test_system_nirfsg.py index 08802eeeb..8bd3b7a78 100644 --- a/src/nirfsg/system_tests/test_system_nirfsg.py +++ b/src/nirfsg/system_tests/test_system_nirfsg.py @@ -53,12 +53,21 @@ def test_get_string_attribute(self, rfsg_device_session): model = rfsg_device_session.instrument_model assert model == "NI PXIe-5841" + def test_get_list_of_strings_attribute(self, rfsg_device_session): + models = rfsg_device_session.supported_instrument_models + assert isinstance(models, list) and all(isinstance(model, str) for model in models) + assert "NI PXIe-5841" in models + def test_set_string_attribute(self, rfsg_device_session): rfsg_device_session.selected_script = "myScript" assert rfsg_device_session.selected_script == "myScript" - def test_get_int32_attribute(self, rfsg_device_session): + def test_get_timedelta_attribute(self, rfsg_device_session): value = rfsg_device_session.external_calibration_recommended_interval + assert isinstance(value, hightime.timedelta) + + def test_get_int32_attribute(self, rfsg_device_session): + value = rfsg_device_session.arb_waveform_quantum assert isinstance(value, int) def test_set_int32_enum_attribute(self, rfsg_device_session):