from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class TimeCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("time", core, parent)
[docs]
def set(self, time_range_mode: enums.TriggerSearchRangeMode, trigger=repcap.Trigger.Default) -> None:
"""
``TRIGger<*>:WINDow:TIME`` \n
Snippet: ``driver.trigger.window.time.set(time_range_mode = enums.TriggerSearchRangeMode.LONGer, trigger = repcap.Trigger.Default)`` \n
Defines the limit of the window in relation to the time specified using method ``RsRtx.trigger.window.width.set()`` and
method ``RsRtx.trigger.window.delta.set()`` . Time conditioning is available for method
``RsRtx.trigger.window.range.set()`` = WITHin and OUTSide.
: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 trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
"""
param = Conversions.enum_scalar_to_str(time_range_mode, enums.TriggerSearchRangeMode)
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
self._core.io.write_with_opc(f'TRIGger{trigger_cmd_val}:WINDow:TIME {param}')
# noinspection PyTypeChecker
[docs]
def get(self, trigger=repcap.Trigger.Default) -> enums.TriggerSearchRangeMode:
"""
``TRIGger<*>:WINDow:TIME`` \n
Snippet: ``value: enums.TriggerSearchRangeMode = driver.trigger.window.time.get(trigger = repcap.Trigger.Default)`` \n
Defines the limit of the window in relation to the time specified using method ``RsRtx.trigger.window.width.set()`` and
method ``RsRtx.trigger.window.delta.set()`` . Time conditioning is available for method
``RsRtx.trigger.window.range.set()`` = WITHin and OUTSide.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
: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.
"""
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
response = self._core.io.query_str_with_opc(f'TRIGger{trigger_cmd_val}:WINDow:TIME?')
return Conversions.str_to_scalar_enum(response, enums.TriggerSearchRangeMode)