Source code for rsmxo.Implementations.RefCurve.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, vertical_offset: float, refCurve=repcap.RefCurve.Default) -> None: """ ``REFCurve<*>:OFFSet`` \n Snippet: ``driver.refCurve.offset.set(vertical_offset = 1.0, refCurve = repcap.RefCurve.Default)`` \n The vertical offset moves the reference waveform vertically. Enter a value with the unit of the waveform. :param vertical_offset: -1E+26 to 1E+26 :param refCurve: optional repeated capability selector. Default value: Nr1 (settable in the interface 'RefCurve') """ param = Conversions.decimal_value_to_str(vertical_offset) refCurve_cmd_val = self._cmd_group.get_repcap_cmd_value(refCurve, repcap.RefCurve) self._core.io.write(f'REFCurve{refCurve_cmd_val}:OFFSet {param}')
[docs] def get(self, refCurve=repcap.RefCurve.Default) -> float: """ ``REFCurve<*>:OFFSet`` \n Snippet: ``value: float = driver.refCurve.offset.get(refCurve = repcap.RefCurve.Default)`` \n The vertical offset moves the reference waveform vertically. Enter a value with the unit of the waveform. :param refCurve: optional repeated capability selector. Default value: Nr1 (settable in the interface 'RefCurve') :return: vertical_offset: -1E+26 to 1E+26 """ refCurve_cmd_val = self._cmd_group.get_repcap_cmd_value(refCurve, repcap.RefCurve) response = self._core.io.query_str(f'REFCurve{refCurve_cmd_val}:OFFSet?') return Conversions.str_to_float(response)