Source code for rsrtx.Implementations.Cdr.Software.Bitrate

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class BitrateCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("bitrate", core, parent)

[docs] def set(self, bitrate: float, software=repcap.Software.Default) -> None: """ ``CDR:SOFTware<*>:BITRate`` \n Snippet: ``driver.cdr.software.bitrate.set(bitrate = 1.0, software = repcap.Software.Default)`` \n Sets the quiescent frequency of the PLL. It corresponds to the data rate of the data stream from which the clock is to be recovered. :param bitrate: 100 to max {5 Gbps, available instrument bandwidth} :param software: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Software') """ param = Conversions.decimal_value_to_str(bitrate) software_cmd_val = self._cmd_group.get_repcap_cmd_value(software, repcap.Software) self._core.io.write_with_opc(f'CDR:SOFTware{software_cmd_val}:BITRate {param}')
[docs] def get(self, software=repcap.Software.Default) -> float: """ ``CDR:SOFTware<*>:BITRate`` \n Snippet: ``value: float = driver.cdr.software.bitrate.get(software = repcap.Software.Default)`` \n Sets the quiescent frequency of the PLL. It corresponds to the data rate of the data stream from which the clock is to be recovered. :param software: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Software') :return: bitrate: 100 to max {5 Gbps, available instrument bandwidth} """ software_cmd_val = self._cmd_group.get_repcap_cmd_value(software, repcap.Software) response = self._core.io.query_str_with_opc(f'CDR:SOFTware{software_cmd_val}:BITRate?') return Conversions.str_to_float(response)