from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Types import DataType
from ...Internal.ArgSingleList import ArgSingleList
from ...Internal.ArgSingle import ArgSingle
from ... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class RefWfmCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("refWfm", core, parent)
[docs]
def set(self, mask_test: str, source: enums.MtestSource) -> None:
"""
``MTESt:REFWfm`` \n
Snippet: ``driver.mtest.refWfm.set(mask_test = 'abc', source = enums.MtestSource.REF1)`` \n
Sets the reference waveform from which the mask is created. The reference waveform can be created before, or loaded from
a file with REFCurve commands, see 'Reference waveforms'.
:param mask_test: String containing the name of the mask test
:param source: REF1 = REFerence1, REF2 = REFerence2, REF3 = REFerence3, REF4 = REFerence4: reference waveforms
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('source', source, DataType.Enum, enums.MtestSource))
self._core.io.write_with_opc(f'MTESt:REFWfm {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, mask_test: str) -> enums.MtestSource:
"""
``MTESt:REFWfm`` \n
Snippet: ``value: enums.MtestSource = driver.mtest.refWfm.get(mask_test = 'abc')`` \n
Sets the reference waveform from which the mask is created. The reference waveform can be created before, or loaded from
a file with REFCurve commands, see 'Reference waveforms'.
:param mask_test: String containing the name of the mask test
:return: source: REF1 = REFerence1, REF2 = REFerence2, REF3 = REFerence3, REF4 = REFerence4: reference waveforms
"""
param = Conversions.value_to_quoted_str(mask_test)
response = self._core.io.query_str_with_opc(f'MTESt:REFWfm? {param}')
return Conversions.str_to_scalar_enum(response, enums.MtestSource)