from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class PowerCls:
"""
| Commands in total: 46
| Subgroups: 8
| Direct child commands: 11
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("power", core, parent)
@property
def alc(self):
"""
| Commands in total: 8
| Subgroups: 1
| Direct child commands: 7
"""
if not hasattr(self, '_alc'):
from .Alc import AlcCls
self._alc = AlcCls(self._core, self._cmd_group)
return self._alc
@property
def attenuation(self):
"""
| Commands in total: 6
| Subgroups: 3
| Direct child commands: 3
"""
if not hasattr(self, '_attenuation'):
from .Attenuation import AttenuationCls
self._attenuation = AttenuationCls(self._core, self._cmd_group)
return self._attenuation
@property
def emf(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_emf'):
from .Emf import EmfCls
self._emf = EmfCls(self._core, self._cmd_group)
return self._emf
@property
def level(self):
"""
| Commands in total: 5
| Subgroups: 2
| Direct child commands: 0
"""
if not hasattr(self, '_level'):
from .Level import LevelCls
self._level = LevelCls(self._core, self._cmd_group)
return self._level
@property
def limit(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_limit'):
from .Limit import LimitCls
self._limit = LimitCls(self._core, self._cmd_group)
return self._limit
@property
def range(self):
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
if not hasattr(self, '_range'):
from .Range import RangeCls
self._range = RangeCls(self._core, self._cmd_group)
return self._range
@property
def spc(self):
"""
| Commands in total: 10
| Subgroups: 2
| Direct child commands: 8
"""
if not hasattr(self, '_spc'):
from .Spc import SpcCls
self._spc = SpcCls(self._core, self._cmd_group)
return self._spc
@property
def step(self):
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
if not hasattr(self, '_step'):
from .Step import StepCls
self._step = StepCls(self._core, self._cmd_group)
return self._step
[docs]
def get_aattenuation(self) -> float:
"""
``[SOURce<HW>]:POWer:AATTenuation`` \n
Snippet: ``value: float = driver.source.power.get_aattenuation()`` \n
Queries the currently active level attenuation.
:return: active_att: float Range: 0 to 110
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:AATTenuation?')
return Conversions.str_to_float(response)
[docs]
def get_iq_pep(self) -> float:
"""
``[SOURce<HW>]:POWer:IQPep`` \n
Snippet: ``value: float = driver.source.power.get_iq_pep()`` \n
No help available
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:IQPep?')
return Conversions.str_to_float(response)
# noinspection PyTypeChecker
[docs]
def get_lbehaviour(self) -> enums.PowLevBehaviour:
"""
``[SOURce<HW>]:POWer:LBEHaviour`` \n
Snippet: ``value: enums.PowLevBehaviour = driver.source.power.get_lbehaviour()`` \n
Selects the level behavior at the RF output over time.
:return: behaviour: AUTO | UNINterrupted | MONotone | CVSWr | CPHase UNINterrupted | MONotone Do not use the uninterrupted level settings and strictly monotone modes in combination with the high-quality optimization mode (see method ``RsSmw.source.bb.impairment.optimization.mode()`` ) CVSWr Constant VSWR CPHase Continuous phase CONStant Constant phase
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:LBEHaviour?')
return Conversions.str_to_scalar_enum(response, enums.PowLevBehaviour)
[docs]
def set_lbehaviour(self, behaviour: enums.PowLevBehaviour) -> None:
"""
``[SOURce<HW>]:POWer:LBEHaviour`` \n
Snippet: ``driver.source.power.set_lbehaviour(behaviour = enums.PowLevBehaviour.AUTO)`` \n
Selects the level behavior at the RF output over time.
:param behaviour: AUTO | UNINterrupted | MONotone | CVSWr | CPHase UNINterrupted | MONotone Do not use the uninterrupted level settings and strictly monotone modes in combination with the high-quality optimization mode (see method ``RsSmw.source.bb.impairment.optimization.mode()`` ) CVSWr Constant VSWR CPHase Continuous phase CONStant Constant phase
"""
param = Conversions.enum_scalar_to_str(behaviour, enums.PowLevBehaviour)
self._core.io.write(f'SOURce<HwInstance>:POWer:LBEHaviour {param}')
# noinspection PyTypeChecker
[docs]
def get_lmode(self) -> enums.PowLevMode:
"""
``[SOURce<HW>]:POWer:LMODe`` \n
Snippet: ``value: enums.PowLevMode = driver.source.power.get_lmode()`` \n
Sets the RF level mode.
:return: lev_mode: NORMal | LOWNoise | LOWDistortion NORMal Supplies the RF signal with the standard power level of the instrument. LOWNoise Supplies a very low noise sinewave signal. LOWDistortion Supplies a very pure sinewave signal.
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:LMODe?')
return Conversions.str_to_scalar_enum(response, enums.PowLevMode)
[docs]
def set_lmode(self, lev_mode: enums.PowLevMode) -> None:
"""
``[SOURce<HW>]:POWer:LMODe`` \n
Snippet: ``driver.source.power.set_lmode(lev_mode = enums.PowLevMode.LOWDistortion)`` \n
Sets the RF level mode.
:param lev_mode: NORMal | LOWNoise | LOWDistortion NORMal Supplies the RF signal with the standard power level of the instrument. LOWNoise Supplies a very low noise sinewave signal. LOWDistortion Supplies a very pure sinewave signal.
"""
param = Conversions.enum_scalar_to_str(lev_mode, enums.PowLevMode)
self._core.io.write(f'SOURce<HwInstance>:POWer:LMODe {param}')
[docs]
def get_manual(self) -> float:
"""
``[SOURce<HW>]:POWer:MANual`` \n
Snippet: ``value: float = driver.source.power.get_manual()`` \n
Sets the level for the subsequent sweep step if method ``RsSmw.source.sweep.power.mode()`` . Use a separate command for
each sweep step.
:return: manual: float You can select any level within the setting range, where: STARt is set with method ``RsSmw.source.power.start()`` STOP is set with method ``RsSmw.source.power.stop()`` OFFSet is set with method ``RsSmw.source.power.level.immediate.offset()`` Range: (STARt + OFFSet) to (STOP + OFFSet) , Unit: dBm
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:MANual?')
return Conversions.str_to_float(response)
[docs]
def set_manual(self, manual: float) -> None:
"""
``[SOURce<HW>]:POWer:MANual`` \n
Snippet: ``driver.source.power.set_manual(manual = 1.0)`` \n
Sets the level for the subsequent sweep step if method ``RsSmw.source.sweep.power.mode()`` . Use a separate command for
each sweep step.
:param manual: float You can select any level within the setting range, where: STARt is set with method ``RsSmw.source.power.start()`` STOP is set with method ``RsSmw.source.power.stop()`` OFFSet is set with method ``RsSmw.source.power.level.immediate.offset()`` Range: (STARt + OFFSet) to (STOP + OFFSet) , Unit: dBm
"""
param = Conversions.decimal_value_to_str(manual)
self._core.io.write(f'SOURce<HwInstance>:POWer:MANual {param}')
# noinspection PyTypeChecker
[docs]
def get_mode(self) -> enums.LfFreqMode:
"""
``[SOURce<HW>]:POWer:MODE`` \n
Snippet: ``value: enums.LfFreqMode = driver.source.power.get_mode()`` \n
Selects the operating mode of the instrument to set the output level.
:return: mode: CW | FIXed | SWEep CW | FIXed Operates at a constant level. CW and FIXed are synonyms. To set the output level value, use the command method ``RsSmw.source.power.level.immediate.amplitude()`` . SWEep Sets sweep mode. Set the range and current level with the commands: method ``RsSmw.source.power.start()`` and method ``RsSmw.source.power.stop()`` , method ``RsSmw.source.power.manual()`` .
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:MODE?')
return Conversions.str_to_scalar_enum(response, enums.LfFreqMode)
[docs]
def set_mode(self, mode: enums.LfFreqMode) -> None:
"""
``[SOURce<HW>]:POWer:MODE`` \n
Snippet: ``driver.source.power.set_mode(mode = enums.LfFreqMode.CW)`` \n
Selects the operating mode of the instrument to set the output level.
:param mode: CW | FIXed | SWEep CW | FIXed Operates at a constant level. CW and FIXed are synonyms. To set the output level value, use the command method ``RsSmw.source.power.level.immediate.amplitude()`` . SWEep Sets sweep mode. Set the range and current level with the commands: method ``RsSmw.source.power.start()`` and method ``RsSmw.source.power.stop()`` , method ``RsSmw.source.power.manual()`` .
"""
param = Conversions.enum_scalar_to_str(mode, enums.LfFreqMode)
self._core.io.write(f'SOURce<HwInstance>:POWer:MODE {param}')
[docs]
def get_pep(self) -> float:
"""
``[SOURce<HW>]:POWer:PEP`` \n
Snippet: ``value: float = driver.source.power.get_pep()`` \n
Queries the PEP 'Peak Envelope Power) of digital modulation or digital standards at the RF output. This value corresponds
to the level specification, displayed in the status bar (header) .
:return: pep: float
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:PEP?')
return Conversions.str_to_float(response)
[docs]
def get_power(self) -> float:
"""
``[SOURce<HW>]:POWer:POWer`` \n
Snippet: ``value: float = driver.source.power.get_power()`` \n
Sets the level at the RF output connector. This value does not consider a specified offset. The command method
``RsSmw.source.power.level.immediate.amplitude()`` sets the level of the 'Level' display, that means the level containing
offset. See 'Displayed RF frequency and level values with downstream instruments'.
:return: power: float Level at the RF output, without level offset Range: See specifications document. , Unit: dBm
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:POWer?')
return Conversions.str_to_float(response)
[docs]
def set_power(self, power: float) -> None:
"""
``[SOURce<HW>]:POWer:POWer`` \n
Snippet: ``driver.source.power.set_power(power = 1.0)`` \n
Sets the level at the RF output connector. This value does not consider a specified offset. The command method
``RsSmw.source.power.level.immediate.amplitude()`` sets the level of the 'Level' display, that means the level containing
offset. See 'Displayed RF frequency and level values with downstream instruments'.
:param power: float Level at the RF output, without level offset Range: See specifications document. , Unit: dBm
"""
param = Conversions.decimal_value_to_str(power)
self._core.io.write(f'SOURce<HwInstance>:POWer:POWer {param}')
[docs]
def get_start(self) -> float:
"""
``[SOURce<HW>]:POWer:STARt`` \n
Snippet: ``value: float = driver.source.power.get_start()`` \n
Sets the RF start/stop level in sweep mode.
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:STARt?')
return Conversions.str_to_float(response)
[docs]
def set_start(self, start: float) -> None:
"""
``[SOURce<HW>]:POWer:STARt`` \n
Snippet: ``driver.source.power.set_start(start = 1.0)`` \n
Sets the RF start/stop level in sweep mode.
:param start: float Sets the setting range calculated as follows: (Level_min + OFFSet) to (Level_max + OFFSet) Where the values are set with the commands: method ``RsSmw.source.power.level.immediate.offset()`` method ``RsSmw.source.power.start()`` method ``RsSmw.source.power.stop()`` Range: Minimum level to maximum level , Unit: dBm
"""
param = Conversions.decimal_value_to_str(start)
self._core.io.write(f'SOURce<HwInstance>:POWer:STARt {param}')
[docs]
def get_stop(self) -> float:
"""
``[SOURce<HW>]:POWer:STOP`` \n
Snippet: ``value: float = driver.source.power.get_stop()`` \n
Sets the RF start/stop level in sweep mode.
:return: stop: float Sets the setting range calculated as follows: (Level_min + OFFSet) to (Level_max + OFFSet) Where the values are set with the commands: method ``RsSmw.source.power.level.immediate.offset()`` method ``RsSmw.source.power.start()`` method ``RsSmw.source.power.stop()`` Range: Minimum level to maximum level , Unit: dBm
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:STOP?')
return Conversions.str_to_float(response)
[docs]
def set_stop(self, stop: float) -> None:
"""
``[SOURce<HW>]:POWer:STOP`` \n
Snippet: ``driver.source.power.set_stop(stop = 1.0)`` \n
Sets the RF start/stop level in sweep mode.
:param stop: float Sets the setting range calculated as follows: (Level_min + OFFSet) to (Level_max + OFFSet) Where the values are set with the commands: method ``RsSmw.source.power.level.immediate.offset()`` method ``RsSmw.source.power.start()`` method ``RsSmw.source.power.stop()`` Range: Minimum level to maximum level , Unit: dBm
"""
param = Conversions.decimal_value_to_str(stop)
self._core.io.write(f'SOURce<HwInstance>:POWer:STOP {param}')
[docs]
def get_wignore(self) -> bool:
"""
``[SOURce]:POWer:WIGNore`` \n
Snippet: ``value: bool = driver.source.power.get_wignore()`` \n
Ignores level range warnings.
:return: state: 1 | ON | 0| OFF
"""
response = self._core.io.query_str('SOURce:POWer:WIGNore?')
return Conversions.str_to_bool(response)
[docs]
def set_wignore(self, state: bool) -> None:
"""
``[SOURce]:POWer:WIGNore`` \n
Snippet: ``driver.source.power.set_wignore(state = False)`` \n
Ignores level range warnings.
:param state: 1 | ON | 0| OFF
"""
param = Conversions.bool_to_str(state)
self._core.io.write(f'SOURce:POWer:WIGNore {param}')
def clone(self) -> 'PowerCls':
"""
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 = PowerCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group