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

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


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

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

[docs] def set(self, vertical_scale: float, tdRtSignal=repcap.TdRtSignal.Default) -> None: """ ``TDRT:SIGNal<*>:SCALe`` \n Snippet: ``driver.tdrt.signal.scale.set(vertical_scale = 1.0, tdRtSignal = repcap.TdRtSignal.Default)`` \n Set the vertical scale of the indicated TDR/TDT signal. :param vertical_scale: 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(vertical_scale) 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}:SCALe {param}')
[docs] def get(self, tdRtSignal=repcap.TdRtSignal.Default) -> float: """ ``TDRT:SIGNal<*>:SCALe`` \n Snippet: ``value: float = driver.tdrt.signal.scale.get(tdRtSignal = repcap.TdRtSignal.Default)`` \n Set the vertical scale of the indicated TDR/TDT signal. :param tdRtSignal: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Signal') :return: vertical_scale: 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}:SCALe?') return Conversions.str_to_float(response)