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 LogicCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("logic", core, parent)
[docs]
def set(self, search_name: str, operator: enums.LogicOperator) -> None:
"""
``SEARch:TRIGger:PATTern:ABCD:LOGic`` \n
Snippet: ``driver.search.trigger.pattern.abcd.logic.set(search_name = 'abc', operator = enums.LogicOperator.AND)`` \n
Defines the logical combination of the indicated channels after evaluating the previous logical operations: \n
- AB: CH1 and CH2
- CD: CH3 and CH4
- ABCD: result of AB and CD
:param search_name: String with the name of the search
:param operator: AND: logical AND, conjunctive combination NAND:logical NOT AND OR:logical OR, disjunctive combination NOR: logical NOT OR
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search_name', search_name, DataType.String), ArgSingle('operator', operator, DataType.Enum, enums.LogicOperator))
self._core.io.write_with_opc(f'SEARch:TRIGger:PATTern:ABCD:LOGic {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search_name: str) -> enums.LogicOperator:
"""
``SEARch:TRIGger:PATTern:ABCD:LOGic`` \n
Snippet: ``value: enums.LogicOperator = driver.search.trigger.pattern.abcd.logic.get(search_name = 'abc')`` \n
Defines the logical combination of the indicated channels after evaluating the previous logical operations: \n
- AB: CH1 and CH2
- CD: CH3 and CH4
- ABCD: result of AB and CD
:param search_name: String with the name of the search
:return: operator: AND: logical AND, conjunctive combination NAND:logical NOT AND OR:logical OR, disjunctive combination NOR: logical NOT OR
"""
param = Conversions.value_to_quoted_str(search_name)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:PATTern:ABCD:LOGic? {param}')
return Conversions.str_to_scalar_enum(response, enums.LogicOperator)