Source code for rsrtx.Implementations.Cursor.Label.X

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.Utilities import trim_str_response
from ....Internal.RepeatedCapability import RepeatedCapability
from .... import repcap


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

	Repeated Capability Setting:
	
	.. code-block:: python
	
			# Range: Nr1 .. Nr2 \n
			driver.cursor.label.x.repcap_xaxis_set(repcap.Xaxis.Nr1)
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("x", core, parent)
		self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_xaxis_get', 'repcap_xaxis_set', repcap.Xaxis.Nr1)

	def repcap_xaxis_set(self, xaxis: repcap.Xaxis) -> 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 Xaxis.Default.
		Default value after init: Xaxis.Nr1
		"""
		self._cmd_group.set_repcap_enum_value(xaxis)

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

[docs] def set(self, name: str, cursor=repcap.Cursor.Default, xaxis=repcap.Xaxis.Default) -> None: """ ``CURSor<*>:LABel:X<*>`` \n Snippet: ``driver.cursor.label.x.set(name = 'abc', cursor = repcap.Cursor.Default, xaxis = repcap.Xaxis.Default)`` \n Defines a label to be displayed with the vertical cursors. X1 is the left cursor line, and X2 the right one. By default, the cursors are labeled as Cu1.X1, Cu1.X2, Cu2.X1, Cu2.X2, Cu3.X1, Cu3.X2, Cu4.X1, Cu4.X2. :param name: String with the cursor label :param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor') :param xaxis: optional repeated capability selector. Default value: Nr1 (settable in the interface 'X') """ param = Conversions.value_to_quoted_str(name) cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor) xaxis_cmd_val = self._cmd_group.get_repcap_cmd_value(xaxis, repcap.Xaxis) self._core.io.write_with_opc(f'CURSor{cursor_cmd_val}:LABel:X{xaxis_cmd_val} {param}')
[docs] def get(self, cursor=repcap.Cursor.Default, xaxis=repcap.Xaxis.Default) -> str: """ ``CURSor<*>:LABel:X<*>`` \n Snippet: ``value: str = driver.cursor.label.x.get(cursor = repcap.Cursor.Default, xaxis = repcap.Xaxis.Default)`` \n Defines a label to be displayed with the vertical cursors. X1 is the left cursor line, and X2 the right one. By default, the cursors are labeled as Cu1.X1, Cu1.X2, Cu2.X1, Cu2.X2, Cu3.X1, Cu3.X2, Cu4.X1, Cu4.X2. :param cursor: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cursor') :param xaxis: optional repeated capability selector. Default value: Nr1 (settable in the interface 'X') :return: name: String with the cursor label """ cursor_cmd_val = self._cmd_group.get_repcap_cmd_value(cursor, repcap.Cursor) xaxis_cmd_val = self._cmd_group.get_repcap_cmd_value(xaxis, repcap.Xaxis) response = self._core.io.query_str_with_opc(f'CURSor{cursor_cmd_val}:LABel:X{xaxis_cmd_val}?') return trim_str_response(response)
def clone(self) -> 'XCls': """ 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 = XCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group