from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AthresholdCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("athreshold", core, parent)
[docs]
def set(self, value: float, measurement=repcap.Measurement.Default) -> None:
"""
``MEASurement<*>:SPECtrum:ATHReshold`` \n
Snippet: ``driver.measurement.spectrum.athreshold.set(value = 1.0, measurement = repcap.Measurement.Default)`` \n
Defines an absolute threshold as an additional condition for the peak search. Only peaks that exceed the threshold are
detected. This setting is only available for spectrum waveforms. It is valid for cursor measurements, spectrum
measurements and peak search.
:param value: numeric value
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
"""
param = Conversions.decimal_value_to_str(value)
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:SPECtrum:ATHReshold {param}')
[docs]
def get(self, measurement=repcap.Measurement.Default) -> float:
"""
``MEASurement<*>:SPECtrum:ATHReshold`` \n
Snippet: ``value: float = driver.measurement.spectrum.athreshold.get(measurement = repcap.Measurement.Default)`` \n
Defines an absolute threshold as an additional condition for the peak search. Only peaks that exceed the threshold are
detected. This setting is only available for spectrum waveforms. It is valid for cursor measurements, spectrum
measurements and peak search.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: value: numeric value
"""
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}:SPECtrum:ATHReshold?')
return Conversions.str_to_float(response)