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 NpfSlopeCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("npfSlope", core, parent)
[docs]
def set(self, period_nslope: enums.SignalSlope, measurement=repcap.Measurement.Default) -> None:
"""
``MEASurement<*>:AMPTime:NPFSlope`` \n
Snippet: ``driver.measurement.ampTime.npfSlope.set(period_nslope = enums.SignalSlope.EITHer, measurement = repcap.Measurement.Default)`` \n
Selects the slope direction for N-Period measurements.
:param period_nslope: FIRSt | POSitive | NEGative \n
- POSitive | NEGative: Measures the time between rising or falling edges, respectively.
- FIRSt: Time is measured either between rising edges or between falling edges. The first edge is taken for the measurement. In single measurements, it works the same way as Either.Only available for analog measurement sources.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
"""
param = Conversions.enum_scalar_to_str(period_nslope, enums.SignalSlope)
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:NPFSlope {param}')
# noinspection PyTypeChecker
[docs]
def get(self, measurement=repcap.Measurement.Default) -> enums.SignalSlope:
"""
``MEASurement<*>:AMPTime:NPFSlope`` \n
Snippet: ``value: enums.SignalSlope = driver.measurement.ampTime.npfSlope.get(measurement = repcap.Measurement.Default)`` \n
Selects the slope direction for N-Period measurements.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: period_nslope: FIRSt | POSitive | NEGative \n
- POSitive | NEGative: Measures the time between rising or falling edges, respectively.
- FIRSt: Time is measured either between rising edges or between falling edges. The first edge is taken for the measurement. In single measurements, it works the same way as Either.Only available for analog measurement sources.
"""
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
response = self._core.io.query_str_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:NPFSlope?')
return Conversions.str_to_scalar_enum(response, enums.SignalSlope)