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 YsourceCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("ysource", core, parent)
[docs]
def set(self, ysource: enums.SignalSource, waveform=repcap.Waveform.Default) -> None:
"""
``WAVeform<*>:XYCurve:YSOurce`` \n
Snippet: ``driver.waveform.xyCurve.ysource.set(ysource = enums.SignalSource.AJ1, waveform = repcap.Waveform.Default)`` \n
Defines the signal source that supplies the y-values of the XY-diagram.
:param ysource: Source of y-values, see 'Waveform parameter'
:param waveform: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Waveform')
"""
param = Conversions.enum_scalar_to_str(ysource, enums.SignalSource)
waveform_cmd_val = self._cmd_group.get_repcap_cmd_value(waveform, repcap.Waveform)
self._core.io.write_with_opc(f'WAVeform{waveform_cmd_val}:XYCurve:YSOurce {param}')
# noinspection PyTypeChecker
[docs]
def get(self, waveform=repcap.Waveform.Default) -> enums.SignalSource:
"""
``WAVeform<*>:XYCurve:YSOurce`` \n
Snippet: ``value: enums.SignalSource = driver.waveform.xyCurve.ysource.get(waveform = repcap.Waveform.Default)`` \n
Defines the signal source that supplies the y-values of the XY-diagram.
:param waveform: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Waveform')
:return: ysource: Source of y-values, see 'Waveform parameter'
"""
waveform_cmd_val = self._cmd_group.get_repcap_cmd_value(waveform, repcap.Waveform)
response = self._core.io.query_str_with_opc(f'WAVeform{waveform_cmd_val}:XYCurve:YSOurce?')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)