Source code for rsrtx.Implementations.Search.Trigger.Pattern.Timeout.Mode

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 ModeCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("mode", core, parent)

[docs] def set(self, search: str, timeout_mode: enums.TimeoutRange) -> None: """ ``SEARch:TRIGger:PATTern:TIMeout:MODE`` \n Snippet: ``driver.search.trigger.pattern.timeout.mode.set(search = 'abc', timeout_mode = enums.TimeoutRange.EITHer)`` \n Defines the condition for the timeout. :param search: String with the name of the search :param timeout_mode: HIGH | LOW | EITHer \n - EITHer: High or low, the pattern remains unchanged for the given time. """ 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:PATTern:TIMeout:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.TimeoutRange: """ ``SEARch:TRIGger:PATTern:TIMeout:MODE`` \n Snippet: ``value: enums.TimeoutRange = driver.search.trigger.pattern.timeout.mode.get(search = 'abc')`` \n Defines the condition for the timeout. :param search: String with the name of the search :return: timeout_mode: HIGH | LOW | EITHer \n - EITHer: High or low, the pattern remains unchanged for the given time. """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:PATTern:TIMeout:MODE? {param}') return Conversions.str_to_scalar_enum(response, enums.TimeoutRange)