Source code for RsSmw.Implementations.Source.LfOutput.Sweep.Frequency

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class FrequencyCls:
	"""
	| Commands in total: 10
	| Subgroups: 2
	| Direct child commands: 7
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("frequency", 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 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_dwell(self) -> float: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:DWELl`` \n Snippet: ``value: float = driver.source.lfOutput.sweep.frequency.get_dwell()`` \n Sets the dwell time for each frequency step of the sweep. :return: dwell: float Range: 0.001 to 100, Unit: s """ response = self._core.io.query_str('SOURce<HwInstance>:LFOutput:SWEep:FREQuency:DWELl?') return Conversions.str_to_float(response)
[docs] def set_dwell(self, dwell: float) -> None: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:DWELl`` \n Snippet: ``driver.source.lfOutput.sweep.frequency.set_dwell(dwell = 1.0)`` \n Sets the dwell time for each frequency step of the sweep. :param dwell: float Range: 0.001 to 100, Unit: s """ param = Conversions.decimal_value_to_str(dwell) self._core.io.write(f'SOURce<HwInstance>:LFOutput:SWEep:FREQuency:DWELl {param}')
# noinspection PyTypeChecker
[docs] def get_mode(self) -> enums.AutoManStep: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:MODE`` \n Snippet: ``value: enums.AutoManStep = driver.source.lfOutput.sweep.frequency.get_mode()`` \n Sets the cycle mode of the LF sweep. :return: mode: AUTO | MANual | STEP AUTO Performs a complete sweep cycle from the start to the end value when a trigger event occurs. The dwell time determines the time period until the signal switches to the next step. MANual Performs a single sweep step when a manual trigger event occurs. The trigger system is not active. To trigger each frequency step of the sweep individually, use the command method ``RsSmw.source.lfOutput.frequency.manual()`` . STEP Each trigger command triggers one sweep step only. The frequency increases by the value set with the coammnds: method ``RsSmw.source.lfOutput.sweep.frequency.step.linear()`` (linear spacing) method ``RsSmw.source.lfOutput.sweep.frequency.step.logarithmic()`` (logarithmic spacing) """ response = self._core.io.query_str('SOURce<HwInstance>:LFOutput:SWEep:FREQuency:MODE?') return Conversions.str_to_scalar_enum(response, enums.AutoManStep)
[docs] def set_mode(self, mode: enums.AutoManStep) -> None: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:MODE`` \n Snippet: ``driver.source.lfOutput.sweep.frequency.set_mode(mode = enums.AutoManStep.AUTO)`` \n Sets the cycle mode of the LF sweep. :param mode: AUTO | MANual | STEP AUTO Performs a complete sweep cycle from the start to the end value when a trigger event occurs. The dwell time determines the time period until the signal switches to the next step. MANual Performs a single sweep step when a manual trigger event occurs. The trigger system is not active. To trigger each frequency step of the sweep individually, use the command method ``RsSmw.source.lfOutput.frequency.manual()`` . STEP Each trigger command triggers one sweep step only. The frequency increases by the value set with the coammnds: method ``RsSmw.source.lfOutput.sweep.frequency.step.linear()`` (linear spacing) method ``RsSmw.source.lfOutput.sweep.frequency.step.logarithmic()`` (logarithmic spacing) """ param = Conversions.enum_scalar_to_str(mode, enums.AutoManStep) self._core.io.write(f'SOURce<HwInstance>:LFOutput:SWEep:FREQuency:MODE {param}')
[docs] def get_points(self) -> int: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:POINts`` \n Snippet: ``value: int = driver.source.lfOutput.sweep.frequency.get_points()`` \n Sets the number of steps in an LF sweep. For information on how the value is calculated and the interdependency with other parameters, see 'Correlating parameters in sweep mode' :return: points: integer Range: 2 to POINts """ response = self._core.io.query_str('SOURce<HwInstance>:LFOutput:SWEep:FREQuency:POINts?') return Conversions.str_to_int(response)
[docs] def set_points(self, points: int) -> None: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:POINts`` \n Snippet: ``driver.source.lfOutput.sweep.frequency.set_points(points = 1)`` \n Sets the number of steps in an LF sweep. For information on how the value is calculated and the interdependency with other parameters, see 'Correlating parameters in sweep mode' :param points: integer Range: 2 to POINts """ param = Conversions.decimal_value_to_str(points) self._core.io.write(f'SOURce<HwInstance>:LFOutput:SWEep:FREQuency:POINts {param}')
[docs] def get_retrace(self) -> bool: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:RETRace`` \n Snippet: ``value: bool = driver.source.lfOutput.sweep.frequency.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>:LFOutput:SWEep:FREQuency:RETRace?') return Conversions.str_to_bool(response)
[docs] def set_retrace(self, state: bool) -> None: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:RETRace`` \n Snippet: ``driver.source.lfOutput.sweep.frequency.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>:LFOutput:SWEep:FREQuency:RETRace {param}')
[docs] def get_running(self) -> bool: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:RUNNing`` \n Snippet: ``value: bool = driver.source.lfOutput.sweep.frequency.get_running()`` \n Queries the current status of the LF frequency sweep mode. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:LFOutput:SWEep:FREQuency:RUNNing?') return Conversions.str_to_bool(response)
# noinspection PyTypeChecker
[docs] def get_shape(self) -> enums.SweCyclMode: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:SHAPe`` \n Snippet: ``value: enums.SweCyclMode = driver.source.lfOutput.sweep.frequency.get_shape()`` \n Sets the cycle mode for a sweep sequence (shape) . :return: shape: SAWTooth | TRIangle """ response = self._core.io.query_str('SOURce<HwInstance>:LFOutput:SWEep:FREQuency:SHAPe?') return Conversions.str_to_scalar_enum(response, enums.SweCyclMode)
[docs] def set_shape(self, shape: enums.SweCyclMode) -> None: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:SHAPe`` \n Snippet: ``driver.source.lfOutput.sweep.frequency.set_shape(shape = enums.SweCyclMode.SAWTooth)`` \n Sets the cycle mode for a sweep sequence (shape) . :param shape: SAWTooth | TRIangle """ param = Conversions.enum_scalar_to_str(shape, enums.SweCyclMode) self._core.io.write(f'SOURce<HwInstance>:LFOutput:SWEep:FREQuency:SHAPe {param}')
# noinspection PyTypeChecker
[docs] def get_spacing(self) -> enums.Spacing: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:SPACing`` \n Snippet: ``value: enums.Spacing = driver.source.lfOutput.sweep.frequency.get_spacing()`` \n Selects linear or logarithmic sweep spacing. :return: spacing: LINear | LOGarithmic """ response = self._core.io.query_str('SOURce<HwInstance>:LFOutput:SWEep:FREQuency:SPACing?') return Conversions.str_to_scalar_enum(response, enums.Spacing)
[docs] def set_spacing(self, spacing: enums.Spacing) -> None: """ ``[SOURce<HW>]:LFOutput:SWEep:[FREQuency]:SPACing`` \n Snippet: ``driver.source.lfOutput.sweep.frequency.set_spacing(spacing = enums.Spacing.LINear)`` \n Selects linear or logarithmic sweep spacing. :param spacing: LINear | LOGarithmic """ param = Conversions.enum_scalar_to_str(spacing, enums.Spacing) self._core.io.write(f'SOURce<HwInstance>:LFOutput:SWEep:FREQuency:SPACing {param}')
def clone(self) -> 'FrequencyCls': """ 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 = FrequencyCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group