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 SourceCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("source", core, parent)
[docs]
def set(self, source: enums.SignalSource, maskTest=repcap.MaskTest.Default) -> None:
"""
``MTESt<*>:SOURce`` \n
Snippet: ``driver.mtest.source.set(source = enums.SignalSource.C1, maskTest = repcap.MaskTest.Default)`` \n
Selects the waveform to be tested against the mask.
:param source: C1 | C2 | ... | C8 | M1 | M2 | ... | M8 | XY1 | XY2 | XY3 | XY4 | SPECNORM1 | SPECNORM2 | SPECNORM3 | SPECNORM4 | OnC1 | OnC2 | ... | OnC8 (n = 2 to 11 | EYE1 | EYE2 | ... | EYE8
:param maskTest: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Mtest')
"""
param = Conversions.enum_scalar_to_str(source, enums.SignalSource)
maskTest_cmd_val = self._cmd_group.get_repcap_cmd_value(maskTest, repcap.MaskTest)
self._core.io.write(f'MTESt{maskTest_cmd_val}:SOURce {param}')
# noinspection PyTypeChecker
[docs]
def get(self, maskTest=repcap.MaskTest.Default) -> enums.SignalSource:
"""
``MTESt<*>:SOURce`` \n
Snippet: ``value: enums.SignalSource = driver.mtest.source.get(maskTest = repcap.MaskTest.Default)`` \n
Selects the waveform to be tested against the mask.
:param maskTest: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Mtest')
:return: source: C1 | C2 | ... | C8 | M1 | M2 | ... | M8 | XY1 | XY2 | XY3 | XY4 | SPECNORM1 | SPECNORM2 | SPECNORM3 | SPECNORM4 | OnC1 | OnC2 | ... | OnC8 (n = 2 to 11 | EYE1 | EYE2 | ... | EYE8
"""
maskTest_cmd_val = self._cmd_group.get_repcap_cmd_value(maskTest, repcap.MaskTest)
response = self._core.io.query_str(f'MTESt{maskTest_cmd_val}:SOURce?')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)