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 repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class EnableCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("enable", core, parent)
[docs]
def set(self, search: str, enable: bool, error=repcap.Error.Default) -> None:
"""
``SEARch:TRIGger:USBPd:ERRor<*>:ENABle`` \n
Snippet: ``driver.search.trigger.usbPd.error.enable.set(search = 'abc', enable = False, error = repcap.Error.Default)`` \n
Enables or disables the checking condition for searching a specific error in the selected field of the selected frame.
:param enable: OFF | ON
:param error: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Error')
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('enable', enable, DataType.Boolean))
error_cmd_val = self._cmd_group.get_repcap_cmd_value(error, repcap.Error)
self._core.io.write(f'SEARch:TRIGger:USBPd:ERRor{error_cmd_val}:ENABle {param}'.rstrip())
[docs]
def get(self, search: str, error=repcap.Error.Default) -> bool:
"""
``SEARch:TRIGger:USBPd:ERRor<*>:ENABle`` \n
Snippet: ``value: bool = driver.search.trigger.usbPd.error.enable.get(search = 'abc', error = repcap.Error.Default)`` \n
Enables or disables the checking condition for searching a specific error in the selected field of the selected frame.
:param error: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Error')
:return: enable: OFF | ON
"""
param = Conversions.value_to_quoted_str(search)
error_cmd_val = self._cmd_group.get_repcap_cmd_value(error, repcap.Error)
response = self._core.io.query_str(f'SEARch:TRIGger:USBPd:ERRor{error_cmd_val}:ENABle? {param}')
return Conversions.str_to_bool(response)