Source code for rsrtx.Implementations.Power.Spectrum

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class SpectrumCls:
	"""
	| Commands in total: 7
	| Subgroups: 3
	| Direct child commands: 3
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("spectrum", 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 report(self):
		"""
		| Commands in total: 1
		| Subgroups: 1
		| Direct child commands: 0
		"""
		if not hasattr(self, '_report'):
			from .Report import ReportCls
			self._report = ReportCls(self._core, self._cmd_group)
		return self._report

	@property
	def result(self):
		"""
		| Commands in total: 2
		| Subgroups: 2
		| Direct child commands: 0
		"""
		if not hasattr(self, '_result'):
			from .Result import ResultCls
			self._result = ResultCls(self._core, self._cmd_group)
		return self._result

[docs] def get_frequency(self) -> float: """ ``POWer:SPECtrum:FREQuency`` \n Snippet: ``value: float = driver.power.spectrum.get_frequency()`` \n Sets the SMPS switching frequency. :return: smps_frequency: 1 to 100E+6 """ response = self._core.io.query_str('POWer:SPECtrum:FREQuency?') return Conversions.str_to_float(response)
[docs] def set_frequency(self, smps_frequency: float) -> None: """ ``POWer:SPECtrum:FREQuency`` \n Snippet: ``driver.power.spectrum.set_frequency(smps_frequency = 1.0)`` \n Sets the SMPS switching frequency. :param smps_frequency: 1 to 100E+6 """ param = Conversions.decimal_value_to_str(smps_frequency) self._core.io.write(f'POWer:SPECtrum:FREQuency {param}')
# noinspection PyTypeChecker
[docs] def get_auto_scale(self) -> enums.AutoScale: """ ``POWer:SPECtrum:AUToscale`` \n Snippet: ``value: enums.AutoScale = driver.power.spectrum.get_auto_scale()`` \n Selects the scaling for the display of the results. :return: auto_scale: AUTO | MANUAL """ response = self._core.io.query_str('POWer:SPECtrum:AUToscale?') return Conversions.str_to_scalar_enum(response, enums.AutoScale)
[docs] def set_auto_scale(self, auto_scale: enums.AutoScale) -> None: """ ``POWer:SPECtrum:AUToscale`` \n Snippet: ``driver.power.spectrum.set_auto_scale(auto_scale = enums.AutoScale.AUTO)`` \n Selects the scaling for the display of the results. :param auto_scale: AUTO | MANUAL """ param = Conversions.enum_scalar_to_str(auto_scale, enums.AutoScale) self._core.io.write(f'POWer:SPECtrum:AUToscale {param}')
[docs] def get_rcount(self) -> float: """ ``POWer:SPECtrum:RCOunt`` \n Snippet: ``value: float = driver.power.spectrum.get_rcount()`` \n Returns the total number of harmonics. """ response = self._core.io.query_str('POWer:SPECtrum:RCOunt?') return Conversions.str_to_float(response)
def clone(self) -> 'SpectrumCls': """ 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 = SpectrumCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group