from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ......Internal.StructBase import StructBase
from ......Internal.ArgStruct import ArgStruct
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CarrierCls:
"""
| Commands in total: 8
| Subgroups: 1
| Direct child commands: 5
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("carrier", core, parent)
@property
def listPy(self):
"""
| Commands in total: 3
| Subgroups: 3
| Direct child commands: 0
"""
if not hasattr(self, '_listPy'):
from .ListPy import ListPyCls
self._listPy = ListPyCls(self._core, self._cmd_group)
return self._listPy
[docs]
def get_count(self) -> int:
"""
``[SOURce<HW>]:BB:MCCW:CARRier:COUNt`` \n
Snippet: ``value: int = driver.source.bb.mccw.carrier.get_count()`` \n
Sets the number of carriers in the multi carrier CW signal.
:return: count: integer Range: 1 to 160001
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:MCCW:CARRier:COUNt?')
return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs]
class PhaseStruct(StructBase):
"""
Structure for reading output parameters. Fields: \n
- Carrier_Index: int: integer Range: 0 to lastCarrier
- Phase: float: float Range: 0 to 359.99, Unit: DEG
"""
__meta_args_list = [
ArgStruct.scalar_int('Carrier_Index'),
ArgStruct.scalar_float('Phase')]
def __init__(self):
StructBase.__init__(self, self)
self.Carrier_Index: int=None
self.Phase: float=None
[docs]
def get_phase(self) -> PhaseStruct:
"""
``[SOURce<HW>]:BB:MCCW:CARRier:PHASe`` \n
Snippet: ``value: PhaseStruct = driver.source.bb.mccw.carrier.get_phase()`` \n
For disabled optimization of the crest factor, sets the start phase of the selected carrier.
:return: structure: for return value, see the help for PhaseStruct structure arguments.
"""
return self._core.io.query_struct('SOURce<HwInstance>:BB:MCCW:CARRier:PHASe?', self.__class__.PhaseStruct())
# noinspection PyTypeChecker
[docs]
class PowerStruct(StructBase):
"""
Structure for reading output parameters. Fields: \n
- Carrier_Index: int: integer Range: 0 to lastCarrier
- Power: float: float Range: -80 to 0
"""
__meta_args_list = [
ArgStruct.scalar_int('Carrier_Index'),
ArgStruct.scalar_float('Power')]
def __init__(self):
StructBase.__init__(self, self)
self.Carrier_Index: int=None
self.Power: float=None
[docs]
def get_power(self) -> PowerStruct:
"""
``[SOURce<HW>]:BB:MCCW:CARRier:POWer`` \n
Snippet: ``value: PowerStruct = driver.source.bb.mccw.carrier.get_power()`` \n
Sets the power of the selected carrier.
:return: structure: for return value, see the help for PowerStruct structure arguments.
"""
return self._core.io.query_struct('SOURce<HwInstance>:BB:MCCW:CARRier:POWer?', self.__class__.PowerStruct())
[docs]
def get_spacing(self) -> float:
"""
``[SOURce<HW>]:BB:MCCW:CARRier:SPACing`` \n
Snippet: ``value: float = driver.source.bb.mccw.carrier.get_spacing()`` \n
Sets the carrier spacing.
:return: spacing: float Value range depends on the available bandwidth and the number of carriers, see 'Cross-reference between total bandwidth, carrier spacing, and number of carriers'. Range: 0 to depends on options, for example 120E6 (R&S SMW-B10)
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:MCCW:CARRier:SPACing?')
return Conversions.str_to_float(response)
# noinspection PyTypeChecker
[docs]
class StateStruct(StructBase):
"""
Structure for reading output parameters. Fields: \n
- Carrier_Index: int: integer Range: 0 to lastCarrier
- State: bool: 1 | ON | 0| OFF
"""
__meta_args_list = [
ArgStruct.scalar_int('Carrier_Index'),
ArgStruct.scalar_bool('State')]
def __init__(self):
StructBase.__init__(self, self)
self.Carrier_Index: int=None
self.State: bool=None
[docs]
def get_state(self) -> StateStruct:
"""
``[SOURce<HW>]:BB:MCCW:CARRier:STATe`` \n
Snippet: ``value: StateStruct = driver.source.bb.mccw.carrier.get_state()`` \n
Switches the selected carrier on or off.
:return: structure: for return value, see the help for StateStruct structure arguments.
"""
return self._core.io.query_struct('SOURce<HwInstance>:BB:MCCW:CARRier:STATe?', self.__class__.StateStruct())
def clone(self) -> 'CarrierCls':
"""
Clones the group by creating new object from it and its whole existing subgroups.
Also copies all the existing default Repeated Capabilities setting,
which you can change independently without affecting the original group.
"""
new_group = CarrierCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group