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
# 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_name: str, state: bool) -> None:
"""
``SEARch:TRIGger:PATTern:D[:ENABle]`` \n
Snippet: ``driver.search.trigger.pattern.d.enable.set(search_name = 'abc', state = False)`` \n
Enables the channel to be considered in the pattern search. The trigger source channel is selected by default.
Defines the logical combination of the indicated channels after evaluating the previous logical operations: \n
- A[:ENABle]: CH1
- B[:ENABle]: CH2
- C[:ENABle]: CH3
- D[:ENABle]: CH4
Digital channels are not available.
:param search_name: String with name of the search
:param state: OFF | ON
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search_name', search_name, DataType.String), ArgSingle('state', state, DataType.Boolean))
self._core.io.write_with_opc(f'SEARch:TRIGger:PATTern:D:ENABle {param}'.rstrip())
[docs]
def get(self, search_name: str) -> bool:
"""
``SEARch:TRIGger:PATTern:D[:ENABle]`` \n
Snippet: ``value: bool = driver.search.trigger.pattern.d.enable.get(search_name = 'abc')`` \n
Enables the channel to be considered in the pattern search. The trigger source channel is selected by default.
Defines the logical combination of the indicated channels after evaluating the previous logical operations: \n
- A[:ENABle]: CH1
- B[:ENABle]: CH2
- C[:ENABle]: CH3
- D[:ENABle]: CH4
Digital channels are not available.
:param search_name: String with name of the search
:return: state: OFF | ON
"""
param = Conversions.value_to_quoted_str(search_name)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:PATTern:D:ENABle? {param}')
return Conversions.str_to_bool(response)