Source code for rsrtx.Implementations.RefLevel.Absolute.Mlevel

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


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

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

[docs] def set(self, value: float, refLevel=repcap.RefLevel.Default) -> None: """ ``REFLevel<*>:ABSolute:MLEVel`` \n Snippet: ``driver.refLevel.absolute.mlevel.set(value = 1.0, refLevel = repcap.RefLevel.Default)`` \n For user signal level selection, the level is the middle level between high and low signal level. The value is adjusted automatically if you change the high or low signal levels. Vice versa, if you change the middle level, the high and low signal levels are adjusted. For user reference level selection, the level is the middle level between upper and lower reference level. The value is adjusted automatically if you change the upper or lower reference levels. Vice versa, if you change the middle level, the upper and lower reference levels are adjusted. :param refLevel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'RefLevel') """ param = Conversions.decimal_value_to_str(value) refLevel_cmd_val = self._cmd_group.get_repcap_cmd_value(refLevel, repcap.RefLevel) self._core.io.write_with_opc(f'REFLevel{refLevel_cmd_val}:ABSolute:MLEVel {param}')
[docs] def get(self, refLevel=repcap.RefLevel.Default) -> float: """ ``REFLevel<*>:ABSolute:MLEVel`` \n Snippet: ``value: float = driver.refLevel.absolute.mlevel.get(refLevel = repcap.RefLevel.Default)`` \n For user signal level selection, the level is the middle level between high and low signal level. The value is adjusted automatically if you change the high or low signal levels. Vice versa, if you change the middle level, the high and low signal levels are adjusted. For user reference level selection, the level is the middle level between upper and lower reference level. The value is adjusted automatically if you change the upper or lower reference levels. Vice versa, if you change the middle level, the upper and lower reference levels are adjusted. :param refLevel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'RefLevel') """ refLevel_cmd_val = self._cmd_group.get_repcap_cmd_value(refLevel, repcap.RefLevel) response = self._core.io.query_str_with_opc(f'REFLevel{refLevel_cmd_val}:ABSolute:MLEVel?') return Conversions.str_to_float(response)