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 WfmSaveCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("wfmSave", core, parent)
[docs]
def set(self, save_wfm: enums.TriggerAction, maskTest=repcap.MaskTest.Default) -> None:
"""
``MTESt<*>:ONViolation:WFMSave`` \n
Snippet: ``driver.mtest.onViolation.wfmSave.set(save_wfm = enums.TriggerAction.NOACtion, maskTest = repcap.MaskTest.Default)`` \n
Saves the waveform data to file if the command is set to SUCCess or VIOLation.
To define the path and file names, use the EXPort:WAVeform:AUTonaming:* commands: \n
- method ``RsMxo.export.waveform.autoNaming.name()``
- method ``RsMxo.export.waveform.autoNaming.path()``
- method ``RsMxo.export.waveform.autoNaming.type_py()``
:param save_wfm: NOACtion | SUCCess | VIOLation
:param maskTest: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Mtest')
"""
param = Conversions.enum_scalar_to_str(save_wfm, enums.TriggerAction)
maskTest_cmd_val = self._cmd_group.get_repcap_cmd_value(maskTest, repcap.MaskTest)
self._core.io.write(f'MTESt{maskTest_cmd_val}:ONViolation:WFMSave {param}')
# noinspection PyTypeChecker
[docs]
def get(self, maskTest=repcap.MaskTest.Default) -> enums.TriggerAction:
"""
``MTESt<*>:ONViolation:WFMSave`` \n
Snippet: ``value: enums.TriggerAction = driver.mtest.onViolation.wfmSave.get(maskTest = repcap.MaskTest.Default)`` \n
Saves the waveform data to file if the command is set to SUCCess or VIOLation.
To define the path and file names, use the EXPort:WAVeform:AUTonaming:* commands: \n
- method ``RsMxo.export.waveform.autoNaming.name()``
- method ``RsMxo.export.waveform.autoNaming.path()``
- method ``RsMxo.export.waveform.autoNaming.type_py()``
:param maskTest: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Mtest')
:return: save_wfm: NOACtion | SUCCess | VIOLation
"""
maskTest_cmd_val = self._cmd_group.get_repcap_cmd_value(maskTest, repcap.MaskTest)
response = self._core.io.query_str(f'MTESt{maskTest_cmd_val}:ONViolation:WFMSave?')
return Conversions.str_to_scalar_enum(response, enums.TriggerAction)