Source code for RsSmw.Implementations.Source.Sweep.Power

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: 10
	| Subgroups: 3
	| Direct child commands: 7
	"""

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

	@property
	def execute(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_execute'):
			from .Execute import ExecuteCls
			self._execute = ExecuteCls(self._core, self._cmd_group)
		return self._execute

	@property
	def spacing(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_spacing'):
			from .Spacing import SpacingCls
			self._spacing = SpacingCls(self._core, self._cmd_group)
		return self._spacing

	@property
	def step(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_step'):
			from .Step import StepCls
			self._step = StepCls(self._core, self._cmd_group)
		return self._step

	# noinspection PyTypeChecker
[docs] def get_amode(self) -> enums.PowerAttMode: """ ``[SOURce<HW>]:SWEep:POWer:AMODe`` \n Snippet: ``value: enums.PowerAttMode = driver.source.sweep.power.get_amode()`` \n Selects the power attenuator mode for the level sweep. :return: amode: NORMal | HPOWer NORMal Performs the level settings in the range of the built-in attenuator. HPOWer Performs the level settings in the high level range. """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:AMODe?') return Conversions.str_to_scalar_enum(response, enums.PowerAttMode)
[docs] def set_amode(self, amode: enums.PowerAttMode) -> None: """ ``[SOURce<HW>]:SWEep:POWer:AMODe`` \n Snippet: ``driver.source.sweep.power.set_amode(amode = enums.PowerAttMode.AUTO)`` \n Selects the power attenuator mode for the level sweep. :param amode: NORMal | HPOWer NORMal Performs the level settings in the range of the built-in attenuator. HPOWer Performs the level settings in the high level range. """ param = Conversions.enum_scalar_to_str(amode, enums.PowerAttMode) self._core.io.write(f'SOURce<HwInstance>:SWEep:POWer:AMODe {param}')
[docs] def get_dwell(self) -> float: """ ``[SOURce<HW>]:SWEep:POWer:DWELl`` \n Snippet: ``value: float = driver.source.sweep.power.get_dwell()`` \n Sets the dwell time for a level sweep step. :return: dwell: float Range: 0.001 to 100 """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:DWELl?') return Conversions.str_to_float(response)
[docs] def set_dwell(self, dwell: float) -> None: """ ``[SOURce<HW>]:SWEep:POWer:DWELl`` \n Snippet: ``driver.source.sweep.power.set_dwell(dwell = 1.0)`` \n Sets the dwell time for a level sweep step. :param dwell: float Range: 0.001 to 100 """ param = Conversions.decimal_value_to_str(dwell) self._core.io.write(f'SOURce<HwInstance>:SWEep:POWer:DWELl {param}')
# noinspection PyTypeChecker
[docs] def get_mode(self) -> enums.AutoManStep: """ ``[SOURce<HW>]:SWEep:POWer:MODE`` \n Snippet: ``value: enums.AutoManStep = driver.source.sweep.power.get_mode()`` \n Sets the cycle mode for the level sweep. :return: mode: AUTO | MANual | STEP AUTO Each trigger triggers exactly one complete sweep. MANual The trigger system is not active. You can trigger every step individually with the method ``RsSmw.source.power.manual()`` . The level value increases at each step by the value that you define with method ``RsSmw.source.power.step.increment()`` . Values directly entered with the method ``RsSmw.source.power.manual()`` are not taken into account. STEP Each trigger triggers one sweep step only. The level increases by the value entered with method ``RsSmw.source.power.step.increment()`` . """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:MODE?') return Conversions.str_to_scalar_enum(response, enums.AutoManStep)
[docs] def set_mode(self, mode: enums.AutoManStep) -> None: """ ``[SOURce<HW>]:SWEep:POWer:MODE`` \n Snippet: ``driver.source.sweep.power.set_mode(mode = enums.AutoManStep.AUTO)`` \n Sets the cycle mode for the level sweep. :param mode: AUTO | MANual | STEP AUTO Each trigger triggers exactly one complete sweep. MANual The trigger system is not active. You can trigger every step individually with the method ``RsSmw.source.power.manual()`` . The level value increases at each step by the value that you define with method ``RsSmw.source.power.step.increment()`` . Values directly entered with the method ``RsSmw.source.power.manual()`` are not taken into account. STEP Each trigger triggers one sweep step only. The level increases by the value entered with method ``RsSmw.source.power.step.increment()`` . """ param = Conversions.enum_scalar_to_str(mode, enums.AutoManStep) self._core.io.write(f'SOURce<HwInstance>:SWEep:POWer:MODE {param}')
[docs] def get_points(self) -> int: """ ``[SOURce<HW>]:SWEep:POWer:POINts`` \n Snippet: ``value: int = driver.source.sweep.power.get_points()`` \n Sets the number of steps within the RF level sweep range. :return: points: integer Range: 2 to Max """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:POINts?') return Conversions.str_to_int(response)
[docs] def set_points(self, points: int) -> None: """ ``[SOURce<HW>]:SWEep:POWer:POINts`` \n Snippet: ``driver.source.sweep.power.set_points(points = 1)`` \n Sets the number of steps within the RF level sweep range. :param points: integer Range: 2 to Max """ param = Conversions.decimal_value_to_str(points) self._core.io.write(f'SOURce<HwInstance>:SWEep:POWer:POINts {param}')
[docs] def get_retrace(self) -> bool: """ ``[SOURce<HW>]:SWEep:POWer:RETRace`` \n Snippet: ``value: bool = driver.source.sweep.power.get_retrace()`` \n Activates that the signal changes to the start frequency value while it is waiting for the next trigger event. You can enable this feature, when you are working with sawtooth shapes in sweep mode 'Single' or 'External Single'. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:RETRace?') return Conversions.str_to_bool(response)
[docs] def set_retrace(self, state: bool) -> None: """ ``[SOURce<HW>]:SWEep:POWer:RETRace`` \n Snippet: ``driver.source.sweep.power.set_retrace(state = False)`` \n Activates that the signal changes to the start frequency value while it is waiting for the next trigger event. You can enable this feature, when you are working with sawtooth shapes in sweep mode 'Single' or 'External Single'. :param state: 1 | ON | 0| OFF """ param = Conversions.bool_to_str(state) self._core.io.write(f'SOURce<HwInstance>:SWEep:POWer:RETRace {param}')
[docs] def get_running(self) -> bool: """ ``[SOURce<HW>]:SWEep:POWer:RUNNing`` \n Snippet: ``value: bool = driver.source.sweep.power.get_running()`` \n Queries the current sweep state. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:RUNNing?') return Conversions.str_to_bool(response)
# noinspection PyTypeChecker
[docs] def get_shape(self) -> enums.SweCyclMode: """ ``[SOURce<HW>]:SWEep:POWer:SHAPe`` \n Snippet: ``value: enums.SweCyclMode = driver.source.sweep.power.get_shape()`` \n Determines the waveform shape for a frequency sweep sequence. :return: shape: SAWTooth | TRIangle """ response = self._core.io.query_str('SOURce<HwInstance>:SWEep:POWer:SHAPe?') return Conversions.str_to_scalar_enum(response, enums.SweCyclMode)
[docs] def set_shape(self, shape: enums.SweCyclMode) -> None: """ ``[SOURce<HW>]:SWEep:POWer:SHAPe`` \n Snippet: ``driver.source.sweep.power.set_shape(shape = enums.SweCyclMode.SAWTooth)`` \n Determines the waveform shape for a frequency sweep sequence. :param shape: SAWTooth | TRIangle """ param = Conversions.enum_scalar_to_str(shape, enums.SweCyclMode) self._core.io.write(f'SOURce<HwInstance>:SWEep:POWer:SHAPe {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