from .......Internal.Core import Core
from .......Internal.CommandsGroup import CommandsGroup
from .......Internal import Conversions
from ....... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class RatioCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("ratio", core, parent)
[docs]
def set(self, span_rbw_ratio: int, math=repcap.Math.Default) -> None:
"""
``CALCulate:MATH<*>:FFT:BANDwidth[:RESolution]:RATio`` \n
Snippet: ``driver.calculate.math.fft.bandwidth.resolution.ratio.set(span_rbw_ratio = 1, math = repcap.Math.Default)`` \n
This command defines the ratio of span (Hz) / resolution bandwidth (Hz) .
:param span_rbw_ratio: ratio span / resolution bandwidth
:param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math')
"""
param = Conversions.decimal_value_to_str(span_rbw_ratio)
math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math)
self._core.io.write_with_opc(f'CALCulate:MATH{math_cmd_val}:FFT:BANDwidth:RESolution:RATio {param}')
[docs]
def get(self, math=repcap.Math.Default) -> int:
"""
``CALCulate:MATH<*>:FFT:BANDwidth[:RESolution]:RATio`` \n
Snippet: ``value: int = driver.calculate.math.fft.bandwidth.resolution.ratio.get(math = repcap.Math.Default)`` \n
This command defines the ratio of span (Hz) / resolution bandwidth (Hz) .
:param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math')
:return: span_rbw_ratio: ratio span / resolution bandwidth
"""
math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math)
response = self._core.io.query_str_with_opc(f'CALCulate:MATH{math_cmd_val}:FFT:BANDwidth:RESolution:RATio?')
return Conversions.str_to_int(response)