Source code for rsrtx.Implementations.Lane.Cmpo

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


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

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

[docs] def set(self, offs_compens: bool, lane=repcap.Lane.Default) -> None: """ ``LANE<*>:CMPO`` \n Snippet: ``driver.lane.cmpo.set(offs_compens = False, lane = repcap.Lane.Default)`` \n Enables the DC offset compensation. If enabled, the application estimates the DC offset of the input signal and removes it prior to training and/or applying equalizers to it. :param offs_compens: OFF | ON :param lane: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Lane') """ param = Conversions.bool_to_str(offs_compens) lane_cmd_val = self._cmd_group.get_repcap_cmd_value(lane, repcap.Lane) self._core.io.write_with_opc(f'LANE{lane_cmd_val}:CMPO {param}')
[docs] def get(self, lane=repcap.Lane.Default) -> bool: """ ``LANE<*>:CMPO`` \n Snippet: ``value: bool = driver.lane.cmpo.get(lane = repcap.Lane.Default)`` \n Enables the DC offset compensation. If enabled, the application estimates the DC offset of the input signal and removes it prior to training and/or applying equalizers to it. :param lane: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Lane') :return: offs_compens: OFF | ON """ lane_cmd_val = self._cmd_group.get_repcap_cmd_value(lane, repcap.Lane) response = self._core.io.query_str_with_opc(f'LANE{lane_cmd_val}:CMPO?') return Conversions.str_to_bool(response)