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 TconditionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("tcondition", core, parent)
[docs]
def set(self, search: str, operator_et: enums.ConditionOperator) -> None:
"""
``SEARch:TRIGger:USB:TCONdition`` \n
Snippet: ``driver.search.trigger.usb.tcondition.set(search = 'abc', operator_et = enums.ConditionOperator.EQUal)`` \n
Sets the operator to set a specific endpoint type (ET) or an ET range. The ET values are set with method
``RsRtx.search.trigger.usb.tmin.set()`` and method ``RsRtx.search.trigger.usb.tmax.set()`` .
:param operator_et: OFF | ANY | EQUal | NEQual | LTHan | LETHan | GTHan | GETHan | INRange | OORange \n
- OFF = ANY: The endpoint type is not relevant for the search condition.
- EQUal | NEQual | LTHan | LETHan | GTHan | GETHan: Equal, Not equal, Less than, Less than or equal, Greater than, Greater than or equal. These conditions require one ET value to be set using SEARch:TRIGger:USB:TMIN.
- INRange | OORange: In range, out of range. These conditions require a range of ET values to be set using SEARch:TRIGger:USB:TMIN and SEARch:TRIGger:USB:TMAX.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('operator_et', operator_et, DataType.Enum, enums.ConditionOperator))
self._core.io.write(f'SEARch:TRIGger:USB:TCONdition {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.ConditionOperator:
"""
``SEARch:TRIGger:USB:TCONdition`` \n
Snippet: ``value: enums.ConditionOperator = driver.search.trigger.usb.tcondition.get(search = 'abc')`` \n
Sets the operator to set a specific endpoint type (ET) or an ET range. The ET values are set with method
``RsRtx.search.trigger.usb.tmin.set()`` and method ``RsRtx.search.trigger.usb.tmax.set()`` .
:return: operator_et: OFF | ANY | EQUal | NEQual | LTHan | LETHan | GTHan | GETHan | INRange | OORange \n
- OFF = ANY: The endpoint type is not relevant for the search condition.
- EQUal | NEQual | LTHan | LETHan | GTHan | GETHan: Equal, Not equal, Less than, Less than or equal, Greater than, Greater than or equal. These conditions require one ET value to be set using SEARch:TRIGger:USB:TMIN.
- INRange | OORange: In range, out of range. These conditions require a range of ET values to be set using SEARch:TRIGger:USB:TMIN and SEARch:TRIGger:USB:TMAX.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:USB:TCONdition? {param}')
return Conversions.str_to_scalar_enum(response, enums.ConditionOperator)