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 DirectionCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("direction", core, parent)
[docs]
def set(self, edge_cnt_dirct: enums.EdgeCntDirection, measurement=repcap.Measurement.Default, measDelay=repcap.MeasDelay.Default) -> None:
"""
``MEASurement<*>:AMPTime:DELay<*>:DIRection`` \n
Snippet: ``driver.measurement.ampTime.delay.direction.set(edge_cnt_dirct = enums.EdgeCntDirection.FRFI, measurement = repcap.Measurement.Default, measDelay = repcap.MeasDelay.Default)`` \n
Selects the direction for counting slopes for each source: from the beginning of the waveform, or from the end.
:param edge_cnt_dirct: FRFI - FRom FIrst, counting starts with the first edge of the waveform. FRLA - FRom LAst, counting starts with the last edge of the waveform.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:param measDelay: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Delay')
"""
param = Conversions.enum_scalar_to_str(edge_cnt_dirct, enums.EdgeCntDirection)
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
measDelay_cmd_val = self._cmd_group.get_repcap_cmd_value(measDelay, repcap.MeasDelay)
self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:DELay{measDelay_cmd_val}:DIRection {param}')
# noinspection PyTypeChecker
[docs]
def get(self, measurement=repcap.Measurement.Default, measDelay=repcap.MeasDelay.Default) -> enums.EdgeCntDirection:
"""
``MEASurement<*>:AMPTime:DELay<*>:DIRection`` \n
Snippet: ``value: enums.EdgeCntDirection = driver.measurement.ampTime.delay.direction.get(measurement = repcap.Measurement.Default, measDelay = repcap.MeasDelay.Default)`` \n
Selects the direction for counting slopes for each source: from the beginning of the waveform, or from the end.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:param measDelay: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Delay')
:return: edge_cnt_dirct: FRFI - FRom FIrst, counting starts with the first edge of the waveform. FRLA - FRom LAst, counting starts with the last edge of the waveform.
"""
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
measDelay_cmd_val = self._cmd_group.get_repcap_cmd_value(measDelay, repcap.MeasDelay)
response = self._core.io.query_str_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:DELay{measDelay_cmd_val}:DIRection?')
return Conversions.str_to_scalar_enum(response, enums.EdgeCntDirection)