from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SymbolRateCls:
"""
| Commands in total: 4
| Subgroups: 0
| Direct child commands: 4
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("symbolRate", core, parent)
[docs]
def get_max(self) -> int:
"""
``[SOURce<HW>]:BBIN:SRATe:MAX`` \n
Snippet: ``value: int = driver.source.bbin.symbolRate.get_max()`` \n
Queries the maximum sample rate.
:return: dig_iq_hs_out_sr_max: integer Range: 1050E6 to 1250E6
"""
response = self._core.io.query_str('SOURce<HwInstance>:BBIN:SRATe:MAX?')
return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs]
def get_source(self) -> enums.BbinSampRateMode:
"""
``[SOURce<HW>]:BBIN:SRATe:SOURce`` \n
Snippet: ``value: enums.BbinSampRateMode = driver.source.bbin.symbolRate.get_source()`` \n
Selects whether the sample rate is estimated based on the digital input signal or is a user-defined value.
:return: source: DIN | HSDin | USER USER Enabled for method ``RsSmw.source.bbin.digital.interface()`` DIN. Set the value with method ``RsSmw.source.bbin.symbolRate.actual()`` . DIN Enabled for method ``RsSmw.source.bbin.digital.source()`` CODER1 | CODER2. Estimates the sample rate based on the digital input signal. HSDin Enabled for method ``RsSmw.source.bbin.digital.interface()`` HSDin. ``*RST``: USER (R&S SMW-B10) /HSDin (R&S SMW-B9)
"""
response = self._core.io.query_str('SOURce<HwInstance>:BBIN:SRATe:SOURce?')
return Conversions.str_to_scalar_enum(response, enums.BbinSampRateMode)
[docs]
def set_source(self, source: enums.BbinSampRateMode) -> None:
"""
``[SOURce<HW>]:BBIN:SRATe:SOURce`` \n
Snippet: ``driver.source.bbin.symbolRate.set_source(source = enums.BbinSampRateMode.DIN)`` \n
Selects whether the sample rate is estimated based on the digital input signal or is a user-defined value.
:param source: DIN | HSDin | USER USER Enabled for method ``RsSmw.source.bbin.digital.interface()`` DIN. Set the value with method ``RsSmw.source.bbin.symbolRate.actual()`` . DIN Enabled for method ``RsSmw.source.bbin.digital.source()`` CODER1 | CODER2. Estimates the sample rate based on the digital input signal. HSDin Enabled for method ``RsSmw.source.bbin.digital.interface()`` HSDin. ``*RST``: USER (R&S SMW-B10) /HSDin (R&S SMW-B9)
"""
param = Conversions.enum_scalar_to_str(source, enums.BbinSampRateMode)
self._core.io.write(f'SOURce<HwInstance>:BBIN:SRATe:SOURce {param}')
[docs]
def get_sum(self) -> int:
"""
``[SOURce<HW>]:BBIN:SRATe:SUM`` \n
Snippet: ``value: int = driver.source.bbin.symbolRate.get_sum()`` \n
Queries the sum of the sample rates of all active channels.
:return: dig_iq_hs_out_sr_sum: integer Range: 0 to depends on settings
"""
response = self._core.io.query_str('SOURce<HwInstance>:BBIN:SRATe:SUM?')
return Conversions.str_to_int(response)
[docs]
def get_actual(self) -> float:
"""
``[SOURce<HW>]:BBIN:SRATe:[ACTual]`` \n
Snippet: ``value: float = driver.source.bbin.symbolRate.get_actual()`` \n
Sets the sample rate of the external digital baseband signal.
:return: actual: float Range: 25E6 to max (depends on options) max = 200E6 (R&S SMW-B10) max = 250E6 (R&S SMW-B9) max = 100E6 | 200E6 (for method ``RsSmw.source.bbin.digital.source()`` FADER1 | FADER2) See also 'Supported digital interfaces and system configuration'.
"""
response = self._core.io.query_str('SOURce<HwInstance>:BBIN:SRATe:ACTual?')
return Conversions.str_to_float(response)
[docs]
def set_actual(self, actual: float) -> None:
"""
``[SOURce<HW>]:BBIN:SRATe:[ACTual]`` \n
Snippet: ``driver.source.bbin.symbolRate.set_actual(actual = 1.0)`` \n
Sets the sample rate of the external digital baseband signal.
:param actual: float Range: 25E6 to max (depends on options) max = 200E6 (R&S SMW-B10) max = 250E6 (R&S SMW-B9) max = 100E6 | 200E6 (for method ``RsSmw.source.bbin.digital.source()`` FADER1 | FADER2) See also 'Supported digital interfaces and system configuration'.
"""
param = Conversions.decimal_value_to_str(actual)
self._core.io.write(f'SOURce<HwInstance>:BBIN:SRATe:ACTual {param}')