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 RunExecCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("runExec", core, parent)
[docs]
def set(self, mask_test: str, run_executable: enums.BeepMode) -> None:
"""
``MTESt:ONViolation:RUNexec`` \n
Snippet: ``driver.mtest.onViolation.runExec.set(mask_test = 'abc', run_executable = enums.BeepMode.NOACtion)`` \n
Starts an external application if the command is set to VIOLation or SUCCess.
Use the following commands to set up the application: \n
- method ``RsRtx.executable.name()``
- method ``RsRtx.executable.parameter()``
- method ``RsRtx.executable.wdirectory()``
:param mask_test: String with the name of the mask test
:param run_executable: See 'Event parameter'
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('mask_test', mask_test, DataType.String), ArgSingle('run_executable', run_executable, DataType.Enum, enums.BeepMode))
self._core.io.write_with_opc(f'MTESt:ONViolation:RUNexec {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, mask_test: str) -> enums.BeepMode:
"""
``MTESt:ONViolation:RUNexec`` \n
Snippet: ``value: enums.BeepMode = driver.mtest.onViolation.runExec.get(mask_test = 'abc')`` \n
Starts an external application if the command is set to VIOLation or SUCCess.
Use the following commands to set up the application: \n
- method ``RsRtx.executable.name()``
- method ``RsRtx.executable.parameter()``
- method ``RsRtx.executable.wdirectory()``
:param mask_test: String with the name of the mask test
:return: run_executable: See 'Event parameter'
"""
param = Conversions.value_to_quoted_str(mask_test)
response = self._core.io.query_str_with_opc(f'MTESt:ONViolation:RUNexec? {param}')
return Conversions.str_to_scalar_enum(response, enums.BeepMode)