Source code for rsrtx.Implementations.Search.Trigger.Level.Value

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

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

[docs] def set(self, key: str, signal_source: enums.SignalSource, value: float) -> None: """ ``SEARch:TRIGger:LEVel[:VALue]`` \n Snippet: ``driver.search.trigger.level.value.set(key = 'abc', signal_source = enums.SignalSource.AJ1, value = 1.0)`` \n Sets the voltage of the trigger level that is used to determine other parameters. :param key: String with the name of the search :param signal_source: Source of the search, see 'Waveform parameter' :param value: Voltage value """ param = ArgSingleList().compose_cmd_string(ArgSingle('key', key, DataType.String), ArgSingle('signal_source', signal_source, DataType.Enum, enums.SignalSource), ArgSingle('value', value, DataType.Float)) self._core.io.write_with_opc(f'SEARch:TRIGger:LEVel:VALue {param}'.rstrip())
[docs] def get(self, key: str, signal_source: enums.SignalSource) -> float: """ ``SEARch:TRIGger:LEVel[:VALue]`` \n Snippet: ``value: float = driver.search.trigger.level.value.get(key = 'abc', signal_source = enums.SignalSource.AJ1)`` \n Sets the voltage of the trigger level that is used to determine other parameters. :param key: String with the name of the search :param signal_source: Source of the search, see 'Waveform parameter' :return: value: Voltage value """ 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:VALue? {param}'.rstrip()) return Conversions.str_to_float(response)