Source code for rsrtx.Implementations.Eye.Horizontal.Unit

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


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

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

[docs] def set(self, time_units: enums.EyeTimeUnits, eye=repcap.Eye.Default) -> None: """ ``EYE<*>:HORizontal[:UNIT]`` \n Snippet: ``driver.eye.horizontal.unit.set(time_units = enums.EyeTimeUnits.ATIMe, eye = repcap.Eye.Default)`` \n Sets the method to define the horizontal scale of the eye diagram. :param time_units: ATIMe | UINTerval \n - ATIMe: Absolute time - UINTerval: Unit intervals. You can use unit interval, if the nominal frequency of the clock signal is known. :param eye: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Eye') """ param = Conversions.enum_scalar_to_str(time_units, enums.EyeTimeUnits) eye_cmd_val = self._cmd_group.get_repcap_cmd_value(eye, repcap.Eye) self._core.io.write_with_opc(f'EYE{eye_cmd_val}:HORizontal:UNIT {param}')
# noinspection PyTypeChecker
[docs] def get(self, eye=repcap.Eye.Default) -> enums.EyeTimeUnits: """ ``EYE<*>:HORizontal[:UNIT]`` \n Snippet: ``value: enums.EyeTimeUnits = driver.eye.horizontal.unit.get(eye = repcap.Eye.Default)`` \n Sets the method to define the horizontal scale of the eye diagram. :param eye: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Eye') :return: time_units: ATIMe | UINTerval \n - ATIMe: Absolute time - UINTerval: Unit intervals. You can use unit interval, if the nominal frequency of the clock signal is known. """ eye_cmd_val = self._cmd_group.get_repcap_cmd_value(eye, repcap.Eye) response = self._core.io.query_str_with_opc(f'EYE{eye_cmd_val}:HORizontal:UNIT?') return Conversions.str_to_scalar_enum(response, enums.EyeTimeUnits)