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 X1EnvelopeCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("x1Envelope", core, parent)
[docs]
def set(self, envelope_curve_1: enums.EnvelopeCurve, cursor=repcap.Cursor.Default) -> None:
"""
``CURSor<*>:X1ENvelope`` \n
Snippet: ``driver.cursor.x1Envelope.set(envelope_curve_1 = enums.EnvelopeCurve.BOTH, cursor = repcap.Cursor.Default)`` \n
If the waveform arithmetics are set to envelope curve (see method ``RsRtx.channel.waveform.arithmetics.set()`` ) and
method ``RsRtx.cursor.tracking.state.set()`` is set to ON, this setting defines how the first horizontal cursor is
positioned.
:param envelope_curve_1: MIN | MAX \n
- MIN: The horizontal cursor is set to the crossing point of the vertical cursor with the minimum waveform envelope.
- MAX: The horizontal cursor is set to the crossing point of the vertical cursor with the maximum waveform envelope.
:param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor')
"""
param = Conversions.enum_scalar_to_str(envelope_curve_1, enums.EnvelopeCurve)
cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor)
self._core.io.write_with_opc(f'CURSor{cursor_cmd_val}:X1ENvelope {param}')
# noinspection PyTypeChecker
[docs]
def get(self, cursor=repcap.Cursor.Default) -> enums.EnvelopeCurve:
"""
``CURSor<*>:X1ENvelope`` \n
Snippet: ``value: enums.EnvelopeCurve = driver.cursor.x1Envelope.get(cursor = repcap.Cursor.Default)`` \n
If the waveform arithmetics are set to envelope curve (see method ``RsRtx.channel.waveform.arithmetics.set()`` ) and
method ``RsRtx.cursor.tracking.state.set()`` is set to ON, this setting defines how the first horizontal cursor is
positioned.
:param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor')
:return: envelope_curve_1: MIN | MAX \n
- MIN: The horizontal cursor is set to the crossing point of the vertical cursor with the minimum waveform envelope.
- MAX: The horizontal cursor is set to the crossing point of the vertical cursor with the maximum waveform envelope.
"""
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}:X1ENvelope?')
return Conversions.str_to_scalar_enum(response, enums.EnvelopeCurve)