from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class NdbDownCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("ndbDown", core, parent)
[docs]
def set(self, ndb_down: float, measurement=repcap.Measurement.Default) -> None:
"""
``MEASurement<*>:SPECtrum:NDBDown`` \n
Snippet: ``driver.measurement.spectrum.ndbDown.set(ndb_down = 1.0, measurement = repcap.Measurement.Default)`` \n
Defines the threshold until which the samples to the left and right of the peak value are analyzed in order to determine
the N dB down bandwidth.
:param ndb_down: 0 to 100
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
"""
param = Conversions.decimal_value_to_str(ndb_down)
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:NDBDown {param}')
[docs]
def get(self, measurement=repcap.Measurement.Default) -> float:
"""
``MEASurement<*>:SPECtrum:NDBDown`` \n
Snippet: ``value: float = driver.measurement.spectrum.ndbDown.get(measurement = repcap.Measurement.Default)`` \n
Defines the threshold until which the samples to the left and right of the peak value are analyzed in order to determine
the N dB down bandwidth.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: ndb_down: 0 to 100
"""
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:NDBDown?')
return Conversions.str_to_float(response)