Source code for RsSmw.Implementations.Source.Bb.Pramp.Ramp

from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class RampCls:
	"""
	| Commands in total: 21
	| Subgroups: 5
	| Direct child commands: 10
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("ramp", core, parent)

	@property
	def blank(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_blank'):
			from .Blank import BlankCls
			self._blank = BlankCls(self._core, self._cmd_group)
		return self._blank

	@property
	def fall(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_fall'):
			from .Fall import FallCls
			self._fall = FallCls(self._core, self._cmd_group)
		return self._fall

	@property
	def preSweep(self):
		"""
		| Commands in total: 3
		| Subgroups: 0
		| Direct child commands: 3
		"""
		if not hasattr(self, '_preSweep'):
			from .PreSweep import PreSweepCls
			self._preSweep = PreSweepCls(self._core, self._cmd_group)
		return self._preSweep

	@property
	def stair(self):
		"""
		| Commands in total: 4
		| Subgroups: 2
		| Direct child commands: 0
		"""
		if not hasattr(self, '_stair'):
			from .Stair import StairCls
			self._stair = StairCls(self._core, self._cmd_group)
		return self._stair

	@property
	def sweep(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_sweep'):
			from .Sweep import SweepCls
			self._sweep = SweepCls(self._core, self._cmd_group)
		return self._sweep

[docs] def get_attenuation(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:ATTenuation`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_attenuation()`` \n Sets the attenuation in constant power sweep mode. :return: const_atten: float Range: 0.01 to 60 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:ATTenuation?') return Conversions.str_to_float(response)
[docs] def set_attenuation(self, const_atten: float) -> None: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:ATTenuation`` \n Snippet: ``driver.source.bb.pramp.ramp.set_attenuation(const_atten = 1.0)`` \n Sets the attenuation in constant power sweep mode. :param const_atten: float Range: 0.01 to 60 """ param = Conversions.decimal_value_to_str(const_atten) self._core.io.write(f'SOURce<HwInstance>:BB:PRAMp:RAMP:ATTenuation {param}')
[docs] def get_constmode(self) -> bool: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:CONStmode`` \n Snippet: ``value: bool = driver.source.bb.pramp.ramp.get_constmode()`` \n Enables power constant mode. :return: constmode: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:CONStmode?') return Conversions.str_to_bool(response)
[docs] def set_constmode(self, constmode: bool) -> None: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:CONStmode`` \n Snippet: ``driver.source.bb.pramp.ramp.set_constmode(constmode = False)`` \n Enables power constant mode. :param constmode: 1 | ON | 0| OFF """ param = Conversions.bool_to_str(constmode) self._core.io.write(f'SOURce<HwInstance>:BB:PRAMp:RAMP:CONStmode {param}')
[docs] def get_level(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:LEVel`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_level()`` \n Queries the resulting constant power value of the power sweep. :return: const_level: float Range: -145 to 30 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:LEVel?') return Conversions.str_to_float(response)
[docs] def get_range(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:RANGe`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_range()`` \n Sets the power sweep range. :return: range_py: float Range: 0.01 to 50, Unit: dB """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:RANGe?') return Conversions.str_to_float(response)
[docs] def set_range(self, range_py: float) -> None: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:RANGe`` \n Snippet: ``driver.source.bb.pramp.ramp.set_range(range_py = 1.0)`` \n Sets the power sweep range. :param range_py: float Range: 0.01 to 50, Unit: dB """ param = Conversions.decimal_value_to_str(range_py) self._core.io.write(f'SOURce<HwInstance>:BB:PRAMp:RAMP:RANGe {param}')
[docs] def get_resolution(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:RESolution`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_resolution()`` \n Queries the resolution of the power steps. :return: power_resolution: float Range: 0 to 60 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:RESolution?') return Conversions.str_to_float(response)
[docs] def get_sample_rate(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:SAMPlerate`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_sample_rate()`` \n Queries the calculated sample rate. :return: sample_rate: float Range: 0 to 20 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:SAMPlerate?') return Conversions.str_to_float(response)
# noinspection PyTypeChecker
[docs] def get_shape(self) -> enums.PowerRampShape: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:SHAPe`` \n Snippet: ``value: enums.PowerRampShape = driver.source.bb.pramp.ramp.get_shape()`` \n Selects the power sweep shape. :return: shape: LINear | STAir | TRIangle LINear The sweep curve resembles a sawtooth. STAir The sweep curve resembles a stair step with definable 'Dwell time' or 'Power step', see method ``RsSmw.source.bb.pramp.ramp.stair.dwell.time()`` and method ``RsSmw.source.bb.pramp.ramp.stair.step.level()`` . TRIangle The sweep curve resembles a triangle. """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:SHAPe?') return Conversions.str_to_scalar_enum(response, enums.PowerRampShape)
[docs] def set_shape(self, shape: enums.PowerRampShape) -> None: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:SHAPe`` \n Snippet: ``driver.source.bb.pramp.ramp.set_shape(shape = enums.PowerRampShape.LINear)`` \n Selects the power sweep shape. :param shape: LINear | STAir | TRIangle LINear The sweep curve resembles a sawtooth. STAir The sweep curve resembles a stair step with definable 'Dwell time' or 'Power step', see method ``RsSmw.source.bb.pramp.ramp.stair.dwell.time()`` and method ``RsSmw.source.bb.pramp.ramp.stair.step.level()`` . TRIangle The sweep curve resembles a triangle. """ param = Conversions.enum_scalar_to_str(shape, enums.PowerRampShape) self._core.io.write(f'SOURce<HwInstance>:BB:PRAMp:RAMP:SHAPe {param}')
# noinspection PyTypeChecker
[docs] def get_slope(self) -> enums.PowerRampSlope: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:SLOPe`` \n Snippet: ``value: enums.PowerRampSlope = driver.source.bb.pramp.ramp.get_slope()`` \n Sets the slope direction (increasing or decreasing) . :return: slope: ASCending | DESCending """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:SLOPe?') return Conversions.str_to_scalar_enum(response, enums.PowerRampSlope)
[docs] def set_slope(self, slope: enums.PowerRampSlope) -> None: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:SLOPe`` \n Snippet: ``driver.source.bb.pramp.ramp.set_slope(slope = enums.PowerRampSlope.ASCending)`` \n Sets the slope direction (increasing or decreasing) . :param slope: ASCending | DESCending """ param = Conversions.enum_scalar_to_str(slope, enums.PowerRampSlope) self._core.io.write(f'SOURce<HwInstance>:BB:PRAMp:RAMP:SLOPe {param}')
[docs] def get_start_level(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:STARtlevel`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_start_level()`` \n Queries the start or end power values of the active measurement. :return: start_level: float Range: -145 to 30 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:STARtlevel?') return Conversions.str_to_float(response)
[docs] def get_stop_level(self) -> float: """ ``[SOURce<HW>]:BB:PRAMp:RAMP:STOPlevel`` \n Snippet: ``value: float = driver.source.bb.pramp.ramp.get_stop_level()`` \n Queries the start or end power values of the active measurement. :return: stop_level: float Range: -145 to 30 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:PRAMp:RAMP:STOPlevel?') return Conversions.str_to_float(response)
def clone(self) -> 'RampCls': """ 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 = RampCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group