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 PslopeCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("pslope", core, parent)
[docs]
def set(self, pulses_slope: enums.Edge, measurement=repcap.Measurement.Default) -> None:
"""
``MEASurement<*>:AMPTime:PSLope`` \n
Snippet: ``driver.measurement.ampTime.pslope.set(pulses_slope = enums.Edge.EITHer, measurement = repcap.Measurement.Default)`` \n
Sets the first slope of the pulses to be counted. The setting is only relevant for pulse count measurement
(MEASurement<m>:MAIN PULCnt or MEASurement<m>:ADDitional PULCnt,ON) .
:param pulses_slope: Count either positive or negative pulses, or both.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
"""
param = Conversions.enum_scalar_to_str(pulses_slope, enums.Edge)
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:PSLope {param}')
# noinspection PyTypeChecker
[docs]
def get(self, measurement=repcap.Measurement.Default) -> enums.Edge:
"""
``MEASurement<*>:AMPTime:PSLope`` \n
Snippet: ``value: enums.Edge = driver.measurement.ampTime.pslope.get(measurement = repcap.Measurement.Default)`` \n
Sets the first slope of the pulses to be counted. The setting is only relevant for pulse count measurement
(MEASurement<m>:MAIN PULCnt or MEASurement<m>:ADDitional PULCnt,ON) .
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: pulses_slope: Count either positive or negative pulses, or both.
"""
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:PSLope?')
return Conversions.str_to_scalar_enum(response, enums.Edge)