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 ConditionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("condition", core, parent)
[docs]
def set(self, search: str, dat_index_optor: enums.DataIndexOperator) -> None:
"""
``SEARch:TRIGger:DPHY:DIDX:CONDition`` \n
Snippet: ``driver.search.trigger.dphy.didx.condition.set(search = 'abc', dat_index_optor = enums.DataIndexOperator.ANY)`` \n
Sets the condition for the data index. You can define an exact value or a value range.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('dat_index_optor', dat_index_optor, DataType.Enum, enums.DataIndexOperator))
self._core.io.write(f'SEARch:TRIGger:DPHY:DIDX:CONDition {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.DataIndexOperator:
"""
``SEARch:TRIGger:DPHY:DIDX:CONDition`` \n
Snippet: ``value: enums.DataIndexOperator = driver.search.trigger.dphy.didx.condition.get(search = 'abc')`` \n
Sets the condition for the data index. You can define an exact value or a value range.
:param search: EQUal | LTHan | LETHan | GTHan | GETHan | INRange | RANGe \n
- EQUal | NEQual | LTHan | LETHan | GTHan | GETHan: Equal, Not equal, Less than, Less or equal than, Greater Than, Greater or equal than. These conditions require one pattern to be set with the corresponding SEARch:TRIGger:DPHY:DIDX:MIN command.
- INRange = RANGe: In range: Set the minimum and maximum value using SEARch:TRIGger:DPHY:DIDX:MIN and SEARch:TRIGger:DPHY:DIDX:MAX.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:DPHY:DIDX:CONDition? {param}')
return Conversions.str_to_scalar_enum(response, enums.DataIndexOperator)