Source code for rsrtx.Implementations.Search.Trigger.Level.Noise.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
from ...... import enums


# 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, key: str, signal_source: enums.SignalSource, state: bool) -> None: """ ``SEARch:TRIGger:LEVel:NOISe[:STATe]`` \n Snippet: ``driver.search.trigger.level.noise.state.set(key = 'abc', signal_source = enums.SignalSource.AJ1, state = False)`` \n If enabled, the noise reject settings for the waveform are considered for the search. :param key: String with the name of the search :param signal_source: Source of the search, see 'Waveform parameter' :param state: OFF | ON """ param = ArgSingleList().compose_cmd_string(ArgSingle('key', key, DataType.String), ArgSingle('signal_source', signal_source, DataType.Enum, enums.SignalSource), ArgSingle('state', state, DataType.Boolean)) self._core.io.write_with_opc(f'SEARch:TRIGger:LEVel:NOISe:STATe {param}'.rstrip())
[docs] def get(self, key: str, signal_source: enums.SignalSource) -> bool: """ ``SEARch:TRIGger:LEVel:NOISe[:STATe]`` \n Snippet: ``value: bool = driver.search.trigger.level.noise.state.get(key = 'abc', signal_source = enums.SignalSource.AJ1)`` \n If enabled, the noise reject settings for the waveform are considered for the search. :param key: String with the name of the search :param signal_source: Source of the search, see 'Waveform parameter' :return: state: OFF | ON """ param = ArgSingleList().compose_cmd_string(ArgSingle('key', key, DataType.String), ArgSingle('signal_source', signal_source, DataType.Enum, enums.SignalSource)) response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:LEVel:NOISe:STATe? {param}'.rstrip()) return Conversions.str_to_bool(response)