Source code for rsrtx.Implementations.Display.Signal.Label

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.StructBase import StructBase
from .....Internal.ArgStruct import ArgStruct
from ..... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class LabelCls:
	"""
	| Commands in total: 12
	| Subgroups: 8
	| Direct child commands: 2
	"""

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

	@property
	def remove(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_remove'):
			from .Remove import RemoveCls
			self._remove = RemoveCls(self._core, self._cmd_group)
		return self._remove

	@property
	def show(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_show'):
			from .Show import ShowCls
			self._show = ShowCls(self._core, self._cmd_group)
		return self._show

	@property
	def idsList(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_idsList'):
			from .IdsList import IdsListCls
			self._idsList = IdsListCls(self._core, self._cmd_group)
		return self._idsList

	@property
	def text(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_text'):
			from .Text import TextCls
			self._text = TextCls(self._core, self._cmd_group)
		return self._text

	@property
	def state(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_state'):
			from .State import StateCls
			self._state = StateCls(self._core, self._cmd_group)
		return self._state

	@property
	def posMode(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_posMode'):
			from .PosMode import PosModeCls
			self._posMode = PosModeCls(self._core, self._cmd_group)
		return self._posMode

	@property
	def horizontal(self):
		"""
		| Commands in total: 2
		| Subgroups: 2
		| Direct child commands: 0
		"""
		if not hasattr(self, '_horizontal'):
			from .Horizontal import HorizontalCls
			self._horizontal = HorizontalCls(self._core, self._cmd_group)
		return self._horizontal

	@property
	def vertical(self):
		"""
		| Commands in total: 2
		| Subgroups: 2
		| Direct child commands: 0
		"""
		if not hasattr(self, '_vertical'):
			from .Vertical import VerticalCls
			self._vertical = VerticalCls(self._core, self._cmd_group)
		return self._vertical

	# noinspection PyTypeChecker
[docs] class AddStruct(StructBase): """ Structure for setting input parameters. Fields: \n - Label_Id: str: String with the label identifier. The LabelID and Source parameters identify each label uniquely, so the label ID must be unique for the given waveform. Note the LabelID because it is not possible to query it, or to read it on the user interface. - Source: enums.SignalSource: Waveform to that the label belongs, see 'Waveform suffix'. - Label_Text: str: String with the label text that is shown on the display - Position_Mode: enums.PositionMode: ABS | REL \n - ABS: Position in time and voltage values, or in other units depending on the waveform character. Absolute positions move with the waveform display when the scales, the vertical position or offset, or the reference point are changed. - REL: Fixed label position in percent of the screen counting from the upper left corner. - Xpositon: int: Horizontal position of the label text. Values, range and unit depend on the position mode, the waveform position and scaling. For relative position mode, the range is 0 to 100 %. - Ypositon: int: Vertical position of the label text. Values, range and unit depend on the position mode, the waveform position and scaling. For relative position mode, the range is 0 to 100 %. """ __meta_args_list = [ ArgStruct.scalar_str('Label_Id'), ArgStruct.scalar_enum('Source', enums.SignalSource), ArgStruct.scalar_str('Label_Text'), ArgStruct.scalar_enum('Position_Mode', enums.PositionMode), ArgStruct.scalar_int('Xpositon'), ArgStruct.scalar_int('Ypositon')] def __init__(self): StructBase.__init__(self, self) self.Label_Id: str=None self.Source: enums.SignalSource=None self.Label_Text: str=None self.Position_Mode: enums.PositionMode=None self.Xpositon: int=None self.Ypositon: int=None
[docs] def set_add(self, value: AddStruct) -> None: """ ``DISPlay:SIGNal:LABel:ADD`` \n Snippet with structure: \n structure = driver.display.signal.label.AddStruct() \n structure.Label_Id: str = 'abc' \n structure.Source: enums.SignalSource = enums.SignalSource.AJ1 \n structure.Label_Text: str = 'abc' \n structure.Position_Mode: enums.PositionMode = enums.PositionMode.ABS \n structure.Xpositon: int = 1 \n structure.Ypositon: int = 1 \n driver.display.signal.label.set_add(value = structure) \n Creates a new waveform label for the specified source waveform. :param value: see the help for AddStruct structure arguments. """ self._core.io.write_struct_with_opc('DISPlay:SIGNal:LABel:ADD', value)
[docs] def get_fontsize(self) -> int: """ ``DISPlay:SIGNal:LABel:FONTsize`` \n Snippet: ``value: int = driver.display.signal.label.get_fontsize()`` \n Sets the font size of waveform labels. """ response = self._core.io.query_str_with_opc('DISPlay:SIGNal:LABel:FONTsize?') return Conversions.str_to_int(response)
[docs] def set_fontsize(self, label_font_size: int) -> None: """ ``DISPlay:SIGNal:LABel:FONTsize`` \n Snippet: ``driver.display.signal.label.set_fontsize(label_font_size = 1)`` \n Sets the font size of waveform labels. :param label_font_size: 7 to 30 """ param = Conversions.decimal_value_to_str(label_font_size) self._core.io.write_with_opc(f'DISPlay:SIGNal:LABel:FONTsize {param}')
def clone(self) -> 'LabelCls': """ 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 = LabelCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group