Source code for rsrtx.Implementations.Search.Trigger.I2C.AddOr

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
from ......Internal.RepeatedCapability import RepeatedCapability
from ...... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AddOrCls:
	"""
	| Commands in total: 5
	| Subgroups: 4
	| Direct child commands: 1

	Repeated Capability Setting:
	
	.. code-block:: python
	
			# Range: Nr1 .. Nr4 \n
			driver.search.trigger.i2C.addOr.repcap_triggerI2cAddo_set(repcap.TriggerI2cAddo.Nr1)
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("addOr", core, parent)
		self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_triggerI2cAddo_get', 'repcap_triggerI2cAddo_set', repcap.TriggerI2cAddo.Nr1)

	def repcap_triggerI2cAddo_set(self, triggerI2cAddo: repcap.TriggerI2cAddo) -> None:
		"""
		Repeated Capability default value numeric suffix.
		This value is used, if you do not explicitely set it in the child set/get methods, or if you leave it to TriggerI2cAddo.Default.
		Default value after init: TriggerI2cAddo.Nr1
		"""
		self._cmd_group.set_repcap_enum_value(triggerI2cAddo)

	def repcap_triggerI2cAddo_get(self) -> repcap.TriggerI2cAddo:
		"""
		Returns the current default repeated capability for the child set/get methods.
		"""
		# noinspection PyTypeChecker
		return self._cmd_group.get_repcap_enum_value()

	@property
	def enable(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_enable'):
			from .Enable import EnableCls
			self._enable = EnableCls(self._core, self._cmd_group)
		return self._enable

	@property
	def value(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_value'):
			from .Value import ValueCls
			self._value = ValueCls(self._core, self._cmd_group)
		return self._value

	@property
	def adrType(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_adrType'):
			from .AdrType import AdrTypeCls
			self._adrType = AdrTypeCls(self._core, self._cmd_group)
		return self._adrType

	@property
	def rwbIt(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_rwbIt'):
			from .RwbIt import RwbItCls
			self._rwbIt = RwbItCls(self._core, self._cmd_group)
		return self._rwbIt

[docs] def set(self, search: str, chk_search_addr_or: bool) -> None: """ ``SEARch:TRIGger:I2C:ADOR`` \n Snippet: ``driver.search.trigger.i2C.addOr.set(search = 'abc', chk_search_addr_or = False)`` \n Enables the search for one to four address conditions. To define the address condition, use the following commands: \n - method ``RsRtx.search.trigger.i2C.addOr.enable.set()`` - method ``RsRtx.search.trigger.i2C.addOr.adrType.set()`` - method ``RsRtx.search.trigger.i2C.addOr.value.set()`` - method ``RsRtx.search.trigger.i2C.addOr.rwbIt.set()`` """ param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('chk_search_addr_or', chk_search_addr_or, DataType.Boolean)) self._core.io.write(f'SEARch:TRIGger:I2C:ADOR {param}'.rstrip())
[docs] def get(self, search: str) -> bool: """ ``SEARch:TRIGger:I2C:ADOR`` \n Snippet: ``value: bool = driver.search.trigger.i2C.addOr.get(search = 'abc')`` \n Enables the search for one to four address conditions. To define the address condition, use the following commands: \n - method ``RsRtx.search.trigger.i2C.addOr.enable.set()`` - method ``RsRtx.search.trigger.i2C.addOr.adrType.set()`` - method ``RsRtx.search.trigger.i2C.addOr.value.set()`` - method ``RsRtx.search.trigger.i2C.addOr.rwbIt.set()`` :param search: OFF | ON """ param = Conversions.value_to_quoted_str(search) response = self._core.io.query_str(f'SEARch:TRIGger:I2C:ADOR? {param}') return Conversions.str_to_bool(response)
def clone(self) -> 'AddOrCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = AddOrCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group