Source code for rsrtx.Implementations.Search.Trigger.Can.Dlc

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

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

[docs] def set(self, search: str, word_count: int) -> None: """ ``SEARch:TRIGger:CAN:DLC`` \n Snippet: ``driver.search.trigger.can.dlc.set(search = 'abc', word_count = 1)`` \n Sets the Data Length Code, the number of data bytes to be found. For complete definition, set also the operator with method ``RsRtx.search.trigger.can.dlcCondition.set()`` . :param word_count: 1 to 8 """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('word_count', word_count, DataType.Integer)) self._core.io.write(f'SEARch:TRIGger:CAN:DLC {param}'.rstrip())
[docs] def get(self, search: str) -> int: """ ``SEARch:TRIGger:CAN:DLC`` \n Snippet: ``value: int = driver.search.trigger.can.dlc.get(search = 'abc')`` \n Sets the Data Length Code, the number of data bytes to be found. For complete definition, set also the operator with method ``RsRtx.search.trigger.can.dlcCondition.set()`` . :return: word_count: 1 to 8 """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str(f'SEARch:TRIGger:CAN:DLC? {param}') return Conversions.str_to_int(response)