Source code for rsrtx.Implementations.Measurement.Spectrum.Arithmetic.Operator

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class OperatorCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, arith_operator: enums.MeasArithmOperator, measurement=repcap.Measurement.Default) -> None: """ ``MEASurement<*>:SPECtrum:ARIThmetic:OPERator`` \n Snippet: ``driver.measurement.spectrum.arithmetic.operator.set(arith_operator = enums.MeasArithmOperator.ABS, measurement = repcap.Measurement.Default)`` \n Selects the operation type to be performed on the selected operands for the spectrum arithmetic measurement. :param arith_operator: ADD | SUB | MUL | DIV :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') """ param = Conversions.enum_scalar_to_str(arith_operator, enums.MeasArithmOperator) measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement) self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:SPECtrum:ARIThmetic:OPERator {param}')
# noinspection PyTypeChecker
[docs] def get(self, measurement=repcap.Measurement.Default) -> enums.MeasArithmOperator: """ ``MEASurement<*>:SPECtrum:ARIThmetic:OPERator`` \n Snippet: ``value: enums.MeasArithmOperator = driver.measurement.spectrum.arithmetic.operator.get(measurement = repcap.Measurement.Default)`` \n Selects the operation type to be performed on the selected operands for the spectrum arithmetic measurement. :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') :return: arith_operator: ADD | SUB | MUL | DIV """ measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement) response = self._core.io.query_str_with_opc(f'MEASurement{measurement_cmd_val}:SPECtrum:ARIThmetic:OPERator?') return Conversions.str_to_scalar_enum(response, enums.MeasArithmOperator)