Source code for rsrtx.Implementations.Calculate.Math.EnvSelection

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 EnvSelectionCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, envelope_curve: enums.EnvelopeCurve, math=repcap.Math.Default) -> None: """ ``CALCulate:MATH<*>:ENVSelection`` \n Snippet: ``driver.calculate.math.envSelection.set(envelope_curve = enums.EnvelopeCurve.BOTH, math = repcap.Math.Default)`` \n Selects the upper or lower part of the waveform for mathematic calculation, or a combination of both. The setting is relevant for waveforms with waveform arithmetic mode Envelope or with Peak detect decimation. All mathematic operations - except for derivation - can be applied to envelope waveforms and waveforms with Peak detect decimation. :param envelope_curve: MIN | MAX | BOTH :param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math') """ param = Conversions.enum_scalar_to_str(envelope_curve, enums.EnvelopeCurve) math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math) self._core.io.write_with_opc(f'CALCulate:MATH{math_cmd_val}:ENVSelection {param}')
# noinspection PyTypeChecker
[docs] def get(self, math=repcap.Math.Default) -> enums.EnvelopeCurve: """ ``CALCulate:MATH<*>:ENVSelection`` \n Snippet: ``value: enums.EnvelopeCurve = driver.calculate.math.envSelection.get(math = repcap.Math.Default)`` \n Selects the upper or lower part of the waveform for mathematic calculation, or a combination of both. The setting is relevant for waveforms with waveform arithmetic mode Envelope or with Peak detect decimation. All mathematic operations - except for derivation - can be applied to envelope waveforms and waveforms with Peak detect decimation. :param math: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Math') :return: envelope_curve: MIN | MAX | BOTH """ math_cmd_val = self._cmd_group.get_repcap_cmd_value(math, repcap.Math) response = self._core.io.query_str_with_opc(f'CALCulate:MATH{math_cmd_val}:ENVSelection?') return Conversions.str_to_scalar_enum(response, enums.EnvelopeCurve)