Source code for rsrtx.Implementations.Search.Trigger.Mdio.ReGi

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Types import DataType
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle


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

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

[docs] def set(self, search: str, reg_addr: int) -> None: """ ``SEARch:TRIGger:MDIO:REGI`` \n Snippet: ``driver.search.trigger.mdio.reGi.set(search = 'abc', reg_addr = 1)`` \n Allows to set the register address (in Clause 22) or device address (in Clause 45) of the frame pattern (5 bits) ; available only in search criteria type Data. """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('reg_addr', reg_addr, DataType.Integer)) self._core.io.write(f'SEARch:TRIGger:MDIO:REGI {param}'.rstrip())
[docs] def get(self, search: str) -> int: """ ``SEARch:TRIGger:MDIO:REGI`` \n Snippet: ``value: int = driver.search.trigger.mdio.reGi.get(search = 'abc')`` \n Allows to set the register address (in Clause 22) or device address (in Clause 45) of the frame pattern (5 bits) ; available only in search criteria type Data. """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str(f'SEARch:TRIGger:MDIO:REGI? {param}') return Conversions.str_to_int(response)