Source code for rsrtx.Implementations.Search.Trigger.Pattern.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, mode: enums.PatternMode) -> None: """ ``SEARch:TRIGger:PATTern:MODE`` \n Snippet: ``driver.search.trigger.pattern.mode.set(search = 'abc', mode = enums.PatternMode.OFF)`` \n Adds additional time limitation to the pattern definition. :param search: String with the name of the search :param mode: OFF | TIMeout | WIDTh \n - OFF: No time limitation. The event is found if the pattern condition is fulfilled. - TIMeout: Defines how long the result of the pattern condition stays high or low. The duration of the timeout is defined using SEARch:TRIGger:PATTern:TIMeout[:TIME] The result state is defined using SEARch:TRIGger:PATTern:TIMeout:MODE. - WIDTh: Defines a time range for keeping up the true result of the pattern condition. The range is defined using SEARch:TRIGger:PATTern:WIDTh:RANGe. """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('mode', mode, DataType.Enum, enums.PatternMode)) self._core.io.write_with_opc(f'SEARch:TRIGger:PATTern:MODE {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.PatternMode: """ ``SEARch:TRIGger:PATTern:MODE`` \n Snippet: ``value: enums.PatternMode = driver.search.trigger.pattern.mode.get(search = 'abc')`` \n Adds additional time limitation to the pattern definition. :param search: String with the name of the search :return: mode: OFF | TIMeout | WIDTh \n - OFF: No time limitation. The event is found if the pattern condition is fulfilled. - TIMeout: Defines how long the result of the pattern condition stays high or low. The duration of the timeout is defined using SEARch:TRIGger:PATTern:TIMeout[:TIME] The result state is defined using SEARch:TRIGger:PATTern:TIMeout:MODE. - WIDTh: Defines a time range for keeping up the true result of the pattern condition. The range is defined using SEARch:TRIGger:PATTern:WIDTh:RANGe. """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:PATTern:MODE? {param}') return Conversions.str_to_scalar_enum(response, enums.PatternMode)