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, mode: enums.RuntMode) -> None:
"""
``SEARch:TRIGger:RUNT:RANGe`` \n
Snippet: ``driver.search.trigger.runt.range.set(search = 'abc', mode = enums.RuntMode.ANY)`` \n
Selects how the time limit of the runt pulse is defined based on the runt width and delta (see method
``RsRtx.search.trigger.runt.width.set()`` and method ``RsRtx.search.trigger.runt.delta.set()`` ) .
:param search: Search definition
:param mode: ANY | LONGer | SHORter | WITHin | OUTSide \n
- ANY: Triggers on all runts fulfilling the level condition, without time limitation.
- LONGer: Triggers on runts longer than the given Runt width.
- SHORter: Triggers on runts shorter than the given Runt width.
- WITHin: Triggers if the runt length is inside a given time range. The range is defined by Runt width and ±Delta.
- OUTSide: Triggers if the runt length is outside a given time range. The range definition is the same as for Within range.
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('mode', mode, DataType.Enum, enums.RuntMode))
self._core.io.write_with_opc(f'SEARch:TRIGger:RUNT:RANGe {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.RuntMode:
"""
``SEARch:TRIGger:RUNT:RANGe`` \n
Snippet: ``value: enums.RuntMode = driver.search.trigger.runt.range.get(search = 'abc')`` \n
Selects how the time limit of the runt pulse is defined based on the runt width and delta (see method
``RsRtx.search.trigger.runt.width.set()`` and method ``RsRtx.search.trigger.runt.delta.set()`` ) .
:param search: Search definition
:return: mode: ANY | LONGer | SHORter | WITHin | OUTSide \n
- ANY: Triggers on all runts fulfilling the level condition, without time limitation.
- LONGer: Triggers on runts longer than the given Runt width.
- SHORter: Triggers on runts shorter than the given Runt width.
- WITHin: Triggers if the runt length is inside a given time range. The range is defined by Runt width and ±Delta.
- OUTSide: Triggers if the runt length is outside a given time range. The range definition is the same as for Within range.
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:RUNT:RANGe? {param}')
return Conversions.str_to_scalar_enum(response, enums.RuntMode)