Source code for rsrtx.Implementations.Probe.Setup.Optical.WavLength

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

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

[docs] def set(self, wavelength: enums.ProbeOpticalWavelength, probe=repcap.Probe.Default) -> None: """ ``PROBe<*>:SETup:OPTical:WAVLength`` \n Snippet: ``driver.probe.setup.optical.wavLength.set(wavelength = enums.ProbeOpticalWavelength.CUSTOM, probe = repcap.Probe.Default)`` \n Sets the wavelength of the optical signal. The setting is relevant for optic receivers and probes. :param wavelength: NM800 | NM1300 | NM1550 | CUSTOM \n - NM800 | NM1300 | NM1550: Predefined wavelength. To query the corresponding conversion gain, use PROBech:SETup:OPTical:CONGain. - CUSTOM: Set the required conversion gain with PROBech:SETup:OPTical:CONGain. :param probe: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Probe') """ param = Conversions.enum_scalar_to_str(wavelength, enums.ProbeOpticalWavelength) probe_cmd_val = self._cmd_group.get_repcap_cmd_value(probe, repcap.Probe) self._core.io.write_with_opc(f'PROBe{probe_cmd_val}:SETup:OPTical:WAVLength {param}')
# noinspection PyTypeChecker
[docs] def get(self, probe=repcap.Probe.Default) -> enums.ProbeOpticalWavelength: """ ``PROBe<*>:SETup:OPTical:WAVLength`` \n Snippet: ``value: enums.ProbeOpticalWavelength = driver.probe.setup.optical.wavLength.get(probe = repcap.Probe.Default)`` \n Sets the wavelength of the optical signal. The setting is relevant for optic receivers and probes. :param probe: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Probe') :return: wavelength: NM800 | NM1300 | NM1550 | CUSTOM \n - NM800 | NM1300 | NM1550: Predefined wavelength. To query the corresponding conversion gain, use PROBech:SETup:OPTical:CONGain. - CUSTOM: Set the required conversion gain with PROBech:SETup:OPTical:CONGain. """ probe_cmd_val = self._cmd_group.get_repcap_cmd_value(probe, repcap.Probe) response = self._core.io.query_str_with_opc(f'PROBe{probe_cmd_val}:SETup:OPTical:WAVLength?') return Conversions.str_to_scalar_enum(response, enums.ProbeOpticalWavelength)