Source code for rsrtx.Implementations.Search.Trigger.Runt.Polarity

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

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

[docs] def set(self, search: str, polarity: enums.Edge) -> None: """ ``SEARch:TRIGger:RUNT:POLarity`` \n Snippet: ``driver.search.trigger.runt.polarity.set(search = 'abc', polarity = enums.Edge.EITHer)`` \n Indicates the polarity of a pulse, that is the direction of the first pulse slope. :param search: Search definition :param polarity: See 'Polarity parameter'. """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('polarity', polarity, DataType.Enum, enums.Edge)) self._core.io.write_with_opc(f'SEARch:TRIGger:RUNT:POLarity {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.Edge: """ ``SEARch:TRIGger:RUNT:POLarity`` \n Snippet: ``value: enums.Edge = driver.search.trigger.runt.polarity.get(search = 'abc')`` \n Indicates the polarity of a pulse, that is the direction of the first pulse slope. :param search: Search definition :return: polarity: See 'Polarity parameter'. """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:RUNT:POLarity? {param}') return Conversions.str_to_scalar_enum(response, enums.Edge)