Source code for rsrtx.Implementations.Search.Trigger.Glitch.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:GLITch:POLarity`` \n Snippet: ``driver.search.trigger.glitch.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:GLITch:POLarity {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.Edge: """ ``SEARch:TRIGger:GLITch:POLarity`` \n Snippet: ``value: enums.Edge = driver.search.trigger.glitch.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:GLITch:POLarity? {param}') return Conversions.str_to_scalar_enum(response, enums.Edge)