Source code for rsrtx.Implementations.Search.Trigger.Pattern.State

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class StateCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, search: str, state: bool) -> None: """ ``SEARch:TRIGger:PATTern[:STATe]`` \n Snippet: ``driver.search.trigger.pattern.state.set(search = 'abc', state = False)`` \n Includes the search conditions for the selected trigger event type in the next search. :param search: Search definition :param state: OFF | ON """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('state', state, DataType.Boolean)) self._core.io.write_with_opc(f'SEARch:TRIGger:PATTern:STATe {param}'.rstrip())
[docs] def get(self, search: str) -> bool: """ ``SEARch:TRIGger:PATTern[:STATe]`` \n Snippet: ``value: bool = driver.search.trigger.pattern.state.get(search = 'abc')`` \n Includes the search conditions for the selected trigger event type in the next search. :param search: Search definition :return: state: OFF | ON """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:PATTern:STATe? {param}') return Conversions.str_to_bool(response)