Source code for RsSmw.Implementations.Source.Power.Level.Immediate
from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ImmediateCls:
"""
| Commands in total: 4
| Subgroups: 0
| Direct child commands: 4
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("immediate", core, parent)
[docs]
def get_offset(self) -> float:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:OFFSet`` \n
Snippet: ``value: float = driver.source.power.level.immediate.get_offset()`` \n
Sets the level offset of a downstream instrument. The level at the RF output is not changed. To query the resulting level,
as it is at the output of the downstream instrument, use the command method
``RsSmw.source.power.level.immediate.amplitude()`` . See 'Displayed RF frequency and level values with downstream
instruments'. Note: The level offset also affects the RF level sweep.
:return: offset: float Range: -100 to 100 , Unit: dB Level offset is always expreced in dB; linear units (V, W, etc.) are not supported
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:LEVel:IMMediate:OFFSet?')
return Conversions.str_to_float(response)
[docs]
def set_offset(self, offset: float) -> None:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:OFFSet`` \n
Snippet: ``driver.source.power.level.immediate.set_offset(offset = 1.0)`` \n
Sets the level offset of a downstream instrument. The level at the RF output is not changed. To query the resulting level,
as it is at the output of the downstream instrument, use the command method
``RsSmw.source.power.level.immediate.amplitude()`` . See 'Displayed RF frequency and level values with downstream
instruments'. Note: The level offset also affects the RF level sweep.
:param offset: float Range: -100 to 100 , Unit: dB Level offset is always expreced in dB; linear units (V, W, etc.) are not supported
"""
param = Conversions.decimal_value_to_str(offset)
self._core.io.write(f'SOURce<HwInstance>:POWer:LEVel:IMMediate:OFFSet {param}')
# noinspection PyTypeChecker
[docs]
def get_recall(self) -> enums.InclExcl:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:RCL`` \n
Snippet: ``value: enums.InclExcl = driver.source.power.level.immediate.get_recall()`` \n
Determines whether the current level is retained or if the stored level setting is adopted when an instrument
configuration is loaded. The setting is valid for both paths. If a suffix is specified, it is ignored.
:return: rcl: INCLude | EXCLude INCLude Takes the current level when an instrument configuration is loaded. EXCLude Retains the current level when an instrument configuration is loaded.
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:LEVel:IMMediate:RCL?')
return Conversions.str_to_scalar_enum(response, enums.InclExcl)
[docs]
def set_recall(self, rcl: enums.InclExcl) -> None:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:RCL`` \n
Snippet: ``driver.source.power.level.immediate.set_recall(rcl = enums.InclExcl.EXCLude)`` \n
Determines whether the current level is retained or if the stored level setting is adopted when an instrument
configuration is loaded. The setting is valid for both paths. If a suffix is specified, it is ignored.
:param rcl: INCLude | EXCLude INCLude Takes the current level when an instrument configuration is loaded. EXCLude Retains the current level when an instrument configuration is loaded.
"""
param = Conversions.enum_scalar_to_str(rcl, enums.InclExcl)
self._core.io.write(f'SOURce<HwInstance>:POWer:LEVel:IMMediate:RCL {param}')
[docs]
def get_ref_level(self) -> float:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:REFLevel`` \n
Snippet: ``value: float = driver.source.power.level.immediate.get_ref_level()`` \n
Queries the reference level of the user correction. The reference level is the sum of the amplitude and the level offset,
set with the commands method ``RsSmw.source.power.power()`` method ``RsSmw.source.power.level.immediate.offset()`` .
:return: reference_level: float Range: -245 to 120
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:LEVel:IMMediate:REFLevel?')
return Conversions.str_to_float(response)
[docs]
def set_ref_level(self, reference_level: float) -> None:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:REFLevel`` \n
Snippet: ``driver.source.power.level.immediate.set_ref_level(reference_level = 1.0)`` \n
Queries the reference level of the user correction. The reference level is the sum of the amplitude and the level offset,
set with the commands method ``RsSmw.source.power.power()`` method ``RsSmw.source.power.level.immediate.offset()`` .
:param reference_level: float Range: -245 to 120
"""
param = Conversions.decimal_value_to_str(reference_level)
self._core.io.write(f'SOURce<HwInstance>:POWer:LEVel:IMMediate:REFLevel {param}')
[docs]
def get_amplitude(self) -> float:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:[AMPLitude]`` \n
Snippet: ``value: float = driver.source.power.level.immediate.get_amplitude()`` \n
Sets the RF level applied to the DUT. To activate the RF output use method ``RsSmw.output.state.value()`` ('RF On'/'RF
Off') .
The following applies POWer = RF output level + OFFSet, where: \n
- POWer is the values set with method ``RsSmw.source.power.level.immediate.amplitude()``
- RF output level is set with method ``RsSmw.source.power.power()``
- OFFSet is set with method ``RsSmw.source.power.level.immediate.offset()``
:return: amplitude: float The following settings influence the value range: OFFSet set with the method ``RsSmw.source.power.level.immediate.offset()`` Numerical value Sets the level UP | DOWN Varies the level step by step. The level is increased or decreased by the value set with the method ``RsSmw.source.power.step.increment()`` . Range: (Level_min + OFFSet) to (Level_max + OFFStet) , Unit: dBm
"""
response = self._core.io.query_str('SOURce<HwInstance>:POWer:LEVel:IMMediate:AMPLitude?')
return Conversions.str_to_float(response)
[docs]
def set_amplitude(self, amplitude: float) -> None:
"""
``[SOURce<HW>]:POWer:[LEVel]:[IMMediate]:[AMPLitude]`` \n
Snippet: ``driver.source.power.level.immediate.set_amplitude(amplitude = 1.0)`` \n
Sets the RF level applied to the DUT. To activate the RF output use method ``RsSmw.output.state.value()`` ('RF On'/'RF
Off') .
The following applies POWer = RF output level + OFFSet, where: \n
- POWer is the values set with method ``RsSmw.source.power.level.immediate.amplitude()``
- RF output level is set with method ``RsSmw.source.power.power()``
- OFFSet is set with method ``RsSmw.source.power.level.immediate.offset()``
:param amplitude: float The following settings influence the value range: OFFSet set with the method ``RsSmw.source.power.level.immediate.offset()`` Numerical value Sets the level UP | DOWN Varies the level step by step. The level is increased or decreased by the value set with the method ``RsSmw.source.power.step.increment()`` . Range: (Level_min + OFFSet) to (Level_max + OFFStet) , Unit: dBm
"""
param = Conversions.decimal_value_to_str(amplitude)
self._core.io.write(f'SOURce<HwInstance>:POWer:LEVel:IMMediate:AMPLitude {param}')