Source code for rsrtx.Implementations.Search.Trigger.Window.TimeRange

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

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

[docs] def set(self, search: str, time_range_mode: enums.TriggerSearchRangeMode) -> None: """ ``SEARch:TRIGger:WINDow:TIMerange`` \n Snippet: ``driver.search.trigger.window.timeRange.set(search = 'abc', time_range_mode = enums.TriggerSearchRangeMode.LONGer)`` \n Selects how the time limit of the window is defined. Time conditioning is available for the vertical conditions WITHin and OUTSide (see method ``RsRtx.search.trigger.window.range.set()`` ) . :param search: Search definition :param time_range_mode: WITHin | OUTSide | SHORter | LONGer \n - WITHin: Triggers if the signal stays inside or outside the vertical window limits at least for the time Width - Delta and for Width + Delta at the most. - OUTSide: Outside is the opposite definition of Within. The instrument triggers if the signal stays inside or outside the vertical window limits for a time shorter than Width - Delta or longer than Width + Delta. - SHORter: Triggers if the signal crosses vertical limits before the specified Width time is reached. - LONGer: Triggers if the signal crosses vertical limits before the specified Width time is reached. """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('time_range_mode', time_range_mode, DataType.Enum, enums.TriggerSearchRangeMode)) self._core.io.write_with_opc(f'SEARch:TRIGger:WINDow:TIMerange {param}'.rstrip())
# noinspection PyTypeChecker
[docs] def get(self, search: str) -> enums.TriggerSearchRangeMode: """ ``SEARch:TRIGger:WINDow:TIMerange`` \n Snippet: ``value: enums.TriggerSearchRangeMode = driver.search.trigger.window.timeRange.get(search = 'abc')`` \n Selects how the time limit of the window is defined. Time conditioning is available for the vertical conditions WITHin and OUTSide (see method ``RsRtx.search.trigger.window.range.set()`` ) . :param search: Search definition :return: time_range_mode: WITHin | OUTSide | SHORter | LONGer \n - WITHin: Triggers if the signal stays inside or outside the vertical window limits at least for the time Width - Delta and for Width + Delta at the most. - OUTSide: Outside is the opposite definition of Within. The instrument triggers if the signal stays inside or outside the vertical window limits for a time shorter than Width - Delta or longer than Width + Delta. - SHORter: Triggers if the signal crosses vertical limits before the specified Width time is reached. - LONGer: Triggers if the signal crosses vertical limits before the specified Width time is reached. """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str_with_opc(f'SEARch:TRIGger:WINDow:TIMerange? {param}') return Conversions.str_to_scalar_enum(response, enums.TriggerSearchRangeMode)