Source code for rsrtx.Implementations.Tdrt.Signal.Offset

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


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

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

[docs] def set(self, offset: float, tdRtSignal=repcap.TdRtSignal.Default) -> None: """ ``TDRT:SIGNal<*>:OFFSet`` \n Snippet: ``driver.tdrt.signal.offset.set(offset = 1.0, tdRtSignal = repcap.TdRtSignal.Default)`` \n Set the offset of the indicated TDR/TDT signal. :param offset: 1E-12 to 100E+12 :param tdRtSignal: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Signal') """ param = Conversions.decimal_value_to_str(offset) tdRtSignal_cmd_val = self._cmd_group.get_repcap_cmd_value(tdRtSignal, repcap.TdRtSignal) self._core.io.write_with_opc(f'TDRT:SIGNal{tdRtSignal_cmd_val}:OFFSet {param}')
[docs] def get(self, tdRtSignal=repcap.TdRtSignal.Default) -> float: """ ``TDRT:SIGNal<*>:OFFSet`` \n Snippet: ``value: float = driver.tdrt.signal.offset.get(tdRtSignal = repcap.TdRtSignal.Default)`` \n Set the offset of the indicated TDR/TDT signal. :param tdRtSignal: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Signal') :return: offset: 1E-12 to 100E+12 """ tdRtSignal_cmd_val = self._cmd_group.get_repcap_cmd_value(tdRtSignal, repcap.TdRtSignal) response = self._core.io.query_str_with_opc(f'TDRT:SIGNal{tdRtSignal_cmd_val}:OFFSet?') return Conversions.str_to_float(response)