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 RangeCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("range", core, parent)
[docs]
def set(self, search: str, timeout_mode: enums.TimeoutRange) -> None:
"""
``SEARch:TRIGger:TIMeout:RANGe`` \n
Snippet: ``driver.search.trigger.timeout.range.set(search = 'abc', timeout_mode = enums.TimeoutRange.EITHer)`` \n
Selects the relation of the signal level to the trigger level:
:param search: Search definition
:param timeout_mode: HIGH | LOW | EITHer \n
- HIGH: The signal level stays above the trigger level.
- LOW: The signal level stays below the trigger level.
- EITHer: The signal level stays above or below the trigger level.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('timeout_mode', timeout_mode, DataType.Enum, enums.TimeoutRange))
self._core.io.write_with_opc(f'SEARch:TRIGger:TIMeout:RANGe {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.TimeoutRange:
"""
``SEARch:TRIGger:TIMeout:RANGe`` \n
Snippet: ``value: enums.TimeoutRange = driver.search.trigger.timeout.range.get(search = 'abc')`` \n
Selects the relation of the signal level to the trigger level:
:param search: Search definition
:return: timeout_mode: HIGH | LOW | EITHer \n
- HIGH: The signal level stays above the trigger level.
- LOW: The signal level stays below the trigger level.
- EITHer: The signal level stays above or below the trigger level.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:TIMeout:RANGe? {param}')
return Conversions.str_to_scalar_enum(response, enums.TimeoutRange)