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.InvertLogicOperator) -> None:
"""
``SEARch:TRIGger:STATe:D:LOGic`` \n
Snippet: ``driver.search.trigger.state.d.logic.set(search_name = 'abc', operator = enums.InvertLogicOperator.DIRect)`` \n
Defines the logic for the indicated channel: \n
- A: CH1
- B: CH2
- C: CH3
- D: CH4
:param search_name: String with the name of the search
:param operator: DIRect | HIGH | NOT | LOW \n
- DIRect: Input value remains unchanged
- NOT: Input value is inverted
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search_name', search_name, DataType.String), ArgSingle('operator', operator, DataType.Enum, enums.InvertLogicOperator))
self._core.io.write_with_opc(f'SEARch:TRIGger:STATe:D:LOGic {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search_name: str) -> enums.InvertLogicOperator:
"""
``SEARch:TRIGger:STATe:D:LOGic`` \n
Snippet: ``value: enums.InvertLogicOperator = driver.search.trigger.state.d.logic.get(search_name = 'abc')`` \n
Defines the logic for the indicated channel: \n
- A: CH1
- B: CH2
- C: CH3
- D: CH4
:param search_name: String with the name of the search
:return: operator: DIRect | HIGH | NOT | LOW \n
- DIRect: Input value remains unchanged
- NOT: Input value is inverted
"""
param = Conversions.value_to_quoted_str(search_name)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:STATe:D:LOGic? {param}')
return Conversions.str_to_scalar_enum(response, enums.InvertLogicOperator)