from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ClippingCls:
"""
| Commands in total: 3
| Subgroups: 0
| Direct child commands: 3
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("clipping", core, parent)
[docs]
def get_level(self) -> int:
"""
``[SOURce<HW>]:BB:BTOoth:CLIPping:LEVel`` \n
Snippet: ``value: int = driver.source.bb.btooth.clipping.get_level()`` \n
Sets the limit for level clipping. This value indicates at what point the signal is clipped. It is specified as a
percentage, relative to the highest level. 100% indicates that clipping does not take place.
:return: level: integer Range: 1 to 100, Unit: PCT
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:BTOoth:CLIPping:LEVel?')
return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs]
def get_mode(self) -> enums.ClipMode:
"""
``[SOURce<HW>]:BB:BTOoth:CLIPping:MODE`` \n
Snippet: ``value: enums.ClipMode = driver.source.bb.btooth.clipping.get_mode()`` \n
The command sets the method for level clipping.
:return: mode: VECTor | SCALar VECTor The reference level is the amplitude i+jq. SCALar The reference level is the absolute maximum of the I and Q values.
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:BTOoth:CLIPping:MODE?')
return Conversions.str_to_scalar_enum(response, enums.ClipMode)
[docs]
def get_state(self) -> bool:
"""
``[SOURce<HW>]:BB:BTOoth:CLIPping:STATe`` \n
Snippet: ``value: bool = driver.source.bb.btooth.clipping.get_state()`` \n
Activates level clipping. The value is defined with the command BB:BTO:CLIPping:LEVel, the mode of calculation with the
command BB:BTO:CLIPping:MODE.
:return: state: 1 | ON | 0| OFF
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:BTOoth:CLIPping:STATe?')
return Conversions.str_to_bool(response)