from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class Y2PositionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("y2Position", core, parent)
[docs]
def set(self, yuser_position_2: float, cursor=repcap.Cursor.Default) -> None:
"""
``CURSor<*>:Y2Position`` \n
Snippet: ``driver.cursor.y2Position.set(yuser_position_2 = 1.0, cursor = repcap.Cursor.Default)`` \n
Defines the position of the upper horizontal cursor line. If method ``RsRtx.cursor.tracking.state.set()`` is enabled, the
query returns the measurement result - the upper vertical value of the waveform.
:param yuser_position_2: -50 to 50
:param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor')
"""
param = Conversions.decimal_value_to_str(yuser_position_2)
cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor)
self._core.io.write_with_opc(f'CURSor{cursor_cmd_val}:Y2Position {param}')
[docs]
def get(self, cursor=repcap.Cursor.Default) -> float:
"""
``CURSor<*>:Y2Position`` \n
Snippet: ``value: float = driver.cursor.y2Position.get(cursor = repcap.Cursor.Default)`` \n
Defines the position of the upper horizontal cursor line. If method ``RsRtx.cursor.tracking.state.set()`` is enabled, the
query returns the measurement result - the upper vertical value of the waveform.
:param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor')
"""
cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor)
response = self._core.io.query_str_with_opc(f'CURSor{cursor_cmd_val}:Y2Position?')
return Conversions.str_to_float(response)