Source code for rsmxo.Implementations.Display.Annotation.Arrow.Value

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal.Types import DataType
from .....Internal.StructBase import StructBase
from .....Internal.ArgStruct import ArgStruct
from .....Internal.ArgSingleList import ArgSingleList
from .....Internal.ArgSingle import ArgSingle
from ..... import repcap


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

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

[docs] def set(self, horizontal_pos: float=None, vertical_pos: float=None, width: float=None, height: float=None, annotation=repcap.Annotation.Default) -> None: """ ``DISPlay:ANNotation:ARRow<*>[:VALue]`` \n Snippet: ``driver.display.annotation.arrow.value.set(horizontal_pos = 1.0, vertical_pos = 1.0, width = 1.0, height = 1.0, annotation = repcap.Annotation.Default)`` \n Adds a new arrow annotation, or replaces the annotation if it already exists. If no parameters are defined, the default values are used. All parameters are given in % of the screen. :param horizontal_pos: 0 to 99 :param vertical_pos: 0 to 99 :param width: 0 to 100 :param height: 0 to 100 :param annotation: optional repeated capability selector. Default value: Ix1 (settable in the interface 'Annotation') """ param = ArgSingleList().compose_cmd_string(ArgSingle('horizontal_pos', horizontal_pos, DataType.Float, None, is_optional=True), ArgSingle('vertical_pos', vertical_pos, DataType.Float, None, is_optional=True), ArgSingle('width', width, DataType.Float, None, is_optional=True), ArgSingle('height', height, DataType.Float, None, is_optional=True)) annotation_cmd_val = self._cmd_group.get_repcap_cmd_value(annotation, repcap.Annotation) self._core.io.write(f'DISPlay:ANNotation:ARRow{annotation_cmd_val}:VALue {param}'.rstrip())
# noinspection PyTypeChecker
[docs] class ValueStruct(StructBase): """ Response structure. Fields: \n - 1 Horizontal_Pos: float: 0 to 99 - 2 Vertical_Pos: float: 0 to 99 - 3 Width: float: 0 to 100 - 4 Height: float: 0 to 100 """ __meta_args_list = [ ArgStruct.scalar_float('Horizontal_Pos'), ArgStruct.scalar_float('Vertical_Pos'), ArgStruct.scalar_float('Width'), ArgStruct.scalar_float('Height')] def __init__(self): StructBase.__init__(self, self) self.Horizontal_Pos: float = None self.Vertical_Pos: float = None self.Width: float = None self.Height: float = None
[docs] def get(self, annotation=repcap.Annotation.Default) -> ValueStruct: """ ``DISPlay:ANNotation:ARRow<*>[:VALue]`` \n Snippet: ``value: ValueStruct = driver.display.annotation.arrow.value.get(annotation = repcap.Annotation.Default)`` \n Adds a new arrow annotation, or replaces the annotation if it already exists. If no parameters are defined, the default values are used. All parameters are given in % of the screen. :param annotation: optional repeated capability selector. Default value: Ix1 (settable in the interface 'Annotation') :return: structure: for return value, see the help for ValueStruct structure arguments. """ annotation_cmd_val = self._cmd_group.get_repcap_cmd_value(annotation, repcap.Annotation) return self._core.io.query_struct(f'DISPlay:ANNotation:ARRow{annotation_cmd_val}:VALue?', self.__class__.ValueStruct())